@skaldapp/runtime 3.4.5 → 3.4.6

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.
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-CMxvf4Kt.js";var t=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,n=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,r=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function i(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){a(e);return}return t}function a(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function o(e,a={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let o=e.trim();if(o.length<=9)switch(o.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!r.test(e)){if(a.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(t.test(e)||n.test(e)){if(a.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,i)}return JSON.parse(e)}catch(t){if(a.strict)throw t;return e}}String.fromCharCode;var s=/#/g,c=/&/g,l=/\//g,u=/=/g,d=/\+/g,ee=/%5e/gi,f=/%60/gi,p=/%7c/gi,te=/%20/gi;function ne(e){return encodeURI(``+e).replace(p,`|`)}function m(e){return ne(typeof e==`string`?e:JSON.stringify(e)).replace(d,`%2B`).replace(te,`+`).replace(s,`%23`).replace(c,`%26`).replace(f,"`").replace(ee,`^`).replace(l,`%2F`)}function h(e){return m(e).replace(u,`%3D`)}function g(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function _(e){return g(e.replace(d,` `))}function v(e){return g(e.replace(d,` `))}function y(e=``){let t=Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=_(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=v(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function b(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${h(e)}=${m(t)}`).join(`&`):`${h(e)}=${m(t)}`:h(e)}function x(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>b(t,e[t])).filter(Boolean).join(`&`)}var S=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,re=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,ie=/^([/\\]\s*){2,}[^/\\]/,ae=/\/$|\/\?|\/#/,C=/^\.?\//;function w(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?S.test(e):re.test(e)||(t.acceptRelative?ie.test(e):!1)}function T(e=``,t){return t?ae.test(e):e.endsWith(`/`)}function E(e=``,t){if(!t)return(T(e)?e.slice(0,-1):e)||`/`;if(!T(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function D(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(T(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function O(e,t){if(A(t)||w(e))return e;let n=E(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return M(n,e)}function k(e,t){let n=P(e);return n.search=x({...y(n.search),...t}),I(n)}function A(e){return!e||e===`/`}function j(e){return e&&e!==`/`}function M(e,...t){let n=e||``;for(let e of t.filter(e=>j(e)))if(n){let t=e.replace(C,``);n=D(n)+t}else n=e;return n}var N=Symbol.for(`ufo:protocolRelative`);function P(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!w(e,{acceptRelative:!0}))return t?P(t+e):F(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=F(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[N]:!r}}function F(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function I(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[N]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var L=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function R(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new L(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}var oe=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function z(e=`GET`){return oe.has(e.toUpperCase())}function B(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}var V=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),H=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function U(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return H.test(t)?`json`:t===`text/event-stream`?`stream`:V.has(t)||t.startsWith(`text/`)?`text`:`blob`}function W(e,t,n,r){let i=G(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function G(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function K(e,t){if(t)if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}var q=new Set([408,409,425,429,500,502,503,504]),se=new Set([101,204,205,304]);function J(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!z(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):q.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=R(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,s={}){let c={request:a,options:W(a,s,e.defaults,n),response:void 0,error:void 0};if(c.options.method&&(c.options.method=c.options.method.toUpperCase()),c.options.onRequest&&(await K(c,c.options.onRequest),c.options.headers instanceof n||(c.options.headers=new n(c.options.headers||{}))),typeof c.request==`string`&&(c.options.baseURL&&(c.request=O(c.request,c.options.baseURL)),c.options.query&&(c.request=k(c.request,c.options.query),delete c.options.query),`query`in c.options&&delete c.options.query,`params`in c.options&&delete c.options.params),c.options.body&&z(c.options.method))if(B(c.options.body)){let e=c.options.headers.get(`content-type`);typeof c.options.body!=`string`&&(c.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(c.options.body).toString():JSON.stringify(c.options.body)),e||c.options.headers.set(`content-type`,`application/json`),c.options.headers.has(`accept`)||c.options.headers.set(`accept`,`application/json`)}else (`pipeTo`in c.options.body&&typeof c.options.body.pipeTo==`function`||typeof c.options.body.pipe==`function`)&&(`duplex`in c.options||(c.options.duplex=`half`));let l;if(!c.options.signal&&c.options.timeout){let e=new r;l=setTimeout(()=>{let t=Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},c.options.timeout),c.options.signal=e.signal}try{c.response=await t(c.request,c.options)}catch(e){return c.error=e,c.options.onRequestError&&await K(c,c.options.onRequestError),await i(c)}finally{l&&clearTimeout(l)}if((c.response.body||c.response._bodyInit)&&!se.has(c.response.status)&&c.options.method!==`HEAD`){let e=(c.options.parseResponse?`json`:c.options.responseType)||U(c.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await c.response.text(),t=c.options.parseResponse||o;c.response._data=t(e);break}case`stream`:c.response._data=c.response.body||c.response._bodyInit;break;default:c.response._data=await c.response[e]()}}return c.options.onResponse&&await K(c,c.options.onResponse),!c.options.ignoreResponseError&&c.response.status>=400&&c.response.status<600?(c.options.onResponseError&&await K(c,c.options.onResponseError),await i(c)):c.response},s=async function(e,t){return(await a(e,t))._data};return s.raw=a,s.native=(...e)=>t(...e),s.create=(t={},n={})=>J({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),s}var ce=e({$fetch:()=>le,AbortController:()=>Q,Headers:()=>Z,createFetch:()=>J,fetch:()=>X,ofetch:()=>$}),Y=(function(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`unable to locate global object`)})(),X=Y.fetch?(...e)=>Y.fetch(...e):()=>Promise.reject(Error(`[ofetch] global.fetch is not supported!`)),Z=Y.Headers,Q=Y.AbortController,$=J({fetch:X,Headers:Z,AbortController:Q}),le=$;export{$ as n,ce as t};
1
+ import{r as e}from"./rolldown-runtime-DAXXjFlN.js";var t=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,n=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,r=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function i(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){a(e);return}return t}function a(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function o(e,a={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let o=e.trim();if(o.length<=9)switch(o.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!r.test(e)){if(a.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(t.test(e)||n.test(e)){if(a.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,i)}return JSON.parse(e)}catch(t){if(a.strict)throw t;return e}}String.fromCharCode;var s=/#/g,c=/&/g,l=/\//g,u=/=/g,d=/\+/g,ee=/%5e/gi,f=/%60/gi,p=/%7c/gi,te=/%20/gi;function ne(e){return encodeURI(``+e).replace(p,`|`)}function m(e){return ne(typeof e==`string`?e:JSON.stringify(e)).replace(d,`%2B`).replace(te,`+`).replace(s,`%23`).replace(c,`%26`).replace(f,"`").replace(ee,`^`).replace(l,`%2F`)}function h(e){return m(e).replace(u,`%3D`)}function g(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function _(e){return g(e.replace(d,` `))}function v(e){return g(e.replace(d,` `))}function y(e=``){let t=Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=_(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=v(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function b(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${h(e)}=${m(t)}`).join(`&`):`${h(e)}=${m(t)}`:h(e)}function x(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>b(t,e[t])).filter(Boolean).join(`&`)}var S=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,re=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,ie=/^([/\\]\s*){2,}[^/\\]/,ae=/\/$|\/\?|\/#/,C=/^\.?\//;function w(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?S.test(e):re.test(e)||(t.acceptRelative?ie.test(e):!1)}function T(e=``,t){return t?ae.test(e):e.endsWith(`/`)}function E(e=``,t){if(!t)return(T(e)?e.slice(0,-1):e)||`/`;if(!T(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function D(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(T(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function O(e,t){if(A(t)||w(e))return e;let n=E(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return M(n,e)}function k(e,t){let n=P(e);return n.search=x({...y(n.search),...t}),I(n)}function A(e){return!e||e===`/`}function j(e){return e&&e!==`/`}function M(e,...t){let n=e||``;for(let e of t.filter(e=>j(e)))if(n){let t=e.replace(C,``);n=D(n)+t}else n=e;return n}var N=Symbol.for(`ufo:protocolRelative`);function P(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!w(e,{acceptRelative:!0}))return t?P(t+e):F(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=F(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[N]:!r}}function F(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function I(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[N]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var L=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function R(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new L(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}var oe=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function z(e=`GET`){return oe.has(e.toUpperCase())}function B(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}var V=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),H=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function U(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return H.test(t)?`json`:t===`text/event-stream`?`stream`:V.has(t)||t.startsWith(`text/`)?`text`:`blob`}function W(e,t,n,r){let i=G(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function G(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function K(e,t){if(t)if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}var q=new Set([408,409,425,429,500,502,503,504]),se=new Set([101,204,205,304]);function J(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!z(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):q.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=R(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,s={}){let c={request:a,options:W(a,s,e.defaults,n),response:void 0,error:void 0};if(c.options.method&&(c.options.method=c.options.method.toUpperCase()),c.options.onRequest&&(await K(c,c.options.onRequest),c.options.headers instanceof n||(c.options.headers=new n(c.options.headers||{}))),typeof c.request==`string`&&(c.options.baseURL&&(c.request=O(c.request,c.options.baseURL)),c.options.query&&(c.request=k(c.request,c.options.query),delete c.options.query),`query`in c.options&&delete c.options.query,`params`in c.options&&delete c.options.params),c.options.body&&z(c.options.method))if(B(c.options.body)){let e=c.options.headers.get(`content-type`);typeof c.options.body!=`string`&&(c.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(c.options.body).toString():JSON.stringify(c.options.body)),e||c.options.headers.set(`content-type`,`application/json`),c.options.headers.has(`accept`)||c.options.headers.set(`accept`,`application/json`)}else(`pipeTo`in c.options.body&&typeof c.options.body.pipeTo==`function`||typeof c.options.body.pipe==`function`)&&(`duplex`in c.options||(c.options.duplex=`half`));let l;if(!c.options.signal&&c.options.timeout){let e=new r;l=setTimeout(()=>{let t=Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},c.options.timeout),c.options.signal=e.signal}try{c.response=await t(c.request,c.options)}catch(e){return c.error=e,c.options.onRequestError&&await K(c,c.options.onRequestError),await i(c)}finally{l&&clearTimeout(l)}if((c.response.body||c.response._bodyInit)&&!se.has(c.response.status)&&c.options.method!==`HEAD`){let e=(c.options.parseResponse?`json`:c.options.responseType)||U(c.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await c.response.text(),t=c.options.parseResponse||o;c.response._data=t(e);break}case`stream`:c.response._data=c.response.body||c.response._bodyInit;break;default:c.response._data=await c.response[e]()}}return c.options.onResponse&&await K(c,c.options.onResponse),!c.options.ignoreResponseError&&c.response.status>=400&&c.response.status<600?(c.options.onResponseError&&await K(c,c.options.onResponseError),await i(c)):c.response},s=async function(e,t){return(await a(e,t))._data};return s.raw=a,s.native=(...e)=>t(...e),s.create=(t={},n={})=>J({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),s}var ce=e({$fetch:()=>le,AbortController:()=>Q,Headers:()=>Z,createFetch:()=>J,fetch:()=>X,ofetch:()=>$}),Y=(function(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`unable to locate global object`)})(),X=Y.fetch?(...e)=>Y.fetch(...e):()=>Promise.reject(Error(`[ofetch] global.fetch is not supported!`)),Z=Y.Headers,Q=Y.AbortController,$=J({fetch:X,Headers:Z,AbortController:Q}),le=$;export{$ as n,ce as t};
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e),f=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});export{d as a,f as i,o as n,u as o,c as r,s as t};