@wener/utils 1.1.23 → 1.1.25

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,2 +1,2 @@
1
- "use strict";var b=Object.create;var u=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var q=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of g(e))!p.call(t,o)&&o!==r&&u(t,o,{get:()=>e[o],enumerable:!(n=d(e,o))||n.enumerable});return t};var h=(t,e,r)=>(r=t!=null?b(y(t)):{},q(e||!t||!t.__esModule?u(r,"default",{value:t,enumerable:!0}):r,t));var R=require("../getGlobalThis-304f74e0.js");function f(t){if("fetch"in globalThis)return!1;if(t){const{default:e,Response:r,Headers:n,Request:o,AbortError:c,FetchError:s,FormData:i,Blob:l,File:a}=t;return Object.assign(globalThis,{fetch:e,Response:r,Headers:n,Request:o,AbortError:c,FetchError:s,FormData:i,Blob:l,File:a}),!0}return import("node-fetch").then(e=>f(e))}function m({proxy:t,fetch:e}={}){const r=R.getGlobalThis();if(!t)return e||r.fetch;let n;const o=r.Request;let c,s;return async(i,l)=>{if(!n){const{default:a}=await Promise.resolve().then(function(){return require("../index-69020bc5.js")}).then(function(F){return F.index});n=a(t)}return c||({Request:c,default:s}=await import("node-fetch")),e||=s,i instanceof o?e(new o(i,{agent:n})):i instanceof c?e(new c(i,{agent:n})):e(i,{...l,agent:n})}}exports.createFetchWithProxyByNodeFetch=m,exports.polyfillFetch=f;
1
+ "use strict";var F=Object.create;var f=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var d=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of g(t))!y.call(e,n)&&n!==r&&f(e,n,{get:()=>t[n],enumerable:!(o=b(t,n))||o.enumerable});return e};var h=(e,t,r)=>(r=e!=null?F(p(e)):{},d(t||!e||!e.__esModule?f(r,"default",{value:e,enumerable:!0}):r,e));var R=require("../getGlobalThis-304f74e0.js");function u(e){if("fetch"in globalThis)return!1;if(e){const{default:t,Response:r,Headers:o,Request:n,AbortError:c,FetchError:s,FormData:i,Blob:a,File:l}=e;return Object.assign(globalThis,{fetch:t,Response:r,Headers:o,Request:n,AbortError:c,FetchError:s,FormData:i,Blob:a,File:l}),!0}return import("node-fetch").then(t=>u(t))}function m({proxy:e,fetch:t}={}){const r=R.getGlobalThis();if(!e)return t||r.fetch;let o;const n=r.Request;let c,s;return async(i,a)=>{if(!o){const{default:l}=await import("https-proxy-agent");o=l(e)}return c||({Request:c,default:s}=await import("node-fetch")),t||=s,i instanceof n?t(new n(i,{agent:o})):i instanceof c?t(new c(i,{agent:o})):t(i,{...a,agent:o})}}exports.createFetchWithProxyByNodeFetch=m,exports.polyfillFetch=u;
2
2
  //# sourceMappingURL=node-fetch.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-fetch.cjs","sources":["../../../src/servers/polyfill/polyfillFetch.ts","../../../src/servers/fetch/createFetchWithProxyByNodeFetch.ts"],"sourcesContent":["import type { MaybePromise } from '../../asyncs/MaybePromise';\n\nexport function polyfillFetch(nodeFetch: typeof import('node-fetch')): boolean;\nexport function polyfillFetch(nodeFetch?: undefined): Promise<boolean>;\nexport function polyfillFetch(nodeFetch?: typeof import('node-fetch')): MaybePromise<boolean> {\n if ('fetch' in globalThis) {\n return false;\n }\n // sync mode\n if (nodeFetch) {\n const { default: fetch, Response, Headers, Request, AbortError, FetchError, FormData, Blob, File } = nodeFetch;\n Object.assign(globalThis, {\n fetch,\n Response,\n Headers,\n Request,\n AbortError,\n FetchError,\n FormData,\n Blob,\n File,\n });\n // abort controller\n return true;\n }\n return import('node-fetch').then((v) => polyfillFetch(v));\n}\n","import { type FetchLike } from '../../fetch';\nimport { getGlobalThis } from '../../isomorphics/getGlobalThis';\n\nexport function createFetchWithProxyByNodeFetch({\n proxy,\n fetch,\n}: { proxy?: string; fetch?: FetchLike } = {}): FetchLike {\n const globalThis = getGlobalThis();\n if (!proxy) {\n return fetch || globalThis.fetch;\n }\n\n let agent: any;\n const Request = globalThis.Request;\n let NodeRequest: any;\n let NodeFetch: any;\n return async (url, init?: RequestInit) => {\n if (!agent) {\n const { default: createHttpsProxyAgent } = await import('https-proxy-agent');\n agent = (createHttpsProxyAgent as any)(proxy);\n }\n\n // node-fetch 才可以,node v18 fetch 不支持\n if (!NodeRequest) {\n ({ Request: NodeRequest, default: NodeFetch } = await import('node-fetch'));\n }\n\n fetch ||= NodeFetch;\n\n if (url instanceof Request) {\n return (fetch as any)(new Request(url, { agent } as any));\n }\n if ((url as any) instanceof NodeRequest) {\n return (fetch as any)(new NodeRequest(url, { agent } as any));\n }\n return (fetch as any)(url, {\n ...init,\n agent,\n } as any);\n };\n}\n"],"names":["polyfillFetch","nodeFetch","fetch","Response","Headers","Request","AbortError","FetchError","FormData","Blob","File","v","createFetchWithProxyByNodeFetch","proxy","globalThis","getGlobalThis","agent","NodeRequest","NodeFetch","url","init","createHttpsProxyAgent","n"],"mappings":"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"}
