Files
2026-04-19 01:39:41 +08:00

1 line
7.6 KiB
JavaScript
Executable File

(function(){function a(b,d){function f(a){if(f[a]!==i)return f[a];var b;if("bug-string-char-index"==a)b="a"!="a"[0];else if("json"==a)b=f("json-stringify")&&f("json-parse");else{var c,e='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==a){var g=d.stringify,h="function"==typeof g&&s;if(h){(c=function(){return 1}).toJSON=c;try{h="0"===g(0)&&"0"===g(new j)&&'""'==g(new k)&&g(r)===i&&g(i)===i&&g()===i&&"1"===g(c)&&"[1]"==g([c])&&"[null]"==g([i])&&"null"==g(null)&&"[null,null,null]"==g([i,r,null])&&g({a:[c,!0,!1,null,"\x00\b\n\f\r "]})==e&&"1"===g(null,c)&&"[\n 1,\n 2\n]"==g([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==g(new m(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==g(new m(864e13))&&'"-000001-01-01T00:00:00.000Z"'==g(new m(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==g(new m(-1))}catch(l){h=!1}}b=h}if("json-parse"==a){var n=d.parse;if("function"==typeof n)try{if(0===n("0")&&!n(!1)){c=n(e);var o=5==c.a.length&&1===c.a[0];if(o){try{o=!n('" "')}catch(l){}if(o)try{o=1!==n("01")}catch(l){}if(o)try{o=1!==n("1.")}catch(l){}}}}catch(l){o=!1}b=o}}return f[a]=!!b}b||(b=e.Object()),d||(d=e.Object());var g,h,i,j=b.Number||e.Number,k=b.String||e.String,l=b.Object||e.Object,m=b.Date||e.Date,n=b.SyntaxError||e.SyntaxError,o=b.TypeError||e.TypeError,p=b.Math||e.Math,q=(b.JSON||e.JSON,l.prototype),r=q.toString,s=new m(-0xc782b5b800cec);try{s=-109252==s.getUTCFullYear()&&0===s.getUTCMonth()&&1===s.getUTCDate()&&10==s.getUTCHours()&&37==s.getUTCMinutes()&&6==s.getUTCSeconds()&&708==s.getUTCMilliseconds()}catch(t){}if(!f("json")){var u="[object Function]",v="[object Date]",w="[object Number]",x="[object String]",y="[object Array]",z="[object Boolean]",A=f("bug-string-char-index");if(!s)var B=p.floor,C=[0,31,59,90,120,151,181,212,243,273,304,334],D=function(a,b){return C[b]+365*(a-1970)+B((a-1969+(b=+(b>1)))/4)-B((a-1901+b)/100)+B((a-1601+b)/400)};if((g=q.hasOwnProperty)||(g=function(a){var b,c={};return(c.__proto__=null,c.__proto__={toString:1},c).toString!=r?g=function(a){var b=this.__proto__,c=a in(this.__proto__=null,this);return this.__proto__=b,c}:(b=c.constructor,g=function(a){var c=(this.constructor||b).prototype;return a in this&&!(a in c&&this[a]===c[a])}),c=null,g.call(this,a)}),h=function(a,b){var d,e,f,i=0;(d=function(){this.valueOf=0}).prototype.valueOf=0,e=new d;for(f in e)g.call(e,f)&&i++;return d=e=null,i?h=2==i?function(a,b){var c,d={},e=r.call(a)==u;for(c in a)e&&"prototype"==c||g.call(d,c)||!(d[c]=1)||!g.call(a,c)||b(c)}:function(a,b){var c,d,e=r.call(a)==u;for(c in a)e&&"prototype"==c||!g.call(a,c)||(d="constructor"===c)||b(c);(d||g.call(a,c="constructor"))&&b(c)}:(e=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],h=function(a,b){var d,f,h=r.call(a)==u,i=!h&&"function"!=typeof a.constructor&&c[typeof a.hasOwnProperty]&&a.hasOwnProperty||g;for(d in a)h&&"prototype"==d||!i.call(a,d)||b(d);for(f=e.length;d=e[--f];i.call(a,d)&&b(d));}),h(a,b)},!f("json-stringify")){var E={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},F="000000",G=function(a,b){return(F+(b||0)).slice(-a)},H="\\u00",I=function(a){for(var b='"',c=0,d=a.length,e=!A||d>10,f=e&&(A?a.split(""):a);d>c;c++){var g=a.charCodeAt(c);switch(g){case 8:case 9:case 10:case 12:case 13:case 34:case 92:b+=E[g];break;default:if(32>g){b+=H+G(2,g.toString(16));break}b+=e?f[c]:a.charAt(c)}}return b+'"'},J=function(a,b,c,d,e,f,j){var k,l,m,n,p,q,s,t,u,A,C,E,F,H,K,L;try{k=b[a]}catch(M){}if("object"==typeof k&&k)if(l=r.call(k),l!=v||g.call(k,"toJSON"))"function"==typeof k.toJSON&&(l!=w&&l!=x&&l!=y||g.call(k,"toJSON"))&&(k=k.toJSON(a));else if(k>-1/0&&1/0>k){if(D){for(p=B(k/864e5),m=B(p/365.2425)+1970-1;D(m+1,0)<=p;m++);for(n=B((p-D(m,0))/30.42);D(m,n+1)<=p;n++);p=1+p-D(m,n),q=(k%864e5+864e5)%864e5,s=B(q/36e5)%24,t=B(q/6e4)%60,u=B(q/1e3)%60,A=q%1e3}else m=k.getUTCFullYear(),n=k.getUTCMonth(),p=k.getUTCDate(),s=k.getUTCHours(),t=k.getUTCMinutes(),u=k.getUTCSeconds(),A=k.getUTCMilliseconds();k=(0>=m||m>=1e4?(0>m?"-":"+")+G(6,0>m?-m:m):G(4,m))+"-"+G(2,n+1)+"-"+G(2,p)+"T"+G(2,s)+":"+G(2,t)+":"+G(2,u)+"."+G(3,A)+"Z"}else k=null;if(c&&(k=c.call(b,a,k)),null===k)return"null";if(l=r.call(k),l==z)return""+k;if(l==w)return k>-1/0&&1/0>k?""+k:"null";if(l==x)return I(""+k);if("object"==typeof k){for(H=j.length;H--;)if(j[H]===k)throw o();if(j.push(k),C=[],K=f,f+=e,l==y){for(F=0,H=k.length;H>F;F++)E=J(F,k,c,d,e,f,j),C.push(E===i?"null":E);L=C.length?e?"[\n"+f+C.join(",\n"+f)+"\n"+K+"]":"["+C.join(",")+"]":"[]"}else h(d||k,function(a){var b=J(a,k,c,d,e,f,j);b!==i&&C.push(I(a)+":"+(e?" ":"")+b)}),L=C.length?e?"{\n"+f+C.join(",\n"+f)+"\n"+K+"}":"{"+C.join(",")+"}":"{}";return j.pop(),L}};d.stringify=function(a,b,d){var e,f,g,h;if(c[typeof b]&&b)if((h=r.call(b))==u)f=b;else if(h==y){g={};for(var i,j=0,k=b.length;k>j;i=b[j++],h=r.call(i),(h==x||h==w)&&(g[i]=1));}if(d)if((h=r.call(d))==w){if((d-=d%1)>0)for(e="",d>10&&(d=10);e.length<d;e+=" ");}else h==x&&(e=d.length<=10?d:d.slice(0,10));return J("",(i={},i[""]=a,i),f,g,e,"",[])}}if(!f("json-parse")){var K,L,M=k.fromCharCode,N={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:"\n",102:"\f",114:"\r"},O=function(){throw K=L=null,n()},P=function(){for(var a,b,c,d,e,f=L,g=f.length;g>K;)switch(e=f.charCodeAt(K)){case 9:case 10:case 13:case 32:K++;break;case 123:case 125:case 91:case 93:case 58:case 44:return a=A?f.charAt(K):f[K],K++,a;case 34:for(a="@",K++;g>K;)if(e=f.charCodeAt(K),32>e)O();else if(92==e)switch(e=f.charCodeAt(++K)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:a+=N[e],K++;break;case 117:for(b=++K,c=K+4;c>K;K++)e=f.charCodeAt(K),e>=48&&57>=e||e>=97&&102>=e||e>=65&&70>=e||O();a+=M("0x"+f.slice(b,K));break;default:O()}else{if(34==e)break;for(e=f.charCodeAt(K),b=K;e>=32&&92!=e&&34!=e;)e=f.charCodeAt(++K);a+=f.slice(b,K)}if(34==f.charCodeAt(K))return K++,a;O();default:if(b=K,45==e&&(d=!0,e=f.charCodeAt(++K)),e>=48&&57>=e){for(48==e&&(e=f.charCodeAt(K+1),e>=48&&57>=e)&&O(),d=!1;g>K&&(e=f.charCodeAt(K),e>=48&&57>=e);K++);if(46==f.charCodeAt(K)){for(c=++K;g>c&&(e=f.charCodeAt(c),e>=48&&57>=e);c++);c==K&&O(),K=c}if(e=f.charCodeAt(K),101==e||69==e){for(e=f.charCodeAt(++K),(43==e||45==e)&&K++,c=K;g>c&&(e=f.charCodeAt(c),e>=48&&57>=e);c++);c==K&&O(),K=c}var h=f.slice(b,K),i=+h;return i>9007199254740991?"@"+h:i}if(d&&O(),"true"==f.slice(K,K+4))return K+=4,!0;if("false"==f.slice(K,K+5))return K+=5,!1;if("null"==f.slice(K,K+4))return K+=4,null;O()}return"$"},Q=function(a){var b,c;if("$"==a&&O(),"string"==typeof a){if("@"==(A?a.charAt(0):a[0]))return a.slice(1);if("["==a){for(b=[];a=P(),"]"!=a;c||(c=!0))c&&(","==a?(a=P(),"]"==a&&O()):O()),","==a&&O(),b.push(Q(a));return b}if("{"==a){for(b={};a=P(),"}"!=a;c||(c=!0))c&&(","==a?(a=P(),"}"==a&&O()):O()),(","==a||"string"!=typeof a||"@"!=(A?a.charAt(0):a[0])||":"!=P())&&O(),b[a.slice(1)]=Q(P());return b}O()}return a},R=function(a,b,c){var d=S(a,b,c);d===i?delete a[b]:a[b]=d},S=function(a,b,c){var d,e=a[b];if("object"==typeof e&&e)if(r.call(e)==y)for(d=e.length;d--;)R(e,d,c);else h(e,function(a){R(e,a,c)});return c.call(a,b,e)};d.parse=function(a,b){var c,d;return K=0,L=""+a,c=Q(P()),"$"!=P()&&O(),K=L=null,b&&r.call(b)==u?S((d={},d[""]=c,d),"",b):c}}}return d.runInContext=a,d}var b="function"==typeof define&&define.amd,c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType&&exports,e=c[typeof window]&&window||this,f=d&&c[typeof module]&&module&&!module.nodeType&&"object"==typeof global&&global;if(!f||f.global!==f&&f.window!==f&&f.self!==f||(e=f),d&&!b)a(e,d);else{var g=e.JSON,h=e.JSON3,i=!1,j=a(e,e.JSON3={noConflict:function(){return i||(i=!0,e.JSON=g,e.JSON3=h,g=h=null),j}});e.JSON={parse:j.parse,stringify:j.stringify}}b&&define(function(){return j})}).call(this);