/* * This file is part of the TYPO3 CMS project. * * It is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, either version 2 * of the License, or any later version. * * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * * The TYPO3 project - inspiring people to share! */ import{property as p,state as f,customElement as b}from"lit/decorators.js";import{LitElement as g,html as a,nothing as u}from"lit";import{classMap as v}from"lit/directives/class-map.js";var d=function(c,t,n,o){var i=arguments.length,e=i<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(c,t,n,o);else for(var r=c.length-1;r>=0;r--)(s=c[r])&&(e=(i<3?s(e):i>3?s(t,n,e):s(t,n))||e);return i>3&&e&&Object.defineProperty(t,n,e),e};let l=class extends g{constructor(){super(...arguments),this.configurationIsWritable=!1,this.data=null,this.addLanguagesActive=!1}createRenderRoot(){return this}render(){return a`

Active languages

${this.renderLanguages()}
${this.globalActions()}
LocaleDependenciesLast update
`}globalActions(){const t={btn:!0,"btn-default":!0,"update-all":!0,disabled:!this.hasActiveLanguages()};return a`${this.configurationIsWritable?a``:u} `}renderLanguageActions(t){const n=[],{iso:o}=t,i={detail:{iso:o}};return t.active?(this.configurationIsWritable&&n.push(a``),n.push(a``)):this.configurationIsWritable&&n.push(a``),n}renderLanguages(){return this.data.languages.filter(t=>this.addLanguagesActive?!t.active:t.active).map(t=>a`
${this.renderLanguageActions(t)}
${t.name}${t.iso}${t.dependencies.join(", ")}${t.lastUpdate===null?"":t.lastUpdate}`)}hasActiveLanguages(){return Array.isArray(this.data.activeLanguages)&&this.data.activeLanguages.length}};d([p({type:Boolean})],l.prototype,"configurationIsWritable",void 0),d([p({type:Object})],l.prototype,"data",void 0),d([f()],l.prototype,"addLanguagesActive",void 0),l=d([b("typo3-install-language-matrix")],l);let h=class extends g{constructor(){super(...arguments),this.data=null}createRenderRoot(){return this}render(){return this.data.extensions.length===0?a``:a`

Translation status

${this.headerActions()}${this.renderExtensions()}
ExtensionKey
`}headerActions(){return this.data.activeLanguages.map(t=>a``)}renderExtensions(){return this.data.extensions.map(t=>a`${t.icon?a`${t.title}`:u} ${t.title}${t.key}${this.renderExtensionActions(t)}`)}renderExtensionActions(t){const n=[];return this.data.activeLanguages.forEach(o=>{let i=u;t.packs.forEach(e=>{if(e.iso!==o)return;let s;e.exists!==!0?e.lastUpdate!==null?s="No language pack available for "+e.iso+" when tried at "+e.lastUpdate+". Click to re-try.":s="Language pack not downloaded. Click to download":e.lastUpdate===null?s="Downloaded. Click to renew":s="Language pack downloaded at "+e.lastUpdate+". Click to renew";const r={detail:{iso:e.iso,extension:t.key}};i=a``}),i===u&&(i=a``),n.push(i)}),n}};d([p({type:Object})],h.prototype,"data",void 0),h=d([b("typo3-install-extension-matrix")],h);export{h as ExtensionMatrixElement,l as LanguageMatrixElement};