4 lines
10 KiB
JavaScript
4 lines
10 KiB
JavaScript
import{Q as z,r as x,a9 as O,F as A,aa as H,ab as S,q as M,u as j,ac as U}from"./entry.a42f0781.js";const N=()=>null;function Y(...s){const n=typeof s[s.length-1]=="string"?s.pop():void 0;typeof s[0]!="string"&&s.unshift(n);let[r,e,t={}]=s;if(typeof r!="string")throw new TypeError("[nuxt] [asyncData] key must be a string.");if(typeof e!="function")throw new TypeError("[nuxt] [asyncData] handler must be a function.");t.server=t.server??!0,t.default=t.default??N,t.lazy=t.lazy??!1,t.immediate=t.immediate??!0;const i=z(),c=()=>i.isHydrating?i.payload.data[r]:i.static.data[r],l=()=>c()!==void 0;i._asyncData[r]||(i._asyncData[r]={data:x(c()??t.default()),pending:x(!l()),error:O(i.payload._errors,r)});const a={...i._asyncData[r]};a.refresh=a.execute=(o={})=>{if(i._asyncDataPromises[r]){if(o.dedupe===!1)return i._asyncDataPromises[r];i._asyncDataPromises[r].cancelled=!0}if((o._initial||i.isHydrating&&o._initial!==!1)&&l())return c();a.pending.value=!0;const y=new Promise((u,p)=>{try{u(e(i))}catch(B){p(B)}}).then(u=>{if(y.cancelled)return i._asyncDataPromises[r];let p=u;t.transform&&(p=t.transform(u)),t.pick&&(p=R(p,t.pick)),a.data.value=p,a.error.value=null}).catch(u=>{if(y.cancelled)return i._asyncDataPromises[r];a.error.value=u,a.data.value=j(t.default())}).finally(()=>{y.cancelled||(a.pending.value=!1,i.payload.data[r]=a.data.value,a.error.value&&(i.payload._errors[r]=U(a.error.value)),delete i._asyncDataPromises[r])});return i._asyncDataPromises[r]=y,i._asyncDataPromises[r]};const f=()=>a.refresh({_initial:!0}),h=t.server!==!1&&i.payload.serverRendered;{const o=A();if(o&&!o._nuxtOnBeforeMountCbs){o._nuxtOnBeforeMountCbs=[];const u=o._nuxtOnBeforeMountCbs;o&&(H(()=>{u.forEach(p=>{p()}),u.splice(0,u.length)}),S(()=>u.splice(0,u.length)))}h&&i.isHydrating&&l()?a.pending.value=!1:o&&(i.payload.serverRendered&&i.isHydrating||t.lazy)&&t.immediate?o._nuxtOnBeforeMountCbs.push(f):t.immediate&&f(),t.watch&&M(t.watch,()=>a.refresh());const y=i.hook("app:data:refresh",u=>{if(!u||u.includes(r))return a.refresh()});o&&S(y)}const d=Promise.resolve(i._asyncDataPromises[r]).then(()=>a);return Object.assign(d,a),d}function R(s,n){const r={};for(const e of n)r[e]=s[e];return r}const F={ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1};function T(s,n={}){n={...F,...n};const r=D(n);return r.dispatch(s),r.toString()}function D(s){const n=[];let r=[];const e=t=>{n.push(t)};return{toString(){return n.join("")},getContext(){return r},dispatch(t){return s.replacer&&(t=s.replacer(t)),this["_"+(t===null?"null":typeof t)](t)},_object(t){if(t&&typeof t.toJSON=="function")return this._object(t.toJSON());const i=/\[object (.*)]/i,c=Object.prototype.toString.call(t),l=i.exec(c),a=l?l[1].toLowerCase():"unknown:["+c.toLowerCase()+"]";let f=null;if((f=r.indexOf(t))>=0)return this.dispatch("[CIRCULAR:"+f+"]");if(r.push(t),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(t))return e("buffer:"),e(t.toString("utf8"));if(a!=="object"&&a!=="function"&&a!=="asyncfunction")this["_"+a]?this["_"+a](t):s.ignoreUnknown||this._unkown(t,a);else{let h=Object.keys(t);s.unorderedObjects&&(h=h.sort()),s.respectType!==!1&&!k(t)&&h.splice(0,0,"prototype","__proto__","letructor"),s.excludeKeys&&(h=h.filter(function(d){return!s.excludeKeys(d)})),e("object:"+h.length+":");for(const d of h)this.dispatch(d),e(":"),s.excludeValues||this.dispatch(t[d]),e(",")}},_array(t,i){if(i=typeof i<"u"?i:s.unorderedArrays!==!1,e("array:"+t.length+":"),!i||t.length<=1){for(const a of t)this.dispatch(a);return}const c=[],l=t.map(a=>{const f=D(s);return f.dispatch(a),c.push(f.getContext()),f.toString()});return r=[...r,...c],l.sort(),this._array(l,!1)},_date(t){return e("date:"+t.toJSON())},_symbol(t){return e("symbol:"+t.toString())},_unkown(t,i){if(e(i),!!t&&(e(":"),t&&typeof t.entries=="function"))return this._array(Array.from(t.entries()),!0)},_error(t){return e("error:"+t.toString())},_boolean(t){return e("bool:"+t.toString())},_string(t){e("string:"+t.length+":"),e(t.toString())},_function(t){e("fn:"),k(t)?this.dispatch("[native]"):this.dispatch(t.toString()),s.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(t.name)),s.respectFunctionProperties&&this._object(t)},_number(t){return e("number:"+t.toString())},_xml(t){return e("xml:"+t.toString())},_null(){return e("Null")},_undefined(){return e("Undefined")},_regexp(t){return e("regex:"+t.toString())},_uint8array(t){return e("uint8array:"),this.dispatch(Array.prototype.slice.call(t))},_uint8clampedarray(t){return e("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(t))},_int8array(t){return e("int8array:"),this.dispatch(Array.prototype.slice.call(t))},_uint16array(t){return e("uint16array:"),this.dispatch(Array.prototype.slice.call(t))},_int16array(t){return e("int16array:"),this.dispatch(Array.prototype.slice.call(t))},_uint32array(t){return e("uint32array:"),this.dispatch(Array.prototype.slice.call(t))},_int32array(t){return e("int32array:"),this.dispatch(Array.prototype.slice.call(t))},_float32array(t){return e("float32array:"),this.dispatch(Array.prototype.slice.call(t))},_float64array(t){return e("float64array:"),this.dispatch(Array.prototype.slice.call(t))},_arraybuffer(t){return e("arraybuffer:"),this.dispatch(new Uint8Array(t))},_url(t){return e("url:"+t.toString())},_map(t){e("map:");const i=[...t];return this._array(i,s.unorderedSets!==!1)},_set(t){e("set:");const i=[...t];return this._array(i,s.unorderedSets!==!1)},_file(t){return e("file:"),this.dispatch([t.name,t.size,t.type,t.lastModfied])},_blob(){if(s.ignoreUnknown)return e("[blob]");throw new Error(`Hashing Blob objects is currently not supported
|
|
Use "options.replacer" or "options.ignoreUnknown"
|
|
`)},_domwindow(){return e("domwindow")},_bigint(t){return e("bigint:"+t.toString())},_process(){return e("process")},_timer(){return e("timer")},_pipe(){return e("pipe")},_tcp(){return e("tcp")},_udp(){return e("udp")},_tty(){return e("tty")},_statwatcher(){return e("statwatcher")},_securecontext(){return e("securecontext")},_connection(){return e("connection")},_zlib(){return e("zlib")},_context(){return e("context")},_nodescript(){return e("nodescript")},_httpparser(){return e("httpparser")},_dataview(){return e("dataview")},_signal(){return e("signal")},_fsevent(){return e("fsevent")},_tlswrap(){return e("tlswrap")}}}function k(s){return typeof s!="function"?!1:/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code]\s+}$/i.exec(Function.prototype.toString.call(s))!=null}class g{constructor(n,r){n=this.words=n||[],this.sigBytes=r!==void 0?r:n.length*4}toString(n){return(n||L).stringify(this)}concat(n){if(this.clamp(),this.sigBytes%4)for(let r=0;r<n.sigBytes;r++){const e=n.words[r>>>2]>>>24-r%4*8&255;this.words[this.sigBytes+r>>>2]|=e<<24-(this.sigBytes+r)%4*8}else for(let r=0;r<n.sigBytes;r+=4)this.words[this.sigBytes+r>>>2]=n.words[r>>>2];return this.sigBytes+=n.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new g([...this.words])}}const L={stringify(s){const n=[];for(let r=0;r<s.sigBytes;r++){const e=s.words[r>>>2]>>>24-r%4*8&255;n.push((e>>>4).toString(16),(e&15).toString(16))}return n.join("")}},E={stringify(s){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=[];for(let e=0;e<s.sigBytes;e+=3){const t=s.words[e>>>2]>>>24-e%4*8&255,i=s.words[e+1>>>2]>>>24-(e+1)%4*8&255,c=s.words[e+2>>>2]>>>24-(e+2)%4*8&255,l=t<<16|i<<8|c;for(let a=0;a<4&&e*8+a*6<s.sigBytes*8;a++)r.push(n.charAt(l>>>6*(3-a)&63))}return r.join("")}},K={parse(s){const n=s.length,r=[];for(let e=0;e<n;e++)r[e>>>2]|=(s.charCodeAt(e)&255)<<24-e%4*8;return new g(r,n)}},W={parse(s){return K.parse(unescape(encodeURIComponent(s)))}};class I{constructor(){this._minBufferSize=0,this.blockSize=512/32,this.reset()}reset(){this._data=new g,this._nDataBytes=0}_append(n){typeof n=="string"&&(n=W.parse(n)),this._data.concat(n),this._nDataBytes+=n.sigBytes}_doProcessBlock(n,r){}_process(n){let r,e=this._data.sigBytes/(this.blockSize*4);n?e=Math.ceil(e):e=Math.max((e|0)-this._minBufferSize,0);const t=e*this.blockSize,i=Math.min(t*4,this._data.sigBytes);if(t){for(let c=0;c<t;c+=this.blockSize)this._doProcessBlock(this._data.words,c);r=this._data.words.splice(0,t),this._data.sigBytes-=i}return new g(r,i)}}class J extends I{update(n){return this._append(n),this._process(),this}finalize(n){n&&this._append(n)}}const q=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],Q=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],_=[];class V extends J{constructor(){super(),this.reset()}reset(){super.reset(),this._hash=new g([...q])}_doProcessBlock(n,r){const e=this._hash.words;let t=e[0],i=e[1],c=e[2],l=e[3],a=e[4],f=e[5],h=e[6],d=e[7];for(let o=0;o<64;o++){if(o<16)_[o]=n[r+o]|0;else{const m=_[o-15],C=(m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3,w=_[o-2],P=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;_[o]=C+_[o-7]+P+_[o-16]}const y=a&f^~a&h,u=t&i^t&c^i&c,p=(t<<30|t>>>2)^(t<<19|t>>>13)^(t<<10|t>>>22),B=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),b=d+B+y+Q[o]+_[o],v=p+u;d=h,h=f,f=a,a=l+b|0,l=c,c=i,i=t,t=b+v|0}e[0]=e[0]+t|0,e[1]=e[1]+i|0,e[2]=e[2]+c|0,e[3]=e[3]+l|0,e[4]=e[4]+a|0,e[5]=e[5]+f|0,e[6]=e[6]+h|0,e[7]=e[7]+d|0}finalize(n){super.finalize(n);const r=this._nDataBytes*8,e=this._data.sigBytes*8;return this._data.words[e>>>5]|=128<<24-e%32,this._data.words[(e+64>>>9<<4)+14]=Math.floor(r/4294967296),this._data.words[(e+64>>>9<<4)+15]=r,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function G(s){return new V().finalize(s).toString(E)}function Z(s,n={}){const r=typeof s=="string"?s:T(s,n);return G(r).slice(0,10)}export{Z as h,Y as u};
|