mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 14:25:41 +08:00
2 lines
23 KiB
JavaScript
2 lines
23 KiB
JavaScript
var Ze=typeof global=="object"&&global&&global.Object===Object&&global,pt=typeof self=="object"&&self&&self.Object===Object&&self,w=Ze||pt||Function("return this")(),y=w.Symbol,We=Object.prototype,_t=We.hasOwnProperty,bt=We.toString,D=y?y.toStringTag:void 0;function yt(e){var t=_t.call(e,D),r=e[D];try{e[D]=void 0;var n=!0}catch{}var i=bt.call(e);return n&&(t?e[D]=r:delete e[D]),i}var vt=Object.prototype,Ot=vt.toString;function mt(e){return Ot.call(e)}var wt="[object Null]",Tt="[object Undefined]",Oe=y?y.toStringTag:void 0;function M(e){return e==null?e===void 0?Tt:wt:Oe&&Oe in Object(e)?yt(e):mt(e)}function j(e){return e!=null&&typeof e=="object"}var At="[object Symbol]";function he(e){return typeof e=="symbol"||j(e)&&M(e)==At}function Je(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var g=Array.isArray,me=y?y.prototype:void 0,we=me?me.toString:void 0;function Qe(e){if(typeof e=="string")return e;if(g(e))return Je(e,Qe)+"";if(he(e))return we?we.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function ce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function J(e){return e}var Pt="[object AsyncFunction]",Et="[object Function]",$t="[object GeneratorFunction]",St="[object Proxy]";function Z(e){if(!ce(e))return!1;var t=M(e);return t==Et||t==$t||t==Pt||t==St}var re=w["__core-js_shared__"],Te=(function(){var e=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Ct(e){return!!Te&&Te in e}var jt=Function.prototype,xt=jt.toString;function I(e){if(e!=null){try{return xt.call(e)}catch{}try{return e+""}catch{}}return""}var It=/[\\^$.*+?()[\]{}|]/g,Lt=/^\[object .+?Constructor\]$/,Rt=Function.prototype,Nt=Object.prototype,Mt=Rt.toString,Dt=Nt.hasOwnProperty,Ft=RegExp("^"+Mt.call(Dt).replace(It,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gt(e){if(!ce(e)||Ct(e))return!1;var t=Z(e)?Ft:Lt;return t.test(I(e))}function Ut(e,t){return e?.[t]}function L(e,t){var r=Ut(e,t);return Gt(r)?r:void 0}var oe=L(w,"WeakMap");function zt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Ht(){}var Bt=800,Kt=16,qt=Date.now;function Xt(e){var t=0,r=0;return function(){var n=qt(),i=Kt-(n-r);if(r=n,i>0){if(++t>=Bt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function F(e){return function(){return e}}var Ae=(function(){try{var e=L(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Yt=Ae?function(e,t){return Ae(e,"toString",{configurable:!0,enumerable:!1,value:F(t),writable:!0})}:J,Zt=Xt(Yt);function Wt(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}function Jt(e,t,r,n){for(var i=e.length,s=r+-1;++s<i;)if(t(e[s],s,e))return s;return-1}function Qt(e){return e!==e}function Vt(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function kt(e,t,r){return t===t?Vt(e,t,r):Jt(e,Qt,r)}function er(e,t){var r=e==null?0:e.length;return!!r&&kt(e,t,0)>-1}var tr=9007199254740991,rr=/^(?:0|[1-9]\d*)$/;function Ve(e,t){var r=typeof e;return t=t??tr,!!t&&(r=="number"||r!="symbol"&&rr.test(e))&&e>-1&&e%1==0&&e<t}function ke(e,t){return e===t||e!==e&&t!==t}var Pe=Math.max;function nr(e,t,r){return t=Pe(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Pe(n.length-t,0),a=Array(s);++i<s;)a[i]=n[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=n[i];return o[t]=r(a),zt(e,this,o)}}function ir(e,t){return Zt(nr(e,t,J),e+"")}var sr=9007199254740991;function le(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=sr}function Q(e){return e!=null&&le(e.length)&&!Z(e)}var ar=Object.prototype;function et(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ar;return e===r}function or(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var ur="[object Arguments]";function Ee(e){return j(e)&&M(e)==ur}var tt=Object.prototype,fr=tt.hasOwnProperty,hr=tt.propertyIsEnumerable,V=Ee((function(){return arguments})())?Ee:function(e){return j(e)&&fr.call(e,"callee")&&!hr.call(e,"callee")};function cr(){return!1}var rt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$e=rt&&typeof module=="object"&&module&&!module.nodeType&&module,lr=$e&&$e.exports===rt,Se=lr?w.Buffer:void 0,dr=Se?Se.isBuffer:void 0,W=dr||cr,gr="[object Arguments]",pr="[object Array]",_r="[object Boolean]",br="[object Date]",yr="[object Error]",vr="[object Function]",Or="[object Map]",mr="[object Number]",wr="[object Object]",Tr="[object RegExp]",Ar="[object Set]",Pr="[object String]",Er="[object WeakMap]",$r="[object ArrayBuffer]",Sr="[object DataView]",Cr="[object Float32Array]",jr="[object Float64Array]",xr="[object Int8Array]",Ir="[object Int16Array]",Lr="[object Int32Array]",Rr="[object Uint8Array]",Nr="[object Uint8ClampedArray]",Mr="[object Uint16Array]",Dr="[object Uint32Array]",h={};h[Cr]=h[jr]=h[xr]=h[Ir]=h[Lr]=h[Rr]=h[Nr]=h[Mr]=h[Dr]=!0;h[gr]=h[pr]=h[$r]=h[_r]=h[Sr]=h[br]=h[yr]=h[vr]=h[Or]=h[mr]=h[wr]=h[Tr]=h[Ar]=h[Pr]=h[Er]=!1;function Fr(e){return j(e)&&le(e.length)&&!!h[M(e)]}function Gr(e){return function(t){return e(t)}}var nt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,U=nt&&typeof module=="object"&&module&&!module.nodeType&&module,Ur=U&&U.exports===nt,ne=Ur&&Ze.process,Ce=(function(){try{var e=U&&U.require&&U.require("util").types;return e||ne&&ne.binding&&ne.binding("util")}catch{}})(),je=Ce&&Ce.isTypedArray,de=je?Gr(je):Fr,zr=Object.prototype,Hr=zr.hasOwnProperty;function Br(e,t){var r=g(e),n=!r&&V(e),i=!r&&!n&&W(e),s=!r&&!n&&!i&&de(e),a=r||n||i||s,o=a?or(e.length,String):[],u=o.length;for(var f in e)(t||Hr.call(e,f))&&!(a&&(f=="length"||i&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Ve(f,u)))&&o.push(f);return o}function Kr(e,t){return function(r){return e(t(r))}}var qr=Kr(Object.keys,Object),Xr=Object.prototype,Yr=Xr.hasOwnProperty;function it(e){if(!et(e))return qr(e);var t=[];for(var r in Object(e))Yr.call(e,r)&&r!="constructor"&&t.push(r);return t}function b(e){return Q(e)?Br(e):it(e)}var Zr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wr=/^\w*$/;function ge(e,t){if(g(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||he(e)?!0:Wr.test(e)||!Zr.test(e)||t!=null&&e in Object(t)}var z=L(Object,"create");function Jr(){this.__data__=z?z(null):{},this.size=0}function Qr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Vr="__lodash_hash_undefined__",kr=Object.prototype,en=kr.hasOwnProperty;function tn(e){var t=this.__data__;if(z){var r=t[e];return r===Vr?void 0:r}return en.call(t,e)?t[e]:void 0}var rn=Object.prototype,nn=rn.hasOwnProperty;function sn(e){var t=this.__data__;return z?t[e]!==void 0:nn.call(t,e)}var an="__lodash_hash_undefined__";function on(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=z&&t===void 0?an:t,this}function x(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}x.prototype.clear=Jr;x.prototype.delete=Qr;x.prototype.get=tn;x.prototype.has=sn;x.prototype.set=on;function un(){this.__data__=[],this.size=0}function k(e,t){for(var r=e.length;r--;)if(ke(e[r][0],t))return r;return-1}var fn=Array.prototype,hn=fn.splice;function cn(e){var t=this.__data__,r=k(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():hn.call(t,r,1),--this.size,!0}function ln(e){var t=this.__data__,r=k(t,e);return r<0?void 0:t[r][1]}function dn(e){return k(this.__data__,e)>-1}function gn(e,t){var r=this.__data__,n=k(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function T(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}T.prototype.clear=un;T.prototype.delete=cn;T.prototype.get=ln;T.prototype.has=dn;T.prototype.set=gn;var H=L(w,"Map");function pn(){this.size=0,this.__data__={hash:new x,map:new(H||T),string:new x}}function _n(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ee(e,t){var r=e.__data__;return _n(t)?r[typeof t=="string"?"string":"hash"]:r.map}function bn(e){var t=ee(this,e).delete(e);return this.size-=t?1:0,t}function yn(e){return ee(this,e).get(e)}function vn(e){return ee(this,e).has(e)}function On(e,t){var r=ee(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function A(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}A.prototype.clear=pn;A.prototype.delete=bn;A.prototype.get=yn;A.prototype.has=vn;A.prototype.set=On;var mn="Expected a function";function pe(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(mn);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a)||s,a};return r.cache=new(pe.Cache||A),r}pe.Cache=A;var wn=500;function Tn(e){var t=pe(e,function(n){return r.size===wn&&r.clear(),n}),r=t.cache;return t}var An=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pn=/\\(\\)?/g,En=Tn(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(An,function(r,n,i,s){t.push(i?s.replace(Pn,"$1"):n||r)}),t});function $n(e){return e==null?"":Qe(e)}function st(e,t){return g(e)?e:ge(e,t)?[e]:En($n(e))}function te(e){if(typeof e=="string"||he(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function at(e,t){t=st(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[te(t[r++])];return r&&r==n?e:void 0}function Sn(e,t,r){var n=e==null?void 0:at(e,t);return n===void 0?r:n}function ot(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var xe=y?y.isConcatSpreadable:void 0;function Cn(e){return g(e)||V(e)||!!(xe&&e&&e[xe])}function jn(e,t,r,n,i){var s=-1,a=e.length;for(r||(r=Cn),i||(i=[]);++s<a;){var o=e[s];r(o)?ot(i,o):n||(i[i.length]=o)}return i}function xn(e,t,r,n){var i=-1,s=e==null?0:e.length;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}function In(){this.__data__=new T,this.size=0}function Ln(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Rn(e){return this.__data__.get(e)}function Nn(e){return this.__data__.has(e)}var Mn=200;function Dn(e,t){var r=this.__data__;if(r instanceof T){var n=r.__data__;if(!H||n.length<Mn-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new A(n)}return r.set(e,t),this.size=r.size,this}function m(e){var t=this.__data__=new T(e);this.size=t.size}m.prototype.clear=In;m.prototype.delete=Ln;m.prototype.get=Rn;m.prototype.has=Nn;m.prototype.set=Dn;function ut(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[i++]=a)}return s}function Fn(){return[]}var Gn=Object.prototype,Un=Gn.propertyIsEnumerable,Ie=Object.getOwnPropertySymbols,zn=Ie?function(e){return e==null?[]:(e=Object(e),ut(Ie(e),function(t){return Un.call(e,t)}))}:Fn;function Hn(e,t,r){var n=t(e);return g(e)?n:ot(n,r(e))}function Le(e){return Hn(e,b,zn)}var ue=L(w,"DataView"),fe=L(w,"Promise"),N=L(w,"Set"),Re="[object Map]",Bn="[object Object]",Ne="[object Promise]",Me="[object Set]",De="[object WeakMap]",Fe="[object DataView]",Kn=I(ue),qn=I(H),Xn=I(fe),Yn=I(N),Zn=I(oe),O=M;(ue&&O(new ue(new ArrayBuffer(1)))!=Fe||H&&O(new H)!=Re||fe&&O(fe.resolve())!=Ne||N&&O(new N)!=Me||oe&&O(new oe)!=De)&&(O=function(e){var t=M(e),r=t==Bn?e.constructor:void 0,n=r?I(r):"";if(n)switch(n){case Kn:return Fe;case qn:return Re;case Xn:return Ne;case Yn:return Me;case Zn:return De}return t});var Ge=w.Uint8Array,Wn="__lodash_hash_undefined__";function Jn(e){return this.__data__.set(e,Wn),this}function Qn(e){return this.__data__.has(e)}function B(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new A;++t<r;)this.add(e[t])}B.prototype.add=B.prototype.push=Jn;B.prototype.has=Qn;function Vn(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function ft(e,t){return e.has(t)}var kn=1,ei=2;function ht(e,t,r,n,i,s){var a=r&kn,o=e.length,u=t.length;if(o!=u&&!(a&&u>o))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var c=-1,l=!0,v=r&ei?new B:void 0;for(s.set(e,t),s.set(t,e);++c<o;){var p=e[c],_=t[c];if(n)var P=a?n(_,p,c,t,e,s):n(p,_,c,e,t,s);if(P!==void 0){if(P)continue;l=!1;break}if(v){if(!Vn(t,function(E,$){if(!ft(v,$)&&(p===E||i(p,E,r,n,s)))return v.push($)})){l=!1;break}}else if(!(p===_||i(p,_,r,n,s))){l=!1;break}}return s.delete(e),s.delete(t),l}function ti(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function _e(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var ri=1,ni=2,ii="[object Boolean]",si="[object Date]",ai="[object Error]",oi="[object Map]",ui="[object Number]",fi="[object RegExp]",hi="[object Set]",ci="[object String]",li="[object Symbol]",di="[object ArrayBuffer]",gi="[object DataView]",Ue=y?y.prototype:void 0,ie=Ue?Ue.valueOf:void 0;function pi(e,t,r,n,i,s,a){switch(r){case gi:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case di:return!(e.byteLength!=t.byteLength||!s(new Ge(e),new Ge(t)));case ii:case si:case ui:return ke(+e,+t);case ai:return e.name==t.name&&e.message==t.message;case fi:case ci:return e==t+"";case oi:var o=ti;case hi:var u=n&ri;if(o||(o=_e),e.size!=t.size&&!u)return!1;var f=a.get(e);if(f)return f==t;n|=ni,a.set(e,t);var d=ht(o(e),o(t),n,i,s,a);return a.delete(e),d;case li:if(ie)return ie.call(e)==ie.call(t)}return!1}var _i=1,bi=Object.prototype,yi=bi.hasOwnProperty;function vi(e,t,r,n,i,s){var a=r&_i,o=Le(e),u=o.length,f=Le(t),d=f.length;if(u!=d&&!a)return!1;for(var c=u;c--;){var l=o[c];if(!(a?l in t:yi.call(t,l)))return!1}var v=s.get(e),p=s.get(t);if(v&&p)return v==t&&p==e;var _=!0;s.set(e,t),s.set(t,e);for(var P=a;++c<u;){l=o[c];var E=e[l],$=t[l];if(n)var ve=a?n($,E,l,t,e,s):n(E,$,l,e,t,s);if(!(ve===void 0?E===$||i(E,$,r,n,s):ve)){_=!1;break}P||(P=l=="constructor")}if(_&&!P){var K=e.constructor,q=t.constructor;K!=q&&"constructor"in e&&"constructor"in t&&!(typeof K=="function"&&K instanceof K&&typeof q=="function"&&q instanceof q)&&(_=!1)}return s.delete(e),s.delete(t),_}var Oi=1,ze="[object Arguments]",He="[object Array]",X="[object Object]",mi=Object.prototype,Be=mi.hasOwnProperty;function wi(e,t,r,n,i,s){var a=g(e),o=g(t),u=a?He:O(e),f=o?He:O(t);u=u==ze?X:u,f=f==ze?X:f;var d=u==X,c=f==X,l=u==f;if(l&&W(e)){if(!W(t))return!1;a=!0,d=!1}if(l&&!d)return s||(s=new m),a||de(e)?ht(e,t,r,n,i,s):pi(e,t,u,r,n,i,s);if(!(r&Oi)){var v=d&&Be.call(e,"__wrapped__"),p=c&&Be.call(t,"__wrapped__");if(v||p){var _=v?e.value():e,P=p?t.value():t;return s||(s=new m),i(_,P,r,n,s)}}return l?(s||(s=new m),vi(e,t,r,n,i,s)):!1}function be(e,t,r,n,i){return e===t?!0:e==null||t==null||!j(e)&&!j(t)?e!==e&&t!==t:wi(e,t,r,n,be,i)}var Ti=1,Ai=2;function Pi(e,t,r,n){var i=r.length,s=i;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var o=a[0],u=e[o],f=a[1];if(a[2]){if(u===void 0&&!(o in e))return!1}else{var d=new m,c;if(!(c===void 0?be(f,u,Ti|Ai,n,d):c))return!1}}return!0}function ct(e){return e===e&&!ce(e)}function Ei(e){for(var t=b(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,ct(i)]}return t}function lt(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function $i(e){var t=Ei(e);return t.length==1&&t[0][2]?lt(t[0][0],t[0][1]):function(r){return r===e||Pi(r,e,t)}}function Si(e,t){return e!=null&&t in Object(e)}function Ci(e,t,r){t=st(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var a=te(t[n]);if(!(s=e!=null&&r(e,a)))break;e=e[a]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&le(i)&&Ve(a,i)&&(g(e)||V(e)))}function ji(e,t){return e!=null&&Ci(e,t,Si)}var xi=1,Ii=2;function Li(e,t){return ge(e)&&ct(t)?lt(te(e),t):function(r){var n=Sn(r,e);return n===void 0&&n===t?ji(r,e):be(t,n,xi|Ii)}}function Ri(e){return function(t){return t?.[e]}}function Ni(e){return function(t){return at(t,e)}}function Mi(e){return ge(e)?Ri(te(e)):Ni(e)}function dt(e){return typeof e=="function"?e:e==null?J:typeof e=="object"?g(e)?Li(e[0],e[1]):$i(e):Mi(e)}function Di(e){return function(t,r,n){for(var i=-1,s=Object(t),a=n(t),o=a.length;o--;){var u=a[++i];if(r(s[u],u,s)===!1)break}return t}}var Fi=Di();function Gi(e,t){return e&&Fi(e,t,b)}function Ui(e,t){return function(r,n){if(r==null)return r;if(!Q(r))return e(r,n);for(var i=r.length,s=-1,a=Object(r);++s<i&&n(a[s],s,a)!==!1;);return r}}var ye=Ui(Gi);function zi(e){return j(e)&&Q(e)}function Hi(e){return typeof e=="function"?e:J}function S(e,t){var r=g(e)?Wt:ye;return r(e,Hi(t))}function Bi(e,t){var r=[];return ye(e,function(n,i,s){t(n,i,s)&&r.push(n)}),r}function Y(e,t){var r=g(e)?ut:Bi;return r(e,dt(t))}function Ki(e,t){return Je(t,function(r){return e[r]})}function se(e){return e==null?[]:Ki(e,b(e))}var qi="[object Map]",Xi="[object Set]",Yi=Object.prototype,Zi=Yi.hasOwnProperty;function Ke(e){if(e==null)return!0;if(Q(e)&&(g(e)||typeof e=="string"||typeof e.splice=="function"||W(e)||de(e)||V(e)))return!e.length;var t=O(e);if(t==qi||t==Xi)return!e.size;if(et(e))return!it(e).length;for(var r in e)if(Zi.call(e,r))return!1;return!0}function R(e){return e===void 0}function Wi(e,t,r,n,i){return i(e,function(s,a,o){r=n?(n=!1,s):t(r,s,a,o)}),r}function Ji(e,t,r){var n=g(e)?xn:Wi,i=arguments.length<3;return n(e,dt(t),r,i,ye)}var Qi=1/0,Vi=N&&1/_e(new N([,-0]))[1]==Qi?function(e){return new N(e)}:Ht,ki=200;function es(e,t,r){var n=-1,i=er,s=e.length,a=!0,o=[],u=o;if(s>=ki){var f=Vi(e);if(f)return _e(f);a=!1,i=ft,u=new B}else u=o;e:for(;++n<s;){var d=e[n],c=d;if(d=d!==0?d:0,a&&c===c){for(var l=u.length;l--;)if(u[l]===c)continue e;o.push(d)}else i(u,c,r)||(u!==o&&u.push(c),o.push(d))}return o}var ts=ir(function(e){return es(jn(e,1,zi,!0))}),rs="\0",C="\0",qe="";class gt{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=F(void 0),this._defaultEdgeLabelFn=F(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[C]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return Z(t)||(t=F(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return b(this._nodes)}sources(){var t=this;return Y(this.nodes(),function(r){return Ke(t._in[r])})}sinks(){var t=this;return Y(this.nodes(),function(r){return Ke(t._out[r])})}setNodes(t,r){var n=arguments,i=this;return S(t,function(s){n.length>1?i.setNode(s,r):i.setNode(s)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=C,this._children[t]={},this._children[C][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],S(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),S(b(this._in[t]),r),delete this._in[t],delete this._preds[t],S(b(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(R(r))r=C;else{r+="";for(var n=r;!R(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==C)return r}}children(t){if(R(t)&&(t=C),this._isCompound){var r=this._children[t];if(r)return b(r)}else{if(t===C)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return b(r)}successors(t){var r=this._sucs[t];if(r)return b(r)}neighbors(t){var r=this.predecessors(t);if(r)return ts(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;S(this._nodes,function(a,o){t(o)&&r.setNode(o,a)}),S(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,n.edge(a))});var i={};function s(a){var o=n.parent(a);return o===void 0||r.hasNode(o)?(i[a]=o,o):o in i?i[o]:s(o)}return this._isCompound&&S(r.nodes(),function(a){r.setParent(a,s(a))}),r}setDefaultEdgeLabel(t){return Z(t)||(t=F(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return se(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return Ji(t,function(s,a){return i.length>1?n.setEdge(s,a,r):n.setEdge(s,a),a}),this}setEdge(){var t,r,n,i,s=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,n=a.name,arguments.length===2&&(i=arguments[1],s=!0)):(t=a,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),t=""+t,r=""+r,R(n)||(n=""+n);var o=G(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return s&&(this._edgeLabels[o]=i),this;if(!R(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[o]=s?i:this._defaultEdgeLabelFn(t,r,n);var u=ns(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[o]=u,Xe(this._preds[r],t),Xe(this._sucs[t],r),this._in[r][o]=u,this._out[t][o]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?ae(this._isDirected,arguments[0]):G(this._isDirected,t,r,n),s=this._edgeObjs[i];return s&&(t=s.v,r=s.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Ye(this._preds[r],t),Ye(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=se(n);return r?Y(i,function(s){return s.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=se(n);return r?Y(i,function(s){return s.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}}gt.prototype._nodeCount=0;gt.prototype._edgeCount=0;function Xe(e,t){e[t]?e[t]++:e[t]=1}function Ye(e,t){--e[t]||delete e[t]}function G(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}return i+qe+s+qe+(R(n)?rs:n)}function ns(e,t,r,n){var i=""+t,s=""+r;if(!e&&i>s){var a=i;i=s,s=a}var o={v:i,w:s};return n&&(o.name=n),o}function ae(e,t){return G(e,t.v,t.w,t.name)}export{Y as $,m as A,Le as B,Wt as C,g as D,de as E,zi as F,gt as G,V as H,Z as I,Fi as J,dt as K,Jt as L,ye as M,Je as N,Hi as O,Gi as P,Ci as Q,J as R,y as S,st as T,Ge as U,te as V,at as W,ji as X,$n as Y,S as Z,F as _,he as a,se as a0,Ji as a1,ce as b,Q as c,Ae as d,ke as e,Ve as f,ir as g,et as h,R as i,Br as j,jn as k,Kr as l,j as m,M as n,nr as o,b as p,zn as q,w as r,Zt as s,Fn as t,ot as u,Hn as v,O as w,Gr as x,Ce as y,W as z};
|