@shihengtech/utils 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sh-utils.js +46 -2
- package/dist/sh-utils.js.map +1 -1
- package/es/index.js +155 -29
- package/es/index.js.map +1 -1
- package/lib/index.d.ts +72 -10
- package/lib/index.js +157 -28
- package/lib/index.js.map +1 -1
- package/package.json +12 -2
package/dist/sh-utils.js
CHANGED
|
@@ -1,4 +1,48 @@
|
|
|
1
|
-
var ShihengUtils=(function(exports){'use strict';var mt=Object.create;var Re=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames,nr=Object.getOwnPropertySymbols,yt=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable;var or=(s,f,m)=>f in s?Re(s,f,{enumerable:true,configurable:true,writable:true,value:m}):s[f]=m,pe=(s,f)=>{for(var m in f||(f={}))ar.call(f,m)&&or(s,m,f[m]);if(nr)for(var m of nr(f))xt.call(f,m)&&or(s,m,f[m]);return s};var ue=(s=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(s,{get:(f,m)=>(typeof require!="undefined"?require:f)[m]}):s)(function(s){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var gt=(s,f)=>()=>(f||s((f={exports:{}}).exports,f),f.exports);var _t=(s,f,m,_)=>{if(f&&typeof f=="object"||typeof f=="function")for(let g of vt(f))!ar.call(s,g)&&g!==m&&Re(s,g,{get:()=>f[g],enumerable:!(_=ht(f,g))||_.enumerable});return s};var bt=(s,f,m)=>(m=s!=null?mt(yt(s)):{},_t(!s||!s.__esModule?Re(m,"default",{value:s,enumerable:true}):m,s));var Z=(s,f,m)=>new Promise((_,g)=>{var C=b=>{try{N(m.next(b));}catch(P){g(P);}},S=b=>{try{N(m.throw(b));}catch(P){g(P);}},N=b=>b.done?_(b.value):Promise.resolve(b.value).then(C,S);N((m=m.apply(s,f)).next());});var ur=gt((fr,Ne)=>{(function(s){if(typeof fr=="object"&&typeof Ne!="undefined")Ne.exports=s();else if(typeof define=="function"&&define.amd)define([],s);else {var f;typeof window!="undefined"?f=window:typeof global!="undefined"?f=global:typeof self!="undefined"?f=self:f=this,f.localforage=s();}})(function(){return (function _(g,C,S){function N(U,Y){if(!C[U]){if(!g[U]){var h=typeof ue=="function"&&ue;if(!Y&&h)return h(U,true);if(b)return b(U,true);var w=new Error("Cannot find module '"+U+"'");throw w.code="MODULE_NOT_FOUND",w}var B=C[U]={exports:{}};g[U][0].call(B.exports,function(O){var k=g[U][1][O];return N(k||O)},B,B.exports,_,g,C,S);}return C[U].exports}for(var b=typeof ue=="function"&&ue,P=0;P<S.length;P++)N(S[P]);return N})({1:[function(_,g,C){(function(S){var N=S.MutationObserver||S.WebKitMutationObserver,b;if(N){var P=0,U=new N(O),Y=S.document.createTextNode("");U.observe(Y,{characterData:true}),b=function(){Y.data=P=++P%2;};}else if(!S.setImmediate&&typeof S.MessageChannel!="undefined"){var h=new S.MessageChannel;h.port1.onmessage=O,b=function(){h.port2.postMessage(0);};}else "document"in S&&"onreadystatechange"in S.document.createElement("script")?b=function(){var L=S.document.createElement("script");L.onreadystatechange=function(){O(),L.onreadystatechange=null,L.parentNode.removeChild(L),L=null;},S.document.documentElement.appendChild(L);}:b=function(){setTimeout(O,0);};var w,B=[];function O(){w=true;for(var L,$,D=B.length;D;){for($=B,B=[],L=-1;++L<D;)$[L]();D=B.length;}w=false;}g.exports=k;function k(L){B.push(L)===1&&!w&&b();}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{});},{}],2:[function(_,g,C){var S=_(1);function N(){}var b={},P=["REJECTED"],U=["FULFILLED"],Y=["PENDING"];g.exports=h;function h(p){if(typeof p!="function")throw new TypeError("resolver must be a function");this.state=Y,this.queue=[],this.outcome=void 0,p!==N&&k(this,p);}h.prototype.catch=function(p){return this.then(null,p)},h.prototype.then=function(p,I){if(typeof p!="function"&&this.state===U||typeof I!="function"&&this.state===P)return this;var v=new this.constructor(N);if(this.state!==Y){var x=this.state===U?p:I;B(v,x,this.outcome);}else this.queue.push(new w(v,p,I));return v};function w(p,I,v){this.promise=p,typeof I=="function"&&(this.onFulfilled=I,this.callFulfilled=this.otherCallFulfilled),typeof v=="function"&&(this.onRejected=v,this.callRejected=this.otherCallRejected);}w.prototype.callFulfilled=function(p){b.resolve(this.promise,p);},w.prototype.otherCallFulfilled=function(p){B(this.promise,this.onFulfilled,p);},w.prototype.callRejected=function(p){b.reject(this.promise,p);},w.prototype.otherCallRejected=function(p){B(this.promise,this.onRejected,p);};function B(p,I,v){S(function(){var x;try{x=I(v);}catch(T){return b.reject(p,T)}x===p?b.reject(p,new TypeError("Cannot resolve promise with itself")):b.resolve(p,x);});}b.resolve=function(p,I){var v=L(O,I);if(v.status==="error")return b.reject(p,v.value);var x=v.value;if(x)k(p,x);else {p.state=U,p.outcome=I;for(var T=-1,W=p.queue.length;++T<W;)p.queue[T].callFulfilled(I);}return p},b.reject=function(p,I){p.state=P,p.outcome=I;for(var v=-1,x=p.queue.length;++v<x;)p.queue[v].callRejected(I);return p};function O(p){var I=p&&p.then;if(p&&(typeof p=="object"||typeof p=="function")&&typeof I=="function")return function(){I.apply(p,arguments);}}function k(p,I){var v=false;function x(q){v||(v=true,b.reject(p,q));}function T(q){v||(v=true,b.resolve(p,q));}function W(){I(T,x);}var z=L(W);z.status==="error"&&x(z.value);}function L(p,I){var v={};try{v.value=p(I),v.status="success";}catch(x){v.status="error",v.value=x;}return v}h.resolve=$;function $(p){return p instanceof this?p:b.resolve(new this(N),p)}h.reject=D;function D(p){var I=new this(N);return b.reject(I,p)}h.all=re;function re(p){var I=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=p.length,x=false;if(!v)return this.resolve([]);for(var T=new Array(v),W=0,z=-1,q=new this(N);++z<v;)j(p[z],z);return q;function j(oe,le){I.resolve(oe).then(xe,function(te){x||(x=true,b.reject(q,te));});function xe(te){T[le]=te,++W===v&&!x&&(x=true,b.resolve(q,T));}}}h.race=V;function V(p){var I=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=p.length,x=false;if(!v)return this.resolve([]);for(var T=-1,W=new this(N);++T<v;)z(p[T]);return W;function z(q){I.resolve(q).then(function(j){x||(x=true,b.resolve(W,j));},function(j){x||(x=true,b.reject(W,j));});}}},{1:1}],3:[function(_,g,C){(function(S){typeof S.Promise!="function"&&(S.Promise=_(2));}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{});},{2:2}],4:[function(_,g,C){var S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(e){return}}var P=b();function U(){try{if(!P||!P.open)return !1;var e=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return (!e||t)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(r){return false}}function Y(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(n){if(n.name!=="TypeError")throw n;for(var r=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,o=new r,a=0;a<e.length;a+=1)o.append(e[a]);return o.getBlob(t.type)}}typeof Promise=="undefined"&&_(3);var h=Promise;function w(e,t){t&&e.then(function(r){t(null,r);},function(r){t(r);});}function B(e,t,r){typeof t=="function"&&e.then(t),typeof r=="function"&&e.catch(r);}function O(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function k(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var L="local-forage-detect-blob-support",$=void 0,D={},re=Object.prototype.toString,V="readonly",p="readwrite";function I(e){for(var t=e.length,r=new ArrayBuffer(t),o=new Uint8Array(r),a=0;a<t;a++)o[a]=e.charCodeAt(a);return r}function v(e){return new h(function(t){var r=e.transaction(L,p),o=Y([""]);r.objectStore(L).put(o,"key"),r.onabort=function(a){a.preventDefault(),a.stopPropagation(),t(false);},r.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!a||parseInt(a[1],10)>=43);};}).catch(function(){return false})}function x(e){return typeof $=="boolean"?h.resolve($):v(e).then(function(t){return $=t,$})}function T(e){var t=D[e.name],r={};r.promise=new h(function(o,a){r.resolve=o,r.reject=a;}),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then(function(){return r.promise}):t.dbReady=r.promise;}function W(e){var t=D[e.name],r=t.deferredOperations.pop();if(r)return r.resolve(),r.promise}function z(e,t){var r=D[e.name],o=r.deferredOperations.pop();if(o)return o.reject(t),o.promise}function q(e,t){return new h(function(r,o){if(D[e.name]=D[e.name]||Fe(),e.db)if(t)T(e),e.db.close();else return r(e.db);var a=[e.name];t&&a.push(e.version);var n=P.open.apply(P,a);t&&(n.onupgradeneeded=function(u){var i=n.result;try{i.createObjectStore(e.storeName),u.oldVersion<=1&&i.createObjectStore(L);}catch(l){if(l.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw l}}),n.onerror=function(u){u.preventDefault(),o(n.error);},n.onsuccess=function(){var u=n.result;u.onversionchange=function(i){i.target.close();},r(u),W(e);};})}function j(e){return q(e,false)}function oe(e){return q(e,true)}function le(e,t){if(!e.db)return true;var r=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,a=e.version>e.db.version;if(o&&(e.version!==t&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),a||r){if(r){var n=e.db.version+1;n>e.version&&(e.version=n);}return true}return false}function xe(e){return new h(function(t,r){var o=new FileReader;o.onerror=r,o.onloadend=function(a){var n=btoa(a.target.result||"");t({__local_forage_encoded_blob:true,data:n,type:e.type});},o.readAsBinaryString(e);})}function te(e){var t=I(atob(e.data));return Y([t],{type:e.type})}function We(e){return e&&e.__local_forage_encoded_blob}function hr(e){var t=this,r=t._initReady().then(function(){var o=D[t._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return B(r,e,e),r}function vr(e){T(e);for(var t=D[e.name],r=t.forages,o=0;o<r.length;o++){var a=r[o];a._dbInfo.db&&(a._dbInfo.db.close(),a._dbInfo.db=null);}return e.db=null,j(e).then(function(n){return e.db=n,le(e)?oe(e):n}).then(function(n){e.db=t.db=n;for(var u=0;u<r.length;u++)r[u]._dbInfo.db=n;}).catch(function(n){throw z(e,n),n})}function Q(e,t,r,o){o===void 0&&(o=1);try{var a=e.db.transaction(e.storeName,t);r(null,a);}catch(n){if(o>0&&(!e.db||n.name==="InvalidStateError"||n.name==="NotFoundError"))return h.resolve().then(function(){if(!e.db||n.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),oe(e)}).then(function(){return vr(e).then(function(){Q(e,t,r,o-1);})}).catch(r);r(n);}}function Fe(){return {forages:[],db:null,dbReady:null,deferredOperations:[]}}function yr(e){var t=this,r={db:null};if(e)for(var o in e)r[o]=e[o];var a=D[r.name];a||(a=Fe(),D[r.name]=a),a.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=hr);var n=[];function u(){return h.resolve()}for(var i=0;i<a.forages.length;i++){var l=a.forages[i];l!==t&&n.push(l._initReady().catch(u));}var c=a.forages.slice(0);return h.all(n).then(function(){return r.db=a.db,j(r)}).then(function(d){return r.db=d,le(r,t._defaultConfig.version)?oe(r):d}).then(function(d){r.db=a.db=d,t._dbInfo=r;for(var y=0;y<c.length;y++){var E=c[y];E!==t&&(E._dbInfo.db=r.db,E._dbInfo.version=r.version);}})}function xr(e,t){var r=this;e=O(e);var o=new h(function(a,n){r.ready().then(function(){Q(r._dbInfo,V,function(u,i){if(u)return n(u);try{var l=i.objectStore(r._dbInfo.storeName),c=l.get(e);c.onsuccess=function(){var d=c.result;d===void 0&&(d=null),We(d)&&(d=te(d)),a(d);},c.onerror=function(){n(c.error);};}catch(d){n(d);}});}).catch(n);});return w(o,t),o}function gr(e,t){var r=this,o=new h(function(a,n){r.ready().then(function(){Q(r._dbInfo,V,function(u,i){if(u)return n(u);try{var l=i.objectStore(r._dbInfo.storeName),c=l.openCursor(),d=1;c.onsuccess=function(){var y=c.result;if(y){var E=y.value;We(E)&&(E=te(E));var A=e(E,y.key,d++);A!==void 0?a(A):y.continue();}else a();},c.onerror=function(){n(c.error);};}catch(y){n(y);}});}).catch(n);});return w(o,t),o}function _r(e,t,r){var o=this;e=O(e);var a=new h(function(n,u){var i;o.ready().then(function(){return i=o._dbInfo,re.call(t)==="[object Blob]"?x(i.db).then(function(l){return l?t:xe(t)}):t}).then(function(l){Q(o._dbInfo,p,function(c,d){if(c)return u(c);try{var y=d.objectStore(o._dbInfo.storeName);l===null&&(l=void 0);var E=y.put(l,e);d.oncomplete=function(){l===void 0&&(l=null),n(l);},d.onabort=d.onerror=function(){var A=E.error?E.error:E.transaction.error;u(A);};}catch(A){u(A);}});}).catch(u);});return w(a,r),a}function br(e,t){var r=this;e=O(e);var o=new h(function(a,n){r.ready().then(function(){Q(r._dbInfo,p,function(u,i){if(u)return n(u);try{var l=i.objectStore(r._dbInfo.storeName),c=l.delete(e);i.oncomplete=function(){a();},i.onerror=function(){n(c.error);},i.onabort=function(){var d=c.error?c.error:c.transaction.error;n(d);};}catch(d){n(d);}});}).catch(n);});return w(o,t),o}function wr(e){var t=this,r=new h(function(o,a){t.ready().then(function(){Q(t._dbInfo,p,function(n,u){if(n)return a(n);try{var i=u.objectStore(t._dbInfo.storeName),l=i.clear();u.oncomplete=function(){o();},u.onabort=u.onerror=function(){var c=l.error?l.error:l.transaction.error;a(c);};}catch(c){a(c);}});}).catch(a);});return w(r,e),r}function Er(e){var t=this,r=new h(function(o,a){t.ready().then(function(){Q(t._dbInfo,V,function(n,u){if(n)return a(n);try{var i=u.objectStore(t._dbInfo.storeName),l=i.count();l.onsuccess=function(){o(l.result);},l.onerror=function(){a(l.error);};}catch(c){a(c);}});}).catch(a);});return w(r,e),r}function Ir(e,t){var r=this,o=new h(function(a,n){if(e<0){a(null);return}r.ready().then(function(){Q(r._dbInfo,V,function(u,i){if(u)return n(u);try{var l=i.objectStore(r._dbInfo.storeName),c=!1,d=l.openKeyCursor();d.onsuccess=function(){var y=d.result;if(!y){a(null);return}e===0||c?a(y.key):(c=!0,y.advance(e));},d.onerror=function(){n(d.error);};}catch(y){n(y);}});}).catch(n);});return w(o,t),o}function Sr(e){var t=this,r=new h(function(o,a){t.ready().then(function(){Q(t._dbInfo,V,function(n,u){if(n)return a(n);try{var i=u.objectStore(t._dbInfo.storeName),l=i.openKeyCursor(),c=[];l.onsuccess=function(){var d=l.result;if(!d){o(c);return}c.push(d.key),d.continue();},l.onerror=function(){a(l.error);};}catch(d){a(d);}});}).catch(a);});return w(r,e),r}function Tr(e,t){t=k.apply(this,arguments);var r=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var o=this,a;if(!e.name)a=h.reject("Invalid arguments");else {var n=e.name===r.name&&o._dbInfo.db,u=n?h.resolve(o._dbInfo.db):j(e).then(function(i){var l=D[e.name],c=l.forages;l.db=i;for(var d=0;d<c.length;d++)c[d]._dbInfo.db=i;return i});e.storeName?a=u.then(function(i){if(i.objectStoreNames.contains(e.storeName)){var l=i.version+1;T(e);var c=D[e.name],d=c.forages;i.close();for(var y=0;y<d.length;y++){var E=d[y];E._dbInfo.db=null,E._dbInfo.version=l;}var A=new h(function(R,M){var F=P.open(e.name,l);F.onerror=function(K){var fe=F.result;fe.close(),M(K);},F.onupgradeneeded=function(){var K=F.result;K.deleteObjectStore(e.storeName);},F.onsuccess=function(){var K=F.result;K.close(),R(K);};});return A.then(function(R){c.db=R;for(var M=0;M<d.length;M++){var F=d[M];F._dbInfo.db=R,W(F._dbInfo);}}).catch(function(R){throw (z(e,R)||h.resolve()).catch(function(){}),R})}}):a=u.then(function(i){T(e);var l=D[e.name],c=l.forages;i.close();for(var d=0;d<c.length;d++){var y=c[d];y._dbInfo.db=null;}var E=new h(function(A,R){var M=P.deleteDatabase(e.name);M.onerror=function(){var F=M.result;F&&F.close(),R(M.error);},M.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed');},M.onsuccess=function(){var F=M.result;F&&F.close(),A(F);};});return E.then(function(A){l.db=A;for(var R=0;R<c.length;R++){var M=c[R];W(M._dbInfo);}}).catch(function(A){throw (z(e,A)||h.resolve()).catch(function(){}),A})});}return w(a,t),a}var Ar={_driver:"asyncStorage",_initStorage:yr,_support:U(),iterate:gr,getItem:xr,setItem:_r,removeItem:br,clear:wr,length:Er,key:Ir,keys:Sr,dropInstance:Tr};function Rr(){return typeof openDatabase=="function"}var X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nr="~~local_forage_type~",Ue=/^~~local_forage_type~([^~]+)~/,ce="__lfsc__:",ge=ce.length,_e="arbf",be="blob",Me="si08",qe="ui08",ze="uic8",Ye="si16",je="si32",ke="ur16",$e="ui32",Ke="fl32",He="fl64",Ve=ge+_e.length,Qe=Object.prototype.toString;function Ge(e){var t=e.length*.75,r=e.length,o,a=0,n,u,i,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),d=new Uint8Array(c);for(o=0;o<r;o+=4)n=X.indexOf(e[o]),u=X.indexOf(e[o+1]),i=X.indexOf(e[o+2]),l=X.indexOf(e[o+3]),d[a++]=n<<2|u>>4,d[a++]=(u&15)<<4|i>>2,d[a++]=(i&3)<<6|l&63;return c}function we(e){var t=new Uint8Array(e),r="",o;for(o=0;o<t.length;o+=3)r+=X[t[o]>>2],r+=X[(t[o]&3)<<4|t[o+1]>>4],r+=X[(t[o+1]&15)<<2|t[o+2]>>6],r+=X[t[o+2]&63];return t.length%3===2?r=r.substring(0,r.length-1)+"=":t.length%3===1&&(r=r.substring(0,r.length-2)+"=="),r}function Dr(e,t){var r="";if(e&&(r=Qe.call(e)),e&&(r==="[object ArrayBuffer]"||e.buffer&&Qe.call(e.buffer)==="[object ArrayBuffer]")){var o,a=ce;e instanceof ArrayBuffer?(o=e,a+=_e):(o=e.buffer,r==="[object Int8Array]"?a+=Me:r==="[object Uint8Array]"?a+=qe:r==="[object Uint8ClampedArray]"?a+=ze:r==="[object Int16Array]"?a+=Ye:r==="[object Uint16Array]"?a+=ke:r==="[object Int32Array]"?a+=je:r==="[object Uint32Array]"?a+=$e:r==="[object Float32Array]"?a+=Ke:r==="[object Float64Array]"?a+=He:t(new Error("Failed to get type for BinaryArray"))),t(a+we(o));}else if(r==="[object Blob]"){var n=new FileReader;n.onload=function(){var u=Nr+e.type+"~"+we(this.result);t(ce+be+u);},n.readAsArrayBuffer(e);}else try{t(JSON.stringify(e));}catch(u){console.error("Couldn't convert value into a JSON string: ",e),t(null,u);}}function Pr(e){if(e.substring(0,ge)!==ce)return JSON.parse(e);var t=e.substring(Ve),r=e.substring(ge,Ve),o;if(r===be&&Ue.test(t)){var a=t.match(Ue);o=a[1],t=t.substring(a[0].length);}var n=Ge(t);switch(r){case _e:return n;case be:return Y([n],{type:o});case Me:return new Int8Array(n);case qe:return new Uint8Array(n);case ze:return new Uint8ClampedArray(n);case Ye:return new Int16Array(n);case ke:return new Uint16Array(n);case je:return new Int32Array(n);case $e:return new Uint32Array(n);case Ke:return new Float32Array(n);case He:return new Float64Array(n);default:throw new Error("Unkown type: "+r)}}var Ee={serialize:Dr,deserialize:Pr,stringToBuffer:Ge,bufferToString:we};function Xe(e,t,r,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,o);}function Cr(e){var t=this,r={db:null};if(e)for(var o in e)r[o]=typeof e[o]!="string"?e[o].toString():e[o];var a=new h(function(n,u){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size);}catch(i){return u(i)}r.db.transaction(function(i){Xe(i,r,function(){t._dbInfo=r,n();},function(l,c){u(c);});},u);});return r.serializer=Ee,a}function J(e,t,r,o,a,n){e.executeSql(r,o,a,function(u,i){i.code===i.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(l,c){c.rows.length?n(l,i):Xe(l,t,function(){l.executeSql(r,o,a,n);},n);},n):n(u,i);},n);}function Br(e,t){var r=this;e=O(e);var o=new h(function(a,n){r.ready().then(function(){var u=r._dbInfo;u.db.transaction(function(i){J(i,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(l,c){var d=c.rows.length?c.rows.item(0).value:null;d&&(d=u.serializer.deserialize(d)),a(d);},function(l,c){n(c);});});}).catch(n);});return w(o,t),o}function Or(e,t){var r=this,o=new h(function(a,n){r.ready().then(function(){var u=r._dbInfo;u.db.transaction(function(i){J(i,u,"SELECT * FROM "+u.storeName,[],function(l,c){for(var d=c.rows,y=d.length,E=0;E<y;E++){var A=d.item(E),R=A.value;if(R&&(R=u.serializer.deserialize(R)),R=e(R,A.key,E+1),R!==void 0){a(R);return}}a();},function(l,c){n(c);});});}).catch(n);});return w(o,t),o}function Je(e,t,r,o){var a=this;e=O(e);var n=new h(function(u,i){a.ready().then(function(){t===void 0&&(t=null);var l=t,c=a._dbInfo;c.serializer.serialize(t,function(d,y){y?i(y):c.db.transaction(function(E){J(E,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,d],function(){u(l);},function(A,R){i(R);});},function(E){if(E.code===E.QUOTA_ERR){if(o>0){u(Je.apply(a,[e,l,r,o-1]));return}i(E);}});});}).catch(i);});return w(n,r),n}function Lr(e,t,r){return Je.apply(this,[e,t,r,1])}function Wr(e,t){var r=this;e=O(e);var o=new h(function(a,n){r.ready().then(function(){var u=r._dbInfo;u.db.transaction(function(i){J(i,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){a();},function(l,c){n(c);});});}).catch(n);});return w(o,t),o}function Fr(e){var t=this,r=new h(function(o,a){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(u){J(u,n,"DELETE FROM "+n.storeName,[],function(){o();},function(i,l){a(l);});});}).catch(a);});return w(r,e),r}function Ur(e){var t=this,r=new h(function(o,a){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(u){J(u,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(i,l){var c=l.rows.item(0).c;o(c);},function(i,l){a(l);});});}).catch(a);});return w(r,e),r}function Mr(e,t){var r=this,o=new h(function(a,n){r.ready().then(function(){var u=r._dbInfo;u.db.transaction(function(i){J(i,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(l,c){var d=c.rows.length?c.rows.item(0).key:null;a(d);},function(l,c){n(c);});});}).catch(n);});return w(o,t),o}function qr(e){var t=this,r=new h(function(o,a){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(u){J(u,n,"SELECT key FROM "+n.storeName,[],function(i,l){for(var c=[],d=0;d<l.rows.length;d++)c.push(l.rows.item(d).key);o(c);},function(i,l){a(l);});});}).catch(a);});return w(r,e),r}function zr(e){return new h(function(t,r){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(a,n){for(var u=[],i=0;i<n.rows.length;i++)u.push(n.rows.item(i).name);t({db:e,storeNames:u});},function(a,n){r(n);});},function(o){r(o);});})}function Yr(e,t){t=k.apply(this,arguments);var r=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var o=this,a;return e.name?a=new h(function(n){var u;e.name===r.name?u=o._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?n({db:u,storeNames:[e.storeName]}):n(zr(u));}).then(function(n){return new h(function(u,i){n.db.transaction(function(l){function c(A){return new h(function(R,M){l.executeSql("DROP TABLE IF EXISTS "+A,[],function(){R();},function(F,K){M(K);});})}for(var d=[],y=0,E=n.storeNames.length;y<E;y++)d.push(c(n.storeNames[y]));h.all(d).then(function(){u();}).catch(function(A){i(A);});},function(l){i(l);});})}):a=h.reject("Invalid arguments"),w(a,t),a}var jr={_driver:"webSQLStorage",_initStorage:Cr,_support:Rr(),iterate:Or,getItem:Br,setItem:Lr,removeItem:Wr,clear:Fr,length:Ur,key:Mr,keys:qr,dropInstance:Yr};function kr(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return false}}function Ze(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function $r(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(t){return true}}function Kr(){return !$r()||localStorage.length>0}function Hr(e){var t=this,r={};if(e)for(var o in e)r[o]=e[o];return r.keyPrefix=Ze(e,t._defaultConfig),Kr()?(t._dbInfo=r,r.serializer=Ee,h.resolve()):h.reject()}function Vr(e){var t=this,r=t.ready().then(function(){for(var o=t._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var n=localStorage.key(a);n.indexOf(o)===0&&localStorage.removeItem(n);}});return w(r,e),r}function Qr(e,t){var r=this;e=O(e);var o=r.ready().then(function(){var a=r._dbInfo,n=localStorage.getItem(a.keyPrefix+e);return n&&(n=a.serializer.deserialize(n)),n});return w(o,t),o}function Gr(e,t){var r=this,o=r.ready().then(function(){for(var a=r._dbInfo,n=a.keyPrefix,u=n.length,i=localStorage.length,l=1,c=0;c<i;c++){var d=localStorage.key(c);if(d.indexOf(n)===0){var y=localStorage.getItem(d);if(y&&(y=a.serializer.deserialize(y)),y=e(y,d.substring(u),l++),y!==void 0)return y}}});return w(o,t),o}function Xr(e,t){var r=this,o=r.ready().then(function(){var a=r._dbInfo,n;try{n=localStorage.key(e);}catch(u){n=null;}return n&&(n=n.substring(a.keyPrefix.length)),n});return w(o,t),o}function Jr(e){var t=this,r=t.ready().then(function(){for(var o=t._dbInfo,a=localStorage.length,n=[],u=0;u<a;u++){var i=localStorage.key(u);i.indexOf(o.keyPrefix)===0&&n.push(i.substring(o.keyPrefix.length));}return n});return w(r,e),r}function Zr(e){var t=this,r=t.keys().then(function(o){return o.length});return w(r,e),r}function et(e,t){var r=this;e=O(e);var o=r.ready().then(function(){var a=r._dbInfo;localStorage.removeItem(a.keyPrefix+e);});return w(o,t),o}function rt(e,t,r){var o=this;e=O(e);var a=o.ready().then(function(){t===void 0&&(t=null);var n=t;return new h(function(u,i){var l=o._dbInfo;l.serializer.serialize(t,function(c,d){if(d)i(d);else try{localStorage.setItem(l.keyPrefix+e,c),u(n);}catch(y){(y.name==="QuotaExceededError"||y.name==="NS_ERROR_DOM_QUOTA_REACHED")&&i(y),i(y);}});})});return w(a,r),a}function tt(e,t){if(t=k.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName;}var o=this,a;return e.name?a=new h(function(n){e.storeName?n(Ze(e,o._defaultConfig)):n(e.name+"/");}).then(function(n){for(var u=localStorage.length-1;u>=0;u--){var i=localStorage.key(u);i.indexOf(n)===0&&localStorage.removeItem(i);}}):a=h.reject("Invalid arguments"),w(a,t),a}var nt={_driver:"localStorageWrapper",_initStorage:Hr,_support:kr(),iterate:Gr,getItem:Qr,setItem:rt,removeItem:et,clear:Vr,length:Zr,key:Xr,keys:Jr,dropInstance:tt},ot=function(t,r){return t===r||typeof t=="number"&&typeof r=="number"&&isNaN(t)&&isNaN(r)},at=function(t,r){for(var o=t.length,a=0;a<o;){if(ot(t[a],r))return true;a++;}return false},er=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ae={},rr={},ne={INDEXEDDB:Ar,WEBSQL:jr,LOCALSTORAGE:nt},ft=[ne.INDEXEDDB._driver,ne.WEBSQL._driver,ne.LOCALSTORAGE._driver],de=["dropInstance"],Ie=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(de),ut={description:"",driver:ft.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function st(e,t){e[t]=function(){var r=arguments;return e.ready().then(function(){return e[t].apply(e,r)})};}function Se(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(er(t[r])?arguments[0][r]=t[r].slice():arguments[0][r]=t[r]);}return arguments[0]}var it=(function(){function e(t){N(this,e);for(var r in ne)if(ne.hasOwnProperty(r)){var o=ne[r],a=o._driver;this[r]=a,ae[a]||this.defineDriver(o);}this._defaultConfig=Se({},ut),this._config=Se({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=false,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){});}return e.prototype.config=function(r){if((typeof r=="undefined"?"undefined":S(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var o in r){if(o==="storeName"&&(r[o]=r[o].replace(/\W/g,"_")),o==="version"&&typeof r[o]!="number")return new Error("Database version must be a number.");this._config[o]=r[o];}return "driver"in r&&r.driver?this.setDriver(this._config.driver):true}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,o,a){var n=new h(function(u,i){try{var l=r._driver,c=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){i(c);return}for(var d=Ie.concat("_initStorage"),y=0,E=d.length;y<E;y++){var A=d[y],R=!at(de,A);if((R||r[A])&&typeof r[A]!="function"){i(c);return}}var M=function(){for(var fe=function(dt){return function(){var pt=new Error("Method "+dt+" is not implemented by the current driver"),tr=h.reject(pt);return w(tr,arguments[arguments.length-1]),tr}},Te=0,ct=de.length;Te<ct;Te++){var Ae=de[Te];r[Ae]||(r[Ae]=fe(Ae));}};M();var F=function(fe){ae[l]&&console.info("Redefining LocalForage driver: "+l),ae[l]=r,rr[l]=fe,u();};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(F,i):F(!!r._support):F(!0);}catch(K){i(K);}});return B(n,o,a),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,o,a){var n=ae[r]?h.resolve(ae[r]):h.reject(new Error("Driver not found."));return B(n,o,a),n},e.prototype.getSerializer=function(r){var o=h.resolve(Ee);return B(o,r),o},e.prototype.ready=function(r){var o=this,a=o._driverSet.then(function(){return o._ready===null&&(o._ready=o._initDriver()),o._ready});return B(a,r,r),a},e.prototype.setDriver=function(r,o,a){var n=this;er(r)||(r=[r]);var u=this._getSupportedDrivers(r);function i(){n._config.driver=n.driver();}function l(y){return n._extend(y),i(),n._ready=n._initStorage(n._config),n._ready}function c(y){return function(){var E=0;function A(){for(;E<y.length;){var R=y[E];return E++,n._dbInfo=null,n._ready=null,n.getDriver(R).then(l).catch(A)}i();var M=new Error("No available storage method found.");return n._driverSet=h.reject(M),n._driverSet}return A()}}var d=this._driverSet!==null?this._driverSet.catch(function(){return h.resolve()}):h.resolve();return this._driverSet=d.then(function(){var y=u[0];return n._dbInfo=null,n._ready=null,n.getDriver(y).then(function(E){n._driver=E._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=c(u);})}).catch(function(){i();var y=new Error("No available storage method found.");return n._driverSet=h.reject(y),n._driverSet}),B(this._driverSet,o,a),this._driverSet},e.prototype.supports=function(r){return !!rr[r]},e.prototype._extend=function(r){Se(this,r);},e.prototype._getSupportedDrivers=function(r){for(var o=[],a=0,n=r.length;a<n;a++){var u=r[a];this.supports(u)&&o.push(u);}return o},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,o=Ie.length;r<o;r++)st(this,Ie[r]);},e.prototype.createInstance=function(r){return new e(r)},e})(),lt=new it;g.exports=lt;},{3:3}]},{},[4])(4)});});var me=class{constructor(f=1){this.buffer=[];this.subscriptions=[];this.maxBufferSize=f;}subscribe(f){return this.subscriptions.push(f),this.buffer.forEach(m=>f(m)),()=>this.unsubscribe(f)}unsubscribe(f){this.subscriptions=this.subscriptions.filter(m=>m!==f);}next(f){this.subscriptions.forEach(m=>m(f)),this.buffer.push(f),this.buffer.length>this.maxBufferSize&&(this.buffer=this.buffer.slice(1));}};var Le=bt(ur());function G(s){return s!=null&&typeof s=="object"&&s["@@functional/placeholder"]===true}function H(s){return function f(m){return arguments.length===0||G(m)?f:s.apply(this,arguments)}}function De(s){return function f(m,_){switch(arguments.length){case 0:return f;case 1:return G(m)?f:H(function(g){return s(m,g)});default:return G(m)&&G(_)?f:G(m)?H(function(g){return s(g,_)}):G(_)?H(function(g){return s(m,g)}):s(m,_)}}}function he(s){for(var f=[],m;!(m=s.next()).done;)f.push(m.value);return f}function ve(s,f,m){for(var _=0,g=m.length;_<g;){if(s(f,m[_]))return true;_+=1;}return false}function Pe(s){var f=String(s).match(/^function (\w*)/);return f==null?"":f[1]}function ee(s,f){return Object.prototype.hasOwnProperty.call(f,s)}function wt(s,f){return s===f?s!==0||1/s===1/f:s!==s&&f!==f}var ye=typeof Object.is=="function"?Object.is:wt;var sr=Object.prototype.toString,Et=(function(){return sr.call(arguments)==="[object Arguments]"?function(f){return sr.call(f)==="[object Arguments]"}:function(f){return ee("callee",f)}})(),ir=Et;var It=!{toString:null}.propertyIsEnumerable("toString"),lr=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],cr=(function(){return arguments.propertyIsEnumerable("length")})(),St=function(f,m){for(var _=0;_<f.length;){if(f[_]===m)return true;_+=1;}return false},Tt=typeof Object.keys=="function"&&!cr?H(function(f){return Object(f)!==f?[]:Object.keys(f)}):H(function(f){if(Object(f)!==f)return [];var m,_,g=[],C=cr&&ir(f);for(m in f)ee(m,f)&&(!C||m!=="length")&&(g[g.length]=m);if(It)for(_=lr.length-1;_>=0;)m=lr[_],ee(m,f)&&!St(g,m)&&(g[g.length]=m),_-=1;return g}),Ce=Tt;var At=H(function(f){return f===null?"Null":f===void 0?"Undefined":Object.prototype.toString.call(f).slice(8,-1)}),Be=At;function dr(s,f,m,_){var g=he(s),C=he(f);function S(N,b){return se(N,b,m.slice(),_.slice())}return !ve(function(N,b){return !ve(S,b,N)},C,g)}function se(s,f,m,_){if(ye(s,f))return true;var g=Be(s);if(g!==Be(f))return false;if(typeof s["fantasy-land/equals"]=="function"||typeof f["fantasy-land/equals"]=="function")return typeof s["fantasy-land/equals"]=="function"&&s["fantasy-land/equals"](f)&&typeof f["fantasy-land/equals"]=="function"&&f["fantasy-land/equals"](s);if(typeof s.equals=="function"||typeof f.equals=="function")return typeof s.equals=="function"&&s.equals(f)&&typeof f.equals=="function"&&f.equals(s);switch(g){case "Arguments":case "Array":case "Object":if(typeof s.constructor=="function"&&Pe(s.constructor)==="Promise")return s===f;break;case "Boolean":case "Number":case "String":if(!(typeof s==typeof f&&ye(s.valueOf(),f.valueOf())))return false;break;case "Date":if(!ye(s.valueOf(),f.valueOf()))return false;break;case "Error":return s.name===f.name&&s.message===f.message;case "RegExp":if(!(s.source===f.source&&s.global===f.global&&s.ignoreCase===f.ignoreCase&&s.multiline===f.multiline&&s.sticky===f.sticky&&s.unicode===f.unicode))return false;break}for(var C=m.length-1;C>=0;){if(m[C]===s)return _[C]===f;C-=1;}switch(g){case "Map":return s.size!==f.size?false:dr(s.entries(),f.entries(),m.concat([s]),_.concat([f]));case "Set":return s.size!==f.size?false:dr(s.values(),f.values(),m.concat([s]),_.concat([f]));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 false}var S=Ce(s);if(S.length!==Ce(f).length)return false;var N=m.concat([s]),b=_.concat([f]);for(C=S.length-1;C>=0;){var P=S[C];if(!(ee(P,f)&&se(f[P],s[P],N,b)))return false;C-=1;}return true}var Rt=De(function(f,m){return se(f,m,[],[])}),Oe=Rt;function pr(s,f=0){return Z(this,null,function*(){let m=(f||0)+1;for(let _=0;_<m;_++)try{return yield s()}catch(g){if(_===m-1)throw g}throw new Error("fnRunner: Unexpected error - all retries exhausted.")})}var mr="sh-cache-common",ie=Le.default.createInstance({name:mr,storeName:"main-store"});function Nt(s,f,m){let{deps:_,retry:g,maxAge:C,version:S,compareBeforeUpdate:N,remoteMemoryCache:b,equals:P,cacheEnabled:U,beforeRequest:Y,onSuccess:h,onError:w,errorHandler:B}=pe({deps:[],retry:0,equals:(v,x)=>v.length===x.length&&v.every((T,W)=>T===x[W]),compareBeforeUpdate:Oe,remoteMemoryCache:false},m),O=new me(1),k=()=>_.map(v=>typeof v=="function"?v():v),L=(v,x)=>(T=>{let W=v(T);return W.then(z=>{var j;let q={type:x.type,result:z};return (j=x.onSuccess)==null||j.call(x,q),q},x.onError).catch(()=>{}),W}),$=v=>Z(null,null,function*(){let x=yield ie.getItem(s);if(x&&(!S||x.version===S)&&(!x.expires||x.expires>Date.now())&&P(x.deps,v.concat(k())))return x.result;throw new Error("Cache not found")}),D={success:false,args:[],result:null},re=()=>{D.success=false,D.result=null,D.args=[];},V=v=>{if(D.success&&P(D.args,v))return {type:"memory",promiseResult:D.result};D.args=v,D.success=true;let x=D.result=pr(()=>f(...v),g);return Promise.resolve(x).then(T=>(!b&&re(),T)).catch(re),{type:"remote",promiseResult:x}},p=L(v=>Z(null,null,function*(){let x={type:"remote",result:null};try{let{type:T,promiseResult:W}=V(v),z=x.result=yield W;T==="remote"&&(!U||(yield U(v)))&&Promise.resolve().then(()=>Z(null,null,function*(){let q=yield $(v).catch(()=>null),j=pe(pe({deps:v.concat(k()),result:z},S&&{version:S}),C&&{expires:Date.now()+C});ie.setItem(s,j),!(N&&q&&N(q,z))&&O.next({result:z,cacheData:j,isCacheHit:!!q});}));}catch(T){if(B)x.result=yield B(T);else throw T}return x.result}),{type:"remote",onSuccess:h,onError:w}),I=(...v)=>Z(null,null,function*(){yield Y==null?void 0:Y();let[x,T]=[L($,{type:"local",onSuccess:h})(v),p(v)];return yield Promise.race([x.catch(()=>T),T])});return I.refresh=(...v)=>p(v),I.subscribeCacheUpdate=v=>O.subscribe(v),I.clearCache=()=>Z(null,null,function*(){re(),yield ie.removeItem(s);}),I}Nt.useDb=s=>{typeof s=="string"?ie=Le.default.createInstance({name:mr,storeName:s}):ie=s;};/*! Bundled license information:
|
|
1
|
+
var ShihengUtils=(function(exports){'use strict';var Yn=Object.create;var Pt=Object.defineProperty,qn=Object.defineProperties,Vn=Object.getOwnPropertyDescriptor,Hn=Object.getOwnPropertyDescriptors,Kn=Object.getOwnPropertyNames,Mr=Object.getOwnPropertySymbols,Qn=Object.getPrototypeOf,Dt=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable;var on=(n,o,p)=>o in n?Pt(n,o,{enumerable:true,configurable:true,writable:true,value:p}):n[o]=p,Pe=(n,o)=>{for(var p in o||(o={}))Dt.call(o,p)&&on(n,p,o[p]);if(Mr)for(var p of Mr(o))an.call(o,p)&&on(n,p,o[p]);return n},$r=(n,o)=>qn(n,Hn(o));var pr=(n=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(n,{get:(o,p)=>(typeof require!="undefined"?require:o)[p]}):n)(function(n){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var un=(n,o)=>{var p={};for(var y in n)Dt.call(n,y)&&o.indexOf(y)<0&&(p[y]=n[y]);if(n!=null&&Mr)for(var y of Mr(n))o.indexOf(y)<0&&an.call(n,y)&&(p[y]=n[y]);return p};var zr=(n,o)=>()=>(o||n((o={exports:{}}).exports,o),o.exports);var Gn=(n,o,p,y)=>{if(o&&typeof o=="object"||typeof o=="function")for(let b of Kn(o))!Dt.call(n,b)&&b!==p&&Pt(n,b,{get:()=>o[b],enumerable:!(y=Vn(o,b))||y.enumerable});return n};var Nt=(n,o,p)=>(p=n!=null?Yn(Qn(n)):{},Gn(!n||!n.__esModule?Pt(p,"default",{value:n,enumerable:true}):p,n));var Se=(n,o,p)=>new Promise((y,b)=>{var I=w=>{try{C(p.next(w));}catch(D){b(D);}},T=w=>{try{C(p.throw(w));}catch(D){b(D);}},C=w=>w.done?y(w.value):Promise.resolve(w.value).then(I,T);C((p=p.apply(n,o)).next());});var xn=zr($=>{var mr=Symbol.for("react.element"),Xn=Symbol.for("react.portal"),Jn=Symbol.for("react.fragment"),Zn=Symbol.for("react.strict_mode"),eo=Symbol.for("react.profiler"),ro=Symbol.for("react.provider"),to=Symbol.for("react.context"),no=Symbol.for("react.forward_ref"),oo=Symbol.for("react.suspense"),ao=Symbol.for("react.memo"),uo=Symbol.for("react.lazy"),sn=Symbol.iterator;function io(n){return n===null||typeof n!="object"?null:(n=sn&&n[sn]||n["@@iterator"],typeof n=="function"?n:null)}var ln={isMounted:function(){return false},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dn=Object.assign,pn={};function Xe(n,o,p){this.props=n,this.context=o,this.refs=pn,this.updater=p||ln;}Xe.prototype.isReactComponent={};Xe.prototype.setState=function(n,o){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,o,"setState");};Xe.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate");};function mn(){}mn.prototype=Xe.prototype;function Lt(n,o,p){this.props=n,this.context=o,this.refs=pn,this.updater=p||ln;}var Bt=Lt.prototype=new mn;Bt.constructor=Lt;dn(Bt,Xe.prototype);Bt.isPureReactComponent=true;var fn=Array.isArray,vn=Object.prototype.hasOwnProperty,Ft={current:null},hn={key:true,ref:true,__self:true,__source:true};function yn(n,o,p){var y,b={},I=null,T=null;if(o!=null)for(y in o.ref!==void 0&&(T=o.ref),o.key!==void 0&&(I=""+o.key),o)vn.call(o,y)&&!hn.hasOwnProperty(y)&&(b[y]=o[y]);var C=arguments.length-2;if(C===1)b.children=p;else if(1<C){for(var w=Array(C),D=0;D<C;D++)w[D]=arguments[D+2];b.children=w;}if(n&&n.defaultProps)for(y in C=n.defaultProps,C)b[y]===void 0&&(b[y]=C[y]);return {$$typeof:mr,type:n,key:I,ref:T,props:b,_owner:Ft.current}}function so(n,o){return {$$typeof:mr,type:n.type,key:o,ref:n.ref,props:n.props,_owner:n._owner}}function jt(n){return typeof n=="object"&&n!==null&&n.$$typeof===mr}function fo(n){var o={"=":"=0",":":"=2"};return "$"+n.replace(/[=:]/g,function(p){return o[p]})}var cn=/\/+/g;function kt(n,o){return typeof n=="object"&&n!==null&&n.key!=null?fo(""+n.key):o.toString(36)}function Vr(n,o,p,y,b){var I=typeof n;(I==="undefined"||I==="boolean")&&(n=null);var T=false;if(n===null)T=true;else switch(I){case "string":case "number":T=true;break;case "object":switch(n.$$typeof){case mr:case Xn:T=true;}}if(T)return T=n,b=b(T),n=y===""?"."+kt(T,0):y,fn(b)?(p="",n!=null&&(p=n.replace(cn,"$&/")+"/"),Vr(b,o,p,"",function(D){return D})):b!=null&&(jt(b)&&(b=so(b,p+(!b.key||T&&T.key===b.key?"":(""+b.key).replace(cn,"$&/")+"/")+n)),o.push(b)),1;if(T=0,y=y===""?".":y+":",fn(n))for(var C=0;C<n.length;C++){I=n[C];var w=y+kt(I,C);T+=Vr(I,o,p,w,b);}else if(w=io(n),typeof w=="function")for(n=w.call(n),C=0;!(I=n.next()).done;)I=I.value,w=y+kt(I,C++),T+=Vr(I,o,p,w,b);else if(I==="object")throw o=String(n),Error("Objects are not valid as a React child (found: "+(o==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.");return T}function qr(n,o,p){if(n==null)return n;var y=[],b=0;return Vr(n,y,"","",function(I){return o.call(p,I,b++)}),y}function co(n){if(n._status===-1){var o=n._result;o=o(),o.then(function(p){(n._status===0||n._status===-1)&&(n._status=1,n._result=p);},function(p){(n._status===0||n._status===-1)&&(n._status=2,n._result=p);}),n._status===-1&&(n._status=0,n._result=o);}if(n._status===1)return n._result.default;throw n._result}var he={current:null},Hr={transition:null},lo={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:Hr,ReactCurrentOwner:Ft};function gn(){throw Error("act(...) is not supported in production builds of React.")}$.Children={map:qr,forEach:function(n,o,p){qr(n,function(){o.apply(this,arguments);},p);},count:function(n){var o=0;return qr(n,function(){o++;}),o},toArray:function(n){return qr(n,function(o){return o})||[]},only:function(n){if(!jt(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};$.Component=Xe;$.Fragment=Jn;$.Profiler=eo;$.PureComponent=Lt;$.StrictMode=Zn;$.Suspense=oo;$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lo;$.act=gn;$.cloneElement=function(n,o,p){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var y=dn({},n.props),b=n.key,I=n.ref,T=n._owner;if(o!=null){if(o.ref!==void 0&&(I=o.ref,T=Ft.current),o.key!==void 0&&(b=""+o.key),n.type&&n.type.defaultProps)var C=n.type.defaultProps;for(w in o)vn.call(o,w)&&!hn.hasOwnProperty(w)&&(y[w]=o[w]===void 0&&C!==void 0?C[w]:o[w]);}var w=arguments.length-2;if(w===1)y.children=p;else if(1<w){C=Array(w);for(var D=0;D<w;D++)C[D]=arguments[D+2];y.children=C;}return {$$typeof:mr,type:n.type,key:b,ref:I,props:y,_owner:T}};$.createContext=function(n){return n={$$typeof:to,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:ro,_context:n},n.Consumer=n};$.createElement=yn;$.createFactory=function(n){var o=yn.bind(null,n);return o.type=n,o};$.createRef=function(){return {current:null}};$.forwardRef=function(n){return {$$typeof:no,render:n}};$.isValidElement=jt;$.lazy=function(n){return {$$typeof:uo,_payload:{_status:-1,_result:n},_init:co}};$.memo=function(n,o){return {$$typeof:ao,type:n,compare:o===void 0?null:o}};$.startTransition=function(n){var o=Hr.transition;Hr.transition={};try{n();}finally{Hr.transition=o;}};$.unstable_act=gn;$.useCallback=function(n,o){return he.current.useCallback(n,o)};$.useContext=function(n){return he.current.useContext(n)};$.useDebugValue=function(){};$.useDeferredValue=function(n){return he.current.useDeferredValue(n)};$.useEffect=function(n,o){return he.current.useEffect(n,o)};$.useId=function(){return he.current.useId()};$.useImperativeHandle=function(n,o,p){return he.current.useImperativeHandle(n,o,p)};$.useInsertionEffect=function(n,o){return he.current.useInsertionEffect(n,o)};$.useLayoutEffect=function(n,o){return he.current.useLayoutEffect(n,o)};$.useMemo=function(n,o){return he.current.useMemo(n,o)};$.useReducer=function(n,o,p){return he.current.useReducer(n,o,p)};$.useRef=function(n){return he.current.useRef(n)};$.useState=function(n){return he.current.useState(n)};$.useSyncExternalStore=function(n,o,p){return he.current.useSyncExternalStore(n,o,p)};$.useTransition=function(){return he.current.useTransition()};$.version="18.3.1";});var _n=zr((z,Kr)=>{process.env.NODE_ENV!=="production"&&(function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.3.1",o=Symbol.for("react.element"),p=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),C=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),K=Symbol.iterator,j="@@iterator";function oe(e){if(e===null||typeof e!="object")return null;var a=K&&e[K]||e[j];return typeof a=="function"?a:null}var J={current:null},Z={transition:null},N={current:null,isBatchingLegacy:false,didScheduleLegacyUpdate:false},se={current:null},G={},_=null;function W(e){_=e;}G.setExtraStackFrame=function(e){_=e;},G.getCurrentStack=null,G.getStackAddendum=function(){var e="";_&&(e+=_);var a=G.getCurrentStack;return a&&(e+=a()||""),e};var L=false,U=false,B=false,M=false,Q=false,te={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:Z,ReactCurrentOwner:se};te.ReactDebugCurrentFrame=G,te.ReactCurrentActQueue=N;function V(e){{for(var a=arguments.length,c=new Array(a>1?a-1:0),l=1;l<a;l++)c[l-1]=arguments[l];me("warn",e,c);}}function O(e){{for(var a=arguments.length,c=new Array(a>1?a-1:0),l=1;l<a;l++)c[l-1]=arguments[l];me("error",e,c);}}function me(e,a,c){{var l=te.ReactDebugCurrentFrame,x=l.getStackAddendum();x!==""&&(a+="%s",c=c.concat([x]));var A=c.map(function(S){return String(S)});A.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,A);}}var ge={};function ye(e,a){{var c=e.constructor,l=c&&(c.displayName||c.name)||"ReactClass",x=l+"."+a;if(ge[x])return;O("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",a,l),ge[x]=true;}}var Oe={isMounted:function(e){return false},enqueueForceUpdate:function(e,a,c){ye(e,"forceUpdate");},enqueueReplaceState:function(e,a,c,l){ye(e,"replaceState");},enqueueSetState:function(e,a,c,l){ye(e,"setState");}},be=Object.assign,Je={};Object.freeze(Je);function le(e,a,c){this.props=e,this.context=a,this.refs=Je,this.updater=c||Oe;}le.prototype.isReactComponent={},le.prototype.setState=function(e,a){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,a,"setState");},le.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate");};{var je={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},Zr=function(e,a){Object.defineProperty(le.prototype,e,{get:function(){V("%s(...) is deprecated in plain JavaScript React classes. %s",a[0],a[1]);}});};for(var Ze in je)je.hasOwnProperty(Ze)&&Zr(Ze,je[Ze]);}function hr(){}hr.prototype=le.prototype;function er(e,a,c){this.props=e,this.context=a,this.refs=Je,this.updater=c||Oe;}var rr=er.prototype=new hr;rr.constructor=er,be(rr,le.prototype),rr.isPureReactComponent=true;function et(){var e={current:null};return Object.seal(e),e}var rt=Array.isArray;function We(e){return rt(e)}function tt(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,c=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c}}function nt(e){try{return yr(e),!1}catch(a){return true}}function yr(e){return ""+e}function Ue(e){if(nt(e))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",tt(e)),yr(e)}function we(e,a,c){var l=e.displayName;if(l)return l;var x=a.displayName||a.name||"";return x!==""?c+"("+x+")":c}function gr(e){return e.displayName||"Context"}function Ee(e){if(e==null)return null;if(typeof e.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return "Fragment";case p:return "Portal";case I:return "Profiler";case b:return "StrictMode";case D:return "Suspense";case X:return "SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case C:var a=e;return gr(a)+".Consumer";case T:var c=e;return gr(c._context)+".Provider";case w:return we(e,e.render,"ForwardRef");case re:var l=e.displayName||null;return l!==null?l:Ee(e.type)||"Memo";case E:{var x=e,A=x._payload,S=x._init;try{return Ee(S(A))}catch(k){return null}}}return null}var Re=Object.prototype.hasOwnProperty,Me={key:true,ref:true,__self:true,__source:true},$e,ze,Ye;Ye={};function tr(e){if(Re.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return false}return e.ref!==void 0}function nr(e){if(Re.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return false}return e.key!==void 0}function xr(e,a){var c=function(){$e||($e=true,O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a));};c.isReactWarning=true,Object.defineProperty(e,"key",{get:c,configurable:true});}function _r(e,a){var c=function(){ze||(ze=true,O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a));};c.isReactWarning=true,Object.defineProperty(e,"ref",{get:c,configurable:true});}function br(e){if(typeof e.ref=="string"&&se.current&&e.__self&&se.current.stateNode!==e.__self){var a=Ee(se.current.type);Ye[a]||(O('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',a,e.ref),Ye[a]=true);}}var qe=function(e,a,c,l,x,A,S){var k={$$typeof:o,type:e,key:a,ref:c,props:S,_owner:A};return k._store={},Object.defineProperty(k._store,"validated",{configurable:false,enumerable:false,writable:true,value:false}),Object.defineProperty(k,"_self",{configurable:false,enumerable:false,writable:false,value:l}),Object.defineProperty(k,"_source",{configurable:false,enumerable:false,writable:false,value:x}),Object.freeze&&(Object.freeze(k.props),Object.freeze(k)),k};function Er(e,a,c){var l,x={},A=null,S=null,k=null,q=null;if(a!=null){tr(a)&&(S=a.ref,br(a)),nr(a)&&(Ue(a.key),A=""+a.key),k=a.__self===void 0?null:a.__self,q=a.__source===void 0?null:a.__source;for(l in a)Re.call(a,l)&&!Me.hasOwnProperty(l)&&(x[l]=a[l]);}var ne=arguments.length-2;if(ne===1)x.children=c;else if(ne>1){for(var ae=Array(ne),ue=0;ue<ne;ue++)ae[ue]=arguments[ue+2];Object.freeze&&Object.freeze(ae),x.children=ae;}if(e&&e.defaultProps){var ie=e.defaultProps;for(l in ie)x[l]===void 0&&(x[l]=ie[l]);}if(A||S){var ce=typeof e=="function"?e.displayName||e.name||"Unknown":e;A&&xr(x,ce),S&&_r(x,ce);}return qe(e,A,S,k,q,se.current,x)}function wr(e,a){var c=qe(e.type,a,e.ref,e._self,e._source,e._owner,e.props);return c}function Rr(e,a,c){if(e==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var l,x=be({},e.props),A=e.key,S=e.ref,k=e._self,q=e._source,ne=e._owner;if(a!=null){tr(a)&&(S=a.ref,ne=se.current),nr(a)&&(Ue(a.key),A=""+a.key);var ae;e.type&&e.type.defaultProps&&(ae=e.type.defaultProps);for(l in a)Re.call(a,l)&&!Me.hasOwnProperty(l)&&(a[l]===void 0&&ae!==void 0?x[l]=ae[l]:x[l]=a[l]);}var ue=arguments.length-2;if(ue===1)x.children=c;else if(ue>1){for(var ie=Array(ue),ce=0;ce<ue;ce++)ie[ce]=arguments[ce+2];x.children=ie;}return qe(e.type,A,S,k,q,ne,x)}function Ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}var or=".",ar=":";function ot(e){var a=/[=:]/g,c={"=":"=0",":":"=2"},l=e.replace(a,function(x){return c[x]});return "$"+l}var Sr=false,ur=/\/+/g;function ir(e){return e.replace(ur,"$&/")}function sr(e,a){return typeof e=="object"&&e!==null&&e.key!=null?(Ue(e.key),ot(""+e.key)):a.toString(36)}function xe(e,a,c,l,x){var A=typeof e;(A==="undefined"||A==="boolean")&&(e=null);var S=false;if(e===null)S=true;else switch(A){case "string":case "number":S=true;break;case "object":switch(e.$$typeof){case o:case p:S=true;}}if(S){var k=e,q=x(k),ne=l===""?or+sr(k,0):l;if(We(q)){var ae="";ne!=null&&(ae=ir(ne)+"/"),xe(q,a,ae,"",function(zn){return zn});}else q!=null&&(Ce(q)&&(q.key&&(!k||k.key!==q.key)&&Ue(q.key),q=wr(q,c+(q.key&&(!k||k.key!==q.key)?ir(""+q.key)+"/":"")+ne)),a.push(q));return 1}var ue,ie,ce=0,pe=l===""?or:l+ar;if(We(e))for(var Ur=0;Ur<e.length;Ur++)ue=e[Ur],ie=pe+sr(ue,Ur),ce+=xe(ue,a,c,ie,x);else {var At=oe(e);if(typeof At=="function"){var rn=e;At===rn.entries&&(Sr||V("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Sr=true);for(var Mn=At.call(rn),tn,$n=0;!(tn=Mn.next()).done;)ue=tn.value,ie=pe+sr(ue,$n++),ce+=xe(ue,a,c,ie,x);}else if(A==="object"){var nn=String(e);throw new Error("Objects are not valid as a React child (found: "+(nn==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":nn)+"). If you meant to render a collection of children, use an array instead.")}}return ce}function Ve(e,a,c){if(e==null)return e;var l=[],x=0;return xe(e,l,"","",function(A){return a.call(c,A,x++)}),l}function at(e){var a=0;return Ve(e,function(){a++;}),a}function Tr(e,a,c){Ve(e,function(){a.apply(this,arguments);},c);}function ut(e){return Ve(e,function(a){return a})||[]}function it(e){if(!Ce(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}function st(e){var a={$$typeof:C,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:T,_context:a};var c=false,l=false,x=false;{var A={$$typeof:C,_context:a};Object.defineProperties(A,{Provider:{get:function(){return l||(l=true,O("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),a.Provider},set:function(S){a.Provider=S;}},_currentValue:{get:function(){return a._currentValue},set:function(S){a._currentValue=S;}},_currentValue2:{get:function(){return a._currentValue2},set:function(S){a._currentValue2=S;}},_threadCount:{get:function(){return a._threadCount},set:function(S){a._threadCount=S;}},Consumer:{get:function(){return c||(c=true,O("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),a.Consumer}},displayName:{get:function(){return a.displayName},set:function(S){x||(V("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",S),x=true);}}}),a.Consumer=A;}return a._currentRenderer=null,a._currentRenderer2=null,a}var ke=-1,fr=0,Cr=1,ft=2;function ct(e){if(e._status===ke){var a=e._result,c=a();if(c.then(function(A){if(e._status===fr||e._status===ke){var S=e;S._status=Cr,S._result=A;}},function(A){if(e._status===fr||e._status===ke){var S=e;S._status=ft,S._result=A;}}),e._status===ke){var l=e;l._status=fr,l._result=c;}}if(e._status===Cr){var x=e._result;return x===void 0&&O(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
|
+
|
|
3
|
+
Your code should look like:
|
|
4
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
5
|
+
|
|
6
|
+
Did you accidentally put curly braces around the import?`,x),"default"in x||O(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
|
+
|
|
8
|
+
Your code should look like:
|
|
9
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,x),x.default}else throw e._result}function lt(e){var a={_status:ke,_result:e},c={$$typeof:E,_payload:a,_init:ct};{var l,x;Object.defineProperties(c,{defaultProps:{configurable:true,get:function(){return l},set:function(A){O("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),l=A,Object.defineProperty(c,"defaultProps",{enumerable:true});}},propTypes:{configurable:true,get:function(){return x},set:function(A){O("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),x=A,Object.defineProperty(c,"propTypes",{enumerable:true});}}});}return c}function dt(e){e!=null&&e.$$typeof===re?O("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof e!="function"?O("forwardRef requires a render function but was given %s.",e===null?"null":typeof e):e.length!==0&&e.length!==2&&O("forwardRef render functions accept exactly two parameters: props and ref. %s",e.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),e!=null&&(e.defaultProps!=null||e.propTypes!=null)&&O("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var a={$$typeof:w,render:e};{var c;Object.defineProperty(a,"displayName",{enumerable:false,configurable:true,get:function(){return c},set:function(l){c=l,!e.name&&!e.displayName&&(e.displayName=l);}});}return a}var cr;cr=Symbol.for("react.module.reference");function Ir(e){return !!(typeof e=="string"||typeof e=="function"||e===y||e===I||Q||e===b||e===D||e===X||M||e===P||L||U||B||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===re||e.$$typeof===T||e.$$typeof===C||e.$$typeof===w||e.$$typeof===cr||e.getModuleId!==void 0))}function pt(e,a){Ir(e)||O("memo: The first argument must be a component. Instead received: %s",e===null?"null":typeof e);var c={$$typeof:re,type:e,compare:a===void 0?null:a};{var l;Object.defineProperty(c,"displayName",{enumerable:false,configurable:true,get:function(){return l},set:function(x){l=x,!e.name&&!e.displayName&&(e.displayName=x);}});}return c}function de(){var e=J.current;return e===null&&O(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
|
+
2. You might be breaking the Rules of Hooks
|
|
12
|
+
3. You might have more than one copy of React in the same app
|
|
13
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function mt(e){var a=de();if(e._context!==void 0){var c=e._context;c.Consumer===e?O("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):c.Provider===e&&O("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");}return a.useContext(e)}function vt(e){var a=de();return a.useState(e)}function ht(e,a,c){var l=de();return l.useReducer(e,a,c)}function yt(e){var a=de();return a.useRef(e)}function gt(e,a){var c=de();return c.useEffect(e,a)}function xt(e,a){var c=de();return c.useInsertionEffect(e,a)}function _t(e,a){var c=de();return c.useLayoutEffect(e,a)}function bt(e,a){var c=de();return c.useCallback(e,a)}function Et(e,a){var c=de();return c.useMemo(e,a)}function wt(e,a,c){var l=de();return l.useImperativeHandle(e,a,c)}function Rt(e,a){{var c=de();return c.useDebugValue(e,a)}}function St(){var e=de();return e.useTransition()}function Or(e){var a=de();return a.useDeferredValue(e)}function Le(){var e=de();return e.useId()}function Ar(e,a,c){var l=de();return l.useSyncExternalStore(e,a,c)}var _e=0,Pr,Be,He,Dr,Nr,Ke,kr;function Lr(){}Lr.__reactDisabledLog=true;function r(){{if(_e===0){Pr=console.log,Be=console.info,He=console.warn,Dr=console.error,Nr=console.group,Ke=console.groupCollapsed,kr=console.groupEnd;var e={configurable:true,enumerable:true,value:Lr,writable:true};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e});}_e++;}}function u(){{if(_e--,_e===0){var e={configurable:true,enumerable:true,writable:true};Object.defineProperties(console,{log:be({},e,{value:Pr}),info:be({},e,{value:Be}),warn:be({},e,{value:He}),error:be({},e,{value:Dr}),group:be({},e,{value:Nr}),groupCollapsed:be({},e,{value:Ke}),groupEnd:be({},e,{value:kr})});}_e<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.");}}var t=te.ReactCurrentDispatcher,s;function f(e,a,c){{if(s===void 0)try{throw Error()}catch(x){var l=x.stack.trim().match(/\n( *(at )?)/);s=l&&l[1]||"";}return `
|
|
14
|
+
`+s+e}}var i=false,d;{var m=typeof WeakMap=="function"?WeakMap:Map;d=new m;}function v(e,a){if(!e||i)return "";{var c=d.get(e);if(c!==void 0)return c}var l;i=true;var x=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var A;A=t.current,t.current=null,r();try{if(a){var S=function(){throw Error()};if(Object.defineProperty(S.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(S,[]);}catch(pe){l=pe;}Reflect.construct(e,[],S);}else {try{S.call();}catch(pe){l=pe;}e.call(S.prototype);}}else {try{throw Error()}catch(pe){l=pe;}e();}}catch(pe){if(pe&&l&&typeof pe.stack=="string"){for(var k=pe.stack.split(`
|
|
15
|
+
`),q=l.stack.split(`
|
|
16
|
+
`),ne=k.length-1,ae=q.length-1;ne>=1&&ae>=0&&k[ne]!==q[ae];)ae--;for(;ne>=1&&ae>=0;ne--,ae--)if(k[ne]!==q[ae]){if(ne!==1||ae!==1)do if(ne--,ae--,ae<0||k[ne]!==q[ae]){var ue=`
|
|
17
|
+
`+k[ne].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),typeof e=="function"&&d.set(e,ue),ue}while(ne>=1&&ae>=0);break}}}finally{i=false,t.current=A,u(),Error.prepareStackTrace=x;}var ie=e?e.displayName||e.name:"",ce=ie?f(ie):"";return typeof e=="function"&&d.set(e,ce),ce}function h(e,a,c){return v(e,false)}function g(e){var a=e.prototype;return !!(a&&a.isReactComponent)}function R(e,a,c){if(e==null)return "";if(typeof e=="function")return v(e,g(e));if(typeof e=="string")return f(e);switch(e){case D:return f("Suspense");case X:return f("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case w:return h(e.render);case re:return R(e.type,a,c);case E:{var l=e,x=l._payload,A=l._init;try{return R(A(x),a,c)}catch(S){}}}return ""}var F={},H=te.ReactDebugCurrentFrame;function Y(e){if(e){var a=e._owner,c=R(e.type,e._source,a?a.type:null);H.setExtraStackFrame(c);}else H.setExtraStackFrame(null);}function fe(e,a,c,l,x){{var A=Function.call.bind(Re);for(var S in e)if(A(e,S)){var k=void 0;try{if(typeof e[S]!="function"){var q=Error((l||"React class")+": "+c+" type `"+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[S]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw q.name="Invariant Violation",q}k=e[S](a,S,l,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");}catch(ne){k=ne;}k&&!(k instanceof Error)&&(Y(x),O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",c,S,typeof k),Y(null)),k instanceof Error&&!(k.message in F)&&(F[k.message]=true,Y(x),O("Failed %s type: %s",c,k.message),Y(null));}}}function ee(e){if(e){var a=e._owner,c=R(e.type,e._source,a?a.type:null);W(c);}else W(null);}var ve;ve=false;function Ae(){if(se.current){var e=Ee(se.current.type);if(e)return `
|
|
18
|
+
|
|
19
|
+
Check the render method of \``+e+"`."}return ""}function lr(e){if(e!==void 0){var a=e.fileName.replace(/^.*[\\\/]/,""),c=e.lineNumber;return `
|
|
20
|
+
|
|
21
|
+
Check your code at `+a+":"+c+"."}return ""}function Tt(e){return e!=null?lr(e.__source):""}var Qe={};function Qt(e){var a=Ae();if(!a){var c=typeof e=="string"?e:e.displayName||e.name;c&&(a=`
|
|
22
|
+
|
|
23
|
+
Check the top-level render call using <`+c+">.");}return a}function Br(e,a){if(!(!e._store||e._store.validated||e.key!=null)){e._store.validated=true;var c=Qt(a);if(!Qe[c]){Qe[c]=true;var l="";e&&e._owner&&e._owner!==se.current&&(l=" It was passed a child from "+Ee(e._owner.type)+"."),ee(e),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',c,l),ee(null);}}}function Fr(e,a){if(typeof e=="object"){if(We(e))for(var c=0;c<e.length;c++){var l=e[c];Ce(l)&&Br(l,a);}else if(Ce(e))e._store&&(e._store.validated=true);else if(e){var x=oe(e);if(typeof x=="function"&&x!==e.entries)for(var A=x.call(e),S;!(S=A.next()).done;)Ce(S.value)&&Br(S.value,a);}}}function dr(e){{var a=e.type;if(a==null||typeof a=="string")return;var c;if(typeof a=="function")c=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===w||a.$$typeof===re))c=a.propTypes;else return;if(c){var l=Ee(a);fe(c,e.props,"prop",l,e);}else if(a.PropTypes!==void 0&&!ve){ve=true;var x=Ee(a);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x||"Unknown");}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");}}function Dn(e){{for(var a=Object.keys(e.props),c=0;c<a.length;c++){var l=a[c];if(l!=="children"&&l!=="key"){ee(e),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",l),ee(null);break}}e.ref!==null&&(ee(e),O("Invalid attribute `ref` supplied to `React.Fragment`."),ee(null));}}function Gt(e,a,c){var l=Ir(e);if(!l){var x="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(x+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var A=Tt(a);A?x+=A:x+=Ae();var S;e===null?S="null":We(e)?S="array":e!==void 0&&e.$$typeof===o?(S="<"+(Ee(e.type)||"Unknown")+" />",x=" Did you accidentally export a JSX literal instead of a component?"):S=typeof e,O("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",S,x);}var k=Er.apply(this,arguments);if(k==null)return k;if(l)for(var q=2;q<arguments.length;q++)Fr(arguments[q],e);return e===y?Dn(k):dr(k),k}var Xt=false;function Nn(e){var a=Gt.bind(null,e);return a.type=e,Xt||(Xt=true,V("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(a,"type",{enumerable:false,get:function(){return V("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),a}function kn(e,a,c){for(var l=Rr.apply(this,arguments),x=2;x<arguments.length;x++)Fr(arguments[x],l.type);return dr(l),l}function Ln(e,a){var c=Z.transition;Z.transition={};var l=Z.transition;Z.transition._updatedFibers=new Set;try{e();}finally{if(Z.transition=c,c===null&&l._updatedFibers){var x=l._updatedFibers.size;x>10&&V("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),l._updatedFibers.clear();}}}var Jt=false,jr=null;function Bn(e){if(jr===null)try{var a=("require"+Math.random()).slice(0,7),c=Kr&&Kr[a];jr=c.call(Kr,"timers").setImmediate;}catch(l){jr=function(x){Jt===false&&(Jt=true,typeof MessageChannel=="undefined"&&O("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var A=new MessageChannel;A.port1.onmessage=x,A.port2.postMessage(void 0);};}return jr(e)}var Ge=0,Zt=false;function en(e){{var a=Ge;Ge++,N.current===null&&(N.current=[]);var c=N.isBatchingLegacy,l;try{if(N.isBatchingLegacy=!0,l=e(),!c&&N.didScheduleLegacyUpdate){var x=N.current;x!==null&&(N.didScheduleLegacyUpdate=!1,Ot(x));}}catch(ie){throw Wr(a),ie}finally{N.isBatchingLegacy=c;}if(l!==null&&typeof l=="object"&&typeof l.then=="function"){var A=l,S=false,k={then:function(ie,ce){S=true,A.then(function(pe){Wr(a),Ge===0?Ct(pe,ie,ce):ie(pe);},function(pe){Wr(a),ce(pe);});}};return !Zt&&typeof Promise!="undefined"&&Promise.resolve().then(function(){}).then(function(){S||(Zt=true,O("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));}),k}else {var q=l;if(Wr(a),Ge===0){var ne=N.current;ne!==null&&(Ot(ne),N.current=null);var ae={then:function(ie,ce){N.current===null?(N.current=[],Ct(q,ie,ce)):ie(q);}};return ae}else {var ue={then:function(ie,ce){ie(q);}};return ue}}}}function Wr(e){e!==Ge-1&&O("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Ge=e;}function Ct(e,a,c){{var l=N.current;if(l!==null)try{Ot(l),Bn(function(){l.length===0?(N.current=null,a(e)):Ct(e,a,c);});}catch(x){c(x);}else a(e);}}var It=false;function Ot(e){if(!It){It=true;var a=0;try{for(;a<e.length;a++){var c=e[a];do c=c(!0);while(c!==null)}e.length=0;}catch(l){throw e=e.slice(a+1),l}finally{It=false;}}}var Fn=Gt,jn=kn,Wn=Nn,Un={map:Ve,forEach:Tr,count:at,toArray:ut,only:it};z.Children=Un,z.Component=le,z.Fragment=y,z.Profiler=I,z.PureComponent=er,z.StrictMode=b,z.Suspense=D,z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,z.act=en,z.cloneElement=jn,z.createContext=st,z.createElement=Fn,z.createFactory=Wn,z.createRef=et,z.forwardRef=dt,z.isValidElement=Ce,z.lazy=lt,z.memo=pt,z.startTransition=Ln,z.unstable_act=en,z.useCallback=bt,z.useContext=mt,z.useDebugValue=Rt,z.useDeferredValue=Or,z.useEffect=gt,z.useId=Le,z.useImperativeHandle=wt,z.useInsertionEffect=xt,z.useLayoutEffect=_t,z.useMemo=Et,z.useReducer=ht,z.useRef=yt,z.useState=vt,z.useSyncExternalStore=Ar,z.useTransition=St,z.version=n,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error);})();});var Ut=zr((wo,Wt)=>{process.env.NODE_ENV==="production"?Wt.exports=xn():Wt.exports=_n();});var Sn=zr((Rn,Mt)=>{(function(n){if(typeof Rn=="object"&&typeof Mt!="undefined")Mt.exports=n();else if(typeof define=="function"&&define.amd)define([],n);else {var o;typeof window!="undefined"?o=window:typeof global!="undefined"?o=global:typeof self!="undefined"?o=self:o=this,o.localforage=n();}})(function(){return (function y(b,I,T){function C(X,re){if(!I[X]){if(!b[X]){var E=typeof pr=="function"&≺if(!re&&E)return E(X,true);if(w)return w(X,true);var P=new Error("Cannot find module '"+X+"'");throw P.code="MODULE_NOT_FOUND",P}var K=I[X]={exports:{}};b[X][0].call(K.exports,function(j){var oe=b[X][1][j];return C(oe||j)},K,K.exports,y,b,I,T);}return I[X].exports}for(var w=typeof pr=="function"&&pr,D=0;D<T.length;D++)C(T[D]);return C})({1:[function(y,b,I){(function(T){var C=T.MutationObserver||T.WebKitMutationObserver,w;if(C){var D=0,X=new C(j),re=T.document.createTextNode("");X.observe(re,{characterData:true}),w=function(){re.data=D=++D%2;};}else if(!T.setImmediate&&typeof T.MessageChannel!="undefined"){var E=new T.MessageChannel;E.port1.onmessage=j,w=function(){E.port2.postMessage(0);};}else "document"in T&&"onreadystatechange"in T.document.createElement("script")?w=function(){var J=T.document.createElement("script");J.onreadystatechange=function(){j(),J.onreadystatechange=null,J.parentNode.removeChild(J),J=null;},T.document.documentElement.appendChild(J);}:w=function(){setTimeout(j,0);};var P,K=[];function j(){P=true;for(var J,Z,N=K.length;N;){for(Z=K,K=[],J=-1;++J<N;)Z[J]();N=K.length;}P=false;}b.exports=oe;function oe(J){K.push(J)===1&&!P&&w();}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{});},{}],2:[function(y,b,I){var T=y(1);function C(){}var w={},D=["REJECTED"],X=["FULFILLED"],re=["PENDING"];b.exports=E;function E(_){if(typeof _!="function")throw new TypeError("resolver must be a function");this.state=re,this.queue=[],this.outcome=void 0,_!==C&&oe(this,_);}E.prototype.catch=function(_){return this.then(null,_)},E.prototype.then=function(_,W){if(typeof _!="function"&&this.state===X||typeof W!="function"&&this.state===D)return this;var L=new this.constructor(C);if(this.state!==re){var U=this.state===X?_:W;K(L,U,this.outcome);}else this.queue.push(new P(L,_,W));return L};function P(_,W,L){this.promise=_,typeof W=="function"&&(this.onFulfilled=W,this.callFulfilled=this.otherCallFulfilled),typeof L=="function"&&(this.onRejected=L,this.callRejected=this.otherCallRejected);}P.prototype.callFulfilled=function(_){w.resolve(this.promise,_);},P.prototype.otherCallFulfilled=function(_){K(this.promise,this.onFulfilled,_);},P.prototype.callRejected=function(_){w.reject(this.promise,_);},P.prototype.otherCallRejected=function(_){K(this.promise,this.onRejected,_);};function K(_,W,L){T(function(){var U;try{U=W(L);}catch(B){return w.reject(_,B)}U===_?w.reject(_,new TypeError("Cannot resolve promise with itself")):w.resolve(_,U);});}w.resolve=function(_,W){var L=J(j,W);if(L.status==="error")return w.reject(_,L.value);var U=L.value;if(U)oe(_,U);else {_.state=X,_.outcome=W;for(var B=-1,M=_.queue.length;++B<M;)_.queue[B].callFulfilled(W);}return _},w.reject=function(_,W){_.state=D,_.outcome=W;for(var L=-1,U=_.queue.length;++L<U;)_.queue[L].callRejected(W);return _};function j(_){var W=_&&_.then;if(_&&(typeof _=="object"||typeof _=="function")&&typeof W=="function")return function(){W.apply(_,arguments);}}function oe(_,W){var L=false;function U(te){L||(L=true,w.reject(_,te));}function B(te){L||(L=true,w.resolve(_,te));}function M(){W(B,U);}var Q=J(M);Q.status==="error"&&U(Q.value);}function J(_,W){var L={};try{L.value=_(W),L.status="success";}catch(U){L.status="error",L.value=U;}return L}E.resolve=Z;function Z(_){return _ instanceof this?_:w.resolve(new this(C),_)}E.reject=N;function N(_){var W=new this(C);return w.reject(W,_)}E.all=se;function se(_){var W=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=_.length,U=false;if(!L)return this.resolve([]);for(var B=new Array(L),M=0,Q=-1,te=new this(C);++Q<L;)V(_[Q],Q);return te;function V(O,me){W.resolve(O).then(ge,function(ye){U||(U=true,w.reject(te,ye));});function ge(ye){B[me]=ye,++M===L&&!U&&(U=true,w.resolve(te,B));}}}E.race=G;function G(_){var W=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=_.length,U=false;if(!L)return this.resolve([]);for(var B=-1,M=new this(C);++B<L;)Q(_[B]);return M;function Q(te){W.resolve(te).then(function(V){U||(U=true,w.resolve(M,V));},function(V){U||(U=true,w.reject(M,V));});}}},{1:1}],3:[function(y,b,I){(function(T){typeof T.Promise!="function"&&(T.Promise=y(2));}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{});},{2:2}],4:[function(y,b,I){var T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function C(r,u){if(!(r instanceof u))throw new TypeError("Cannot call a class as a function")}function w(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(r){return}}var D=w();function X(){try{if(!D||!D.open)return !1;var r=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),u=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return (!r||u)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(t){return false}}function re(r,u){r=r||[],u=u||{};try{return new Blob(r,u)}catch(i){if(i.name!=="TypeError")throw i;for(var t=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,s=new t,f=0;f<r.length;f+=1)s.append(r[f]);return s.getBlob(u.type)}}typeof Promise=="undefined"&&y(3);var E=Promise;function P(r,u){u&&r.then(function(t){u(null,t);},function(t){u(t);});}function K(r,u,t){typeof u=="function"&&r.then(u),typeof t=="function"&&r.catch(t);}function j(r){return typeof r!="string"&&(console.warn(r+" used as a key, but it is not a string."),r=String(r)),r}function oe(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var J="local-forage-detect-blob-support",Z=void 0,N={},se=Object.prototype.toString,G="readonly",_="readwrite";function W(r){for(var u=r.length,t=new ArrayBuffer(u),s=new Uint8Array(t),f=0;f<u;f++)s[f]=r.charCodeAt(f);return t}function L(r){return new E(function(u){var t=r.transaction(J,_),s=re([""]);t.objectStore(J).put(s,"key"),t.onabort=function(f){f.preventDefault(),f.stopPropagation(),u(false);},t.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);u(i||!f||parseInt(f[1],10)>=43);};}).catch(function(){return false})}function U(r){return typeof Z=="boolean"?E.resolve(Z):L(r).then(function(u){return Z=u,Z})}function B(r){var u=N[r.name],t={};t.promise=new E(function(s,f){t.resolve=s,t.reject=f;}),u.deferredOperations.push(t),u.dbReady?u.dbReady=u.dbReady.then(function(){return t.promise}):u.dbReady=t.promise;}function M(r){var u=N[r.name],t=u.deferredOperations.pop();if(t)return t.resolve(),t.promise}function Q(r,u){var t=N[r.name],s=t.deferredOperations.pop();if(s)return s.reject(u),s.promise}function te(r,u){return new E(function(t,s){if(N[r.name]=N[r.name]||je(),r.db)if(u)B(r),r.db.close();else return t(r.db);var f=[r.name];u&&f.push(r.version);var i=D.open.apply(D,f);u&&(i.onupgradeneeded=function(d){var m=i.result;try{m.createObjectStore(r.storeName),d.oldVersion<=1&&m.createObjectStore(J);}catch(v){if(v.name==="ConstraintError")console.warn('The database "'+r.name+'" has been upgraded from version '+d.oldVersion+" to version "+d.newVersion+', but the storage "'+r.storeName+'" already exists.');else throw v}}),i.onerror=function(d){d.preventDefault(),s(i.error);},i.onsuccess=function(){var d=i.result;d.onversionchange=function(m){m.target.close();},t(d),M(r);};})}function V(r){return te(r,false)}function O(r){return te(r,true)}function me(r,u){if(!r.db)return true;var t=!r.db.objectStoreNames.contains(r.storeName),s=r.version<r.db.version,f=r.version>r.db.version;if(s&&(r.version!==u&&console.warn('The database "'+r.name+`" can't be downgraded from version `+r.db.version+" to version "+r.version+"."),r.version=r.db.version),f||t){if(t){var i=r.db.version+1;i>r.version&&(r.version=i);}return true}return false}function ge(r){return new E(function(u,t){var s=new FileReader;s.onerror=t,s.onloadend=function(f){var i=btoa(f.target.result||"");u({__local_forage_encoded_blob:true,data:i,type:r.type});},s.readAsBinaryString(r);})}function ye(r){var u=W(atob(r.data));return re([u],{type:r.type})}function Oe(r){return r&&r.__local_forage_encoded_blob}function be(r){var u=this,t=u._initReady().then(function(){var s=N[u._dbInfo.name];if(s&&s.dbReady)return s.dbReady});return K(t,r,r),t}function Je(r){B(r);for(var u=N[r.name],t=u.forages,s=0;s<t.length;s++){var f=t[s];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null);}return r.db=null,V(r).then(function(i){return r.db=i,me(r)?O(r):i}).then(function(i){r.db=u.db=i;for(var d=0;d<t.length;d++)t[d]._dbInfo.db=i;}).catch(function(i){throw Q(r,i),i})}function le(r,u,t,s){s===void 0&&(s=1);try{var f=r.db.transaction(r.storeName,u);t(null,f);}catch(i){if(s>0&&(!r.db||i.name==="InvalidStateError"||i.name==="NotFoundError"))return E.resolve().then(function(){if(!r.db||i.name==="NotFoundError"&&!r.db.objectStoreNames.contains(r.storeName)&&r.version<=r.db.version)return r.db&&(r.version=r.db.version+1),O(r)}).then(function(){return Je(r).then(function(){le(r,u,t,s-1);})}).catch(t);t(i);}}function je(){return {forages:[],db:null,dbReady:null,deferredOperations:[]}}function Zr(r){var u=this,t={db:null};if(r)for(var s in r)t[s]=r[s];var f=N[t.name];f||(f=je(),N[t.name]=f),f.forages.push(u),u._initReady||(u._initReady=u.ready,u.ready=be);var i=[];function d(){return E.resolve()}for(var m=0;m<f.forages.length;m++){var v=f.forages[m];v!==u&&i.push(v._initReady().catch(d));}var h=f.forages.slice(0);return E.all(i).then(function(){return t.db=f.db,V(t)}).then(function(g){return t.db=g,me(t,u._defaultConfig.version)?O(t):g}).then(function(g){t.db=f.db=g,u._dbInfo=t;for(var R=0;R<h.length;R++){var F=h[R];F!==u&&(F._dbInfo.db=t.db,F._dbInfo.version=t.version);}})}function Ze(r,u){var t=this;r=j(r);var s=new E(function(f,i){t.ready().then(function(){le(t._dbInfo,G,function(d,m){if(d)return i(d);try{var v=m.objectStore(t._dbInfo.storeName),h=v.get(r);h.onsuccess=function(){var g=h.result;g===void 0&&(g=null),Oe(g)&&(g=ye(g)),f(g);},h.onerror=function(){i(h.error);};}catch(g){i(g);}});}).catch(i);});return P(s,u),s}function hr(r,u){var t=this,s=new E(function(f,i){t.ready().then(function(){le(t._dbInfo,G,function(d,m){if(d)return i(d);try{var v=m.objectStore(t._dbInfo.storeName),h=v.openCursor(),g=1;h.onsuccess=function(){var R=h.result;if(R){var F=R.value;Oe(F)&&(F=ye(F));var H=r(F,R.key,g++);H!==void 0?f(H):R.continue();}else f();},h.onerror=function(){i(h.error);};}catch(R){i(R);}});}).catch(i);});return P(s,u),s}function er(r,u,t){var s=this;r=j(r);var f=new E(function(i,d){var m;s.ready().then(function(){return m=s._dbInfo,se.call(u)==="[object Blob]"?U(m.db).then(function(v){return v?u:ge(u)}):u}).then(function(v){le(s._dbInfo,_,function(h,g){if(h)return d(h);try{var R=g.objectStore(s._dbInfo.storeName);v===null&&(v=void 0);var F=R.put(v,r);g.oncomplete=function(){v===void 0&&(v=null),i(v);},g.onabort=g.onerror=function(){var H=F.error?F.error:F.transaction.error;d(H);};}catch(H){d(H);}});}).catch(d);});return P(f,t),f}function rr(r,u){var t=this;r=j(r);var s=new E(function(f,i){t.ready().then(function(){le(t._dbInfo,_,function(d,m){if(d)return i(d);try{var v=m.objectStore(t._dbInfo.storeName),h=v.delete(r);m.oncomplete=function(){f();},m.onerror=function(){i(h.error);},m.onabort=function(){var g=h.error?h.error:h.transaction.error;i(g);};}catch(g){i(g);}});}).catch(i);});return P(s,u),s}function et(r){var u=this,t=new E(function(s,f){u.ready().then(function(){le(u._dbInfo,_,function(i,d){if(i)return f(i);try{var m=d.objectStore(u._dbInfo.storeName),v=m.clear();d.oncomplete=function(){s();},d.onabort=d.onerror=function(){var h=v.error?v.error:v.transaction.error;f(h);};}catch(h){f(h);}});}).catch(f);});return P(t,r),t}function rt(r){var u=this,t=new E(function(s,f){u.ready().then(function(){le(u._dbInfo,G,function(i,d){if(i)return f(i);try{var m=d.objectStore(u._dbInfo.storeName),v=m.count();v.onsuccess=function(){s(v.result);},v.onerror=function(){f(v.error);};}catch(h){f(h);}});}).catch(f);});return P(t,r),t}function We(r,u){var t=this,s=new E(function(f,i){if(r<0){f(null);return}t.ready().then(function(){le(t._dbInfo,G,function(d,m){if(d)return i(d);try{var v=m.objectStore(t._dbInfo.storeName),h=!1,g=v.openKeyCursor();g.onsuccess=function(){var R=g.result;if(!R){f(null);return}r===0||h?f(R.key):(h=!0,R.advance(r));},g.onerror=function(){i(g.error);};}catch(R){i(R);}});}).catch(i);});return P(s,u),s}function tt(r){var u=this,t=new E(function(s,f){u.ready().then(function(){le(u._dbInfo,G,function(i,d){if(i)return f(i);try{var m=d.objectStore(u._dbInfo.storeName),v=m.openKeyCursor(),h=[];v.onsuccess=function(){var g=v.result;if(!g){s(h);return}h.push(g.key),g.continue();},v.onerror=function(){f(v.error);};}catch(g){f(g);}});}).catch(f);});return P(t,r),t}function nt(r,u){u=oe.apply(this,arguments);var t=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||t.name,r.storeName=r.storeName||t.storeName);var s=this,f;if(!r.name)f=E.reject("Invalid arguments");else {var i=r.name===t.name&&s._dbInfo.db,d=i?E.resolve(s._dbInfo.db):V(r).then(function(m){var v=N[r.name],h=v.forages;v.db=m;for(var g=0;g<h.length;g++)h[g]._dbInfo.db=m;return m});r.storeName?f=d.then(function(m){if(m.objectStoreNames.contains(r.storeName)){var v=m.version+1;B(r);var h=N[r.name],g=h.forages;m.close();for(var R=0;R<g.length;R++){var F=g[R];F._dbInfo.db=null,F._dbInfo.version=v;}var H=new E(function(Y,fe){var ee=D.open(r.name,v);ee.onerror=function(ve){var Ae=ee.result;Ae.close(),fe(ve);},ee.onupgradeneeded=function(){var ve=ee.result;ve.deleteObjectStore(r.storeName);},ee.onsuccess=function(){var ve=ee.result;ve.close(),Y(ve);};});return H.then(function(Y){h.db=Y;for(var fe=0;fe<g.length;fe++){var ee=g[fe];ee._dbInfo.db=Y,M(ee._dbInfo);}}).catch(function(Y){throw (Q(r,Y)||E.resolve()).catch(function(){}),Y})}}):f=d.then(function(m){B(r);var v=N[r.name],h=v.forages;m.close();for(var g=0;g<h.length;g++){var R=h[g];R._dbInfo.db=null;}var F=new E(function(H,Y){var fe=D.deleteDatabase(r.name);fe.onerror=function(){var ee=fe.result;ee&&ee.close(),Y(fe.error);},fe.onblocked=function(){console.warn('dropInstance blocked for database "'+r.name+'" until all open connections are closed');},fe.onsuccess=function(){var ee=fe.result;ee&&ee.close(),H(ee);};});return F.then(function(H){v.db=H;for(var Y=0;Y<h.length;Y++){var fe=h[Y];M(fe._dbInfo);}}).catch(function(H){throw (Q(r,H)||E.resolve()).catch(function(){}),H})});}return P(f,u),f}var yr={_driver:"asyncStorage",_initStorage:Zr,_support:X(),iterate:hr,getItem:Ze,setItem:er,removeItem:rr,clear:et,length:rt,key:We,keys:tt,dropInstance:nt};function Ue(){return typeof openDatabase=="function"}var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gr="~~local_forage_type~",Ee=/^~~local_forage_type~([^~]+)~/,Re="__lfsc__:",Me=Re.length,$e="arbf",ze="blob",Ye="si08",tr="ui08",nr="uic8",xr="si16",_r="si32",br="ur16",qe="ui32",Er="fl32",wr="fl64",Rr=Me+$e.length,Ce=Object.prototype.toString;function or(r){var u=r.length*.75,t=r.length,s,f=0,i,d,m,v;r[r.length-1]==="="&&(u--,r[r.length-2]==="="&&u--);var h=new ArrayBuffer(u),g=new Uint8Array(h);for(s=0;s<t;s+=4)i=we.indexOf(r[s]),d=we.indexOf(r[s+1]),m=we.indexOf(r[s+2]),v=we.indexOf(r[s+3]),g[f++]=i<<2|d>>4,g[f++]=(d&15)<<4|m>>2,g[f++]=(m&3)<<6|v&63;return h}function ar(r){var u=new Uint8Array(r),t="",s;for(s=0;s<u.length;s+=3)t+=we[u[s]>>2],t+=we[(u[s]&3)<<4|u[s+1]>>4],t+=we[(u[s+1]&15)<<2|u[s+2]>>6],t+=we[u[s+2]&63];return u.length%3===2?t=t.substring(0,t.length-1)+"=":u.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function ot(r,u){var t="";if(r&&(t=Ce.call(r)),r&&(t==="[object ArrayBuffer]"||r.buffer&&Ce.call(r.buffer)==="[object ArrayBuffer]")){var s,f=Re;r instanceof ArrayBuffer?(s=r,f+=$e):(s=r.buffer,t==="[object Int8Array]"?f+=Ye:t==="[object Uint8Array]"?f+=tr:t==="[object Uint8ClampedArray]"?f+=nr:t==="[object Int16Array]"?f+=xr:t==="[object Uint16Array]"?f+=br:t==="[object Int32Array]"?f+=_r:t==="[object Uint32Array]"?f+=qe:t==="[object Float32Array]"?f+=Er:t==="[object Float64Array]"?f+=wr:u(new Error("Failed to get type for BinaryArray"))),u(f+ar(s));}else if(t==="[object Blob]"){var i=new FileReader;i.onload=function(){var d=gr+r.type+"~"+ar(this.result);u(Re+ze+d);},i.readAsArrayBuffer(r);}else try{u(JSON.stringify(r));}catch(d){console.error("Couldn't convert value into a JSON string: ",r),u(null,d);}}function Sr(r){if(r.substring(0,Me)!==Re)return JSON.parse(r);var u=r.substring(Rr),t=r.substring(Me,Rr),s;if(t===ze&&Ee.test(u)){var f=u.match(Ee);s=f[1],u=u.substring(f[0].length);}var i=or(u);switch(t){case $e:return i;case ze:return re([i],{type:s});case Ye:return new Int8Array(i);case tr:return new Uint8Array(i);case nr:return new Uint8ClampedArray(i);case xr:return new Int16Array(i);case br:return new Uint16Array(i);case _r:return new Int32Array(i);case qe:return new Uint32Array(i);case Er:return new Float32Array(i);case wr:return new Float64Array(i);default:throw new Error("Unkown type: "+t)}}var ur={serialize:ot,deserialize:Sr,stringToBuffer:or,bufferToString:ar};function ir(r,u,t,s){r.executeSql("CREATE TABLE IF NOT EXISTS "+u.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,s);}function sr(r){var u=this,t={db:null};if(r)for(var s in r)t[s]=typeof r[s]!="string"?r[s].toString():r[s];var f=new E(function(i,d){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size);}catch(m){return d(m)}t.db.transaction(function(m){ir(m,t,function(){u._dbInfo=t,i();},function(v,h){d(h);});},d);});return t.serializer=ur,f}function xe(r,u,t,s,f,i){r.executeSql(t,s,f,function(d,m){m.code===m.SYNTAX_ERR?d.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[u.storeName],function(v,h){h.rows.length?i(v,m):ir(v,u,function(){v.executeSql(t,s,f,i);},i);},i):i(d,m);},i);}function Ve(r,u){var t=this;r=j(r);var s=new E(function(f,i){t.ready().then(function(){var d=t._dbInfo;d.db.transaction(function(m){xe(m,d,"SELECT * FROM "+d.storeName+" WHERE key = ? LIMIT 1",[r],function(v,h){var g=h.rows.length?h.rows.item(0).value:null;g&&(g=d.serializer.deserialize(g)),f(g);},function(v,h){i(h);});});}).catch(i);});return P(s,u),s}function at(r,u){var t=this,s=new E(function(f,i){t.ready().then(function(){var d=t._dbInfo;d.db.transaction(function(m){xe(m,d,"SELECT * FROM "+d.storeName,[],function(v,h){for(var g=h.rows,R=g.length,F=0;F<R;F++){var H=g.item(F),Y=H.value;if(Y&&(Y=d.serializer.deserialize(Y)),Y=r(Y,H.key,F+1),Y!==void 0){f(Y);return}}f();},function(v,h){i(h);});});}).catch(i);});return P(s,u),s}function Tr(r,u,t,s){var f=this;r=j(r);var i=new E(function(d,m){f.ready().then(function(){u===void 0&&(u=null);var v=u,h=f._dbInfo;h.serializer.serialize(u,function(g,R){R?m(R):h.db.transaction(function(F){xe(F,h,"INSERT OR REPLACE INTO "+h.storeName+" (key, value) VALUES (?, ?)",[r,g],function(){d(v);},function(H,Y){m(Y);});},function(F){if(F.code===F.QUOTA_ERR){if(s>0){d(Tr.apply(f,[r,v,t,s-1]));return}m(F);}});});}).catch(m);});return P(i,t),i}function ut(r,u,t){return Tr.apply(this,[r,u,t,1])}function it(r,u){var t=this;r=j(r);var s=new E(function(f,i){t.ready().then(function(){var d=t._dbInfo;d.db.transaction(function(m){xe(m,d,"DELETE FROM "+d.storeName+" WHERE key = ?",[r],function(){f();},function(v,h){i(h);});});}).catch(i);});return P(s,u),s}function st(r){var u=this,t=new E(function(s,f){u.ready().then(function(){var i=u._dbInfo;i.db.transaction(function(d){xe(d,i,"DELETE FROM "+i.storeName,[],function(){s();},function(m,v){f(v);});});}).catch(f);});return P(t,r),t}function ke(r){var u=this,t=new E(function(s,f){u.ready().then(function(){var i=u._dbInfo;i.db.transaction(function(d){xe(d,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(m,v){var h=v.rows.item(0).c;s(h);},function(m,v){f(v);});});}).catch(f);});return P(t,r),t}function fr(r,u){var t=this,s=new E(function(f,i){t.ready().then(function(){var d=t._dbInfo;d.db.transaction(function(m){xe(m,d,"SELECT key FROM "+d.storeName+" WHERE id = ? LIMIT 1",[r+1],function(v,h){var g=h.rows.length?h.rows.item(0).key:null;f(g);},function(v,h){i(h);});});}).catch(i);});return P(s,u),s}function Cr(r){var u=this,t=new E(function(s,f){u.ready().then(function(){var i=u._dbInfo;i.db.transaction(function(d){xe(d,i,"SELECT key FROM "+i.storeName,[],function(m,v){for(var h=[],g=0;g<v.rows.length;g++)h.push(v.rows.item(g).key);s(h);},function(m,v){f(v);});});}).catch(f);});return P(t,r),t}function ft(r){return new E(function(u,t){r.transaction(function(s){s.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,i){for(var d=[],m=0;m<i.rows.length;m++)d.push(i.rows.item(m).name);u({db:r,storeNames:d});},function(f,i){t(i);});},function(s){t(s);});})}function ct(r,u){u=oe.apply(this,arguments);var t=this.config();r=typeof r!="function"&&r||{},r.name||(r.name=r.name||t.name,r.storeName=r.storeName||t.storeName);var s=this,f;return r.name?f=new E(function(i){var d;r.name===t.name?d=s._dbInfo.db:d=openDatabase(r.name,"","",0),r.storeName?i({db:d,storeNames:[r.storeName]}):i(ft(d));}).then(function(i){return new E(function(d,m){i.db.transaction(function(v){function h(H){return new E(function(Y,fe){v.executeSql("DROP TABLE IF EXISTS "+H,[],function(){Y();},function(ee,ve){fe(ve);});})}for(var g=[],R=0,F=i.storeNames.length;R<F;R++)g.push(h(i.storeNames[R]));E.all(g).then(function(){d();}).catch(function(H){m(H);});},function(v){m(v);});})}):f=E.reject("Invalid arguments"),P(f,u),f}var lt={_driver:"webSQLStorage",_initStorage:sr,_support:Ue(),iterate:at,getItem:Ve,setItem:ut,removeItem:it,clear:st,length:ke,key:fr,keys:Cr,dropInstance:ct};function dt(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(r){return false}}function cr(r,u){var t=r.name+"/";return r.storeName!==u.storeName&&(t+=r.storeName+"/"),t}function Ir(){var r="_localforage_support_test";try{return localStorage.setItem(r,!0),localStorage.removeItem(r),!1}catch(u){return true}}function pt(){return !Ir()||localStorage.length>0}function de(r){var u=this,t={};if(r)for(var s in r)t[s]=r[s];return t.keyPrefix=cr(r,u._defaultConfig),pt()?(u._dbInfo=t,t.serializer=ur,E.resolve()):E.reject()}function mt(r){var u=this,t=u.ready().then(function(){for(var s=u._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var i=localStorage.key(f);i.indexOf(s)===0&&localStorage.removeItem(i);}});return P(t,r),t}function vt(r,u){var t=this;r=j(r);var s=t.ready().then(function(){var f=t._dbInfo,i=localStorage.getItem(f.keyPrefix+r);return i&&(i=f.serializer.deserialize(i)),i});return P(s,u),s}function ht(r,u){var t=this,s=t.ready().then(function(){for(var f=t._dbInfo,i=f.keyPrefix,d=i.length,m=localStorage.length,v=1,h=0;h<m;h++){var g=localStorage.key(h);if(g.indexOf(i)===0){var R=localStorage.getItem(g);if(R&&(R=f.serializer.deserialize(R)),R=r(R,g.substring(d),v++),R!==void 0)return R}}});return P(s,u),s}function yt(r,u){var t=this,s=t.ready().then(function(){var f=t._dbInfo,i;try{i=localStorage.key(r);}catch(d){i=null;}return i&&(i=i.substring(f.keyPrefix.length)),i});return P(s,u),s}function gt(r){var u=this,t=u.ready().then(function(){for(var s=u._dbInfo,f=localStorage.length,i=[],d=0;d<f;d++){var m=localStorage.key(d);m.indexOf(s.keyPrefix)===0&&i.push(m.substring(s.keyPrefix.length));}return i});return P(t,r),t}function xt(r){var u=this,t=u.keys().then(function(s){return s.length});return P(t,r),t}function _t(r,u){var t=this;r=j(r);var s=t.ready().then(function(){var f=t._dbInfo;localStorage.removeItem(f.keyPrefix+r);});return P(s,u),s}function bt(r,u,t){var s=this;r=j(r);var f=s.ready().then(function(){u===void 0&&(u=null);var i=u;return new E(function(d,m){var v=s._dbInfo;v.serializer.serialize(u,function(h,g){if(g)m(g);else try{localStorage.setItem(v.keyPrefix+r,h),d(i);}catch(R){(R.name==="QuotaExceededError"||R.name==="NS_ERROR_DOM_QUOTA_REACHED")&&m(R),m(R);}});})});return P(f,t),f}function Et(r,u){if(u=oe.apply(this,arguments),r=typeof r!="function"&&r||{},!r.name){var t=this.config();r.name=r.name||t.name,r.storeName=r.storeName||t.storeName;}var s=this,f;return r.name?f=new E(function(i){r.storeName?i(cr(r,s._defaultConfig)):i(r.name+"/");}).then(function(i){for(var d=localStorage.length-1;d>=0;d--){var m=localStorage.key(d);m.indexOf(i)===0&&localStorage.removeItem(m);}}):f=E.reject("Invalid arguments"),P(f,u),f}var wt={_driver:"localStorageWrapper",_initStorage:de,_support:dt(),iterate:ht,getItem:vt,setItem:bt,removeItem:_t,clear:mt,length:xt,key:yt,keys:gt,dropInstance:Et},Rt=function(u,t){return u===t||typeof u=="number"&&typeof t=="number"&&isNaN(u)&&isNaN(t)},St=function(u,t){for(var s=u.length,f=0;f<s;){if(Rt(u[f],t))return true;f++;}return false},Or=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"},Le={},Ar={},_e={INDEXEDDB:yr,WEBSQL:lt,LOCALSTORAGE:wt},Pr=[_e.INDEXEDDB._driver,_e.WEBSQL._driver,_e.LOCALSTORAGE._driver],Be=["dropInstance"],He=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Be),Dr={description:"",driver:Pr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Nr(r,u){r[u]=function(){var t=arguments;return r.ready().then(function(){return r[u].apply(r,t)})};}function Ke(){for(var r=1;r<arguments.length;r++){var u=arguments[r];if(u)for(var t in u)u.hasOwnProperty(t)&&(Or(u[t])?arguments[0][t]=u[t].slice():arguments[0][t]=u[t]);}return arguments[0]}var kr=(function(){function r(u){C(this,r);for(var t in _e)if(_e.hasOwnProperty(t)){var s=_e[t],f=s._driver;this[t]=f,Le[f]||this.defineDriver(s);}this._defaultConfig=Ke({},Dr),this._config=Ke({},this._defaultConfig,u),this._driverSet=null,this._initDriver=null,this._ready=false,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){});}return r.prototype.config=function(t){if((typeof t=="undefined"?"undefined":T(t))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var s in t){if(s==="storeName"&&(t[s]=t[s].replace(/\W/g,"_")),s==="version"&&typeof t[s]!="number")return new Error("Database version must be a number.");this._config[s]=t[s];}return "driver"in t&&t.driver?this.setDriver(this._config.driver):true}else return typeof t=="string"?this._config[t]:this._config},r.prototype.defineDriver=function(t,s,f){var i=new E(function(d,m){try{var v=t._driver,h=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver){m(h);return}for(var g=He.concat("_initStorage"),R=0,F=g.length;R<F;R++){var H=g[R],Y=!St(Be,H);if((Y||t[H])&&typeof t[H]!="function"){m(h);return}}var fe=function(){for(var Ae=function(Br){return function(){var Fr=new Error("Method "+Br+" is not implemented by the current driver"),dr=E.reject(Fr);return P(dr,arguments[arguments.length-1]),dr}},lr=0,Tt=Be.length;lr<Tt;lr++){var Qe=Be[lr];t[Qe]||(t[Qe]=Ae(Qe));}};fe();var ee=function(Ae){Le[v]&&console.info("Redefining LocalForage driver: "+v),Le[v]=t,Ar[v]=Ae,d();};"_support"in t?t._support&&typeof t._support=="function"?t._support().then(ee,m):ee(!!t._support):ee(!0);}catch(ve){m(ve);}});return K(i,s,f),i},r.prototype.driver=function(){return this._driver||null},r.prototype.getDriver=function(t,s,f){var i=Le[t]?E.resolve(Le[t]):E.reject(new Error("Driver not found."));return K(i,s,f),i},r.prototype.getSerializer=function(t){var s=E.resolve(ur);return K(s,t),s},r.prototype.ready=function(t){var s=this,f=s._driverSet.then(function(){return s._ready===null&&(s._ready=s._initDriver()),s._ready});return K(f,t,t),f},r.prototype.setDriver=function(t,s,f){var i=this;Or(t)||(t=[t]);var d=this._getSupportedDrivers(t);function m(){i._config.driver=i.driver();}function v(R){return i._extend(R),m(),i._ready=i._initStorage(i._config),i._ready}function h(R){return function(){var F=0;function H(){for(;F<R.length;){var Y=R[F];return F++,i._dbInfo=null,i._ready=null,i.getDriver(Y).then(v).catch(H)}m();var fe=new Error("No available storage method found.");return i._driverSet=E.reject(fe),i._driverSet}return H()}}var g=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=g.then(function(){var R=d[0];return i._dbInfo=null,i._ready=null,i.getDriver(R).then(function(F){i._driver=F._driver,m(),i._wrapLibraryMethodsWithReady(),i._initDriver=h(d);})}).catch(function(){m();var R=new Error("No available storage method found.");return i._driverSet=E.reject(R),i._driverSet}),K(this._driverSet,s,f),this._driverSet},r.prototype.supports=function(t){return !!Ar[t]},r.prototype._extend=function(t){Ke(this,t);},r.prototype._getSupportedDrivers=function(t){for(var s=[],f=0,i=t.length;f<i;f++){var d=t[f];this.supports(d)&&s.push(d);}return s},r.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,s=He.length;t<s;t++)Nr(this,He[t]);},r.prototype.createInstance=function(t){return new r(t)},r})(),Lr=new kr;b.exports=Lr;},{3:3}]},{},[4])(4)});});var Yr=class{constructor(o=1){this.buffer=[];this.subscriptions=[];this.maxBufferSize=o;}subscribe(o){return this.subscriptions.push(o),this.buffer.forEach(p=>o(p)),()=>this.unsubscribe(o)}unsubscribe(o){this.subscriptions=this.subscriptions.filter(p=>p!==o);}next(o){this.subscriptions.forEach(p=>p(o)),this.buffer.push(o),this.buffer.length>this.maxBufferSize&&(this.buffer=this.buffer.slice(1));}};var bn=Nt(Ut());function En(n){let o=(0, bn.useRef)();return o.current==null&&(o.current=n()),o}function wn(n){return En(n).current}var Fe=Nt(Ut());var Ht=Nt(Sn());function Ie(n){return n!=null&&typeof n=="object"&&n["@@functional/placeholder"]===true}function Te(n){return function o(p){return arguments.length===0||Ie(p)?o:n.apply(this,arguments)}}function $t(n){return function o(p,y){switch(arguments.length){case 0:return o;case 1:return Ie(p)?o:Te(function(b){return n(p,b)});default:return Ie(p)&&Ie(y)?o:Ie(p)?Te(function(b){return n(b,y)}):Ie(y)?Te(function(b){return n(p,b)}):n(p,y)}}}function Qr(n){for(var o=[],p;!(p=n.next()).done;)o.push(p.value);return o}function Gr(n,o,p){for(var y=0,b=p.length;y<b;){if(n(o,p[y]))return true;y+=1;}return false}function zt(n){var o=String(n).match(/^function (\w*)/);return o==null?"":o[1]}function De(n,o){return Object.prototype.hasOwnProperty.call(o,n)}function po(n,o){return n===o?n!==0||1/n===1/o:n!==n&&o!==o}var Xr=typeof Object.is=="function"?Object.is:po;var Tn=Object.prototype.toString,mo=(function(){return Tn.call(arguments)==="[object Arguments]"?function(o){return Tn.call(o)==="[object Arguments]"}:function(o){return De("callee",o)}})(),Cn=mo;var vo=!{toString:null}.propertyIsEnumerable("toString"),In=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],On=(function(){return arguments.propertyIsEnumerable("length")})(),ho=function(o,p){for(var y=0;y<o.length;){if(o[y]===p)return true;y+=1;}return false},yo=typeof Object.keys=="function"&&!On?Te(function(o){return Object(o)!==o?[]:Object.keys(o)}):Te(function(o){if(Object(o)!==o)return [];var p,y,b=[],I=On&&Cn(o);for(p in o)De(p,o)&&(!I||p!=="length")&&(b[b.length]=p);if(vo)for(y=In.length-1;y>=0;)p=In[y],De(p,o)&&!ho(b,p)&&(b[b.length]=p),y-=1;return b}),Yt=yo;var go=Te(function(o){return o===null?"Null":o===void 0?"Undefined":Object.prototype.toString.call(o).slice(8,-1)}),qt=go;function An(n,o,p,y){var b=Qr(n),I=Qr(o);function T(C,w){return vr(C,w,p.slice(),y.slice())}return !Gr(function(C,w){return !Gr(T,w,C)},I,b)}function vr(n,o,p,y){if(Xr(n,o))return true;var b=qt(n);if(b!==qt(o))return false;if(typeof n["fantasy-land/equals"]=="function"||typeof o["fantasy-land/equals"]=="function")return typeof n["fantasy-land/equals"]=="function"&&n["fantasy-land/equals"](o)&&typeof o["fantasy-land/equals"]=="function"&&o["fantasy-land/equals"](n);if(typeof n.equals=="function"||typeof o.equals=="function")return typeof n.equals=="function"&&n.equals(o)&&typeof o.equals=="function"&&o.equals(n);switch(b){case "Arguments":case "Array":case "Object":if(typeof n.constructor=="function"&&zt(n.constructor)==="Promise")return n===o;break;case "Boolean":case "Number":case "String":if(!(typeof n==typeof o&&Xr(n.valueOf(),o.valueOf())))return false;break;case "Date":if(!Xr(n.valueOf(),o.valueOf()))return false;break;case "Error":return n.name===o.name&&n.message===o.message;case "RegExp":if(!(n.source===o.source&&n.global===o.global&&n.ignoreCase===o.ignoreCase&&n.multiline===o.multiline&&n.sticky===o.sticky&&n.unicode===o.unicode))return false;break}for(var I=p.length-1;I>=0;){if(p[I]===n)return y[I]===o;I-=1;}switch(b){case "Map":return n.size!==o.size?false:An(n.entries(),o.entries(),p.concat([n]),y.concat([o]));case "Set":return n.size!==o.size?false:An(n.values(),o.values(),p.concat([n]),y.concat([o]));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 false}var T=Yt(n);if(T.length!==Yt(o).length)return false;var C=p.concat([n]),w=y.concat([o]);for(I=T.length-1;I>=0;){var D=T[I];if(!(De(D,o)&&vr(o[D],n[D],C,w)))return false;I-=1;}return true}var xo=$t(function(o,p){return vr(o,p,[],[])}),Jr=xo;function Vt(n,o=0){return Se(this,null,function*(){let p=(o||0)+1;for(let y=0;y<p;y++)try{return yield n()}catch(b){if(y===p-1)throw b}throw new Error("fnRunner: Unexpected error - all retries exhausted.")})}var Pn="sh-cache-common",Ne=Ht.default.createInstance({name:Pn,storeName:"main-store"});function Kt(n,o,p){let{deps:y,retry:b,maxAge:I,version:T,compareBeforeUpdate:C,remoteMemoryCache:w,equals:D,cacheEnabled:X,beforeRequest:re,onSuccess:E,onError:P,errorHandler:K}=Pe({deps:[],retry:0,equals:Jr,compareBeforeUpdate:Jr,remoteMemoryCache:false},p),j=0,oe=[],J=new Yr(1),Z=()=>typeof y=="function"?y():y,N=(B,M)=>((Q,te)=>{let V=B(Q,te);return V.then(O=>{var ge;let me={type:M.type,result:O};return te.runCount===j&&((ge=M.onSuccess)==null||ge.call(M,me)),me},O=>{var me;te.runCount===j&&((me=M.onError)==null||me.call(M,O));}).catch(()=>{}),V}),se=(Q,te)=>Se(null,[Q,te],function*(B,{deps:M}){let V=yield Ne.getItem(n);if(V&&(!T||V.version===T)&&(!V.expires||V.expires>Date.now())&&D(V.deps,M))return V.result;throw new Error("Cache not found")}),G={success:false,deps:[],result:null},_=()=>{G.success=false,G.result=null,G.deps=[];},W=(B,M)=>{if(!w)return {type:"remote",promiseResult:Vt(()=>o(...B),b)};if(G.success&&D(G.deps,M))return {type:"memory",promiseResult:G.result};G.deps=M,G.success=true;let Q=G.result=Vt(()=>o(...B),b);return Promise.resolve(Q).catch(_),{type:"remote",promiseResult:Q}},L=(B,M)=>Se(null,null,function*(){let Q={type:"remote",result:null},{runCount:te,deps:V}=M;try{let{type:O,promiseResult:me}=W(B,V),ge=Q.result=yield me;te===j&&O==="remote"&&(!X||(yield X(V)))&&Promise.resolve().then(()=>Se(null,null,function*(){let ye=yield se(B,M).catch(()=>null),Oe=Pe(Pe({deps:V,result:ge},T&&{version:T}),I&&{expires:Date.now()+I});Ne.setItem(n,Oe),!(C&&ye&&C(ye,ge))&&J.next({result:ge,cacheData:Oe,isCacheHit:!!ye});}));}catch(O){if(K)Q.result=yield K(O);else throw O}return Q.result}),U=(...B)=>Se(null,null,function*(){yield re==null?void 0:re();let M=++j;oe=B.concat(Z());let Q={runCount:M,deps:oe},te=X&&!(yield X(oe)),[V,O]=[te?null:N(se,{type:"local",onSuccess:E})(B,Q),N(L,{type:"remote",onSuccess:E,onError:P})(B,Q)];return V?yield Promise.race([V.catch(()=>O),O]):O});return U.refresh=(...B)=>Se(null,null,function*(){yield re==null?void 0:re();let M=++j;oe=B.concat(Z());let Q={runCount:M,deps:oe};return N(L,{type:"remote",onSuccess:E,onError:P})(B,Q)}),U.getCache=()=>Ne.getItem(n),U.updateCache=B=>Se(null,null,function*(){if(typeof B=="function"){let M=yield U.getCache().catch(()=>null),Q=B(M);yield Ne.setItem(n,Q);}else yield Ne.setItem(n,B);}),U.subscribeCacheUpdate=B=>J.subscribe(B),U.clearCache=()=>Se(null,null,function*(){_(),yield Ne.removeItem(n);}),U}Kt.useDb=n=>{typeof n=="string"?Ne=Ht.default.createInstance({name:Pn,storeName:n}):Ne=n;};function va(n,o,p=[],y){let J=y||{},{enabled:b=true,initialData:I,onSuccess:T,onError:C,onFinished:w,useCustomEffect:D=Fe.useEffect}=J,X=un(J,["enabled","initialData","onSuccess","onError","onFinished","useCustomEffect"]),[re,E]=(0, Fe.useState)(false),[P,K]=(0, Fe.useState)(()=>({type:"local",data:typeof I=="function"?I():I,error:null})),j=(0, Fe.useRef)({deps:p,fn:o,onSuccess:T,onError:C,onFinished:w});j.current.deps=p,j.current.fn=o,j.current.onSuccess=T,j.current.onError=C,j.current.onFinished=w;let oe=wn(()=>Kt(n,()=>j.current.fn(),$r(Pe({},X),{deps:()=>j.current.deps,beforeRequest:()=>{E(true);},onSuccess:Z=>{var N,se,G,_;E(false),K({type:Z.type,data:Z.result,error:null}),(se=(N=j.current).onSuccess)==null||se.call(N,Z.result),(_=(G=j.current).onFinished)==null||_.call(G,{success:true,data:Z.result});},onError:Z=>{var N,se,G,_;E(false),K(W=>$r(Pe({},W),{error:Z})),(se=(N=j.current).onError)==null||se.call(N,Z),(_=(G=j.current).onFinished)==null||_.call(G,{success:false,error:Z});}})));return D(()=>{b&&oe();},[b,...p]),$r(Pe({},P),{loading:re,setState:K,run:oe,refresh:oe.refresh,clearCache:oe.clearCache})}/*! Bundled license information:
|
|
24
|
+
|
|
25
|
+
react/cjs/react.production.min.js:
|
|
26
|
+
(**
|
|
27
|
+
* @license React
|
|
28
|
+
* react.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*)
|
|
35
|
+
|
|
36
|
+
react/cjs/react.development.js:
|
|
37
|
+
(**
|
|
38
|
+
* @license React
|
|
39
|
+
* react.development.js
|
|
40
|
+
*
|
|
41
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the MIT license found in the
|
|
44
|
+
* LICENSE file in the root directory of this source tree.
|
|
45
|
+
*)
|
|
2
46
|
|
|
3
47
|
localforage/dist/localforage.js:
|
|
4
48
|
(*!
|
|
@@ -7,5 +51,5 @@ localforage/dist/localforage.js:
|
|
|
7
51
|
https://localforage.github.io/localForage
|
|
8
52
|
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
9
53
|
*)
|
|
10
|
-
*/exports.ReplaySubject=
|
|
54
|
+
*/exports.ReplaySubject=Yr;exports.createQueryWithCache=Kt;exports.fnRunner=Vt;exports.useLaziedConst=wn;exports.useLaziedRef=En;exports.useQueryWithCache=va;return exports;})({});//# sourceMappingURL=sh-utils.js.map
|
|
11
55
|
//# sourceMappingURL=sh-utils.js.map
|