baixingwenzheng-pc/node_modules/@vue/reactivity/dist/reactivity.global.prod.js

2 lines
11 KiB
JavaScript
Raw Normal View History

2024-01-29 09:26:07 +08:00
var VueReactivity=function(t){"use strict";function e(t,e){const n=Object.create(null),s=t.split(",");for(let r=0;r<s.length;r++)n[s[r]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}const n=()=>{},s=Object.assign,r=Object.prototype.hasOwnProperty,i=(t,e)=>r.call(t,e),c=Array.isArray,o=t=>"[object Map]"===f(t),u=t=>"function"==typeof t,a=t=>"symbol"==typeof t,l=t=>null!==t&&"object"==typeof t,h=Object.prototype.toString,f=t=>h.call(t),_=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,p=(t,e)=>!Object.is(t,e);let d;const v=[];class g{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&d&&(this.parent=d,this.index=(d.scopes||(d.scopes=[])).push(this)-1)}run(t){if(this.active)try{return this.on(),t()}finally{this.off()}}on(){this.active&&(v.push(this),d=this)}off(){this.active&&(v.pop(),d=v[v.length-1])}stop(t){if(this.active){if(this.effects.forEach((t=>t.stop())),this.cleanups.forEach((t=>t())),this.scopes&&this.scopes.forEach((t=>t.stop(!0))),this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.active=!1}}}function y(t,e){(e=e||d)&&e.active&&e.effects.push(t)}const w=t=>{const e=new Set(t);return e.w=0,e.n=0,e},R=t=>(t.w&E)>0,b=t=>(t.n&E)>0,k=new WeakMap;let m=0,E=1;const S=[];let j;const O=Symbol(""),x=Symbol("");class P{constructor(t,e=null,n){this.fn=t,this.scheduler=e,this.active=!0,this.deps=[],y(this,n)}run(){if(!this.active)return this.fn();if(!S.includes(this))try{return S.push(j=this),T(),E=1<<++m,m<=30?(({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=E})(this):M(this),this.fn()}finally{m<=30&&(t=>{const{deps:e}=t;if(e.length){let n=0;for(let s=0;s<e.length;s++){const r=e[s];R(r)&&!b(r)?r.delete(t):e[n++]=r,r.w&=~E,r.n&=~E}e.length=n}})(this),E=1<<--m,V(),S.pop();const t=S.length;j=t>0?S[t-1]:void 0}}stop(){this.active&&(M(this),this.onStop&&this.onStop(),this.active=!1)}}function M(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let z=!0;const W=[];function A(){W.push(z),z=!1}function T(){W.push(z),z=!0}function V(){const t=W.pop();z=void 0===t||t}function N(t,e,n){if(!C())return;let s=k.get(t);s||k.set(t,s=new Map);let r=s.get(n);r||s.set(n,r=w()),I(r)}function C(){return z&&void 0!==j}function I(t,e){let n=!1;m<=30?b(t)||(t.n|=E,n=!R(t)):n=!t.has(j),n&&(t.add(j),j.deps.push(t))}function K(t,e,n,s,r,i){const u=k.get(t);if(!u)return;let a=[];if("clear"===e)a=[...u.values()];else if("length"===n&&c(t))u.forEach(((t,e)=>{("length"===e||e>=s)&&a.push(t)}));else switch(void 0!==n&&a.push(u.get(n)),e){case"add":c(t)?_(n)&&a.push(u.get("length")):(a.push(u.get(O)),o(t)&&a.push(u.get(x)));break;case"delete":c(t)||(a.push(u.get(O)),o(t)&&a.push(u.get(x)));break;case"set":o(t)&&a.push(u.get(O))}if(1===a.length)a[0]&&B(a[0]);else{const t=[];for(const e of a)e&&t.push(...e);B(w(t))}}function B(t,e){for(const n of c(t)?t:[...t])(n!==j||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const D=e("__proto__,__v_isRef,__isVue"),L=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(a)),Y=Q(),q=Q(!1,!0),F=Q(!0),G=Q(!0,!0),H=J();function J(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const n=Vt(this);for(let e=0,r=this.length;e<r;e++)N(n,0,e+"");const s=n[e](...t);return-1===s||!1===s?n[e](...t.map(Vt)):s}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){A();const n=Vt(this)[e].apply(this,t);return V(),n}})),t}function Q(t=!1,e=!1){return function(n,s,r){if("__v_isReactive"===s)return!t;if("__v_isReadonly"===s)return t;if("__v_raw"===s&&r===(t?e?xt:Ot:e?jt:St).get(n))return n;const o=c(n);if(!t&&o&&i(H,s))return Reflect.get(H,s,r);const u=Reflect.get(n,s,r);if(a(s)?L.has(s):D(s))return u;if(t||N(n,0,s),e)return u;if(Kt(u)){return!o||!_(s)?u.value:u}return l(u)?t?zt(u):Mt(u):u}}function U(t=!1){return function(e,n,s,r){let o=e[n];if(!t&&(s=Vt(s),o=Vt(o),!c(e)&&Kt(o)&&!Kt(s)))return o.value=s,!0;const u=c(e)&&_(n)?Number(n)<e.length:i(e,n),a=Reflect.set(e,n,s,r);return e===Vt(r)&&(u?