essor 0.0.15-beta.6 → 0.0.15-beta.7
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/dist/essor.cjs.js +15 -9
- package/dist/essor.cjs.js.map +1 -1
- package/dist/essor.d.cts +1 -1
- package/dist/essor.d.ts +1 -1
- package/dist/essor.dev.cjs.js +61 -36
- package/dist/essor.dev.cjs.js.map +1 -1
- package/dist/essor.dev.esm.js +61 -36
- package/dist/essor.dev.esm.js.map +1 -1
- package/dist/essor.esm.js +15 -9
- package/dist/essor.esm.js.map +1 -1
- package/package.json +4 -4
package/dist/essor.cjs.js
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
'use strict';/**
|
|
2
|
-
* essor v0.0.15-beta.
|
|
3
|
-
* build time
|
|
2
|
+
* essor v0.0.15-beta.7
|
|
3
|
+
* build time 2026-01-05T05:59:39.530Z
|
|
4
4
|
* (c) 2023-Present jiangxd <jiangxd2016@gmail.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
**/
|
|
7
|
-
var Ye="0.0.15-beta.6";var d=e=>e!==null&&typeof e=="object";function he(e){return Z.call(e)==="[object Promise]"}var P=Array.isArray;function v(e){return typeof e=="string"}function xe(e){return typeof e=="number"}function ir(e){return e===null}function Te(e){return typeof e=="symbol"}function de(e){return Z.call(e)==="[object Set]"}function Ge(e){return Z.call(e)==="[object WeakMap]"}function Xe(e){return Z.call(e)==="[object WeakSet]"}function pe(e){return Z.call(e)==="[object Map]"}function Je(e){return e==null}var b=e=>typeof e=="function";function me(e){return e===false||e===null||e===void 0}var re=e=>["string","number","boolean","symbol","undefined"].includes(typeof e)||ir(e);function ne(e){return e instanceof HTMLElement}var Ze=e=>Z.call(e)==="[object Object]";function Le(e){return !v(e)||e===""?false:!Number.isNaN(Number(e))}function Qe(e){return typeof e=="undefined"}var Z=Object.prototype.toString,or=Object.prototype.hasOwnProperty;var ie=(e,t)=>or.call(e,t);function Ce(e){return P(e)?e:[e]}var R=(e,t)=>!Object.is(e,t);function et(e,t){return v(e)?e.indexOf(t)===0:false}var Pe=e=>{let t=Object.create(null);return(r=>t[r]||(t[r]=e(r)))};var sr=/\B([A-Z])/g,tt=Pe(e=>e.replaceAll(sr,"-$1").toLowerCase()),ar=/[_-](\w)/g,Me=Pe(e=>(e=e.replaceAll(/^[_-]+|[_-]+$/g,""),e=e.replaceAll(/[_-]+/g,"-"),e.replaceAll(ar,(t,r)=>r.toUpperCase()))),rt=Pe(e=>e.charAt(0).toUpperCase()+e.slice(1));function m(e,...t){console.warn(`[Essor warn]: ${e}`,...t);}function Ie(e,...t){console.info(`[Essor info]: ${e}`,...t);}function p(e,...t){console.error(`[Essor error]: ${e}`,...t);}var cr=/["&'<>]/;function lr(e){let t=`${e}`,r=cr.exec(t);if(!r)return t;let n="",i,o,s=0;for(o=r.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=""";break;case 38:i="&";break;case 39:i="'";break;case 60:i="<";break;case 62:i=">";break;default:continue}s!==o&&(n+=t.slice(s,o)),s=o+1,n+=i;}return s!==o?n+t.slice(s,o):n}function j(e){let t=Object.create(null);for(let r of e.split(","))t[r]=1;return r=>r in t}var nt="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",it=j(nt),ot=j(`${nt},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);function st(e){return !!e||e===""}j("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");j("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");var ur="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",fr="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",hr="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",dr="beforeinput,click,dblclick,contextmenu,focusin,focusout,input,keydown,keyup,mousedown,mousemove,mouseout,mouseover,mouseup,pointerdown,pointermove,pointerout,pointerover,pointerup,touchend,touchmove,touchstart",pr="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",mr="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";j(ur);j(fr);j(hr);j(pr);j(mr);j(dr);var gr=Object.defineProperty,vr=Object.defineProperties,br=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,yr=Object.prototype.hasOwnProperty,Sr=Object.prototype.propertyIsEnumerable,ct=(e,t,r)=>t in e?gr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,Re=(e,t)=>{for(var r in t||(t={}))yr.call(t,r)&&ct(e,r,t[r]);if(at)for(var r of at(t))Sr.call(t,r)&&ct(e,r,t[r]);return e},Er=(e,t)=>vr(e,br(t)),T={SET:"SET",ADD:"ADD",DELETE:"DELETE",CLEAR:"CLEAR"},lt=Symbol("Signal_Key"),be=Symbol("Array_Key"),L=Symbol("Collection_Key"),oe=Symbol("WeakCollection_Key"),W=Symbol("Array_Iterate_Key");function Et(e){let t=e.nextSubLink,r;e:do{let n=e.subNode,i=n.flag&64,o=n.flag&2,s=n.flag&-65;if(s&60?s&48||(s&12?s&4?!(s&48)&&wr(e,n)?(n.flag=i|o|(s|8|32),s&=1):(s=0,n.flag=i|o):n.flag=i|o|(s&-9|32):(s=0,n.flag=i|o)):n.flag=i|o|s|32,n.flag&2&&_t(n),s&1){let a=n.subLink;if(a){let c=(e=a).nextSubLink;c&&(r={value:t,prev:r},t=c);continue}}if(t){e=t,t=e.nextSubLink;continue}for(;r;)if(e=r.value,r=r.prev,e){t=e.nextSubLink;continue e}break}while(true)}function wt(e){for(;e;){let t=e.subNode,r=t.flag&64,n=t.flag&-65;if(!(n&16)&&n&33){let i=r|n&-33|16;t.flag=i,i&2&&_t(t),n&1&&t.subLink&&wt(t.subLink);}e=e.nextSubLink;}}function _t(e){e.active&&e.notify();}var ge=0,M,ae=false;function kt(e,t){if(ae)return;let r=t.depLinkTail;if(r&&r.depNode===e)return r;let n=r?r.nextDepLink:t.depLink;if(n&&n.depNode===e)return n.version=ge,t.depLinkTail=n,n;let i=e.subLinkTail;if(i&&i.version===ge&&i.subNode===t)return t.depLinkTail=i,i;let o={version:ge,depNode:e,subNode:t,prevSubLink:i,nextSubLink:void 0,prevDepLink:r,nextDepLink:n};return n&&(n.prevDepLink=o),r?r.nextDepLink=o:t.depLink=o,i?i.nextSubLink=o:e.subLink=o,e.subLinkTail=o,t.depLinkTail=o,t.onTrack&&b(t==null?void 0:t.onTrack)&&t.onTrack({effect:t,target:e,type:"get",key:void 0}),o}function ye(e,t=e.subNode){let r=e.depNode,n=e.prevSubLink,i=e.nextSubLink,o=e.prevDepLink,s=e.nextDepLink;if(s?s.prevDepLink=o:t.depLinkTail=o,o?o.nextDepLink=s:t.depLink=s,i?i.prevSubLink=n:r.subLinkTail=n,n)n.nextSubLink=i;else if(r.subLink=i,i===void 0){let a=r.depLink;for(;a;)a=ye(a,r);r.depLinkTail=void 0,r.flag|=16,r.depLink&&p("[Link] Cascading cleanup failed: depNode still has dependency links. This indicates a bug in the unlinking logic.");}return e.depNode=void 0,e.subNode=void 0,e.prevSubLink=void 0,e.nextSubLink=void 0,e.prevDepLink=void 0,e.nextDepLink=void 0,s}function At(e,t){let r=[{link:e,owner:t}],n=[];for(;r.length>0;){let i=r.pop(),o=i.link,s=i.owner;for(;o;){let a=o.depNode,c=a.flag;if(s.flag&16)return true;if((c&17)===17){let l=a.subLink;l&&l.nextSubLink&&$e(l);for(let u of n)u.flag&32&&(u.flag=u.flag&-33|16);return true}(c&33)===33?a.depLink?(n.push(a),r.push({link:a.depLink,owner:a})):a.flag&=-33:c&32&&(a.flag&=-33),o=o.nextDepLink;}}for(let i of n)i.flag&=-33;return t.flag&32&&(t.flag&=-33),false}function $e(e){for(;e;){let t=e.subNode,r=t.flag&64,n=t.flag&-65;(n&48)===32&&(t.flag=r|n|16),e=e.nextSubLink;}}function Oe(e){let t=M;return M=e,t}function xt(e){return ge++,e.depLinkTail=void 0,e.flag=e.flag&-57|4,Oe(e)}function Tt(e,t){M=t;let r=e.depLinkTail,n=r?r.nextDepLink:e.depLink;for(;n;)n=ye(n,e);e.flag&=-5;}function Qn(e){let t=Oe(void 0),r=ae;ae=true;try{return e()}finally{ae=r,Oe(t);}}function wr(e,t){let r=t.depLinkTail;for(;r;){if(r===e)return true;r=r.prevDepLink;}return false}var Ne=new WeakMap;function g(e,t){if(!M||ae)return;let r=Ne.get(e);r||(r=new Map,Ne.set(e,r));let n=r.get(t);n||(n=new Set,r.set(t,n)),n.has(M)||(n.add(M),b(M.onTrack)&&M.onTrack({effect:M,target:e,type:"get",key:t}));}function k(e,t,r,n){let i=Ne.get(e);if(!i)return;let o=new Set;if(r!==void 0)if(Array.isArray(r))r.forEach(s=>{let a=i.get(s);a&&a.forEach(c=>o.add(c));});else {let s=i.get(r);s&&s.forEach(a=>o.add(a));}if(t==="ADD"||t==="DELETE"||t==="CLEAR"){let s=Symbol("iterate"),a=Symbol("arrayIterate"),c=Array.isArray(e)?a:s,l=i.get(c);l&&l.forEach(u=>o.add(u));}o.forEach(s=>{var a;b(s.onTrigger)&&s.onTrigger({effect:s,target:e,type:t,key:r,newValue:n}),s.flag&2?(a=s.notify)==null||a.call(s):s.flag&1&&(s.flag|=16,s.subLink&&Et(s.subLink));});}var ut=new WeakMap;function h(e){if(!e||!d(e))return e;let t=e._RAW;return t?h(t):E(e)?h(e.peek()):e}var ft=_r();function _r(){let e={};return ["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...r){let n=h(this);g(n,W);let i=n[t](...r);if((i===-1||i===false)&&r.length>0){let o=r.map(s=>h(s));i=n[t](...o);}return i};}),["find","findIndex","findLast","findLastIndex"].forEach(t=>{e[t]=function(...r){let n=h(this),i=O(this);g(n,W);let o=n[t](...r);return (t==="find"||t==="findLast")&&d(o)&&!i?w(o):o};}),["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].forEach(t=>{e[t]=function(...r){let n=h(this),i=Array.prototype[t].apply(n,r);return k(n,T.SET,be),k(n,T.SET,W),i};}),["toReversed","toSorted","toSpliced"].forEach(t=>{e[t]=function(...r){let n=h(this),i=O(this);if(g(n,W),t==="toSpliced")for(let s=0,a=n.length;s<a;s++)g(n,`${s}`);let o=Array.prototype[t].apply(n,r);return Array.isArray(o)?o.map(s=>d(s)?w(s,i):s):o};}),["concat","slice","filter","map","flatMap","flat"].forEach(t=>{e[t]=function(...r){let n=h(this);return g(n,W),Array.prototype[t].apply(n,r)};}),["join","toString","toLocaleString"].forEach(t=>{e[t]=function(...r){let n=h(this);return g(n,W),Array.prototype[t].apply(n,r)};}),["values","keys","entries",Symbol.iterator].forEach(t=>{e[t]=function(){let r=h(this),n=O(this);g(r,be);let i=t===Symbol.iterator?r[Symbol.iterator]():r[t]();return {next(){let{value:o,done:s}=i.next();return s?{value:o,done:s}:Array.isArray(o)?{value:o.map(a=>d(a)?w(a,n):a),done:s}:{value:d(o)?w(o,n):o,done:s}},[Symbol.iterator](){return this}}};}),e}var Lt=e=>({get:(t,r,n)=>{if(r==="_RAW")return t;if(r==="_IS_REACTIVE")return true;if(r==="_IS_SHALLOW")return e;if(ie(ft,r))return ft[r];let i=Reflect.get(t,r,n);return Le(r)&&g(t,r),g(t,be),d(i)&&!e?w(i):i},set:(t,r,n,i)=>{let o=Reflect.get(t,r,i),s=Reflect.set(t,r,n,i);return R(n,o)&&(Le(r)?k(t,T.SET,[r,W,be]):k(t,T.SET,r)),s}}),kr=Lt(true),Ar=Lt(false),xr={get(e,t){return t==="_IS_REACTIVE"?true:t==="_RAW"?e:Reflect.get(ie(ht,t)?ht:e,t,e)}},Tr={get(e,t){return t==="_IS_REACTIVE"?true:t==="_RAW"?e:Reflect.get(ie(dt,t)&&t in e?dt:e,t,e)}},ht={get(e){let t=h(this);g(t,L);let r=t.get(e);return d(r)&&!O(this)?w(r):r},set(e,t){let r=h(this),n=r.has(e),i=r.get(e),o=h(t);return r.set(e,o),(!n||R(i,o))&&k(r,T.SET,L),this},add(e){let t=h(this),r=h(e),n=t.has(r);return t.add(r),n?k(t,T.SET,L):k(t,T.ADD,L),this},has(e){let t=h(this);g(t,L);let r=t.has(e);return !r&&d(e)?t.has(h(e)):r},delete(e){let t=h(this),r=t.has(e),n=t.delete(e);return !n&&d(e)&&(n=t.delete(h(e))),(r||n)&&k(t,T.DELETE,L),n},clear(){let e=h(this),t=e.size>0,r=e.clear();return t&&k(e,T.CLEAR,L),r},forEach(e,t){let r=h(this),n=O(this);g(r,L),r.forEach((i,o)=>{let s=n||!d(i)?i:w(i),a=n||!d(o)?o:w(o);e.call(t,s,a,this);});},[Symbol.iterator](){let e=h(this),t=O(this);g(e,L);let r=e[Symbol.iterator]();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:t?{value:n,done:i}:Array.isArray(n)?{value:n.map(o=>d(o)?w(o):o),done:i}:{value:d(n)?w(n):n,done:i}},[Symbol.iterator](){return this}}},get size(){let e=h(this);return g(e,L),e.size},keys(){let e=h(this),t=O(this);g(e,L);let r=e.keys();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:{value:t||!d(n)?n:w(n),done:i}},[Symbol.iterator](){return this}}},values(){let e=h(this),t=O(this);g(e,L);let r=e.values();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:{value:t||!d(n)?n:w(n),done:i}},[Symbol.iterator](){return this}}},entries(){let e=h(this),t=O(this);g(e,L);let r=e.entries();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:t?{value:n,done:i}:{value:n.map(o=>d(o)?w(o):o),done:i}},[Symbol.iterator](){return this}}}},dt={get(e){let t=h(this);g(t,oe);let r=t.get(e);return r===void 0&&V(e)&&(r=t.get(h(e))),d(r)&&!O(this)?w(r):r},set(e,t){let r=h(this),n=h(e),i=r.has(n),o=r.get(n),s=h(t);return r.set(n,s),(!i||R(o,s))&&k(r,T.SET,oe),this},add(e){let t=h(this),r=h(e),n=t.has(r);return t.add(r),n||k(t,T.ADD,oe),this},has(e){let t=h(this);g(t,oe);let r=t.has(e);return !r&&V(e)&&(r=t.has(h(e))),r},delete(e){let t=h(this),r=h(e),n=t.has(r),i=t.delete(r);return (n||i)&&k(t,T.DELETE,oe),i}},Lr=e=>({get(t,r,n){if(r==="_RAW")return t;if(r==="_IS_REACTIVE")return true;if(r==="_IS_SHALLOW")return e;let i=Reflect.get(t,r,n),o=E(i)?i.value:i;return g(t,r),d(o)&&!e?w(o):o},set:(t,r,n,i)=>{let o=Reflect.get(t,r,i),s=Reflect.set(t,r,h(n),i);return R(n,o)&&k(t,T.SET,r,n),s},deleteProperty:(t,r)=>{let n=ie(t,r),i=Reflect.deleteProperty(t,r);return n&&i&&k(t,T.DELETE,r,void 0),i}});function w(e,t=false){if(!d(e)||V(e))return e;let r=ut.get(e);if(r)return r;let n;P(e)?n=t?kr:Ar:de(e)||pe(e)?n=xr:Ge(e)||Xe(e)?n=Tr:n=Lr(t);let i=new Proxy(e,n);return ut.set(e,i),i}function V(e){return !!(e&&e._IS_REACTIVE)}function Se(e){return V(e)?(m("[Reactive] Target is already reactive. Returning existing reactive proxy to avoid double wrapping."),e):E(e)?(m("[Reactive] Creating a reactive proxy from a signal is not recommended. Use the signal directly or access its value property."),e):w(e)}function Ee(e){return V(e)?(O(e)?m("[ShallowReactive] Target is already a shallow reactive proxy. Returning existing proxy to avoid double wrapping."):m("[ShallowReactive] Target is already a deep reactive proxy. Cannot convert deep reactive to shallow reactive. Returning existing proxy."),e):E(e)?(m("[ShallowReactive] Creating a reactive proxy from a signal is not recommended. Use the signal directly or access its value property."),e):w(e,true)}function O(e){return !!(e&&e._IS_SHALLOW)}var ei=e=>d(e)?Se(e):e,Ct;Ct="_IS_SIGNAL";var Ke=class{constructor(e,t=false){this.flag=1,this[Ct]=true,this._oldValue=this._rawValue=e,t?this._value=d(e)?Ee(e):e:this._value=d(e)?Se(e):e,this._IS_SHALLOW=t;}get dep(){return this}get value(){let e=M;if(e&&kt(this,e),this.flag&16&&this.shouldUpdate()){let t=this.subLink;t&&$e(t);}return this._value}set value(e){if(E(e)&&(m("Setting a signal value to another signal is not recommended. The value will be unwrapped automatically."),e=e.peek()),e=h(e),!R(this._rawValue,e))return;this.flag|=16,this._rawValue=e,this._IS_SHALLOW?this._value=d(e)?Ee(e):e:this._value=d(e)?Se(e):e;let r=this.subLink;r&&Et(r);}shouldUpdate(){return this.flag&=-17,R(this._oldValue,this._oldValue=this._rawValue)}peek(){return this._value}set(e){this.value=e;}update(e){let t=e(this.peek());E(t)?(m("Returning a signal from an update function is not recommended. The value will be unwrapped."),this.value=t.peek()):this.value=t;}};function ce(e){return E(e)?(m("Creating a signal with another signal is not recommended. The value will be unwrapped."),e):new Ke(e)}function ti(e){return E(e)&&(m("Creating a shallow signal with another signal is not recommended. The value will be unwrapped."),e=e.peek()),new Ke(e,true)}function E(e){return !!e&&!!e._IS_SIGNAL}var ve=new Set,De=new Set,Cr=Promise.resolve(),je=false;function Pr(e){return e?new Promise((t,r)=>{queueMicrotask(()=>{try{e(),t();}catch(n){r(n);}});}):Cr}function we(e){ve.add(e),Pt();}function Pt(){je||(je=true,Pr(Mt));}function Mr(e){De.add(e),Pt();}function Mt(){for(je=false,Ir();ve.size>0;){let e=Array.from(ve);ve.clear();for(let t of e)try{t();}catch(r){p("Error executing queued job:",r);}}}function Ir(){let e=Array.from(De);De.clear();for(let t of e)try{t();}catch(r){p("Error executing pre-flush callback:",r);}}function Rr(e,t){switch(t){case "sync":return ()=>e();case "pre":return ()=>Mr(e);case "post":return ()=>we(e);default:return m(`Invalid flush timing: ${t}. Defaulting to 'post'.`),()=>we(e)}}var B=0;function pt(e){Or();try{return e()}finally{Nr();}}function Or(){B++;}function Nr(){if(B===0){m("[Batch] endBatch() called without matching startBatch(). This may indicate unbalanced batch calls in your code.");return}--B===0&&(Mt(),B!==0&&p(`[Batch] Batch depth is not zero after endBatch(). Current depth: ${B}. This indicates a bug in batch management.`));}function Dr(){return B>0}function ri(){return B}var It;It="_IS_EFFECT";var jr=class{constructor(e,t){this.flag=18,this[It]=true,this._active=true,this.fn=e,t&&(this.scheduler=t.flush||t.scheduler,this.onStop=t.onStop,this.onTrack=t.onTrack,this.onTrigger=t.onTrigger);}get active(){return this._active}get dirty(){let e=this.flag;if(e&16)return true;if(e&32){if(this.depLink&&At(this.depLink,this))return this.flag=e&-33|16,true;this.flag=e&-33;}return false}pause(){this.flag|=256;}resume(){let t=this.flag&-257;this.flag=t;let r=(t&16)!==0,n=(t&32)!==0;(r||n)&&this.notify();}run(){if(!this._active)return this.fn();let e=this.flag;this.flag=e&-17|1024;let t=xt(this);try{return this.fn()}catch(r){throw this.flag|=16,r}finally{this.flag&=-1025,Tt(this,t);}}getJob(){return this._job||(this._job=()=>this.run()),this._job}notify(){let e=this.flag;!this._active||e&1296||(this.flag=e|16,this.onTrigger&&this.onTrigger({effect:this,target:{},type:"set"}),this.scheduler?b(this.scheduler)?this.scheduler(this):Rr(()=>this.run(),this.scheduler)():Dr()?we(this.getJob()):this.run());}stop(){if(!this._active){m("[Effect] Attempting to stop an already stopped effect.");return}this._active=false;let e=this.depLink;for(;e;)e=ye(e,this);let t=this.subLink;for(;t;)t=ye(t);this._job=void 0,this.depLinkTail=void 0,this.subLinkTail=void 0,this.depLink&&p("[Effect] Cleanup verification failed: depLink not cleared. This indicates a memory leak in the dependency tracking system."),this.subLink&&p("[Effect] Cleanup verification failed: subLink not cleared. This indicates a memory leak in the subscription system."),this.onStop&&this.onStop();}};function _e(e,t){let r=new jr(e,t);try{r.run();}catch(i){throw r.stop(),p("[Effect] Effect failed during initial execution and has been stopped. Fix the error in your effect function.",i),i}let n=()=>r.run();return n.effect=r,n.stop=()=>r.stop(),n}function ni(e){e.effect.stop();}function ii(e){return !!(e&&e._IS_EFFECT)}function oi(e,t,r){let n=t;return _e(()=>{n=e(n);},r)}var se=Symbol("computed-no-value"),Rt;Rt="_IS_COMPUTED";var mt=class{constructor(e,t,r,n){this.flag=17,this[Rt]=true,this._value=se,this.getter=e,this.setter=t,this.onTrack=r,this.onTrigger=n,this.flag|=16;}get value(){M&&kt(this,M);let e=this.flag,t=this._value!==se;return t&&!(e&48)?this._value:!t||e&16?(this.recompute(),this._value):(e&32&&(this.depLink&&At(this.depLink,this)?this.recompute():this.flag=e&-33),this._value)}set value(e){this.setter?this.setter(e):m(`[Computed] Cannot set readonly computed value. Provide a setter in the computed options to make it writable.
|
|
8
|
-
Example: computed({ get: () => value, set: (v) => { ... } })`);}peek(){return this._value===se&&this.recompute(),this._value}recompute(){let e=this._value,t=e!==se,r=xt(this);try{let n=this.getter(),i=this.flag,o=-49;!t||R(e,n)?(this._value=n,this.flag=i&
|
|
9
|
-
|
|
7
|
+
var Ye="0.0.15-beta.7";var d=e=>e!==null&&typeof e=="object";function he(e){return Z.call(e)==="[object Promise]"}var P=Array.isArray;function b(e){return typeof e=="string"}function xe(e){return typeof e=="number"}function ir(e){return e===null}function Te(e){return typeof e=="symbol"}function de(e){return Z.call(e)==="[object Set]"}function Ge(e){return Z.call(e)==="[object WeakMap]"}function Xe(e){return Z.call(e)==="[object WeakSet]"}function pe(e){return Z.call(e)==="[object Map]"}function Je(e){return e==null}var S=e=>typeof e=="function";function me(e){return e===false||e===null||e===void 0}var re=e=>["string","number","boolean","symbol","undefined"].includes(typeof e)||ir(e);function ne(e){return e instanceof HTMLElement}var Ze=e=>Z.call(e)==="[object Object]";function Le(e){return !b(e)||e===""?false:!Number.isNaN(Number(e))}function Qe(e){return typeof e=="undefined"}var Z=Object.prototype.toString,or=Object.prototype.hasOwnProperty;var ie=(e,t)=>or.call(e,t);function Ce(e){return P(e)?e:[e]}var R=(e,t)=>!Object.is(e,t);function et(e,t){return b(e)?e.indexOf(t)===0:false}var Pe=e=>{let t=Object.create(null);return(r=>t[r]||(t[r]=e(r)))};var sr=/\B([A-Z])/g,tt=Pe(e=>e.replaceAll(sr,"-$1").toLowerCase()),ar=/[_-](\w)/g,Me=Pe(e=>(e=e.replaceAll(/^[_-]+|[_-]+$/g,""),e=e.replaceAll(/[_-]+/g,"-"),e.replaceAll(ar,(t,r)=>r.toUpperCase()))),rt=Pe(e=>e.charAt(0).toUpperCase()+e.slice(1));function g(e,...t){console.warn(`[Essor warn]: ${e}`,...t);}function Ie(e,...t){console.info(`[Essor info]: ${e}`,...t);}function p(e,...t){console.error(`[Essor error]: ${e}`,...t);}var cr=/["&'<>]/;function lr(e){let t=`${e}`,r=cr.exec(t);if(!r)return t;let n="",i,o,s=0;for(o=r.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=""";break;case 38:i="&";break;case 39:i="'";break;case 60:i="<";break;case 62:i=">";break;default:continue}s!==o&&(n+=t.slice(s,o)),s=o+1,n+=i;}return s!==o?n+t.slice(s,o):n}function $(e){let t=Object.create(null);for(let r of e.split(","))t[r]=1;return r=>r in t}var nt="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",it=$(nt),ot=$(`${nt},async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);function st(e){return !!e||e===""}$("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");$("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");var ur="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",fr="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",hr="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",dr="beforeinput,click,dblclick,contextmenu,focusin,focusout,input,keydown,keyup,mousedown,mousemove,mouseout,mouseover,mouseup,pointerdown,pointermove,pointerout,pointerover,pointerup,touchend,touchmove,touchstart",pr="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",mr="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";$(ur);$(fr);$(hr);$(pr);$(mr);$(dr);var gr=Object.defineProperty,vr=Object.defineProperties,br=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,yr=Object.prototype.hasOwnProperty,Sr=Object.prototype.propertyIsEnumerable,ct=(e,t,r)=>t in e?gr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,Re=(e,t)=>{for(var r in t||(t={}))yr.call(t,r)&&ct(e,r,t[r]);if(at)for(var r of at(t))Sr.call(t,r)&&ct(e,r,t[r]);return e},wr=(e,t)=>vr(e,br(t)),L={SET:"SET",ADD:"ADD",DELETE:"DELETE",CLEAR:"CLEAR"},lt=Symbol("Signal_Key"),be=Symbol("Array_Key"),C=Symbol("Collection_Key"),oe=Symbol("WeakCollection_Key"),B=Symbol("Array_Iterate_Key");function wt(e){let t=e.nextSubLink,r;e:do{let n=e.subNode,i=n.flag&64,o=n.flag&2,s=n.flag&-65;if(s&60?s&48||(s&12?s&4?!(s&48)&&Er(e,n)?(n.flag=i|o|(s|8|32),s&=1):(s=0,n.flag=i|o):n.flag=i|o|(s&-9|32):(s=0,n.flag=i|o)):n.flag=i|o|s|32,n.flag&2&&_t(n),s&1){let a=n.subLink;if(a){let c=(e=a).nextSubLink;c&&(r={value:t,prev:r},t=c);continue}}if(t){e=t,t=e.nextSubLink;continue}for(;r;)if(e=r.value,r=r.prev,e){t=e.nextSubLink;continue e}break}while(true)}function Et(e){for(;e;){let t=e.subNode,r=t.flag&64,n=t.flag&-65;if(!(n&16)&&n&33){let i=r|n&-33|16;t.flag=i,i&2&&_t(t),n&1&&t.subLink&&Et(t.subLink);}e=e.nextSubLink;}}function _t(e){e.active&&e.notify();}var ge=0,M,ae=false;function kt(e,t){if(ae)return;let r=t.depLinkTail;if(r&&r.depNode===e)return r;let n=r?r.nextDepLink:t.depLink;if(n&&n.depNode===e)return n.version=ge,t.depLinkTail=n,n;let i=e.subLinkTail;if(i&&i.version===ge&&i.subNode===t)return t.depLinkTail=i,i;let o={version:ge,depNode:e,subNode:t,prevSubLink:i,nextSubLink:void 0,prevDepLink:r,nextDepLink:n};return n&&(n.prevDepLink=o),r?r.nextDepLink=o:t.depLink=o,i?i.nextSubLink=o:e.subLink=o,e.subLinkTail=o,t.depLinkTail=o,t.onTrack&&S(t==null?void 0:t.onTrack)&&t.onTrack({effect:t,target:e,type:"get",key:void 0}),o}function ye(e,t=e.subNode){let r=e.depNode,n=e.prevSubLink,i=e.nextSubLink,o=e.prevDepLink,s=e.nextDepLink;if(s?s.prevDepLink=o:t.depLinkTail=o,o?o.nextDepLink=s:t.depLink=s,i?i.prevSubLink=n:r.subLinkTail=n,n)n.nextSubLink=i;else if(r.subLink=i,i===void 0){let a=r.depLink;for(;a;)a=ye(a,r);r.depLinkTail=void 0,r.flag|=16,r.depLink&&p("[Link] Cascading cleanup failed: depNode still has dependency links. This indicates a bug in the unlinking logic.");}return e.depNode=void 0,e.subNode=void 0,e.prevSubLink=void 0,e.nextSubLink=void 0,e.prevDepLink=void 0,e.nextDepLink=void 0,s}function At(e,t){let r=[{link:e,owner:t}],n=[];for(;r.length>0;){let i=r.pop(),o=i.link,s=i.owner;for(;o;){let a=o.depNode,c=a.flag;if(s.flag&16)return true;if((c&17)===17){let l=a.subLink;l&&l.nextSubLink&&$e(l);for(let f of n)f.flag&32&&(f.flag=f.flag&-33|16);return true}(c&33)===33?a.depLink?(n.push(a),r.push({link:a.depLink,owner:a})):a.flag&=-33:c&32&&(a.flag&=-33),o=o.nextDepLink;}}for(let i of n)i.flag&=-33;return t.flag&32&&(t.flag&=-33),false}function $e(e){for(;e;){let t=e.subNode,r=t.flag&64,n=t.flag&-65;(n&48)===32&&(t.flag=r|n|16),e=e.nextSubLink;}}function Oe(e){let t=M;return M=e,t}function xt(e){return ge++,e.depLinkTail=void 0,e.flag=e.flag&-57|4,Oe(e)}function Tt(e,t){M=t;let r=e.depLinkTail,n=r?r.nextDepLink:e.depLink;for(;n;)n=ye(n,e);e.flag&=-5;}function Qn(e){let t=Oe(void 0),r=ae;ae=true;try{return e()}finally{ae=r,Oe(t);}}function Er(e,t){let r=t.depLinkTail;for(;r;){if(r===e)return true;r=r.prevDepLink;}return false}var Ne=new WeakMap;function v(e,t){if(!M||ae)return;let r=Ne.get(e);r||(r=new Map,Ne.set(e,r));let n=r.get(t);n||(n=new Set,r.set(t,n)),n.has(M)||(n.add(M),S(M.onTrack)&&M.onTrack({effect:M,target:e,type:"get",key:t}));}function A(e,t,r,n){let i=Ne.get(e);if(!i)return;let o=new Set;if(r!==void 0)if(Array.isArray(r))r.forEach(s=>{let a=i.get(s);a&&a.forEach(c=>o.add(c));});else {let s=i.get(r);s&&s.forEach(a=>o.add(a));}if(t==="ADD"||t==="DELETE"||t==="CLEAR"){let s=Symbol("iterate"),a=Symbol("arrayIterate"),c=Array.isArray(e)?a:s,l=i.get(c);l&&l.forEach(f=>o.add(f));}o.forEach(s=>{var a;S(s.onTrigger)&&s.onTrigger({effect:s,target:e,type:t,key:r,newValue:n}),s.flag&2?(a=s.notify)==null||a.call(s):s.flag&1&&(s.flag|=16,s.subLink&&wt(s.subLink));});}var ut=new WeakMap;function h(e){if(!e||!d(e))return e;let t=e._RAW;return t?h(t):w(e)?h(e.peek()):e}var ft=_r();function _r(){let e={};return ["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...r){let n=h(this);v(n,B);let i=n[t](...r);if((i===-1||i===false)&&r.length>0){let o=r.map(s=>h(s));i=n[t](...o);}return i};}),["find","findIndex","findLast","findLastIndex"].forEach(t=>{e[t]=function(...r){let n=h(this),i=O(this);v(n,B);let o=n[t](...r);return (t==="find"||t==="findLast")&&d(o)&&!i?E(o):o};}),["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].forEach(t=>{e[t]=function(...r){let n=h(this),i=Array.prototype[t].apply(n,r);return A(n,L.SET,be),A(n,L.SET,B),i};}),["toReversed","toSorted","toSpliced"].forEach(t=>{e[t]=function(...r){let n=h(this),i=O(this);if(v(n,B),t==="toSpliced")for(let s=0,a=n.length;s<a;s++)v(n,`${s}`);let o=Array.prototype[t].apply(n,r);return Array.isArray(o)?o.map(s=>d(s)?E(s,i):s):o};}),["concat","slice","filter","map","flatMap","flat"].forEach(t=>{e[t]=function(...r){let n=h(this);return v(n,B),Array.prototype[t].apply(n,r)};}),["join","toString","toLocaleString"].forEach(t=>{e[t]=function(...r){let n=h(this);return v(n,B),Array.prototype[t].apply(n,r)};}),["values","keys","entries",Symbol.iterator].forEach(t=>{e[t]=function(){let r=h(this),n=O(this);v(r,be);let i=t===Symbol.iterator?r[Symbol.iterator]():r[t]();return {next(){let{value:o,done:s}=i.next();return s?{value:o,done:s}:Array.isArray(o)?{value:o.map(a=>d(a)?E(a,n):a),done:s}:{value:d(o)?E(o,n):o,done:s}},[Symbol.iterator](){return this}}};}),e}var Lt=e=>({get:(t,r,n)=>{if(r==="_RAW")return t;if(r==="_IS_REACTIVE")return true;if(r==="_IS_SHALLOW")return e;if(ie(ft,r))return ft[r];let i=Reflect.get(t,r,n);return Le(r)&&v(t,r),v(t,be),d(i)&&!e?E(i):i},set:(t,r,n,i)=>{let o=Reflect.get(t,r,i),s=Reflect.set(t,r,n,i);return R(n,o)&&(Le(r)?A(t,L.SET,[r,B,be]):A(t,L.SET,r)),s}}),kr=Lt(true),Ar=Lt(false),xr={get(e,t){return t==="_IS_REACTIVE"?true:t==="_RAW"?e:Reflect.get(ie(ht,t)?ht:e,t,e)}},Tr={get(e,t){return t==="_IS_REACTIVE"?true:t==="_RAW"?e:Reflect.get(ie(dt,t)&&t in e?dt:e,t,e)}},ht={get(e){let t=h(this);v(t,C);let r=t.get(e);return d(r)&&!O(this)?E(r):r},set(e,t){let r=h(this),n=r.has(e),i=r.get(e),o=h(t);return r.set(e,o),(!n||R(i,o))&&A(r,L.SET,C),this},add(e){let t=h(this),r=h(e),n=t.has(r);return t.add(r),n?A(t,L.SET,C):A(t,L.ADD,C),this},has(e){let t=h(this);v(t,C);let r=t.has(e);return !r&&d(e)?t.has(h(e)):r},delete(e){let t=h(this),r=t.has(e),n=t.delete(e);return !n&&d(e)&&(n=t.delete(h(e))),(r||n)&&A(t,L.DELETE,C),n},clear(){let e=h(this),t=e.size>0,r=e.clear();return t&&A(e,L.CLEAR,C),r},forEach(e,t){let r=h(this),n=O(this);v(r,C),r.forEach((i,o)=>{let s=n||!d(i)?i:E(i),a=n||!d(o)?o:E(o);e.call(t,s,a,this);});},[Symbol.iterator](){let e=h(this),t=O(this);v(e,C);let r=e[Symbol.iterator]();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:t?{value:n,done:i}:Array.isArray(n)?{value:n.map(o=>d(o)?E(o):o),done:i}:{value:d(n)?E(n):n,done:i}},[Symbol.iterator](){return this}}},get size(){let e=h(this);return v(e,C),e.size},keys(){let e=h(this),t=O(this);v(e,C);let r=e.keys();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:{value:t||!d(n)?n:E(n),done:i}},[Symbol.iterator](){return this}}},values(){let e=h(this),t=O(this);v(e,C);let r=e.values();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:{value:t||!d(n)?n:E(n),done:i}},[Symbol.iterator](){return this}}},entries(){let e=h(this),t=O(this);v(e,C);let r=e.entries();return {next(){let{value:n,done:i}=r.next();return i?{value:n,done:i}:t?{value:n,done:i}:{value:n.map(o=>d(o)?E(o):o),done:i}},[Symbol.iterator](){return this}}}},dt={get(e){let t=h(this);v(t,oe);let r=t.get(e);return r===void 0&&V(e)&&(r=t.get(h(e))),d(r)&&!O(this)?E(r):r},set(e,t){let r=h(this),n=h(e),i=r.has(n),o=r.get(n),s=h(t);return r.set(n,s),(!i||R(o,s))&&A(r,L.SET,oe),this},add(e){let t=h(this),r=h(e),n=t.has(r);return t.add(r),n||A(t,L.ADD,oe),this},has(e){let t=h(this);v(t,oe);let r=t.has(e);return !r&&V(e)&&(r=t.has(h(e))),r},delete(e){let t=h(this),r=h(e),n=t.has(r),i=t.delete(r);return (n||i)&&A(t,L.DELETE,oe),i}},Lr=e=>({get(t,r,n){if(r==="_RAW")return t;if(r==="_IS_REACTIVE")return true;if(r==="_IS_SHALLOW")return e;let i=Reflect.get(t,r,n),o=w(i)?i.value:i;return v(t,r),d(o)&&!e?E(o):o},set:(t,r,n,i)=>{let o=Reflect.get(t,r,i),s=Reflect.set(t,r,h(n),i);return R(n,o)&&A(t,L.SET,r,n),s},deleteProperty:(t,r)=>{let n=ie(t,r),i=Reflect.deleteProperty(t,r);return n&&i&&A(t,L.DELETE,r,void 0),i}});function E(e,t=false){if(!d(e)||V(e))return e;let r=ut.get(e);if(r)return r;let n;P(e)?n=t?kr:Ar:de(e)||pe(e)?n=xr:Ge(e)||Xe(e)?n=Tr:n=Lr(t);let i=new Proxy(e,n);return ut.set(e,i),i}function V(e){return !!(e&&e._IS_REACTIVE)}function Se(e){return V(e)?(g("[Reactive] Target is already reactive. Returning existing reactive proxy to avoid double wrapping."),e):w(e)?(g("[Reactive] Creating a reactive proxy from a signal is not recommended. Use the signal directly or access its value property."),e):E(e)}function we(e){return V(e)?(O(e)?g("[ShallowReactive] Target is already a shallow reactive proxy. Returning existing proxy to avoid double wrapping."):g("[ShallowReactive] Target is already a deep reactive proxy. Cannot convert deep reactive to shallow reactive. Returning existing proxy."),e):w(e)?(g("[ShallowReactive] Creating a reactive proxy from a signal is not recommended. Use the signal directly or access its value property."),e):E(e,true)}function O(e){return !!(e&&e._IS_SHALLOW)}var ei=e=>d(e)?Se(e):e,Ct;Ct="_IS_SIGNAL";var Ke=class{constructor(e,t=false){this.flag=1,this[Ct]=true,this._rawValue=e,t?this._value=d(e)?we(e):e:this._value=d(e)?Se(e):e,this._IS_SHALLOW=t;}get dep(){return this}get value(){let e=M;if(e&&kt(this,e),this.flag&16&&this.shouldUpdate()){let r=this.subLink;r&&$e(r);}return this._value}set value(e){if(w(e)&&(g("Setting a signal value to another signal is not recommended. The value will be unwrapped automatically."),e=e.peek()),e=h(e),!R(this._rawValue,e))return;"_oldValue"in this||(this._oldValue=this._rawValue);let t=this.flag;this.flag=t|16,this._rawValue=e,this._IS_SHALLOW?this._value=d(e)?we(e):e:this._value=d(e)?Se(e):e;let n=this.subLink;n&&wt(n);}shouldUpdate(){if(this.flag&=-17,!("_oldValue"in this))return true;let e=R(this._oldValue,this._rawValue);return this._oldValue=this._rawValue,e}peek(){return this._value}set(e){this.value=e;}update(e){let t=e(this.peek());w(t)?(g("Returning a signal from an update function is not recommended. The value will be unwrapped."),this.value=t.peek()):this.value=t;}};function ce(e){return w(e)?(g("Creating a signal with another signal is not recommended. The value will be unwrapped."),e):new Ke(e)}function ti(e){return w(e)&&(g("Creating a shallow signal with another signal is not recommended. The value will be unwrapped."),e=e.peek()),new Ke(e,true)}function w(e){return !!e&&!!e._IS_SIGNAL}var ve=new Set,De=new Set,Cr=Promise.resolve(),je=false;function Pr(e){return e?new Promise((t,r)=>{queueMicrotask(()=>{try{e(),t();}catch(n){r(n);}});}):Cr}function Ee(e){ve.add(e),Pt();}function Pt(){je||(je=true,Pr(Mt));}function Mr(e){De.add(e),Pt();}function Mt(){for(je=false,Ir();ve.size>0;){let e=Array.from(ve);ve.clear();for(let t of e)try{t();}catch(r){p("Error executing queued job:",r);}}}function Ir(){let e=Array.from(De);De.clear();for(let t of e)try{t();}catch(r){p("Error executing pre-flush callback:",r);}}function Rr(e,t){switch(t){case "sync":return ()=>e();case "pre":return ()=>Mr(e);case "post":return ()=>Ee(e);default:return g(`Invalid flush timing: ${t}. Defaulting to 'post'.`),()=>Ee(e)}}var ee=0;function pt(e){Or();try{return e()}finally{Nr();}}function Or(){ee++;}function Nr(){if(ee===0){g("[Batch] endBatch() called without matching startBatch(). This indicates unbalanced batch calls in your code. Make sure every startBatch() has a corresponding endBatch(), or use the batch() function which handles this automatically.");return}ee--,ee===0&&Mt();}function Dr(){return ee>0}function ri(){return ee}var It;It="_IS_EFFECT";var jr=class{constructor(e,t){this.flag=18,this[It]=true,this._active=true,this.fn=e,t&&(this.scheduler=t.flush||t.scheduler,this.onStop=t.onStop,this.onTrack=t.onTrack,this.onTrigger=t.onTrigger);}get active(){return this._active}get dirty(){let e=this.flag;if(e&16)return true;if(e&32){if(this.depLink&&At(this.depLink,this))return this.flag=e&-33|16,true;this.flag=e&-33;}return false}pause(){this.flag|=256;}resume(){let t=this.flag&-257;this.flag=t;let r=(t&16)!==0,n=(t&32)!==0;(r||n)&&this.notify();}run(){if(!this._active)return this.fn();let e=this.flag;this.flag=e&-17|1024;let t=xt(this);try{return this.fn()}catch(r){throw this.flag|=16,r}finally{this.flag&=-1025,Tt(this,t);}}getJob(){return this._job||(this._job=()=>this.run()),this._job}notify(){let e=this.flag;!this._active||e&1296||(this.flag=e|16,this.onTrigger&&this.onTrigger({effect:this,target:{},type:"set"}),this.scheduler?S(this.scheduler)?this.scheduler(this):Rr(()=>this.run(),this.scheduler)():Dr()?Ee(this.getJob()):this.run());}stop(){if(!this._active){g("[Effect] Attempting to stop an already stopped effect.");return}this._active=false;let e=this.depLink;for(;e;)e=ye(e,this);let t=this.subLink;for(;t;)t=ye(t);this._job=void 0,this.depLinkTail=void 0,this.subLinkTail=void 0,this.depLink&&p("[Effect] Cleanup verification failed: depLink not cleared. This indicates a memory leak in the dependency tracking system."),this.subLink&&p("[Effect] Cleanup verification failed: subLink not cleared. This indicates a memory leak in the subscription system."),this.onStop&&this.onStop();}};function _e(e,t){let r=new jr(e,t);try{r.run();}catch(i){throw r.stop(),p("[Effect] Effect failed during initial execution and has been stopped. Fix the error in your effect function.",i),i}let n=()=>r.run();return n.effect=r,n.stop=()=>r.stop(),n}function ni(e){e.effect.stop();}function ii(e){return !!(e&&e._IS_EFFECT)}function oi(e,t,r){let n=t;return _e(()=>{n=e(n);},r)}var se=Symbol("computed-no-value"),Rt;Rt="_IS_COMPUTED";var mt=class{constructor(e,t,r,n){this.flag=17,this[Rt]=true,this._value=se,this.getter=e,this.setter=t,this.onTrack=r,this.onTrigger=n,this.flag|=16;}get value(){M&&kt(this,M);let e=this.flag,t=this._value!==se;return t&&!(e&48)?this._value:!t||e&16?(this.recompute(),this._value):(e&32&&(this.depLink&&At(this.depLink,this)?this.recompute():this.flag=e&-33),this._value)}set value(e){this.setter?this.setter(e):g(`[Computed] Cannot set readonly computed value. Provide a setter in the computed options to make it writable.
|
|
8
|
+
Example: computed({ get: () => value, set: (v) => { ... } })`);}peek(){return this._value===se&&this.recompute(),this._value}recompute(){let e=this._value,t=e!==se,r=xt(this);try{let n=this.getter(),i=this.flag,o=this.subLink,s=-49;!t||R(e,n)?(this._value=n,this.flag=i&s,this.onTrigger&&this.onTrigger({effect:this,target:this,type:"set",key:"value",newValue:n}),o&&Et(o)):this.flag=i&s;}catch(n){throw this.flag&=-49,this.flag|=16,p(`[Computed] Error occurred while computing value.
|
|
9
|
+
The computed will retry on next access.
|
|
10
|
+
Common causes:
|
|
11
|
+
- Accessing undefined properties
|
|
12
|
+
- Circular dependencies
|
|
13
|
+
- Exceptions in getter function
|
|
14
|
+
Check your getter function for errors.`,n),n}finally{Tt(this,r);}}shouldUpdate(){let e=this._value!==se,t=this._value;return this.recompute(),e?R(this._value,t):true}};function $r(e){if(Y(e))return g("[Computed] Creating a computed from another computed is not recommended. The existing computed will be returned to avoid unnecessary wrapping."),e;if(!e)throw new Error("[Computed] Invalid argument: computed() requires a getter function or options object.");if(S(e))return new mt(e);if(Ze(e)){let{get:t,set:r,onTrack:n,onTrigger:i}=e;if(!t)throw new Error(`[Computed] Invalid options: getter function is required.
|
|
15
|
+
Usage: computed({ get: () => value, set: (v) => { ... } })`);if(!S(t))throw new TypeError(`[Computed] Invalid options: getter must be a function.
|
|
10
16
|
Received: ${typeof t}`);return new mt(t,r,n,i)}throw new Error(`[Computed] Invalid argument: expected a function or options object.
|
|
11
|
-
Received: ${typeof e}`)}function Y(e){return !!e&&!!e._IS_COMPUTED}function Kr(e){if(!e.state)throw m("Store state is required"),new Error("Store state is required");let{state:t,getters:r,actions:n}=e,i=Re({},t),o=Se(t),s=new Set,a=new Set,c={patch$(u){if(!u){m("Patch payload is required");return}pt(()=>{Object.assign(o,u);}),s.forEach(f=>f(o)),a.forEach(f=>f(o));},subscribe$(u){if(!u){m("Subscribe callback is required");return}s.add(u);},unsubscribe$(u){s.delete(u);},onAction$(u){if(!u){m("Action callback is required");return}a.add(u);},reset$(){pt(()=>{Object.assign(o,i);}),s.forEach(u=>u(o)),a.forEach(u=>u(o));}},l=Re(Er(Re({},o),{state:o}),c);if(r)for(let u in r){let f=r[u];f&&Object.defineProperty(l,u,{get(){return $r(()=>f.call(l,o)).value},enumerable:true,configurable:true});}if(n)for(let u in n){let f=n[u];f&&(l[u]=(...y)=>{let S=f.apply(o,y);return a.forEach(C=>C(o)),S});}return l}function Ur(e){let t=new e,r=Object.create(null),n={},i={};return Object.getOwnPropertyNames(t).forEach(o=>{r[o]=t[o];}),Object.getOwnPropertyNames(e.prototype).forEach(o=>{let s=Object.getOwnPropertyDescriptor(e.prototype,o);s&&(typeof s.get=="function"?n[o]=function(){return s.get.call(this)}:typeof s.value=="function"&&o!=="constructor"&&(i[o]=function(...a){return s.value.apply(this,a)}));}),{state:r,getters:n,actions:i}}function si(e){if(!e)throw m("Store definition is required"),new Error("Store definition is required");return ()=>{let t;typeof e=="function"?t=Ur(e):t=e;let r=Kr(t);return typeof e=="function"&&Object.keys(t.actions||{}).forEach(n=>{r[n]=t.actions[n].bind(r);}),r}}var gt,vt,bt=class extends(vt=Ke,gt="_IS_REF",vt){constructor(e){super(e,true),this[gt]=true;}get value(){return g(this,lt),this._value}set value(e){E(e)&&(e=e.value),Ot(e)&&(e=e.value),R(this._value,e)&&(this._value=e,this.subLink&&$e(this.subLink),k(this,"SET",lt));}};function ai(e=void 0){return Ot(e)?(Ie("Creating a ref with another ref is not recommended. The value will be unwrapped."),e):E(e)?(Ie("Creating a ref with a signal is not recommended. The value will be unwrapped."),new bt(e.peek())):new bt(e)}function Ot(e){return !!e&&!!e._IS_REF}var yt={},St=new WeakMap;function U(e,t=new Set){if(!d(e)||t.has(e))return e;if(t.add(e),E(e)||Y(e))return U(e.value,t);if(Array.isArray(e))for(let r of e)U(r,t);else pe(e)?(e.forEach(r=>{U(r,t);}),e.keys(),e.values()):de(e)?(e.forEach(r=>{U(r,t);}),e.values()):Object.keys(e).forEach(r=>{U(e[r],t);});return e}function Q(e){if(!d(e))return e;if(Array.isArray(e))return e.map(r=>Q(r));if(pe(e)){let r=new Map;return e.forEach((n,i)=>{r.set(i,Q(n));}),r}if(de(e)){let r=new Set;return e.forEach(n=>{r.add(Q(n));}),r}let t={};for(let r of Object.keys(e))t[r]=Q(e[r]);return t}function Fr(e){return Array.isArray(e)?()=>e.map(t=>E(t)||Y(t)?t.value:V(t)?U(t):b(t)?t():t):b(e)?e:E(e)?()=>e.value:d(e)&&"value"in e?()=>e.value:V(e)?()=>U(e):()=>e}function ci(e,t,r={}){let{immediate:n=false,deep:i=false}=r,o=yt,s=Fr(e),a=()=>{let l=c.effect;if(!l.run)return;let u=l.run();R(u,o)&&(t(u,o===yt?void 0:o),o=Q(u));},c=_e(()=>{let l=s();return i&&U(l),l},{scheduler:()=>we(a)});return n?a():o=Q(c.effect.run()),()=>{c.stop();let l=St.get(c.effect);l&&(l.forEach(u=>u()),St.delete(c.effect));}}var Hr=Object.defineProperty,Nt=Object.getOwnPropertySymbols,qr=Object.prototype.hasOwnProperty,zr=Object.prototype.propertyIsEnumerable,Dt=(e,t,r)=>t in e?Hr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,Bt=(e,t)=>{for(var r in t||(t={}))qr.call(t,r)&&Dt(e,r,t[r]);if(Nt)for(var r of Nt(t))zr.call(t,r)&&Dt(e,r,t[r]);return e},qe=(e,t,r)=>new Promise((n,i)=>{var o=c=>{try{a(r.next(c));}catch(l){i(l);}},s=c=>{try{a(r.throw(c));}catch(l){i(l);}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,s);a((r=r.apply(e,t)).next());}),G=null,Wr=0,Ue=[];function K(){return G}function Br(e){G=e;}function Vr(e=G){let t={id:++Wr,parent:e,children:null,provides:null,cleanup:null,onMount:null,onUpdate:null,onDestroy:null,isMounted:false,isDestroyed:false};return e&&(e.children||(e.children=new Set),e.children.add(t)),t}function ee(e,t){let r=G;r&&Ue.push(r),G=e;try{return t()}finally{G=Ue.length>0?Ue.pop():r;}}function Vt(e){var t,r,n,i,o;if(!(!e||e.isDestroyed)){if(e.children){let s=Array.from(e.children);for(let a of s)Vt(a);}if(e.onDestroy){for(let s of e.onDestroy)try{s();}catch(a){p(`Scope(${e.id}): Error in destroy hook:`,a);}e.onDestroy.clear();}if(e.cleanup){for(let s of e.cleanup)try{s();}catch(a){p(`Scope(${e.id}): Error in cleanup:`,a);}e.cleanup.clear();}(t=e.parent)!=null&&t.children&&e.parent.children.delete(e),(r=e.children)==null||r.clear(),(n=e.provides)==null||n.clear(),(i=e.onMount)==null||i.clear(),(o=e.onUpdate)==null||o.clear(),Br(e.parent),e.parent=null,e.isDestroyed=true;}}function Ve(e){let t=G;if(!t){p("onCleanup() must be called within a scope");return}t.cleanup||(t.cleanup=new Set),t.cleanup.add(e);}var Yr="on",Gr="_$spread$",Xr="ref",Jr="key",Zr="http://www.w3.org/2000/svg",jt="http://www.w3.org/2000/xlink",$t="http://www.w3.org/2000/xmlns/",Kt=/^\d+-\d+$/,Fe=1e3,Ut=new WeakMap;function Qr(e){let t=Ut.get(e);if(!t){let r=e.name||"anonymous",n=Yt(e.toString()).toString(36);t=`${r}_${n}`,Ut.set(e,t);}return t}function Yt(e){let t=0,r=e.length<100?e.length:100;for(let n=0;n<r;n++)t=Math.trunc((t<<5)-t+e.charCodeAt(n));return t<0?-t:t}var en=0;function Gt(e){if(!me(e)){if(v(e))return e.length<=Fe?e:(m(`[Key System] Key length exceeds ${Fe} characters. Consider using a shorter identifier.`),`${e.slice(0,Fe-10)}_${Yt(e).toString(36)}`);if(xe(e)){{if(e!==e){m("[Key System] NaN cannot be used as a key");return}if(!Number.isFinite(e)){m("[Key System] Infinity cannot be used as a key");return}}return String(e)}if(Te(e)){let t=Symbol.keyFor(e);if(t)return `_s.${t}`;let r=e.description;return r?`_s.${r}`:`${en++}`}return String(e)}}var ze=Symbol("essor.key");function We(e,t){if(A(e))return;if(!e||e.nodeType===Node.DOCUMENT_NODE){m("[Key System] Cannot set key on invalid node");return}let r=Gt(t);me(r)?delete e[ze]:e[ze]=r;}function X(e){if(e)return A(e)?e.key:e[ze]}function vi(e,t){let r=new Set(t);return new Proxy(e,{get(n,i){if(!r.has(i))return Reflect.get(n,i)},ownKeys(n){return Reflect.ownKeys(n).filter(i=>!r.has(i))},getOwnPropertyDescriptor(n,i){if(!r.has(i))return Reflect.getOwnPropertyDescriptor(n,i)},has(n,i){return r.has(i)?false:Reflect.has(n,i)}})}function q(e){if(e)try{if(A(e))e.destroy();else {let t=e;t.parentElement&&t.remove();}}catch(t){p("Failed to remove node:",t);}}function N(e,t,r){if(!(!e||!t))try{let n=A(r)?r.firstChild:r;if(A(t)){t.mount(e,n);return}n?e.insertBefore(t,n):(t||p("insertNode: child is not a Node",t),e.appendChild(t));}catch(n){p("Failed to insert node:",n);}}function Xt(e,t,r){if(!(!e||!t||!r||t===r))try{let n=A(r)?r.beforeNode:r.nextSibling;q(r),N(e,t,n);}catch(n){p("Failed to replace node:",n);}}function J(e){if(e){if(A(e))return e.firstChild;if(!re(e))return e}}function F(e,t){let r=X(e),n=X(t);if(r!==n)return false;let i=A(e),o=A(t);if(i&&o)return e.component===t.component;if(i!==o)return false;if(re(e)||re(t))return e===t;let s=e,a=t;return s.nodeType!==a.nodeType?false:s.nodeType===Node.ELEMENT_NODE?s.tagName===a.tagName:true}function le(e){if(ne(e))return e;if(re(e)){let t=me(e)?"":String(e);return document.createTextNode(t)}return e}function tn(e){return e instanceof HTMLInputElement}function rn(e){return e instanceof HTMLSelectElement}function nn(e){return e instanceof HTMLTextAreaElement}function Ft(e){return e instanceof Text}function on(e,t){if(e===t)return true;if(!e||!t||Array.isArray(e)!==Array.isArray(t))return false;for(let r in e)if(e[r]!==t[r])return false;for(let r in t)if(!(r in e))return false;return true}function Ht(e,t){if(A(e)||A(t))return;let r=X(e);r&&!X(t)&&We(t,r);}function H(e,t,r){if(r===t)return t;let n=ne(t);if(ne(r)&&n){if(r.isEqualNode(t))return t;if(t.tagName===r.tagName){let a=t.attributes,c=r.attributes;for(let l=a.length-1;l>=0;l--){let u=a[l].name;r.hasAttribute(u)||t.removeAttribute(u);}for(let l=0,u=c.length;l<u;l++){let f=c[l];t.getAttribute(f.name)!==f.value&&t.setAttribute(f.name,f.value);}return Ht(t,r),t}}if(Ft(t)&&Ft(r))return t.textContent!==r.textContent&&(t.textContent=r.textContent),Ht(t,r),t;let o=A(t),s=A(r);return o&&s&&t.component===r.component?r.update(t):(Xt(e,r,t),r)}function sn(e,t,r,n){let i=t.length,o=r.length;if(i===0&&o===0)return [];if(i===0){for(let s=0;s<o;s++)N(e,r[s],n);return r}if(o===0){for(let s=0;s<i;s++)q(t[s]);return []}if(i===1&&o===1){let s=t[0],a=r[0];return F(s,a)?(H(e,s,a),r[0]=s):Xt(e,a,s),r}if(i===2&&o===2){let s=t[0],a=t[1],c=r[0],l=r[1];if(F(s,c)&&F(a,l))return H(e,s,c),H(e,a,l),r[0]=s,r[1]=a,r;if(F(s,l)&&F(a,c)){H(e,s,l),H(e,a,c);let u=J(a),f=J(s);return u&&f&&u.parentNode===e&&e.insertBefore(u,f),r[0]=a,r[1]=s,r}}return an(e,t,r,n)}function an(e,t,r,n){let i=0,o=0,s=t.length-1,a=r.length-1,c=t[0],l=t[s],u=r[0],f=r[a];for(;i<=s&&o<=a;)if(!c)c=t[++i];else if(!l)l=t[--s];else if(F(c,u))H(e,c,u),r[o]=c,c=t[++i],u=r[++o];else break;for(;i<=s&&o<=a;)if(!c)c=t[++i];else if(!l)l=t[--s];else if(F(l,f))H(e,l,f),r[a]=l,l=t[--s],f=r[--a];else break;if(i>s){if(o<=a){let y=a+1<r.length?J(r[a+1]):n;for(let S=o;S<=a;S++)N(e,r[S],y);}}else if(o>a)for(let y=i;y<=s;y++){let S=t[y];S&&q(S);}else cn(e,t,r,i,s,o,a,n);return r}function cn(e,t,r,n,i,o,s,a){let c=s-o+1,l=r.length,u;for(let _=o;_<=s;_++){let x=X(r[_]);x!==void 0&&(u||(u=Object.create(null)),u[x]=_);}let f=new Int32Array(c),y=false,S=0,C=0;for(let _=n;_<=i;_++){let x=t[_];if(!x)continue;if(C>=c){q(x);continue}let I,z=X(x);if(z!==void 0&&u&&z in u)I=u[z];else for(let D=o;D<=s;D++)if(f[D-o]===0&&z===void 0&&X(r[D])===void 0&&F(x,r[D])){I=D;break}I===void 0?q(x):(f[I-o]=_+1,I>=S?S=I:y=true,H(e,x,r[I]),r[I]=x,C++);}let te=y?ln(f):[],Ae=te.length-1;for(let _=c-1;_>=0;_--){let x=o+_,I=r[x],z=x+1<l?J(r[x+1]):a;if(f[_]===0)N(e,I,z);else if(y)if(Ae<0||_!==te[Ae]){let D=J(I);D&&D.parentNode===e&&N(e,D,z);}else Ae--;}}function ln(e){let t=e.length;if(t===0)return [];if(t===1)return e[0]!==0?[0]:[];let r=[],n=new Int32Array(t),i,o,s,a,c;for(i=0;i<t;i++){let l=e[i];if(l!==0){if(o=r[r.length-1],r.length===0||e[o]<l){n[i]=o,r.push(i);continue}for(s=0,a=r.length-1;s<a;)c=s+a>>1,e[r[c]]<l?s=c+1:a=c;l<e[r[s]]&&(s>0&&(n[i]=r[s-1]),r[s]=i);}}for(s=r.length,a=r[s-1];s-- >0;)r[s]=a,a=n[a];return r}function $(e,t,r,n){e.addEventListener(t,r,n),Ve(()=>{e.removeEventListener(t,r,n);});}function bi(e,t,r,n){if(tn(e))switch(e.type){case "checkbox":$(e,"change",()=>{n(!!e.checked);});break;case "radio":$(e,"change",()=>{n(e.checked?e.value:"");});break;case "file":$(e,"change",()=>{n(e.files);});break;case "number":case "range":$(e,"input",()=>{n(e.value||"");});break;case "date":case "datetime-local":case "month":case "time":case "week":$(e,"change",()=>{n(e.value||"");});break;default:$(e,"input",()=>{n(e.value);});break}else rn(e)?$(e,"change",()=>{if(e.multiple){let i=Array.from(e.options).filter(o=>o.selected).map(o=>o.value);n(i);}else n(e.value);}):nn(e)&&$(e,"input",()=>{n(e.value);});}function un(e,t,r){if(!e)return;let n=K(),i=[],o=_e(()=>{let s=()=>{let a=b(t)?t():t,c=Ce(a).map(l=>b(l)?l():l).flatMap(l=>l).map(le);i=sn(e,i,c,r);};n&&!n.isDestroyed?ee(n,s):s();});return Ve(()=>{o(),i.forEach(s=>q(s)),i.length=0;}),i}function fn(e,t){let r=t.length,n=new Array(r),i=new Set(t),o=1,s=0,a=c=>{if(c.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){if(i.has(o)&&(n[s++]=c,s===r))return true;o++;}let l=c.firstChild;for(;l;){if(a(l))return true;l=l.nextSibling;}return false};return a(e),n}function hn(e){let t=K();if(!t){p("onMount() must be called within a scope");return}if(t.isMounted){try{e();}catch(r){p(`Scope(${t.id}): Error in mount hook:`,r);}return}t.onMount||(t.onMount=new Set),t.onMount.add(e);}function dn(e){let t=K();if(!t){p("onUpdate() must be called within a scope");return}t.onUpdate||(t.onUpdate=new Set),t.onUpdate.add(e);}function pn(e){let t=K();if(!t){p("onDestroy() must be called within a scope");return}t.onDestroy||(t.onDestroy=new Set),t.onDestroy.add(e);}function mn(e){!e||e.isDestroyed||e.isMounted||(e.isMounted=true,e.onMount&&ee(e,()=>{for(let t of e.onMount)try{t();}catch(r){p(`Scope(${e.id}): Error in mount hook:`,r);}}));}function qt(e){if(!(!e||e.isDestroyed)&&e.onUpdate)for(let t of e.onUpdate)try{t();}catch(r){p(`Scope(${e.id}): Error in update hook:`,r);}}function gn(e){hn(e);}function vn(e){pn(e);}function yi(e){dn(e);}var Jt;Jt="normal";var bn=class{constructor(e,t){this.component=e,this.props=t,this.renderedNodes=[],this.scope=null,this.parentNode=void 0,this.beforeNode=void 0,this.reactiveProps={},this.state=0,this.parentScope=null,this[Jt]=true,this.key=t!=null&&t.key?Gt(t.key):Qr(e),this.reactiveProps=Ee(Bt({},this.props||{})),this.parentScope=K();}get isConnected(){return this.state===2}get firstChild(){for(let e of this.renderedNodes){let t=J(e);if(t)return t}}mount(e,t){var r;if(this.parentNode=e,this.beforeNode=t,this.state=1,this.renderedNodes.length>0){for(let o of this.renderedNodes)N(e,o,t);return this.state=2,this.renderedNodes}let n=(r=this.parentScope)!=null?r:K();this.scope=Vr(n);let i=ee(this.scope,()=>{var o;let s=this.component(this.reactiveProps);return b(s)&&(s=s(this.reactiveProps)),(E(s)||Y(s))&&(s=s.value),(o=un(e,s,t))!=null?o:[]});return this.renderedNodes=i,ee(this.scope,()=>{this.applyProps(this.props||{});}),this.state=2,this.scope&&mn(this.scope),this.renderedNodes}update(e){if(this.key!==e.key)return this.mount(e.parentNode,e.beforeNode),this;if(this.parentNode=e.parentNode,this.beforeNode=e.beforeNode,this.scope=e.scope,this.parentScope=e.parentScope,this.renderedNodes=e.renderedNodes,this.state=e.state,this.reactiveProps=e.reactiveProps,this.props)for(let t in this.props){if(t==="key")continue;let r=this.props[t],n=this.reactiveProps[t];Object.is(n,r)||d(n)&&d(r)&&on(n,r)||(this.reactiveProps[t]=r);}return !this.isConnected&&this.parentNode&&this.mount(this.parentNode,this.beforeNode),this.scope&&(ee(this.scope,()=>{this.applyProps(this.props||{});}),qt(this.scope)),this}forceUpdate(){return qe(this,null,function*(){if(yield Promise.resolve(),this.state===5||!this.parentNode||!this.scope)return;let e=[...this.renderedNodes];try{ee(this.scope,()=>{let t=this.component(this.reactiveProps);b(t)&&(t=t(this.reactiveProps)),(E(t)||Y(t))&&(t=t.value);let r=Ce(t);if(this.parentNode){let n=this.beforeNode;if(!n&&this.renderedNodes.length>0){let i=this.renderedNodes[this.renderedNodes.length-1],o=J(i);o&&(n=o.nextSibling);}for(let i of this.renderedNodes)q(i);for(let i of r)N(this.parentNode,i,n);this.renderedNodes=r;}}),this.scope&&qt(this.scope);}catch(t){throw this.renderedNodes=e,t}})}destroy(){if(this.state===4||this.state===5)return;this.state=4;let e=this.scope;e&&(Vt(e),this.scope=null);for(let t of this.renderedNodes)q(t);this.renderedNodes=[],this.parentNode=void 0,this.beforeNode=void 0,this.parentScope=null,this.reactiveProps={},this.props=void 0,this.state=5;}applyProps(e){if(!e)return;let t=this.firstChild;for(let[r,n]of Object.entries(e))if(et(r,Yr)&&t){let i=r.slice(2).toLowerCase();ne(t)&&$(t,i,n);}else r===Xr&&E(n)&&(n.value=t);this.props=e;}};function A(e){return !!e&&!!e.normal}function Zt(e,t){return A(e)?e:new bn(e,t)}function yn(e){let t,r=()=>{let n=document.createElement("template");n.innerHTML=e;let i=n.content.firstChild;if(!i)throw new Error("Invalid template: empty content");return i};return ()=>(t||(t=r())).cloneNode(true)}function Si(e,t){let r=v(t)?document.querySelector(t):t;if(!r){p(`Target element not found: ${t}`);return}r.innerHTML&&(p(`Target element is not empty, it will be delete: ${t}`),r.innerHTML="");let i=Zt(e);return i.mount(r),i}function Sn(e,t){let r=K();if(!r){p("provide() must be called within a scope");return}r.provides||(r.provides=new Map),r.provides.set(e,t);}function En(e,t){let r=K();if(!r)return p("inject() must be called within a scope"),t;let n=r;for(;n;){if(n.provides){let i=n.provides.get(e);if(i)return i}n=n.parent;}return t}function wn(e){let t=e.target,r=`${e.type}`,n=e.target,i=e.currentTarget,o=c=>Object.defineProperty(e,"target",{configurable:true,value:c}),s=()=>{let c=t[`_$${r}`];if(c&&b(c)&&!t.disabled){let l=t[`${r}Data`];if(l?c.call(t,l,e):c.call(t,e),e.cancelBubble)return false}return t.host&&!v(t.host)&&!t.host._$host&&b(t.contains)&&t.contains(e.target)&&o(t.host),true},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let c=e.composedPath();o(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();o(n);}var zt=Symbol("_$EVENTS");function Ei(e,t=window.document){let r=t,n=r[zt]||(r[zt]=new Set);for(let i of e)n.has(i)||(n.add(i),t.addEventListener(i,wn));}function wi(e,t,r,n=false){if(t===r)return;let i=Be(r),o=Be(t);i&&o===i||(i?n?e.setAttribute("class",i):e.className=i:e.removeAttribute("class"));}function Be(e){if(e==null)return "";if(typeof e=="string")return e.trim();if(P(e))return e.map(Be).filter(Boolean).join(" ");if(d(e)){let t=[];for(let r in e)e[r]&&t.push(r);return t.join(" ")}return String(e).trim()}var Wt=/\s*!important$/,_n=["Webkit","Moz","ms"],He={};function _i(e,t,r){let n=e.style,i=v(r);if(r&&i){t!==r&&(n.cssText=r);return}if(!r){t&&e.removeAttribute("style");return}if(t&&!v(t))for(let o in t)(!r||r[o]==null)&&ke(n,o,"");else if(t&&v(t)){let o=t.split(";");for(let s of o){let a=s.indexOf(":");if(a>0){let c=s.slice(0,a).trim();r&&d(r)&&r[c]==null&&ke(n,c,"");}}}if(r&&!v(r))for(let o in r){let s=r[o];(!t||v(t)||t[o]!==s)&&s!=null&&ke(n,o,s);}}function ke(e,t,r){if(P(r)){for(let i of r)ke(e,t,i);return}if((r==null||r==="")&&(r=""),t.startsWith("--")){e.setProperty(t,r);return}let n=kn(e,t);typeof r=="string"&&Wt.test(r)?e.setProperty(Me(n),r.replace(Wt,""),"important"):e[n]=r;}function kn(e,t){let r=He[t];if(r)return r;let n=Me(t);if(n!=="filter"&&n in e)return He[t]=n;n=rt(n);for(let i of _n){let o=i+n;if(o in e)return He[t]=o}return t}function An(e,t,r,n){if(t===Jr){n==null?We(e,void 0):We(e,String(n));return}if(t===Gr){d(n)||m("spread attribute must be an object"),Object.keys(n).forEach(f=>{An(e,f,r==null?void 0:r[f],n==null?void 0:n[f]);});return}let i=(e==null?void 0:e.namespaceURI)===Zr,o=i&&t.startsWith("xlink:"),s=i&&t.startsWith("xmlns:"),a=it(t)||ot(t);if(r===n)return;let c=t.toLowerCase();if(/^on[a-z]+/.test(c)||c==="innerhtml")return;if(n==null){if(o)e.removeAttributeNS(jt,t.slice(6));else if(s){let f=t.slice(6);e.removeAttributeNS($t,f);}else e.removeAttribute(t);return}if(o){e.setAttributeNS(jt,t,String(n));return}if(s){e.setAttributeNS($t,t,String(n));return}if(a){st(n)?e.setAttribute(t,""):e.removeAttribute(t);return}let l=Te(n)?String(n):n;if((c==="href"||c==="src"||c==="xlink:href")&&typeof l=="string"){let f=l.trim().toLowerCase();if(f.startsWith("javascript:")||f.startsWith("data:"))return}if(i)e.setAttribute(t,String(l));else if(t in e)try{e[t]=l;}catch(f){e.setAttribute(t,String(l));}else e.setAttribute(t,String(l));}function ki(e,t,r,n){if(!(n!=null&&n.delegate))return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n);let i=n.delegate,o=a=>{let c=a.target;(c.matches(i)||c.closest(i))&&r.call(e,a);},s=Bt({},n);return s.delegate=void 0,e.addEventListener(t,o,s),()=>{e.removeEventListener(t,o,s);}}function xn(e){{if(!e)return p("Fragment component requires props"),null;if(!e.children)return p("Fragment component requires children"),null}return e==null?void 0:e.children}xn.fragment=true;function Ai(e){return !!e&&!!e.fragment}function Tn(e){if(typeof document=="undefined"){let n=e.children;return n?(P(n)?n:[n]).map(o=>String(o||"")).join(""):""}let t=document.createComment("portal");t.portal=true;let r=e.children;if(r){let n=P(r)?r:[r],i=[];gn(()=>{let o=v(e.target)?document.querySelector(e.target):e.target;if(!o){m(`[Portal] Target element not found: ${e.target}`);return}n.forEach(s=>{if(s!=null){let a=le(s);a&&(N(o,a),i.push(a));}}),Ve(()=>{i.forEach(s=>{typeof s!="string"&&s.parentNode===o&&o.removeChild(s);});});});}return t}Tn.portal=true;function xi(e){return !!e&&!!e.portal}var Qt=Symbol("SuspenseContext");function Ln(e){if(Qe(document)){let f=e.fallback;return f?String(f||""):""}let t=document.createElement("div");t.style.display="contents";let r=true,n=0,i=false,o=null,s=()=>{if(!i){for(i=true;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let f=le(e.fallback);f&&N(t,f);}}},a=()=>{if(!(!i||!(o||e.children!=null&&!he(e.children)))){for(i=false;t.firstChild;)t.removeChild(t.firstChild);o?c(o):e.children!=null&&!he(e.children)&&c(e.children);}},c=f=>{for(;t.firstChild;)t.removeChild(t.firstChild);if(f==null)return;let y=K();if((P(f)?f:[f]).forEach(C=>{if(C!=null){A(C)&&(C.parentContext=y);let te=le(C);te&&N(t,te);}}),i){for(;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let C=le(e.fallback);C&&N(t,C);}}},l={register:f=>{n++,s(),f.then(()=>{r&&(n--,n===0&&a());}).catch(y=>{m("[Suspense] Resource failed:",y),r&&(n--,n===0&&a());});},increment:()=>{n++,s();},decrement:()=>{n--,n===0&&a();}};Sn(Qt,l);let u=e.children;return he(u)?(u.then(f=>{o=f;}).catch(()=>{}),l.register(u)):u!=null?c(u):s(),vn(()=>{for(r=false;t.firstChild;)t.removeChild(t.firstChild);}),t}Ln.suspense=true;function Ti(e){return !!e&&!!e.suspense}function Li(e,t){let r=ce(t==null?void 0:t.initialValue),n=ce(true),i=ce(null),o=ce("pending"),s=0,a=null,c=()=>qe(null,null,function*(){let f=++s;n.value=true,o.value="pending",i.value=null;let y=e();a=y.then(()=>{});try{let S=yield y;f===s&&(r.value=S,o.value="ready",n.value=!1);}catch(S){f===s&&(i.value=S instanceof Error?S:new Error(String(S)),o.value="errored",n.value=false);}});c();let l=(()=>{if(n.value&&a){let f=En(Qt,null);f&&f.register(a);}return r.value});return l.loading=n,l.error=i,l.state=o,[l,{mutate:f=>{r.value=f,o.value="ready",n.value=false,i.value=null;},refetch:()=>qe(null,null,function*(){yield c();})}]}var er=0;function Cn(){return `${er++}`}function tr(){er=0;}function ue(e,t=false){return Je(e)?"":v(e)?e:P(e)?e.map(r=>ue(r,t)).join(""):b(e)?ue(e(),t):String(e)}function Pn(e,t){let r=/^<([a-z]+)(\s*)([^>]*)>/i,n=/data-idx="(\d+)"/g,i=/<!--(.*?)-->/g;return e.replace(r,`<$1$2$3 data-hk="${t}">`).replaceAll(n,`data-idx="${t}-$1"`).replaceAll(i,`<!--${t}-$1-->`)}function Ci(e,t){if(!b(e))return p("Component must be a function"),"";tr();let r=e(t);return ue(r)}function Pi(e,t,...r){let n="",i=0;for(let s of e)if(n+=s,i<r.length){let a=r[i++];a&&(n+=ue(a));}return Pn(n,t)}function Mi(e,t={}){if(!b(e))return p("create ssg component: Component is not a function"),"";let r=e(t);return ue(r)}function rr(e){if(P(e)){let t={};for(let r of e){let n=v(r)?On(r):rr(r);if(n)for(let i in n)t[i]=n[i];}return t}if(v(e)||d(e))return e}var Mn=/;(?![^(]*\))/g,In=/:([\s\S]+)/,Rn=/\/\*[\s\S]*?\*\//g;function On(e){let t={};return e.replaceAll(Rn,"").split(Mn).forEach(r=>{if(r){let n=r.split(In);n.length>1&&(t[n[0].trim()]=n[1].trim());}}),t}function Nn(e){if(!e)return "";if(v(e))return e;let t="";for(let r in e){let n=e[r];if(v(n)||xe(n)){let i=r.startsWith("--")?r:tt(r);t+=`${i}:${n};`;}}return t}function nr(e){let t="";if(v(e))t=e;else if(P(e))for(let r of e){let n=nr(r);n&&(t+=`${n} `);}else if(d(e))for(let r in e)e[r]&&(t+=`${r} `);return t.trim()}function Dn(e,t,r){if(E(t)||Y(t))return Dn(e,t.value);if(!t&&t!==0)return "";if(e==="style"){let n=rr(t);return n?v(n)?` style="${n}"`:` style="${Nn(n)}"`:""}if(e==="class"){let n=nr(t);return n?` class="${n}"`:""}return e.startsWith("on")?"":t===true?` ${e}`:` ${e}="${t}"`}function Ii(e){return ()=>{let t=Cn();return document.querySelector(`[data-hk="${t}"]`)||yn(e)()}}function Ri(e,t){let r=e.dataset.hk;if(!r)return fn(e,t);let n=[],i=e.querySelectorAll(`[data-idx^="${r}"]`);i.length>0&&n.push(...Array.from(i).filter(c=>{let l=c.dataset.idx;return l!==null&&Kt.test(l)}).map(c=>{let l=c.dataset.idx||"",[u,f]=l.split("-");return {hk:u,idx:f,node:c}}));let o=[],s=c=>{if(c.nodeType===Node.COMMENT_NODE&&c.textContent&&Kt.test(c.textContent)){let[u,f]=c.textContent.split("-");o.push({hk:u,idx:f,node:c});}let l=c.firstChild;for(;l;)s(l),l=l.nextSibling;};s(e),n.push(...o);let a=[e];return t.forEach(c=>{let l=n.find(u=>u.idx===String(c));l&&a.push(l.node);}),a}function Oi(e,t,r={}){tr();try{let n=v(t)?document.querySelector(t):t;if(!n){p("Hydration error: Root element not found");return}let i=Zt(e,r);return i.mount(n),i}catch(n){p("Hydration error:",n);return}}globalThis&&(globalThis.__essor_version__=Ye);/**
|
|
12
|
-
* @estjs/signals v0.0.15-beta.
|
|
17
|
+
Received: ${typeof e}`)}function Y(e){return !!e&&!!e._IS_COMPUTED}function Kr(e){if(!e.state)throw g("Store state is required"),new Error("Store state is required");let{state:t,getters:r,actions:n}=e,i=Re({},t),o=Se(t),s=new Set,a=new Set,c=u=>{s.forEach(m=>m(u)),a.forEach(m=>m(u));},l={patch$(u){if(!u){g("Patch payload is required");return}pt(()=>{Object.assign(o,u);}),c(o);},subscribe$(u){if(!u){g("Subscribe callback is required");return}s.add(u);},unsubscribe$(u){s.delete(u);},onAction$(u){if(!u){g("Action callback is required");return}a.add(u);},reset$(){pt(()=>{Object.assign(o,i);}),c(o);}},f=Re(wr(Re({},o),{state:o}),l);if(r)for(let u in r){let m=r[u];if(m){let y=0,_=0;Object.defineProperty(f,u,{get(){{y++;let D=Date.now();y>100&&D-_>1e3&&(g(`Getter '${u}' has been accessed ${y} times. Consider caching the result if the value is used frequently. Note: Getters are computed properties that recalculate on every access.`),_=D,y=0);}return $r(()=>m.call(f,o)).value},enumerable:true,configurable:true});}}if(n)for(let u in n){let m=n[u];m&&(f[u]=(...y)=>{let _=m.apply(o,y);return a.forEach(D=>D(o)),_});}return f}function Ur(e){let t=new e,r=Object.create(null),n={},i={};return Object.getOwnPropertyNames(t).forEach(o=>{r[o]=t[o];}),Object.getOwnPropertyNames(e.prototype).forEach(o=>{let s=Object.getOwnPropertyDescriptor(e.prototype,o);s&&(typeof s.get=="function"?n[o]=function(){return s.get.call(this)}:typeof s.value=="function"&&o!=="constructor"&&(i[o]=function(...a){return s.value.apply(this,a)}));}),{state:r,getters:n,actions:i}}function si(e){if(!e)throw g("Store definition is required"),new Error("Store definition is required");return ()=>{let t;typeof e=="function"?t=Ur(e):t=e;let r=Kr(t);return typeof e=="function"&&Object.keys(t.actions||{}).forEach(n=>{r[n]=t.actions[n].bind(r);}),r}}var gt,vt,bt=class extends(vt=Ke,gt="_IS_REF",vt){constructor(e){super(e,true),this[gt]=true;}get value(){return v(this,lt),this._value}set value(e){w(e)&&(e=e.value),Ot(e)&&(e=e.value),R(this._value,e)&&(this._value=e,this.subLink&&$e(this.subLink),A(this,"SET",lt));}};function ai(e=void 0){return Ot(e)?(Ie("Creating a ref with another ref is not recommended. The value will be unwrapped."),e):w(e)?(Ie("Creating a ref with a signal is not recommended. The value will be unwrapped."),new bt(e.peek())):new bt(e)}function Ot(e){return !!e&&!!e._IS_REF}var yt={},St=new WeakMap;function F(e,t=new Set){if(!d(e)||t.has(e))return e;if(t.add(e),w(e)||Y(e))return F(e.value,t);if(Array.isArray(e))for(let r of e)F(r,t);else pe(e)?(e.forEach(r=>{F(r,t);}),e.keys(),e.values()):de(e)?(e.forEach(r=>{F(r,t);}),e.values()):Object.keys(e).forEach(r=>{F(e[r],t);});return e}function Q(e){if(!d(e))return e;if(Array.isArray(e))return e.map(r=>Q(r));if(pe(e)){let r=new Map;return e.forEach((n,i)=>{r.set(i,Q(n));}),r}if(de(e)){let r=new Set;return e.forEach(n=>{r.add(Q(n));}),r}let t={};for(let r of Object.keys(e))t[r]=Q(e[r]);return t}function Fr(e){return Array.isArray(e)?()=>e.map(t=>w(t)||Y(t)?t.value:V(t)?F(t):S(t)?t():t):S(e)?e:w(e)?()=>e.value:d(e)&&"value"in e?()=>e.value:V(e)?()=>F(e):()=>e}function ci(e,t,r={}){let{immediate:n=false,deep:i=false}=r,o=yt,s=Fr(e),a=()=>{let l=c.effect;if(!l.run)return;let f=l.run();R(f,o)&&(t(f,o===yt?void 0:o),o=Q(f));},c=_e(()=>{let l=s();return i&&F(l),l},{scheduler:()=>Ee(a)});return n?a():o=Q(c.effect.run()),()=>{c.stop();let l=St.get(c.effect);l&&(l.forEach(f=>f()),St.delete(c.effect));}}var Hr=Object.defineProperty,Nt=Object.getOwnPropertySymbols,qr=Object.prototype.hasOwnProperty,zr=Object.prototype.propertyIsEnumerable,Dt=(e,t,r)=>t in e?Hr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,Bt=(e,t)=>{for(var r in t||(t={}))qr.call(t,r)&&Dt(e,r,t[r]);if(Nt)for(var r of Nt(t))zr.call(t,r)&&Dt(e,r,t[r]);return e},qe=(e,t,r)=>new Promise((n,i)=>{var o=c=>{try{a(r.next(c));}catch(l){i(l);}},s=c=>{try{a(r.throw(c));}catch(l){i(l);}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,s);a((r=r.apply(e,t)).next());}),G=null,Wr=0,Ue=[];function U(){return G}function Br(e){G=e;}function Vr(e=G){let t={id:++Wr,parent:e,children:null,provides:null,cleanup:null,onMount:null,onUpdate:null,onDestroy:null,isMounted:false,isDestroyed:false};return e&&(e.children||(e.children=new Set),e.children.add(t)),t}function te(e,t){let r=G;r&&Ue.push(r),G=e;try{return t()}finally{G=Ue.length>0?Ue.pop():r;}}function Vt(e){var t,r,n,i,o;if(!(!e||e.isDestroyed)){if(e.children){let s=Array.from(e.children);for(let a of s)Vt(a);}if(e.onDestroy){for(let s of e.onDestroy)try{s();}catch(a){p(`Scope(${e.id}): Error in destroy hook:`,a);}e.onDestroy.clear();}if(e.cleanup){for(let s of e.cleanup)try{s();}catch(a){p(`Scope(${e.id}): Error in cleanup:`,a);}e.cleanup.clear();}(t=e.parent)!=null&&t.children&&e.parent.children.delete(e),(r=e.children)==null||r.clear(),(n=e.provides)==null||n.clear(),(i=e.onMount)==null||i.clear(),(o=e.onUpdate)==null||o.clear(),Br(e.parent),e.parent=null,e.isDestroyed=true;}}function Ve(e){let t=G;if(!t){p("onCleanup() must be called within a scope");return}t.cleanup||(t.cleanup=new Set),t.cleanup.add(e);}var Yr="on",Gr="_$spread$",Xr="ref",Jr="key",Zr="http://www.w3.org/2000/svg",jt="http://www.w3.org/2000/xlink",$t="http://www.w3.org/2000/xmlns/",Kt=/^\d+-\d+$/,Fe=1e3,Ut=new WeakMap;function Qr(e){let t=Ut.get(e);if(!t){let r=e.name||"anonymous",n=Yt(e.toString()).toString(36);t=`${r}_${n}`,Ut.set(e,t);}return t}function Yt(e){let t=0,r=e.length<100?e.length:100;for(let n=0;n<r;n++)t=Math.trunc((t<<5)-t+e.charCodeAt(n));return t<0?-t:t}var en=0;function Gt(e){if(!me(e)){if(b(e))return e.length<=Fe?e:(g(`[Key System] Key length exceeds ${Fe} characters. Consider using a shorter identifier.`),`${e.slice(0,Fe-10)}_${Yt(e).toString(36)}`);if(xe(e)){{if(e!==e){g("[Key System] NaN cannot be used as a key");return}if(!Number.isFinite(e)){g("[Key System] Infinity cannot be used as a key");return}}return String(e)}if(Te(e)){let t=Symbol.keyFor(e);if(t)return `_s.${t}`;let r=e.description;return r?`_s.${r}`:`${en++}`}return String(e)}}var ze=Symbol("essor.key");function We(e,t){if(x(e))return;if(!e||e.nodeType===Node.DOCUMENT_NODE){g("[Key System] Cannot set key on invalid node");return}let r=Gt(t);me(r)?delete e[ze]:e[ze]=r;}function X(e){if(e)return x(e)?e.key:e[ze]}function vi(e,t){let r=new Set(t);return new Proxy(e,{get(n,i){if(!r.has(i))return Reflect.get(n,i)},ownKeys(n){return Reflect.ownKeys(n).filter(i=>!r.has(i))},getOwnPropertyDescriptor(n,i){if(!r.has(i))return Reflect.getOwnPropertyDescriptor(n,i)},has(n,i){return r.has(i)?false:Reflect.has(n,i)}})}function z(e){if(e)try{if(x(e))e.destroy();else {let t=e;t.parentElement&&t.remove();}}catch(t){p("Failed to remove node:",t);}}function N(e,t,r){if(!(!e||!t))try{let n=x(r)?r.firstChild:r;if(x(t)){t.mount(e,n);return}n?e.insertBefore(t,n):(t||p("insertNode: child is not a Node",t),e.appendChild(t));}catch(n){p("Failed to insert node:",n);}}function Xt(e,t,r){if(!(!e||!t||!r||t===r))try{let n=x(r)?r.beforeNode:r.nextSibling;z(r),N(e,t,n);}catch(n){p("Failed to replace node:",n);}}function J(e){if(e){if(x(e))return e.firstChild;if(!re(e))return e}}function H(e,t){let r=X(e),n=X(t);if(r!==n)return false;let i=x(e),o=x(t);if(i&&o)return e.component===t.component;if(i!==o)return false;if(re(e)||re(t))return e===t;let s=e,a=t;return s.nodeType!==a.nodeType?false:s.nodeType===Node.ELEMENT_NODE?s.tagName===a.tagName:true}function le(e){if(ne(e))return e;if(re(e)){let t=me(e)?"":String(e);return document.createTextNode(t)}return e}function tn(e){return e instanceof HTMLInputElement}function rn(e){return e instanceof HTMLSelectElement}function nn(e){return e instanceof HTMLTextAreaElement}function Ft(e){return e instanceof Text}function on(e,t){if(e===t)return true;if(!e||!t||Array.isArray(e)!==Array.isArray(t))return false;for(let r in e)if(e[r]!==t[r])return false;for(let r in t)if(!(r in e))return false;return true}function Ht(e,t){if(x(e)||x(t))return;let r=X(e);r&&!X(t)&&We(t,r);}function q(e,t,r){if(r===t)return t;let n=ne(t);if(ne(r)&&n){if(r.isEqualNode(t))return t;if(t.tagName===r.tagName){let a=t.attributes,c=r.attributes;for(let l=a.length-1;l>=0;l--){let f=a[l].name;r.hasAttribute(f)||t.removeAttribute(f);}for(let l=0,f=c.length;l<f;l++){let u=c[l];t.getAttribute(u.name)!==u.value&&t.setAttribute(u.name,u.value);}return Ht(t,r),t}}if(Ft(t)&&Ft(r))return t.textContent!==r.textContent&&(t.textContent=r.textContent),Ht(t,r),t;let o=x(t),s=x(r);return o&&s&&t.component===r.component?r.update(t):(Xt(e,r,t),r)}function sn(e,t,r,n){let i=t.length,o=r.length;if(i===0&&o===0)return [];if(i===0){for(let s=0;s<o;s++)N(e,r[s],n);return r}if(o===0){for(let s=0;s<i;s++)z(t[s]);return []}if(i===1&&o===1){let s=t[0],a=r[0];return H(s,a)?(q(e,s,a),r[0]=s):Xt(e,a,s),r}if(i===2&&o===2){let s=t[0],a=t[1],c=r[0],l=r[1];if(H(s,c)&&H(a,l))return q(e,s,c),q(e,a,l),r[0]=s,r[1]=a,r;if(H(s,l)&&H(a,c)){q(e,s,l),q(e,a,c);let f=J(a),u=J(s);return f&&u&&f.parentNode===e&&e.insertBefore(f,u),r[0]=a,r[1]=s,r}}return an(e,t,r,n)}function an(e,t,r,n){let i=0,o=0,s=t.length-1,a=r.length-1,c=t[0],l=t[s],f=r[0],u=r[a];for(;i<=s&&o<=a;)if(!c)c=t[++i];else if(!l)l=t[--s];else if(H(c,f))q(e,c,f),r[o]=c,c=t[++i],f=r[++o];else break;for(;i<=s&&o<=a;)if(!c)c=t[++i];else if(!l)l=t[--s];else if(H(l,u))q(e,l,u),r[a]=l,l=t[--s],u=r[--a];else break;if(i>s){if(o<=a){let m=a+1<r.length?J(r[a+1]):n;for(let y=o;y<=a;y++)N(e,r[y],m);}}else if(o>a)for(let m=i;m<=s;m++){let y=t[m];y&&z(y);}else cn(e,t,r,i,s,o,a,n);return r}function cn(e,t,r,n,i,o,s,a){let c=s-o+1,l=r.length,f;for(let k=o;k<=s;k++){let T=X(r[k]);T!==void 0&&(f||(f=Object.create(null)),f[T]=k);}let u=new Int32Array(c),m=false,y=0,_=0;for(let k=n;k<=i;k++){let T=t[k];if(!T)continue;if(_>=c){z(T);continue}let I,W=X(T);if(W!==void 0&&f&&W in f)I=f[W];else for(let j=o;j<=s;j++)if(u[j-o]===0&&W===void 0&&X(r[j])===void 0&&H(T,r[j])){I=j;break}I===void 0?z(T):(u[I-o]=k+1,I>=y?y=I:m=true,q(e,T,r[I]),r[I]=T,_++);}let D=m?ln(u):[],Ae=D.length-1;for(let k=c-1;k>=0;k--){let T=o+k,I=r[T],W=T+1<l?J(r[T+1]):a;if(u[k]===0)N(e,I,W);else if(m)if(Ae<0||k!==D[Ae]){let j=J(I);j&&j.parentNode===e&&N(e,j,W);}else Ae--;}}function ln(e){let t=e.length;if(t===0)return [];if(t===1)return e[0]!==0?[0]:[];let r=[],n=new Int32Array(t),i,o,s,a,c;for(i=0;i<t;i++){let l=e[i];if(l!==0){if(o=r[r.length-1],r.length===0||e[o]<l){n[i]=o,r.push(i);continue}for(s=0,a=r.length-1;s<a;)c=s+a>>1,e[r[c]]<l?s=c+1:a=c;l<e[r[s]]&&(s>0&&(n[i]=r[s-1]),r[s]=i);}}for(s=r.length,a=r[s-1];s-- >0;)r[s]=a,a=n[a];return r}function K(e,t,r,n){e.addEventListener(t,r,n),Ve(()=>{e.removeEventListener(t,r,n);});}function bi(e,t,r,n){if(tn(e))switch(e.type){case "checkbox":K(e,"change",()=>{n(!!e.checked);});break;case "radio":K(e,"change",()=>{n(e.checked?e.value:"");});break;case "file":K(e,"change",()=>{n(e.files);});break;case "number":case "range":K(e,"input",()=>{n(e.value||"");});break;case "date":case "datetime-local":case "month":case "time":case "week":K(e,"change",()=>{n(e.value||"");});break;default:K(e,"input",()=>{n(e.value);});break}else rn(e)?K(e,"change",()=>{if(e.multiple){let i=Array.from(e.options).filter(o=>o.selected).map(o=>o.value);n(i);}else n(e.value);}):nn(e)&&K(e,"input",()=>{n(e.value);});}function un(e,t,r){if(!e)return;let n=U(),i=[],o=_e(()=>{let s=()=>{let a=S(t)?t():t,c=Ce(a).map(l=>S(l)?l():l).flatMap(l=>l).map(le);i=sn(e,i,c,r);};n&&!n.isDestroyed?te(n,s):s();});return Ve(()=>{o(),i.forEach(s=>z(s)),i.length=0;}),i}function fn(e,t){let r=t.length,n=new Array(r),i=new Set(t),o=1,s=0,a=c=>{if(c.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){if(i.has(o)&&(n[s++]=c,s===r))return true;o++;}let l=c.firstChild;for(;l;){if(a(l))return true;l=l.nextSibling;}return false};return a(e),n}function hn(e){let t=U();if(!t){p("onMount() must be called within a scope");return}if(t.isMounted){try{e();}catch(r){p(`Scope(${t.id}): Error in mount hook:`,r);}return}t.onMount||(t.onMount=new Set),t.onMount.add(e);}function dn(e){let t=U();if(!t){p("onUpdate() must be called within a scope");return}t.onUpdate||(t.onUpdate=new Set),t.onUpdate.add(e);}function pn(e){let t=U();if(!t){p("onDestroy() must be called within a scope");return}t.onDestroy||(t.onDestroy=new Set),t.onDestroy.add(e);}function mn(e){!e||e.isDestroyed||e.isMounted||(e.isMounted=true,e.onMount&&te(e,()=>{for(let t of e.onMount)try{t();}catch(r){p(`Scope(${e.id}): Error in mount hook:`,r);}}));}function qt(e){if(!(!e||e.isDestroyed)&&e.onUpdate)for(let t of e.onUpdate)try{t();}catch(r){p(`Scope(${e.id}): Error in update hook:`,r);}}function gn(e){hn(e);}function vn(e){pn(e);}function yi(e){dn(e);}var Jt;Jt="normal";var bn=class{constructor(e,t={}){this.component=e,this.props=t,this.renderedNodes=[],this.scope=null,this.parentNode=void 0,this.beforeNode=void 0,this.reactiveProps={},this.state=0,this.parentScope=null,this[Jt]=true,this.key=t.key?Gt(t.key):Qr(e),this.reactiveProps=we(Bt({},t||{})),this.parentScope=U();}get isConnected(){return this.state===2}get firstChild(){for(let e of this.renderedNodes){let t=J(e);if(t)return t}}mount(e,t){var r;if(this.parentNode=e,this.beforeNode=t,this.state=1,this.renderedNodes.length>0){for(let o of this.renderedNodes)N(e,o,t);return this.state=2,this.renderedNodes}let n=(r=this.parentScope)!=null?r:U();this.scope=Vr(n);let i=te(this.scope,()=>{var o;let s=this.component(this.reactiveProps);return S(s)&&(s=s(this.reactiveProps)),(w(s)||Y(s))&&(s=s.value),(o=un(e,s,t))!=null?o:[]});return this.renderedNodes=i,te(this.scope,()=>{this.applyProps(this.props||{});}),this.state=2,this.scope&&mn(this.scope),this.renderedNodes}update(e){if(this.key!==e.key)return this.mount(e.parentNode,e.beforeNode),this;if(this.parentNode=e.parentNode,this.beforeNode=e.beforeNode,this.scope=e.scope,this.parentScope=e.parentScope,this.renderedNodes=e.renderedNodes,this.state=e.state,this.reactiveProps=e.reactiveProps,this.props)for(let t in this.props){if(t==="key")continue;let r=this.props[t],n=this.reactiveProps[t];Object.is(n,r)||d(n)&&d(r)&&on(n,r)||(this.reactiveProps[t]=r);}return !this.isConnected&&this.parentNode&&this.mount(this.parentNode,this.beforeNode),this.scope&&(te(this.scope,()=>{this.applyProps(this.props||{});}),qt(this.scope)),this}forceUpdate(){return qe(this,null,function*(){if(yield Promise.resolve(),this.state===5||!this.parentNode||!this.scope)return;let e=[...this.renderedNodes];try{te(this.scope,()=>{let t=this.component(this.reactiveProps);S(t)&&(t=t(this.reactiveProps)),(w(t)||Y(t))&&(t=t.value);let r=Ce(t);if(this.parentNode){let n=this.beforeNode;if(!n&&this.renderedNodes.length>0){let i=this.renderedNodes[this.renderedNodes.length-1],o=J(i);o&&(n=o.nextSibling);}for(let i of this.renderedNodes)z(i);for(let i of r)N(this.parentNode,i,n);this.renderedNodes=r;}}),this.scope&&qt(this.scope);}catch(t){throw this.renderedNodes=e,t}})}destroy(){if(this.state===4||this.state===5)return;this.state=4;let e=this.scope;e&&(Vt(e),this.scope=null);for(let t of this.renderedNodes)z(t);this.renderedNodes=[],this.parentNode=void 0,this.beforeNode=void 0,this.parentScope=null,this.reactiveProps={},this.props={},this.state=5;}applyProps(e){if(!e)return;let t=this.firstChild;for(let[r,n]of Object.entries(e))if(et(r,Yr)&&t){let i=r.slice(2).toLowerCase();ne(t)&&K(t,i,n);}else r===Xr&&w(n)&&(n.value=t);this.props=e;}};function x(e){return !!e&&!!e.normal}function Zt(e,t){return x(e)?e:new bn(e,t)}function yn(e){let t,r=()=>{let n=document.createElement("template");n.innerHTML=e;let i=n.content.firstChild;if(!i)throw new Error("Invalid template: empty content");return i};return ()=>(t||(t=r())).cloneNode(true)}function Si(e,t){let r=b(t)?document.querySelector(t):t;if(!r){p(`Target element not found: ${t}`);return}r.innerHTML&&(p(`Target element is not empty, it will be delete: ${t}`),r.innerHTML="");let i=Zt(e);return i.mount(r),i}function Sn(e,t){let r=U();if(!r){p("provide() must be called within a scope");return}r.provides||(r.provides=new Map),r.provides.set(e,t);}function wn(e,t){let r=U();if(!r)return p("inject() must be called within a scope"),t;let n=r;for(;n;){if(n.provides){let i=n.provides.get(e);if(i)return i}n=n.parent;}return t}function En(e){let t=e.target,r=`${e.type}`,n=e.target,i=e.currentTarget,o=c=>Object.defineProperty(e,"target",{configurable:true,value:c}),s=()=>{let c=t[`_$${r}`];if(c&&S(c)&&!t.disabled){let l=t[`${r}Data`];if(l?c.call(t,l,e):c.call(t,e),e.cancelBubble)return false}return t.host&&!b(t.host)&&!t.host._$host&&S(t.contains)&&t.contains(e.target)&&o(t.host),true},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let c=e.composedPath();o(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();o(n);}var zt=Symbol("_$EVENTS");function wi(e,t=window.document){let r=t,n=r[zt]||(r[zt]=new Set);for(let i of e)n.has(i)||(n.add(i),t.addEventListener(i,En));}function Ei(e,t,r,n=false){if(t===r)return;let i=Be(r),o=Be(t);i&&o===i||(i?n?e.setAttribute("class",i):e.className=i:e.removeAttribute("class"));}function Be(e){if(e==null)return "";if(typeof e=="string")return e.trim();if(P(e))return e.map(Be).filter(Boolean).join(" ");if(d(e)){let t=[];for(let r in e)e[r]&&t.push(r);return t.join(" ")}return String(e).trim()}var Wt=/\s*!important$/,_n=["Webkit","Moz","ms"],He={};function _i(e,t,r){let n=e.style,i=b(r);if(r&&i){t!==r&&(n.cssText=r);return}if(!r){t&&e.removeAttribute("style");return}if(t&&!b(t))for(let o in t)(!r||r[o]==null)&&ke(n,o,"");else if(t&&b(t)){let o=t.split(";");for(let s of o){let a=s.indexOf(":");if(a>0){let c=s.slice(0,a).trim();r&&d(r)&&r[c]==null&&ke(n,c,"");}}}if(r&&!b(r))for(let o in r){let s=r[o];(!t||b(t)||t[o]!==s)&&s!=null&&ke(n,o,s);}}function ke(e,t,r){if(P(r)){for(let i of r)ke(e,t,i);return}if((r==null||r==="")&&(r=""),t.startsWith("--")){e.setProperty(t,r);return}let n=kn(e,t);typeof r=="string"&&Wt.test(r)?e.setProperty(Me(n),r.replace(Wt,""),"important"):e[n]=r;}function kn(e,t){let r=He[t];if(r)return r;let n=Me(t);if(n!=="filter"&&n in e)return He[t]=n;n=rt(n);for(let i of _n){let o=i+n;if(o in e)return He[t]=o}return t}function An(e,t,r,n){if(t===Jr){n==null?We(e,void 0):We(e,String(n));return}if(t===Gr){d(n)||g("spread attribute must be an object"),Object.keys(n).forEach(u=>{An(e,u,r==null?void 0:r[u],n==null?void 0:n[u]);});return}let i=(e==null?void 0:e.namespaceURI)===Zr,o=i&&t.startsWith("xlink:"),s=i&&t.startsWith("xmlns:"),a=it(t)||ot(t);if(r===n)return;let c=t.toLowerCase();if(/^on[a-z]+/.test(c)||c==="innerhtml")return;if(n==null){if(o)e.removeAttributeNS(jt,t.slice(6));else if(s){let u=t.slice(6);e.removeAttributeNS($t,u);}else e.removeAttribute(t);return}if(o){e.setAttributeNS(jt,t,String(n));return}if(s){e.setAttributeNS($t,t,String(n));return}if(a){st(n)?e.setAttribute(t,""):e.removeAttribute(t);return}let l=Te(n)?String(n):n;if((c==="href"||c==="src"||c==="xlink:href")&&typeof l=="string"){let u=l.trim().toLowerCase();if(u.startsWith("javascript:")||u.startsWith("data:"))return}if(i)e.setAttribute(t,String(l));else if(t in e)try{e[t]=l;}catch(u){e.setAttribute(t,String(l));}else e.setAttribute(t,String(l));}function ki(e,t,r,n){if(!(n!=null&&n.delegate))return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n);let i=n.delegate,o=a=>{let c=a.target;(c.matches(i)||c.closest(i))&&r.call(e,a);},s=Bt({},n);return s.delegate=void 0,e.addEventListener(t,o,s),()=>{e.removeEventListener(t,o,s);}}function xn(e){{if(!e)return p("Fragment component requires props"),null;if(!e.children)return p("Fragment component requires children"),null}return e==null?void 0:e.children}xn.fragment=true;function Ai(e){return !!e&&!!e.fragment}function Tn(e){if(typeof document=="undefined"){let n=e.children;return n?(P(n)?n:[n]).map(o=>String(o||"")).join(""):""}let t=document.createComment("portal");t.portal=true;let r=e.children;if(r){let n=P(r)?r:[r],i=[];gn(()=>{let o=b(e.target)?document.querySelector(e.target):e.target;if(!o){g(`[Portal] Target element not found: ${e.target}`);return}n.forEach(s=>{if(s!=null){let a=le(s);a&&(N(o,a),i.push(a));}}),Ve(()=>{i.forEach(s=>{typeof s!="string"&&s.parentNode===o&&o.removeChild(s);});});});}return t}Tn.portal=true;function xi(e){return !!e&&!!e.portal}var Qt=Symbol("SuspenseContext");function Ln(e){if(Qe(document)){let u=e.fallback;return u?String(u||""):""}let t=document.createElement("div");t.style.display="contents";let r=true,n=0,i=false,o=null,s=()=>{if(!i){for(i=true;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let u=le(e.fallback);u&&N(t,u);}}},a=()=>{if(!(!i||!(o||e.children!=null&&!he(e.children)))){for(i=false;t.firstChild;)t.removeChild(t.firstChild);o?c(o):e.children!=null&&!he(e.children)&&c(e.children);}},c=u=>{for(;t.firstChild;)t.removeChild(t.firstChild);if(u==null)return;let m=U();if((P(u)?u:[u]).forEach(_=>{if(_!=null){x(_)&&(_.parentContext=m);let D=le(_);D&&N(t,D);}}),i){for(;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let _=le(e.fallback);_&&N(t,_);}}},l={register:u=>{n++,s(),u.then(()=>{r&&(n--,n===0&&a());}).catch(m=>{g("[Suspense] Resource failed:",m),r&&(n--,n===0&&a());});},increment:()=>{n++,s();},decrement:()=>{n--,n===0&&a();}};Sn(Qt,l);let f=e.children;return he(f)?(f.then(u=>{o=u;}).catch(()=>{}),l.register(f)):f!=null?c(f):s(),vn(()=>{for(r=false;t.firstChild;)t.removeChild(t.firstChild);}),t}Ln.suspense=true;function Ti(e){return !!e&&!!e.suspense}function Li(e,t){let r=ce(t==null?void 0:t.initialValue),n=ce(true),i=ce(null),o=ce("pending"),s=0,a=null,c=()=>qe(null,null,function*(){let u=++s;n.value=true,o.value="pending",i.value=null;try{let m=e();a=m.then(()=>{}).catch(()=>{});let y=yield m;u===s&&(r.value=y,o.value="ready",n.value=!1);}catch(m){u===s&&(i.value=m instanceof Error?m:new Error(String(m)),o.value="errored",n.value=false);}});c();let l=(()=>{if(n.value&&a){let u=wn(Qt,null);u&&u.register(a);}return r.value});return l.loading=n,l.error=i,l.state=o,[l,{mutate:u=>{r.value=u,o.value="ready",n.value=false,i.value=null;},refetch:()=>qe(null,null,function*(){yield c();})}]}var er=0;function Cn(){return `${er++}`}function tr(){er=0;}function ue(e,t=false){return Je(e)?"":b(e)?e:P(e)?e.map(r=>ue(r,t)).join(""):S(e)?ue(e(),t):String(e)}function Pn(e,t){let r=/^<([a-z]+)(\s*)([^>]*)>/i,n=/data-idx="(\d+)"/g,i=/<!--(.*?)-->/g;return e.replace(r,`<$1$2$3 data-hk="${t}">`).replaceAll(n,`data-idx="${t}-$1"`).replaceAll(i,`<!--${t}-$1-->`)}function Ci(e,t={}){if(!S(e))return p("Component must be a function"),"";tr();let r=e(t);return ue(r)}function Pi(e,t,...r){let n="",i=0;for(let s of e)if(n+=s,i<r.length){let a=r[i++];a&&(n+=ue(a));}return Pn(n,t)}function Mi(e,t={}){if(!S(e))return p("create ssg component: Component is not a function"),"";let r=e(t);return ue(r)}function rr(e){if(P(e)){let t={};for(let r of e){let n=b(r)?On(r):rr(r);if(n)for(let i in n)t[i]=n[i];}return t}if(b(e)||d(e))return e}var Mn=/;(?![^(]*\))/g,In=/:([\s\S]+)/,Rn=/\/\*[\s\S]*?\*\//g;function On(e){let t={};return e.replaceAll(Rn,"").split(Mn).forEach(r=>{if(r){let n=r.split(In);n.length>1&&(t[n[0].trim()]=n[1].trim());}}),t}function Nn(e){if(!e)return "";if(b(e))return e;let t="";for(let r in e){let n=e[r];if(b(n)||xe(n)){let i=r.startsWith("--")?r:tt(r);t+=`${i}:${n};`;}}return t}function nr(e){let t="";if(b(e))t=e;else if(P(e))for(let r of e){let n=nr(r);n&&(t+=`${n} `);}else if(d(e))for(let r in e)e[r]&&(t+=`${r} `);return t.trim()}function Dn(e,t,r){if(w(t)||Y(t))return Dn(e,t.value);if(!t&&t!==0)return "";if(e==="style"){let n=rr(t);return n?b(n)?` style="${n}"`:` style="${Nn(n)}"`:""}if(e==="class"){let n=nr(t);return n?` class="${n}"`:""}return e.startsWith("on")?"":t===true?` ${e}`:` ${e}="${t}"`}function Ii(e){return ()=>{let t=Cn();return document.querySelector(`[data-hk="${t}"]`)||yn(e)()}}function Ri(e,t){let r=e.dataset.hk;if(!r)return fn(e,t);let n=[],i=e.querySelectorAll(`[data-idx^="${r}"]`);i.length>0&&n.push(...Array.from(i).filter(c=>{let l=c.dataset.idx;return l!==null&&Kt.test(l)}).map(c=>{let l=c.dataset.idx||"",[f,u]=l.split("-");return {hk:f,idx:u,node:c}}));let o=[],s=c=>{if(c.nodeType===Node.COMMENT_NODE&&c.textContent&&Kt.test(c.textContent)){let[f,u]=c.textContent.split("-");o.push({hk:f,idx:u,node:c});}let l=c.firstChild;for(;l;)s(l),l=l.nextSibling;};s(e),n.push(...o);let a=[e];return t.forEach(c=>{let l=n.find(f=>f.idx===String(c));l&&a.push(l.node);}),a}function Oi(e,t,r={}){tr();try{let n=b(t)?document.querySelector(t):t;if(!n){p("Hydration error: Root element not found");return}let i=Zt(e,r);return i.mount(n),i}catch(n){p("Hydration error:",n);return}}globalThis&&(globalThis.__essor_version__=Ye);/**
|
|
18
|
+
* @estjs/signals v0.0.15-beta.7
|
|
13
19
|
* (c) 2023-Present jiangxd <jiangxd2016@gmail.com>
|
|
14
20
|
* @license MIT
|
|
15
21
|
**/
|
|
16
22
|
/**
|
|
17
|
-
* @estjs/template v0.0.15-beta.
|
|
23
|
+
* @estjs/template v0.0.15-beta.7
|
|
18
24
|
* (c) 2023-Present jiangxd <jiangxd2016@gmail.com>
|
|
19
25
|
* @license MIT
|
|
20
|
-
**/exports.Component=bn;exports.Fragment=xn;exports.Portal=Tn;exports.Suspense=Ln;exports.SuspenseContext=Qt;exports.TriggerOpTypes=
|
|
26
|
+
**/exports.Component=bn;exports.Fragment=xn;exports.Portal=Tn;exports.Suspense=Ln;exports.SuspenseContext=Qt;exports.TriggerOpTypes=L;exports.__version=Ye;exports.addEvent=ki;exports.addEventListener=K;exports.batch=pt;exports.bindElement=bi;exports.computed=$r;exports.createApp=Si;exports.createComponent=Zt;exports.createResource=Li;exports.createSSGComponent=Mi;exports.createStore=si;exports.delegateEvents=wi;exports.effect=_e;exports.endBatch=Nr;exports.escapeHTML=lr;exports.getBatchDepth=ri;exports.getHydrationKey=Cn;exports.getRenderedElement=Ii;exports.hydrate=Oi;exports.inject=wn;exports.insert=un;exports.isBatching=Dr;exports.isComponent=x;exports.isComputed=Y;exports.isEffect=ii;exports.isFragment=Ai;exports.isPortal=xi;exports.isReactive=V;exports.isRef=Ot;exports.isShallow=O;exports.isSignal=w;exports.isSuspense=Ti;exports.mapNodes=fn;exports.mapSSRNodes=Ri;exports.memoEffect=oi;exports.nextTick=Pr;exports.normalizeClass=Be;exports.omitProps=vi;exports.onDestroy=vn;exports.onMount=gn;exports.onUpdate=yi;exports.patchAttr=An;exports.patchClass=Ei;exports.patchStyle=_i;exports.provide=Sn;exports.queueJob=Ee;exports.queuePreFlushCb=Mr;exports.reactive=Se;exports.ref=ai;exports.render=Pi;exports.renderToString=Ci;exports.setSSGAttr=Dn;exports.setStyle=ke;exports.shallowReactive=we;exports.shallowSignal=ti;exports.signal=ce;exports.startBatch=Or;exports.stop=ni;exports.template=yn;exports.toRaw=h;exports.toReactive=ei;exports.trigger=A;exports.untrack=Qn;exports.watch=ci;//# sourceMappingURL=essor.cjs.js.map
|
|
21
27
|
//# sourceMappingURL=essor.cjs.js.map
|