compelem 0.20.2 → 0.21.1

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/constants.d.ts CHANGED
@@ -17,6 +17,7 @@ export declare enum Mode {
17
17
  }
18
18
  export declare const DefinitionCompEventMap: Map<Function, Record<string, any>[]>;
19
19
  export declare const DefinitionTagMap: Record<string, string>;
20
+ export declare const DefinitionComponentMap: Record<string, Function>;
20
21
  export declare const DefinitionComputedMap: WeakMap<Function, Record<string, Getter>>;
21
22
  export declare const DefinitionStateMap: WeakMap<Function, Record<string, StateOption>>;
22
23
  export declare const DefinitionPropMap: WeakMap<Function, Record<string, PropOption>>;
@@ -30,6 +31,7 @@ export declare const WatchDeepUpdateMap: WeakMap<Function, Record<string, Set<Fu
30
31
  export declare const WatchImmediateListMap: WeakMap<Function, Record<string, Set<Function>>>;
31
32
  export declare const PropSyncKeySetMap: WeakMap<Function, Set<string>>;
32
33
  export declare const StateShallowKeySetMap: WeakMap<Function, Set<string>>;
34
+ export declare const PropShallowKeySetMap: WeakMap<Function, Set<string>>;
33
35
  export declare const HasChangedPropOrStateMap: WeakMap<Function, Map<string, Function>>;
34
36
  export declare const ComputedUpdateDepsMap: WeakMap<Function, Map<string, Set<Function>>>;
35
37
  export declare const CssUpdateDepsMap: WeakMap<Function, Set<string>>;
package/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export * from "./directives/Styles";
27
27
  export * from "./directives/Sync";
28
28
  export * from "./directives/When";
29
29
  export { buildHTML, createRef, html, Template };
30
+ export declare function regComponents(): void;
30
31
  export * from './CompElem';
31
32
  export * from './types';
32
33
  export * from './utils';
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * compelem v0.20.2.1774012731
2
+ * compelem v0.21.1.1775987163
3
3
  * A modern, reactive, fast, lightweight and flexible lib for building web components
4
4
  * @holyhigh2
5
5
  * git+https://github.com/holyhigh2/compelem.git
6
6
  */
