@paroicms/list-field-plugin 0.28.18 → 0.28.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1,2 @@
|
|
|
1
|
-
:root{--pcms-list-field-placeholder:
|
|
1
|
+
:root{--pcms-list-field-placeholder:0}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
function ct(n){return typeof n=="object"&&n!==null&&"j"in n}const yt={en:{en:"English",fr:"French",es:"Spanish",de:"German",it:"Italian",pt:"Portuguese"},fr:{en:"Anglais",fr:"Français",es:"Espagnol",de:"Allemand",it:"Italien",pt:"Portugais"},es:{en:"Inglés",fr:"Francés",es:"Español",de:"Alemán",it:"Italiano",pt:"Portugués"},de:{en:"Englisch",fr:"Französisch",es:"Spanisch",de:"Deutsch",it:"Italienisch",pt:"Portugiesisch"},it:{en:"Inglese",fr:"Francese",es:"Spagnolo",de:"Tedesco",it:"Italiano",pt:"Portoghese"},pt:{en:"Inglês",fr:"Francês",es:"Espanhol",de:"Alemão",it:"Italiano",pt:"Português"}},K=Object.keys(yt);function At(n,{pluginLanguages:t,siteLanguages:e=[]}){if(t.includes(n)||K.includes(n)&&t.includes(n))return n;const s=e.find(i=>K.includes(i)&&t.includes(i));return s||(t.includes("en")?"en":t[0]??"en")}const O=globalThis,D=O.ShadowRoot&&(O.ShadyCSS===void 0||O.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,z=Symbol(),J=new WeakMap;let pt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==z)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(D&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=J.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&J.set(e,t))}return t}toString(){return this.cssText}};const bt=n=>new pt(typeof n=="string"?n:n+"",void 0,z),ut=(n,...t)=>{const e=n.length===1?n[0]:t.reduce((s,i,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[r+1],n[0]);return new pt(e,n,z)},Et=(n,t)=>{if(D)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=O.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)}},Z=D?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return bt(e)})(n):n;const{is:xt,defineProperty:St,getOwnPropertyDescriptor:wt,getOwnPropertyNames:Ct,getOwnPropertySymbols:Pt,getPrototypeOf:Ut}=Object,R=globalThis,G=R.trustedTypes,Lt=G?G.emptyScript:"",It=R.reactiveElementPolyfillSupport,L=(n,t)=>n,j={toAttribute(n,t){switch(t){case Boolean:n=n?Lt:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},ft=(n,t)=>!xt(n,t),Q={attribute:!0,type:String,converter:j,reflect:!1,useDefault:!1,hasChanged:ft};Symbol.metadata??=Symbol("metadata"),R.litPropertyMetadata??=new WeakMap;let x=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Q){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&St(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=wt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Q}static _$Ei(){if(this.hasOwnProperty(L("elementProperties")))return;const t=Ut(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(L("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(L("properties"))){const e=this.properties,s=[...Ct(e),...Pt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(Z(i))}else t!==void 0&&e.push(Z(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Et(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:j).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:j;this._$Em=i;const a=o.fromAttribute(e,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(t,e,s,i=!1,r){if(t!==void 0){const o=this.constructor;if(i===!1&&(r=this[t]),s??=o.getPropertyOptions(t),!((s.hasChanged??ft)(r,e)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),r!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[L("elementProperties")]=new Map,x[L("finalized")]=new Map,It?.({ReactiveElement:x}),(R.reactiveElementVersions??=[]).push("2.1.2");const q=globalThis,X=n=>n,T=q.trustedTypes,tt=T?T.createPolicy("lit-html",{createHTML:n=>n}):void 0,$t="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+g,Mt=`<${mt}>`,b=document,I=()=>b.createComment(""),M=n=>n===null||typeof n!="object"&&typeof n!="function",V=Array.isArray,Ht=n=>V(n)||typeof n?.[Symbol.iterator]=="function",B=`[ \t\n\f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,et=/-->/g,st=/>/g,_=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,nt=/"/g,gt=/^(?:script|style|textarea|title)$/i,Ot=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),y=Ot(1),E=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),rt=new WeakMap,A=b.createTreeWalker(b,129);function _t(n,t){if(!V(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return tt!==void 0?tt.createHTML(t):t}const Tt=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"<svg>":t===3?"<math>":"",o=P;for(let a=0;a<e;a++){const l=n[a];let d,u,h=-1,p=0;for(;p<l.length&&(o.lastIndex=p,u=o.exec(l),u!==null);)p=o.lastIndex,o===P?u[1]==="!--"?o=et:u[1]!==void 0?o=st:u[2]!==void 0?(gt.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=_):u[3]!==void 0&&(o=_):o===_?u[0]===">"?(o=i??P,h=-1):u[1]===void 0?h=-2:(h=o.lastIndex-u[2].length,d=u[1],o=u[3]===void 0?_:u[3]==='"'?nt:it):o===nt||o===it?o=_:o===et||o===st?o=P:(o=_,i=void 0);const c=o===_&&n[a+1].startsWith("/>")?" ":"";r+=o===P?l+Mt:h>=0?(s.push(d),l.slice(0,h)+$t+l.slice(h)+g+c):l+g+(h===-2?a:c)}return[_t(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class H{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const a=t.length-1,l=this.parts,[d,u]=Tt(t,e);if(this.el=H.createElement(d,s),A.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=A.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const h of i.getAttributeNames())if(h.endsWith($t)){const p=u[o++],c=i.getAttribute(h).split(g),f=/([.?@])?(.*)/.exec(p);l.push({type:1,index:r,name:f[2],strings:c,ctor:f[1]==="."?kt:f[1]==="?"?Nt:f[1]==="@"?Bt:k}),i.removeAttribute(h)}else h.startsWith(g)&&(l.push({type:6,index:r}),i.removeAttribute(h));if(gt.test(i.tagName)){const h=i.textContent.split(g),p=h.length-1;if(p>0){i.textContent=T?T.emptyScript:"";for(let c=0;c<p;c++)i.append(h[c],I()),A.nextNode(),l.push({type:2,index:++r});i.append(h[p],I())}}}else if(i.nodeType===8)if(i.data===mt)l.push({type:2,index:r});else{let h=-1;for(;(h=i.data.indexOf(g,h+1))!==-1;)l.push({type:7,index:r}),h+=g.length-1}r++}}static createElement(t,e){const s=b.createElement("template");return s.innerHTML=t,s}}function w(n,t,e=n,s){if(t===E)return t;let i=s!==void 0?e._$Co?.[s]:e._$Cl;const r=M(t)?void 0:t._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,e,s)),s!==void 0?(e._$Co??=[])[s]=i:e._$Cl=i),i!==void 0&&(t=w(n,i._$AS(n,t.values),i,s)),t}class Rt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??b).importNode(e,!0);A.currentNode=i;let r=A.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new C(r,r.nextSibling,this,t):l.type===1?d=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(d=new Ft(r,this,t)),this._$AV.push(d),l=s[++a]}o!==l?.index&&(r=A.nextNode(),o++)}return A.currentNode=b,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class C{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=w(this,t,e),M(t)?t===$||t==null||t===""?(this._$AH!==$&&this._$AR(),this._$AH=$):t!==this._$AH&&t!==E&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ht(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==$&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(b.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=H.createElement(_t(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const r=new Rt(i,this),o=r.u(this.options);r.p(e),this.T(o),this._$AH=r}}_$AC(t){let e=rt.get(t.strings);return e===void 0&&rt.set(t.strings,e=new H(t)),e}k(t){V(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new C(this.O(I()),this.O(I()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const s=X(t).nextSibling;X(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=$,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(r===void 0)t=w(this,t,e,0),o=!M(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else{const a=t;let l,d;for(t=r[0],l=0;l<r.length-1;l++)d=w(this,a[s+l],e,l),d===E&&(d=this._$AH[l]),o||=!M(d)||d!==this._$AH[l],d===$?t=$:t!==$&&(t+=(d??"")+r[l+1]),this._$AH[l]=d}o&&!i&&this.j(t)}j(t){t===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class kt extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$?void 0:t}}class Nt extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==$)}}class Bt extends k{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=w(this,t,e,0)??$)===E)return;const s=this._$AH,i=t===$&&s!==$||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==$&&(s===$||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Ft{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){w(this,t)}}const jt={I:C},Dt=q.litHtmlPolyfillSupport;Dt?.(H,C),(q.litHtmlVersions??=[]).push("3.3.2");const zt=(n,t,e)=>{const s=e?.renderBefore??t;let i=s._$litPart$;if(i===void 0){const r=e?.renderBefore??null;s._$litPart$=i=new C(t.insertBefore(I(),r),r,void 0,e??{})}return i._$AI(n),i};const W=globalThis;let S=class extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=zt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}};S._$litElement$=!0,S.finalized=!0,W.litElementHydrateSupport?.({LitElement:S});const qt=W.litElementPolyfillSupport;qt?.({LitElement:S});(W.litElementVersions??=[]).push("4.2.2");const Vt={CHILD:2},Wt=n=>(...t)=>({_$litDirective$:n,values:t});let Yt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};const{I:Kt}=jt,ot=n=>n,lt=()=>document.createComment(""),U=(n,t,e)=>{const s=n._$AA.parentNode,i=t===void 0?n._$AB:t._$AA;if(e===void 0){const r=s.insertBefore(lt(),i),o=s.insertBefore(lt(),i);e=new Kt(r,o,n,n.options)}else{const r=e._$AB.nextSibling,o=e._$AM,a=o!==n;if(a){let l;e._$AQ?.(n),e._$AM=n,e._$AP!==void 0&&(l=n._$AU)!==o._$AU&&e._$AP(l)}if(r!==i||a){let l=e._$AA;for(;l!==r;){const d=ot(l).nextSibling;ot(s).insertBefore(l,i),l=d}}}return e},v=(n,t,e=n)=>(n._$AI(t,e),n),Jt={},Zt=(n,t=Jt)=>n._$AH=t,Gt=n=>n._$AH,F=n=>{n._$AR(),n._$AA.remove()};const at=(n,t,e)=>{const s=new Map;for(let i=t;i<=e;i++)s.set(n[i],i);return s},Qt=Wt(class extends Yt{constructor(n){if(super(n),n.type!==Vt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let s;e===void 0?e=t:t!==void 0&&(s=t);const i=[],r=[];let o=0;for(const a of n)i[o]=s?s(a,o):o,r[o]=e(a,o),o++;return{values:r,keys:i}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,s]){const i=Gt(n),{values:r,keys:o}=this.dt(t,e,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let d,u,h=0,p=i.length-1,c=0,f=r.length-1;for(;h<=p&&c<=f;)if(i[h]===null)h++;else if(i[p]===null)p--;else if(a[h]===o[c])l[c]=v(i[h],r[c]),h++,c++;else if(a[p]===o[f])l[f]=v(i[p],r[f]),p--,f--;else if(a[h]===o[f])l[f]=v(i[h],r[f]),U(n,l[f+1],i[h]),h++,f--;else if(a[p]===o[c])l[c]=v(i[p],r[c]),U(n,i[h],i[p]),p--,c++;else if(d===void 0&&(d=at(o,c,f),u=at(a,h,p)),d.has(a[h]))if(d.has(a[p])){const m=u.get(o[c]),N=m!==void 0?i[m]:null;if(N===null){const Y=U(n,i[h]);v(Y,r[c]),l[c]=Y}else l[c]=v(N,r[c]),U(n,i[h],N),i[m]=null;c++}else F(i[p]),p--;else F(i[h]),h++;for(;c<=f;){const m=U(n,l[f+1]);v(m,r[c]),l[c++]=m}for(;h<=p;){const m=i[h++];m!==null&&F(m)}return this.ut=o,Zt(n,l),E}}),Xt={placeholder:"Bearbeiten…",emptyList:"Keine Elemente gefunden"},te={ListField:Xt},ee={placeholder:"Edit…",emptyList:"No items found"},se={ListField:ee},ie={placeholder:"Editar…",emptyList:"Lista vacía"},ne={ListField:ie},re={placeholder:"Éditer…",emptyList:"Liste vide"},oe={ListField:re},le={placeholder:"Modifica…",emptyList:"Nessun elemento trovato"},ae={ListField:le},he={placeholder:"Editar…",emptyList:"Nenhum item encontrado"},de={ListField:he},ht={en:se,fr:oe,es:ne,de:te,it:ae,pt:de};class ce{_ctx;constructor(t){this._ctx={language:"",dict:{}},this.setLanguage(t)}setLanguage(t,e){const s=Object.keys(ht),i=At(t,{pluginLanguages:s,siteLanguages:e}),r=i,o={};vt(ht[r],"",o),this._ctx={language:i,dict:o}}t(t){return this._ctx.dict[t]??t}}function vt(n,t,e){for(const s in n){const i=n[s],r=t?`${t}.${s}`:s;i&&typeof i=="object"&&!Array.isArray(i)?vt(i,r,e):typeof i=="string"&&(e[r]=i)}}class pe extends S{static properties={value:{type:String},placeholder:{type:String},disabled:{type:Boolean,reflect:!0}};static styles=ut`
|
|
1
|
+
function e(e){return typeof e=="object"&&!!e&&"j"in e}var t=Object.keys({en:{en:"English",fr:"French",es:"Spanish",de:"German",it:"Italian",pt:"Portuguese"},fr:{en:"Anglais",fr:"Français",es:"Espagnol",de:"Allemand",it:"Italien",pt:"Portugais"},es:{en:"Inglés",fr:"Francés",es:"Español",de:"Alemán",it:"Italiano",pt:"Portugués"},de:{en:"Englisch",fr:"Französisch",es:"Spanisch",de:"Deutsch",it:"Italienisch",pt:"Portugiesisch"},it:{en:"Inglese",fr:"Francese",es:"Spagnolo",de:"Tedesco",it:"Italiano",pt:"Portoghese"},pt:{en:"Inglês",fr:"Francês",es:"Espanhol",de:"Alemão",it:"Italiano",pt:"Português"}});function n(e,{pluginLanguages:n,siteLanguages:r=[]}){return n.includes(e)||t.includes(e)&&n.includes(e)?e:r.find(e=>t.includes(e)&&n.includes(e))||(n.includes("en")?"en":n[0]??"en")}var r=globalThis,i=r.ShadowRoot&&(r.ShadyCSS===void 0||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),o=new WeakMap,s=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(i&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=o.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&o.set(t,e))}return e}toString(){return this.cssText}},c=e=>new s(typeof e=="string"?e:e+"",void 0,a),l=(e,...t)=>new s(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e=="number")return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[r+1],e[0]),e,a),u=(e,t)=>{if(i)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement("style"),i=r.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=n.cssText,e.appendChild(t)}},d=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return c(t)})(e):e,{is:f,defineProperty:p,getOwnPropertyDescriptor:m,getOwnPropertyNames:ee,getOwnPropertySymbols:te,getPrototypeOf:ne}=Object,h=globalThis,re=h.trustedTypes,ie=re?re.emptyScript:"",ae=h.reactiveElementPolyfillSupport,g=(e,t)=>e,_={toAttribute(e,t){switch(t){case Boolean:e=e?ie:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},v=(e,t)=>!f(e,t),oe={attribute:!0,type:String,converter:_,reflect:!1,useDefault:!1,hasChanged:v};Symbol.metadata??=Symbol("metadata"),h.litPropertyMetadata??=new WeakMap;var y=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=oe){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=m(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??oe}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;let e=ne(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){let e=this.properties,t=[...ee(e),...te(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(Infinity).reverse());for(let e of n)t.unshift(d(e))}else e!==void 0&&t.push(d(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return u(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?_:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter=="function"?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?_:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??v)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[g("elementProperties")]=new Map,y[g("finalized")]=new Map,ae?.({ReactiveElement:y}),(h.reactiveElementVersions??=[]).push("2.1.2");var b=globalThis,x=e=>e,S=b.trustedTypes,se=S?S.createPolicy("lit-html",{createHTML:e=>e}):void 0,C="$lit$",w=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+w,ce=`<${T}>`,E=document,D=()=>E.createComment(""),O=e=>e===null||typeof e!="object"&&typeof e!="function",k=Array.isArray,le=e=>k(e)||typeof e?.[Symbol.iterator]=="function",A="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,M=/-->/g,N=/>/g,P=RegExp(`>|${A}(?:([^\\s"'>=/]+)(${A}*=${A}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),F=/'/g,ue=/"/g,de=/^(?:script|style|textarea|title)$/i,I=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),L=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),z=new WeakMap,B=E.createTreeWalker(E,129);function V(e,t){if(!k(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return se===void 0?t:se.createHTML(t)}var H=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?"<svg>":t===3?"<math>":"",o=j;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===j?c[1]==="!--"?o=M:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=P):(de.test(c[2])&&(i=RegExp("</"+c[2],"g")),o=P):o=N:o===P?c[0]===">"?(o=i??j,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?P:c[3]==='"'?ue:F):o===ue||o===F?o=P:o===M||o===N?o=j:(o=P,i=void 0);let d=o===P&&e[t+1].startsWith("/>")?" ":"";a+=o===j?n+ce:l>=0?(r.push(s),n.slice(0,l)+C+n.slice(l)+w+d):n+w+(l===-2?t:d)}return[V(e,a+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},U=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=H(t,n);if(this.el=e.createElement(l,r),B.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=B.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(C)){let t=u[o++],n=i.getAttribute(e).split(w),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]==="."?fe:r[1]==="?"?pe:r[1]==="@"?me:q}),i.removeAttribute(e)}else e.startsWith(w)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(de.test(i.tagName)){let e=i.textContent.split(w),t=e.length-1;if(t>0){i.textContent=S?S.emptyScript:"";for(let n=0;n<t;n++)i.append(e[n],D()),B.nextNode(),c.push({type:2,index:++a});i.append(e[t],D())}}}else if(i.nodeType===8)if(i.data===T)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(w,e+1))!==-1;)c.push({type:7,index:a}),e+=w.length-1}a++}}static createElement(e,t){let n=E.createElement("template");return n.innerHTML=e,n}};function W(e,t,n=e,r){if(t===L)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=O(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=W(e,i._$AS(e,t.values),i,r)),t}var G=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??E).importNode(t,!0);B.currentNode=r;let i=B.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new K(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new he(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=B.nextNode(),a++)}return B.currentNode=E,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},K=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=W(this,e,t),O(e)?e===R||e==null||e===""?(this._$AH!==R&&this._$AR(),this._$AH=R):e!==this._$AH&&e!==L&&this._(e):e._$litType$===void 0?e.nodeType===void 0?le(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==R&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(E.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=U.createElement(V(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new G(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=z.get(e.strings);return t===void 0&&z.set(e.strings,t=new U(e)),t}k(t){k(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(D()),this.O(D()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=x(e).nextSibling;x(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},q=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=R,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=R}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=W(this,e,t,0),a=!O(e)||e!==this._$AH&&e!==L,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=W(this,r[n+o],t,o),s===L&&(s=this._$AH[o]),a||=!O(s)||s!==this._$AH[o],s===R?e=R:e!==R&&(e+=(s??"")+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},fe=class extends q{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===R?void 0:e}},pe=class extends q{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==R)}},me=class extends q{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=W(this,e,t,0)??R)===L)return;let n=this._$AH,r=e===R&&n!==R||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==R&&(n===R||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},he=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){W(this,e)}},ge={M:C,P:w,A:T,C:1,L:H,R:G,D:le,V:W,I:K,H:q,N:pe,U:me,B:fe,F:he},_e=b.litHtmlPolyfillSupport;_e?.(U,K),(b.litHtmlVersions??=[]).push("3.3.2");var ve=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new K(t.insertBefore(D(),e),e,void 0,n??{})}return i._$AI(e),i},J=globalThis,Y=class extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ve(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};Y._$litElement$=!0,Y.finalized=!0,J.litElementHydrateSupport?.({LitElement:Y});var ye=J.litElementPolyfillSupport;ye?.({LitElement:Y}),(J.litElementVersions??=[]).push("4.2.2");var be={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},xe=e=>(...t)=>({_$litDirective$:e,values:t}),Se=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},{I:Ce}=ge,we=e=>e,X=()=>document.createComment(""),Z=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new Ce(r.insertBefore(X(),i),r.insertBefore(X(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=we(e).nextSibling;we(r).insertBefore(e,i),e=t}}}return n},Q=(e,t,n=e)=>(e._$AI(t,n),e),Te={},Ee=(e,t=Te)=>e._$AH=t,De=e=>e._$AH,$=e=>{e._$AR(),e._$AA.remove()},Oe=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},ke=xe(class extends Se{constructor(e){if(super(e),e.type!==be.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=De(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=Q(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=Q(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=Q(i[d],a[m]),Z(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=Q(i[f],a[p]),Z(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=Oe(o,p,m),u=Oe(s,d,f)),l.has(s[d]))if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=Z(e,i[d]);Q(t,a[p]),c[p]=t}else c[p]=Q(n,a[p]),Z(e,i[d],n),i[t]=null;p++}else $(i[f]),f--;else $(i[d]),d++;for(;p<=m;){let t=Z(e,c[m+1]);Q(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&$(e)}return this.ut=o,Ee(e,c),L}}),Ae={en:{ListField:{placeholder:"Edit…",emptyList:"No items found"}},fr:{ListField:{placeholder:"Éditer…",emptyList:"Liste vide"}},es:{ListField:{placeholder:"Editar…",emptyList:"Lista vacía"}},de:{ListField:{placeholder:"Bearbeiten…",emptyList:"Keine Elemente gefunden"}},it:{ListField:{placeholder:"Modifica…",emptyList:"Nessun elemento trovato"}},pt:{ListField:{placeholder:"Editar…",emptyList:"Nenhum item encontrado"}}},je=class{_ctx;constructor(e){this._ctx={language:"",dict:{}},this.setLanguage(e)}setLanguage(e,t){let r=n(e,{pluginLanguages:Object.keys(Ae),siteLanguages:t}),i=r,a={};Me(Ae[i],"",a),this._ctx={language:r,dict:a}}t(e){return this._ctx.dict[e]??e}};function Me(e,t,n){for(let r in e){let i=e[r],a=t?`${t}.${r}`:r;i&&typeof i=="object"&&!Array.isArray(i)?Me(i,a,n):typeof i=="string"&&(n[a]=i)}}var Ne=class extends Y{static properties={value:{type:String},placeholder:{type:String},disabled:{type:Boolean,reflect:!0}};static styles=l`
|
|
2
2
|
:host { display: contents; }
|
|
3
3
|
input { flex: 1; border: none; outline: none; font: inherit; background: transparent; }
|
|
4
|
-
`;value="";placeholder="";disabled=!1;focus(){this.renderRoot.querySelector("input")?.focus()}render(){return
|
|
4
|
+
`;value="";placeholder="";disabled=!1;focus(){this.renderRoot.querySelector("input")?.focus()}render(){return I`<input
|
|
5
5
|
class="input"
|
|
6
6
|
.value=${this.value}
|
|
7
7
|
?disabled=${this.disabled}
|
|
8
|
-
@input=${this.#
|
|
8
|
+
@input=${this.#e}
|
|
9
9
|
placeholder=${this.placeholder}
|
|
10
10
|
aria-disabled=${this.disabled?"true":"false"}
|
|
11
11
|
tabindex=${this.disabled?-1:0}
|
|
12
|
-
/>`}#
|
|
12
|
+
/>`}#e(e){if(!e.currentTarget||this.disabled)return;let t=e.currentTarget.value;this.value=t,this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:t},bubbles:!0,composed:!0}))}};customElements.define("pcms-list-field-item-text",Ne);var Pe=class extends Y{static properties={language:{type:String}};static styles=l`
|
|
13
13
|
:host {
|
|
14
14
|
display: block;
|
|
15
15
|
font: inherit;
|
|
@@ -36,40 +36,40 @@ function ct(n){return typeof n=="object"&&n!==null&&"j"in n}const yt={en:{en:"En
|
|
|
36
36
|
.addBtn { align-self: flex-start; }
|
|
37
37
|
.empty { font-size: 0.85rem; color: #777; padding: 0.25rem 0.5rem; }
|
|
38
38
|
.placeholder { height: 2.25rem; border: 1px dashed var(--pcms-lf-border-color); border-radius: var(--pcms-lf-border-radius); }
|
|
39
|
-
`;#
|
|
39
|
+
`;#e=[];#t=0;get items(){return this.#e.map(e=>e.value)}set items(e){let t=Array.isArray(e)?e:[],n=[];for(let e=0;e<t.length;++e){let r=this.#e[e];n.push({id:r?.id??String(this.#t++),value:String(t[e])})}this.#e=n,this.requestUpdate("items")}language="en";#n;#r;#i=0;#a=new je("en");#o=0;#s=0;#c=null;#l;willUpdate(){this.#a.setLanguage(this.language)}render(){return I`<div class="root">
|
|
40
40
|
<ul class="list">
|
|
41
|
-
${this.items.length?this.#f():
|
|
41
|
+
${this.items.length?this.#f():I`<div class="empty">${this.#a.t("ListField.emptyList")}</div>`}
|
|
42
42
|
</ul>
|
|
43
43
|
<button type="button" class="addBtn" @click=${()=>this.#u()} aria-label="add">+</button>
|
|
44
|
-
</div>`}destroy(){}async#u(){this.#
|
|
45
|
-
${
|
|
44
|
+
</div>`}destroy(){}async#u(){this.#e=[...this.#e,{id:String(this.#t++),value:""}],this.requestUpdate("items"),this.#d(),await this.updateComplete;let e=this.renderRoot.querySelectorAll("pcms-list-field-item-text");e[e.length-1]?.focus?.()}#d(){this.dispatchEvent(new CustomEvent("items-changed",{detail:{items:[...this.items]},bubbles:!0,composed:!0}))}#f(){let e=this.#n,t=this.#r,n=this.#e;return[ke(n,e=>e.id,(n,r)=>{let i=r===e,a=i&&t!==void 0&&t!==e,o=i&&!a?`transform: translateY(${this.#i}px);`:"";return I`
|
|
45
|
+
${e!==void 0&&t!==void 0&&t===r&&t!==e?I`<li class="placeholder" data-placeholder="true"></li>`:null}
|
|
46
46
|
<li
|
|
47
|
-
class="item ${
|
|
48
|
-
style=${
|
|
49
|
-
aria-grabbed=${
|
|
50
|
-
data-entry-id=${
|
|
47
|
+
class="item ${i?"dragging":""} ${a?"source-collapsed":""}"
|
|
48
|
+
style=${o}
|
|
49
|
+
aria-grabbed=${i?"true":"false"}
|
|
50
|
+
data-entry-id=${n.id}
|
|
51
51
|
>
|
|
52
52
|
<button
|
|
53
53
|
type="button"
|
|
54
54
|
class="handle"
|
|
55
|
-
@pointerdown=${
|
|
55
|
+
@pointerdown=${e=>this.#h(e,r)}
|
|
56
56
|
title="move"
|
|
57
57
|
aria-label="move"
|
|
58
58
|
tabindex="-1"
|
|
59
59
|
>⇳</button>
|
|
60
60
|
<pcms-list-field-item-text
|
|
61
|
-
.value=${
|
|
62
|
-
.placeholder=${this.#
|
|
63
|
-
@value-changed=${
|
|
61
|
+
.value=${n.value}
|
|
62
|
+
.placeholder=${this.#a.t("ListField.placeholder")}
|
|
63
|
+
@value-changed=${e=>this.#p(n.id,e.detail.value)}
|
|
64
64
|
></pcms-list-field-item-text>
|
|
65
65
|
<button
|
|
66
66
|
type="button"
|
|
67
67
|
class="deleteBtn"
|
|
68
|
-
@click=${()=>this.#m(
|
|
68
|
+
@click=${()=>this.#m(r)}
|
|
69
69
|
aria-label="delete"
|
|
70
70
|
>🗑</button>
|
|
71
|
-
</li>`}),
|
|
71
|
+
</li>`}),e!==void 0&&t!==void 0&&t===n.length&&t!==e?I`<li class="placeholder" data-placeholder="true"></li>`:null,e!==void 0&&this.#c&&t!==void 0&&t!==e?(()=>{let t=this.#c;return t?I`<div class="drag-ghost" style=${`top:${t.top+this.#i}px;left:${t.left}px;width:${t.width}px;`}>
|
|
72
72
|
<button type="button" class="handle" title="move" aria-label="move" tabindex="-1">⇳</button>
|
|
73
|
-
<pcms-list-field-item-text .value=${this.#
|
|
73
|
+
<pcms-list-field-item-text .value=${this.#e[e].value} .placeholder=${this.#a.t("ListField.placeholder")} disabled aria-hidden="true"></pcms-list-field-item-text>
|
|
74
74
|
<button type="button" class="deleteBtn" aria-hidden="true" tabindex="-1">🗑</button>
|
|
75
|
-
</div
|
|
75
|
+
</div>`:null})():null]}#p(e,t){let n=this.#e.findIndex(t=>t.id===e);if(n===-1)return;let r=t.trim();if(this.#e[n].value===r)return;let i=[...this.#e];i[n]={...i[n],value:r},this.#e=i,this.requestUpdate("items"),this.#d()}async#m(e){let t=[...this.#e];t.splice(e,1),this.#e=t,this.requestUpdate("items"),this.#d(),await this.updateComplete;let n=this.renderRoot.querySelectorAll("pcms-list-field-item-text");n.length&&n[Math.min(e,n.length-1)]?.focus?.()}#h(e,t){let n=e.currentTarget;this.#l=n,this.#n=t,this.#r=void 0,this.#s=e.clientY;let r=n.closest("li.item")||void 0;if(r){let e=r.getBoundingClientRect();this.#c={top:e.top,left:e.left,width:e.width,height:e.height}}else this.#c=null;n.setPointerCapture(e.pointerId),n.addEventListener("pointermove",this.#g),n.addEventListener("pointerup",this.#v,{once:!0}),n.addEventListener("pointercancel",this.#y,{once:!0})}#g=e=>{this.#n!==void 0&&(this.#i=e.clientY-this.#s,cancelAnimationFrame(this.#o),this.#o=requestAnimationFrame(()=>{this.#_(e.clientY),this.requestUpdate()}))};#_(e){if(this.#n===void 0)return;let t=this.renderRoot.querySelector("ul.list");if(!t)return;let n=Array.from(t.querySelectorAll("li.item")),r=this.#n;if(!n[r])return;let i=[];for(let e=0;e<n.length;++e)e!==r&&i.push({el:n[e],fullIndex:e});let a=i.length;for(let t=0;t<i.length;++t){let{el:n}=i[t],r=n.getBoundingClientRect();if(e<r.top+r.height/2){a=t;break}}let o;o=a===i.length?n.length:i[a].fullIndex;let s=o;r<o&&(s=o-1),s===r?this.#r=void 0:this.#r=o}#v=()=>{if(this.#n===void 0)return;let e=this.#n,t=this.#r;if(t!==void 0){let n=t;if(e<t&&(n=t-1),n<0&&(n=0),e!==n){let t=[...this.#e],[r]=t.splice(e,1);t.splice(n,0,r),this.#e=t,this.requestUpdate("items"),this.#d()}}this.#n=void 0,this.#r=void 0,this.#i=0,this.#c=null,this.#l&&=(this.#l.removeEventListener("pointermove",this.#g),void 0),this.requestUpdate()};#y=()=>{this.#v()}};customElements.define("pcms-list-field",Pe);var Fe={create:Le,init:Ie};function Ie({pluginBaseUrl:e}){let t=`${e}/admin-ui-plugin.css`,n=document.createElement("link");n.rel="stylesheet",n.href=t,document.head.appendChild(n)}function Le(t){let{fieldType:n,initialValue:r}=t;if(n.dataType!=="json")throw Error(`field type '${n.name}' is incompatible with list-field plugin, needs data type 'json'`);if(r!==void 0&&!e(r))throw Error(`field type '${n.name}' is incompatible, should be a json, got '${typeof r}'`);let i=document.createElement("pcms-list-field");return i.items=Re(r),i.language=t.language,i.addEventListener("items-changed",e=>{let n=e.detail;t.setModifiedValue({j:n.items})}),{element:i,setLanguage:e=>{i.language=e},setValue:e=>{i.items=Re(e)},getValue:()=>({j:[...i.items]}),dispose:()=>i.destroy()}}function Re(t){return e(t)&&Array.isArray(t.j)?t.j.map(e=>String(e)):[]}export{Fe as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/list-field-plugin",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.20",
|
|
4
4
|
"description": "List field plugin for ParoiCMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"dev:admin-ui": "(cd admin-ui-plugin && vite)",
|
|
20
20
|
"build": "npm run build:backend && npm run build:admin-ui",
|
|
21
|
+
"build:ci": "npm run build",
|
|
21
22
|
"build:backend": "(cd backend && tsc)",
|
|
22
23
|
"build:backend:watch": "(cd backend && tsc --watch --preserveWatchOutput)",
|
|
23
24
|
"build:admin-ui": "(cd admin-ui-plugin && npm run build)",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"clear": "rimraf backend/dist/* admin-ui-plugin/dist/*"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@paroicms/script-lib": "0.3.
|
|
29
|
+
"@paroicms/script-lib": "0.3.22",
|
|
29
30
|
"arktype": "~2.2.0"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
@@ -33,11 +34,11 @@
|
|
|
33
34
|
"@paroicms/public-server-lib": "0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@paroicms/public-anywhere-lib": "0.43.
|
|
37
|
-
"@paroicms/public-server-lib": "0.56.
|
|
38
|
-
"@types/node": "~24.
|
|
37
|
+
"@paroicms/public-anywhere-lib": "0.43.1",
|
|
38
|
+
"@paroicms/public-server-lib": "0.56.2",
|
|
39
|
+
"@types/node": "~24.12.2",
|
|
39
40
|
"rimraf": "~6.1.3",
|
|
40
|
-
"typescript": "~
|
|
41
|
+
"typescript": "~6.0.2"
|
|
41
42
|
},
|
|
42
43
|
"type": "module",
|
|
43
44
|
"main": "backend/dist/index.js",
|