mirror of
https://github.com/JasonYANG170/IOTConnect-Web.git
synced 2024-11-24 04:36:31 +00:00
7 lines
13 KiB
JavaScript
7 lines
13 KiB
JavaScript
|
/**
|
||
|
* @vue/reactivity v3.4.21
|
||
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
|
* @license MIT
|
||
|
**/
|
||
|
function t(t,e){const s=new Set(t.split(","));return e?t=>s.has(t.toLowerCase()):t=>s.has(t)}const e=()=>{},s=Object.assign,n=Object.prototype.hasOwnProperty,i=(t,e)=>n.call(t,e),r=Array.isArray,c=t=>"[object Map]"===a(t),o=t=>"function"==typeof t,u=t=>"symbol"==typeof t,l=t=>null!==t&&"object"==typeof t,h=Object.prototype.toString,a=t=>h.call(t),_=t=>a(t).slice(8,-1),f=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,d=(t,e)=>!Object.is(t,e);let p,v;class g{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=p,!t&&p&&(this.index=(p.scopes||(p.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=p;try{return p=this,t()}finally{p=e}}}on(){p=this}off(){p=this.parent}stop(t){if(this._active){let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}function y(t){return new g(t)}function w(t,e=p){e&&e.active&&e.effects.push(t)}function R(){return p}function b(t){p&&p.cleanups.push(t)}class S{constructor(t,e,s,n){this.fn=t,this.trigger=e,this.scheduler=s,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,w(this,n)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,A();for(let t=0;t<this._depsLength;t++){const e=this.deps[t];if(e.computed&&(L(e.computed),this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),W()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=x,e=v;try{return x=!0,v=this,this._runnings++,k(this),this.fn()}finally{E(this),this._runnings--,v=e,x=t}}stop(){var t;this.active&&(k(this),E(this),null==(t=this.onStop)||t.call(this),this.active=!1)}}function L(t){return t.value}function k(t){t._trackId++,t._depsLength=0}function E(t){if(t.deps.length>t._depsLength){for(let e=t._depsLength;e<t.deps.length;e++)O(t.deps[e],t);t.deps.length=t._depsLength}}function O(t,e){const s=t.get(e);void 0!==s&&e._trackId!==s&&(t.delete(e),0===t.size&&t.cleanup())}function m(t,n){t.effect instanceof S&&(t=t.effect.fn);const i=new S(t,e,(()=>{i.dirty&&i.run()}));n&&(s(i,n),n.scope&&w(i,n.scope)),n&&n.lazy||i.run();const r=i.run.bind(i);return r.effect=i,r}function j(t){t.effect.stop()}let x=!0,I=0;const P=[];function A(){P.push(x),x=!1}function M(){P.push(x),x=!0}function W(){const t=P.pop();x=void 0===t||t}function z(){I++}function V(){for(I--;!I&&T.length;)T.shift()()}function N(t,e,s){if(e.get(t)!==t._trackId){e.set(t,t._trackId);const s=t.deps[t._depsLength];s!==e?(s&&O(s,t),t.deps[t._depsLength++]=e):t._depsLength++}}const T=[];function D(t,e,s){z();for(const n of t.keys()){let s;n._dirtyLevel<e&&(null!=s?s:s=t.get(n)===n._trackId)&&(n._shouldSchedule||(n._shouldSchedule=0===n._dirtyLevel),n._dirtyLevel=e),n._shouldSchedule&&(null!=s?s:s=t.get(n)===n._trackId)&&(n.trigger(),n._runnings&&!n.allowRecurse||2===n._dirtyLevel||(n._shouldSchedule=!1,n.scheduler&&T.push(n.scheduler)))}V()}const C=(t,e)=>{const s=new Map;return s.cleanup=t,s.computed=e,s},K=new WeakMap,H=Symbol(""),G=Symbol("");function Y(t,e,s){if(x&&v){let e=K.get(t);e||K.set(t,e=new Map);let n=e.get(s);n||e.set(s,n=C((()=>e.delete(s)))),N(v,n)}}function q(t,e,s,n,i,o){const l=K.get(t);if(!l)return;let h=[];if("clear"===e)h=[...l.values()];else if("length"===s&&r(t)){const t=Number(n);l.forEach(((e,s)=>{("length"===s||!u(s)&&s>=t)&&h.push(e)}))}else switch(void 0!==s&&h.push(l.get(s)),e){case"add":r(t)?f(s)&&h.push(l.get("length")):(h.push(l.get(H)),c(t)&&h.push(l.get(G)));break;case"delete":r(t)||(h.push(l.get(H)),c(t)&&h.push(l.get(G)));break;case"set":c(t)&&h.push(l.get(H))}z();for(const r of h)r&&D(r,4);V()}const B=t("__proto__,__v_isRef,__isVue"),F=new Set(Object.g
|