7
- import t,{toPath as e,some as s,isString as r,isUndefined as n,isBlank as o,closest as i,isObject as a,isFunction as l,startsWith as c,get as u,concat as h,toArray as d,isSymbol as p,isArray as f,size as g,eachRight as _,slice as m,defaults as v,isLowerCaseChar as y,merge as E,each as w,kebabCase as b,has as S,set as N,includes as T,find as C,debounce as k,throttle as M,once as P,remove as A,map as x,flatMap as R,test as D,assign as O,first as L,walkTree as I,isEmpty as V,filter as W,isNil as H,camelCase as U,isNull as B,isDefined as $,trim as j,isBoolean as F,parseJSON as z,cloneDeep as G,keys as X,groupBy as K,last as q,reject as Q,toString as Z,reduce as Y,compact as J,initial as tt,except as et,join as st,split as rt,isEqual as nt,replace as ot,replaceAll as it,snakeCase as at,bind as lt,isMatch as ct,clone as ut,findIndex as ht,call as dt}from"myfx";const pt="default",ft=/\s+\.?key\s*=/;var gt,_t;!function(t){t[t.RENDER=1]="RENDER",t[t.COMPUTED=2]="COMPUTED",t[t.DIRECTIVE=3]="DIRECTIVE"}(gt||(gt={})),function(t){t.Prod="prod",t.Dev="dev"}(_t||(_t={}));const mt=new Map,vt={},yt=new WeakMap,Et=new WeakMap,wt=new WeakMap,bt=new Map,St=new Map,Nt=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,kt=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,At=new WeakMap,xt=new WeakMap,Rt=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,Lt=new WeakMap,It="__data_";function Vt(t){console.error("[CompElem]",t)}function Wt(t,e){console.error(`[CompElem <${t}>]`,e)}function Ht(...t){console.warn("[CompElem]",...t)}function Ut(t,e){console.warn(`[CompElem <${t}>]`,e)}function Bt(t){return e(t).join("-")}function $t(t){return Object.getPrototypeOf(t)}function jt(t){return t===Boolean||s(t,(t=>t===Boolean))}function Ft(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||o(e))&&(e=!0),e}const zt={getNodes(t,e){let s=t.nextSibling;if(!e)return[s];let r=[];for(;s&&s!==e;)r.push(s),s=s?.nextSibling;return r},insertBefore:function(t,e){if(!t.parentNode)return;let s=document.createDocumentFragment();s.append(...e),t.parentNode.insertBefore(s,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let s=t.nextSibling;for(;s&&s!==e;)s?.parentNode?.removeChild(s),s=t.nextSibling},clear(t,e){if(!t)return;let s,r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT);for(r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);s=r.nextNode();)t!==s&&(s instanceof Comment||s instanceof Ie&&s.destroy())}};function Gt(t,e){let s=i(t,(t=>t.host&&t.host instanceof Ie),"parentNode");if(!s||s.host!==e)return s?s.host:void 0}function Xt(t,e,s){let r=s,n=t?t.call(r):Reflect.get(r[It],e);if(Yt.__collecting&&Yt.__varPathList.push(e),ee.has(n)){let t=re.get(n);return t||(t=new Set,re.set(n,t)),t.add(r.__thisRef),ee.get(n)}if(a(n)&&!l(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=xt.get(r.constructor),s=t?.has(e);n=s||"slots"===e?n:ne(n,r,e)}return n}function Kt(t,e,s){let r=s;if(!r.__inited)return void Reflect.set(r[It],t,e);let n=r[It][t],o=Rt.get(r.constructor),i=o?.get(t);if(i){if(!i.call(r,e,n,[t],e,n))return!0}else if(Object.is(n,e))return!0;qt(r,e,n,t),Qt(r,t),Zt(r,t),Reflect.set(r[It],t,e),r._notify(n,[t]);let a=At.get(r.constructor);a?.has(t)&&r.emit("update:"+t,{value:e})}function qt(t,e,s,r,n,o){let i=$t(t.constructor),a=Ct.get(t.constructor)??Ct.get(i),l=Tt.get(t.constructor)??Tt.get(i),p=Mt.get(t.constructor)??Mt.get(i),f=kt.get(t.constructor)??kt.get(i),g=Nt.get(t.constructor)??Nt.get(i);a?.forEach((i=>{(r===i||c(i,r+".")&&!Object.is(u(t._getPrivateData(),i),u(e,i))||c(r,i+".")&&l?.includes(i)&&!Object.is(u(t._getPrivateData(),i),u(e,i)))&&h(d(f[i]),d(p[i])).forEach((a=>{a&&!0!==g.get(i)&&(t._watchUpdateArgsInNextTick.set(a,{newValue:e,oldValue:s,chain:r.split("."),rootObjNew:n,rootObjOld:o,fullMatch:i===r}),t._watchUpdateSetInNextTick.add(a),g.has(i)&&g.set(i,!0))}))}))}function Qt(t,e){let s=Dt.get(t.constructor);s?.has(e)&&s.get(e)?.forEach((e=>{t._computedUpdateSetInNextTick.add(e)}))}function Zt(t,e){let s=Ot.get(t.constructor);if(!s)return;let r=e.split("."),n="";r.forEach((e=>{n=n?n+"."+e:e,s.has(n)&&(t._cssUpdateInNextTick=!0)}))}const Yt={popDirectiveQ(){return this.__varPathList.reduceRight(((t,e)=>(t.includes(e)||t.unshift(e),t)),[])},start(){this.__collecting=!0,this.__varPathList=[]},end(t,e){t&&e&&t._regSubViewDeps(Yt.popVarPathList(),e),this.__collecting=!1},popVarPathList(){let t=Array.from(new Set(this.__varPathList));return this.__varPathList=[],t},__varPathList:[],__collecting:!1},Jt=new WeakMap,te=new WeakMap,ee=new WeakMap,se=new WeakMap,re=new WeakMap;function ne(t,e,s){if(ee.has(t))return ee.get(t);if(se.has(t)){if(s){let r=Jt.get(e);r||(r=new WeakMap,Jt.set(e,r)),r.set(t,s);let n=re.get(t);n||(n=new Set,re.set(t,n)),n.values().some((t=>t.deref()===e))||n.add(new WeakRef(e))}return t}const r=new Proxy(t,{get(t,s,r){if(!s)return;const n=Reflect.get(t,s,r);if(p(s))return n;if(l(n))return n;if("length"===s&&f(t))return n;if(Yt.__collecting){let t=te.has(r)?h(te.get(r)):[];t.push(s);let e=t.join(".");Yt.__varPathList.push(e)}if(ee.has(n))return ee.get(n);let o=n;if(a(n)&&!l(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){o=ne(n,e);let t=te.has(r)?h(te.get(r)):[];t.push(s),te.set(o,t),ee.set(n,o)}return o},set(t,s,r,n){if(!s)return!1;let o=t[s],i=te.get(n)??[],a=h(i,[s]),l=Rt.get(e.constructor),c=l?.get(a[0]),u=a.length>1,d=r,p=o;if(u&&(p=d=e._getPrivateData()[a[0]]),c){if(!c.call(e,d,p,a,r,o))return!0}else if(Object.is(o,r))return!0;let f=r,g=Reflect.set(t,s,f),_=re.get(n),m=a.join(".");return qt(e,f,o,m,d,p),Qt(e,m),Zt(e,m),oe(e,p,a),_?.forEach((t=>{let e=t.deref();if(!e)return;let s=e._wrapperProp[a[0]],r=a.join(".");r=r.replace(a[0],s),qt(e,f,o,r),Qt(e,r),Zt(e,r),oe(e,p,r.split("."))})),g}});if(te.has(r)||te.set(r,s?[s]:[]),ee.set(t,r),s&&(se.set(r,e),!Jt.has(e))){let t=new WeakMap;t.set(r,s),Jt.set(e,t)}return r}function oe(t,e,s,r,n){let o=g(s);_(s,(r=>{let n=m(s,0,o--);t._notify(e,n)}))}const ie=new Map;class ae{static nextSet=new Set;static nextPending=!1;static next;static flush(){ae.nextPending=!1;let t=Array.from(ae.nextSet);ae.nextSet.clear(),ie.clear(),t.forEach((t=>t())),t=null}static pushNext(t){ae.nextSet.add(t),ae.nextPending||(ae.nextPending=!0,ae.next())}}function le(t){if(1===arguments.length)return(e,s,r)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,ce(e,s,t,r)};let e=arguments[0],s=arguments[1],r=arguments[2];t={type:void 0,required:!1,attribute:!0},r&&"function"==typeof r.type&&(t=v(r,t),r=void 0),ce(e,s,t,r)}function ce(t,e,s,r){let n;if(y(e[0])||Vt(`Prop '${e}' must be in CamelCase`),!wt.has(t.constructor)){const e={};let s=t.constructor;for(;(s=$t(s))!==Ie;)E(e,wt.get(s)??{});n=new Set,w(e,((t,e)=>{if(t.attribute){let t=b(e);n?.add(t)}})),St.set(t.constructor,n),wt.set(t.constructor,e)}if(r&&(r.get&&(s.getter=r.get),r.set&&(s.setter=r.set)),s.attribute){n||(n=St.get(t.constructor));let s=b(e);n?.add(s)}if(S(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),n&&(t.constructor.observedAttributes=d(n)),N(wt.get(t.constructor),e,s),s.hasChanged){let r=Rt.get(t.constructor);r||(r=new Map,Rt.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.sync){let s=At.get(t.constructor);s||(s=new Set,At.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t,e,{get(){return Xt(r?.get,e,this)},set(t){r?.set?r.set(t):Kt(e,t,this)}})}(()=>{const t=Promise.resolve(),e=ae.flush;ae.next=()=>{t.then(e)}})();const ue=new Set;function he(t){return St.get(t)??ue}const de=["resize","outside","mutate"],pe=new WeakMap,fe=[],ge=[],_e=[],me=new WeakSet,ve=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,s=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;if(!me.has(e.target)){me.add(e.target);continue}let r=pe.get(e.target);r&&r({target:e.target,contentBoxSize:t,borderBoxSize:s,type:"resize"})}}));var ye;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(ye||(ye={}));const Ee=new WeakMap,we=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const s=t[e];let r=Ee.get(s.target);if(!r)return;let n={target:s.target},o=null;switch(s.type){case"subtree":n.type=ye.Tree,o=r[ye.Tree];break;case"childList":n.type=ye.Child,n.addedNodes=s.addedNodes,n.removedNodes=s.removedNodes,o=r[ye.Child];break;case"attributes":n.type=ye.Attr,n.attributeName=s.attributeName,n.oldValue=s.oldValue,o=r[ye.Attr];break;case"characterData":n.type=ye.Char,n.oldValue=s.oldValue,o=r[ye.Char]}o&&(n.type="mutate",o(n))}}));function be(e,s,r,n,o){if("resize"===e)return function(t,e){if(pe.has(t))return;pe.set(t,e),ve.observe(t);let s=ve;return(e=!1)=>{s.unobserve(t),pe.delete(t),e&&(s=t=null)}}(s,r);if("outside"===e)switch(n[0]){case"mousedown":return function(e,s){return fe.push([e,s]),(r=!1)=>{t.remove(fe,(t=>t[0]===e&&t[1]===s))}}(s,r);case"dblclick":return function(e,s){return _e.push([e,s]),(r=!1)=>{t.remove(_e,(t=>t[0]===e&&t[1]===s))}}(s,r);default:return function(e,s){return ge.push([e,s]),(r=!1)=>{t.remove(ge,(t=>t[0]===e&&t[1]===s))}}(s,r)}else if("mutate"===e)return function(t,e,s){let r=T(s,"child"),n=T(s,"attr"),o=T(s,"char"),i=T(s,"tree"),a=Ee.get(t);if(!a)return a={},Ee.set(t,a),r&&(a[ye.Child]=e),n&&(a[ye.Attr]=e),o&&(a[ye.Char]=e),i&&(a[ye.Tree]=e),we.observe(t,{childList:r,attributes:n,characterData:o,subtree:i}),(e=!1)=>{Ee.delete(t),e&&(t=null)}}(s,r,n)}document.addEventListener("mousedown",(t=>{let e=u(t.composedPath(),0,t.target);fe.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"mousedown",event:t})}))}),!1),document.addEventListener("click",(t=>{let e=u(t.composedPath(),0,t.target);ge.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"click",event:t})}))}),!1),document.addEventListener("dblclick",(t=>{let e=u(t.composedPath(),0,t.target);_e.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"dblclick",event:t})}))}),!1);const Se=/,|^(debounce:.+)|(debounce$)/,Ne=/,|^(throttle:.+)|(throttle$)/,Te="native",Ce={esc:"escape"},ke=()=>{};function Me(t,e,s,r){let n,o=t.split("."),i=o.shift(),a=o.includes("once"),l=e??ke;if(n=C(o,(t=>Se.test(t)))){let t=n.split(":");l=k(l,parseInt(t[1])||100)}if(n=C(o,(t=>Ne.test(t)))){let t=n.split(":");l=M(l,parseInt(t[1])||100)}if(a&&(l=P(l)),s instanceof Ie&&(s!==r||o.includes(Te)||o.push(Te),!o.includes(Te)))return s._addEvent(i,e);if(function(t){return de.includes(t)}(i))return be(i,s,l,o);let c=t=>{if(o.includes("prevent")&&t.preventDefault(),o.includes("stop")&&t.stopPropagation(),!o.includes("self")||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes("left")&&0!=t.button)return;if(o.includes("right")&&2!=t.button)return;if(o.includes("middle")&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(A(o,(t=>"ctrl"==t))[0]&&!t.ctrlKey)return;if(A(o,(t=>"alt"==t))[0]&&!t.altKey)return;if(A(o,(t=>"shift"==t))[0]&&!t.shiftKey)return;if(A(o,(t=>"meta"==t))[0]&&!t.metaKey)return;let e=x(o,(t=>Ce[t]||t));if(g(e)>0&&!e.includes(t.key.toLowerCase()))return}l(t)}},u={capture:o.includes("capture")||!1,passive:o.includes("passive")||!1};return s.addEventListener(i,c,u),(t=!1)=>{s.removeEventListener(i,c,u),t&&(s=null)}}const Pe={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},Ae=new WeakMap;let xe=[],Re=0;const De=new WeakMap,Oe={},Le="slots";class Ie extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){xe=R(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,w(t,((t,e)=>{D(e[0],/[A-Z]/)}))}#t;#e={};__data_={};#s={};#r;__updateTree;_eventBindList;_listerners={};__docoEventMap;__updateSubViewDeps;_cssUpdateInNextTick=!1;_cssVarOldValueMap;__cssSheets;_watchUpdateSetInNextTick;_watchUpdateArgsInNextTick;_computedUpdateSetInNextTick;get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get attrs(){return this.#n}get props(){return this.#o}get renderRoot(){return this.#i?.deref()}get renderRoots(){return this.#a.flatMap((t=>t.deref()??[]))}get parentComponent(){return this.#l?.deref()}get wrapperComponent(){return this.__wrapperComponent?.deref()}get slots(){return Oe}get slotHooks(){return this.#c}get cssSheets(){return Ae.get(this.constructor)}get globalCssSheet(){return Ie.__l_globalRule.sheet}get isMounted(){return this.#u}#n;#o;#i;#a;#l;__wrapperComponent;#h={};#c={};#d={};#u=!1;#p=!1;#f;static get css(){return[]}static get globalCss(){}static get hostCss(){}get cssVars(){return{}}__inited=!1;#g=!1;#_;__thisRef;constructor(...t){super(),this.#t=Re++,this.__updateTree=[],this.__thisRef=new WeakRef(this),this.#_=this.#m.bind(this),1===g(t)&&(this.#o={},O(this.#o,L(t))),Reflect.getOwnPropertyDescriptor(this.constructor.prototype,"slots")||Reflect.defineProperty(this.constructor.prototype,"slots",{get(){return Xt(void 0,"slots",this)},set(t){Kt("slots",t,this)}});let e=bt.get(this.constructor)??bt.get($t(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#v=this.#y.bind(this)}insertStyleSheet(t){if(!this.#r)return null;let e;if(r(t)){e=new CSSStyleSheet;try{e.replaceSync(t)}catch(t){}}else{if(this.#r.adoptedStyleSheets.includes(t))return t;e=t}this.#r.adoptedStyleSheets=[...this.#r.adoptedStyleSheets,e];return(Ae.get(this.constructor)??[]).push(e),e}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#v;connectedCallback(){let t=i(this.parentNode,(t=>t instanceof Ie||t.host instanceof Ie),"parentNode");this.#l=t?t instanceof Ie?new WeakRef(t):new WeakRef(t.host):void 0,Ie.__l_globalRule.parentNode||document.head.appendChild(Ie.__l_globalRule);let e=u(this.constructor,"hostCss"),s=u(this.constructor,"hostCssSheet");if(e){s||(r(e)?(s=new CSSStyleSheet,s.replaceSync(e)):s=e,N(this.constructor,"hostCssSheet",s));let t=this.__wrapperComponent?.deref()?.shadowRoot??this.#l?.deref()?.shadowRoot??this.ownerDocument;this.__wrapperComponent&&!this.__wrapperComponent.deref()?.shadowRoot?.contains(this)&&(t=i(this,(t=>t instanceof HTMLDocument||t instanceof ShadowRoot),"parentNode")),t&&s&&!t.adoptedStyleSheets.includes(s)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,s])}this.__init(),this.__bindEvents()}disconnectedCallback(){this.__unbindEvents()}__bindEvents(){let t=this._eventBindList;w(t,(t=>{let[e,s,r,n]=t;if(n)return;if(!r)return;let o=Me(e,s?s.bind(this):s,r,this);t[3]=o}));let e=mt.get(this.constructor);g(e)>0&&(this.__docoEventMap||(this.__docoEventMap=new Map),w(e,(({name:t,targetFn:e,fnName:s})=>{if(this.__docoEventMap.has(t+"@"+s))return;let r=e?e(this):this,n=u(this,s),o=Me(t,n?n.bind(this):n,r,this);this.__docoEventMap.set(t+"@"+s,o)})))}__unbindEvents(){w(this._eventBindList,(t=>{let[,,,e]=t;e&&e(),t[3]=null}));let t=[];w(this.__docoEventMap,((e,s)=>{e&&e(),t.push(s)})),t.forEach((t=>this.__docoEventMap.delete(t)))}beforeDestroyed(){}destroyed(){}get isDestroyed(){return this.#E}#E=!1;destroy(){if(this.#E)return;this.#E=!0;let t=bt.get(this.constructor)??bt.get($t(this.constructor));if(t&&t.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.destroy(this)})),this.beforeDestroyed(),this.__unbindEvents(),this._listerners=null,this.__docoEventMap?.clear(),this.__docoEventMap=this._eventBindList=null,Lt.get(this)?.clear(),Lt.delete(this),this._watchUpdateArgsInNextTick?.clear(),this._watchUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick=null,this.__cssSheets=null,this.__updateSubViewDeps?.clear(),this.#l){let t=this.#l.deref();t&&I(t.__updateTree,(e=>{e.__destroyed||e.node?.deref()===this&&(e.destroy(t),A(e.parent?e.parent.children:t.__updateTree,(t=>t===e)))}))}w(this.__updateTree,(t=>t?.destroy(this))),w(this.#h,(t=>{De.delete(t),t.remove()})),w(this.#d,(t=>{w(t,(t=>t.remove()))})),w(this.__data_.slots,((t,e)=>{w(t,(t=>t.remove()))})),this.#w.clear(),this.#d=this.#h=this.#w=this.#e=this.__data_.slots=null,this.remove(),this._wrapperProp=this.#b=this.#i=this.#a=this.#r=this.#s=this.#n=this.#o=this.#i=this.#a=this.#c=this.#v=this.__data_=this.__updateTree=this.#l=this._asyncDirectives=this.__wrapperComponent=null,this.destroyed()}__init(){if(this.__inited)return;if(this.#g)return;this.#g=!0;let t=u(this.constructor,"globalCss");V(t)||!r(t)||u(this.constructor,"_globalRuleInserted")||(Ie.__l_globalRule.textContent+=t,N(this.constructor,"_globalRuleInserted",!0));let e=Ae.get(this.constructor),s=e??[];e||(w(u(this.constructor,"css"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),s.push(e)}else l(t)||s.push(t)})),Ae.set(this.constructor,s));const n=this.#S();this.propsReady(n);for(const t in n){const e=n[t];this.__data_[t]=e}this.#N(),this.__data_.slots={},Reflect.defineProperty(this.__data_,"__isData",{enumerable:!1,value:!0});let i=$t(this.constructor);if(Ct.get(this.constructor)??Ct.get(i)){this._watchUpdateSetInNextTick=new Set,this._watchUpdateArgsInNextTick=new Map;let t=Nt.get(this.constructor)??Nt.get(i),e=Pt.get(this.constructor)??Pt.get(i);w(e,((e,s)=>{let r=u(this,s);e.forEach((t=>{t.call(this,r,void 0,s)})),t.has(s)&&t.set(s,!0)}))}let a=O({},yt.get(this.constructor),yt.get(i));if(a){this._computedUpdateSetInNextTick=new Set;let t=Dt.get(this.constructor);t?w(a,((t,e)=>{this[It][e]=t.call(this)})):(t=new Map,Dt.set(this.constructor,t),w(a,((e,s)=>{N(e,"key",s),Yt.start(),this[It][s]=e.call(this),Yt.end(),Yt.popVarPathList().forEach((s=>{let r=t.get(s);r||(r=new Set,t.set(s,r)),r.add(e)}))})))}Yt.start();let c=this.render();Yt.end();let h,d=Yt.popVarPathList();this.constructor.prototype._viewDeps||(this.constructor.prototype._viewDeps=d),null===c?(this.#a=[],this.#i=void 0):(this.#r=this.attachShadow({mode:"open"}),this.#r.adoptedStyleSheets=[...xe,...Ae.get(this.constructor)??[]],h=function(t,e){let s,r=[];if(os.has(e.constructor)){s=ds(r,os.get(e.constructor),ls(e,t),e)}else{let[n,o]=is(e,t);os.set(e.constructor,n),s=ds(r,n,o,e)}return e.__updateTree=r,s}(c,this),h&&(this.#a=W(h,(t=>t.nodeType===Node.ELEMENT_NODE)).map((t=>new WeakRef(t))),this.#i=this.#a[0])),this.__inited=!0,this.#T(),w(this.#c,((t,e)=>{this.#C(e)}));const p=this;let f=bt.get(this.constructor)??bt.get($t(this.constructor));f&&f.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.beforeMount(),setTimeout((()=>{if(!this.isDestroyed){if(this.#u=!0,this.#r){Yt.start();let t=this.cssVars;if(Yt.end(),!V(t)){this._cssVarOldValueMap={};let e=Ot.get(this.constructor);e||(e=new Set(Yt.popVarPathList()),Ot.set(this.constructor,e));let s="";w(t,((t,e)=>{let r="--"+b(e).replace(/^-+/,"");(o(t)||H(t))&&(t="initial"),this._cssVarOldValueMap[r]=t,s+=";"+r+":"+t})),this.style.cssText+=s}}h&&this.#r.append(...h),f&&f.forEach((t=>{t.mounted(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.#f&&this.#f.forEach((t=>ae.pushNext(t))),this.#p&&ae.pushNext(this.#v),this.__bindEvents(),this.mounted()}}),0)}propsReady(t){}render(){return null}beforeMount(){}mounted(){}#m(t){let e=t.currentTarget,s="";w(this.#h,((t,r)=>{if(t===e)return s=r,!1})),this.__inited&&this.#k(e,s===pt?"":s)}#k(t,e){this.#T();let s=u(this.#e[e],"props");s&&w(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof Ie?t._updateProps(s):w(s,((e,s)=>{if(t instanceof HTMLSlotElement){let r=De.get(t);if(r){let n=t.name||pt,o=r.#e[n];o||(o=r.#e[n]={props:{}}),o.props||(o.props={}),o.props[s]=e,r.#k(t,n)}}else t.setAttribute(s,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,s){if(!this.__inited)return;if(Object.is(s,e))return;"undefined"===s&&(s=null);let r=U(t);if(jt(wt.get(this.constructor)[r].type)){let t=!B(s)&&Ft(s);if(u(this,r)===t)return}this.#M(t,e,s)}shouldUpdate(t){return!0}updated(t){}_notify(t,e,s,r){let n=[];for(let o=0;o<e.length;o++){const i=e[o];n.push(i);let a=u(this,n),l=Bt(n);this.#s[l]={value:a,chain:l===Le?[Le]:n,oldValue:t,end:n.length===e.length,subNewValue:s,subOldValue:r}}this.isMounted?ae.pushNext(this.#v):this.#p=!0}#y(){if(g(this.#s)<1)return;if(!this.isMounted)return;const t=this.#s;if(this.#s={},!this.shouldUpdate(t))return;let e=bt.get(this.constructor)??bt.get($t(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)}));let s=!1,r=new Set,n=this.constructor.prototype._viewDeps;if(w(t,((t,e)=>{if(!s&&n?.includes(e)&&(s=!0),this.__updateSubViewDeps?.has(e)){let t=this.__updateSubViewDeps.get(e);t&&t.forEach((t=>{r.add(t)}))}})),this._watchUpdateSetInNextTick?.forEach((t=>{let{newValue:e,oldValue:s,chain:r,rootObjNew:n,rootObjOld:o,fullMatch:i}=this._watchUpdateArgsInNextTick.get(t),a=i?e:n,l=i?s:o;t.call(this,a,l,r,e,s)})),this._watchUpdateSetInNextTick?.clear(),this._watchUpdateArgsInNextTick?.clear(),this._computedUpdateSetInNextTick?.forEach((t=>{let e=u(t,"key"),s=this.__data_[e],r=t.call(this);(a(r)||r!==s)&&(this.__data_[e]=r,this._notify(s,[e]))})),this._computedUpdateSetInNextTick?.clear(),this._cssUpdateInNextTick){let t=this.cssVars;w(t,((t,e)=>{let s="--"+b(e).replace(/^-+/,"");this._cssVarOldValueMap[s]!=t&&((o(t)||H(t))&&(t="initial"),this._cssVarOldValueMap[s]=t,this.style.setProperty(s,t+""))}))}this.#i?.deref()&&(s&&fs(this.render(),this,this.__updateTree),g(r)>0&&r.forEach((t=>{gs(t,this,void 0)}))),this.#w.forEach((t=>{this.#C(t)})),this.updated(t)}#S(){let t=wt.get(this.constructor)??wt.get($t(this.constructor)),e=this.attributes,s=this.tagName,r=this.#o,o={};w(e,(({name:e,value:s})=>{if(e[0]===Ke||e[0]===qe||e[0]===Qe||e===Je||"slot"===e)return;let r=U(e);t&&!t[r]&&(o[e]=s)})),this.#n=this.#n?O(this.#n,o):o;let i={};if(!t)return i;let l=Object.keys(t),c=l.length;for(let o=0;o<c;o++){const c=l[o],h=b(c),d=this.hasAttribute(h);let p,g=t[c],_=S(r,c),m=u(this,c);if(!("_defaultValue"in g)&&(g._defaultValue=m,!g.type)){n(m)&&Wt(s,"Prop '"+c+"' has neither propType nor defaultValue be used for type inference");let t=typeof m;f(m)&&(t="array");let e=Pe[t];g.type=e}if(_)p=H(r[c])?m:r[c];else{p=m;let t=e.getNamedItem(h)||e.getNamedItem(qe+h);t&&(_=!0,p=t.value)}if(g.required&&!_){Wt(s,"Prop '"+c+"' is required");break}p=this.#P(t,c,p,d),g.attribute&&$(p)&&!a(p)&&this.#A(g,c,p),this.__data_[c]=p,i[c]=p,delete this[c]}return i}#A(t,e,s){let r=b(e),n=j(s);jt(t.type)?(n=Ft(s),F(n)?n&&!this.hasAttribute(r)?this.toggleAttribute(r,!0):!n&&this.hasAttribute(r)&&this.toggleAttribute(r,!1):this.getAttribute(r)!==n&&this.setAttribute(r,n)):this.getAttribute(r)!==n&&this.setAttribute(r,n)}#x(t,e){let s=t;try{for(let r=0;r<e.length;r++){const n=e[r];s=n===Boolean?Ft(t):n===Number?Number(t):n===String?String(t):n===Object||n===Array?z(t):n===Date?new Date(t):new n(t)}}catch(e){Wt(this.tagName,"Convert attribute error with "+t)}return s}#P(t,e,n,o){let i=t[e];if(!i)return n;let a=i.isValid,l=i.type,c=f(l)?l:[l],u=i.converter,h=n;if(!s(c,(t=>t===String))&&r(h)&&!B(h))try{h=u?u(h):this.#x(h,c)}catch(t){Wt(this.tagName,`Convert attribute '${e}' error with `+h)}for(let t=0;t<c.length;t++){"Boolean"===c[t].name&&o&&(h=Ft(h))}if(H(h))return h;let d=typeof h,p=!$(h);for(let t=0;t<c.length;t++){const e=c[t];if(D(d,e.name,"i")||h instanceof e||Object.prototype.toString.call(h)===Object.prototype.toString.call(e.prototype)){p=!0;break}}return p||Wt(this.tagName,`Invalid prop '${e}'. expected '${c.map((t=>t.name||t))}' but got '${d}'`),a&&(a.call(this,h,this.__data_)||Wt(this.tagName,`Invalid prop '${e}'. IsValid() check failed`)),h}#N(){let t=Et.get(this.constructor)??Et.get($t(this.constructor));t&&w(t,((e,s)=>{let r=t[s],n=u(this,s);if(r){let t=r.prop;n=t?G(this.__data_[t]):u(this,s)}this.__data_[s]=n,delete this[s]}))}#b=k(this.propsReady,100);_updateProps(t){let e=wt.get(this.constructor);if(!e)return;let s=[];w(t,((t,r)=>{let n=U(r),o=e[n];o&&(t=this.#P(e,n,t),o.attribute&&$(t)&&!a(t)&&s.push([o,n,t]),N(this,n,t))})),O(this.#o,t),s.forEach((([t,e,s])=>{this.#A(t,e,s)})),this.#o&&this.#b(this.#o)}_wrapperProp={};_initProps(t,e){this.#o=E(this.#o||{},t),this.#n=E(this.#n||{},e),w(t,((t,e)=>{if(a(t)){let s=te.get(t);if(s){let t=s.join("-");this._wrapperProp[t]=e;let r=this.wrapperComponent?Et.get(this.wrapperComponent?.constructor):null,n=s[0];if(r&&r[n]){let t=wt.get(this.constructor);N(t,[e,"shallow"],r[n].shallow)}}}}))}_bindSlot(t,e,s){this.#h[e]||(this.#h[e]=t,De.set(t,this));let r="slotchange",n=Me(r,this.#_,t,this);if(this._eventBindList.push([r,this.#_,t,n]),!V(s)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=s}}_bindSlotHook(t,e){this.#c[t]=e}#w=new Set;_updateSlot(t,e,s){let r=this.#h[t],n=this.#c[t];if(!n&&!r)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=s),n)this.#w.add(t);else{let t=r.assignedElements({flatten:!0});for(let r=0;r<t.length;r++){t[r].setAttribute(e,s+"")}}}#T(){if(!this.#i)return;let t=X(this.#h);if(V(t))return;const e=R(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let s=K(e,(e=>{if(e.nodeType===Node.TEXT_NODE&&t.includes(pt))return pt;if(e instanceof Element){let s=e.getAttribute("slot")||pt;if(t.includes(s))return s}}));if(V(s))return void(this.slots={});w(s,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&V(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=q(t);if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&V(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};w(s,((t,e)=>{V(t)||(r[e]=t)})),this.slots=r}#C(t){let e=this.#c[t];if(!e)return;let s=this.#e[t];if(!this.__data_.slots)return;if(!this.__data_.slots[t])return;this.renderAsync(e,u(s,"props"));const r=this._asyncDirectives.get(e);let n=r?.buildView(e(u(s,"props"))),o=Q(d(n),(t=>t.nodeType===Node.COMMENT_NODE));if(o){let e=this.#d[t];if(!V(e))for(let t=0;t<e.length;t++){const s=e[t];s.parentNode?.removeChild(s)}this.#d[t]=o,this.append(...o),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#M(t,e,s){if(!this.__inited)return;if(he(this.constructor).has(t)){let e=U(t);if(B(s)){let t=wt.get(this.constructor);t&&(s=t[e]._defaultValue)}this._updateProps({[e]:s})}}_regSubViewDeps(t,e){this.__updateSubViewDeps||(this.__updateSubViewDeps=new Map),t.forEach((t=>{let s=this.__updateSubViewDeps.get(t);s||(s=new Set,this.__updateSubViewDeps.set(t,s)),s.add(e)}))}_getPrivateData(){return this.__data_}emit(t,e={},s){s&&(e.event=s),e.target=this,S(this.#n,"emit-native")?this.dispatchEvent(new CustomEvent(t,{bubbles:!1,composed:!1,cancelable:!0,detail:e})):this._listerners[t]&&this._listerners[t](e)}_addEvent(t,e){this._listerners||(this._listerners={}),this._listerners[t]=e}nextTick(t){if(!this.isMounted)return this.#f||(this.#f=[]),void this.#f.push(t);ae.pushNext(t)}forceUpdate(){w(this.__data_,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#y()}}class Ve{strings;vars;constructor(t,e){this.strings=h(t),this.vars=e}getKey(){let t=this.vars,e="";return w(this.strings,((s,r)=>{if(ft.test(s))return e=Z(t[r]),!1})),e}getKeys(){let t=this.vars,e=[];for(let s=0;s<this.strings.length;s++){const r=this.strings[s];if(ft.test(r)){let r=Z(t[s]);e.push(r)}}return V(e)&&t.forEach((t=>{if(t instanceof Ve){let s=t.getKey();e.push(s)}})),e}append(t){let e=q(this.strings);return t.strings.forEach(((t,s)=>{0!=s?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=h(this.vars,t.vars),this}insert(t,e){let s=e.strings.shift();return this.strings[t]+=s,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,s]=is(t,this),r=ds([],e,s,t);return Y(r,((t,e)=>t+(e.outerHTML??"")),"")}flatVars(t){let e=h(this.vars),s=this.strings.length-1,r=0;for(let n=0;n<=s;n++){let s=u(e,r,"");if(s instanceof Ve&&s.vars.length>0){let[n,o]=is(t,s);s=n,e.splice(r,1,...o),r+=o.length-1}r++}return e}destroy(){this.strings=this.vars=null}}var We,He;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(We||(We={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(He||(He={}));class Ue{key;varIndex;value;node;attrName;attrTmpl;isText=!1;isDirective=!1;isComponent=!1;isProp=!1;isToggleProp=!1;isPlaceholder;__destroyed=!1;directiveOldValue;children;parent;constructor(t,e,s,r){this.varIndex=t,e&&(this.node=e),s&&(this.attrName=s),r&&(this.attrTmpl=r)}static createFrom(t){let e=new Ue(t.varIndex,t.node,t.attrName,t.attrTmpl);return e.key=t.key,e.value=t.value,e.isText=t.isText,e.isDirective=t.isDirective,e.isComponent=t.isComponent,e.isProp=t.isProp,e.isToggleProp=t.isToggleProp,e.isPlaceholder=t.isPlaceholder,e}destroy(t){if(this.__destroyed)return;this.__destroyed=!0;let e=this.node,s=this.children;this.parent;if(this.node=this.value=this.directiveOldValue=this.children=this.parent=null,!e)return;let r=s;r?.forEach(((e,s)=>{e.destroy(t)})),e instanceof Ie&&e.destroy(),t&&zt.clear(e.deref(),t),e.deref()?.remove()}insert(t){t.parent=this,this.children||(this.children=[]),this.children.push(t)}}const Be=new WeakMap,$e=new Map;var je;!function(t){t.AFTER_BEGIN="afterbegin"}(je||(je={}));let Fe={};function ze(t,e,s,r,n,o,i,a){let l;if([We.TEXT,We.SLOT].includes(u(r,"__scope",""))?(Yt.start(),l=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i}),Yt.end(n,a)):l=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i}),!l)return;let[c,h]=l;if(c===He.NONE)return;let p=Be.get(t),f=zt.getNodes(p,t),g=a.children;if(c===He.REMOVE){for(let t=0;t<f.length;t++){const e=f[t];e.remove(),e instanceof Ie&&e.destroy()}g?.forEach(((t,e)=>{t.destroy(n)}))}else if(c===He.REPLACE){let e=[];for(let t=0;t<f.length;t++){const e=f[t];e.parentNode?.removeChild(e),e instanceof Ie&&e.destroy()}g?.forEach(((t,e)=>{t.destroy(n)}));let s=ps(t,h,n,a,!0);e=d(s);let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)}else if(c===He.UPDATE){let e,s={},r=[],o=[];if(h||(h=new Ve([],[])),V(f)){let e=ps(t,h,n,a,!0);return void p.after(...e)}let i={};h instanceof Ve&&h.vars.forEach((t=>{if(t instanceof Ve){const e=t.getKey();i[e]=t,s[e]=!0,o.push(e)}})),f=W(J(f),(t=>t.nodeType===Node.ELEMENT_NODE)),e=W(J(d(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let l={},c="",u={};for(let t=0;t<f.length;t++){let e=f[t],s=e.getAttribute("key");if(!H(s)){if(l[s]){c=s;break}l[s]=e,r.push(s),u[s]=!0}}if(c)return void Vt(`${U(t.nodeValue)} - duplicate key '${c}'`);let _=s,m=[],v=[];w(u,((t,e)=>{_[e]||(v.push(e),delete u[e],A(r,(t=>t===e)))}));let y,E=!1;if(!V(o)){let t=-1,e=[],s=[],n=0,i=0;for(;i<o.length;i++){const a=o[i];let c=r.findIndex((t=>t===a));if(c<0){let t=o[i-1],e=t?l[t]||t:p;m.push({prevNode:e,newkey:a}),n++}else if(c>-1&&c!==i-n){if(t<0||1===Math.abs(t-c)){let t=q(e);e.push({nodeId:a,targetId:0===i?je.AFTER_BEGIN:t?t.nodeId:o[i-1]})}else s.push({moveGroup:e,moveIndex:i+e.length}),e=[],e.push({nodeId:a,targetId:o[i-1]});t=c}}if(e.length>0&&s.push({moveGroup:e,moveIndex:i+e.length}),s.length>0){E=!0;let t=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(t.length<2){let{moveGroup:e}=t[0];if(e.length>1){let t=q(e).targetId;e[e.length-2].nodeId===t&&(e=tt(e))}e.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===je.AFTER_BEGIN?(s=p,s.after(r)):l[t]&&(s=l[t],s.after(r))}))}else{let e=q(t).moveIndex;1===Math.abs(t[t.length-2].moveIndex-e)&&(t=tt(t)),t.forEach((({moveGroup:t})=>{t.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===je.AFTER_BEGIN?(s=p,s.after(r)):(s=l[t],s.after(r))}))}))}}}if(v.forEach((t=>{let e=l[t];if(e&&e.parentNode){l[t]=null,e.remove();let s=A(g,(e=>e.key==t));s.forEach((t=>t.destroy(n)))}})),m.length>0&&(y=function(t,e,s,r,n,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let s=q(u);s&&c===t.prevNode?(s.group||(s.group=[c]),s.group.push(t.newkey)):u.push(t),c=t.newkey;let r=t.newkey;l.push(r),i.push(""),a.push(e[r])})),i.push("");let h=ps(r,new Ve(i,a),s,o,!0),d=new Map;return h.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(d.set(e,!0),n[e]=t)})),u}(m,i,n,t,Fe,a),y.forEach(((e,s)=>{let r=e.newkey,n=Fe[r],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...x(e.group,(t=>Fe[t]))),n=t}o===t?o.before(n):o===p?o.after(n):"string"==typeof o?Fe[o].after(n):o.after(n)})),Fe=null,Fe={}),h.vars[0]instanceof Ve){let t=[],e=[];w(h.vars,(s=>{e.push(...s.vars),t.push(...x(s.vars,(t=>"1")))})),t.push("1"),h=new Ve(t,e)}if(E||v.length>0||y){const t=K(g,(t=>t.key));let e=[],s=0;o.forEach((r=>{t[r]&&t[r].forEach((t=>{t.varIndex=s++,e.push(t)}))})),et(g,e).forEach((t=>t.destroy(n))),a.children=e}gs(a,n,h)}}let Ge=0;function Xe(t,e){let s=t.name||"Di-"+Ge++,r=Symbol.for(s);return(...n)=>{let o=t(...n);return(T(e,We.TEXT)||T(e,We.SLOT))&&$e.set(s,o),N(o,"__scope",e[0]),[r,n,o,t=>{},Yt.popDirectiveQ()]}}const Ke="@",qe=".",Qe="?",Ze="*",Ye=":",Je="ref",ts="key",es=/(<\/?)\s*([A-Z][A-Za-z0-9]*)([\s>])/gm,ss=/\s+([\.?@*])?((?:[a-zA-Z]*[A-Z][^\s<>="']+))(?=[\s=>])/gm,rs=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,ns="slot-props",os=new Map;function is(t,e){let s="",r=h(e.vars),n=e.strings.length-1,o=e.vars.length-1,i=0;for(let a=0;a<=n;a++){const n=e.strings[a];let l=u(r,i,"");if(l instanceof Ve){let[e,s]=is(t,l);l=e,r.splice(i,1,...s),i+=s.length-1}else l=a>o?"":cs;i++,s=s+n+l}let a=0;return s=s.replace(rs,((t,e)=>it(t,cs,(()=>cs.replace("--\x3e","")+a++)))),s=s.replace(ms,"$1><").trim(),s=as(s),[s,r]}function as(t){return r(t)?t=(t=t.replace(ss,((t,e,s)=>` ${e??""}${b(s)}`))).replace(es,((t,e,s,r)=>e+vt[s]+r)):t+""}function ls(t,e){let s=h(e.vars),r=e.strings.length-1;for(let n=0;n<=r;n++){let r=u(e.vars,n,"");if(r instanceof Ve){let e=ls(t,r);s.splice(n,1,...e)}}return s}const cs="\x3c!--c_ui-pl_df--\x3e",us="\x3c!--c_ui-pl_df",hs=/<!--c_ui-pl_df\d*(-->)?/;function ds(t,e,s,r){const n=document.createElement("div");n.innerHTML=e;let o=r._eventBindList;o||(o=r._eventBindList=[]);const i=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,u=0,h=null,_="";for(;a=i.nextNode();){if(l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof Ie&&(l=a);let e={},n=d(a.attributes);for(let i=0;i<n.length;i++){const d=n[i];let{name:g,value:m}=d;if(g!==ns)if(c(g,us)){let e=s[u];if(f(e)&&p(e[0])){let[,s,n,o,i]=e;o(We.TAG);let c=new Ue(u,new WeakRef(a));c.isDirective=!0,c.value=e,c.isComponent=!!l,t.push(c),h&&h?.contains(a)&&(c.key=_),u++,n(a,s,void 0,{renderComponent:r,slotComponent:l,varChain:i})}a.removeAttribute(g)}else if(g[0]!==Ke)if(g!==Je)if(g!==ts){if(hs.test(m)){let n=s[u],o=new Ue(u,new WeakRef(a),g.replace(/\.|\?|@/,""),m);if(o.isComponent=!!l,h&&h?.contains(a)&&(o.key=_),g[0]===qe||g[0]===Qe||g[0]===Ze){if(f(n)&&p(n[0])){let[,t,e,s,i]=n;s(We.PROP),e(a,t,void 0,{renderComponent:r,slotComponent:l,varChain:i,attrName:g.substring(1)}),o.value=n,o.isDirective=!0}else if(g[0]===Qe){o.isToggleProp=!0,o.value=!!n;let t=g.substring(1);o.value&&a.setAttribute(t,n)}else if(g[0]===Ze){o.value=n;let t=g.substring(1);const[e,s]=t.split(Ye);let r=e;switch(s){case"camel":r=U(r);break;case"kebab":r=b(r);break;case"snake":r=at(r)}o.attrName=r,a.setAttribute(r,n)}else{let t=U(g.substring(1));o.value=n,o.isProp=!0,e[t]=n}a.removeAttribute(g),n=""}else{let t,e;if(o.value=n,f(n)&&p(n[0])){We.ATTR,"class"===g?We.CLASS:"style"===g&&We.STYLE;let[,s,r,i]=n;o.isDirective=!0,o.attrName=g,e=s,t=r,n=""}m=ot(m,hs,n),d.value=m,$(m)&&a.setAttribute(g,m),t&&t(a,e,void 0,{renderComponent:r,slotComponent:l})}t.push(o),u++}}else{let e=s[u];a.setAttribute(g,e);let r=new Ue(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=_),t.push(r),u++,h=a,_=e,t.length>0&&t.forEach((t=>{t.key=t.key??e}))}else{if(hs.test(m)){let e=s[u],r=new Ue(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=_),t.push(r),u++,e.__setRef(new WeakRef(a))}a.removeAttribute(g)}else{let e;if(hs.test(m)){let r=new Ue(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=_),t.push(r),e=s[u],u++}let r=g.substring(1);o.push([r,e,a]),a.removeAttribute(g)}}a instanceof Ie?(m=r,a.__wrapperComponent=new WeakRef(m),g(e)>0&&a._initProps(e)):a instanceof HTMLSlotElement&&r._bindSlot(a,a.name||"default",e)}else{let e=a;if(`\x3c!--${e.nodeValue}--\x3e`!==cs)continue;let n=new Ue(u,new WeakRef(a));h&&h?.contains(a)&&(n.key=_),t.push(n),n.isComponent=!!l,n.isText=!0;let o=s[u];if(f(o)&&p(o[0])){const t=Symbol.keyFor(o[0]);let s;s=document.createComment(`compelem-${r.tagName}-${t}-start`),e.parentNode.insertBefore(s,e),e.nodeValue=`compelem-${r.tagName}-${t}-end`,e._diName=t,Be.set(e,s),n.isDirective=!0,n.value=o;let i=l?We.SLOT:We.TEXT,[,a,c,u,h]=o;u(i),n.directiveOldValue=[a,h],Yt.start();let d=c(e,a,void 0,{renderComponent:r,slotComponent:l,varChain:h});if(Yt.end(r,n),d){let t=ps(e,d[1],r,n),s=t.length;t&&s>0&&zt.insertBefore(e,Array.from(t))}o=void 0}else n.value=o,n.node=null;if(u++,!n.isDirective){let t=Z(o??""),s=document.createTextNode(t);e.parentNode.insertBefore(s,e),e.remove(),a=s,n.node=new WeakRef(s)}}h&&!h.contains(a)&&h!==a&&(h=null,_="")}var m;return n.childNodes}function ps(t,e,s,r,n=!1){let[o,i]=is(s,e),a=[],l=ds(a,o,i,s);return n&&s.__bindEvents(),a.forEach((t=>{r.insert(t)})),l}function fs(t,e,s,r){if(o(st(t.strings)))return;let n=t.flatVars(e);for(let t=0;t<s.length;t++){const r=s[t];let o=r.varIndex;if(o<0)continue;if(r.isPlaceholder)continue;if(r.__destroyed)continue;let i=r.value,l=n,c=r.node.deref();if(!c)continue;let h=rt(o,"-");for(let e=0;e<h.length;e++){const s=h[e];l=u(l,s),l&&l.vars&&t<h.length-1&&(l=l.vars)}if(!a(i)&&i===l)continue;let d=c;if(r.isDirective){let[,t,s,,n]=r.value;if(!f(l))continue;let o=Gt(c,e),[,i]=l;ze(c,i,t,s,e,o,n,r)}else if(r.isToggleProp){if(!!l===i)continue;d.toggleAttribute(r.attrName,!!l),N(d,r.attrName,!!l)}else if(r.isProp){if(!a(l)&&l===i)continue;c instanceof Ie?c._updateProps({[r.attrName]:l}):c instanceof HTMLSlotElement&&e._updateSlot(c.getAttribute("name")||"default",r.attrName,l)}else if(r.attrName){if(!nt(i,l))switch(r.attrName){case"value":if(c instanceof HTMLInputElement){c.value=l;break}default:c.setAttribute(r.attrName,ot(r.attrTmpl,hs,l+""))}}else if(r.isText){r.node.deref().textContent=Z(l??"")}r.value=l}}function gs(t,e,s,r){if(!t)return;let n=t.node.deref();const o=$e.get(n._diName);let i=Gt(n,e);const[a,l]=t.directiveOldValue;if(!s){let r=o(n,t.value[1],a,{renderComponent:e,slotComponent:i,varChain:l});if(!r)return;s=r[1]}if(s){if(s.vars[0]instanceof Ve){let t=[],e=[];w(s.vars,(s=>{e.push(...s.vars),t.push(...x(s.vars,(t=>"1")))})),t.push("1"),s=new Ve(t,e)}fs(s,e,t.children)}}function _s(t,...e){return new Ve(r(t)?[t]:t,e)}const ms=/([a-z0-9"'])\s*>\s*</gim;class vs{#R;get current(){return this.#R?.deref()}__setRef(t){this.#R=t}}function ys(){return new vs}var Es;!function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(Es||(Es={}));class ws{static get priority(){return 0}created(t,...e){}beforeMount(t,e,...s){}mounted(t,e,...s){}updated(t,e){}beforeDestroy(t,...e){}}class bs{metadata;decorator;key;priority=0;constructor(t,e,s){this.metadata=e,this.decorator=new s(...t),this.priority=u(s,"priority",0)}dispose(){this.metadata=null,this.decorator=null}create(t){let e,s=this.decorator.targets,r=this.metadata[1];a(r)&&$(u(r,"configurable"))?e=Es.METHOD:n(this.metadata[1])&&(e=Es.FIELD),!V(s)&&e&&s.includes(e)?this.decorator.created(t,...this.metadata):Vt(`Decorator '${this.decorator.constructor.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.decorator.beforeMount(t,e,...this.metadata)}mounted(t,e){this.decorator.mounted(t,e,...this.metadata)}updated(t,e){this.decorator.updated(t,e)}destroy(t){this.decorator.beforeDestroy(t,...this.metadata)}}function Ss(t){return(...e)=>(...s)=>{let r=s[0].constructor,n=bt.get(r);if(!bt.has(r)){let t=Object.getPrototypeOf(r);n=t?h(bt.get(t)??[]):[],bt.set(r,n)}let o=new bs(e,s.splice(1),t);return n?.push(o),o}}function Ns(t){return(...e)=>{if(!e||e.length<1)return;let s=e[0].constructor,r=bt.get(s);if(!bt.has(s)){let t=Object.getPrototypeOf(s);r=t?h(bt.get(t)??[]):[],bt.set(s,r)}let n=new bs([],e.splice(1),t);return r?.push(n),n}}function Ts(t,e,s){return s.get||Vt(`Computed '${e}' must be a getter`),yt.has(t.constructor)||yt.set(t.constructor,{}),yt.get(t.constructor)[e]=s.get,delete t[e],Reflect.defineProperty(t,e,{get(){return Yt.__collecting&&Yt.__varPathList.push(e),Reflect.get(this[It],e)}}),Reflect.getOwnPropertyDescriptor(t,e)}const Cs=Ss(class extends ws{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);N(t,e,k(r,this.wait,this.immediate)),N(t,e+"_$__",r)}beforeDestroy(t,e){N(t,e,null),N(t,e+"_$__",null)}get targets(){return[Es.METHOD]}wait;immediate;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function ks(t,e){return(s,r,n)=>{if(!mt.has(s.constructor)){let t=[],e=s.constructor;for(;(e=$t(e))!==Ie;)t=h(t,mt.get(e)??[]);mt.set(s.constructor,t)}mt.get(s.constructor)?.push({name:t,targetFn:e,fnName:r})}}const Ms=Ss(class extends ws{static get priority(){return Number.MAX_VALUE}created(t,e,s,...r){let n=lt(u(t,s),t);N(t,s,P(n)),N(t,s+"_$__",n)}beforeDestroy(t,e){N(t,e,null),N(t,e+"_$__",null)}get targets(){return[Es.METHOD]}});var Ps;!function(t){t.ONCE="once"}(Ps||(Ps={}));const As=new WeakMap;class xs extends ws{static get priority(){return Number.MAX_VALUE}get targets(){return[Es.FIELD]}selector;cache;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){let e=t?.shadowRoot?.querySelector(this.selector),s=As.get(t);s||(s=new Map,As.set(t,s)),s.set(this.selector,e)}mounted(t,e,s,...r){const n=this;let o=new WeakRef(t);Reflect.defineProperty(t,s,{configurable:!0,get(){let t=o.deref();return As.has(t)&&As.get(t)?.has(n.selector)&&n.cache===Ps.ONCE||n.getter(t),As.get(t)?.get(n.selector)}})}beforeDestroy(t,e){As.get(t)?.clear(),As.delete(t)}updated(t,e){this.cache!==Ps.ONCE&&this.getter(t)}}const Rs=Ss(xs),Ds=Ss(class extends xs{getter(t){let e=t.shadowRoot?.querySelectorAll(this.selector),s=As.get(t);s||(s=new Map,As.set(t,s)),s.set(this.selector,e)}});function Os(t){if(1===arguments.length)return(e,s)=>{Ls(e,s,t)};Ls(arguments[0],arguments[1],{prop:""})}function Ls(t,e,s){if(!Et.has(t.constructor)){const e={};let s=t.constructor;for(;(s=$t(s))!==Ie;)E(e,Et.get(s)??{});Et.set(t.constructor,e)}if(s.shallow=s.shallow||!1,N(Et.get(t.constructor),e,s),s.hasChanged){let r=Rt.get(t.constructor);r||(r=new Map,Rt.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.shallow){let s=xt.get(t.constructor);s||(s=new Set,xt.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t.constructor.prototype,e,{get(){return Xt(void 0,e,this)},set(t){Kt(e,t,this)}})}function Is(t,e,s){Ls(t.prototype,e,s||{prop:""})}function Vs(t){return e=>{e&&(vt[e.name]=t,customElements.define(t,e))}}const Ws=Ss(class extends ws{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);N(t,e,M(r,this.wait)),N(t,e+"_$__",r)}beforeDestroy(t,e){N(t,e,null),N(t,e+"_$__",null)}get targets(){return[Es.METHOD]}wait;constructor(t){super(),this.wait=t}});function Hs(t,e){return(s,r)=>{let n=Mt.get(s.constructor),o=kt.get(s.constructor),i=Nt.get(s.constructor),a=Tt.get(s.constructor),l=Ct.get(s.constructor),c=Pt.get(s.constructor);if(!l){l=[],Ct.set(s.constructor,l),a=[],Tt.set(s.constructor,a),i=new Map,Nt.set(s.constructor,i),n={},Mt.set(s.constructor,n),o={},kt.set(s.constructor,o),c={},Pt.set(s.constructor,c);let t=$t(s.constructor);for(;t;)Ct.has(t)&&(l.push(...Ct.get(t)),a.push(...Tt.get(t)),Nt.get(t)?.forEach(((t,e)=>{i.set(e,t)})),O(n,Mt.get(t)),O(o,kt.get(t)),O(c,Pt.get(t))),t=$t(t)}(f(t)?t:[t]).forEach((t=>{let h=s[r];u(e,"once",!1)&&i.set(t,!1);let d=u(e,"deep",!1);if(l.push(t),d?(n[t]=n[t]??new Set,n[t].add(h),a.push(t)):(o[t]=o[t]??new Set,o[t].add(h)),u(e,"immediate",!1)){let e=c[t];e||(e=c[t]=new Set),e.add(h)}}))}}const Us=["key"],Bs=Xe((function(t){return(t,[e],s)=>{let r=t;if(s)w(e,((t,e)=>{r.setAttribute(e,t)}));else if(r instanceof Ie){let t={},s={},n=wt.get(r.constructor);w(e,((e,r)=>{if(Us.includes(r))return;let o=U(r);(n?n[o]:void 0)?t[r]=e:s[r]=e+""})),r._initProps(t,s)}else w(e,((t,e)=>{r.setAttribute(e,t)}))}}),[We.TAG]),$s=new WeakMap,js=Xe((function(t){return(t,[e],s,{renderComponent:n})=>{let o=[];if(f(e)?o=J(e):a(e)?o=R(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!s)return;let i=t;if($s.get(i)&&$s.get(i).length===o.length&&ct($s.get(i),o))return;let l=$s.get(i);w(l,(t=>{i.classList.remove(t)})),w(o,(t=>{i.classList.add(t)})),l=h(o),$s.set(i,l)}}),[We.CLASS]),Fs=new WeakMap,zs=new WeakMap,Gs=Xe((function(t,e){return(t,e,s,{varChain:r})=>{let n=t,o=function(t,e,s){let r=x(t,((t,s)=>e(t,s)));if(r.length<1){let t=new Ve([],[]);return zs.set(s,t),t}let n=[],o=[];const i=[],a=[];for(let t=0;t<r.length;t++){const e=r[t];let s=q(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(ft.test(e)){let e=l[t]+"";if(n.includes(e))return void Vt(`forEach - duplicate key '${e}'`);n.push(e),c=!1}0==t&&s?o[o.length-1]=s+e:o.push(e)}if(c)return void Vt("forEach - missing 'key' prop");let h=q(i);h&&u.length>0&&(i[i.length-1]=j(h)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new Ve(i,a);return zs.set(s,l),l}(e[0],e[1],n);if(s&&s[0]){const s=Fs.get(n);let r=Be.get(t),i=zt.getNodes(r,t);if(V(i)&&(!e||V(e[0])))return[He.NONE,o];if(s&&ct(s,e[0])&&s.length===e[0].length)return[He.NONE,o]}return Fs.set(n,ut(e[0])),s?[He.UPDATE,o]:[He.APPEND,o]}}),[We.TEXT,We.SLOT]);let Xs=document.createElement("div");const Ks=Xe((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||H(e[0])||(Xs.innerHTML=as(e[0]),t.after(...Xs.childNodes))}}),[We.TEXT,We.SLOT]),qs=Xe((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||H(e[0])||(t.innerHTML=as(e[0]))}}),[We.TAG]),Qs=new WeakMap,Zs=Xe((function(t,e,s){return(t,[e,s,r],n,{renderComponent:o})=>{let i=t;if(n){if(!!e==!!n[0]){let t=Qs.get(i);return[He.NONE,t.call(o,e)]}let t=e?s:r;return Qs.set(i,t),[He.REPLACE,t.call(o,e)]}{let t=e?s:r;return Qs.set(i,t),[He.APPEND,t.call(o,e)]}}}),[We.TEXT,We.SLOT]),Ys=Xe((function(t,e){return(t,[e,s],r)=>r?e===r[0]?[He.NONE,e?s():_s``]:e?[He.REPLACE,e?s():_s``]:[He.REMOVE]:[He.APPEND,e?s():_s``]}),[We.TEXT,We.SLOT]);var Js;!function(t){t.CHANGE="change",t.INPUT="input"}(Js||(Js={}));const tr=Xe((function(t,s="value",n){return(t,[s,n,o],i,{varChain:l,renderComponent:c})=>{n=n??"value";const h=t;if(i){const t=i[0],e=s;let r=u(h,n);if(!a(e)&&Object.is(e,t)&&Object.is(r,e))return;if(h instanceof Ie)h._updateProps({[n]:e});else if(h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement){if(h.setAttribute(n,e+""),h instanceof HTMLSelectElement){let t=C(h.querySelectorAll("option"),(t=>t.value==e));t&&(t.selected=!0)}}else if(h instanceof HTMLInputElement){if(h.value==e)return;switch(h.type){case"checkbox":case"radio":e?h.setAttribute("checked",""):h.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":h.setAttribute(n,e+""),N(h,n,e);break;default:h.setAttribute(n,e+"")}}return}let d;d=r(o)?e(o)[0]:q(l);const p=rt(d,".")[0];p in c||c._wrapperProp[p]||Vt(`model - property '${p}' is not defined on the instance of `+c.tagName);let f=c._eventBindList;if(a(s)||j(s)||(s=""),h instanceof Ie){h._initProps({[n]:s});let t="update:"+n;f.push([t,function(t){let e=this,s=e._wrapperProp[p];!(p in e)&&s&&u(e.wrapperComponent,p)===u(e,s)&&(e=e.wrapperComponent||e),N(e,d,t.value)},h])}else if(h instanceof HTMLTextAreaElement){h.setAttribute(n,s+"");let t="input";f.push([t,function(t){let e=t.target;N(this,d,e.value)},h])}else if(h instanceof HTMLInputElement){let t="",e="";switch(h.type){case"checkbox":case"radio":t="checked",e="change";break;default:t="value",e="input"}h.setAttribute(n??t,s+""),f.push([e,function(t){let e=t.target;N(this,d,e.value)},h])}else h instanceof HTMLSelectElement&&(h.setAttribute(n,s+""),f.push(["change",function(t){let e=t.target,s=this,r=s._wrapperProp[p];!(p in s)&&r&&u(s.wrapperComponent,p)===u(s,r)&&(s=s.wrapperComponent||s),N(s,d,e.value)},h]))}}),[We.TAG]),er=new WeakMap,sr=Xe((function(t,e){return(t,[e,s],r)=>{if(r&&e===r[0])return;let n=t;if(!er.has(n)){let t=n.style.display;er.set(n,"none"==t?"unset":t)}n.style.display=e?er.get(n):"none",s&&s(n,e)}}),[We.TAG]),rr=Xe((function(t,e){return(t,[e,s],r,{renderComponent:n,slotComponent:o})=>{r||(e=e.bind(n),o._bindSlotHook(s||"default",e))}}),[We.SLOT]);class nr{static getCssText(t,e=!1){return r(t)?t:st(x(t,((t,s)=>s.startsWith("--")?s+":"+t+(e?" !important":""):b(s)+":"+t+(e?" !important":""))),";")+";"}static setStyle(t,e){if(r(t)&&!j(t))return;let s=nr.getCssText(t);e.style.cssText=s}}const or=Xe((function(...t){return(t,e,s,{renderComponent:r})=>{let n=t,o=Y(e,((t,e)=>t+nr.getCssText(e)),""),i=J(o.split(";").map((t=>t.split(":")[0]))),a=J(n.style.cssText.split(";")),l=Q(a,(t=>i.some((e=>t.trim().startsWith(e)))));n.style.cssText=o+l.join(";")}}),[We.STYLE]),ir=Xe((function(t){return(t,e,s,{renderComponent:r,varChain:n,attrName:o})=>{const i=t;if(s)return void(nt(e,s)||i._updateProps({[o]:e[0]}));let a=q(n);i._initProps({[o]:e[0]}),i.addEventListener("update:"+o,(t=>{N(r,a,t.detail.value)}))}}),[We.PROP]),ar=Xe((function(t,e){return(t,[e,s],r)=>{let n=()=>_s``,o=[],i=[];w(s,((t,e)=>{if(l(t))o.push(e),i.push(t);else{let e=t[0],s=t[1];o.push(e),i.push(s)}"default"===e&&(n=t)}));let a=ht(o,(t=>l(t)?t(e):t==e));return r?[He.REPLACE,dt(i[a]??n)]:[He.APPEND,dt(i[a]??n)]}}),[We.TEXT,We.SLOT]);export{Ie as CompElem,nr as CssHelper,Be as DI_COMMENT_START_NODE_MAP,ws as Decorator,Es as DecoratorType,bs as DecoratorWrapper,He as DirectiveUpdateTag,zt as DomUtil,We as EnterPointType,Js as ModelTriggerType,Ps as QueryCache,Ve as Template,$e as TextOrSlotDirectiveExecutorMap,Ue as UpdatePoint,he as _getObservedAttrs,$t as _getSuper,Bt as _toUpdatePath,Bs as bind,is as buildHTML,js as classes,Ts as computed,ys as createRef,Cs as debounced,Ss as decorator,Ns as decoratorWithNoArgs,Xe as directive,ks as event,Gs as forEach,Ft as getBooleanValue,Gt as getSlotComponent,_s as html,Ks as htmlC,qs as htmlD,Zs as ifElse,Ys as ifTrue,jt as isBooleanProp,Is as makeState,tr as model,Ms as onced,le as prop,Rs as query,Ds as queryAll,sr as show,Vt as showError,Wt as showTagError,Ut as showTagWarn,Ht as showWarn,rr as slot,Os as state,or as styles,ir as sync,Vs as tag,Ws as throttled,ze as updateDirective,Hs as watch,ar as when};
7
+ import t,{toPath as e,some as s,isString as r,isUndefined as n,isBlank as o,closest as i,isObject as a,isFunction as l,startsWith as c,get as u,concat as h,toArray as d,isSymbol as p,isArray as f,size as g,eachRight as _,slice as m,defaults as v,isLowerCaseChar as y,merge as E,each as w,kebabCase as b,has as S,set as N,includes as T,find as C,debounce as k,throttle as M,once as P,remove as A,map as x,flatMap as R,test as D,assign as O,first as L,walkTree as I,isEmpty as V,filter as W,isNil as H,camelCase as U,isNull as B,isDefined as $,trim as j,isBoolean as F,parseJSON as z,cloneDeep as G,keys as X,groupBy as K,last as q,reject as Q,toString as Z,reduce as Y,compact as J,initial as tt,except as et,join as st,split as rt,isEqual as nt,replace as ot,replaceAll as it,snakeCase as at,bind as lt,isMatch as ct,clone as ut,findIndex as ht,call as dt}from"myfx";const pt="default",ft=/\s+\.?key\s*=/;var gt,_t;!function(t){t[t.RENDER=1]="RENDER",t[t.COMPUTED=2]="COMPUTED",t[t.DIRECTIVE=3]="DIRECTIVE"}(gt||(gt={})),function(t){t.Prod="prod",t.Dev="dev"}(_t||(_t={}));const mt=new Map,vt={},yt={},Et=new WeakMap,wt=new WeakMap,bt=new WeakMap,St=new Map,Nt=new Map,Tt=new WeakMap,Ct=new WeakMap,kt=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,At=new WeakMap,xt=new WeakMap,Rt=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,Lt=new WeakMap,It=new WeakMap,Vt=new WeakMap,Wt="__data_";function Ht(t){console.error("[CompElem]",t)}function Ut(t,e){console.error(`[CompElem <${t}>]`,e)}function Bt(...t){console.warn("[CompElem]",...t)}function $t(t,e){console.warn(`[CompElem <${t}>]`,e)}function jt(t){return e(t).join("-")}function Ft(t){return Object.getPrototypeOf(t)}function zt(t){return t===Boolean||s(t,(t=>t===Boolean))}function Gt(t){let e=t;return r(t)&&/(?:^true$)|(?:^false$)/.test(e)?e="true"===e:(n(e)||o(e))&&(e=!0),e}const Xt={getNodes(t,e){let s=t.nextSibling;if(!e)return[s];let r=[];for(;s&&s!==e;)r.push(s),s=s?.nextSibling;return r},insertBefore:function(t,e){if(!t.parentNode)return;let s=document.createDocumentFragment();s.append(...e),t.parentNode.insertBefore(s,t)},remove:function(t,e){if(t===e)return void t?.parentNode?.removeChild(t);let s=t.nextSibling;for(;s&&s!==e;)s?.parentNode?.removeChild(s),s=t.nextSibling},clear(t,e){if(!t)return;let s,r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT);for(r=document.createNodeIterator(t,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);s=r.nextNode();)t!==s&&(s instanceof Comment||s instanceof We&&s.destroy())}};function Kt(t,e){let s=i(t,(t=>t.host&&t.host instanceof We),"parentNode");if(!s||s.host!==e)return s?s.host:void 0}function qt(t,e,s){let r=s,n=t?t.call(r):Reflect.get(r[Wt],e);if(te.__collecting&&te.__varPathList.push(e),re.has(n)){let t=oe.get(n);return t||(t=new Set,oe.set(n,t)),t.add(r.__thisRef),re.get(n)}if(a(n)&&!l(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=Rt.get(r.constructor),s=t?.has(e);s||(t=Dt.get(r.constructor),s=t?.has(e)),n=s||"slots"===e?n:ie(n,r,e)}return n}function Qt(t,e,s){let r=s;if(!r.__inited)return void Reflect.set(r[Wt],t,e);let n=r[Wt][t],o=Ot.get(r.constructor),i=o?.get(t);if(i){if(!i.call(r,e,n,[t],e,n))return!0}else if(Object.is(n,e))return!0;Zt(r,e,n,t),Yt(r,t),Jt(r,t),Reflect.set(r[Wt],t,e),r._notify(n,[t]);let a=xt.get(r.constructor);a?.has(t)&&r.emit("update:"+t,{value:e})}function Zt(t,e,s,r,n,o){let i=Ft(t.constructor),a=kt.get(t.constructor)??kt.get(i),l=Ct.get(t.constructor)??Ct.get(i),p=Pt.get(t.constructor)??Pt.get(i),f=Mt.get(t.constructor)??Mt.get(i),g=Tt.get(t.constructor)??Tt.get(i);a?.forEach((i=>{(r===i||c(i,r+".")&&!Object.is(u(t._getPrivateData(),i),u(e,i))||c(r,i+".")&&l?.includes(i)&&!Object.is(u(t._getPrivateData(),i),u(e,i)))&&h(d(f[i]),d(p[i])).forEach((a=>{a&&!0!==g.get(i)&&(t._watchUpdateArgsInNextTick.set(a,{newValue:e,oldValue:s,chain:r.split("."),rootObjNew:n,rootObjOld:o,fullMatch:i===r}),t._watchUpdateSetInNextTick.add(a),g.has(i)&&g.set(i,!0))}))}))}function Yt(t,e){let s=Lt.get(t.constructor);s?.has(e)&&s.get(e)?.forEach((e=>{t._computedUpdateSetInNextTick.add(e)}))}function Jt(t,e){let s=It.get(t.constructor);if(!s)return;let r=e.split("."),n="";r.forEach((e=>{n=n?n+"."+e:e,s.has(n)&&(t._cssUpdateInNextTick=!0)}))}const te={popDirectiveQ(){return this.__varPathList.reduceRight(((t,e)=>(t.includes(e)||t.unshift(e),t)),[])},start(){this.__collecting=!0,this.__varPathList=[]},end(t,e){t&&e&&t._regSubViewDeps(te.popVarPathList(),e),this.__collecting=!1},popVarPathList(){let t=Array.from(new Set(this.__varPathList));return this.__varPathList=[],t},__varPathList:[],__collecting:!1},ee=new WeakMap,se=new WeakMap,re=new WeakMap,ne=new WeakMap,oe=new WeakMap;function ie(t,e,s){if(re.has(t))return re.get(t);if(ne.has(t)){if(s){let r=ee.get(e);r||(r=new WeakMap,ee.set(e,r)),r.set(t,s);let n=oe.get(t);n||(n=new Set,oe.set(t,n)),n.values().some((t=>t.deref()===e))||n.add(new WeakRef(e))}return t}const r=new Proxy(t,{get(t,s,r){if(!s)return;const n=Reflect.get(t,s,r);if(p(s))return n;if(l(n))return n;if("length"===s&&f(t))return n;if("__"===s.substring(0,2))return n;if(te.__collecting){let t=se.has(r)?h(se.get(r)):[];t.push(s);let e=t.join(".");te.__varPathList.push(e)}if(re.has(n))return re.get(n);let o=n;if(a(n)&&!l(n)&&!(n instanceof Node)&&!Object.isFrozen(n)){let t=se.has(r)?h(se.get(r)):[];o=ie(n,e),t.push(s),se.set(o,t),re.set(n,o)}return o},set(t,s,r,n){if(!s)return!1;let o=t[s],i=se.get(n)??[],a=h(i,[s]),l=Ot.get(e.constructor),c=l?.get(a[0]),u=a.length>1,d=r,p=o;if(u&&(p=d=e._getPrivateData()[a[0]]),c){if(!c.call(e,d,p,a,r,o))return!0}else if(Object.is(o,r))return!0;let f=r,g=Reflect.set(t,s,f),_=oe.get(n),m=a.join(".");return Zt(e,f,o,m,d,p),Yt(e,m),Jt(e,m),ae(e,p,a),_?.forEach((t=>{let e=t.deref();if(!e)return;let s=e._wrapperProp[a[0]],r=a.join(".");r=r.replace(a[0],s),Zt(e,f,o,r),Yt(e,r),Jt(e,r),ae(e,p,r.split("."))})),g}});if(se.has(r)||se.set(r,s?[s]:[]),re.set(t,r),s&&(ne.set(r,e),!ee.has(e))){let t=new WeakMap;t.set(r,s),ee.set(e,t)}return r}function ae(t,e,s,r,n){let o=g(s);_(s,(r=>{let n=m(s,0,o--);t._notify(e,n)}))}const le=new Map;class ce{static nextSet=new Set;static nextPending=!1;static next;static flush(){ce.nextPending=!1;let t=Array.from(ce.nextSet);ce.nextSet.clear(),le.clear(),t.forEach((t=>t())),t=null}static pushNext(t){ce.nextSet.add(t),ce.nextPending||(ce.nextPending=!0,ce.next())}}function ue(t){if(1===arguments.length)return(e,s,r)=>{t.required=t.required||!1,t.attribute=!1!==t.attribute,he(e,s,t,r)};let e=arguments[0],s=arguments[1],r=arguments[2];t={type:void 0,required:!1,attribute:!0},r&&"function"==typeof r.type&&(t=v(r,t),r=void 0),t.shallow=t.shallow||!1,he(e,s,t,r)}function he(t,e,s,r){let n;if(y(e[0])||Ht(`Prop '${e}' must be in CamelCase`),!bt.has(t.constructor)){const e={};let s=t.constructor;for(;(s=Ft(s))!==We;)E(e,bt.get(s)??{});n=new Set,w(e,((t,e)=>{if(t.attribute){let t=b(e);n?.add(t)}})),Nt.set(t.constructor,n),bt.set(t.constructor,e)}if(r&&(r.get&&(s.getter=r.get),r.set&&(s.setter=r.set)),s.attribute){n||(n=Nt.get(t.constructor));let s=b(e);n?.add(s)}if(S(t.constructor,"observedAttributes")||(t.constructor.observedAttributes=[]),n&&(t.constructor.observedAttributes=d(n)),N(bt.get(t.constructor),e,s),s.hasChanged){let r=Ot.get(t.constructor);r||(r=new Map,Ot.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.sync){let s=xt.get(t.constructor);s||(s=new Set,xt.set(t.constructor,s)),s.add(e)}if(s.shallow){let s=Dt.get(t.constructor);s||(s=new Set,Dt.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t,e,{get(){return qt(r?.get,e,this)},set(t){r?.set?r.set(t):Qt(e,t,this)}})}(()=>{const t=Promise.resolve(),e=ce.flush;ce.next=()=>{t.then(e)}})();const de=new Set;function pe(t){return Nt.get(t)??de}const fe=["resize","outside","mutate"],ge=new WeakMap,_e=[],me=[],ve=[],ye=new WeakSet,Ee=new ResizeObserver((t=>{for(const e of t){const t=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize,s=Array.isArray(e.borderBoxSize)?e.borderBoxSize[0]:e.borderBoxSize;if(!ye.has(e.target)){ye.add(e.target);continue}let r=ge.get(e.target);r&&r({target:e.target,contentBoxSize:t,borderBoxSize:s,type:"resize"})}}));var we;!function(t){t.Child="child",t.Tree="tree",t.Attr="attr",t.Char="char"}(we||(we={}));const be=new WeakMap,Se=new MutationObserver((t=>{for(let e=0;e<t.length;e++){const s=t[e];let r=be.get(s.target);if(!r)return;let n={target:s.target},o=null;switch(s.type){case"subtree":n.type=we.Tree,o=r[we.Tree];break;case"childList":n.type=we.Child,n.addedNodes=s.addedNodes,n.removedNodes=s.removedNodes,o=r[we.Child];break;case"attributes":n.type=we.Attr,n.attributeName=s.attributeName,n.oldValue=s.oldValue,o=r[we.Attr];break;case"characterData":n.type=we.Char,n.oldValue=s.oldValue,o=r[we.Char]}o&&(n.type="mutate",o(n))}}));function Ne(e,s,r,n,o){if("resize"===e)return function(t,e){if(ge.has(t))return;ge.set(t,e),Ee.observe(t);let s=Ee;return(e=!1)=>{s.unobserve(t),ge.delete(t),e&&(s=t=null)}}(s,r);if("outside"===e)switch(n[0]){case"mousedown":return function(e,s){return _e.push([e,s]),(r=!1)=>{t.remove(_e,(t=>t[0]===e&&t[1]===s))}}(s,r);case"dblclick":return function(e,s){return ve.push([e,s]),(r=!1)=>{t.remove(ve,(t=>t[0]===e&&t[1]===s))}}(s,r);default:return function(e,s){return me.push([e,s]),(r=!1)=>{t.remove(me,(t=>t[0]===e&&t[1]===s))}}(s,r)}else if("mutate"===e)return function(t,e,s){let r=T(s,"child"),n=T(s,"attr"),o=T(s,"char"),i=T(s,"tree"),a=be.get(t);if(!a)return a={},be.set(t,a),r&&(a[we.Child]=e),n&&(a[we.Attr]=e),o&&(a[we.Char]=e),i&&(a[we.Tree]=e),Se.observe(t,{childList:r,attributes:n,characterData:o,subtree:i}),(e=!1)=>{be.delete(t),e&&(t=null)}}(s,r,n)}document.addEventListener("mousedown",(t=>{let e=u(t.composedPath(),0,t.target);_e.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"mousedown",event:t})}))}),!1),document.addEventListener("click",(t=>{let e=u(t.composedPath(),0,t.target);me.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"click",event:t})}))}),!1),document.addEventListener("dblclick",(t=>{let e=u(t.composedPath(),0,t.target);ve.forEach((([s,r])=>{s.contains(e)||s.contains(i(e,(t=>t instanceof ShadowRoot),"parentNode")?.host)||r({type:"outside",target:s,modifier:"dblclick",event:t})}))}),!1);const Te=/,|^(debounce:.+)|(debounce$)/,Ce=/,|^(throttle:.+)|(throttle$)/,ke="native",Me={esc:"escape"},Pe=()=>{};function Ae(t,e,s,r){let n,o=t.split("."),i=o.shift(),a=o.includes("once"),l=e??Pe;if(n=C(o,(t=>Te.test(t)))){let t=n.split(":");l=k(l,parseInt(t[1])||100)}if(n=C(o,(t=>Ce.test(t)))){let t=n.split(":");l=M(l,parseInt(t[1])||100)}if(a&&(l=P(l)),s instanceof We&&(s!==r||o.includes(ke)||o.push(ke),!o.includes(ke)))return s._addEvent(i,e);if(function(t){return fe.includes(t)}(i))return Ne(i,s,l,o);let c=t=>{if(o.includes("prevent")&&t.preventDefault(),o.includes("stop")&&t.stopPropagation(),!o.includes("self")||t.target===t.currentTarget){if(t instanceof MouseEvent){if(o.includes("left")&&0!=t.button)return;if(o.includes("right")&&2!=t.button)return;if(o.includes("middle")&&1!=t.button)return}else if(t instanceof KeyboardEvent){if(A(o,(t=>"ctrl"==t))[0]&&!t.ctrlKey)return;if(A(o,(t=>"alt"==t))[0]&&!t.altKey)return;if(A(o,(t=>"shift"==t))[0]&&!t.shiftKey)return;if(A(o,(t=>"meta"==t))[0]&&!t.metaKey)return;let e=x(o,(t=>Me[t]||t));if(g(e)>0&&!e.includes(t.key.toLowerCase()))return}l(t)}},u={capture:o.includes("capture")||!1,passive:o.includes("passive")||!1};return s.addEventListener(i,c,u),(t=!1)=>{s.removeEventListener(i,c,u),t&&(s=null)}}const xe={boolean:Boolean,string:String,number:Number,object:Object,array:Array,function:Function,undefined:Object},Re=new WeakMap;let De=[],Oe=0;const Le=new WeakMap,Ie={},Ve="slots";class We extends HTMLElement{static __l_globalRule=document.createElement("style");static defaults(t){De=R(t.css,(t=>{if(r(t)){let e=new CSSStyleSheet;return e.replaceSync(t),e}return t instanceof CSSStyleSheet?t:[]})),t.global,w(t,((t,e)=>{D(e[0],/[A-Z]/)}))}#t;#e={};__data_={};#s={};#r;__updateTree;_eventBindList;_listerners={};__docoEventMap;__updateSubViewDeps;_cssUpdateInNextTick=!1;_cssVarOldValueMap;__cssSheets;_watchUpdateSetInNextTick;_watchUpdateArgsInNextTick;_computedUpdateSetInNextTick;get[Symbol.toStringTag](){return this.constructor.name}get cid(){return this.#t}get attrs(){return this.#n}get props(){return this.#o}get renderRoot(){return this.#i?.deref()}get renderRoots(){return this.#a.flatMap((t=>t.deref()??[]))}get parentComponent(){return this.#l?.deref()}get wrapperComponent(){return this.__wrapperComponent?.deref()}get slots(){return Ie}get slotHooks(){return this.#c}get cssSheets(){return Re.get(this.constructor)}get globalCssSheet(){return We.__l_globalRule.sheet}get isMounted(){return this.#u}#n;#o;#i;#a;#l;__wrapperComponent;#h={};#c={};#d={};#u=!1;#p=!1;#f;static get css(){return[]}static get globalCss(){}static get hostCss(){}get cssVars(){return{}}__inited=!1;#g=!1;#_;__thisRef;constructor(...t){super(),this.#t=Oe++,this.__updateTree=[],this.__thisRef=new WeakRef(this),this.#_=this.#m.bind(this),1===g(t)&&(this.#o={},O(this.#o,L(t))),Reflect.getOwnPropertyDescriptor(this.constructor.prototype,"slots")||Reflect.defineProperty(this.constructor.prototype,"slots",{get(){return qt(void 0,"slots",this)},set(t){Qt("slots",t,this)}});let e=St.get(this.constructor)??St.get(Ft(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((t=>t.create(this))),this.#v=this.#y.bind(this)}insertStyleSheet(t){if(!this.#r)return null;let e;if(r(t)){e=new CSSStyleSheet;try{e.replaceSync(t)}catch(t){}}else{if(this.#r.adoptedStyleSheets.includes(t))return t;e=t}this.#r.adoptedStyleSheets=[...this.#r.adoptedStyleSheets,e];return(Re.get(this.constructor)??[]).push(e),e}get rootComponent(){let t=this;for(;t.parentComponent;)t=t.parentComponent;return t}#v;connectedCallback(){let t=i(this.parentNode,(t=>t instanceof We||t.host instanceof We),"parentNode");this.#l=t?t instanceof We?new WeakRef(t):new WeakRef(t.host):void 0,We.__l_globalRule.parentNode||document.head.appendChild(We.__l_globalRule);let e=u(this.constructor,"hostCss"),s=u(this.constructor,"hostCssSheet");if(e){s||(r(e)?(s=new CSSStyleSheet,s.replaceSync(e)):s=e,N(this.constructor,"hostCssSheet",s));let t=this.__wrapperComponent?.deref()?.shadowRoot??this.#l?.deref()?.shadowRoot??this.ownerDocument;this.__wrapperComponent&&!this.__wrapperComponent.deref()?.shadowRoot?.contains(this)&&(t=i(this,(t=>t instanceof HTMLDocument||t instanceof ShadowRoot),"parentNode")),t&&s&&!t.adoptedStyleSheets.includes(s)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,s])}this.__init(),this.__bindEvents()}disconnectedCallback(){this.__unbindEvents()}__bindEvents(){let t=this._eventBindList;w(t,(t=>{let[e,s,r,n]=t;if(n)return;if(!r)return;let o=Ae(e,s?s.bind(this):s,r,this);t[3]=o}));let e=mt.get(this.constructor);g(e)>0&&(this.__docoEventMap||(this.__docoEventMap=new Map),w(e,(({name:t,targetFn:e,fnName:s})=>{if(this.__docoEventMap.has(t+"@"+s))return;let r=e?e(this):this,n=u(this,s),o=Ae(t,n?n.bind(this):n,r,this);this.__docoEventMap.set(t+"@"+s,o)})))}__unbindEvents(){w(this._eventBindList,(t=>{let[,,,e]=t;e&&e(),t[3]=null}));let t=[];w(this.__docoEventMap,((e,s)=>{e&&e(),t.push(s)})),t.forEach((t=>this.__docoEventMap.delete(t)))}beforeDestroyed(){}destroyed(){}get isDestroyed(){return this.#E}#E=!1;destroy(){if(this.#E)return;this.#E=!0;let t=St.get(this.constructor)??St.get(Ft(this.constructor));if(t&&t.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.destroy(this)})),this.beforeDestroyed(),this.__unbindEvents(),this._listerners=null,this.__docoEventMap?.clear(),this.__docoEventMap=this._eventBindList=null,Vt.get(this)?.clear(),Vt.delete(this),this._watchUpdateArgsInNextTick?.clear(),this._watchUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick?.clear(),this._computedUpdateSetInNextTick=null,this.__cssSheets=null,this.__updateSubViewDeps?.clear(),this.#l){let t=this.#l.deref();t&&I(t.__updateTree,(e=>{e.__destroyed||e.node?.deref()===this&&(e.destroy(t),A(e.parent?e.parent.children:t.__updateTree,(t=>t===e)))}))}w(this.__updateTree,(t=>t?.destroy(this))),w(this.#h,(t=>{Le.delete(t),t.remove()})),w(this.#d,(t=>{w(t,(t=>t.remove()))})),w(this.__data_.slots,((t,e)=>{w(t,(t=>t.remove()))})),this.#w.clear(),this.#d=this.#h=this.#w=this.#e=this.__data_.slots=null,this.remove(),this._wrapperProp=this.#b=this.#i=this.#a=this.#r=this.#s=this.#n=this.#o=this.#i=this.#a=this.#c=this.#v=this.__data_=this.__updateTree=this.#l=this._asyncDirectives=this.__wrapperComponent=null,this.destroyed()}__init(){if(this.__inited)return;if(this.#g)return;this.#g=!0;let t=u(this.constructor,"globalCss");V(t)||!r(t)||u(this.constructor,"_globalRuleInserted")||(We.__l_globalRule.textContent+=t,N(this.constructor,"_globalRuleInserted",!0));let e=Re.get(this.constructor),s=e??[];e||(w(u(this.constructor,"css"),(t=>{if(r(t)){let e=new CSSStyleSheet;e.replaceSync(t),s.push(e)}else l(t)||s.push(t)})),Re.set(this.constructor,s));const n=this.#S();this.propsReady(n);for(const t in n){const e=n[t];this.__data_[t]=e}this.#N(),this.__data_.slots={},Reflect.defineProperty(this.__data_,"__isData",{enumerable:!1,value:!0});let i=Ft(this.constructor);if(kt.get(this.constructor)??kt.get(i)){this._watchUpdateSetInNextTick=new Set,this._watchUpdateArgsInNextTick=new Map;let t=Tt.get(this.constructor)??Tt.get(i),e=At.get(this.constructor)??At.get(i);w(e,((e,s)=>{let r=u(this,s);e.forEach((t=>{t.call(this,r,void 0,s)})),t.has(s)&&t.set(s,!0)}))}let a=O({},Et.get(this.constructor),Et.get(i));if(a){this._computedUpdateSetInNextTick=new Set;let t=Lt.get(this.constructor);t?w(a,((t,e)=>{this[Wt][e]=t.call(this)})):(t=new Map,Lt.set(this.constructor,t),w(a,((e,s)=>{N(e,"key",s),te.start(),this[Wt][s]=e.call(this),te.end(),te.popVarPathList().forEach((s=>{let r=t.get(s);r||(r=new Set,t.set(s,r)),r.add(e)}))})))}te.start();let c=this.render();te.end();let h,d=te.popVarPathList();this.constructor.prototype._viewDeps||(this.constructor.prototype._viewDeps=d),null===c?(this.#a=[],this.#i=void 0):(this.#r=this.attachShadow({mode:"open"}),this.#r.adoptedStyleSheets=[...De,...Re.get(this.constructor)??[]],h=function(t,e){let s,r=[];if(as.has(e.constructor)){s=fs(r,as.get(e.constructor),us(e,t),e)}else{let[n,o]=ls(e,t);as.set(e.constructor,n),s=fs(r,n,o,e)}return e.__updateTree=r,s}(c,this),h&&(this.#a=W(h,(t=>t.nodeType===Node.ELEMENT_NODE)).map((t=>new WeakRef(t))),this.#i=this.#a[0])),this.__inited=!0,this.#T(),w(this.#c,((t,e)=>{this.#C(e)}));const p=this;let f=St.get(this.constructor)??St.get(Ft(this.constructor));f&&f.sort(((t,e)=>e.priority-t.priority)).forEach((t=>{t.beforeMount(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.beforeMount(),setTimeout((()=>{if(!this.isDestroyed){if(this.#u=!0,this.#r){te.start();let t=this.cssVars;if(te.end(),!V(t)){this._cssVarOldValueMap={};let e=It.get(this.constructor);e||(e=new Set(te.popVarPathList()),It.set(this.constructor,e));let s="";w(t,((t,e)=>{let r="--"+b(e).replace(/^-+/,"");(o(t)||H(t))&&(t="initial"),this._cssVarOldValueMap[r]=t,s+=";"+r+":"+t})),this.style.cssText+=s}}h&&this.#r.append(...h),f&&f.forEach((t=>{t.mounted(this,((t,e)=>(p.__data_[t]=e,p.__data_[t])))})),this.#f&&this.#f.forEach((t=>ce.pushNext(t))),this.#p&&ce.pushNext(this.#v),this.__bindEvents(),this.mounted()}}),0)}propsReady(t){}render(){return null}beforeMount(){}mounted(){}#m(t){let e=t.currentTarget,s="";w(this.#h,((t,r)=>{if(t===e)return s=r,!1})),this.__inited&&this.#k(e,s===pt?"":s)}#k(t,e){this.#T();let s=u(this.#e[e],"props");s&&w(this.slots,((t,e)=>{t.filter((t=>t.nodeType===Node.ELEMENT_NODE)).forEach((t=>{t instanceof We?t._updateProps(s):w(s,((e,s)=>{if(t instanceof HTMLSlotElement){let r=Le.get(t);if(r){let n=t.name||pt,o=r.#e[n];o||(o=r.#e[n]={props:{}}),o.props||(o.props={}),o.props[s]=e,r.#k(t,n)}}else t.setAttribute(s,e)}))}))})),this.slotChange(t,e)}slotChange(t,e){}attributeChangedCallback(t,e,s){if(!this.__inited)return;if(Object.is(s,e))return;"undefined"===s&&(s=null);let r=U(t);if(zt(bt.get(this.constructor)[r].type)){let t=!B(s)&&Gt(s);if(u(this,r)===t)return}this.#M(t,e,s)}shouldUpdate(t){return!0}updated(t){}_notify(t,e,s,r){let n=[];for(let o=0;o<e.length;o++){const i=e[o];n.push(i);let a=u(this,n),l=jt(n);this.#s[l]={value:a,chain:l===Ve?[Ve]:n,oldValue:t,end:n.length===e.length,subNewValue:s,subOldValue:r}}this.isMounted?ce.pushNext(this.#v):this.#p=!0}#y(){if(g(this.#s)<1)return;if(!this.isMounted)return;const t=this.#s;if(this.#s={},!this.shouldUpdate(t))return;let e=St.get(this.constructor)??St.get(Ft(this.constructor));e&&e.sort(((t,e)=>e.priority-t.priority)).forEach((e=>{e.updated(this,t)}));let s=!1,r=new Set,n=this.constructor.prototype._viewDeps;if(w(t,((t,e)=>{if(!s&&n?.includes(e)&&(s=!0),this.__updateSubViewDeps?.has(e)){let t=this.__updateSubViewDeps.get(e);t&&t.forEach((t=>{r.add(t)}))}})),this._watchUpdateSetInNextTick?.forEach((t=>{let{newValue:e,oldValue:s,chain:r,rootObjNew:n,rootObjOld:o,fullMatch:i}=this._watchUpdateArgsInNextTick.get(t),a=i?e:n,l=i?s:o;t.call(this,a,l,r,e,s)})),this._watchUpdateSetInNextTick?.clear(),this._watchUpdateArgsInNextTick?.clear(),this._computedUpdateSetInNextTick?.forEach((t=>{let e=u(t,"key"),s=this.__data_[e],r=t.call(this);(a(r)||r!==s)&&(this.__data_[e]=r,this._notify(s,[e]))})),this._computedUpdateSetInNextTick?.clear(),this._cssUpdateInNextTick){let t=this.cssVars;w(t,((t,e)=>{let s="--"+b(e).replace(/^-+/,"");this._cssVarOldValueMap[s]!=t&&((o(t)||H(t))&&(t="initial"),this._cssVarOldValueMap[s]=t,this.style.setProperty(s,t+""))}))}this.#i?.deref()&&(s&&_s(this.render(),this,this.__updateTree),g(r)>0&&r.forEach((t=>{ms(t,this,void 0)}))),this.#w.forEach((t=>{this.#C(t)})),this.updated(t)}#S(){let t=bt.get(this.constructor)??bt.get(Ft(this.constructor)),e=this.attributes,s=this.tagName,r=this.#o,o={};w(e,(({name:e,value:s})=>{if(e[0]===Qe||e[0]===Ze||e[0]===Ye||e===es||"slot"===e)return;let r=U(e);t&&!t[r]&&(o[e]=s)})),this.#n=this.#n?O(this.#n,o):o;let i={};if(!t)return i;let l=Object.keys(t),c=l.length;for(let o=0;o<c;o++){const c=l[o],h=b(c),d=this.hasAttribute(h);let p,g=t[c],_=S(r,c),m=u(this,c);if(!("_defaultValue"in g)&&(g._defaultValue=m,!g.type)){n(m)&&Ut(s,"Prop '"+c+"' has neither propType nor defaultValue be used for type inference");let t=typeof m;f(m)&&(t="array");let e=xe[t];g.type=e}if(_)p=H(r[c])?m:r[c];else{p=m;let t=e.getNamedItem(h)||e.getNamedItem(Ze+h);t&&(_=!0,p=t.value)}if(g.required&&!_){Ut(s,"Prop '"+c+"' is required");break}p=this.#P(t,c,p,d),g.attribute&&$(p)&&!a(p)&&this.#A(g,c,p),this.__data_[c]=p,i[c]=p,delete this[c]}return i}#A(t,e,s){let r=b(e),n=j(s);zt(t.type)?(n=Gt(s),F(n)?n&&!this.hasAttribute(r)?this.toggleAttribute(r,!0):!n&&this.hasAttribute(r)&&this.toggleAttribute(r,!1):this.getAttribute(r)!==n&&this.setAttribute(r,n)):this.getAttribute(r)!==n&&this.setAttribute(r,n)}#x(t,e){let s=t;try{for(let r=0;r<e.length;r++){const n=e[r];s=n===Boolean?Gt(t):n===Number?Number(t):n===String?String(t):n===Object||n===Array?z(t):n===Date?new Date(t):new n(t)}}catch(e){Ut(this.tagName,"Convert attribute error with "+t)}return s}#P(t,e,n,o){let i=t[e];if(!i)return n;let a=i.isValid,l=i.type,c=f(l)?l:[l],u=i.converter,h=n;if(!s(c,(t=>t===String))&&r(h)&&!B(h))try{h=u?u(h):this.#x(h,c)}catch(t){Ut(this.tagName,`Convert attribute '${e}' error with `+h)}for(let t=0;t<c.length;t++){"Boolean"===c[t].name&&o&&(h=Gt(h))}if(H(h))return h;let d=typeof h,p=!$(h);for(let t=0;t<c.length;t++){const e=c[t];if(D(d,e.name,"i")||h instanceof e||Object.prototype.toString.call(h)===Object.prototype.toString.call(e.prototype)){p=!0;break}}return p||Ut(this.tagName,`Invalid prop '${e}'. expected '${c.map((t=>t.name||t))}' but got '${d}'`),a&&(a.call(this,h,this.__data_)||Ut(this.tagName,`Invalid prop '${e}'. IsValid() check failed`)),h}#N(){let t=wt.get(this.constructor)??wt.get(Ft(this.constructor));t&&w(t,((e,s)=>{let r=t[s],n=u(this,s);if(r){let t=r.prop;n=t?G(this.__data_[t]):u(this,s)}this.__data_[s]=n,delete this[s]}))}#b=k(this.propsReady,100);_updateProps(t){let e=bt.get(this.constructor);if(!e)return;let s=[];w(t,((t,r)=>{let n=U(r),o=e[n];o&&(t=this.#P(e,n,t),o.attribute&&$(t)&&!a(t)&&s.push([o,n,t]),N(this,n,t))})),O(this.#o,t),s.forEach((([t,e,s])=>{this.#A(t,e,s)})),this.#o&&this.#b(this.#o)}_wrapperProp={};_initProps(t,e){this.#o=E(this.#o||{},t),this.#n=E(this.#n||{},e),w(t,((t,e)=>{if(a(t)){let s=se.get(t);if(s){let t=s.join("-");this._wrapperProp[t]=e;let r=this.wrapperComponent?wt.get(this.wrapperComponent?.constructor):null,n=s[0];if(r&&r[n]){let t=bt.get(this.constructor);N(t,[e,"shallow"],r[n].shallow)}}}}))}_bindSlot(t,e,s){this.#h[e]||(this.#h[e]=t,Le.set(t,this));let r="slotchange",n=Ae(r,this.#_,t,this);if(this._eventBindList.push([r,this.#_,t,n]),!V(s)){let t=this.#e[e];t||(t=this.#e[e]={}),t.props=s}}_bindSlotHook(t,e){this.#c[t]=e}#w=new Set;_updateSlot(t,e,s){let r=this.#h[t],n=this.#c[t];if(!n&&!r)return;let o=this.#e[t];if(e&&(o.props||(o.props={}),o.props[e]=s),n)this.#w.add(t);else{let t=r.assignedElements({flatten:!0});for(let r=0;r<t.length;r++){t[r].setAttribute(e,s+"")}}}#T(){if(!this.#i)return;let t=X(this.#h);if(V(t))return;const e=R(this.childNodes,(t=>t.nodeType===Node.COMMENT_NODE?[]:t instanceof HTMLSlotElement?t.assignedNodes({flatten:!0}):t));let s=K(e,(e=>{if(e.nodeType===Node.TEXT_NODE&&t.includes(pt))return pt;if(e instanceof Element){let s=e.getAttribute("slot")||pt;if(t.includes(s))return s}}));if(V(s))return void(this.slots={});w(s,((t,e)=>{if(e){for(;t.length>0;){let e=t[0];if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&V(e.assignedNodes({flatten:!0}))))break;t.shift()}for(;t.length>0;){let e=q(t);if(!(e.nodeType===Node.TEXT_NODE&&o(e.textContent)||e instanceof HTMLSlotElement&&V(e.assignedNodes({flatten:!0}))))break;t.pop()}}}));let r={};w(s,((t,e)=>{V(t)||(r[e]=t)})),this.slots=r}#C(t){let e=this.#c[t];if(!e)return;let s=this.#e[t];if(!this.__data_.slots)return;if(!this.__data_.slots[t])return;this.renderAsync(e,u(s,"props"));const r=this._asyncDirectives.get(e);let n=r?.buildView(e(u(s,"props"))),o=Q(d(n),(t=>t.nodeType===Node.COMMENT_NODE));if(o){let e=this.#d[t];if(!V(e))for(let t=0;t<e.length;t++){const s=e[t];s.parentNode?.removeChild(s)}this.#d[t]=o,this.append(...o),this.#w.clear()}}_asyncDirectives=new WeakMap;renderAsync(t,...e){}#M(t,e,s){if(!this.__inited)return;if(pe(this.constructor).has(t)){let e=U(t);if(B(s)){let t=bt.get(this.constructor);t&&(s=t[e]._defaultValue)}this._updateProps({[e]:s})}}_regSubViewDeps(t,e){this.__updateSubViewDeps||(this.__updateSubViewDeps=new Map),t.forEach((t=>{let s=this.__updateSubViewDeps.get(t);s||(s=new Set,this.__updateSubViewDeps.set(t,s)),s.add(e)}))}_getPrivateData(){return this.__data_}emit(t,e={},s){s&&(e.event=s),e.target=this,S(this.#n,"emit-native")?this.dispatchEvent(new CustomEvent(t,{bubbles:!1,composed:!1,cancelable:!0,detail:e})):this._listerners[t]&&this._listerners[t](e)}_addEvent(t,e){this._listerners||(this._listerners={}),this._listerners[t]=e}nextTick(t){if(!this.isMounted)return this.#f||(this.#f=[]),void this.#f.push(t);ce.pushNext(t)}forceUpdate(){w(this.__data_,((t,e)=>{this.#s[e]={value:void 0,chain:void 0}})),this.#y()}}class He{strings;vars;constructor(t,e){this.strings=h(t),this.vars=e}getKey(){let t=this.vars,e="";return w(this.strings,((s,r)=>{if(ft.test(s))return e=Z(t[r]),!1})),e}getKeys(){let t=this.vars,e=[];for(let s=0;s<this.strings.length;s++){const r=this.strings[s];if(ft.test(r)){let r=Z(t[s]);e.push(r)}}return V(e)&&t.forEach((t=>{if(t instanceof He){let s=t.getKey();e.push(s)}})),e}append(t){let e=q(this.strings);return t.strings.forEach(((t,s)=>{0!=s?this.strings.push(t):this.strings[this.strings.length-1]=e+t})),this.vars=h(this.vars,t.vars),this}insert(t,e){let s=e.strings.shift();return this.strings[t]+=s,this.strings.splice(t+1,0,...e.strings),this.vars.splice(t,0,...e.vars),this}getHTML(t){let[e,s]=ls(t,this),r=fs([],e,s,t);return Y(r,((t,e)=>t+(e.outerHTML??"")),"")}flatVars(t){let e=h(this.vars),s=this.strings.length-1,r=0;for(let n=0;n<=s;n++){let s=u(e,r,"");if(s instanceof He&&s.vars.length>0){let[n,o]=ls(t,s);s=n,e.splice(r,1,...o),r+=o.length-1}r++}return e}destroy(){this.strings=this.vars=null}}var Ue,Be;!function(t){t.ATTR="attr",t.PROP="prop",t.TEXT="text",t.CLASS="class",t.STYLE="style",t.SLOT="slot",t.TAG="tag"}(Ue||(Ue={})),function(t){t.NONE="NONE",t.REMOVE="REMOVE",t.REPLACE="REPLACE",t.UPDATE="UPDATE",t.APPEND="APPEND"}(Be||(Be={}));class $e{key;varIndex;value;node;attrName;attrTmpl;isText=!1;isDirective=!1;isComponent=!1;isProp=!1;isToggleProp=!1;isPlaceholder;__destroyed=!1;directiveOldValue;children;parent;constructor(t,e,s,r){this.varIndex=t,e&&(this.node=e),s&&(this.attrName=s),r&&(this.attrTmpl=r)}static createFrom(t){let e=new $e(t.varIndex,t.node,t.attrName,t.attrTmpl);return e.key=t.key,e.value=t.value,e.isText=t.isText,e.isDirective=t.isDirective,e.isComponent=t.isComponent,e.isProp=t.isProp,e.isToggleProp=t.isToggleProp,e.isPlaceholder=t.isPlaceholder,e}destroy(t){if(this.__destroyed)return;this.__destroyed=!0;let e=this.node,s=this.children;this.parent;if(this.node=this.value=this.directiveOldValue=this.children=this.parent=null,!e)return;let r=s;r?.forEach(((e,s)=>{e.destroy(t)})),e instanceof We&&e.destroy(),t&&Xt.clear(e.deref(),t),e.deref()?.remove()}insert(t){t.parent=this,this.children||(this.children=[]),this.children.push(t)}}const je=new WeakMap,Fe=new Map;var ze;!function(t){t.AFTER_BEGIN="afterbegin"}(ze||(ze={}));let Ge={};function Xe(t,e,s,r,n,o,i,a){let l;if([Ue.TEXT,Ue.SLOT].includes(u(r,"__scope",""))?(te.start(),l=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i}),te.end(n,a)):l=r(t,e,s,{renderComponent:n,slotComponent:o,varChain:i}),!l)return;let[c,h]=l;if(c===Be.NONE)return;let p=je.get(t),f=Xt.getNodes(p,t),g=a.children;if(c===Be.REMOVE){for(let t=0;t<f.length;t++){const e=f[t];e.remove(),e instanceof We&&e.destroy()}g?.forEach(((t,e)=>{t.destroy(n)}))}else if(c===Be.REPLACE){let e=[];for(let t=0;t<f.length;t++){const e=f[t];e.parentNode?.removeChild(e),e instanceof We&&e.destroy()}g?.forEach(((t,e)=>{t.destroy(n)}));let s=gs(t,h,n,a,!0);e=d(s);let r=document.createDocumentFragment();r.append(...e),t.parentNode.insertBefore(r,t)}else if(c===Be.UPDATE){let e,s={},r=[],o=[];if(h||(h=new He([],[])),V(f)){let e=gs(t,h,n,a,!0);return void p.after(...e)}let i={};h instanceof He&&h.vars.forEach((t=>{if(t instanceof He){const e=t.getKey();i[e]=t,s[e]=!0,o.push(e)}})),f=W(J(f),(t=>t.nodeType===Node.ELEMENT_NODE)),e=W(J(d(e)),(t=>t.nodeType===Node.ELEMENT_NODE));let l={},c="",u={};for(let t=0;t<f.length;t++){let e=f[t],s=e.getAttribute("key");if(!H(s)){if(l[s]){c=s;break}l[s]=e,r.push(s),u[s]=!0}}if(c)return void Ht(`${U(t.nodeValue)} - duplicate key '${c}'`);let _=s,m=[],v=[];w(u,((t,e)=>{_[e]||(v.push(e),delete u[e],A(r,(t=>t===e)))}));let y,E=!1;if(!V(o)){let t=-1,e=[],s=[],n=0,i=0;for(;i<o.length;i++){const a=o[i];let c=r.findIndex((t=>t===a));if(c<0){let t=o[i-1],e=t?l[t]||t:p;m.push({prevNode:e,newkey:a}),n++}else if(c>-1&&c!==i-n){if(t<0||1===Math.abs(t-c)){let t=q(e);e.push({nodeId:a,targetId:0===i?ze.AFTER_BEGIN:t?t.nodeId:o[i-1]})}else s.push({moveGroup:e,moveIndex:i+e.length}),e=[],e.push({nodeId:a,targetId:o[i-1]});t=c}}if(e.length>0&&s.push({moveGroup:e,moveIndex:i+e.length}),s.length>0){E=!0;let t=s.sort(((t,e)=>t.moveGroup.length-e.moveGroup.length));if(t.length<2){let{moveGroup:e}=t[0];if(e.length>1){let t=q(e).targetId;e[e.length-2].nodeId===t&&(e=tt(e))}e.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===ze.AFTER_BEGIN?(s=p,s.after(r)):l[t]&&(s=l[t],s.after(r))}))}else{let e=q(t).moveIndex;1===Math.abs(t[t.length-2].moveIndex-e)&&(t=tt(t)),t.forEach((({moveGroup:t})=>{t.forEach((({targetId:t,nodeId:e})=>{let s,r=l[e];t===ze.AFTER_BEGIN?(s=p,s.after(r)):(s=l[t],s.after(r))}))}))}}}if(v.forEach((t=>{let e=l[t];if(e&&e.parentNode){l[t]=null,e.remove();let s=A(g,(e=>e.key==t));s.forEach((t=>t.destroy(n)))}})),m.length>0&&(y=function(t,e,s,r,n,o){const i=[],a=[],l=[];let c,u=[];t.forEach((t=>{let s=q(u);s&&c===t.prevNode?(s.group||(s.group=[c]),s.group.push(t.newkey)):u.push(t),c=t.newkey;let r=t.newkey;l.push(r),i.push(""),a.push(e[r])})),i.push("");let h=gs(r,new He(i,a),s,o,!0),d=new Map;return h.forEach((t=>{const e=t.getAttribute("key");l.includes(e)&&(d.set(e,!0),n[e]=t)})),u}(m,i,n,t,Ge,a),y.forEach(((e,s)=>{let r=e.newkey,n=Ge[r],o=e.prevNode;if(e.group){let t=document.createDocumentFragment();t.append(...x(e.group,(t=>Ge[t]))),n=t}o===t?o.before(n):o===p?o.after(n):"string"==typeof o?Ge[o].after(n):o.after(n)})),Ge=null,Ge={}),h.vars[0]instanceof He){let t=[],e=[];w(h.vars,(s=>{e.push(...s.vars),t.push(...x(s.vars,(t=>"1")))})),t.push("1"),h=new He(t,e)}if(E||v.length>0||y){const t=K(g,(t=>t.key));let e=[],s=0;o.forEach((r=>{t[r]&&t[r].forEach((t=>{t.varIndex=s++,e.push(t)}))})),et(g,e).forEach((t=>t.destroy(n))),a.children=e}ms(a,n,h)}}let Ke=0;function qe(t,e){let s=t.name||"Di-"+Ke++,r=Symbol.for(s);return(...n)=>{let o=t(...n);return(T(e,Ue.TEXT)||T(e,Ue.SLOT))&&Fe.set(s,o),N(o,"__scope",e[0]),[r,n,o,t=>{},te.popDirectiveQ()]}}const Qe="@",Ze=".",Ye="?",Je="*",ts=":",es="ref",ss="key",rs=/(<\/?)\s*([A-Z][A-Za-z0-9]*)([\s>])/gm,ns=/\s+([\.?@*])?((?:[a-zA-Z]*[A-Z][^\s<>="']+))(?=[\s=>])/gm,os=/<\s*[a-z0-9-]+([^>]*<\!--c_ui-pl_df-->)*[^>]*?(?<!-)>/gims,is="slot-props",as=new Map;function ls(t,e){let s="",r=h(e.vars),n=e.strings.length-1,o=e.vars.length-1,i=0;for(let a=0;a<=n;a++){const n=e.strings[a];let l=u(r,i,"");if(l instanceof He){let[e,s]=ls(t,l);l=e,r.splice(i,1,...s),i+=s.length-1}else l=a>o?"":hs;i++,s=s+n+l}let a=0;return s=s.replace(os,((t,e)=>it(t,hs,(()=>hs.replace("--\x3e","")+a++)))),s=s.replace(ys,"$1><").trim(),s=cs(s),[s,r]}function cs(t){return r(t)?t=(t=t.replace(ns,((t,e,s)=>` ${e??""}${b(s)}`))).replace(rs,((t,e,s,r)=>e+vt[s]+r)):t+""}function us(t,e){let s=h(e.vars),r=e.strings.length-1;for(let n=0;n<=r;n++){let r=u(e.vars,n,"");if(r instanceof He){let e=us(t,r);s.splice(n,1,...e)}}return s}const hs="\x3c!--c_ui-pl_df--\x3e",ds="\x3c!--c_ui-pl_df",ps=/<!--c_ui-pl_df\d*(-->)?/;function fs(t,e,s,r){const n=document.createElement("div");n.innerHTML=e;let o=r._eventBindList;o||(o=r._eventBindList=[]);const i=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let a,l,u=0,h=null,_="";for(;a=i.nextNode();){if(l&&!l.contains(a)&&(l=void 0),a instanceof HTMLElement||a instanceof SVGElement){a instanceof We&&(l=a);let e={},n=d(a.attributes);for(let i=0;i<n.length;i++){const d=n[i];let{name:g,value:m}=d;if(g!==is)if(c(g,ds)){let e=s[u];if(f(e)&&p(e[0])){let[,s,n,o,i]=e;o(Ue.TAG);let c=new $e(u,new WeakRef(a));c.isDirective=!0,c.value=e,c.isComponent=!!l,t.push(c),h&&h?.contains(a)&&(c.key=_),u++,n(a,s,void 0,{renderComponent:r,slotComponent:l,varChain:i})}a.removeAttribute(g)}else if(g[0]!==Qe)if(g!==es)if(g!==ss){if(ps.test(m)){let n=s[u],o=new $e(u,new WeakRef(a),g.replace(/\.|\?|@/,""),m);if(o.isComponent=!!l,h&&h?.contains(a)&&(o.key=_),g[0]===Ze||g[0]===Ye||g[0]===Je){if(f(n)&&p(n[0])){let[,t,e,s,i]=n;s(Ue.PROP),e(a,t,void 0,{renderComponent:r,slotComponent:l,varChain:i,attrName:g.substring(1)}),o.value=n,o.isDirective=!0}else if(g[0]===Ye){o.isToggleProp=!0,o.value=!!n;let t=g.substring(1);o.value&&a.setAttribute(t,n)}else if(g[0]===Je){o.value=n;let t=g.substring(1);const[e,s]=t.split(ts);let r=e;switch(s){case"camel":r=U(r);break;case"kebab":r=b(r);break;case"snake":r=at(r)}o.attrName=r,a.setAttribute(r,n)}else{let t=U(g.substring(1));o.value=n,o.isProp=!0,e[t]=n}a.removeAttribute(g),n=""}else{let t,e;if(o.value=n,f(n)&&p(n[0])){Ue.ATTR,"class"===g?Ue.CLASS:"style"===g&&Ue.STYLE;let[,s,r,i]=n;o.isDirective=!0,o.attrName=g,e=s,t=r,n=""}m=ot(m,ps,n),d.value=m,$(m)&&a.setAttribute(g,m),t&&t(a,e,void 0,{renderComponent:r,slotComponent:l})}t.push(o),u++}}else{let e=s[u];a.setAttribute(g,e);let r=new $e(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=_),t.push(r),u++,h=a,_=e,t.length>0&&t.forEach((t=>{t.key=t.key??e}))}else{if(ps.test(m)){let e=s[u],r=new $e(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=_),t.push(r),u++,e.__setRef(new WeakRef(a))}a.removeAttribute(g)}else{let e;if(ps.test(m)){let r=new $e(u);r.isPlaceholder=!0,h&&h?.contains(a)&&(r.key=_),t.push(r),e=s[u],u++}let r=g.substring(1);o.push([r,e,a]),a.removeAttribute(g)}}a instanceof We?(m=r,a.__wrapperComponent=new WeakRef(m),g(e)>0&&a._initProps(e)):a instanceof HTMLSlotElement&&r._bindSlot(a,a.name||"default",e)}else{let e=a;if(`\x3c!--${e.nodeValue}--\x3e`!==hs)continue;let n=new $e(u,new WeakRef(a));h&&h?.contains(a)&&(n.key=_),t.push(n),n.isComponent=!!l,n.isText=!0;let o=s[u];if(f(o)&&p(o[0])){const t=Symbol.keyFor(o[0]);let s;s=document.createComment(`compelem-${r.tagName}-${t}-start`),e.parentNode.insertBefore(s,e),e.nodeValue=`compelem-${r.tagName}-${t}-end`,e._diName=t,je.set(e,s),n.isDirective=!0,n.value=o;let i=l?Ue.SLOT:Ue.TEXT,[,a,c,u,h]=o;u(i),n.directiveOldValue=[a,h],te.start();let d=c(e,a,void 0,{renderComponent:r,slotComponent:l,varChain:h});if(te.end(r,n),d){let t=gs(e,d[1],r,n),s=t.length;t&&s>0&&Xt.insertBefore(e,Array.from(t))}o=void 0}else n.value=o,n.node=null;if(u++,!n.isDirective){let t=Z(o??""),s=document.createTextNode(t);e.parentNode.insertBefore(s,e),e.remove(),a=s,n.node=new WeakRef(s)}}h&&!h.contains(a)&&h!==a&&(h=null,_="")}var m;return n.childNodes}function gs(t,e,s,r,n=!1){let[o,i]=ls(s,e),a=[],l=fs(a,o,i,s);return n&&s.__bindEvents(),a.forEach((t=>{r.insert(t)})),l}function _s(t,e,s,r){if(o(st(t.strings)))return;let n=t.flatVars(e);for(let t=0;t<s.length;t++){const r=s[t];let o=r.varIndex;if(o<0)continue;if(r.isPlaceholder)continue;if(r.__destroyed)continue;let i=r.value,l=n,c=r.node.deref();if(!c)continue;let h=rt(o,"-");for(let e=0;e<h.length;e++){const s=h[e];l=u(l,s),l&&l.vars&&t<h.length-1&&(l=l.vars)}if(!a(i)&&i===l)continue;let d=c;if(r.isDirective){let[,t,s,,n]=r.value;if(!f(l))continue;let o=Kt(c,e),[,i]=l;Xe(c,i,t,s,e,o,n,r)}else if(r.isToggleProp){if(!!l===i)continue;d.toggleAttribute(r.attrName,!!l),N(d,r.attrName,!!l)}else if(r.isProp){if(!a(l)&&l===i)continue;c instanceof We?c._updateProps({[r.attrName]:l}):c instanceof HTMLSlotElement&&e._updateSlot(c.getAttribute("name")||"default",r.attrName,l)}else if(r.attrName){if(!nt(i,l))switch(r.attrName){case"value":if(c instanceof HTMLInputElement){c.value=l;break}default:c.setAttribute(r.attrName,ot(r.attrTmpl,ps,l+""))}}else if(r.isText){r.node.deref().textContent=Z(l??"")}r.value=l}}function ms(t,e,s,r){if(!t)return;let n=t.node.deref();const o=Fe.get(n._diName);let i=Kt(n,e);const[a,l]=t.directiveOldValue;if(!s){let r=o(n,t.value[1],a,{renderComponent:e,slotComponent:i,varChain:l});if(!r)return;s=r[1]}if(s){if(s.vars[0]instanceof He){let t=[],e=[];w(s.vars,(s=>{e.push(...s.vars),t.push(...x(s.vars,(t=>"1")))})),t.push("1"),s=new He(t,e)}_s(s,e,t.children)}}function vs(t,...e){return new He(r(t)?[t]:t,e)}const ys=/([a-z0-9"'])\s*>\s*</gim;class Es{#R;get current(){return this.#R?.deref()}__setRef(t){this.#R=t}}function ws(){return new Es}var bs;!function(t){t.CLASS="class",t.FIELD="field",t.METHOD="method"}(bs||(bs={}));class Ss{static get priority(){return 0}created(t,...e){}beforeMount(t,e,...s){}mounted(t,e,...s){}updated(t,e){}beforeDestroy(t,...e){}}class Ns{metadata;decorator;key;priority=0;constructor(t,e,s){this.metadata=e,this.decorator=new s(...t),this.priority=u(s,"priority",0)}dispose(){this.metadata=null,this.decorator=null}create(t){let e,s=this.decorator.targets,r=this.metadata[1];a(r)&&$(u(r,"configurable"))?e=bs.METHOD:n(this.metadata[1])&&(e=bs.FIELD),!V(s)&&e&&s.includes(e)?this.decorator.created(t,...this.metadata):Ht(`Decorator '${this.decorator.constructor.name}' is out of targets, expect '${s.join(",")}' bug got '${e}'`)}beforeMount(t,e){this.decorator.beforeMount(t,e,...this.metadata)}mounted(t,e){this.decorator.mounted(t,e,...this.metadata)}updated(t,e){this.decorator.updated(t,e)}destroy(t){this.decorator.beforeDestroy(t,...this.metadata)}}function Ts(t){return(...e)=>(...s)=>{let r=s[0].constructor,n=St.get(r);if(!St.has(r)){let t=Object.getPrototypeOf(r);n=t?h(St.get(t)??[]):[],St.set(r,n)}let o=new Ns(e,s.splice(1),t);return n?.push(o),o}}function Cs(t){return(...e)=>{if(!e||e.length<1)return;let s=e[0].constructor,r=St.get(s);if(!St.has(s)){let t=Object.getPrototypeOf(s);r=t?h(St.get(t)??[]):[],St.set(s,r)}let n=new Ns([],e.splice(1),t);return r?.push(n),n}}function ks(t,e,s){return s.get||Ht(`Computed '${e}' must be a getter`),Et.has(t.constructor)||Et.set(t.constructor,{}),Et.get(t.constructor)[e]=s.get,delete t[e],Reflect.defineProperty(t,e,{get(){return te.__collecting&&te.__varPathList.push(e),Reflect.get(this[Wt],e)}}),Reflect.getOwnPropertyDescriptor(t,e)}const Ms=Ts(class extends Ss{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);N(t,e,k(r,this.wait,this.immediate)),N(t,e+"_$__",r)}beforeDestroy(t,e){N(t,e,null),N(t,e+"_$__",null)}get targets(){return[bs.METHOD]}wait;immediate;constructor(t,e=!1){super(),this.wait=t,this.immediate=e}});function Ps(t,e){return(s,r,n)=>{if(!mt.has(s.constructor)){let t=[],e=s.constructor;for(;(e=Ft(e))!==We;)t=h(t,mt.get(e)??[]);mt.set(s.constructor,t)}mt.get(s.constructor)?.push({name:t,targetFn:e,fnName:r})}}const As=Ts(class extends Ss{static get priority(){return Number.MAX_VALUE}created(t,e,s,...r){let n=lt(u(t,s),t);N(t,s,P(n)),N(t,s+"_$__",n)}beforeDestroy(t,e){N(t,e,null),N(t,e+"_$__",null)}get targets(){return[bs.METHOD]}});var xs;!function(t){t.ONCE="once"}(xs||(xs={}));const Rs=new WeakMap;class Ds extends Ss{static get priority(){return Number.MAX_VALUE}get targets(){return[bs.FIELD]}selector;cache;constructor(t,e){super(),this.selector=t,this.cache=e}static getKey(t){return t}getter(t){let e=t?.shadowRoot?.querySelector(this.selector),s=Rs.get(t);s||(s=new Map,Rs.set(t,s)),s.set(this.selector,e)}mounted(t,e,s,...r){const n=this;let o=new WeakRef(t);Reflect.defineProperty(t,s,{configurable:!0,get(){let t=o.deref();return Rs.has(t)&&Rs.get(t)?.has(n.selector)&&n.cache===xs.ONCE||n.getter(t),Rs.get(t)?.get(n.selector)}})}beforeDestroy(t,e){Rs.get(t)?.clear(),Rs.delete(t)}updated(t,e){this.cache!==xs.ONCE&&this.getter(t)}}const Os=Ts(Ds),Ls=Ts(class extends Ds{getter(t){let e=t.shadowRoot?.querySelectorAll(this.selector),s=Rs.get(t);s||(s=new Map,Rs.set(t,s)),s.set(this.selector,e)}});function Is(t){if(1===arguments.length)return(e,s)=>{Vs(e,s,t)};Vs(arguments[0],arguments[1],{prop:""})}function Vs(t,e,s){if(!wt.has(t.constructor)){const e={};let s=t.constructor;for(;(s=Ft(s))!==We;)E(e,wt.get(s)??{});wt.set(t.constructor,e)}if(s.shallow=s.shallow||!1,N(wt.get(t.constructor),e,s),s.hasChanged){let r=Ot.get(t.constructor);r||(r=new Map,Ot.set(t.constructor,r)),r.set(e,s.hasChanged)}if(s.shallow){let s=Rt.get(t.constructor);s||(s=new Set,Rt.set(t.constructor,s)),s.add(e)}Reflect.defineProperty(t.constructor.prototype,e,{get(){return qt(void 0,e,this)},set(t){Qt(e,t,this)}})}function Ws(t,e,s){Vs(t.prototype,e,s||{prop:""})}function Hs(t){return e=>{e&&(vt[e.name]=t,yt[t]=e)}}const Us=Ts(class extends Ss{static get priority(){return Number.MAX_VALUE}created(t,e,...s){let r=u(t,e);N(t,e,M(r,this.wait)),N(t,e+"_$__",r)}beforeDestroy(t,e){N(t,e,null),N(t,e+"_$__",null)}get targets(){return[bs.METHOD]}wait;constructor(t){super(),this.wait=t}});function Bs(t,e){return(s,r)=>{let n=Pt.get(s.constructor),o=Mt.get(s.constructor),i=Tt.get(s.constructor),a=Ct.get(s.constructor),l=kt.get(s.constructor),c=At.get(s.constructor);if(!l){l=[],kt.set(s.constructor,l),a=[],Ct.set(s.constructor,a),i=new Map,Tt.set(s.constructor,i),n={},Pt.set(s.constructor,n),o={},Mt.set(s.constructor,o),c={},At.set(s.constructor,c);let t=Ft(s.constructor);for(;t;)kt.has(t)&&(l.push(...kt.get(t)),a.push(...Ct.get(t)),Tt.get(t)?.forEach(((t,e)=>{i.set(e,t)})),O(n,Pt.get(t)),O(o,Mt.get(t)),O(c,At.get(t))),t=Ft(t)}(f(t)?t:[t]).forEach((t=>{let h=s[r];u(e,"once",!1)&&i.set(t,!1);let d=u(e,"deep",!1);if(l.push(t),d?(n[t]=n[t]??new Set,n[t].add(h),a.push(t)):(o[t]=o[t]??new Set,o[t].add(h)),u(e,"immediate",!1)){let e=c[t];e||(e=c[t]=new Set),e.add(h)}}))}}const $s=["key"],js=qe((function(t){return(t,[e],s)=>{let r=t;if(s)w(e,((t,e)=>{r.setAttribute(e,t)}));else if(r instanceof We){let t={},s={},n=bt.get(r.constructor);w(e,((e,r)=>{if($s.includes(r))return;let o=U(r);(n?n[o]:void 0)?t[r]=e:s[r]=e+""})),r._initProps(t,s)}else w(e,((t,e)=>{r.setAttribute(e,t)}))}}),[Ue.TAG]),Fs=new WeakMap,zs=qe((function(t){return(t,[e],s,{renderComponent:n})=>{let o=[];if(f(e)?o=J(e):a(e)?o=R(e,((t,e)=>t?e:[])):r(e)&&(o=e.split(" ")),o.length<1&&!s)return;let i=t;if(Fs.get(i)&&Fs.get(i).length===o.length&&ct(Fs.get(i),o))return;let l=Fs.get(i);w(l,(t=>{i.classList.remove(t)})),w(o,(t=>{i.classList.add(t)})),l=h(o),Fs.set(i,l)}}),[Ue.CLASS]),Gs=new WeakMap,Xs=new WeakMap,Ks=qe((function(t,e){return(t,e,s,{varChain:r})=>{let n=t,o=function(t,e,s){let r=x(t,((t,s)=>e(t,s)));if(r.length<1){let t=new He([],[]);return Xs.set(s,t),t}let n=[],o=[];const i=[],a=[];for(let t=0;t<r.length;t++){const e=r[t];let s=q(o),l=e.vars,c=!0,u=e.strings;for(let t=0;t<u.length;t++){const e=u[t];if(ft.test(e)){let e=l[t]+"";if(n.includes(e))return void Ht(`forEach - duplicate key '${e}'`);n.push(e),c=!1}0==t&&s?o[o.length-1]=s+e:o.push(e)}if(c)return void Ht("forEach - missing 'key' prop");let h=q(i);h&&u.length>0&&(i[i.length-1]=j(h)+u.shift()),i.push(""),a.push(e)}i.push("");let l=new He(i,a);return Xs.set(s,l),l}(e[0],e[1],n);if(s&&s[0]){const s=Gs.get(n);let r=je.get(t),i=Xt.getNodes(r,t);if(V(i)&&(!e||V(e[0])))return[Be.NONE,o];if(s&&ct(s,e[0])&&s.length===e[0].length)return[Be.NONE,o]}return Gs.set(n,ut(e[0])),s?[Be.UPDATE,o]:[Be.APPEND,o]}}),[Ue.TEXT,Ue.SLOT]);let qs=document.createElement("div");const Qs=qe((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||H(e[0])||(qs.innerHTML=cs(e[0]),t.after(...qs.childNodes))}}),[Ue.TEXT,Ue.SLOT]),Zs=qe((function(t){return(t,e,s,{renderComponent:r,slotComponent:n})=>{s&&e[0]==s[0]||H(e[0])||(t.innerHTML=cs(e[0]))}}),[Ue.TAG]),Ys=new WeakMap,Js=qe((function(t,e,s){return(t,[e,s,r],n,{renderComponent:o})=>{let i=t;if(n){if(!!e==!!n[0]){let t=Ys.get(i);return[Be.NONE,t.call(o,e)]}let t=e?s:r;return Ys.set(i,t),[Be.REPLACE,t.call(o,e)]}{let t=e?s:r;return Ys.set(i,t),[Be.APPEND,t.call(o,e)]}}}),[Ue.TEXT,Ue.SLOT]),tr=qe((function(t,e){return(t,[e,s],r)=>r?e===r[0]?[Be.NONE,e?s():vs``]:e?[Be.REPLACE,e?s():vs``]:[Be.REMOVE]:[Be.APPEND,e?s():vs``]}),[Ue.TEXT,Ue.SLOT]);var er;!function(t){t.CHANGE="change",t.INPUT="input"}(er||(er={}));const sr=qe((function(t,s="value",n){return(t,[s,n,o],i,{varChain:l,renderComponent:c})=>{n=n??"value";const h=t;if(i){const t=i[0],e=s;let r=u(h,n);if(!a(e)&&Object.is(e,t)&&Object.is(r,e))return;if(h instanceof We)h._updateProps({[n]:e});else if(h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement){if(h.setAttribute(n,e+""),h instanceof HTMLSelectElement){let t=C(h.querySelectorAll("option"),(t=>t.value==e));t&&(t.selected=!0)}}else if(h instanceof HTMLInputElement){if(h.value==e)return;switch(h.type){case"checkbox":case"radio":e?h.setAttribute("checked",""):h.removeAttribute("checked");break;case"text":case"email":case"number":case"password":case"search":case"tel":case"url":h.setAttribute(n,e+""),N(h,n,e);break;default:h.setAttribute(n,e+"")}}return}let d;d=r(o)?e(o)[0]:q(l);const p=rt(d,".")[0];p in c||c._wrapperProp[p]||Ht(`model - property '${p}' is not defined on the instance of `+c.tagName);let f=c._eventBindList;if(a(s)||j(s)||(s=""),h instanceof We){h._initProps({[n]:s});let t="update:"+n;f.push([t,function(t){let e=this,s=e._wrapperProp[p];!(p in e)&&s&&u(e.wrapperComponent,p)===u(e,s)&&(e=e.wrapperComponent||e),N(e,d,t.value)},h])}else if(h instanceof HTMLTextAreaElement){h.setAttribute(n,s+"");let t="input";f.push([t,function(t){let e=t.target;N(this,d,e.value)},h])}else if(h instanceof HTMLInputElement){let t="",e="";switch(h.type){case"checkbox":case"radio":t="checked",e="change";break;default:t="value",e="input"}h.setAttribute(n??t,s+""),f.push([e,function(t){let e=t.target;N(this,d,e.value)},h])}else h instanceof HTMLSelectElement&&(h.setAttribute(n,s+""),f.push(["change",function(t){let e=t.target,s=this,r=s._wrapperProp[p];!(p in s)&&r&&u(s.wrapperComponent,p)===u(s,r)&&(s=s.wrapperComponent||s),N(s,d,e.value)},h]))}}),[Ue.TAG]),rr=new WeakMap,nr=qe((function(t,e){return(t,[e,s],r)=>{if(r&&e===r[0])return;let n=t;if(!rr.has(n)){let t=n.style.display;rr.set(n,"none"==t?"unset":t)}n.style.display=e?rr.get(n):"none",s&&s(n,e)}}),[Ue.TAG]),or=qe((function(t,e){return(t,[e,s],r,{renderComponent:n,slotComponent:o})=>{r||(e=e.bind(n),o._bindSlotHook(s||"default",e))}}),[Ue.SLOT]);class ir{static getCssText(t,e=!1){return r(t)?t:st(x(t,((t,s)=>s.startsWith("--")?s+":"+t+(e?" !important":""):b(s)+":"+t+(e?" !important":""))),";")+";"}static setStyle(t,e){if(r(t)&&!j(t))return;let s=ir.getCssText(t);e.style.cssText=s}}const ar=qe((function(...t){return(t,e,s,{renderComponent:r})=>{let n=t,o=Y(e,((t,e)=>t+ir.getCssText(e)),""),i=J(o.split(";").map((t=>t.split(":")[0]))),a=J(n.style.cssText.split(";")),l=Q(a,(t=>i.some((e=>t.trim().startsWith(e)))));n.style.cssText=o+l.join(";")}}),[Ue.STYLE]),lr=qe((function(t){return(t,e,s,{renderComponent:r,varChain:n,attrName:o})=>{const i=t;if(s)return void(nt(e,s)||i._updateProps({[o]:e[0]}));let a=q(n);i._initProps({[o]:e[0]}),i.addEventListener("update:"+o,(t=>{N(r,a,t.detail.value)}))}}),[Ue.PROP]),cr=qe((function(t,e){return(t,[e,s],r)=>{let n=()=>vs``,o=[],i=[];w(s,((t,e)=>{if(l(t))o.push(e),i.push(t);else{let e=t[0],s=t[1];o.push(e),i.push(s)}"default"===e&&(n=t)}));let a=ht(o,(t=>l(t)?t(e):t==e));return r?[Be.REPLACE,dt(i[a]??n)]:[Be.APPEND,dt(i[a]??n)]}}),[Ue.TEXT,Ue.SLOT]);function ur(){w(yt,((t,e)=>{customElements.define(e,t)}))}export{We as CompElem,ir as CssHelper,je as DI_COMMENT_START_NODE_MAP,Ss as Decorator,bs as DecoratorType,Ns as DecoratorWrapper,Be as DirectiveUpdateTag,Xt as DomUtil,Ue as EnterPointType,er as ModelTriggerType,xs as QueryCache,He as Template,Fe as TextOrSlotDirectiveExecutorMap,$e as UpdatePoint,pe as _getObservedAttrs,Ft as _getSuper,jt as _toUpdatePath,js as bind,ls as buildHTML,zs as classes,ks as computed,ws as createRef,Ms as debounced,Ts as decorator,Cs as decoratorWithNoArgs,qe as directive,Ps as event,Ks as forEach,Gt as getBooleanValue,Kt as getSlotComponent,vs as html,Qs as htmlC,Zs as htmlD,Js as ifElse,tr as ifTrue,zt as isBooleanProp,Ws as makeState,sr as model,As as onced,ue as prop,Os as query,Ls as queryAll,ur as regComponents,nr as show,Ht as showError,Ut as showTagError,$t as showTagWarn,Bt as showWarn,or as slot,Is as state,ar as styles,lr as sync,Hs as tag,Us as throttled,Xe as updateDirective,Bs as watch,cr as when};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compelem",
3
- "version": "0.20.2",
3
+ "version": "0.21.1",
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",
package/types.d.ts CHANGED
@@ -81,6 +81,10 @@ export type StateOption = {
81
81
  * 属性定义
82
82
  */
83
83
  export type PropOption = {
84
+ /**
85
+ * 是否浅层监控,默认false。如果属性值是由上级组件传递的state且已经指定shallow,则忽略该属性
86
+ */
87
+ shallow?: boolean;
84
88
  /**
85
89
  * 参数类型
86
90
  */