1
+ {"version":3,"file":"node-fetch.cjs","sources":["../../../src/servers/polyfill/polyfillFetch.ts","../../../src/servers/fetch/createFetchWithProxyByNodeFetch.ts"],"sourcesContent":["import type { MaybePromise } from '../../asyncs/MaybePromise';\n\nexport function polyfillFetch(nodeFetch: typeof import('node-fetch')): boolean;\nexport function polyfillFetch(nodeFetch?: undefined): Promise<boolean>;\nexport function polyfillFetch(nodeFetch?: typeof import('node-fetch')): MaybePromise<boolean> {\n if ('fetch' in globalThis) {\n return false;\n }\n // sync mode\n if (nodeFetch) {\n const { default: fetch, Response, Headers, Request, AbortError, FetchError, FormData, Blob, File } = nodeFetch;\n Object.assign(globalThis, {\n fetch,\n Response,\n Headers,\n Request,\n AbortError,\n FetchError,\n FormData,\n Blob,\n File,\n });\n // abort controller\n return true;\n }\n return import('node-fetch').then((v) => polyfillFetch(v));\n}\n","import { type FetchLike } from '../../fetch';\nimport { getGlobalThis } from '../../isomorphics/getGlobalThis';\n\nexport function createFetchWithProxyByNodeFetch({\n proxy,\n fetch,\n}: { proxy?: string; fetch?: FetchLike } = {}): FetchLike {\n const globalThis = getGlobalThis();\n if (!proxy) {\n return fetch || globalThis.fetch;\n }\n\n let agent: any;\n const Request = globalThis.Request;\n let NodeRequest: any;\n let NodeFetch: any;\n return async (url, init?: RequestInit) => {\n if (!agent) {\n const { default: createHttpsProxyAgent } = await import('https-proxy-agent');\n agent = (createHttpsProxyAgent as any)(proxy);\n }\n\n // node-fetch 才可以,node v18 fetch 不支持\n if (!NodeRequest) {\n ({ Request: NodeRequest, default: NodeFetch } = await import('node-fetch'));\n }\n\n fetch ||= NodeFetch;\n\n if (url instanceof Request) {\n return (fetch as any)(new Request(url, { agent } as any));\n }\n if ((url as any) instanceof NodeRequest) {\n return (fetch as any)(new NodeRequest(url, { agent } as any));\n }\n return (fetch as any)(url, {\n ...init,\n agent,\n } as any);\n };\n}\n"],"names":["polyfillFetch","nodeFetch","fetch","Response","Headers","Request","AbortError","FetchError","FormData","Blob","File","v","createFetchWithProxyByNodeFetch","proxy","globalThis","getGlobalThis","agent","NodeRequest","NodeFetch","url","init","createHttpsProxyAgent"],"mappings":"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"}
package/dist/esm/index.js CHANGED
@@ -1,21 +1,21 @@
1
- import{g as O}from"./getGlobalThis-b7ad0cf9.js";function De(e,t=null,r=ce){return Object.fromEntries(t===null?Object.entries(e).map(([n,o])=>[n,r(o)]):t.map(n=>[n,r(n)]))}function ce(e){return Array.isArray(e)?e[0]:e}function Ve(e){return Array.isArray(e)?e[e.length-1]:e}function Fe(e){return Array.isArray(e)?e:e==null?[]:[e]}async function ze(e){const t=[];for await(const r of e)t.push(r);return t}function _(e){if(typeof e!="string")return Array.isArray(e)?e:[e];const t=e.split(".");if(!e.includes("["))return t;const r=[];for(const n of t)if(!n.endsWith("]"))r.push(n);else{const o=n.split("[");for(let s of o)s.endsWith("]")&&(s=s.slice(0,-1)),r.push(s)}return r}function H(e,t,r){const n=_(t);let o=e;for(const s of n)o=o?o[s]:void 0;return o===void 0?r:o}function _e(e,t,r,n=!0){const o=_(t);let s=0;const i=o.length;let d=e,y,g;for(;s<i&&(g=o[s++],!(g==="__proto__"||g==="constructor"||g==="prototype"));)d=d[g]=s===i?n?G(d[g],r):r:typeof(y=d[g])==typeof o?y:o[s]*0!==0||~(""+o[s]).indexOf(".")?{}:[]}function G(e,t){let r;if(typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))for(r=0;r<t.length;r++)e[r]=G(e[r],t[r]);else for(r in t){if(r==="__proto__"||r==="constructor"||r==="prototype")break;e[r]=G(e[r],t[r])}return e}return t}function He(e){return Ge(e)&&!Ze(e)}function Ge(e){return!!e&&typeof e=="object"}function Ze(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Ke(e)}var Je=typeof Symbol=="function"&&Symbol.for,We=Je?Symbol.for("react.element"):60103;function Ke(e){return e.$$typeof===We}function Ye(e){return Array.isArray(e)?[]:{}}function P(e,t){return t.clone!==!1&&t.isMergeableObject(e)?B(Ye(e),e,t):e}function Qe(e,t,r){return e.concat(t).map(function(n){return P(n,r)})}function Xe(e,t){if(!t.customMerge)return B;var r=t.customMerge(e);return typeof r=="function"?r:B}function et(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function ue(e){return Object.keys(e).concat(et(e))}function le(e,t){try{return t in e}catch{return!1}}function tt(e,t){return le(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function rt(e,t,r){const n={};return r.isMergeableObject(e)&&ue(e).forEach(o=>{n[o]=P(e[o],r)}),ue(t).forEach(o=>{tt(e,o)||(le(e,o)&&r.isMergeableObject(t[o])?n[o]=Xe(o,r)(e[o],t[o],r):n[o]=P(t[o],r))}),n}function B(e,t,r){const n={arrayMerge:Qe,isMergeableObject:He,...r,cloneUnlessOtherwiseSpecified:P};let o=Array.isArray(t),s=Array.isArray(e);return o===s?o?n.arrayMerge(e,t,n):rt(e,t,n):P(t,n)}B.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return B(r,n,t)},{})};function k(e){return e&&(e instanceof Promise||e.then&&e.catch)}function Z(e){const t={resolve(n){throw new Error("pending resolve")},reject(n){throw new Error("pending reject")}},r=Object.assign(new Promise((n,o)=>{t.reject=o,t.resolve=n}),{resolve(n){t.resolve(n)},reject(n){t.resolve(n)}});if(e){const n=t.resolve;let o=!0;t.resolve=d=>{o=!1,n(d)};const s=r.then.bind(r);r.then=(...d)=>{if(o){o=!1;try{const y=e(t.resolve,t.reject);k(y)?y.then(t.resolve,t.reject):y!==void 0&&t.resolve(y)}catch(y){t.reject(y)}}return s(...d)};const i=t;return i.then=r.then,i.catch=r.catch.bind(r),r.finally&&(i.finally=r.finally),Object.defineProperty(i,Symbol.species,{get(){return Promise}}),i}return r}function nt(e,t,r=t){let n;const o=async()=>{await e(),n=setTimeout(o,t)};return n=setTimeout(o,r),()=>n}function ot(e){clearTimeout(e==null?void 0:e())}function st(e){const t=[];let r;{let n;t.push(n=Z()),r=(o,s)=>{if(s!==void 0)n.resolve([void 0,!0,s]);else if(o!==void 0)n.resolve(o);else return;t.push(n=Z())}}return e(r),async function*(){let n,o;for(let s=0,i=!1;!i;s++){let d=await t[s];if(delete t[s],[n,i,o]=d,o)throw o;n!==void 0&&(yield n)}}()}function fe(e){return typeof(e==null?void 0:e.next)=="function"}function J(e){if(k(e))return e.then(t=>J(t));if(fe(e)){let t=e.next();return k(t)?t.then(r=>[r.value,r.done]):[t.value,t.done]}return[e]}function it(e){const t=J(e);return k(t)?t.then(r=>r[0]):t[0]}const at=e=>new Promise(t=>setTimeout(t,e));function ct(e,t){const r=new de;let n;return Promise.race([e,new Promise((o,s)=>{n=setTimeout(()=>{s(r)},t)})]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}class de extends Error{constructor(){super("TimeoutError")}}function ut(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0}const he=Object.prototype.hasOwnProperty,lt=typeof Element<"u";function ye(e,t,r){for(r of e.keys())if(N(r,t))return r}function N(e,t){let r,n,o;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&N(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(o=n,o&&typeof o=="object"&&(o=ye(t,o),!o)||!t.has(o))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(o=n[0],o&&typeof o=="object"&&(o=ye(t,o),!o)||!N(n[1],t.get(o)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(lt&&e instanceof Element)return!1;if(!r||typeof e=="object"){n=0;for(r in e)if(!((r==="_owner"||r==="__v"||r==="__o")&&e.$$typeof)&&(he.call(e,r)&&++n&&!he.call(t,r)||!(r in t)||!N(e[r],t[r])))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function L(e){return Object.prototype.toString.call(e).slice(8,-1)}function ft(e){return e&&(Array.isArray(e)?e.slice():typeof e=="object"?Object.assign({},e):e)}function dt(e){return typeof e=="function"&&/^class\s/.test(Function.prototype.toString.call(e))}function ht(e){return e!=null}function pe(e){return L(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function yt(e){return pe(e)&&Object.keys(e).length===0}function pt(e,t=!1){if(typeof e=="boolean")return e;if(typeof e=="string")switch(e.toLowerCase()){case"f":case"false":case"0":return!1;case"1":case"t":case"true":return!0}else if(typeof e=="number")switch(e){case 0:return!1;case 1:return!0}if(!t)return!!e}function gt(e,...t){return e instanceof Function?e(...t):e}function mt(e,{resolver:t=(...r)=>JSON.stringify(r)}={}){if(typeof e!="function")throw new Error("`callback` should be a function");if(t!==void 0&&typeof t!="function")throw new Error("`resolver` should be a function");const r={},n=function(){const o=Array.prototype.slice.call(arguments),s=t.apply(this,o);return s in r||(r[s]=e.apply(this,o)),r[s]};return n.cache=r,n}function wt(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(String(e))}function bt(e){if(e){if(e instanceof Date)return e;if(typeof e=="string"&&/^[0-9.]+$/.test(e)){let t=parseFloat(e);return Math.floor(t).toString().length<=11&&(t*=1e3),new Date(t)}else if(typeof e=="string"){const t=new Date(e);if(!isNaN(+t))return t}throw new Error(`parseTimestamp: invalid "${e}"`)}}const vt=/^(?<n>(?:@(?<org>[a-z0-9-~][a-z0-9-._~]*)\/)?(?<pkg>[a-z0-9-~][a-z0-9-._~]*))(?:@(?<v>[-a-z0-9><=_.^~]+))?(?<p>\/[^\r\n]*)?$/;function At(e){var t;const r=(t=e.match(vt))==null?void 0:t.groups;if(!r)return;const{n,v:o,p:s,org:i,pkg:d}=r,y=!!i,g=/^\d+\.\d+\.\d+/.test(o)?o:void 0,A=o||"latest",f={id:`${n}@${A}`,name:n,range:A,scoped:y,pkg:d,org:i,versioned:!!o};return g&&(f.version=g),s&&(f.path=s),f.scoped||delete f.org,f}function $t(e){return e&&e[Symbol.toStringTag]==="Module"}function W(e=({level:r,values:n,...o})=>{var s;({values:n,...o}=Et(o,n)),(s=console[r])==null||s.call(console,...n,o)},t={}){return{trace:(...r)=>{e({...t,level:"trace",values:r})},debug:(...r)=>{e({...t,level:"debug",values:r})},info:(...r)=>{e({...t,level:"info",values:r})},warn:(...r)=>{e({...t,level:"warn",values:r})},error:(...r)=>{e({...t,level:"error",values:r})},child:r=>W(e,{...t,...r})}}function Et(e,t){return t[0]&&typeof t[0]=="object"?{...e,...t[0],values:t.slice(1)}:{...e,values:t}}function ge(){const e=(...t)=>{};return{trace:e,debug:e,info:e,warn:e,error:e,child:()=>ge()}}function xt(e,t){return e.child?e.child(t):W(r=>{const{level:n,values:o,...s}=r;Object.keys(s).length?e[n](s,...o):e[n](...o)},t)}function jt(e){let t=!1,r=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];t&&/[a-zA-Z]/.test(s)&&s.toUpperCase()===s?(e=e.slice(0,o)+"-"+e.slice(o),t=!1,n=r,r=!0,o++):r&&n&&/[a-zA-Z]/.test(s)&&s.toLowerCase()===s?(e=e.slice(0,o-1)+"-"+e.slice(o-1),n=r,r=!1,t=!0):(t=s.toLowerCase()===s&&s.toUpperCase()!==s,n=r,r=s.toUpperCase()===s&&s.toLowerCase()!==s)}return e}function Ot(e){return me(e,{pascalCase:!0})}function me(e,t={pascalCase:!1}){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");const r=n=>t.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(e)?e=e.map(n=>n.trim()).filter(n=>n.length).join("-"):e=e.trim(),e.length===0?"":e.length===1?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=jt(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,o)=>o.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),r(e))}function we(e,t,r="js"){let n;return t?typeof t=="function"?n=t:n=o=>H(t,o):n=()=>"",typeof r=="string"&&(r=be[r]||be.js),e.replace(r,(o,s)=>n(s.trim()))}const be={js:/\${(.*?)}/g,common:/{{(.*?)}}/g};function St(e,t=!1,r=1){const n=t?1e3:1024;if(Math.abs(e)<n)return`${e} B`;const o=t?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let s=-1;const i=10**r;do e/=n,++s;while(Math.round(Math.abs(e)*i)/i>=n&&s<o.length-1);return e.toFixed(r)+" "+o[s]}function Ut(e){let t="";const r=e||{},n=o=>{if(Array.isArray(o))return o;const s=o.split(/[_-]/);return s.length>1?[o,s[0]]:[o]};return{locale(o){return t=o||t},dict:(o,s)=>{if(s){r[o]=Object.assign(r[o]||{},s);return}return r[o]},t(o,s,i){let d;for(const y of n(i||t))if(d=H(r[y],o,""),d)break;return typeof d=="function"?d(s):typeof d=="string"?we(d,s,"common"):d}}}function q(e){var t,r;return(r=(t=e==null?void 0:e.constructor)==null?void 0:t.isBuffer)==null?void 0:r.call(t,e)}const ve=O();function Ct(e){return Ae||=Bt(),Ae.some(t=>e instanceof t)}let Ae;function Bt(){const e=ve.window||ve||global;return[e.ArrayBuffer,e.MessagePort,e.ReadableStream,e.WritableStream,e.TransformStream,e.AudioData,e.ImageBitmap,e.VideoFrame,e.OffscreenCanvas,e.RTCDataChannel].filter(Boolean)}const R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<R.length;e++)I[R.charCodeAt(e)]=e;function Rt(e){const t=new Uint8Array(e),r=t.length;let n="";for(let o=0;o<r;o+=3)n+=R[t[o]>>2],n+=R[(t[o]&3)<<4|t[o+1]>>4],n+=R[(t[o+1]&15)<<2|t[o+2]>>6],n+=R[t[o+2]&63];return r%3===2?n=n.substring(0,n.length-1)+"=":r%3===1&&(n=n.substring(0,n.length-2)+"=="),n}function Tt(e){const t=e.length;let r=e.length*.75,n,o=0,s,i,d,y;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const g=new ArrayBuffer(r),A=new Uint8Array(g);for(n=0;n<t;n+=4)s=I[e.charCodeAt(n)],i=I[e.charCodeAt(n+1)],d=I[e.charCodeAt(n+2)],y=I[e.charCodeAt(n+3)],A[o++]=s<<2|i>>4,A[o++]=(i&15)<<4|d>>2,A[o++]=(d&3)<<6|y&63;return g}class b{static#e=!0;static#t;static isNativeBufferAvailable(){var t,r;return this.#t??=!((r=(t=O().Buffer)==null?void 0:t.isPollyfill)!=null&&r.call(t))}static isNativeBufferAllowed(){return this.#e&&this.#t}static setNativeBufferAllowed(t){this.#e=t}static isArrayBuffer=t=>t instanceof ArrayBuffer;static slice=(t,r,n)=>q(t)?Uint8Array.prototype.slice.call(t,r,n):t.slice(r,n);static asView=(t,r,n,o)=>r instanceof t&&(n??0)===0&&o===void 0?r:ArrayBuffer.isView(r)||q(r)?b.isNativeBufferAllowed()&&t===Buffer?Buffer.from(r.buffer,n,o):new t(r.buffer,r.byteOffset+(n??0),o??r.byteLength):new t(r,n,o);static toString=(t,r="utf8")=>{if(typeof t=="string")switch(r){case"base64":return btoa(t);case"utf-8":case"utf8":return t;default:throw new Error(`[ArrayBuffers.toString] Unsupported encoding for string: ${r}`)}if(b.isNativeBufferAllowed())return Buffer.from(b.asView(Uint8Array,t)).toString(r);switch(r){case"hex":return[...b.asView(Uint8Array,t)].map(n=>Mt[n]).join("");case"base64":return Rt(b.asView(Uint8Array,t));case"utf8":case"utf-8":return new TextDecoder().decode(t);case"ascii":{const n=b.asView(Uint8Array,t);return String.fromCharCode(...n.map(o=>o&127))}case"latin1":case"binary":{const n=b.asView(Uint8Array,t);return String.fromCharCode(...n)}case"ucs2":case"ucs-2":case"utf16le":{const n=b.asView(Uint8Array,t);let o="";for(let s=0;s<n.length-1;s+=2)o+=String.fromCharCode(n[s]+n[s+1]*256);return o}default:throw new Error(`[ArrayBuffers.toString] Unknown encoding: ${r}`)}};static toJSON=(t,r)=>JSON.parse(b.toString(t),r);static alloc=(t,r,n)=>r!==void 0?typeof r=="number"?new Uint8Array(t).fill(r):b.asView(Uint8Array,b.from(r,n)).slice(0,t):new ArrayBuffer(t);static from=(t,r="utf8")=>{if(!t)return new ArrayBuffer(0);if(typeof t=="string"){if(b.isNativeBufferAllowed())return Buffer.from(t,r);switch(r){case"utf-8":case"utf8":return new TextEncoder().encode(t).buffer;case"base64":return Tt(t.replace(/[^0-9a-zA-Z=+/_]/g,""));default:throw new Error(`[ArrayBuffers.from] Unknown encoding: ${r}`)}}if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t)||q(t)){if(t.byteOffset!==0)throw new Error("ArrayBuffers.from do not support view with offset");return t.buffer}if(Array.isArray(t))return new Uint8Array(t);const n=L(t);throw new TypeError(`ArrayBuffers.from unsupported type ${n}`)};static isEncoding=t=>{switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":return!0;default:return!1}};static concat=(t,r,n=0)=>{const o=t.reduce((i,d)=>i+d.byteLength,0),s=r?new Uint8Array(r):new Uint8Array(o);for(const i of t){if(!(i!=null&&i.byteLength))continue;let d;if(i instanceof ArrayBuffer)d=new Uint8Array(i);else if(ArrayBuffer.isView(i))d=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);else throw new Error(`ArrayBuffers.concat unsupported type ${L(i)}`);s.set(d,n),n+=i.byteLength}return s.buffer}}const Mt=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();let Pt=class ne extends Uint8Array{static get isPolyfill(){return!0}static isBuffer(t){return t instanceof ne||q(t)}static from(t,r){return new ne(b.from(t,r))}static isEncoding=b.isEncoding;toString(t){return b.toString(this,t)}},K;function kt(){let e;function t(){return navigator.userAgent.match(/ipad|iphone/i)}function r(s){e=document.createElement("textArea"),e.value=s,document.body.appendChild(e)}function n(){let s,i;if(t()){if(s=document.createRange(),s.selectNodeContents(e),i=window.getSelection(),i===null){console.error("no selection");return}i.removeAllRanges(),i.addRange(s),e.setSelectionRange(0,999999)}else e.select()}function o(){document.execCommand("copy"),document.body.removeChild(e)}K=s=>{r(s),n(),o()}}function Nt(e){var t,r;return(r=(t=window.navigator)==null?void 0:t.clipboard)!=null&&r.writeText?window.navigator.clipboard.writeText(e):(K||kt(),K(e))}function Lt(e,t,{type:r="application/octet-stream",raw:n=!1}={}){const o=document.createElement("a");let s=()=>null;try{if(o.download=e,typeof t=="string"&&/^(https?:|data:)/.test(t)&&!n?o.href=t:typeof t=="string"&&(t=new TextEncoder().encode(t)),t instanceof Uint8Array&&(t=new Blob([t],{type:r})),t instanceof File||t instanceof Blob||t instanceof MediaSource)o.href=URL.createObjectURL(t),s=()=>{URL.revokeObjectURL(o.href)};else throw console.error("invalid download data",t),new Error(`can not download ${Object.getPrototypeOf(t)}`);o.click()}finally{s()}}function $e(e,t,r,n){e.onload=()=>{t(e)},e.onerror=s=>{e.remove(),r(s)};const{attributes:o={}}=n||{};Object.entries(o).forEach(([s,i])=>{e.setAttribute(s,i)}),document.head.appendChild(e)}function Ee(e,t){if(Array.isArray(e))return Promise.resolve().then(async()=>{const n=[];for(const o of e)n.push(await Ee(o));return n});const r=document.querySelector(`script[src="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const s=document.createElement("script");s.src=e,$e(s,n,o,t)})}function qt(e,t){const r=document.querySelector(`link[href="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const s=document.createElement("link");s.rel="stylesheet",s.href=e,$e(s,n,o,t)})}function It(e){var t;if(!e)return{};const r=e.items??[];if(r.length>=2&&r[0].kind==="string"&&r[1].kind==="file"){const n=e.getData("text"),o=r[1].getAsFile()??((t=e.files)==null?void 0:t.item(0));return o?{file:o,name:n}:(console.error(`no file ${n}`,r[1]),{})}else if(r[0].kind==="file"){const n=r[0].getAsFile();return n?{file:n,name:n.name}:(console.error("no file",r[0]),{})}else console.debug("file item not match",Array.from(r).map(n=>({type:n.type,kind:n.kind})));return{}}const Dt=O(),Vt=Dt.structuredClone||T;function xe(e,t,r){typeof r.value=="object"&&(r.value=T(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function T(e){if(typeof e!="object")return e;let t=0,r,n,o;const s=L(e);switch(s){case"Array":o=Array(e.length);break;case"Object":o=Object.create(e.__proto__||null);break;case"Set":o=new Set,e.forEach(function(i){o.add(T(i))});break;case"Map":o=new Map,e.forEach(function(i,d){o.set(T(d),T(i))});break;case"Date":o=new Date(+e);break;case"RegExp":o=new RegExp(e.source,e.flags);break;case"DataView":o=new e.constructor(T(e.buffer));break;case"ArrayBuffer":o=e.slice(0);break;default:s.endsWith("Array")&&(o=new e.constructor(e))}if(o){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)xe(o,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(o,r=n[t])&&o[r]===e[r]||xe(o,r,Object.getOwnPropertyDescriptor(e,r))}return o||e}var je,Oe;const Se=O(),Ft=((Oe=(je=Se.crypto)==null?void 0:je.randomUUID)==null?void 0:Oe.bind(Se.crypto))||zt;function zt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}let Y;if(typeof window>"u")try{typeof require>"u"?import("crypto").then(e=>Y=e.default):Y=require("crypto")}catch{}function _t(){return Y}var Ue,Ce,Be,Re;const V=O();let Q=((Ce=(Ue=V.crypto)==null?void 0:Ue.getRandomValues)==null?void 0:Ce.bind(V.crypto))||((Re=(Be=V.msCrypto)==null?void 0:Be.getRandomValues)==null?void 0:Re.bind(V.msCrypto))||Ht;function Ht(e){var t,r,n;const o=_t();if((t=o==null?void 0:o.webcrypto)!=null&&t.getRandomValues)return Q=(n=(r=o==null?void 0:o.webcrypto)==null?void 0:r.getRandomValues)==null?void 0:n.bind(o==null?void 0:o.webcrypto),o.webcrypto.getRandomValues(e);if(o!=null&&o.randomBytes){if(!(e instanceof Uint8Array))throw new TypeError("expected Uint8Array");if(e.length>65536){const i=new Error;throw i.code=22,i.message=`Failed to execute 'getRandomValues' on 'Crypto': The ArrayBufferView's byte length (${e.length}) exceeds the number of bytes of entropy available via this API (65536).`,i.name="QuotaExceededError",i}const s=o.randomBytes(e.length);return e.set(s),e}throw new Error("[getRandomValues]: No secure random number generator available.")}function Gt(e){return F("SHA-1",e)}function Zt(e){return F("SHA-256",e)}function Jt(e){return F("SHA-384",e)}function Wt(e){return F("SHA-512",e)}function F(e,t){return crypto.subtle.digest(e,Kt(t))}function Kt(e){return typeof e=="string"?new TextEncoder().encode(e):e}function Yt(e){var t="0123456789abcdef";function r(m){var p,w="";for(p=0;p<=3;p++)w+=t.charAt(m>>p*8+4&15)+t.charAt(m>>p*8&15);return w}function n(m,p){var w=(m&65535)+(p&65535),v=(m>>16)+(p>>16)+(w>>16);return v<<16|w&65535}function o(m,p){return m<<p|m>>>32-p}function s(m,p,w,v,$,E){return n(o(n(n(p,m),n(v,E)),$),w)}function i(m,p,w,v,$,E,j){return s(p&w|~p&v,m,p,$,E,j)}function d(m,p,w,v,$,E,j){return s(p&v|w&~v,m,p,$,E,j)}function y(m,p,w,v,$,E,j){return s(p^w^v,m,p,$,E,j)}function g(m,p,w,v,$,E,j){return s(w^(p|~v),m,p,$,E,j)}function A(m){var p,w=(m.length+8>>6)+1,v=new Array(w*16);for(p=0;p<w*16;p++)v[p]=0;for(p=0;p<m.length;p++)v[p>>2]|=m.charCodeAt(p)<<p%4*8;return v[p>>2]|=128<<p%4*8,v[w*16-2]=m.length*8,v}var f,h=A(""+e),a=1732584193,c=-271733879,u=-1732584194,l=271733878,oe,se,ie,ae;for(f=0;f<h.length;f+=16)oe=a,se=c,ie=u,ae=l,a=i(a,c,u,l,h[f+0],7,-680876936),l=i(l,a,c,u,h[f+1],12,-389564586),u=i(u,l,a,c,h[f+2],17,606105819),c=i(c,u,l,a,h[f+3],22,-1044525330),a=i(a,c,u,l,h[f+4],7,-176418897),l=i(l,a,c,u,h[f+5],12,1200080426),u=i(u,l,a,c,h[f+6],17,-1473231341),c=i(c,u,l,a,h[f+7],22,-45705983),a=i(a,c,u,l,h[f+8],7,1770035416),l=i(l,a,c,u,h[f+9],12,-1958414417),u=i(u,l,a,c,h[f+10],17,-42063),c=i(c,u,l,a,h[f+11],22,-1990404162),a=i(a,c,u,l,h[f+12],7,1804603682),l=i(l,a,c,u,h[f+13],12,-40341101),u=i(u,l,a,c,h[f+14],17,-1502002290),c=i(c,u,l,a,h[f+15],22,1236535329),a=d(a,c,u,l,h[f+1],5,-165796510),l=d(l,a,c,u,h[f+6],9,-1069501632),u=d(u,l,a,c,h[f+11],14,643717713),c=d(c,u,l,a,h[f+0],20,-373897302),a=d(a,c,u,l,h[f+5],5,-701558691),l=d(l,a,c,u,h[f+10],9,38016083),u=d(u,l,a,c,h[f+15],14,-660478335),c=d(c,u,l,a,h[f+4],20,-405537848),a=d(a,c,u,l,h[f+9],5,568446438),l=d(l,a,c,u,h[f+14],9,-1019803690),u=d(u,l,a,c,h[f+3],14,-187363961),c=d(c,u,l,a,h[f+8],20,1163531501),a=d(a,c,u,l,h[f+13],5,-1444681467),l=d(l,a,c,u,h[f+2],9,-51403784),u=d(u,l,a,c,h[f+7],14,1735328473),c=d(c,u,l,a,h[f+12],20,-1926607734),a=y(a,c,u,l,h[f+5],4,-378558),l=y(l,a,c,u,h[f+8],11,-2022574463),u=y(u,l,a,c,h[f+11],16,1839030562),c=y(c,u,l,a,h[f+14],23,-35309556),a=y(a,c,u,l,h[f+1],4,-1530992060),l=y(l,a,c,u,h[f+4],11,1272893353),u=y(u,l,a,c,h[f+7],16,-155497632),c=y(c,u,l,a,h[f+10],23,-1094730640),a=y(a,c,u,l,h[f+13],4,681279174),l=y(l,a,c,u,h[f+0],11,-358537222),u=y(u,l,a,c,h[f+3],16,-722521979),c=y(c,u,l,a,h[f+6],23,76029189),a=y(a,c,u,l,h[f+9],4,-640364487),l=y(l,a,c,u,h[f+12],11,-421815835),u=y(u,l,a,c,h[f+15],16,530742520),c=y(c,u,l,a,h[f+2],23,-995338651),a=g(a,c,u,l,h[f+0],6,-198630844),l=g(l,a,c,u,h[f+7],10,1126891415),u=g(u,l,a,c,h[f+14],15,-1416354905),c=g(c,u,l,a,h[f+5],21,-57434055),a=g(a,c,u,l,h[f+12],6,1700485571),l=g(l,a,c,u,h[f+3],10,-1894986606),u=g(u,l,a,c,h[f+10],15,-1051523),c=g(c,u,l,a,h[f+1],21,-2054922799),a=g(a,c,u,l,h[f+8],6,1873313359),l=g(l,a,c,u,h[f+15],10,-30611744),u=g(u,l,a,c,h[f+6],15,-1560198380),c=g(c,u,l,a,h[f+13],21,1309151649),a=g(a,c,u,l,h[f+4],6,-145523070),l=g(l,a,c,u,h[f+11],10,-1120210379),u=g(u,l,a,c,h[f+2],15,718787259),c=g(c,u,l,a,h[f+9],21,-343485551),a=n(a,oe),c=n(c,se),u=n(u,ie),l=n(l,ae);return r(a)+r(c)+r(u)+r(l)}function Qt(e){return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}function x(e){const t=new Error(e);return t.source="ulid",t}const S="0123456789ABCDEFGHJKMNPQRSTVWXYZ",U=S.length,X=Math.pow(2,48)-1,M=10,ee=16;function Xt(e){return e?e.length===26&&/^[0-9A-HJKMNP-TV-Z]{26}$/i.test(e):!1}function Te(e,t,r){return t>e.length-1?e:e.substr(0,t)+r+e.substr(t+1)}function er(e){let t,r=e.length,n,o;const s=U-1;for(;!t&&r-->=0;){if(n=e[r],o=S.indexOf(n),o===-1)throw x("incorrectly encoded string");if(o===s){e=Te(e,r,S[0]);continue}t=Te(e,r,S[o+1])}if(typeof t=="string")return t;throw x("cannot increment this string")}function tr(e){let t=Math.floor(e()*U);return t===U&&(t=U-1),S.charAt(t)}function te(e,t){if(isNaN(e))throw new Error(`${e} must be a number`);if(e>X)throw x(`cannot encode time greater than ${X}`);if(e<0)throw x("time must be positive");if(!Number.isInteger(e))throw x("time must be an integer");let r,n="";for(;t>0;t--)r=e%U,n=S.charAt(r)+n,e=(e-r)/U;return n}function Me(e,t){let r="";for(;e>0;e--)r=tr(t)+r;return r}function rr(e){if(e.length!==M+ee)throw x("malformed ulid");const t=e.substr(0,M).split("").reverse().reduce((r,n,o)=>{const s=S.indexOf(n);if(s===-1)throw x("invalid character found: "+n);return r+=s*Math.pow(U,o)},0);if(t>X)throw x("malformed ulid, timestamp too large");return{timestamp:t,random:e.substring(M)}}function nr(){return()=>{const e=new Uint8Array(1);return Q(e),e[0]/255}}function Pe({monotonic:e=!0,random:t=nr(),now:r=Date.now}={}){if(!e)return function(s){return s||=r(),te(s,M)+Me(ee,t)};let n=0,o;return function(s){if(s||=r(),s<=n&&o){const d=o=er(o);return te(n,M)+d}n=s;const i=o=Me(ee,t);return te(s,M)+i}}let ke=(...e)=>D?D(...e):(D=Pe(),ke=D,D(...e)),D;class or{static decode(t){const r=t.match(/^-----BEGIN (?<type>[^\r\n-]+)-----$\r?\n(?<headers>(^[^:\r\n]+:[^\n\r]+\r?\n)+\r?\n)?(?<data>[a-zA-Z0-9/_=\n\r+]+?)^-----END \1-----$\r?\n?/ms);if(!(r!=null&&r.groups))throw new Error("Invalid PEM data");const{type:n,headers:o="",data:s}=r.groups,i=o.split(`
2
- `).filter(d=>d.trim()).map(d=>{const[y,...g]=d.split(":");return[y.trim(),g.join(":").trim()]}).reduce((d,[y,g])=>({...d,[y]:g}),{});return{block:{type:n,header:i,bytes:b.from(s.replace(/[\r\n]/g,""),"base64")},head:t.slice(0,r.index||0),tail:t.slice((r.index||0)+r[0].length)}}static encode(t){var r;const{type:n,header:o,bytes:s}=t,i=Object.entries(o||{}).map(([d,y])=>`${d}: ${y}`).join(`
1
+ import{g as j}from"./getGlobalThis-b7ad0cf9.js";function Fe(e,t=null,r=ue){return Object.fromEntries(t===null?Object.entries(e).map(([n,o])=>[n,r(o)]):t.map(n=>[n,r(n)]))}function ue(e){return Array.isArray(e)?e[0]:e}function ze(e){return Array.isArray(e)?e[e.length-1]:e}function He(e){return Array.isArray(e)?e:e==null?[]:[e]}async function _e(e){const t=[];for await(const r of e)t.push(r);return t}function H(e){if(typeof e!="string")return Array.isArray(e)?e:[e];const t=e.split(".");if(!e.includes("["))return t;const r=[];for(const n of t)if(!n.endsWith("]"))r.push(n);else{const o=n.split("[");for(let s of o)s.endsWith("]")&&(s=s.slice(0,-1)),r.push(s)}return r}function _(e,t,r){const n=H(t);let o=e;for(const s of n)o=o?o[s]:void 0;return o===void 0?r:o}function Ge(e,t,r,n=!0){const o=H(t);let s=0;const a=o.length;let d=e,y,g;for(;s<a&&(g=o[s++],!(g==="__proto__"||g==="constructor"||g==="prototype"));)d=d[g]=s===a?n?G(d[g],r):r:typeof(y=d[g])==typeof o?y:o[s]*0!==0||~(""+o[s]).indexOf(".")?{}:[]}function G(e,t){let r;if(typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))for(r=0;r<t.length;r++)e[r]=G(e[r],t[r]);else for(r in t){if(r==="__proto__"||r==="constructor"||r==="prototype")break;e[r]=G(e[r],t[r])}return e}return t}function Je(e){return Ze(e)&&!We(e)}function Ze(e){return!!e&&typeof e=="object"}function We(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Qe(e)}var Ke=typeof Symbol=="function"&&Symbol.for,Ye=Ke?Symbol.for("react.element"):60103;function Qe(e){return e.$$typeof===Ye}function Xe(e){return Array.isArray(e)?[]:{}}function P(e,t){return t.clone!==!1&&t.isMergeableObject(e)?R(Xe(e),e,t):e}function et(e,t,r){return e.concat(t).map(function(n){return P(n,r)})}function tt(e,t){if(!t.customMerge)return R;var r=t.customMerge(e);return typeof r=="function"?r:R}function rt(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function le(e){return Object.keys(e).concat(rt(e))}function fe(e,t){try{return t in e}catch{return!1}}function nt(e,t){return fe(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function ot(e,t,r){const n={};return r.isMergeableObject(e)&&le(e).forEach(o=>{n[o]=P(e[o],r)}),le(t).forEach(o=>{nt(e,o)||(fe(e,o)&&r.isMergeableObject(t[o])?n[o]=tt(o,r)(e[o],t[o],r):n[o]=P(t[o],r))}),n}function R(e,t,r){const n={arrayMerge:et,isMergeableObject:Je,...r,cloneUnlessOtherwiseSpecified:P};let o=Array.isArray(t),s=Array.isArray(e);return o===s?o?n.arrayMerge(e,t,n):ot(e,t,n):P(t,n)}R.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return R(r,n,t)},{})};function N(e){return e&&(e instanceof Promise||e.then&&e.catch)}function J(e){const t={resolve(n){throw new Error("pending resolve")},reject(n){throw new Error("pending reject")}},r=Object.assign(new Promise((n,o)=>{t.reject=o,t.resolve=n}),{resolve(n){t.resolve(n)},reject(n){t.resolve(n)}});if(e){const n=t.resolve;let o=!0;t.resolve=d=>{o=!1,n(d)};const s=r.then.bind(r);r.then=(...d)=>{if(o){o=!1;try{const y=e(t.resolve,t.reject);N(y)?y.then(t.resolve,t.reject):y!==void 0&&t.resolve(y)}catch(y){t.reject(y)}}return s(...d)};const a=t;return a.then=r.then,a.catch=r.catch.bind(r),r.finally&&(a.finally=r.finally),Object.defineProperty(a,Symbol.species,{get(){return Promise}}),a}return r}function st(e,t,r=t){let n;const o=async()=>{await e(),n=setTimeout(o,t)};return n=setTimeout(o,r),()=>n}function at(e){clearTimeout(e==null?void 0:e())}function it(e){const t=[];let r;{let n;t.push(n=J()),r=(o,s)=>{if(s!==void 0)n.resolve([void 0,!0,s]);else if(o!==void 0)n.resolve(o);else return;t.push(n=J())}}return e(r),async function*(){let n,o;for(let s=0,a=!1;!a;s++){let d=await t[s];if(delete t[s],[n,a,o]=d,o)throw o;n!==void 0&&(yield n)}}()}function de(e){return typeof(e==null?void 0:e.next)=="function"}function Z(e){if(N(e))return e.then(t=>Z(t));if(de(e)){let t=e.next();return N(t)?t.then(r=>[r.value,r.done]):[t.value,t.done]}return[e]}function ct(e){const t=Z(e);return N(t)?t.then(r=>r[0]):t[0]}const ut=e=>new Promise(t=>setTimeout(t,e));function lt(e,t){const r=new he;let n;return Promise.race([e,new Promise((o,s)=>{n=setTimeout(()=>{s(r)},t)})]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}class he extends Error{constructor(){super("TimeoutError")}}function ft(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0}const ye=Object.prototype.hasOwnProperty,dt=typeof Element<"u";function pe(e,t,r){for(r of e.keys())if(k(r,t))return r}function k(e,t){let r,n,o;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&k(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(o=n,o&&typeof o=="object"&&(o=pe(t,o),!o)||!t.has(o))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(o=n[0],o&&typeof o=="object"&&(o=pe(t,o),!o)||!k(n[1],t.get(o)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(dt&&e instanceof Element)return!1;if(!r||typeof e=="object"){n=0;for(r in e)if(!((r==="_owner"||r==="__v"||r==="__o")&&e.$$typeof)&&(ye.call(e,r)&&++n&&!ye.call(t,r)||!(r in t)||!k(e[r],t[r])))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function L(e){return Object.prototype.toString.call(e).slice(8,-1)}function ht(e){return e&&(Array.isArray(e)?e.slice():typeof e=="object"?Object.assign({},e):e)}function yt(e){return typeof e=="function"&&/^class\s/.test(Function.prototype.toString.call(e))}function pt(e){return e!=null}function ge(e){return L(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function gt(e){return ge(e)&&Object.keys(e).length===0}function mt(e,t=!1){if(typeof e=="boolean")return e;if(typeof e=="string")switch(e.toLowerCase()){case"f":case"false":case"0":return!1;case"1":case"t":case"true":return!0}else if(typeof e=="number")switch(e){case 0:return!1;case 1:return!0}if(!t)return!!e}function wt(e,...t){return e instanceof Function?e(...t):e}function bt(e,{resolver:t=(...r)=>JSON.stringify(r)}={}){if(typeof e!="function")throw new Error("`callback` should be a function");if(t!==void 0&&typeof t!="function")throw new Error("`resolver` should be a function");const r={},n=function(){const o=Array.prototype.slice.call(arguments),s=t.apply(this,o);return s in r||(r[s]=e.apply(this,o)),r[s]};return n.cache=r,n}function vt(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(String(e))}function At(e){if(e){if(e instanceof Date)return e;if(typeof e=="string"&&/^[0-9.]+$/.test(e)){let t=parseFloat(e);return Math.floor(t).toString().length<=11&&(t*=1e3),new Date(t)}else if(typeof e=="string"){const t=new Date(e);if(!isNaN(+t))return t}throw new Error(`parseTimestamp: invalid "${e}"`)}}const $t=/^(?<n>(?:@(?<org>[a-z0-9-~][a-z0-9-._~]*)\/)?(?<pkg>[a-z0-9-~][a-z0-9-._~]*))(?:@(?<v>[-a-z0-9><=_.^~]+))?(?<p>\/[^\r\n]*)?$/;function xt(e){var t;const r=(t=e.match($t))==null?void 0:t.groups;if(!r)return;const{n,v:o,p:s,org:a,pkg:d}=r,y=!!a,g=/^\d+\.\d+\.\d+/.test(o)?o:void 0,A=o||"latest",f={id:`${n}@${A}`,name:n,range:A,scoped:y,pkg:d,org:a,versioned:!!o};return g&&(f.version=g),s&&(f.path=s),f.scoped||delete f.org,f}function Et(e){return e&&e[Symbol.toStringTag]==="Module"}function W(e=({level:r,values:n,...o})=>{var s;({values:n,...o}=Ot(o,n)),(s=console[r])==null||s.call(console,...n,o)},t={}){return{trace:(...r)=>{e({...t,level:"trace",values:r})},debug:(...r)=>{e({...t,level:"debug",values:r})},info:(...r)=>{e({...t,level:"info",values:r})},warn:(...r)=>{e({...t,level:"warn",values:r})},error:(...r)=>{e({...t,level:"error",values:r})},child:r=>W(e,{...t,...r})}}function Ot(e,t){return t[0]&&typeof t[0]=="object"?{...e,...t[0],values:t.slice(1)}:{...e,values:t}}function me(){const e=(...t)=>{};return{trace:e,debug:e,info:e,warn:e,error:e,child:()=>me()}}function jt(e,t){return e.child?e.child(t):W(r=>{const{level:n,values:o,...s}=r;Object.keys(s).length?e[n](s,...o):e[n](...o)},t)}function St(e){let t=!1,r=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];t&&/[a-zA-Z]/.test(s)&&s.toUpperCase()===s?(e=e.slice(0,o)+"-"+e.slice(o),t=!1,n=r,r=!0,o++):r&&n&&/[a-zA-Z]/.test(s)&&s.toLowerCase()===s?(e=e.slice(0,o-1)+"-"+e.slice(o-1),n=r,r=!1,t=!0):(t=s.toLowerCase()===s&&s.toUpperCase()!==s,n=r,r=s.toUpperCase()===s&&s.toLowerCase()!==s)}return e}function Ut(e){return we(e,{pascalCase:!0})}function we(e,t={pascalCase:!1}){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");const r=n=>t.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(e)?e=e.map(n=>n.trim()).filter(n=>n.length).join("-"):e=e.trim(),e.length===0?"":e.length===1?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=St(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,o)=>o.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),r(e))}function be(e,t,r="js"){let n;return t?typeof t=="function"?n=t:n=o=>_(t,o):n=()=>"",typeof r=="string"&&(r=ve[r]||ve.js),e.replace(r,(o,s)=>n(s.trim()))}const ve={js:/\${(.*?)}/g,common:/{{(.*?)}}/g};function Ct(e,t=!1,r=1){const n=t?1e3:1024;if(Math.abs(e)<n)return`${e} B`;const o=t?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let s=-1;const a=10**r;do e/=n,++s;while(Math.round(Math.abs(e)*a)/a>=n&&s<o.length-1);return e.toFixed(r)+" "+o[s]}function Rt(e){let t="";const r=e||{},n=o=>{if(Array.isArray(o))return o;const s=o.split(/[_-]/);return s.length>1?[o,s[0]]:[o]};return{locale(o){return t=o||t},dict:(o,s)=>{if(s){r[o]=Object.assign(r[o]||{},s);return}return r[o]},t(o,s,a){let d;for(const y of n(a||t))if(d=_(r[y],o,""),d)break;return typeof d=="function"?d(s):typeof d=="string"?be(d,s,"common"):d}}}function q(e){var t,r;return(r=(t=e==null?void 0:e.constructor)==null?void 0:t.isBuffer)==null?void 0:r.call(t,e)}const Ae=j();function Bt(e){return $e||=Tt(),$e.some(t=>e instanceof t)}let $e;function Tt(){const e=Ae.window||Ae||global;return[e.ArrayBuffer,e.MessagePort,e.ReadableStream,e.WritableStream,e.TransformStream,e.AudioData,e.ImageBitmap,e.VideoFrame,e.OffscreenCanvas,e.RTCDataChannel].filter(Boolean)}const B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<B.length;e++)I[B.charCodeAt(e)]=e;function Mt(e){const t=new Uint8Array(e),r=t.length;let n="";for(let o=0;o<r;o+=3)n+=B[t[o]>>2],n+=B[(t[o]&3)<<4|t[o+1]>>4],n+=B[(t[o+1]&15)<<2|t[o+2]>>6],n+=B[t[o+2]&63];return r%3===2?n=n.substring(0,n.length-1)+"=":r%3===1&&(n=n.substring(0,n.length-2)+"=="),n}function Pt(e){const t=e.length;let r=e.length*.75,n,o=0,s,a,d,y;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const g=new ArrayBuffer(r),A=new Uint8Array(g);for(n=0;n<t;n+=4)s=I[e.charCodeAt(n)],a=I[e.charCodeAt(n+1)],d=I[e.charCodeAt(n+2)],y=I[e.charCodeAt(n+3)],A[o++]=s<<2|a>>4,A[o++]=(a&15)<<4|d>>2,A[o++]=(d&3)<<6|y&63;return g}class w{static#e=!0;static#t;static isNativeBufferAvailable(){var t,r;return this.#t??=!((r=(t=j().Buffer)==null?void 0:t.isPollyfill)!=null&&r.call(t))}static isNativeBufferAllowed(){return this.#e&&this.#t}static setNativeBufferAllowed(t){this.#e=t}static isArrayBuffer=t=>t instanceof ArrayBuffer;static slice=(t,r,n)=>q(t)?Uint8Array.prototype.slice.call(t,r,n):t.slice(r,n);static asView=(t,r,n,o)=>r instanceof t&&(n??0)===0&&o===void 0?r:ArrayBuffer.isView(r)||q(r)?w.isNativeBufferAllowed()&&t===Buffer?Buffer.from(r.buffer,n,o):new t(r.buffer,r.byteOffset+(n??0),o??r.byteLength):new t(r,n,o);static toString=(t,r="utf8")=>{if(typeof t=="string")switch(r){case"base64":return btoa(t);case"utf-8":case"utf8":return t;default:throw new Error(`[ArrayBuffers.toString] Unsupported encoding for string: ${r}`)}if(w.isNativeBufferAllowed())return Buffer.from(w.asView(Uint8Array,t)).toString(r);switch(r){case"hex":return[...w.asView(Uint8Array,t)].map(n=>Nt[n]).join("");case"base64":return Mt(w.asView(Uint8Array,t));case"utf8":case"utf-8":return new TextDecoder().decode(t);case"ascii":{const n=w.asView(Uint8Array,t);return String.fromCharCode(...n.map(o=>o&127))}case"latin1":case"binary":{const n=w.asView(Uint8Array,t);return String.fromCharCode(...n)}case"ucs2":case"ucs-2":case"utf16le":{const n=w.asView(Uint8Array,t);let o="";for(let s=0;s<n.length-1;s+=2)o+=String.fromCharCode(n[s]+n[s+1]*256);return o}default:throw new Error(`[ArrayBuffers.toString] Unknown encoding: ${r}`)}};static toJSON=(t,r)=>JSON.parse(w.toString(t),r);static alloc=(t,r,n)=>r!==void 0?typeof r=="number"?new Uint8Array(t).fill(r):w.asView(Uint8Array,w.from(r,n)).slice(0,t):new ArrayBuffer(t);static from=(t,r="utf8")=>{if(!t)return new ArrayBuffer(0);if(typeof t=="string"){if(w.isNativeBufferAllowed())return Buffer.from(t,r);switch(r){case"utf-8":case"utf8":return new TextEncoder().encode(t).buffer;case"base64":return Pt(t.replace(/[^0-9a-zA-Z=+/_]/g,""));default:throw new Error(`[ArrayBuffers.from] Unknown encoding: ${r}`)}}if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t)||q(t)){if(t.byteOffset!==0)throw new Error("ArrayBuffers.from do not support view with offset");return t.buffer}if(Array.isArray(t))return new Uint8Array(t);const n=L(t);throw new TypeError(`ArrayBuffers.from unsupported type ${n}`)};static isEncoding=t=>{switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":return!0;default:return!1}};static concat=(t,r,n=0)=>{const o=t.reduce((a,d)=>a+d.byteLength,0),s=r?new Uint8Array(r):new Uint8Array(o);for(const a of t){if(!(a!=null&&a.byteLength))continue;let d;if(a instanceof ArrayBuffer)d=new Uint8Array(a);else if(ArrayBuffer.isView(a))d=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);else throw new Error(`ArrayBuffers.concat unsupported type ${L(a)}`);s.set(d,n),n+=a.byteLength}return s.buffer}}const Nt=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();let kt=class oe extends Uint8Array{static get isPolyfill(){return!0}static isBuffer(t){return t instanceof oe||q(t)}static from(t,r){return new oe(w.from(t,r))}static isEncoding=w.isEncoding;toString(t){return w.toString(this,t)}},K;function Lt(){let e;function t(){return navigator.userAgent.match(/ipad|iphone/i)}function r(s){e=document.createElement("textArea"),e.value=s,document.body.appendChild(e)}function n(){let s,a;if(t()){if(s=document.createRange(),s.selectNodeContents(e),a=window.getSelection(),a===null){console.error("no selection");return}a.removeAllRanges(),a.addRange(s),e.setSelectionRange(0,999999)}else e.select()}function o(){document.execCommand("copy"),document.body.removeChild(e)}K=s=>{r(s),n(),o()}}function qt(e){var t,r;return(r=(t=window.navigator)==null?void 0:t.clipboard)!=null&&r.writeText?window.navigator.clipboard.writeText(e):(K||Lt(),K(e))}function It(e,t,{type:r="application/octet-stream",raw:n=!1}={}){const o=document.createElement("a");let s=()=>null;try{if(o.download=e,typeof t=="string"&&/^(https?:|data:)/.test(t)&&!n?o.href=t:typeof t=="string"&&(t=new TextEncoder().encode(t)),t instanceof Uint8Array&&(t=new Blob([t],{type:r})),t instanceof File||t instanceof Blob||t instanceof MediaSource)o.href=URL.createObjectURL(t),s=()=>{URL.revokeObjectURL(o.href)};else throw console.error("invalid download data",t),new Error(`can not download ${Object.getPrototypeOf(t)}`);o.click()}finally{s()}}function xe(e,t,r,n){e.onload=()=>{t(e)},e.onerror=s=>{e.remove(),r(s)};const{attributes:o={}}=n||{};Object.entries(o).forEach(([s,a])=>{e.setAttribute(s,a)}),document.head.appendChild(e)}function Ee(e,t){if(Array.isArray(e))return Promise.resolve().then(async()=>{const n=[];for(const o of e)n.push(await Ee(o));return n});const r=document.querySelector(`script[src="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const s=document.createElement("script");s.src=e,xe(s,n,o,t)})}function Dt(e,t){const r=document.querySelector(`link[href="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const s=document.createElement("link");s.rel="stylesheet",s.href=e,xe(s,n,o,t)})}function Vt(e){var t;if(!e)return{};const r=e.items??[];if(r.length>=2&&r[0].kind==="string"&&r[1].kind==="file"){const n=e.getData("text"),o=r[1].getAsFile()??((t=e.files)==null?void 0:t.item(0));return o?{file:o,name:n}:(console.error(`no file ${n}`,r[1]),{})}else if(r[0].kind==="file"){const n=r[0].getAsFile();return n?{file:n,name:n.name}:(console.error("no file",r[0]),{})}else console.debug("file item not match",Array.from(r).map(n=>({type:n.type,kind:n.kind})));return{}}const Ft=j(),zt=Ft.structuredClone||T;function Oe(e,t,r){typeof r.value=="object"&&(r.value=T(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function T(e){if(typeof e!="object")return e;let t=0,r,n,o;const s=L(e);switch(s){case"Array":o=Array(e.length);break;case"Object":o=Object.create(e.__proto__||null);break;case"Set":o=new Set,e.forEach(function(a){o.add(T(a))});break;case"Map":o=new Map,e.forEach(function(a,d){o.set(T(d),T(a))});break;case"Date":o=new Date(+e);break;case"RegExp":o=new RegExp(e.source,e.flags);break;case"DataView":o=new e.constructor(T(e.buffer));break;case"ArrayBuffer":o=e.slice(0);break;default:s.endsWith("Array")&&(o=new e.constructor(e))}if(o){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)Oe(o,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(o,r=n[t])&&o[r]===e[r]||Oe(o,r,Object.getOwnPropertyDescriptor(e,r))}return o||e}var je,Se;const Ue=j(),Ht=((Se=(je=Ue.crypto)==null?void 0:je.randomUUID)==null?void 0:Se.bind(Ue.crypto))||_t;function _t(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}let Y;if(typeof window>"u")try{typeof require>"u"?import("crypto").then(e=>Y=e.default):Y=require("crypto")}catch{}function Gt(){return Y}var Ce,Re,Be,Te;const V=j();let Q=((Re=(Ce=V.crypto)==null?void 0:Ce.getRandomValues)==null?void 0:Re.bind(V.crypto))||((Te=(Be=V.msCrypto)==null?void 0:Be.getRandomValues)==null?void 0:Te.bind(V.msCrypto))||Jt;function Jt(e){var t,r,n;const o=Gt();if((t=o==null?void 0:o.webcrypto)!=null&&t.getRandomValues)return Q=(n=(r=o==null?void 0:o.webcrypto)==null?void 0:r.getRandomValues)==null?void 0:n.bind(o==null?void 0:o.webcrypto),o.webcrypto.getRandomValues(e);if(o!=null&&o.randomBytes){if(!(e instanceof Uint8Array))throw new TypeError("expected Uint8Array");if(e.length>65536){const a=new Error;throw a.code=22,a.message=`Failed to execute 'getRandomValues' on 'Crypto': The ArrayBufferView's byte length (${e.length}) exceeds the number of bytes of entropy available via this API (65536).`,a.name="QuotaExceededError",a}const s=o.randomBytes(e.length);return e.set(s),e}throw new Error("[getRandomValues]: No secure random number generator available.")}function Zt(e,t){return F("SHA-1",e,t)}function Wt(e,t){return F("SHA-256",e,t)}function Kt(e,t){return F("SHA-384",e,t)}function Yt(e,t){return F("SHA-512",e,t)}function F(e,t,r){let n=crypto.subtle.digest(e,X(t));return r&&n.then(o=>Me(o,r))}function X(e){return typeof e=="string"?new TextEncoder().encode(e):e}function Me(e,t){if(t)switch(t){case"hex":case"base64":return w.toString(e,t)}return e}async function Qt(e,t,r,n){let o=t instanceof CryptoKey?t:await crypto.subtle.importKey("raw",X(t),{name:"HMAC",hash:{name:Xt(e)}},!1,["sign"]),s=await crypto.subtle.sign({name:"HMAC",hash:{name:e}},o,X(r));return Me(s,n)}function Xt(e){return e.replace(/^sha/i,"SHA-")}function er(e){var t="0123456789abcdef";function r(m){var p,b="";for(p=0;p<=3;p++)b+=t.charAt(m>>p*8+4&15)+t.charAt(m>>p*8&15);return b}function n(m,p){var b=(m&65535)+(p&65535),v=(m>>16)+(p>>16)+(b>>16);return v<<16|b&65535}function o(m,p){return m<<p|m>>>32-p}function s(m,p,b,v,$,x){return n(o(n(n(p,m),n(v,x)),$),b)}function a(m,p,b,v,$,x,O){return s(p&b|~p&v,m,p,$,x,O)}function d(m,p,b,v,$,x,O){return s(p&v|b&~v,m,p,$,x,O)}function y(m,p,b,v,$,x,O){return s(p^b^v,m,p,$,x,O)}function g(m,p,b,v,$,x,O){return s(b^(p|~v),m,p,$,x,O)}function A(m){var p,b=(m.length+8>>6)+1,v=new Array(b*16);for(p=0;p<b*16;p++)v[p]=0;for(p=0;p<m.length;p++)v[p>>2]|=m.charCodeAt(p)<<p%4*8;return v[p>>2]|=128<<p%4*8,v[b*16-2]=m.length*8,v}var f,h=A(""+e),i=1732584193,c=-271733879,u=-1732584194,l=271733878,se,ae,ie,ce;for(f=0;f<h.length;f+=16)se=i,ae=c,ie=u,ce=l,i=a(i,c,u,l,h[f+0],7,-680876936),l=a(l,i,c,u,h[f+1],12,-389564586),u=a(u,l,i,c,h[f+2],17,606105819),c=a(c,u,l,i,h[f+3],22,-1044525330),i=a(i,c,u,l,h[f+4],7,-176418897),l=a(l,i,c,u,h[f+5],12,1200080426),u=a(u,l,i,c,h[f+6],17,-1473231341),c=a(c,u,l,i,h[f+7],22,-45705983),i=a(i,c,u,l,h[f+8],7,1770035416),l=a(l,i,c,u,h[f+9],12,-1958414417),u=a(u,l,i,c,h[f+10],17,-42063),c=a(c,u,l,i,h[f+11],22,-1990404162),i=a(i,c,u,l,h[f+12],7,1804603682),l=a(l,i,c,u,h[f+13],12,-40341101),u=a(u,l,i,c,h[f+14],17,-1502002290),c=a(c,u,l,i,h[f+15],22,1236535329),i=d(i,c,u,l,h[f+1],5,-165796510),l=d(l,i,c,u,h[f+6],9,-1069501632),u=d(u,l,i,c,h[f+11],14,643717713),c=d(c,u,l,i,h[f+0],20,-373897302),i=d(i,c,u,l,h[f+5],5,-701558691),l=d(l,i,c,u,h[f+10],9,38016083),u=d(u,l,i,c,h[f+15],14,-660478335),c=d(c,u,l,i,h[f+4],20,-405537848),i=d(i,c,u,l,h[f+9],5,568446438),l=d(l,i,c,u,h[f+14],9,-1019803690),u=d(u,l,i,c,h[f+3],14,-187363961),c=d(c,u,l,i,h[f+8],20,1163531501),i=d(i,c,u,l,h[f+13],5,-1444681467),l=d(l,i,c,u,h[f+2],9,-51403784),u=d(u,l,i,c,h[f+7],14,1735328473),c=d(c,u,l,i,h[f+12],20,-1926607734),i=y(i,c,u,l,h[f+5],4,-378558),l=y(l,i,c,u,h[f+8],11,-2022574463),u=y(u,l,i,c,h[f+11],16,1839030562),c=y(c,u,l,i,h[f+14],23,-35309556),i=y(i,c,u,l,h[f+1],4,-1530992060),l=y(l,i,c,u,h[f+4],11,1272893353),u=y(u,l,i,c,h[f+7],16,-155497632),c=y(c,u,l,i,h[f+10],23,-1094730640),i=y(i,c,u,l,h[f+13],4,681279174),l=y(l,i,c,u,h[f+0],11,-358537222),u=y(u,l,i,c,h[f+3],16,-722521979),c=y(c,u,l,i,h[f+6],23,76029189),i=y(i,c,u,l,h[f+9],4,-640364487),l=y(l,i,c,u,h[f+12],11,-421815835),u=y(u,l,i,c,h[f+15],16,530742520),c=y(c,u,l,i,h[f+2],23,-995338651),i=g(i,c,u,l,h[f+0],6,-198630844),l=g(l,i,c,u,h[f+7],10,1126891415),u=g(u,l,i,c,h[f+14],15,-1416354905),c=g(c,u,l,i,h[f+5],21,-57434055),i=g(i,c,u,l,h[f+12],6,1700485571),l=g(l,i,c,u,h[f+3],10,-1894986606),u=g(u,l,i,c,h[f+10],15,-1051523),c=g(c,u,l,i,h[f+1],21,-2054922799),i=g(i,c,u,l,h[f+8],6,1873313359),l=g(l,i,c,u,h[f+15],10,-30611744),u=g(u,l,i,c,h[f+6],15,-1560198380),c=g(c,u,l,i,h[f+13],21,1309151649),i=g(i,c,u,l,h[f+4],6,-145523070),l=g(l,i,c,u,h[f+11],10,-1120210379),u=g(u,l,i,c,h[f+2],15,718787259),c=g(c,u,l,i,h[f+9],21,-343485551),i=n(i,se),c=n(c,ae),u=n(u,ie),l=n(l,ce);return r(i)+r(c)+r(u)+r(l)}function tr(e){return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}function E(e){const t=new Error(e);return t.source="ulid",t}const S="0123456789ABCDEFGHJKMNPQRSTVWXYZ",U=S.length,ee=Math.pow(2,48)-1,M=10,te=16;function rr(e){return e?e.length===26&&/^[0-9A-HJKMNP-TV-Z]{26}$/i.test(e):!1}function Pe(e,t,r){return t>e.length-1?e:e.substr(0,t)+r+e.substr(t+1)}function nr(e){let t,r=e.length,n,o;const s=U-1;for(;!t&&r-->=0;){if(n=e[r],o=S.indexOf(n),o===-1)throw E("incorrectly encoded string");if(o===s){e=Pe(e,r,S[0]);continue}t=Pe(e,r,S[o+1])}if(typeof t=="string")return t;throw E("cannot increment this string")}function or(e){let t=Math.floor(e()*U);return t===U&&(t=U-1),S.charAt(t)}function re(e,t){if(isNaN(e))throw new Error(`${e} must be a number`);if(e>ee)throw E(`cannot encode time greater than ${ee}`);if(e<0)throw E("time must be positive");if(!Number.isInteger(e))throw E("time must be an integer");let r,n="";for(;t>0;t--)r=e%U,n=S.charAt(r)+n,e=(e-r)/U;return n}function Ne(e,t){let r="";for(;e>0;e--)r=or(t)+r;return r}function sr(e){if(e.length!==M+te)throw E("malformed ulid");const t=e.substr(0,M).split("").reverse().reduce((r,n,o)=>{const s=S.indexOf(n);if(s===-1)throw E("invalid character found: "+n);return r+=s*Math.pow(U,o)},0);if(t>ee)throw E("malformed ulid, timestamp too large");return{timestamp:t,random:e.substring(M)}}function ar(){return()=>{const e=new Uint8Array(1);return Q(e),e[0]/255}}function ke({monotonic:e=!0,random:t=ar(),now:r=Date.now}={}){if(!e)return function(s){return s||=r(),re(s,M)+Ne(te,t)};let n=0,o;return function(s){if(s||=r(),s<=n&&o){const d=o=nr(o);return re(n,M)+d}n=s;const a=o=Ne(te,t);return re(s,M)+a}}let Le=(...e)=>D?D(...e):(D=ke(),Le=D,D(...e)),D;class ir{static decode(t){const r=t.match(/^-----BEGIN (?<type>[^\r\n-]+)-----$\r?\n(?<headers>(^[^:\r\n]+:[^\n\r]+\r?\n)+\r?\n)?(?<data>[a-zA-Z0-9/_=\n\r+]+?)^-----END \1-----$\r?\n?/ms);if(!(r!=null&&r.groups))throw new Error("Invalid PEM data");const{type:n,headers:o="",data:s}=r.groups,a=o.split(`
2
+ `).filter(d=>d.trim()).map(d=>{const[y,...g]=d.split(":");return[y.trim(),g.join(":").trim()]}).reduce((d,[y,g])=>({...d,[y]:g}),{});return{block:{type:n,header:a,bytes:w.from(s.replace(/[\r\n]/g,""),"base64")},head:t.slice(0,r.index||0),tail:t.slice((r.index||0)+r[0].length)}}static encode(t){var r;const{type:n,header:o,bytes:s}=t,a=Object.entries(o||{}).map(([d,y])=>`${d}: ${y}`).join(`
3
3
  `);return`-----BEGIN ${n}-----
4
- ${i}${i.length?`
4
+ ${a}${a.length?`
5
5
 
6
- `:""}${((r=b.toString(s,"base64").match(/.{1,64}/g))==null?void 0:r.join(`
6
+ `:""}${((r=w.toString(s,"base64").match(/.{1,64}/g))==null?void 0:r.join(`
7
7
  `))||""}
8
8
  -----END ${n}-----
9
- `}}function sr(e={}){let t=typeof e.seed=="string"?0:e.seed??0;if(typeof e.seed=="string"){let r=0;for(let n=0;n<e.seed.length;n++)r+=e.seed.charCodeAt(n);t=r}return()=>{const r=Math.sin(t++)*1e4;return r-Math.floor(r)}}function Ne({fetch:e=O().fetch,onRequest:t=n=>n.next(n.url,n.req),onResponse:r=n=>n.res}){return async(n,o)=>{const s=String(n);let i=o||{};const d=i.fetch||e,y=await t({url:s,req:i,next:(g,A)=>(i=A,d(g,A))})??await d(s,o);return r({url:s,req:i,res:y})}}function Le({url:e,req:t={},log:r=console.log}){const{method:n="GET"}=t;let o=`-> ${n} ${e}
10
- ${Array.from(new Headers(t.headers).entries()).map(([i,d])=>`${i}: ${d}`).join(`
9
+ `}}function cr(e={}){let t=typeof e.seed=="string"?0:e.seed??0;if(typeof e.seed=="string"){let r=0;for(let n=0;n<e.seed.length;n++)r+=e.seed.charCodeAt(n);t=r}return()=>{const r=Math.sin(t++)*1e4;return r-Math.floor(r)}}function qe({fetch:e=j().fetch,onRequest:t=n=>n.next(n.url,n.req),onResponse:r=n=>n.res}){return async(n,o)=>{const s=String(n);let a=o||{};const d=a.fetch||e,y=await t({url:s,req:a,next:(g,A)=>(a=A,d(g,A))})??await d(s,o);return r({url:s,req:a,res:y})}}function Ie({url:e,req:t={},log:r=console.log}){const{method:n="GET"}=t;let o=`-> ${n} ${e}
10
+ ${Array.from(new Headers(t.headers).entries()).map(([a,d])=>`${a}: ${d}`).join(`
11
11
  `)}
12
- `,s;if(t.body){if(t.body instanceof ReadableStream){const[i,d]=t.body.tee();t.body=i;const y=t.signal;s=Promise.resolve().then(async()=>{const g=d.getReader();for(r(o);!(y!=null&&y.aborted);){let{done:A,value:f}=await g.read();if(f instanceof Uint8Array&&(f=new TextDecoder().decode(f)),o+=f,r(f),!A)break}return o+=`
12
+ `,s;if(t.body){if(new Headers(t.headers).get("content-type")!=="application/octet-stream")if(t.body instanceof ReadableStream){const[a,d]=t.body.tee();t.body=a;const y=t.signal;s=Promise.resolve().then(async()=>{const g=d.getReader();for(r(o);!(y!=null&&y.aborted);){let{done:A,value:f}=await g.read();if(f instanceof Uint8Array&&(f=new TextDecoder().decode(f)),o+=f,r(f),!A)break}return o+=`
13
13
  `,o})}else o+=`
14
14
  ${t.body}
15
- `;r(o)}return s||Promise.resolve(o)}async function qe({res:e,url:t,req:r,log:n=console.log}){let o=`<- ${e.status} ${e.statusText} ${r.method} ${t}
16
- ${Array.from(e.headers.entries()).map(([i,d])=>`${i}: ${d}`).join(`
15
+ `;r(o)}return s||Promise.resolve(o)}async function De({res:e,url:t,req:r,log:n=console.log}){let o=`<- ${e.status} ${e.statusText} ${r.method} ${t}
16
+ ${Array.from(e.headers.entries()).map(([a,d])=>`${a}: ${d}`).join(`
17
17
  `)}
18
- `,s=e.headers.get("content-type");if(s!=null&&s.includes("application/json")||s!=null&&s.includes("text/plain")){const i=await e.text();o+=`
19
- ${i}
20
- `,e=new Response(i,e)}return n(o),e}function ir({fetch:e,log:t=console.log}={}){return Ne({fetch:e,onRequest:({url:r,req:n})=>{Le({url:r,req:n,log:t})},onResponse:({url:r,req:n,res:o})=>qe({url:r,req:n,res:o,log:t})})}function ar(e,t){try{if(typeof e=="string"&&e.length>0)return cr(e);if(typeof e=="number"&&isFinite(e))return t!=null&&t.long?lr(e):ur(e);throw new Error("Value is not a string or number.")}catch(r){const n=fr(r)?`${r.message}. value=${JSON.stringify(e)}`:"An unknown error has occurred.";throw new Error(n)}}function cr(e){if(e.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");const t=/^(?<value>-?(?:\d+)?\.?\d+) *(?<type>milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e),r=t==null?void 0:t.groups;if(!r)return NaN;const n=parseFloat(r.value),o=(r.type||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*315576e5;case"weeks":case"week":case"w":return n*6048e5;case"days":case"day":case"d":return n*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return n*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return n*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return n*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:throw new Error(`The unit ${o} was matched, but no matching case exists.`)}}function ur(e){const t=Math.abs(e);return t>=864e5?`${Math.round(e/864e5)}d`:t>=36e5?`${Math.round(e/36e5)}h`:t>=6e4?`${Math.round(e/6e4)}m`:t>=1e3?`${Math.round(e/1e3)}s`:`${e}ms`}function lr(e){const t=Math.abs(e);return t>=864e5?z(e,t,864e5,"day"):t>=36e5?z(e,t,36e5,"hour"):t>=6e4?z(e,t,6e4,"minute"):t>=1e3?z(e,t,1e3,"second"):`${e} ms`}function z(e,t,r,n){const o=t>=r*1.5;return`${Math.round(e/r)} ${n}${o?"s":""}`}function fr(e){return typeof e=="object"&&e!==null&&"message"in e}const dr={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Unused",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Required",413:"Request Entry Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};function Ie(e){return dr[e]}function hr(e){switch(e){case 408:case 425:case 429:case 502:case 503:case 504:return!0;default:return!1}}class re extends Error{constructor(t){super(t.message,{cause:t.cause}),this.detail=t,this.status=t.status,this.description=t.description}status;description;toJSON(){return{code:this.detail.code,message:this.message,status:this.status,description:this.description,cause:this.cause}}}class C{message;status;code;metadata;description;cause;constructor({status:t,message:r=Ie(t),code:n=t,metadata:o,description:s,cause:i}){this.message=r??String(t),this.status=t,this.code=n,this.description=s,this.metadata=o,this.cause=i}with(t){return typeof t=="string"&&(t={message:t}),t===void 0?new C(this):new C({status:this.status,code:this.code,message:this.message,metadata:this.metadata,cause:this.cause,...t})}asError(t){return typeof t=="string"&&(t={message:t}),new re(this.with(t))}require(t,r){if(t==null)throw this.asError(r);return t}check(t,r){switch(t){case!1:case void 0:case null:throw this.asError(r)}}throw(t){throw this.asError(t)}}class yr{static BadRequest=this.with({status:400});static Unauthorized=this.with({status:403});static Forbidden=this.with({status:403});static NotFound=this.with({status:404});static InternalServerError=this.with({status:501});static NotImplemented=this.with({status:501});static ServiceUnavailable=this.with({status:503});static with(t){return new C(t)}static ok(t,r){if(t.ok)return t;throw this.with({description:t.statusText,status:t.status,...r,metadata:{...r==null?void 0:r.metadata,response:t}}).asError()}static resolve(t){if(t instanceof C)return t;if(t instanceof re)return t.detail;if(t instanceof Error){const{message:r,code:n,status:o}=t;return new C({message:r,status:parseInt(o)||500,code:n,cause:t})}return new C({message:t.message,status:500,cause:t})}}export{b as ArrayBuffers,Pt as Buffer,re as DetailError,yr as Errors,or as PEM,de as TimeoutError,ze as arrayFromAsync,Fe as arrayOfMaybeArray,me as camelCase,L as classOf,ot as clearAsyncInterval,Nt as copy,st as createAsyncIterator,xt as createChildLogger,Ne as createFetchWith,ir as createFetchWithLogging,Z as createLazyPromise,W as createLogger,ge as createNoopLogger,sr as createRandom,Ut as createTranslate,Pe as createULID,N as deepEqual,Lt as download,Le as dumpRequest,qe as dumpResponse,it as firstOfAsyncIterator,ce as firstOfMaybeArray,St as formatBytes,H as get,It as getFileFromDataTransfer,O as getGlobalThis,Ie as getHttpStatusText,Q as getRandomValues,Qt as hex,q as isBuffer,dt as isClass,ht as isDefined,yt as isEmptyObject,fe as isIterator,$t as isModule,pe as isPlainObject,k as isPromise,hr as isRetryableHttpStatus,Ct as isTransferable,Xt as isULID,wt as isUUID,Ve as lastOfMaybeArray,Ee as loadScripts,qt as loadStyles,gt as maybeFunction,Yt as md5,mt as memoize,B as merge,ar as ms,J as nextOfAsyncIterator,De as objectOfMaybeArray,pt as parseBoolean,At as parseModuleId,_ as parseObjectPath,bt as parseTimestamp,rr as parseULID,Ot as pascalCase,Ft as randomUUID,we as renderTemplate,_e as set,nt as setAsyncInterval,Gt as sha1,Zt as sha256,Jt as sha384,Wt as sha512,ft as shallowClone,ut as shallowEqual,at as sleep,Vt as structuredClone,ct as timeout,ke as ulid};
18
+ `,s=e.headers.get("content-type");if(s!=null&&s.includes("application/json")||s!=null&&s.includes("text/plain")){const a=await e.text();o+=`
19
+ ${a}
20
+ `,e=new Response(a,e)}return n(o),e}function ur({fetch:e,log:t=console.log}={}){return qe({fetch:e,onRequest:({url:r,req:n})=>{Ie({url:r,req:n,log:t})},onResponse:({url:r,req:n,res:o})=>De({url:r,req:n,res:o,log:t})})}function lr(e,t){try{if(typeof e=="string"&&e.length>0)return fr(e);if(typeof e=="number"&&isFinite(e))return t!=null&&t.long?hr(e):dr(e);throw new Error("Value is not a string or number.")}catch(r){const n=yr(r)?`${r.message}. value=${JSON.stringify(e)}`:"An unknown error has occurred.";throw new Error(n)}}function fr(e){if(e.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");const t=/^(?<value>-?(?:\d+)?\.?\d+) *(?<type>milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e),r=t==null?void 0:t.groups;if(!r)return NaN;const n=parseFloat(r.value),o=(r.type||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*315576e5;case"weeks":case"week":case"w":return n*6048e5;case"days":case"day":case"d":return n*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return n*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return n*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return n*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:throw new Error(`The unit ${o} was matched, but no matching case exists.`)}}function dr(e){const t=Math.abs(e);return t>=864e5?`${Math.round(e/864e5)}d`:t>=36e5?`${Math.round(e/36e5)}h`:t>=6e4?`${Math.round(e/6e4)}m`:t>=1e3?`${Math.round(e/1e3)}s`:`${e}ms`}function hr(e){const t=Math.abs(e);return t>=864e5?z(e,t,864e5,"day"):t>=36e5?z(e,t,36e5,"hour"):t>=6e4?z(e,t,6e4,"minute"):t>=1e3?z(e,t,1e3,"second"):`${e} ms`}function z(e,t,r,n){const o=t>=r*1.5;return`${Math.round(e/r)} ${n}${o?"s":""}`}function yr(e){return typeof e=="object"&&e!==null&&"message"in e}const pr={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Unused",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Required",413:"Request Entry Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};function Ve(e){return pr[e]}function gr(e){switch(e){case 408:case 425:case 429:case 502:case 503:case 504:return!0;default:return!1}}class ne extends Error{constructor(t){super(t.message,{cause:t.cause}),this.detail=t,this.status=t.status,this.description=t.description}status;description;toJSON(){return{code:this.detail.code,message:this.message,status:this.status,description:this.description,cause:this.cause}}}class C{message;status;code;metadata;description;cause;constructor({status:t,message:r=Ve(t),code:n=t,metadata:o,description:s,cause:a}){this.message=r??String(t),this.status=t,this.code=n,this.description=s,this.metadata=o,this.cause=a}with(t){return typeof t=="string"&&(t={message:t}),t===void 0?new C(this):new C({status:this.status,code:this.code,message:this.message,metadata:this.metadata,cause:this.cause,...t})}asError(t){return typeof t=="string"&&(t={message:t}),new ne(this.with(t))}require(t,r){if(t==null)throw this.asError(r);return t}check(t,r){switch(t){case!1:case void 0:case null:throw this.asError(r)}}throw(t){throw this.asError(t)}toJSON(){return{code:this.code,message:this.message,status:this.status,description:this.description,cause:this.cause,metadata:this.metadata}}asResponse(){return new Response(JSON.stringify(this.toJSON()),{status:this.status,statusText:this.description,headers:{"Content-Type":"application/json"}})}}class mr{static BadRequest=this.with({status:400});static Unauthorized=this.with({status:403});static Forbidden=this.with({status:403});static NotFound=this.with({status:404});static InternalServerError=this.with({status:501});static NotImplemented=this.with({status:501});static ServiceUnavailable=this.with({status:503});static resolvers=[];static with(t){return new C(t)}static ok(t,r){if(t.ok)return t;throw this.with({description:t.statusText,status:t.status,...r,metadata:{...r==null?void 0:r.metadata,response:t}}).asError()}static resolve(t){if(t instanceof C)return t;if(t instanceof ne)return t.detail;for(const r of this.resolvers){const n=r(t);if(n)return n}if(t instanceof Error){const{message:r,code:n,status:o}=t;return new C({message:r,status:parseInt(o)||500,code:n,cause:t})}return new C({message:t.message,status:500,cause:t})}}export{w as ArrayBuffers,kt as Buffer,ne as DetailError,mr as Errors,ir as PEM,he as TimeoutError,_e as arrayFromAsync,He as arrayOfMaybeArray,we as camelCase,L as classOf,at as clearAsyncInterval,qt as copy,it as createAsyncIterator,jt as createChildLogger,qe as createFetchWith,ur as createFetchWithLogging,J as createLazyPromise,W as createLogger,me as createNoopLogger,cr as createRandom,Rt as createTranslate,ke as createULID,k as deepEqual,It as download,Ie as dumpRequest,De as dumpResponse,ct as firstOfAsyncIterator,ue as firstOfMaybeArray,Ct as formatBytes,_ as get,Vt as getFileFromDataTransfer,j as getGlobalThis,Ve as getHttpStatusText,Q as getRandomValues,tr as hex,Qt as hmac,q as isBuffer,yt as isClass,pt as isDefined,gt as isEmptyObject,de as isIterator,Et as isModule,ge as isPlainObject,N as isPromise,gr as isRetryableHttpStatus,Bt as isTransferable,rr as isULID,vt as isUUID,ze as lastOfMaybeArray,Ee as loadScripts,Dt as loadStyles,wt as maybeFunction,er as md5,bt as memoize,R as merge,lr as ms,Z as nextOfAsyncIterator,Fe as objectOfMaybeArray,mt as parseBoolean,xt as parseModuleId,H as parseObjectPath,At as parseTimestamp,sr as parseULID,Ut as pascalCase,Ht as randomUUID,be as renderTemplate,Ge as set,st as setAsyncInterval,Zt as sha1,Wt as sha256,Kt as sha384,Yt as sha512,ht as shallowClone,ft as shallowEqual,ut as sleep,zt as structuredClone,lt as timeout,Le as ulid};
21
21
  //# sourceMappingURL=index.js.map