@ywfe/fe-tools 1.2.1-beta.31 → 1.2.1-beta.33

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).YWTOOLS={})}(this,(function(e){"use strict";function t(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function r(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function n(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}"function"==typeof SuppressedError&&SuppressedError;var i={},o=n(Object.freeze({__proto__:null,default:{}}));function s(e){return t(this,arguments,void 0,(function(e){var t,n,o,s,a,c,u,f=e.input;return r(this,(function(e){switch(e.label){case 0:return t=f.method||"GET",n=new Map([["prod","https://gateway.ywwl.com"],["test","https://test-gateway.ywwl.com"],["test2","https://test2-gateway.ywwl.com"],["dev","https://dev-gateway.ywwl.com"]]),o=function(e){return/^https?:\/\//.test(e)},s=function(){return n.get("{{env}}")}(),a=o(f.url)?f.url:"".concat(s).concat(f.url),console.log("requestUrl",a,o(f.url)),c={method:t,headers:{"Content-type":"application/json","x-token":"{{token}}"}},"POST"===t.toUpperCase()?c.body=JSON.stringify(f.params):"GET"===t.toUpperCase()&&(a="".concat(a,"?").concat(i.querystring.stringify(f.params||{}))),[4,fetch(a,c)];case 1:return(u=e.sent()).ok?[4,u.json()]:[2,{success:!1,message:"An error has occured: ".concat(u.status)}];case 2:return[2,e.sent()]}}))}))}!function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var r=t(o);function n(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function i(e){return function t(r){return 0===arguments.length||n(r)?t:e.apply(this,arguments)}}function s(e){return function t(r,o){switch(arguments.length){case 0:return t;case 1:return n(r)?t:i((function(t){return e(r,t)}));default:return n(r)&&n(o)?t:n(r)?i((function(t){return e(t,o)})):n(o)?i((function(t){return e(r,t)})):e(r,o)}}}function a(e,t){var r;t=t||[];var n=(e=e||[]).length,i=t.length,o=[];for(r=0;r<n;)o[o.length]=e[r],r+=1;for(r=0;r<i;)o[o.length]=t[r],r+=1;return o}function c(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,i){return t.apply(this,arguments)};case 5:return function(e,r,n,i,o){return t.apply(this,arguments)};case 6:return function(e,r,n,i,o,s){return t.apply(this,arguments)};case 7:return function(e,r,n,i,o,s,a){return t.apply(this,arguments)};case 8:return function(e,r,n,i,o,s,a,c){return t.apply(this,arguments)};case 9:return function(e,r,n,i,o,s,a,c,u){return t.apply(this,arguments)};case 10:return function(e,r,n,i,o,s,a,c,u,f){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function u(e,t,r){return function(){for(var i=[],o=0,s=e,a=0;a<t.length||o<arguments.length;){var f;a<t.length&&(!n(t[a])||o>=arguments.length)?f=t[a]:(f=arguments[o],o+=1),i[a]=f,n(f)||(s-=1),a+=1}return s<=0?r.apply(this,i):c(s,u(e,i,r))}}var f=s((function(e,t){return 1===e?i(t):c(e,u(e,[],t))}));function l(e){return function t(r,o,a){switch(arguments.length){case 0:return t;case 1:return n(r)?t:s((function(t,n){return e(r,t,n)}));case 2:return n(r)&&n(o)?t:n(r)?s((function(t,r){return e(t,o,r)})):n(o)?s((function(t,n){return e(r,t,n)})):i((function(t){return e(r,o,t)}));default:return n(r)&&n(o)&&n(a)?t:n(r)&&n(o)?s((function(t,r){return e(t,r,a)})):n(r)&&n(a)?s((function(t,r){return e(t,o,r)})):n(o)&&n(a)?s((function(t,n){return e(r,t,n)})):n(r)?i((function(t){return e(t,o,a)})):n(o)?i((function(t){return e(r,t,a)})):n(a)?i((function(t){return e(r,o,t)})):e(r,o,a)}}}var h=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function p(e,t,r){return function(){if(0===arguments.length)return r();var n=Array.prototype.slice.call(arguments,0),i=n.pop();if(!h(i)){for(var o=0;o<e.length;){if("function"==typeof i[e[o]])return i[e[o]].apply(i,n);o+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(i))return t.apply(null,n)(i)}return r.apply(this,arguments)}}var m=function(){return this.xf["@@transducer/init"]()},d=function(e){return this.xf["@@transducer/result"](e)};function g(e,t){for(var r=0,n=t.length,i=Array(n);r<n;)i[r]=e(t[r]),r+=1;return i}function y(e){return"[object String]"===Object.prototype.toString.call(e)}var w=i((function(e){return!!h(e)||!!e&&("object"==typeof e&&(!y(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))})),b=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var v=s((function(e,t){return c(e.length,(function(){return e.apply(t,arguments)}))})),x=v;function k(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function S(e,t,r,n){return e["@@transducer/result"](r[n](x(e["@@transducer/step"],e),t))}var E="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function T(e,t,r){if("function"==typeof e&&(e=function(e){return new b(e)}(e)),w(r))return function(e,t,r){for(var n=0,i=r.length;n<i;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}(e,t,r);if("function"==typeof r["fantasy-land/reduce"])return S(e,t,r,"fantasy-land/reduce");if(null!=r[E])return k(e,t,r[E]());if("function"==typeof r.next)return k(e,t,r);if("function"==typeof r.reduce)return S(e,t,r,"reduce");throw new TypeError("reduce: list must be array or iterable")}var O=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=m,e.prototype["@@transducer/result"]=d,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}(),N=s((function(e,t){return new O(e,t)}));function j(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var _=Object.prototype.toString,I=function(){return"[object Arguments]"===_.call(arguments)?function(e){return"[object Arguments]"===_.call(e)}:function(e){return j("callee",e)}}(),B=I,M=!{toString:null}.propertyIsEnumerable("toString"),A=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],z=function(){return arguments.propertyIsEnumerable("length")}(),F=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},U="function"!=typeof Object.keys||z?i((function(e){if(Object(e)!==e)return[];var t,r,n=[],i=z&&B(e);for(t in e)!j(t,e)||i&&"length"===t||(n[n.length]=t);if(M)for(r=A.length-1;r>=0;)j(t=A[r],e)&&!F(n,t)&&(n[n.length]=t),r-=1;return n})):i((function(e){return Object(e)!==e?[]:Object.keys(e)})),P=U,L=s(p(["fantasy-land/map","map"],N,(function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return f(t.length,(function(){return e.call(this,t.apply(this,arguments))}));case"[object Object]":return T((function(r,n){return r[n]=e(t[n]),r}),{},P(t));default:return g(e,t)}}))),$=L,D=Number.isInteger||function(e){return(e|0)===e},R=s((function(e,t){var r=e<0?t.length+e:e;return y(t)?t.charAt(r):t[r]})),C=s((function(e,t){return e.map((function(e){for(var r,n=t,i=0;i<e.length;){if(null==n)return;r=e[i],n=D(r)?R(r,n):n[r],i+=1}return n}))})),q=s((function(e,t){return C([e],t)[0]})),H=s((function(e,t){return q([e],t)})),W=l(T),Y=s((function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(r){return e(r)(t(r))}:T((function(e,r){return a(e,$(r,t))}),[],e)})),V=i((function(e){for(var t=P(e),r=t.length,n=[],i=0;i<r;)n[i]=e[t[i]],i+=1;return n})),G=i((function(e){return null==e}));function Q(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}var Z=s((function(e,t){var r=f(e,t);return f(e,(function(){return T(Y,$(r,arguments[0]),Array.prototype.slice.call(arguments,1))}))})),J=Z,X=i((function(e){return J(e.length,e)})),K=i((function(e){return f(e.length,e)}));function ee(e){return function e(t){for(var r,n,i,o=[],s=0,a=t.length;s<a;){if(w(t[s]))for(i=0,n=(r=e(t[s])).length;i<n;)o[o.length]=r[i],i+=1;else o[o.length]=t[s];s+=1}return o}}var te=i((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)})),re=X(i((function(e){return!e})));function ne(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function ie(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return h(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}}var oe=l(ie("slice",(function(e,t,r){return Array.prototype.slice.call(r,e,t)}))),se=i(ie("tail",oe(1,1/0)));function ae(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return c(arguments[0].length,W(ne,arguments[0],se(arguments)))}var ce=i((function(e){return y(e)?e.split("").reverse().join(""):Array.prototype.slice.call(e,0).reverse()}));function ue(){if(0===arguments.length)throw new Error("compose requires at least one argument");return ae.apply(this,ce(arguments))}function fe(e){return e}var le=i(fe);function he(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function pe(e,t,r){for(var n=0,i=r.length;n<i;){if(e(t,r[n]))return!0;n+=1}return!1}var me="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};function de(e,t,r,n){var i=he(e);function o(e,t){return ge(e,t,r.slice(),n.slice())}return!pe((function(e,t){return!pe(o,t,e)}),he(t),i)}function ge(e,t,r,n){if(me(e,t))return!0;var i,o,s=te(e);if(s!==te(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(i=e.constructor,null==(o=String(i).match(/^function (\w*)/))?"":o[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!me(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!me(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var a=r.length-1;a>=0;){if(r[a]===e)return n[a]===t;a-=1}switch(s){case"Map":return e.size===t.size&&de(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&de(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=P(e);if(c.length!==P(t).length)return!1;var u=r.concat([e]),f=n.concat([t]);for(a=c.length-1;a>=0;){var l=c[a];if(!j(l,t)||!ge(t[l],e[l],u,f))return!1;a-=1}return!0}var ye=s((function(e,t){return ge(e,t,[],[])}));function we(e,t){return function(e,t,r){var n,i;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(n=1/t;r<e.length;){if(0===(i=e[r])&&1/i===n)return r;r+=1}return-1}if(t!=t){for(;r<e.length;){if("number"==typeof(i=e[r])&&i!=i)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(ye(e[r],t))return r;r+=1}return-1}(t,e,0)>=0}function be(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var ve=function(e){return(e<10?"0":"")+e},xe="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+ve(e.getUTCMonth()+1)+"-"+ve(e.getUTCDate())+"T"+ve(e.getUTCHours())+":"+ve(e.getUTCMinutes())+":"+ve(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function ke(e){return"[object Object]"===Object.prototype.toString.call(e)}var Se=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=m,e.prototype["@@transducer/result"]=d,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}(),Ee=s(p(["filter"],s((function(e,t){return new Se(e,t)})),(function(e,t){return ke(t)?T((function(r,n){return e(t[n])&&(r[n]=t[n]),r}),{},P(t)):function(e,t){for(var r=0,n=t.length,i=[];r<n;)e(t[r])&&(i[i.length]=t[r]),r+=1;return i}(e,t)}))),Te=s((function(e,t){return Ee((r=e,function(){return!r.apply(this,arguments)}),t);var r})),Oe=Te;function Ne(e,t){var r=function(r){var n=t.concat([e]);return we(r,n)?"<Circular>":Ne(r,n)},n=function(e,t){return g((function(t){return be(t)+": "+r(e[t])}),t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+g(r,e).join(", ")+"))";case"[object Array]":return"["+g(r,e).concat(n(e,Oe((function(e){return/^\d+$/.test(e)}),P(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):be(xe(e)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":be(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var i=e.toString();if("[object Object]"!==i)return i}return"{"+n(e,P(e)).join(", ")+"}"}}var je=i((function(e){return Ne(e,[])})),_e=s((function(e,t){if(h(e)){if(h(t))return e.concat(t);throw new TypeError(je(t)+" is not an array")}if(y(e)){if(y(t))return e+t;throw new TypeError(je(t)+" is not a string")}if(null!=e&&Q(e["fantasy-land/concat"]))return e["fantasy-land/concat"](t);if(null!=e&&Q(e.concat))return e.concat(t);throw new TypeError(je(e)+' does not have a method named "concat" or "fantasy-land/concat"')}));function Ie(e,t,r){var n,i=typeof e;switch(i){case"string":case"number":return 0===e&&1/e==-1/0?!!r._items["-0"]||(t&&(r._items["-0"]=!0),!1):null!==r._nativeSet?t?(n=r._nativeSet.size,r._nativeSet.add(e),r._nativeSet.size===n):r._nativeSet.has(e):i in r._items?e in r._items[i]||(t&&(r._items[i][e]=!0),!1):(t&&(r._items[i]={},r._items[i][e]=!0),!1);case"boolean":if(i in r._items){var o=e?1:0;return!!r._items[i][o]||(t&&(r._items[i][o]=!0),!1)}return t&&(r._items[i]=e?[!1,!0]:[!0,!1]),!1;case"function":return null!==r._nativeSet?t?(n=r._nativeSet.size,r._nativeSet.add(e),r._nativeSet.size===n):r._nativeSet.has(e):i in r._items?!!we(e,r._items[i])||(t&&r._items[i].push(e),!1):(t&&(r._items[i]=[e]),!1);case"undefined":return!!r._items[i]||(t&&(r._items[i]=!0),!1);case"object":if(null===e)return!!r._items.null||(t&&(r._items.null=!0),!1);default:return(i=Object.prototype.toString.call(e))in r._items?!!we(e,r._items[i])||(t&&r._items[i].push(e),!1):(t&&(r._items[i]=[e]),!1)}}var Be=function(){function e(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return e.prototype.add=function(e){return!Ie(e,!0,this)},e.prototype.has=function(e){return Ie(e,!1,this)},e}(),Me=i((function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():h(e)?[]:y(e)?"":ke(e)?{}:B(e)?function(){return arguments}():void 0})),Ae=Me,ze=function(){function e(e,t){this.xf=t,this.f=e,this.found=!1}return e.prototype["@@transducer/init"]=m,e.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){var r;return this.f(t)&&(this.found=!0,e=(r=this.xf["@@transducer/step"](e,t))&&r["@@transducer/reduced"]?r:{"@@transducer/value":r,"@@transducer/reduced":!0}),e},e}(),Fe=s(p(["find"],s((function(e,t){return new ze(e,t)})),(function(e,t){for(var r=0,n=t.length;r<n;){if(e(t[r]))return t[r];r+=1}}))),Ue=i(ee()),Pe=i((function(e){for(var t={},r=0;r<e.length;)t[e[r][0]]=e[r][1],r+=1;return t})),Le=s((function(e,t){if(0===e.length||G(t))return!1;for(var r=t,n=0;n<e.length;){if(G(r)||!j(e[n],r))return!1;r=r[e[n]],n+=1}return!0})),$e=s((function(e,t){for(var r,n,i=new Be,o=[],s=0;s<t.length;)r=e(n=t[s]),i.add(r)&&o.push(n),s+=1;return o}))(le);var De="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,n=arguments.length;r<n;){var i=arguments[r];if(null!=i)for(var o in i)j(o,i)&&(t[o]=i[o]);r+=1}return t},Re=s((function(e,t){return f(e+1,(function(){var r=arguments[e];if(null!=r&&Q(r[t]))return r[t].apply(r,Array.prototype.slice.call(arguments,0,e));throw new TypeError(je(r)+' does not have a method named "'+t+'"')}))})),Ce=Re,qe=s((function(e,t){return null!=t&&t.constructor===e||t instanceof e})),He=i((function(e){return null!=e&&ye(e,Ae(e))})),We=i((function(e){return De.apply(null,[{}].concat(e))})),Ye=s((function(e,t){for(var r={},n={},i=0,o=e.length;i<o;)n[e[i]]=1,i+=1;for(var s in t)n.hasOwnProperty(s)||(r[s]=t[s]);return r})),Ve=Ye,Ge=l((function(e,t,r){return ye(t,r[e])})),Qe=l((function(e,t,r){return r.replace(e,t)})),Ze=Ce(1,"split"),Je="\t\n\v\f\r                 \u2028\u2029\ufeff",Xe=i("function"==typeof String.prototype.trim&&!Je.trim()&&"​".trim()?function(e){return e.trim()}:function(e){var t=new RegExp("^["+Je+"]["+Je+"]*"),r=new RegExp("["+Je+"]["+Je+"]*$");return e.replace(t,"").replace(r,"")}),Ke=s(ue($e,a));const et=e=>{if(G(e)||He(e))return e;switch(te(e)){case"String":return Xe(e);case"Array":return Ee(re(He))(e);default:return e}},tt=(e,t)=>He(t)||G(t)?[]:ae(Ze(e),et)(t),rt={set:(e,t)=>{"undefined"!=typeof window&&window.sessionStorage.setItem(e,t)},get:e=>"undefined"!=typeof window?window.sessionStorage.getItem(e):null,remove:e=>{"undefined"!=typeof window&&window.sessionStorage.removeItem(e)},clear:()=>{"undefined"!=typeof window&&window.sessionStorage.clear()}},nt={set:(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},get:e=>"undefined"!=typeof window?window.localStorage.getItem(e):null,remove:e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},clear:()=>{"undefined"!=typeof window&&window.localStorage.clear()}},it={set:(e,t,r)=>{const n=new Date;n.setTime(n.getTime()+24*r*60*60*1e3);const i=`expires=${n.toUTCString()}`;document.cookie=`${e}=${escape(t)};${i};path=/`},get:e=>{const t=`${e}=`,r=document.cookie.split(";");for(let e=0;e<r.length;e+=1){let n=r[e];for(;" "===n.charAt(0);)n=n.substring(1);if(-1!==n.indexOf(t))return n.substring(t.length,n.length)}}};function ot(e,t,r,n){e.addEventListener(t,(function n(i){e.removeEventListener(t,n),r(i)}),n)}const st=["id","type","async","defer","crossOrigin","integrity","noModule"];const at=e=>{let t=e;return e instanceof Date?t=e:"string"==typeof e&&String(e).length>=13&&!isNaN(e)?t=Number(e):"string"==typeof e&&e.includes("-")&&(t=e.replace(/-/g,"/")),new Date(t)&&"Invalid Date"!==String(new Date(t))},ct=e=>{const t=e.replace(/-/g,"/");return new Date(t).valueOf()},ut=(e,t)=>{if(!at(e))return null;let r;isNaN(e)?"string"==typeof e&&e.includes("-")&&(e=e.replace(/-/g,"/")):e=Number(e),r=new Date(e);const n={YYYY:r.getFullYear(),YY:`${r.getFullYear()}`.slice(-2),MM:`0${r.getMonth()+1}`.slice(-2),M:r.getMonth()+1,DD:`0${r.getDate()}`.slice(-2),D:r.getDate(),HH:`0${r.getHours()}`.slice(-2),H:r.getHours(),hh:("0"+r.getHours()%12).slice(-2),h:r.getHours()%12,mm:`0${r.getMinutes()}`.slice(-2),m:r.getMinutes(),ss:`0${r.getSeconds()}`.slice(-2),s:r.getSeconds(),w:["日","一","二","三","四","五","六"][r.getDay()]};for(const e in n)t=t.replace(e,n[e]);return t},ft=(e,t,r,n)=>{let i="";return t.length>r?t:(i="left"===e?new Array(r-t.length+1).join(n)+t:t+new Array(r-t.length+1).join(n),i)},[lt,ht,pt]=[86400,3600,60],mt=(e,t,r=!0)=>{let n=e<0?0:parseFloat(`${e}`);if((isNaN(n)||!n)&&(!r||0!==n))return"-";let[i,o,s,a]=[void 0,void 0,void 0,void 0];t.indexOf("{DD}")>-1&&(i=Math.floor(n/lt),n=Math.floor(n%lt)),t.indexOf("{HH}")>-1&&(o=Math.floor(n/ht),n=Math.floor(n%ht)),t.indexOf("{mm}")>-1&&(s=Math.floor(n/pt),n=Math.floor(n%pt)),a=n;return t.replace("{ss}","number"==typeof a?ft("left",String(a),2,"0"):"").replace("{mm}","number"==typeof s?ft("left",String(s),2,"0"):"").replace("{HH}","number"==typeof o?ft("left",String(o),2,"0"):"").replace("{DD}","number"==typeof i?ft("left",String(i),2,"0"):"")},[dt,gt,yt]=[86400,3600,60],wt=(e,t,r)=>{const n={reduce:K(((e,r,i)=>{const o=e(r,i);return(e=>Le([t],e))(i)&&i[t]?i[t].reduce(n.reduce(e),o):o})),find:K(((e,t,r)=>ae($(n.reduce(e,t)),Ue)(r)))},i=(r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?r.concat([Ve([t],n)]):r;switch(te(r)){case"Object":return n.reduce(i,[])(r);case"Array":return n.find(i,[])(r);default:return r}},bt=(e,t)=>{let r=[],n=[],i={};const o=Fe(Ge("origion_url",`/${e[0]}`))(t);if(o){if(r=[o.name],e.length>1&&o.children&&o.children.length){const t=e.join("/");i=Fe(Ge("origion_url",`/${t}`))(o.children)}else i=o.children&&o.children.length?o.children[0]:o;n=(null==i?void 0:i.name)?[i.name]:[]}return{defaultOpenMenus:r,defaultSelectedMenus:n,defaultMenu:i}},vt=e=>{var t,r;let n=[],i=[],o={};return e[0]&&e[0].children&&e[0].children.length?(n=[e[0].name],i=[e[0].children[0].name],o=e[0].children[0]):e[0]&&(n=[null===(t=e[0])||void 0===t?void 0:t.name],i=[null===(r=e[0])||void 0===r?void 0:r.name],o=e[0]),{defaultOpenMenus:n,defaultSelectedMenus:i,defaultMenu:o}},xt=(e,t=0,r=!0,n=!1)=>{let i=parseFloat(e);if(isNaN(i)||0!==e&&!e)return"-";let o=!1,s="";return i<0&&(o=!0,i=Math.abs(i)),i>=1e8?s=(i/1e8).toFixed(t)+(r?"亿":""):i>=1e4?s=(i/1e4).toFixed(t)+(r?"万":""):(s=n?i.toFixed(0):i.toString(),s=n||isNaN(t)?s:i.toFixed(t)),o?`-${s}`:s},kt=()=>window.localStorage.getItem("env")||"prod",St=()=>window.localStorage.getItem("isMock"),Et=e=>{if(!e)return{};return ae(Qe("?",""),Ze("&"),$((e=>Ze("=",decodeURI(e)))),Pe)(e)};var Tt=Object.freeze({__proto__:null,parse:Et,stringify:e=>{if(He(e))return"";const t=Object.keys(e);let r="";t.map((t=>{r+=`&${t}=${e[t]}`}));return new URLSearchParams(r).toString()||""}});var Ot=1e6,Nt=1e6,jt="[big.js] ",_t=jt+"Invalid ",It=_t+"decimal places",Bt=_t+"rounding mode",Mt=jt+"Division by zero",At={},zt=void 0,Ft=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Ut(e,t,r,n){var i=e.c,o=e.e+t+1;if(o<i.length){if(1===r)n=i[o]>=5;else if(2===r)n=i[o]>5||5==i[o]&&(n||o<0||i[o+1]!==zt||1&i[o-1]);else if(3===r)n=n||!!i[0];else if(n=!1,0!==r)throw Error(Bt);if(o<1)i.length=1,n?(e.e=-t,i[0]=1):i[0]=e.e=0;else{if(i.length=o--,n)for(;++i[o]>9;)i[o]=0,o--||(++e.e,i.unshift(1));for(o=i.length;!i[--o];)i.pop()}}else if(r<0||r>3||r!==~~r)throw Error(Bt);return e}function Pt(e,t,r,n){var i,o,s=e.constructor,a=!e.c[0];if(r!==zt){if(r!==~~r||r<(3==t)||r>Ot)throw Error(3==t?_t+"precision":It);for(r=n-(e=new s(e)).e,e.c.length>++n&&Ut(e,r,s.RM),2==t&&(n=e.e+r+1);e.c.length<n;)e.c.push(0)}if(i=e.e,r=(o=e.c.join("")).length,2!=t&&(1==t||3==t&&n<=i||i<=s.NE||i>=s.PE))o=o.charAt(0)+(r>1?"."+o.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)o="0"+o;o="0."+o}else if(i>0)if(++i>r)for(i-=r;i--;)o+="0";else i<r&&(o=o.slice(0,i)+"."+o.slice(i));else r>1&&(o=o.charAt(0)+"."+o.slice(1));return e.s<0&&(!a||4==t)?"-"+o:o}At.abs=function(){var e=new this.constructor(this);return e.s=1,e},At.cmp=function(e){var t,r=this,n=r.c,i=(e=new r.constructor(e)).c,o=r.s,s=e.s,a=r.e,c=e.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-s:0;if(o!=s)return o;if(t=o<0,a!=c)return a>c^t?1:-1;for(s=(a=n.length)<(c=i.length)?a:c,o=-1;++o<s;)if(n[o]!=i[o])return n[o]>i[o]^t?1:-1;return a==c?0:a>c^t?1:-1},At.div=function(e){var t=this,r=t.constructor,n=t.c,i=(e=new r(e)).c,o=t.s==e.s?1:-1,s=r.DP;if(s!==~~s||s<0||s>Ot)throw Error(It);if(!i[0])throw Error(Mt);if(!n[0])return new r(0*o);var a,c,u,f,l,h=i.slice(),p=a=i.length,m=n.length,d=n.slice(0,a),g=d.length,y=e,w=y.c=[],b=0,v=s+(y.e=t.e-e.e)+1;for(y.s=o,o=v<0?0:v,h.unshift(0);g++<a;)d.push(0);do{for(u=0;u<10;u++){if(a!=(g=d.length))f=a>g?1:-1;else for(l=-1,f=0;++l<a;)if(i[l]!=d[l]){f=i[l]>d[l]?1:-1;break}if(!(f<0))break;for(c=g==a?i:h;g;){if(d[--g]<c[g]){for(l=g;l&&!d[--l];)d[l]=9;--d[l],d[g]+=10}d[g]-=c[g]}for(;!d[0];)d.shift()}w[b++]=f?u:++u,d[0]&&f?d[g]=n[p]||0:d=[n[p]]}while((p++<m||d[0]!==zt)&&o--);return w[0]||1==b||(w.shift(),y.e--),b>v&&Ut(y,s,r.RM,d[0]!==zt),y},At.eq=function(e){return!this.cmp(e)},At.gt=function(e){return this.cmp(e)>0},At.gte=function(e){return this.cmp(e)>-1},At.lt=function(e){return this.cmp(e)<0},At.lte=function(e){return this.cmp(e)<1},At.minus=At.sub=function(e){var t,r,n,i,o=this,s=o.constructor,a=o.s,c=(e=new s(e)).s;if(a!=c)return e.s=-c,o.plus(e);var u=o.c.slice(),f=o.e,l=e.c,h=e.e;if(!u[0]||!l[0])return l[0]?(e.s=-c,e):new s(u[0]?o:0);if(a=f-h){for((i=a<0)?(a=-a,n=u):(h=f,n=l),n.reverse(),c=a;c--;)n.push(0);n.reverse()}else for(r=((i=u.length<l.length)?u:l).length,a=c=0;c<r;c++)if(u[c]!=l[c]){i=u[c]<l[c];break}if(i&&(n=u,u=l,l=n,e.s=-e.s),(c=(r=l.length)-(t=u.length))>0)for(;c--;)u[t++]=0;for(c=t;r>a;){if(u[--r]<l[r]){for(t=r;t&&!u[--t];)u[t]=9;--u[t],u[r]+=10}u[r]-=l[r]}for(;0===u[--c];)u.pop();for(;0===u[0];)u.shift(),--h;return u[0]||(e.s=1,u=[h=0]),e.c=u,e.e=h,e},At.mod=function(e){var t,r=this,n=r.constructor,i=r.s,o=(e=new n(e)).s;if(!e.c[0])throw Error(Mt);return r.s=e.s=1,t=1==e.cmp(r),r.s=i,e.s=o,t?new n(r):(i=n.DP,o=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=i,n.RM=o,this.minus(r.times(e)))},At.plus=At.add=function(e){var t,r=this,n=r.constructor,i=r.s,o=(e=new n(e)).s;if(i!=o)return e.s=-o,r.minus(e);var s=r.e,a=r.c,c=e.e,u=e.c;if(!a[0]||!u[0])return u[0]?e:new n(a[0]?r:0*i);if(a=a.slice(),i=s-c){for(i>0?(c=s,t=u):(i=-i,t=a),t.reverse();i--;)t.push(0);t.reverse()}for(a.length-u.length<0&&(t=u,u=a,a=t),i=u.length,o=0;i;a[i]%=10)o=(a[--i]=a[i]+u[i]+o)/10|0;for(o&&(a.unshift(o),++c),i=a.length;0===a[--i];)a.pop();return e.c=a,e.e=c,e},At.pow=function(e){var t=this,r=new t.constructor(1),n=r,i=e<0;if(e!==~~e||e<-1e6||e>Nt)throw Error(_t+"exponent");for(i&&(e=-e);1&e&&(n=n.times(t)),e>>=1;)t=t.times(t);return i?r.div(n):n},At.round=function(e,t){var r=this.constructor;if(e===zt)e=0;else if(e!==~~e||e<-Ot||e>Ot)throw Error(It);return Ut(new r(this),e,t===zt?r.RM:t)},At.sqrt=function(){var e,t,r,n=this,i=n.constructor,o=n.s,s=n.e,a=new i(.5);if(!n.c[0])return new i(n);if(o<0)throw Error(jt+"No square root");0===(o=Math.sqrt(n+""))||o===1/0?((t=n.c.join("")).length+s&1||(t+="0"),s=((s+1)/2|0)-(s<0||1&s),e=new i(((o=Math.sqrt(t))==1/0?"1e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+s)):e=new i(o),s=e.e+(i.DP+=4);do{r=e,e=a.times(r.plus(n.div(r)))}while(r.c.slice(0,s).join("")!==e.c.slice(0,s).join(""));return Ut(e,i.DP-=4,i.RM)},At.times=At.mul=function(e){var t,r=this,n=r.constructor,i=r.c,o=(e=new n(e)).c,s=i.length,a=o.length,c=r.e,u=e.e;if(e.s=r.s==e.s?1:-1,!i[0]||!o[0])return new n(0*e.s);for(e.e=c+u,s<a&&(t=i,i=o,o=t,u=s,s=a,a=u),t=new Array(u=s+a);u--;)t[u]=0;for(c=a;c--;){for(a=0,u=s+c;u>c;)a=t[u]+o[c]*i[u-c-1]+a,t[u--]=a%10,a=a/10|0;t[u]=(t[u]+a)%10}for(a?++e.e:t.shift(),c=t.length;!t[--c];)t.pop();return e.c=t,e},At.toExponential=function(e){return Pt(this,1,e,e)},At.toFixed=function(e){return Pt(this,2,e,this.e+e)},At.toPrecision=function(e){return Pt(this,3,e,e-1)},At.toString=function(){return Pt(this)},At.valueOf=At.toJSON=function(){return Pt(this,4)};var Lt=function e(){function t(r){var n=this;if(!(n instanceof t))return r===zt?e():new t(r);r instanceof t?(n.s=r.s,n.e=r.e,n.c=r.c.slice()):function(e,t){var r,n,i;if(0===t&&1/t<0)t="-0";else if(!Ft.test(t+=""))throw Error(_t+"number");e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".",""));(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length);for(i=t.length,n=0;n<i&&"0"==t.charAt(n);)++n;if(n==i)e.c=[e.e=0];else{for(;i>0&&"0"==t.charAt(--i););for(e.e=r-n-1,e.c=[],r=0;n<=i;)e.c[r++]=+t.charAt(n++)}}(n,r),n.constructor=t}return t.prototype=At,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.version="5.2.2",t}();const $t=(e,t)=>{const r=(e=e.toString()).indexOf(".");return e=-1!==r?e.substring(0,t+r+1):e.substring(0),Number(parseFloat(e).toFixed(t))},Dt=e=>(t,r)=>{if(He(t)||G(t))return t;if(isNaN(Number(t)))return NaN;const n=Number(new Lt(Number(t)).mul(e));if(G(null==r?void 0:r.decimalNumber)&&G(null==r?void 0:r.fn))return n;if(!G(null==r?void 0:r.decimalNumber)&&G(null==r?void 0:r.fn))return Number(n.toFixed(null==r?void 0:r.decimalNumber));if(!G(null==r?void 0:r.decimalNumber)&&!G(null==r?void 0:r.fn)){if("toFixed"===(null==r?void 0:r.fn))return Number(n.toFixed(null==r?void 0:r.decimalNumber));if("floor"===(null==r?void 0:r.fn))return $t(n,null==r?void 0:r.decimalNumber)}},Rt=e=>(t,r)=>{const n=(null==r?void 0:r.decimalNumber)||2,i=(null==r?void 0:r.fn)||"toFixed";if(He(t)||G(t))return t;if(isNaN(Number(t)))return NaN;const o=new Lt(Number(t)).div(e);return"toFixed"===i?Number(o.toFixed(n)):"floor"===i?$t(Number(o),n):t},Ct=e=>{const t=Object.prototype.toString.call(e),r=/^\[object (.*)\]$/.exec(t);return null!==r?r[1].toLowerCase():null},qt=e=>"string"==typeof e?Xe(e):("array"!==Ct(e)&&"object"!==Ct(e)||(Array.isArray(e)&&e.forEach((e=>{qt(e)})),null===typeof e)||Object.keys(e).map((t=>{const r=e[t];"string"==typeof r&&(e[t]=Xe(r)),"object"!==Ct(r)&&"array"!==Ct(r)||qt(r)})),e);var Ht,Wt=new Uint8Array(16);function Yt(){if(!Ht&&!(Ht="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Wt)}var Vt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Gt=[],Qt=0;Qt<256;++Qt)Gt.push((Qt+256).toString(16).substr(1));function Zt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Gt[e[t+0]]+Gt[e[t+1]]+Gt[e[t+2]]+Gt[e[t+3]]+"-"+Gt[e[t+4]]+Gt[e[t+5]]+"-"+Gt[e[t+6]]+Gt[e[t+7]]+"-"+Gt[e[t+8]]+Gt[e[t+9]]+"-"+Gt[e[t+10]]+Gt[e[t+11]]+Gt[e[t+12]]+Gt[e[t+13]]+Gt[e[t+14]]+Gt[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Vt.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r}function Jt(e,t,r){var n=(e=e||{}).random||(e.rng||Yt)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,Zt(n)}const Xt="input is invalid type",Kt="0123456789abcdef".split(""),er=[128,32768,8388608,-2147483648];let tr,rr=[];const nr=new ArrayBuffer(68);tr=new Uint8Array(nr),rr=new Uint32Array(nr);function ir(){rr[0]=rr[16]=rr[1]=rr[2]=rr[3]=rr[4]=rr[5]=rr[6]=rr[7]=rr[8]=rr[9]=rr[10]=rr[11]=rr[12]=rr[13]=rr[14]=rr[15]=0,this.blocks=rr,this.buffer8=tr,this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}ir.prototype.update=function(e){if(this.finalized)return;let t;const r=typeof e;if("string"!==r){if("object"!==r)throw Xt;if(null===e)throw Xt;if(e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&!ArrayBuffer.isView(e))throw Xt;t=!0}let n,i,o=0,s=e.length,a=this.blocks,c=this.buffer8;for(;o<s;){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)for(i=this.start;o<s&&i<64;++o)c[i++]=e[o];else for(i=this.start;o<s&&i<64;++o)n=e.charCodeAt(o),n<128?c[i++]=n:n<2048?(c[i++]=192|n>>6,c[i++]=128|63&n):n<55296||n>=57344?(c[i++]=224|n>>12,c[i++]=128|n>>6&63,c[i++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),c[i++]=240|n>>18,c[i++]=128|n>>12&63,c[i++]=128|n>>6&63,c[i++]=128|63&n);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},ir.prototype.finalize=function(){if(this.finalized)return;this.finalized=!0;const e=this.blocks,t=this.lastByteIndex;e[t>>2]|=er[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()},ir.prototype.hash=function(){let e,t,r,n,i,o,s=this.blocks;this.first?(e=s[0]-680876937,e=(e<<7|e>>>25)-271733879|0,n=(-1732584194^2004318071&e)+s[1]-117830708,n=(n<<12|n>>>20)+e|0,r=(-271733879^n&(-271733879^e))+s[2]-1126478375,r=(r<<17|r>>>15)+n|0,t=(e^r&(n^e))+s[3]-1316259209,t=(t<<22|t>>>10)+r|0):(e=this.h0,t=this.h1,r=this.h2,n=this.h3,e+=(n^t&(r^n))+s[0]-680876936,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[1]-389564586,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[2]+606105819,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[3]-1044525330,t=(t<<22|t>>>10)+r|0),e+=(n^t&(r^n))+s[4]-176418897,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[5]+1200080426,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[6]-1473231341,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[7]-45705983,t=(t<<22|t>>>10)+r|0,e+=(n^t&(r^n))+s[8]+1770035416,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[9]-1958414417,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[10]-42063,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[11]-1990404162,t=(t<<22|t>>>10)+r|0,e+=(n^t&(r^n))+s[12]+1804603682,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[13]-40341101,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[14]-1502002290,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[15]+1236535329,t=(t<<22|t>>>10)+r|0,e+=(r^n&(t^r))+s[1]-165796510,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[6]-1069501632,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[11]+643717713,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[0]-373897302,t=(t<<20|t>>>12)+r|0,e+=(r^n&(t^r))+s[5]-701558691,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[10]+38016083,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[15]-660478335,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[4]-405537848,t=(t<<20|t>>>12)+r|0,e+=(r^n&(t^r))+s[9]+568446438,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[14]-1019803690,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[3]-187363961,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[8]+1163531501,t=(t<<20|t>>>12)+r|0,e+=(r^n&(t^r))+s[13]-1444681467,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[2]-51403784,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[7]+1735328473,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[12]-1926607734,t=(t<<20|t>>>12)+r|0,i=t^r,e+=(i^n)+s[5]-378558,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[8]-2022574463,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[11]+1839030562,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[14]-35309556,t=(t<<23|t>>>9)+r|0,i=t^r,e+=(i^n)+s[1]-1530992060,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[4]+1272893353,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[7]-155497632,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[10]-1094730640,t=(t<<23|t>>>9)+r|0,i=t^r,e+=(i^n)+s[13]+681279174,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[0]-358537222,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[3]-722521979,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[6]+76029189,t=(t<<23|t>>>9)+r|0,i=t^r,e+=(i^n)+s[9]-640364487,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[12]-421815835,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[15]+530742520,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[2]-995338651,t=(t<<23|t>>>9)+r|0,e+=(r^(t|~n))+s[0]-198630844,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[7]+1126891415,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[14]-1416354905,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[5]-57434055,t=(t<<21|t>>>11)+r|0,e+=(r^(t|~n))+s[12]+1700485571,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[3]-1894986606,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[10]-1051523,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[1]-2054922799,t=(t<<21|t>>>11)+r|0,e+=(r^(t|~n))+s[8]+1873313359,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[15]-30611744,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[6]-1560198380,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[13]+1309151649,t=(t<<21|t>>>11)+r|0,e+=(r^(t|~n))+s[4]-145523070,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[11]-1120210379,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[2]+718787259,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[9]-343485551,t=(t<<21|t>>>11)+r|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=r-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+r|0,this.h3=this.h3+n|0)},ir.prototype.hex=function(){this.finalize();let e=this.h0,t=this.h1,r=this.h2,n=this.h3;return Kt[e>>4&15]+Kt[15&e]+Kt[e>>12&15]+Kt[e>>8&15]+Kt[e>>20&15]+Kt[e>>16&15]+Kt[e>>28&15]+Kt[e>>24&15]+Kt[t>>4&15]+Kt[15&t]+Kt[t>>12&15]+Kt[t>>8&15]+Kt[t>>20&15]+Kt[t>>16&15]+Kt[t>>28&15]+Kt[t>>24&15]+Kt[r>>4&15]+Kt[15&r]+Kt[r>>12&15]+Kt[r>>8&15]+Kt[r>>20&15]+Kt[r>>16&15]+Kt[r>>28&15]+Kt[r>>24&15]+Kt[n>>4&15]+Kt[15&n]+Kt[n>>12&15]+Kt[n>>8&15]+Kt[n>>20&15]+Kt[n>>16&15]+Kt[n>>28&15]+Kt[n>>24&15]};var or=e=>(new ir).update(e).hex();function sr(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function ar(e,t,r){if("undefined"==typeof window)return;let n,i,o,s,a,c,u=0,f=!1,l=!1,h=!0;const p=!t&&0!==t&&"function"==typeof requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){const r=n,o=i;return n=i=void 0,u=t,s=e.apply(o,r),s}function d(e,t){return p?(cancelAnimationFrame(a),requestAnimationFrame(e)):setTimeout(e,t)}function g(e){const r=e-c;return void 0===c||r>=t||r<0||l&&e-u>=o}function y(){const e=Date.now();if(g(e))return w(e);a=d(y,function(e){const r=e-u,n=t-(e-c);return l?Math.min(n,o-r):n}(e))}function w(e){return a=void 0,h&&n?m(e):(n=i=void 0,s)}function b(...e){const r=Date.now(),o=g(r);if(n=e,i=this,c=r,o){if(void 0===a)return function(e){return u=e,a=d(y,t),f?m(e):s}(c);if(l)return a=d(y,t),m(c)}return void 0===a&&(a=d(y,t)),s}return t=+t||0,sr(r)&&(f=!!r.leading,l="maxWait"in r,o=l?Math.max(+r.maxWait||0,t):o,h="trailing"in r?!!r.trailing:h),b.cancel=function(){void 0!==a&&function(e){if(p)return cancelAnimationFrame(e);clearTimeout(e)}(a),u=0,n=c=i=a=void 0},b.flush=function(){return void 0===a?s:w(Date.now())},b.pending=function(){return void 0!==a},b}var cr={},ur={
2
2
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
- read:function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,f=(1<<u)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,m=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*c-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=m,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+p]=255&s,p+=m,s/=256,u-=8);e[r+p-m]|=128*d}};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AnsiStringType=e.StringType=e.BufferType=e.Uint8ArrayType=e.IgnoreType=e.Float80_LE=e.Float80_BE=e.Float64_LE=e.Float64_BE=e.Float32_LE=e.Float32_BE=e.Float16_LE=e.Float16_BE=e.INT64_BE=e.UINT64_BE=e.INT64_LE=e.UINT64_LE=e.INT32_LE=e.INT32_BE=e.INT24_BE=e.INT24_LE=e.INT16_LE=e.INT16_BE=e.INT8=e.UINT32_BE=e.UINT32_LE=e.UINT24_BE=e.UINT24_LE=e.UINT16_BE=e.UINT16_LE=e.UINT8=void 0;const t=ur;function r(e){return new DataView(e.buffer,e.byteOffset)}e.UINT8={len:1,get:(e,t)=>r(e).getUint8(t),put:(e,t,n)=>(r(e).setUint8(t,n),t+1)},e.UINT16_LE={len:2,get:(e,t)=>r(e).getUint16(t,!0),put:(e,t,n)=>(r(e).setUint16(t,n,!0),t+2)},e.UINT16_BE={len:2,get:(e,t)=>r(e).getUint16(t),put:(e,t,n)=>(r(e).setUint16(t,n),t+2)},e.UINT24_LE={len:3,get(e,t){const n=r(e);return n.getUint8(t)+(n.getUint16(t+1,!0)<<8)},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.UINT24_BE={len:3,get(e,t){const n=r(e);return(n.getUint16(t)<<8)+n.getUint8(t+2)},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.UINT32_LE={len:4,get:(e,t)=>r(e).getUint32(t,!0),put:(e,t,n)=>(r(e).setUint32(t,n,!0),t+4)},e.UINT32_BE={len:4,get:(e,t)=>r(e).getUint32(t),put:(e,t,n)=>(r(e).setUint32(t,n),t+4)},e.INT8={len:1,get:(e,t)=>r(e).getInt8(t),put:(e,t,n)=>(r(e).setInt8(t,n),t+1)},e.INT16_BE={len:2,get:(e,t)=>r(e).getInt16(t),put:(e,t,n)=>(r(e).setInt16(t,n),t+2)},e.INT16_LE={len:2,get:(e,t)=>r(e).getInt16(t,!0),put:(e,t,n)=>(r(e).setInt16(t,n,!0),t+2)},e.INT24_LE={len:3,get(t,r){const n=e.UINT24_LE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.INT24_BE={len:3,get(t,r){const n=e.UINT24_BE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.INT32_BE={len:4,get:(e,t)=>r(e).getInt32(t),put:(e,t,n)=>(r(e).setInt32(t,n),t+4)},e.INT32_LE={len:4,get:(e,t)=>r(e).getInt32(t,!0),put:(e,t,n)=>(r(e).setInt32(t,n,!0),t+4)},e.UINT64_LE={len:8,get:(e,t)=>r(e).getBigUint64(t,!0),put:(e,t,n)=>(r(e).setBigUint64(t,n,!0),t+8)},e.INT64_LE={len:8,get:(e,t)=>r(e).getBigInt64(t,!0),put:(e,t,n)=>(r(e).setBigInt64(t,n,!0),t+8)},e.UINT64_BE={len:8,get:(e,t)=>r(e).getBigUint64(t),put:(e,t,n)=>(r(e).setBigUint64(t,n),t+8)},e.INT64_BE={len:8,get:(e,t)=>r(e).getBigInt64(t),put:(e,t,n)=>(r(e).setBigInt64(t,n),t+8)},e.Float16_BE={len:2,get(e,r){return t.read(e,r,!1,10,this.len)},put(e,r,n){return t.write(e,n,r,!1,10,this.len),r+this.len}},e.Float16_LE={len:2,get(e,r){return t.read(e,r,!0,10,this.len)},put(e,r,n){return t.write(e,n,r,!0,10,this.len),r+this.len}},e.Float32_BE={len:4,get:(e,t)=>r(e).getFloat32(t),put:(e,t,n)=>(r(e).setFloat32(t,n),t+4)},e.Float32_LE={len:4,get:(e,t)=>r(e).getFloat32(t,!0),put:(e,t,n)=>(r(e).setFloat32(t,n,!0),t+4)},e.Float64_BE={len:8,get:(e,t)=>r(e).getFloat64(t),put:(e,t,n)=>(r(e).setFloat64(t,n),t+8)},e.Float64_LE={len:8,get:(e,t)=>r(e).getFloat64(t,!0),put:(e,t,n)=>(r(e).setFloat64(t,n,!0),t+8)},e.Float80_BE={len:10,get(e,r){return t.read(e,r,!1,63,this.len)},put(e,r,n){return t.write(e,n,r,!1,63,this.len),r+this.len}},e.Float80_LE={len:10,get(e,r){return t.read(e,r,!0,63,this.len)},put(e,r,n){return t.write(e,n,r,!0,63,this.len),r+this.len}};e.IgnoreType=class{constructor(e){this.len=e}get(e,t){}};e.Uint8ArrayType=class{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}};e.BufferType=class{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}};e.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class n{constructor(e){this.len=e}static decode(e,t,r){let i="";for(let o=t;o<r;++o)i+=n.codePointToString(n.singleByteDecoder(e[o]));return i}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(n.inRange(e,0,127))return e;const t=n.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return n.decode(e,t,t+this.len)}}e.AnsiStringType=n,n.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]}(cr);var fr={},lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.readFile=lr.writeFileSync=lr.writeFile=lr.read=lr.open=lr.close=lr.stat=lr.createReadStream=lr.pathExists=void 0;const hr=r.default;lr.pathExists=hr.existsSync,lr.createReadStream=hr.createReadStream,lr.stat=async function(e){return new Promise(((t,r)=>{hr.stat(e,((e,n)=>{e?r(e):t(n)}))}))},lr.close=async function(e){return new Promise(((t,r)=>{hr.close(e,(e=>{e?r(e):t()}))}))},lr.open=async function(e,t){return new Promise(((r,n)=>{hr.open(e,t,((e,t)=>{e?n(e):r(t)}))}))},lr.read=async function(e,t,r,n,i){return new Promise(((o,s)=>{hr.read(e,t,r,n,i,((e,t,r)=>{e?s(e):o({bytesRead:t,buffer:r})}))}))},lr.writeFile=async function(e,t){return new Promise(((r,n)=>{hr.writeFile(e,t,(e=>{e?n(e):r()}))}))},lr.writeFileSync=function(e,t){hr.writeFileSync(e,t)},lr.readFile=async function(e){return new Promise(((t,r)=>{hr.readFile(e,((e,n)=>{e?r(e):t(n)}))}))};var pr={},mr={},dr={},gr={},yr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EndOfStreamError=e.defaultMessages=void 0,e.defaultMessages="End-Of-Stream";class t extends Error{constructor(){super(e.defaultMessages)}}e.EndOfStreamError=t}(yr);var wr={},br={};Object.defineProperty(br,"__esModule",{value:!0}),br.Deferred=void 0;br.Deferred=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;const t=yr,r=br;var n=yr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}});e.StreamReader=class{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",(()=>this.reject(new t.EndOfStreamError))),this.s.once("error",(e=>this.reject(e))),this.s.once("close",(()=>this.reject(new Error("Stream closed"))))}async peek(e,t,r){const n=await this.read(e,t,r);return this.peekQueue.push(e.subarray(t,t+n)),n}async read(e,r,n){if(0===n)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new t.EndOfStreamError;let i=n,o=0;for(;this.peekQueue.length>0&&i>0;){const t=this.peekQueue.pop();if(!t)throw new Error("peekData should be defined");const n=Math.min(t.length,i);e.set(t.subarray(0,n),r+o),o+=n,i-=n,n<t.length&&this.peekQueue.push(t.subarray(n))}for(;i>0&&!this.endOfStream;){const t=Math.min(i,1048576),n=await this.readFromStream(e,r+o,t);if(o+=n,n<t)break;i-=n}return o}async readFromStream(e,t,n){const i=this.s.read(n);if(i)return e.set(i,t),i.length;{const i={buffer:e,offset:t,length:n,deferred:new r.Deferred};return this.deferred=i.deferred,this.s.once("readable",(()=>{this.readDeferred(i)})),i.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",(()=>{this.readDeferred(e)}))}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}}(wr),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;var t=yr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return t.EndOfStreamError}});var r=wr;Object.defineProperty(e,"StreamReader",{enumerable:!0,get:function(){return r.StreamReader}})}(gr),Object.defineProperty(dr,"__esModule",{value:!0}),dr.AbstractTokenizer=void 0;const vr=gr;dr.AbstractTokenizer=class{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new vr.EndOfStreamError;return e.get(r,0)}async peekToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new vr.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new vr.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new vr.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}},Object.defineProperty(mr,"__esModule",{value:!0}),mr.ReadStreamTokenizer=void 0;const xr=dr,kr=gr;class Sr extends xr.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new kr.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const i=await this.streamReader.read(e,r.offset,r.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<r.length)throw new kr.EndOfStreamError;return i}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const t=r.position-this.position;if(t>0){const i=new Uint8Array(r.length+t);return n=await this.peekBuffer(i,{mayBeLess:r.mayBeLess}),e.set(i.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof kr.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n<r.length)throw new kr.EndOfStreamError}return n}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let n=0;for(;n<e;){const i=e-n,o=await this.readBuffer(r,{length:Math.min(t,i)});if(o<0)return o;n+=o}return n}}mr.ReadStreamTokenizer=Sr;var Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.BufferTokenizer=void 0;const Tr=gr,Or=dr;class Nr extends Or.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&n<r.length)throw new Tr.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+n),r.offset),n}async close(){}}Er.BufferTokenizer=Nr,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromBuffer=e.fromStream=e.EndOfStreamError=void 0;const t=mr,r=Er;var n=gr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}}),e.fromStream=function(e,r){return r=r||{},new t.ReadStreamTokenizer(e,r)},e.fromBuffer=function(e,t){return new r.BufferTokenizer(e,t)}}(pr);var jr={};Object.defineProperty(jr,"__esModule",{value:!0}),jr.fromFile=jr.FileTokenizer=void 0;const _r=dr,Ir=gr,Br=lr;class Mr extends _r.AbstractTokenizer{constructor(e,t){super(t),this.fd=e}async readBuffer(e,t){const r=this.normalizeOptions(e,t);this.position=r.position;const n=await Br.read(this.fd,e,r.offset,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead<r.length&&(!t||!t.mayBeLess))throw new Ir.EndOfStreamError;return n.bytesRead}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=await Br.read(this.fd,e,r.offset,r.length,r.position);if(!r.mayBeLess&&n.bytesRead<r.length)throw new Ir.EndOfStreamError;return n.bytesRead}async close(){return Br.close(this.fd)}}jr.FileTokenizer=Mr,jr.fromFile=async function(e){const t=await Br.stat(e);if(!t.isFile)throw new Error(`File not a file: ${e}`);const r=await Br.open(e,"r");return new Mr(r,{path:e,size:t.size})},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromStream=e.fromBuffer=e.EndOfStreamError=e.fromFile=void 0;const t=lr,r=pr;var n=jr;Object.defineProperty(e,"fromFile",{enumerable:!0,get:function(){return n.fromFile}});var i=pr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),Object.defineProperty(e,"fromBuffer",{enumerable:!0,get:function(){return i.fromBuffer}}),e.fromStream=async function(e,n){if(n=n||{},e.path){const r=await t.stat(e.path);n.path=e.path,n.size=r.size}return r.fromStream(e,n)}}(fr);const Ar={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4};async function zr(e){try{return(new Ur).parse(e)}catch(e){if(!(e instanceof fr.EndOfStreamError))throw e}}function Fr(e,t,r){r=Object.assign({offset:0},r);for(const[n,i]of t.entries())if(r.mask){if(i!==(r.mask[n]&e[n+r.offset]))return!1}else if(i!==e[n+r.offset])return!1;return!0}class Ur{constructor(){this.buffer=Buffer.alloc(4100)}check(e,t){return Fr(this.buffer,e,t)}checkString(e,t){return this.check((r=e,Object.values(r).map((e=>e.charCodeAt(0)))),t);var r}async readTiffTag(e){if(this.tokenizer){const t=await this.tokenizer.readToken(e?cr.UINT16_BE:cr.UINT16_LE);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}}async readTiffIFD(e){if(this.tokenizer){const t=await this.tokenizer.readToken(e?cr.UINT16_BE:cr.UINT16_LE);for(let r=0;r<t;++r){const t=await this.readTiffTag(e);if(t)return t}}}async readTiffHeader(e){const t=(e?cr.UINT16_BE:cr.UINT16_LE).get(this.buffer,2),r=(e?cr.UINT32_BE:cr.UINT32_LE).get(this.buffer,4);if(42===t){if(r>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}if(this.tokenizer){await this.tokenizer.ignore(r);const e=await this.readTiffIFD(!1);return e||{ext:"tif",mime:"image/tiff"}}}if(43===t)return{ext:"tif",mime:"image/tiff"}}async parse(e){if(this.buffer=Buffer.alloc(4100),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(Ar);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),zr(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(this.buffer,{length:30});const r={compressedSize:this.buffer.readUInt32LE(18),uncompressedSize:this.buffer.readUInt32LE(22),filenameLength:this.buffer.readUInt16LE(26),extraFieldLength:this.buffer.readUInt16LE(28)};if(r.filename=await e.readToken(new cr.StringType(r.filenameLength,"utf-8")),await e.ignore(r.extraFieldLength),"META-INF/mozilla.rsa"===r.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml")){switch(r.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.filename.startsWith("3D/")&&r.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===r.filename&&r.compressedSize===r.uncompressedSize){switch(await e.readToken(new cr.StringType(r.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}}if(0===r.compressedSize){let n=-1;for(;n<0&&e.position<e.fileInfo.size;)await e.peekBuffer(this.buffer,{mayBeLess:!0}),n=this.buffer.indexOf("504B0304",0,"hex"),await e.ignore(n>=0?n:this.buffer.length)}else await e.ignore(r.compressedSize)}}catch(i){if(!(i instanceof fr.EndOfStreamError))throw i}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const o=Buffer.alloc(8);return await e.readBuffer(o),Fr(o,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:Fr(o,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Fr(o,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Fr(o,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Fr(o,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Fr(o,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const s=this.buffer.toString("binary",8,12).replace("\0"," ").trim();switch(s){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return s.startsWith("3g")?s.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){await e.ignore(1350);const a=10485760,c=Buffer.alloc(Math.min(a,e.fileInfo.size));return await e.readBuffer(c,{mayBeLess:!0}),c.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const u=await this.readTiffHeader(!1);if(u)return u}if(this.check([77,77])){const f=await this.readTiffHeader(!0);if(f)return f}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function l(){const t=await e.peekNumber(cr.UINT8);let r=128,n=0;for(;!(t&r);)++n,r>>=1;const i=Buffer.alloc(n+1);return await e.readBuffer(i),i}async function h(){const e=await l(),t=await l();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function p(t,r){for(;r>0;){const t=await h();if(17026===t.id){return(await e.readToken(new cr.StringType(t.len,"utf-8"))).replace(/\00.*$/g,"")}await e.ignore(t.len),--r}}const m=await h();switch(await p(0,m.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){await e.ignore(8);return"debian-binary"===await e.readToken(new cr.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(this.check([137,80,78,71,13,10,26,10])){async function d(){return{length:await e.readToken(cr.INT32_BE),type:await e.readToken(new cr.StringType(4,"binary"))}}await e.ignore(8);do{const g=await d();if(g.length<0)return;switch(g.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(g.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([239,187,191])&&this.checkString("<?xml",{offset:3}))return{ext:"xml",mime:"application/xml"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function y(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(cr.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const w=await y();let b=w.size-24;if(Fr(w.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const v=Buffer.alloc(16);if(b-=await e.readBuffer(v),Fr(v,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Fr(v,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(b)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await e.ignore(20);switch(await e.readToken(new cr.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255,0,60,0,63,0,120,0,109,0,108])||this.check([255,254,60,0,63,0,120,0,109,0,108,0]))return{ext:"xml",mime:"application/xml"};if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const x=this.buffer.readUInt32LE(12);if(x>12&&this.buffer.length>=x+16)try{const k=this.buffer.slice(16,x+16).toString();if(JSON.parse(k).files)return{ext:"asar",mime:"application/x-asar"}}catch(S){}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),function(e,t=0){const r=Number.parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(r))return!1;let n=256;for(let r=t;r<t+148;r++)n+=e[r];for(let r=t+156;r<t+512;r++)n+=e[r];return r===n}(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}}e.YC=it,e.YL=nt,e.YR={email:/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,phone:/^1[3|4|5|6|7|8][0-9]{9}$/,fixedPhone:/(^0\d{2,3}-\d{7,8}$)|(^1[3|4|5|6|7|8][0-9]{9}$)/,qq:/[1-9][0-9]{4,}/,zipcode:/[1-9]\d{5}(?!\d)/,IDCard:/^\d{17}[\d|X|x]|\d{15}$/,chinese:/^[\u0391-\uFFE5]+$/,chineseNumberLine:/^[\u4E00-\u9FA5A-Za-z0-9_]+$/,chineseNumberNoLine:/^[\u4E00-\u9FA5A-Za-z0-9]+$/,integerZ:/^[1-9]\d*$/,integerF:/^-[1-9]\d*$/,number:/^\d+(\.\d+)?$/,numberNoMoreThan1:/^\-?([0-9](\d+)?(\.\d{1,1})?$)|(^0$)|(^\d\.\d{1,1})$/,numberNoMoreThan2:/^\-?([0-9](\d+)?(\.\d{1,2})?$)|(^0$)|(^\d\.\d{1,2})$/,numberNoMoreThan3:/^\-?([0-9](\d+)?(\.\d{1,3})?$)|(^0$)|(^\d\.\d{1,3})$/,numberNoMoreThan4:/^\-?([0-9](\d+)?(\.\d{1,4})?$)|(^0$)|(^\d\.\d{1,4})$/,greaterZero1:/^(0|[1-9]\d*)(\.\d{1,1})?$/,greaterZero2:/^(0|[1-9]\d*)(\.\d{1,2})?$/,greaterZero3:/^(0|[1-9]\d*)(\.\d{1,3})?$/,greaterZero4:/^(0|[1-9]\d*)(\.\d{1,4})?$/,zeroTo100:/^((\d|[1-9]\d)(\.\d{1,2})?$)|(^100|100.0|100.00$)$/,zeroTo1000:/^((\d|[1-9]{1,2}\d)(\.\d{1,2})?$)|(^1000|1000.0|1000.00$)$/},e.YS=rt,e.calTimeLen=(e,t,r="s",n)=>{let i;switch(r){case"m":i=1e3*yt;break;case"h":i=1e3*gt;break;case"d":i=1e3*dt;break;default:i=1e3}let o=(ct(t)-ct(e))/i;return o="number"==typeof n?Number(o.toFixed(n)):o,o},e.checkFileType=(e,t)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=async r=>{var n,i;try{const o=new Uint8Array(null===(n=r.target)||void 0===n?void 0:n.result),s=await fr.fromBuffer(o),a=await zr(s),c=e.name.indexOf(".")>-1?(e.name.split(".").pop()||"").toLocaleLowerCase():"";let u=!a||c===a.ext;c.indexOf("xls")>-1&&((null===(i=null==a?void 0:a.ext)||void 0===i?void 0:i.indexOf("xls"))>-1||"cfb"===(null==a?void 0:a.ext))&&(u=!0),t(u,a)}catch(e){if(!(e instanceof fr.EndOfStreamError))throw e;t(!0,void 0)}}},e.dateFormat=ut,e.debounce=ar,e.expandMultiple=(e,t,r)=>Dt(e)(t,r),e.exportExcel=(e,t={})=>{let r;if("undefined"!=typeof window){r=window.localStorage.getItem("token");const n=Object.assign(Object.assign({},t),{token:r});/^https.*/.test(e)||(e=e.replace("http","https"));const i=`${e}?${(e=>{const t=[];return Object.keys(e).forEach((r=>{He(e[r])||G(e[r])||t.push(`${r}=${e[r]}`)})),t.join("&")})(n)}`;console.log("YWFE下载地址=>",i);const o=`alink_${(new Date).getTime()}`,s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("target","_blank"),s.setAttribute("id",o),document.getElementById(o)||document.body.appendChild(s),s.click(),setTimeout((()=>{document.body.removeChild(s)}),0)}},e.fenToyuan=(e,t)=>Rt(100)(e,t),e.fileTypeFromTokenizer=zr,e.formatData=e=>{let{afterUnit:t}=e;const{type:r,value:n,isAbs:i,beforeUnit:o}=e;if(-2147483648===Number(n))return"无权限";if("text"===r)return n||0===n?n:"-";if(isNaN(n)||0!==n&&!n)return"-";let s;switch(r){case"yuan":s=xt(n,2);break;case"fen":s=xt(n/100,2);break;case"decimalToPercentSave2Decimal":s=xt(100*n,2),t="string"==typeof t?t:"%";break;case"decimalToPercentSave0Decimal":s=xt(100*n,0),t="string"==typeof t?t:"%";break;case"percentSave2Decimal":s=xt(n,2),t="string"==typeof t?t:"%";break;case"percentSave0Decimal":s=xt(n,0),t="string"==typeof t?t:"%";break;case"int":s=xt(n,2,!0,!0);break;case"decimal":s=xt(n,2,!0,!1);break;case"secToTimeHM":s=mt(n,"{HH}h{mm}m");break;case"secToTimeChMS":s=mt(n,"{mm}分{ss}秒");break;case"secToTimeMS":s=mt(n,"{mm}m{ss}s");break;case"secToTime":s=mt(n,"{DD}d{HH}h{mm}m{ss}s",!1),s=s.replace("00d","").replace("00h","");break;default:s=xt(n)}return s="-"!==s&&i?s.replace("-",""):s,"-"===s?"-":`${o||""}${s}${t||""}`},e.formatTime=mt,e.gTokg=(e,t)=>Rt(1e3)(e,t),e.getBiteLen=e=>{if("string"!=typeof e)return 0;let t=0;for(let r=0;r<e.length;r++)e.charCodeAt(r)>127||94===e.charCodeAt(r)?t+=2:t+=1;return t},e.getDate=ct,e.getEnv=kt,e.getHost=(e,t,r)=>{const n=window.configs?window.configs:{};let i=r&&St()?"mock":kt();return{basePath:n[e]?n[e][i].API_BASE_URL+""+("mock"===i?"/"+t:""):"",loginPath:n.AUTH?n.AUTH[i].APPLICATION_URL:""}},e.getImgUrl=(e,t=200,r,n)=>{const i=new RegExp(/resize:(\d+):(\d+)/,"g");let o="";return e?(o=e,o=i.test(o)?o.replace(i,`resize:${t}:${r||0}`):o.indexOf("x-oss-process=image")>-1||o.indexOf("?")>-1?o:`${o}?x-oss-process=image/resize,w_${t},limit_0/quality,q_60`):o=n||"https://cdn.ywwl.com/bps/ywyun/dianhu/assets/def_goods_img.png",o},e.getMD5=e=>He(e)||G(e)?e:qe(String,e)?or(e):e,e.getMock=St,e.getQueries=e=>{let t=e||window.location.search;return t=t.replace("?",""),Et(t)||{}},e.getQuery=(e,t)=>{const r=new RegExp(`(\\?|&)${e}=([^&]*)(&|$)`,"i");let n=window.location.href;const i=r.exec(t||n);return null!=i&&decodeURIComponent(i[2])||""},e.getQueryName=(e,t)=>{let r=t||decodeURI(window.location.href);r=r.split("?")[1];const n=new Object;if(-1===r.indexOf("?")){const e=r.split("&");for(let t=0;t<e.length;t++){const r=e[t],i=r.indexOf("=");i>0&&(n[r.substr(0,i)]=decodeURI(r.substr(i+1)))}}return n[e]||""},e.getQueryOfNextPageContext=e=>{if(!e)return{};const{pathname:t="",asPath:r="",query:n}=e,i=ae(Ze("/"),Ee((e=>/\[\w+\]/.test(e))),$((e=>Qe("]","",Qe("[","",e)))))(t),o=ae(Ze("#"),oe(0,1))(r)||[],s=o.length?ae(Ze("/"),Ee((e=>""!==e)))(o[0]):[],a=i.map(((e,t)=>({[`${e}`]:s[t]})));let c={};return i.length?c=We(a)||{}:c.path=s[0]||"desktop",Object.assign(Object.assign({},n),c)},e.getRoutes=(e,t,r,n)=>{if(He(e)||He(t))return{menus:[],defaultSelectedMenus:[],defaultOpenMenus:[],defaultMenu:{},permissions:[]};let i;i="/"!==n&&"/undefined"!==n&&"/null"!==n?tt("/",n):[];let o=[],s=[],a={};const c=e=>{const n=t[e.url];if(!n)return{};const i=0===e.url.indexOf("/")?e.url||"":`/${e.url}`,c={path:i,param:n.param||"",url:n.url,name:e.resourceId,meta:{title:e.name,icon:n.icon},component:n.component,hidden:n.hidden,origion_url:i};return((null==r?void 0:r.primaryDefaultMenu)&&e.url===(null==r?void 0:r.primaryDefaultMenu)||(null==r?void 0:r.secondaryDefaultMenu)&&e.url===(null==r?void 0:r.secondaryDefaultMenu))&&(o=[e.resourceParentId],s=[e.resourceId],a=c),c},u=[];let f=[];if(e.map((e=>{const r=[],n=t[e.url],i=wt({key:"resourceType",value:"BUTTON"},"childMenus",e);if(i&&i.length){const e=ae($(H("url")))(i);f=_e(f,e)}if(e.childMenus&&e.childMenus.length){wt({key:"resourceId"},"childMenus",e.childMenus).map((e=>{if(e){const t=c(e);t&&t.name&&r.push(t)}}))}const o=c(e);n&&u.push(Object.assign(Object.assign({},o),{children:r}))})),i.length&&u.length){const e=bt(i,u);s=e.defaultSelectedMenus,o=e.defaultOpenMenus,a=e.defaultMenu}else if(!s.length||!o.length||!a){const e=vt(u);s=e.defaultSelectedMenus,o=e.defaultOpenMenus,a=e.defaultMenu}return{menus:u,defaultSelectedMenus:s,defaultOpenMenus:o,defaultMenu:a,permissions:f}},e.humpToLine=function(e){return"string"!=typeof e?e:e.replace(/([A-Z])/g,"_$1").toLowerCase()},e.isChinaMobile=e=>/^((\+86)|(86)|(086))?(13[0-9]|15[0-9]|166|17[0-9]|18[0-9]|14[0-9]|19[0-9])[0-9]{8}$/.test(String(e)),e.isDate=at,e.isURL=e=>/^((?:(?:https?|ftp):|)\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(String(e)),e.joinPath=e=>{if(!e||He(e))return"";const t=Object.keys(e);let r="";return t.map((t=>{e[t]&&"search"!==t&&(r+=`/${e[t]}`),"search"===t&&(r+=e[t])})),r},e.kgTog=(e,t)=>Dt(1e3)(e,t),e.lineToHump=function(e){return"string"!=typeof e?e:e.replace(/\_(\w)/g,(function(e,t){return t.toUpperCase()}))},e.loadScript=function(e,t,r){return new Promise(((n,i)=>{const o=document.createElement("script");var s,a;o.id=t,o.readyState?(a=()=>n(o),(s=o).onreadystatechange=function(){"loaded"!==s.readyState&&"complete"!==s.readyState||(s.onreadystatechange=null,a())}):function(e,t,r){ot(e,"load",t),ot(e,"error",r)}(o,(()=>n(o)),(()=>{i(),document.removeChild(document.getElementById(t))})),r&&st.forEach((e=>{if(e in r){const t=r[e];"string"==typeof t?o.setAttribute(e,t):"boolean"==typeof t&&(o[e]=t)}})),o.src=e.js,document.body.appendChild(o)}))},e.maxSubstrWord=(e,t=5,r=!0)=>"string"==typeof e?r?`${e.substr(0,t)}...`:e.substr(0,t):e,e.niceNumShow=(e,t=!1)=>{if(0!==e&&!e||"-"===e)return[{type:"num",text:"-"}];const r=[],n=e.toString().split("");let i,o="";return n.forEach((e=>{let n=/^[0-9\\.]*$/.test(e)?"num":"character";n="."===e&&t||"num"===n&&"suffixNum"===i?"suffixNum":n,i!==n&&i?(r.push({type:i,text:o}),o=e):o=`${o}${e}`,i=n})),i=i||"num",r.push({type:i,text:o}),r},e.numberToThousand=(e,t=",")=>He(e)||G(e)?e:isNaN(Number(e))?NaN:e.toString().replace(/\d+/,(e=>e.replace(/(\d)(?=(\d{3})+$)/g,(e=>`${e}${t}`)))),e.omadownload=(e,t,r)=>{const n=new Uint8Array(e);try{const e=String.fromCharCode.apply(null,n);if(e.indexOf("success")>-1)return JSON.parse(e)}catch(e){console.warn(e)}const i=window.URL.createObjectURL(new Blob([e],{type:r||"application/vnd.ms-excel"})),o=document.createElement("a");o.style.display="none",o.href=i,o.setAttribute("download",decodeURIComponent(t)),document.body.appendChild(o),o.click(),o.remove()},e.parseParams=e=>V(e).join("/"),e.pickAll=(e,t,r)=>{const n={reduce:K(((r,i,o)=>{const s=r(i,o);if(!(e=>Le([t],e))(o)){return s&&s.length?$((t=>t[e]||t))(s):[]}return o[t]?o[t].reduce(n.reduce(r),s):s})),find:K(((e,t,r)=>ae($(n.reduce(e,t)),Ue)(r)))},i=(r,n)=>n[e]?r.concat([Ve([t],n)]):r;switch(te(r)){case"Object":return n.reduce(i,[])(r);case"Array":return n.find(i,[])(r);default:return r}},e.querystring=Tt,e.reduceMultiple=(e,t,r)=>Rt(e)(t,r),e.reduceParams=e=>{if(!e)return{};if(e instanceof FormData)return e;return Ee((e=>!G(e)&&!He(e)))(e)||{}},e.remove=function(e,t){const r=[];if(!e||!e.length)return r;let n=-1,i=[],o=e.length;for(;++n<o;){const o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return function(e,t){let r=e?t.length:0,n=r-1,i=0;for(;r--;){const o=t[r];r!=n&&o===i||(i=o,Array.prototype.splice.call(e,o,1))}}(e,i),r},e.round=(e,t=0)=>Math.round(Math.random()*(e-t)+t),e.slicePath=(e,t=0,r)=>{const n=tt("/",e);r||(r=n.length-1);return"/"+n.slice(t,r).join("/")},e.split=tt,e.strPad=ft,e.sum=(e,t)=>{let r=new Lt(0);const n=(e,t)=>{"array"===Ct(e)&&Array.isArray(e)&&e.forEach((e=>{isNaN(e)||(r=r.plus(Number(e))),"object"===Ct(e)&&void 0!==t&&null!==e[t]&&(r=r.plus(Number(e[t]))),"array"===Ct(e)&&Array.isArray(e)&&n(e,t)}))};return n(e,t),Number(r)},e.throttle=function(e,t,r){let n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return sr(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),ar(e,t,{leading:n,trailing:i,maxWait:t})},e.timeFlow=(e,t,r="HH:mm:ss")=>ut(ct(e)+1e3*t,r),e.toDate=e=>{if(at(e)){let t=e;return e instanceof Date?t=e:"string"==typeof e&&String(e).length>=13&&!isNaN(e)?t=Number(e):"string"==typeof e&&e.includes("-")&&(t=e.replace(/-/g,"/")),new Date(t).getTime()}return 0},e.transformShortNum=xt,e.translateMapToArray=(e,t=!1,r="全部",n=null)=>{let i=t?[{label:r,value:n}]:[];for(const[t,r]of e.entries())i.push({label:r,value:t});return i},e.treeFind=(e,t,r)=>{const n={reduce:K(((r,i,s)=>{const a=r(i,s);return((e=>t&&Le([t],e)&&!He(e[t]))(s)||s[e.key]!==e.value)&&t&&s[t]&&!He(s[t])?n.reduce(o,a)(s[t]):a})),find:K(((e,t,r)=>ae($(n.reduce(e,t)),Ue,Ke(t))(r)))},i=(r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?t?r.concat([Ve([t],n)]):r.concat([n]):r,o=(e,t)=>{const r=Object.keys(t),o=[];return r.map((e=>{o.push(t[e])})),n.find(i,e)(o)};switch(te(r)){case"Object":return n.reduce(o,[])(r);case"Array":return n.find(i,[])(r);default:return[]}},e.treePaths=(e,t,r)=>{const n={reduce:K(((r,i,s,a)=>{const c=r(i,s,a);return(e=>Le([t],e)&&!He(e[t]))(a)||a[e.key]!==e.value?a[t]&&!He(a[t])?n.reduce(o,[],Ve([t],a))(a[t]):c:(s.path&&c.splice(0,0,s.path),c)})),find:K(((e,t,r,i)=>ae($(n.reduce(e,t,r)),Ue)(i)))},i=(t,r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?t.concat([n.path]):t,o=(e,t,r)=>{if(!r||He(r))return e;const o=Object.keys(r),s=[];return o.map((e=>{s.push(r[e])})),n.find(i,e,t)(s)};switch(te(r)){case"Object":return n.reduce(o,[],{})(r);case"Array":return n.find(i,[],{})(r);default:return[]}},e.treeReduce=wt,e.trimAll=et,e.trimParams=qt,e.unLoadScript=function(e){if(document.getElementById(e)){const t=document.getElementById(e);document.body.removeChild(t)}},e.uuidv4=()=>Jt(),e.wanToyuan=(e,t)=>Dt(1e4)(e,t),e.yuanTofen=(e,t)=>Dt(100)(e,t),e.yuanTowan=(e,t)=>Rt(1e4)(e,t)}(i),e.JSON2String=function(e){var t=e.input.data,r={content:""};try{var n=JSON.stringify(t);return r.content="```json"+n+"json```",r}catch(e){return r.content="```json{}json```",r}},e.request=s,e.userInputToJson=function(e){return t(this,arguments,void 0,(function(e){var t,n,i=e.input;return r(this,(function(e){switch(e.label){case 0:return console.log("input",i),[4,s({input:{url:"https://fc-typechat.ywwl.com/userInputToJson",method:"GET",params:i}})];case 1:return(t=e.sent()).success?[2,(n=t.data).success?n.data:n]:[2,t.success?t.data:t]}}))}))}}));
3
+ read:function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,f=(1<<u)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,m=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*c-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=m,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+p]=255&s,p+=m,s/=256,u-=8);e[r+p-m]|=128*d}};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AnsiStringType=e.StringType=e.BufferType=e.Uint8ArrayType=e.IgnoreType=e.Float80_LE=e.Float80_BE=e.Float64_LE=e.Float64_BE=e.Float32_LE=e.Float32_BE=e.Float16_LE=e.Float16_BE=e.INT64_BE=e.UINT64_BE=e.INT64_LE=e.UINT64_LE=e.INT32_LE=e.INT32_BE=e.INT24_BE=e.INT24_LE=e.INT16_LE=e.INT16_BE=e.INT8=e.UINT32_BE=e.UINT32_LE=e.UINT24_BE=e.UINT24_LE=e.UINT16_BE=e.UINT16_LE=e.UINT8=void 0;const t=ur;function r(e){return new DataView(e.buffer,e.byteOffset)}e.UINT8={len:1,get:(e,t)=>r(e).getUint8(t),put:(e,t,n)=>(r(e).setUint8(t,n),t+1)},e.UINT16_LE={len:2,get:(e,t)=>r(e).getUint16(t,!0),put:(e,t,n)=>(r(e).setUint16(t,n,!0),t+2)},e.UINT16_BE={len:2,get:(e,t)=>r(e).getUint16(t),put:(e,t,n)=>(r(e).setUint16(t,n),t+2)},e.UINT24_LE={len:3,get(e,t){const n=r(e);return n.getUint8(t)+(n.getUint16(t+1,!0)<<8)},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.UINT24_BE={len:3,get(e,t){const n=r(e);return(n.getUint16(t)<<8)+n.getUint8(t+2)},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.UINT32_LE={len:4,get:(e,t)=>r(e).getUint32(t,!0),put:(e,t,n)=>(r(e).setUint32(t,n,!0),t+4)},e.UINT32_BE={len:4,get:(e,t)=>r(e).getUint32(t),put:(e,t,n)=>(r(e).setUint32(t,n),t+4)},e.INT8={len:1,get:(e,t)=>r(e).getInt8(t),put:(e,t,n)=>(r(e).setInt8(t,n),t+1)},e.INT16_BE={len:2,get:(e,t)=>r(e).getInt16(t),put:(e,t,n)=>(r(e).setInt16(t,n),t+2)},e.INT16_LE={len:2,get:(e,t)=>r(e).getInt16(t,!0),put:(e,t,n)=>(r(e).setInt16(t,n,!0),t+2)},e.INT24_LE={len:3,get(t,r){const n=e.UINT24_LE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.INT24_BE={len:3,get(t,r){const n=e.UINT24_BE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.INT32_BE={len:4,get:(e,t)=>r(e).getInt32(t),put:(e,t,n)=>(r(e).setInt32(t,n),t+4)},e.INT32_LE={len:4,get:(e,t)=>r(e).getInt32(t,!0),put:(e,t,n)=>(r(e).setInt32(t,n,!0),t+4)},e.UINT64_LE={len:8,get:(e,t)=>r(e).getBigUint64(t,!0),put:(e,t,n)=>(r(e).setBigUint64(t,n,!0),t+8)},e.INT64_LE={len:8,get:(e,t)=>r(e).getBigInt64(t,!0),put:(e,t,n)=>(r(e).setBigInt64(t,n,!0),t+8)},e.UINT64_BE={len:8,get:(e,t)=>r(e).getBigUint64(t),put:(e,t,n)=>(r(e).setBigUint64(t,n),t+8)},e.INT64_BE={len:8,get:(e,t)=>r(e).getBigInt64(t),put:(e,t,n)=>(r(e).setBigInt64(t,n),t+8)},e.Float16_BE={len:2,get(e,r){return t.read(e,r,!1,10,this.len)},put(e,r,n){return t.write(e,n,r,!1,10,this.len),r+this.len}},e.Float16_LE={len:2,get(e,r){return t.read(e,r,!0,10,this.len)},put(e,r,n){return t.write(e,n,r,!0,10,this.len),r+this.len}},e.Float32_BE={len:4,get:(e,t)=>r(e).getFloat32(t),put:(e,t,n)=>(r(e).setFloat32(t,n),t+4)},e.Float32_LE={len:4,get:(e,t)=>r(e).getFloat32(t,!0),put:(e,t,n)=>(r(e).setFloat32(t,n,!0),t+4)},e.Float64_BE={len:8,get:(e,t)=>r(e).getFloat64(t),put:(e,t,n)=>(r(e).setFloat64(t,n),t+8)},e.Float64_LE={len:8,get:(e,t)=>r(e).getFloat64(t,!0),put:(e,t,n)=>(r(e).setFloat64(t,n,!0),t+8)},e.Float80_BE={len:10,get(e,r){return t.read(e,r,!1,63,this.len)},put(e,r,n){return t.write(e,n,r,!1,63,this.len),r+this.len}},e.Float80_LE={len:10,get(e,r){return t.read(e,r,!0,63,this.len)},put(e,r,n){return t.write(e,n,r,!0,63,this.len),r+this.len}};e.IgnoreType=class{constructor(e){this.len=e}get(e,t){}};e.Uint8ArrayType=class{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}};e.BufferType=class{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}};e.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class n{constructor(e){this.len=e}static decode(e,t,r){let i="";for(let o=t;o<r;++o)i+=n.codePointToString(n.singleByteDecoder(e[o]));return i}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(n.inRange(e,0,127))return e;const t=n.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return n.decode(e,t,t+this.len)}}e.AnsiStringType=n,n.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]}(cr);var fr={},lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.readFile=lr.writeFileSync=lr.writeFile=lr.read=lr.open=lr.close=lr.stat=lr.createReadStream=lr.pathExists=void 0;const hr=r.default;lr.pathExists=hr.existsSync,lr.createReadStream=hr.createReadStream,lr.stat=async function(e){return new Promise(((t,r)=>{hr.stat(e,((e,n)=>{e?r(e):t(n)}))}))},lr.close=async function(e){return new Promise(((t,r)=>{hr.close(e,(e=>{e?r(e):t()}))}))},lr.open=async function(e,t){return new Promise(((r,n)=>{hr.open(e,t,((e,t)=>{e?n(e):r(t)}))}))},lr.read=async function(e,t,r,n,i){return new Promise(((o,s)=>{hr.read(e,t,r,n,i,((e,t,r)=>{e?s(e):o({bytesRead:t,buffer:r})}))}))},lr.writeFile=async function(e,t){return new Promise(((r,n)=>{hr.writeFile(e,t,(e=>{e?n(e):r()}))}))},lr.writeFileSync=function(e,t){hr.writeFileSync(e,t)},lr.readFile=async function(e){return new Promise(((t,r)=>{hr.readFile(e,((e,n)=>{e?r(e):t(n)}))}))};var pr={},mr={},dr={},gr={},yr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EndOfStreamError=e.defaultMessages=void 0,e.defaultMessages="End-Of-Stream";class t extends Error{constructor(){super(e.defaultMessages)}}e.EndOfStreamError=t}(yr);var wr={},br={};Object.defineProperty(br,"__esModule",{value:!0}),br.Deferred=void 0;br.Deferred=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;const t=yr,r=br;var n=yr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}});e.StreamReader=class{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",(()=>this.reject(new t.EndOfStreamError))),this.s.once("error",(e=>this.reject(e))),this.s.once("close",(()=>this.reject(new Error("Stream closed"))))}async peek(e,t,r){const n=await this.read(e,t,r);return this.peekQueue.push(e.subarray(t,t+n)),n}async read(e,r,n){if(0===n)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new t.EndOfStreamError;let i=n,o=0;for(;this.peekQueue.length>0&&i>0;){const t=this.peekQueue.pop();if(!t)throw new Error("peekData should be defined");const n=Math.min(t.length,i);e.set(t.subarray(0,n),r+o),o+=n,i-=n,n<t.length&&this.peekQueue.push(t.subarray(n))}for(;i>0&&!this.endOfStream;){const t=Math.min(i,1048576),n=await this.readFromStream(e,r+o,t);if(o+=n,n<t)break;i-=n}return o}async readFromStream(e,t,n){const i=this.s.read(n);if(i)return e.set(i,t),i.length;{const i={buffer:e,offset:t,length:n,deferred:new r.Deferred};return this.deferred=i.deferred,this.s.once("readable",(()=>{this.readDeferred(i)})),i.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",(()=>{this.readDeferred(e)}))}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}}(wr),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;var t=yr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return t.EndOfStreamError}});var r=wr;Object.defineProperty(e,"StreamReader",{enumerable:!0,get:function(){return r.StreamReader}})}(gr),Object.defineProperty(dr,"__esModule",{value:!0}),dr.AbstractTokenizer=void 0;const vr=gr;dr.AbstractTokenizer=class{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new vr.EndOfStreamError;return e.get(r,0)}async peekToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new vr.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new vr.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new vr.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}},Object.defineProperty(mr,"__esModule",{value:!0}),mr.ReadStreamTokenizer=void 0;const xr=dr,kr=gr;class Sr extends xr.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new kr.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const i=await this.streamReader.read(e,r.offset,r.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<r.length)throw new kr.EndOfStreamError;return i}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const t=r.position-this.position;if(t>0){const i=new Uint8Array(r.length+t);return n=await this.peekBuffer(i,{mayBeLess:r.mayBeLess}),e.set(i.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof kr.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n<r.length)throw new kr.EndOfStreamError}return n}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let n=0;for(;n<e;){const i=e-n,o=await this.readBuffer(r,{length:Math.min(t,i)});if(o<0)return o;n+=o}return n}}mr.ReadStreamTokenizer=Sr;var Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.BufferTokenizer=void 0;const Tr=gr,Or=dr;class Nr extends Or.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&n<r.length)throw new Tr.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+n),r.offset),n}async close(){}}Er.BufferTokenizer=Nr,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromBuffer=e.fromStream=e.EndOfStreamError=void 0;const t=mr,r=Er;var n=gr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}}),e.fromStream=function(e,r){return r=r||{},new t.ReadStreamTokenizer(e,r)},e.fromBuffer=function(e,t){return new r.BufferTokenizer(e,t)}}(pr);var jr={};Object.defineProperty(jr,"__esModule",{value:!0}),jr.fromFile=jr.FileTokenizer=void 0;const _r=dr,Ir=gr,Br=lr;class Mr extends _r.AbstractTokenizer{constructor(e,t){super(t),this.fd=e}async readBuffer(e,t){const r=this.normalizeOptions(e,t);this.position=r.position;const n=await Br.read(this.fd,e,r.offset,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead<r.length&&(!t||!t.mayBeLess))throw new Ir.EndOfStreamError;return n.bytesRead}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=await Br.read(this.fd,e,r.offset,r.length,r.position);if(!r.mayBeLess&&n.bytesRead<r.length)throw new Ir.EndOfStreamError;return n.bytesRead}async close(){return Br.close(this.fd)}}jr.FileTokenizer=Mr,jr.fromFile=async function(e){const t=await Br.stat(e);if(!t.isFile)throw new Error(`File not a file: ${e}`);const r=await Br.open(e,"r");return new Mr(r,{path:e,size:t.size})},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromStream=e.fromBuffer=e.EndOfStreamError=e.fromFile=void 0;const t=lr,r=pr;var n=jr;Object.defineProperty(e,"fromFile",{enumerable:!0,get:function(){return n.fromFile}});var i=pr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),Object.defineProperty(e,"fromBuffer",{enumerable:!0,get:function(){return i.fromBuffer}}),e.fromStream=async function(e,n){if(n=n||{},e.path){const r=await t.stat(e.path);n.path=e.path,n.size=r.size}return r.fromStream(e,n)}}(fr);const Ar={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4};async function zr(e){try{return(new Ur).parse(e)}catch(e){if(!(e instanceof fr.EndOfStreamError))throw e}}function Fr(e,t,r){r=Object.assign({offset:0},r);for(const[n,i]of t.entries())if(r.mask){if(i!==(r.mask[n]&e[n+r.offset]))return!1}else if(i!==e[n+r.offset])return!1;return!0}class Ur{constructor(){this.buffer=Buffer.alloc(4100)}check(e,t){return Fr(this.buffer,e,t)}checkString(e,t){return this.check((r=e,Object.values(r).map((e=>e.charCodeAt(0)))),t);var r}async readTiffTag(e){if(this.tokenizer){const t=await this.tokenizer.readToken(e?cr.UINT16_BE:cr.UINT16_LE);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}}async readTiffIFD(e){if(this.tokenizer){const t=await this.tokenizer.readToken(e?cr.UINT16_BE:cr.UINT16_LE);for(let r=0;r<t;++r){const t=await this.readTiffTag(e);if(t)return t}}}async readTiffHeader(e){const t=(e?cr.UINT16_BE:cr.UINT16_LE).get(this.buffer,2),r=(e?cr.UINT32_BE:cr.UINT32_LE).get(this.buffer,4);if(42===t){if(r>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}if(this.tokenizer){await this.tokenizer.ignore(r);const e=await this.readTiffIFD(!1);return e||{ext:"tif",mime:"image/tiff"}}}if(43===t)return{ext:"tif",mime:"image/tiff"}}async parse(e){if(this.buffer=Buffer.alloc(4100),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(Ar);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),zr(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(this.buffer,{length:30});const r={compressedSize:this.buffer.readUInt32LE(18),uncompressedSize:this.buffer.readUInt32LE(22),filenameLength:this.buffer.readUInt16LE(26),extraFieldLength:this.buffer.readUInt16LE(28)};if(r.filename=await e.readToken(new cr.StringType(r.filenameLength,"utf-8")),await e.ignore(r.extraFieldLength),"META-INF/mozilla.rsa"===r.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml")){switch(r.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.filename.startsWith("3D/")&&r.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===r.filename&&r.compressedSize===r.uncompressedSize){switch(await e.readToken(new cr.StringType(r.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}}if(0===r.compressedSize){let n=-1;for(;n<0&&e.position<e.fileInfo.size;)await e.peekBuffer(this.buffer,{mayBeLess:!0}),n=this.buffer.indexOf("504B0304",0,"hex"),await e.ignore(n>=0?n:this.buffer.length)}else await e.ignore(r.compressedSize)}}catch(i){if(!(i instanceof fr.EndOfStreamError))throw i}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const o=Buffer.alloc(8);return await e.readBuffer(o),Fr(o,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:Fr(o,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Fr(o,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Fr(o,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Fr(o,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Fr(o,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const s=this.buffer.toString("binary",8,12).replace("\0"," ").trim();switch(s){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return s.startsWith("3g")?s.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){await e.ignore(1350);const a=10485760,c=Buffer.alloc(Math.min(a,e.fileInfo.size));return await e.readBuffer(c,{mayBeLess:!0}),c.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const u=await this.readTiffHeader(!1);if(u)return u}if(this.check([77,77])){const f=await this.readTiffHeader(!0);if(f)return f}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function l(){const t=await e.peekNumber(cr.UINT8);let r=128,n=0;for(;!(t&r);)++n,r>>=1;const i=Buffer.alloc(n+1);return await e.readBuffer(i),i}async function h(){const e=await l(),t=await l();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function p(t,r){for(;r>0;){const t=await h();if(17026===t.id){return(await e.readToken(new cr.StringType(t.len,"utf-8"))).replace(/\00.*$/g,"")}await e.ignore(t.len),--r}}const m=await h();switch(await p(0,m.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){await e.ignore(8);return"debian-binary"===await e.readToken(new cr.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(this.check([137,80,78,71,13,10,26,10])){async function d(){return{length:await e.readToken(cr.INT32_BE),type:await e.readToken(new cr.StringType(4,"binary"))}}await e.ignore(8);do{const g=await d();if(g.length<0)return;switch(g.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(g.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([239,187,191])&&this.checkString("<?xml",{offset:3}))return{ext:"xml",mime:"application/xml"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function y(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(cr.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const w=await y();let b=w.size-24;if(Fr(w.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const v=Buffer.alloc(16);if(b-=await e.readBuffer(v),Fr(v,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Fr(v,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(b)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await e.ignore(20);switch(await e.readToken(new cr.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255,0,60,0,63,0,120,0,109,0,108])||this.check([255,254,60,0,63,0,120,0,109,0,108,0]))return{ext:"xml",mime:"application/xml"};if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const x=this.buffer.readUInt32LE(12);if(x>12&&this.buffer.length>=x+16)try{const k=this.buffer.slice(16,x+16).toString();if(JSON.parse(k).files)return{ext:"asar",mime:"application/x-asar"}}catch(S){}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),function(e,t=0){const r=Number.parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(r))return!1;let n=256;for(let r=t;r<t+148;r++)n+=e[r];for(let r=t+156;r<t+512;r++)n+=e[r];return r===n}(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}}e.YC=it,e.YL=nt,e.YR={email:/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,phone:/^1[3|4|5|6|7|8][0-9]{9}$/,fixedPhone:/(^0\d{2,3}-\d{7,8}$)|(^1[3|4|5|6|7|8][0-9]{9}$)/,qq:/[1-9][0-9]{4,}/,zipcode:/[1-9]\d{5}(?!\d)/,IDCard:/^\d{17}[\d|X|x]|\d{15}$/,chinese:/^[\u0391-\uFFE5]+$/,chineseNumberLine:/^[\u4E00-\u9FA5A-Za-z0-9_]+$/,chineseNumberNoLine:/^[\u4E00-\u9FA5A-Za-z0-9]+$/,integerZ:/^[1-9]\d*$/,integerF:/^-[1-9]\d*$/,number:/^\d+(\.\d+)?$/,numberNoMoreThan1:/^\-?([0-9](\d+)?(\.\d{1,1})?$)|(^0$)|(^\d\.\d{1,1})$/,numberNoMoreThan2:/^\-?([0-9](\d+)?(\.\d{1,2})?$)|(^0$)|(^\d\.\d{1,2})$/,numberNoMoreThan3:/^\-?([0-9](\d+)?(\.\d{1,3})?$)|(^0$)|(^\d\.\d{1,3})$/,numberNoMoreThan4:/^\-?([0-9](\d+)?(\.\d{1,4})?$)|(^0$)|(^\d\.\d{1,4})$/,greaterZero1:/^(0|[1-9]\d*)(\.\d{1,1})?$/,greaterZero2:/^(0|[1-9]\d*)(\.\d{1,2})?$/,greaterZero3:/^(0|[1-9]\d*)(\.\d{1,3})?$/,greaterZero4:/^(0|[1-9]\d*)(\.\d{1,4})?$/,zeroTo100:/^((\d|[1-9]\d)(\.\d{1,2})?$)|(^100|100.0|100.00$)$/,zeroTo1000:/^((\d|[1-9]{1,2}\d)(\.\d{1,2})?$)|(^1000|1000.0|1000.00$)$/},e.YS=rt,e.calTimeLen=(e,t,r="s",n)=>{let i;switch(r){case"m":i=1e3*yt;break;case"h":i=1e3*gt;break;case"d":i=1e3*dt;break;default:i=1e3}let o=(ct(t)-ct(e))/i;return o="number"==typeof n?Number(o.toFixed(n)):o,o},e.checkFileType=(e,t)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=async r=>{var n,i;try{const o=new Uint8Array(null===(n=r.target)||void 0===n?void 0:n.result),s=await fr.fromBuffer(o),a=await zr(s),c=e.name.indexOf(".")>-1?(e.name.split(".").pop()||"").toLocaleLowerCase():"";let u=!a||c===a.ext;c.indexOf("xls")>-1&&((null===(i=null==a?void 0:a.ext)||void 0===i?void 0:i.indexOf("xls"))>-1||"cfb"===(null==a?void 0:a.ext))&&(u=!0),t(u,a)}catch(e){if(!(e instanceof fr.EndOfStreamError))throw e;t(!0,void 0)}}},e.dateFormat=ut,e.debounce=ar,e.expandMultiple=(e,t,r)=>Dt(e)(t,r),e.exportExcel=(e,t={})=>{let r;if("undefined"!=typeof window){r=window.localStorage.getItem("token");const n=Object.assign(Object.assign({},t),{token:r});/^https.*/.test(e)||(e=e.replace("http","https"));const i=`${e}?${(e=>{const t=[];return Object.keys(e).forEach((r=>{He(e[r])||G(e[r])||t.push(`${r}=${e[r]}`)})),t.join("&")})(n)}`;console.log("YWFE下载地址=>",i);const o=`alink_${(new Date).getTime()}`,s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("target","_blank"),s.setAttribute("id",o),document.getElementById(o)||document.body.appendChild(s),s.click(),setTimeout((()=>{document.body.removeChild(s)}),0)}},e.fenToyuan=(e,t)=>Rt(100)(e,t),e.fileTypeFromTokenizer=zr,e.formatData=e=>{let{afterUnit:t}=e;const{type:r,value:n,isAbs:i,beforeUnit:o}=e;if(-2147483648===Number(n))return"无权限";if("text"===r)return n||0===n?n:"-";if(isNaN(n)||0!==n&&!n)return"-";let s;switch(r){case"yuan":s=xt(n,2);break;case"fen":s=xt(n/100,2);break;case"decimalToPercentSave2Decimal":s=xt(100*n,2),t="string"==typeof t?t:"%";break;case"decimalToPercentSave0Decimal":s=xt(100*n,0),t="string"==typeof t?t:"%";break;case"percentSave2Decimal":s=xt(n,2),t="string"==typeof t?t:"%";break;case"percentSave0Decimal":s=xt(n,0),t="string"==typeof t?t:"%";break;case"int":s=xt(n,2,!0,!0);break;case"decimal":s=xt(n,2,!0,!1);break;case"secToTimeHM":s=mt(n,"{HH}h{mm}m");break;case"secToTimeChMS":s=mt(n,"{mm}分{ss}秒");break;case"secToTimeMS":s=mt(n,"{mm}m{ss}s");break;case"secToTime":s=mt(n,"{DD}d{HH}h{mm}m{ss}s",!1),s=s.replace("00d","").replace("00h","");break;default:s=xt(n)}return s="-"!==s&&i?s.replace("-",""):s,"-"===s?"-":`${o||""}${s}${t||""}`},e.formatTime=mt,e.gTokg=(e,t)=>Rt(1e3)(e,t),e.getBiteLen=e=>{if("string"!=typeof e)return 0;let t=0;for(let r=0;r<e.length;r++)e.charCodeAt(r)>127||94===e.charCodeAt(r)?t+=2:t+=1;return t},e.getDate=ct,e.getEnv=kt,e.getHost=(e,t,r)=>{const n=window.configs?window.configs:{};let i=r&&St()?"mock":kt();return{basePath:n[e]?n[e][i].API_BASE_URL+""+("mock"===i?"/"+t:""):"",loginPath:n.AUTH?n.AUTH[i].APPLICATION_URL:""}},e.getImgUrl=(e,t=200,r,n)=>{const i=new RegExp(/resize:(\d+):(\d+)/,"g");let o="";return e?(o=e,o=i.test(o)?o.replace(i,`resize:${t}:${r||0}`):o.indexOf("x-oss-process=image")>-1||o.indexOf("?")>-1?o:`${o}?x-oss-process=image/resize,w_${t},limit_0/quality,q_60`):o=n||"https://cdn.ywwl.com/bps/ywyun/dianhu/assets/def_goods_img.png",o},e.getMD5=e=>He(e)||G(e)?e:qe(String,e)?or(e):e,e.getMock=St,e.getQueries=e=>{let t=e||window.location.search;return t=t.replace("?",""),Et(t)||{}},e.getQuery=(e,t)=>{const r=new RegExp(`(\\?|&)${e}=([^&]*)(&|$)`,"i");let n=window.location.href;const i=r.exec(t||n);return null!=i&&decodeURIComponent(i[2])||""},e.getQueryName=(e,t)=>{let r=t||decodeURI(window.location.href);r=r.split("?")[1];const n=new Object;if(-1===r.indexOf("?")){const e=r.split("&");for(let t=0;t<e.length;t++){const r=e[t],i=r.indexOf("=");i>0&&(n[r.substr(0,i)]=decodeURI(r.substr(i+1)))}}return n[e]||""},e.getQueryOfNextPageContext=e=>{if(!e)return{};const{pathname:t="",asPath:r="",query:n}=e,i=ae(Ze("/"),Ee((e=>/\[\w+\]/.test(e))),$((e=>Qe("]","",Qe("[","",e)))))(t),o=ae(Ze("#"),oe(0,1))(r)||[],s=o.length?ae(Ze("/"),Ee((e=>""!==e)))(o[0]):[],a=i.map(((e,t)=>({[`${e}`]:s[t]})));let c={};return i.length?c=We(a)||{}:c.path=s[0]||"desktop",Object.assign(Object.assign({},n),c)},e.getRoutes=(e,t,r,n)=>{if(He(e)||He(t))return{menus:[],defaultSelectedMenus:[],defaultOpenMenus:[],defaultMenu:{},permissions:[]};let i;i="/"!==n&&"/undefined"!==n&&"/null"!==n?tt("/",n):[];let o=[],s=[],a={};const c=e=>{const n=t[e.url];if(!n)return{};const i=0===e.url.indexOf("/")?e.url||"":`/${e.url}`,c={path:i,param:n.param||"",url:n.url,name:e.resourceId,meta:{title:e.name,icon:n.icon},component:n.component,hidden:n.hidden,origion_url:i};return((null==r?void 0:r.primaryDefaultMenu)&&e.url===(null==r?void 0:r.primaryDefaultMenu)||(null==r?void 0:r.secondaryDefaultMenu)&&e.url===(null==r?void 0:r.secondaryDefaultMenu))&&(o=[e.resourceParentId],s=[e.resourceId],a=c),c},u=[];let f=[];if(e.map((e=>{const r=[],n=t[e.url],i=wt({key:"resourceType",value:"BUTTON"},"childMenus",e);if(i&&i.length){const e=ae($(H("url")))(i);f=_e(f,e)}if(e.childMenus&&e.childMenus.length){wt({key:"resourceId"},"childMenus",e.childMenus).map((e=>{if(e){const t=c(e);t&&t.name&&r.push(t)}}))}const o=c(e);n&&u.push(Object.assign(Object.assign({},o),{children:r}))})),i.length&&u.length){const e=bt(i,u);s=e.defaultSelectedMenus,o=e.defaultOpenMenus,a=e.defaultMenu}else if(!s.length||!o.length||!a){const e=vt(u);s=e.defaultSelectedMenus,o=e.defaultOpenMenus,a=e.defaultMenu}return{menus:u,defaultSelectedMenus:s,defaultOpenMenus:o,defaultMenu:a,permissions:f}},e.humpToLine=function(e){return"string"!=typeof e?e:e.replace(/([A-Z])/g,"_$1").toLowerCase()},e.isChinaMobile=e=>/^((\+86)|(86)|(086))?(13[0-9]|15[0-9]|166|17[0-9]|18[0-9]|14[0-9]|19[0-9])[0-9]{8}$/.test(String(e)),e.isDate=at,e.isURL=e=>/^((?:(?:https?|ftp):|)\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(String(e)),e.joinPath=e=>{if(!e||He(e))return"";const t=Object.keys(e);let r="";return t.map((t=>{e[t]&&"search"!==t&&(r+=`/${e[t]}`),"search"===t&&(r+=e[t])})),r},e.kgTog=(e,t)=>Dt(1e3)(e,t),e.lineToHump=function(e){return"string"!=typeof e?e:e.replace(/\_(\w)/g,(function(e,t){return t.toUpperCase()}))},e.loadScript=function(e,t,r){return new Promise(((n,i)=>{const o=document.createElement("script");var s,a;o.id=t,o.readyState?(a=()=>n(o),(s=o).onreadystatechange=function(){"loaded"!==s.readyState&&"complete"!==s.readyState||(s.onreadystatechange=null,a())}):function(e,t,r){ot(e,"load",t),ot(e,"error",r)}(o,(()=>n(o)),(()=>{i(),document.removeChild(document.getElementById(t))})),r&&st.forEach((e=>{if(e in r){const t=r[e];"string"==typeof t?o.setAttribute(e,t):"boolean"==typeof t&&(o[e]=t)}})),o.src=e.js,document.body.appendChild(o)}))},e.maxSubstrWord=(e,t=5,r=!0)=>"string"==typeof e?r?`${e.substr(0,t)}...`:e.substr(0,t):e,e.niceNumShow=(e,t=!1)=>{if(0!==e&&!e||"-"===e)return[{type:"num",text:"-"}];const r=[],n=e.toString().split("");let i,o="";return n.forEach((e=>{let n=/^[0-9\\.]*$/.test(e)?"num":"character";n="."===e&&t||"num"===n&&"suffixNum"===i?"suffixNum":n,i!==n&&i?(r.push({type:i,text:o}),o=e):o=`${o}${e}`,i=n})),i=i||"num",r.push({type:i,text:o}),r},e.numberToThousand=(e,t=",")=>He(e)||G(e)?e:isNaN(Number(e))?NaN:e.toString().replace(/\d+/,(e=>e.replace(/(\d)(?=(\d{3})+$)/g,(e=>`${e}${t}`)))),e.omadownload=(e,t,r)=>{const n=new Uint8Array(e);try{const e=String.fromCharCode.apply(null,n);if(e.indexOf("success")>-1)return JSON.parse(e)}catch(e){console.warn(e)}const i=window.URL.createObjectURL(new Blob([e],{type:r||"application/vnd.ms-excel"})),o=document.createElement("a");o.style.display="none",o.href=i,o.setAttribute("download",decodeURIComponent(t)),document.body.appendChild(o),o.click(),o.remove()},e.parseParams=e=>V(e).join("/"),e.pickAll=(e,t,r)=>{const n={reduce:K(((r,i,o)=>{const s=r(i,o);if(!(e=>Le([t],e))(o)){return s&&s.length?$((t=>t[e]||t))(s):[]}return o[t]?o[t].reduce(n.reduce(r),s):s})),find:K(((e,t,r)=>ae($(n.reduce(e,t)),Ue)(r)))},i=(r,n)=>n[e]?r.concat([Ve([t],n)]):r;switch(te(r)){case"Object":return n.reduce(i,[])(r);case"Array":return n.find(i,[])(r);default:return r}},e.querystring=Tt,e.reduceMultiple=(e,t,r)=>Rt(e)(t,r),e.reduceParams=e=>{if(!e)return{};if(e instanceof FormData)return e;return Ee((e=>!G(e)&&!He(e)))(e)||{}},e.remove=function(e,t){const r=[];if(!e||!e.length)return r;let n=-1,i=[],o=e.length;for(;++n<o;){const o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return function(e,t){let r=e?t.length:0,n=r-1,i=0;for(;r--;){const o=t[r];r!=n&&o===i||(i=o,Array.prototype.splice.call(e,o,1))}}(e,i),r},e.round=(e,t=0)=>Math.round(Math.random()*(e-t)+t),e.slicePath=(e,t=0,r)=>{const n=tt("/",e);r||(r=n.length-1);return"/"+n.slice(t,r).join("/")},e.split=tt,e.strPad=ft,e.sum=(e,t)=>{let r=new Lt(0);const n=(e,t)=>{"array"===Ct(e)&&Array.isArray(e)&&e.forEach((e=>{isNaN(e)||(r=r.plus(Number(e))),"object"===Ct(e)&&void 0!==t&&null!==e[t]&&(r=r.plus(Number(e[t]))),"array"===Ct(e)&&Array.isArray(e)&&n(e,t)}))};return n(e,t),Number(r)},e.throttle=function(e,t,r){let n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return sr(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),ar(e,t,{leading:n,trailing:i,maxWait:t})},e.timeFlow=(e,t,r="HH:mm:ss")=>ut(ct(e)+1e3*t,r),e.toDate=e=>{if(at(e)){let t=e;return e instanceof Date?t=e:"string"==typeof e&&String(e).length>=13&&!isNaN(e)?t=Number(e):"string"==typeof e&&e.includes("-")&&(t=e.replace(/-/g,"/")),new Date(t).getTime()}return 0},e.transformShortNum=xt,e.translateMapToArray=(e,t=!1,r="全部",n=null)=>{let i=t?[{label:r,value:n}]:[];for(const[t,r]of e.entries())i.push({label:r,value:t});return i},e.treeFind=(e,t,r)=>{const n={reduce:K(((r,i,s)=>{const a=r(i,s);return((e=>t&&Le([t],e)&&!He(e[t]))(s)||s[e.key]!==e.value)&&t&&s[t]&&!He(s[t])?n.reduce(o,a)(s[t]):a})),find:K(((e,t,r)=>ae($(n.reduce(e,t)),Ue,Ke(t))(r)))},i=(r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?t?r.concat([Ve([t],n)]):r.concat([n]):r,o=(e,t)=>{const r=Object.keys(t),o=[];return r.map((e=>{o.push(t[e])})),n.find(i,e)(o)};switch(te(r)){case"Object":return n.reduce(o,[])(r);case"Array":return n.find(i,[])(r);default:return[]}},e.treePaths=(e,t,r)=>{const n={reduce:K(((r,i,s,a)=>{const c=r(i,s,a);return(e=>Le([t],e)&&!He(e[t]))(a)||a[e.key]!==e.value?a[t]&&!He(a[t])?n.reduce(o,[],Ve([t],a))(a[t]):c:(s.path&&c.splice(0,0,s.path),c)})),find:K(((e,t,r,i)=>ae($(n.reduce(e,t,r)),Ue)(i)))},i=(t,r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?t.concat([n.path]):t,o=(e,t,r)=>{if(!r||He(r))return e;const o=Object.keys(r),s=[];return o.map((e=>{s.push(r[e])})),n.find(i,e,t)(s)};switch(te(r)){case"Object":return n.reduce(o,[],{})(r);case"Array":return n.find(i,[],{})(r);default:return[]}},e.treeReduce=wt,e.trimAll=et,e.trimParams=qt,e.unLoadScript=function(e){if(document.getElementById(e)){const t=document.getElementById(e);document.body.removeChild(t)}},e.uuidv4=()=>Jt(),e.wanToyuan=(e,t)=>Dt(1e4)(e,t),e.yuanTofen=(e,t)=>Dt(100)(e,t),e.yuanTowan=(e,t)=>Rt(1e4)(e,t)}(i),e.JSON2String=function(e){var t=e.input.data,r={content:""};try{var n=JSON.stringify(t);return r.content="```json"+n+"json```",r}catch(e){return r.content="```json{}json```",r}},e.request=s,e.userInputToJson=function(e){return t(this,arguments,void 0,(function(e){var t,n=e.input;return r(this,(function(e){switch(e.label){case 0:return[4,s({input:{url:"https://fc-typechat.ywwl.com/userInputToJson",method:"GET",params:n}})];case 1:return t=e.sent(),console.log("userINput1",t),[2,t]}}))}))}}));
4
4
  //# sourceMappingURL=ywfe-tools.umd.js.map