import{Q as e,S as t,U as s,V as r}from"./main-0de26b5f.js";import{m as n,u as o,r as i,p as l,s as u}from"./c.234c9091.js";function a(e){if(!e||"object"!=typeof e)return e;if("[object Date]"==Object.prototype.toString.call(e))return new Date(e.getTime());if(Array.isArray(e))return e.map(a);var t={};return Object.keys(e).forEach((function(s){t[s]=a(e[s])})),t}const f=(e,t,s)=>{const r=new Map;for(let n=t;n<=s;n++)r.set(e[n],n);return r},c=e(class extends t{constructor(e){if(super(e),e.type!==s.CHILD)throw Error("repeat() can only be used in text expressions")}ht(e,t,s){let r;void 0===s?s=t:void 0!==t&&(r=t);const n=[],o=[];let i=0;for(const t of e)n[i]=r?r(t,i):i,o[i]=s(t,i),i++;return{values:o,keys:n}}render(e,t,s){return this.ht(e,t,s).values}update(e,[t,s,a]){var c;const h=n(e),{values:p,keys:d}=this.ht(t,s,a);if(!Array.isArray(h))return this.ut=d,p;const y=null!==(c=this.ut)&&void 0!==c?c:this.ut=[],v=[];let m,b,g=0,j=h.length-1,x=0,A=p.length-1;for(;g<=j&&x<=A;)if(null===h[g])g++;else if(null===h[j])j--;else if(y[g]===d[x])v[x]=o(h[g],p[x]),g++,x++;else if(y[j]===d[A])v[A]=o(h[j],p[A]),j--,A--;else if(y[g]===d[A])v[A]=o(h[g],p[A]),i(e,v[A+1],h[g]),g++,A--;else if(y[j]===d[x])v[x]=o(h[j],p[x]),i(e,h[g],h[j]),j--,x++;else if(void 0===m&&(m=f(d,x,A),b=f(y,g,j)),m.has(y[g]))if(m.has(y[j])){const t=b.get(d[x]),s=void 0!==t?h[t]:null;if(null===s){const t=i(e,h[g]);o(t,p[x]),v[x]=t}else v[x]=o(s,p[x]),i(e,h[g],s),h[t]=null;x++}else l(h[j]),j--;else l(h[g]),g++;for(;x<=A;){const t=i(e,v[A+1]);o(t,p[x]),v[x++]=t}for(;g<=j;){const e=h[g++];null!==e&&l(e)}return this.ut=d,u(e,v),r}}),h=(e,t)=>e&&e.config.components.includes(t);export{c,a as d,h as i};
