var k=Object.defineProperty;var E=n=>{throw TypeError(n)};var R=(n,e,r)=>e in n?k(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r;var d=(n,e,r)=>R(n,typeof e!="symbol"?e+"":e,r),T=(n,e,r)=>e.has(n)||E("Cannot "+r);var j=(n,e,r)=>(T(n,e,"read from private field"),r?r.call(n):e.get(n)),I=(n,e,r)=>e.has(n)?E("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,r);import{g as M,a9 as F,ar as x,s as C,as as u,at as q}from"./DYWyN9gj.js";import{u as L}from"./BrHTsVVn.js";function P(n){return typeof n=="string"?`'${n}'`:new J().serialize(n)}const J=function(){var e;class n{constructor(){I(this,e,new Map)}compare(t,s){const i=typeof t,o=typeof s;return i==="string"&&o==="string"?t.localeCompare(s):i==="number"&&o==="number"?t-s:String.prototype.localeCompare.call(this.serialize(t,!0),this.serialize(s,!0))}serialize(t,s){if(t===null)return"null";switch(typeof t){case"string":return s?t:`'${t}'`;case"bigint":return`${t}n`;case"object":return this.$object(t);case"function":return this.$function(t)}return String(t)}serializeObject(t){const s=Object.prototype.toString.call(t);if(s!=="[object Object]")return this.serializeBuiltInType(s.length<10?`unknown:${s}`:s.slice(8,-1),t);const i=t.constructor,o=i===Object||i===void 0?"":i.name;if(o!==""&&globalThis[o]===i)return this.serializeBuiltInType(o,t);if(typeof t.toJSON=="function"){const a=t.toJSON();return o+(a!==null&&typeof a=="object"?this.$object(a):`(${this.serialize(a)})`)}return this.serializeObjectEntries(o,Object.entries(t))}serializeBuiltInType(t,s){const i=this["$"+t];if(i)return i.call(this,s);if(typeof(s==null?void 0:s.entries)=="function")return this.serializeObjectEntries(t,s.entries());throw new Error(`Cannot serialize ${t}`)}serializeObjectEntries(t,s){const i=Array.from(s).sort((a,c)=>this.compare(a[0],c[0]));let o=`${t}{`;for(let a=0;a<i.length;a++){const[c,f]=i[a];o+=`${this.serialize(c,!0)}:${this.serialize(f)}`,a<i.length-1&&(o+=",")}return o+"}"}$object(t){let s=j(this,e).get(t);return s===void 0&&(j(this,e).set(t,`#${j(this,e).size}`),s=this.serializeObject(t),j(this,e).set(t,s)),s}$function(t){const s=Function.prototype.toString.call(t);return s.slice(-15)==="[native code] }"?`${t.name||""}()[native]`:`${t.name}(${t.length})${s.replace(/\s*\n\s*/g,"")}`}$Array(t){let s="[";for(let i=0;i<t.length;i++)s+=this.serialize(t[i]),i<t.length-1&&(s+=",");return s+"]"}$Date(t){try{return`Date(${t.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(t){return`ArrayBuffer[${new Uint8Array(t).join(",")}]`}$Set(t){return`Set${this.$Array(Array.from(t).sort((s,i)=>this.compare(s,i)))}`}$Map(t){return this.serializeObjectEntries("Map",t.entries())}}e=new WeakMap;for(const r of["Error","RegExp","URL"])n.prototype["$"+r]=function(t){return`${r}(${t})`};for(const r of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])n.prototype["$"+r]=function(t){return`${r}[${t.join(",")}]`};for(const r of["BigInt64Array","BigUint64Array"])n.prototype["$"+r]=function(t){return`${r}[${t.join("n,")}${t.length>0?"n":""}]`};return n}(),N=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],G=[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],K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",g=[];class V{constructor(){d(this,"_data",new $);d(this,"_hash",new $([...N]));d(this,"_nDataBytes",0);d(this,"_minBufferSize",0)}finalize(e){e&&this._append(e);const r=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(r/4294967296),this._data.words[(t+64>>>9<<4)+15]=r,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,r){const t=this._hash.words;let s=t[0],i=t[1],o=t[2],a=t[3],c=t[4],f=t[5],m=t[6],B=t[7];for(let h=0;h<64;h++){if(h<16)g[h]=e[r+h]|0;else{const y=g[h-15],l=(y<<25|y>>>7)^(y<<14|y>>>18)^y>>>3,w=g[h-2],p=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;g[h]=l+g[h-7]+p+g[h-16]}const A=c&f^~c&m,O=s&i^s&o^i&o,v=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),S=(c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25),z=B+S+A+G[h]+g[h],_=v+O;B=m,m=f,f=c,c=a+z|0,a=o,o=i,i=s,s=z+_|0}t[0]=t[0]+s|0,t[1]=t[1]+i|0,t[2]=t[2]+o|0,t[3]=t[3]+a|0,t[4]=t[4]+c|0,t[5]=t[5]+f|0,t[6]=t[6]+m|0,t[7]=t[7]+B|0}_append(e){typeof e=="string"&&(e=$.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let r,t=this._data.sigBytes/64;e?t=Math.ceil(t):t=Math.max((t|0)-this._minBufferSize,0);const s=t*16,i=Math.min(s*4,this._data.sigBytes);if(s){for(let o=0;o<s;o+=16)this._doProcessBlock(this._data.words,o);r=this._data.words.splice(0,s),this._data.sigBytes-=i}return new $(r,i)}}class ${constructor(e,r){d(this,"words");d(this,"sigBytes");e=this.words=e||[],this.sigBytes=r===void 0?e.length*4:r}static fromUtf8(e){const r=unescape(encodeURIComponent(e)),t=r.length,s=[];for(let i=0;i<t;i++)s[i>>>2]|=(r.charCodeAt(i)&255)<<24-i%4*8;return new $(s,t)}toBase64(){const e=[];for(let r=0;r<this.sigBytes;r+=3){const t=this.words[r>>>2]>>>24-r%4*8&255,s=this.words[r+1>>>2]>>>24-(r+1)%4*8&255,i=this.words[r+2>>>2]>>>24-(r+2)%4*8&255,o=t<<16|s<<8|i;for(let a=0;a<4&&r*8+a*6<this.sigBytes*8;a++)e.push(K.charAt(o>>>6*(3-a)&63))}return e.join("")}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let r=0;r<e.sigBytes;r++){const t=e.words[r>>>2]>>>24-r%4*8&255;this.words[this.sigBytes+r>>>2]|=t<<24-(this.sigBytes+r)%4*8}else for(let r=0;r<e.sigBytes;r+=4)this.words[this.sigBytes+r>>>2]=e.words[r>>>2];this.sigBytes+=e.sigBytes}}function H(n){return new V().finalize(n).toBase64()}function b(n){return H(P(n))}function tt(n,e,r){const[t={},s]=typeof e=="string"?[{},e]:[e,r],i=M(()=>u(n)),o=M(()=>u(t.key)||"$f"+b([s,typeof i.value=="string"?i.value:"",...Q(t)]));if(!t.baseURL&&typeof i.value=="string"&&i.value[0]==="/"&&i.value[1]==="/")throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const{server:a,lazy:c,default:f,transform:m,pick:B,watch:h,immediate:A,getCachedData:O,deep:v,dedupe:S,...z}=t,_=F({...x,...z,cache:typeof t.cache=="boolean"?void 0:t.cache}),y={server:a,lazy:c,default:f,transform:m,pick:B,immediate:A,getCachedData:O,deep:v,dedupe:S,watch:h===!1?[]:[...h||[],_]};if(!A){let p=function(){y.immediate=!0};C(o,p,{flush:"sync",once:!0}),C([...h||[],_],p,{flush:"sync",once:!0})}let l;return L(h===!1?o.value:o,()=>{var U;(U=l==null?void 0:l.abort)==null||U.call(l,new DOMException("Request aborted as another request to the same endpoint was initiated.","AbortError")),l=typeof AbortController<"u"?new AbortController:{};const p=u(t.timeout);let D;return p&&(D=setTimeout(()=>l.abort(new DOMException("Request aborted due to timeout.","AbortError")),p),l.signal.onabort=()=>clearTimeout(D)),(t.$fetch||globalThis.$fetch)(i.value,{signal:l.signal,..._}).finally(()=>{clearTimeout(D)})},y)}function Q(n){var r;const e=[((r=u(n.method))==null?void 0:r.toUpperCase())||"GET",u(n.baseURL)];for(const t of[n.params||n.query]){const s=u(t);if(!s)continue;const i={};for(const[o,a]of Object.entries(s))i[u(o)]=u(a);e.push(i)}if(n.body){const t=u(n.body);if(!t)e.push(b(t));else if(t instanceof ArrayBuffer)e.push(b(Object.fromEntries([...new Uint8Array(t).entries()].map(([s,i])=>[s,i.toString()]))));else if(t instanceof FormData){const s={};for(const i of t.entries()){const[o,a]=i;s[o]=a instanceof File?a.name:a}e.push(b(s))}else if(q(t))e.push(b(F(t)));else try{e.push(b(t))}catch{console.warn("[useFetch] Failed to hash body",t)}}return e}export{tt as u};
