@geodaoyu/accessor 2.0.1 → 3.0.0

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Lt(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Wt=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ht=()=>{},ot=Object.assign,$t=Object.prototype.hasOwnProperty,ct=(t,e)=>$t.call(t,e),V=Array.isArray,P=t=>et(t)==="[object Map]",Ct=t=>et(t)==="[object Set]",wt=t=>typeof t=="function",zt=t=>typeof t=="string",F=t=>typeof t=="symbol",K=t=>t!==null&&typeof t=="object",Yt=Object.prototype.toString,et=t=>Yt.call(t),yt=t=>et(t).slice(8,-1),Bt=t=>et(t)==="[object Object]",dt=t=>zt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ft=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},Ut=Ft(t=>t.charAt(0).toUpperCase()+t.slice(1)),m=(t,e)=>!Object.is(t,e);function S(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let u;const rt=new WeakSet;class Gt{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,rt.has(this)&&(rt.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Jt(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Et(this),Nt(this);const e=u,n=g;u=this,g=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&u!==this&&S("Active effect was not restored correctly - this is likely a Vue internal bug."),xt(this),u=e,g=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)_t(e);this.deps=this.depsTail=void 0,Et(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?rt.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){at(this)&&this.run()}get dirty(){return at(this)}}let Dt=0,$,C;function Jt(t,e=!1){if(t.flags|=8,e){t.next=C,C=t;return}t.next=$,$=t}function ht(){Dt++}function vt(){if(--Dt>0)return;if(C){let e=C;for(C=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;$;){let e=$;for($=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=n}}if(t)throw t}function Nt(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function xt(t){let e,n=t.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),_t(s),qt(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}t.deps=e,t.depsTail=n}function at(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Qt(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Qt(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===k)||(t.globalVersion=k,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!at(t))))return;t.flags|=2;const e=t.dep,n=u,s=g;u=t,g=!0;try{Nt(t);const r=t.fn(t._value);(e.version===0||m(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{u=n,g=s,xt(t),t.flags&=-3}}function _t(t,e=!1){const{dep:n,prevSub:s,nextSub:r}=t;if(s&&(s.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=s,t.nextSub=void 0),process.env.NODE_ENV!=="production"&&n.subsHead===t&&(n.subsHead=r),n.subs===t&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)_t(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function qt(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let g=!0;const Tt=[];function mt(){Tt.push(g),g=!1}function Rt(){const t=Tt.pop();g=t===void 0?!0:t}function Et(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=u;u=void 0;try{e()}finally{u=n}}}let k=0;class Xt{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Zt{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!u||!g||u===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==u)n=this.activeLink=new Xt(u,this),u.deps?(n.prevDep=u.depsTail,u.depsTail.nextDep=n,u.depsTail=n):u.deps=u.depsTail=n,Vt(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=u.depsTail,n.nextDep=void 0,u.depsTail.nextDep=n,u.depsTail=n,u.deps===n&&(u.deps=s)}return process.env.NODE_ENV!=="production"&&u.onTrack&&u.onTrack(ot({effect:u},e)),n}trigger(e){this.version++,k++,this.notify(e)}notify(e){ht();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(ot({effect:n.sub},e));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{vt()}}}function Vt(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)Vt(s)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),process.env.NODE_ENV!=="production"&&t.dep.subsHead===void 0&&(t.dep.subsHead=t),t.dep.subs=t}}const ft=new WeakMap,R=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),lt=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Y=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function _(t,e,n){if(g&&u){let s=ft.get(t);s||ft.set(t,s=new Map);let r=s.get(n);r||(s.set(n,r=new Zt),r.map=s,r.key=n),process.env.NODE_ENV!=="production"?r.track({target:t,type:e,key:n}):r.track()}}function y(t,e,n,s,r,i){const o=ft.get(t);if(!o){k++;return}const c=a=>{a&&(process.env.NODE_ENV!=="production"?a.trigger({target:t,type:e,key:n,newValue:s,oldValue:r,oldTarget:i}):a.trigger())};if(ht(),e==="clear")o.forEach(c);else{const a=V(t),d=a&&dt(n);if(a&&n==="length"){const v=Number(s);o.forEach((f,h)=>{(h==="length"||h===Y||!F(h)&&h>=v)&&c(f)})}else switch((n!==void 0||o.has(void 0))&&c(o.get(n)),d&&c(o.get(Y)),e){case"add":a?d&&c(o.get("length")):(c(o.get(R)),P(t)&&c(o.get(lt)));break;case"delete":a||(c(o.get(R)),P(t)&&c(o.get(lt)));break;case"set":P(t)&&c(o.get(R));break}}vt()}function A(t){const e=p(t);return e===t?e:(_(e,"iterate",Y),w(t)?e:e.map(I))}function gt(t){return _(t=p(t),"iterate",Y),t}function O(t,e){return j(t)?z(t)?B(I(e)):B(e):I(e)}const kt={__proto__:null,[Symbol.iterator](){return st(this,Symbol.iterator,t=>O(this,t))},concat(...t){return A(this).concat(...t.map(e=>V(e)?A(e):e))},entries(){return st(this,"entries",t=>(t[1]=O(this,t[1]),t))},every(t,e){return E(this,"every",t,e,void 0,arguments)},filter(t,e){return E(this,"filter",t,e,n=>n.map(s=>O(this,s)),arguments)},find(t,e){return E(this,"find",t,e,n=>O(this,n),arguments)},findIndex(t,e){return E(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return E(this,"findLast",t,e,n=>O(this,n),arguments)},findLastIndex(t,e){return E(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return E(this,"forEach",t,e,void 0,arguments)},includes(...t){return it(this,"includes",t)},indexOf(...t){return it(this,"indexOf",t)},join(t){return A(this).join(t)},lastIndexOf(...t){return it(this,"lastIndexOf",t)},map(t,e){return E(this,"map",t,e,void 0,arguments)},pop(){return H(this,"pop")},push(...t){return H(this,"push",t)},reduce(t,...e){return St(this,"reduce",t,e)},reduceRight(t,...e){return St(this,"reduceRight",t,e)},shift(){return H(this,"shift")},some(t,e){return E(this,"some",t,e,void 0,arguments)},splice(...t){return H(this,"splice",t)},toReversed(){return A(this).toReversed()},toSorted(t){return A(this).toSorted(t)},toSpliced(...t){return A(this).toSpliced(...t)},unshift(...t){return H(this,"unshift",t)},values(){return st(this,"values",t=>O(this,t))}};function st(t,e,n){const s=gt(t),r=s[e]();return s!==t&&!w(t)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const te=Array.prototype;function E(t,e,n,s,r,i){const o=gt(t),c=o!==t&&!w(t),a=o[e];if(a!==te[e]){const f=a.apply(t,i);return c?I(f):f}let d=n;o!==t&&(c?d=function(f,h){return n.call(this,O(t,f),h,t)}:n.length>2&&(d=function(f,h){return n.call(this,f,h,t)}));const v=a.call(o,d,s);return c&&r?r(v):v}function St(t,e,n,s){const r=gt(t);let i=n;return r!==t&&(w(t)?n.length>3&&(i=function(o,c,a){return n.call(this,o,c,a,t)}):i=function(o,c,a){return n.call(this,o,O(t,c),a,t)}),r[e](i,...s)}function it(t,e,n){const s=p(t);_(s,"iterate",Y);const r=s[e](...n);return(r===-1||r===!1)&&ve(n[0])?(n[0]=p(n[0]),s[e](...n)):r}function H(t,e,n=[]){mt(),ht();const s=p(t)[e].apply(t,n);return vt(),Rt(),s}const ee=Lt("__proto__,__v_isRef,__isVue"),jt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(F));function ne(t){F(t)||(t=String(t));const e=p(this);return _(e,"has",t),e.hasOwnProperty(t)}class It{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,s){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?pe:Pt:i?ue:At).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=V(e);if(!r){let a;if(o&&(a=kt[n]))return a;if(n==="hasOwnProperty")return ne}const c=Reflect.get(e,n,N(e)?e:s);if((F(n)?jt.has(n):ee(n))||(r||_(e,"get",n),i))return c;if(N(c)){const a=o&&dt(n)?c:c.value;return r&&K(a)?pt(a):a}return K(c)?r?pt(c):bt(c):c}}class re extends It{constructor(e=!1){super(!1,e)}set(e,n,s,r){let i=e[n];const o=V(e)&&dt(n);if(!this._isShallow){const d=j(i);if(!w(s)&&!j(s)&&(i=p(i),s=p(s)),!o&&N(i)&&!N(s))return d?(process.env.NODE_ENV!=="production"&&S(`Set operation on key "${String(n)}" failed: target is readonly.`,e[n]),!0):(i.value=s,!0)}const c=o?Number(n)<e.length:ct(e,n),a=Reflect.set(e,n,s,N(e)?e:r);return e===p(r)&&(c?m(s,i)&&y(e,"set",n,s,i):y(e,"add",n,s)),a}deleteProperty(e,n){const s=ct(e,n),r=e[n],i=Reflect.deleteProperty(e,n);return i&&s&&y(e,"delete",n,void 0,r),i}has(e,n){const s=Reflect.has(e,n);return(!F(n)||!jt.has(n))&&_(e,"has",n),s}ownKeys(e){return _(e,"iterate",V(e)?"length":R),Reflect.ownKeys(e)}}class se extends It{constructor(e=!1){super(!0,e)}set(e,n){return process.env.NODE_ENV!=="production"&&S(`Set operation on key "${String(n)}" failed: target is readonly.`,e),!0}deleteProperty(e,n){return process.env.NODE_ENV!=="production"&&S(`Delete operation on key "${String(n)}" failed: target is readonly.`,e),!0}}const ie=new re,oe=new se,ut=t=>t,q=t=>Reflect.getPrototypeOf(t);function ce(t,e,n){return function(...s){const r=this.__v_raw,i=p(r),o=P(i),c=t==="entries"||t===Symbol.iterator&&o,a=t==="keys"&&o,d=r[t](...s),v=n?ut:e?B:I;return!e&&_(i,"iterate",a?lt:R),{next(){const{value:f,done:h}=d.next();return h?{value:f,done:h}:{value:c?[v(f[0]),v(f[1])]:v(f),done:h}},[Symbol.iterator](){return this}}}}function X(t){return function(...e){if(process.env.NODE_ENV!=="production"){const n=e[0]?`on key "${e[0]}" `:"";S(`${Ut(t)} operation ${n}failed: target is readonly.`,p(this))}return t==="delete"?!1:t==="clear"?void 0:this}}function ae(t,e){const n={get(r){const i=this.__v_raw,o=p(i),c=p(r);t||(m(r,c)&&_(o,"get",r),_(o,"get",c));const{has:a}=q(o),d=e?ut:t?B:I;if(a.call(o,r))return d(i.get(r));if(a.call(o,c))return d(i.get(c));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!t&&_(p(r),"iterate",R),r.size},has(r){const i=this.__v_raw,o=p(i),c=p(r);return t||(m(r,c)&&_(o,"has",r),_(o,"has",c)),r===c?i.has(r):i.has(r)||i.has(c)},forEach(r,i){const o=this,c=o.__v_raw,a=p(c),d=e?ut:t?B:I;return!t&&_(a,"iterate",R),c.forEach((v,f)=>r.call(i,d(v),d(f),o))}};return ot(n,t?{add:X("add"),set:X("set"),delete:X("delete"),clear:X("clear")}:{add(r){!e&&!w(r)&&!j(r)&&(r=p(r));const i=p(this);return q(i).has.call(i,r)||(i.add(r),y(i,"add",r,r)),this},set(r,i){!e&&!w(i)&&!j(i)&&(i=p(i));const o=p(this),{has:c,get:a}=q(o);let d=c.call(o,r);d?process.env.NODE_ENV!=="production"&&Ot(o,c,r):(r=p(r),d=c.call(o,r));const v=a.call(o,r);return o.set(r,i),d?m(i,v)&&y(o,"set",r,i,v):y(o,"add",r,i),this},delete(r){const i=p(this),{has:o,get:c}=q(i);let a=o.call(i,r);a?process.env.NODE_ENV!=="production"&&Ot(i,o,r):(r=p(r),a=o.call(i,r));const d=c?c.call(i,r):void 0,v=i.delete(r);return a&&y(i,"delete",r,void 0,d),v},clear(){const r=p(this),i=r.size!==0,o=process.env.NODE_ENV!=="production"?P(r)?new Map(r):new Set(r):void 0,c=r.clear();return i&&y(r,"clear",void 0,void 0,o),c}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=ce(r,t,e)}),n}function Mt(t,e){const n=ae(t,e);return(s,r,i)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?s:Reflect.get(ct(n,r)&&r in s?n:s,r,i)}const fe={get:Mt(!1,!1)},le={get:Mt(!0,!1)};function Ot(t,e,n){const s=p(n);if(s!==n&&e.call(t,s)){const r=yt(t);S(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const At=new WeakMap,ue=new WeakMap,Pt=new WeakMap,pe=new WeakMap;function de(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function he(t){return t.__v_skip||!Object.isExtensible(t)?0:de(yt(t))}function bt(t){return j(t)?t:Kt(t,!1,ie,fe,At)}function pt(t){return Kt(t,!0,oe,le,Pt)}function Kt(t,e,n,s,r){if(!K(t))return process.env.NODE_ENV!=="production"&&S(`value cannot be made ${e?"readonly":"reactive"}: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=he(t);if(i===0)return t;const o=r.get(t);if(o)return o;const c=new Proxy(t,i===2?s:n);return r.set(t,c),c}function z(t){return j(t)?z(t.__v_raw):!!(t&&t.__v_isReactive)}function j(t){return!!(t&&t.__v_isReadonly)}function w(t){return!!(t&&t.__v_isShallow)}function ve(t){return t?!!t.__v_raw:!1}function p(t){const e=t&&t.__v_raw;return e?p(e):t}const I=t=>K(t)?bt(t):t,B=t=>K(t)?pt(t):t;function N(t){return t?t.__v_isRef===!0:!1}const Z={},tt=new WeakMap;let T;function _e(t,e=!1,n=T){if(n){let s=tt.get(n);s||tt.set(n,s=[]),s.push(t)}else process.env.NODE_ENV!=="production"&&!e&&S("onWatcherCleanup() was called when there was no active watcher to associate with.")}function ge(t,e,n=Wt){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:c,call:a}=n,d=l=>{(n.onWarn||S)("Invalid watch source: ",l,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},v=l=>r?l:w(l)||r===!1||r===0?D(l,1):D(l);let f,h,L,U,G=!1,J=!1;if(N(t)?(h=()=>t.value,G=w(t)):z(t)?(h=()=>v(t),G=!0):V(t)?(J=!0,G=t.some(l=>z(l)||w(l)),h=()=>t.map(l=>{if(N(l))return l.value;if(z(l))return v(l);if(wt(l))return a?a(l,2):l();process.env.NODE_ENV!=="production"&&d(l)})):wt(t)?e?h=a?()=>a(t,2):t:h=()=>{if(L){mt();try{L()}finally{Rt()}}const l=T;T=f;try{return a?a(t,3,[U]):t(U)}finally{T=l}}:(h=Ht,process.env.NODE_ENV!=="production"&&d(t)),e&&r){const l=h,b=r===!0?1/0:r;h=()=>D(l(),b)}const M=()=>{f.stop()};if(i&&e){const l=e;e=(...b)=>{l(...b),M()}}let x=J?new Array(t.length).fill(Z):Z;const W=l=>{if(!(!(f.flags&1)||!f.dirty&&!l))if(e){const b=f.run();if(r||G||(J?b.some((nt,Q)=>m(nt,x[Q])):m(b,x))){L&&L();const nt=T;T=f;try{const Q=[b,x===Z?void 0:J&&x[0]===Z?[]:x,U];x=b,a?a(e,3,Q):e(...Q)}finally{T=nt}}}else f.run()};return c&&c(W),f=new Gt(h),f.scheduler=o?()=>o(W,!1):W,U=l=>_e(l,!1,f),L=f.onStop=()=>{const l=tt.get(f);if(l){if(a)a(l,4);else for(const b of l)b();tt.delete(f)}},process.env.NODE_ENV!=="production"&&(f.onTrack=n.onTrack,f.onTrigger=n.onTrigger),e?s?W(!0):x=f.run():o?o(W.bind(null,!0),!0):f.run(),M.pause=f.pause.bind(f),M.resume=f.resume.bind(f),M.stop=M,M}function D(t,e=1/0,n){if(e<=0||!K(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,N(t))D(t.value,e,n);else if(V(t))for(let s=0;s<t.length;s++)D(t[s],e,n);else if(Ct(t)||P(t))t.forEach(s=>{D(s,e,n)});else if(Bt(t)){for(const s in t)D(t[s],e,n);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&D(t[s],e,n)}return t}class be{constructor(e){return e&&Object.assign(this,e),bt(this)}}const we={watch:ge};exports.Accessor=be;exports.reactiveUtils=we;
@@ -0,0 +1,900 @@
1
+ // @__NO_SIDE_EFFECTS__
2
+ function Lt(t) {
3
+ const e = /* @__PURE__ */ Object.create(null);
4
+ for (const n of t.split(",")) e[n] = 1;
5
+ return (n) => n in e;
6
+ }
7
+ const Wt = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
8
+ process.env.NODE_ENV !== "production" && Object.freeze([]);
9
+ const Ht = () => {
10
+ }, ot = Object.assign, $t = Object.prototype.hasOwnProperty, ct = (t, e) => $t.call(t, e), V = Array.isArray, P = (t) => et(t) === "[object Map]", Ct = (t) => et(t) === "[object Set]", wt = (t) => typeof t == "function", zt = (t) => typeof t == "string", F = (t) => typeof t == "symbol", K = (t) => t !== null && typeof t == "object", Yt = Object.prototype.toString, et = (t) => Yt.call(t), yt = (t) => et(t).slice(8, -1), Bt = (t) => et(t) === "[object Object]", dt = (t) => zt(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t, Ft = (t) => {
11
+ const e = /* @__PURE__ */ Object.create(null);
12
+ return ((n) => e[n] || (e[n] = t(n)));
13
+ }, Gt = Ft((t) => t.charAt(0).toUpperCase() + t.slice(1)), m = (t, e) => !Object.is(t, e);
14
+ function S(t, ...e) {
15
+ console.warn(`[Vue warn] ${t}`, ...e);
16
+ }
17
+ let u;
18
+ const rt = /* @__PURE__ */ new WeakSet();
19
+ class Ut {
20
+ constructor(e) {
21
+ this.fn = e, this.deps = void 0, this.depsTail = void 0, this.flags = 5, this.next = void 0, this.cleanup = void 0, this.scheduler = void 0;
22
+ }
23
+ pause() {
24
+ this.flags |= 64;
25
+ }
26
+ resume() {
27
+ this.flags & 64 && (this.flags &= -65, rt.has(this) && (rt.delete(this), this.trigger()));
28
+ }
29
+ /**
30
+ * @internal
31
+ */
32
+ notify() {
33
+ this.flags & 2 && !(this.flags & 32) || this.flags & 8 || Jt(this);
34
+ }
35
+ run() {
36
+ if (!(this.flags & 1))
37
+ return this.fn();
38
+ this.flags |= 2, Et(this), Nt(this);
39
+ const e = u, n = g;
40
+ u = this, g = !0;
41
+ try {
42
+ return this.fn();
43
+ } finally {
44
+ process.env.NODE_ENV !== "production" && u !== this && S(
45
+ "Active effect was not restored correctly - this is likely a Vue internal bug."
46
+ ), xt(this), u = e, g = n, this.flags &= -3;
47
+ }
48
+ }
49
+ stop() {
50
+ if (this.flags & 1) {
51
+ for (let e = this.deps; e; e = e.nextDep)
52
+ _t(e);
53
+ this.deps = this.depsTail = void 0, Et(this), this.onStop && this.onStop(), this.flags &= -2;
54
+ }
55
+ }
56
+ trigger() {
57
+ this.flags & 64 ? rt.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty();
58
+ }
59
+ /**
60
+ * @internal
61
+ */
62
+ runIfDirty() {
63
+ at(this) && this.run();
64
+ }
65
+ get dirty() {
66
+ return at(this);
67
+ }
68
+ }
69
+ let Dt = 0, $, C;
70
+ function Jt(t, e = !1) {
71
+ if (t.flags |= 8, e) {
72
+ t.next = C, C = t;
73
+ return;
74
+ }
75
+ t.next = $, $ = t;
76
+ }
77
+ function ht() {
78
+ Dt++;
79
+ }
80
+ function vt() {
81
+ if (--Dt > 0)
82
+ return;
83
+ if (C) {
84
+ let e = C;
85
+ for (C = void 0; e; ) {
86
+ const n = e.next;
87
+ e.next = void 0, e.flags &= -9, e = n;
88
+ }
89
+ }
90
+ let t;
91
+ for (; $; ) {
92
+ let e = $;
93
+ for ($ = void 0; e; ) {
94
+ const n = e.next;
95
+ if (e.next = void 0, e.flags &= -9, e.flags & 1)
96
+ try {
97
+ e.trigger();
98
+ } catch (s) {
99
+ t || (t = s);
100
+ }
101
+ e = n;
102
+ }
103
+ }
104
+ if (t) throw t;
105
+ }
106
+ function Nt(t) {
107
+ for (let e = t.deps; e; e = e.nextDep)
108
+ e.version = -1, e.prevActiveLink = e.dep.activeLink, e.dep.activeLink = e;
109
+ }
110
+ function xt(t) {
111
+ let e, n = t.depsTail, s = n;
112
+ for (; s; ) {
113
+ const r = s.prevDep;
114
+ s.version === -1 ? (s === n && (n = r), _t(s), qt(s)) : e = s, s.dep.activeLink = s.prevActiveLink, s.prevActiveLink = void 0, s = r;
115
+ }
116
+ t.deps = e, t.depsTail = n;
117
+ }
118
+ function at(t) {
119
+ for (let e = t.deps; e; e = e.nextDep)
120
+ if (e.dep.version !== e.version || e.dep.computed && (Qt(e.dep.computed) || e.dep.version !== e.version))
121
+ return !0;
122
+ return !!t._dirty;
123
+ }
124
+ function Qt(t) {
125
+ if (t.flags & 4 && !(t.flags & 16) || (t.flags &= -17, t.globalVersion === k) || (t.globalVersion = k, !t.isSSR && t.flags & 128 && (!t.deps && !t._dirty || !at(t))))
126
+ return;
127
+ t.flags |= 2;
128
+ const e = t.dep, n = u, s = g;
129
+ u = t, g = !0;
130
+ try {
131
+ Nt(t);
132
+ const r = t.fn(t._value);
133
+ (e.version === 0 || m(r, t._value)) && (t.flags |= 128, t._value = r, e.version++);
134
+ } catch (r) {
135
+ throw e.version++, r;
136
+ } finally {
137
+ u = n, g = s, xt(t), t.flags &= -3;
138
+ }
139
+ }
140
+ function _t(t, e = !1) {
141
+ const { dep: n, prevSub: s, nextSub: r } = t;
142
+ if (s && (s.nextSub = r, t.prevSub = void 0), r && (r.prevSub = s, t.nextSub = void 0), process.env.NODE_ENV !== "production" && n.subsHead === t && (n.subsHead = r), n.subs === t && (n.subs = s, !s && n.computed)) {
143
+ n.computed.flags &= -5;
144
+ for (let i = n.computed.deps; i; i = i.nextDep)
145
+ _t(i, !0);
146
+ }
147
+ !e && !--n.sc && n.map && n.map.delete(n.key);
148
+ }
149
+ function qt(t) {
150
+ const { prevDep: e, nextDep: n } = t;
151
+ e && (e.nextDep = n, t.prevDep = void 0), n && (n.prevDep = e, t.nextDep = void 0);
152
+ }
153
+ let g = !0;
154
+ const Tt = [];
155
+ function mt() {
156
+ Tt.push(g), g = !1;
157
+ }
158
+ function Rt() {
159
+ const t = Tt.pop();
160
+ g = t === void 0 ? !0 : t;
161
+ }
162
+ function Et(t) {
163
+ const { cleanup: e } = t;
164
+ if (t.cleanup = void 0, e) {
165
+ const n = u;
166
+ u = void 0;
167
+ try {
168
+ e();
169
+ } finally {
170
+ u = n;
171
+ }
172
+ }
173
+ }
174
+ let k = 0;
175
+ class Xt {
176
+ constructor(e, n) {
177
+ this.sub = e, this.dep = n, this.version = n.version, this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
178
+ }
179
+ }
180
+ class Zt {
181
+ // TODO isolatedDeclarations "__v_skip"
182
+ constructor(e) {
183
+ this.computed = e, this.version = 0, this.activeLink = void 0, this.subs = void 0, this.map = void 0, this.key = void 0, this.sc = 0, this.__v_skip = !0, process.env.NODE_ENV !== "production" && (this.subsHead = void 0);
184
+ }
185
+ track(e) {
186
+ if (!u || !g || u === this.computed)
187
+ return;
188
+ let n = this.activeLink;
189
+ if (n === void 0 || n.sub !== u)
190
+ n = this.activeLink = new Xt(u, this), u.deps ? (n.prevDep = u.depsTail, u.depsTail.nextDep = n, u.depsTail = n) : u.deps = u.depsTail = n, Vt(n);
191
+ else if (n.version === -1 && (n.version = this.version, n.nextDep)) {
192
+ const s = n.nextDep;
193
+ s.prevDep = n.prevDep, n.prevDep && (n.prevDep.nextDep = s), n.prevDep = u.depsTail, n.nextDep = void 0, u.depsTail.nextDep = n, u.depsTail = n, u.deps === n && (u.deps = s);
194
+ }
195
+ return process.env.NODE_ENV !== "production" && u.onTrack && u.onTrack(
196
+ ot(
197
+ {
198
+ effect: u
199
+ },
200
+ e
201
+ )
202
+ ), n;
203
+ }
204
+ trigger(e) {
205
+ this.version++, k++, this.notify(e);
206
+ }
207
+ notify(e) {
208
+ ht();
209
+ try {
210
+ if (process.env.NODE_ENV !== "production")
211
+ for (let n = this.subsHead; n; n = n.nextSub)
212
+ n.sub.onTrigger && !(n.sub.flags & 8) && n.sub.onTrigger(
213
+ ot(
214
+ {
215
+ effect: n.sub
216
+ },
217
+ e
218
+ )
219
+ );
220
+ for (let n = this.subs; n; n = n.prevSub)
221
+ n.sub.notify() && n.sub.dep.notify();
222
+ } finally {
223
+ vt();
224
+ }
225
+ }
226
+ }
227
+ function Vt(t) {
228
+ if (t.dep.sc++, t.sub.flags & 4) {
229
+ const e = t.dep.computed;
230
+ if (e && !t.dep.subs) {
231
+ e.flags |= 20;
232
+ for (let s = e.deps; s; s = s.nextDep)
233
+ Vt(s);
234
+ }
235
+ const n = t.dep.subs;
236
+ n !== t && (t.prevSub = n, n && (n.nextSub = t)), process.env.NODE_ENV !== "production" && t.dep.subsHead === void 0 && (t.dep.subsHead = t), t.dep.subs = t;
237
+ }
238
+ }
239
+ const ft = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ Symbol(
240
+ process.env.NODE_ENV !== "production" ? "Object iterate" : ""
241
+ ), lt = /* @__PURE__ */ Symbol(
242
+ process.env.NODE_ENV !== "production" ? "Map keys iterate" : ""
243
+ ), Y = /* @__PURE__ */ Symbol(
244
+ process.env.NODE_ENV !== "production" ? "Array iterate" : ""
245
+ );
246
+ function _(t, e, n) {
247
+ if (g && u) {
248
+ let s = ft.get(t);
249
+ s || ft.set(t, s = /* @__PURE__ */ new Map());
250
+ let r = s.get(n);
251
+ r || (s.set(n, r = new Zt()), r.map = s, r.key = n), process.env.NODE_ENV !== "production" ? r.track({
252
+ target: t,
253
+ type: e,
254
+ key: n
255
+ }) : r.track();
256
+ }
257
+ }
258
+ function y(t, e, n, s, r, i) {
259
+ const o = ft.get(t);
260
+ if (!o) {
261
+ k++;
262
+ return;
263
+ }
264
+ const c = (a) => {
265
+ a && (process.env.NODE_ENV !== "production" ? a.trigger({
266
+ target: t,
267
+ type: e,
268
+ key: n,
269
+ newValue: s,
270
+ oldValue: r,
271
+ oldTarget: i
272
+ }) : a.trigger());
273
+ };
274
+ if (ht(), e === "clear")
275
+ o.forEach(c);
276
+ else {
277
+ const a = V(t), d = a && dt(n);
278
+ if (a && n === "length") {
279
+ const v = Number(s);
280
+ o.forEach((f, h) => {
281
+ (h === "length" || h === Y || !F(h) && h >= v) && c(f);
282
+ });
283
+ } else
284
+ switch ((n !== void 0 || o.has(void 0)) && c(o.get(n)), d && c(o.get(Y)), e) {
285
+ case "add":
286
+ a ? d && c(o.get("length")) : (c(o.get(R)), P(t) && c(o.get(lt)));
287
+ break;
288
+ case "delete":
289
+ a || (c(o.get(R)), P(t) && c(o.get(lt)));
290
+ break;
291
+ case "set":
292
+ P(t) && c(o.get(R));
293
+ break;
294
+ }
295
+ }
296
+ vt();
297
+ }
298
+ function A(t) {
299
+ const e = p(t);
300
+ return e === t ? e : (_(e, "iterate", Y), w(t) ? e : e.map(j));
301
+ }
302
+ function gt(t) {
303
+ return _(t = p(t), "iterate", Y), t;
304
+ }
305
+ function O(t, e) {
306
+ return I(t) ? z(t) ? B(j(e)) : B(e) : j(e);
307
+ }
308
+ const kt = {
309
+ __proto__: null,
310
+ [Symbol.iterator]() {
311
+ return st(this, Symbol.iterator, (t) => O(this, t));
312
+ },
313
+ concat(...t) {
314
+ return A(this).concat(
315
+ ...t.map((e) => V(e) ? A(e) : e)
316
+ );
317
+ },
318
+ entries() {
319
+ return st(this, "entries", (t) => (t[1] = O(this, t[1]), t));
320
+ },
321
+ every(t, e) {
322
+ return E(this, "every", t, e, void 0, arguments);
323
+ },
324
+ filter(t, e) {
325
+ return E(
326
+ this,
327
+ "filter",
328
+ t,
329
+ e,
330
+ (n) => n.map((s) => O(this, s)),
331
+ arguments
332
+ );
333
+ },
334
+ find(t, e) {
335
+ return E(
336
+ this,
337
+ "find",
338
+ t,
339
+ e,
340
+ (n) => O(this, n),
341
+ arguments
342
+ );
343
+ },
344
+ findIndex(t, e) {
345
+ return E(this, "findIndex", t, e, void 0, arguments);
346
+ },
347
+ findLast(t, e) {
348
+ return E(
349
+ this,
350
+ "findLast",
351
+ t,
352
+ e,
353
+ (n) => O(this, n),
354
+ arguments
355
+ );
356
+ },
357
+ findLastIndex(t, e) {
358
+ return E(this, "findLastIndex", t, e, void 0, arguments);
359
+ },
360
+ // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
361
+ forEach(t, e) {
362
+ return E(this, "forEach", t, e, void 0, arguments);
363
+ },
364
+ includes(...t) {
365
+ return it(this, "includes", t);
366
+ },
367
+ indexOf(...t) {
368
+ return it(this, "indexOf", t);
369
+ },
370
+ join(t) {
371
+ return A(this).join(t);
372
+ },
373
+ // keys() iterator only reads `length`, no optimization required
374
+ lastIndexOf(...t) {
375
+ return it(this, "lastIndexOf", t);
376
+ },
377
+ map(t, e) {
378
+ return E(this, "map", t, e, void 0, arguments);
379
+ },
380
+ pop() {
381
+ return H(this, "pop");
382
+ },
383
+ push(...t) {
384
+ return H(this, "push", t);
385
+ },
386
+ reduce(t, ...e) {
387
+ return St(this, "reduce", t, e);
388
+ },
389
+ reduceRight(t, ...e) {
390
+ return St(this, "reduceRight", t, e);
391
+ },
392
+ shift() {
393
+ return H(this, "shift");
394
+ },
395
+ // slice could use ARRAY_ITERATE but also seems to beg for range tracking
396
+ some(t, e) {
397
+ return E(this, "some", t, e, void 0, arguments);
398
+ },
399
+ splice(...t) {
400
+ return H(this, "splice", t);
401
+ },
402
+ toReversed() {
403
+ return A(this).toReversed();
404
+ },
405
+ toSorted(t) {
406
+ return A(this).toSorted(t);
407
+ },
408
+ toSpliced(...t) {
409
+ return A(this).toSpliced(...t);
410
+ },
411
+ unshift(...t) {
412
+ return H(this, "unshift", t);
413
+ },
414
+ values() {
415
+ return st(this, "values", (t) => O(this, t));
416
+ }
417
+ };
418
+ function st(t, e, n) {
419
+ const s = gt(t), r = s[e]();
420
+ return s !== t && !w(t) && (r._next = r.next, r.next = () => {
421
+ const i = r._next();
422
+ return i.done || (i.value = n(i.value)), i;
423
+ }), r;
424
+ }
425
+ const te = Array.prototype;
426
+ function E(t, e, n, s, r, i) {
427
+ const o = gt(t), c = o !== t && !w(t), a = o[e];
428
+ if (a !== te[e]) {
429
+ const f = a.apply(t, i);
430
+ return c ? j(f) : f;
431
+ }
432
+ let d = n;
433
+ o !== t && (c ? d = function(f, h) {
434
+ return n.call(this, O(t, f), h, t);
435
+ } : n.length > 2 && (d = function(f, h) {
436
+ return n.call(this, f, h, t);
437
+ }));
438
+ const v = a.call(o, d, s);
439
+ return c && r ? r(v) : v;
440
+ }
441
+ function St(t, e, n, s) {
442
+ const r = gt(t);
443
+ let i = n;
444
+ return r !== t && (w(t) ? n.length > 3 && (i = function(o, c, a) {
445
+ return n.call(this, o, c, a, t);
446
+ }) : i = function(o, c, a) {
447
+ return n.call(this, o, O(t, c), a, t);
448
+ }), r[e](i, ...s);
449
+ }
450
+ function it(t, e, n) {
451
+ const s = p(t);
452
+ _(s, "iterate", Y);
453
+ const r = s[e](...n);
454
+ return (r === -1 || r === !1) && ve(n[0]) ? (n[0] = p(n[0]), s[e](...n)) : r;
455
+ }
456
+ function H(t, e, n = []) {
457
+ mt(), ht();
458
+ const s = p(t)[e].apply(t, n);
459
+ return vt(), Rt(), s;
460
+ }
461
+ const ee = /* @__PURE__ */ Lt("__proto__,__v_isRef,__isVue"), It = new Set(
462
+ /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((t) => t !== "arguments" && t !== "caller").map((t) => Symbol[t]).filter(F)
463
+ );
464
+ function ne(t) {
465
+ F(t) || (t = String(t));
466
+ const e = p(this);
467
+ return _(e, "has", t), e.hasOwnProperty(t);
468
+ }
469
+ class jt {
470
+ constructor(e = !1, n = !1) {
471
+ this._isReadonly = e, this._isShallow = n;
472
+ }
473
+ get(e, n, s) {
474
+ if (n === "__v_skip") return e.__v_skip;
475
+ const r = this._isReadonly, i = this._isShallow;
476
+ if (n === "__v_isReactive")
477
+ return !r;
478
+ if (n === "__v_isReadonly")
479
+ return r;
480
+ if (n === "__v_isShallow")
481
+ return i;
482
+ if (n === "__v_raw")
483
+ return s === (r ? i ? pe : Pt : i ? ue : At).get(e) || // receiver is not the reactive proxy, but has the same prototype
484
+ // this means the receiver is a user proxy of the reactive proxy
485
+ Object.getPrototypeOf(e) === Object.getPrototypeOf(s) ? e : void 0;
486
+ const o = V(e);
487
+ if (!r) {
488
+ let a;
489
+ if (o && (a = kt[n]))
490
+ return a;
491
+ if (n === "hasOwnProperty")
492
+ return ne;
493
+ }
494
+ const c = Reflect.get(
495
+ e,
496
+ n,
497
+ // if this is a proxy wrapping a ref, return methods using the raw ref
498
+ // as receiver so that we don't have to call `toRaw` on the ref in all
499
+ // its class methods
500
+ N(e) ? e : s
501
+ );
502
+ if ((F(n) ? It.has(n) : ee(n)) || (r || _(e, "get", n), i))
503
+ return c;
504
+ if (N(c)) {
505
+ const a = o && dt(n) ? c : c.value;
506
+ return r && K(a) ? pt(a) : a;
507
+ }
508
+ return K(c) ? r ? pt(c) : bt(c) : c;
509
+ }
510
+ }
511
+ class re extends jt {
512
+ constructor(e = !1) {
513
+ super(!1, e);
514
+ }
515
+ set(e, n, s, r) {
516
+ let i = e[n];
517
+ const o = V(e) && dt(n);
518
+ if (!this._isShallow) {
519
+ const d = I(i);
520
+ if (!w(s) && !I(s) && (i = p(i), s = p(s)), !o && N(i) && !N(s))
521
+ return d ? (process.env.NODE_ENV !== "production" && S(
522
+ `Set operation on key "${String(n)}" failed: target is readonly.`,
523
+ e[n]
524
+ ), !0) : (i.value = s, !0);
525
+ }
526
+ const c = o ? Number(n) < e.length : ct(e, n), a = Reflect.set(
527
+ e,
528
+ n,
529
+ s,
530
+ N(e) ? e : r
531
+ );
532
+ return e === p(r) && (c ? m(s, i) && y(e, "set", n, s, i) : y(e, "add", n, s)), a;
533
+ }
534
+ deleteProperty(e, n) {
535
+ const s = ct(e, n), r = e[n], i = Reflect.deleteProperty(e, n);
536
+ return i && s && y(e, "delete", n, void 0, r), i;
537
+ }
538
+ has(e, n) {
539
+ const s = Reflect.has(e, n);
540
+ return (!F(n) || !It.has(n)) && _(e, "has", n), s;
541
+ }
542
+ ownKeys(e) {
543
+ return _(
544
+ e,
545
+ "iterate",
546
+ V(e) ? "length" : R
547
+ ), Reflect.ownKeys(e);
548
+ }
549
+ }
550
+ class se extends jt {
551
+ constructor(e = !1) {
552
+ super(!0, e);
553
+ }
554
+ set(e, n) {
555
+ return process.env.NODE_ENV !== "production" && S(
556
+ `Set operation on key "${String(n)}" failed: target is readonly.`,
557
+ e
558
+ ), !0;
559
+ }
560
+ deleteProperty(e, n) {
561
+ return process.env.NODE_ENV !== "production" && S(
562
+ `Delete operation on key "${String(n)}" failed: target is readonly.`,
563
+ e
564
+ ), !0;
565
+ }
566
+ }
567
+ const ie = /* @__PURE__ */ new re(), oe = /* @__PURE__ */ new se(), ut = (t) => t, q = (t) => Reflect.getPrototypeOf(t);
568
+ function ce(t, e, n) {
569
+ return function(...s) {
570
+ const r = this.__v_raw, i = p(r), o = P(i), c = t === "entries" || t === Symbol.iterator && o, a = t === "keys" && o, d = r[t](...s), v = n ? ut : e ? B : j;
571
+ return !e && _(
572
+ i,
573
+ "iterate",
574
+ a ? lt : R
575
+ ), {
576
+ // iterator protocol
577
+ next() {
578
+ const { value: f, done: h } = d.next();
579
+ return h ? { value: f, done: h } : {
580
+ value: c ? [v(f[0]), v(f[1])] : v(f),
581
+ done: h
582
+ };
583
+ },
584
+ // iterable protocol
585
+ [Symbol.iterator]() {
586
+ return this;
587
+ }
588
+ };
589
+ };
590
+ }
591
+ function X(t) {
592
+ return function(...e) {
593
+ if (process.env.NODE_ENV !== "production") {
594
+ const n = e[0] ? `on key "${e[0]}" ` : "";
595
+ S(
596
+ `${Gt(t)} operation ${n}failed: target is readonly.`,
597
+ p(this)
598
+ );
599
+ }
600
+ return t === "delete" ? !1 : t === "clear" ? void 0 : this;
601
+ };
602
+ }
603
+ function ae(t, e) {
604
+ const n = {
605
+ get(r) {
606
+ const i = this.__v_raw, o = p(i), c = p(r);
607
+ t || (m(r, c) && _(o, "get", r), _(o, "get", c));
608
+ const { has: a } = q(o), d = e ? ut : t ? B : j;
609
+ if (a.call(o, r))
610
+ return d(i.get(r));
611
+ if (a.call(o, c))
612
+ return d(i.get(c));
613
+ i !== o && i.get(r);
614
+ },
615
+ get size() {
616
+ const r = this.__v_raw;
617
+ return !t && _(p(r), "iterate", R), r.size;
618
+ },
619
+ has(r) {
620
+ const i = this.__v_raw, o = p(i), c = p(r);
621
+ return t || (m(r, c) && _(o, "has", r), _(o, "has", c)), r === c ? i.has(r) : i.has(r) || i.has(c);
622
+ },
623
+ forEach(r, i) {
624
+ const o = this, c = o.__v_raw, a = p(c), d = e ? ut : t ? B : j;
625
+ return !t && _(a, "iterate", R), c.forEach((v, f) => r.call(i, d(v), d(f), o));
626
+ }
627
+ };
628
+ return ot(
629
+ n,
630
+ t ? {
631
+ add: X("add"),
632
+ set: X("set"),
633
+ delete: X("delete"),
634
+ clear: X("clear")
635
+ } : {
636
+ add(r) {
637
+ !e && !w(r) && !I(r) && (r = p(r));
638
+ const i = p(this);
639
+ return q(i).has.call(i, r) || (i.add(r), y(i, "add", r, r)), this;
640
+ },
641
+ set(r, i) {
642
+ !e && !w(i) && !I(i) && (i = p(i));
643
+ const o = p(this), { has: c, get: a } = q(o);
644
+ let d = c.call(o, r);
645
+ d ? process.env.NODE_ENV !== "production" && Ot(o, c, r) : (r = p(r), d = c.call(o, r));
646
+ const v = a.call(o, r);
647
+ return o.set(r, i), d ? m(i, v) && y(o, "set", r, i, v) : y(o, "add", r, i), this;
648
+ },
649
+ delete(r) {
650
+ const i = p(this), { has: o, get: c } = q(i);
651
+ let a = o.call(i, r);
652
+ a ? process.env.NODE_ENV !== "production" && Ot(i, o, r) : (r = p(r), a = o.call(i, r));
653
+ const d = c ? c.call(i, r) : void 0, v = i.delete(r);
654
+ return a && y(i, "delete", r, void 0, d), v;
655
+ },
656
+ clear() {
657
+ const r = p(this), i = r.size !== 0, o = process.env.NODE_ENV !== "production" ? P(r) ? new Map(r) : new Set(r) : void 0, c = r.clear();
658
+ return i && y(
659
+ r,
660
+ "clear",
661
+ void 0,
662
+ void 0,
663
+ o
664
+ ), c;
665
+ }
666
+ }
667
+ ), [
668
+ "keys",
669
+ "values",
670
+ "entries",
671
+ Symbol.iterator
672
+ ].forEach((r) => {
673
+ n[r] = ce(r, t, e);
674
+ }), n;
675
+ }
676
+ function Mt(t, e) {
677
+ const n = ae(t, e);
678
+ return (s, r, i) => r === "__v_isReactive" ? !t : r === "__v_isReadonly" ? t : r === "__v_raw" ? s : Reflect.get(
679
+ ct(n, r) && r in s ? n : s,
680
+ r,
681
+ i
682
+ );
683
+ }
684
+ const fe = {
685
+ get: /* @__PURE__ */ Mt(!1, !1)
686
+ }, le = {
687
+ get: /* @__PURE__ */ Mt(!0, !1)
688
+ };
689
+ function Ot(t, e, n) {
690
+ const s = p(n);
691
+ if (s !== n && e.call(t, s)) {
692
+ const r = yt(t);
693
+ S(
694
+ `Reactive ${r} contains both the raw and reactive versions of the same object${r === "Map" ? " as keys" : ""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
695
+ );
696
+ }
697
+ }
698
+ const At = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap();
699
+ function de(t) {
700
+ switch (t) {
701
+ case "Object":
702
+ case "Array":
703
+ return 1;
704
+ case "Map":
705
+ case "Set":
706
+ case "WeakMap":
707
+ case "WeakSet":
708
+ return 2;
709
+ default:
710
+ return 0;
711
+ }
712
+ }
713
+ function he(t) {
714
+ return t.__v_skip || !Object.isExtensible(t) ? 0 : de(yt(t));
715
+ }
716
+ function bt(t) {
717
+ return I(t) ? t : Kt(
718
+ t,
719
+ !1,
720
+ ie,
721
+ fe,
722
+ At
723
+ );
724
+ }
725
+ function pt(t) {
726
+ return Kt(
727
+ t,
728
+ !0,
729
+ oe,
730
+ le,
731
+ Pt
732
+ );
733
+ }
734
+ function Kt(t, e, n, s, r) {
735
+ if (!K(t))
736
+ return process.env.NODE_ENV !== "production" && S(
737
+ `value cannot be made ${e ? "readonly" : "reactive"}: ${String(
738
+ t
739
+ )}`
740
+ ), t;
741
+ if (t.__v_raw && !(e && t.__v_isReactive))
742
+ return t;
743
+ const i = he(t);
744
+ if (i === 0)
745
+ return t;
746
+ const o = r.get(t);
747
+ if (o)
748
+ return o;
749
+ const c = new Proxy(
750
+ t,
751
+ i === 2 ? s : n
752
+ );
753
+ return r.set(t, c), c;
754
+ }
755
+ function z(t) {
756
+ return I(t) ? z(t.__v_raw) : !!(t && t.__v_isReactive);
757
+ }
758
+ function I(t) {
759
+ return !!(t && t.__v_isReadonly);
760
+ }
761
+ function w(t) {
762
+ return !!(t && t.__v_isShallow);
763
+ }
764
+ function ve(t) {
765
+ return t ? !!t.__v_raw : !1;
766
+ }
767
+ function p(t) {
768
+ const e = t && t.__v_raw;
769
+ return e ? p(e) : t;
770
+ }
771
+ const j = (t) => K(t) ? bt(t) : t, B = (t) => K(t) ? pt(t) : t;
772
+ function N(t) {
773
+ return t ? t.__v_isRef === !0 : !1;
774
+ }
775
+ const Z = {}, tt = /* @__PURE__ */ new WeakMap();
776
+ let T;
777
+ function _e(t, e = !1, n = T) {
778
+ if (n) {
779
+ let s = tt.get(n);
780
+ s || tt.set(n, s = []), s.push(t);
781
+ } else process.env.NODE_ENV !== "production" && !e && S(
782
+ "onWatcherCleanup() was called when there was no active watcher to associate with."
783
+ );
784
+ }
785
+ function ge(t, e, n = Wt) {
786
+ const { immediate: s, deep: r, once: i, scheduler: o, augmentJob: c, call: a } = n, d = (l) => {
787
+ (n.onWarn || S)(
788
+ "Invalid watch source: ",
789
+ l,
790
+ "A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types."
791
+ );
792
+ }, v = (l) => r ? l : w(l) || r === !1 || r === 0 ? D(l, 1) : D(l);
793
+ let f, h, L, G, U = !1, J = !1;
794
+ if (N(t) ? (h = () => t.value, U = w(t)) : z(t) ? (h = () => v(t), U = !0) : V(t) ? (J = !0, U = t.some((l) => z(l) || w(l)), h = () => t.map((l) => {
795
+ if (N(l))
796
+ return l.value;
797
+ if (z(l))
798
+ return v(l);
799
+ if (wt(l))
800
+ return a ? a(l, 2) : l();
801
+ process.env.NODE_ENV !== "production" && d(l);
802
+ })) : wt(t) ? e ? h = a ? () => a(t, 2) : t : h = () => {
803
+ if (L) {
804
+ mt();
805
+ try {
806
+ L();
807
+ } finally {
808
+ Rt();
809
+ }
810
+ }
811
+ const l = T;
812
+ T = f;
813
+ try {
814
+ return a ? a(t, 3, [G]) : t(G);
815
+ } finally {
816
+ T = l;
817
+ }
818
+ } : (h = Ht, process.env.NODE_ENV !== "production" && d(t)), e && r) {
819
+ const l = h, b = r === !0 ? 1 / 0 : r;
820
+ h = () => D(l(), b);
821
+ }
822
+ const M = () => {
823
+ f.stop();
824
+ };
825
+ if (i && e) {
826
+ const l = e;
827
+ e = (...b) => {
828
+ l(...b), M();
829
+ };
830
+ }
831
+ let x = J ? new Array(t.length).fill(Z) : Z;
832
+ const W = (l) => {
833
+ if (!(!(f.flags & 1) || !f.dirty && !l))
834
+ if (e) {
835
+ const b = f.run();
836
+ if (r || U || (J ? b.some((nt, Q) => m(nt, x[Q])) : m(b, x))) {
837
+ L && L();
838
+ const nt = T;
839
+ T = f;
840
+ try {
841
+ const Q = [
842
+ b,
843
+ // pass undefined as the old value when it's changed for the first time
844
+ x === Z ? void 0 : J && x[0] === Z ? [] : x,
845
+ G
846
+ ];
847
+ x = b, a ? a(e, 3, Q) : (
848
+ // @ts-expect-error
849
+ e(...Q)
850
+ );
851
+ } finally {
852
+ T = nt;
853
+ }
854
+ }
855
+ } else
856
+ f.run();
857
+ };
858
+ return c && c(W), f = new Ut(h), f.scheduler = o ? () => o(W, !1) : W, G = (l) => _e(l, !1, f), L = f.onStop = () => {
859
+ const l = tt.get(f);
860
+ if (l) {
861
+ if (a)
862
+ a(l, 4);
863
+ else
864
+ for (const b of l) b();
865
+ tt.delete(f);
866
+ }
867
+ }, process.env.NODE_ENV !== "production" && (f.onTrack = n.onTrack, f.onTrigger = n.onTrigger), e ? s ? W(!0) : x = f.run() : o ? o(W.bind(null, !0), !0) : f.run(), M.pause = f.pause.bind(f), M.resume = f.resume.bind(f), M.stop = M, M;
868
+ }
869
+ function D(t, e = 1 / 0, n) {
870
+ if (e <= 0 || !K(t) || t.__v_skip || (n = n || /* @__PURE__ */ new Map(), (n.get(t) || 0) >= e))
871
+ return t;
872
+ if (n.set(t, e), e--, N(t))
873
+ D(t.value, e, n);
874
+ else if (V(t))
875
+ for (let s = 0; s < t.length; s++)
876
+ D(t[s], e, n);
877
+ else if (Ct(t) || P(t))
878
+ t.forEach((s) => {
879
+ D(s, e, n);
880
+ });
881
+ else if (Bt(t)) {
882
+ for (const s in t)
883
+ D(t[s], e, n);
884
+ for (const s of Object.getOwnPropertySymbols(t))
885
+ Object.prototype.propertyIsEnumerable.call(t, s) && D(t[s], e, n);
886
+ }
887
+ return t;
888
+ }
889
+ class be {
890
+ constructor(e) {
891
+ return e && Object.assign(this, e), bt(this);
892
+ }
893
+ }
894
+ const we = {
895
+ watch: ge
896
+ };
897
+ export {
898
+ be as Accessor,
899
+ we as reactiveUtils
900
+ };
@@ -0,0 +1 @@
1
+ (function(x,W){typeof exports=="object"&&typeof module<"u"?W(exports):typeof define=="function"&&define.amd?define(["exports"],W):(x=typeof globalThis<"u"?globalThis:x||self,W(x.Accessor={}))})(this,(function(x){"use strict";function W(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const He=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const $e=()=>{},se=Object.assign,Ce=Object.prototype.hasOwnProperty,ie=(e,t)=>Ce.call(e,t),T=Array.isArray,A=e=>J(e)==="[object Map]",ze=e=>J(e)==="[object Set]",Se=e=>typeof e=="function",Ye=e=>typeof e=="string",H=e=>typeof e=="symbol",P=e=>e!==null&&typeof e=="object",Fe=Object.prototype.toString,J=e=>Fe.call(e),Oe=e=>J(e).slice(8,-1),Be=e=>J(e)==="[object Object]",oe=e=>Ye(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ue=(e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),m=(e,t)=>!Object.is(e,t);function E(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let u;const ce=new WeakSet;class Ge{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ce.has(this)&&(ce.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Je(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Re(this),De(this);const t=u,n=g;u=this,g=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&u!==this&&E("Active effect was not restored correctly - this is likely a Vue internal bug."),Ne(this),u=t,g=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ue(t);this.deps=this.depsTail=void 0,Re(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ce.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){le(this)&&this.run()}get dirty(){return le(this)}}let ye=0,$,C;function Je(e,t=!1){if(e.flags|=8,t){e.next=C,C=e;return}e.next=$,$=e}function ae(){ye++}function fe(){if(--ye>0)return;if(C){let t=C;for(C=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;$;){let t=$;for($=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function De(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ne(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),ue(s),qe(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function le(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Qe(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Qe(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Q)||(e.globalVersion=Q,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!le(e))))return;e.flags|=2;const t=e.dep,n=u,s=g;u=e,g=!0;try{De(e);const r=e.fn(e._value);(t.version===0||m(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{u=n,g=s,Ne(e),e.flags&=-3}}function ue(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),process.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=r),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)ue(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function qe(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let g=!0;const xe=[];function Te(){xe.push(g),g=!1}function me(){const e=xe.pop();g=e===void 0?!0:e}function Re(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=u;u=void 0;try{t()}finally{u=n}}}let Q=0;class Xe{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ze{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!u||!g||u===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==u)n=this.activeLink=new Xe(u,this),u.deps?(n.prevDep=u.depsTail,u.depsTail.nextDep=n,u.depsTail=n):u.deps=u.depsTail=n,Ve(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=u.depsTail,n.nextDep=void 0,u.depsTail.nextDep=n,u.depsTail=n,u.deps===n&&(u.deps=s)}return process.env.NODE_ENV!=="production"&&u.onTrack&&u.onTrack(se({effect:u},t)),n}trigger(t){this.version++,Q++,this.notify(t)}notify(t){ae();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(se({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{fe()}}}function Ve(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Ve(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),process.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const pe=new WeakMap,R=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),de=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),z=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function _(e,t,n){if(g&&u){let s=pe.get(e);s||pe.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Ze),r.map=s,r.key=n),process.env.NODE_ENV!=="production"?r.track({target:e,type:t,key:n}):r.track()}}function O(e,t,n,s,r,i){const o=pe.get(e);if(!o){Q++;return}const c=a=>{a&&(process.env.NODE_ENV!=="production"?a.trigger({target:e,type:t,key:n,newValue:s,oldValue:r,oldTarget:i}):a.trigger())};if(ae(),t==="clear")o.forEach(c);else{const a=T(e),d=a&&oe(n);if(a&&n==="length"){const v=Number(s);o.forEach((f,h)=>{(h==="length"||h===z||!H(h)&&h>=v)&&c(f)})}else switch((n!==void 0||o.has(void 0))&&c(o.get(n)),d&&c(o.get(z)),t){case"add":a?d&&c(o.get("length")):(c(o.get(R)),A(e)&&c(o.get(de)));break;case"delete":a||(c(o.get(R)),A(e)&&c(o.get(de)));break;case"set":A(e)&&c(o.get(R));break}}fe()}function K(e){const t=p(e);return t===e?t:(_(t,"iterate",z),b(e)?t:t.map(j))}function he(e){return _(e=p(e),"iterate",z),e}function y(e,t){return V(e)?F(e)?B(j(t)):B(t):j(t)}const ke={__proto__:null,[Symbol.iterator](){return ve(this,Symbol.iterator,e=>y(this,e))},concat(...e){return K(this).concat(...e.map(t=>T(t)?K(t):t))},entries(){return ve(this,"entries",e=>(e[1]=y(this,e[1]),e))},every(e,t){return S(this,"every",e,t,void 0,arguments)},filter(e,t){return S(this,"filter",e,t,n=>n.map(s=>y(this,s)),arguments)},find(e,t){return S(this,"find",e,t,n=>y(this,n),arguments)},findIndex(e,t){return S(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return S(this,"findLast",e,t,n=>y(this,n),arguments)},findLastIndex(e,t){return S(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return S(this,"forEach",e,t,void 0,arguments)},includes(...e){return _e(this,"includes",e)},indexOf(...e){return _e(this,"indexOf",e)},join(e){return K(this).join(e)},lastIndexOf(...e){return _e(this,"lastIndexOf",e)},map(e,t){return S(this,"map",e,t,void 0,arguments)},pop(){return Y(this,"pop")},push(...e){return Y(this,"push",e)},reduce(e,...t){return je(this,"reduce",e,t)},reduceRight(e,...t){return je(this,"reduceRight",e,t)},shift(){return Y(this,"shift")},some(e,t){return S(this,"some",e,t,void 0,arguments)},splice(...e){return Y(this,"splice",e)},toReversed(){return K(this).toReversed()},toSorted(e){return K(this).toSorted(e)},toSpliced(...e){return K(this).toSpliced(...e)},unshift(...e){return Y(this,"unshift",e)},values(){return ve(this,"values",e=>y(this,e))}};function ve(e,t,n){const s=he(e),r=s[t]();return s!==e&&!b(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const et=Array.prototype;function S(e,t,n,s,r,i){const o=he(e),c=o!==e&&!b(e),a=o[t];if(a!==et[t]){const f=a.apply(e,i);return c?j(f):f}let d=n;o!==e&&(c?d=function(f,h){return n.call(this,y(e,f),h,e)}:n.length>2&&(d=function(f,h){return n.call(this,f,h,e)}));const v=a.call(o,d,s);return c&&r?r(v):v}function je(e,t,n,s){const r=he(e);let i=n;return r!==e&&(b(e)?n.length>3&&(i=function(o,c,a){return n.call(this,o,c,a,e)}):i=function(o,c,a){return n.call(this,o,y(e,c),a,e)}),r[t](i,...s)}function _e(e,t,n){const s=p(e);_(s,"iterate",z);const r=s[t](...n);return(r===-1||r===!1)&&vt(n[0])?(n[0]=p(n[0]),s[t](...n)):r}function Y(e,t,n=[]){Te(),ae();const s=p(e)[t].apply(e,n);return fe(),me(),s}const tt=W("__proto__,__v_isRef,__isVue"),Ie=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(H));function nt(e){H(e)||(e=String(e));const t=p(this);return _(t,"has",e),t.hasOwnProperty(e)}class Me{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?pt:Le:i?ut:Ke).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=T(t);if(!r){let a;if(o&&(a=ke[n]))return a;if(n==="hasOwnProperty")return nt}const c=Reflect.get(t,n,D(t)?t:s);if((H(n)?Ie.has(n):tt(n))||(r||_(t,"get",n),i))return c;if(D(c)){const a=o&&oe(n)?c:c.value;return r&&P(a)?we(a):a}return P(c)?r?we(c):be(c):c}}class rt extends Me{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];const o=T(t)&&oe(n);if(!this._isShallow){const d=V(i);if(!b(s)&&!V(s)&&(i=p(i),s=p(s)),!o&&D(i)&&!D(s))return d?(process.env.NODE_ENV!=="production"&&E(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(i.value=s,!0)}const c=o?Number(n)<t.length:ie(t,n),a=Reflect.set(t,n,s,D(t)?t:r);return t===p(r)&&(c?m(s,i)&&O(t,"set",n,s,i):O(t,"add",n,s)),a}deleteProperty(t,n){const s=ie(t,n),r=t[n],i=Reflect.deleteProperty(t,n);return i&&s&&O(t,"delete",n,void 0,r),i}has(t,n){const s=Reflect.has(t,n);return(!H(n)||!Ie.has(n))&&_(t,"has",n),s}ownKeys(t){return _(t,"iterate",T(t)?"length":R),Reflect.ownKeys(t)}}class st extends Me{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&E(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&E(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const it=new rt,ot=new st,ge=e=>e,q=e=>Reflect.getPrototypeOf(e);function ct(e,t,n){return function(...s){const r=this.__v_raw,i=p(r),o=A(i),c=e==="entries"||e===Symbol.iterator&&o,a=e==="keys"&&o,d=r[e](...s),v=n?ge:t?B:j;return!t&&_(i,"iterate",a?de:R),{next(){const{value:f,done:h}=d.next();return h?{value:f,done:h}:{value:c?[v(f[0]),v(f[1])]:v(f),done:h}},[Symbol.iterator](){return this}}}}function X(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";E(`${Ue(e)} operation ${n}failed: target is readonly.`,p(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function at(e,t){const n={get(r){const i=this.__v_raw,o=p(i),c=p(r);e||(m(r,c)&&_(o,"get",r),_(o,"get",c));const{has:a}=q(o),d=t?ge:e?B:j;if(a.call(o,r))return d(i.get(r));if(a.call(o,c))return d(i.get(c));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&_(p(r),"iterate",R),r.size},has(r){const i=this.__v_raw,o=p(i),c=p(r);return e||(m(r,c)&&_(o,"has",r),_(o,"has",c)),r===c?i.has(r):i.has(r)||i.has(c)},forEach(r,i){const o=this,c=o.__v_raw,a=p(c),d=t?ge:e?B:j;return!e&&_(a,"iterate",R),c.forEach((v,f)=>r.call(i,d(v),d(f),o))}};return se(n,e?{add:X("add"),set:X("set"),delete:X("delete"),clear:X("clear")}:{add(r){!t&&!b(r)&&!V(r)&&(r=p(r));const i=p(this);return q(i).has.call(i,r)||(i.add(r),O(i,"add",r,r)),this},set(r,i){!t&&!b(i)&&!V(i)&&(i=p(i));const o=p(this),{has:c,get:a}=q(o);let d=c.call(o,r);d?process.env.NODE_ENV!=="production"&&Pe(o,c,r):(r=p(r),d=c.call(o,r));const v=a.call(o,r);return o.set(r,i),d?m(i,v)&&O(o,"set",r,i,v):O(o,"add",r,i),this},delete(r){const i=p(this),{has:o,get:c}=q(i);let a=o.call(i,r);a?process.env.NODE_ENV!=="production"&&Pe(i,o,r):(r=p(r),a=o.call(i,r));const d=c?c.call(i,r):void 0,v=i.delete(r);return a&&O(i,"delete",r,void 0,d),v},clear(){const r=p(this),i=r.size!==0,o=process.env.NODE_ENV!=="production"?A(r)?new Map(r):new Set(r):void 0,c=r.clear();return i&&O(r,"clear",void 0,void 0,o),c}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=ct(r,e,t)}),n}function Ae(e,t){const n=at(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(ie(n,r)&&r in s?n:s,r,i)}const ft={get:Ae(!1,!1)},lt={get:Ae(!0,!1)};function Pe(e,t,n){const s=p(n);if(s!==n&&t.call(e,s)){const r=Oe(e);E(`Reactive ${r} contains both the raw and reactive versions of the same object${r==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Ke=new WeakMap,ut=new WeakMap,Le=new WeakMap,pt=new WeakMap;function dt(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ht(e){return e.__v_skip||!Object.isExtensible(e)?0:dt(Oe(e))}function be(e){return V(e)?e:We(e,!1,it,ft,Ke)}function we(e){return We(e,!0,ot,lt,Le)}function We(e,t,n,s,r){if(!P(e))return process.env.NODE_ENV!=="production"&&E(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=ht(e);if(i===0)return e;const o=r.get(e);if(o)return o;const c=new Proxy(e,i===2?s:n);return r.set(e,c),c}function F(e){return V(e)?F(e.__v_raw):!!(e&&e.__v_isReactive)}function V(e){return!!(e&&e.__v_isReadonly)}function b(e){return!!(e&&e.__v_isShallow)}function vt(e){return e?!!e.__v_raw:!1}function p(e){const t=e&&e.__v_raw;return t?p(t):e}const j=e=>P(e)?be(e):e,B=e=>P(e)?we(e):e;function D(e){return e?e.__v_isRef===!0:!1}const Z={},k=new WeakMap;let I;function _t(e,t=!1,n=I){if(n){let s=k.get(n);s||k.set(n,s=[]),s.push(e)}else process.env.NODE_ENV!=="production"&&!t&&E("onWatcherCleanup() was called when there was no active watcher to associate with.")}function gt(e,t,n=He){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:c,call:a}=n,d=l=>{(n.onWarn||E)("Invalid watch source: ",l,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},v=l=>r?l:b(l)||r===!1||r===0?N(l,1):N(l);let f,h,U,ee,te=!1,ne=!1;if(D(e)?(h=()=>e.value,te=b(e)):F(e)?(h=()=>v(e),te=!0):T(e)?(ne=!0,te=e.some(l=>F(l)||b(l)),h=()=>e.map(l=>{if(D(l))return l.value;if(F(l))return v(l);if(Se(l))return a?a(l,2):l();process.env.NODE_ENV!=="production"&&d(l)})):Se(e)?t?h=a?()=>a(e,2):e:h=()=>{if(U){Te();try{U()}finally{me()}}const l=I;I=f;try{return a?a(e,3,[ee]):e(ee)}finally{I=l}}:(h=$e,process.env.NODE_ENV!=="production"&&d(e)),t&&r){const l=h,w=r===!0?1/0:r;h=()=>N(l(),w)}const L=()=>{f.stop()};if(i&&t){const l=t;t=(...w)=>{l(...w),L()}}let M=ne?new Array(e.length).fill(Z):Z;const G=l=>{if(!(!(f.flags&1)||!f.dirty&&!l))if(t){const w=f.run();if(r||te||(ne?w.some((Ee,re)=>m(Ee,M[re])):m(w,M))){U&&U();const Ee=I;I=f;try{const re=[w,M===Z?void 0:ne&&M[0]===Z?[]:M,ee];M=w,a?a(t,3,re):t(...re)}finally{I=Ee}}}else f.run()};return c&&c(G),f=new Ge(h),f.scheduler=o?()=>o(G,!1):G,ee=l=>_t(l,!1,f),U=f.onStop=()=>{const l=k.get(f);if(l){if(a)a(l,4);else for(const w of l)w();k.delete(f)}},process.env.NODE_ENV!=="production"&&(f.onTrack=n.onTrack,f.onTrigger=n.onTrigger),t?s?G(!0):M=f.run():o?o(G.bind(null,!0),!0):f.run(),L.pause=f.pause.bind(f),L.resume=f.resume.bind(f),L.stop=L,L}function N(e,t=1/0,n){if(t<=0||!P(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,D(e))N(e.value,t,n);else if(T(e))for(let s=0;s<e.length;s++)N(e[s],t,n);else if(ze(e)||A(e))e.forEach(s=>{N(s,t,n)});else if(Be(e)){for(const s in e)N(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&N(e[s],t,n)}return e}class bt{constructor(t){return t&&Object.assign(this,t),be(this)}}const wt={watch:gt};x.Accessor=bt,x.reactiveUtils=wt,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@geodaoyu/accessor",
3
- "version": "2.0.1",
3
+ "version": "3.0.0",
4
4
  "description": "mini @arcgis/core/core/Accessor & @arcgis/core/core/reactiveUtils",
5
- "main": "index.js",
5
+ "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "scripts": {
8
- "build": "npx tsc",
9
- "test": "mocha"
8
+ "start": "vite",
9
+ "build": "vite build",
10
+ "test": "vitest --run"
10
11
  },
11
12
  "keywords": [
12
13
  "Accessor",
@@ -28,7 +29,10 @@
28
29
  "url": "https://github.com/GeoDaoyu/Accessor.git"
29
30
  },
30
31
  "devDependencies": {
31
- "mocha": "^11.7.1",
32
- "typescript": "^5.8.3"
32
+ "vite": "^7.3.0",
33
+ "vitest": "^1.0.0"
34
+ },
35
+ "dependencies": {
36
+ "@vue/reactivity": "^3.5.26"
33
37
  }
34
38
  }
@@ -0,0 +1,10 @@
1
+ import { ref, watch, reactive } from "@vue/reactivity";
2
+
3
+ class Accessor {
4
+ constructor(properties) {
5
+ properties && Object.assign(this, properties);
6
+ return reactive(this);
7
+ }
8
+ }
9
+
10
+ export default Accessor;
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default as Accessor } from "./Accessor.js";
2
+ export { default as reactiveUtils } from "./reactiveUtils.js";
@@ -0,0 +1,5 @@
1
+ import { watch } from "@vue/reactivity";
2
+
3
+ export default {
4
+ watch,
5
+ };
@@ -1,16 +0,0 @@
1
- type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void;
2
- interface WatchHandle extends Object {
3
- /**
4
- * Removes the watch handle.
5
- */
6
- remove(): void;
7
- }
8
- declare class Accessor {
9
- declaredClass: string;
10
- private _handles;
11
- constructor(props?: object);
12
- get(path: string): any;
13
- set(path: string | object, value: any): this;
14
- watch(path: string | string[], callback: WatchCallback): WatchHandle;
15
- }
16
- export default Accessor;
package/dist/accessor.js DELETED
@@ -1,89 +0,0 @@
1
- class Accessor {
2
- declaredClass;
3
- _handles;
4
- constructor(props = {}) {
5
- // 为当前实例创建一个代理
6
- const proxy = new Proxy(this, {
7
- set: (target, key, value, receiver) => {
8
- if (key !== '_handles' && target._handles) {
9
- const oldValue = target[key];
10
- target._handles.forEach((handle) => {
11
- if (handle.path === key) {
12
- handle.callback(value, oldValue, key, target);
13
- }
14
- });
15
- }
16
- return Reflect.set(target, key, value, receiver);
17
- }
18
- });
19
- // 初始化属性
20
- for (let prop in props) {
21
- proxy[prop] = props[prop];
22
- }
23
- proxy.declaredClass = "Accessor";
24
- proxy._handles = new Set();
25
- return proxy;
26
- }
27
- get(path) {
28
- const dotIndex = path.indexOf(".");
29
- if (dotIndex !== -1) {
30
- const key = path.slice(0, dotIndex);
31
- const value = path.slice(dotIndex + 1);
32
- return this[key] && this[key].get(value);
33
- }
34
- return this[path];
35
- }
36
- set(path, value) {
37
- if (typeof path === "string") {
38
- const dotIndex = path.indexOf(".");
39
- if (dotIndex !== -1) {
40
- const key = path.slice(0, dotIndex);
41
- const childPath = path.slice(dotIndex + 1);
42
- if (this[key]) {
43
- this[key].set(childPath, value);
44
- }
45
- }
46
- else {
47
- this[path] = value;
48
- }
49
- }
50
- else {
51
- for (const key in path) {
52
- this.set(key, path[key]);
53
- }
54
- }
55
- return this;
56
- }
57
- watch(path, callback) {
58
- const handles = [];
59
- const pathArray = [];
60
- if (typeof path === "object") {
61
- pathArray.push(...path);
62
- }
63
- if (typeof path === "string") {
64
- if (path.includes(",")) {
65
- pathArray.push(...path.replace(" ", "").split(","));
66
- }
67
- else {
68
- pathArray.push(path);
69
- }
70
- }
71
- pathArray.forEach((item) => {
72
- const dotIndex = item.indexOf(".");
73
- const handle = dotIndex !== -1
74
- ? this[item.slice(0, dotIndex)].watch(item.slice(dotIndex + 1), callback)
75
- : { path: item, callback };
76
- handles.push(handle);
77
- this._handles.add(handle);
78
- });
79
- const watchHandle = {
80
- remove: () => {
81
- handles.forEach((handle) => {
82
- this._handles.delete(handle);
83
- });
84
- },
85
- };
86
- return watchHandle;
87
- }
88
- }
89
- export default Accessor;
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import Accessor from './accessor.js';
2
- export default Accessor;
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- import Accessor from './accessor.js';
2
- export default Accessor;
package/src/accessor.ts DELETED
@@ -1,119 +0,0 @@
1
- type WatchCallback = (
2
- newValue: any,
3
- oldValue: any,
4
- propertyName: string,
5
- target: Accessor
6
- ) => void;
7
-
8
- interface WatchHandle extends Object {
9
- /**
10
- * Removes the watch handle.
11
- */
12
- remove(): void;
13
- }
14
-
15
- interface Handle {
16
- path: string;
17
- callback: Function;
18
- }
19
-
20
- class Accessor {
21
- declaredClass: string;
22
- private _handles: Set<Handle>;
23
-
24
- constructor(props: object = {}) {
25
- // 为当前实例创建一个代理
26
- const proxy = new Proxy(this, {
27
- set: (target, key, value, receiver) => {
28
- if (key !== '_handles' && target._handles) {
29
- const oldValue = target[key];
30
- target._handles.forEach((handle) => {
31
- if (handle.path === key) {
32
- handle.callback(value, oldValue, key, target);
33
- }
34
- });
35
- }
36
- return Reflect.set(target, key, value, receiver);
37
- }
38
- });
39
-
40
- // 初始化属性
41
- for (let prop in props) {
42
- proxy[prop] = props[prop];
43
- }
44
- proxy.declaredClass = "Accessor";
45
- proxy._handles = new Set();
46
-
47
- return proxy;
48
- }
49
-
50
- get(path: string): any {
51
- const dotIndex = path.indexOf(".");
52
- if (dotIndex !== -1) {
53
- const key = path.slice(0, dotIndex);
54
- const value = path.slice(dotIndex + 1);
55
- return this[key] && this[key].get(value);
56
- }
57
- return this[path];
58
- }
59
-
60
- set(path: string | object, value: any): this {
61
- if (typeof path === "string") {
62
- const dotIndex = path.indexOf(".");
63
- if (dotIndex !== -1) {
64
- const key = path.slice(0, dotIndex);
65
- const childPath = path.slice(dotIndex + 1);
66
- if (this[key]) {
67
- this[key].set(childPath, value);
68
- }
69
- } else {
70
- this[path] = value;
71
- }
72
- } else {
73
- for (const key in path) {
74
- this.set(key, path[key]);
75
- }
76
- }
77
-
78
- return this;
79
- }
80
-
81
- watch(path: string | string[], callback: WatchCallback): WatchHandle {
82
- const handles = [];
83
- const pathArray = [];
84
- if (typeof path === "object") {
85
- pathArray.push(...path);
86
- }
87
- if (typeof path === "string") {
88
- if (path.includes(",")) {
89
- pathArray.push(...path.replace(" ", "").split(","));
90
- } else {
91
- pathArray.push(path);
92
- }
93
- }
94
- pathArray.forEach((item) => {
95
- const dotIndex = item.indexOf(".");
96
- const handle =
97
- dotIndex !== -1
98
- ? this[item.slice(0, dotIndex)].watch(
99
- item.slice(dotIndex + 1),
100
- callback
101
- )
102
- : { path: item, callback };
103
-
104
- handles.push(handle);
105
- this._handles.add(handle);
106
- });
107
-
108
- const watchHandle = {
109
- remove: () => {
110
- handles.forEach((handle) => {
111
- this._handles.delete(handle);
112
- });
113
- },
114
- };
115
- return watchHandle;
116
- }
117
- }
118
-
119
- export default Accessor;
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- import Accessor from './accessor.js';
2
-
3
- export default Accessor;