@paroicms/list-field-plugin 0.28.21 → 0.28.22

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,4 +1,4 @@
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`
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.3");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
4
  `;value="";placeholder="";disabled=!1;focus(){this.renderRoot.querySelector("input")?.focus()}render(){return I`<input
@@ -72,4 +72,4 @@ function e(e){return typeof e=="object"&&!!e&&"j"in e}var t=Object.keys({en:{en:
72
72
  <button type="button" class="handle" title="move" aria-label="move" tabindex="-1">⇳</button>
73
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>`: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};
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=>{if(this.#n===void 0)return;let t=e.clientY-this.#s;this.#i=t,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.21",
3
+ "version": "0.28.22",
4
4
  "description": "List field plugin for ParoiCMS",
5
5
  "keywords": [
6
6
  "paroicms",
@@ -26,7 +26,7 @@
26
26
  "clear": "rimraf backend/dist/* admin-ui-plugin/dist/*"
27
27
  },
28
28
  "dependencies": {
29
- "@paroicms/script-lib": "0.3.23",
29
+ "@paroicms/script-lib": "0.3.24",
30
30
  "arktype": "~2.2.0"
31
31
  },
32
32
  "peerDependencies": {
@@ -34,11 +34,11 @@
34
34
  "@paroicms/public-server-lib": "0"
35
35
  },
36
36
  "devDependencies": {
37
- "@paroicms/public-anywhere-lib": "0.43.2",
38
- "@paroicms/public-server-lib": "0.56.3",
39
- "@types/node": "~24.12.2",
37
+ "@paroicms/public-anywhere-lib": "0.43.3",
38
+ "@paroicms/public-server-lib": "0.56.4",
39
+ "@types/node": "~24.12.4",
40
40
  "rimraf": "~6.1.3",
41
- "typescript": "~6.0.2"
41
+ "typescript": "~6.0.3"
42
42
  },
43
43
  "type": "module",
44
44
  "main": "backend/dist/index.js",