@ckirg/corelib-cloud 0.1.22 → 0.2.0

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.
Files changed (74) hide show
  1. package/dist/aws/RequestUnlimited-CXTEHPLC.mjs +2 -0
  2. package/dist/aws/bun-THMEYPJD.mjs +2 -0
  3. package/dist/aws/chunk-6G4LF4KV.mjs +2 -0
  4. package/dist/aws/{chunk-F2KTMAO3.mjs → chunk-BIWQVQOH.mjs} +1 -1
  5. package/dist/aws/{chunk-Y7RZHZ53.mjs → chunk-QDX5GFCD.mjs} +1 -1
  6. package/dist/aws/chunk-QE5QGPOG.mjs +24 -0
  7. package/dist/aws/{chunk-V3XZ4XYN.mjs → chunk-XFLNYUID.mjs} +1 -1
  8. package/dist/aws/chunk-Z5QO7O62.mjs +8 -0
  9. package/dist/aws/chunk-ZGHY5A62.mjs +2 -0
  10. package/dist/aws/cloudflare-QTQSRNP7.mjs +2 -0
  11. package/dist/aws/deno-BKEQIY74.mjs +2 -0
  12. package/dist/{cloudrun/gcp-W76U73T6.js → aws/gcp-VNE5WPOL.mjs} +1 -1
  13. package/dist/aws/handler.mjs +3 -3
  14. package/dist/aws/lambda-4S67INQI.mjs +3 -0
  15. package/dist/aws/node-RQLZ4GQE.mjs +2 -0
  16. package/dist/aws/utils-5YBC32TV.mjs +2 -0
  17. package/dist/cloudflare/RequestUnlimited-OE7GCYBY.js +1 -0
  18. package/dist/cloudflare/bun-B6T46QQU.js +1 -0
  19. package/dist/cloudflare/{chunk-QPTGW2LL.js → chunk-BHGBRQZV.js} +1 -1
  20. package/dist/cloudflare/{chunk-EQSCULS7.js → chunk-GY2JCE4G.js} +2 -2
  21. package/dist/cloudflare/chunk-QPM32MRA.js +1 -0
  22. package/dist/cloudflare/chunk-VBA2ACKG.js +1 -0
  23. package/dist/cloudflare/{chunk-DGDAVQYC.js → chunk-ZMQIBLAC.js} +1 -1
  24. package/dist/cloudflare/cloudflare-CTNLQDS4.js +1 -0
  25. package/dist/cloudflare/deno-2KIX5TV5.js +1 -0
  26. package/dist/cloudflare/gcp-GBGWAZSX.js +1 -0
  27. package/dist/cloudflare/lambda-6HQKP6G3.js +1 -0
  28. package/dist/cloudflare/node-BRA7RBP5.js +1 -0
  29. package/dist/cloudflare/utils-3L6PYJAG.js +1 -0
  30. package/dist/cloudflare/worker.js +3 -3
  31. package/dist/cloudrun/RequestUnlimited-DEASSJEC.js +2 -0
  32. package/dist/cloudrun/bun-MBTNJC4U.js +2 -0
  33. package/dist/cloudrun/{chunk-JUVTJQ7I.js → chunk-6DRVUVNZ.js} +1 -1
  34. package/dist/cloudrun/chunk-EV26JQYW.js +2 -0
  35. package/dist/cloudrun/chunk-GSIUCMVK.js +8 -0
  36. package/dist/cloudrun/{chunk-FYZPEVAA.js → chunk-JBN5SOGD.js} +1 -1
  37. package/dist/cloudrun/chunk-MHUQ3MGN.js +24 -0
  38. package/dist/cloudrun/{chunk-GB4XIPDS.js → chunk-R26GKMTH.js} +1 -1
  39. package/dist/cloudrun/chunk-XO3TAODL.js +2 -0
  40. package/dist/cloudrun/cloudflare-5WFHLALX.js +2 -0
  41. package/dist/cloudrun/deno-7HS4QY7G.js +2 -0
  42. package/dist/{aws/gcp-ZEEIATV7.mjs → cloudrun/gcp-ODIRVFFY.js} +1 -1
  43. package/dist/cloudrun/lambda-HR2JPPGG.js +3 -0
  44. package/dist/cloudrun/node-YIKCMSEO.js +2 -0
  45. package/dist/cloudrun/server.js +4 -4
  46. package/dist/cloudrun/utils-TJZDD75X.js +2 -0
  47. package/package.json +3 -3
  48. package/dist/aws/RequestUnlimited-EKXQGSQT.mjs +0 -2
  49. package/dist/aws/bun-GK5CEVAU.mjs +0 -2
  50. package/dist/aws/chunk-QCE23AKJ.mjs +0 -8
  51. package/dist/aws/chunk-STPKE4A5.mjs +0 -24
  52. package/dist/aws/cloudflare-BDB3FS4Y.mjs +0 -2
  53. package/dist/aws/deno-AIUOFIXG.mjs +0 -2
  54. package/dist/aws/lambda-S3DVSSBV.mjs +0 -3
  55. package/dist/aws/node-A7ZN443L.mjs +0 -2
  56. package/dist/aws/utils-KMHFLZAJ.mjs +0 -2
  57. package/dist/cloudflare/RequestUnlimited-QCOTVU4G.js +0 -1
  58. package/dist/cloudflare/bun-O4EJPGLH.js +0 -1
  59. package/dist/cloudflare/chunk-O3XYZ4KS.js +0 -1
  60. package/dist/cloudflare/cloudflare-I5A4OJEG.js +0 -1
  61. package/dist/cloudflare/deno-KE6IVNNU.js +0 -1
  62. package/dist/cloudflare/gcp-MNKOPDML.js +0 -1
  63. package/dist/cloudflare/lambda-PLZQW4BF.js +0 -1
  64. package/dist/cloudflare/node-DRV76TUB.js +0 -1
  65. package/dist/cloudflare/utils-7K7MHQMD.js +0 -1
  66. package/dist/cloudrun/RequestUnlimited-YQAPYTOH.js +0 -2
  67. package/dist/cloudrun/bun-BONNABBU.js +0 -2
  68. package/dist/cloudrun/chunk-5B5BV7SP.js +0 -8
  69. package/dist/cloudrun/chunk-CFQMQATE.js +0 -24
  70. package/dist/cloudrun/cloudflare-Q3ZW7CDF.js +0 -2
  71. package/dist/cloudrun/deno-CPTVGH3A.js +0 -2
  72. package/dist/cloudrun/lambda-NKM4QA4M.js +0 -3
  73. package/dist/cloudrun/node-SKMPZMFE.js +0 -2
  74. package/dist/cloudrun/utils-SDRX3ZUT.js +0 -2
