mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-06 03:57:49 +08:00
2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
import{i as Y,a as M,h as $,b as q,t as xt,c as p,N as yt,d as C,e as L,m as Kt,f as Pt,g as z,j as U}from"./@vue_shared@3.3.4-896c5ecf.js";let f;class Ot{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=f,!e&&f&&(this.index=(f.scopes||(f.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const s=f;try{return f=this,e()}finally{f=s}}}on(){f=this}off(){f=this.parent}stop(e){if(this._active){let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.scopes)for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0,this._active=!1}}}function ge(t){return new Ot(t)}function at(t,e=f){e&&e.active&&e.effects.push(t)}function we(){return f}function ve(t){f&&f.cleanups.push(t)}const J=t=>{const e=new Set(t);return e.w=0,e.n=0,e},ot=t=>(t.w&R)>0,ft=t=>(t.n&R)>0,zt=({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=R},At=t=>{const{deps:e}=t;if(e.length){let s=0;for(let n=0;n<e.length;n++){const r=e[n];ot(r)&&!ft(r)?r.delete(t):e[s++]=r,r.w&=~R,r.n&=~R}e.length=s}},A=new WeakMap;let S=0,R=1;const W=30;let h;const E=Symbol(""),B=Symbol("");class ut{constructor(e,s=null,n){this.fn=e,this.scheduler=s,this.active=!0,this.deps=[],this.parent=void 0,at(this,n)}run(){if(!this.active)return this.fn();let e=h,s=v;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=h,h=this,v=!0,R=1<<++S,S<=W?zt(this):tt(this),this.fn()}finally{S<=W&&At(this),R=1<<--S,h=this.parent,v=s,this.parent=void 0,this.deferStop&&this.stop()}}stop(){h===this?this.deferStop=!0:this.active&&(tt(this),this.onStop&&this.onStop(),this.active=!1)}}function tt(t){const{deps:e}=t;if(e.length){for(let s=0;s<e.length;s++)e[s].delete(t);e.length=0}}function Re(t,e){t.effect&&(t=t.effect.fn);const s=new ut(t);e&&(U(s,e),e.scope&&at(s,e.scope)),(!e||!e.lazy)&&s.run();const n=s.run.bind(s);return n.effect=s,n}function me(t){t.effect.stop()}let v=!0;const lt=[];function Ct(){lt.push(v),v=!1}function Ht(){const t=lt.pop();v=t===void 0?!0:t}function u(t,e,s){if(v&&h){let n=A.get(t);n||A.set(t,n=new Map);let r=n.get(s);r||n.set(s,r=J()),ht(r)}}function ht(t,e){let s=!1;S<=W?ft(t)||(t.n|=R,s=!ot(t)):s=!t.has(h),s&&(t.add(h),h.deps.push(t))}function m(t,e,s,n,r,i){const c=A.get(t);if(!c)return;let a=[];if(e==="clear")a=[...c.values()];else if(s==="length"&&p(t)){const l=Number(n);c.forEach((d,g)=>{(g==="length"||g>=l)&&a.push(d)})}else switch(s!==void 0&&a.push(c.get(s)),e){case"add":p(t)?L(s)&&a.push(c.get("length")):(a.push(c.get(E)),z(t)&&a.push(c.get(B)));break;case"delete":p(t)||(a.push(c.get(E)),z(t)&&a.push(c.get(B)));break;case"set":z(t)&&a.push(c.get(E));break}if(a.length===1)a[0]&&F(a[0]);else{const l=[];for(const d of a)d&&l.push(...d);F(J(l))}}function F(t,e){const s=p(t)?t:[...t];for(const n of s)n.computed&&et(n);for(const n of s)n.computed||et(n)}function et(t,e){(t!==h||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}function jt(t,e){var s;return(s=A.get(t))==null?void 0:s.get(e)}const Dt=Kt("__proto__,__v_isRef,__isVue"),_t=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Y)),Gt=H(),Nt=H(!1,!0),Vt=H(!0),Wt=H(!0,!0),st=Bt();function Bt(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...s){const n=o(this);for(let i=0,c=this.length;i<c;i++)u(n,"get",i+"");const r=n[e](...s);return r===-1||r===!1?n[e](...s.map(o)):r}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...s){Ct();const n=o(this)[e].apply(this,s);return Ht(),n}}),t}function Ft(t){const e=o(this);return u(e,"has",t),e.hasOwnProperty(t)}function H(t=!1,e=!1){return function(n,r,i){if(r==="__v_isReactive")return!t;if(r==="__v_isReadonly")return t;if(r==="__v_isShallow")return e;if(r==="__v_raw"&&i===(t?e?mt:Rt:e?vt:wt).get(n))return n;const c=p(n);if(!t){if(c&&C(st,r))return Reflect.get(st,r,i);if(r==="hasOwnProperty")return Ft}const a=Reflect.get(n,r,i);return(Y(r)?_t.has(r):Dt(r))||(t||u(n,"get",r),e)?a:_(a)?c&&L(r)?a:a.value:M(a)?t?bt(a):Et(a):a}}const Yt=pt(),$t=pt(!0);function pt(t=!1){return function(s,n,r,i){let c=s[n];if(b(c)&&_(c)&&!_(r))return!1;if(!t&&(!St(r)&&!b(r)&&(c=o(c),r=o(r)),!p(s)&&_(c)&&!_(r)))return c.value=r,!0;const a=p(s)&&L(n)?Number(n)<s.length:C(s,n),l=Reflect.set(s,n,r,i);return s===o(i)&&(a?$(r,c)&&m(s,"set",n,r):m(s,"add",n,r)),l}}function qt(t,e){const s=C(t,e);t[e];const n=Reflect.deleteProperty(t,e);return n&&s&&m(t,"delete",e,void 0),n}function Lt(t,e){const s=Reflect.has(t,e);return(!Y(e)||!_t.has(e))&&u(t,"has",e),s}function Ut(t){return u(t,"iterate",p(t)?"length":E),Reflect.ownKeys(t)}const dt={get:Gt,set:Yt,deleteProperty:qt,has:Lt,ownKeys:Ut},gt={get:Vt,set(t,e){return!0},deleteProperty(t,e){return!0}},Jt=U({},dt,{get:Nt,set:$t}),Qt=U({},gt,{get:Wt}),Q=t=>t,j=t=>Reflect.getPrototypeOf(t);function x(t,e,s=!1,n=!1){t=t.__v_raw;const r=o(t),i=o(e);s||(e!==i&&u(r,"get",e),u(r,"get",i));const{has:c}=j(r),a=n?Q:s?Z:I;if(c.call(r,e))return a(t.get(e));if(c.call(r,i))return a(t.get(i));t!==r&&t.get(e)}function y(t,e=!1){const s=this.__v_raw,n=o(s),r=o(t);return e||(t!==r&&u(n,"has",t),u(n,"has",r)),t===r?s.has(t):s.has(t)||s.has(r)}function K(t,e=!1){return t=t.__v_raw,!e&&u(o(t),"iterate",E),Reflect.get(t,"size",t)}function nt(t){t=o(t);const e=o(this);return j(e).has.call(e,t)||(e.add(t),m(e,"add",t,t)),this}function rt(t,e){e=o(e);const s=o(this),{has:n,get:r}=j(s);let i=n.call(s,t);i||(t=o(t),i=n.call(s,t));const c=r.call(s,t);return s.set(t,e),i?$(e,c)&&m(s,"set",t,e):m(s,"add",t,e),this}function it(t){const e=o(this),{has:s,get:n}=j(e);let r=s.call(e,t);r||(t=o(t),r=s.call(e,t)),n&&n.call(e,t);const i=e.delete(t);return r&&m(e,"delete",t,void 0),i}function ct(){const t=o(this),e=t.size!==0,s=t.clear();return e&&m(t,"clear",void 0,void 0),s}function P(t,e){return function(n,r){const i=this,c=i.__v_raw,a=o(c),l=e?Q:t?Z:I;return!t&&u(a,"iterate",E),c.forEach((d,g)=>n.call(r,l(d),l(g),i))}}function O(t,e,s){return function(...n){const r=this.__v_raw,i=o(r),c=z(i),a=t==="entries"||t===Symbol.iterator&&c,l=t==="keys"&&c,d=r[t](...n),g=s?Q:e?Z:I;return!e&&u(i,"iterate",l?B:E),{next(){const{value:T,done:V}=d.next();return V?{value:T,done:V}:{value:a?[g(T[0]),g(T[1])]:g(T),done:V}},[Symbol.iterator](){return this}}}}function w(t){return function(...e){return t==="delete"?!1:this}}function Xt(){const t={get(i){return x(this,i)},get size(){return K(this)},has:y,add:nt,set:rt,delete:it,clear:ct,forEach:P(!1,!1)},e={get(i){return x(this,i,!1,!0)},get size(){return K(this)},has:y,add:nt,set:rt,delete:it,clear:ct,forEach:P(!1,!0)},s={get(i){return x(this,i,!0)},get size(){return K(this,!0)},has(i){return y.call(this,i,!0)},add:w("add"),set:w("set"),delete:w("delete"),clear:w("clear"),forEach:P(!0,!1)},n={get(i){return x(this,i,!0,!0)},get size(){return K(this,!0)},has(i){return y.call(this,i,!0)},add:w("add"),set:w("set"),delete:w("delete"),clear:w("clear"),forEach:P(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=O(i,!1,!1),s[i]=O(i,!0,!1),e[i]=O(i,!1,!0),n[i]=O(i,!0,!0)}),[t,s,e,n]}const[Zt,kt,te,ee]=Xt();function D(t,e){const s=e?t?ee:te:t?kt:Zt;return(n,r,i)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?n:Reflect.get(C(s,r)&&r in n?s:n,r,i)}const se={get:D(!1,!1)},ne={get:D(!1,!0)},re={get:D(!0,!1)},ie={get:D(!0,!0)},wt=new WeakMap,vt=new WeakMap,Rt=new WeakMap,mt=new WeakMap;function ce(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ae(t){return t.__v_skip||!Object.isExtensible(t)?0:ce(xt(t))}function Et(t){return b(t)?t:G(t,!1,dt,se,wt)}function Ee(t){return G(t,!1,Jt,ne,vt)}function bt(t){return G(t,!0,gt,re,Rt)}function be(t){return G(t,!0,Qt,ie,mt)}function G(t,e,s,n,r){if(!M(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=r.get(t);if(i)return i;const c=ae(t);if(c===0)return t;const a=new Proxy(t,c===2?n:s);return r.set(t,a),a}function X(t){return b(t)?X(t.__v_raw):!!(t&&t.__v_isReactive)}function b(t){return!!(t&&t.__v_isReadonly)}function St(t){return!!(t&&t.__v_isShallow)}function Se(t){return X(t)||b(t)}function o(t){const e=t&&t.__v_raw;return e?o(e):t}function Ie(t){return Pt(t,"__v_skip",!0),t}const I=t=>M(t)?Et(t):t,Z=t=>M(t)?bt(t):t;function k(t){v&&h&&(t=o(t),ht(t.dep||(t.dep=J())))}function N(t,e){t=o(t);const s=t.dep;s&&F(s)}function _(t){return!!(t&&t.__v_isRef===!0)}function oe(t){return It(t,!1)}function Me(t){return It(t,!0)}function It(t,e){return _(t)?t:new fe(t,e)}class fe{constructor(e,s){this.__v_isShallow=s,this.dep=void 0,this.__v_isRef=!0,this._rawValue=s?e:o(e),this._value=s?e:I(e)}get value(){return k(this),this._value}set value(e){const s=this.__v_isShallow||St(e)||b(e);e=s?e:o(e),$(e,this._rawValue)&&(this._rawValue=e,this._value=s?e:I(e),N(this))}}function Te(t){N(t)}function Mt(t){return _(t)?t.value:t}function xe(t){return q(t)?t():Mt(t)}const ue={get:(t,e,s)=>Mt(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const r=t[e];return _(r)&&!_(s)?(r.value=s,!0):Reflect.set(t,e,s,n)}};function ye(t){return X(t)?t:new Proxy(t,ue)}class le{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:s,set:n}=e(()=>k(this),()=>N(this));this._get=s,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function Ke(t){return new le(t)}function Pe(t){const e=p(t)?new Array(t.length):{};for(const s in t)e[s]=Tt(t,s);return e}class he{constructor(e,s,n){this._object=e,this._key=s,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return jt(o(this._object),this._key)}}class _e{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Oe(t,e,s){return _(t)?t:q(t)?new _e(t):M(t)&&arguments.length>1?Tt(t,e,s):oe(t)}function Tt(t,e,s){const n=t[e];return _(n)?n:new he(t,e,s)}class pe{constructor(e,s,n,r){this._setter=s,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new ut(e,()=>{this._dirty||(this._dirty=!0,N(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=n}get value(){const e=o(this);return k(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function ze(t,e,s=!1){let n,r;const i=q(t);return i?(n=t,r=yt):(n=t.get,r=t.set),new pe(n,r,i||!r,s)}export{be as A,me as B,xe as C,Te as D,Ot as E,ut as R,St as a,X as b,Se as c,ze as d,ye as e,u as f,we as g,Et as h,_ as i,m as j,oe as k,Me as l,Ie as m,bt as n,ve as o,Ct as p,Oe as q,Ht as r,Ee as s,o as t,Mt as u,ge as v,Pe as w,Ke as x,Re as y,b as z};
|