@cline/core 0.0.95 → 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.
- package/dist/ClineCore.d.ts +6 -1
- package/dist/account/rpc.d.ts +3 -1
- package/dist/cline-core/runtime-services.d.ts +4 -2
- package/dist/cloud/controller.d.ts +5 -2
- package/dist/cloud/hub-client.d.ts +51 -0
- package/dist/cloud/hub-protocol.d.ts +18 -0
- package/dist/cloud/index.d.ts +2 -0
- package/dist/cloud/index.js +16 -16
- package/dist/cloud/types.d.ts +4 -1
- package/dist/extensions/context/compaction-shared.d.ts +1 -0
- package/dist/extensions/context/compaction.d.ts +7 -0
- package/dist/extensions/context/summarize-conversation.d.ts +7 -0
- package/dist/extensions/context/summary-generation.d.ts +14 -0
- package/dist/extensions/mcp/apps.d.ts +16 -0
- package/dist/extensions/mcp/client.d.ts +1 -0
- package/dist/extensions/mcp/index.d.ts +5 -1
- package/dist/extensions/mcp/manager.d.ts +2 -1
- package/dist/extensions/mcp/session-apps.d.ts +28 -0
- package/dist/extensions/mcp/types.d.ts +22 -0
- package/dist/extensions/plugin/plugin-command-origin.d.ts +8 -0
- package/dist/extensions/plugin/plugin-registry.d.ts +1 -0
- package/dist/extensions/plugin/plugin-runtime.d.ts +7 -0
- package/dist/hub/client/index.d.ts +6 -0
- package/dist/hub/client/managed-hub-build-watcher.d.ts +2 -0
- package/dist/hub/client/plugin-commands.d.ts +4 -0
- package/dist/hub/client/session-client.d.ts +2 -0
- package/dist/hub/daemon/entry.js +241 -228
- package/dist/hub/index.d.ts +1 -0
- package/dist/hub/index.js +231 -218
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +6 -0
- package/dist/hub/server/cloud-session-service.d.ts +50 -0
- package/dist/hub/server/handlers/capability-handlers.d.ts +18 -1
- package/dist/hub/server/handlers/context.d.ts +13 -2
- package/dist/hub/server/handlers/mcp-apps-handlers.d.ts +5 -0
- package/dist/hub/server/hub-server-options.d.ts +3 -0
- package/dist/hub/server/hub-server-transport.d.ts +2 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +278 -258
- package/dist/plugin-runtime/node_modules/@cline/agents/dist/index.js +76 -0
- package/dist/plugin-runtime/node_modules/@cline/agents/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/ai-sdk-b1d8eb67.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/anthropic-33qvrctr.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/bedrock-paabhz8w.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/cline-yhsfqcy1.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/cloud/index.js +21 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/community-gqgs7446.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/foundation-models-embedding-model-strategy-SAVQFBF4-822304b0.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/foundation-models-language-model-strategy-BPQO66W7-hky2m2yx.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-bsd-sqf1kd37.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-bsd-tx1kp6xn.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-darwin-6cpgjxme.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-darwin-fxchqbze.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-linux-m3bzwmzc.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-linux-pr9sb5fr.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-unsupported-nckraycx.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-unsupported-w91yq3tm.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-win-xdyxc2tf.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-win-yxsvs11a.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/google-pgdk2dm9.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/hub/daemon/entry.js +1160 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/hub/index.js +1147 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-02jpyn9y.js +85 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-0cb4390m.js +137 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-0f8xrhgt.js +209 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-1f8vb421.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-28c7m0fv.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-2em3jg4q.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-4n1zpzbe.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-54eea0ex.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-5j92dtg5.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-6akf3a5d.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-6k6ep10s.js +136 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-71ym4q6s.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-91p1ghfk.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-9qkpjy7x.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-9swk4nej.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-aa2s5myc.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ae0ajw38.js +13 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bxvyzjhc.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bzy863k0.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-d96n0s70.js +20 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-dsd6vt8c.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-e2q4azd9.js +119 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-egd18jj2.js +4 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-eh83hr16.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ev9r2dy3.js +1204 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-f2mvvryf.js +190 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-h7gn5v3f.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-h7s1a560.js +12 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-hkhq3jtz.js +21 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-j8r18nfg.js +15 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-jhny555h.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-m1gpa2eg.js +146 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-m2ad6tgj.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-m7mks2jq.js +4 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-mcnngj50.js +62 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-n2srkkh0.js +39 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-nbs1tsny.js +142 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-nqjnz7m4.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-rmhzyxr8.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-rtzf3vvk.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-sw74pcm3.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-t3eanyjj.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-tseksj1v.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v0ctpcdr.js +12 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v4-dx8bd4wq.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v695918t.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v96yy1pw.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-vfm7r9wk.js +65 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-xecthgrg.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-xn1xhp06.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-yfdscfdx.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-yrnwqsdt.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/jiti-static-3mgy2y9y.js +473 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/jiti-w1xrs0vd.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/langfuse-stream-telemetry-9tppg77c.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/langfuse-telemetry-y658kpzy.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/mistral-cmhqd91b.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/multipart-parser-qkjjf8mm.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/ollama-8z6y9d1h.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/openai-cfmja1ez.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/openai-compatible-1t7n5sxj.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/orchestration-embedding-model-strategy-GT27AFII-k6yqgnyd.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/orchestration-language-model-strategy-YEQPUCOT-6rdyebbq.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/services/feature-flags/posthog.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/services/telemetry/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/token-1h068py9.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/token-util-7jchft51.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/vertex-qfxfsrn4.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/dist/index.browser.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/sdk/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/sdk/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/automation/index.js +57 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/db/index.js +127 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/index.browser.js +110 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/node.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/remote-config/index.js +68 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/storage/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/types/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/package.json +1 -0
- package/dist/plugin-runtime/package.json +1 -0
- package/dist/{extensions → plugin-runtime}/plugin-sandbox-bootstrap.js +129 -129
- package/dist/remote/remote-environments.d.ts +1 -0
- package/dist/runtime/config/agent-runtime-config-builder.d.ts +2 -0
- package/dist/runtime/host/local-runtime-host.d.ts +10 -0
- package/dist/runtime/host/runtime-host.d.ts +6 -0
- package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +3 -0
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +10 -1
- package/dist/runtime/orchestration/session-runtime.d.ts +2 -0
- package/dist/runtime/tools/subprocess-sandbox.d.ts +22 -0
- package/dist/services/llms/cline-recommended-models.d.ts +2 -0
- package/dist/services/local-runtime-bootstrap.d.ts +1 -0
- package/dist/services/plugin-command-api.d.ts +47 -0
- package/dist/services/plugin-commands.d.ts +25 -27
- package/dist/services/skills-cli.d.ts +2 -0
- package/dist/services/telemetry/core-events.d.ts +26 -0
- package/dist/services/telemetry/index.js +1 -1
- package/dist/services/telemetry/run-health.d.ts +40 -0
- package/dist/services/telemetry/stall-signals.d.ts +12 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/session.d.ts +7 -0
- package/package.json +6 -5
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import K from"node:fs/promises";import et from"node:path";import{createHmac as Jr}from"node:crypto";import{basename as Br}from"node:path";import re from"node:path";async function Lr(e){try{return await K.access(e),!0}catch{return!1}}class $n{filePath;constructor(e){this.filePath=e}async read(){try{return JSON.parse(await K.readFile(this.filePath,"utf8"))}catch(e){if(e.code==="ENOENT")return;throw e}}async write(e){await K.mkdir(et.dirname(this.filePath),{recursive:!0}),await K.writeFile(this.filePath,JSON.stringify(e,null,2),"utf8")}async clear(){await K.rm(this.filePath,{force:!0})}}class dt{async writeText(e,t){await K.mkdir(et.dirname(e),{recursive:!0}),await K.writeFile(e,t,"utf8")}async remove(e){await K.rm(e,{recursive:!0,force:!0})}async removeChildren(e){if(!await Lr(e))return;let t=await K.readdir(e);await Promise.all(t.map((n)=>K.rm(et.join(e,n),{recursive:!0,force:!0})))}}var tt=new TextEncoder,Kr={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},Hr=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]);class pt{constructor({accessKeyId:e,secretAccessKey:t,sessionToken:n,service:r,region:i,cache:o,retries:a,initRetryMs:s}){if(e==null)throw TypeError("accessKeyId is a required option");if(t==null)throw TypeError("secretAccessKey is a required option");this.accessKeyId=e,this.secretAccessKey=t,this.sessionToken=n,this.service=r,this.region=i,this.cache=o||new Map,this.retries=a!=null?a:10,this.initRetryMs=s||50}async sign(e,t){if(e instanceof Request){let{method:i,url:o,headers:a,body:s}=e;if(t=Object.assign({method:i,url:o,headers:a},t),t.body==null&&a.has("Content-Type"))t.body=s!=null&&a.has("X-Amz-Content-Sha256")?s:await e.clone().arrayBuffer();e=o}let n=new Pn(Object.assign({url:e.toString()},t,this,t&&t.aws)),r=Object.assign({},t,await n.sign());delete r.aws;try{return new Request(r.url.toString(),r)}catch(i){if(i instanceof TypeError)return new Request(r.url.toString(),Object.assign({duplex:"half"},r));throw i}}async fetch(e,t){for(let n=0;n<=this.retries;n++){let r=fetch(await this.sign(e,t));if(n===this.retries)return r;let i=await r;if(i.status<500&&i.status!==429)return i;await new Promise((o)=>setTimeout(o,Math.random()*this.initRetryMs*Math.pow(2,n)))}throw Error("An unknown error occurred, ensure retries is not negative")}}class Pn{constructor({method:e,url:t,headers:n,body:r,accessKeyId:i,secretAccessKey:o,sessionToken:a,service:s,region:u,cache:l,datetime:c,signQuery:p,appendSessionToken:d,allHeaders:h,singleEncode:m}){if(t==null)throw TypeError("url is a required option");if(i==null)throw TypeError("accessKeyId is a required option");if(o==null)throw TypeError("secretAccessKey is a required option");this.method=e||(r?"POST":"GET"),this.url=new URL(t),this.headers=new Headers(n||{}),this.body=r,this.accessKeyId=i,this.secretAccessKey=o,this.sessionToken=a;let y,b;if(!s||!u)[y,b]=Wr(this.url,this.headers);if(this.service=s||y||"",this.region=u||b||"us-east-1",this.cache=l||new Map,this.datetime=c||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=p,this.appendSessionToken=d||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256"))this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let _=this.signQuery?this.url.searchParams:this.headers;if(_.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken)_.set("X-Amz-Security-Token",this.sessionToken);if(this.signableHeaders=["host",...this.headers.keys()].filter((A)=>h||!Hr.has(A)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map((A)=>A+":"+(A==="host"?this.url.host:(this.headers.get(A)||"").replace(/\s+/g," "))).join(`
|
|
2
|
+
`),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery){if(this.service==="s3"&&!_.has("X-Amz-Expires"))_.set("X-Amz-Expires","86400");_.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),_.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),_.set("X-Amz-SignedHeaders",this.signedHeaders)}if(this.service==="s3")try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch(A){this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");if(!m)this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/");this.encodedPath=It(this.encodedPath);let I=new Set;this.encodedSearch=[...this.url.searchParams].filter(([A])=>{if(!A)return!1;if(this.service==="s3"){if(I.has(A))return!1;I.add(A)}return!0}).map((A)=>A.map((O)=>It(encodeURIComponent(O)))).sort(([A,O],[z,F])=>A<z?-1:A>z?1:O<F?-1:O>F?1:0).map((A)=>A.join("=")).join("&")}async sign(){if(this.signQuery){if(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken)this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)}else this.headers.set("Authorization",await this.authHeader());return{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){let e=this.datetime.slice(0,8),t=[this.secretAccessKey,e,this.region,this.service].join(),n=this.cache.get(t);if(!n){let r=await ce("AWS4"+this.secretAccessKey,e),i=await ce(r,this.region),o=await ce(i,this.service);n=await ce(o,"aws4_request"),this.cache.set(t,n)}return Be(await ce(n,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,Be(await At(await this.canonicalString()))].join(`
|
|
3
|
+
`)}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+`
|
|
4
|
+
`,this.signedHeaders,await this.hexBodyHash()].join(`
|
|
5
|
+
`)}async hexBodyHash(){let e=this.headers.get("X-Amz-Content-Sha256")||(this.service==="s3"&&this.signQuery?"UNSIGNED-PAYLOAD":null);if(e==null){if(this.body&&typeof this.body!=="string"&&!("byteLength"in this.body))throw Error("body must be a string, ArrayBuffer or ArrayBufferView, unless you include the X-Amz-Content-Sha256 header");e=Be(await At(this.body||""))}return e}}async function ce(e,t){let n=await crypto.subtle.importKey("raw",typeof e==="string"?tt.encode(e):e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return crypto.subtle.sign("HMAC",n,tt.encode(t))}async function At(e){return crypto.subtle.digest("SHA-256",typeof e==="string"?tt.encode(e):e)}var Et=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function Be(e){let t=new Uint8Array(e),n="";for(let r=0;r<t.length;r++){let i=t[r];n+=Et[i>>>4&15],n+=Et[i&15]}return n}function It(e){return e.replace(/[!'()*]/g,(t)=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}function Wr(e,t){let{hostname:n,pathname:r}=e;if(n.endsWith(".on.aws")){let s=n.match(/^[^.]{1,63}\.lambda-url\.([^.]{1,63})\.on\.aws$/);return s!=null?["lambda",s[1]||""]:["",""]}if(n.endsWith(".r2.cloudflarestorage.com"))return["s3","auto"];if(n.endsWith(".backblazeb2.com")){let s=n.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);return s!=null?["s3",s[1]||""]:["",""]}let i=n.replace("dualstack.","").match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/),o=i&&i[1]||"",a=i&&i[2];if(a==="us-gov")a="us-gov-west-1";else if(a==="s3"||a==="s3-accelerate")a="us-east-1",o="s3";else if(o==="iot")if(n.startsWith("iot."))o="execute-api";else if(n.startsWith("data.jobs.iot."))o="iot-jobs-data";else o=r==="/mqtt"?"iotdevicegateway":"iotdata";else if(o==="autoscaling"){let s=(t.get("X-Amz-Target")||"").split(".")[0];if(s==="AnyScaleFrontendService")o="application-autoscaling";else if(s==="AnyScaleScalingPlannerFrontendService")o="autoscaling-plans"}else if(a==null&&o.startsWith("s3-"))a=o.slice(3).replace(/^fips-|^external-1/,""),o="s3";else if(o.endsWith("-fips"))o=o.slice(0,-5);else if(a&&/-\d$/.test(o)&&!/-\d$/.test(a))[o,a]=[a,o];return[Kr[o]||o,a||""]}var Vr="enterprise.blobUpload",Ae=new Map;function Ke(e,t){return{adapterType:e,accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,region:t.region,bucket:t.bucket,endpoint:t.endpoint,accountId:t.accountId}}function xn(e){return{adapterType:e.adapterType,bucket:e.bucket,region:e.region,endpoint:e.endpoint,accountId:e.accountId}}function qr(e){if(!e||e.enabled!==!0)return;if(e.type==="s3_access_keys"&&e.s3AccessSettings)return Ke("s3",e.s3AccessSettings);if(e.type==="r2_access_keys"&&e.r2AccessSettings)return Ke("r2",e.r2AccessSettings);if(e.type==="azure_access_keys"&&e.azureAccessSettings)return Ke("azure",e.azureAccessSettings);return}function Tn(e){return qr(e?.enterpriseTelemetry?.promptUploading)}function pc(e,t){let n=Tn(e);if(!n)return;return{version:1,storage:xn(n),userDistinctId:t}}function hc(e,t,n){let r=Tn(t);if(!r){Ae.delete(e);return}return Ae.set(e,r),{version:1,storage:xn(r),userDistinctId:n}}function mc(e){Ae.delete(e)}function An(e,t,n){let r=`${t}/${n}`;return{async write(i,o){let a=await e.fetch(`${r}/${i}`,{method:"PUT",body:o,headers:{"Content-Type":"application/json; charset=utf-8"}});if(!a.ok)throw Error(`Failed to write ${i}: ${a.status}`)}}}function Xr(e){let{bucket:t,accessKeyId:n,secretAccessKey:r}=e;if(!t||!n||!r)return;let i=e.region||"us-east-1",o=e.endpoint||`https://s3.${i}.amazonaws.com`;return An(new pt({region:i,accessKeyId:n,secretAccessKey:r}),o,t)}function Gr(e){let{accountId:t,endpoint:n,bucket:r,accessKeyId:i,secretAccessKey:o}=e;if(!n&&!t||!r||!i||!o)return;return An(new pt({accessKeyId:i,secretAccessKey:o}),e.endpoint??`https://${t}.r2.cloudflarestorage.com`,r)}function Yr(e,t,n,r,i){let o=i["Content-Length"]||"",a=i["Content-Type"]||"",s=Object.entries(i).filter(([d])=>d.toLowerCase().startsWith("x-ms-")).sort(([d],[h])=>d.toLowerCase().localeCompare(h.toLowerCase())).map(([d,h])=>`${d.toLowerCase()}:${h}`).join(`
|
|
6
|
+
`),u=`/${e}${r}`,l=[n,"","",o,"",a,"","","","","","",s,u].join(`
|
|
7
|
+
`),c=Buffer.from(t,"base64"),p=Jr("sha256",c).update(l,"utf8").digest("base64");return`SharedKey ${e}:${p}`}function Qr(e){let{accessKeyId:t,secretAccessKey:n,bucket:r}=e;if(!t||!n||!r)return;let i=e.endpoint||`https://${t}.blob.core.windows.net`;return{async write(o,a){let s=`/${r}/${o}`,u=new Date().toUTCString(),l=Buffer.from(a,"utf8"),c={"x-ms-date":u,"x-ms-version":"2024-11-04","x-ms-blob-type":"BlockBlob","Content-Type":"application/json; charset=utf-8","Content-Length":l.byteLength.toString()};c.Authorization=Yr(t,n,"PUT",s,c);let p=await fetch(`${i}${s}`,{method:"PUT",body:l,headers:c});if(!p.ok){let d=await p.text().catch(()=>"");throw Error(`Failed to write ${o}: ${p.status} ${d}`.trim())}}}}function ei(e){if(e.adapterType==="s3")return Xr(e);if(e.adapterType==="r2")return Gr(e);if(e.adapterType==="azure")return Qr(e);return}function jt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function ti(e){let t=e?.metadata?.[Vr];if(!jt(t))return;let n=t.storage;if(!jt(n))return;let r=n.adapterType;if(r!=="s3"&&r!=="r2"&&r!=="azure")return;if(typeof n.bucket!=="string")return;return{version:1,storage:{adapterType:r,bucket:n.bucket,region:typeof n.region==="string"?n.region:void 0,endpoint:typeof n.endpoint==="string"?n.endpoint:void 0,accountId:typeof n.accountId==="string"?n.accountId:void 0},keyPrefix:typeof t.keyPrefix==="string"?t.keyPrefix:void 0,userDistinctId:typeof t.userDistinctId==="string"?t.userDistinctId:void 0}}function ni(e,t,n){return["sessions",n.userDistinctId?.trim()||"unknown",e,t?.endsWith("messages.json")?"messages.json":Br(t)].filter((r)=>Boolean(r?.trim())).join("/")}function yc(){let e=new Map;return{async uploadMessagesFile({sessionId:t,path:n,contents:r,row:i}){let o=ti(i);if(!o)return;let a=Ae.get(t);if(!a)return;let s=JSON.stringify(a),u=e.get(s);if(!u){if(u=ei(a),!u)return;e.set(s,u)}await u.write(ni(t,n,o),r)}}}function Nt(e,t,n){return{id:`remote-config:${e}:${n}:${t.name}`,name:t.name,kind:e,contents:t.contents,alwaysEnabled:t.alwaysEnabled}}var gc="remote://";function Zt(e){let t="",n=!1;for(let r of e.trim().toLowerCase()){let i=r.charCodeAt(0);if(i>=97&&i<=122||i>=48&&i<=57||r==="."||r==="_"||r==="-"){if(n&&t&&t[t.length-1]!=="-")t+="-";n=!1,t+=r}else n=!0;if(t.length>=80)break}while(t.endsWith("-"))t=t.slice(0,-1);while(t.startsWith("-"))t=t.slice(1);return t||"item"}function ri(e){let t=e?.globalRules?.map((r,i)=>Nt("rule",r,`${i}`))??[],n=e?.globalWorkflows?.map((r,i)=>Nt("workflow",r,`${i}`))??[];return[...t,...n]}function ii(e){return[...ri(e.remoteConfig),...e.managedInstructions??[]]}function oi(e){return e.map((t)=>{let n=`## ${t.name}`,r=t.alwaysEnabled?`_Always enabled_
|
|
8
|
+
`:"";return`${n}
|
|
9
|
+
|
|
10
|
+
${r}${t.contents.trim()}`}).join(`
|
|
11
|
+
|
|
12
|
+
`)}function He(e,t){return e.filter((n)=>n.kind===t)}class En{async materialize(e){let t=ii(e.bundle),n=He(t,"rule"),r=He(t,"workflow"),i=He(t,"skill");await e.artifactStore.removeChildren(e.paths.workflowsPath),await e.artifactStore.removeChildren(e.paths.skillsPath);let o=[];if(n.length>0)await e.artifactStore.writeText(e.paths.rulesFilePath,oi(n)),o.push(...n.map((a)=>({kind:a.kind,filePath:e.paths.rulesFilePath,id:a.id,name:a.name})));else await e.artifactStore.remove(e.paths.rulesFilePath);for(let a of r){let s=`${e.paths.workflowsPath}/${Zt(a.name.replace(/\.(md|markdown|txt)$/i,""))}.md`;await e.artifactStore.writeText(s,a.contents),o.push({kind:a.kind,filePath:s,id:a.id,name:a.name})}for(let a of i){let s=`${e.paths.skillsPath}/${Zt(a.name)}/SKILL.md`;await e.artifactStore.writeText(s,a.contents),o.push({kind:a.kind,filePath:s,id:a.id,name:a.name})}return await e.artifactStore.writeText(e.paths.manifestPath,JSON.stringify({source:e.bundle.source,version:e.bundle.version,files:o},null,2)),{paths:e.paths,rulesFilePath:n.length>0?e.paths.rulesFilePath:void 0,files:o}}}var ai="remote-config";function In(e){let t=e.pluginName??ai,n=re.join(e.workspacePath,".cline",t);return{pluginName:t,pluginPath:n,workflowsPath:re.join(n,"workflows"),skillsPath:re.join(n,"skills"),bundleCachePath:re.join(n,"cache","bundle.json"),manifestPath:re.join(n,"managed.json"),rulesFilePath:re.join(n,"rules.md")}}function si(e){return{workflowsDirectories:[e.workflowsPath],skillsDirectories:[e.skillsPath]}}function ui(e){if(!e)return;return{enabled:e.openTelemetryEnabled??!1,metricsExporter:e.openTelemetryMetricsExporter,logsExporter:e.openTelemetryLogsExporter,otlpProtocol:e.openTelemetryOtlpProtocol,otlpEndpoint:e.openTelemetryOtlpEndpoint,otlpHeaders:e.openTelemetryOtlpHeaders,otlpMetricsProtocol:e.openTelemetryOtlpMetricsProtocol,otlpMetricsEndpoint:e.openTelemetryOtlpMetricsEndpoint,otlpMetricsHeaders:e.openTelemetryOtlpMetricsHeaders,otlpLogsProtocol:e.openTelemetryOtlpLogsProtocol,otlpLogsEndpoint:e.openTelemetryOtlpLogsEndpoint,otlpLogsHeaders:e.openTelemetryOtlpLogsHeaders,metricExportInterval:e.openTelemetryMetricExportInterval,otlpInsecure:e.openTelemetryOtlpInsecure,logBatchSize:e.openTelemetryLogBatchSize,logBatchTimeout:e.openTelemetryLogBatchTimeout,logMaxQueueSize:e.openTelemetryLogMaxQueueSize}}function jn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function q(e,t){let n=e[t];return typeof n==="string"?n:void 0}function Ct(e,t){let n=e[t];return typeof n==="boolean"?n:void 0}function be(e,t){let n=e[t];return typeof n==="number"&&Number.isFinite(n)?n:void 0}function We(e,t){let n=e[t];if(!jn(n))return;let r=Object.entries(n).filter((i)=>typeof i[1]==="string");return r.length>0?Object.fromEntries(r):void 0}function li(e){if(!jn(e))return;let t={enabled:Ct(e,"enabled"),metricsExporter:q(e,"metricsExporter"),logsExporter:q(e,"logsExporter"),otlpProtocol:q(e,"otlpProtocol"),otlpEndpoint:q(e,"otlpEndpoint"),otlpHeaders:We(e,"otlpHeaders"),otlpMetricsProtocol:q(e,"otlpMetricsProtocol"),otlpMetricsEndpoint:q(e,"otlpMetricsEndpoint"),otlpMetricsHeaders:We(e,"otlpMetricsHeaders"),otlpLogsProtocol:q(e,"otlpLogsProtocol"),otlpLogsEndpoint:q(e,"otlpLogsEndpoint"),otlpLogsHeaders:We(e,"otlpLogsHeaders"),metricExportInterval:be(e,"metricExportInterval"),otlpInsecure:Ct(e,"otlpInsecure"),logBatchSize:be(e,"logBatchSize"),logBatchTimeout:be(e,"logBatchTimeout"),logMaxQueueSize:be(e,"logMaxQueueSize")};return Object.values(t).some((n)=>n!==void 0)?t:void 0}class Nn{name="remote-config";resolveTelemetry(e,t){return{...ui(e.remoteConfig),...li(e.telemetry)}}}async function _c(e){let t=In(e),n=e.artifactStore??new dt;await n.removeChildren(t.workflowsPath),await n.removeChildren(t.skillsPath),await n.remove(t.rulesFilePath),await n.remove(t.manifestPath),await n.remove(t.bundleCachePath)}function Zn(e){return e?.claims}function Cn(e,t){if(!e)return[];if(t.claimsMapper)return t.claimsMapper.mapClaimsToRoles(e);return e.roles??[]}function ci(e,t){return{...e,metadata:{...e.metadata??{},paths:t}}}class Mn{options;constructor(e){this.options=e}async sync(e){let t=await this.options.controlPlane.fetchBundle({workspacePath:e.workspacePath,rootPath:e.rootPath,context:e.context,signal:e.signal,now:e.now,logger:this.options.logger});if(!t)throw Error("Remote config control plane returned no bundle");await this.options.bundleStore.write(t);let n=await this.options.materializer.materialize({bundle:t,paths:e.paths,artifactStore:this.options.artifactStore}),r=this.options.telemetryAdapter?await this.options.telemetryAdapter.resolveTelemetry(t,{workspacePath:e.workspacePath,rootPath:e.rootPath,context:e.context,signal:e.signal,now:e.now,logger:this.options.logger}):void 0,i=Zn(t),o=Cn(i,this.options);return{bundle:t,materialized:n,telemetry:r,roles:o,claims:i}}}function fi(e){let t=e?.name??"remote-config";return{name:t,manifest:{capabilities:["providers"]},async setup(n,r){n.registerProvider?.({name:t,description:"Remote-config managed runtime integration"}),await e?.setup?.(n,r)}}}async function bc(e){let t=In({workspacePath:e.workspacePath,pluginName:e.pluginName}),n=e.bundleStore??new $n(t.bundleCachePath),r=e.artifactStore??new dt,i=e.materializer??new En,o=e.telemetryAdapter??new Nn,a,s,u=[],l,c=!1,p=!1;if(e.controlPlane){let h=new Mn({controlPlane:e.controlPlane,bundleStore:n,artifactStore:r,materializer:i,telemetryAdapter:o,claimsMapper:e.claimsMapper,logger:e.logger});try{let m=await h.sync({workspacePath:e.workspacePath,rootPath:e.rootPath,context:e.context,paths:t,signal:e.signal,now:e.now});a=m.bundle,s=m.telemetry,u=m.roles,l=m.claims,p=!0}catch(m){if(e.useCachedBundle!==!1)a=await n.read(),c=Boolean(a);if(!a)throw m}}else if(e.useCachedBundle!==!1)a=await n.read(),c=Boolean(a);if(!a&&e.requireBundle)throw Error("Remote config runtime preparation requires a bundle");if(a){let h=ci(a,t);if(await n.write(h),!p)await i.materialize({bundle:h,paths:t,artifactStore:r});l??=Zn(h),u=u.length>0?u:Cn(l,e),s??=await o.resolveTelemetry(h,{workspacePath:e.workspacePath,rootPath:e.rootPath,context:e.context,signal:e.signal,now:e.now,logger:e.logger}),a=h}let d=si(t);return{pluginName:t.pluginName,pluginDefinition:fi({name:t.pluginName}),paths:t,bundle:a,telemetry:s,roles:u,claims:l,usedCachedBundle:c,workflowsDirectories:d.workflowsDirectories,skillsDirectories:d.skillsDirectories}}function nt(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,r])=>t.indexOf(+n)===-1).map(([n,r])=>r)}function Mt(e,t="|"){return e.map((n)=>Jn(n)).join(t)}function rt(e,t){if(typeof t==="bigint")return t.toString();return t}class Fn{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Ce(e){return new Fn(e)}function di(e){return e===null||e===void 0}function ht(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function pi(e,t){let n=e/t,r=Math.round(n),i=4*Number.EPSILON*Math.max(Math.abs(n),1);if(Math.abs(n-r)<i)return 0;return n-r}function V(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function mt(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function W(e){return mt(e._zod.def)??e._zod.def.shape}function Rn(e,t,n){Object.defineProperty(e,t,{get(){let r=n();return V(this,t,r),r},enumerable:!0,configurable:!0})}function Dn(e,t,n){if(t in e)V(e,t,n);else e[t]=n}function ne(e,t,n,r){let i=W(t);for(let o of n){let a=Object.getOwnPropertyDescriptor(i,o);if(!a.enumerable)continue;if(a.get)Rn(e,o,()=>{let s=t._zod.def.shape[o];return r?r(s,o):s});else Dn(e,o,r?r(a.value,o):a.value)}}function hi(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);if(!r.enumerable)continue;if(r.get)Rn(e,n,()=>t[n]);else Dn(e,n,r.value)}}function R(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function mi(e){return JSON.stringify(e)}function yi(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Un="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ye(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var gi=Ce(()=>{if(U.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function oe(e){if(ye(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let n=t.prototype;if(ye(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function Ln(e){if(oe(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var vi=new Set(["string","number","symbol"]);function ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function te(e,t,n){let r=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)r._zod.parent=e;return r}function g(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Jn(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function _i(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Bn=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),bi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wi(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return ne(i,e,Me(e,t)),te(e,R(n,{shape:i,checks:[]}))}function Me(e,t){let n=W(e),r=[];for(let i of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,i)?.enumerable)throw Error(`Unrecognized key: "${String(i)}"`);if(t[i])r.push(i)}return r}function zi(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Me(e,t)),o={};return ne(o,e,Reflect.ownKeys(W(e)).filter((a)=>!i.has(a))),te(e,R(n,{shape:o,checks:[]}))}function ki(e,t){if(!oe(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=W(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return te(e,R(e._zod.def,{shape:Kn(e,t)}))}function Kn(e,t){let n={};return ne(n,e,Reflect.ownKeys(W(e))),hi(n,t),n}function Si(e,t){if(!oe(t))throw Error("Invalid input to safeExtend: expected a plain object");return te(e,R(e._zod.def,{shape:Kn(e,t)}))}function Oi(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};ne(n,e,Reflect.ownKeys(W(e))),ne(n,t,Reflect.ownKeys(W(t)));let r=R(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return te(e,r)}function Ft(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let o=n?new Set(Me(t,n)):void 0,a={};return ne(a,t,Reflect.ownKeys(W(t)),e&&((s,u)=>o&&!o.has(u)?s:new e({type:"optional",innerType:s}))),te(t,R(t._zod.def,{shape:a,checks:[]}))}function $i(e,t,n){let r=n?new Set(Me(t,n)):void 0,i={};return ne(i,t,Reflect.ownKeys(W(t)),(o,a)=>r&&!r.has(a)?o:new e({type:"nonoptional",innerType:o})),te(t,R(t._zod.def,{shape:i}))}function J(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Pi(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function G(e,t){return t.map((n)=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function fe(e){return typeof e==="string"?e:e?.message}function Rt(e){let t=[];for(let n of e??[]){let r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;let i=r.maximum??r.length??r.size;if(i>=0)t.push([i,n])}return t}function it(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Q(e,t,n){var r;let i=e.inst?._zod?.traits;if(i?.has("$ZodType"))if(i.has("$ZodCheck"))(r=e).schema??(r.schema=e.inst);else e.schema=e.inst;let o=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:fe(e.inst?._zod.def?.error?.(e))??fe(o?.(e))??fe(t?.error?.(e))??fe(n.customError?.(e))??fe(n.localeError?.(e))??"Invalid input",s={};for(let u of Object.keys(e)){if(u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__")continue;s[u]=e[u]}if(s.path??(s.path=[]),s.message=a,t?.reportInput)s.input=e.input;return s}var xi=/[\uD800-\uDBFF]/;function yt(e){let t=e.length;if(!xi.test(e))return t;let n=t;for(let r=0;r<t-1;r++)if((e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320)n--,r++;return n}function gt(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Ti(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function ge(...e){let[t,n,r]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:r};return{...t}}function Ai(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);if(r.get)Object.defineProperty(e,n,{...r,enumerable:!1});else Ei(e,n,r.value)}}function ee(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Hn(e,t,n){return ee(e,t,n,!1)}function vt(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return ee(this,n,r(this))},set(i){ee(this,n,i)}})}return t}function Ei(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ee(this,t,n.bind(this))},set(r){ee(this,t,r)}})}function Ii(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Ve,X=!1,ji={configurable:!0,get(){X=!0;return}};function w(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Ve!==e._zod){Ve=void 0;return}Ve=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ji);let i=X;X=!1;try{let o=n(this);if(X)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o});return X=X||i,o}catch(o){throw delete this[t],X=X||i,o}},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i})}})}function Ni(e,t,n,r){let i=Ii(e,t);if(!i)return;Object.defineProperty(i,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:o})}})}var Zi="~constantCatch";function Ci(e){let t=()=>e;return t[Zi]=!0,t}var Dt,qe={value:void 0,enumerable:!1},Ut="captureStackTrace"in Error?Error:null;function Mi(e){let t=Ut;if(t){let n=t.stackTraceLimit;if(typeof n==="number"){try{t.stackTraceLimit=0}catch{return Ut=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function f(e,t,n,r){let i={};function o(d){this.def=d,this.constr=p,this.traits=new Set}o.prototype=i;let a=n,s=a&&new WeakSet;function u(d,h){if(!d._zod){qe.value=new o(h);try{Object.defineProperty(d,"_zod",qe)}finally{qe.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,h),s){let y=Object.getPrototypeOf(d),b=d._zod.constr.prototype,_=y;while(_&&_!==b)_=Object.getPrototypeOf(_);let I=_??y;if(!s.has(I))s.add(I),Ai(I,a)}let m=p.prototype;for(let y in m){if(!Object.prototype.hasOwnProperty.call(m,y))continue;if(!(y in d))d[y]=m[y].bind(d)}}let l=r?.Parent??Object;class c extends l{}Object.defineProperty(c,"name",{value:e});function p(d){let h=r?.Parent?Mi(c):this;u(h,d);let m=h._zod.deferred;if(m){for(let b of m)b();h._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;if(y)y(h);return h}return Object.defineProperty(p,"init",{value:u}),Object.defineProperty(p,Symbol.hasInstance,{value:(d)=>{if(r?.Parent&&d instanceof r.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(p,"name",{value:e}),p}class Y extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _t extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Dt=globalThis).__zod_globalConfig??(Dt.__zod_globalConfig={});var U=globalThis.__zod_globalConfig;function H(e){if(e)Object.assign(U,e);return U}function Fi(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,rt,2)),e.message}function Ri(e){this._zod.message=e}var Di={get:Fi,set:Ri,enumerable:!0,configurable:!0},Xe={value:void 0,enumerable:!1},Lt=new WeakSet([Object.prototype,Error.prototype]),Wn=(e,t)=>{e.name="$ZodError",Xe.value=t,Object.defineProperty(e,"issues",Xe),Xe.value=void 0,Object.defineProperty(e,"message",Di);let n=Object.getPrototypeOf(e);if(!Lt.has(n))Lt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}})},Ui=f("$ZodError",Wn),Vn=f("$ZodError",Wn,void 0,{Parent:Error});function Li(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0});else e[t]=n();return e[t]}function Ji(e,t=(n)=>n.message){let n={},r=[];for(let i of e.issues)if(i.path.length>0)Li(n,i.path[0],()=>[]).push(t(i));else r.push(t(i));return{formErrors:r,fieldErrors:n}}function Bi(e,t=(n)=>n.message){let n={_errors:[]},r=(i,o=[])=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map((s)=>r({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)n._errors.push(t(a));else{let u=n,l=0;while(l<s.length){let c=s[l],p=l===s.length-1;if(c==="_errors"){if(p)u._errors.push(t(a));l++;continue}if(!Object.prototype.hasOwnProperty.call(u,c))Object.defineProperty(u,c,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=u[c];if(p)d._errors.push(t(a));u=d,l++}}}};return r(e),n}function Fe(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Re=(e)=>{let t=(n,r,i,o)=>{let a=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new Y;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map((l)=>Q(l,a,H())));throw Un(u,o?.callee??t),u}return s.value};return t},Jt=Re(Vn),De=(e)=>{let t=async(n,r,i,o)=>{let a=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},a);if(s instanceof Promise)s=await s;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map((l)=>Q(l,a,H())));throw Un(u,o?.callee??t),u}return s.value};return t},Bt=De(Vn),bt=(e)=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Y;return o.issues.length?qn(e,o.issues,i):{success:!0,data:o.value}};function qn(e,t,n){let r;return{success:!1,get error(){if(!r)r=new e(t.map((i)=>Q(i,n,H()))),t=void 0,n=void 0;return r},set error(i){r=i,t=void 0,n=void 0}}}var wt=(e)=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)o=await o;return o.issues.length?qn(e,o.issues,i):{success:!0,data:o.value}},Ki=Symbol.for("zod.compile.invalid"),Hi=Symbol.for("zod.compile.fallback"),Wi=(e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Ki)return!0;if(r.definite===!0&&n===void 0)return!1}return Vi(e,t,n)};function Vi(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,o;if(i)r[Hi]=!0,o=i({value:t,issues:[]},r);else o=e._zod.run({value:t,issues:[]},r);if(o instanceof Promise)throw new Y;return o.issues.length===0}var qi=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);if(i instanceof Promise)i=await i;return i.issues.length===0},Xi=(e)=>{let t=Re(e),n=(r,i,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return t(r,i,s,Fe(n,a))};return n},Gi=(e)=>{let t=Re(e),n=(r,i,o,a)=>t(r,i,o,Fe(n,a));return n},Yi=(e)=>{let t=De(e),n=async(r,i,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return await t(r,i,s,Fe(n,a))};return n},Qi=(e)=>{let t=De(e),n=async(r,i,o,a)=>await t(r,i,o,Fe(n,a));return n},eo=(e)=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return bt(e)(t,n,i)},to=(e)=>(t,n,r)=>bt(e)(t,n,r),no=(e)=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return wt(e)(t,n,i)},ro=(e)=>async(t,n,r)=>wt(e)(t,n,r),io=/^[cC][0-9a-z]{6,}$/,oo=/^[0-9a-z]+$/,ao=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,so=/^[0-9a-vA-V]{20}$/,uo=/^[A-Za-z0-9]{27}$/,lo=/^[a-zA-Z0-9_-]{21}$/;function co(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var fo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,po=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Kt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},ho=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mo="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function yo(){return new RegExp(mo,"u")}var go=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_o=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,bo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zo=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ko=/^https?$/,So=/^\+[1-9]\d{6,14}$/,Xn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Oo(e){return new RegExp(`^${e}$`)}var $o=Oo(Xn);function ot(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Po(e){return new RegExp(`^${ot(e)}$`)}function xo(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${ot({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${ot({precision:e.precision})}`:n;return new RegExp(`^${Xn}T(?:${r})$`)}var To=/^[\s\S]{0,}$/,Ao=/^-?\d+$/,zt=/^-?\d+(?:\.\d+)?$/,Eo=/^(?:true|false)$/i,Io=/^[^A-Z]*$/,jo=/^[^a-z]*$/,M=f("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),kt=(e)=>{let t=e.value;return!di(t)&&t.length!==void 0},Ee={number:"number",bigint:"bigint",object:"date"},Gn=f("$ZodCheckLessThan",(e,t)=>{M.init(e,t);let n=Ee[typeof t.value];e._zod.check=(r)=>{if(t.inclusive?r.value<=t.value:r.value<t.value)return;r.issues.push({origin:Ee[typeof r.value]??n,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yn=f("$ZodCheckGreaterThan",(e,t)=>{M.init(e,t);let n=Ee[typeof t.value];e._zod.check=(r)=>{if(t.inclusive?r.value>=t.value:r.value>t.value)return;r.issues.push({origin:Ee[typeof r.value]??n,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),No=f("$ZodCheckMultipleOf",(e,t)=>{M.init(e,t),e._zod.check=(n)=>{if(typeof n.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):pi(n.value,t.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Zo=f("$ZodCheckNumberFormat",(e,t)=>{M.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,o]=Bn[t.format];e._zod.check=(a)=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){if(s>0)a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});else a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}if(s<i)a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort});if(s>o)a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Co=f("$ZodCheckMaxLength",(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=kt),e._zod.check=(r)=>{let i=r.value,o=i.length;if((typeof i==="string"&&o>t.maximum?yt(i):o)<=t.maximum)return;let a=gt(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Mo=f("$ZodCheckMinLength",(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=kt),e._zod.check=(r)=>{let i=r.value,o=i.length;if((typeof i==="string"&&o>=t.minimum&&o<t.minimum*2?yt(i):o)>=t.minimum)return;let a=gt(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Fo=f("$ZodCheckLengthEquals",(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=kt),e._zod.check=(r)=>{let i=r.value,o=i.length,a=typeof i==="string"&&o>=t.length&&o<=t.length*2?yt(i):o;if(a===t.length)return;let s=gt(i),u=a>t.length;r.issues.push({origin:s,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ue=f("$ZodCheckStringFormat",(e,t)=>{var n,r;if(M.init(e,t),t.pattern)(n=e._zod).check??(n.check=(i)=>{if(t.pattern.lastIndex=0,t.pattern.test(i.value))return;i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(r=e._zod).check??(r.check=()=>{})}),Ro=f("$ZodCheckRegex",(e,t)=>{Ue.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Do=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Io),Ue.init(e,t)}),Uo=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=jo),Ue.init(e,t)}),Lo=f("$ZodCheckIncludes",(e,t)=>{M.init(e,t);let n=ae(t.includes),r=new RegExp(typeof t.position==="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=(i)=>{if(i.value.includes(t.includes,t.position))return;i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Jo=f("$ZodCheckStartsWith",(e,t)=>{M.init(e,t);let n=new RegExp(`^${ae(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=(r)=>{if(r.value.startsWith(t.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Bo=f("$ZodCheckEndsWith",(e,t)=>{M.init(e,t);let n=new RegExp(`.*${ae(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=(r)=>{if(r.value.endsWith(t.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Ko=f("$ZodCheckOverwrite",(e,t)=>{M.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class Qn{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split(`
|
|
13
|
+
`).filter((i)=>i),n=Math.min(...t.map((i)=>i.length-i.trimStart().length)),r=t.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of r)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
14
|
+
${t.join(`
|
|
15
|
+
`)}
|
|
16
|
+
};`)(...Object.values(this.closed))}}var Ho={major:4,minor:6,patch:7},k=f("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ho;let r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let o of i)for(let a of o._zod.onattach)a(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(s,u,l)=>{if(s.memo)return s;let c=J(s),p;for(let d of u){if(d._zod.def.when){if(Pi(s))continue;if(!d._zod.def.when(s))continue}else if(c)continue;let h=s.issues.length,m=d._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new Y;if(p||m instanceof Promise)p=(p??Promise.resolve()).then(async()=>{if(await m,s.issues.length===h)return;if(it(s.issues,h,e),!c)c=J(s,h)});else{if(s.issues.length===h)continue;if(it(s.issues,h,e),!c)c=J(s,h)}}if(p)return p.then(()=>s);return s},a=(s,u,l)=>{if(J(s))return s.aborted=!0,s;let c=o(u,i,l);if(c instanceof Promise){if(l.async===!1)throw new Y;return c.then((p)=>e._zod.parse(p,l))}return e._zod.parse(c,l)};e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let c=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});if(c instanceof Promise)return c.then((p)=>a(p,s,u));return a(c,s,u)}let l=e._zod.parse(s,u);if(l instanceof Promise){if(u.async===!1)throw new Y;return l.then((c)=>o(c,i,u))}return o(l,i,u)}}},{get "~standard"(){return Hn(this,"~standard",tr(this))},set "~standard"(e){ee(this,"~standard",e)}}),er=(e,t)=>e.issues.length?{issues:e.issues.map((n)=>Q(n,t,H()))}:{value:e.value};async function Wo(e,t){let n={async:!0};return er(await e._zod.run({value:t,issues:[]},n),n)}function tr(e){return{validate:(t)=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return er(r,n)}catch(r){}return Wo(e,t)},vendor:"zod",version:1}}var St=f("$ZodString",(e,t)=>{k.init(e,t),e._zod.pattern=t.pattern??To,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),P=f("$ZodStringFormat",(e,t)=>{Ue.init(e,t),St.init(e,t)}),Vo=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=po),P.init(e,t)}),qo=f("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Kt(n))}else t.pattern??(t.pattern=Kt());P.init(e,t)}),Xo=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ho),P.init(e,t)}),nr=1,Ie=2;function rr(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function Go(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return rr(e)||Ie;return Yo(e,t)}function Yo(e,t){if(!t.normalize&&t.protocol?.source===ko.source&&!/^https?:\/\//i.test(e))return nr;try{if(typeof URL<"u"){let n=URL;if(typeof n.parse==="function")return n.parse(e)??Ie}return new URL(e)}catch{return Ie}}var Qo=/[\t\n\r]/g;function Ht(e){return e.replace(Qo,"")}function ea(e,t){return t.lastIndex=0,t.test(e.hostname)}function ta(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var na=f("$ZodURL",(e,t)=>{P.init(e,t),e._zod.check=(n)=>{try{let r=n.value.trim(),i=Go(r,t);if(i===nr){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(i===Ie){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Ht(r);return}if(t.hostname&&!ea(i,t.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort});if(t.protocol&&!ta(i,t.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort});n.value=t.normalize?i.href:Ht(r);return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ra=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=yo()),P.init(e,t)}),ia=f("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?lo:co(t.length)),P.init(e,t)}),oa=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=io),P.init(e,t)}),aa=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=oo),P.init(e,t)}),sa=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ao),P.init(e,t)}),ua=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=so),P.init(e,t)}),la=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=uo),P.init(e,t)}),ca=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=xo(t)),P.init(e,t)}),fa=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=$o),P.init(e,t)}),da=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Po(t)),P.init(e,t)}),pa=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fo),P.init(e,t)}),ha=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=go),P.init(e,t)}),ma=/^[0-9a-fA-F:.]+$/;function ir(e){if(!ma.test(e))return!1;return rr(`http://[${e}]`)}var ya=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=vo),P.init(e,t),e._zod.check=(n)=>{if(!ir(n.value))n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),ga=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_o),P.init(e,t)});function va(e){let t=e.split("/");if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);if(`${i}`!==r)return!1;if(i<0||i>128)return!1;return ir(n)}var _a=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=bo),P.init(e,t),e._zod.check=(n)=>{if(!va(n.value))n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function or(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var ar=/^[0-9a-zA-Z+/]*={0,2}$/,ba=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ar),P.init(e,t),e._zod.check=(n)=>{if(or(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Ot=/^[A-Za-z0-9_-]*$/;function wa(e){if(!Ot.test(e))return!1;let t=e.replace(/[-_]/g,(r)=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return or(n)}var za=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ot),P.init(e,t),e._zod.check=(n)=>{if(wa(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ka=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=So),P.init(e,t)});function Sa(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT")return!1;if(!i.alg)return!1;if(t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}var Oa=f("$ZodJWT",(e,t)=>{P.init(e,t),e._zod.check=(n)=>{if(Sa(n.value,t.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),sr=f("$ZodNumber",(e,t)=>{k.init(e,t),e._zod.pattern=zt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(a){}let i=n.value;if(typeof i==="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;let o=typeof i==="number"?Number.isNaN(i)?"NaN":!Number.isFinite(i)?String(i):void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),$a=f("$ZodNumberFormat",(e,t)=>{Zo.init(e,t),sr.init(e,t)}),Pa=f("$ZodBoolean",(e,t)=>{k.init(e,t),e._zod.pattern=Eo,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(o){}let i=n.value;if(typeof i==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),xa=f("$ZodUnknown",(e,t)=>{k.init(e,t),e._zod.parse=(n)=>n}),Ta=f("$ZodNever",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Aa=f("$ZodVoid",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(typeof i>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),n}}),Ea=f("$ZodDate",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(a){}let i=n.value,o=i instanceof Date;if(o&&!Number.isNaN(i.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),n}});function Ia(e,t){let n=Rt(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map((o)=>o[0])),i=e._zod.parse;e._zod.parse=(o,a)=>{let s=t(o.value);if(s>r&&!a?.skipChecks&&a?.direction!=="backward"){for(let[u,l]of Rt(e._zod.def.checks))if(s>u&&l._zod.def.when(o)){let c=o.issues.length;return l._zod.check(o),o.issues[c].continue=!1,it(o.issues,c,e),o}}return i(o,a)}}var ja=(e)=>Array.isArray(e)?e.length:-1;function Wt(e,t,n){if(e.issues.length)t.issues.push(...G(n,e.issues));t.value[n]=e.value}var Na=f("$ZodArray",(e,t)=>{k.init(e,t);let n=U.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=n?n.alloc(e,r,Array(o.length),i):Array(o.length);let a=[],s=i?.abortEarly;for(let u=0;u<o.length;u++){let l=o[u],c=t.element._zod.run({value:l,issues:[]},i);if(c instanceof Promise)a.push(c.then((p)=>Wt(p,r,u)));else if(Wt(c,r,u),s&&c.issues.length!==0&&J(c))break}if(a.length)return Promise.all(a).then(()=>r);return r},Ia(e,ja)});function je(e,t,n,r,i,o){let a=n in r,s=o==="optional";if(!a&&s&&i==="optional")return;if(e.issues.length){if(i!==void 0&&s&&!a)return;t.issues.push(...G(n,e.issues))}if(!a&&i===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}if(e.value===void 0){if(a||i==="defaulted"&&!s)t.value[n]=void 0}else t.value[n]=e.value}var Za=[];function ur(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Za,i=r.length?[...t,...r]:t;for(let a of i)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(a)}": expected a Zod schema`);let o=_i(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function lr(e,t,n,r,i,o,a){let s=[],u=i.keySet,l=i.catchall._zod,c=l.def.type,{optin:p,optout:d}=l,h=0;for(let m in t){if(a&&n.issues.length!==h){if(J(n,h))break;h=n.issues.length}if(u.has(m))continue;if(m==="__proto__"){if(c==="never")s.push(m);continue}if(c==="never"){s.push(m);continue}let y=l.run({value:t[m],issues:[]},r);if(y instanceof Promise)e.push(y.then((b)=>je(b,n,m,t,p,d)));else je(y,n,m,t,p,d)}if(s.length)n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o,continue:!0});if(!e.length)return n;return Promise.all(e).then(()=>n)}var Ca=f("$ZodObject",(e,t)=>{k.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){let l=()=>{let c={...r};return Object.defineProperty(t,"shape",{value:c}),l.raw=c,c};l.raw=r,Object.defineProperty(t,"shape",{get:l})}let i=Ce(()=>ur(t));w(e,"propValues",(l)=>{let c=l.def.shape,p={};for(let d in c){let h=c[d]._zod;if(h.values){if(!Object.prototype.hasOwnProperty.call(p,d))V(p,d,new Set);for(let m of h.values)p[d].add(m);if(h.optin!==void 0)p[d].add(void 0)}}return p});let o=ye,a=t.catchall,s,u=U.memoizer;u?.attach(e),e._zod.parse=(l,c)=>{s??(s=i.value);let p=l.value;if(!o(p))return l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l;l.value=u?u.alloc(e,l,{},c):{};let d=[],h=s.shape,m=c?.abortEarly,y=l.issues.length;for(let b of s.allKeys){if(m&&l.issues.length!==y){if(J(l,y))break;y=l.issues.length}if(b==="__proto__")continue;let _=h[b],I=_._zod.optin,A=_._zod.optout,O=_._zod.run({value:p[b],issues:[]},c);if(O instanceof Promise)d.push(O.then((z)=>je(z,l,b,p,I,A)));else je(O,l,b,p,I,A)}if(!a)return d.length?Promise.all(d).then(()=>l):l;return lr(d,p,l,c,i.value,e,m===!0)}}),Ma=f("$ZodObjectJIT",(e,t)=>{Ca.init(e,t);let n=e._zod.parse,r=Ce(()=>ur(t)),i=U.memoizer,o=(d)=>{let h=r.value,m=h.symbolKeys,y=new Qn(["payload","ctx"],{shape:d,inst:e,memo:i,syms:m}),b=(O)=>`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`,_=(O,z)=>`
|
|
17
|
+
let ${O}_ab = false;
|
|
18
|
+
for (let i = 0; i < ${O}.issues.length; i++) {
|
|
19
|
+
const iss = ${O}.issues[i];
|
|
20
|
+
iss.path = iss.path ? [${z}, ...iss.path] : [${z}];
|
|
21
|
+
payload.issues.push(iss);
|
|
22
|
+
if (iss.continue !== true) ${O}_ab = true;
|
|
23
|
+
}
|
|
24
|
+
if (${O}_ab && ctx && ctx.abortEarly) {
|
|
25
|
+
payload.value = newResult;
|
|
26
|
+
return payload;
|
|
27
|
+
}`;y.write("const input = payload.value;");let I=Object.create(null),A=0;for(let O of h.allKeys)I[O]=`key_${A++}`;y.write(i?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let O of h.allKeys){if(O==="__proto__")continue;let z=I[O],F=typeof O==="symbol"?`syms[${m.indexOf(O)}]`:mi(O),Le=`${F} in input`,xt=d[O],Je=xt?._zod?.optin,Tt=Je!==void 0,Dr=xt?._zod?.optout==="optional";if(y.write(`const ${z} = ${b(F)};`),Tt&&Dr){let Ur=Je==="optional"?`${z}_present`:`${z}.value !== undefined || ${z}_present`;y.write(`
|
|
28
|
+
const ${z}_present = ${Le};
|
|
29
|
+
if (!${z}.issues.length || ${z}_present) {
|
|
30
|
+
if (${z}.issues.length) {${_(z,F)}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (${Ur}) {
|
|
34
|
+
newResult[${F}] = ${z}.value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`)}else if(!Tt)y.write(`
|
|
39
|
+
const ${z}_present = ${Le};
|
|
40
|
+
if (${z}.issues.length) {${_(z,F)}
|
|
41
|
+
}
|
|
42
|
+
if (!${z}_present && !${z}.issues.length) {
|
|
43
|
+
payload.issues.push({
|
|
44
|
+
code: "invalid_type",
|
|
45
|
+
expected: "nonoptional",
|
|
46
|
+
input: undefined,
|
|
47
|
+
path: [${F}]
|
|
48
|
+
});
|
|
49
|
+
if (ctx && ctx.abortEarly) {
|
|
50
|
+
payload.value = newResult;
|
|
51
|
+
return payload;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${z}_present) {
|
|
56
|
+
newResult[${F}] = ${z}.value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
`);else if(y.write(`
|
|
60
|
+
if (${z}.issues.length) {${_(z,F)}
|
|
61
|
+
}
|
|
62
|
+
`),Je==="defaulted")y.write(`newResult[${F}] = ${z}.value;`);else y.write(`
|
|
63
|
+
if (${z}.value !== undefined || ${Le}) {
|
|
64
|
+
newResult[${F}] = ${z}.value;
|
|
65
|
+
}
|
|
66
|
+
`)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},a,s=ye,u=!U.jitless,l=u&&gi.value,c=t.catchall,p;e._zod.parse=(d,h)=>{p??(p=r.value);let m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;if(u&&l&&h?.async===!1&&h.jitless!==!0){if(!a)a=o(t.shape);if(d=a(d,h),!c)return d;return lr([],m,d,h,p,e,h?.abortEarly===!0)}return n(d,h)}});function Vt(e,t,n,r){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let i=e.filter((o)=>!J(o));if(i.length===1)return t.value=i[0].value,i[0];return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((o)=>o.issues.map((a)=>Q(a,r,H())))}),t}var cr=f("$ZodUnion",(e,t)=>{k.init(e,t),w(e,"optin",(r)=>r.def.options.some((i)=>i._zod.optin==="defaulted")?"defaulted":r.def.options.some((i)=>i._zod.optin!==void 0)?"optional":void 0),w(e,"optout",(r)=>r.def.options.some((i)=>i._zod.optout==="optional")?"optional":void 0),w(e,"values",(r)=>{if(r.def.options.every((i)=>i._zod.values))return new Set(r.def.options.flatMap((i)=>Array.from(i._zod.values)));return}),w(e,"pattern",(r)=>{if(r.def.options.every((i)=>i._zod.pattern)){let i=r.def.options.map((o)=>o._zod.pattern);return new RegExp(`^(${i.map((o)=>ht(o.source)).join("|")})$`)}return});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,a=[];for(let s of t.options){let u=s._zod.run({value:r.value,issues:[]},i);if(u instanceof Promise)a.push(u),o=!0;else{if(u.issues.length===0)return u;a.push(u)}}if(!o)return Vt(a,r,e,i);return Promise.all(a).then((s)=>Vt(s,r,e,i))}});function Fa(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let i of r)if(t.has(i)){if(i!==void 0)throw Error(`Duplicate discriminator value "${String(i)}"`);t.set(i,null)}else t.set(i,n)}return t}var Ra=f("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,cr.init(e,t);let n=e._zod.parse;w(e,"propValues",(i)=>{let o={},a=0;for(let s of i.def.options){let u=s._zod.propValues;if(!u||Object.keys(u).length===0)throw Error(`Invalid discriminated union option at index "${i.def.options.indexOf(s)}"`);if(u[i.def.discriminator]?.has(void 0))a++;for(let[l,c]of Object.entries(u)){if(!Object.prototype.hasOwnProperty.call(o,l))V(o,l,new Set);for(let p of c)o[l].add(p)}}if(!i.def.unionFallback&&a>1)o[i.def.discriminator]?.delete(void 0);return o}),t.options.forEach((i,o)=>{let a=mt(i._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,t.discriminator))throw Error(`Invalid discriminated union option at index "${o}"`)});let r=Ce(()=>Fa(t));e._zod.parse=(i,o)=>{let a=i.value;if(!ye(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let s=a?.[t.discriminator],u=r.value.get(s);if(u&&(s!==void 0||o.direction!=="backward"))return u._zod.run(i,o);if(t.unionFallback||o.direction==="backward")return n(i,o);return i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter((l)=>r.value.get(l)!==null),input:a,path:[t.discriminator],inst:e}),i}}),Da=f("$ZodIntersection",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>{let i=n.value,o=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);if(o instanceof Promise||a instanceof Promise)return Promise.all([o,a]).then(([s,u])=>qt(n,s,u));return qt(n,o,a)}});function at(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(oe(e)&&oe(t)){let n=Object.keys(t),r=Object.keys(e).filter((o)=>n.indexOf(o)!==-1),i={...e,...t};if(Object.prototype.hasOwnProperty.call(i,"__proto__"))delete i.__proto__;for(let o of r){if(o==="__proto__")continue;let a=at(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t[r],a=at(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qt(e,t,n){let r=new Map,i,o=new Map,a=(l,c)=>{let p;if(l.code==="unrecognized_keys"&&!l.path?.length)i??(i=l),p=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let d=String(l.path[0]);if(!o.has(d))o.set(d,l);p=[d]}else return!1;for(let d of p){if(!r.has(d))r.set(d,{});r.get(d)[c]=!0}return!0};for(let l of t.issues)if(!a(l,"l"))e.issues.push(l);for(let l of n.issues)if(!a(l,"r"))e.issues.push(l);let s=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length){let l=i?s.filter((c)=>i.keys.includes(c)):[];if(l.length)e.issues.push({...i,keys:l});for(let c of s)if(!l.includes(c)&&o.has(c))e.issues.push(o.get(c))}let u=at(t.value,n.value);if(!u.valid){if(J(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var fr=f("$ZodTuple",(e,t)=>{k.init(e,t);let n=t.items,r=U.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let a=i.value;if(!Array.isArray(a))return i.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],o):[];let s=[],u=Xt(n,"optin"),l=Xt(n,"optout");if(!t.rest){if(a.length<u)return i.issues.push({code:"too_small",minimum:u,inclusive:!0,input:a,inst:e,origin:"array"}),i;if(a.length>n.length)i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:a,inst:e,origin:"array"})}let c=Array(n.length),p=t.rest?o?.abortEarly:void 0,d=!1;for(let h=0;h<n.length;h++){let m=n[h]._zod.run({value:a[h],issues:[]},o);if(m instanceof Promise)s.push(m.then((y)=>{c[h]=y}));else if(c[h]=m,p&&!d&&m.issues.length)d=J(m)}if(t.rest&&!d){let h=n.length-1,m=a.slice(n.length),y=i.issues.length;for(let b of m){if(p&&i.issues.length!==y){if(J(i,y))break;y=i.issues.length}h++;let _=t.rest._zod.run({value:b,issues:[]},o);if(_ instanceof Promise)s.push(_.then((I)=>Gt(I,i,h)));else Gt(_,i,h)}}if(s.length)return Promise.all(s).then(()=>Yt(c,i,n,a,l));return Yt(c,i,n,a,l)}});function Xt(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function Gt(e,t,n){if(e.issues.length)t.issues.push(...G(n,e.issues));t.value[n]=e.value}function Yt(e,t,n,r,i){for(let o=0;o<n.length;o++){let a=e[o],s=o<r.length;if(!s&&o>=i&&n[o]._zod.optin==="optional"){t.value.length=o;break}if(a.issues.length){if(!s&&o>=i){t.value.length=o;break}t.issues.push(...G(o,a.issues))}t.value[o]=a.value}for(let o=t.value.length-1;o>=r.length;o--)if(n[o]._zod.optout==="optional"&&t.value[o]===void 0)t.value.length=o;else break;return t}var Ua=f("$ZodRecord",(e,t)=>{k.init(e,t);let n=U.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!oe(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let a=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let u=new Set;for(let c of s)if(typeof c==="string"||typeof c==="number"||typeof c==="symbol"){if(u.add(typeof c==="number"?c.toString():c),c==="__proto__")continue;let p=t.keyType._zod.run({value:c,issues:[]},i);if(p instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map((m)=>Q(m,i,H())),input:c,path:[c],inst:e});continue}let d=p.value;if(d==="__proto__")continue;let h=t.valueType._zod.run({value:o[c],issues:[]},i);if(h instanceof Promise)a.push(h.then((m)=>{if(m.issues.length)r.issues.push(...G(c,m.issues));r.value[d]=m.value}));else{if(h.issues.length)r.issues.push(...G(c,h.issues));r.value[d]=h.value}}let l;for(let c in o)if(!u.has(c))if(t.mode==="loose"){if(c==="__proto__")continue;r.value[c]=o[c]}else l=l??[],l.push(c);if(l&&l.length>0)r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let u;for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(o,l))continue;let c=t.keyType._zod.run({value:l,issues:[]},i);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof l==="string"&&zt.test(l)&&c.issues.length){let h=t.keyType._zod.run({value:Number(l),issues:[]},i);if(h instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(h.issues.length===0)c=h}if(c.issues.length){if(t.mode==="loose")r.value[l]=o[l];else if(s)u=u??[],u.push(l);else r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((h)=>Q(h,i,H())),input:l,path:[l],inst:e});continue}let p=c.value;if(p==="__proto__")continue;let d=t.valueType._zod.run({value:o[l],issues:[]},i);if(d instanceof Promise)a.push(d.then((h)=>{if(h.issues.length)r.issues.push(...G(l,h.issues));r.value[p]=h.value}));else{if(d.issues.length)r.issues.push(...G(l,d.issues));r.value[p]=d.value}}if(u&&u.length>0)r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:u,continue:!0})}if(a.length)return Promise.all(a).then(()=>r);return r}}),La=f("$ZodEnum",(e,t)=>{k.init(e,t);let n=nt(t.entries),r=new Set(n);e._zod.values=r,w(e,"pattern",(i)=>{let o=nt(i.def.entries).filter((a)=>vi.has(typeof a));return new RegExp(o.length?`^(${o.map((a)=>ae(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,o)=>{let a=i.value;if(r.has(a))return i;return i.issues.push({code:"invalid_value",values:n,input:a,inst:e}),i}}),Ja=f("$ZodLiteral",(e,t)=>{k.init(e,t);let n=new Set(t.values);e._zod.values=n,w(e,"pattern",(r)=>{let i=r.def.values;return new RegExp(i.length?`^(${i.map((o)=>typeof o==="string"?ae(o):o?ae(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,i)=>{let o=r.value;if(n.has(o))return r;return r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),Ba=f("$ZodTransform",(e,t)=>{k.init(e,t),e._zod.optin="optional",U.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new _t(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then((o)=>(n.value=o,n));if(i instanceof Promise)throw new Y;return n.value=i,n}});function Qt(e,t){return e.value=t.issues.length?void 0:t.value,e}var dr=f("$ZodOptional",(e,t)=>{k.init(e,t),w(e,"optin",(n)=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",w(e,"values",(n)=>{let r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),w(e,"pattern",(n)=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${ht(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let i=t.innerType._zod.run({value:n.value,issues:[]},r);if(i instanceof Promise)return i.then((o)=>Qt(n,o));return Qt(n,i)}return t.innerType._zod.run(n,r)}}),Ka=f("$ZodExactOptional",(e,t)=>{dr.init(e,t),w(e,"values",(n)=>n.def.innerType._zod.values),w(e,"pattern",(n)=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Ha=f("$ZodNullable",(e,t)=>{k.init(e,t),w(e,"optin",(n)=>n.def.innerType._zod.optin),w(e,"optout",(n)=>n.def.innerType._zod.optout),w(e,"pattern",(n)=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${ht(r.source)}|null)$`):void 0}),w(e,"values",(n)=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>{if(n.value===null)return n;return t.innerType._zod.run(n,r)}}),Wa=f("$ZodDefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",w(e,"values",(n)=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;let i=t.innerType._zod.run(n,r);if(i instanceof Promise)return i.then((o)=>en(o,t));return en(i,t)}});function en(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Va=f("$ZodPrefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",w(e,"values",(n)=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)n.value=t.defaultValue;return t.innerType._zod.run(n,r)}}),qa=f("$ZodNonOptional",(e,t)=>{k.init(e,t),w(e,"values",(n)=>{let r=n.def.innerType._zod.values;return r?new Set([...r].filter((i)=>i!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);if(i instanceof Promise)return i.then((o)=>tn(o,e));return tn(i,e)}});function tn(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function nn(e,t,n,r){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map((i)=>Q(i,r,H()))},input:e.value}),e}var Xa=f("$ZodCatch",(e,t)=>{k.init(e,t),w(e,"optin",(n)=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),w(e,"optout",(n)=>n.def.innerType._zod.optout),w(e,"values",(n)=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let i=t.innerType._zod.run({value:n.value,issues:[]},r);if(i instanceof Promise)return i.then((o)=>nn(n,o,t,r));return nn(n,i,t,r)}}),pr=f("$ZodPipe",(e,t)=>{k.init(e,t),w(e,"values",(n)=>n.def.in._zod.values),w(e,"optin",(n)=>n.def.in._zod.optin),w(e,"optout",(n)=>n.def.out._zod.optout),w(e,"propValues",(n)=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){let o=t.out._zod.run(n,r);if(o instanceof Promise)return o.then((a)=>we(a,t.in,r));return we(o,t.in,r)}let i=t.in._zod.run(n,r);if(i instanceof Promise)return i.then((o)=>we(o,t.out,r));return we(i,t.out,r)}});function we(e,t,n){if(e.issues.some((r)=>r.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},n)}var Ga=f("$ZodPreprocess",(e,t)=>{pr.init(e,t)}),Ya=f("$ZodReadonly",(e,t)=>{k.init(e,t),w(e,"propValues",(n)=>n.def.innerType._zod.propValues),w(e,"values",(n)=>n.def.innerType._zod.values),w(e,"optin",(n)=>n.def.innerType?._zod?.optin),w(e,"optout",(n)=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let i=t.innerType._zod.run(n,r);if(i instanceof Promise)return i.then(rn);return rn(i)}});function rn(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Qa=f("$ZodFunction",(e,t)=>(k.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=(n)=>{if(typeof n!=="function")throw Error("implement() must be called with a function");return Object.defineProperty(function(...r){let i=e._def.input?Jt(e._def.input,r):r,o=Reflect.apply(n,this,i);if(e._def.output)return Jt(e._def.output,o);return o},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=(n)=>{if(typeof n!=="function")throw Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...r){let i=e._def.input?await Bt(e._def.input,r):r,o=await Reflect.apply(n,this,i);if(e._def.output)return await Bt(e._def.output,o);return o},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,r)=>{if(typeof n.value!=="function")return n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n;if(e._def.output&&e._def.output._zod.def.type==="promise")n.value=e.implementAsync(n.value);else n.value=e.implement(n.value);return n},e.input=(...n)=>{let r=e.constructor;if(Array.isArray(n[0]))return new r({type:"function",input:new fr({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output});return new r({type:"function",input:n[0],output:e._def.output})},e.output=(n)=>new e.constructor({type:"function",input:e._def.input,output:n}),e)),es=f("$ZodPromise",(e,t)=>{k.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then((i)=>t.innerType._zod.run({value:i,issues:[]},r))}),ts=f("$ZodCustom",(e,t)=>{M.init(e,t),k.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=(n)=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then((o)=>on(o,n,r,e));on(i,n,r,e);return}});function on(e,t,n,r){if(!e){let i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};if(r._zod.def.params)i.params=r._zod.def.params;t.issues.push(ge(i))}}class hr extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var st="~memo",an=[];function mr(e){return e!==null&&typeof e==="object"}function Ge(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var yr=new WeakMap,de=0,$e=1,he=2;function Pe(e,t,n){let r=yr.get(e);if(r!==void 0)return r?he:de;if(t.has(e))return he;t.add(e);let i=de,o=(c)=>{if(i!==he&&c?._zod){let p=Pe(c,t,n);if(p>i)i=p}},a=(c,p)=>{let d=de;for(let h of Reflect.ownKeys(c)){let m=Object.getOwnPropertyDescriptor(c,h);if(p&&!m.enumerable)continue;let y=m.get?$e:m.value?._zod?Pe(m.value,t,n):de;if(y>d)d=y}return d},s=(c)=>{if(c>i)i=c},u=e._zod.def;switch(u.type){case"object":{let c=mt(u);s(c?a(c,!0):$e),o(u.catchall);break}case"array":o(u.element);break;case"tuple":for(let c of u.items)o(c);o(u.rest);break;case"record":case"map":o(u.keyType),o(u.valueType);break;case"set":o(u.valueType);break;case"union":for(let c of u.options)o(c);break;case"intersection":o(u.left),o(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(u.innerType);break;case"pipe":o(u.in),o(u.out);break;case"function":o(u.input),o(u.output);break;case"lazy":{let c=u._cachedInner??(n?e._zod.innerType:void 0);s(c?Pe(c,t,!1):$e);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let c in u){let p=Object.getOwnPropertyDescriptor(u,c);if(!p||p.get)continue;let d=p.value;if(!d||typeof d!=="object")continue;if(d._zod)o(d);else if(Array.isArray(d))for(let h of d)o(h)}}return t.delete(e),ns(e,i)}function ns(e,t){if(t!==$e)yr.set(e,t===he);return t}function rs(e,t){let n=e.buckets.get(t);if(!n)n=new WeakMap,e.buckets.set(t,n);return n}var ze,ke=[],is={alloc(e,t,n){let r=ze;if(!r)return n;ze=void 0;let i={value:n,issues:null};return r.set(t.value,i),ke.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,r=(i,o)=>{if(o.direction!=="backward"&&as(o,i.value))throw new hr;return n(i,o)};if(e._zod.parse=r,e._zod.run===n)e._zod.run=r})},attach(e){var t;let n,r=!1,i,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let a=e._zod.parse,s=(u,l)=>{if(n===void 0){let _=Pe(e,new Set,!1);if(_===de){if(e._zod.parse=a,e._zod.run===s)e._zod.run=a;return a(u,l)}if(_===he||r)n=!0;else r=!0}let c=u.value;if(!mr(c))return a(u,l);let p=l[st];if(!p)p={buckets:new WeakMap,backEdges:void 0},l[st]=p;let d;if(i===l)d=o;else d=rs(p,e),i=l,o=d;let h=d.get(c);if(h){if(u.value=h.value,h.issues){if(h.issues.length)u.issues.push(...Ge(h.issues))}else u.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(h.value);return u}ze=d;let m=ke.length,y=a(u,l);ze=void 0;let b=ke.length>m?ke.pop():void 0;if(y instanceof Promise)return y.then((_)=>{if(b)b.issues=_.issues.length?Ge(_.issues):an;return _});if(b)b.issues=y.issues.length?Ge(y.issues):an;return y};if(e._zod.parse=s,e._zod.run===a)e._zod.run=s})}};function os(){return is}function as(e,t){let n=e[st]?.backEdges;return n!==void 0&&mr(t)&&n.has(t)}var ss=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function i(o,a){if(o==="number"&&typeof a==="number"&&!Number.isFinite(a))return String(a);return r[o]??o}return(o)=>{switch(o.code){case"invalid_type":{let a=i(o.expected),s=Ti(o.input),u=i(s,o.input);return`Invalid input: expected ${a}, received ${u}`}case"invalid_value":if(o.values.length===1)return`Invalid input: expected ${Jn(o.values[0])}`;return`Invalid option: expected one of ${Mt(o.values,"|")}`;case"too_big":{let a=o.exact?"exactly ":o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Too big: expected ${o.origin??"value"} to have ${a}${o.maximum.toString()} ${s.unit??"elements"}`;return`Too big: expected ${o.origin??"value"} to be ${a}${o.maximum.toString()}`}case"too_small":{let a=o.exact?"exactly ":o.inclusive?">=":">",s=t(o.origin);if(s)return`Too small: expected ${o.origin} to have ${a}${o.minimum.toString()} ${s.unit}`;return`Too small: expected ${o.origin} to be ${a}${o.minimum.toString()}`}case"invalid_format":{let a=o;if(a.format==="starts_with")return`Invalid string: must start with "${a.prefix}"`;if(a.format==="ends_with")return`Invalid string: must end with "${a.suffix}"`;if(a.format==="includes")return`Invalid string: must include "${a.includes}"`;if(a.format==="regex")return`Invalid string: must match pattern ${a.pattern}`;return`Invalid ${n[a.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${Mt(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":if(o.options&&Array.isArray(o.options)&&o.options.length>0)return`Invalid discriminator value. Expected ${o.options.map((a)=>`'${a}'`).join(" | ")}`;if(o.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function us(){return{localeError:ss()}}var sn;class gr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n)this._idmap.set(n.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function ls(){return new gr}(sn=globalThis).__zod_globalRegistry??(sn.__zod_globalRegistry=ls());var pe=globalThis.__zod_globalRegistry;function vr(e){if(e.checks)e.checks=[...e.checks];return e}function cs(e,t){return new e(vr({type:"string",...g(t)}))}function fs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function ds(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function ps(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function hs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function ys(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function gs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function vs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function _s(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function bs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function ws(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function zs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function ks(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function Ss(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function Os(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function $s(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function Ps(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function xs(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function Ts(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function As(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function Es(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function Is(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function js(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Ns(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Zs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function Cs(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function Ms(e,t){return new e(vr({type:"number",checks:[],...g(t)}))}function Fs(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function Rs(e,t){return new e({type:"boolean",...g(t)})}function Ds(e){return new e({type:"unknown"})}function Us(e,t){return new e({type:"never",...g(t)})}function un(e,t){return new Gn({check:"less_than",...g(t),value:e,inclusive:!1})}function xe(e,t){return new Gn({check:"less_than",...g(t),value:e,inclusive:!0})}function ln(e,t){return new Yn({check:"greater_than",...g(t),value:e,inclusive:!1})}function Te(e,t){return new Yn({check:"greater_than",...g(t),value:e,inclusive:!0})}function cn(e,t){return new No({check:"multiple_of",...g(t),value:e})}function _r(e,t){return new Co({check:"max_length",...g(t),maximum:e})}function Ne(e,t){return new Mo({check:"min_length",...g(t),minimum:e})}function br(e,t){return new Fo({check:"length_equals",...g(t),length:e})}function Ls(e,t){return new Ro({check:"string_format",format:"regex",...g(t),pattern:e})}function Js(e){return new Do({check:"string_format",format:"lowercase",...g(e)})}function Bs(e){return new Uo({check:"string_format",format:"uppercase",...g(e)})}function Ks(e,t){return new Lo({check:"string_format",format:"includes",...g(t),includes:e})}function Hs(e,t){return new Jo({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Ws(e,t){return new Bo({check:"string_format",format:"ends_with",...g(t),suffix:e})}function le(e){return new Ko({check:"overwrite",tx:e})}function Vs(e){return le((t)=>t.normalize(e))}function qs(){return le((e)=>e.trim())}function Xs(){return le((e)=>e.toLowerCase())}function Gs(){return le((e)=>e.toUpperCase())}function Ys(){return le((e)=>yi(e))}function Qs(e,t,n){return new e({type:"array",element:t,...g(n)})}function eu(e,t,n){return new e({type:"custom",check:"custom",fn:t,...g(n)})}function tu(e,t){let n=nu((r)=>(r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(ge(i,r.value,n._zod.def));else{let o=i;if(o.fatal)o.continue=!1;if(o.code??(o.code="custom"),!("input"in o))o.input=r.value;o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),r.issues.push(ge(o))}},e(r.value,r)),t);return n}function nu(e,t){let n=new M({check:"custom",...g(t)});return n._zod.check=e,n}function me(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))if(Object.prototype.propertyIsEnumerable.call(n,r))V(e,r,n[r]);return e}function wr(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??pe,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function B(e,t,n,r,i){let o=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw Error(i);return Object.assign(n,o),!0}function x(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o){if(o.count++,n.schemaPath.includes(e))o.cycle=n.path;return o.schema}let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,l);else{let p=a.schema,d=t.processors[i.type];if(!d)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);d(e,t,p,l)}let c=e._zod.parent;if(c){if(!a.ref)a.ref=c;x(c,t,l),t.seen.get(c).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)me(a.schema,u);if(t.io==="input"&&N(e))delete a.schema.examples,delete a.schema.default;if(t.io==="input"&&"_prefault"in a.schema)(r=a.schema).default??(r.default=a.schema._prefault);return delete a.schema._prefault,t.seen.get(e).schema}function fn(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function zr(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let u=r.get(s);if(u&&u!==a[0])throw Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(s,a[0])}}let i=(a)=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,d=e.external.uri??((m)=>m);if(p)return{ref:d(p)};let h=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=h,{defId:h,ref:`${d("__shared")}#/${s}/${fn(h)}`}}let u="#",l=`${u}/${s}/`;if(a[1]===n&&!a[1].schema.id)return{ref:u};let c=a[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:l+fn(c)}},o=(a)=>{if(a[1].schema.$ref)return;let s=a[1],{ref:u,defId:l}=i(a);if(s.def={...s.schema},l)s.defId=l;let c=s.schema;for(let p in c)delete c[p];c.$ref=u};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
67
|
+
|
|
68
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){o(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1){if(e.reused==="ref")o(a)}}if(e.external)e.sharedDefsExtractedFor=e.external}function kr(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!=="object")return;kr(r);let i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;let o=r.type;for(let a of Array.isArray(o)?o:[o]){if(typeof a!=="string")return;if(!n.includes(a))n.push(a)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Sr=new Set(["type","properties","required","additionalProperties"]),dn=["oneOf","anyOf"];function pn(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function ut(e){let t=[];for(let o of e){if(typeof o!=="object"||o.type!=="object")return null;for(let a in o)if(!Sr.has(a))return null;t.push(o)}let n={},r=new Set;for(let o of t){for(let a in o.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;let s=[];for(let l of t){let c=l.properties?.[a]??pn(l);if(c===null||c===void 0)continue;if(!s.some((p)=>JSON.stringify(p)===JSON.stringify(c)))s.push(c)}let u=s.length===1?s[0]:ut(s)??{allOf:s};V(n,a,u)}for(let a of o.required??[])r.add(a)}let i={type:"object",properties:n};if(r.size)i.required=[...r];if(t.every((o)=>o.additionalProperties===!1))i.additionalProperties=!1;else{let o=[];for(let a of t){let s=pn(a);if(s&&!o.some((u)=>JSON.stringify(u)===JSON.stringify(s)))o.push(s)}if(o.length===1)i.additionalProperties=o[0];else if(o.length>1)i.additionalProperties={allOf:o}}return i}function ru(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let i of Sr)if(i in e)return;let n=t.filter((i)=>dn.some((o)=>Array.isArray(i[o]))),r=null;if(!n.length)r=ut(t);else{let i=n[0],o=dn.find((u)=>Array.isArray(i[u]));if(Object.keys(i).length!==1)return;let a=t.filter((u)=>u!==i),s=i[o].map((u)=>ut([...a,u]));if(s.some((u)=>!u))return;r={[o]:s}}if(!r)return;delete e.allOf,me(e,r)}function Or(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=(s)=>{let u=e.seen.get(s);if(u.ref===null)return;let l=u.def??u.schema,c={...l},p=u.ref;if(u.ref=null,p){r(p);let h=e.seen.get(p),m=h.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))l.allOf=l.allOf??[],l.allOf.push(m);else me(l,m);if(me(l,c),s._zod.parent===p)for(let y in l){if(y==="$ref"||y==="allOf")continue;if(!(y in c))delete l[y]}if(m.$ref&&h.def)for(let y in l){if(y==="$ref"||y==="allOf")continue;if(y in h.def&&JSON.stringify(l[y])===JSON.stringify(h.def[y]))delete l[y]}}let d=s._zod.parent;if(d&&d!==p){r(d);let h=e.seen.get(d);if(h?.schema.$ref){if(l.$ref=h.schema.$ref,h.def)for(let m in l){if(m==="$ref"||m==="allOf")continue;if(m in h.def&&JSON.stringify(l[m])===JSON.stringify(h.def[m]))delete l[m]}}}e.override({zodSchema:s,jsonSchema:l,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let s of[...e.seen.entries()].reverse())r(s[0]);if(e.target!=="openapi-3.0")for(let s of e.seen.entries())kr(s[1].def??s[1].schema);for(let s of e.deferred)s();if(e.intersections.length){let s=new Map;for(let u of e.seen.values())for(let l of[u.schema,u.def]){let c=l?.allOf;if(!Array.isArray(c))continue;let p=s.get(c);if(p)p.push(l);else s.set(c,[l])}for(let u of e.intersections)for(let l of s.get(u)??[])ru(l)}}let i={};if(e.target==="draft-2020-12")i.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")i.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")i.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(s)}me(i,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;if(o!==void 0&&i.id===o)delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let s of e.seen.entries()){let u=s[1];if(u.def&&u.defId){if(u.def.id===u.defId)delete u.def.id;V(a,u.defId,u.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(a).length>0)if(e.target==="draft-2020-12")i.$defs=a;else i.definitions=a;try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ze(t,"input",e.processors),output:Ze(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch(s){throw Error("Error converting schema to JSON.")}}function N(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return N(r.element,n);if(r.type==="set")return N(r.valueType,n);if(r.type==="lazy")return N(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return N(r.innerType,n);if(r.type==="intersection")return N(r.left,n)||N(r.right,n);if(r.type==="record"||r.type==="map")return N(r.keyType,n)||N(r.valueType,n);if(r.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return N(r.in,n)||N(r.out,n)}if(r.type==="object"){for(let i in r.shape)if(N(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(let i of r.options)if(N(i,n))return!0;return!1}if(r.type==="tuple"){for(let i of r.items)if(N(i,n))return!0;if(r.rest&&N(r.rest,n))return!0;return!1}return!1}var iu=(e,t={})=>(n)=>{let r=wr({...n,processors:t});return x(e,r),zr(r,e),Or(r,e)},Ze=(e,t,n={})=>(r)=>{let{libraryOptions:i,target:o}=r??{},a=wr({...i??{},target:o,io:t,processors:n});return x(e,a),zr(a,e),Or(a,e)},se=(e,t,n)=>{if(e[t]===void 0||n>e[t])e[t]=n},ue=(e,t,n)=>{if(e[t]===void 0||n<e[t])e[t]=n},hn=(e,t)=>{se(e,"minimum",t),ue(e,"maximum",t)},$r=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Pr=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},xr=(e,t)=>{e.mime=e.mime?e.mime.filter((n)=>t.includes(n)):[...t]},Tr=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},mn=(e,t)=>se(e,"minimum",t.minimum),yn=(e,t)=>ue(e,"maximum",t.maximum),gn=(e)=>(t,n)=>{Tr(t,n.format);let[r,i]=e[n.format];se(t,"minimum",r),ue(t,"maximum",i)},ou={greater_than:(e,t)=>se(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ue(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>$r(e,t.value),number_format:gn(Bn),bigint_format:gn(bi),min_length:mn,max_length:yn,length_equals:(e,t)=>hn(e,t.length),min_size:mn,max_size:yn,size_equals:(e,t)=>hn(e,t.size),string_format:(e,t)=>{if(Tr(e,t.format),t.pattern)Pr(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>xr(e,t.mime)};function C(e){let t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let o of r)ou[o._zod.def.check]?.(t,o._zod.def);let i=e._zod.bag;if(i.minimum!==void 0)se(t,"minimum",i.minimum);if(i.exclusiveMinimum!==void 0)se(t,"exclusiveMinimum",i.exclusiveMinimum);if(i.maximum!==void 0)ue(t,"maximum",i.maximum);if(i.exclusiveMaximum!==void 0)ue(t,"exclusiveMaximum",i.exclusiveMaximum);if(i.multipleOf!==void 0)$r(t,i.multipleOf);if(i.format!==void 0){if(t.format??(t.format=i.format),i.format.includes("int"))t.isInt=!0}if(i.mime)xr(t,i.mime);for(let o of i.patterns??[])Pr(t,o);return t}var au={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},su=new Map([[ar,wo],[Ot,zo]]),Ar=(e)=>su.get(e)??e,uu=(e,t,n,r)=>{let i=n;i.type="string";let{minimum:o,maximum:a,format:s,patterns:u,contentEncoding:l,laxFormat:c}=C(e);if(typeof o==="number")i.minLength=o;if(typeof a==="number")i.maxLength=a;if(s){if(i.format=au[s]??s,i.format==="")delete i.format;if(s==="time"||c)delete i.format}if(l)i.contentEncoding=l;if(u&&u.size>0){let p=[...u].map(Ar);if(p.length===1)i.pattern=p[0].source;else if(p.length>1)i.allOf=[...p.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},lu=(e,t,n,r)=>{let i=n,{minimum:o,maximum:a,multipleOf:s,exclusiveMaximum:u,exclusiveMinimum:l,isInt:c}=C(e);i.type=c?"integer":"number";let p=typeof l==="number"&&l>=(o??Number.NEGATIVE_INFINITY),d=typeof u==="number"&&u<=(a??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(p)if(h)i.minimum=l,i.exclusiveMinimum=!0;else i.exclusiveMinimum=l;else if(typeof o==="number")i.minimum=o;if(d)if(h)i.maximum=u,i.exclusiveMaximum=!0;else i.exclusiveMaximum=u;else if(typeof a==="number")i.maximum=a;if(s){let m=new Set;for(let _ of s)if(Number.isFinite(_)&&_!==0)m.add(Math.abs(_));else B(e,t,i,r,`A multipleOf divisor of ${_} cannot be represented in JSON Schema`);let[y,...b]=m;if(y!==void 0)i.multipleOf=y;if(b.length)i.allOf=[...i.allOf??[],...b.map((_)=>({multipleOf:_}))]}},cu=(e,t,n,r)=>{n.type="boolean"};var fu=(e,t,n,r)=>{B(e,t,n,r,"Void cannot be represented in JSON Schema")},du=(e,t,n,r)=>{n.not={}};var pu=(e,t,n,r)=>{},hu=(e,t,n,r)=>{B(e,t,n,r,"Date cannot be represented in JSON Schema")},mu=(e,t,n,r)=>{let i=e._zod.def,o=nt(i.entries);if(o.length===0){n.not={};return}if(o.every((a)=>typeof a==="number"))n.type="number";if(o.every((a)=>typeof a==="string"))n.type="string";n.enum=o},yu=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let o=[];for(let a of i.values)if(a===void 0){if(B(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a==="bigint"){if(B(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(o.length===0);else if(o.length===1){let a=o[0];if(n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0")n.enum=[a];else n.const=a}else{if(o.every((a)=>typeof a==="number"))n.type="number";if(o.every((a)=>typeof a==="string"))n.type="string";if(o.every((a)=>typeof a==="boolean"))n.type="boolean";if(o.every((a)=>a===null))n.type="null";n.enum=o}};var gu=(e,t,n,r)=>{B(e,t,n,r,"Custom types cannot be represented in JSON Schema")},vu=(e,t,n,r)=>{B(e,t,n,r,"Function types cannot be represented in JSON Schema")},_u=(e,t,n,r)=>{B(e,t,n,r,"Transforms cannot be represented in JSON Schema")};var bu=(e,t,n,r)=>{let i=n,o=e._zod.def,{minimum:a,maximum:s}=C(e);if(typeof a==="number")i.minItems=a;if(typeof s==="number")i.maxItems=s;i.type="array",i.items=x(o.element,t,{...r,path:[...r.path,"items"]})};function ve(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return ve(t.out);if(t.type==="catch")return ve(t.innerType);return e._zod.optin}var wu=(e,t,n,r)=>{let i=n,o=e._zod.def,a=o.shape;if(Object.getOwnPropertySymbols(a).length&&B(e,t,i,r,"Symbol keys cannot be represented in JSON Schema"))return;i.type="object",i.properties={};for(let u in a)V(i.properties,u,x(a[u],t,{...r,path:[...r.path,"properties",u]}));let s=[];for(let u of Object.keys(a)){let l=o.shape[u];if(t.io==="input"?ve(l)===void 0:l._zod.optout===void 0)s.push(u)}if(s.length>0)i.required=s;if(o.catchall?._zod.def.type==="never")i.additionalProperties=!1;else if(!o.catchall){if(t.io==="output")i.additionalProperties=!1}else if(o.catchall)i.additionalProperties=x(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})},zu=(e,t,n,r)=>{let i=e._zod.def,o=i.inclusive===!1,a=i.options.map((s,u)=>x(s,t,{...r,path:[...r.path,o?"oneOf":"anyOf",u]}));if(o)n.oneOf=a;else n.anyOf=a},ku=(e,t,n,r)=>{let i=e._zod.def,o=x(i.left,t,{...r,path:[...r.path,"allOf",0]}),a=x(i.right,t,{...r,path:[...r.path,"allOf",1]}),s=(l)=>("allOf"in l)&&Object.keys(l).length===1,u=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];n.allOf=u,t.intersections.push(u)},Su=(e,t,n,r)=>{let i=n,o=e._zod.def;i.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((y,b)=>x(y,t,{...r,path:[...r.path,a,b]})),l=o.rest?x(o.rest,t,{...r,path:[...r.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,c=o.items.length;while(c>0){let y=o.items[c-1];if(!(t.io==="input"?ve(y)!==void 0:y._zod.optout==="optional"))break;c--}let p=o.items.length,d=!o.rest;if(t.target==="draft-2020-12"){if(i.prefixItems=u,d)i.items=!1;else if(l)i.items=l;if(c>0)i.minItems=c;if(d)i.maxItems=p}else if(t.target==="openapi-3.0"){if(i.items={anyOf:u},l)i.items.anyOf.push(l);if(c>0)i.minItems=c;if(d)i.maxItems=p}else{if(i.items=u,d)i.additionalItems=!1;else if(l)i.additionalItems=l;if(c>0)i.minItems=c;if(d)i.maxItems=p}let{minimum:h,maximum:m}=C(e);if(typeof h==="number")i.minItems=h;if(typeof m==="number")i.maxItems=m};function lt(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let y=lt(e,m,n);return y===m?t:y}for(let m of["anyOf","oneOf"]){let y=t[m];if(!Array.isArray(y))continue;let b=y.map((_)=>lt(e,_,n));if(b.some((_,I)=>_!==y[I]))t={...t,[m]:b}}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes("string")&&r.some((m)=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!i&&!o?.some((m)=>typeof m==="number"))return t;let{minimum:a,maximum:s,exclusiveMinimum:u,exclusiveMaximum:l,multipleOf:c,format:p,id:d,...h}=t;if(h.enum)h.enum=h.enum.map((m)=>typeof m==="number"?String(m):m);else if(typeof h.const==="number")h.const=String(h.const);if(!i)return h;if(h.type="string",!o)h.pattern=(r.includes("number")?zt:Ao).source;return h}var ct=new WeakMap;function Ou(e){let t=new Map;for(let r of e.seen.values())if(r.def&&!t.has(r.schema))t.set(r.schema,r);let n=new Map;for(let r of ct.get(e)??[]){let i=e.seen.get(r),o=(i?.def??i?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let a=lt(t,o,new Set);if(a!==o)n.set(o,a)}if(!n.size)return;for(let r of e.seen.values())for(let i of[r.schema,r.def]){let o=i&&n.get(i.propertyNames);if(o)i.propertyNames=o}}var $u=(e,t,n,r)=>{let i=n,o=e._zod.def;i.type="object";let a=o.keyType,s=C(a).patterns;if(o.mode==="loose"&&s&&s.size>0){let c=x(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(let p of s)V(i.patternProperties,Ar(p).source,c)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){i.propertyNames=x(o.keyType,t,{...r,path:[...r.path,"propertyNames"]});let c=ct.get(t);if(!c)c=[],ct.set(t,c),t.deferred.push(()=>Ou(t));c.push(e)}i.additionalProperties=x(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let u=a._zod.values,l=t.io==="input"&&ve(o.valueType)!==void 0;if(u&&!o.partial&&!l){let c=[...u].filter((p)=>typeof p==="string"||typeof p==="number");if(c.length>0)i.required=c.map(String)}},Pu=(e,t,n,r)=>{let i=e._zod.def,o=x(i.innerType,t,r),a=t.seen.get(e);if(t.target==="openapi-3.0")a.ref=i.innerType,n.nullable=!0;else n.anyOf=[o,{type:"null"}]},xu=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType},$t=Symbol();function Er(e,t,n,r,i){let o=!1,a=JSON.stringify(e,(s,u)=>{if(typeof u!=="bigint")return u;return o=!0,null});if(!o)return JSON.parse(a);return B(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),$t}var Tu=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType;let a=Er(i.defaultValue,e,t,n,r);if(a!==$t)n.default=a},Au=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let o=t.seen.get(e);if(o.ref=i.innerType,t.io!=="input")return;let a=Er(i.defaultValue,e,t,n,r);if(a!==$t)n._prefault=a},Eu=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{B(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=a},Iu=(e,t,n,r)=>{let i=e._zod.def,o=i.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?o?i.out:i.in:i.out;x(a,t,r);let s=t.seen.get(e);s.ref=a},ju=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType,n.readOnly=!0},Nu=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType},Ir=(e,t,n,r)=>{let i=e._zod.def;x(i.innerType,t,r);let o=t.seen.get(e);o.ref=i.innerType};var vn=new WeakSet([Object.prototype,Error.prototype]);function Se(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var Zu=(e,t)=>{Ui.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);if(vn.has(n))return;vn.add(n),Se(n,"format",(r)=>(i)=>Bi(r,i)),Se(n,"flatten",(r)=>(i)=>Ji(r,i)),Se(n,"addIssue",(r)=>(i)=>{r.issues.push(i),r.message=JSON.stringify(r.issues,rt,2)}),Se(n,"addIssues",(r)=>(i)=>{r.issues.push(...i),r.message=JSON.stringify(r.issues,rt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})},L=f("ZodError",Zu,void 0,{Parent:Error}),Cu=Re(L),Mu=De(L),Fu=bt(L),Ru=wt(L),Du=Xi(L),Uu=Gi(L),Lu=Yi(L),Ju=Qi(L),Bu=eo(L),Ku=to(L),Hu=no(L),Wu=ro(L);function Vu(){if(!U.localeError)H(us())}function _e(){if(!U.memoizer)H({memoizer:os()})}var S=f("ZodType",(e,t)=>(Vu(),k.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(R(t,{checks:[...t.checks??[],...e.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return te(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Jl(e,t))},superRefine(e,t){return this.check(Bl(e,t))},overwrite(e){return this.check(le(e))},optional(){return zn(this)},exactOptional(){return El(this)},nullable(){return kn(this)},nullish(){return zn(kn(this))},nonoptional(e){return Ml(this,e)},array(){return D(this)},or(e){return Cr([this,e])},and(e){return $l(this,e)},transform(e){return Sn(this,Al(e))},default(e){return Nl(this,e)},prefault(e){return Cl(this,e)},catch(e){return Rl(this,e)},pipe(e){return Sn(this,e)},readonly(){return Ul(this)},describe(e){let t=this.clone();return pe.add(t,{description:e}),t},meta(...e){if(e.length===0)return pe.get(this);let t=this.clone();return pe.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Hn(this,"~standard",{...tr(this),jsonSchema:{input:Ze(this,"input"),output:Ze(this,"output")}})},set "~standard"(e){ee(this,"~standard",e)},parse:function e(t,n){return Cu(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Mu(this,t,n,{callee:e})},safeParse(e,t){return Fu(this,e,t)},async safeParseAsync(e,t){return Ru(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ee(this,"spa",e)},validate(e,t){return Wi(this,e,t)},validateAsync(e,t){return qi(this,e,t)},encode:function e(t,n){return Du(this,t,n,{callee:e})},decode:function e(t,n){return Uu(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Lu(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Ju(this,t,n,{callee:e})},safeEncode(e,t){return Bu(this,e,t)},safeDecode(e,t){return Ku(this,e,t)},async safeEncodeAsync(e,t){return Hu(this,e,t)},async safeDecodeAsync(e,t){return Wu(this,e,t)},toJSONSchema(e){return iu(this,{})(e)},get description(){return pe.get(this)?.description},get _def(){return this._zod.def}}),jr=f("_ZodString",(e,t)=>{St.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uu(e,n,r,i)},vt({format:(e)=>C(e).format??null,minLength:(e)=>C(e).minimum??null,maxLength:(e)=>C(e).maximum??null},{regex(...e){return this.check(Ls(...e))},includes(...e){return this.check(Ks(...e))},startsWith(...e){return this.check(Hs(...e))},endsWith(...e){return this.check(Ws(...e))},min(...e){return this.check(Ne(...e))},max(...e){return this.check(_r(...e))},length(...e){return this.check(br(...e))},nonempty(...e){return this.check(Ne(1,...e))},lowercase(e){return this.check(Js(e))},uppercase(e){return this.check(Bs(e))},trim(){return this.check(qs())},normalize(...e){return this.check(Vs(...e))},toLowerCase(){return this.check(Xs())},toUpperCase(){return this.check(Gs())},slugify(){return this.check(Ys())}})),qu=f("ZodString",(e,t)=>{St.init(e,t),jr.init(e,t)},{email(e){return this.check(fs(el,e))},url(e){return this.check(gs(nl,e))},jwt(e){return this.check(Is(gl,e))},emoji(e){return this.check(vs(rl,e))},guid(e){return this.check(ds(tl,e))},uuid(e){return this.check(ps(Oe,e))},uuidv4(e){return this.check(hs(Oe,e))},uuidv6(e){return this.check(ms(Oe,e))},uuidv7(e){return this.check(ys(Oe,e))},nanoid(e){return this.check(_s(il,e))},cuid(e){return this.check(bs(ol,e))},cuid2(e){return this.check(ws(al,e))},ulid(e){return this.check(zs(sl,e))},base64(e){return this.check(Ts(hl,e))},base64url(e){return this.check(As(ml,e))},xid(e){return this.check(ks(ul,e))},ksuid(e){return this.check(Ss(ll,e))},ipv4(e){return this.check(Os(cl,e))},ipv6(e){return this.check($s(fl,e))},cidrv4(e){return this.check(Ps(dl,e))},cidrv6(e){return this.check(xs(pl,e))},e164(e){return this.check(Es(yl,e))},datetime(e){return this.check(js(Xu,e))},date(e){return this.check(Ns(Gu,e))},time(e){return this.check(Zs(Yu,e))},duration(e){return this.check(Cs(Qu,e))}});function v(e){return cs(qu,e)}var T=f("ZodStringFormat",(e,t)=>{P.init(e,t),jr.init(e,t)}),Xu=f("ZodISODateTime",(e,t)=>{ca.init(e,t),T.init(e,t)}),Gu=f("ZodISODate",(e,t)=>{fa.init(e,t),T.init(e,t)}),Yu=f("ZodISOTime",(e,t)=>{da.init(e,t),T.init(e,t)}),Qu=f("ZodISODuration",(e,t)=>{pa.init(e,t),T.init(e,t)}),el=f("ZodEmail",(e,t)=>{Xo.init(e,t),T.init(e,t)}),tl=f("ZodGUID",(e,t)=>{Vo.init(e,t),T.init(e,t)}),Oe=f("ZodUUID",(e,t)=>{qo.init(e,t),T.init(e,t)}),nl=f("ZodURL",(e,t)=>{na.init(e,t),T.init(e,t)}),rl=f("ZodEmoji",(e,t)=>{ra.init(e,t),T.init(e,t)}),il=f("ZodNanoID",(e,t)=>{ia.init(e,t),T.init(e,t)}),ol=f("ZodCUID",(e,t)=>{oa.init(e,t),T.init(e,t)}),al=f("ZodCUID2",(e,t)=>{aa.init(e,t),T.init(e,t)}),sl=f("ZodULID",(e,t)=>{sa.init(e,t),T.init(e,t)}),ul=f("ZodXID",(e,t)=>{ua.init(e,t),T.init(e,t)}),ll=f("ZodKSUID",(e,t)=>{la.init(e,t),T.init(e,t)}),cl=f("ZodIPv4",(e,t)=>{ha.init(e,t),T.init(e,t)}),fl=f("ZodIPv6",(e,t)=>{ya.init(e,t),T.init(e,t)}),dl=f("ZodCIDRv4",(e,t)=>{ga.init(e,t),T.init(e,t)}),pl=f("ZodCIDRv6",(e,t)=>{_a.init(e,t),T.init(e,t)}),hl=f("ZodBase64",(e,t)=>{ba.init(e,t),T.init(e,t)}),ml=f("ZodBase64URL",(e,t)=>{za.init(e,t),T.init(e,t)}),yl=f("ZodE164",(e,t)=>{ka.init(e,t),T.init(e,t)}),gl=f("ZodJWT",(e,t)=>{Oa.init(e,t),T.init(e,t)}),Nr=f("ZodNumber",(e,t)=>{sr.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lu(e,n,r,i),e.isFinite=!0},vt({minValue:(e)=>{let{minimum:t,exclusiveMinimum:n}=C(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:n}=C(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:n}=C(e);return!!t||!!n?.some(Number.isSafeInteger)},format:(e)=>C(e).format??null},{gt(e,t){return this.check(ln(e,t))},gte(e,t){return this.check(Te(e,t))},min(e,t){return this.check(Te(e,t))},lt(e,t){return this.check(un(e,t))},lte(e,t){return this.check(xe(e,t))},max(e,t){return this.check(xe(e,t))},int(e){return this.check(_n(e))},safe(e){return this.check(_n(e))},positive(e){return this.check(ln(0,e))},nonnegative(e){return this.check(Te(0,e))},negative(e){return this.check(un(0,e))},nonpositive(e){return this.check(xe(0,e))},multipleOf(e,t){return this.check(cn(e,t))},step(e,t){return this.check(cn(e,t))},finite(){return this}}));function Z(e){return Ms(Nr,e)}var vl=f("ZodNumberFormat",(e,t)=>{$a.init(e,t),Nr.init(e,t)});function _n(e){return Fs(vl,e)}var _l=f("ZodBoolean",(e,t)=>{Pa.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cu(e,n,r,i)});function j(e){return Rs(_l,e)}var bl=f("ZodUnknown",(e,t)=>{xa.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pu(e,n,r,i)});function bn(){return Ds(bl)}var wl=f("ZodNever",(e,t)=>{Ta.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>du(e,n,r,i)});function zl(e){return Us(wl,e)}var wc=f("ZodVoid",(e,t)=>{Aa.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fu(e,n,r,i)});var zc=f("ZodDate",(e,t)=>{Ea.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hu(e,n,r,i),e.min=(n,r)=>e.check(Te(n,r)),e.max=(n,r)=>e.check(xe(n,r))},vt({minDate:(e)=>{let{minimum:t}=C(e);return t?new Date(t):null},maxDate:(e)=>{let{maximum:t}=C(e);return t?new Date(t):null}},{}));var kl=f("ZodArray",(e,t)=>{_e(),Na.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bu(e,n,r,i),e.element=t.element},{min(e,t){return this.check(Ne(e,t))},nonempty(e){return this.check(Ne(1,e))},max(e,t){return this.check(_r(e,t))},length(e,t){return this.check(br(e,t))},unwrap(){return this.element}});function D(e,t){return Qs(kl,e,t)}var Sl=f("ZodObject",(e,t)=>{_e(),Ma.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wu(e,n,r,i),Ni(e,"shape",(n)=>n._zod.def.shape,!1)},{keyof(){return Pl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(R(this._zod.def,{catchall:e}))},passthrough(){return this.clone(R(this._zod.def,{catchall:bn()}))},loose(){return this.clone(R(this._zod.def,{catchall:bn()}))},strict(){return this.clone(R(this._zod.def,{catchall:zl()}))},strip(){return this.clone(R(this._zod.def,{catchall:void 0}))},extend(e){return ki(this,e)},safeExtend(e){return Si(this,e)},merge(e){return Oi(this,e)},pick(e){return wi(this,e)},omit(e){return zi(this,e)},partial(...e){return Ft(Pt,this,e[0])},exactPartial(...e){return Ft(Mr,this,e[0],"exactPartial")},required(...e){return $i(Fr,this,e[0])}});function E(e,t){let n={type:"object",shape:e??{},...g(t)};return new Sl(n)}var Zr=f("ZodUnion",(e,t)=>{cr.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zu(e,n,r,i),e.options=t.options});function Cr(e,t){return new Zr({type:"union",options:e,...g(t)})}var kc=f("ZodDiscriminatedUnion",(e,t)=>{Zr.init(e,t),Ra.init(e,t)});var Ol=f("ZodIntersection",(e,t)=>{Da.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ku(e,n,r,i)});function $l(e,t){return new Ol({type:"intersection",left:e,right:t})}var Sc=f("ZodTuple",(e,t)=>{_e(),fr.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Su(e,n,r,i)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map((t)=>new Pt({type:"optional",innerType:t}))})}});var wn=f("ZodRecord",(e,t)=>{_e(),Ua.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$u(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function ie(e,t,n){if(!t||!t._zod)return new wn({type:"record",keyType:v(),valueType:e,...g(t)});return new wn({type:"record",keyType:e,valueType:t,...g(n)})}var ft=f("ZodEnum",(e,t)=>{La.init(e,t),S.init(e,t),e._zod.processJSONSchema=(r,i,o)=>mu(e,r,i,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{let o={};for(let a of r)if(n.has(a))o[a]=t.entries[a];else throw Error(`Key ${a} not found in enum`);return new ft({...t,checks:[],...g(i),entries:o})},e.exclude=(r,i)=>{let o={...t.entries};for(let a of r)if(n.has(a))delete o[a];else throw Error(`Key ${a} not found in enum`);return new ft({...t,checks:[],...g(i),entries:o})}});function Pl(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map((r)=>[r,r])):e;return new ft({type:"enum",entries:n,...g(t)})}var xl=f("ZodLiteral",(e,t)=>{Ja.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yu(e,n,r,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ye(e,t){return new xl({type:"literal",values:Array.isArray(e)?e:[e],...g(t)})}var Tl=f("ZodTransform",(e,t)=>{_e(),Ba.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_u(e,n,r,i),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new _t(e.constructor.name);n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(ge(o,n.value,t));else{let a=o;if(a.fatal)a.continue=!1;if(a.code??(a.code="custom"),!("input"in a))a.input=n.value;a.inst??(a.inst=e),n.issues.push(ge(a))}};let i=t.transform(n.value,n);if(i instanceof Promise)return i.then((o)=>(n.value=o,n));return n.value=i,n}});function Al(e){return new Tl({type:"transform",transform:e})}var Pt=f("ZodOptional",(e,t)=>{dr.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ir(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function zn(e){return new Pt({type:"optional",innerType:e})}var Mr=f("ZodExactOptional",(e,t)=>{Ka.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ir(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function El(e){return new Mr({type:"optional",innerType:e})}var Il=f("ZodNullable",(e,t)=>{Ha.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Pu(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function kn(e){return new Il({type:"nullable",innerType:e})}var jl=f("ZodDefault",(e,t)=>{Wa.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Tu(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Nl(e,t){return new jl({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Ln(t)}})}var Zl=f("ZodPrefault",(e,t)=>{Va.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Au(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Cl(e,t){return new Zl({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Ln(t)}})}var Fr=f("ZodNonOptional",(e,t)=>{qa.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xu(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Ml(e,t){return new Fr({type:"nonoptional",innerType:e,...g(t)})}var Fl=f("ZodCatch",(e,t)=>{Xa.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Eu(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rl(e,t){return new Fl({type:"catch",innerType:e,catchValue:typeof t==="function"?t:Ci(t)})}var Rr=f("ZodPipe",(e,t)=>{pr.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Iu(e,n,r,i),e.in=t.in,e.out=t.out});function Sn(e,t){return new Rr({type:"pipe",in:e,out:t})}var Oc=f("ZodPreprocess",(e,t)=>{Rr.init(e,t),Ga.init(e,t)}),Dl=f("ZodReadonly",(e,t)=>{Ya.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ju(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Ul(e){return new Dl({type:"readonly",innerType:e})}var $c=f("ZodPromise",(e,t)=>{es.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Nu(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});var Pc=f("ZodFunction",(e,t)=>{Qa.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vu(e,n,r,i)});var Ll=f("ZodCustom",(e,t)=>{ts.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gu(e,n,r,i)});function Jl(e,t={}){return eu(Ll,e,t)}function Bl(e,t){return tu(e,t)}var Kl=E({id:v(),temperature:Z().optional(),maxTokens:Z().optional(),contextWindow:Z().optional(),inputPrice:Z().optional(),outputPrice:Z().optional(),supportsImages:j().optional()}),Hl=E({models:D(Kl).optional(),openAiBaseUrl:v().optional(),openAiHeaders:ie(v(),v()).optional(),azureApiVersion:v().optional(),azureIdentity:j().optional()}),Wl=E({id:v(),thinkingBudgetTokens:Z().optional()}),Vl=E({name:v(),baseModelId:v(),thinkingBudgetTokens:Z().optional()}),ql=E({models:D(Wl).optional(),customModels:D(Vl).optional(),awsRegion:v().optional(),awsUseCrossRegionInference:j().optional(),awsUseGlobalInference:j().optional(),awsBedrockUsePromptCache:j().optional(),awsBedrockEndpoint:v().optional()}),Xl=E({id:v()}),Gl=E({models:D(Xl).optional()}),Yl=E({id:v(),thinkingBudgetTokens:Z().optional()}),Ql=E({models:D(Yl).optional(),vertexProjectId:v().optional(),vertexRegion:v().optional()}),ec=E({id:v(),thinkingBudgetTokens:Z().optional(),promptCachingEnabled:j().optional()}),tc=E({models:D(ec).optional(),baseUrl:v().optional()}),nc=E({id:v(),thinkingBudgetTokens:Z().optional()}),rc=E({models:D(nc).optional(),baseUrl:v().optional()}),ic=E({OpenAiCompatible:Hl.optional(),AwsBedrock:ql.optional(),Cline:Gl.optional(),Vertex:Ql.optional(),LiteLLM:tc.optional(),Anthropic:rc.optional()}),oc=E({id:v()}),ac=E({name:v(),url:v(),alwaysEnabled:j().optional(),headers:ie(v(),v()).optional()}),On=E({alwaysEnabled:j(),name:v(),contents:v()}),Qe=E({bucket:v(),accessKeyId:v(),secretAccessKey:v(),region:v().optional(),endpoint:v().optional(),accountId:v().optional()}),sc=E({enabled:j().optional(),type:Cr([Ye("s3_access_keys"),Ye("r2_access_keys"),Ye("azure_access_keys")]).optional(),s3AccessSettings:Qe.optional(),r2AccessSettings:Qe.optional(),azureAccessSettings:Qe.optional()}),uc=E({promptUploading:sc.optional()}),xc=E({version:v(),providerSettings:ic.optional(),telemetryEnabled:j().optional(),kanbanEnabled:j().optional(),mcpMarketplaceEnabled:j().optional(),allowedMCPServers:D(oc).optional(),remoteMCPServers:D(ac).optional(),blockPersonalRemoteMCPServers:j().optional(),yoloModeAllowed:j().optional(),openTelemetryEnabled:j().optional(),openTelemetryMetricsExporter:v().optional(),openTelemetryLogsExporter:v().optional(),openTelemetryOtlpProtocol:v().optional(),openTelemetryOtlpEndpoint:v().optional(),openTelemetryOtlpHeaders:ie(v(),v()).optional(),openTelemetryOtlpMetricsProtocol:v().optional(),openTelemetryOtlpMetricsEndpoint:v().optional(),openTelemetryOtlpMetricsHeaders:ie(v(),v()).optional(),openTelemetryOtlpLogsProtocol:v().optional(),openTelemetryOtlpLogsEndpoint:v().optional(),openTelemetryOtlpLogsHeaders:ie(v(),v()).optional(),openTelemetryMetricExportInterval:Z().optional(),openTelemetryOtlpInsecure:j().optional(),openTelemetryLogBatchSize:Z().optional(),openTelemetryLogBatchTimeout:Z().optional(),openTelemetryLogMaxQueueSize:Z().optional(),enterpriseTelemetry:uc.optional(),globalRules:D(On).optional(),globalWorkflows:D(On).optional()}),Tc=ie(v(),v());export{Tc as APIKeySchema,oc as AllowedMCPServerSchema,nc as AnthropicModelSchema,rc as AnthropicSchema,Vl as AwsBedrockCustomModelSchema,Wl as AwsBedrockModelSchema,ql as AwsBedrockSettingsSchema,Xl as ClineModelSchema,Gl as ClineSettingsSchema,ai as DEFAULT_REMOTE_CONFIG_PLUGIN_NAME,Nn as DefaultRemoteConfigTelemetryAdapter,uc as EnterpriseTelemetrySchema,$n as FileRemoteConfigBundleStore,dt as FileSystemRemoteConfigManagedArtifactStore,En as FileSystemRemoteConfigPolicyMaterializer,On as GlobalInstructionsFileSchema,ec as LiteLLMModelSchema,tc as LiteLLMSchema,Kl as OpenAiCompatibleModelSchema,Hl as OpenAiCompatibleSchema,sc as PromptUploadingSchema,Vr as REMOTE_CONFIG_SESSION_BLOB_UPLOAD_METADATA_KEY,gc as REMOTE_URI_SCHEME,xc as RemoteConfigSchema,Mn as RemoteConfigSyncService,ac as RemoteMCPServerSchema,Qe as S3AccessKeySettingsSchema,Yl as VertexModelSchema,Ql as VertexSettingsSchema,pc as buildRemoteConfigSessionBlobUploadMetadata,_c as clearMaterializedRemoteConfigRuntime,mc as clearRemoteConfigSessionBlobUpload,ei as createRemoteConfigBlobStorageAdapter,fi as createRemoteConfigPluginDefinition,yc as createRemoteConfigSessionMessagesArtifactUploader,si as getRemoteConfigCommandDirectories,li as normalizeBundleTelemetry,bc as prepareRemoteConfigRuntime,ti as readRemoteConfigSessionBlobUploadMetadata,hc as registerRemoteConfigSessionBlobUpload,Nt as remoteConfigInstructionToManagedFile,qr as resolveBlobStoreSettingsFromPromptUploading,Tn as resolveBlobStoreSettingsFromRemoteConfig,ui as resolveOpenTelemetryConfigFromRemoteConfig,In as resolveRemoteConfigPaths,ci as withRemoteConfigBundlePaths};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{existsSync as E,readdirSync as X}from"node:fs";import{basename as H,dirname as W,join as j}from"node:path";import{appendFileSync as ie,existsSync as a,mkdirSync as O,readdirSync as oe,readFileSync as x,statSync as v}from"node:fs";import{homedir as ue}from"node:os";import{basename as ae,dirname as S,extname as le,isAbsolute as ce,join as t,relative as fe,resolve as f}from"node:path";var ee=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g,re=" ";function w(e){return e.normalize("NFC").replace(ee," ")}function te(e){let r=H(e),n=r.replace(/ (AM|PM)\./gi,`${re}$1.`);return n===r?e:j(W(e),n)}function ne(e){return e.normalize("NFD")}function G(e){return e.replace(/'/g,"’")}function se(e){let r=W(e),n=w(H(e));try{for(let i of X(r))if(w(i)===n)return j(r,i)}catch{}return}function je(e){if(E(e))return e;let r=te(e);if(r!==e&&E(r))return r;let n=ne(e);if(n!==e&&E(n))return n;let i=G(e);if(i!==e&&E(i))return i;let s=G(n);if(s!==n&&s!==i&&E(s))return s;return se(e)}var pe="workspaces",me="chat";function Be(e){let r=e.trim(),n=/^[A-Za-z]:[\\/]/.test(r)||r.startsWith("\\\\"),i=r.startsWith("/");if(!n&&!i)return!1;let s=r.split(n?/[\\/]+/:/\/+/).filter(Boolean),o=s.at(-1)??"",u=s.at(-2)??"",p=s.at(-3)??"";return(s.at(-4)??"")===".cline"&&p==="data"&&u==="workspaces"&&o==="chat"}var k=".clinerules",g=".cline",_e=".claude",N=".agents",ve=N,Y="agents",A="hooks",T="skills",B="rules",I="workflows",R="plugins",K="AGENTS.md",Ce="plugin.json";function Ke(){return t(c(),pe,me)}var Ee="cline_mcp_settings.json",he="settings.json";function De(){let e=process?.env?.HOME?.trim();if(e&&e!=="~")return e;let r=process?.env?.USERPROFILE?.trim();if(r)return r;let n=process?.env?.HOMEDRIVE?.trim(),i=process?.env?.HOMEPATH?.trim();if(n&&i)return`${n}${i}`;let s=ue().trim();if(s&&s!=="~")return s;return"~"}var m=De(),U=!1;function Ue(e){let r=e.trim();if(!r)return;m=r,U=!0}function ze(e){if(U)return;let r=e.trim();if(!r)return;m=r}var h,z=!1;function Ze(e){let r=e.trim();if(!r)return;h=r,z=!0}function qe(e){if(z)return;let r=e.trim();if(!r)return;h=r}function l(){if(h)return h;let e=process.env.CLINE_DIR?.trim();if(e)return e;return t(m,".cline")}function Se(){return t(m,"Documents","Cline")}function P(e){return t(Se(),e)}function c(){let e=process.env.CLINE_DATA_DIR?.trim();if(e)return e;return t(l(),"data")}function Je(){let e=process.env.CLINE_SESSION_DATA_DIR?.trim();if(e)return e;return t(c(),"sessions")}function Ve(){let e=process.env.CLINE_TEAM_DATA_DIR?.trim();if(e)return e;return t(c(),"teams")}function ge(){let e=process.env.CLINE_CONNECTOR_DATA_DIR?.trim();if(e)return e;return t(c(),"connectors")}function Qe(e,r){let n=e.replace(/[^a-zA-Z0-9._-]+/g,"_"),i=r.replace(/[^a-zA-Z0-9._-]+/g,"_");return t(c(),"logs","connectors",n,`${i}.log`)}function Xe(){let e=process.env.CLINE_CONNECTOR_SETTINGS_PATH?.trim();if(e)return e;return t(ge(),he)}function L(){let e=process.env.CLINE_DB_DATA_DIR?.trim();if(e)return e;return t(c(),"db")}function er(){let e=process.env.CLINE_CONNECTORS_DB_PATH?.trim();if(e)return e;return t(L(),"connectors.db")}function rr(){let e=process.env.CLINE_CRON_DB_PATH?.trim();if(e)return e;return t(L(),"cron.db")}function tr(){let e=process.env.CLINE_TASKS_DB_PATH?.trim();if(e)return e;return t(L(),"tasks.db")}function nr(){return t(l(),"schedules")}function Ne(){return t(l(),"tasks")}function Pe(e){let r=e.trim();if(!r)throw Error("workspaceRoot is required for workspace task scope");return t(r,".cline","tasks")}function sr(e){let r=e.taskSpecsDir?.trim();if(r)return r;if(e.scope==="workspace")return Pe(e.workspaceRoot??"");return Ne()}function Ae(){return t(l(),"cron")}function b(e){return t(e,".cline","cron")}function Z(e){if(typeof e==="string")return b(e);if(e?.cronSpecsDir?.trim())return e.cronSpecsDir.trim();if(e?.scope==="workspace"){let r=e.workspaceRoot?.trim();if(!r)throw Error("workspaceRoot is required for workspace cron scope");return b(r)}return Ae()}function ir(e){return t(Z(e),"reports")}function or(e){return t(Z(e),"events")}function ur(){let e=process.env.CLINE_PROVIDER_SETTINGS_PATH?.trim();if(e)return e;return t(c(),"settings","providers.json")}function ar(){let e=process.env.CLINE_GLOBAL_SETTINGS_PATH?.trim();if(e)return e;return t(c(),"settings","global-settings.json")}function lr(){let e=process.env.CLINE_MCP_SETTINGS_PATH?.trim();if(e)return e;return t(c(),"settings",Ee)}function _(e){let r=new Set,n=[];for(let i of e){if(!i||r.has(i))continue;r.add(i),n.push(i)}return n}function Ie(e){if(!e)return[];return[k,g,_e,N].map((r)=>t(e,r,T))}function Te(){return t(l(),Y)}function cr(e){return _([e?t(e,g,Y):"",Te()])}function fr(e){let r=[P("Hooks"),t(l(),A)];if(e)r.push(t(e,k,A),t(e,g,A));return _(r)}function pr(e){return _([...Ie(e),t(l(),T),t(m,N,T)])}function Re(){return t(m,N,K)}function de(e){return[t(e,k),t(e,g,B)]}function Oe(){let e=[];for(let r of["OneDrive","OneDriveConsumer","OneDriveCommercial"]){let n=process.env[r]?.trim();if(n)e.push(t(n,"Documents"))}return e}function ke(){return _([t(l(),B),t(m,"Cline","Rules"),P("Rules"),...Oe().map((e)=>t(e,"Cline","Rules"))])}function mr(e){let r=e?de(e):[],n=e?[t(e,K)]:[];return _([...n,...r,Re(),...ke()])}function _r(e){return _([e?t(e,".clinerules",I):"",P("Workflows"),t(l(),I),e?t(e,".cline",I):""])}function vr(e){return _([e?t(e,".cline",R):"",t(l(),R),P("Plugins")])}function Cr(){return[t(m,ve,R)]}var q=new Set([".js",".ts"]),F="package.json",Le=["index.ts","index.js"],Fe=new Set(["node_modules"]);function d(e){try{return v(t(e,Ce)).isFile()}catch{return!1}}function D(e){let r=e.lastIndexOf(".");if(r===-1)return!1;return q.has(e.slice(r))}function J(e){try{let r=JSON.parse(x(e,"utf8"));if(!r.cline||typeof r.cline!=="object")return null;return r.cline}catch{return null}}function V(e){let r=e?.plugins;if(!Array.isArray(r))return[];return r.flatMap((n)=>n.paths??[])}function Me(e){let r=f(e);if(!a(r)||!v(r).isDirectory())return null;if(d(r))return null;let n=t(r,F);if(a(n)){let i=J(n),s=V(i).map((o)=>f(r,o)).filter((o)=>a(o)&&v(o).isFile()&&D(o));if(s.length>0)return s}for(let i of Le){let s=t(r,i);if(a(s)&&v(s).isFile())return[s]}return null}function ye(e){try{let r=JSON.parse(x(e,"utf8"));return typeof r.name==="string"&&r.name.trim()?r.name.trim():void 0}catch{return}}function we(e,r){let n=fe(f(e),f(r));return n===""||!n.startsWith("..")&&!ce(n)}function Er(e,r){let n=S(e),i=f(r);while(we(i,n)){let s=t(n,F);if(a(s)){let u=ye(s);if(u)return u;break}let o=f(n,"..");if(o===n)break;n=o}return ae(e,le(e))}function Ge(e){let r=f(e);if(!a(r))return[];if(d(r))return[];let n=[],i=[r];while(i.length>0){let s=i.pop();if(!s)continue;let o;try{o=oe(s,{withFileTypes:!0})}catch{continue}for(let u of o){let p=t(s,u.name);if(u.isDirectory()){if(d(p))continue;if(Fe.has(u.name)||u.name.startsWith("."))continue;let M=t(p,F);if(a(M)){let Q=J(M),y=V(Q).map((C)=>f(p,C)).filter((C)=>a(C)&&v(C).isFile()&&D(C));if(y.length>0){n.push(...y);continue}}i.push(p);continue}if(u.name.startsWith("."))continue;if(u.isFile()&&D(p))n.push(p)}}return n.sort((s,o)=>s.localeCompare(o))}function hr(e,r){let n=[];for(let i of e){let s=i.trim();if(!s)continue;let o=f(r,s);if(!a(o))throw Error(`Plugin path does not exist: ${o}`);if(v(o).isDirectory()){let u=Me(o);if(u){n.push(...u);continue}n.push(...Ge(o));continue}if(!D(o))throw Error(`Plugin file must use a supported extension (${[...q].join(", ")}): ${o}`);n.push(o)}return n}function be(e){let r=S(e);if(!a(r))O(r,{recursive:!0})}function Dr(e){O(S(e),{recursive:!0}),ie(e,"")}function Sr(e){if(e?.trim())return be(e),S(e);let r=t(c(),"logs");if(!a(r))O(r,{recursive:!0});return r}export{K as AGENTS_RULES_FILE_NAME,Y as AGENT_CONFIG_DIRECTORY_NAME,Ce as AGENT_PLUGIN_MANIFEST_FILE_NAME,me as CLINE_CHAT_WORKSPACE_DIRECTORY_NAME,he as CLINE_CONNECTOR_SETTINGS_FILE_NAME,Ee as CLINE_MCP_SETTINGS_FILE_NAME,pe as CLINE_WORKSPACES_DIRECTORY_NAME,A as HOOKS_CONFIG_DIRECTORY_NAME,B as RULES_CONFIG_DIRECTORY_NAME,T as SKILLS_CONFIG_DIRECTORY_NAME,I as WORKFLOWS_CONFIG_DIRECTORY_NAME,Ge as discoverPluginModulePaths,Dr as ensureFileExists,Sr as ensureHookLogDir,be as ensureParentDir,Er as getPluginDisplayName,d as isAgentPluginDirectory,Be as isChatWorkspacePath,D as isPluginModulePath,cr as resolveAgentConfigSearchPaths,Cr as resolveAgentPluginSearchPaths,nr as resolveAgentSchedulesDir,Te as resolveAgentsConfigDirPath,Ke as resolveChatWorkspacePath,c as resolveClineDataDir,l as resolveClineDir,hr as resolveConfiguredPluginModulePaths,ge as resolveConnectorDataDir,Qe as resolveConnectorLogPath,Xe as resolveConnectorSettingsPath,er as resolveConnectorsDbPath,rr as resolveCronDbPath,or as resolveCronEventsDir,ir as resolveCronReportsDir,Z as resolveCronSpecsDir,L as resolveDbDataDir,Se as resolveDocumentsClineDirectoryPath,P as resolveDocumentsExtensionPath,je as resolveExistingFilePath,Re as resolveGlobalAgentsRulesPath,Ae as resolveGlobalCronSpecsDir,ke as resolveGlobalRulesConfigPaths,ar as resolveGlobalSettingsPath,Ne as resolveGlobalTaskSpecsDir,fr as resolveHooksConfigSearchPaths,lr as resolveMcpSettingsPath,vr as resolvePluginConfigSearchPaths,Me as resolvePluginModuleEntries,ur as resolveProviderSettingsPath,mr as resolveRulesConfigSearchPaths,Je as resolveSessionDataDir,pr as resolveSkillsConfigSearchPaths,sr as resolveTaskSpecsDir,tr as resolveTasksDbPath,Ve as resolveTeamDataDir,_r as resolveWorkflowsConfigSearchPaths,b as resolveWorkspaceCronSpecsDir,de as resolveWorkspaceRulesConfigPaths,Pe as resolveWorkspaceTaskSpecsDir,Ze as setClineDir,qe as setClineDirIfUnset,Ue as setHomeDir,ze as setHomeDirIfUnset};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=["401","403","unauthorized","forbidden","invalid token","expired token","authentication"];function o(e){let r=(e instanceof Error?e.message:String(e)).toLowerCase();return i.some((t)=>r.includes(t))}export{i as AUTH_ERROR_PATTERNS,o as isLikelyAuthError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@cline/shared","version":"0.2.0","type":"module","exports":{".":"./dist/index.js","./browser":"./dist/index.browser.js","./types":"./dist/types/index.js","./storage":"./dist/storage/index.js","./db":"./dist/db/index.js","./node":"./dist/node.js","./automation":"./dist/automation/index.js","./remote-config":"./dist/remote-config/index.js"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@cline/plugin-runtime","private":true,"type":"module"}
|