@@ -0,0 +1,8 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as E}from"./chunk-6G4LF4KV.mjs";import{a as M,c as Z,d as ee,g as we,h as z,i as te,j as be,k as Re,l as ke,m as re}from"./chunk-QDX5GFCD.mjs";import{a as ye}from"./chunk-XFLNYUID.mjs";import{h as u}from"./chunk-VULBPPPP.mjs";u();u();var x={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},Jt={defaultMerge:x.defaultMerge};function et(t,e){return e}function tt(t,e){return t.filter(r=>r!==void 0)}var Te;(function(t){t[t.NOT=0]="NOT",t[t.RECORD=1]="RECORD",t[t.ARRAY=2]="ARRAY",t[t.SET=3]="SET",t[t.MAP=4]="MAP",t[t.OTHER=5]="OTHER"})(Te||(Te={}));function xe(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:ot(t)?1:t instanceof Set?3:t instanceof Map?4:5}function rt(t){let e=new Set;for(let r of t)for(let n of[...Object.keys(r),...Object.getOwnPropertySymbols(r)])e.add(n);return e}function nt(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Ee(t){let e=0,r=t[0]?.[Symbol.iterator]();return{[Symbol.iterator](){return{next(){do{if(r===void 0)return{done:!0,value:void 0};let n=r.next();if(n.done===!0){e+=1,r=t[e]?.[Symbol.iterator]();continue}return{done:!1,value:n.value}}while(!0)}}}}}var Se=["[object Object]","[object Module]"];function ot(t){if(!Se.includes(Object.prototype.toString.call(t)))return!1;let{constructor:e}=t;if(e===void 0)return!0;let r=e.prototype;return!(r===null||typeof r!="object"||!Se.includes(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function st(t,e,r){let n={};for(let o of rt(t)){let s=[];for(let a of t)nt(a,o)&&s.push(a[o]);if(s.length===0)continue;let i=e.metaDataUpdater(r,{key:o,parents:t}),c=Oe(s,e,i);c!==x.skip&&(o==="__proto__"?Object.defineProperty(n,o,{value:c,configurable:!0,enumerable:!0,writable:!0}):n[o]=c)}return n}function it(t){return t.flat()}function at(t){return new Set(Ee(t))}function ct(t){return new Map(Ee(t))}function ut(t){return t.at(-1)}var H={mergeRecords:st,mergeArrays:it,mergeSets:at,mergeMaps:ct,mergeOthers:ut};function $(t,e){let r=ft(t,n);function n(...o){return Oe(o,r,e)}return n}function ft(t,e){return{defaultMergeFunctions:H,mergeFunctions:{...H,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(H,r)).map(([r,n])=>n===!1?[r,H.mergeOthers]:[r,n]))},metaDataUpdater:t.metaDataUpdater??et,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,filterValues:t.filterValues===!1?void 0:t.filterValues??tt,actions:x}}function Oe(t,e,r){let n=e.filterValues?.(t,r)??t;if(n.length===0)return;if(n.length===1)return ne(n,e,r);let o=xe(n[0]);if(o!==0&&o!==5){for(let s=1;s<n.length;s++)if(xe(n[s])!==o)return ne(n,e,r)}switch(o){case 1:return lt(n,e,r);case 2:return dt(n,e,r);case 3:return ht(n,e,r);case 4:return mt(n,e,r);default:return ne(n,e,r)}}function lt(t,e,r){let n=e.mergeFunctions.mergeRecords(t,e,r);return n===x.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeRecords!==e.defaultMergeFunctions.mergeRecords?e.defaultMergeFunctions.mergeRecords(t,e,r):n}function dt(t,e,r){let n=e.mergeFunctions.mergeArrays(t,e,r);return n===x.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeArrays!==e.defaultMergeFunctions.mergeArrays?e.defaultMergeFunctions.mergeArrays(t):n}function ht(t,e,r){let n=e.mergeFunctions.mergeSets(t,e,r);return n===x.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeSets!==e.defaultMergeFunctions.mergeSets?e.defaultMergeFunctions.mergeSets(t):n}function mt(t,e,r){let n=e.mergeFunctions.mergeMaps(t,e,r);return n===x.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeMaps!==e.defaultMergeFunctions.mergeMaps?e.defaultMergeFunctions.mergeMaps(t):n}function ne(t,e,r){let n=e.mergeFunctions.mergeOthers(t,e,r);return n===x.defaultMerge||e.useImplicitDefaultMerging&&n===void 0&&e.mergeFunctions.mergeOthers!==e.defaultMergeFunctions.mergeOthers?e.defaultMergeFunctions.mergeOthers(t):n}u();u();u();u();var R=class extends Error{name="KyError";get isKyError(){return!0}};var k=class extends R{name="HTTPError";response;request;options;data;constructor(e,r,n){let o=e.status||e.status===0?e.status:"",s=e.statusText??"",i=`${o} ${s}`.trim(),c=i?`status code ${i}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.response=e,this.request=r,this.options=n}};u();var v=class extends R{name="NetworkError";request;constructor(e,r){super(`Request failed due to a network error: ${e.method} ${e.url}`,r),this.request=e}};u();var A=class extends Error{name="NonError";value;constructor(e){let r="Non-error value was thrown";try{typeof e=="string"?r=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(r=e.message)}catch{}super(r),this.value=e}};u();var O=class extends R{name="ForceRetryError";customDelay;code;customRequest;constructor(e){let r=e?.cause?e.cause instanceof Error?e.cause:new A(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",r?{cause:r}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}};u();var B=class extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}};u();var w=class extends R{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}};u();u();var oe=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return t&&!e})(),Pe=typeof globalThis.AbortController=="function",V=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Me=typeof globalThis.ReadableStream=="function",ve=typeof globalThis.FormData=="function",J=["get","post","put","patch","head","delete"],pt=()=>{};pt();var Ae={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},q=2147483647,qe=40,W=Symbol("stop"),F=class{options;constructor(e){this.options=e}},Ce=t=>new F(t),je={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Ie={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};var K=new TextEncoder,gt=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[r,n]of t)e+=qe,e+=K.encode(`Content-Disposition: form-data; name="${r}"`).byteLength,e+=typeof n=="string"?K.encode(n).byteLength:n.size;return e}return t instanceof Blob?t.size:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:typeof t=="string"?K.encode(t).byteLength:t instanceof URLSearchParams?K.encode(t.toString()).byteLength:0},Fe=(t,e,r)=>{let n,o=0;return t.pipeThrough(new TransformStream({transform(s,i){if(i.enqueue(s),n){o+=n.byteLength;let c=e===0?0:o/e;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(e,o),transferredBytes:o},n)}n=s},flush(){n&&(o+=n.byteLength,r?.({percent:1,totalBytes:Math.max(e,o),transferredBytes:o},n))}}))},_e=(t,e)=>{if(!t.body)return t;let r={status:t.status,statusText:t.statusText,headers:t.headers};if(t.status===204)return new Response(null,r);let n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(Fe(t.body,n,e),r)},Le=(t,e,r)=>{if(!t.body)return t;let n=gt(r??t.body);return new Request(t,{duplex:"half",body:Fe(t.body,n,e)})};u();u();var T=t=>t!==null&&typeof t=="object";var yt=Symbol("replaceOption"),se=t=>T(t)&&t[yt]===!0?{isReplace:!0,value:t.value}:{isReplace:!1,value:t};var L=(...t)=>{for(let e of t)if((!T(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return ce({},...t)},ae=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(let[s,i]of o.entries())n&&i==="undefined"||i===void 0?r.delete(s):r.set(s,i);return r},ie=t=>{if(!T(t)||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},C=t=>{if(t instanceof URLSearchParams){let e=new URLSearchParams(t),r=t[S];return r&&(e[S]=new Set(r)),e}return t instanceof globalThis.Headers?new globalThis.Headers(t):Array.isArray(t)?[...t]:ie(t)?{...t}:t},wt=t=>Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0)),bt=(t,e)=>ie(t)&&ie(e)?wt({...t,...e}):ae(t,e);function _(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:ce(t[r]??[],e[r]??[])}var X=(t={},e={})=>({init:_(t,e,"init"),beforeRequest:_(t,e,"beforeRequest"),beforeRetry:_(t,e,"beforeRetry"),beforeError:_(t,e,"beforeError"),afterResponse:_(t,e,"afterResponse")}),S=Symbol("deletedParameters"),Rt=(t,e)=>{let r=new URLSearchParams,n=new Set;for(let o of[t,e])if(o!==void 0)if(o instanceof URLSearchParams){for(let[i,c]of o.entries())r.append(i,c),n.delete(i);let s=o[S];if(s)for(let i of s)r.delete(i),n.add(i)}else if(Array.isArray(o))for(let s of o){if(!Array.isArray(s)||s.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(s[0]),String(s[1])),n.delete(String(s[0]))}else if(T(o))for(let[s,i]of Object.entries(o))i===void 0?(r.delete(s),n.add(s)):(r.append(s,String(i)),n.delete(s));else{let s=new URLSearchParams(o);for(let[i,c]of s.entries())r.append(i,c),n.delete(i)}return n.size>0&&(r[S]=n),r},ce=(...t)=>{let e={},r={},n={},o,s=[];for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(T(i)){for(let[c,a]of Object.entries(i)){if(c==="signal"&&a instanceof globalThis.AbortSignal){s.push(a);continue}let f=se(a),{isReplace:l}=f;if(a=f.value,c==="context"){if(a!=null&&(!T(a)||Array.isArray(a)))throw new TypeError("The `context` option must be an object");e={...e,context:a==null?{}:l?{...a}:{...e.context,...a}};continue}if(c==="searchParams"){a==null?o=void 0:l?o=a:o=o===void 0?a:Rt(o,a);continue}T(a)&&!l&&c in e&&(a=ce(e[c],a)),e={...e,[c]:a}}if(T(i.hooks)){let{value:c,isReplace:a}=se(i.hooks);n=X(a?{}:n,c),e.hooks=n}if(T(i.headers)){let{value:c,isReplace:a}=se(i.headers);r=a?C(c):bt(r,c),e.headers=r}}return o!==void 0&&(e.searchParams=o),s.length>0&&(s.length===1?e.signal=s[0]:V?e.signal=AbortSignal.any(s):e.signal=s.at(-1)),e};u();var Ne=t=>J.includes(t)?t.toUpperCase():t,kt=["get","put","head","delete","options","trace"],Tt=[408,413,429,500,502,503,504],xt=[413,429,503],De={limit:2,methods:kt,statusCodes:Tt,afterStatusCodes:xt,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Ue=(t={})=>{if(typeof t=="number")return{...De,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");let e=Object.fromEntries(Object.entries({...t,methods:t.methods?.map(r=>r.toLowerCase())}).filter(([,r])=>r!==void 0));return{...De,...e}};u();async function ue(t,e,r,n){return new Promise((o,s)=>{let i=setTimeout(()=>{r&&r.abort(),s(new w(t))},n.timeout);n.fetch(t,e).then(o).catch(s).then(()=>{clearTimeout(i)})})}u();async function Y(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(s),n(e.reason)}let s=setTimeout(()=>{e?.removeEventListener("abort",o),r()},t)})}u();var ze=t=>{let e={};for(let r in t)Object.hasOwn(t,r)&&!(r in Ie)&&!(r in je)&&(e[r]=t[r]);return e},He=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0||!!t[S]?.size:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t;u();var St=Object.prototype.toString,Et=t=>St.call(t)==="[object Error]",Ot=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function fe(t){if(!(t&&Et(t)&&t.name==="TypeError"&&typeof t.message=="string"))return!1;let{message:r,stack:n}=t;return r==="Load failed"?n===void 0||"__sentry_captured__"in t:r.startsWith("error sending request for url")||r==="Failed to fetch"||r.startsWith("Failed to fetch (")&&r.endsWith(")")?!0:Ot.has(r)}u();var le=(t,e)=>t instanceof e||t?.name===e.name;function $e(t){return le(t,k)}function Be(t){return le(t,v)}function Ve(t){return le(t,w)}var Pt=10*1024*1024,Mt="The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl",D=Symbol("timedOutResponseData"),vt=t=>{let e=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(t),r=e?.[1]??e?.[2];if(r)try{return new TextDecoder(r)}catch{}return new TextDecoder},Je="The `schema` argument must follow the Standard Schema specification",At=t=>typeof t!="object"?t:{...t,...t.methods&&{methods:[...t.methods]},...t.statusCodes&&{statusCodes:[...t.statusCodes]},...t.afterStatusCodes&&{afterStatusCodes:[...t.afterStatusCodes]}},Xe=Object.prototype.toString,We=t=>t instanceof globalThis.Request||Xe.call(t)==="[object Request]",N=t=>t instanceof globalThis.Response||Xe.call(t)==="[object Response]",qt=t=>Array.isArray(t)?t.map(e=>[...e]):C(t);function Ct(t){let e={...t,json:C(t.json),context:C(t.context),headers:C(t.headers),searchParams:qt(t.searchParams)};return t.retry!==void 0&&(e.retry=At(t.retry)),e}var Ke=async(t,e)=>{if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError(Je);let r=e["~standard"];if(typeof r!="object"||r===null||typeof r.validate!="function")throw new TypeError(Je);let n=await r.validate(t);if(n.issues)throw new B(n.issues);return n.value},U=class t{static create(e,r){let n=r.hooks?.init??[],o=n.length>0?Ct(r):r;for(let a of n)a(o);let s=new t(e,o),i=async()=>{if(typeof s.#e.timeout=="number"&&s.#e.timeout>q)throw new RangeError(`The \`timeout\` option cannot be greater than ${q}`);if(typeof s.#e.totalTimeout=="number"&&s.#e.totalTimeout>q)throw new RangeError(`The \`totalTimeout\` option cannot be greater than ${q}`);await Promise.resolve();let a=await s.#I(),f=a??await s.#O(async()=>s.#y()),l=a!==void 0||s.#g();for(;;){if(f===void 0)return f;if(N(f))try{f=await s.#F(f)}catch(p){if(!(p instanceof O))throw p;let b=await s.#p(p,async()=>s.#y());if(b===void 0)return b;f=b,l=s.#g();continue}let d=f;if(!d.ok&&d.type!=="opaque"&&(typeof s.#e.throwHttpErrors=="function"?s.#e.throwHttpErrors(d.status):s.#e.throwHttpErrors)){let p=new k(d,s.#a(d),s.#i()),b=p;if(p.data=await s.#A(d),l)throw b;let g=await s.#p(p,async()=>s.#y());if(g===void 0)return g;f=g,l=s.#g();continue}break}if(!N(f))return f;if(s.#x(f),s.#e.onDownloadProgress){if(typeof s.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Me)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");let d=f.clone();return s.#n(f),_e(d,s.#e.onDownloadProgress)}return f},c=(async()=>{try{return await i()}catch(a){if(!(a instanceof Error)||s.#k.has(a))throw a;let f=a;for(let l of s.#e.hooks.beforeError){let d=await l({request:s.request,options:s.#i(),error:f,retryCount:s.#r});d instanceof Error&&(f=d)}throw f}finally{let a=s.#R;s.#m(a?.body??void 0),s.request!==a&&s.#m(s.request.body??void 0)}})();for(let[a,f]of Object.entries(Ae))a==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(c[a]=async l=>{s.request.headers.set("accept",s.request.headers.get("accept")||f);let d=await c;if(a!=="json")return d[a]();let p=await d.text();if(p==="")return l!==void 0?Ke(void 0,l):JSON.parse(p);let b=o.parseJson?await o.parseJson(p,{request:s.#a(d),response:d}):JSON.parse(p);return l===void 0?b:Ke(b,l)});return c}static#M(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0)):e}request;#o;#r=0;#t;#e;#R;#c;#k=new WeakSet;#u;#h;#f=!1;#T=new WeakMap;constructor(e,r={}){if(this.#t=e,Object.hasOwn(r,"prefixUrl"))throw new Error(Mt);if(this.#e={...r,headers:ae(this.#t.headers,r.headers),hooks:X({},r.hooks),method:Ne(r.method??this.#t.method??"GET"),prefix:String(r.prefix||""),retry:Ue(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,totalTimeout:r.totalTimeout??!1,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(typeof this.#t=="string"){if(this.#e.prefix){let o=this.#e.prefix.replace(/\/+$/,""),s=this.#t.replace(/^\/+/,"");this.#t=`${o}/${s}`}if(this.#e.baseUrl){let o;try{o=new URL(this.#t)}catch{}o||(this.#t=new URL(this.#t,new Request(this.#e.baseUrl).url))}}Pe&&V&&(this.#c=this.#e.signal??this.#t.signal,this.#o=new globalThis.AbortController,this.#e.signal=this.#E()),oe&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(ve&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!n&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),He(this.#e.searchParams)){let o=new URL(this.request.url),s=this.#e.searchParams?.[S];if(s)for(let i of s)o.searchParams.delete(i);if(typeof this.#e.searchParams=="string"){let i=this.#e.searchParams.replace(/^\?/,"");i!==""&&(o.search=o.search?`${o.search}&${i}`:`?${i}`)}else{let i=new URLSearchParams(t.#M(this.#e.searchParams));for(let[c,a]of i.entries())o.searchParams.append(c,a)}if(this.#e.searchParams&&typeof this.#e.searchParams=="object"&&!Array.isArray(this.#e.searchParams)&&!(this.#e.searchParams instanceof URLSearchParams))for(let[i,c]of Object.entries(this.#e.searchParams))c===void 0&&o.searchParams.delete(i);this.request=new globalThis.Request(o,this.#e)}if(this.#e.onUploadProgress&&typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");this.#h=typeof this.#e.totalTimeout=="number"?this.#P():void 0}#s(){let e=this.#e.retry.delay(this.#r+1),r=e;return this.#e.retry.jitter===!0?r=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(r=this.#e.retry.jitter(e),(!Number.isFinite(r)||r<0)&&(r=e)),Math.min(this.#e.retry.backoffLimit,r)}async#v(e){if(this.#r>=this.#e.retry.limit)throw e;let r=e instanceof Error?e:new A(e);if(r instanceof O)return r.customDelay??this.#s();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){let n=await this.#e.retry.shouldRetry({error:r,retryCount:this.#r+1});if(n===!1)throw e;if(n===!0)return this.#s()}if(Ve(e)){if(!this.#e.retry.retryOnTimeout)throw e;return this.#s()}if($e(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let o=Number(n)*1e3;return Number.isNaN(o)?o=Date.parse(n)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now()),Number.isFinite(o)?(o=Math.max(0,o),Math.min(this.#e.retry.maxRetryAfter,o)):Math.min(this.#e.retry.maxRetryAfter,this.#s())}if(e.response.status===413)throw e;return this.#s()}if(!Be(e))throw e;return this.#s()}#x(e){let r=this.#a(e);return this.#e.parseJson&&(e.json=async()=>{let n=await e.text();return n===""?JSON.parse(n):this.#e.parseJson(n,{request:r,response:e})}),e}async#A(e){let r=await this.#C(e,this.#S());if(r===D){this.#l();return}if(!r)return;if(!this.#q(e.headers.get("content-type")??""))return r;let n=await this.#j(r,e,this.#S(),this.#a(e));if(n===D){this.#l();return}return n}#S(){let e=this.#e.timeout===!1?1e4:this.#e.timeout,r=this.#d();if(r===void 0)return e;if(r<=0)throw new w(this.request);return Math.min(e,r)}#q(e){let r=(e.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(r)}async#C(e,r){let{body:n}=e;if(!n)try{return await e.text()}catch{return}let o;try{o=n.getReader()}catch{return}let s=vt(e.headers.get("content-type")??""),i=[],c=0,a=(async()=>{try{for(;;){let{done:d,value:p}=await o.read();if(d)break;if(c+=p.byteLength,c>Pt){o.cancel().catch(()=>{});return}i.push(s.decode(p,{stream:!0}))}}catch{return}return i.push(s.decode()),i.join("")})(),f=new Promise(d=>{let p=setTimeout(()=>{d(D)},r);a.finally(()=>{clearTimeout(p)})}),l=await Promise.race([a,f]);return l===D&&o.cancel().catch(()=>{}),l}async#j(e,r,n,o){let s;try{return await Promise.race([Promise.resolve().then(()=>this.#e.parseJson?this.#e.parseJson(e,{request:o,response:r}):JSON.parse(e)),new Promise(i=>{s=setTimeout(()=>{i(D)},n)})])}catch{return}finally{clearTimeout(s)}}#m(e){e&&e.cancel().catch(()=>{})}#n(e){this.#m(e.body??void 0)}#E(){return this.#c?AbortSignal.any([this.#c,this.#o.signal]):this.#o.signal}#l(){let e=this.#d();if(e!==void 0&&e<=0)throw new w(this.request)}async#I(){for(let e of this.#e.hooks.beforeRequest){let r=await e({request:this.request,options:this.#i(),retryCount:0});if(We(r))this.#w(r);else if(N(r))return r}}async#F(e){let r=this.#a(e);for(let n of this.#e.hooks.afterResponse){let o=this.#b(e.clone(),r);this.#x(o);let s;try{s=await n({request:this.request,options:this.#i(),response:o,retryCount:this.#r})}catch(c){throw o!==e&&this.#n(o),this.#n(e),c}if(s instanceof F)throw o!==e&&this.#n(o),this.#n(e),new O(s.options);let i=N(s)?this.#b(s,r):e;o!==e&&o!==i&&o.body!==i.body&&this.#n(o),e!==i&&e.body!==i.body&&this.#n(e),e=i}return e}async#O(e){try{return await e()}catch(r){return this.#p(r,e)}}async#p(e,r){this.#f=!1;let n=Math.min(await this.#v(e),q),o={signal:this.#c},s=this.#d();if(s!==void 0){if(s<=0)throw new w(this.request);if(n>=s)throw await Y(s,o),new w(this.request)}if(await Y(n,o),this.#l(),e instanceof O&&e.customRequest){let i=new globalThis.Request(e.customRequest,this.#e.signal?{signal:this.#e.signal}:void 0);this.#w(i)}for(let i of this.#e.hooks.beforeRetry){let c;try{c=await i({request:this.request,options:this.#i(),error:e,retryCount:this.#r+1})}catch(a){throw a instanceof Error&&a!==e&&this.#k.add(a),a}if(We(c)){this.#w(c);break}if(N(c))return this.#f=!0,this.#r++,c;if(c===W)return}return this.#l(),this.#r++,this.#O(r)}#g(){let e=this.#f;return this.#f=!1,e}async#y(){this.#o?.signal.aborted&&(this.#o=new globalThis.AbortController,this.#e.signal=this.#E(),this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));let e=ze(this.#e),r=this.#e.retry.limit>0?this.request.clone():void 0,n=this.#_(this.request,this.#e.body??void 0);this.#R=n,r&&(this.request=r);try{let o=this.#d();if(o!==void 0&&o<=0)throw new w(this.request);let s=this.#e.timeout===!1?o:o===void 0?this.#e.timeout:Math.min(this.#e.timeout,o),i=s===void 0?await this.#e.fetch(n,e):await ue(n,e,this.#o,{timeout:s,fetch:this.#e.fetch});return this.#b(i,n)}catch(o){throw fe(o)?new v(this.request,{cause:o}):o}}#d(){if(this.#h===void 0)return;let e=this.#P()-this.#h;return Math.max(0,this.#e.totalTimeout-e)}#P(){return globalThis.performance?.now()??Date.now()}#i(){if(!this.#u){let{hooks:e,json:r,parseJson:n,stringifyJson:o,searchParams:s,timeout:i,totalTimeout:c,throwHttpErrors:a,fetch:f,...l}=this.#e;this.#u=Object.freeze(l)}return this.#u}#w(e){this.#u=void 0,this.request=e}#a(e){return this.#T.get(e)??this.request}#b(e,r){return this.#T.set(e,r),e}#_(e,r){return!this.#e.onUploadProgress||!e.body||!oe?e:Le(e,this.#e.onUploadProgress,r??this.#e.body??void 0)}};var de=t=>{let e=(r,n)=>U.create(r,L(t,n));for(let r of J)e[r]=(n,o)=>U.create(n,L(t,o,{method:r}));return e.create=r=>de(L(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),de(L(t,r))),e.stop=W,e.retry=Ce,e},jt=de(),Ye=jt;u();u();import{EventEmitter as Ft}from"events";var he={markets:{chromeVersion:"146",nasdaq:{statusEndpoint:"https://api.nasdaq.com/api/market-info",monitor:{liveIntervalSec:10,closedIntervalSec:3600,warnIntervalSec:60},symbols:{nasdaqListedUrl:"https://www.nasdaqtrader.com/dynamic/symdir/nasdaqlisted.txt",otherListedUrl:"https://www.nasdaqtrader.com/dynamic/symdir/otherlisted.txt",initialBackoffMs:1e3,maxRetryBackoffMs:36e5,maxFetchRetries:10},quotes:{concurrencyLimit:5}}},retrieve:{timeout:5e4,retry:{limit:5,backoffLimit:3e3}}};u();async function Ge(t){let{getEnv:e}=await import("./utils-5YBC32TV.mjs"),r=(await import("crypto")).default,n=e("CORELIB_AES_PASSWORD");if(!n)throw new Error("Decryption failed: CORELIB_AES_PASSWORD environment variable is not set.");let o=t.split(`
3
+ `).map(l=>l.trim()).filter(Boolean);if(o.length<2)throw new Error("Invalid .enc file format. Expected IV on line 1 and Ciphertext on line 2.");let s=Buffer.from(o[0],"base64"),i=Buffer.from(o[1],"base64"),c=Buffer.from(n,"hex"),a=r.createDecipheriv("aes-256-cbc",c,s),f=a.update(i);return f=Buffer.concat([f,a.final()]),JSON.parse(f.toString("utf8"))}var me=$({mergeArrays:!1}),_t=t=>!t.split(/[.-]/).some(e=>e==="__proto__"||e==="constructor"||e==="prototype");function j(t,e){for(let r of Object.keys(t))r in e||delete t[r];for(let r of Object.keys(e)){let n=e[r];n&&typeof n=="object"&&!Array.isArray(n)?((!t[r]||typeof t[r]!="object"||Array.isArray(t[r]))&&(t[r]={}),j(t[r],n)):t[r]=n}}function Lt(t,e,r,n){let o=t;for(;;){if(r(e.join(o,"pnpm-workspace.yaml")))return e.basename(o);let s=e.join(o,"package.json");if(r(s))try{if(JSON.parse(n(s)).workspaces)return e.basename(o)}catch{}let i=e.dirname(o);if(i===o)break;o=i}return e.basename(t)}var P=class t extends Ft{static instance;_config={};_defaultsPath;static _logger=M.child({section:"ConfigManager"});_initPromise=null;_isInitialized=!1;_mutationChain=Promise.resolve();_inFlightTempConfig=null;static _prematureWarnEmitted=!1;constructor(){super();let e=Re(),r=e;try{let{join:n}=ee()("node:path");r=n(e,"ConfigManager.json")}catch{r=`${e}/ConfigManager.json`}this._defaultsPath=r,j(this._config,he),globalThis.sysconfig=this._config}static getInstance(){return t.instance||(t.instance=new t),t.instance}get(e){!this._isInitialized&&!t._prematureWarnEmitted&&re()!=="production"&&(t._prematureWarnEmitted=!0,t._logger.warn(`ConfigManager.get("${e}") called before initialize() resolved; returning seeded default`));let r=e.split("."),n=this._config;for(let o of r){if(n===null||typeof n!="object"||!(o in n))return;n=n[o]}return n}static get(e){return t.getInstance().get(e)}initialize(e){return this._initPromise?this._initPromise:(this._initPromise=this._enqueue(()=>this.runInitSequence(e)).then(()=>{this._isInitialized=!0,this._initPromise=null},r=>{throw this._initPromise=null,r}),this._initPromise)}async runInitSequence(e){t._logger.trace("initialize: start");let r=e??(typeof process<"u"&&Array.isArray(process.argv)?process.argv.slice(2):[]),n,o={};for(let i=0;i<r.length;i++){let c=r[i];if(c==="-C"||c==="--config"){i+1<r.length&&!r[i+1].startsWith("-")&&(n=r[++i]);continue}if(c.startsWith("--config=")){n=c.slice(9);continue}if(!c.startsWith("--"))continue;let a=c.slice(2);if(a===""||a.startsWith("="))continue;let f,l=a.indexOf("=");l>-1?(f=a.slice(l+1),a=a.slice(0,l)):i+1<r.length&&!r[i+1].startsWith("-")?f=r[++i]:f=!0,o[a]=f}t._logger.trace("initialize: resolved",{hasConfigPath:n!=null,overrideCount:Object.keys(o).length});let s={};this._inFlightTempConfig=s;try{if(this.loadDefaults(s),n){let i=await this.fetchExternalConfig(n);this.processHierarchy(i,s)}this.applyEnvOverrides(s),this.applyCliOverrides(o,s),j(this._config,s),t._logger.trace("initialize: committed",{keys:Object.keys(this._config??{}).length}),this.emit("initialized",this._config)}finally{this._inFlightTempConfig=null}}_enqueue(e){let r=this._mutationChain.then(e,e);return this._mutationChain=r.then(()=>{},()=>{}),r}getConfig(){return this._config}get isInitialized(){return this._isInitialized}whenReady(){return this._isInitialized?Promise.resolve():this._initPromise??Promise.resolve()}loadExternalConfig(e){return this._enqueue(()=>this.loadExternalConfigInner(e))}async loadExternalConfigInner(e){try{let r=await this.fetchExternalConfig(e),n=structuredClone(this._config);this._inFlightTempConfig=n;try{this.processHierarchy(r,n),this.applyEnvOverrides(n),j(this._config,n),this.emit("configLoaded",this._config)}finally{this._inFlightTempConfig=null}}catch(r){throw this.logError(`Failed to load external config dynamically from ${e}`,r),r}}loadDefaults(e){let r={...he};if(te(this._defaultsPath))try{r=JSON.parse(z(this._defaultsPath))}catch(n){this.logError("Failed to load defaults",n)}j(e,r)}async fetchExternalConfig(e){t._logger.trace("external config",{source:e.startsWith("http")?"http":"file"});let r;if(e.startsWith("http")){let{endPoint:s}=await import("./RequestUnlimited-CXTEHPLC.mjs"),i=await s(e);if(i.status==="error")throw new Error("Failed to fetch external config");r=i.value.body}else r=z(e);let n=e.toLowerCase();if(n.endsWith(".enc")){t._logger.trace("decrypting .enc config");let s=this.validateConfigObject(await Ge(r),e);return t._logger.trace("decryption ok"),s}let o=await import("./dist-VV3A6A7N.mjs");return n.endsWith(".yaml")||n.endsWith(".yml")?this.validateConfigObject(o.parseYAML(r),e):n.endsWith(".toml")?this.validateConfigObject(o.parseTOML(r),e):n.endsWith(".json5")?this.validateConfigObject(o.parseJSON5(r),e):n.endsWith(".jsonc")?this.validateConfigObject(o.parseJSONC(r),e):n.endsWith(".ini")?this.validateConfigObject(o.parseINI(r),e):this.validateConfigObject(o.parseJSON(r),e)}validateConfigObject(e,r){if(e===null||typeof e!="object"||Array.isArray(e))throw new Error(`Config from "${r}" must be a JSON object, got ${Array.isArray(e)?"array":typeof e}`);return e}processHierarchy(e,r){if(!e)return;let n=this.getAppName(),o=ke(),s=re(),i=e.commonAll||{},c=Object.keys(e).find(l=>l.toLowerCase()===n.toLowerCase()),a=c?e[c]:null;if(a){a.common&&(i=me(i,a.common));let l=a[o];if(l){let d=l[s];d&&(i=me(i,d))}}let f=me(r,i);j(r,f)}applyEnvOverrides(e){let r="CORELIB_",n=we();Object.keys(n).forEach(o=>{if(o.startsWith(r)){let s=o.slice(r.length).toLowerCase().replace(/_/g,".");t._logger.trace("env override",{key:s});let i=this.parseValue(n[o]);this.setPath(e,s,i)}})}applyCliOverrides(e,r){Object.keys(e).forEach(n=>{if(n==="config")return;if(!_t(n)){t._logger.warn(`Dropped unsafe CLI override key "${n}" (prototype-pollution guard)`);return}let o=n.replace(/-/g,".");t._logger.trace("cli override",{key:o});let s=this.parseValue(e[n]);this.setPath(r,o,s)})}updateValue(e,r){this.setPath(this._config,e,r),this._inFlightTempConfig!==null&&this.setPath(this._inFlightTempConfig,e,r),this.emit("change",{path:e,value:r}),this.emit(`change:${e}`,r)}setPath(e,r,n){let o=r.split("."),s=e;for(;o.length>1;){let i=o.shift();(!(i in s)||typeof s[i]!="object"||s[i]===null)&&(s[i]={}),s=s[i]}s[o[0]]=n}parseValue(e){if(typeof e!="string")return e;if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("{")&&e.endsWith("}"))try{return JSON.parse(e)}catch(r){return this.logError("Failed to parse complex JSON from CLI/Env flag",r),e}return e.toLowerCase()==="true"?!0:e.toLowerCase()==="false"?!1:!Number.isNaN(Number(e))&&e.trim()!==""?Number(e):e}getAppName(){try{let e=ye();if(e==="node"||e==="bun"||typeof import.meta<"u"&&import.meta.url&&import.meta.url.startsWith("file:")){let r=ee()("node:path");return Lt(be(),r,n=>te(n),n=>z(n))}return"edge-app"}catch(e){return this.logError("Failed to get app name from cwd. Falling back to default-app",e),"default-app"}}logError(e,r){let n=r?E(r):void 0;t._logger.error(e,{error:n})}toJsonString(){return JSON.stringify(this._config)}toBuffer(){return Buffer.from(this.toJsonString())}__resetForTests(){this._initPromise=null,this._isInitialized=!1,this._inFlightTempConfig=null,this._mutationChain=Promise.resolve(),t._prematureWarnEmitted=!1}};u();var Dt=M.child({section:"RequestResponseSerialize"});async function pe(t){if(!t)return null;let e={};t.headers.forEach((o,s)=>{e[s.toLowerCase()]=o});let r,n=t.headers.get("content-type")||"";try{if(t.bodyUsed)r="[Body already consumed]";else{let o=await t.clone().text();if(n.includes("application/json"))try{r=JSON.parse(o)}catch{r=o}else r=o}}catch(o){Dt.warn("Failed to read response body",{status:t.status,url:t.url,bodyUsed:t.bodyUsed,error:E(o)}),r="[Error reading body]"}return{ok:t.ok,status:t.status,statusText:t.statusText,headers:e,url:t.url,redirected:t.redirected,type:t.type,body:r}}var y=M.child({section:"RequestUnlimited"}),Nt=$({mergeArrays:!1}),Ut=10,zt=1e3,Ht=12e4,$t=6e4;function ge(t,e,r,n){return typeof t!="number"||!Number.isFinite(t)?n:Math.min(r,Math.max(e,t))}function Qe(t){try{let e=t instanceof URL?t:new URL(t instanceof Request?t.url:t);return`${e.origin}${e.pathname}`}catch{return"[unparseable url]"}}function Bt(t,e){let r=Math.min(e,300*2**(t-1)),n=Math.round(Math.random()*r);return y.trace("retry delay computed",{attempt:t,base:r,cap:e,delayMs:n}),n}var G={timeout:5e4,throwHttpErrors:!0,retry:{limit:5,methods:["get","post","put","delete","patch"],backoffLimit:3e3,shouldRetry:({error:t,retryCount:e})=>{if(t instanceof k&&t.response){let r=t.response.status;if(r===429&&e<=5)return y.trace("retry decision",{status:r,willRetry:!0}),!0;if(r>=400&&r<500)return y.trace("retry decision: skip",{status:r,willRetry:!1}),!1;let n=r>=500;return y.trace(n?"retry decision":"retry decision: skip",{status:r,willRetry:n}),n}return y.trace("retry decision",{willRetry:!0}),!0}},method:"get",headers:{"content-type":"application/json",accept:"application/json"},hooks:{beforeRetry:[]}};function Ze(t){let e={};for(let r in t)Object.hasOwn(t,r)&&t[r]!==void 0&&(e[r.toLowerCase()]=t[r]);return e}async function Vt(t,e={}){let r=Ze(G.headers||{}),n=e.headers?Ze(e.headers):{},{headers:o,hooks:s,...i}=e,c=ge(P.get("retrieve.timeout"),zt,Ht,5e4),a=ge(P.get("retrieve.retry.limit"),0,Ut,5),f=ge(P.get("retrieve.retry.backoffLimit"),0,$t,3e3),l=Z(),d=performance.now();y.trace("endPoint: request",{cid:l,url:Qe(t),timeout:c,retryLimit:a,backoffLimit:f});let p=G.retry,b=Nt(G,{timeout:c,retry:{...p,limit:a,backoffLimit:f,delay:g=>Bt(g,f)}},i,{headers:{...r,...n},hooks:{beforeRetry:[...G.hooks?.beforeRetry||[],async({retryCount:g})=>{y.trace("endPoint: retry",{cid:l,retryCount:g,durationMs:performance.now()-d})},...s?.beforeRetry||[]]}});try{let g=await Ye(t,b),I=await pe(g);return y.trace("endPoint: ok",{cid:l,durationMs:performance.now()-d,url:Qe(t),status:g.status}),{status:"success",value:I}}catch(g){if(g instanceof k||g.response){let Q=await pe(g.response);return y.trace("endPoint: error",{cid:l,durationMs:performance.now()-d,status:Q?.status,errorMsg:"HTTP error"}),y.warn("HTTP Error",{cid:l,status:Q?.status,url:t.toString()}),{status:"error",reason:Q}}let I=E(g);return y.trace("endPoint: error",{cid:l,durationMs:performance.now()-d,errorMsg:I?.message??"internal/network error"}),y.error("Internal/Network Error",{cid:l,error:I}),{status:"error",reason:I}}}async function Un(t,e={}){let r=Z(),n=performance.now();y.trace("endPoints: batch",{cid:r,count:t.length});let o=t.map(a=>Vt(a,e)),i=(await Promise.allSettled(o)).map(a=>a.status==="fulfilled"?a.value:{status:"error",reason:E(a.reason)}),c=i.filter(a=>a.status==="success").length;return y.trace("endPoints: done",{cid:r,durationMs:performance.now()-n,ok:c,failed:i.length-c}),i}export{Ut as a,zt as b,Ht as c,$t as d,ge as e,Bt as f,G as g,Vt as h,Un as i,P as j};
4
+ /*! Bundled license information:
5
+
6
+ ky/distribution/index.js:
7
+ (*! MIT License © Sindre Sorhus *)
8
+ */
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as s}from"./chunk-6G4LF4KV.mjs";import{h as f}from"./chunk-VULBPPPP.mjs";f();function u(n){return n instanceof Error||Object.prototype.toString.call(n)==="[object Error]"}function w(n){if(typeof n!="object"||n===null)return!1;let o=Object.getPrototypeOf(n);return o===Object.prototype||o===null}function b(n){if(n===void 0)return;if(u(n))return{err:s(n)};let o=new Map,i=r=>{if(u(r))return s(r);if(Array.isArray(r)){let e=o.get(r);if(e)return e;let t=[];o.set(r,t);for(let c of r)t.push(i(c));return t}if(w(r)){let e=o.get(r);if(e)return e;let t={};o.set(r,t);for(let[c,k]of Object.entries(r))t[c]=i(k);return t}return r};return i(n)}export{b as a};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as s}from"./chunk-ZGHY5A62.mjs";import"./chunk-6G4LF4KV.mjs";import{b as i}from"./chunk-XFLNYUID.mjs";import{h as o}from"./chunk-VULBPPPP.mjs";o();var l={trace:10,debug:20,info:30,warn:40,error:50,fatal:60,silent:1/0},n=class g{state;context;_level=process.env.LOG_LEVEL||"info";constructor(e={telemetryEnabled:!1},t={}){this.state=e,this.context=t}getTelemetry(){return this.state.telemetryEnabled?i():void 0}validate(e,t){if(typeof e!="string")throw new Error("Logger requires string message first, optional object second");if(t!==void 0&&(typeof t!="object"||t===null||Array.isArray(t)))throw new Error("Logger requires string message first, optional object second")}log(e,t,r){if((l[e]??30)<this.levelVal)return;this.validate(t,r);let a={level:e,time:Date.now(),...this.context,...s(r),...this.state.telemetryEnabled&&{telemetry:this.getTelemetry()},msg:t};console.log(JSON.stringify(a))}trace(e,t){this.log("trace",e,t)}debug(e,t){this.log("debug",e,t)}info(e,t){this.log("info",e,t)}warn(e,t){this.log("warn",e,t)}error(e,t){this.log("error",e,t)}fatal(e,t){this.log("fatal",e,t)}child(e){return new g(this.state,{...this.context,...e})}setTelemetry(e){if(e!=="on"&&e!=="off")throw new Error("setTelemetry accepts only 'on' or 'off'");this.state.telemetryEnabled=e==="on"}get level(){return this._level}set level(e){this._level=e}get levelVal(){return l[this._level]??30}bindings(){return{...this.context}}silent(){this._level="silent"}flush(e){e?.()}};function c(){return new n}export{c as default};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as g}from"./chunk-BIWQVQOH.mjs";import"./chunk-27GDSGEE.mjs";import{c as p,d as i}from"./chunk-QE5QGPOG.mjs";import"./chunk-ZGHY5A62.mjs";import"./chunk-6G4LF4KV.mjs";import"./chunk-XFLNYUID.mjs";import{e as s,h as n}from"./chunk-VULBPPPP.mjs";n();var o=s(p(),1),a=s(g(),1);import{Writable as d}from"stream";var f=process.env.LOG_PRETTY==="true"||process.env.NODE_ENV!=="production"&&process.env.LOG_PRETTY!=="false",e=process.env.LOG_LEVEL||"info",m=new d({write(t,v,c){let r=globalThis.__wsLogWrite;r&&r(typeof t=="string"?t:t.toString("utf8")),c()}}),l=o.default.multistream([{level:e,stream:f?(0,a.default)({colorize:!0,translateTime:"SYS:standard",ignore:"pid,hostname"}):process.stdout},{level:e,stream:m}]),u=(0,o.default)({level:e,redact:["password","secret","token","authorization","apiKey"]},l),L=new i(u),S=L;export{S as default};