compelem 0.7.4-b1 → 0.7.6-b1

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.
package/CompElem.d.ts CHANGED
@@ -70,6 +70,7 @@ export declare class CompElem extends HTMLElement implements IComponent {
70
70
  */
71
71
  _notify(ov: any, chain: string[]): any;
72
72
  _updateProps(props: Record<string, any>): void;
73
+ _wrapperProp: Set<string>;
73
74
  _initProps(props: Record<string, any>, attrs?: Record<string, any>): void;
74
75
  /**
75
76
  * 绑定slot标签,render时调用
package/compelem.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * compelem v0.7.4-b1.1760876873
2
+ * compelem v0.7.6-b1.1761447525
3
3
  * A modern, reactive, fast, lightweight and flexible lib for building web components
4
4
  * @holyhigh2
5
5
  * https://github.com/holyhigh2/compelem
6
6
  */
7
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("myfx")):"function"==typeof define&&define.amd?define(["exports","myfx"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).compelem={},e.myfx)}(this,(function(e,t){"use strict";const r=/\s+\.?key\s*=/;var n,s,o,i;function a(e){console.error("[CompElem]",e)}function l(e,t){console.error(`[CompElem <${e}>]`,t)}function c(e){return t.toPath(e).join("-")}function u(e){return Object.getPrototypeOf(e)}function d(e){return e===Boolean||t.some(e,(e=>e===Boolean))}function p(e){let r=e;return t.isString(e)&&/(?:^true$)|(?:^false$)/.test(r)?r="true"===r:(t.isUndefined(r)||t.isBlank(r))&&(r=!0),r}!function(e){e[e.CSS=1]="CSS",e[e.COMPUTED=2]="COMPUTED"}(n||(n={})),function(e){e.PROPS="__deco_props",e.STATES="__deco_states",e.COMPUTED="__deco_computed",e.WATCH="__deco_watch",e.EVENTS="__deco_events"}(s||(s={})),function(e){e.Prod="prod",e.Dev="dev"}(o||(o={})),e.DecoratorType=void 0,(i=e.DecoratorType||(e.DecoratorType={})).CLASS="class",i.FIELD="field",i.METHOD="method";class h{static get priority(){return 0}}const f="getKey",g="__decorators",m=new WeakMap;class y{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(e,r,n){this.args=e,this.metadata=r,this.decoratorClass=n,this.priority=t.get(n,"priority",0),this.instanceMap=new WeakMap}create(r){let n,s=new this.decoratorClass(...this.args),o=s.targets,i=this.metadata[2];t.isObject(i)&&t.isDefined(t.get(i,"configurable"))?n=e.DecoratorType.METHOD:t.isUndefined(this.metadata[2])&&(n=e.DecoratorType.FIELD),!t.isEmpty(o)&&n&&o.includes(n)?(s.created(r,...this.metadata),this.instanceMap.set(r,s)):a(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${o.join(",")}' bug got '${n}'`)}beforeMount(e,t){this.instanceMap.get(e).beforeMount(e,t,...this.metadata)}mounted(e,t){this.instanceMap.get(e).mounted(e,t,...this.metadata)}updated(e,t){this.instanceMap.get(e).updated(e,t)}}const v=new WeakMap;function E(e){let r=(...r)=>(...n)=>{let s=n[0].constructor,o=s[g];if(!t.has(s,g)){let e=Object.getPrototypeOf(s);o=e?t.concat(e[g]??[]):[],Reflect.defineProperty(s,g,{configurable:!1,enumerable:!1,value:o})}let i,a={},l=e[f];if(l){let t=v.get(e);if(t||(t=new WeakMap,v.set(e,t)),a=t.get(s),a||(a={},t.set(s,a)),i=l(...r),a[i])return a[i]}let c=new y(r,n,e);return a[i]=c,o?.push(c),c};return m.set(r,!0),r}const b=new WeakMap;function T(e,r,n,o){let i;if(t.isLowerCaseChar(r[0])||a(`Prop '${r}' must be in CamelCase`),!t.has(e.constructor,s.PROPS)){const r={};let n=e.constructor;for(;(n=u(n))!==G;)t.merge(r,n[s.PROPS]?t.cloneDeep(n[s.PROPS]):{});Reflect.defineProperty(e.constructor,s.PROPS,{configurable:!1,enumerable:!1,value:r}),i=new Set,t.each(r,((e,r)=>{if(e.attribute){let e=t.kebabCase(r);i?.add(e)}})),b.set(e.constructor,i)}if(o&&(o.get&&(n.getter=o.get),o.set&&(n.setter=o.set)),n.attribute){i||(i=b.get(e.constructor));let n=t.kebabCase(r);i?.add(n)}t.has(e.constructor,"observedAttributes")||(e.constructor.observedAttributes=[]),e.constructor.observedAttributes=t.toArray(i),e.constructor[s.PROPS][r]=n}const S=new Set;function C(e){return b.get(e)??S}var N,_;e.EnterPointType=void 0,(N=e.EnterPointType||(e.EnterPointType={})).ATTR="attr",N.PROP="prop",N.TEXT="text",N.CLASS="class",N.STYLE="style",N.SLOT="slot",N.TAG="tag",e.DirectiveUpdateTag=void 0,(_=e.DirectiveUpdateTag||(e.DirectiveUpdateTag={})).NONE="NONE",_.REMOVE="REMOVE",_.REPLACE="REPLACE",_.UPDATE="UPDATE",_.APPEND="APPEND";class A{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(e,t,r,n){this.varIndex=e,this.node=t,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}const P="-",w={collectWatch(e,t,r){let n=x.get(e);n||(n={},x.set(e,n));let s=n[r];s||(s=n[r]=[]),s.push(t)},startCollect(e,t){this.__collectType=t,this.__collecting=e},setUpdater(e){this.__updater=e},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(e){let r=t.last(this.__directiveQ);const n=e?e.join(","):"",s=r?r.join(","):"";r&&n===s||(r&&r.length<e.length&&t.startsWith(n,s)?this.__directiveQ[this.__directiveQ.length-1]=e:this.__directiveQ.push(e))},popDirectiveQ(){let e=t.concat(this.__directiveQ);return this.__directiveQ=[],e},startRender(e){this.__renderCollecting=!0,this.__renderContext=e},endRender(e){this.__renderCollection.forEach((t=>{e._regDeps(t,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(e){this.__renderCollection.add(e)},clear(){this.__directiveQ=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},D=new WeakMap,k=new WeakMap,M=new WeakMap,O=new WeakMap,x=new WeakMap,R=new WeakMap;function L(e,r){if(!t.isObject(e))return e;if(R.has(e))return R.get(e);if(D.has(e))return e;const o=new Proxy(e,{get(e,r,o){if(!r)return;const i=Reflect.get(e,r,o);if(t.isSymbol(r))return i;if("length"===r&&t.isArray(e))return i;let a=k.get(o)??[],l=t.concat(a,[r]),u=r in e;if((w.__renderCollecting||w.__collecting)&&(u&&e.hasOwnProperty(r)||!u)){let e=l.join(P);if(w.__renderCollecting)w.collect(c(l)),w.setDirectiveQ(l);else if(w.__collecting){let t;switch(w.__collectType){case n.COMPUTED:t=M.get(w.__collecting),t||(t={},M.set(w.__collecting,t));break;case n.CSS:t=O.get(w.__collecting),t||(t={},O.set(w.__collecting,t))}let r=t[e];r||(r=t[e]=[]),r.push(w.__updater)}}const d=D.get(o);let p=d.from,h=t.get(p.constructor,s.STATES);if(t.get(h,[r,"shallow"]))return i;let f=i;if(t.isObject(i)&&!t.isFunction(i)&&!(i instanceof Node)&&!Object.isFrozen(i)){let e=d.pathMap;d.contextSet.forEach((t=>{let r=e?.get(t);r&&(f=L(i,t),R.set(i,f),k.has(f)||k.set(f,l))}))}return f},set(e,n,o,i){if(!n)return!1;let a=e[n],l=k.get(i)??[],c=t.concat(l,[n]),u=t.get(r.constructor,s.PROPS),d=t.get(r.constructor,s.STATES),p=t.get(u,[c[0],"hasChanged"])||t.get(d,[c[0],"hasChanged"]);if(p){let e=o,t=a;if(c.length>1&&(t=e=r._getPrivateData()[c[0]]),!p.call(r,e,t,c,o,a))return!0}else if(Object.is(a,o))return!0;u&&u[n]&&e.__isData&&u[n].sync&&r.emit("update:"+n,{value:o});let h=o,f=Reflect.set(e,n,h);return U(r,a,c),f}});let i=k.get(e)??[];if(Object.isExtensible(e)&&!D.get(o)){let e=new Set;e.add(r);let t=new WeakMap;t.set(r,i),D.set(o,{from:r,contextSet:e,pathMap:t})}else{D.get(o).contextSet.add(r);let e=D.get(o).pathMap,n=e.get(r),s=t.concat(i);if(n&&n.join("")!==s.join("")){let e=t.get(r,t.initial(n));t.isArray(e)||function(...e){console.warn("[CompElem]",...e)}(`The object is referenced by more than one @state '${s.join(".")},${n.join(".")}'`),n=s}else e.set(r,s)}return R.set(e,o),o}function U(e,r,n){let s=M.get(e),o=O.get(e),i=x.get(e);if(s||o||i){let e=n.length;for(;e;){let a=n.slice(0,e).join(P);if(i){const s=i[a];e===n.length?s?.forEach((e=>{let t=e();t.ov=r,W.pushWatch(t)})):s?.forEach((e=>{let n=e();t.get(n,"deep")&&(n.ov=r,W.pushWatch(n))}))}if(s){let e=s[a];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];W.pushComputed(r)}}if(o){let e=o[a];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];W.pushCss(r)}}e--}}let a=e._notify(r,n);W.pushNext(a,e.cid)}const H=new Map;class W{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){W.nextPending=!1;let e=Array.from(W.watchSet);W.watchSet.clear();let r=Array.from(W.computedSet);W.computedSet.clear();let n=Array.from(W.cssSet);W.cssSet.clear();let s=Array.from(W.nextSet);W.nextSet.clear(),H.clear(),e.forEach((e=>e(t.get(e,"ov")))),r.forEach((e=>e())),n.forEach((e=>e())),s.forEach((e=>e()))}static pushWatch(e){W.watchSet.add(e)}static pushComputed(e){W.computedSet.add(e)}static pushCss(e){W.cssSet.add(e)}static pushNext(e,t){if(t){if(H.has(t))return;H.set(t,e)}W.nextSet.add(e),W.nextPending||(W.nextPending=!0,W.next())}}(()=>{const e=Promise.resolve(),t=W.flush;W.next=()=>{e.then(t)}})();const j={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},I=new WeakMap;let B=[],V=0;const $=new Map,F=new WeakMap,z=Symbol.for("PROP_OBJECT_KEY_MAP_SYMBOL");class G extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(e){B=t.flatMap(e.css,(e=>{if(t.isString(e)){let t=new CSSStyleSheet;return t.replaceSync(e),t}return e instanceof CSSStyleSheet?e:[]})),e.global,t.each(e,((e,r)=>{t.test(r[0],/[A-Z]/)}))}#e;#t={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#e}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#p}get slotHooks(){return this.#h}get css(){return I.get(this.constructor)}get globalStyleSheet(){return $.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#p;#g={};#h={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#y=!1;#v=!1;constructor(...e){super(),this.#e=V++,1===t.size(e)&&(this.#l={},t.assign(this.#l,t.first(e)));let r=this.render.bind(this);this.render=function(){let e;return w.startRender(this),e=r(),w.endRender(this),e};let n=t.get(this.constructor,"globalStyles"),s=$.has(this.constructor);if(!t.isEmpty(n)&&!s){let e="";n.forEach((r=>{t.isString(r)&&(e+=r+"\n")}));let r=document.createElement("style");r.textContent+=e,$.set(this.constructor,r),document.head.appendChild(r)}let o=I.get(this.constructor),i=o??[];o||(t.each(t.get(this.constructor,"styles"),(e=>{if(t.isString(e)){let t=new CSSStyleSheet;t.replaceSync(e),i.push(t)}else i.push(e)})),I.set(this.constructor,i)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...B,...i],this.#E();let a=t.get(this.constructor,g);a&&a.sort(((e,t)=>t.priority-e.priority)).forEach((e=>e.create(this))),this.#b=this.#T.bind(this)}get rootComponent(){let e=this;for(;e.parentComponent;)e=e.parentComponent;return e}#b;connectedCallback(){let e=t.closest(this.parentNode,(e=>e instanceof G||e.host instanceof G),"parentNode");this.#d=e?e instanceof G?e:e.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#y)return;if(this.#v)return;this.#v=!0,this.#E();const e=this.#S();this.propsReady(e);for(const t in e){const r=e[t];this.#r[t]=r}this.#C(),t.each(this.#r,((e,t)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,t);Reflect.defineProperty(this,t,{get(){let e=Reflect.get(this.#n,t);return r?.get?r?.get():e},set(e){r?.set?r?.set(e):Reflect.set(this.#n,t,e)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=L(this.#r,this);let r=t.get(this.constructor,s.COMPUTED);t.each(r,((e,t)=>{w.startCollect(this,n.COMPUTED),w.setUpdater((()=>{this.#n[t]=e.call(this)})),this.#r[t]=e.call(this),w.endCollect(),Reflect.defineProperty(this,t,{get(){return Reflect.get(this.#n,t)},set(e){l(this.tagName,"Cannot set a computed property '"+t+"'")}})}));let o=t.get(this.constructor,s.WATCH);t.each(o,((e,r)=>{e.forEach((e=>{let{source:n,options:s,handler:o}=e,i=o.bind(this);t.get(s,"once",!1)&&(i=t.once(i));const a=function(e){let r=t.get(this,n.replaceAll(P,"."));i(r,e,n)}.bind(this);let l=t.get(s,"deep",!1);if(a.deep=l,w.collectWatch(this,(()=>a),r),!t.get(s,"immediate",!1))return;let c=t.get(this,n.replaceAll(P,"."));i(c,c,n)}))}));let i=function(e,r){let n,s=[];if(Re.has(r.constructor)){let o=Re.get(r.constructor),i=function(e,r){let n=t.concat(r.vars),s=r.strings.length-1;for(let o=0;o<=s;o++){let s=t.get(r.vars,o,"");if(s instanceof tt){let[t,r]=Fe(e,s);n.splice(o,1,...r)}}return n}(r,e);n=Le.has(r.constructor)?function(e,r,n){let s=Le.get(n.constructor)?.cloneNode(!0),o=Ue.get(n.constructor);const i=document.createNodeIterator(s,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,c=0,u=0;for(;a=i.nextNode();){let s;if(u++,l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof G&&(l=a);let i={};o[u].forEach((o=>{let u=r[c++];switch(o.type){case He.Event:s=t.clone(o.up),o.value||c--,o.value&&Ne(o.name,u.bind(n),a,n),a.removeAttribute(o.attrName);break;case He.AttrSlot:l&&o.name,a.removeAttribute(o.attrName);break;case He.Ref:s=t.clone(o.up),u.current=a,a.removeAttribute(o.attrName);break;case He.AttrKey:s=t.clone(o.up),a.setAttribute(Me,u);break;case He.AttrBool:s=t.clone(o.up),s.value=!!u,s.node=a,s.value&&a.setAttribute(o.name,""),a.removeAttribute(o.attrName);break;case He.AttrProp:s=t.clone(o.up),s.value=u,s.node=a,i[o.name]=u,o.attrName&&a.removeAttribute(o.attrName);break;case He.AttrRef:case He.Attr:s=t.clone(o.up),s.value=u,s.node=a,a.setAttribute(o.attrName,u),He.AttrRef===o.type&&a.removeAttribute(o.name);break;case He.DirectiveAttr:case He.DirectiveTag:case He.DirectiveProp:s=t.clone(o.up),s.value=u,s.node=a;let e=t.clone(o.point);e.startNode=a;let[r,d,p,h,f]=u,g=$e.get(a);if(g||(g={},$e.set(a,g)),g[o.attrName??Symbol.keyFor(r)]=[e,n,l],p(e,d,void 0,{renderComponent:n,slotComponent:l,varChain:f}),He.DirectiveAttr===o.type){let e=a.getAttribute(o.attrName);e=t.replace(e,Ke,""),a.setAttribute(o.attrName,e)}o.name&&a.removeAttribute(o.name)}s&&e.push(s)})),a instanceof G?(a._initProps(i),a._regWrapper(n)):a instanceof HTMLSlotElement&&n._bindSlot(a,a.name||"default",i)}else{o[u].forEach((o=>{let i=r[c++];switch(o.type){case He.DirectiveSlot:case He.DirectiveText:s=t.clone(o.up),s.value=i,s.node=a;let[e,r,c,u,d]=i,p=Symbol.keyFor(e),h=document.createComment(`compelem-${n.tagName}-${p}-start`);s.textNode=h,a.parentNode.insertBefore(h,a),a.nodeValue=`compelem-${n.tagName}-${p}-end`;let f=t.clone(o.point);f.startNode=h,f.endNode=a,Be.set(a,[f,n,l,r,d]),Ie.set(a,c),Ve.set(a,s),w.startRender(a);let g=c(f,r,void 0,{renderComponent:n,slotComponent:l,varChain:d});w.endRender(n);let m=qe(a,g[1],n);m&&m.length>0&&Je.insertBefore(a,Array.from(m));break;case He.Text:s=t.clone(o.up),s.node=a;let y=t.toString(i??""),v=document.createTextNode(y);a.replaceWith(v),s.textNode=v}s&&e.push(s)}))}}return s.childNodes}(s,i,r):Qe(s,o,i,r)}else{let[t,o]=Fe(r,e);Re.set(r.constructor,t),n=Qe(s,t,o,r)}return We.set(r,s),n}(this.render(),this);i&&(this.#o.append(...i),this.#u=t.filter(this.#o.childNodes,(e=>e.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),t.each(this.#h,((e,t)=>{this.#N(t)}));const a=this;let c=t.get(this.constructor,g);c&&c.sort(((e,t)=>t.priority-e.priority)).forEach((e=>{e.beforeMount(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}));let u=t.get(this.constructor,"hostStyles"),d=this.#p?.shadowRoot??this.ownerDocument,p=F.get(d);if(!p?.includes(this.constructor)&&u.length>0){let e=[];t.each(u,(r=>{if(t.isString(r)){let t=new CSSStyleSheet;t.replaceSync(r),e.push(t)}else e.push(r)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...e],p?.push(this.constructor)}this.beforeMount();let h=t.get(this.constructor,s.EVENTS);h&&h.forEach((async e=>{let r=e.name,n=t.assign({target:document,once:!1,passive:!1,capture:!1},e.options),s=t.bind(e.fn,this),o=n.target;t.isFunction(o)&&(o=await o.call(this,this)),o?o.addEventListener(r,s,n):l(this.tagName,"The target of @event('"+r+"',...) is invalid")})),w.startCollect(this,n.CSS);let f=[];this.styles.forEach((e=>{if(!t.isFunction(e))return;let r=new CSSStyleSheet;f.push(r),w.setUpdater((()=>{let t=e()??"";r.replaceSync(t)}));let n=e();t.isBlank(n)||r.replaceSync(n)})),w.endCollect(),f.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...f]),setTimeout((()=>{this.#f=!0,this.mounted(),c&&c.forEach((e=>{e.mounted(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}))}),0),this.#y=!0}propsReady(e){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#_(e,r){this.#E();let n=t.get(this.#t[r],"props");n&&t.each(this.slots,((e,r)=>{e.filter((e=>e.nodeType===Node.ELEMENT_NODE)).forEach((e=>{e instanceof G?e._updateProps(n):t.each(n,((r,n)=>{if(e instanceof HTMLSlotElement){let s=t.get(e,"__l_comp");if(s){let t=e.name||"default",o=s.#t[t];o||(o=s.#t[t]={props:{}}),o.props||(o.props={}),o.props[n]=r,s.#_(e,t)}}else e.setAttribute(n,r)}))}))})),this.slotChange(e,r)}slotChange(e,t){}attributeChangedCallback(e,r,n){if(Object.is(n,r))return;let o=t.camelCase(e);if(d(t.get(this.constructor,[s.PROPS,o]).type)){let e=p(n);if(t.get(this,o)===e)return}this.#A(e,r,n)}shouldUpdate(e){return!0}updated(e){}#P={};_notify(e,r){let n=[];for(let s=0;s<r.length;s++){const o=r[s];n.push(o);let i=t.get(this,n),a=c(n);this.#s[a]={value:i,chain:"slots"===a?["slots"]:n,oldValue:e,end:n.length===r.length}}return this.#b}#T(){if(t.size(this.#s)<1)return;const e=this.#s;this.#s={};const r=Object.keys(e);let n=t.get(this.constructor,g);if(n&&n.sort(((e,t)=>t.priority-e.priority)).forEach((t=>{t.updated(this,e)})),!this.shouldUpdate(e))return;let s=new Set;const o=this.#i;t.each(e,(({value:e,chain:t,oldValue:r,end:n},i)=>{o[i]&&o[i].forEach((e=>{s.add(e)}))})),s.forEach((e=>{e===this?Xe(this.render(),this,void 0,r):Ye(e,this)})),this.#w.forEach((e=>{this.#N(e)})),this.updated(e)}#S(){let e=t.get(this.constructor,s.PROPS),r=this.attributes,n=this.tagName,o=this.#l,i={};t.each(r,(({name:r,value:n})=>{if(r[0]===_e||r[0]===Ae||r[0]===Pe||r===ke||"slot"===r)return;let s=t.camelCase(r);e&&!e[s]&&(i[r]=n)})),this.#a=this.#a?t.assign(this.#a,i):i;let a={};if(!e)return Object.seal(a);let c=Object.keys(e),u=c.length;for(let s=0;s<u;s++){const i=c[s],u=t.kebabCase(i),d=this.hasAttribute(u);let p,h=e[i],f=t.has(o,i),g=t.get(this,i);if(!("_defaultValue"in h)&&(h._defaultValue=g,!h.type)){t.isUndefined(g)&&l(n,"Prop '"+i+"' has neither propType nor defaultValue be used for type inference");let e=typeof g;t.isArray(g)&&(e="array");let r=j[e];h.type=r}if(f)p=t.isNil(o[i])?g:o[i];else{p=g;let e=r.getNamedItem(u)||r.getNamedItem(Ae+u);e&&(f=!0,p=e.value)}if(h.required&&!f){l(n,"Prop '"+i+"' is required");break}p=this.#D(e,i,p,d);let m=t.get(e,[i,"getter"]);m&&(m=t.bind(m,this));let y=t.get(e,[i,"setter"]);y&&(y=t.bind(y,this)),(m||y)&&Reflect.defineProperty(this.#r,i,{set:y||function(e){},get:m}),h.attribute&&t.isDefined(p)&&!t.isObject(p)&&this.#k(h,i,p),this.#r[i]=p,a[i]=p}return Object.seal(a)}#k(e,r,n){let s=t.kebabCase(r),o=t.trim(n);d(e.type)?(o=p(n),t.isBoolean(o)?o&&!this.hasAttribute(s)?this.toggleAttribute(s,!0):!o&&this.hasAttribute(s)&&this.toggleAttribute(s,!1):this.getAttribute(s)!==o&&this.setAttribute(s,o)):this.getAttribute(s)!==o&&this.setAttribute(s,o)}#M(e,r){let n=e;try{for(let s=0;s<r.length;s++){const o=r[s];n=o===Boolean?p(e):o===Number?Number(e):o===String?String(e):o===Object||o===Array?t.parseJSON(e):o===Date?new Date(e):new o(e)}}catch(t){l(this.tagName,"Convert attribute error with "+e)}return n}#D(e,r,n,s){let o=e[r];if(!o)return n;let i=o.isValid,a=o.type,c=t.isArray(a)?a:[a],u=o.converter,d=n;if(!t.some(c,(e=>e===String))&&t.isString(d)&&!t.isNull(d))try{d=u?u(d):this.#M(d,c)}catch(e){l(this.tagName,`Convert attribute '${r}' error with `+d)}for(let e=0;e<c.length;e++){"Boolean"===c[e].name&&s&&(d=p(d))}if(t.isNil(d))return d;let h=typeof d,f=!t.isDefined(d);for(let e=0;e<c.length;e++){const r=c[e];if(t.test(h,r.name,"i")||d instanceof r||Object.prototype.toString.call(d)===Object.prototype.toString.call(r.prototype)){f=!0;break}}return f||l(this.tagName,`Invalid prop '${r}'. expected '${c.map((e=>e.name||e))}' but got '${h}'`),i&&(i.call(this,d,this.#r)||l(this.tagName,`Invalid prop '${r}'. IsValid() check failed`)),d}#C(){let e=t.get(this.constructor,s.STATES);t.each(e,((r,n)=>{let s=e[n],o=t.get(this,n);if(s){let e=s.prop;o=e?t.cloneDeep(this.#r[e]):t.get(this,n)}this.#r[n]=o}))}#O=t.debounce(this.propsReady,100);_updateProps(e){let r=t.get(this.constructor,s.PROPS),n=[];t.each(e,((e,s)=>{let o=t.camelCase(s),i=r[o];i&&(e=this.#D(r,o,e),i.attribute&&t.isDefined(e)&&!t.isObject(e)&&n.push([i,o,e]),w.__skipCheck=!0,t.set(this,o,e),w.__skipCheck=!1)})),t.assign(this.#l,e),n.forEach((([e,t,r])=>{this.#k(e,t,r)})),this.#O(this.#l)}_initProps(e,r){this.#l=t.merge(this.#l||{},e),this.#a=t.merge(this.#a||{},r)}_bindSlot(e,r,n){if(this.#g[r]||(this.#g[r]=e,Reflect.defineProperty(e,"__l_comp",{value:this})),e.addEventListener("slotchange",(t=>{this.#y&&this.#_(e,"default"===r?"":r)})),!t.isEmpty(n)){let e=this.#t[r];e||(e=this.#t[r]={}),e.props=n}}_bindSlotHook(e,t){this.#h[e]=t}#w=new Set;_updateSlot(e,t,r){let n=this.#g[e],s=this.#h[e];if(!s&&!n)return;let o=this.#t[e];if(t&&(o.props||(o.props={}),o.props[t]=r),s)this.#w.add(e);else{let e=n.assignedElements({flatten:!0});for(let n=0;n<e.length;n++){e[n].setAttribute(t,r+"")}}}#E(){const e=t.flatMap(this.childNodes,(e=>e.nodeType===Node.COMMENT_NODE?[]:e instanceof HTMLSlotElement?e.assignedNodes({flatten:!0}):e));let r=t.groupBy(e,(e=>e.nodeType===Node.TEXT_NODE?"default":e instanceof Element?e.getAttribute("slot")||"default":void 0));if(t.isEmpty(r))return void(t.isEmpty(this.#r["#slots"])||(this.#y?this.#n["#slots"]={}:this.#r["#slots"]={}));t.each(r,((e,r)=>{if(r){for(;e.length>0;){let r=e[0];if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.shift()}for(;e.length>0;){let r=t.last(e);if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.pop()}}}));let n={};t.each(r,((e,r)=>{t.isEmpty(e)||(n[r]=e)})),this.#y?this.#n["#slots"]=n:this.#r["#slots"]=n}#N(e){let r=this.#h[e];if(!r)return;let n=this.#t[e];if(!this.#r["#slots"][e])return;this.renderAsync(r,t.get(n,"props"));const s=this._asyncDirectives.get(r);let o=s?.buildView(r(t.get(n,"props"))),i=t.reject(t.toArray(o),(e=>e.nodeType===Node.COMMENT_NODE));if(i){let r=this.#m[e];if(!t.isEmpty(r))for(let e=0;e<r.length;e++){const t=r[e];t.parentNode?.removeChild(t)}this.#m[e]=i,this.append(...i),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(e,...t){}#A(e,r,n){if(!this.#y)return;if(C(this.constructor).has(e)){let r=t.camelCase(e);if(t.isNull(n)){n=t.get(this.constructor,s.PROPS)[r]._defaultValue}this._updateProps({[r]:n})}}_regDeps(e,t){let r=this.#i[e];r||(r=this.#i[e]=new Set),r.add(t);let n=e.split(P);if(n.pop(),n.length<1)return;let s=n.join(P);r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(t)}_regWrapper(e){this.#p=e}_getPrivateData(){return this.#r}emit(e,r={},n){n&&n.event&&(r.event=n.event),r.target=this,this.dispatchEvent(new CustomEvent(e,{bubbles:t.get(n,"bubbles",!1),composed:t.get(n,"composed",!1),cancelable:!0,detail:r}))}on(e,t){this.#P[e]||(this.#P[e]=[]);let r=t.bind(this);this.#P[e].push(r),this.addEventListener(e,r)}nextTick(e,t){W.pushNext(e,t)}forceUpdate(){t.each(this.#n,((e,t)=>{this.#s[t]={value:void 0,chain:void 0}})),this.#T()}}class K{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(e,t,r){this.startNode=e,this.attrName=t,this.type=r}setVarIndex(e){this.varIndex=e}getNodes(){let e=this.startNode.nextSibling;if(!this.endNode)return[e];let t=[];for(;e&&e!==this.endNode;)t.push(e),e=e?.nextSibling;return t}}var Q;!function(e){e.AFTER_BEGIN="afterbegin"}(Q||(Q={}));const q={};function X(r,n,s,o,i,l,c,u=!1){let d;if(u?(w.startRender(r.endNode),d=o(r,n,s,{renderComponent:i,slotComponent:l,varChain:c}),w.endRender(i)):d=o(r,n,s,{renderComponent:i,slotComponent:l,varChain:c}),!d)return;let[p,h]=d;if(p===e.DirectiveUpdateTag.NONE)return;let f=r.getNodes();if(p===e.DirectiveUpdateTag.REMOVE)for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}else if(p===e.DirectiveUpdateTag.REPLACE){let e=[];for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}let n=qe(r.endNode,h,i);e=t.toArray(n);let s=document.createDocumentFragment();s.append(...e),r.endNode.parentNode.insertBefore(s,r.endNode)}else if(p===e.DirectiveUpdateTag.UPDATE){let e,n={},s=[],o=[],l=je.get(r.endNode);if(h||(h=new tt([],[])),t.isEmpty(f)){let e=qe(r.endNode,h,i);return void r.startNode.after(...e)}let c={};h instanceof tt&&h.vars.forEach((e=>{if(e instanceof tt){const t=e.getKey();c[t]=e,n[t]=!0,o.push(t)}})),f=t.filter(t.compact(f),(e=>e.nodeType===Node.ELEMENT_NODE)),e=t.filter(t.compact(t.toArray(e)),(e=>e.nodeType===Node.ELEMENT_NODE));let u={},d="",p={};for(let e=0;e<f.length;e++){let t=f[e],r=t.getAttribute("key");if(r){if(u[r]){d=r;break}u[r]=t,s.push(r),p[r]=!0}}if(d)return void a(`${t.camelCase(r.endNode._diName)} - duplicate key '${d}'`);let g=n;const m=r.startNode.parentNode;let y=[],v=[];t.each(p,((e,r)=>{g[r]||(v.push(r),delete p[r],t.remove(s,(e=>e===r)))}));let E,b=!1;if(!t.isEmpty(o)){let e=-1,n=[],i=[],a=0,l=0;for(;l<o.length;l++){const c=o[l];let d=s.findIndex((e=>e===c));if(d<0){let e=o[l-1],t=e?u[e]||e:r.startNode;y.push({prevNode:t,newkey:c}),a++}else if(d>-1&&d!==l-a){if(e<0||1===Math.abs(e-d)){let e=t.last(n);n.push({nodeId:c,targetId:0===l?Q.AFTER_BEGIN:e?e.nodeId:o[l-1]})}else i.push({moveGroup:n,moveIndex:l+n.length}),n=[],n.push({nodeId:c,targetId:o[l-1]});e=d}}if(n.length>0&&i.push({moveGroup:n,moveIndex:l+n.length}),i.length>0){b=!0;let e=i.sort(((e,t)=>e.moveGroup.length-t.moveGroup.length));if(e.length<2){let{moveGroup:n}=e[0];if(n.length>1){let e=t.last(n).targetId;n[n.length-2].nodeId===e&&(n=t.initial(n))}n.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===Q.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}else{let n=t.last(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-n)&&(e=t.initial(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===Q.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}))}}}if(y.length>0&&(E=function(e,r,n,s,o,i){const a=[],l=[],c=[];let u,d=[];e.forEach((e=>{let n=t.last(d);n&&u===e.prevNode?(n.group||(n.group=[u]),n.group.push(e.newkey)):d.push(e),u=e.newkey;let s=e.newkey;c.push(s),a.push(""),l.push(r[s])})),a.push("");let p=new tt(a,l),h=[...o],f=qe(i,p,s),g=je.get(i);o.length=0,o.push(...g);let m=new Map;return f.forEach((e=>{const t=e.getAttribute("key");c.includes(t)&&(m.set(t,!0),q[t]=e)})),h.forEach(((e,t)=>{const r=e.key+"";!m.get(r)&&n.includes(r)&&o.push(e)})),d}(y,c,o,i,l,r.endNode),E.forEach(((e,n)=>{let s=e.newkey,o=q[s],i=e.prevNode;if(e.group){let r=document.createDocumentFragment();r.append(...t.map(e.group,(e=>q[e]))),o=r}i===r.endNode?i.before(o):i===r.startNode?i.after(o):"string"==typeof i?q[i].after(o):i.after(o)}))),v.forEach((e=>{let t=u[e];t&&t.parentNode&&m.removeChild(t)})),h.vars[0]instanceof tt){let e=[],r=[];t.each(h.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),h=new tt(e,r)}if(b||v.length>0||E){const e=t.groupBy(l,(e=>e.key));let r=[],n=0;o.forEach((t=>{e[t].forEach((e=>{e.varIndex=n++,r.push(e)}))})),l=r}Ye(r.endNode,i,h,l)}}let Y=0;function J(e,t){let r=e.name||"Di-"+Y++,n=Symbol.for(r);return(...t)=>{let r=e(...t);return[n,t,r,e=>{},w.popDirectiveQ()]}}const Z=["resize","outside","mutate"],ee=new WeakMap,te=[],re=[],ne=[],se=new ResizeObserver((e=>{for(const t of e){const e=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize,r=Array.isArray(t.borderBoxSize)?t.borderBoxSize[0]:t.borderBoxSize;let n=ee.get(t.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:e.inlineSize,h:e.blockSize}}}),t.target)}}}));var oe;!function(e){e.Child="child",e.Tree="tree",e.Attr="attr",e.Char="char"}(oe||(oe={}));const ie=new WeakMap,ae=new MutationObserver((e=>{for(let t=0;t<e.length;t++){const r=e[t];let n=ie.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=oe.Tree,o=n[oe.Tree];break;case"childList":s.type=oe.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[oe.Child];break;case"attributes":s.type=oe.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[oe.Attr];break;case"characterData":s.type=oe.Char,s.oldValue=r.oldValue,o=n[oe.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function le(e,r,n,s){if("resize"===e)!function(e,t){ee.has(e)||(ee.set(e,t),se.observe(e))}(r,n);else if("outside"===e)switch(s[0]){case"mousedown":!function(e,t){te.push([e,t])}(r,n);break;case"dblclick":!function(e,t){ne.push([e,t])}(r,n);break;default:!function(e,t){re.push([e,t])}(r,n)}else"mutate"===e&&function(e,r,n){let s=t.includes(n,"child"),o=t.includes(n,"attr"),i=t.includes(n,"char"),a=t.includes(n,"tree"),l=ie.get(e);l||(l={},ie.set(e,l),s&&(l[oe.Child]=r),o&&(l[oe.Attr]=r),i&&(l[oe.Char]=r),a&&(l[oe.Tree]=r),ae.observe(e,{childList:s,attributes:o,characterData:i,subtree:a}))}(r,n,s)}document.addEventListener("mousedown",(e=>{let r=t.get(e.composedPath(),0,e.target);te.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("click",(e=>{let r=t.get(e.composedPath(),0,e.target);re.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("dblclick",(e=>{let r=t.get(e.composedPath(),0,e.target);ne.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1);const ce=/,|^(debounce:.+)|(debounce$)/,ue=/,|^(throttle:.+)|(throttle$)/,de="self",pe="stop",he="prevent",fe="once",ge="left",me="right",ye="middle",ve="ctrl",Ee="alt",be="shift",Te="meta",Se={esc:"escape"},Ce=":";function Ne(e,r,n,s){let o,i=e.split("."),a=i.shift(),l=i.includes(fe),c=r;if(o=t.find(i,(e=>ce.test(e)))){let e=o.split(Ce);c=t.debounce(c,parseInt(e[1])||100)}if(o=t.find(i,(e=>ue.test(e)))){let e=o.split(Ce);c=t.throttle(c,parseInt(e[1])||100)}if(l&&(c=t.once(c)),function(e){return Z.includes(e)}(a))return le(a,n,c,i),c;let u=e=>{if(i.includes(he)&&e.preventDefault(),i.includes(pe)&&e.stopPropagation(),!i.includes(de)||e.target===e.currentTarget){if(e instanceof MouseEvent){if(i.includes(ge)&&0!=e.button)return;if(i.includes(me)&&2!=e.button)return;if(i.includes(ye)&&1!=e.button)return}else if(e instanceof KeyboardEvent){if(t.remove(i,(e=>e==ve))[0]&&!e.ctrlKey)return;if(t.remove(i,(e=>e==Ee))[0]&&!e.altKey)return;if(t.remove(i,(e=>e==be))[0]&&!e.shiftKey)return;if(t.remove(i,(e=>e==Te))[0]&&!e.metaKey)return;let r=t.map(i,(e=>Se[e]||e));if(t.size(r)>0&&!r.includes(e.key.toLowerCase()))return}c(e)}};n.addEventListener(a,u);let d=s.__events[a];return d||(d=s.__events[a]=[]),d.push([n,u]),u}const _e="@",Ae=".",Pe="?",we="*",De=":",ke="ref",Me="key",Oe=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,xe="slot-props",Re=new Map,Le=new Map,Ue=new Map;var He;!function(e){e.Event="event",e.Directive="directive",e.DirectiveTag="directiveTag",e.DirectiveAttr="directiveAttr",e.DirectiveProp="directiveProp",e.DirectiveText="directiveText",e.DirectiveSlot="directiveSlot",e.Attr="attr",e.AttrProp="attrProp",e.AttrBool="attrBool",e.AttrRef="attrRef",e.AttrSlot="attrSlot",e.AttrKey="key",e.Ref="ref",e.Text="text"}(He||(He={}));const We=new WeakMap,je=new WeakMap,Ie=new WeakMap,Be=new WeakMap,Ve=new WeakMap,$e=new WeakMap;function Fe(e,r){let n="",s=t.concat(r.vars),o=r.strings.length-1,i=r.vars.length-1,a=0;for(let l=0;l<=o;l++){const o=r.strings[l];let c=t.get(s,a,"");if(c instanceof tt){let[t,r]=Fe(e,c);c=t,s.splice(a,1,...r),a+=r.length-1}else c=l>i?"":ze;a++,n=n+o+c}let l=0;return n=n.replace(Oe,((e,r)=>t.replaceAll(e,ze,(()=>ze.replace("--\x3e","")+l++)))),n=n.replace(et,"$1><").trim(),[n,s]}const ze="\x3c!--c_ui-pl_df--\x3e",Ge="\x3c!--c_ui-pl_df",Ke=/<!--c_ui-pl_df\d*(-->)?/;function Qe(r,n,s,o,i=!1){const a=document.createElement("div");a.innerHTML=n;const l=Ue.has(o.constructor);i||!l||Le.has(o.constructor)||Le.set(o.constructor,a.cloneNode(!0));let c=0;const u=document.createNodeIterator(a,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let d,p,h=0,f=l?void 0:{},g=null,m="";for(;d=u.nextNode();){c++;let n=l?void 0:[];if(p&&!p.contains(d)&&(p=void 0),d instanceof HTMLElement||d instanceof SVGElement){d instanceof G&&(p=d);let i={},a=t.toArray(d.attributes);for(let l=0;l<a.length;l++){const c=a[l];let{name:u,value:f}=c;if(u!==xe)if(t.startsWith(u,Ge)){let i=s[h];if(t.isArray(i)&&t.isSymbol(i[0])){let[,t,s,a,l]=i;a(e.EnterPointType.TAG);let c=new K(d,u.substring(1),e.EnterPointType.TAG),f=$e.get(d);f||(f={},$e.set(d,f)),f[Symbol.keyFor(i[0])]=[c,o,p];let y=new A(h,d);y.isDirective=!0,y.value=i,y.isComponent=!!p,r.push(y),g&&g?.contains(d)&&(y.key=m),h++,s(c,t,void 0,{renderComponent:o,slotComponent:p,varChain:l}),n&&n.push({type:He.DirectiveTag,point:c,up:y,name:u})}d.removeAttribute(u)}else if(u[0]!==_e)if(u!==ke)if(u!==Me){if(Ke.test(f)){let a=s[h],l=new A(h,d,u.replace(/\.|\?|@/,""),f);if(l.isComponent=!!p,g&&g?.contains(d)&&(l.key=m),u[0]===Ae||u[0]===Pe||u[0]===we){if(t.isArray(a)&&t.isSymbol(a[0])){let[,t,r,s,i]=a;s(e.EnterPointType.PROP);let c=u.substring(1),h=new K(d,c,e.EnterPointType.PROP),f=$e.get(d);f||(f={},$e.set(d,f)),f[c]=[h,o,p],r(h,t,void 0,{renderComponent:o,slotComponent:p,varChain:i}),l.value=a,l.isDirective=!0,n&&n.push({type:He.DirectiveProp,up:l,point:h,name:u,attrName:c})}else if(u[0]===Pe){l.isToggleProp=!0,l.value=!!a;let e=u.substring(1);l.value&&d.setAttribute(e,""),n&&n.push({type:He.AttrBool,name:e,up:l,attrName:u})}else if(u[0]===we){l.value=a;let e=u.substring(1);const[r,s]=e.split(De);let o=r;switch(s){case"camel":o=t.camelCase(o);break;case"kebab":o=t.kebabCase(o);break;case"snake":o=t.snakeCase(o)}l.attrName=o,d.setAttribute(o,a),n&&n.push({type:He.AttrRef,up:l,name:u,attrName:o})}else{let e=t.camelCase(u.substring(1));l.value=a,l.isProp=!0,i[e]=a,n&&n.push({type:He.AttrProp,up:l,name:e,attrName:u})}d.removeAttribute(u),a=""}else{let r,s;l.value=a;let i={type:He.Attr,up:l,attrName:u};if(t.isArray(a)&&t.isSymbol(a[0])){let t=e.EnterPointType.ATTR;"class"===u?t=e.EnterPointType.CLASS:"style"===u&&(t=e.EnterPointType.STYLE);let[,n,c,h,f]=a;h(t),l.isDirective=!0,l.attrName=u;let g=new K(d,u,t),m=$e.get(d);m||(m={},$e.set(d,m)),m[u]=[g,o,p],s=n,r=c,a="",i.type=He.DirectiveAttr,i.point=g}f=t.replace(f,Ke,a),c.value=f,r&&r(i.point,s,void 0,{renderComponent:o,slotComponent:p}),n&&n.push(i)}r.push(l),h++}}else{let e=s[h];d.setAttribute(u,e);let t=new A(h,d);t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),h++,g=d,m=e,n&&n.push({up:t,type:He.AttrKey}),r.length>0&&r.forEach((t=>{t.key=t.key??e}))}else{if(Ke.test(f)){let e=s[h],t=new A(h,d);t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),h++,e.current=d,n&&n.push({type:He.Ref,up:t,attrName:u})}d.removeAttribute(u)}else{let e=e=>{},t=null,i=!1;if(Ke.test(f)){t=new A(h,d),t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),e=s[h].bind(o),h++,i=!0}let a=u.substring(1);Ne(a,e,d,o),d.removeAttribute(u),n&&n.push({type:He.Event,up:t,name:a,attrName:u,value:i})}else{let e=d.getAttribute("name")||"default";n&&n.push({type:He.AttrSlot,name:e,attrName:u})}}d instanceof G?(d._initProps(i),d._regWrapper(o)):d instanceof HTMLSlotElement&&o._bindSlot(d,d.name||"default",i)}else{let i=d;if(`\x3c!--${i.nodeValue}--\x3e`!==ze)continue;let a=new A(h,d);g&&g?.contains(d)&&(a.key=m),r.push(a),a.isComponent=!!p,a.isText=!0;let l=s[h];if(t.isArray(l)&&t.isSymbol(l[0])){const t=Symbol.keyFor(l[0]);let r;r=document.createComment(`compelem-${o.tagName}-${t}-start`),a.textNode=r,i.parentNode.insertBefore(r,i),i.nodeValue=`compelem-${o.tagName}-${t}-end`,i._diName=t,a.isDirective=!0,a.value=l;let s=p?e.EnterPointType.SLOT:e.EnterPointType.TEXT,[,c,u,d,h]=l;d(s);let f=new K(r,"",s);f.endNode=i,Be.set(i,[f,o,p,c,h]),Ie.set(i,u),Ve.set(i,a),w.startRender(i);let g=u(f,c,void 0,{renderComponent:o,slotComponent:p,varChain:h});if(w.endRender(o),g){let e=qe(i,g[1],o);e&&e.length>0&&Je.insertBefore(i,Array.from(e))}l=void 0,n&&n.push({type:s===e.EnterPointType.SLOT?He.DirectiveSlot:He.DirectiveText,up:a,point:f})}else a.value=l,n&&n.push({type:He.Text,up:a});h++;let c=t.toString(l??""),u=document.createTextNode(c);i.parentNode.insertBefore(u,i),a.textNode=u}f&&n&&(f[c]=n),g&&!g.contains(d)&&g!==d&&(g=null,m="")}return!i&&f&&Ue.set(o.constructor,f),a.childNodes}function qe(e,t,r){let[n,s]=Fe(r,t),o=[],i=Qe(o,n,s,r,!0);return je.set(e,o),i}function Xe(r,n,s,o){if(t.isBlank(t.join(r.strings)))return;if(!We.has(n))return;let i=r.flatVars(n);s=s??We.get(n);for(let r=0;r<s.length;r++){const a=s[r];let l=a.varIndex;if(l<0)continue;if(a.notUpdated)continue;let c=a.value,u=i,d=a.node,p=t.split(l,P);for(let e=0;e<p.length;e++){const n=p[e];u=t.get(u,n),u&&u.vars&&r<p.length-1&&(u=u.vars)}if(!t.isObject(c)&&c===u)continue;let h=d;if(a.isDirective){let[t,r,n,,s]=a.value,o=Be.get(d);if(!o){const e=$e.get(d);o=e[a.attrName]||e[Symbol.keyFor(t)]}let[i,l,c]=o,[,p]=u;const h=Ve.get(d);if(h){h.value=u;Be.get(d)[3]=p}X(i,p,r,n,l,c,s,i.type==e.EnterPointType.TEXT||i.type==e.EnterPointType.SLOT)}else if(a.isToggleProp){if(!!u===c)continue;h.toggleAttribute(a.attrName,!!u),t.set(h,a.attrName,!!u)}else if(a.isProp){if(!t.isObject(u)&&u===c)continue;if(d instanceof G)if(t.isObject(u)&&Object.is(u,c)){let e=t.camelCase(a.attrName),r=[e];if(o&&o.length>0){let n="",s=t.join(k.get(a.value),P);o.forEach((e=>{e.startsWith(s)&&e.length>n.length&&(n=e)})),r=t.concat(t.split(n.replace(s,e),P))}U(d,c,r)}else d._updateProps({[a.attrName]:u});else d instanceof HTMLSlotElement&&n._updateSlot(d.getAttribute("name")||"default",a.attrName,u)}else if(a.attrName){if(!t.isEqual(c,u))switch(a.attrName){case"value":if(d instanceof HTMLInputElement){d.value=u;break}default:d.setAttribute(a.attrName,t.replace(a.attrTmpl,Ke,u+""))}}else if(a.isText){a.textNode.textContent=t.toString(u??"")}a.value=u}}function Ye(e,r,n,s){const o=Ie.get(e),[i,a,l,c,u]=Be.get(e),d=Ve.get(e);if(!n){let e=o(i,d.value[1],c,{renderComponent:a,slotComponent:l,varChain:u});if(!e)return;n=e[1]}if(n&&n.vars[0]instanceof tt){let e=[],r=[];t.each(n.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),n=new tt(e,r)}s&&je.set(e,s),Xe(n,r,s=s??je.get(e))}const Je={insertBefore:function(e,t){if(!e.parentNode)return;let r=document.createDocumentFragment();r.append(...t),e.parentNode.insertBefore(r,e)},remove:function(e,t){if(e===t)return void e?.parentNode?.removeChild(e);let r=e.nextSibling;for(;r&&r!==t;)r?.parentNode?.removeChild(r),r=e.nextSibling}};function Ze(e,...r){return new tt(t.isString(e)?[e]:e,r)}const et=/([a-z0-9"'])\s*>\s*</gim;class tt{strings;vars;constructor(e,r){this.strings=t.concat(e),this.vars=r}getKey(){let e=this.vars,n="";return t.each(this.strings,((s,o)=>{if(r.test(s))return n=t.toString(e[o]),!1})),n}getKeys(){let e=this.vars,n=[];for(let s=0;s<this.strings.length;s++){const o=this.strings[s];if(r.test(o)){let r=t.toString(e[s]);n.push(r)}}return t.isEmpty(n)&&e.forEach((e=>{if(e instanceof tt){let t=e.getKey();n.push(t)}})),n}append(e){let r=t.last(this.strings);return e.strings.forEach(((e,t)=>{0!=t?this.strings.push(e):this.strings[this.strings.length-1]=r+e})),this.vars=t.concat(this.vars,e.vars),this}insert(e,t){let r=t.strings.shift();return this.strings[e]+=r,this.strings.splice(e+1,0,...t.strings),this.vars.splice(e,0,...t.vars),this}getHTML(e){let[r,n]=Fe(e,this),s=Qe([],r,n,e);return t.reduce(s,((e,t)=>e+(t.outerHTML??"")),"")}flatVars(e){let r=t.concat(this.vars),n=this.strings.length-1,s=0;for(let o=0;o<=n;o++){let n=t.get(r,s,"");if(n instanceof tt&&n.vars.length>0){let[t,o]=Fe(e,n);n=t,r.splice(s,1,...o),s+=o.length-1}s++}return r}}const rt=E(class extends h{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.debounce(o,this.wait,this.immediate));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;immediate;result;constructor(e,t=!1){super(),this.wait=e,this.immediate=t}});const nt=E(class extends h{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.bind(t.get(e,n),e);t.set(e,n,t.once(o));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(){super()}});var st;e.QueryCache=void 0,(st=e.QueryCache||(e.QueryCache={})).ONCE="once",st.UPDATABLE="updatable";class ot extends h{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){}mounted(e,t,...r){}get targets(){return[e.DecoratorType.FIELD]}selector;cache;result;constructor(e,t){super(),this.selector=e,this.cache=t}static getKey(e){return e}getter(e){this.result=e.shadowRoot?.querySelector(this.selector)}beforeMount(e,t,r,n,...s){const o=this;Reflect.defineProperty(e,n,{get:()=>(o.result&&o.cache||o.getter(e),o.result)})}updated(t,r){this.cache===e.QueryCache.UPDATABLE&&this.getter(t)}}const it=E(ot),at=E(class extends ot{getter(e){this.result=e.shadowRoot?.querySelectorAll(this.selector)}});function lt(e,r,n){if(!t.has(e.constructor,s.STATES)){const r={};let n=e.constructor;for(;(n=u(n))!==G;)t.merge(r,n[s.STATES]?t.cloneDeep(n[s.STATES]):{});Reflect.defineProperty(e.constructor,s.STATES,{configurable:!1,enumerable:!1,value:r})}n.shallow=n.shallow||!1,e.constructor[s.STATES][r]=n}const ct=E(class extends h{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.throttle(o,this.wait));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(e){super(),this.wait=e}});const ut=["key"],dt=J((function(e){return(e,[r],n)=>{let o=e.startNode;if(n)t.each(r,((e,t)=>{o.setAttribute(t,e)}));else if(o instanceof G){let e={},n={},i=t.get(o.constructor,s.PROPS);t.each(r,((r,s)=>{if(ut.includes(s))return;let o=t.camelCase(s);i[o]?e[s]=r:n[s]=r+""})),o._initProps(e,n)}else t.each(r,((e,t)=>{o.setAttribute(t,e)}))}}),e.EnterPointType.TAG),pt=new Map,ht=J((function(e){return(e,[r],n,{renderComponent:s})=>{let o=[];if(t.isArray(r)?o=t.compact(r):t.isObject(r)?o=t.flatMap(r,((e,t)=>e?t:[])):t.isString(r)&&(o=r.split(" ")),o.length<1&&!n)return;let i=e.startNode;if(pt.get(i)&&pt.get(i).length===o.length&&t.isMatch(pt.get(i),o))return;let a=pt.get(i);t.each(a,(e=>{i.classList.remove(e)})),t.each(o,(e=>{i.classList.add(e)})),a=t.concat(o),pt.set(i,a)}}),e.EnterPointType.CLASS),ft=new Map,gt=new Map,mt=J((function(n,s){return(n,o,i,{varChain:l})=>{let c=n.startNode,u=function(e,n,s){let o=t.map(e,((e,t)=>n(e,t)));if(o.length<1){let e=new tt([],[]);return gt.set(s,e),e}let i=[],l=[];const c=[],u=[];for(let e=0;e<o.length;e++){const n=o[e];let s=t.last(l),d=n.vars,p=!0,h=n.strings;for(let e=0;e<h.length;e++){const t=h[e];if(r.test(t)){let t=d[e]+"";if(i.includes(t))return void a(`forEach - duplicate key '${t}'`);i.push(t),p=!1}0==e&&s?l[l.length-1]=s+t:l.push(t)}if(p)return void a("forEach - missing 'key' prop");let f=t.last(c);f&&h.length>0&&(c[c.length-1]=t.trim(f)+h.shift()),c.push(""),u.push(n)}c.push("");let d=new tt(c,u);return gt.set(s,d),d}(o[0],s,c);if(i&&i[0]){const r=ft.get(c);if(t.isEmpty(n.getNodes())&&(!o||t.isEmpty(o[0])))return[e.DirectiveUpdateTag.NONE,u];if(r&&t.isMatch(r,o[0])&&r.length===o[0].length)return[e.DirectiveUpdateTag.NONE,u]}return ft.set(c,t.clone(o[0])),i?[e.DirectiveUpdateTag.UPDATE,u]:[e.DirectiveUpdateTag.APPEND,u]}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));const yt=new WeakMap,vt=J((function(t,r,n){return(s,[o,i],a,{renderComponent:l})=>{let c=s.endNode;if(a){if(!!o==!!a[0]){let t=yt.get(c);return[e.DirectiveUpdateTag.NONE,t.call(l,o)]}let t=o?r:n;return yt.set(c,t),[e.DirectiveUpdateTag.REPLACE,t.call(l,o)]}{let s=o?r:n;return yt.set(c,s),[e.DirectiveUpdateTag.APPEND,s.call(l,t)]}}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT)),Et=J((function(t,r){return(t,[r,n],s)=>s?r===s[0]?[e.DirectiveUpdateTag.NONE,r?n():Ze``]:r?[e.DirectiveUpdateTag.REPLACE,r?n():Ze``]:[e.DirectiveUpdateTag.REMOVE]:[e.DirectiveUpdateTag.APPEND,r?n():Ze``]}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));var bt;e.ModelTriggerType=void 0,(bt=e.ModelTriggerType||(e.ModelTriggerType={})).CHANGE="change",bt.INPUT="input";const Tt=new WeakMap,St=J((function(e,r="value"){return(n,s,o,{varChain:i,renderComponent:a})=>{const l=n.startNode;if(o){if(t.isEqual(s,o))return;if(!t.isEqual(s,o)){let e=s[0];if(l instanceof G)l._updateProps({[r]:e});else if(l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement){if(l.setAttribute(r,e+""),l instanceof HTMLSelectElement){let r=t.find(l.querySelectorAll("option"),(t=>t.value==e));r&&(r.selected=!0)}}else if(l instanceof HTMLInputElement){if(l.value==e)return;switch(l.type){case"checkbox":case"radio":e?l.setAttribute("checked",""):l.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":l.setAttribute(r,e+""),t.set(l,r,e);break;default:l.setAttribute(r,e+"")}}}return}if("binded"===t.get(l,"_model"))return;let c=t.last(i);if(Tt.set(l,c),t.isObject(e)||t.trim(e)||(e=""),l instanceof G)l._initProps({[r]:e}),l.addEventListener("update:"+r,(e=>{t.set(a,c,e.detail.value)})),t.set(l,"_model","binded");else if(l instanceof HTMLTextAreaElement)l.setAttribute(r,e+""),l.addEventListener("input",(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded");else if(l instanceof HTMLInputElement){let n="",s="";switch(l.type){case"checkbox":case"radio":n="checked",s="change";break;default:n="value",s="input"}l.setAttribute(r??n,e+""),l.addEventListener(s,(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded")}else l instanceof HTMLSelectElement&&(l.setAttribute(r,e+""),l.addEventListener("change",(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded"))}}),e.EnterPointType.TAG),Ct=new Map,Nt=J((function(e,t){return(e,[r],n)=>{if(n&&r===n[0])return;let s=e.startNode;if(!Ct.has(s)){let e=s.style.display;Ct.set(s,"none"==e?"unset":e)}s.style.display=r?Ct.get(s):"none",t&&t(s,r)}}),e.EnterPointType.TAG),_t=J((function(e,t){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(e=e.bind(o),i._bindSlotHook(t||"default",e))}}),e.EnterPointType.SLOT);class At{static getCssText(e,r=!1){return t.isString(e)?e:t.join(t.map(e,((e,n)=>n.startsWith("--")?n+":"+e+(r?" !important":""):t.kebabCase(n)+":"+e+(r?" !important":""))),";")}static setStyle(e,r){if(t.isString(e)&&!t.trim(e))return{};let n=At.getCssText(e),s={};return t.each(n.split(";"),(e=>{let n=e.split(":"),o=t.trim(n[0]),i=t.trim(n[1]);s[o]=r.style.getPropertyValue(o),r.style.setProperty(o,i)})),s}}const Pt=new Map;let wt=0;const Dt=J((function(e){return(e,t,r,{renderComponent:n})=>{let s=e.startNode,o=Pt.get(s);o||(o="style_d"+wt++,Pt.set(s,o)),n.nextTick((()=>{At.setStyle(t[0],s)}),o)}}),e.EnterPointType.STYLE),kt=J((function(e){return(r,n,s,{renderComponent:o,varChain:i})=>{const a=r.startNode;if(s){if(!t.isEqual(n,s)){let e=r.attrName;a._updateProps({[e]:n[0]})}return}let l=t.last(i),c=r.attrName;a._initProps({[c]:e}),a.addEventListener("update:"+c,(e=>{t.set(o,l,e.detail.value)}))}}),e.EnterPointType.PROP),Mt=J((function(r,n){return(r,[n,s],o)=>{let i=()=>Ze``,a=[],l=[];t.each(s,((e,r)=>{if(t.isFunction(e))a.push(r),l.push(e);else{let t=e[0],r=e[1];a.push(t),l.push(r)}"default"===r&&(i=e)}));let c=t.findIndex(a,(e=>t.isFunction(e)?e(n):e==n));return o?[e.DirectiveUpdateTag.REPLACE,t.call(l[c]??i)]:[e.DirectiveUpdateTag.APPEND,t.call(l[c]??i)]}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));e.CompElem=G,e.CssHelper=At,e.Decorator=h,e.DecoratorWrapper=y,e.EnterPoint=K,e.GetKeyFnName=f,e.PATH_SEPARATOR=P,e.PROP_OBJECT_KEY_MAP_SYMBOL=z,e.Template=tt,e.UpdatePoint=A,e._DecoratorMap=m,e._DecoratorsKey=g,e._getObservedAttrs=C,e.bind=dt,e.buildHTML=Fe,e.classes=ht,e.computed=function(e,r,n){n.get||a(`Computed '${r}' must be a getter`),t.has(e.constructor,s.COMPUTED)||(e.constructor[s.COMPUTED]=t.isEmpty(e.constructor[s.COMPUTED])?{}:t.cloneDeep(e.constructor[s.COMPUTED])),e.constructor[s.COMPUTED][r]=n.get},e.createRef=function(e){return{current:e}},e.debounced=rt,e.decorator=E,e.directive=J,e.event=function(e,r){return(n,o,i)=>{t.has(n.constructor,s.EVENTS)||(n.constructor[s.EVENTS]=t.isEmpty(n.constructor[s.EVENTS])?[]:t.cloneDeep(n.constructor[s.EVENTS])),n.constructor[s.EVENTS].push({name:e,options:r,fn:n[o]})}},e.forEach=mt,e.html=Ze,e.ifElse=vt,e.ifTrue=Et,e.makeState=function(e,t,r){lt(e.prototype,t,r||{prop:""})},e.model=St,e.onced=nt,e.prop=function(e){if(1===arguments.length)return(t,r,n)=>{e.required=e.required||!1,e.attribute=!1!==e.attribute,T(t,r,e,n)};let r=arguments[0],n=arguments[1],s=arguments[2];e={type:void 0,required:!1,attribute:!0},s&&"function"==typeof s.type&&(e=t.defaults(s,e),s=void 0),T(r,n,e,s)},e.query=it,e.queryAll=at,e.show=Nt,e.slot=_t,e.state=function(e){if(1===arguments.length)return(t,r)=>{lt(t,r,e)};lt(arguments[0],arguments[1],{prop:""})},e.styles=Dt,e.sync=kt,e.tag=function(e){return t=>{if(t){if(t.prototype.hasOwnProperty("attributeChangedCallback")){let e=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,r,n){G.prototype.attributeChangedCallback.call(this,t,r,n),e.call(this,t,r,n)}}if(t.prototype.hasOwnProperty("connectedCallback")){let e=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){G.prototype.connectedCallback.call(this),e.call(this)}}if(t.prototype.hasOwnProperty("disconnectedCallback")){let e=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){G.prototype.disconnectedCallback.call(this),e.call(this)}}customElements.define(e,t)}}},e.throttled=ct,e.updateDirective=X,e.watch=function(e,r){return(n,o)=>{t.has(n.constructor,s.WATCH)||(n.constructor[s.WATCH]=t.isEmpty(n.constructor[s.WATCH])?{}:t.cloneDeep(n.constructor[s.WATCH]));(t.isArray(e)?e:[e]).forEach((e=>{let i=e.replaceAll(".",P),a=n.constructor[s.WATCH][i];t.isArray(a)||(a=n.constructor[s.WATCH][i]=[]),a.push({source:e,options:r,handler:n[o]})}))}},e.when=Mt,Object.defineProperty(e,"__esModule",{value:!0})}));
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("myfx")):"function"==typeof define&&define.amd?define(["exports","myfx"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).compelem={},e.myfx)}(this,(function(e,t){"use strict";const r=/\s+\.?key\s*=/;var n,s,o,i;function a(e){console.error("[CompElem]",e)}function l(e,t){console.error(`[CompElem <${e}>]`,t)}function c(e){return t.toPath(e).join("-")}function u(e){return Object.getPrototypeOf(e)}function d(e){return e===Boolean||t.some(e,(e=>e===Boolean))}function p(e){let r=e;return t.isString(e)&&/(?:^true$)|(?:^false$)/.test(r)?r="true"===r:(t.isUndefined(r)||t.isBlank(r))&&(r=!0),r}!function(e){e[e.CSS=1]="CSS",e[e.COMPUTED=2]="COMPUTED"}(n||(n={})),function(e){e.PROPS="__deco_props",e.STATES="__deco_states",e.COMPUTED="__deco_computed",e.WATCH="__deco_watch",e.EVENTS="__deco_events"}(s||(s={})),function(e){e.Prod="prod",e.Dev="dev"}(o||(o={})),e.DecoratorType=void 0,(i=e.DecoratorType||(e.DecoratorType={})).CLASS="class",i.FIELD="field",i.METHOD="method";class h{static get priority(){return 0}}const f="getKey",g="__decorators",m=new WeakMap;class y{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(e,r,n){this.args=e,this.metadata=r,this.decoratorClass=n,this.priority=t.get(n,"priority",0),this.instanceMap=new WeakMap}create(r){let n,s=new this.decoratorClass(...this.args),o=s.targets,i=this.metadata[2];t.isObject(i)&&t.isDefined(t.get(i,"configurable"))?n=e.DecoratorType.METHOD:t.isUndefined(this.metadata[2])&&(n=e.DecoratorType.FIELD),!t.isEmpty(o)&&n&&o.includes(n)?(s.created(r,...this.metadata),this.instanceMap.set(r,s)):a(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${o.join(",")}' bug got '${n}'`)}beforeMount(e,t){this.instanceMap.get(e).beforeMount(e,t,...this.metadata)}mounted(e,t){this.instanceMap.get(e).mounted(e,t,...this.metadata)}updated(e,t){this.instanceMap.get(e).updated(e,t)}}const v=new WeakMap;function b(e){let r=(...r)=>(...n)=>{let s=n[0].constructor,o=s[g];if(!t.has(s,g)){let e=Object.getPrototypeOf(s);o=e?t.concat(e[g]??[]):[],Reflect.defineProperty(s,g,{configurable:!1,enumerable:!1,value:o})}let i,a={},l=e[f];if(l){let t=v.get(e);if(t||(t=new WeakMap,v.set(e,t)),a=t.get(s),a||(a={},t.set(s,a)),i=l(...r),a[i])return a[i]}let c=new y(r,n,e);return a[i]=c,o?.push(c),c};return m.set(r,!0),r}const E=new WeakMap;function T(e,r,n,o){let i;if(t.isLowerCaseChar(r[0])||a(`Prop '${r}' must be in CamelCase`),!t.has(e.constructor,s.PROPS)){const r={};let n=e.constructor;for(;(n=u(n))!==G;)t.merge(r,n[s.PROPS]?t.cloneDeep(n[s.PROPS]):{});Reflect.defineProperty(e.constructor,s.PROPS,{configurable:!1,enumerable:!1,value:r}),i=new Set,t.each(r,((e,r)=>{if(e.attribute){let e=t.kebabCase(r);i?.add(e)}})),E.set(e.constructor,i)}if(o&&(o.get&&(n.getter=o.get),o.set&&(n.setter=o.set)),n.attribute){i||(i=E.get(e.constructor));let n=t.kebabCase(r);i?.add(n)}t.has(e.constructor,"observedAttributes")||(e.constructor.observedAttributes=[]),e.constructor.observedAttributes=t.toArray(i),e.constructor[s.PROPS][r]=n}const S=new Set;function C(e){return E.get(e)??S}var _,N;e.EnterPointType=void 0,(_=e.EnterPointType||(e.EnterPointType={})).ATTR="attr",_.PROP="prop",_.TEXT="text",_.CLASS="class",_.STYLE="style",_.SLOT="slot",_.TAG="tag",e.DirectiveUpdateTag=void 0,(N=e.DirectiveUpdateTag||(e.DirectiveUpdateTag={})).NONE="NONE",N.REMOVE="REMOVE",N.REPLACE="REPLACE",N.UPDATE="UPDATE",N.APPEND="APPEND";class A{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(e,t,r,n){this.varIndex=e,this.node=t,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}const P="-",w={collectWatch(e,t,r){let n=x.get(e);n||(n={},x.set(e,n));let s=n[r];s||(s=n[r]=[]),s.push(t)},startCollect(e,t){this.__collectType=t,this.__collecting=e},setUpdater(e){this.__updater=e},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(e){let r=t.last(this.__directiveQ);const n=e?e.join(","):"",s=r?r.join(","):"";r&&n===s||(r&&r.length<e.length&&t.startsWith(n,s)?this.__directiveQ[this.__directiveQ.length-1]=e:this.__directiveQ.push(e))},popDirectiveQ(){let e=t.concat(this.__directiveQ);return this.__directiveQ=[],e},startRender(e){this.__renderCollecting=!0,this.__renderContext=e},endRender(e){this.__renderCollection.forEach((t=>{e._regDeps(t,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(e){this.__renderCollection.add(e)},clear(){this.__directiveQ=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},D=new WeakMap,k=new WeakMap,M=new WeakMap,O=new WeakMap,x=new WeakMap,R=new WeakMap;function L(e,r){if(!t.isObject(e))return e;if(R.has(e))return R.get(e);if(D.has(e))return e;const o=new Proxy(e,{get(e,r,o){if(!r)return;const i=Reflect.get(e,r,o);if(t.isSymbol(r))return i;if("length"===r&&t.isArray(e))return i;let a=k.get(o)??[],l=t.concat(a,[r]),u=r in e;if((w.__renderCollecting||w.__collecting)&&(u&&e.hasOwnProperty(r)||!u)){let e=l.join(P);if(w.__renderCollecting)w.collect(c(l)),w.setDirectiveQ(l);else if(w.__collecting){let t;switch(w.__collectType){case n.COMPUTED:t=M.get(w.__collecting),t||(t={},M.set(w.__collecting,t));break;case n.CSS:t=O.get(w.__collecting),t||(t={},O.set(w.__collecting,t))}let r=t[e];r||(r=t[e]=[]),r.push(w.__updater)}}const d=D.get(o);let p=d.from,h=t.get(p.constructor,s.STATES);if(t.get(h,[r,"shallow"]))return i;let f=i;if(t.isObject(i)&&!t.isFunction(i)&&!(i instanceof Node)&&!Object.isFrozen(i)){let e=d.pathMap;d.contextSet.forEach((t=>{let r=e?.get(t);r&&(f=L(i,t),R.set(i,f),k.has(f)||k.set(f,l))}))}return f},set(e,n,o,i){if(!n)return!1;let a=e[n],l=k.get(i)??[],c=t.concat(l,[n]),u=t.get(r.constructor,s.PROPS),d=t.get(r.constructor,s.STATES),p=t.get(u,[c[0],"hasChanged"])||t.get(d,[c[0],"hasChanged"]);if(p){let e=o,t=a;if(c.length>1&&(t=e=r._getPrivateData()[c[0]]),!p.call(r,e,t,c,o,a))return!0}else if(Object.is(a,o))return!0;u&&u[n]&&e.__isData&&u[n].sync&&r.emit("update:"+n,{value:o});let h=o,f=Reflect.set(e,n,h);return U(r,a,c),f}});let i=k.get(e)??[];if(Object.isExtensible(e)&&!D.get(o)){let e=new Set;e.add(r);let t=new WeakMap;t.set(r,i),D.set(o,{from:r,contextSet:e,pathMap:t})}else{D.get(o).contextSet.add(r);let e=D.get(o).pathMap,n=e.get(r),s=t.concat(i);if(n&&n.join("")!==s.join("")){let e=t.get(r,t.initial(n));t.isArray(e)||function(...e){console.warn("[CompElem]",...e)}(`The object is referenced by more than one @state '${s.join(".")},${n.join(".")}'`),n=s}else e.set(r,s)}return R.set(e,o),o}function U(e,r,n){let s=M.get(e),o=O.get(e),i=x.get(e);if(s||o||i){let e=n.length;for(;e;){let a=n.slice(0,e).join(P);if(i){const s=i[a];e===n.length?s?.forEach((e=>{let t=e();t.ov=r,W.pushWatch(t)})):s?.forEach((e=>{let n=e();t.get(n,"deep")&&(n.ov=r,W.pushWatch(n))}))}if(s){let e=s[a];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];W.pushComputed(r)}}if(o){let e=o[a];if(!t.isEmpty(e))for(let t=0;t<e.length;t++){const r=e[t];W.pushCss(r)}}e--}}let a=e._notify(r,n);W.pushNext(a,e.cid)}const H=new Map;class W{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){W.nextPending=!1;let e=Array.from(W.watchSet);W.watchSet.clear();let r=Array.from(W.computedSet);W.computedSet.clear();let n=Array.from(W.cssSet);W.cssSet.clear();let s=Array.from(W.nextSet);W.nextSet.clear(),H.clear(),e.forEach((e=>e(t.get(e,"ov")))),r.forEach((e=>e())),n.forEach((e=>e())),s.forEach((e=>e()))}static pushWatch(e){W.watchSet.add(e)}static pushComputed(e){W.computedSet.add(e)}static pushCss(e){W.cssSet.add(e)}static pushNext(e,t){if(t){if(H.has(t))return;H.set(t,e)}W.nextSet.add(e),W.nextPending||(W.nextPending=!0,W.next())}}(()=>{const e=Promise.resolve(),t=W.flush;W.next=()=>{e.then(t)}})();const j={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},I=new WeakMap;let B=[],V=0;const $=new Map,F=new WeakMap,z=Symbol.for("PROP_OBJECT_KEY_MAP_SYMBOL");class G extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(e){B=t.flatMap(e.css,(e=>{if(t.isString(e)){let t=new CSSStyleSheet;return t.replaceSync(e),t}return e instanceof CSSStyleSheet?e:[]})),e.global,t.each(e,((e,r)=>{t.test(r[0],/[A-Z]/)}))}#e;#t={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#e}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#p}get slotHooks(){return this.#h}get css(){return I.get(this.constructor)}get globalStyleSheet(){return $.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#p;#g={};#h={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#y=!1;#v=!1;constructor(...e){super(),this.#e=V++,1===t.size(e)&&(this.#l={},t.assign(this.#l,t.first(e)));let r=this.render.bind(this);this.render=function(){let e;return w.startRender(this),e=r(),w.endRender(this),e};let n=t.get(this.constructor,"globalStyles"),s=$.has(this.constructor);if(!t.isEmpty(n)&&!s){let e="";n.forEach((r=>{t.isString(r)&&(e+=r+"\n")}));let r=document.createElement("style");r.textContent+=e,$.set(this.constructor,r),document.head.appendChild(r)}let o=I.get(this.constructor),i=o??[];o||(t.each(t.get(this.constructor,"styles"),(e=>{if(t.isString(e)){let t=new CSSStyleSheet;t.replaceSync(e),i.push(t)}else i.push(e)})),I.set(this.constructor,i)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...B,...i],this.#b();let a=t.get(this.constructor,g);a&&a.sort(((e,t)=>t.priority-e.priority)).forEach((e=>e.create(this))),this.#E=this.#T.bind(this)}get rootComponent(){let e=this;for(;e.parentComponent;)e=e.parentComponent;return e}#E;connectedCallback(){let e=t.closest(this.parentNode,(e=>e instanceof G||e.host instanceof G),"parentNode");this.#d=e?e instanceof G?e:e.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#y)return;if(this.#v)return;this.#v=!0,this.#b();const e=this.#S();this.propsReady(e);for(const t in e){const r=e[t];this.#r[t]=r}this.#C(),t.each(this.#r,((e,t)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,t);Reflect.defineProperty(this,t,{get(){let e=Reflect.get(this.#n,t);return r?.get?r?.get():e},set(e){r?.set?r?.set(e):Reflect.set(this.#n,t,e)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=L(this.#r,this);let r=t.get(this.constructor,s.COMPUTED);t.each(r,((e,t)=>{w.startCollect(this,n.COMPUTED),w.setUpdater((()=>{this.#n[t]=e.call(this)})),this.#r[t]=e.call(this),w.endCollect(),Reflect.defineProperty(this,t,{get(){return Reflect.get(this.#n,t)},set(e){l(this.tagName,"Cannot set a computed property '"+t+"'")}})}));let o=t.get(this.constructor,s.WATCH);t.each(o,((e,r)=>{e.forEach((e=>{let{source:n,options:s,handler:o}=e,i=o.bind(this);t.get(s,"once",!1)&&(i=t.once(i));const a=function(e){let r=t.get(this,n.replaceAll(P,"."));i(r,e,n)}.bind(this);let l=t.get(s,"deep",!1);if(a.deep=l,w.collectWatch(this,(()=>a),r),!t.get(s,"immediate",!1))return;let c=t.get(this,n.replaceAll(P,"."));i(c,c,n)}))}));let i=function(e,r){let n,s=[];if(Re.has(r.constructor)){let o=Re.get(r.constructor),i=function(e,r){let n=t.concat(r.vars),s=r.strings.length-1;for(let o=0;o<=s;o++){let s=t.get(r.vars,o,"");if(s instanceof tt){let[t,r]=Fe(e,s);n.splice(o,1,...r)}}return n}(r,e);n=Le.has(r.constructor)?function(e,r,n){let s=Le.get(n.constructor)?.cloneNode(!0),o=Ue.get(n.constructor);const i=document.createNodeIterator(s,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,c=0,u=0;for(;a=i.nextNode();){let s;if(u++,l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof G&&(l=a);let i={},d=o[u];d&&d.forEach((o=>{let u=r[c++];switch(o.type){case He.Event:s=t.clone(o.up),o.value||c--,o.value&&_e(o.name,u.bind(n),a,n),a.removeAttribute(o.attrName);break;case He.AttrSlot:l&&o.name,a.removeAttribute(o.attrName);break;case He.Ref:s=t.clone(o.up),u.current=a,a.removeAttribute(o.attrName);break;case He.AttrKey:s=t.clone(o.up),a.setAttribute(Me,u);break;case He.AttrBool:s=t.clone(o.up),s.value=!!u,s.node=a,s.value&&a.setAttribute(o.name,""),a.removeAttribute(o.attrName);break;case He.AttrProp:s=t.clone(o.up),s.value=u,s.node=a,i[o.name]=u,o.attrName&&a.removeAttribute(o.attrName);break;case He.AttrRef:case He.Attr:s=t.clone(o.up),s.value=u,s.node=a,a.setAttribute(o.attrName,u),He.AttrRef===o.type&&a.removeAttribute(o.name);break;case He.DirectiveAttr:case He.DirectiveTag:case He.DirectiveProp:s=t.clone(o.up),s.value=u,s.node=a;let e=t.clone(o.point);e.startNode=a;let[r,d,p,h,f]=u,g=$e.get(a);if(g||(g={},$e.set(a,g)),g[o.attrName??Symbol.keyFor(r)]=[e,n,l],p(e,d,void 0,{renderComponent:n,slotComponent:l,varChain:f}),He.DirectiveAttr===o.type){let e=a.getAttribute(o.attrName);e=t.replace(e,Ke,""),a.setAttribute(o.attrName,e)}o.name&&a.removeAttribute(o.name)}s&&e.push(s)})),a instanceof G?(a._regWrapper(n),t.size(i)>0&&a._initProps(i)):a instanceof HTMLSlotElement&&n._bindSlot(a,a.name||"default",i)}else{let i=o[u];i&&i.forEach((o=>{let i=r[c++];switch(o.type){case He.DirectiveSlot:case He.DirectiveText:s=t.clone(o.up),s.value=i,s.node=a;let[e,r,c,u,d]=i,p=Symbol.keyFor(e),h=document.createComment(`compelem-${n.tagName}-${p}-start`);s.textNode=h,a.parentNode.insertBefore(h,a),a.nodeValue=`compelem-${n.tagName}-${p}-end`;let f=t.clone(o.point);f.startNode=h,f.endNode=a,Be.set(a,[f,n,l,r,d]),Ie.set(a,c),Ve.set(a,s),w.startRender(a);let g=c(f,r,void 0,{renderComponent:n,slotComponent:l,varChain:d});w.endRender(n);let m=qe(a,g[1],n);m&&m.length>0&&Je.insertBefore(a,Array.from(m));break;case He.Text:s=t.clone(o.up),s.node=a;let y=t.toString(i??""),v=document.createTextNode(y);a.replaceWith(v),s.textNode=v}s&&e.push(s)}))}}return s.childNodes}(s,i,r):Qe(s,o,i,r)}else{let[t,o]=Fe(r,e);Re.set(r.constructor,t),n=Qe(s,t,o,r)}return We.set(r,s),n}(this.render(),this);i&&(this.#o.append(...i),this.#u=t.filter(this.#o.childNodes,(e=>e.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),t.each(this.#h,((e,t)=>{this.#_(t)}));const a=this;let c=t.get(this.constructor,g);c&&c.sort(((e,t)=>t.priority-e.priority)).forEach((e=>{e.beforeMount(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}));let u=t.get(this.constructor,"hostStyles"),d=this.#p?.shadowRoot??this.ownerDocument,p=F.get(d);if(!p?.includes(this.constructor)&&u.length>0){let e=[];t.each(u,(r=>{if(t.isString(r)){let t=new CSSStyleSheet;t.replaceSync(r),e.push(t)}else e.push(r)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...e],p?.push(this.constructor)}this.beforeMount();let h=t.get(this.constructor,s.EVENTS);h&&h.forEach((async e=>{let r=e.name,n=t.assign({target:document,once:!1,passive:!1,capture:!1},e.options),s=t.bind(e.fn,this),o=n.target;t.isFunction(o)&&(o=await o.call(this,this)),o?o.addEventListener(r,s,n):l(this.tagName,"The target of @event('"+r+"',...) is invalid")})),w.startCollect(this,n.CSS);let f=[];this.styles.forEach((e=>{if(!t.isFunction(e))return;let r=new CSSStyleSheet;f.push(r),w.setUpdater((()=>{let t=e()??"";r.replaceSync(t)}));let n=e();t.isBlank(n)||r.replaceSync(n)})),w.endCollect(),f.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...f]),setTimeout((()=>{this.#f=!0,this.mounted(),c&&c.forEach((e=>{e.mounted(this,((e,t)=>(a.#n[e]=t,a.#n[e])))}))}),0),this.#y=!0}propsReady(e){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#N(e,r){this.#b();let n=t.get(this.#t[r],"props");n&&t.each(this.slots,((e,r)=>{e.filter((e=>e.nodeType===Node.ELEMENT_NODE)).forEach((e=>{e instanceof G?e._updateProps(n):t.each(n,((r,n)=>{if(e instanceof HTMLSlotElement){let s=t.get(e,"__l_comp");if(s){let t=e.name||"default",o=s.#t[t];o||(o=s.#t[t]={props:{}}),o.props||(o.props={}),o.props[n]=r,s.#N(e,t)}}else e.setAttribute(n,r)}))}))})),this.slotChange(e,r)}slotChange(e,t){}attributeChangedCallback(e,r,n){if(Object.is(n,r))return;let o=t.camelCase(e);if(d(t.get(this.constructor,[s.PROPS,o]).type)){let e=p(n);if(t.get(this,o)===e)return}this.#A(e,r,n)}shouldUpdate(e){return!0}updated(e){}#P={};_notify(e,r){let n=[];for(let s=0;s<r.length;s++){const o=r[s];n.push(o);let i=t.get(this,n),a=c(n);this.#s[a]={value:i,chain:"slots"===a?["slots"]:n,oldValue:e,end:n.length===r.length}}return this.#E}#T(){if(t.size(this.#s)<1)return;const e=this.#s;this.#s={};const r=Object.keys(e);let n=t.get(this.constructor,g);if(n&&n.sort(((e,t)=>t.priority-e.priority)).forEach((t=>{t.updated(this,e)})),!this.shouldUpdate(e))return;let s=new Set;const o=this.#i;t.each(e,(({value:e,chain:t,oldValue:r,end:n},i)=>{o[i]&&o[i].forEach((e=>{s.add(e)}))})),s.forEach((e=>{e===this?Xe(this.render(),this,void 0,r):Ye(e,this)})),this.#w.forEach((e=>{this.#_(e)})),this.updated(e)}#S(){let e=t.get(this.constructor,s.PROPS),r=this.attributes,n=this.tagName,o=this.#l,i={};t.each(r,(({name:r,value:n})=>{if(r[0]===Ne||r[0]===Ae||r[0]===Pe||r===ke||"slot"===r)return;let s=t.camelCase(r);e&&!e[s]&&(i[r]=n)})),this.#a=this.#a?t.assign(this.#a,i):i;let a={};if(!e)return Object.seal(a);let c=Object.keys(e),u=c.length;for(let s=0;s<u;s++){const i=c[s],u=t.kebabCase(i),d=this.hasAttribute(u);let p,h=e[i],f=t.has(o,i),g=t.get(this,i);if(!("_defaultValue"in h)&&(h._defaultValue=g,!h.type)){t.isUndefined(g)&&l(n,"Prop '"+i+"' has neither propType nor defaultValue be used for type inference");let e=typeof g;t.isArray(g)&&(e="array");let r=j[e];h.type=r}if(f)p=t.isNil(o[i])?g:o[i];else{p=g;let e=r.getNamedItem(u)||r.getNamedItem(Ae+u);e&&(f=!0,p=e.value)}if(h.required&&!f){l(n,"Prop '"+i+"' is required");break}p=this.#D(e,i,p,d);let m=t.get(e,[i,"getter"]);m&&(m=t.bind(m,this));let y=t.get(e,[i,"setter"]);y&&(y=t.bind(y,this)),(m||y)&&Reflect.defineProperty(this.#r,i,{set:y||function(e){},get:m}),h.attribute&&t.isDefined(p)&&!t.isObject(p)&&this.#k(h,i,p),this.#r[i]=p,a[i]=p}return Object.seal(a)}#k(e,r,n){let s=t.kebabCase(r),o=t.trim(n);d(e.type)?(o=p(n),t.isBoolean(o)?o&&!this.hasAttribute(s)?this.toggleAttribute(s,!0):!o&&this.hasAttribute(s)&&this.toggleAttribute(s,!1):this.getAttribute(s)!==o&&this.setAttribute(s,o)):this.getAttribute(s)!==o&&this.setAttribute(s,o)}#M(e,r){let n=e;try{for(let s=0;s<r.length;s++){const o=r[s];n=o===Boolean?p(e):o===Number?Number(e):o===String?String(e):o===Object||o===Array?t.parseJSON(e):o===Date?new Date(e):new o(e)}}catch(t){l(this.tagName,"Convert attribute error with "+e)}return n}#D(e,r,n,s){let o=e[r];if(!o)return n;let i=o.isValid,a=o.type,c=t.isArray(a)?a:[a],u=o.converter,d=n;if(!t.some(c,(e=>e===String))&&t.isString(d)&&!t.isNull(d))try{d=u?u(d):this.#M(d,c)}catch(e){l(this.tagName,`Convert attribute '${r}' error with `+d)}for(let e=0;e<c.length;e++){"Boolean"===c[e].name&&s&&(d=p(d))}if(t.isNil(d))return d;let h=typeof d,f=!t.isDefined(d);for(let e=0;e<c.length;e++){const r=c[e];if(t.test(h,r.name,"i")||d instanceof r||Object.prototype.toString.call(d)===Object.prototype.toString.call(r.prototype)){f=!0;break}}return f||l(this.tagName,`Invalid prop '${r}'. expected '${c.map((e=>e.name||e))}' but got '${h}'`),i&&(i.call(this,d,this.#r)||l(this.tagName,`Invalid prop '${r}'. IsValid() check failed`)),d}#C(){let e=t.get(this.constructor,s.STATES);t.each(e,((r,n)=>{let s=e[n],o=t.get(this,n);if(s){let e=s.prop;o=e?t.cloneDeep(this.#r[e]):t.get(this,n)}this.#r[n]=o}))}#O=t.debounce(this.propsReady,100);_updateProps(e){let r=t.get(this.constructor,s.PROPS),n=[];t.each(e,((e,s)=>{let o=t.camelCase(s),i=r[o];i&&(e=this.#D(r,o,e),i.attribute&&t.isDefined(e)&&!t.isObject(e)&&n.push([i,o,e]),w.__skipCheck=!0,t.set(this,o,e),w.__skipCheck=!1)})),t.assign(this.#l,e),n.forEach((([e,t,r])=>{this.#k(e,t,r)})),this.#l&&this.#O(this.#l)}_wrapperProp=new Set;_initProps(e,r){this.#l=t.merge(this.#l||{},e),this.#a=t.merge(this.#a||{},r),t.each(e,((e,r)=>{if(t.isObject(e)){let t=k.get(e);if(t){let e=t.join(P);this._wrapperProp.add(e)}}}))}_bindSlot(e,r,n){if(this.#g[r]||(this.#g[r]=e,Reflect.defineProperty(e,"__l_comp",{value:this})),e.addEventListener("slotchange",(t=>{this.#y&&this.#N(e,"default"===r?"":r)})),!t.isEmpty(n)){let e=this.#t[r];e||(e=this.#t[r]={}),e.props=n}}_bindSlotHook(e,t){this.#h[e]=t}#w=new Set;_updateSlot(e,t,r){let n=this.#g[e],s=this.#h[e];if(!s&&!n)return;let o=this.#t[e];if(t&&(o.props||(o.props={}),o.props[t]=r),s)this.#w.add(e);else{let e=n.assignedElements({flatten:!0});for(let n=0;n<e.length;n++){e[n].setAttribute(t,r+"")}}}#b(){const e=t.flatMap(this.childNodes,(e=>e.nodeType===Node.COMMENT_NODE?[]:e instanceof HTMLSlotElement?e.assignedNodes({flatten:!0}):e));let r=t.groupBy(e,(e=>e.nodeType===Node.TEXT_NODE?"default":e instanceof Element?e.getAttribute("slot")||"default":void 0));if(t.isEmpty(r))return void(t.isEmpty(this.#r["#slots"])||(this.#y?this.#n["#slots"]={}:this.#r["#slots"]={}));t.each(r,((e,r)=>{if(r){for(;e.length>0;){let r=e[0];if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.shift()}for(;e.length>0;){let r=t.last(e);if(!(r.nodeType===Node.TEXT_NODE&&t.isBlank(r.textContent)||r instanceof HTMLSlotElement&&t.isEmpty(r.assignedNodes({flatten:!0}))))break;e.pop()}}}));let n={};t.each(r,((e,r)=>{t.isEmpty(e)||(n[r]=e)})),this.#y?this.#n["#slots"]=n:this.#r["#slots"]=n}#_(e){let r=this.#h[e];if(!r)return;let n=this.#t[e];if(!this.#r["#slots"][e])return;this.renderAsync(r,t.get(n,"props"));const s=this._asyncDirectives.get(r);let o=s?.buildView(r(t.get(n,"props"))),i=t.reject(t.toArray(o),(e=>e.nodeType===Node.COMMENT_NODE));if(i){let r=this.#m[e];if(!t.isEmpty(r))for(let e=0;e<r.length;e++){const t=r[e];t.parentNode?.removeChild(t)}this.#m[e]=i,this.append(...i),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(e,...t){}#A(e,r,n){if(!this.#y)return;if(C(this.constructor).has(e)){let r=t.camelCase(e);if(t.isNull(n)){n=t.get(this.constructor,s.PROPS)[r]._defaultValue}this._updateProps({[r]:n})}}_regDeps(e,t){let r=this.#i[e];r||(r=this.#i[e]=new Set),r.add(t);let n=e.split(P);if(n.pop(),n.length<1)return;let s=n.join(P);r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(t)}_regWrapper(e){this.#p=e}_getPrivateData(){return this.#r}emit(e,r={},n){n&&n.event&&(r.event=n.event),r.target=this,this.dispatchEvent(new CustomEvent(e,{bubbles:t.get(n,"bubbles",!1),composed:t.get(n,"composed",!1),cancelable:!0,detail:r}))}on(e,t){this.#P[e]||(this.#P[e]=[]);let r=t.bind(this);this.#P[e].push(r),this.addEventListener(e,r)}nextTick(e,t){W.pushNext(e,t)}forceUpdate(){t.each(this.#n,((e,t)=>{this.#s[t]={value:void 0,chain:void 0}})),this.#T()}}class K{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(e,t,r){this.startNode=e,this.attrName=t,this.type=r}setVarIndex(e){this.varIndex=e}getNodes(){let e=this.startNode.nextSibling;if(!this.endNode)return[e];let t=[];for(;e&&e!==this.endNode;)t.push(e),e=e?.nextSibling;return t}}var Q;!function(e){e.AFTER_BEGIN="afterbegin"}(Q||(Q={}));const q={};function X(r,n,s,o,i,l,c,u=!1){let d;if(u?(w.startRender(r.endNode),d=o(r,n,s,{renderComponent:i,slotComponent:l,varChain:c}),w.endRender(i)):d=o(r,n,s,{renderComponent:i,slotComponent:l,varChain:c}),!d)return;let[p,h]=d;if(p===e.DirectiveUpdateTag.NONE)return;let f=r.getNodes();if(p===e.DirectiveUpdateTag.REMOVE)for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}else if(p===e.DirectiveUpdateTag.REPLACE){let e=[];for(let e=0;e<f.length;e++){const t=f[e];t.parentNode?.removeChild(t)}let n=qe(r.endNode,h,i);e=t.toArray(n);let s=document.createDocumentFragment();s.append(...e),r.endNode.parentNode.insertBefore(s,r.endNode)}else if(p===e.DirectiveUpdateTag.UPDATE){let e,n={},s=[],o=[],l=je.get(r.endNode);if(h||(h=new tt([],[])),t.isEmpty(f)){let e=qe(r.endNode,h,i);return void r.startNode.after(...e)}let c={};h instanceof tt&&h.vars.forEach((e=>{if(e instanceof tt){const t=e.getKey();c[t]=e,n[t]=!0,o.push(t)}})),f=t.filter(t.compact(f),(e=>e.nodeType===Node.ELEMENT_NODE)),e=t.filter(t.compact(t.toArray(e)),(e=>e.nodeType===Node.ELEMENT_NODE));let u={},d="",p={};for(let e=0;e<f.length;e++){let t=f[e],r=t.getAttribute("key");if(r){if(u[r]){d=r;break}u[r]=t,s.push(r),p[r]=!0}}if(d)return void a(`${t.camelCase(r.endNode._diName)} - duplicate key '${d}'`);let g=n;const m=r.startNode.parentNode;let y=[],v=[];t.each(p,((e,r)=>{g[r]||(v.push(r),delete p[r],t.remove(s,(e=>e===r)))}));let b,E=!1;if(!t.isEmpty(o)){let e=-1,n=[],i=[],a=0,l=0;for(;l<o.length;l++){const c=o[l];let d=s.findIndex((e=>e===c));if(d<0){let e=o[l-1],t=e?u[e]||e:r.startNode;y.push({prevNode:t,newkey:c}),a++}else if(d>-1&&d!==l-a){if(e<0||1===Math.abs(e-d)){let e=t.last(n);n.push({nodeId:c,targetId:0===l?Q.AFTER_BEGIN:e?e.nodeId:o[l-1]})}else i.push({moveGroup:n,moveIndex:l+n.length}),n=[],n.push({nodeId:c,targetId:o[l-1]});e=d}}if(n.length>0&&i.push({moveGroup:n,moveIndex:l+n.length}),i.length>0){E=!0;let e=i.sort(((e,t)=>e.moveGroup.length-t.moveGroup.length));if(e.length<2){let{moveGroup:n}=e[0];if(n.length>1){let e=t.last(n).targetId;n[n.length-2].nodeId===e&&(n=t.initial(n))}n.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===Q.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}else{let n=t.last(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-n)&&(e=t.initial(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:t})=>{let n,s=u[t];e===Q.AFTER_BEGIN?(n=r.startNode,n.after(s)):(n=u[e],n.after(s))}))}))}}}if(y.length>0&&(b=function(e,r,n,s,o,i){const a=[],l=[],c=[];let u,d=[];e.forEach((e=>{let n=t.last(d);n&&u===e.prevNode?(n.group||(n.group=[u]),n.group.push(e.newkey)):d.push(e),u=e.newkey;let s=e.newkey;c.push(s),a.push(""),l.push(r[s])})),a.push("");let p=new tt(a,l),h=[...o],f=qe(i,p,s),g=je.get(i);o.length=0,o.push(...g);let m=new Map;return f.forEach((e=>{const t=e.getAttribute("key");c.includes(t)&&(m.set(t,!0),q[t]=e)})),h.forEach(((e,t)=>{const r=e.key+"";!m.get(r)&&n.includes(r)&&o.push(e)})),d}(y,c,o,i,l,r.endNode),b.forEach(((e,n)=>{let s=e.newkey,o=q[s],i=e.prevNode;if(e.group){let r=document.createDocumentFragment();r.append(...t.map(e.group,(e=>q[e]))),o=r}i===r.endNode?i.before(o):i===r.startNode?i.after(o):"string"==typeof i?q[i].after(o):i.after(o)}))),v.forEach((e=>{let t=u[e];t&&t.parentNode&&m.removeChild(t)})),h.vars[0]instanceof tt){let e=[],r=[];t.each(h.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),h=new tt(e,r)}if(E||v.length>0||b){const e=t.groupBy(l,(e=>e.key));let r=[],n=0;o.forEach((t=>{e[t].forEach((e=>{e.varIndex=n++,r.push(e)}))})),l=r}Ye(r.endNode,i,h,l)}}let Y=0;function J(e,t){let r=e.name||"Di-"+Y++,n=Symbol.for(r);return(...t)=>{let r=e(...t);return[n,t,r,e=>{},w.popDirectiveQ()]}}const Z=["resize","outside","mutate"],ee=new WeakMap,te=[],re=[],ne=[],se=new ResizeObserver((e=>{for(const t of e){const e=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize,r=Array.isArray(t.borderBoxSize)?t.borderBoxSize[0]:t.borderBoxSize;let n=ee.get(t.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:e.inlineSize,h:e.blockSize}}}),t.target)}}}));var oe;!function(e){e.Child="child",e.Tree="tree",e.Attr="attr",e.Char="char"}(oe||(oe={}));const ie=new WeakMap,ae=new MutationObserver((e=>{for(let t=0;t<e.length;t++){const r=e[t];let n=ie.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=oe.Tree,o=n[oe.Tree];break;case"childList":s.type=oe.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[oe.Child];break;case"attributes":s.type=oe.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[oe.Attr];break;case"characterData":s.type=oe.Char,s.oldValue=r.oldValue,o=n[oe.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function le(e,r,n,s){if("resize"===e)!function(e,t){ee.has(e)||(ee.set(e,t),se.observe(e))}(r,n);else if("outside"===e)switch(s[0]){case"mousedown":!function(e,t){te.push([e,t])}(r,n);break;case"dblclick":!function(e,t){ne.push([e,t])}(r,n);break;default:!function(e,t){re.push([e,t])}(r,n)}else"mutate"===e&&function(e,r,n){let s=t.includes(n,"child"),o=t.includes(n,"attr"),i=t.includes(n,"char"),a=t.includes(n,"tree"),l=ie.get(e);l||(l={},ie.set(e,l),s&&(l[oe.Child]=r),o&&(l[oe.Attr]=r),i&&(l[oe.Char]=r),a&&(l[oe.Tree]=r),ae.observe(e,{childList:s,attributes:o,characterData:i,subtree:a}))}(r,n,s)}document.addEventListener("mousedown",(e=>{let r=t.get(e.composedPath(),0,e.target);te.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("click",(e=>{let r=t.get(e.composedPath(),0,e.target);re.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1),document.addEventListener("dblclick",(e=>{let r=t.get(e.composedPath(),0,e.target);ne.forEach((([n,s])=>{if(!n.contains(r)&&!n.contains(t.closest(r,(e=>e instanceof ShadowRoot),"parentNode")?.host)){s(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:n,event:e}}),n)}}))}),!1);const ce=/,|^(debounce:.+)|(debounce$)/,ue=/,|^(throttle:.+)|(throttle$)/,de="self",pe="stop",he="prevent",fe="once",ge="left",me="right",ye="middle",ve="ctrl",be="alt",Ee="shift",Te="meta",Se={esc:"escape"},Ce=":";function _e(e,r,n,s){let o,i=e.split("."),a=i.shift(),l=i.includes(fe),c=r;if(o=t.find(i,(e=>ce.test(e)))){let e=o.split(Ce);c=t.debounce(c,parseInt(e[1])||100)}if(o=t.find(i,(e=>ue.test(e)))){let e=o.split(Ce);c=t.throttle(c,parseInt(e[1])||100)}if(l&&(c=t.once(c)),function(e){return Z.includes(e)}(a))return le(a,n,c,i),c;let u=e=>{if(i.includes(he)&&e.preventDefault(),i.includes(pe)&&e.stopPropagation(),!i.includes(de)||e.target===e.currentTarget){if(e instanceof MouseEvent){if(i.includes(ge)&&0!=e.button)return;if(i.includes(me)&&2!=e.button)return;if(i.includes(ye)&&1!=e.button)return}else if(e instanceof KeyboardEvent){if(t.remove(i,(e=>e==ve))[0]&&!e.ctrlKey)return;if(t.remove(i,(e=>e==be))[0]&&!e.altKey)return;if(t.remove(i,(e=>e==Ee))[0]&&!e.shiftKey)return;if(t.remove(i,(e=>e==Te))[0]&&!e.metaKey)return;let r=t.map(i,(e=>Se[e]||e));if(t.size(r)>0&&!r.includes(e.key.toLowerCase()))return}c(e)}};n.addEventListener(a,u);let d=s.__events[a];return d||(d=s.__events[a]=[]),d.push([n,u]),u}const Ne="@",Ae=".",Pe="?",we="*",De=":",ke="ref",Me="key",Oe=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,xe="slot-props",Re=new Map,Le=new Map,Ue=new Map;var He;!function(e){e.Event="event",e.Directive="directive",e.DirectiveTag="directiveTag",e.DirectiveAttr="directiveAttr",e.DirectiveProp="directiveProp",e.DirectiveText="directiveText",e.DirectiveSlot="directiveSlot",e.Attr="attr",e.AttrProp="attrProp",e.AttrBool="attrBool",e.AttrRef="attrRef",e.AttrSlot="attrSlot",e.AttrKey="key",e.Ref="ref",e.Text="text"}(He||(He={}));const We=new WeakMap,je=new WeakMap,Ie=new WeakMap,Be=new WeakMap,Ve=new WeakMap,$e=new WeakMap;function Fe(e,r){let n="",s=t.concat(r.vars),o=r.strings.length-1,i=r.vars.length-1,a=0;for(let l=0;l<=o;l++){const o=r.strings[l];let c=t.get(s,a,"");if(c instanceof tt){let[t,r]=Fe(e,c);c=t,s.splice(a,1,...r),a+=r.length-1}else c=l>i?"":ze;a++,n=n+o+c}let l=0;return n=n.replace(Oe,((e,r)=>t.replaceAll(e,ze,(()=>ze.replace("--\x3e","")+l++)))),n=n.replace(et,"$1><").trim(),[n,s]}const ze="\x3c!--c_ui-pl_df--\x3e",Ge="\x3c!--c_ui-pl_df",Ke=/<!--c_ui-pl_df\d*(-->)?/;function Qe(r,n,s,o,i=!1){const a=document.createElement("div");a.innerHTML=n;const l=Ue.has(o.constructor);i||!l||Le.has(o.constructor)||Le.set(o.constructor,a.cloneNode(!0));let c=0;const u=document.createNodeIterator(a,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let d,p,h=0,f=l?void 0:{},g=null,m="";for(;d=u.nextNode();){c++;let n=l?void 0:[];if(p&&!p.contains(d)&&(p=void 0),d instanceof HTMLElement||d instanceof SVGElement){d instanceof G&&(p=d);let i={},a=t.toArray(d.attributes);for(let l=0;l<a.length;l++){const c=a[l];let{name:u,value:f}=c;if(u!==xe)if(t.startsWith(u,Ge)){let i=s[h];if(t.isArray(i)&&t.isSymbol(i[0])){let[,t,s,a,l]=i;a(e.EnterPointType.TAG);let c=new K(d,u.substring(1),e.EnterPointType.TAG),f=$e.get(d);f||(f={},$e.set(d,f)),f[Symbol.keyFor(i[0])]=[c,o,p];let y=new A(h,d);y.isDirective=!0,y.value=i,y.isComponent=!!p,r.push(y),g&&g?.contains(d)&&(y.key=m),h++,s(c,t,void 0,{renderComponent:o,slotComponent:p,varChain:l}),n&&n.push({type:He.DirectiveTag,point:c,up:y,name:u})}d.removeAttribute(u)}else if(u[0]!==Ne)if(u!==ke)if(u!==Me){if(Ke.test(f)){let a=s[h],l=new A(h,d,u.replace(/\.|\?|@/,""),f);if(l.isComponent=!!p,g&&g?.contains(d)&&(l.key=m),u[0]===Ae||u[0]===Pe||u[0]===we){if(t.isArray(a)&&t.isSymbol(a[0])){let[,t,r,s,i]=a;s(e.EnterPointType.PROP);let c=u.substring(1),h=new K(d,c,e.EnterPointType.PROP),f=$e.get(d);f||(f={},$e.set(d,f)),f[c]=[h,o,p],r(h,t,void 0,{renderComponent:o,slotComponent:p,varChain:i}),l.value=a,l.isDirective=!0,n&&n.push({type:He.DirectiveProp,up:l,point:h,name:u,attrName:c})}else if(u[0]===Pe){l.isToggleProp=!0,l.value=!!a;let e=u.substring(1);l.value&&d.setAttribute(e,""),n&&n.push({type:He.AttrBool,name:e,up:l,attrName:u})}else if(u[0]===we){l.value=a;let e=u.substring(1);const[r,s]=e.split(De);let o=r;switch(s){case"camel":o=t.camelCase(o);break;case"kebab":o=t.kebabCase(o);break;case"snake":o=t.snakeCase(o)}l.attrName=o,d.setAttribute(o,a),n&&n.push({type:He.AttrRef,up:l,name:u,attrName:o})}else{let e=t.camelCase(u.substring(1));l.value=a,l.isProp=!0,i[e]=a,n&&n.push({type:He.AttrProp,up:l,name:e,attrName:u})}d.removeAttribute(u),a=""}else{let r,s;l.value=a;let i={type:He.Attr,up:l,attrName:u};if(t.isArray(a)&&t.isSymbol(a[0])){let t=e.EnterPointType.ATTR;"class"===u?t=e.EnterPointType.CLASS:"style"===u&&(t=e.EnterPointType.STYLE);let[,n,c,h,f]=a;h(t),l.isDirective=!0,l.attrName=u;let g=new K(d,u,t),m=$e.get(d);m||(m={},$e.set(d,m)),m[u]=[g,o,p],s=n,r=c,a="",i.type=He.DirectiveAttr,i.point=g}f=t.replace(f,Ke,a),c.value=f,r&&r(i.point,s,void 0,{renderComponent:o,slotComponent:p}),n&&n.push(i)}r.push(l),h++}}else{let e=s[h];d.setAttribute(u,e);let t=new A(h,d);t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),h++,g=d,m=e,n&&n.push({up:t,type:He.AttrKey}),r.length>0&&r.forEach((t=>{t.key=t.key??e}))}else{if(Ke.test(f)){let e=s[h],t=new A(h,d);t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),h++,e.current=d,n&&n.push({type:He.Ref,up:t,attrName:u})}d.removeAttribute(u)}else{let e=e=>{},t=null,i=!1;if(Ke.test(f)){t=new A(h,d),t.notUpdated=!0,g&&g?.contains(d)&&(t.key=m),r.push(t),e=s[h].bind(o),h++,i=!0}let a=u.substring(1);_e(a,e,d,o),d.removeAttribute(u),n&&n.push({type:He.Event,up:t,name:a,attrName:u,value:i})}else{let e=d.getAttribute("name")||"default";n&&n.push({type:He.AttrSlot,name:e,attrName:u})}}d instanceof G?(d._regWrapper(o),t.size(i)>0&&d._initProps(i)):d instanceof HTMLSlotElement&&o._bindSlot(d,d.name||"default",i)}else{let i=d;if(`\x3c!--${i.nodeValue}--\x3e`!==ze)continue;let a=new A(h,d);g&&g?.contains(d)&&(a.key=m),r.push(a),a.isComponent=!!p,a.isText=!0;let l=s[h];if(t.isArray(l)&&t.isSymbol(l[0])){const t=Symbol.keyFor(l[0]);let r;r=document.createComment(`compelem-${o.tagName}-${t}-start`),a.textNode=r,i.parentNode.insertBefore(r,i),i.nodeValue=`compelem-${o.tagName}-${t}-end`,i._diName=t,a.isDirective=!0,a.value=l;let s=p?e.EnterPointType.SLOT:e.EnterPointType.TEXT,[,c,u,d,h]=l;d(s);let f=new K(r,"",s);f.endNode=i,Be.set(i,[f,o,p,c,h]),Ie.set(i,u),Ve.set(i,a),w.startRender(i);let g=u(f,c,void 0,{renderComponent:o,slotComponent:p,varChain:h});if(w.endRender(o),g){let e=qe(i,g[1],o);e&&e.length>0&&Je.insertBefore(i,Array.from(e))}l=void 0,n&&n.push({type:s===e.EnterPointType.SLOT?He.DirectiveSlot:He.DirectiveText,up:a,point:f})}else a.value=l,n&&n.push({type:He.Text,up:a});h++;let c=t.toString(l??""),u=document.createTextNode(c);i.parentNode.insertBefore(u,i),a.textNode=u}f&&n&&(f[c]=n),g&&!g.contains(d)&&g!==d&&(g=null,m="")}return!i&&f&&Ue.set(o.constructor,f),a.childNodes}function qe(e,t,r){let[n,s]=Fe(r,t),o=[],i=Qe(o,n,s,r,!0);return je.set(e,o),i}function Xe(r,n,s,o){if(t.isBlank(t.join(r.strings)))return;if(!We.has(n))return;let i=r.flatVars(n);s=s??We.get(n);for(let r=0;r<s.length;r++){const a=s[r];let l=a.varIndex;if(l<0)continue;if(a.notUpdated)continue;let c=a.value,u=i,d=a.node,p=t.split(l,P);for(let e=0;e<p.length;e++){const n=p[e];u=t.get(u,n),u&&u.vars&&r<p.length-1&&(u=u.vars)}if(!t.isObject(c)&&c===u)continue;let h=d;if(a.isDirective){let[t,r,n,,s]=a.value,o=Be.get(d);if(!o){const e=$e.get(d);o=e[a.attrName]||e[Symbol.keyFor(t)]}let[i,l,c]=o,[,p]=u;const h=Ve.get(d);if(h){h.value=u;Be.get(d)[3]=p}X(i,p,r,n,l,c,s,i.type==e.EnterPointType.TEXT||i.type==e.EnterPointType.SLOT)}else if(a.isToggleProp){if(!!u===c)continue;h.toggleAttribute(a.attrName,!!u),t.set(h,a.attrName,!!u)}else if(a.isProp){if(!t.isObject(u)&&u===c)continue;if(d instanceof G)if(t.isObject(u)&&Object.is(u,c)){let e=t.camelCase(a.attrName),r=[e];if(o&&o.length>0){let n="",s=t.join(k.get(a.value),P);o.forEach((e=>{e.startsWith(s)&&e.length>n.length&&(n=e)})),r=t.concat(t.split(n.replace(s,e),P))}U(d,c,r)}else d._updateProps({[a.attrName]:u});else d instanceof HTMLSlotElement&&n._updateSlot(d.getAttribute("name")||"default",a.attrName,u)}else if(a.attrName){if(!t.isEqual(c,u))switch(a.attrName){case"value":if(d instanceof HTMLInputElement){d.value=u;break}default:d.setAttribute(a.attrName,t.replace(a.attrTmpl,Ke,u+""))}}else if(a.isText){a.textNode.textContent=t.toString(u??"")}a.value=u}}function Ye(e,r,n,s){const o=Ie.get(e),[i,a,l,c,u]=Be.get(e),d=Ve.get(e);if(!n){let e=o(i,d.value[1],c,{renderComponent:a,slotComponent:l,varChain:u});if(!e)return;n=e[1]}if(n&&n.vars[0]instanceof tt){let e=[],r=[];t.each(n.vars,(n=>{r.push(...n.vars),e.push(...t.map(n.vars,(e=>"1")))})),e.push("1"),n=new tt(e,r)}s&&je.set(e,s),Xe(n,r,s=s??je.get(e))}const Je={insertBefore:function(e,t){if(!e.parentNode)return;let r=document.createDocumentFragment();r.append(...t),e.parentNode.insertBefore(r,e)},remove:function(e,t){if(e===t)return void e?.parentNode?.removeChild(e);let r=e.nextSibling;for(;r&&r!==t;)r?.parentNode?.removeChild(r),r=e.nextSibling}};function Ze(e,...r){return new tt(t.isString(e)?[e]:e,r)}const et=/([a-z0-9"'])\s*>\s*</gim;class tt{strings;vars;constructor(e,r){this.strings=t.concat(e),this.vars=r}getKey(){let e=this.vars,n="";return t.each(this.strings,((s,o)=>{if(r.test(s))return n=t.toString(e[o]),!1})),n}getKeys(){let e=this.vars,n=[];for(let s=0;s<this.strings.length;s++){const o=this.strings[s];if(r.test(o)){let r=t.toString(e[s]);n.push(r)}}return t.isEmpty(n)&&e.forEach((e=>{if(e instanceof tt){let t=e.getKey();n.push(t)}})),n}append(e){let r=t.last(this.strings);return e.strings.forEach(((e,t)=>{0!=t?this.strings.push(e):this.strings[this.strings.length-1]=r+e})),this.vars=t.concat(this.vars,e.vars),this}insert(e,t){let r=t.strings.shift();return this.strings[e]+=r,this.strings.splice(e+1,0,...t.strings),this.vars.splice(e,0,...t.vars),this}getHTML(e){let[r,n]=Fe(e,this),s=Qe([],r,n,e);return t.reduce(s,((e,t)=>e+(t.outerHTML??"")),"")}flatVars(e){let r=t.concat(this.vars),n=this.strings.length-1,s=0;for(let o=0;o<=n;o++){let n=t.get(r,s,"");if(n instanceof tt&&n.vars.length>0){let[t,o]=Fe(e,n);n=t,r.splice(s,1,...o),s+=o.length-1}s++}return r}}const rt=b(class extends h{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.debounce(o,this.wait,this.immediate));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;immediate;result;constructor(e,t=!1){super(),this.wait=e,this.immediate=t}});const nt=b(class extends h{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.bind(t.get(e,n),e);t.set(e,n,t.once(o));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(){super()}});var st;e.QueryCache=void 0,(st=e.QueryCache||(e.QueryCache={})).ONCE="once",st.UPDATABLE="updatable";class ot extends h{static get priority(){return Number.MAX_VALUE}created(e,t,r,...n){}mounted(e,t,...r){}get targets(){return[e.DecoratorType.FIELD]}selector;cache;result;constructor(e,t){super(),this.selector=e,this.cache=t}static getKey(e){return e}getter(e){this.result=e.shadowRoot?.querySelector(this.selector)}beforeMount(e,t,r,n,...s){const o=this;Reflect.defineProperty(e,n,{get:()=>(o.result&&o.cache||o.getter(e),o.result)})}updated(t,r){this.cache===e.QueryCache.UPDATABLE&&this.getter(t)}}const it=b(ot),at=b(class extends ot{getter(e){this.result=e.shadowRoot?.querySelectorAll(this.selector)}});function lt(e,r,n){if(!t.has(e.constructor,s.STATES)){const r={};let n=e.constructor;for(;(n=u(n))!==G;)t.merge(r,n[s.STATES]?t.cloneDeep(n[s.STATES]):{});Reflect.defineProperty(e.constructor,s.STATES,{configurable:!1,enumerable:!1,value:r})}n.shallow=n.shallow||!1,e.constructor[s.STATES][r]=n}const ct=b(class extends h{static get priority(){return Number.MAX_VALUE}created(e,r,n,...s){let o=t.get(e,n);t.set(e,n,t.throttle(o,this.wait));let i=Reflect.getPrototypeOf(e);i&&!t.get(i,n+"_$__")&&t.set(i,n+"_$__",o)}beforeMount(e,t,...r){}mounted(e,t,...r){}updated(e,t){}get targets(){return[e.DecoratorType.METHOD]}wait;result;constructor(e){super(),this.wait=e}});const ut=["key"],dt=J((function(e){return(e,[r],n)=>{let o=e.startNode;if(n)t.each(r,((e,t)=>{o.setAttribute(t,e)}));else if(o instanceof G){let e={},n={},i=t.get(o.constructor,s.PROPS);t.each(r,((r,s)=>{if(ut.includes(s))return;let o=t.camelCase(s);i[o]?e[s]=r:n[s]=r+""})),o._initProps(e,n)}else t.each(r,((e,t)=>{o.setAttribute(t,e)}))}}),e.EnterPointType.TAG),pt=new Map,ht=J((function(e){return(e,[r],n,{renderComponent:s})=>{let o=[];if(t.isArray(r)?o=t.compact(r):t.isObject(r)?o=t.flatMap(r,((e,t)=>e?t:[])):t.isString(r)&&(o=r.split(" ")),o.length<1&&!n)return;let i=e.startNode;if(pt.get(i)&&pt.get(i).length===o.length&&t.isMatch(pt.get(i),o))return;let a=pt.get(i);t.each(a,(e=>{i.classList.remove(e)})),t.each(o,(e=>{i.classList.add(e)})),a=t.concat(o),pt.set(i,a)}}),e.EnterPointType.CLASS),ft=new Map,gt=new Map,mt=J((function(n,s){return(n,o,i,{varChain:l})=>{let c=n.startNode,u=function(e,n,s){let o=t.map(e,((e,t)=>n(e,t)));if(o.length<1){let e=new tt([],[]);return gt.set(s,e),e}let i=[],l=[];const c=[],u=[];for(let e=0;e<o.length;e++){const n=o[e];let s=t.last(l),d=n.vars,p=!0,h=n.strings;for(let e=0;e<h.length;e++){const t=h[e];if(r.test(t)){let t=d[e]+"";if(i.includes(t))return void a(`forEach - duplicate key '${t}'`);i.push(t),p=!1}0==e&&s?l[l.length-1]=s+t:l.push(t)}if(p)return void a("forEach - missing 'key' prop");let f=t.last(c);f&&h.length>0&&(c[c.length-1]=t.trim(f)+h.shift()),c.push(""),u.push(n)}c.push("");let d=new tt(c,u);return gt.set(s,d),d}(o[0],s,c);if(i&&i[0]){const r=ft.get(c);if(t.isEmpty(n.getNodes())&&(!o||t.isEmpty(o[0])))return[e.DirectiveUpdateTag.NONE,u];if(r&&t.isMatch(r,o[0])&&r.length===o[0].length)return[e.DirectiveUpdateTag.NONE,u]}return ft.set(c,t.clone(o[0])),i?[e.DirectiveUpdateTag.UPDATE,u]:[e.DirectiveUpdateTag.APPEND,u]}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));const yt=new WeakMap,vt=J((function(t,r,n){return(s,[o,i],a,{renderComponent:l})=>{let c=s.endNode;if(a){if(!!o==!!a[0]){let t=yt.get(c);return[e.DirectiveUpdateTag.NONE,t.call(l,o)]}let t=o?r:n;return yt.set(c,t),[e.DirectiveUpdateTag.REPLACE,t.call(l,o)]}{let s=o?r:n;return yt.set(c,s),[e.DirectiveUpdateTag.APPEND,s.call(l,t)]}}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT)),bt=J((function(t,r){return(t,[r,n],s)=>s?r===s[0]?[e.DirectiveUpdateTag.NONE,r?n():Ze``]:r?[e.DirectiveUpdateTag.REPLACE,r?n():Ze``]:[e.DirectiveUpdateTag.REMOVE]:[e.DirectiveUpdateTag.APPEND,r?n():Ze``]}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));var Et;e.ModelTriggerType=void 0,(Et=e.ModelTriggerType||(e.ModelTriggerType={})).CHANGE="change",Et.INPUT="input";const Tt=new WeakMap,St=J((function(e,r="value"){return(n,s,o,{varChain:i,renderComponent:a})=>{const l=n.startNode;if(o){if(t.isEqual(s,o))return;if(!t.isEqual(s,o)){let e=s[0];if(l instanceof G)l._updateProps({[r]:e});else if(l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement){if(l.setAttribute(r,e+""),l instanceof HTMLSelectElement){let r=t.find(l.querySelectorAll("option"),(t=>t.value==e));r&&(r.selected=!0)}}else if(l instanceof HTMLInputElement){if(l.value==e)return;switch(l.type){case"checkbox":case"radio":e?l.setAttribute("checked",""):l.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":l.setAttribute(r,e+""),t.set(l,r,e);break;default:l.setAttribute(r,e+"")}}}return}if("binded"===t.get(l,"_model"))return;let c=t.last(i);if(Tt.set(l,c),t.isObject(e)||t.trim(e)||(e=""),l instanceof G)l._initProps({[r]:e}),l.addEventListener("update:"+r,(e=>{let r=a;a._wrapperProp.has(c[0])&&(r=a.wrapperComponent||r),t.set(r,c,e.detail.value)})),t.set(l,"_model","binded");else if(l instanceof HTMLTextAreaElement)l.setAttribute(r,e+""),l.addEventListener("input",(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded");else if(l instanceof HTMLInputElement){let n="",s="";switch(l.type){case"checkbox":case"radio":n="checked",s="change";break;default:n="value",s="input"}l.setAttribute(r??n,e+""),l.addEventListener(s,(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded")}else l instanceof HTMLSelectElement&&(l.setAttribute(r,e+""),l.addEventListener("change",(e=>{let r=e.target;t.set(a,c,r.value)})),t.set(l,"_model","binded"))}}),e.EnterPointType.TAG),Ct=new Map,_t=J((function(e,t){return(e,[r],n)=>{if(n&&r===n[0])return;let s=e.startNode;if(!Ct.has(s)){let e=s.style.display;Ct.set(s,"none"==e?"unset":e)}s.style.display=r?Ct.get(s):"none",t&&t(s,r)}}),e.EnterPointType.TAG),Nt=J((function(e,t){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(e=e.bind(o),i._bindSlotHook(t||"default",e))}}),e.EnterPointType.SLOT);class At{static getCssText(e,r=!1){return t.isString(e)?e:t.join(t.map(e,((e,n)=>n.startsWith("--")?n+":"+e+(r?" !important":""):t.kebabCase(n)+":"+e+(r?" !important":""))),";")}static setStyle(e,r){if(t.isString(e)&&!t.trim(e))return{};let n=At.getCssText(e),s={};return t.each(n.split(";"),(e=>{let n=e.split(":"),o=t.trim(n[0]),i=t.trim(n[1]);s[o]=r.style.getPropertyValue(o),r.style.setProperty(o,i)})),s}}const Pt=new Map;let wt=0;const Dt=J((function(e){return(e,t,r,{renderComponent:n})=>{let s=e.startNode,o=Pt.get(s);o||(o="style_d"+wt++,Pt.set(s,o)),n.nextTick((()=>{At.setStyle(t[0],s)}),o)}}),e.EnterPointType.STYLE),kt=J((function(e){return(r,n,s,{renderComponent:o,varChain:i})=>{const a=r.startNode;if(s){if(!t.isEqual(n,s)){let e=r.attrName;a._updateProps({[e]:n[0]})}return}let l=t.last(i),c=r.attrName;a._initProps({[c]:e}),a.addEventListener("update:"+c,(e=>{t.set(o,l,e.detail.value)}))}}),e.EnterPointType.PROP),Mt=J((function(r,n){return(r,[n,s],o)=>{let i=()=>Ze``,a=[],l=[];t.each(s,((e,r)=>{if(t.isFunction(e))a.push(r),l.push(e);else{let t=e[0],r=e[1];a.push(t),l.push(r)}"default"===r&&(i=e)}));let c=t.findIndex(a,(e=>t.isFunction(e)?e(n):e==n));return o?[e.DirectiveUpdateTag.REPLACE,t.call(l[c]??i)]:[e.DirectiveUpdateTag.APPEND,t.call(l[c]??i)]}}),(e.EnterPointType.TEXT,e.EnterPointType.SLOT));e.CompElem=G,e.CssHelper=At,e.Decorator=h,e.DecoratorWrapper=y,e.EnterPoint=K,e.GetKeyFnName=f,e.PATH_SEPARATOR=P,e.PROP_OBJECT_KEY_MAP_SYMBOL=z,e.Template=tt,e.UpdatePoint=A,e._DecoratorMap=m,e._DecoratorsKey=g,e._getObservedAttrs=C,e.bind=dt,e.buildHTML=Fe,e.classes=ht,e.computed=function(e,r,n){n.get||a(`Computed '${r}' must be a getter`),t.has(e.constructor,s.COMPUTED)||(e.constructor[s.COMPUTED]=t.isEmpty(e.constructor[s.COMPUTED])?{}:t.cloneDeep(e.constructor[s.COMPUTED])),e.constructor[s.COMPUTED][r]=n.get},e.createRef=function(e){return{current:e}},e.debounced=rt,e.decorator=b,e.directive=J,e.event=function(e,r){return(n,o,i)=>{t.has(n.constructor,s.EVENTS)||(n.constructor[s.EVENTS]=t.isEmpty(n.constructor[s.EVENTS])?[]:t.cloneDeep(n.constructor[s.EVENTS])),n.constructor[s.EVENTS].push({name:e,options:r,fn:n[o]})}},e.forEach=mt,e.html=Ze,e.ifElse=vt,e.ifTrue=bt,e.makeState=function(e,t,r){lt(e.prototype,t,r||{prop:""})},e.model=St,e.onced=nt,e.prop=function(e){if(1===arguments.length)return(t,r,n)=>{e.required=e.required||!1,e.attribute=!1!==e.attribute,T(t,r,e,n)};let r=arguments[0],n=arguments[1],s=arguments[2];e={type:void 0,required:!1,attribute:!0},s&&"function"==typeof s.type&&(e=t.defaults(s,e),s=void 0),T(r,n,e,s)},e.query=it,e.queryAll=at,e.show=_t,e.slot=Nt,e.state=function(e){if(1===arguments.length)return(t,r)=>{lt(t,r,e)};lt(arguments[0],arguments[1],{prop:""})},e.styles=Dt,e.sync=kt,e.tag=function(e){return t=>{if(t){if(t.prototype.hasOwnProperty("attributeChangedCallback")){let e=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,r,n){G.prototype.attributeChangedCallback.call(this,t,r,n),e.call(this,t,r,n)}}if(t.prototype.hasOwnProperty("connectedCallback")){let e=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){G.prototype.connectedCallback.call(this),e.call(this)}}if(t.prototype.hasOwnProperty("disconnectedCallback")){let e=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){G.prototype.disconnectedCallback.call(this),e.call(this)}}customElements.define(e,t)}}},e.throttled=ct,e.updateDirective=X,e.watch=function(e,r){return(n,o)=>{t.has(n.constructor,s.WATCH)||(n.constructor[s.WATCH]=t.isEmpty(n.constructor[s.WATCH])?{}:t.cloneDeep(n.constructor[s.WATCH]));(t.isArray(e)?e:[e]).forEach((e=>{let i=e.replaceAll(".",P),a=n.constructor[s.WATCH][i];t.isArray(a)||(a=n.constructor[s.WATCH][i]=[]),a.push({source:e,options:r,handler:n[o]})}))}},e.when=Mt,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -8,7 +8,7 @@ export type EventOption = {
8
8
  */
9
9
  target?: Object | ((comp?: CompElem) => (HTMLElement | Promise<HTMLElement>));
10
10
  /**
11
- * 是否深度监控
11
+ * 是否在捕获阶段执行
12
12
  */
13
13
  capture?: boolean;
14
14
  /**
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * compelem v0.7.4-b1.1760876873
2
+ * compelem v0.7.6-b1.1761447525
3
3
  * A modern, reactive, fast, lightweight and flexible lib for building web components
4
4
  * @holyhigh2
5
5
  * https://github.com/holyhigh2/compelem
6
6
  */
7
- import{toPath as t,some as e,isString as r,isUndefined as n,isBlank as s,get as o,isObject as i,isDefined as a,isEmpty as l,has as c,concat as u,defaults as d,isLowerCaseChar as h,merge as p,cloneDeep as f,each as g,kebabCase as m,toArray as v,last as b,startsWith as E,isSymbol as y,isArray as S,isFunction as N,initial as _,flatMap as C,test as T,size as A,assign as w,first as P,closest as k,once as M,bind as D,camelCase as x,isNil as O,trim as R,isBoolean as L,parseJSON as H,isNull as W,debounce as I,set as V,groupBy as $,reject as B,filter as U,compact as j,remove as F,map as G,includes as z,find as K,throttle as X,join as Q,split as q,isEqual as Y,replace as J,toString as Z,replaceAll as tt,snakeCase as et,clone as rt,reduce as nt,isMatch as st,findIndex as ot,call as it}from"myfx";const at=/\s+\.?key\s*=/;var lt,ct,ut,dt;function ht(t){console.error("[CompElem]",t)}function pt(t,e){console.error(`[CompElem <${t}>]`,e)}function ft(e){return t(e).join("-")}function gt(t){return Object.getPrototypeOf(t)}function mt(t){return t===Boolean||e(t,(t=>t===Boolean))}function vt(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||s(e))&&(e=!0),e}!function(t){t[t.CSS=1]="CSS",t[t.COMPUTED=2]="COMPUTED"}(lt||(lt={})),function(t){t.PROPS="__deco_props",t.STATES="__deco_states",t.COMPUTED="__deco_computed",t.WATCH="__deco_watch",t.EVENTS="__deco_events"}(ct||(ct={})),function(t){t.Prod="prod",t.Dev="dev"}(ut||(ut={})),function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(dt||(dt={}));class bt{static get priority(){return 0}}const Et="getKey",yt="__decorators",St=new WeakMap;class Nt{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(t,e,r){this.args=t,this.metadata=e,this.decoratorClass=r,this.priority=o(r,"priority",0),this.instanceMap=new WeakMap}create(t){let e,r=new this.decoratorClass(...this.args),s=r.targets,c=this.metadata[2];i(c)&&a(o(c,"configurable"))?e=dt.METHOD:n(this.metadata[2])&&(e=dt.FIELD),!l(s)&&e&&s.includes(e)?(r.created(t,...this.metadata),this.instanceMap.set(t,r)):ht(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.instanceMap.get(t).beforeMount(t,e,...this.metadata)}mounted(t,e){this.instanceMap.get(t).mounted(t,e,...this.metadata)}updated(t,e){this.instanceMap.get(t).updated(t,e)}}const _t=new WeakMap;function Ct(t){let e=(...e)=>(...r)=>{let n=r[0].constructor,s=n[yt];if(!c(n,yt)){let t=Object.getPrototypeOf(n);s=t?u(t[yt]??[]):[],Reflect.defineProperty(n,yt,{configurable:!1,enumerable:!1,value:s})}let o,i={},a=t[Et];if(a){let r=_t.get(t);if(r||(r=new WeakMap,_t.set(t,r)),i=r.get(n),i||(i={},r.set(n,i)),o=a(...e),i[o])return i[o]}let l=new Nt(e,r,t);return i[o]=l,s?.push(l),l};return St.set(e,!0),e}const Tt=new WeakMap;function At(t){if(1===arguments.length)return(e,r,n)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,wt(e,r,t,n)};let e=arguments[0],r=arguments[1],n=arguments[2];t={type:void 0,required:!1,attribute:!0},n&&"function"==typeof n.type&&(t=d(n,t),n=void 0),wt(e,r,t,n)}function wt(t,e,r,n){let s;if(h(e[0])||ht(`Prop '${e}' must be in CamelCase`),!c(t.constructor,ct.PROPS)){const e={};let r=t.constructor;for(;(r=gt(r))!==Jt;)p(e,r[ct.PROPS]?f(r[ct.PROPS]):{});Reflect.defineProperty(t.constructor,ct.PROPS,{configurable:!1,enumerable:!1,value:e}),s=new Set,g(e,((t,e)=>{if(t.attribute){let t=m(e);s?.add(t)}})),Tt.set(t.constructor,s)}if(n&&(n.get&&(r.getter=n.get),n.set&&(r.setter=n.set)),r.attribute){s||(s=Tt.get(t.constructor));let r=m(e);s?.add(r)}c(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),t.constructor.observedAttributes=v(s),t.constructor[ct.PROPS][e]=r}const Pt=new Set;function kt(t){return Tt.get(t)??Pt}var Mt,Dt;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(Mt||(Mt={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Dt||(Dt={}));class xt{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(t,e,r,n){this.varIndex=t,this.node=e,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}const Ot="-",Rt={collectWatch(t,e,r){let n=Vt.get(t);n||(n={},Vt.set(t,n));let s=n[r];s||(s=n[r]=[]),s.push(e)},startCollect(t,e){this.__collectType=e,this.__collecting=t},setUpdater(t){this.__updater=t},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(t){let e=b(this.__directiveQ);const r=t?t.join(","):"",n=e?e.join(","):"";e&&r===n||(e&&e.length<t.length&&E(r,n)?this.__directiveQ[this.__directiveQ.length-1]=t:this.__directiveQ.push(t))},popDirectiveQ(){let t=u(this.__directiveQ);return this.__directiveQ=[],t},startRender(t){this.__renderCollecting=!0,this.__renderContext=t},endRender(t){this.__renderCollection.forEach((e=>{t._regDeps(e,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(t){this.__renderCollection.add(t)},clear(){this.__directiveQ=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},Lt=new WeakMap,Ht=new WeakMap,Wt=new WeakMap,It=new WeakMap,Vt=new WeakMap,$t=new WeakMap;function Bt(t,e){if(!i(t))return t;if($t.has(t))return $t.get(t);if(Lt.has(t))return t;const r=new Proxy(t,{get(t,e,r){if(!e)return;const n=Reflect.get(t,e,r);if(y(e))return n;if("length"===e&&S(t))return n;let s=Ht.get(r)??[],a=u(s,[e]),l=e in t;if((Rt.__renderCollecting||Rt.__collecting)&&(l&&t.hasOwnProperty(e)||!l)){let t=a.join(Ot);if(Rt.__renderCollecting)Rt.collect(ft(a)),Rt.setDirectiveQ(a);else if(Rt.__collecting){let e;switch(Rt.__collectType){case lt.COMPUTED:e=Wt.get(Rt.__collecting),e||(e={},Wt.set(Rt.__collecting,e));break;case lt.CSS:e=It.get(Rt.__collecting),e||(e={},It.set(Rt.__collecting,e))}let r=e[t];r||(r=e[t]=[]),r.push(Rt.__updater)}}const c=Lt.get(r);let d=c.from,h=o(d.constructor,ct.STATES);if(o(h,[e,"shallow"]))return n;let p=n;if(i(n)&&!N(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=c.pathMap;c.contextSet.forEach((e=>{let r=t?.get(e);r&&(p=Bt(n,e),$t.set(n,p),Ht.has(p)||Ht.set(p,a))}))}return p},set(t,r,n,s){if(!r)return!1;let i=t[r],a=Ht.get(s)??[],l=u(a,[r]),c=o(e.constructor,ct.PROPS),d=o(e.constructor,ct.STATES),h=o(c,[l[0],"hasChanged"])||o(d,[l[0],"hasChanged"]);if(h){let t=n,r=i;if(l.length>1&&(r=t=e._getPrivateData()[l[0]]),!h.call(e,t,r,l,n,i))return!0}else if(Object.is(i,n))return!0;c&&c[r]&&t.__isData&&c[r].sync&&e.emit("update:"+r,{value:n});let p=n,f=Reflect.set(t,r,p);return Ut(e,i,l),f}});let n=Ht.get(t)??[];if(Object.isExtensible(t)&&!Lt.get(r)){let t=new Set;t.add(e);let s=new WeakMap;s.set(e,n),Lt.set(r,{from:e,contextSet:t,pathMap:s})}else{Lt.get(r).contextSet.add(e);let t=Lt.get(r).pathMap,s=t.get(e),i=u(n);if(s&&s.join("")!==i.join("")){let t=o(e,_(s));S(t)||function(...t){console.warn("[CompElem]",...t)}(`The object is referenced by more than one @state '${i.join(".")},${s.join(".")}'`),s=i}else t.set(e,i)}return $t.set(t,r),r}function Ut(t,e,r){let n=Wt.get(t),s=It.get(t),i=Vt.get(t);if(n||s||i){let t=r.length;for(;t;){let a=r.slice(0,t).join(Ot);if(i){const n=i[a];t===r.length?n?.forEach((t=>{let r=t();r.ov=e,Ft.pushWatch(r)})):n?.forEach((t=>{let r=t();o(r,"deep")&&(r.ov=e,Ft.pushWatch(r))}))}if(n){let t=n[a];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Ft.pushComputed(r)}}if(s){let t=s[a];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Ft.pushCss(r)}}t--}}let a=t._notify(e,r);Ft.pushNext(a,t.cid)}const jt=new Map;class Ft{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){Ft.nextPending=!1;let t=Array.from(Ft.watchSet);Ft.watchSet.clear();let e=Array.from(Ft.computedSet);Ft.computedSet.clear();let r=Array.from(Ft.cssSet);Ft.cssSet.clear();let n=Array.from(Ft.nextSet);Ft.nextSet.clear(),jt.clear(),t.forEach((t=>t(o(t,"ov")))),e.forEach((t=>t())),r.forEach((t=>t())),n.forEach((t=>t()))}static pushWatch(t){Ft.watchSet.add(t)}static pushComputed(t){Ft.computedSet.add(t)}static pushCss(t){Ft.cssSet.add(t)}static pushNext(t,e){if(e){if(jt.has(e))return;jt.set(e,t)}Ft.nextSet.add(t),Ft.nextPending||(Ft.nextPending=!0,Ft.next())}}(()=>{const t=Promise.resolve(),e=Ft.flush;Ft.next=()=>{t.then(e)}})();const Gt={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},zt=new WeakMap;let Kt=[],Xt=0;const Qt=new Map,qt=new WeakMap,Yt=Symbol.for("PROP_OBJECT_KEY_MAP_SYMBOL");class Jt extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){Kt=C(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,g(t,((t,e)=>{T(e[0],/[A-Z]/)}))}#t;#e={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#h}get slotHooks(){return this.#p}get css(){return zt.get(this.constructor)}get globalStyleSheet(){return Qt.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#h;#g={};#p={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#v=!1;#b=!1;constructor(...t){super(),this.#t=Xt++,1===A(t)&&(this.#l={},w(this.#l,P(t)));let e=this.render.bind(this);this.render=function(){let t;return Rt.startRender(this),t=e(),Rt.endRender(this),t};let n=o(this.constructor,"globalStyles"),s=Qt.has(this.constructor);if(!l(n)&&!s){let t="";n.forEach((e=>{r(e)&&(t+=e+"\n")}));let e=document.createElement("style");e.textContent+=t,Qt.set(this.constructor,e),document.head.appendChild(e)}let i=zt.get(this.constructor),a=i??[];i||(g(o(this.constructor,"styles"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),a.push(e)}else a.push(t)})),zt.set(this.constructor,a)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...Kt,...a],this.#E();let c=o(this.constructor,yt);c&&c.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#y=this.#S.bind(this)}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#y;connectedCallback(){let t=k(this.parentNode,(t=>t instanceof Jt||t.host instanceof Jt),"parentNode");this.#d=t?t instanceof Jt?t:t.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#v)return;if(this.#b)return;this.#b=!0,this.#E();const t=this.#N();this.propsReady(t);for(const e in t){const r=t[e];this.#r[e]=r}this.#_(),g(this.#r,((t,e)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,e);Reflect.defineProperty(this,e,{get(){let t=Reflect.get(this.#n,e);return r?.get?r?.get():t},set(t){r?.set?r?.set(t):Reflect.set(this.#n,e,t)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=Bt(this.#r,this);let e=o(this.constructor,ct.COMPUTED);g(e,((t,e)=>{Rt.startCollect(this,lt.COMPUTED),Rt.setUpdater((()=>{this.#n[e]=t.call(this)})),this.#r[e]=t.call(this),Rt.endCollect(),Reflect.defineProperty(this,e,{get(){return Reflect.get(this.#n,e)},set(t){pt(this.tagName,"Cannot set a computed property '"+e+"'")}})}));let n=o(this.constructor,ct.WATCH);g(n,((t,e)=>{t.forEach((t=>{let{source:r,options:n,handler:s}=t,i=s.bind(this);o(n,"once",!1)&&(i=M(i));const a=function(t){let e=o(this,r.replaceAll(Ot,"."));i(e,t,r)}.bind(this);let l=o(n,"deep",!1);if(a.deep=l,Rt.collectWatch(this,(()=>a),e),!o(n,"immediate",!1))return;let c=o(this,r.replaceAll(Ot,"."));i(c,c,r)}))}));let i=function(t,e){let r,n=[];if($e.has(e.constructor)){let s=$e.get(e.constructor),i=function(t,e){let r=u(e.vars),n=e.strings.length-1;for(let s=0;s<=n;s++){let n=o(e.vars,s,"");if(n instanceof lr){let[e,o]=qe(t,n);r.splice(s,1,...o)}}return r}(e,t);r=Be.has(e.constructor)?function(t,e,r){let n=Be.get(r.constructor)?.cloneNode(!0),s=Ue.get(r.constructor);const o=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let i,a,l=0,c=0;for(;i=o.nextNode();){let n;if(c++,a&&!a.contains(i)&&(a=void 0),i instanceof HTMLElement||i instanceof SVGElement){i instanceof Jt&&(a=i);let o={};s[c].forEach((s=>{let c=e[l++];switch(s.type){case je.Event:n=rt(s.up),s.value||l--,s.value&&Me(s.name,c.bind(r),i,r),i.removeAttribute(s.attrName);break;case je.AttrSlot:a&&s.name,i.removeAttribute(s.attrName);break;case je.Ref:n=rt(s.up),c.current=i,i.removeAttribute(s.attrName);break;case je.AttrKey:n=rt(s.up),i.setAttribute(We,c);break;case je.AttrBool:n=rt(s.up),n.value=!!c,n.node=i,n.value&&i.setAttribute(s.name,""),i.removeAttribute(s.attrName);break;case je.AttrProp:n=rt(s.up),n.value=c,n.node=i,o[s.name]=c,s.attrName&&i.removeAttribute(s.attrName);break;case je.AttrRef:case je.Attr:n=rt(s.up),n.value=c,n.node=i,i.setAttribute(s.attrName,c),je.AttrRef===s.type&&i.removeAttribute(s.name);break;case je.DirectiveAttr:case je.DirectiveTag:case je.DirectiveProp:n=rt(s.up),n.value=c,n.node=i;let t=rt(s.point);t.startNode=i;let[e,u,d,h,p]=c,f=Qe.get(i);if(f||(f={},Qe.set(i,f)),f[s.attrName??Symbol.keyFor(e)]=[t,r,a],d(t,u,void 0,{renderComponent:r,slotComponent:a,varChain:p}),je.DirectiveAttr===s.type){let t=i.getAttribute(s.attrName);t=J(t,Ze,""),i.setAttribute(s.attrName,t)}s.name&&i.removeAttribute(s.name)}n&&t.push(n)})),i instanceof Jt?(i._initProps(o),i._regWrapper(r)):i instanceof HTMLSlotElement&&r._bindSlot(i,i.name||"default",o)}else{s[c].forEach((s=>{let o=e[l++];switch(s.type){case je.DirectiveSlot:case je.DirectiveText:n=rt(s.up),n.value=o,n.node=i;let[t,e,l,c,u]=o,d=Symbol.keyFor(t),h=document.createComment(`compelem-${r.tagName}-${d}-start`);n.textNode=h,i.parentNode.insertBefore(h,i),i.nodeValue=`compelem-${r.tagName}-${d}-end`;let p=rt(s.point);p.startNode=h,p.endNode=i,Ke.set(i,[p,r,a,e,u]),ze.set(i,l),Xe.set(i,n),Rt.startRender(i);let f=l(p,e,void 0,{renderComponent:r,slotComponent:a,varChain:u});Rt.endRender(r);let g=er(i,f[1],r);g&&g.length>0&&sr.insertBefore(i,Array.from(g));break;case je.Text:n=rt(s.up),n.node=i;let m=Z(o??""),v=document.createTextNode(m);i.replaceWith(v),n.textNode=v}n&&t.push(n)}))}}return n.childNodes}(n,i,e):tr(n,s,i,e)}else{let[s,o]=qe(e,t);$e.set(e.constructor,s),r=tr(n,s,o,e)}return Fe.set(e,n),r}(this.render(),this);i&&(this.#o.append(...i),this.#u=U(this.#o.childNodes,(t=>t.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),g(this.#p,((t,e)=>{this.#C(e)}));const a=this;let l=o(this.constructor,yt);l&&l.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}));let c=o(this.constructor,"hostStyles"),d=this.#h?.shadowRoot??this.ownerDocument,h=qt.get(d);if(!h?.includes(this.constructor)&&c.length>0){let t=[];g(c,(e=>{if(r(e)){let r=new CSSStyleSheet;r.replaceSync(e),t.push(r)}else t.push(e)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...t],h?.push(this.constructor)}this.beforeMount();let p=o(this.constructor,ct.EVENTS);p&&p.forEach((async t=>{let e=t.name,r=w({target:document,once:!1,passive:!1,capture:!1},t.options),n=D(t.fn,this),s=r.target;N(s)&&(s=await s.call(this,this)),s?s.addEventListener(e,n,r):pt(this.tagName,"The target of @event('"+e+"',...) is invalid")})),Rt.startCollect(this,lt.CSS);let f=[];this.styles.forEach((t=>{if(!N(t))return;let e=new CSSStyleSheet;f.push(e),Rt.setUpdater((()=>{let r=t()??"";e.replaceSync(r)}));let r=t();s(r)||e.replaceSync(r)})),Rt.endCollect(),f.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...f]),setTimeout((()=>{this.#f=!0,this.mounted(),l&&l.forEach((t=>{t.mounted(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}))}),0),this.#v=!0}propsReady(t){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#T(t,e){this.#E();let r=o(this.#e[e],"props");r&&g(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Jt?t._updateProps(r):g(r,((e,r)=>{if(t instanceof HTMLSlotElement){let n=o(t,"__l_comp");if(n){let s=t.name||"default",o=n.#e[s];o||(o=n.#e[s]={props:{}}),o.props||(o.props={}),o.props[r]=e,n.#T(t,s)}}else t.setAttribute(r,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,r){if(Object.is(r,e))return;let n=x(t);if(mt(o(this.constructor,[ct.PROPS,n]).type)){let t=vt(r);if(o(this,n)===t)return}this.#A(t,e,r)}shouldUpdate(t){return!0}updated(t){}#w={};_notify(t,e){let r=[];for(let n=0;n<e.length;n++){const s=e[n];r.push(s);let i=o(this,r),a=ft(r);this.#s[a]={value:i,chain:"slots"===a?["slots"]:r,oldValue:t,end:r.length===e.length}}return this.#y}#S(){if(A(this.#s)<1)return;const t=this.#s;this.#s={};const e=Object.keys(t);let r=o(this.constructor,yt);if(r&&r.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)})),!this.shouldUpdate(t))return;let n=new Set;const s=this.#i;g(t,(({value:t,chain:e,oldValue:r,end:o},i)=>{s[i]&&s[i].forEach((t=>{n.add(t)}))})),n.forEach((t=>{t===this?rr(this.render(),this,void 0,e):nr(t,this)})),this.#P.forEach((t=>{this.#C(t)})),this.updated(t)}#N(){let t=o(this.constructor,ct.PROPS),e=this.attributes,r=this.tagName,s=this.#l,l={};g(e,(({name:e,value:r})=>{if(e[0]===De||e[0]===xe||e[0]===Oe||e===He||"slot"===e)return;let n=x(e);t&&!t[n]&&(l[e]=r)})),this.#a=this.#a?w(this.#a,l):l;let u={};if(!t)return Object.seal(u);let d=Object.keys(t),h=d.length;for(let l=0;l<h;l++){const h=d[l],p=m(h),f=this.hasAttribute(p);let g,v=t[h],b=c(s,h),E=o(this,h);if(!("_defaultValue"in v)&&(v._defaultValue=E,!v.type)){n(E)&&pt(r,"Prop '"+h+"' has neither propType nor defaultValue be used for type inference");let t=typeof E;S(E)&&(t="array");let e=Gt[t];v.type=e}if(b)g=O(s[h])?E:s[h];else{g=E;let t=e.getNamedItem(p)||e.getNamedItem(xe+p);t&&(b=!0,g=t.value)}if(v.required&&!b){pt(r,"Prop '"+h+"' is required");break}g=this.#k(t,h,g,f);let y=o(t,[h,"getter"]);y&&(y=D(y,this));let N=o(t,[h,"setter"]);N&&(N=D(N,this)),(y||N)&&Reflect.defineProperty(this.#r,h,{set:N||function(t){},get:y}),v.attribute&&a(g)&&!i(g)&&this.#M(v,h,g),this.#r[h]=g,u[h]=g}return Object.seal(u)}#M(t,e,r){let n=m(e),s=R(r);mt(t.type)?(s=vt(r),L(s)?s&&!this.hasAttribute(n)?this.toggleAttribute(n,!0):!s&&this.hasAttribute(n)&&this.toggleAttribute(n,!1):this.getAttribute(n)!==s&&this.setAttribute(n,s)):this.getAttribute(n)!==s&&this.setAttribute(n,s)}#D(t,e){let r=t;try{for(let n=0;n<e.length;n++){const s=e[n];r=s===Boolean?vt(t):s===Number?Number(t):s===String?String(t):s===Object||s===Array?H(t):s===Date?new Date(t):new s(t)}}catch(e){pt(this.tagName,"Convert attribute error with "+t)}return r}#k(t,n,s,o){let i=t[n];if(!i)return s;let l=i.isValid,c=i.type,u=S(c)?c:[c],d=i.converter,h=s;if(!e(u,(t=>t===String))&&r(h)&&!W(h))try{h=d?d(h):this.#D(h,u)}catch(t){pt(this.tagName,`Convert attribute '${n}' error with `+h)}for(let t=0;t<u.length;t++){"Boolean"===u[t].name&&o&&(h=vt(h))}if(O(h))return h;let p=typeof h,f=!a(h);for(let t=0;t<u.length;t++){const e=u[t];if(T(p,e.name,"i")||h instanceof e||Object.prototype.toString.call(h)===Object.prototype.toString.call(e.prototype)){f=!0;break}}return f||pt(this.tagName,`Invalid prop '${n}'. expected '${u.map((t=>t.name||t))}' but got '${p}'`),l&&(l.call(this,h,this.#r)||pt(this.tagName,`Invalid prop '${n}'. IsValid() check failed`)),h}#_(){let t=o(this.constructor,ct.STATES);g(t,((e,r)=>{let n=t[r],s=o(this,r);if(n){let t=n.prop;s=t?f(this.#r[t]):o(this,r)}this.#r[r]=s}))}#x=I(this.propsReady,100);_updateProps(t){let e=o(this.constructor,ct.PROPS),r=[];g(t,((t,n)=>{let s=x(n),o=e[s];o&&(t=this.#k(e,s,t),o.attribute&&a(t)&&!i(t)&&r.push([o,s,t]),Rt.__skipCheck=!0,V(this,s,t),Rt.__skipCheck=!1)})),w(this.#l,t),r.forEach((([t,e,r])=>{this.#M(t,e,r)})),this.#x(this.#l)}_initProps(t,e){this.#l=p(this.#l||{},t),this.#a=p(this.#a||{},e)}_bindSlot(t,e,r){if(this.#g[e]||(this.#g[e]=t,Reflect.defineProperty(t,"__l_comp",{value:this})),t.addEventListener("slotchange",(r=>{this.#v&&this.#T(t,"default"===e?"":e)})),!l(r)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=r}}_bindSlotHook(t,e){this.#p[t]=e}#P=new Set;_updateSlot(t,e,r){let n=this.#g[t],s=this.#p[t];if(!s&&!n)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=r),s)this.#P.add(t);else{let t=n.assignedElements({flatten:!0});for(let n=0;n<t.length;n++){t[n].setAttribute(e,r+"")}}}#E(){const t=C(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let e=$(t,(t=>t.nodeType===Node.TEXT_NODE?"default":t instanceof Element?t.getAttribute("slot")||"default":void 0));if(l(e))return void(l(this.#r["#slots"])||(this.#v?this.#n["#slots"]={}:this.#r["#slots"]={}));g(e,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=b(t);if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};g(e,((t,e)=>{l(t)||(r[e]=t)})),this.#v?this.#n["#slots"]=r:this.#r["#slots"]=r}#C(t){let e=this.#p[t];if(!e)return;let r=this.#e[t];if(!this.#r["#slots"][t])return;this.renderAsync(e,o(r,"props"));const n=this._asyncDirectives.get(e);let s=n?.buildView(e(o(r,"props"))),i=B(v(s),(t=>t.nodeType===Node.COMMENT_NODE));if(i){let e=this.#m[t];if(!l(e))for(let t=0;t<e.length;t++){const r=e[t];r.parentNode?.removeChild(r)}this.#m[t]=i,this.append(...i),this.#P.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#A(t,e,r){if(!this.#v)return;if(kt(this.constructor).has(t)){let e=x(t);if(W(r)){r=o(this.constructor,ct.PROPS)[e]._defaultValue}this._updateProps({[e]:r})}}_regDeps(t,e){let r=this.#i[t];r||(r=this.#i[t]=new Set),r.add(e);let n=t.split(Ot);if(n.pop(),n.length<1)return;let s=n.join(Ot);r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(e)}_regWrapper(t){this.#h=t}_getPrivateData(){return this.#r}emit(t,e={},r){r&&r.event&&(e.event=r.event),e.target=this,this.dispatchEvent(new CustomEvent(t,{bubbles:o(r,"bubbles",!1),composed:o(r,"composed",!1),cancelable:!0,detail:e}))}on(t,e){this.#w[t]||(this.#w[t]=[]);let r=e.bind(this);this.#w[t].push(r),this.addEventListener(t,r)}nextTick(t,e){Ft.pushNext(t,e)}forceUpdate(){g(this.#n,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#S()}}class Zt{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(t,e,r){this.startNode=t,this.attrName=e,this.type=r}setVarIndex(t){this.varIndex=t}getNodes(){let t=this.startNode.nextSibling;if(!this.endNode)return[t];let e=[];for(;t&&t!==this.endNode;)e.push(t),t=t?.nextSibling;return e}}var te;!function(t){t.AFTER_BEGIN="afterbegin"}(te||(te={}));const ee={};function re(t,e,r,n,s,o,i,a=!1){let c;if(a?(Rt.startRender(t.endNode),c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),Rt.endRender(s)):c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),!c)return;let[u,d]=c;if(u===Dt.NONE)return;let h=t.getNodes();if(u===Dt.REMOVE)for(let t=0;t<h.length;t++){const e=h[t];e.parentNode?.removeChild(e)}else if(u===Dt.REPLACE){let e=[];for(let t=0;t<h.length;t++){const e=h[t];e.parentNode?.removeChild(e)}let r=er(t.endNode,d,s);e=v(r);let n=document.createDocumentFragment();n.append(...e),t.endNode.parentNode.insertBefore(n,t.endNode)}else if(u===Dt.UPDATE){let e,r={},n=[],o=[],i=Ge.get(t.endNode);if(d||(d=new lr([],[])),l(h)){let e=er(t.endNode,d,s);return void t.startNode.after(...e)}let a={};d instanceof lr&&d.vars.forEach((t=>{if(t instanceof lr){const e=t.getKey();a[e]=t,r[e]=!0,o.push(e)}})),h=U(j(h),(t=>t.nodeType===Node.ELEMENT_NODE)),e=U(j(v(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let c={},u="",p={};for(let t=0;t<h.length;t++){let e=h[t],r=e.getAttribute("key");if(r){if(c[r]){u=r;break}c[r]=e,n.push(r),p[r]=!0}}if(u)return void ht(`${x(t.endNode._diName)} - duplicate key '${u}'`);let f=r;const m=t.startNode.parentNode;let E=[],y=[];g(p,((t,e)=>{f[e]||(y.push(e),delete p[e],F(n,(t=>t===e)))}));let S,N=!1;if(!l(o)){let e=-1,r=[],s=[],i=0,a=0;for(;a<o.length;a++){const l=o[a];let u=n.findIndex((t=>t===l));if(u<0){let e=o[a-1],r=e?c[e]||e:t.startNode;E.push({prevNode:r,newkey:l}),i++}else if(u>-1&&u!==a-i){if(e<0||1===Math.abs(e-u)){let t=b(r);r.push({nodeId:l,targetId:0===a?te.AFTER_BEGIN:t?t.nodeId:o[a-1]})}else s.push({moveGroup:r,moveIndex:a+r.length}),r=[],r.push({nodeId:l,targetId:o[a-1]});e=u}}if(r.length>0&&s.push({moveGroup:r,moveIndex:a+r.length}),s.length>0){N=!0;let e=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(e.length<2){let{moveGroup:r}=e[0];if(r.length>1){let t=b(r).targetId;r[r.length-2].nodeId===t&&(r=_(r))}r.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===te.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}else{let r=b(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-r)&&(e=_(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===te.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}))}}}if(E.length>0&&(S=function(t,e,r,n,s,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let r=b(u);r&&c===t.prevNode?(r.group||(r.group=[c]),r.group.push(t.newkey)):u.push(t),c=t.newkey;let n=t.newkey;l.push(n),i.push(""),a.push(e[n])})),i.push("");let d=new lr(i,a),h=[...s],p=er(o,d,n),f=Ge.get(o);s.length=0,s.push(...f);let g=new Map;return p.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(g.set(e,!0),ee[e]=t)})),h.forEach(((t,e)=>{const n=t.key+"";!g.get(n)&&r.includes(n)&&s.push(t)})),u}(E,a,o,s,i,t.endNode),S.forEach(((e,r)=>{let n=e.newkey,s=ee[n],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...G(e.group,(t=>ee[t]))),s=t}o===t.endNode?o.before(s):o===t.startNode?o.after(s):"string"==typeof o?ee[o].after(s):o.after(s)}))),y.forEach((t=>{let e=c[t];e&&e.parentNode&&m.removeChild(e)})),d.vars[0]instanceof lr){let t=[],e=[];g(d.vars,(r=>{e.push(...r.vars),t.push(...G(r.vars,(t=>"1")))})),t.push("1"),d=new lr(t,e)}if(N||y.length>0||S){const t=$(i,(t=>t.key));let e=[],r=0;o.forEach((n=>{t[n].forEach((t=>{t.varIndex=r++,e.push(t)}))})),i=e}nr(t.endNode,s,d,i)}}let ne=0;function se(t,e){let r=t.name||"Di-"+ne++,n=Symbol.for(r);return(...e)=>{let r=t(...e);return[n,e,r,t=>{},Rt.popDirectiveQ()]}}const oe=["resize","outside","mutate"],ie=new WeakMap,ae=[],le=[],ce=[],ue=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,r=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;let n=ie.get(e.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:t.inlineSize,h:t.blockSize}}}),e.target)}}}));var de;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(de||(de={}));const he=new WeakMap,pe=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const r=t[e];let n=he.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=de.Tree,o=n[de.Tree];break;case"childList":s.type=de.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[de.Child];break;case"attributes":s.type=de.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[de.Attr];break;case"characterData":s.type=de.Char,s.oldValue=r.oldValue,o=n[de.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function fe(t,e,r,n){if("resize"===t)!function(t,e){ie.has(t)||(ie.set(t,e),ue.observe(t))}(e,r);else if("outside"===t)switch(n[0]){case"mousedown":!function(t,e){ae.push([t,e])}(e,r);break;case"dblclick":!function(t,e){ce.push([t,e])}(e,r);break;default:!function(t,e){le.push([t,e])}(e,r)}else"mutate"===t&&function(t,e,r){let n=z(r,"child"),s=z(r,"attr"),o=z(r,"char"),i=z(r,"tree"),a=he.get(t);a||(a={},he.set(t,a),n&&(a[de.Child]=e),s&&(a[de.Attr]=e),o&&(a[de.Char]=e),i&&(a[de.Tree]=e),pe.observe(t,{childList:n,attributes:s,characterData:o,subtree:i}))}(e,r,n)}document.addEventListener("mousedown",(t=>{let e=o(t.composedPath(),0,t.target);ae.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(k(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("click",(t=>{let e=o(t.composedPath(),0,t.target);le.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(k(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("dblclick",(t=>{let e=o(t.composedPath(),0,t.target);ce.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(k(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1);const ge=/,|^(debounce:.+)|(debounce$)/,me=/,|^(throttle:.+)|(throttle$)/,ve="self",be="stop",Ee="prevent",ye="once",Se="left",Ne="right",_e="middle",Ce="ctrl",Te="alt",Ae="shift",we="meta",Pe={esc:"escape"},ke=":";function Me(t,e,r,n){let s,o=t.split("."),i=o.shift(),a=o.includes(ye),l=e;if(s=K(o,(t=>ge.test(t)))){let t=s.split(ke);l=I(l,parseInt(t[1])||100)}if(s=K(o,(t=>me.test(t)))){let t=s.split(ke);l=X(l,parseInt(t[1])||100)}if(a&&(l=M(l)),function(t){return oe.includes(t)}(i))return fe(i,r,l,o),l;let c=t=>{if(o.includes(Ee)&&t.preventDefault(),o.includes(be)&&t.stopPropagation(),!o.includes(ve)||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes(Se)&&0!=t.button)return;if(o.includes(Ne)&&2!=t.button)return;if(o.includes(_e)&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(F(o,(t=>t==Ce))[0]&&!t.ctrlKey)return;if(F(o,(t=>t==Te))[0]&&!t.altKey)return;if(F(o,(t=>t==Ae))[0]&&!t.shiftKey)return;if(F(o,(t=>t==we))[0]&&!t.metaKey)return;let e=G(o,(t=>Pe[t]||t));if(A(e)>0&&!e.includes(t.key.toLowerCase()))return}l(t)}};r.addEventListener(i,c);let u=n.__events[i];return u||(u=n.__events[i]=[]),u.push([r,c]),c}const De="@",xe=".",Oe="?",Re="*",Le=":",He="ref",We="key",Ie=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,Ve="slot-props",$e=new Map,Be=new Map,Ue=new Map;var je;!function(t){t.Event="event",t.Directive="directive",t.DirectiveTag="directiveTag",t.DirectiveAttr="directiveAttr",t.DirectiveProp="directiveProp",t.DirectiveText="directiveText",t.DirectiveSlot="directiveSlot",t.Attr="attr",t.AttrProp="attrProp",t.AttrBool="attrBool",t.AttrRef="attrRef",t.AttrSlot="attrSlot",t.AttrKey="key",t.Ref="ref",t.Text="text"}(je||(je={}));const Fe=new WeakMap,Ge=new WeakMap,ze=new WeakMap,Ke=new WeakMap,Xe=new WeakMap,Qe=new WeakMap;function qe(t,e){let r="",n=u(e.vars),s=e.strings.length-1,i=e.vars.length-1,a=0;for(let l=0;l<=s;l++){const s=e.strings[l];let c=o(n,a,"");if(c instanceof lr){let[e,r]=qe(t,c);c=e,n.splice(a,1,...r),a+=r.length-1}else c=l>i?"":Ye;a++,r=r+s+c}let l=0;return r=r.replace(Ie,((t,e)=>tt(t,Ye,(()=>Ye.replace("--\x3e","")+l++)))),r=r.replace(ir,"$1><").trim(),[r,n]}const Ye="\x3c!--c_ui-pl_df--\x3e",Je="\x3c!--c_ui-pl_df",Ze=/<!--c_ui-pl_df\d*(-->)?/;function tr(t,e,r,n,s=!1){const o=document.createElement("div");o.innerHTML=e;const i=Ue.has(n.constructor);s||!i||Be.has(n.constructor)||Be.set(n.constructor,o.cloneNode(!0));let a=0;const l=document.createNodeIterator(o,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let c,u,d=0,h=i?void 0:{},p=null,f="";for(;c=l.nextNode();){a++;let e=i?void 0:[];if(u&&!u.contains(c)&&(u=void 0),c instanceof HTMLElement||c instanceof SVGElement){c instanceof Jt&&(u=c);let s={},o=v(c.attributes);for(let i=0;i<o.length;i++){const a=o[i];let{name:l,value:h}=a;if(l!==Ve)if(E(l,Je)){let s=r[d];if(S(s)&&y(s[0])){let[,r,o,i,a]=s;i(Mt.TAG);let h=new Zt(c,l.substring(1),Mt.TAG),g=Qe.get(c);g||(g={},Qe.set(c,g)),g[Symbol.keyFor(s[0])]=[h,n,u];let m=new xt(d,c);m.isDirective=!0,m.value=s,m.isComponent=!!u,t.push(m),p&&p?.contains(c)&&(m.key=f),d++,o(h,r,void 0,{renderComponent:n,slotComponent:u,varChain:a}),e&&e.push({type:je.DirectiveTag,point:h,up:m,name:l})}c.removeAttribute(l)}else if(l[0]!==De)if(l!==He)if(l!==We){if(Ze.test(h)){let o=r[d],i=new xt(d,c,l.replace(/\.|\?|@/,""),h);if(i.isComponent=!!u,p&&p?.contains(c)&&(i.key=f),l[0]===xe||l[0]===Oe||l[0]===Re){if(S(o)&&y(o[0])){let[,t,r,s,a]=o;s(Mt.PROP);let d=l.substring(1),h=new Zt(c,d,Mt.PROP),p=Qe.get(c);p||(p={},Qe.set(c,p)),p[d]=[h,n,u],r(h,t,void 0,{renderComponent:n,slotComponent:u,varChain:a}),i.value=o,i.isDirective=!0,e&&e.push({type:je.DirectiveProp,up:i,point:h,name:l,attrName:d})}else if(l[0]===Oe){i.isToggleProp=!0,i.value=!!o;let t=l.substring(1);i.value&&c.setAttribute(t,""),e&&e.push({type:je.AttrBool,name:t,up:i,attrName:l})}else if(l[0]===Re){i.value=o;let t=l.substring(1);const[r,n]=t.split(Le);let s=r;switch(n){case"camel":s=x(s);break;case"kebab":s=m(s);break;case"snake":s=et(s)}i.attrName=s,c.setAttribute(s,o),e&&e.push({type:je.AttrRef,up:i,name:l,attrName:s})}else{let t=x(l.substring(1));i.value=o,i.isProp=!0,s[t]=o,e&&e.push({type:je.AttrProp,up:i,name:t,attrName:l})}c.removeAttribute(l),o=""}else{let t,r;i.value=o;let s={type:je.Attr,up:i,attrName:l};if(S(o)&&y(o[0])){let e=Mt.ATTR;"class"===l?e=Mt.CLASS:"style"===l&&(e=Mt.STYLE);let[,a,d,h,p]=o;h(e),i.isDirective=!0,i.attrName=l;let f=new Zt(c,l,e),g=Qe.get(c);g||(g={},Qe.set(c,g)),g[l]=[f,n,u],r=a,t=d,o="",s.type=je.DirectiveAttr,s.point=f}h=J(h,Ze,o),a.value=h,t&&t(s.point,r,void 0,{renderComponent:n,slotComponent:u}),e&&e.push(s)}t.push(i),d++}}else{let n=r[d];c.setAttribute(l,n);let s=new xt(d,c);s.notUpdated=!0,p&&p?.contains(c)&&(s.key=f),t.push(s),d++,p=c,f=n,e&&e.push({up:s,type:je.AttrKey}),t.length>0&&t.forEach((t=>{t.key=t.key??n}))}else{if(Ze.test(h)){let n=r[d],s=new xt(d,c);s.notUpdated=!0,p&&p?.contains(c)&&(s.key=f),t.push(s),d++,n.current=c,e&&e.push({type:je.Ref,up:s,attrName:l})}c.removeAttribute(l)}else{let s=t=>{},o=null,i=!1;if(Ze.test(h)){o=new xt(d,c),o.notUpdated=!0,p&&p?.contains(c)&&(o.key=f),t.push(o),s=r[d].bind(n),d++,i=!0}let a=l.substring(1);Me(a,s,c,n),c.removeAttribute(l),e&&e.push({type:je.Event,up:o,name:a,attrName:l,value:i})}else{let t=c.getAttribute("name")||"default";e&&e.push({type:je.AttrSlot,name:t,attrName:l})}}c instanceof Jt?(c._initProps(s),c._regWrapper(n)):c instanceof HTMLSlotElement&&n._bindSlot(c,c.name||"default",s)}else{let s=c;if(`\x3c!--${s.nodeValue}--\x3e`!==Ye)continue;let o=new xt(d,c);p&&p?.contains(c)&&(o.key=f),t.push(o),o.isComponent=!!u,o.isText=!0;let i=r[d];if(S(i)&&y(i[0])){const t=Symbol.keyFor(i[0]);let r;r=document.createComment(`compelem-${n.tagName}-${t}-start`),o.textNode=r,s.parentNode.insertBefore(r,s),s.nodeValue=`compelem-${n.tagName}-${t}-end`,s._diName=t,o.isDirective=!0,o.value=i;let a=u?Mt.SLOT:Mt.TEXT,[,l,c,d,h]=i;d(a);let p=new Zt(r,"",a);p.endNode=s,Ke.set(s,[p,n,u,l,h]),ze.set(s,c),Xe.set(s,o),Rt.startRender(s);let f=c(p,l,void 0,{renderComponent:n,slotComponent:u,varChain:h});if(Rt.endRender(n),f){let t=er(s,f[1],n);t&&t.length>0&&sr.insertBefore(s,Array.from(t))}i=void 0,e&&e.push({type:a===Mt.SLOT?je.DirectiveSlot:je.DirectiveText,up:o,point:p})}else o.value=i,e&&e.push({type:je.Text,up:o});d++;let a=Z(i??""),l=document.createTextNode(a);s.parentNode.insertBefore(l,s),o.textNode=l}h&&e&&(h[a]=e),p&&!p.contains(c)&&p!==c&&(p=null,f="")}return!s&&h&&Ue.set(n.constructor,h),o.childNodes}function er(t,e,r){let[n,s]=qe(r,e),o=[],i=tr(o,n,s,r,!0);return Ge.set(t,o),i}function rr(t,e,r,n){if(s(Q(t.strings)))return;if(!Fe.has(e))return;let a=t.flatVars(e);r=r??Fe.get(e);for(let t=0;t<r.length;t++){const s=r[t];let l=s.varIndex;if(l<0)continue;if(s.notUpdated)continue;let c=s.value,d=a,h=s.node,p=q(l,Ot);for(let e=0;e<p.length;e++){const r=p[e];d=o(d,r),d&&d.vars&&t<p.length-1&&(d=d.vars)}if(!i(c)&&c===d)continue;let f=h;if(s.isDirective){let[t,e,r,,n]=s.value,o=Ke.get(h);if(!o){const e=Qe.get(h);o=e[s.attrName]||e[Symbol.keyFor(t)]}let[i,a,l]=o,[,c]=d;const u=Xe.get(h);if(u){u.value=d;Ke.get(h)[3]=c}re(i,c,e,r,a,l,n,i.type==Mt.TEXT||i.type==Mt.SLOT)}else if(s.isToggleProp){if(!!d===c)continue;f.toggleAttribute(s.attrName,!!d),V(f,s.attrName,!!d)}else if(s.isProp){if(!i(d)&&d===c)continue;if(h instanceof Jt)if(i(d)&&Object.is(d,c)){let t=x(s.attrName),e=[t];if(n&&n.length>0){let r="",o=Q(Ht.get(s.value),Ot);n.forEach((t=>{t.startsWith(o)&&t.length>r.length&&(r=t)})),e=u(q(r.replace(o,t),Ot))}Ut(h,c,e)}else h._updateProps({[s.attrName]:d});else h instanceof HTMLSlotElement&&e._updateSlot(h.getAttribute("name")||"default",s.attrName,d)}else if(s.attrName){if(!Y(c,d))switch(s.attrName){case"value":if(h instanceof HTMLInputElement){h.value=d;break}default:h.setAttribute(s.attrName,J(s.attrTmpl,Ze,d+""))}}else if(s.isText){s.textNode.textContent=Z(d??"")}s.value=d}}function nr(t,e,r,n){const s=ze.get(t),[o,i,a,l,c]=Ke.get(t),u=Xe.get(t);if(!r){let t=s(o,u.value[1],l,{renderComponent:i,slotComponent:a,varChain:c});if(!t)return;r=t[1]}if(r&&r.vars[0]instanceof lr){let t=[],e=[];g(r.vars,(r=>{e.push(...r.vars),t.push(...G(r.vars,(t=>"1")))})),t.push("1"),r=new lr(t,e)}n&&Ge.set(t,n),rr(r,e,n=n??Ge.get(t))}const sr={insertBefore:function(t,e){if(!t.parentNode)return;let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let r=t.nextSibling;for(;r&&r!==e;)r?.parentNode?.removeChild(r),r=t.nextSibling}};function or(t,...e){return new lr(r(t)?[t]:t,e)}const ir=/([a-z0-9"'])\s*>\s*</gim;function ar(t){return{current:t}}class lr{strings;vars;constructor(t,e){this.strings=u(t),this.vars=e}getKey(){let t=this.vars,e="";return g(this.strings,((r,n)=>{if(at.test(r))return e=Z(t[n]),!1})),e}getKeys(){let t=this.vars,e=[];for(let r=0;r<this.strings.length;r++){const n=this.strings[r];if(at.test(n)){let n=Z(t[r]);e.push(n)}}return l(e)&&t.forEach((t=>{if(t instanceof lr){let r=t.getKey();e.push(r)}})),e}append(t){let e=b(this.strings);return t.strings.forEach(((t,r)=>{0!=r?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=u(this.vars,t.vars),this}insert(t,e){let r=e.strings.shift();return this.strings[t]+=r,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,r]=qe(t,this),n=tr([],e,r,t);return nt(n,((t,e)=>t+(e.outerHTML??"")),"")}flatVars(t){let e=u(this.vars),r=this.strings.length-1,n=0;for(let s=0;s<=r;s++){let r=o(e,n,"");if(r instanceof lr&&r.vars.length>0){let[s,o]=qe(t,r);r=s,e.splice(n,1,...o),n+=o.length-1}n++}return e}}function cr(t,e,r){r.get||ht(`Computed '${e}' must be a getter`),c(t.constructor,ct.COMPUTED)||(t.constructor[ct.COMPUTED]=l(t.constructor[ct.COMPUTED])?{}:f(t.constructor[ct.COMPUTED])),t.constructor[ct.COMPUTED][e]=r.get}const ur=Ct(class extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);V(t,r,I(s,this.wait,this.immediate));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&V(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[dt.METHOD]}wait;immediate;result;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function dr(t,e){return(r,n,s)=>{c(r.constructor,ct.EVENTS)||(r.constructor[ct.EVENTS]=l(r.constructor[ct.EVENTS])?[]:f(r.constructor[ct.EVENTS])),r.constructor[ct.EVENTS].push({name:t,options:e,fn:r[n]})}}const hr=Ct(class extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=D(o(t,r),t);V(t,r,M(s));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&V(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[dt.METHOD]}wait;result;constructor(){super()}});var pr;!function(t){t.ONCE="once",t.UPDATABLE="updatable"}(pr||(pr={}));class fr extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){}mounted(t,e,...r){}get targets(){return[dt.FIELD]}selector;cache;result;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){this.result=t.shadowRoot?.querySelector(this.selector)}beforeMount(t,e,r,n,...s){const o=this;Reflect.defineProperty(t,n,{get:()=>(o.result&&o.cache||o.getter(t),o.result)})}updated(t,e){this.cache===pr.UPDATABLE&&this.getter(t)}}const gr=Ct(fr),mr=Ct(class extends fr{getter(t){this.result=t.shadowRoot?.querySelectorAll(this.selector)}});function vr(t){if(1===arguments.length)return(e,r)=>{br(e,r,t)};br(arguments[0],arguments[1],{prop:""})}function br(t,e,r){if(!c(t.constructor,ct.STATES)){const e={};let r=t.constructor;for(;(r=gt(r))!==Jt;)p(e,r[ct.STATES]?f(r[ct.STATES]):{});Reflect.defineProperty(t.constructor,ct.STATES,{configurable:!1,enumerable:!1,value:e})}r.shallow=r.shallow||!1,t.constructor[ct.STATES][e]=r}function Er(t,e,r){br(t.prototype,e,r||{prop:""})}function yr(t){return e=>{if(e){if(e.prototype.hasOwnProperty("attributeChangedCallback")){let t=e.prototype.attributeChangedCallback;e.prototype.attributeChangedCallback=function(e,r,n){Jt.prototype.attributeChangedCallback.call(this,e,r,n),t.call(this,e,r,n)}}if(e.prototype.hasOwnProperty("connectedCallback")){let t=e.prototype.connectedCallback;e.prototype.connectedCallback=function(){Jt.prototype.connectedCallback.call(this),t.call(this)}}if(e.prototype.hasOwnProperty("disconnectedCallback")){let t=e.prototype.disconnectedCallback;e.prototype.disconnectedCallback=function(){Jt.prototype.disconnectedCallback.call(this),t.call(this)}}customElements.define(t,e)}}}const Sr=Ct(class extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);V(t,r,X(s,this.wait));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&V(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[dt.METHOD]}wait;result;constructor(t){super(),this.wait=t}});function Nr(t,e){return(r,n)=>{c(r.constructor,ct.WATCH)||(r.constructor[ct.WATCH]=l(r.constructor[ct.WATCH])?{}:f(r.constructor[ct.WATCH]));(S(t)?t:[t]).forEach((t=>{let s=t.replaceAll(".",Ot),o=r.constructor[ct.WATCH][s];S(o)||(o=r.constructor[ct.WATCH][s]=[]),o.push({source:t,options:e,handler:r[n]})}))}}const _r=["key"],Cr=se((function(t){return(t,[e],r)=>{let n=t.startNode;if(r)g(e,((t,e)=>{n.setAttribute(e,t)}));else if(n instanceof Jt){let t={},r={},s=o(n.constructor,ct.PROPS);g(e,((e,n)=>{if(_r.includes(n))return;let o=x(n);s[o]?t[n]=e:r[n]=e+""})),n._initProps(t,r)}else g(e,((t,e)=>{n.setAttribute(e,t)}))}}),Mt.TAG),Tr=new Map,Ar=se((function(t){return(t,[e],n,{renderComponent:s})=>{let o=[];if(S(e)?o=j(e):i(e)?o=C(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!n)return;let a=t.startNode;if(Tr.get(a)&&Tr.get(a).length===o.length&&st(Tr.get(a),o))return;let l=Tr.get(a);g(l,(t=>{a.classList.remove(t)})),g(o,(t=>{a.classList.add(t)})),l=u(o),Tr.set(a,l)}}),Mt.CLASS),wr=new Map,Pr=new Map,kr=se((function(t,e){return(t,r,n,{varChain:s})=>{let o=t.startNode,i=function(t,e,r){let n=G(t,((t,r)=>e(t,r)));if(n.length<1){let t=new lr([],[]);return Pr.set(r,t),t}let s=[],o=[];const i=[],a=[];for(let t=0;t<n.length;t++){const e=n[t];let r=b(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(at.test(e)){let e=l[t]+"";if(s.includes(e))return void ht(`forEach - duplicate key '${e}'`);s.push(e),c=!1}0==t&&r?o[o.length-1]=r+e:o.push(e)}if(c)return void ht("forEach - missing 'key' prop");let d=b(i);d&&u.length>0&&(i[i.length-1]=R(d)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new lr(i,a);return Pr.set(r,l),l}(r[0],e,o);if(n&&n[0]){const e=wr.get(o);if(l(t.getNodes())&&(!r||l(r[0])))return[Dt.NONE,i];if(e&&st(e,r[0])&&e.length===r[0].length)return[Dt.NONE,i]}return wr.set(o,rt(r[0])),n?[Dt.UPDATE,i]:[Dt.APPEND,i]}}),(Mt.TEXT,Mt.SLOT));const Mr=new WeakMap,Dr=se((function(t,e,r){return(n,[s,o],i,{renderComponent:a})=>{let l=n.endNode;if(i){if(!!s==!!i[0]){let t=Mr.get(l);return[Dt.NONE,t.call(a,s)]}let t=s?e:r;return Mr.set(l,t),[Dt.REPLACE,t.call(a,s)]}{let n=s?e:r;return Mr.set(l,n),[Dt.APPEND,n.call(a,t)]}}}),(Mt.TEXT,Mt.SLOT)),xr=se((function(t,e){return(t,[e,r],n)=>n?e===n[0]?[Dt.NONE,e?r():or``]:e?[Dt.REPLACE,e?r():or``]:[Dt.REMOVE]:[Dt.APPEND,e?r():or``]}),(Mt.TEXT,Mt.SLOT));var Or;!function(t){t.CHANGE="change",t.INPUT="input"}(Or||(Or={}));const Rr=new WeakMap,Lr=se((function(t,e="value"){return(r,n,s,{varChain:a,renderComponent:l})=>{const c=r.startNode;if(s){if(Y(n,s))return;if(!Y(n,s)){let t=n[0];if(c instanceof Jt)c._updateProps({[e]:t});else if(c instanceof HTMLTextAreaElement||c instanceof HTMLSelectElement){if(c.setAttribute(e,t+""),c instanceof HTMLSelectElement){let e=K(c.querySelectorAll("option"),(e=>e.value==t));e&&(e.selected=!0)}}else if(c instanceof HTMLInputElement){if(c.value==t)return;switch(c.type){case"checkbox":case"radio":t?c.setAttribute("checked",""):c.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":c.setAttribute(e,t+""),V(c,e,t);break;default:c.setAttribute(e,t+"")}}}return}if("binded"===o(c,"_model"))return;let u=b(a);if(Rr.set(c,u),i(t)||R(t)||(t=""),c instanceof Jt)c._initProps({[e]:t}),c.addEventListener("update:"+e,(t=>{V(l,u,t.detail.value)})),V(c,"_model","binded");else if(c instanceof HTMLTextAreaElement)c.setAttribute(e,t+""),c.addEventListener("input",(t=>{let e=t.target;V(l,u,e.value)})),V(c,"_model","binded");else if(c instanceof HTMLInputElement){let r="",n="";switch(c.type){case"checkbox":case"radio":r="checked",n="change";break;default:r="value",n="input"}c.setAttribute(e??r,t+""),c.addEventListener(n,(t=>{let e=t.target;V(l,u,e.value)})),V(c,"_model","binded")}else c instanceof HTMLSelectElement&&(c.setAttribute(e,t+""),c.addEventListener("change",(t=>{let e=t.target;V(l,u,e.value)})),V(c,"_model","binded"))}}),Mt.TAG),Hr=new Map,Wr=se((function(t,e){return(t,[r],n)=>{if(n&&r===n[0])return;let s=t.startNode;if(!Hr.has(s)){let t=s.style.display;Hr.set(s,"none"==t?"unset":t)}s.style.display=r?Hr.get(s):"none",e&&e(s,r)}}),Mt.TAG),Ir=se((function(t,e){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(t=t.bind(o),i._bindSlotHook(e||"default",t))}}),Mt.SLOT);class Vr{static getCssText(t,e=!1){return r(t)?t:Q(G(t,((t,r)=>r.startsWith("--")?r+":"+t+(e?" !important":""):m(r)+":"+t+(e?" !important":""))),";")}static setStyle(t,e){if(r(t)&&!R(t))return{};let n=Vr.getCssText(t),s={};return g(n.split(";"),(t=>{let r=t.split(":"),n=R(r[0]),o=R(r[1]);s[n]=e.style.getPropertyValue(n),e.style.setProperty(n,o)})),s}}const $r=new Map;let Br=0;const Ur=se((function(t){return(t,e,r,{renderComponent:n})=>{let s=t.startNode,o=$r.get(s);o||(o="style_d"+Br++,$r.set(s,o)),n.nextTick((()=>{Vr.setStyle(e[0],s)}),o)}}),Mt.STYLE),jr=se((function(t){return(e,r,n,{renderComponent:s,varChain:o})=>{const i=e.startNode;if(n){if(!Y(r,n)){let t=e.attrName;i._updateProps({[t]:r[0]})}return}let a=b(o),l=e.attrName;i._initProps({[l]:t}),i.addEventListener("update:"+l,(t=>{V(s,a,t.detail.value)}))}}),Mt.PROP),Fr=se((function(t,e){return(t,[e,r],n)=>{let s=()=>or``,o=[],i=[];g(r,((t,e)=>{if(N(t))o.push(e),i.push(t);else{let e=t[0],r=t[1];o.push(e),i.push(r)}"default"===e&&(s=t)}));let a=ot(o,(t=>N(t)?t(e):t==e));return n?[Dt.REPLACE,it(i[a]??s)]:[Dt.APPEND,it(i[a]??s)]}}),(Mt.TEXT,Mt.SLOT));export{Jt as CompElem,Vr as CssHelper,bt as Decorator,dt as DecoratorType,Nt as DecoratorWrapper,Dt as DirectiveUpdateTag,Zt as EnterPoint,Mt as EnterPointType,Et as GetKeyFnName,Or as ModelTriggerType,Ot as PATH_SEPARATOR,Yt as PROP_OBJECT_KEY_MAP_SYMBOL,pr as QueryCache,lr as Template,xt as UpdatePoint,St as _DecoratorMap,yt as _DecoratorsKey,kt as _getObservedAttrs,Cr as bind,qe as buildHTML,Ar as classes,cr as computed,ar as createRef,ur as debounced,Ct as decorator,se as directive,dr as event,kr as forEach,or as html,Dr as ifElse,xr as ifTrue,Er as makeState,Lr as model,hr as onced,At as prop,gr as query,mr as queryAll,Wr as show,Ir as slot,vr as state,Ur as styles,jr as sync,yr as tag,Sr as throttled,re as updateDirective,Nr as watch,Fr as when};
7
+ import{toPath as t,some as e,isString as r,isUndefined as n,isBlank as s,get as o,isObject as i,isDefined as a,isEmpty as l,has as c,concat as u,defaults as d,isLowerCaseChar as h,merge as p,cloneDeep as f,each as g,kebabCase as m,toArray as v,last as b,startsWith as E,isSymbol as y,isArray as S,isFunction as N,initial as _,flatMap as C,test as T,size as A,assign as w,first as P,closest as k,once as M,bind as D,camelCase as x,isNil as O,trim as R,isBoolean as L,parseJSON as H,isNull as W,debounce as I,set as V,groupBy as $,reject as B,filter as U,compact as j,remove as F,map as G,includes as z,find as K,throttle as X,join as Q,split as q,isEqual as Y,replace as J,toString as Z,replaceAll as tt,snakeCase as et,clone as rt,reduce as nt,isMatch as st,findIndex as ot,call as it}from"myfx";const at=/\s+\.?key\s*=/;var lt,ct,ut,dt;function ht(t){console.error("[CompElem]",t)}function pt(t,e){console.error(`[CompElem <${t}>]`,e)}function ft(e){return t(e).join("-")}function gt(t){return Object.getPrototypeOf(t)}function mt(t){return t===Boolean||e(t,(t=>t===Boolean))}function vt(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||s(e))&&(e=!0),e}!function(t){t[t.CSS=1]="CSS",t[t.COMPUTED=2]="COMPUTED"}(lt||(lt={})),function(t){t.PROPS="__deco_props",t.STATES="__deco_states",t.COMPUTED="__deco_computed",t.WATCH="__deco_watch",t.EVENTS="__deco_events"}(ct||(ct={})),function(t){t.Prod="prod",t.Dev="dev"}(ut||(ut={})),function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(dt||(dt={}));class bt{static get priority(){return 0}}const Et="getKey",yt="__decorators",St=new WeakMap;class Nt{args;metadata;decoratorClass;instanceMap;key;priority=0;constructor(t,e,r){this.args=t,this.metadata=e,this.decoratorClass=r,this.priority=o(r,"priority",0),this.instanceMap=new WeakMap}create(t){let e,r=new this.decoratorClass(...this.args),s=r.targets,c=this.metadata[2];i(c)&&a(o(c,"configurable"))?e=dt.METHOD:n(this.metadata[2])&&(e=dt.FIELD),!l(s)&&e&&s.includes(e)?(r.created(t,...this.metadata),this.instanceMap.set(t,r)):ht(`Decorator '${this.decoratorClass.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.instanceMap.get(t).beforeMount(t,e,...this.metadata)}mounted(t,e){this.instanceMap.get(t).mounted(t,e,...this.metadata)}updated(t,e){this.instanceMap.get(t).updated(t,e)}}const _t=new WeakMap;function Ct(t){let e=(...e)=>(...r)=>{let n=r[0].constructor,s=n[yt];if(!c(n,yt)){let t=Object.getPrototypeOf(n);s=t?u(t[yt]??[]):[],Reflect.defineProperty(n,yt,{configurable:!1,enumerable:!1,value:s})}let o,i={},a=t[Et];if(a){let r=_t.get(t);if(r||(r=new WeakMap,_t.set(t,r)),i=r.get(n),i||(i={},r.set(n,i)),o=a(...e),i[o])return i[o]}let l=new Nt(e,r,t);return i[o]=l,s?.push(l),l};return St.set(e,!0),e}const Tt=new WeakMap;function At(t){if(1===arguments.length)return(e,r,n)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,wt(e,r,t,n)};let e=arguments[0],r=arguments[1],n=arguments[2];t={type:void 0,required:!1,attribute:!0},n&&"function"==typeof n.type&&(t=d(n,t),n=void 0),wt(e,r,t,n)}function wt(t,e,r,n){let s;if(h(e[0])||ht(`Prop '${e}' must be in CamelCase`),!c(t.constructor,ct.PROPS)){const e={};let r=t.constructor;for(;(r=gt(r))!==Jt;)p(e,r[ct.PROPS]?f(r[ct.PROPS]):{});Reflect.defineProperty(t.constructor,ct.PROPS,{configurable:!1,enumerable:!1,value:e}),s=new Set,g(e,((t,e)=>{if(t.attribute){let t=m(e);s?.add(t)}})),Tt.set(t.constructor,s)}if(n&&(n.get&&(r.getter=n.get),n.set&&(r.setter=n.set)),r.attribute){s||(s=Tt.get(t.constructor));let r=m(e);s?.add(r)}c(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),t.constructor.observedAttributes=v(s),t.constructor[ct.PROPS][e]=r}const Pt=new Set;function kt(t){return Tt.get(t)??Pt}var Mt,Dt;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(Mt||(Mt={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Dt||(Dt={}));class xt{key;varIndex;value;isText=!1;isDirective=!1;node;textNode;isComponent=!1;attrName;attrTmpl;isProp=!1;isToggleProp=!1;notUpdated;constructor(t,e,r,n){this.varIndex=t,this.node=e,r&&(this.attrName=r),n&&(this.attrTmpl=n)}}const Ot="-",Rt={collectWatch(t,e,r){let n=Vt.get(t);n||(n={},Vt.set(t,n));let s=n[r];s||(s=n[r]=[]),s.push(e)},startCollect(t,e){this.__collectType=e,this.__collecting=t},setUpdater(t){this.__updater=t},endCollect(){this.__collecting=null},__directiveQ:[],setDirectiveQ(t){let e=b(this.__directiveQ);const r=t?t.join(","):"",n=e?e.join(","):"";e&&r===n||(e&&e.length<t.length&&E(r,n)?this.__directiveQ[this.__directiveQ.length-1]=t:this.__directiveQ.push(t))},popDirectiveQ(){let t=u(this.__directiveQ);return this.__directiveQ=[],t},startRender(t){this.__renderCollecting=!0,this.__renderContext=t},endRender(t){this.__renderCollection.forEach((e=>{t._regDeps(e,this.__renderContext)})),this.__renderCollection.clear(),this.__renderCollecting=!1,this.__renderContext=null},collect(t){this.__renderCollection.add(t)},clear(){this.__directiveQ=[]},__updater:null,__collecting:null,__collectType:-1,__renderCollection:new Set,__renderContext:null,__renderCollecting:!1,__skipCheck:!1},Lt=new WeakMap,Ht=new WeakMap,Wt=new WeakMap,It=new WeakMap,Vt=new WeakMap,$t=new WeakMap;function Bt(t,e){if(!i(t))return t;if($t.has(t))return $t.get(t);if(Lt.has(t))return t;const r=new Proxy(t,{get(t,e,r){if(!e)return;const n=Reflect.get(t,e,r);if(y(e))return n;if("length"===e&&S(t))return n;let s=Ht.get(r)??[],a=u(s,[e]),l=e in t;if((Rt.__renderCollecting||Rt.__collecting)&&(l&&t.hasOwnProperty(e)||!l)){let t=a.join(Ot);if(Rt.__renderCollecting)Rt.collect(ft(a)),Rt.setDirectiveQ(a);else if(Rt.__collecting){let e;switch(Rt.__collectType){case lt.COMPUTED:e=Wt.get(Rt.__collecting),e||(e={},Wt.set(Rt.__collecting,e));break;case lt.CSS:e=It.get(Rt.__collecting),e||(e={},It.set(Rt.__collecting,e))}let r=e[t];r||(r=e[t]=[]),r.push(Rt.__updater)}}const c=Lt.get(r);let d=c.from,h=o(d.constructor,ct.STATES);if(o(h,[e,"shallow"]))return n;let p=n;if(i(n)&&!N(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=c.pathMap;c.contextSet.forEach((e=>{let r=t?.get(e);r&&(p=Bt(n,e),$t.set(n,p),Ht.has(p)||Ht.set(p,a))}))}return p},set(t,r,n,s){if(!r)return!1;let i=t[r],a=Ht.get(s)??[],l=u(a,[r]),c=o(e.constructor,ct.PROPS),d=o(e.constructor,ct.STATES),h=o(c,[l[0],"hasChanged"])||o(d,[l[0],"hasChanged"]);if(h){let t=n,r=i;if(l.length>1&&(r=t=e._getPrivateData()[l[0]]),!h.call(e,t,r,l,n,i))return!0}else if(Object.is(i,n))return!0;c&&c[r]&&t.__isData&&c[r].sync&&e.emit("update:"+r,{value:n});let p=n,f=Reflect.set(t,r,p);return Ut(e,i,l),f}});let n=Ht.get(t)??[];if(Object.isExtensible(t)&&!Lt.get(r)){let t=new Set;t.add(e);let s=new WeakMap;s.set(e,n),Lt.set(r,{from:e,contextSet:t,pathMap:s})}else{Lt.get(r).contextSet.add(e);let t=Lt.get(r).pathMap,s=t.get(e),i=u(n);if(s&&s.join("")!==i.join("")){let t=o(e,_(s));S(t)||function(...t){console.warn("[CompElem]",...t)}(`The object is referenced by more than one @state '${i.join(".")},${s.join(".")}'`),s=i}else t.set(e,i)}return $t.set(t,r),r}function Ut(t,e,r){let n=Wt.get(t),s=It.get(t),i=Vt.get(t);if(n||s||i){let t=r.length;for(;t;){let a=r.slice(0,t).join(Ot);if(i){const n=i[a];t===r.length?n?.forEach((t=>{let r=t();r.ov=e,Ft.pushWatch(r)})):n?.forEach((t=>{let r=t();o(r,"deep")&&(r.ov=e,Ft.pushWatch(r))}))}if(n){let t=n[a];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Ft.pushComputed(r)}}if(s){let t=s[a];if(!l(t))for(let e=0;e<t.length;e++){const r=t[e];Ft.pushCss(r)}}t--}}let a=t._notify(e,r);Ft.pushNext(a,t.cid)}const jt=new Map;class Ft{static watchSet=new Set;static computedSet=new Set;static cssSet=new Set;static nextSet=new Set;static nextPending=!1;static next;static flush(){Ft.nextPending=!1;let t=Array.from(Ft.watchSet);Ft.watchSet.clear();let e=Array.from(Ft.computedSet);Ft.computedSet.clear();let r=Array.from(Ft.cssSet);Ft.cssSet.clear();let n=Array.from(Ft.nextSet);Ft.nextSet.clear(),jt.clear(),t.forEach((t=>t(o(t,"ov")))),e.forEach((t=>t())),r.forEach((t=>t())),n.forEach((t=>t()))}static pushWatch(t){Ft.watchSet.add(t)}static pushComputed(t){Ft.computedSet.add(t)}static pushCss(t){Ft.cssSet.add(t)}static pushNext(t,e){if(e){if(jt.has(e))return;jt.set(e,t)}Ft.nextSet.add(t),Ft.nextPending||(Ft.nextPending=!0,Ft.next())}}(()=>{const t=Promise.resolve(),e=Ft.flush;Ft.next=()=>{t.then(e)}})();const Gt={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},zt=new WeakMap;let Kt=[],Xt=0;const Qt=new Map,qt=new WeakMap,Yt=Symbol.for("PROP_OBJECT_KEY_MAP_SYMBOL");class Jt extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){Kt=C(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,g(t,((t,e)=>{T(e[0],/[A-Z]/)}))}#t;#e={};#r={"#slots":{}};#n={};#s={};#o;#i={};__events={};get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get reactiveData(){return this.#n}get attrs(){return this.#a}get props(){return this.#l}get renderRoot(){return this.#c}get renderRoots(){return this.#u}get parentComponent(){return this.#d}get wrapperComponent(){return this.#h}get slotHooks(){return this.#p}get css(){return zt.get(this.constructor)}get globalStyleSheet(){return Qt.get(this.constructor)?.sheet}get isMounted(){return this.#f}get slots(){return this.#r["#slots"]}#a;#l;#c;#u;#d;#h;#g={};#p={};#m={};#f=!1;static get styles(){return[]}static get globalStyles(){return[]}static get hostStyles(){return[]}get styles(){return[]}#v=!1;#b=!1;constructor(...t){super(),this.#t=Xt++,1===A(t)&&(this.#l={},w(this.#l,P(t)));let e=this.render.bind(this);this.render=function(){let t;return Rt.startRender(this),t=e(),Rt.endRender(this),t};let n=o(this.constructor,"globalStyles"),s=Qt.has(this.constructor);if(!l(n)&&!s){let t="";n.forEach((e=>{r(e)&&(t+=e+"\n")}));let e=document.createElement("style");e.textContent+=t,Qt.set(this.constructor,e),document.head.appendChild(e)}let i=zt.get(this.constructor),a=i??[];i||(g(o(this.constructor,"styles"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),a.push(e)}else a.push(t)})),zt.set(this.constructor,a)),this.#o=this.attachShadow({mode:"open"}),this.#o.adoptedStyleSheets=[...Kt,...a],this.#E();let c=o(this.constructor,yt);c&&c.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#y=this.#S.bind(this)}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#y;connectedCallback(){let t=k(this.parentNode,(t=>t instanceof Jt||t.host instanceof Jt),"parentNode");this.#d=t?t instanceof Jt?t:t.host:null,this.__init()}disconnectedCallback(){}__init(){if(this.#v)return;if(this.#b)return;this.#b=!0,this.#E();const t=this.#N();this.propsReady(t);for(const e in t){const r=t[e];this.#r[e]=r}this.#_(),g(this.#r,((t,e)=>{let r=Reflect.getOwnPropertyDescriptor(this.#r,e);Reflect.defineProperty(this,e,{get(){let t=Reflect.get(this.#n,e);return r?.get?r?.get():t},set(t){r?.set?r?.set(t):Reflect.set(this.#n,e,t)}})})),Reflect.defineProperty(this.#r,"__isData",{enumerable:!1,value:!0}),this.#n=Bt(this.#r,this);let e=o(this.constructor,ct.COMPUTED);g(e,((t,e)=>{Rt.startCollect(this,lt.COMPUTED),Rt.setUpdater((()=>{this.#n[e]=t.call(this)})),this.#r[e]=t.call(this),Rt.endCollect(),Reflect.defineProperty(this,e,{get(){return Reflect.get(this.#n,e)},set(t){pt(this.tagName,"Cannot set a computed property '"+e+"'")}})}));let n=o(this.constructor,ct.WATCH);g(n,((t,e)=>{t.forEach((t=>{let{source:r,options:n,handler:s}=t,i=s.bind(this);o(n,"once",!1)&&(i=M(i));const a=function(t){let e=o(this,r.replaceAll(Ot,"."));i(e,t,r)}.bind(this);let l=o(n,"deep",!1);if(a.deep=l,Rt.collectWatch(this,(()=>a),e),!o(n,"immediate",!1))return;let c=o(this,r.replaceAll(Ot,"."));i(c,c,r)}))}));let i=function(t,e){let r,n=[];if($e.has(e.constructor)){let s=$e.get(e.constructor),i=function(t,e){let r=u(e.vars),n=e.strings.length-1;for(let s=0;s<=n;s++){let n=o(e.vars,s,"");if(n instanceof lr){let[e,o]=qe(t,n);r.splice(s,1,...o)}}return r}(e,t);r=Be.has(e.constructor)?function(t,e,r){let n=Be.get(r.constructor)?.cloneNode(!0),s=Ue.get(r.constructor);const o=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let i,a,l=0,c=0;for(;i=o.nextNode();){let n;if(c++,a&&!a.contains(i)&&(a=void 0),i instanceof HTMLElement||i instanceof SVGElement){i instanceof Jt&&(a=i);let o={},u=s[c];u&&u.forEach((s=>{let c=e[l++];switch(s.type){case je.Event:n=rt(s.up),s.value||l--,s.value&&Me(s.name,c.bind(r),i,r),i.removeAttribute(s.attrName);break;case je.AttrSlot:a&&s.name,i.removeAttribute(s.attrName);break;case je.Ref:n=rt(s.up),c.current=i,i.removeAttribute(s.attrName);break;case je.AttrKey:n=rt(s.up),i.setAttribute(We,c);break;case je.AttrBool:n=rt(s.up),n.value=!!c,n.node=i,n.value&&i.setAttribute(s.name,""),i.removeAttribute(s.attrName);break;case je.AttrProp:n=rt(s.up),n.value=c,n.node=i,o[s.name]=c,s.attrName&&i.removeAttribute(s.attrName);break;case je.AttrRef:case je.Attr:n=rt(s.up),n.value=c,n.node=i,i.setAttribute(s.attrName,c),je.AttrRef===s.type&&i.removeAttribute(s.name);break;case je.DirectiveAttr:case je.DirectiveTag:case je.DirectiveProp:n=rt(s.up),n.value=c,n.node=i;let t=rt(s.point);t.startNode=i;let[e,u,d,h,p]=c,f=Qe.get(i);if(f||(f={},Qe.set(i,f)),f[s.attrName??Symbol.keyFor(e)]=[t,r,a],d(t,u,void 0,{renderComponent:r,slotComponent:a,varChain:p}),je.DirectiveAttr===s.type){let t=i.getAttribute(s.attrName);t=J(t,Ze,""),i.setAttribute(s.attrName,t)}s.name&&i.removeAttribute(s.name)}n&&t.push(n)})),i instanceof Jt?(i._regWrapper(r),A(o)>0&&i._initProps(o)):i instanceof HTMLSlotElement&&r._bindSlot(i,i.name||"default",o)}else{let o=s[c];o&&o.forEach((s=>{let o=e[l++];switch(s.type){case je.DirectiveSlot:case je.DirectiveText:n=rt(s.up),n.value=o,n.node=i;let[t,e,l,c,u]=o,d=Symbol.keyFor(t),h=document.createComment(`compelem-${r.tagName}-${d}-start`);n.textNode=h,i.parentNode.insertBefore(h,i),i.nodeValue=`compelem-${r.tagName}-${d}-end`;let p=rt(s.point);p.startNode=h,p.endNode=i,Ke.set(i,[p,r,a,e,u]),ze.set(i,l),Xe.set(i,n),Rt.startRender(i);let f=l(p,e,void 0,{renderComponent:r,slotComponent:a,varChain:u});Rt.endRender(r);let g=er(i,f[1],r);g&&g.length>0&&sr.insertBefore(i,Array.from(g));break;case je.Text:n=rt(s.up),n.node=i;let m=Z(o??""),v=document.createTextNode(m);i.replaceWith(v),n.textNode=v}n&&t.push(n)}))}}return n.childNodes}(n,i,e):tr(n,s,i,e)}else{let[s,o]=qe(e,t);$e.set(e.constructor,s),r=tr(n,s,o,e)}return Fe.set(e,n),r}(this.render(),this);i&&(this.#o.append(...i),this.#u=U(this.#o.childNodes,(t=>t.nodeType===Node.ELEMENT_NODE)),this.#c=this.#u[0]),g(this.#p,((t,e)=>{this.#C(e)}));const a=this;let l=o(this.constructor,yt);l&&l.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}));let c=o(this.constructor,"hostStyles"),d=this.#h?.shadowRoot??this.ownerDocument,h=qt.get(d);if(!h?.includes(this.constructor)&&c.length>0){let t=[];g(c,(e=>{if(r(e)){let r=new CSSStyleSheet;r.replaceSync(e),t.push(r)}else t.push(e)})),d.adoptedStyleSheets=[...d.adoptedStyleSheets,...t],h?.push(this.constructor)}this.beforeMount();let p=o(this.constructor,ct.EVENTS);p&&p.forEach((async t=>{let e=t.name,r=w({target:document,once:!1,passive:!1,capture:!1},t.options),n=D(t.fn,this),s=r.target;N(s)&&(s=await s.call(this,this)),s?s.addEventListener(e,n,r):pt(this.tagName,"The target of @event('"+e+"',...) is invalid")})),Rt.startCollect(this,lt.CSS);let f=[];this.styles.forEach((t=>{if(!N(t))return;let e=new CSSStyleSheet;f.push(e),Rt.setUpdater((()=>{let r=t()??"";e.replaceSync(r)}));let r=t();s(r)||e.replaceSync(r)})),Rt.endCollect(),f.length>0&&(this.#o.adoptedStyleSheets=[...this.#o.adoptedStyleSheets,...f]),setTimeout((()=>{this.#f=!0,this.mounted(),l&&l.forEach((t=>{t.mounted(this,((t,e)=>(a.#n[t]=e,a.#n[t])))}))}),0),this.#v=!0}propsReady(t){}render(){throw Error(`[CompElem <${this.tagName}>] Missing render()`)}beforeMount(){}mounted(){}#T(t,e){this.#E();let r=o(this.#e[e],"props");r&&g(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Jt?t._updateProps(r):g(r,((e,r)=>{if(t instanceof HTMLSlotElement){let n=o(t,"__l_comp");if(n){let s=t.name||"default",o=n.#e[s];o||(o=n.#e[s]={props:{}}),o.props||(o.props={}),o.props[r]=e,n.#T(t,s)}}else t.setAttribute(r,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,r){if(Object.is(r,e))return;let n=x(t);if(mt(o(this.constructor,[ct.PROPS,n]).type)){let t=vt(r);if(o(this,n)===t)return}this.#A(t,e,r)}shouldUpdate(t){return!0}updated(t){}#w={};_notify(t,e){let r=[];for(let n=0;n<e.length;n++){const s=e[n];r.push(s);let i=o(this,r),a=ft(r);this.#s[a]={value:i,chain:"slots"===a?["slots"]:r,oldValue:t,end:r.length===e.length}}return this.#y}#S(){if(A(this.#s)<1)return;const t=this.#s;this.#s={};const e=Object.keys(t);let r=o(this.constructor,yt);if(r&&r.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)})),!this.shouldUpdate(t))return;let n=new Set;const s=this.#i;g(t,(({value:t,chain:e,oldValue:r,end:o},i)=>{s[i]&&s[i].forEach((t=>{n.add(t)}))})),n.forEach((t=>{t===this?rr(this.render(),this,void 0,e):nr(t,this)})),this.#P.forEach((t=>{this.#C(t)})),this.updated(t)}#N(){let t=o(this.constructor,ct.PROPS),e=this.attributes,r=this.tagName,s=this.#l,l={};g(e,(({name:e,value:r})=>{if(e[0]===De||e[0]===xe||e[0]===Oe||e===He||"slot"===e)return;let n=x(e);t&&!t[n]&&(l[e]=r)})),this.#a=this.#a?w(this.#a,l):l;let u={};if(!t)return Object.seal(u);let d=Object.keys(t),h=d.length;for(let l=0;l<h;l++){const h=d[l],p=m(h),f=this.hasAttribute(p);let g,v=t[h],b=c(s,h),E=o(this,h);if(!("_defaultValue"in v)&&(v._defaultValue=E,!v.type)){n(E)&&pt(r,"Prop '"+h+"' has neither propType nor defaultValue be used for type inference");let t=typeof E;S(E)&&(t="array");let e=Gt[t];v.type=e}if(b)g=O(s[h])?E:s[h];else{g=E;let t=e.getNamedItem(p)||e.getNamedItem(xe+p);t&&(b=!0,g=t.value)}if(v.required&&!b){pt(r,"Prop '"+h+"' is required");break}g=this.#k(t,h,g,f);let y=o(t,[h,"getter"]);y&&(y=D(y,this));let N=o(t,[h,"setter"]);N&&(N=D(N,this)),(y||N)&&Reflect.defineProperty(this.#r,h,{set:N||function(t){},get:y}),v.attribute&&a(g)&&!i(g)&&this.#M(v,h,g),this.#r[h]=g,u[h]=g}return Object.seal(u)}#M(t,e,r){let n=m(e),s=R(r);mt(t.type)?(s=vt(r),L(s)?s&&!this.hasAttribute(n)?this.toggleAttribute(n,!0):!s&&this.hasAttribute(n)&&this.toggleAttribute(n,!1):this.getAttribute(n)!==s&&this.setAttribute(n,s)):this.getAttribute(n)!==s&&this.setAttribute(n,s)}#D(t,e){let r=t;try{for(let n=0;n<e.length;n++){const s=e[n];r=s===Boolean?vt(t):s===Number?Number(t):s===String?String(t):s===Object||s===Array?H(t):s===Date?new Date(t):new s(t)}}catch(e){pt(this.tagName,"Convert attribute error with "+t)}return r}#k(t,n,s,o){let i=t[n];if(!i)return s;let l=i.isValid,c=i.type,u=S(c)?c:[c],d=i.converter,h=s;if(!e(u,(t=>t===String))&&r(h)&&!W(h))try{h=d?d(h):this.#D(h,u)}catch(t){pt(this.tagName,`Convert attribute '${n}' error with `+h)}for(let t=0;t<u.length;t++){"Boolean"===u[t].name&&o&&(h=vt(h))}if(O(h))return h;let p=typeof h,f=!a(h);for(let t=0;t<u.length;t++){const e=u[t];if(T(p,e.name,"i")||h instanceof e||Object.prototype.toString.call(h)===Object.prototype.toString.call(e.prototype)){f=!0;break}}return f||pt(this.tagName,`Invalid prop '${n}'. expected '${u.map((t=>t.name||t))}' but got '${p}'`),l&&(l.call(this,h,this.#r)||pt(this.tagName,`Invalid prop '${n}'. IsValid() check failed`)),h}#_(){let t=o(this.constructor,ct.STATES);g(t,((e,r)=>{let n=t[r],s=o(this,r);if(n){let t=n.prop;s=t?f(this.#r[t]):o(this,r)}this.#r[r]=s}))}#x=I(this.propsReady,100);_updateProps(t){let e=o(this.constructor,ct.PROPS),r=[];g(t,((t,n)=>{let s=x(n),o=e[s];o&&(t=this.#k(e,s,t),o.attribute&&a(t)&&!i(t)&&r.push([o,s,t]),Rt.__skipCheck=!0,V(this,s,t),Rt.__skipCheck=!1)})),w(this.#l,t),r.forEach((([t,e,r])=>{this.#M(t,e,r)})),this.#l&&this.#x(this.#l)}_wrapperProp=new Set;_initProps(t,e){this.#l=p(this.#l||{},t),this.#a=p(this.#a||{},e),g(t,((t,e)=>{if(i(t)){let e=Ht.get(t);if(e){let t=e.join(Ot);this._wrapperProp.add(t)}}}))}_bindSlot(t,e,r){if(this.#g[e]||(this.#g[e]=t,Reflect.defineProperty(t,"__l_comp",{value:this})),t.addEventListener("slotchange",(r=>{this.#v&&this.#T(t,"default"===e?"":e)})),!l(r)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=r}}_bindSlotHook(t,e){this.#p[t]=e}#P=new Set;_updateSlot(t,e,r){let n=this.#g[t],s=this.#p[t];if(!s&&!n)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=r),s)this.#P.add(t);else{let t=n.assignedElements({flatten:!0});for(let n=0;n<t.length;n++){t[n].setAttribute(e,r+"")}}}#E(){const t=C(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let e=$(t,(t=>t.nodeType===Node.TEXT_NODE?"default":t instanceof Element?t.getAttribute("slot")||"default":void 0));if(l(e))return void(l(this.#r["#slots"])||(this.#v?this.#n["#slots"]={}:this.#r["#slots"]={}));g(e,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=b(t);if(!(e.nodeType===Node.TEXT_NODE&&s(e.textContent)||e instanceof HTMLSlotElement&&l(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};g(e,((t,e)=>{l(t)||(r[e]=t)})),this.#v?this.#n["#slots"]=r:this.#r["#slots"]=r}#C(t){let e=this.#p[t];if(!e)return;let r=this.#e[t];if(!this.#r["#slots"][t])return;this.renderAsync(e,o(r,"props"));const n=this._asyncDirectives.get(e);let s=n?.buildView(e(o(r,"props"))),i=B(v(s),(t=>t.nodeType===Node.COMMENT_NODE));if(i){let e=this.#m[t];if(!l(e))for(let t=0;t<e.length;t++){const r=e[t];r.parentNode?.removeChild(r)}this.#m[t]=i,this.append(...i),this.#P.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#A(t,e,r){if(!this.#v)return;if(kt(this.constructor).has(t)){let e=x(t);if(W(r)){r=o(this.constructor,ct.PROPS)[e]._defaultValue}this._updateProps({[e]:r})}}_regDeps(t,e){let r=this.#i[t];r||(r=this.#i[t]=new Set),r.add(e);let n=t.split(Ot);if(n.pop(),n.length<1)return;let s=n.join(Ot);r=this.#i[s],r||(r=this.#i[s]=new Set),r.add(e)}_regWrapper(t){this.#h=t}_getPrivateData(){return this.#r}emit(t,e={},r){r&&r.event&&(e.event=r.event),e.target=this,this.dispatchEvent(new CustomEvent(t,{bubbles:o(r,"bubbles",!1),composed:o(r,"composed",!1),cancelable:!0,detail:e}))}on(t,e){this.#w[t]||(this.#w[t]=[]);let r=e.bind(this);this.#w[t].push(r),this.addEventListener(t,r)}nextTick(t,e){Ft.pushNext(t,e)}forceUpdate(){g(this.#n,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#S()}}class Zt{startNode;endNode;type;attrName;varIndex;expressionChain;nodes;constructor(t,e,r){this.startNode=t,this.attrName=e,this.type=r}setVarIndex(t){this.varIndex=t}getNodes(){let t=this.startNode.nextSibling;if(!this.endNode)return[t];let e=[];for(;t&&t!==this.endNode;)e.push(t),t=t?.nextSibling;return e}}var te;!function(t){t.AFTER_BEGIN="afterbegin"}(te||(te={}));const ee={};function re(t,e,r,n,s,o,i,a=!1){let c;if(a?(Rt.startRender(t.endNode),c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),Rt.endRender(s)):c=n(t,e,r,{renderComponent:s,slotComponent:o,varChain:i}),!c)return;let[u,d]=c;if(u===Dt.NONE)return;let h=t.getNodes();if(u===Dt.REMOVE)for(let t=0;t<h.length;t++){const e=h[t];e.parentNode?.removeChild(e)}else if(u===Dt.REPLACE){let e=[];for(let t=0;t<h.length;t++){const e=h[t];e.parentNode?.removeChild(e)}let r=er(t.endNode,d,s);e=v(r);let n=document.createDocumentFragment();n.append(...e),t.endNode.parentNode.insertBefore(n,t.endNode)}else if(u===Dt.UPDATE){let e,r={},n=[],o=[],i=Ge.get(t.endNode);if(d||(d=new lr([],[])),l(h)){let e=er(t.endNode,d,s);return void t.startNode.after(...e)}let a={};d instanceof lr&&d.vars.forEach((t=>{if(t instanceof lr){const e=t.getKey();a[e]=t,r[e]=!0,o.push(e)}})),h=U(j(h),(t=>t.nodeType===Node.ELEMENT_NODE)),e=U(j(v(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let c={},u="",p={};for(let t=0;t<h.length;t++){let e=h[t],r=e.getAttribute("key");if(r){if(c[r]){u=r;break}c[r]=e,n.push(r),p[r]=!0}}if(u)return void ht(`${x(t.endNode._diName)} - duplicate key '${u}'`);let f=r;const m=t.startNode.parentNode;let E=[],y=[];g(p,((t,e)=>{f[e]||(y.push(e),delete p[e],F(n,(t=>t===e)))}));let S,N=!1;if(!l(o)){let e=-1,r=[],s=[],i=0,a=0;for(;a<o.length;a++){const l=o[a];let u=n.findIndex((t=>t===l));if(u<0){let e=o[a-1],r=e?c[e]||e:t.startNode;E.push({prevNode:r,newkey:l}),i++}else if(u>-1&&u!==a-i){if(e<0||1===Math.abs(e-u)){let t=b(r);r.push({nodeId:l,targetId:0===a?te.AFTER_BEGIN:t?t.nodeId:o[a-1]})}else s.push({moveGroup:r,moveIndex:a+r.length}),r=[],r.push({nodeId:l,targetId:o[a-1]});e=u}}if(r.length>0&&s.push({moveGroup:r,moveIndex:a+r.length}),s.length>0){N=!0;let e=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(e.length<2){let{moveGroup:r}=e[0];if(r.length>1){let t=b(r).targetId;r[r.length-2].nodeId===t&&(r=_(r))}r.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===te.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}else{let r=b(e).moveIndex;1===Math.abs(e[e.length-2].moveIndex-r)&&(e=_(e)),e.forEach((({moveGroup:e})=>{e.forEach((({targetId:e,nodeId:r})=>{let n,s=c[r];e===te.AFTER_BEGIN?(n=t.startNode,n.after(s)):(n=c[e],n.after(s))}))}))}}}if(E.length>0&&(S=function(t,e,r,n,s,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let r=b(u);r&&c===t.prevNode?(r.group||(r.group=[c]),r.group.push(t.newkey)):u.push(t),c=t.newkey;let n=t.newkey;l.push(n),i.push(""),a.push(e[n])})),i.push("");let d=new lr(i,a),h=[...s],p=er(o,d,n),f=Ge.get(o);s.length=0,s.push(...f);let g=new Map;return p.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(g.set(e,!0),ee[e]=t)})),h.forEach(((t,e)=>{const n=t.key+"";!g.get(n)&&r.includes(n)&&s.push(t)})),u}(E,a,o,s,i,t.endNode),S.forEach(((e,r)=>{let n=e.newkey,s=ee[n],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...G(e.group,(t=>ee[t]))),s=t}o===t.endNode?o.before(s):o===t.startNode?o.after(s):"string"==typeof o?ee[o].after(s):o.after(s)}))),y.forEach((t=>{let e=c[t];e&&e.parentNode&&m.removeChild(e)})),d.vars[0]instanceof lr){let t=[],e=[];g(d.vars,(r=>{e.push(...r.vars),t.push(...G(r.vars,(t=>"1")))})),t.push("1"),d=new lr(t,e)}if(N||y.length>0||S){const t=$(i,(t=>t.key));let e=[],r=0;o.forEach((n=>{t[n].forEach((t=>{t.varIndex=r++,e.push(t)}))})),i=e}nr(t.endNode,s,d,i)}}let ne=0;function se(t,e){let r=t.name||"Di-"+ne++,n=Symbol.for(r);return(...e)=>{let r=t(...e);return[n,e,r,t=>{},Rt.popDirectiveQ()]}}const oe=["resize","outside","mutate"],ie=new WeakMap,ae=[],le=[],ce=[],ue=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,r=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;let n=ie.get(e.target);if(n){n(new CustomEvent("resize",{bubbles:!1,cancelable:!1,detail:{borderBox:{w:r.inlineSize,h:r.blockSize},contentBox:{w:t.inlineSize,h:t.blockSize}}}),e.target)}}}));var de;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(de||(de={}));const he=new WeakMap,pe=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const r=t[e];let n=he.get(r.target);if(!n)return;let s={target:r.target},o=null;switch(r.type){case"subtree":s.type=de.Tree,o=n[de.Tree];break;case"childList":s.type=de.Child,s.addedNodes=r.addedNodes,s.removedNodes=r.removedNodes,o=n[de.Child];break;case"attributes":s.type=de.Attr,s.attributeName=r.attributeName,s.oldValue=r.oldValue,o=n[de.Attr];break;case"characterData":s.type=de.Char,s.oldValue=r.oldValue,o=n[de.Char]}if(o){o(new CustomEvent("mutate",{bubbles:!1,cancelable:!1,detail:s}))}}}));function fe(t,e,r,n){if("resize"===t)!function(t,e){ie.has(t)||(ie.set(t,e),ue.observe(t))}(e,r);else if("outside"===t)switch(n[0]){case"mousedown":!function(t,e){ae.push([t,e])}(e,r);break;case"dblclick":!function(t,e){ce.push([t,e])}(e,r);break;default:!function(t,e){le.push([t,e])}(e,r)}else"mutate"===t&&function(t,e,r){let n=z(r,"child"),s=z(r,"attr"),o=z(r,"char"),i=z(r,"tree"),a=he.get(t);a||(a={},he.set(t,a),n&&(a[de.Child]=e),s&&(a[de.Attr]=e),o&&(a[de.Char]=e),i&&(a[de.Tree]=e),pe.observe(t,{childList:n,attributes:s,characterData:o,subtree:i}))}(e,r,n)}document.addEventListener("mousedown",(t=>{let e=o(t.composedPath(),0,t.target);ae.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(k(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("click",(t=>{let e=o(t.composedPath(),0,t.target);le.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(k(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1),document.addEventListener("dblclick",(t=>{let e=o(t.composedPath(),0,t.target);ce.forEach((([r,n])=>{if(!r.contains(e)&&!r.contains(k(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)){n(new CustomEvent("outside",{bubbles:!1,cancelable:!1,detail:{currentTarget:r,event:t}}),r)}}))}),!1);const ge=/,|^(debounce:.+)|(debounce$)/,me=/,|^(throttle:.+)|(throttle$)/,ve="self",be="stop",Ee="prevent",ye="once",Se="left",Ne="right",_e="middle",Ce="ctrl",Te="alt",Ae="shift",we="meta",Pe={esc:"escape"},ke=":";function Me(t,e,r,n){let s,o=t.split("."),i=o.shift(),a=o.includes(ye),l=e;if(s=K(o,(t=>ge.test(t)))){let t=s.split(ke);l=I(l,parseInt(t[1])||100)}if(s=K(o,(t=>me.test(t)))){let t=s.split(ke);l=X(l,parseInt(t[1])||100)}if(a&&(l=M(l)),function(t){return oe.includes(t)}(i))return fe(i,r,l,o),l;let c=t=>{if(o.includes(Ee)&&t.preventDefault(),o.includes(be)&&t.stopPropagation(),!o.includes(ve)||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes(Se)&&0!=t.button)return;if(o.includes(Ne)&&2!=t.button)return;if(o.includes(_e)&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(F(o,(t=>t==Ce))[0]&&!t.ctrlKey)return;if(F(o,(t=>t==Te))[0]&&!t.altKey)return;if(F(o,(t=>t==Ae))[0]&&!t.shiftKey)return;if(F(o,(t=>t==we))[0]&&!t.metaKey)return;let e=G(o,(t=>Pe[t]||t));if(A(e)>0&&!e.includes(t.key.toLowerCase()))return}l(t)}};r.addEventListener(i,c);let u=n.__events[i];return u||(u=n.__events[i]=[]),u.push([r,c]),c}const De="@",xe=".",Oe="?",Re="*",Le=":",He="ref",We="key",Ie=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,Ve="slot-props",$e=new Map,Be=new Map,Ue=new Map;var je;!function(t){t.Event="event",t.Directive="directive",t.DirectiveTag="directiveTag",t.DirectiveAttr="directiveAttr",t.DirectiveProp="directiveProp",t.DirectiveText="directiveText",t.DirectiveSlot="directiveSlot",t.Attr="attr",t.AttrProp="attrProp",t.AttrBool="attrBool",t.AttrRef="attrRef",t.AttrSlot="attrSlot",t.AttrKey="key",t.Ref="ref",t.Text="text"}(je||(je={}));const Fe=new WeakMap,Ge=new WeakMap,ze=new WeakMap,Ke=new WeakMap,Xe=new WeakMap,Qe=new WeakMap;function qe(t,e){let r="",n=u(e.vars),s=e.strings.length-1,i=e.vars.length-1,a=0;for(let l=0;l<=s;l++){const s=e.strings[l];let c=o(n,a,"");if(c instanceof lr){let[e,r]=qe(t,c);c=e,n.splice(a,1,...r),a+=r.length-1}else c=l>i?"":Ye;a++,r=r+s+c}let l=0;return r=r.replace(Ie,((t,e)=>tt(t,Ye,(()=>Ye.replace("--\x3e","")+l++)))),r=r.replace(ir,"$1><").trim(),[r,n]}const Ye="\x3c!--c_ui-pl_df--\x3e",Je="\x3c!--c_ui-pl_df",Ze=/<!--c_ui-pl_df\d*(-->)?/;function tr(t,e,r,n,s=!1){const o=document.createElement("div");o.innerHTML=e;const i=Ue.has(n.constructor);s||!i||Be.has(n.constructor)||Be.set(n.constructor,o.cloneNode(!0));let a=0;const l=document.createNodeIterator(o,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let c,u,d=0,h=i?void 0:{},p=null,f="";for(;c=l.nextNode();){a++;let e=i?void 0:[];if(u&&!u.contains(c)&&(u=void 0),c instanceof HTMLElement||c instanceof SVGElement){c instanceof Jt&&(u=c);let s={},o=v(c.attributes);for(let i=0;i<o.length;i++){const a=o[i];let{name:l,value:h}=a;if(l!==Ve)if(E(l,Je)){let s=r[d];if(S(s)&&y(s[0])){let[,r,o,i,a]=s;i(Mt.TAG);let h=new Zt(c,l.substring(1),Mt.TAG),g=Qe.get(c);g||(g={},Qe.set(c,g)),g[Symbol.keyFor(s[0])]=[h,n,u];let m=new xt(d,c);m.isDirective=!0,m.value=s,m.isComponent=!!u,t.push(m),p&&p?.contains(c)&&(m.key=f),d++,o(h,r,void 0,{renderComponent:n,slotComponent:u,varChain:a}),e&&e.push({type:je.DirectiveTag,point:h,up:m,name:l})}c.removeAttribute(l)}else if(l[0]!==De)if(l!==He)if(l!==We){if(Ze.test(h)){let o=r[d],i=new xt(d,c,l.replace(/\.|\?|@/,""),h);if(i.isComponent=!!u,p&&p?.contains(c)&&(i.key=f),l[0]===xe||l[0]===Oe||l[0]===Re){if(S(o)&&y(o[0])){let[,t,r,s,a]=o;s(Mt.PROP);let d=l.substring(1),h=new Zt(c,d,Mt.PROP),p=Qe.get(c);p||(p={},Qe.set(c,p)),p[d]=[h,n,u],r(h,t,void 0,{renderComponent:n,slotComponent:u,varChain:a}),i.value=o,i.isDirective=!0,e&&e.push({type:je.DirectiveProp,up:i,point:h,name:l,attrName:d})}else if(l[0]===Oe){i.isToggleProp=!0,i.value=!!o;let t=l.substring(1);i.value&&c.setAttribute(t,""),e&&e.push({type:je.AttrBool,name:t,up:i,attrName:l})}else if(l[0]===Re){i.value=o;let t=l.substring(1);const[r,n]=t.split(Le);let s=r;switch(n){case"camel":s=x(s);break;case"kebab":s=m(s);break;case"snake":s=et(s)}i.attrName=s,c.setAttribute(s,o),e&&e.push({type:je.AttrRef,up:i,name:l,attrName:s})}else{let t=x(l.substring(1));i.value=o,i.isProp=!0,s[t]=o,e&&e.push({type:je.AttrProp,up:i,name:t,attrName:l})}c.removeAttribute(l),o=""}else{let t,r;i.value=o;let s={type:je.Attr,up:i,attrName:l};if(S(o)&&y(o[0])){let e=Mt.ATTR;"class"===l?e=Mt.CLASS:"style"===l&&(e=Mt.STYLE);let[,a,d,h,p]=o;h(e),i.isDirective=!0,i.attrName=l;let f=new Zt(c,l,e),g=Qe.get(c);g||(g={},Qe.set(c,g)),g[l]=[f,n,u],r=a,t=d,o="",s.type=je.DirectiveAttr,s.point=f}h=J(h,Ze,o),a.value=h,t&&t(s.point,r,void 0,{renderComponent:n,slotComponent:u}),e&&e.push(s)}t.push(i),d++}}else{let n=r[d];c.setAttribute(l,n);let s=new xt(d,c);s.notUpdated=!0,p&&p?.contains(c)&&(s.key=f),t.push(s),d++,p=c,f=n,e&&e.push({up:s,type:je.AttrKey}),t.length>0&&t.forEach((t=>{t.key=t.key??n}))}else{if(Ze.test(h)){let n=r[d],s=new xt(d,c);s.notUpdated=!0,p&&p?.contains(c)&&(s.key=f),t.push(s),d++,n.current=c,e&&e.push({type:je.Ref,up:s,attrName:l})}c.removeAttribute(l)}else{let s=t=>{},o=null,i=!1;if(Ze.test(h)){o=new xt(d,c),o.notUpdated=!0,p&&p?.contains(c)&&(o.key=f),t.push(o),s=r[d].bind(n),d++,i=!0}let a=l.substring(1);Me(a,s,c,n),c.removeAttribute(l),e&&e.push({type:je.Event,up:o,name:a,attrName:l,value:i})}else{let t=c.getAttribute("name")||"default";e&&e.push({type:je.AttrSlot,name:t,attrName:l})}}c instanceof Jt?(c._regWrapper(n),A(s)>0&&c._initProps(s)):c instanceof HTMLSlotElement&&n._bindSlot(c,c.name||"default",s)}else{let s=c;if(`\x3c!--${s.nodeValue}--\x3e`!==Ye)continue;let o=new xt(d,c);p&&p?.contains(c)&&(o.key=f),t.push(o),o.isComponent=!!u,o.isText=!0;let i=r[d];if(S(i)&&y(i[0])){const t=Symbol.keyFor(i[0]);let r;r=document.createComment(`compelem-${n.tagName}-${t}-start`),o.textNode=r,s.parentNode.insertBefore(r,s),s.nodeValue=`compelem-${n.tagName}-${t}-end`,s._diName=t,o.isDirective=!0,o.value=i;let a=u?Mt.SLOT:Mt.TEXT,[,l,c,d,h]=i;d(a);let p=new Zt(r,"",a);p.endNode=s,Ke.set(s,[p,n,u,l,h]),ze.set(s,c),Xe.set(s,o),Rt.startRender(s);let f=c(p,l,void 0,{renderComponent:n,slotComponent:u,varChain:h});if(Rt.endRender(n),f){let t=er(s,f[1],n);t&&t.length>0&&sr.insertBefore(s,Array.from(t))}i=void 0,e&&e.push({type:a===Mt.SLOT?je.DirectiveSlot:je.DirectiveText,up:o,point:p})}else o.value=i,e&&e.push({type:je.Text,up:o});d++;let a=Z(i??""),l=document.createTextNode(a);s.parentNode.insertBefore(l,s),o.textNode=l}h&&e&&(h[a]=e),p&&!p.contains(c)&&p!==c&&(p=null,f="")}return!s&&h&&Ue.set(n.constructor,h),o.childNodes}function er(t,e,r){let[n,s]=qe(r,e),o=[],i=tr(o,n,s,r,!0);return Ge.set(t,o),i}function rr(t,e,r,n){if(s(Q(t.strings)))return;if(!Fe.has(e))return;let a=t.flatVars(e);r=r??Fe.get(e);for(let t=0;t<r.length;t++){const s=r[t];let l=s.varIndex;if(l<0)continue;if(s.notUpdated)continue;let c=s.value,d=a,h=s.node,p=q(l,Ot);for(let e=0;e<p.length;e++){const r=p[e];d=o(d,r),d&&d.vars&&t<p.length-1&&(d=d.vars)}if(!i(c)&&c===d)continue;let f=h;if(s.isDirective){let[t,e,r,,n]=s.value,o=Ke.get(h);if(!o){const e=Qe.get(h);o=e[s.attrName]||e[Symbol.keyFor(t)]}let[i,a,l]=o,[,c]=d;const u=Xe.get(h);if(u){u.value=d;Ke.get(h)[3]=c}re(i,c,e,r,a,l,n,i.type==Mt.TEXT||i.type==Mt.SLOT)}else if(s.isToggleProp){if(!!d===c)continue;f.toggleAttribute(s.attrName,!!d),V(f,s.attrName,!!d)}else if(s.isProp){if(!i(d)&&d===c)continue;if(h instanceof Jt)if(i(d)&&Object.is(d,c)){let t=x(s.attrName),e=[t];if(n&&n.length>0){let r="",o=Q(Ht.get(s.value),Ot);n.forEach((t=>{t.startsWith(o)&&t.length>r.length&&(r=t)})),e=u(q(r.replace(o,t),Ot))}Ut(h,c,e)}else h._updateProps({[s.attrName]:d});else h instanceof HTMLSlotElement&&e._updateSlot(h.getAttribute("name")||"default",s.attrName,d)}else if(s.attrName){if(!Y(c,d))switch(s.attrName){case"value":if(h instanceof HTMLInputElement){h.value=d;break}default:h.setAttribute(s.attrName,J(s.attrTmpl,Ze,d+""))}}else if(s.isText){s.textNode.textContent=Z(d??"")}s.value=d}}function nr(t,e,r,n){const s=ze.get(t),[o,i,a,l,c]=Ke.get(t),u=Xe.get(t);if(!r){let t=s(o,u.value[1],l,{renderComponent:i,slotComponent:a,varChain:c});if(!t)return;r=t[1]}if(r&&r.vars[0]instanceof lr){let t=[],e=[];g(r.vars,(r=>{e.push(...r.vars),t.push(...G(r.vars,(t=>"1")))})),t.push("1"),r=new lr(t,e)}n&&Ge.set(t,n),rr(r,e,n=n??Ge.get(t))}const sr={insertBefore:function(t,e){if(!t.parentNode)return;let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let r=t.nextSibling;for(;r&&r!==e;)r?.parentNode?.removeChild(r),r=t.nextSibling}};function or(t,...e){return new lr(r(t)?[t]:t,e)}const ir=/([a-z0-9"'])\s*>\s*</gim;function ar(t){return{current:t}}class lr{strings;vars;constructor(t,e){this.strings=u(t),this.vars=e}getKey(){let t=this.vars,e="";return g(this.strings,((r,n)=>{if(at.test(r))return e=Z(t[n]),!1})),e}getKeys(){let t=this.vars,e=[];for(let r=0;r<this.strings.length;r++){const n=this.strings[r];if(at.test(n)){let n=Z(t[r]);e.push(n)}}return l(e)&&t.forEach((t=>{if(t instanceof lr){let r=t.getKey();e.push(r)}})),e}append(t){let e=b(this.strings);return t.strings.forEach(((t,r)=>{0!=r?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=u(this.vars,t.vars),this}insert(t,e){let r=e.strings.shift();return this.strings[t]+=r,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,r]=qe(t,this),n=tr([],e,r,t);return nt(n,((t,e)=>t+(e.outerHTML??"")),"")}flatVars(t){let e=u(this.vars),r=this.strings.length-1,n=0;for(let s=0;s<=r;s++){let r=o(e,n,"");if(r instanceof lr&&r.vars.length>0){let[s,o]=qe(t,r);r=s,e.splice(n,1,...o),n+=o.length-1}n++}return e}}function cr(t,e,r){r.get||ht(`Computed '${e}' must be a getter`),c(t.constructor,ct.COMPUTED)||(t.constructor[ct.COMPUTED]=l(t.constructor[ct.COMPUTED])?{}:f(t.constructor[ct.COMPUTED])),t.constructor[ct.COMPUTED][e]=r.get}const ur=Ct(class extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);V(t,r,I(s,this.wait,this.immediate));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&V(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[dt.METHOD]}wait;immediate;result;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function dr(t,e){return(r,n,s)=>{c(r.constructor,ct.EVENTS)||(r.constructor[ct.EVENTS]=l(r.constructor[ct.EVENTS])?[]:f(r.constructor[ct.EVENTS])),r.constructor[ct.EVENTS].push({name:t,options:e,fn:r[n]})}}const hr=Ct(class extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=D(o(t,r),t);V(t,r,M(s));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&V(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[dt.METHOD]}wait;result;constructor(){super()}});var pr;!function(t){t.ONCE="once",t.UPDATABLE="updatable"}(pr||(pr={}));class fr extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){}mounted(t,e,...r){}get targets(){return[dt.FIELD]}selector;cache;result;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){this.result=t.shadowRoot?.querySelector(this.selector)}beforeMount(t,e,r,n,...s){const o=this;Reflect.defineProperty(t,n,{get:()=>(o.result&&o.cache||o.getter(t),o.result)})}updated(t,e){this.cache===pr.UPDATABLE&&this.getter(t)}}const gr=Ct(fr),mr=Ct(class extends fr{getter(t){this.result=t.shadowRoot?.querySelectorAll(this.selector)}});function vr(t){if(1===arguments.length)return(e,r)=>{br(e,r,t)};br(arguments[0],arguments[1],{prop:""})}function br(t,e,r){if(!c(t.constructor,ct.STATES)){const e={};let r=t.constructor;for(;(r=gt(r))!==Jt;)p(e,r[ct.STATES]?f(r[ct.STATES]):{});Reflect.defineProperty(t.constructor,ct.STATES,{configurable:!1,enumerable:!1,value:e})}r.shallow=r.shallow||!1,t.constructor[ct.STATES][e]=r}function Er(t,e,r){br(t.prototype,e,r||{prop:""})}function yr(t){return e=>{if(e){if(e.prototype.hasOwnProperty("attributeChangedCallback")){let t=e.prototype.attributeChangedCallback;e.prototype.attributeChangedCallback=function(e,r,n){Jt.prototype.attributeChangedCallback.call(this,e,r,n),t.call(this,e,r,n)}}if(e.prototype.hasOwnProperty("connectedCallback")){let t=e.prototype.connectedCallback;e.prototype.connectedCallback=function(){Jt.prototype.connectedCallback.call(this),t.call(this)}}if(e.prototype.hasOwnProperty("disconnectedCallback")){let t=e.prototype.disconnectedCallback;e.prototype.disconnectedCallback=function(){Jt.prototype.disconnectedCallback.call(this),t.call(this)}}customElements.define(t,e)}}}const Sr=Ct(class extends bt{static get priority(){return Number.MAX_VALUE}created(t,e,r,...n){let s=o(t,r);V(t,r,X(s,this.wait));let i=Reflect.getPrototypeOf(t);i&&!o(i,r+"_$__")&&V(i,r+"_$__",s)}beforeMount(t,e,...r){}mounted(t,e,...r){}updated(t,e){}get targets(){return[dt.METHOD]}wait;result;constructor(t){super(),this.wait=t}});function Nr(t,e){return(r,n)=>{c(r.constructor,ct.WATCH)||(r.constructor[ct.WATCH]=l(r.constructor[ct.WATCH])?{}:f(r.constructor[ct.WATCH]));(S(t)?t:[t]).forEach((t=>{let s=t.replaceAll(".",Ot),o=r.constructor[ct.WATCH][s];S(o)||(o=r.constructor[ct.WATCH][s]=[]),o.push({source:t,options:e,handler:r[n]})}))}}const _r=["key"],Cr=se((function(t){return(t,[e],r)=>{let n=t.startNode;if(r)g(e,((t,e)=>{n.setAttribute(e,t)}));else if(n instanceof Jt){let t={},r={},s=o(n.constructor,ct.PROPS);g(e,((e,n)=>{if(_r.includes(n))return;let o=x(n);s[o]?t[n]=e:r[n]=e+""})),n._initProps(t,r)}else g(e,((t,e)=>{n.setAttribute(e,t)}))}}),Mt.TAG),Tr=new Map,Ar=se((function(t){return(t,[e],n,{renderComponent:s})=>{let o=[];if(S(e)?o=j(e):i(e)?o=C(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!n)return;let a=t.startNode;if(Tr.get(a)&&Tr.get(a).length===o.length&&st(Tr.get(a),o))return;let l=Tr.get(a);g(l,(t=>{a.classList.remove(t)})),g(o,(t=>{a.classList.add(t)})),l=u(o),Tr.set(a,l)}}),Mt.CLASS),wr=new Map,Pr=new Map,kr=se((function(t,e){return(t,r,n,{varChain:s})=>{let o=t.startNode,i=function(t,e,r){let n=G(t,((t,r)=>e(t,r)));if(n.length<1){let t=new lr([],[]);return Pr.set(r,t),t}let s=[],o=[];const i=[],a=[];for(let t=0;t<n.length;t++){const e=n[t];let r=b(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(at.test(e)){let e=l[t]+"";if(s.includes(e))return void ht(`forEach - duplicate key '${e}'`);s.push(e),c=!1}0==t&&r?o[o.length-1]=r+e:o.push(e)}if(c)return void ht("forEach - missing 'key' prop");let d=b(i);d&&u.length>0&&(i[i.length-1]=R(d)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new lr(i,a);return Pr.set(r,l),l}(r[0],e,o);if(n&&n[0]){const e=wr.get(o);if(l(t.getNodes())&&(!r||l(r[0])))return[Dt.NONE,i];if(e&&st(e,r[0])&&e.length===r[0].length)return[Dt.NONE,i]}return wr.set(o,rt(r[0])),n?[Dt.UPDATE,i]:[Dt.APPEND,i]}}),(Mt.TEXT,Mt.SLOT));const Mr=new WeakMap,Dr=se((function(t,e,r){return(n,[s,o],i,{renderComponent:a})=>{let l=n.endNode;if(i){if(!!s==!!i[0]){let t=Mr.get(l);return[Dt.NONE,t.call(a,s)]}let t=s?e:r;return Mr.set(l,t),[Dt.REPLACE,t.call(a,s)]}{let n=s?e:r;return Mr.set(l,n),[Dt.APPEND,n.call(a,t)]}}}),(Mt.TEXT,Mt.SLOT)),xr=se((function(t,e){return(t,[e,r],n)=>n?e===n[0]?[Dt.NONE,e?r():or``]:e?[Dt.REPLACE,e?r():or``]:[Dt.REMOVE]:[Dt.APPEND,e?r():or``]}),(Mt.TEXT,Mt.SLOT));var Or;!function(t){t.CHANGE="change",t.INPUT="input"}(Or||(Or={}));const Rr=new WeakMap,Lr=se((function(t,e="value"){return(r,n,s,{varChain:a,renderComponent:l})=>{const c=r.startNode;if(s){if(Y(n,s))return;if(!Y(n,s)){let t=n[0];if(c instanceof Jt)c._updateProps({[e]:t});else if(c instanceof HTMLTextAreaElement||c instanceof HTMLSelectElement){if(c.setAttribute(e,t+""),c instanceof HTMLSelectElement){let e=K(c.querySelectorAll("option"),(e=>e.value==t));e&&(e.selected=!0)}}else if(c instanceof HTMLInputElement){if(c.value==t)return;switch(c.type){case"checkbox":case"radio":t?c.setAttribute("checked",""):c.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":c.setAttribute(e,t+""),V(c,e,t);break;default:c.setAttribute(e,t+"")}}}return}if("binded"===o(c,"_model"))return;let u=b(a);if(Rr.set(c,u),i(t)||R(t)||(t=""),c instanceof Jt)c._initProps({[e]:t}),c.addEventListener("update:"+e,(t=>{let e=l;l._wrapperProp.has(u[0])&&(e=l.wrapperComponent||e),V(e,u,t.detail.value)})),V(c,"_model","binded");else if(c instanceof HTMLTextAreaElement)c.setAttribute(e,t+""),c.addEventListener("input",(t=>{let e=t.target;V(l,u,e.value)})),V(c,"_model","binded");else if(c instanceof HTMLInputElement){let r="",n="";switch(c.type){case"checkbox":case"radio":r="checked",n="change";break;default:r="value",n="input"}c.setAttribute(e??r,t+""),c.addEventListener(n,(t=>{let e=t.target;V(l,u,e.value)})),V(c,"_model","binded")}else c instanceof HTMLSelectElement&&(c.setAttribute(e,t+""),c.addEventListener("change",(t=>{let e=t.target;V(l,u,e.value)})),V(c,"_model","binded"))}}),Mt.TAG),Hr=new Map,Wr=se((function(t,e){return(t,[r],n)=>{if(n&&r===n[0])return;let s=t.startNode;if(!Hr.has(s)){let t=s.style.display;Hr.set(s,"none"==t?"unset":t)}s.style.display=r?Hr.get(s):"none",e&&e(s,r)}}),Mt.TAG),Ir=se((function(t,e){return(r,n,s,{renderComponent:o,slotComponent:i})=>{s||(t=t.bind(o),i._bindSlotHook(e||"default",t))}}),Mt.SLOT);class Vr{static getCssText(t,e=!1){return r(t)?t:Q(G(t,((t,r)=>r.startsWith("--")?r+":"+t+(e?" !important":""):m(r)+":"+t+(e?" !important":""))),";")}static setStyle(t,e){if(r(t)&&!R(t))return{};let n=Vr.getCssText(t),s={};return g(n.split(";"),(t=>{let r=t.split(":"),n=R(r[0]),o=R(r[1]);s[n]=e.style.getPropertyValue(n),e.style.setProperty(n,o)})),s}}const $r=new Map;let Br=0;const Ur=se((function(t){return(t,e,r,{renderComponent:n})=>{let s=t.startNode,o=$r.get(s);o||(o="style_d"+Br++,$r.set(s,o)),n.nextTick((()=>{Vr.setStyle(e[0],s)}),o)}}),Mt.STYLE),jr=se((function(t){return(e,r,n,{renderComponent:s,varChain:o})=>{const i=e.startNode;if(n){if(!Y(r,n)){let t=e.attrName;i._updateProps({[t]:r[0]})}return}let a=b(o),l=e.attrName;i._initProps({[l]:t}),i.addEventListener("update:"+l,(t=>{V(s,a,t.detail.value)}))}}),Mt.PROP),Fr=se((function(t,e){return(t,[e,r],n)=>{let s=()=>or``,o=[],i=[];g(r,((t,e)=>{if(N(t))o.push(e),i.push(t);else{let e=t[0],r=t[1];o.push(e),i.push(r)}"default"===e&&(s=t)}));let a=ot(o,(t=>N(t)?t(e):t==e));return n?[Dt.REPLACE,it(i[a]??s)]:[Dt.APPEND,it(i[a]??s)]}}),(Mt.TEXT,Mt.SLOT));export{Jt as CompElem,Vr as CssHelper,bt as Decorator,dt as DecoratorType,Nt as DecoratorWrapper,Dt as DirectiveUpdateTag,Zt as EnterPoint,Mt as EnterPointType,Et as GetKeyFnName,Or as ModelTriggerType,Ot as PATH_SEPARATOR,Yt as PROP_OBJECT_KEY_MAP_SYMBOL,pr as QueryCache,lr as Template,xt as UpdatePoint,St as _DecoratorMap,yt as _DecoratorsKey,kt as _getObservedAttrs,Cr as bind,qe as buildHTML,Ar as classes,cr as computed,ar as createRef,ur as debounced,Ct as decorator,se as directive,dr as event,kr as forEach,or as html,Dr as ifElse,xr as ifTrue,Er as makeState,Lr as model,hr as onced,At as prop,gr as query,mr as queryAll,Wr as show,Ir as slot,vr as state,Ur as styles,jr as sync,yr as tag,Sr as throttled,re as updateDirective,Nr as watch,Fr as when};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compelem",
3
- "version": "0.7.4-b1",
3
+ "version": "0.7.6-b1",
4
4
  "description": "A modern, reactive, fast, lightweight and flexible lib for building web components",
5
5
  "main": "index.js",
6
6
  "module": "index.js",