@reason-machines/cli-linux-arm64-musl 0.2.317 → 0.2.320
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/bin/ara +1 -1
- package/bin/vm-hands/{connect-cli-tmegy1zz.js → connect-cli-xnzjcb3e.js} +1 -1
- package/bin/vm-hands/{custom-endpoint-device-wzq9x8k5.js → custom-endpoint-device-j47avpaq.js} +1 -1
- package/bin/vm-hands/{desktop-account-e9asw4vf.js → desktop-account-emwzhj61.js} +1 -1
- package/bin/vm-hands/{device-workspace-1dm2ry6e.js → device-workspace-xnyb7zp2.js} +1 -1
- package/bin/vm-hands/{hands-worker-source-snbsr08g.js → hands-worker-source-ws7x23xe.js} +1 -1
- package/bin/vm-hands/{index-p6kg955p.js → index-752q9pdp.js} +367 -367
- package/bin/vm-hands/{local-automation-wxx64z00.js → local-automation-6bxsfea4.js} +1 -1
- package/bin/vm-hands/{local-capabilities-nx9mgygs.js → local-capabilities-cen359s5.js} +1 -1
- package/bin/vm-hands/{local-desktop-users-j09q8cnt.js → local-desktop-users-rn753h90.js} +1 -1
- package/bin/vm-hands/{local-display-mac-mjjems8c.js → local-display-mac-9qqvjs82.js} +1 -1
- package/bin/vm-hands/{local-display-session-r9n0cnf2.js → local-display-session-vhe31z68.js} +1 -1
- package/bin/vm-hands/{network-contract-kxgvk10y.js → network-contract-bv7mj5he.js} +1 -1
- package/bin/vm-hands/package-xeh4dp97.js +2 -0
- package/bin/vm-hands/{permissions-zjrdww61.js → permissions-5hh1663f.js} +1 -1
- package/bin/vm-hands/{reason-hands-protocol-7t7mewye.js → reason-hands-protocol-5zt3ys5t.js} +1 -1
- package/bin/vm-hands/{status-5ardrey9.js → status-aej4363b.js} +2 -2
- package/bin/vm-hands/{version-6qnegds2.js → version-yds2dewc.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-vreqarwc.js → vm-hands-entry-lite-2ym8pc3f.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-37h9vzhv.js → vm-hands-entry-lite-617f66dj.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-5a34n6sz.js → vm-hands-entry-lite-6fvcdr2b.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-t9kc2r71.js → vm-hands-entry-lite-9kasrx18.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-3rx6cm14.js → vm-hands-entry-lite-b2wdaq7x.js} +1 -1
- package/bin/vm-hands/vm-hands-entry-lite-cxs89wzv.js +3 -0
- package/bin/vm-hands/{vm-hands-entry-lite-famqdhz7.js → vm-hands-entry-lite-dajv3b6q.js} +50 -49
- package/bin/vm-hands/{vm-hands-entry-lite-hths5rsx.js → vm-hands-entry-lite-ex8ayqyn.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-5d1hcp23.js → vm-hands-entry-lite-njavcwrp.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-kqn1bkrr.js → vm-hands-entry-lite-psybjyay.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-m8tb88zv.js → vm-hands-entry-lite-qg2q7w4z.js} +2 -2
- package/bin/vm-hands/{vm-hands-entry-lite-n4xx6qfr.js → vm-hands-entry-lite-t497ewn2.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-7ve198cs.js → vm-hands-entry-lite-tsd17dcd.js} +1 -1
- package/bin/vm-hands/{vm-hands-entry-lite-qa7d2zwf.js → vm-hands-entry-lite-wmbe27q2.js} +2 -2
- package/bin/vm-hands/vm-hands-entry-lite.js +1 -1
- package/bin/vm-hands/{vm-hands-executor-ggktb5tz.js → vm-hands-executor-c3yx2kcy.js} +2 -2
- package/bin/vm-hands/{vm-hands-op-runner-4a4e5cmr.js → vm-hands-op-runner-4j1e9snb.js} +1 -1
- package/bin/vm-hands/{vm-hands-runtime-wv3mr81c.js → vm-hands-runtime-6q8y3a57.js} +3 -3
- package/bin/vm-hands/{worker-sandbox-7zfttr2t.js → worker-sandbox-yt11b09s.js} +1 -1
- package/package.json +1 -1
- package/bin/vm-hands/package-28msp113.js +0 -2
- package/bin/vm-hands/vm-hands-entry-lite-t3gpbwqp.js +0 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Gh as $}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Gh as $}from"./vm-hands-entry-lite-2ym8pc3f.js";var O=$.version,Z=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;function S(B,D){if(!Z.test(B)||!Z.test(D))throw Error("cannot compare invalid CLI versions");let J=(q)=>{let y=q.indexOf("-");return y===-1?[q,void 0]:[q.slice(0,y),q.slice(y+1)]},[j,F]=J(B),[w,G]=J(D),K=j.split(".").map(BigInt),M=w.split(".").map(BigInt);for(let q=0;q<3;q+=1){if(K[q]===M[q])continue;return K[q]<M[q]?-1:1}if(F===void 0||G===void 0){if(F===G)return 0;return F===void 0?1:-1}let Q=F.split("."),U=G.split("."),A=Math.max(Q.length,U.length);for(let q=0;q<A;q+=1){let y=Q[q],z=U[q];if(y===void 0||z===void 0){if(y===z)return 0;return y===void 0?-1:1}if(y===z)continue;let H=/^\d+$/.test(y),W=/^\d+$/.test(z);if(H&&W){let X=BigInt(y),Y=BigInt(z);if(X===Y)continue;return X<Y?-1:1}if(H!==W)return H?-1:1;return y<z?-1:1}return 0}function k(B,D){return D?`cli ${B} \xB7 agent ${D}`:`cli ${B}`}
|
|
3
3
|
export{O as Ch,Z as Dh,S as Eh,k as Fh};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Tg as wz,Ug as Nz}from"./vm-hands-entry-lite-22jgncrd.js";import{ch as N}from"./vm-hands-entry-lite-cp1wqjs5.js";import{Ch as A}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Tg as wz,Ug as Nz}from"./vm-hands-entry-lite-22jgncrd.js";import{ch as N}from"./vm-hands-entry-lite-cp1wqjs5.js";import{Ch as A}from"./vm-hands-entry-lite-ex8ayqyn.js";import{Uh as Fz}from"./vm-hands-entry-lite-cxs89wzv.js";import{spawnSync as iz}from"child_process";import{dirname as g}from"path";import{spawn as cz}from"child_process";import{accessSync as lz,constants as sz}from"fs";import{basename as nz,join as pz}from"path";import{randomUUID as p}from"crypto";import{spawnSync as M}from"child_process";import{chmodSync as Hz,cpSync as Rz,existsSync as U,lstatSync as O,mkdirSync as i,readdirSync as Cz,readFileSync as E,readlinkSync as Lz,realpathSync as T,renameSync as R,rmdirSync as Mz,rmSync as P,symlinkSync as c,writeFileSync as Oz}from"fs";import{dirname as C,join as D,relative as Uz,resolve as Tz}from"path";var a="so.ara.cli",_z="5LJFSBRY2F";var o="ReasonBackgroundIdentity",r="Contents/Helpers/ReasonPermissionTile";var x="AraBackgroundIdentity",Az="Reason",Iz=`anchor apple generic and identifier "${a}" and certificate leaf[subject.OU] = "${_z}"`;class L extends Error{code;constructor(z,J){super(J);this.code=z;this.name="MacOSBackgroundIdentityError"}}var k="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister";function v(z=N()){return D(z,"Library","Application Support","Reason","Background","Reason.app")}function _(z=N()){return D(z,"Library","Application Support","Ara","Background","Ara.app")}function kz(z){try{return O(z).isFile()}catch{return!1}}function y(z){return[o,x].map((J)=>D(z,"Contents","MacOS",J)).find(kz)??null}function w(z){try{if(!O(z).isDirectory())return!1;let J=E(D(z,"Contents","Info.plist"),"utf8");return J.includes(`<string>${a}</string>`)&&(J.includes(`<string>${Az}</string>`)||J.includes("<string>Ara</string>"))&&y(z)!==null}catch{return!1}}function I(z=N()){let J=v(z);if(!w(J))return null;try{let Z=E(D(J,"Contents","Info.plist"),"utf8");return/<key>CFBundleVersion<\/key>\s*<string>(\d+\.\d+\.\d+)<\/string>/.exec(Z)?.[1]??null}catch{return null}}function Sz(z,J=N()){let Z=I(J);return Z===null||$z(S(Z.split(".")),S(z.split(/[.-]/).slice(0,3)))}var fz=1e4;function t(z,J){return M(z,[...J],{stdio:"ignore",timeout:fz}).status??1}var e=new Set;function zz(z){if(process.env.REASON_TEST_REFUSE_REAL_IDENTITY!=="1")return;let J=(Z)=>{try{return T(Z)}catch{return Tz(Z)}};if(z!==void 0&&J(z)!==J(N()))return;throw Error("A test tried to change this computer's real Reason background identity; pass a temporary home. Refused by scripts/test-env.ts.")}var Jz=/\/(?:runtime|CLI)\/versions\/(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$|\/\.ara(?:-staging)?-worker-(\d+)\.(\d+)\.(\d+)[^/]*\/[^/]+$/,Zz=new Set(["ara","ara.exe","reason","reason.exe"]);function S(z){return z.map((J)=>Number(J))}function $z(z,J){for(let Z=0;Z<3;Z+=1)if(z[Z]!==J[Z])return z[Z]<J[Z];return!1}var Ez=[0,2,161];function xz(z){if(z===null)return!0;let J=Ez,Z=null;try{Z=T(process.execPath)}catch{}return z.some(($)=>{let j=Jz.exec($);if(j){let Q=j[1]===void 0?j.slice(4,7):j.slice(1,4);return $z(S(Q),J)}let q=$.slice($.lastIndexOf("/")+1);return Zz.has(q)&&$!==Z&&$!==process.execPath})}function yz(){let z=M("/bin/ps",["-xo","pid=,comm="],{encoding:"utf8",timeout:5000});if(z.status!==0)return null;let J=[];for(let Z of z.stdout.split(`
|
|
3
3
|
`)){let $=/^\s*(\d+)\s+(\S.*)$/.exec(Z);if(!$||Number($[1])===process.pid)continue;let j=$[2].trimEnd(),q=j.slice(j.lastIndexOf("/")+1);if(!Jz.test(j)&&Zz.has(q)){let V=M("/usr/sbin/lsof",["-a","-p",$[1],"-d","txt","-Fn"],{encoding:"utf8",timeout:5000}).stdout?.split(`
|
|
4
4
|
`).find((X)=>X.startsWith("n/"));if(V)j=V.slice(1)}J.push(j)}return J}function bz(z){if(zz(z.home),!w(z.sourceApp))throw new L("identity_invalid","The packaged Reason background identity is missing or invalid.");let J=z.command??t,Z=v(z.home),$=C(Z);i($,{recursive:!0,mode:448}),Hz($,448);let j=T(z.sourceApp),q=null;try{q=T(Z)}catch{}if(j!==q){let Q=`${process.pid}.${p()}`,V=D($,`.Reason.app.${Q}.tmp`),X=D($,`.Reason.app.${Q}.old`),W=!1;try{if(Rz(j,V,{recursive:!0,errorOnExist:!0,preserveTimestamps:!0}),!w(V))throw new L("identity_invalid","The copied Reason background identity is invalid.");let Y=z.releaseSigned?["--test-requirement",`=${Iz}`]:[];if(J("/usr/bin/codesign",["--verify","--strict",...Y,V])!==0)throw new L("identity_invalid_signature","The installed Reason background identity has an invalid signature.");let B=!1;for(let F=0;F<4;F+=1){let G=!1;try{R(Z,X),G=!0,W=!0}catch(K){if(K.code!=="ENOENT")throw K}if(F===0)z.beforePublish?.();try{R(V,Z),B=!0}catch(K){let m=K.code;if(!["EEXIST","ENOTEMPTY"].includes(m??""))throw K;if(G)P(X,{recursive:!0,force:!0}),W=!1;if(F===3)throw K;continue}if(G)P(X,{recursive:!0,force:!0}),W=!1;break}if(!B)throw Error("Could not publish Reason's background identity.")}catch(Y){if(W&&!U(Z)&&U(X))R(X,Z);throw Y}finally{P(V,{recursive:!0,force:!0}),P(X,{recursive:!0,force:!0})}}return Wz(Z,z,{verified:j!==q}),Z}function jz(z){return D(C(z),".Reason.app.registered")}function qz(z){try{let J=O(z);return J.isDirectory()?`${J.ino}:${J.birthtimeMs}`:null}catch{return null}}function f(z){let J=qz(z);try{return J!==null&&E(jz(z),"utf8")===J}catch{return!1}}function Qz(z){if(w(z))return"bundle";try{if(O(D(z,"Contents","Info.plist"),{throwIfNoEntry:!1}))return null;return O(D(z,"Contents","MacOS",x)).isSymbolicLink()?"retired":null}catch{return null}}function Wz(z,J,Z={}){let $=J.command??t;if(!Z.verified&&$("/usr/bin/codesign",["--verify","--strict",z])!==0)throw new L("identity_invalid_signature","The installed Reason background identity has an invalid signature.");if($(k,["-f",z])!==0)throw new L("identity_register_failed","Could not register Reason's macOS background identity.");let j=qz(z);try{if(j)Oz(jz(z),j,{mode:384})}catch{}try{gz(z,J.home,$,J.runningExecutables??yz)}catch(q){let Q=q.code??"unknown";process.stderr.write(`Reason background identity: legacy_identity_retire_failed (${Q})
|
|
5
5
|
`)}}function gz(z,J,Z,$){let j=y(z);if(!j)return;let q=_(J),Q=C(q),V=(K)=>D(K,"Contents","MacOS",x),X=Uz(C(V(q)),j),W=`${process.pid}.${p()}`,Y=Qz(q);if(Y===null)return;let B=Y==="bundle";if(B)Z(k,["-u",q]);let F=D(Q,`.Ara.app.${W}.old`);if(!e.has(q)&&!xz($())){if(!B)Z(k,["-u",q]);try{R(q,F)}catch(K){if(K.code==="ENOENT")return;throw K}P(F,{recursive:!0,force:!0}),uz(Q);return}if(!B){if(Lz(V(q))===X)return;let K=`${V(q)}.${W}`;c(X,K);try{R(K,V(q))}finally{P(K,{force:!0})}return}let G=D(Q,`.Ara.app.${W}.shim`);i(C(V(G)),{recursive:!0}),c(X,V(G));try{try{R(q,F)}catch(K){if(K.code==="ENOENT")return;throw K}try{R(G,q)}catch(K){if(U(q))return;throw R(F,q),K}}finally{P(G,{recursive:!0,force:!0}),P(F,{recursive:!0,force:!0})}}function uz(z){try{if(Cz(z).some((Z)=>Z!==".DS_Store"))return;P(D(z,".DS_Store"),{force:!0}),Mz(z)}catch{}}var l=new Map;function hz(z=N()){let J=l.get(z);if(J)return J;if(process.platform!=="darwin")return[];let Z=s(z);if(Z===null&&U(C(v(z))))Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,100),Z=s(z);if(Z===null)return[];return l.set(z,Z),Z}function s(z){let J=v(z),Z=_(z);if(!w(J)||!f(J))try{dz({home:z,skipWhenSettled:!0})}catch{}let $=w(J)&&(f(J)||!w(Z))?J:w(Z)?Z:null,j=$?y($):null;if(!j)return null;if($===Z)e.add(Z);let q=M(j,["--can-spawn"],{env:{},timeout:2000,encoding:"utf8"});return q.status===0&&q.stdout===`spawn
|
|
@@ -20,7 +20,7 @@ The macOS privacy permissions of this computer's Reason worker:
|
|
|
20
20
|
allow asks for each missing one, or the one named. macOS cannot ask for Full
|
|
21
21
|
Disk Access: allow disk opens its pane, shows the file to add in Finder and
|
|
22
22
|
waits until the worker has it.
|
|
23
|
-
`,u="x-apple.systempreferences:com.apple.preference.security",az="curl -fsSL https://reasonmachines.com/install.sh | bash",oz=180000,rz=2000,h=["screen","accessibility","disk"],d={screen:{label:"Screen & System Audio Recording",purpose:"desktop video, computer-use screenshots",level:"required",pane:`${u}?Privacy_ScreenCapture`},accessibility:{label:"Accessibility",purpose:"computer-use clicks and typing, desktop input",level:"required",pane:`${u}?Privacy_Accessibility`},disk:{label:"Full Disk Access",purpose:"Sessions in Desktop, Documents, Downloads, iCloud Drive and Mail",level:"recommended",pane:`${u}?Privacy_AllFiles`}};function Bz(z){return z.executable}function tz(z,J){if(z==="computer_use_identity_missing")return`Reason's background identity is not installed (${z}); reinstall Reason: ${az}`;if(z==="computer_use_identity_outdated")return`Reason's background identity is outdated (${I(J)??"unknown"}; this CLI is ${A}) (${z}); \`reason update\` installs this release's`;return`Reason's background identity cannot run computer use for this CLI (${z}); run the installed \`reason\``}function ez(z=N()){let J=b(z);if(J.length>0)return{state:"ready",path:g(g(g(J[0]))),prefix:J};let Z=Kz(J,z)??"computer_use_identity_unavailable";return{state:Z,path:v(z),detail:tz(Z,z)}}function Pz(){return{identity:()=>ez(),grants:(z)=>wz(z),request:(z,J)=>Nz(z,J),worker:async()=>(await import("./status-
|
|
23
|
+
`,u="x-apple.systempreferences:com.apple.preference.security",az="curl -fsSL https://reasonmachines.com/install.sh | bash",oz=180000,rz=2000,h=["screen","accessibility","disk"],d={screen:{label:"Screen & System Audio Recording",purpose:"desktop video, computer-use screenshots",level:"required",pane:`${u}?Privacy_ScreenCapture`},accessibility:{label:"Accessibility",purpose:"computer-use clicks and typing, desktop input",level:"required",pane:`${u}?Privacy_Accessibility`},disk:{label:"Full Disk Access",purpose:"Sessions in Desktop, Documents, Downloads, iCloud Drive and Mail",level:"recommended",pane:`${u}?Privacy_AllFiles`}};function Bz(z){return z.executable}function tz(z,J){if(z==="computer_use_identity_missing")return`Reason's background identity is not installed (${z}); reinstall Reason: ${az}`;if(z==="computer_use_identity_outdated")return`Reason's background identity is outdated (${I(J)??"unknown"}; this CLI is ${A}) (${z}); \`reason update\` installs this release's`;return`Reason's background identity cannot run computer use for this CLI (${z}); run the installed \`reason\``}function ez(z=N()){let J=b(z);if(J.length>0)return{state:"ready",path:g(g(g(J[0]))),prefix:J};let Z=Kz(J,z)??"computer_use_identity_unavailable";return{state:Z,path:v(z),detail:tz(Z,z)}}function Pz(){return{identity:()=>ez(),grants:(z)=>wz(z),request:(z,J)=>Nz(z,J),worker:async()=>(await import("./status-aej4363b.js")).connectionMacState(),open:(z)=>{iz("/usr/bin/open",z,{stdio:"ignore",timeout:1e4})},tile:Xz,restartConnection:async()=>(await import("./connect-cli-xnzjcb3e.js")).restartConnection(),sleep:(z)=>new Promise((J)=>setTimeout(J,z)),now:()=>Date.now()}}function Yz(z,J,Z){if(z.state!=="ready"||!J)return"unknown";return J[Z]?"granted":"missing"}async function vz(z){let J=z.identity(),Z=J.state==="ready"?await z.grants(J.prefix):null,$=await z.worker(),j=$?Bz($):null,q=!j||$?.full_disk_access==="unknown"?"unknown":$?.full_disk_access==="granted"?"granted":"missing",Q=(V,X,W)=>{let{label:Y,purpose:B,level:F}=d[V];return{id:V,label:Y,purpose:B,level:F,state:X,holder:W}};return{identity:{state:J.state,path:J.path,detail:J.state==="ready"?null:J.detail},worker_detail:j?null:"Full Disk Access is read from this computer's running worker; `reason connect` starts it.",permissions:[Q("screen",Yz(J,Z,"screen"),J.path),Q("accessibility",Yz(J,Z,"accessibility"),J.path),Q("disk",q,j)]}}function MJ(z){let J=z.identity.state==="ready"?null:z.identity.state,Z=z.permissions.filter((q)=>q.state==="granted").length,$=[...J?[J]:[],...z.permissions.filter((q)=>q.state!=="granted"&&!(J&&q.id!=="disk")).map((q)=>`${q.label} ${q.state}`)],j=!J&&z.permissions.some((q)=>q.state==="missing");return`Permissions: ${Z} of ${z.permissions.length}${$.length>0?` (${$.join(", ")})`:""}`+(j?" \u2014 reason permissions allow":$.length>0?" \u2014 reason permissions":"")}function zJ(z){let J=[];if(z.identity.detail)J.push(z.identity.detail);J.push(`Reason: ${z.identity.path}`);let Z=z.permissions.find(($)=>$.id==="disk");J.push(Z?.holder?`Worker: ${Z.holder}`:`Worker: ${z.worker_detail}`),J.push("");for(let $ of z.permissions){let j=`${$.label}${$.level==="recommended"?" (recommended)":""}`;J.push(` ${$.id.padEnd(13)} ${$.state.padEnd(7)} ${j}: ${$.purpose}`)}if(z.permissions.some(($)=>$.state==="missing"))J.push("","Allow the missing ones: reason permissions allow");return`${J.join(`
|
|
24
24
|
`)}
|
|
25
25
|
`}async function Gz(z,J){let Z=J.now()+oz;for(;;){if(await z())return!0;if(J.now()>=Z)return!1;await J.sleep(rz)}}async function JJ(z,J){let Z=J.host??Pz(),{io:$}=J,j=await vz(Z),q=j.permissions.filter((W)=>z.includes(W.id)&&W.state!=="granted");if(q.length===0)return $.stdout.write(`Reason permissions: ${z.map((W)=>d[W].label).join(", ")} already allowed.
|
|
26
26
|
`),0;let Q=!1,V=!1,X=Z.identity();for(let W of q){let{label:Y,pane:B}=d[W.id];if(W.id!=="disk"){if(X.state!=="ready"){if(!Q)$.stderr.write(`Reason permissions: ${X.detail}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rh as s}from"./vm-hands-entry-lite-t3gpbwqp.js";var mc={};s(mc,{xor:()=>Zl,xid:()=>kl,void:()=>Bl,uuidv7:()=>$l,uuidv6:()=>ul,uuidv4:()=>el,uuid:()=>vl,util:()=>k,url:()=>gl,uppercase:()=>Xr,unknown:()=>mr,union:()=>gt,undefined:()=>Tl,ulid:()=>Ul,uint64:()=>Ql,uint32:()=>ql,tuple:()=>Q$,trim:()=>Tr,treeifyError:()=>Lt,transform:()=>ct,toUpperCase:()=>Br,toLowerCase:()=>Hr,toJSONSchema:()=>Yi,templateLiteral:()=>uc,symbol:()=>Fl,superRefine:()=>cg,success:()=>tc,stringbool:()=>Uc,stringFormat:()=>Ll,string:()=>On,strictObject:()=>Rl,startsWith:()=>Kr,slugify:()=>Mr,size:()=>Dr,setErrorMap:()=>i4,set:()=>pl,safeParseAsync:()=>c$,safeParse:()=>l$,safeEncodeAsync:()=>w$,safeEncode:()=>k$,safeDecodeAsync:()=>S$,safeDecode:()=>D$,registry:()=>ui,regexes:()=>d,regex:()=>Ar,refine:()=>lg,record:()=>F$,readonly:()=>og,property:()=>Vi,promise:()=>$c,prettifyError:()=>Et,preprocess:()=>Dc,prefault:()=>y$,positive:()=>Ei,pipe:()=>di,partialRecord:()=>hl,parseAsync:()=>g$,parse:()=>$$,overwrite:()=>f,optional:()=>Pn,object:()=>xl,number:()=>N$,nullish:()=>ic,nullable:()=>Jn,null:()=>J$,normalize:()=>Fr,nonpositive:()=>Wi,nonoptional:()=>a$,nonnegative:()=>Ai,never:()=>$t,negative:()=>Gi,nativeEnum:()=>sl,nanoid:()=>Il,nan:()=>oc,multipleOf:()=>ur,minSize:()=>a,minLength:()=>nr,mime:()=>Qr,meta:()=>bc,maxSize:()=>$r,maxLength:()=>wr,map:()=>al,mac:()=>Sl,lte:()=>x,lt:()=>h,lowercase:()=>Vr,looseRecord:()=>yl,looseObject:()=>fl,locales:()=>Sn,literal:()=>rc,length:()=>Sr,lazy:()=>ug,ksuid:()=>Dl,keyof:()=>dl,jwt:()=>Jl,json:()=>kc,iso:()=>Rr,ipv6:()=>ml,ipv4:()=>wl,invertCodec:()=>ec,intersection:()=>K$,int64:()=>Yl,int32:()=>Xl,int:()=>Mi,instanceof:()=>_c,includes:()=>qr,httpUrl:()=>ll,hostname:()=>El,hex:()=>Gl,hash:()=>Wl,guid:()=>ol,gte:()=>Q,gt:()=>y,globalRegistry:()=>X,getErrorMap:()=>t4,function:()=>gc,fromJSONSchema:()=>Sc,formatError:()=>$n,float64:()=>Vl,float32:()=>Al,flattenError:()=>un,file:()=>nc,exactOptional:()=>R$,enum:()=>lt,endsWith:()=>Yr,encodeAsync:()=>_$,encode:()=>I$,emoji:()=>cl,email:()=>tl,e164:()=>Pl,discriminatedUnion:()=>Cl,describe:()=>Ic,decodeAsync:()=>U$,decode:()=>b$,date:()=>Ml,custom:()=>cc,cuid2:()=>_l,cuid:()=>bl,core:()=>ir,config:()=>W,coerce:()=>bg,codec:()=>vc,clone:()=>K,cidrv6:()=>zl,cidrv4:()=>Nl,check:()=>lc,catch:()=>rg,boolean:()=>z$,bigint:()=>Kl,base64url:()=>jl,base64:()=>Ol,array:()=>Wn,any:()=>Hl,_function:()=>gc,_default:()=>C$,_ZodString:()=>xi,ZodXor:()=>V$,ZodXID:()=>ai,ZodVoid:()=>W$,ZodUnknown:()=>E$,ZodUnion:()=>Vn,ZodUndefined:()=>j$,ZodUUID:()=>p,ZodURL:()=>En,ZodULID:()=>yi,ZodType:()=>O,ZodTuple:()=>Y$,ZodTransform:()=>d$,ZodTemplateLiteral:()=>vg,ZodSymbol:()=>O$,ZodSuccess:()=>p$,ZodStringFormat:()=>L,ZodString:()=>Cr,ZodSet:()=>H$,ZodRecord:()=>fr,ZodRealError:()=>M,ZodReadonly:()=>tg,ZodPromise:()=>$g,ZodPreprocess:()=>ig,ZodPrefault:()=>h$,ZodPipe:()=>Xn,ZodOptional:()=>It,ZodObject:()=>An,ZodNumberFormat:()=>Nr,ZodNumber:()=>yr,ZodNullable:()=>f$,ZodNull:()=>P$,ZodNonOptional:()=>bt,ZodNever:()=>G$,ZodNanoID:()=>Zi,ZodNaN:()=>ng,ZodMap:()=>T$,ZodMAC:()=>m$,ZodLiteral:()=>B$,ZodLazy:()=>eg,ZodKSUID:()=>pi,ZodJWT:()=>et,ZodIssueCode:()=>n4,ZodIntersection:()=>q$,ZodISOTime:()=>Hi,ZodISODuration:()=>Bi,ZodISODateTime:()=>Fi,ZodISODate:()=>Ti,ZodIPv6:()=>rt,ZodIPv4:()=>si,ZodGUID:()=>jn,ZodFunction:()=>gg,ZodFirstPartyTypeKind:()=>Ig,ZodFile:()=>M$,ZodExactOptional:()=>x$,ZodError:()=>sb,ZodEnum:()=>Zr,ZodEmoji:()=>fi,ZodEmail:()=>Ri,ZodE164:()=>vt,ZodDiscriminatedUnion:()=>X$,ZodDefault:()=>Z$,ZodDate:()=>Gn,ZodCustomStringFormat:()=>hr,ZodCustom:()=>Kn,ZodCodec:()=>qn,ZodCatch:()=>s$,ZodCUID2:()=>hi,ZodCUID:()=>Ci,ZodCIDRv6:()=>it,ZodCIDRv4:()=>nt,ZodBoolean:()=>ar,ZodBigIntFormat:()=>ut,ZodBigInt:()=>pr,ZodBase64URL:()=>ot,ZodBase64:()=>tt,ZodArray:()=>A$,ZodAny:()=>L$,TimePrecision:()=>Qe,NEVER:()=>Ut,$output:()=>Ae,$input:()=>Ve,$brand:()=>kt});var ir={};s(ir,{version:()=>jo,util:()=>k,treeifyError:()=>Lt,toJSONSchema:()=>Yi,toDotPath:()=>zg,safeParseAsync:()=>Wt,safeParse:()=>Gt,safeEncodeAsync:()=>nI,safeEncode:()=>sc,safeDecodeAsync:()=>iI,safeDecode:()=>rI,registry:()=>ui,regexes:()=>d,process:()=>P,prettifyError:()=>Et,parseAsync:()=>Tn,parse:()=>Fn,meta:()=>Du,locales:()=>Sn,isValidJWT:()=>xg,isValidBase64URL:()=>dg,isValidBase64:()=>Zo,initializeContext:()=>gr,globalRegistry:()=>X,globalConfig:()=>Ir,formatError:()=>$n,flattenError:()=>un,finalize:()=>cr,extractDefs:()=>lr,encodeAsync:()=>ac,encode:()=>hc,describe:()=>ku,decodeAsync:()=>pc,decode:()=>yc,createToJSONSchemaMethod:()=>Su,createStandardJSONSchemaMethod:()=>xr,config:()=>W,clone:()=>K,_xor:()=>Gb,_xid:()=>wi,_void:()=>uu,_uuidv7:()=>Ii,_uuidv6:()=>ci,_uuidv4:()=>li,_uuid:()=>gi,_url:()=>Nn,_uppercase:()=>Xr,_unknown:()=>vu,_union:()=>Eb,_undefined:()=>iu,_ulid:()=>Di,_uint64:()=>ru,_uint32:()=>Ce,_tuple:()=>Vb,_trim:()=>Tr,_transform:()=>Tb,_toUpperCase:()=>Br,_toLowerCase:()=>Hr,_templateLiteral:()=>Cb,_symbol:()=>nu,_superRefine:()=>Uu,_success:()=>xb,_stringbool:()=>wu,_stringFormat:()=>dr,_string:()=>qe,_startsWith:()=>Kr,_slugify:()=>Mr,_size:()=>Dr,_set:()=>Kb,_safeParseAsync:()=>Er,_safeParse:()=>Lr,_safeEncodeAsync:()=>fn,_safeEncode:()=>xn,_safeDecodeAsync:()=>Zn,_safeDecode:()=>Rn,_regex:()=>Ar,_refine:()=>_u,_record:()=>Xb,_readonly:()=>Zb,_property:()=>Vi,_promise:()=>yb,_positive:()=>Ei,_pipe:()=>fb,_parseAsync:()=>Jr,_parse:()=>Pr,_overwrite:()=>f,_optional:()=>Hb,_number:()=>Me,_nullable:()=>Bb,_null:()=>tu,_normalize:()=>Fr,_nonpositive:()=>Wi,_nonoptional:()=>db,_nonnegative:()=>Ai,_never:()=>eu,_negative:()=>Gi,_nativeEnum:()=>Qb,_nanoid:()=>_i,_nan:()=>lu,_multipleOf:()=>ur,_minSize:()=>a,_minLength:()=>nr,_min:()=>Q,_mime:()=>Qr,_maxSize:()=>$r,_maxLength:()=>wr,_max:()=>x,_map:()=>qb,_mac:()=>Ye,_lte:()=>x,_lt:()=>h,_lowercase:()=>Vr,_literal:()=>Fb,_length:()=>Sr,_lazy:()=>hb,_ksuid:()=>Si,_jwt:()=>Li,_isoTime:()=>He,_isoDuration:()=>Be,_isoDateTime:()=>Fe,_isoDate:()=>Te,_ipv6:()=>Ni,_ipv4:()=>mi,_intersection:()=>Ab,_int64:()=>se,_int32:()=>Ze,_int:()=>xe,_includes:()=>qr,_guid:()=>mn,_gte:()=>Q,_gt:()=>y,_float64:()=>fe,_float32:()=>Re,_file:()=>Iu,_enum:()=>Yb,_endsWith:()=>Yr,_encodeAsync:()=>Mn,_encode:()=>Hn,_emoji:()=>bi,_email:()=>$i,_e164:()=>Ji,_discriminatedUnion:()=>Wb,_default:()=>Mb,_decodeAsync:()=>dn,_decode:()=>Bn,_date:()=>$u,_custom:()=>bu,_cuid2:()=>ki,_cuid:()=>Ui,_coercedString:()=>Ke,_coercedNumber:()=>de,_coercedDate:()=>gu,_coercedBoolean:()=>ye,_coercedBigint:()=>pe,_cidrv6:()=>Oi,_cidrv4:()=>zi,_check:()=>sg,_catch:()=>Rb,_boolean:()=>he,_bigint:()=>ae,_base64url:()=>Pi,_base64:()=>ji,_array:()=>cu,_any:()=>ou,TimePrecision:()=>Qe,NEVER:()=>Ut,JSONSchemaGenerator:()=>t$,JSONSchema:()=>rl,Doc:()=>an,$output:()=>Ae,$input:()=>Ve,$constructor:()=>l,$brand:()=>kt,$ZodXor:()=>cv,$ZodXID:()=>Ko,$ZodVoid:()=>uv,$ZodUnknown:()=>vv,$ZodUnion:()=>bn,$ZodUndefined:()=>iv,$ZodUUID:()=>Lo,$ZodURL:()=>Go,$ZodULID:()=>qo,$ZodType:()=>z,$ZodTuple:()=>oi,$ZodTransform:()=>mv,$ZodTemplateLiteral:()=>Av,$ZodSymbol:()=>nv,$ZodSuccess:()=>Jv,$ZodStringFormat:()=>J,$ZodString:()=>kr,$ZodSet:()=>kv,$ZodRegistry:()=>Xe,$ZodRecord:()=>_v,$ZodRealError:()=>B,$ZodReadonly:()=>Wv,$ZodPromise:()=>Xv,$ZodPreprocess:()=>Gv,$ZodPrefault:()=>jv,$ZodPipe:()=>ei,$ZodOptional:()=>vi,$ZodObjectJIT:()=>lv,$ZodObject:()=>Zg,$ZodNumberFormat:()=>so,$ZodNumber:()=>ii,$ZodNullable:()=>zv,$ZodNull:()=>tv,$ZodNonOptional:()=>Pv,$ZodNever:()=>ev,$ZodNanoID:()=>Ao,$ZodNaN:()=>Ev,$ZodMap:()=>Uv,$ZodMAC:()=>xo,$ZodLiteral:()=>wv,$ZodLazy:()=>qv,$ZodKSUID:()=>Yo,$ZodJWT:()=>ao,$ZodIntersection:()=>bv,$ZodISOTime:()=>To,$ZodISODuration:()=>Ho,$ZodISODateTime:()=>Qo,$ZodISODate:()=>Fo,$ZodIPv6:()=>Mo,$ZodIPv4:()=>Bo,$ZodGUID:()=>Jo,$ZodFunction:()=>Vv,$ZodFile:()=>Sv,$ZodExactOptional:()=>Nv,$ZodError:()=>en,$ZodEnum:()=>Dv,$ZodEncodeError:()=>br,$ZodEmoji:()=>Wo,$ZodEmail:()=>Eo,$ZodE164:()=>yo,$ZodDiscriminatedUnion:()=>Iv,$ZodDefault:()=>Ov,$ZodDate:()=>$v,$ZodCustomStringFormat:()=>po,$ZodCustom:()=>Kv,$ZodCodec:()=>_n,$ZodCheckUpperCase:()=>Do,$ZodCheckStringFormat:()=>Gr,$ZodCheckStartsWith:()=>So,$ZodCheckSizeEquals:()=>co,$ZodCheckRegex:()=>Uo,$ZodCheckProperty:()=>No,$ZodCheckOverwrite:()=>Oo,$ZodCheckNumberFormat:()=>uo,$ZodCheckMultipleOf:()=>eo,$ZodCheckMinSize:()=>lo,$ZodCheckMinLength:()=>bo,$ZodCheckMimeType:()=>zo,$ZodCheckMaxSize:()=>go,$ZodCheckMaxLength:()=>Io,$ZodCheckLowerCase:()=>ko,$ZodCheckLessThan:()=>hn,$ZodCheckLengthEquals:()=>_o,$ZodCheckIncludes:()=>wo,$ZodCheckGreaterThan:()=>yn,$ZodCheckEndsWith:()=>mo,$ZodCheckBigIntFormat:()=>$o,$ZodCheck:()=>E,$ZodCatch:()=>Lv,$ZodCUID2:()=>Xo,$ZodCUID:()=>Vo,$ZodCIDRv6:()=>fo,$ZodCIDRv4:()=>Ro,$ZodBoolean:()=>In,$ZodBigIntFormat:()=>rv,$ZodBigInt:()=>ti,$ZodBase64URL:()=>ho,$ZodBase64:()=>Co,$ZodAsyncError:()=>C,$ZodArray:()=>gv,$ZodAny:()=>ov});var kg,Ut=Object.freeze({status:"aborted"});function l(n,i,o){function v(u,g){if(!u._zod)Object.defineProperty(u,"_zod",{value:{def:g,constr:e,traits:new Set},enumerable:!1});if(u._zod.traits.has(n))return;u._zod.traits.add(n),i(u,g);let $=e.prototype,c=Object.keys($);for(let b=0;b<c.length;b++){let S=c[b];if(!(S in u))u[S]=$[S].bind(u)}}let r=o?.Parent??Object;class t extends r{}Object.defineProperty(t,"name",{value:n});function e(u){var g;let $=o?.Parent?new t:this;v($,u),(g=$._zod).deferred??(g.deferred=[]);for(let c of $._zod.deferred)c();return $}return Object.defineProperty(e,"init",{value:v}),Object.defineProperty(e,Symbol.hasInstance,{value:(u)=>{if(o?.Parent&&u instanceof o.Parent)return!0;return u?._zod?.traits?.has(n)}}),Object.defineProperty(e,"name",{value:n}),e}var kt=Symbol("zod_brand");class C extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class br extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`);this.name="ZodEncodeError"}}(kg=globalThis).__zod_globalConfig??(kg.__zod_globalConfig={});var Ir=globalThis.__zod_globalConfig;function W(n){if(n)Object.assign(Ir,n);return Ir}var k={};s(k,{unwrapMessage:()=>sr,uint8ArrayToHex:()=>Zc,uint8ArrayToBase64url:()=>Rc,uint8ArrayToBase64:()=>Sg,stringifyPrimitive:()=>_,slugify:()=>St,shallowClone:()=>Nt,safeExtend:()=>Tc,required:()=>Mc,randomString:()=>Vc,propertyKeyTypes:()=>tn,promiseAllObject:()=>Ac,primitiveTypes:()=>zt,prefixIssues:()=>H,pick:()=>Yc,partial:()=>Bc,parsedType:()=>U,optionalKeys:()=>Ot,omit:()=>Qc,objectClone:()=>Ec,numKeys:()=>Xc,nullish:()=>tr,normalizeParams:()=>w,mergeDefs:()=>rr,merge:()=>Hc,jsonStringifyReplacer:()=>zr,joinValues:()=>I,issue:()=>jr,isPlainObject:()=>vr,isObject:()=>_r,hexToUint8Array:()=>fc,getSizableOrigin:()=>on,getParsedType:()=>qc,getLengthableOrigin:()=>vn,getEnumValues:()=>rn,getElementAtPath:()=>Wc,floatSafeRemainder:()=>wt,finalizeIssue:()=>Y,extend:()=>Fc,explicitlyAborted:()=>Jt,escapeRegex:()=>R,esc:()=>Yn,defineLazy:()=>j,createTransparentProxy:()=>Kc,cloneDef:()=>Gc,clone:()=>K,cleanRegex:()=>nn,cleanEnum:()=>dc,captureStackTrace:()=>Qn,cached:()=>Or,base64urlToUint8Array:()=>xc,base64ToUint8Array:()=>wg,assignProp:()=>or,assertNotEqual:()=>jc,assertNever:()=>Jc,assertIs:()=>Pc,assertEqual:()=>Oc,assert:()=>Lc,allowsEval:()=>mt,aborted:()=>er,NUMBER_FORMAT_RANGES:()=>jt,Class:()=>mg,BIGINT_FORMAT_RANGES:()=>Pt});function Oc(n){return n}function jc(n){return n}function Pc(n){}function Jc(n){throw Error("Unexpected value in exhaustive check")}function Lc(n){}function rn(n){let i=Object.values(n).filter((v)=>typeof v==="number");return Object.entries(n).filter(([v,r])=>i.indexOf(+v)===-1).map(([v,r])=>r)}function I(n,i="|"){return n.map((o)=>_(o)).join(i)}function zr(n,i){if(typeof i==="bigint")return i.toString();return i}function Or(n){return{get value(){{let o=n();return Object.defineProperty(this,"value",{value:o}),o}throw Error("cached value already set")}}}function tr(n){return n===null||n===void 0}function nn(n){let i=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;return n.slice(i,o)}function wt(n,i){let o=n/i,v=Math.round(o),r=Number.EPSILON*Math.max(Math.abs(o),1);if(Math.abs(o-v)<r)return 0;return o-v}var Dg=Symbol("evaluating");function j(n,i,o){let v=void 0;Object.defineProperty(n,i,{get(){if(v===Dg)return;if(v===void 0)v=Dg,v=o();return v},set(r){Object.defineProperty(n,i,{value:r})},configurable:!0})}function Ec(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function or(n,i,o){Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}function rr(...n){let i={};for(let o of n){let v=Object.getOwnPropertyDescriptors(o);Object.assign(i,v)}return Object.defineProperties({},i)}function Gc(n){return rr(n._zod.def)}function Wc(n,i){if(!i)return n;return i.reduce((o,v)=>o?.[v],n)}function Ac(n){let i=Object.keys(n),o=i.map((v)=>n[v]);return Promise.all(o).then((v)=>{let r={};for(let t=0;t<i.length;t++)r[i[t]]=v[t];return r})}function Vc(n=10){let o="";for(let v=0;v<n;v++)o+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return o}function Yn(n){return JSON.stringify(n)}function St(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qn="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function _r(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}var mt=Or(()=>{if(Ir.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(n){return!1}});function vr(n){if(_r(n)===!1)return!1;let i=n.constructor;if(i===void 0)return!0;if(typeof i!=="function")return!0;let o=i.prototype;if(_r(o)===!1)return!1;if(Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)return!1;return!0}function Nt(n){if(vr(n))return{...n};if(Array.isArray(n))return[...n];if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);return n}function Xc(n){let i=0;for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))i++;return i}var qc=(n)=>{let i=typeof n;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(n))return"array";if(n===null)return"null";if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return"promise";if(typeof Map<"u"&&n instanceof Map)return"map";if(typeof Set<"u"&&n instanceof Set)return"set";if(typeof Date<"u"&&n instanceof Date)return"date";if(typeof File<"u"&&n instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${i}`)}},tn=new Set(["string","number","symbol"]),zt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function R(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(n,i,o){let v=new n._zod.constr(i??n._zod.def);if(!i||o?.parent)v._zod.parent=n;return v}function w(n){let i=n;if(!i)return{};if(typeof i==="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");i.error=i.message}if(delete i.message,typeof i.error==="string")return{...i,error:()=>i.error};return i}function Kc(n){let i;return new Proxy({},{get(o,v,r){return i??(i=n()),Reflect.get(i,v,r)},set(o,v,r,t){return i??(i=n()),Reflect.set(i,v,r,t)},has(o,v){return i??(i=n()),Reflect.has(i,v)},deleteProperty(o,v){return i??(i=n()),Reflect.deleteProperty(i,v)},ownKeys(o){return i??(i=n()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(o,v){return i??(i=n()),Reflect.getOwnPropertyDescriptor(i,v)},defineProperty(o,v,r){return i??(i=n()),Reflect.defineProperty(i,v,r)}})}function _(n){if(typeof n==="bigint")return n.toString()+"n";if(typeof n==="string")return`"${n}"`;return`${n}`}function Ot(n){return Object.keys(n).filter((i)=>{return n[i]._zod.optin==="optional"&&n[i]._zod.optout==="optional"})}var jt={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]},Pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Yc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;e[u]=o.shape[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Qc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={...n._zod.def.shape};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;delete e[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Fc(n,i){if(!vr(i))throw Error("Invalid input to extend: expected a plain object");let o=n._zod.def.checks;if(o&&o.length>0){let t=n._zod.def.shape;for(let e in i)if(Object.getOwnPropertyDescriptor(t,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=rr(n._zod.def,{get shape(){let t={...n._zod.def.shape,...i};return or(this,"shape",t),t}});return K(n,r)}function Tc(n,i){if(!vr(i))throw Error("Invalid input to safeExtend: expected a plain object");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i};return or(this,"shape",v),v}});return K(n,o)}function Hc(n,i){if(n._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i._zod.def.shape};return or(this,"shape",v),v},get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return K(n,o)}function Bc(n,i,o){let r=i._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let e=rr(i._zod.def,{get shape(){let u=i._zod.def.shape,g={...u};if(o)for(let $ in o){if(!($ in u))throw Error(`Unrecognized key: "${$}"`);if(!o[$])continue;g[$]=n?new n({type:"optional",innerType:u[$]}):u[$]}else for(let $ in u)g[$]=n?new n({type:"optional",innerType:u[$]}):u[$];return or(this,"shape",g),g},checks:[]});return K(i,e)}function Mc(n,i,o){let v=rr(i._zod.def,{get shape(){let r=i._zod.def.shape,t={...r};if(o)for(let e in o){if(!(e in t))throw Error(`Unrecognized key: "${e}"`);if(!o[e])continue;t[e]=new n({type:"nonoptional",innerType:r[e]})}else for(let e in r)t[e]=new n({type:"nonoptional",innerType:r[e]});return or(this,"shape",t),t}});return K(i,v)}function er(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue!==!0)return!0;return!1}function Jt(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue===!1)return!0;return!1}function H(n,i){return i.map((o)=>{var v;return(v=o).path??(v.path=[]),o.path.unshift(n),o})}function sr(n){return typeof n==="string"?n:n?.message}function Y(n,i,o){let v=n.message?n.message:sr(n.inst?._zod.def?.error?.(n))??sr(i?.error?.(n))??sr(o.customError?.(n))??sr(o.localeError?.(n))??"Invalid input",{inst:r,continue:t,input:e,...u}=n;if(u.path??(u.path=[]),u.message=v,i?.reportInput)u.input=e;return u}function on(n){if(n instanceof Set)return"set";if(n instanceof Map)return"map";if(n instanceof File)return"file";return"unknown"}function vn(n){if(Array.isArray(n))return"array";if(typeof n==="string")return"string";return"unknown"}function U(n){let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let o=n;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return i}function jr(...n){let[i,o,v]=n;if(typeof i==="string")return{message:i,code:"custom",input:o,inst:v};return{...i}}function dc(n){return Object.entries(n).filter(([i,o])=>{return Number.isNaN(Number.parseInt(i,10))}).map((i)=>i[1])}function wg(n){let i=atob(n),o=new Uint8Array(i.length);for(let v=0;v<i.length;v++)o[v]=i.charCodeAt(v);return o}function Sg(n){let i="";for(let o=0;o<n.length;o++)i+=String.fromCharCode(n[o]);return btoa(i)}function xc(n){let i=n.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-i.length%4)%4);return wg(i+o)}function Rc(n){return Sg(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function fc(n){let i=n.replace(/^0x/,"");if(i.length%2!==0)throw Error("Invalid hex string length");let o=new Uint8Array(i.length/2);for(let v=0;v<i.length;v+=2)o[v/2]=Number.parseInt(i.slice(v,v+2),16);return o}function Zc(n){return Array.from(n).map((i)=>i.toString(16).padStart(2,"0")).join("")}class mg{constructor(...n){}}var Ng=(n,i)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:i,enumerable:!1}),n.message=JSON.stringify(i,zr,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},en=l("$ZodError",Ng),B=l("$ZodError",Ng,{Parent:Error});function un(n,i=(o)=>o.message){let o={},v=[];for(let r of n.issues)if(r.path.length>0)o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(i(r));else v.push(i(r));return{formErrors:v,fieldErrors:o}}function $n(n,i=(o)=>o.message){let o={_errors:[]},v=(r,t=[])=>{for(let e of r.issues)if(e.code==="invalid_union"&&e.errors.length)e.errors.map((u)=>v({issues:u},[...t,...e.path]));else if(e.code==="invalid_key")v({issues:e.issues},[...t,...e.path]);else if(e.code==="invalid_element")v({issues:e.issues},[...t,...e.path]);else{let u=[...t,...e.path];if(u.length===0)o._errors.push(i(e));else{let g=o,$=0;while($<u.length){let c=u[$];if($!==u.length-1)g[c]=g[c]||{_errors:[]};else g[c]=g[c]||{_errors:[]},g[c]._errors.push(i(e));g=g[c],$++}}}};return v(n),o}function Lt(n,i=(o)=>o.message){let o={errors:[]},v=(r,t=[])=>{var e,u;for(let g of r.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map(($)=>v({issues:$},[...t,...g.path]));else if(g.code==="invalid_key")v({issues:g.issues},[...t,...g.path]);else if(g.code==="invalid_element")v({issues:g.issues},[...t,...g.path]);else{let $=[...t,...g.path];if($.length===0){o.errors.push(i(g));continue}let c=o,b=0;while(b<$.length){let S=$[b],D=b===$.length-1;if(typeof S==="string")c.properties??(c.properties={}),(e=c.properties)[S]??(e[S]={errors:[]}),c=c.properties[S];else c.items??(c.items=[]),(u=c.items)[S]??(u[S]={errors:[]}),c=c.items[S];if(D)c.errors.push(i(g));b++}}};return v(n),o}function zg(n){let i=[],o=n.map((v)=>typeof v==="object"?v.key:v);for(let v of o)if(typeof v==="number")i.push(`[${v}]`);else if(typeof v==="symbol")i.push(`[${JSON.stringify(String(v))}]`);else if(/[^\w$]/.test(v))i.push(`[${JSON.stringify(v)}]`);else{if(i.length)i.push(".");i.push(v)}return i.join("")}function Et(n){let i=[],o=[...n.issues].sort((v,r)=>(v.path??[]).length-(r.path??[]).length);for(let v of o)if(i.push(`\u2716 ${v.message}`),v.path?.length)i.push(` \u2192 at ${zg(v.path)}`);return i.join(`
|
|
2
|
+
import{Sh as s}from"./vm-hands-entry-lite-cxs89wzv.js";var mc={};s(mc,{xor:()=>Zl,xid:()=>kl,void:()=>Bl,uuidv7:()=>$l,uuidv6:()=>ul,uuidv4:()=>el,uuid:()=>vl,util:()=>k,url:()=>gl,uppercase:()=>Xr,unknown:()=>mr,union:()=>gt,undefined:()=>Tl,ulid:()=>Ul,uint64:()=>Ql,uint32:()=>ql,tuple:()=>Q$,trim:()=>Tr,treeifyError:()=>Lt,transform:()=>ct,toUpperCase:()=>Br,toLowerCase:()=>Hr,toJSONSchema:()=>Yi,templateLiteral:()=>uc,symbol:()=>Fl,superRefine:()=>cg,success:()=>tc,stringbool:()=>Uc,stringFormat:()=>Ll,string:()=>On,strictObject:()=>Rl,startsWith:()=>Kr,slugify:()=>Mr,size:()=>Dr,setErrorMap:()=>i4,set:()=>pl,safeParseAsync:()=>c$,safeParse:()=>l$,safeEncodeAsync:()=>w$,safeEncode:()=>k$,safeDecodeAsync:()=>S$,safeDecode:()=>D$,registry:()=>ui,regexes:()=>d,regex:()=>Ar,refine:()=>lg,record:()=>F$,readonly:()=>og,property:()=>Vi,promise:()=>$c,prettifyError:()=>Et,preprocess:()=>Dc,prefault:()=>y$,positive:()=>Ei,pipe:()=>di,partialRecord:()=>hl,parseAsync:()=>g$,parse:()=>$$,overwrite:()=>f,optional:()=>Pn,object:()=>xl,number:()=>N$,nullish:()=>ic,nullable:()=>Jn,null:()=>J$,normalize:()=>Fr,nonpositive:()=>Wi,nonoptional:()=>a$,nonnegative:()=>Ai,never:()=>$t,negative:()=>Gi,nativeEnum:()=>sl,nanoid:()=>Il,nan:()=>oc,multipleOf:()=>ur,minSize:()=>a,minLength:()=>nr,mime:()=>Qr,meta:()=>bc,maxSize:()=>$r,maxLength:()=>wr,map:()=>al,mac:()=>Sl,lte:()=>x,lt:()=>h,lowercase:()=>Vr,looseRecord:()=>yl,looseObject:()=>fl,locales:()=>Sn,literal:()=>rc,length:()=>Sr,lazy:()=>ug,ksuid:()=>Dl,keyof:()=>dl,jwt:()=>Jl,json:()=>kc,iso:()=>Rr,ipv6:()=>ml,ipv4:()=>wl,invertCodec:()=>ec,intersection:()=>K$,int64:()=>Yl,int32:()=>Xl,int:()=>Mi,instanceof:()=>_c,includes:()=>qr,httpUrl:()=>ll,hostname:()=>El,hex:()=>Gl,hash:()=>Wl,guid:()=>ol,gte:()=>Q,gt:()=>y,globalRegistry:()=>X,getErrorMap:()=>t4,function:()=>gc,fromJSONSchema:()=>Sc,formatError:()=>$n,float64:()=>Vl,float32:()=>Al,flattenError:()=>un,file:()=>nc,exactOptional:()=>R$,enum:()=>lt,endsWith:()=>Yr,encodeAsync:()=>_$,encode:()=>I$,emoji:()=>cl,email:()=>tl,e164:()=>Pl,discriminatedUnion:()=>Cl,describe:()=>Ic,decodeAsync:()=>U$,decode:()=>b$,date:()=>Ml,custom:()=>cc,cuid2:()=>_l,cuid:()=>bl,core:()=>ir,config:()=>W,coerce:()=>bg,codec:()=>vc,clone:()=>K,cidrv6:()=>zl,cidrv4:()=>Nl,check:()=>lc,catch:()=>rg,boolean:()=>z$,bigint:()=>Kl,base64url:()=>jl,base64:()=>Ol,array:()=>Wn,any:()=>Hl,_function:()=>gc,_default:()=>C$,_ZodString:()=>xi,ZodXor:()=>V$,ZodXID:()=>ai,ZodVoid:()=>W$,ZodUnknown:()=>E$,ZodUnion:()=>Vn,ZodUndefined:()=>j$,ZodUUID:()=>p,ZodURL:()=>En,ZodULID:()=>yi,ZodType:()=>O,ZodTuple:()=>Y$,ZodTransform:()=>d$,ZodTemplateLiteral:()=>vg,ZodSymbol:()=>O$,ZodSuccess:()=>p$,ZodStringFormat:()=>L,ZodString:()=>Cr,ZodSet:()=>H$,ZodRecord:()=>fr,ZodRealError:()=>M,ZodReadonly:()=>tg,ZodPromise:()=>$g,ZodPreprocess:()=>ig,ZodPrefault:()=>h$,ZodPipe:()=>Xn,ZodOptional:()=>It,ZodObject:()=>An,ZodNumberFormat:()=>Nr,ZodNumber:()=>yr,ZodNullable:()=>f$,ZodNull:()=>P$,ZodNonOptional:()=>bt,ZodNever:()=>G$,ZodNanoID:()=>Zi,ZodNaN:()=>ng,ZodMap:()=>T$,ZodMAC:()=>m$,ZodLiteral:()=>B$,ZodLazy:()=>eg,ZodKSUID:()=>pi,ZodJWT:()=>et,ZodIssueCode:()=>n4,ZodIntersection:()=>q$,ZodISOTime:()=>Hi,ZodISODuration:()=>Bi,ZodISODateTime:()=>Fi,ZodISODate:()=>Ti,ZodIPv6:()=>rt,ZodIPv4:()=>si,ZodGUID:()=>jn,ZodFunction:()=>gg,ZodFirstPartyTypeKind:()=>Ig,ZodFile:()=>M$,ZodExactOptional:()=>x$,ZodError:()=>sb,ZodEnum:()=>Zr,ZodEmoji:()=>fi,ZodEmail:()=>Ri,ZodE164:()=>vt,ZodDiscriminatedUnion:()=>X$,ZodDefault:()=>Z$,ZodDate:()=>Gn,ZodCustomStringFormat:()=>hr,ZodCustom:()=>Kn,ZodCodec:()=>qn,ZodCatch:()=>s$,ZodCUID2:()=>hi,ZodCUID:()=>Ci,ZodCIDRv6:()=>it,ZodCIDRv4:()=>nt,ZodBoolean:()=>ar,ZodBigIntFormat:()=>ut,ZodBigInt:()=>pr,ZodBase64URL:()=>ot,ZodBase64:()=>tt,ZodArray:()=>A$,ZodAny:()=>L$,TimePrecision:()=>Qe,NEVER:()=>Ut,$output:()=>Ae,$input:()=>Ve,$brand:()=>kt});var ir={};s(ir,{version:()=>jo,util:()=>k,treeifyError:()=>Lt,toJSONSchema:()=>Yi,toDotPath:()=>zg,safeParseAsync:()=>Wt,safeParse:()=>Gt,safeEncodeAsync:()=>nI,safeEncode:()=>sc,safeDecodeAsync:()=>iI,safeDecode:()=>rI,registry:()=>ui,regexes:()=>d,process:()=>P,prettifyError:()=>Et,parseAsync:()=>Tn,parse:()=>Fn,meta:()=>Du,locales:()=>Sn,isValidJWT:()=>xg,isValidBase64URL:()=>dg,isValidBase64:()=>Zo,initializeContext:()=>gr,globalRegistry:()=>X,globalConfig:()=>Ir,formatError:()=>$n,flattenError:()=>un,finalize:()=>cr,extractDefs:()=>lr,encodeAsync:()=>ac,encode:()=>hc,describe:()=>ku,decodeAsync:()=>pc,decode:()=>yc,createToJSONSchemaMethod:()=>Su,createStandardJSONSchemaMethod:()=>xr,config:()=>W,clone:()=>K,_xor:()=>Gb,_xid:()=>wi,_void:()=>uu,_uuidv7:()=>Ii,_uuidv6:()=>ci,_uuidv4:()=>li,_uuid:()=>gi,_url:()=>Nn,_uppercase:()=>Xr,_unknown:()=>vu,_union:()=>Eb,_undefined:()=>iu,_ulid:()=>Di,_uint64:()=>ru,_uint32:()=>Ce,_tuple:()=>Vb,_trim:()=>Tr,_transform:()=>Tb,_toUpperCase:()=>Br,_toLowerCase:()=>Hr,_templateLiteral:()=>Cb,_symbol:()=>nu,_superRefine:()=>Uu,_success:()=>xb,_stringbool:()=>wu,_stringFormat:()=>dr,_string:()=>qe,_startsWith:()=>Kr,_slugify:()=>Mr,_size:()=>Dr,_set:()=>Kb,_safeParseAsync:()=>Er,_safeParse:()=>Lr,_safeEncodeAsync:()=>fn,_safeEncode:()=>xn,_safeDecodeAsync:()=>Zn,_safeDecode:()=>Rn,_regex:()=>Ar,_refine:()=>_u,_record:()=>Xb,_readonly:()=>Zb,_property:()=>Vi,_promise:()=>yb,_positive:()=>Ei,_pipe:()=>fb,_parseAsync:()=>Jr,_parse:()=>Pr,_overwrite:()=>f,_optional:()=>Hb,_number:()=>Me,_nullable:()=>Bb,_null:()=>tu,_normalize:()=>Fr,_nonpositive:()=>Wi,_nonoptional:()=>db,_nonnegative:()=>Ai,_never:()=>eu,_negative:()=>Gi,_nativeEnum:()=>Qb,_nanoid:()=>_i,_nan:()=>lu,_multipleOf:()=>ur,_minSize:()=>a,_minLength:()=>nr,_min:()=>Q,_mime:()=>Qr,_maxSize:()=>$r,_maxLength:()=>wr,_max:()=>x,_map:()=>qb,_mac:()=>Ye,_lte:()=>x,_lt:()=>h,_lowercase:()=>Vr,_literal:()=>Fb,_length:()=>Sr,_lazy:()=>hb,_ksuid:()=>Si,_jwt:()=>Li,_isoTime:()=>He,_isoDuration:()=>Be,_isoDateTime:()=>Fe,_isoDate:()=>Te,_ipv6:()=>Ni,_ipv4:()=>mi,_intersection:()=>Ab,_int64:()=>se,_int32:()=>Ze,_int:()=>xe,_includes:()=>qr,_guid:()=>mn,_gte:()=>Q,_gt:()=>y,_float64:()=>fe,_float32:()=>Re,_file:()=>Iu,_enum:()=>Yb,_endsWith:()=>Yr,_encodeAsync:()=>Mn,_encode:()=>Hn,_emoji:()=>bi,_email:()=>$i,_e164:()=>Ji,_discriminatedUnion:()=>Wb,_default:()=>Mb,_decodeAsync:()=>dn,_decode:()=>Bn,_date:()=>$u,_custom:()=>bu,_cuid2:()=>ki,_cuid:()=>Ui,_coercedString:()=>Ke,_coercedNumber:()=>de,_coercedDate:()=>gu,_coercedBoolean:()=>ye,_coercedBigint:()=>pe,_cidrv6:()=>Oi,_cidrv4:()=>zi,_check:()=>sg,_catch:()=>Rb,_boolean:()=>he,_bigint:()=>ae,_base64url:()=>Pi,_base64:()=>ji,_array:()=>cu,_any:()=>ou,TimePrecision:()=>Qe,NEVER:()=>Ut,JSONSchemaGenerator:()=>t$,JSONSchema:()=>rl,Doc:()=>an,$output:()=>Ae,$input:()=>Ve,$constructor:()=>l,$brand:()=>kt,$ZodXor:()=>cv,$ZodXID:()=>Ko,$ZodVoid:()=>uv,$ZodUnknown:()=>vv,$ZodUnion:()=>bn,$ZodUndefined:()=>iv,$ZodUUID:()=>Lo,$ZodURL:()=>Go,$ZodULID:()=>qo,$ZodType:()=>z,$ZodTuple:()=>oi,$ZodTransform:()=>mv,$ZodTemplateLiteral:()=>Av,$ZodSymbol:()=>nv,$ZodSuccess:()=>Jv,$ZodStringFormat:()=>J,$ZodString:()=>kr,$ZodSet:()=>kv,$ZodRegistry:()=>Xe,$ZodRecord:()=>_v,$ZodRealError:()=>B,$ZodReadonly:()=>Wv,$ZodPromise:()=>Xv,$ZodPreprocess:()=>Gv,$ZodPrefault:()=>jv,$ZodPipe:()=>ei,$ZodOptional:()=>vi,$ZodObjectJIT:()=>lv,$ZodObject:()=>Zg,$ZodNumberFormat:()=>so,$ZodNumber:()=>ii,$ZodNullable:()=>zv,$ZodNull:()=>tv,$ZodNonOptional:()=>Pv,$ZodNever:()=>ev,$ZodNanoID:()=>Ao,$ZodNaN:()=>Ev,$ZodMap:()=>Uv,$ZodMAC:()=>xo,$ZodLiteral:()=>wv,$ZodLazy:()=>qv,$ZodKSUID:()=>Yo,$ZodJWT:()=>ao,$ZodIntersection:()=>bv,$ZodISOTime:()=>To,$ZodISODuration:()=>Ho,$ZodISODateTime:()=>Qo,$ZodISODate:()=>Fo,$ZodIPv6:()=>Mo,$ZodIPv4:()=>Bo,$ZodGUID:()=>Jo,$ZodFunction:()=>Vv,$ZodFile:()=>Sv,$ZodExactOptional:()=>Nv,$ZodError:()=>en,$ZodEnum:()=>Dv,$ZodEncodeError:()=>br,$ZodEmoji:()=>Wo,$ZodEmail:()=>Eo,$ZodE164:()=>yo,$ZodDiscriminatedUnion:()=>Iv,$ZodDefault:()=>Ov,$ZodDate:()=>$v,$ZodCustomStringFormat:()=>po,$ZodCustom:()=>Kv,$ZodCodec:()=>_n,$ZodCheckUpperCase:()=>Do,$ZodCheckStringFormat:()=>Gr,$ZodCheckStartsWith:()=>So,$ZodCheckSizeEquals:()=>co,$ZodCheckRegex:()=>Uo,$ZodCheckProperty:()=>No,$ZodCheckOverwrite:()=>Oo,$ZodCheckNumberFormat:()=>uo,$ZodCheckMultipleOf:()=>eo,$ZodCheckMinSize:()=>lo,$ZodCheckMinLength:()=>bo,$ZodCheckMimeType:()=>zo,$ZodCheckMaxSize:()=>go,$ZodCheckMaxLength:()=>Io,$ZodCheckLowerCase:()=>ko,$ZodCheckLessThan:()=>hn,$ZodCheckLengthEquals:()=>_o,$ZodCheckIncludes:()=>wo,$ZodCheckGreaterThan:()=>yn,$ZodCheckEndsWith:()=>mo,$ZodCheckBigIntFormat:()=>$o,$ZodCheck:()=>E,$ZodCatch:()=>Lv,$ZodCUID2:()=>Xo,$ZodCUID:()=>Vo,$ZodCIDRv6:()=>fo,$ZodCIDRv4:()=>Ro,$ZodBoolean:()=>In,$ZodBigIntFormat:()=>rv,$ZodBigInt:()=>ti,$ZodBase64URL:()=>ho,$ZodBase64:()=>Co,$ZodAsyncError:()=>C,$ZodArray:()=>gv,$ZodAny:()=>ov});var kg,Ut=Object.freeze({status:"aborted"});function l(n,i,o){function v(u,g){if(!u._zod)Object.defineProperty(u,"_zod",{value:{def:g,constr:e,traits:new Set},enumerable:!1});if(u._zod.traits.has(n))return;u._zod.traits.add(n),i(u,g);let $=e.prototype,c=Object.keys($);for(let b=0;b<c.length;b++){let S=c[b];if(!(S in u))u[S]=$[S].bind(u)}}let r=o?.Parent??Object;class t extends r{}Object.defineProperty(t,"name",{value:n});function e(u){var g;let $=o?.Parent?new t:this;v($,u),(g=$._zod).deferred??(g.deferred=[]);for(let c of $._zod.deferred)c();return $}return Object.defineProperty(e,"init",{value:v}),Object.defineProperty(e,Symbol.hasInstance,{value:(u)=>{if(o?.Parent&&u instanceof o.Parent)return!0;return u?._zod?.traits?.has(n)}}),Object.defineProperty(e,"name",{value:n}),e}var kt=Symbol("zod_brand");class C extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class br extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`);this.name="ZodEncodeError"}}(kg=globalThis).__zod_globalConfig??(kg.__zod_globalConfig={});var Ir=globalThis.__zod_globalConfig;function W(n){if(n)Object.assign(Ir,n);return Ir}var k={};s(k,{unwrapMessage:()=>sr,uint8ArrayToHex:()=>Zc,uint8ArrayToBase64url:()=>Rc,uint8ArrayToBase64:()=>Sg,stringifyPrimitive:()=>_,slugify:()=>St,shallowClone:()=>Nt,safeExtend:()=>Tc,required:()=>Mc,randomString:()=>Vc,propertyKeyTypes:()=>tn,promiseAllObject:()=>Ac,primitiveTypes:()=>zt,prefixIssues:()=>H,pick:()=>Yc,partial:()=>Bc,parsedType:()=>U,optionalKeys:()=>Ot,omit:()=>Qc,objectClone:()=>Ec,numKeys:()=>Xc,nullish:()=>tr,normalizeParams:()=>w,mergeDefs:()=>rr,merge:()=>Hc,jsonStringifyReplacer:()=>zr,joinValues:()=>I,issue:()=>jr,isPlainObject:()=>vr,isObject:()=>_r,hexToUint8Array:()=>fc,getSizableOrigin:()=>on,getParsedType:()=>qc,getLengthableOrigin:()=>vn,getEnumValues:()=>rn,getElementAtPath:()=>Wc,floatSafeRemainder:()=>wt,finalizeIssue:()=>Y,extend:()=>Fc,explicitlyAborted:()=>Jt,escapeRegex:()=>R,esc:()=>Yn,defineLazy:()=>j,createTransparentProxy:()=>Kc,cloneDef:()=>Gc,clone:()=>K,cleanRegex:()=>nn,cleanEnum:()=>dc,captureStackTrace:()=>Qn,cached:()=>Or,base64urlToUint8Array:()=>xc,base64ToUint8Array:()=>wg,assignProp:()=>or,assertNotEqual:()=>jc,assertNever:()=>Jc,assertIs:()=>Pc,assertEqual:()=>Oc,assert:()=>Lc,allowsEval:()=>mt,aborted:()=>er,NUMBER_FORMAT_RANGES:()=>jt,Class:()=>mg,BIGINT_FORMAT_RANGES:()=>Pt});function Oc(n){return n}function jc(n){return n}function Pc(n){}function Jc(n){throw Error("Unexpected value in exhaustive check")}function Lc(n){}function rn(n){let i=Object.values(n).filter((v)=>typeof v==="number");return Object.entries(n).filter(([v,r])=>i.indexOf(+v)===-1).map(([v,r])=>r)}function I(n,i="|"){return n.map((o)=>_(o)).join(i)}function zr(n,i){if(typeof i==="bigint")return i.toString();return i}function Or(n){return{get value(){{let o=n();return Object.defineProperty(this,"value",{value:o}),o}throw Error("cached value already set")}}}function tr(n){return n===null||n===void 0}function nn(n){let i=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;return n.slice(i,o)}function wt(n,i){let o=n/i,v=Math.round(o),r=Number.EPSILON*Math.max(Math.abs(o),1);if(Math.abs(o-v)<r)return 0;return o-v}var Dg=Symbol("evaluating");function j(n,i,o){let v=void 0;Object.defineProperty(n,i,{get(){if(v===Dg)return;if(v===void 0)v=Dg,v=o();return v},set(r){Object.defineProperty(n,i,{value:r})},configurable:!0})}function Ec(n){return Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n))}function or(n,i,o){Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}function rr(...n){let i={};for(let o of n){let v=Object.getOwnPropertyDescriptors(o);Object.assign(i,v)}return Object.defineProperties({},i)}function Gc(n){return rr(n._zod.def)}function Wc(n,i){if(!i)return n;return i.reduce((o,v)=>o?.[v],n)}function Ac(n){let i=Object.keys(n),o=i.map((v)=>n[v]);return Promise.all(o).then((v)=>{let r={};for(let t=0;t<i.length;t++)r[i[t]]=v[t];return r})}function Vc(n=10){let o="";for(let v=0;v<n;v++)o+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return o}function Yn(n){return JSON.stringify(n)}function St(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Qn="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function _r(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}var mt=Or(()=>{if(Ir.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(n){return!1}});function vr(n){if(_r(n)===!1)return!1;let i=n.constructor;if(i===void 0)return!0;if(typeof i!=="function")return!0;let o=i.prototype;if(_r(o)===!1)return!1;if(Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)return!1;return!0}function Nt(n){if(vr(n))return{...n};if(Array.isArray(n))return[...n];if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);return n}function Xc(n){let i=0;for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))i++;return i}var qc=(n)=>{let i=typeof n;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(n)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(n))return"array";if(n===null)return"null";if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return"promise";if(typeof Map<"u"&&n instanceof Map)return"map";if(typeof Set<"u"&&n instanceof Set)return"set";if(typeof Date<"u"&&n instanceof Date)return"date";if(typeof File<"u"&&n instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${i}`)}},tn=new Set(["string","number","symbol"]),zt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function R(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function K(n,i,o){let v=new n._zod.constr(i??n._zod.def);if(!i||o?.parent)v._zod.parent=n;return v}function w(n){let i=n;if(!i)return{};if(typeof i==="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");i.error=i.message}if(delete i.message,typeof i.error==="string")return{...i,error:()=>i.error};return i}function Kc(n){let i;return new Proxy({},{get(o,v,r){return i??(i=n()),Reflect.get(i,v,r)},set(o,v,r,t){return i??(i=n()),Reflect.set(i,v,r,t)},has(o,v){return i??(i=n()),Reflect.has(i,v)},deleteProperty(o,v){return i??(i=n()),Reflect.deleteProperty(i,v)},ownKeys(o){return i??(i=n()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(o,v){return i??(i=n()),Reflect.getOwnPropertyDescriptor(i,v)},defineProperty(o,v,r){return i??(i=n()),Reflect.defineProperty(i,v,r)}})}function _(n){if(typeof n==="bigint")return n.toString()+"n";if(typeof n==="string")return`"${n}"`;return`${n}`}function Ot(n){return Object.keys(n).filter((i)=>{return n[i]._zod.optin==="optional"&&n[i]._zod.optout==="optional"})}var jt={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]},Pt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Yc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;e[u]=o.shape[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Qc(n,i){let o=n._zod.def,v=o.checks;if(v&&v.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let t=rr(n._zod.def,{get shape(){let e={...n._zod.def.shape};for(let u in i){if(!(u in o.shape))throw Error(`Unrecognized key: "${u}"`);if(!i[u])continue;delete e[u]}return or(this,"shape",e),e},checks:[]});return K(n,t)}function Fc(n,i){if(!vr(i))throw Error("Invalid input to extend: expected a plain object");let o=n._zod.def.checks;if(o&&o.length>0){let t=n._zod.def.shape;for(let e in i)if(Object.getOwnPropertyDescriptor(t,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=rr(n._zod.def,{get shape(){let t={...n._zod.def.shape,...i};return or(this,"shape",t),t}});return K(n,r)}function Tc(n,i){if(!vr(i))throw Error("Invalid input to safeExtend: expected a plain object");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i};return or(this,"shape",v),v}});return K(n,o)}function Hc(n,i){if(n._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let o=rr(n._zod.def,{get shape(){let v={...n._zod.def.shape,...i._zod.def.shape};return or(this,"shape",v),v},get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return K(n,o)}function Bc(n,i,o){let r=i._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let e=rr(i._zod.def,{get shape(){let u=i._zod.def.shape,g={...u};if(o)for(let $ in o){if(!($ in u))throw Error(`Unrecognized key: "${$}"`);if(!o[$])continue;g[$]=n?new n({type:"optional",innerType:u[$]}):u[$]}else for(let $ in u)g[$]=n?new n({type:"optional",innerType:u[$]}):u[$];return or(this,"shape",g),g},checks:[]});return K(i,e)}function Mc(n,i,o){let v=rr(i._zod.def,{get shape(){let r=i._zod.def.shape,t={...r};if(o)for(let e in o){if(!(e in t))throw Error(`Unrecognized key: "${e}"`);if(!o[e])continue;t[e]=new n({type:"nonoptional",innerType:r[e]})}else for(let e in r)t[e]=new n({type:"nonoptional",innerType:r[e]});return or(this,"shape",t),t}});return K(i,v)}function er(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue!==!0)return!0;return!1}function Jt(n,i=0){if(n.aborted===!0)return!0;for(let o=i;o<n.issues.length;o++)if(n.issues[o]?.continue===!1)return!0;return!1}function H(n,i){return i.map((o)=>{var v;return(v=o).path??(v.path=[]),o.path.unshift(n),o})}function sr(n){return typeof n==="string"?n:n?.message}function Y(n,i,o){let v=n.message?n.message:sr(n.inst?._zod.def?.error?.(n))??sr(i?.error?.(n))??sr(o.customError?.(n))??sr(o.localeError?.(n))??"Invalid input",{inst:r,continue:t,input:e,...u}=n;if(u.path??(u.path=[]),u.message=v,i?.reportInput)u.input=e;return u}function on(n){if(n instanceof Set)return"set";if(n instanceof Map)return"map";if(n instanceof File)return"file";return"unknown"}function vn(n){if(Array.isArray(n))return"array";if(typeof n==="string")return"string";return"unknown"}function U(n){let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"nan":"number";case"object":{if(n===null)return"null";if(Array.isArray(n))return"array";let o=n;if(o&&Object.getPrototypeOf(o)!==Object.prototype&&"constructor"in o&&o.constructor)return o.constructor.name}}return i}function jr(...n){let[i,o,v]=n;if(typeof i==="string")return{message:i,code:"custom",input:o,inst:v};return{...i}}function dc(n){return Object.entries(n).filter(([i,o])=>{return Number.isNaN(Number.parseInt(i,10))}).map((i)=>i[1])}function wg(n){let i=atob(n),o=new Uint8Array(i.length);for(let v=0;v<i.length;v++)o[v]=i.charCodeAt(v);return o}function Sg(n){let i="";for(let o=0;o<n.length;o++)i+=String.fromCharCode(n[o]);return btoa(i)}function xc(n){let i=n.replace(/-/g,"+").replace(/_/g,"/"),o="=".repeat((4-i.length%4)%4);return wg(i+o)}function Rc(n){return Sg(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function fc(n){let i=n.replace(/^0x/,"");if(i.length%2!==0)throw Error("Invalid hex string length");let o=new Uint8Array(i.length/2);for(let v=0;v<i.length;v+=2)o[v/2]=Number.parseInt(i.slice(v,v+2),16);return o}function Zc(n){return Array.from(n).map((i)=>i.toString(16).padStart(2,"0")).join("")}class mg{constructor(...n){}}var Ng=(n,i)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:i,enumerable:!1}),n.message=JSON.stringify(i,zr,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},en=l("$ZodError",Ng),B=l("$ZodError",Ng,{Parent:Error});function un(n,i=(o)=>o.message){let o={},v=[];for(let r of n.issues)if(r.path.length>0)o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(i(r));else v.push(i(r));return{formErrors:v,fieldErrors:o}}function $n(n,i=(o)=>o.message){let o={_errors:[]},v=(r,t=[])=>{for(let e of r.issues)if(e.code==="invalid_union"&&e.errors.length)e.errors.map((u)=>v({issues:u},[...t,...e.path]));else if(e.code==="invalid_key")v({issues:e.issues},[...t,...e.path]);else if(e.code==="invalid_element")v({issues:e.issues},[...t,...e.path]);else{let u=[...t,...e.path];if(u.length===0)o._errors.push(i(e));else{let g=o,$=0;while($<u.length){let c=u[$];if($!==u.length-1)g[c]=g[c]||{_errors:[]};else g[c]=g[c]||{_errors:[]},g[c]._errors.push(i(e));g=g[c],$++}}}};return v(n),o}function Lt(n,i=(o)=>o.message){let o={errors:[]},v=(r,t=[])=>{var e,u;for(let g of r.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map(($)=>v({issues:$},[...t,...g.path]));else if(g.code==="invalid_key")v({issues:g.issues},[...t,...g.path]);else if(g.code==="invalid_element")v({issues:g.issues},[...t,...g.path]);else{let $=[...t,...g.path];if($.length===0){o.errors.push(i(g));continue}let c=o,b=0;while(b<$.length){let S=$[b],D=b===$.length-1;if(typeof S==="string")c.properties??(c.properties={}),(e=c.properties)[S]??(e[S]={errors:[]}),c=c.properties[S];else c.items??(c.items=[]),(u=c.items)[S]??(u[S]={errors:[]}),c=c.items[S];if(D)c.errors.push(i(g));b++}}};return v(n),o}function zg(n){let i=[],o=n.map((v)=>typeof v==="object"?v.key:v);for(let v of o)if(typeof v==="number")i.push(`[${v}]`);else if(typeof v==="symbol")i.push(`[${JSON.stringify(String(v))}]`);else if(/[^\w$]/.test(v))i.push(`[${JSON.stringify(v)}]`);else{if(i.length)i.push(".");i.push(v)}return i.join("")}function Et(n){let i=[],o=[...n.issues].sort((v,r)=>(v.path??[]).length-(r.path??[]).length);for(let v of o)if(i.push(`\u2716 ${v.message}`),v.path?.length)i.push(` \u2192 at ${zg(v.path)}`);return i.join(`
|
|
3
3
|
`)}var Pr=(n)=>(i,o,v,r)=>{let t=v?{...v,async:!1}:{async:!1},e=i._zod.run({value:o,issues:[]},t);if(e instanceof Promise)throw new C;if(e.issues.length){let u=new(r?.Err??n)(e.issues.map((g)=>Y(g,t,W())));throw Qn(u,r?.callee),u}return e.value},Fn=Pr(B),Jr=(n)=>async(i,o,v,r)=>{let t=v?{...v,async:!0}:{async:!0},e=i._zod.run({value:o,issues:[]},t);if(e instanceof Promise)e=await e;if(e.issues.length){let u=new(r?.Err??n)(e.issues.map((g)=>Y(g,t,W())));throw Qn(u,r?.callee),u}return e.value},Tn=Jr(B),Lr=(n)=>(i,o,v)=>{let r=v?{...v,async:!1}:{async:!1},t=i._zod.run({value:o,issues:[]},r);if(t instanceof Promise)throw new C;return t.issues.length?{success:!1,error:new(n??en)(t.issues.map((e)=>Y(e,r,W())))}:{success:!0,data:t.value}},Gt=Lr(B),Er=(n)=>async(i,o,v)=>{let r=v?{...v,async:!0}:{async:!0},t=i._zod.run({value:o,issues:[]},r);if(t instanceof Promise)t=await t;return t.issues.length?{success:!1,error:new n(t.issues.map((e)=>Y(e,r,W())))}:{success:!0,data:t.value}},Wt=Er(B),Hn=(n)=>(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Pr(n)(i,o,r)},hc=Hn(B),Bn=(n)=>(i,o,v)=>{return Pr(n)(i,o,v)},yc=Bn(B),Mn=(n)=>async(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Jr(n)(i,o,r)},ac=Mn(B),dn=(n)=>async(i,o,v)=>{return Jr(n)(i,o,v)},pc=dn(B),xn=(n)=>(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Lr(n)(i,o,r)},sc=xn(B),Rn=(n)=>(i,o,v)=>{return Lr(n)(i,o,v)},rI=Rn(B),fn=(n)=>async(i,o,v)=>{let r=v?{...v,direction:"backward"}:{direction:"backward"};return Er(n)(i,o,r)},nI=fn(B),Zn=(n)=>async(i,o,v)=>{return Er(n)(i,o,v)},iI=Zn(B);var d={};s(d,{xid:()=>qt,uuid7:()=>eI,uuid6:()=>vI,uuid4:()=>oI,uuid:()=>Ur,uppercase:()=>vo,unicodeEmail:()=>Og,undefined:()=>to,ulid:()=>Xt,time:()=>yt,string:()=>pt,sha512_hex:()=>LI,sha512_base64url:()=>GI,sha512_base64:()=>EI,sha384_hex:()=>jI,sha384_base64url:()=>JI,sha384_base64:()=>PI,sha256_hex:()=>NI,sha256_base64url:()=>OI,sha256_base64:()=>zI,sha1_hex:()=>wI,sha1_base64url:()=>mI,sha1_base64:()=>SI,rfc5322Email:()=>$I,number:()=>gn,null:()=>io,nanoid:()=>Yt,md5_hex:()=>UI,md5_base64url:()=>DI,md5_base64:()=>kI,mac:()=>dt,lowercase:()=>oo,ksuid:()=>Kt,ipv6:()=>Mt,ipv4:()=>Bt,integer:()=>ro,idnEmail:()=>gI,httpProtocol:()=>Zt,html5Email:()=>uI,hostname:()=>II,hex:()=>_I,guid:()=>Ft,extendedDuration:()=>tI,emoji:()=>Ht,email:()=>Tt,e164:()=>Ct,duration:()=>Qt,domain:()=>bI,datetime:()=>at,date:()=>ht,cuid2:()=>Vt,cuid:()=>At,cidrv6:()=>Rt,cidrv4:()=>xt,browserEmail:()=>lI,boolean:()=>no,bigint:()=>st,base64url:()=>Cn,base64:()=>ft});var At=/^[cC][0-9a-z]{6,}$/,Vt=/^[0-9a-z]+$/,Xt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qt=/^[0-9a-vA-V]{20}$/,Kt=/^[A-Za-z0-9]{27}$/,Yt=/^[a-zA-Z0-9_-]{21}$/,Qt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ft=/^([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})$/,Ur=(n)=>{if(!n)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}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},oI=Ur(4),vI=Ur(6),eI=Ur(7),Tt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,$I=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Og=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,gI=Og,lI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,cI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ht(){return new RegExp(cI,"u")}var Bt=/^(?:(?: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])$/,Mt=/^(([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}|:))$/,dt=(n)=>{let i=R(n??":");return new RegExp(`^(?:[0-9A-F]{2}${i}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${i}){5}[0-9a-f]{2}$`)},xt=/^((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])$/,Rt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ft=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cn=/^[A-Za-z0-9_-]*$/,II=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,bI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Zt=/^https?$/,Ct=/^\+[1-9]\d{6,14}$/,jg="(?:(?:\\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])))",ht=new RegExp(`^${jg}$`);function Pg(n){return typeof n.precision==="number"?n.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":n.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{${n.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function yt(n){return new RegExp(`^${Pg(n)}$`)}function at(n){let i=Pg({precision:n.precision}),o=["Z"];if(n.local)o.push("");if(n.offset)o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let v=`${i}(?:${o.join("|")})`;return new RegExp(`^${jg}T(?:${v})$`)}var pt=(n)=>{let i=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${i}$`)},st=/^-?\d+n?$/,ro=/^-?\d+$/,gn=/^-?\d+(?:\.\d+)?$/,no=/^(?:true|false)$/i,io=/^null$/i;var to=/^undefined$/i;var oo=/^[^A-Z]*$/,vo=/^[^a-z]*$/,_I=/^[0-9a-fA-F]*$/;function ln(n,i){return new RegExp(`^[A-Za-z0-9+/]{${n}}${i}$`)}function cn(n){return new RegExp(`^[A-Za-z0-9_-]{${n}}$`)}var UI=/^[0-9a-fA-F]{32}$/,kI=ln(22,"=="),DI=cn(22),wI=/^[0-9a-fA-F]{40}$/,SI=ln(27,"="),mI=cn(27),NI=/^[0-9a-fA-F]{64}$/,zI=ln(43,"="),OI=cn(43),jI=/^[0-9a-fA-F]{96}$/,PI=ln(64,""),JI=cn(64),LI=/^[0-9a-fA-F]{128}$/,EI=ln(86,"=="),GI=cn(86);var E=l("$ZodCheck",(n,i)=>{var o;n._zod??(n._zod={}),n._zod.def=i,(o=n._zod).onattach??(o.onattach=[])}),Lg={number:"number",bigint:"bigint",object:"date"},hn=l("$ZodCheckLessThan",(n,i)=>{E.init(n,i);let o=Lg[typeof i.value];n._zod.onattach.push((v)=>{let r=v._zod.bag,t=(i.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(i.value<t)if(i.inclusive)r.maximum=i.value;else r.exclusiveMaximum=i.value}),n._zod.check=(v)=>{if(i.inclusive?v.value<=i.value:v.value<i.value)return;v.issues.push({origin:o,code:"too_big",maximum:typeof i.value==="object"?i.value.getTime():i.value,input:v.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),yn=l("$ZodCheckGreaterThan",(n,i)=>{E.init(n,i);let o=Lg[typeof i.value];n._zod.onattach.push((v)=>{let r=v._zod.bag,t=(i.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(i.value>t)if(i.inclusive)r.minimum=i.value;else r.exclusiveMinimum=i.value}),n._zod.check=(v)=>{if(i.inclusive?v.value>=i.value:v.value>i.value)return;v.issues.push({origin:o,code:"too_small",minimum:typeof i.value==="object"?i.value.getTime():i.value,input:v.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),eo=l("$ZodCheckMultipleOf",(n,i)=>{E.init(n,i),n._zod.onattach.push((o)=>{var v;(v=o._zod.bag).multipleOf??(v.multipleOf=i.value)}),n._zod.check=(o)=>{if(typeof o.value!==typeof i.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof o.value==="bigint"?o.value%i.value===BigInt(0):wt(o.value,i.value)===0)return;o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:i.value,input:o.value,inst:n,continue:!i.abort})}}),uo=l("$ZodCheckNumberFormat",(n,i)=>{E.init(n,i),i.format=i.format||"float64";let o=i.format?.includes("int"),v=o?"int":"number",[r,t]=jt[i.format];n._zod.onattach.push((e)=>{let u=e._zod.bag;if(u.format=i.format,u.minimum=r,u.maximum=t,o)u.pattern=ro}),n._zod.check=(e)=>{let u=e.value;if(o){if(!Number.isInteger(u)){e.issues.push({expected:v,format:i.format,code:"invalid_type",continue:!1,input:u,inst:n});return}if(!Number.isSafeInteger(u)){if(u>0)e.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:v,inclusive:!0,continue:!i.abort});else e.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:v,inclusive:!0,continue:!i.abort});return}}if(u<r)e.issues.push({origin:"number",input:u,code:"too_small",minimum:r,inclusive:!0,inst:n,continue:!i.abort});if(u>t)e.issues.push({origin:"number",input:u,code:"too_big",maximum:t,inclusive:!0,inst:n,continue:!i.abort})}}),$o=l("$ZodCheckBigIntFormat",(n,i)=>{E.init(n,i);let[o,v]=Pt[i.format];n._zod.onattach.push((r)=>{let t=r._zod.bag;t.format=i.format,t.minimum=o,t.maximum=v}),n._zod.check=(r)=>{let t=r.value;if(t<o)r.issues.push({origin:"bigint",input:t,code:"too_small",minimum:o,inclusive:!0,inst:n,continue:!i.abort});if(t>v)r.issues.push({origin:"bigint",input:t,code:"too_big",maximum:v,inclusive:!0,inst:n,continue:!i.abort})}}),go=l("$ZodCheckMaxSize",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.size!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<r)v._zod.bag.maximum=i.maximum}),n._zod.check=(v)=>{let r=v.value;if(r.size<=i.maximum)return;v.issues.push({origin:on(r),code:"too_big",maximum:i.maximum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),lo=l("$ZodCheckMinSize",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.size!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>r)v._zod.bag.minimum=i.minimum}),n._zod.check=(v)=>{let r=v.value;if(r.size>=i.minimum)return;v.issues.push({origin:on(r),code:"too_small",minimum:i.minimum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),co=l("$ZodCheckSizeEquals",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.size!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.minimum=i.size,r.maximum=i.size,r.size=i.size}),n._zod.check=(v)=>{let r=v.value,t=r.size;if(t===i.size)return;let e=t>i.size;v.issues.push({origin:on(r),...e?{code:"too_big",maximum:i.size}:{code:"too_small",minimum:i.size},inclusive:!0,exact:!0,input:v.value,inst:n,continue:!i.abort})}}),Io=l("$ZodCheckMaxLength",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.length!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<r)v._zod.bag.maximum=i.maximum}),n._zod.check=(v)=>{let r=v.value;if(r.length<=i.maximum)return;let e=vn(r);v.issues.push({origin:e,code:"too_big",maximum:i.maximum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),bo=l("$ZodCheckMinLength",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.length!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>r)v._zod.bag.minimum=i.minimum}),n._zod.check=(v)=>{let r=v.value;if(r.length>=i.minimum)return;let e=vn(r);v.issues.push({origin:e,code:"too_small",minimum:i.minimum,inclusive:!0,input:r,inst:n,continue:!i.abort})}}),_o=l("$ZodCheckLengthEquals",(n,i)=>{var o;E.init(n,i),(o=n._zod.def).when??(o.when=(v)=>{let r=v.value;return!tr(r)&&r.length!==void 0}),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.minimum=i.length,r.maximum=i.length,r.length=i.length}),n._zod.check=(v)=>{let r=v.value,t=r.length;if(t===i.length)return;let e=vn(r),u=t>i.length;v.issues.push({origin:e,...u?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:v.value,inst:n,continue:!i.abort})}}),Gr=l("$ZodCheckStringFormat",(n,i)=>{var o,v;if(E.init(n,i),n._zod.onattach.push((r)=>{let t=r._zod.bag;if(t.format=i.format,i.pattern)t.patterns??(t.patterns=new Set),t.patterns.add(i.pattern)}),i.pattern)(o=n._zod).check??(o.check=(r)=>{if(i.pattern.lastIndex=0,i.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:i.format,input:r.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:n,continue:!i.abort})});else(v=n._zod).check??(v.check=()=>{})}),Uo=l("$ZodCheckRegex",(n,i)=>{Gr.init(n,i),n._zod.check=(o)=>{if(i.pattern.lastIndex=0,i.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:i.pattern.toString(),inst:n,continue:!i.abort})}}),ko=l("$ZodCheckLowerCase",(n,i)=>{i.pattern??(i.pattern=oo),Gr.init(n,i)}),Do=l("$ZodCheckUpperCase",(n,i)=>{i.pattern??(i.pattern=vo),Gr.init(n,i)}),wo=l("$ZodCheckIncludes",(n,i)=>{E.init(n,i);let o=R(i.includes),v=new RegExp(typeof i.position==="number"?`^.{${i.position}}${o}`:o);i.pattern=v,n._zod.onattach.push((r)=>{let t=r._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(v)}),n._zod.check=(r)=>{if(r.value.includes(i.includes,i.position))return;r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:r.value,inst:n,continue:!i.abort})}}),So=l("$ZodCheckStartsWith",(n,i)=>{E.init(n,i);let o=new RegExp(`^${R(i.prefix)}.*`);i.pattern??(i.pattern=o),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),n._zod.check=(v)=>{if(v.value.startsWith(i.prefix))return;v.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:v.value,inst:n,continue:!i.abort})}}),mo=l("$ZodCheckEndsWith",(n,i)=>{E.init(n,i);let o=new RegExp(`.*${R(i.suffix)}$`);i.pattern??(i.pattern=o),n._zod.onattach.push((v)=>{let r=v._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),n._zod.check=(v)=>{if(v.value.endsWith(i.suffix))return;v.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:v.value,inst:n,continue:!i.abort})}});function Jg(n,i,o){if(n.issues.length)i.issues.push(...H(o,n.issues))}var No=l("$ZodCheckProperty",(n,i)=>{E.init(n,i),n._zod.check=(o)=>{let v=i.schema._zod.run({value:o.value[i.property],issues:[]},{});if(v instanceof Promise)return v.then((r)=>Jg(r,o,i.property));Jg(v,o,i.property);return}}),zo=l("$ZodCheckMimeType",(n,i)=>{E.init(n,i);let o=new Set(i.mime);n._zod.onattach.push((v)=>{v._zod.bag.mime=i.mime}),n._zod.check=(v)=>{if(o.has(v.value.type))return;v.issues.push({code:"invalid_value",values:i.mime,input:v.value.type,inst:n,continue:!i.abort})}}),Oo=l("$ZodCheckOverwrite",(n,i)=>{E.init(n,i),n._zod.check=(o)=>{o.value=i.tx(o.value)}});class an{constructor(n=[]){if(this.content=[],this.indent=0,this)this.args=n}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n==="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}let o=n.split(`
|
|
4
4
|
`).filter((t)=>t),v=Math.min(...o.map((t)=>t.length-t.trimStart().length)),r=o.map((t)=>t.slice(v)).map((t)=>" ".repeat(this.indent*2)+t);for(let t of r)this.content.push(t)}compile(){let n=Function,i=this?.args,v=[...(this?.content??[""]).map((r)=>` ${r}`)];return new n(...i,v.join(`
|
|
5
5
|
`))}}var jo={major:4,minor:4,patch:3};var z=l("$ZodType",(n,i)=>{var o;n??(n={}),n._zod.def=i,n._zod.bag=n._zod.bag||{},n._zod.version=jo;let v=[...n._zod.def.checks??[]];if(n._zod.traits.has("$ZodCheck"))v.unshift(n);for(let r of v)for(let t of r._zod.onattach)t(n);if(v.length===0)(o=n._zod).deferred??(o.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{let r=(e,u,g)=>{let $=er(e),c;for(let b of u){if(b._zod.def.when){if(Jt(e))continue;if(!b._zod.def.when(e))continue}else if($)continue;let S=e.issues.length,D=b._zod.check(e);if(D instanceof Promise&&g?.async===!1)throw new C;if(c||D instanceof Promise)c=(c??Promise.resolve()).then(async()=>{if(await D,e.issues.length===S)return;if(!$)$=er(e,S)});else{if(e.issues.length===S)continue;if(!$)$=er(e,S)}}if(c)return c.then(()=>{return e});return e},t=(e,u,g)=>{if(er(e))return e.aborted=!0,e;let $=r(u,v,g);if($ instanceof Promise){if(g.async===!1)throw new C;return $.then((c)=>n._zod.parse(c,g))}return n._zod.parse($,g)};n._zod.run=(e,u)=>{if(u.skipChecks)return n._zod.parse(e,u);if(u.direction==="backward"){let $=n._zod.parse({value:e.value,issues:[]},{...u,skipChecks:!0});if($ instanceof Promise)return $.then((c)=>{return t(c,e,u)});return t($,e,u)}let g=n._zod.parse(e,u);if(g instanceof Promise){if(u.async===!1)throw new C;return g.then(($)=>r($,v,u))}return r(g,v,u)}}j(n,"~standard",()=>({validate:(r)=>{try{let t=Gt(n,r);return t.success?{value:t.data}:{issues:t.error?.issues}}catch(t){return Wt(n,r).then((e)=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),kr=l("$ZodString",(n,i)=>{z.init(n,i),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??pt(n._zod.bag),n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=String(o.value)}catch(r){}if(typeof o.value==="string")return o;return o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:n}),o}}),J=l("$ZodStringFormat",(n,i)=>{Gr.init(n,i),kr.init(n,i)}),Jo=l("$ZodGUID",(n,i)=>{i.pattern??(i.pattern=Ft),J.init(n,i)}),Lo=l("$ZodUUID",(n,i)=>{if(i.version){let v={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(v===void 0)throw Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=Ur(v))}else i.pattern??(i.pattern=Ur());J.init(n,i)}),Eo=l("$ZodEmail",(n,i)=>{i.pattern??(i.pattern=Tt),J.init(n,i)}),Go=l("$ZodURL",(n,i)=>{J.init(n,i),n._zod.check=(o)=>{try{let v=o.value.trim();if(!i.normalize&&i.protocol?.source===Zt.source){if(!/^https?:\/\//i.test(v)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:n,continue:!i.abort});return}}let r=new URL(v);if(i.hostname){if(i.hostname.lastIndex=0,!i.hostname.test(r.hostname))o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:o.value,inst:n,continue:!i.abort})}if(i.protocol){if(i.protocol.lastIndex=0,!i.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol))o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:o.value,inst:n,continue:!i.abort})}if(i.normalize)o.value=r.href;else o.value=v;return}catch(v){o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:n,continue:!i.abort})}}}),Wo=l("$ZodEmoji",(n,i)=>{i.pattern??(i.pattern=Ht()),J.init(n,i)}),Ao=l("$ZodNanoID",(n,i)=>{i.pattern??(i.pattern=Yt),J.init(n,i)}),Vo=l("$ZodCUID",(n,i)=>{i.pattern??(i.pattern=At),J.init(n,i)}),Xo=l("$ZodCUID2",(n,i)=>{i.pattern??(i.pattern=Vt),J.init(n,i)}),qo=l("$ZodULID",(n,i)=>{i.pattern??(i.pattern=Xt),J.init(n,i)}),Ko=l("$ZodXID",(n,i)=>{i.pattern??(i.pattern=qt),J.init(n,i)}),Yo=l("$ZodKSUID",(n,i)=>{i.pattern??(i.pattern=Kt),J.init(n,i)}),Qo=l("$ZodISODateTime",(n,i)=>{i.pattern??(i.pattern=at(i)),J.init(n,i)}),Fo=l("$ZodISODate",(n,i)=>{i.pattern??(i.pattern=ht),J.init(n,i)}),To=l("$ZodISOTime",(n,i)=>{i.pattern??(i.pattern=yt(i)),J.init(n,i)}),Ho=l("$ZodISODuration",(n,i)=>{i.pattern??(i.pattern=Qt),J.init(n,i)}),Bo=l("$ZodIPv4",(n,i)=>{i.pattern??(i.pattern=Bt),J.init(n,i),n._zod.bag.format="ipv4"}),Mo=l("$ZodIPv6",(n,i)=>{i.pattern??(i.pattern=Mt),J.init(n,i),n._zod.bag.format="ipv6",n._zod.check=(o)=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:n,continue:!i.abort})}}}),xo=l("$ZodMAC",(n,i)=>{i.pattern??(i.pattern=dt(i.delimiter)),J.init(n,i),n._zod.bag.format="mac"}),Ro=l("$ZodCIDRv4",(n,i)=>{i.pattern??(i.pattern=xt),J.init(n,i)}),fo=l("$ZodCIDRv6",(n,i)=>{i.pattern??(i.pattern=Rt),J.init(n,i),n._zod.check=(o)=>{let v=o.value.split("/");try{if(v.length!==2)throw Error();let[r,t]=v;if(!t)throw Error();let e=Number(t);if(`${e}`!==t)throw Error();if(e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:n,continue:!i.abort})}}});function Zo(n){if(n==="")return!0;if(/\s/.test(n))return!1;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}var Co=l("$ZodBase64",(n,i)=>{i.pattern??(i.pattern=ft),J.init(n,i),n._zod.bag.contentEncoding="base64",n._zod.check=(o)=>{if(Zo(o.value))return;o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:n,continue:!i.abort})}});function dg(n){if(!Cn.test(n))return!1;let i=n.replace(/[-_]/g,(v)=>v==="-"?"+":"/"),o=i.padEnd(Math.ceil(i.length/4)*4,"=");return Zo(o)}var ho=l("$ZodBase64URL",(n,i)=>{i.pattern??(i.pattern=Cn),J.init(n,i),n._zod.bag.contentEncoding="base64url",n._zod.check=(o)=>{if(dg(o.value))return;o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:n,continue:!i.abort})}}),yo=l("$ZodE164",(n,i)=>{i.pattern??(i.pattern=Ct),J.init(n,i)});function xg(n,i=null){try{let o=n.split(".");if(o.length!==3)return!1;let[v]=o;if(!v)return!1;let r=JSON.parse(atob(v));if("typ"in r&&r?.typ!=="JWT")return!1;if(!r.alg)return!1;if(i&&(!("alg"in r)||r.alg!==i))return!1;return!0}catch{return!1}}var ao=l("$ZodJWT",(n,i)=>{J.init(n,i),n._zod.check=(o)=>{if(xg(o.value,i.alg))return;o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:n,continue:!i.abort})}}),po=l("$ZodCustomStringFormat",(n,i)=>{J.init(n,i),n._zod.check=(o)=>{if(i.fn(o.value))return;o.issues.push({code:"invalid_format",format:i.format,input:o.value,inst:n,continue:!i.abort})}}),ii=l("$ZodNumber",(n,i)=>{z.init(n,i),n._zod.pattern=n._zod.bag.pattern??gn,n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=Number(o.value)}catch(e){}let r=o.value;if(typeof r==="number"&&!Number.isNaN(r)&&Number.isFinite(r))return o;let t=typeof r==="number"?Number.isNaN(r)?"NaN":!Number.isFinite(r)?"Infinity":void 0:void 0;return o.issues.push({expected:"number",code:"invalid_type",input:r,inst:n,...t?{received:t}:{}}),o}}),so=l("$ZodNumberFormat",(n,i)=>{uo.init(n,i),ii.init(n,i)}),In=l("$ZodBoolean",(n,i)=>{z.init(n,i),n._zod.pattern=no,n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=Boolean(o.value)}catch(t){}let r=o.value;if(typeof r==="boolean")return o;return o.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:n}),o}}),ti=l("$ZodBigInt",(n,i)=>{z.init(n,i),n._zod.pattern=st,n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=BigInt(o.value)}catch(r){}if(typeof o.value==="bigint")return o;return o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:n}),o}}),rv=l("$ZodBigIntFormat",(n,i)=>{$o.init(n,i),ti.init(n,i)}),nv=l("$ZodSymbol",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{let r=o.value;if(typeof r==="symbol")return o;return o.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:n}),o}}),iv=l("$ZodUndefined",(n,i)=>{z.init(n,i),n._zod.pattern=to,n._zod.values=new Set([void 0]),n._zod.parse=(o,v)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:n}),o}}),tv=l("$ZodNull",(n,i)=>{z.init(n,i),n._zod.pattern=io,n._zod.values=new Set([null]),n._zod.parse=(o,v)=>{let r=o.value;if(r===null)return o;return o.issues.push({expected:"null",code:"invalid_type",input:r,inst:n}),o}}),ov=l("$ZodAny",(n,i)=>{z.init(n,i),n._zod.parse=(o)=>o}),vv=l("$ZodUnknown",(n,i)=>{z.init(n,i),n._zod.parse=(o)=>o}),ev=l("$ZodNever",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{return o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:n}),o}}),uv=l("$ZodVoid",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{let r=o.value;if(typeof r>"u")return o;return o.issues.push({expected:"void",code:"invalid_type",input:r,inst:n}),o}}),$v=l("$ZodDate",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{if(i.coerce)try{o.value=new Date(o.value)}catch(u){}let r=o.value,t=r instanceof Date;if(t&&!Number.isNaN(r.getTime()))return o;return o.issues.push({expected:"date",code:"invalid_type",input:r,...t?{received:"Invalid Date"}:{},inst:n}),o}});function Gg(n,i,o){if(n.issues.length)i.issues.push(...H(o,n.issues));i.value[o]=n.value}var gv=l("$ZodArray",(n,i)=>{z.init(n,i),n._zod.parse=(o,v)=>{let r=o.value;if(!Array.isArray(r))return o.issues.push({expected:"array",code:"invalid_type",input:r,inst:n}),o;o.value=Array(r.length);let t=[];for(let e=0;e<r.length;e++){let u=r[e],g=i.element._zod.run({value:u,issues:[]},v);if(g instanceof Promise)t.push(g.then(($)=>Gg($,o,e)));else Gg(g,o,e)}if(t.length)return Promise.all(t).then(()=>o);return o}});function ni(n,i,o,v,r,t){let e=o in v;if(n.issues.length){if(r&&t&&!e)return;i.issues.push(...H(o,n.issues))}if(!e&&!r){if(!n.issues.length)i.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}if(n.value===void 0){if(e)i.value[o]=void 0}else i.value[o]=n.value}function Rg(n){let i=Object.keys(n.shape);for(let v of i)if(!n.shape?.[v]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${v}": expected a Zod schema`);let o=Ot(n.shape);return{...n,keys:i,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(o)}}function fg(n,i,o,v,r,t){let e=[],u=r.keySet,g=r.catchall._zod,$=g.def.type,c=g.optin==="optional",b=g.optout==="optional";for(let S in i){if(S==="__proto__")continue;if(u.has(S))continue;if($==="never"){e.push(S);continue}let D=g.run({value:i[S],issues:[]},v);if(D instanceof Promise)n.push(D.then((N)=>ni(N,o,S,i,c,b)));else ni(D,o,S,i,c,b)}if(e.length)o.issues.push({code:"unrecognized_keys",keys:e,input:i,inst:t});if(!n.length)return o;return Promise.all(n).then(()=>{return o})}var Zg=l("$ZodObject",(n,i)=>{if(z.init(n,i),!Object.getOwnPropertyDescriptor(i,"shape")?.get){let u=i.shape;Object.defineProperty(i,"shape",{get:()=>{let g={...u};return Object.defineProperty(i,"shape",{value:g}),g}})}let v=Or(()=>Rg(i));j(n._zod,"propValues",()=>{let u=i.shape,g={};for(let $ in u){let c=u[$]._zod;if(c.values){g[$]??(g[$]=new Set);for(let b of c.values)g[$].add(b)}}return g});let r=_r,t=i.catchall,e;n._zod.parse=(u,g)=>{e??(e=v.value);let $=u.value;if(!r($))return u.issues.push({expected:"object",code:"invalid_type",input:$,inst:n}),u;u.value={};let c=[],b=e.shape;for(let S of e.keys){let D=b[S],N=D._zod.optin==="optional",T=D._zod.optout==="optional",A=D._zod.run({value:$[S],issues:[]},g);if(A instanceof Promise)c.push(A.then((_t)=>ni(_t,u,S,$,N,T)));else ni(A,u,S,$,N,T)}if(!t)return c.length?Promise.all(c).then(()=>u):u;return fg(c,$,u,g,v.value,n)}}),lv=l("$ZodObjectJIT",(n,i)=>{Zg.init(n,i);let o=n._zod.parse,v=Or(()=>Rg(i)),r=(S)=>{let D=new an(["shape","payload","ctx"]),N=v.value,T=(Z)=>{let G=Yn(Z);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};D.write("const input = payload.value;");let A=Object.create(null),_t=0;for(let Z of N.keys)A[Z]=`key_${_t++}`;D.write("const newResult = {};");for(let Z of N.keys){let G=A[Z],V=Yn(Z),_g=S[Z],Ug=_g?._zod?.optin==="optional",zc=_g?._zod?.optout==="optional";if(D.write(`const ${G} = ${T(Z)};`),Ug&&zc)D.write(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ab as L9,Bb as n0,Ib as K0,wb as NQ,xb as Y8,yb as s9,zb as _0}from"./vm-hands-entry-lite-q8b738zj.js";import{Qb as SQ,Rb as wQ,Sb as J4,Tb as Y4,Ub as V8}from"./vm-hands-entry-lite-qvrnx0vk.js";import{Zb as b0}from"./vm-hands-entry-lite-n07kxrd1.js";import{Ad as W8,Bd as g0,Fd as C0,Sc as e$,Vc as $Q,yd as w9,zd as o0}from"./vm-hands-entry-lite-
|
|
2
|
+
import{Ab as L9,Bb as n0,Ib as K0,wb as NQ,xb as Y8,yb as s9,zb as _0}from"./vm-hands-entry-lite-q8b738zj.js";import{Qb as SQ,Rb as wQ,Sb as J4,Tb as Y4,Ub as V8}from"./vm-hands-entry-lite-qvrnx0vk.js";import{Zb as b0}from"./vm-hands-entry-lite-n07kxrd1.js";import{Ad as W8,Bd as g0,Fd as C0,Sc as e$,Vc as $Q,yd as w9,zd as o0}from"./vm-hands-entry-lite-t497ewn2.js";import{ee as x}from"./vm-hands-entry-lite-psybjyay.js";import{Oe as yQ,Pe as y8,bf as gQ,hf as i9,if as f8}from"./vm-hands-entry-lite-wh0qp1gf.js";import{$f as JQ,Bf as d9,Cf as s$,Df as n$,Ef as R8,Hf as p9,Qf as I8,Rf as S0,Sf as O0,Tf as l9,_f as w8,ag as i$,kf as CZ,nf as B9,wf as QQ,xf as ZQ,zf as XQ}from"./vm-hands-entry-lite-yhz6sv35.js";import{ah as Z4}from"./vm-hands-entry-lite-mzxhng4z.js";import{ch as N8,dh as u9,gh as Q4}from"./vm-hands-entry-lite-cp1wqjs5.js";import{Bh as W$,hh as B8,ih as i0,jh as L8,kh as a0,lh as H9,mh as J8,nh as e8,oh as s0,ph as p0,qh as u$}from"./vm-hands-entry-lite-ne8kkvk4.js";import{Gh as VZ}from"./vm-hands-entry-lite-2ym8pc3f.js";import{Mh as X4}from"./vm-hands-entry-lite-14t846kp.js";import{Oh as C}from"./vm-hands-entry-lite-v6tkjqb1.js";import{Ph as P1,Uh as GZ}from"./vm-hands-entry-lite-cxs89wzv.js";var v={chunk:32768,upload:1048576,total:536870912,streams:16,queued:512,buffered:262144,relayBuffered:8388608,requestMs:30000,lifetimeMs:600000,authorizationMs:2000,window:8};function h9($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function P0($,Q,Z=Number.MAX_SAFE_INTEGER){return typeof $==="number"&&Number.isSafeInteger($)&&$>=Q&&$<=Z}function E$($){return typeof $==="string"&&/^[a-zA-Z0-9_-]{1,160}$/.test($)}function S$($,Q){let Z=Buffer.from($,"latin1");return Buffer.concat([Buffer.from([Z.length]),Z,Q])}function I0($){if(!h9($)||Object.keys($).length!==12||![$.organizationId,$.userId,$.runId,$.deviceId,$.rootId,$.jobId,$.fenceId].every(E$)||!P0($.attachmentRevision,0)||!P0($.grantRevision,1)||!P0($.generation,1)||!P0($.port,1024,65535)||!P0($.expiresAtMs,1))throw Error("preview_binding_invalid");return Object.freeze({...$})}function c0($,Q){return Object.keys($).every((Z)=>$[Z]===Q[Z])}function q9($){if($.length>4096||!$.startsWith("/")||$.startsWith("//")||/[\\\x00-\x20\x7f#]/.test($))throw Error("preview_path_invalid");let Q=decodeURIComponent($);if(Q.startsWith("//")||/[\\\x00-\x1f\x7f]/.test(Q))throw Error("preview_path_invalid");return $}function R$($){return Array.isArray($)&&$.length<=64&&$.every((Q)=>Array.isArray(Q)&&Q.length===2&&typeof Q[0]==="string"&&/^[a-zA-Z0-9-]{1,80}$/.test(Q[0])&&typeof Q[1]==="string"&&Q[1].length<=4096&&!/[\x00-\x1f\x7f]/.test(Q[1]))}function C9($,Q=v.chunk){if($.length>Math.ceil(Q/3)*4||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test($))throw Error("preview_data_invalid");let Z=Buffer.from($,"base64");if(Z.length>Q)throw Error("preview_data_too_large");return Z}function w$($){if(Array.isArray($))return Buffer.concat($);if(typeof $==="string")return Buffer.from($,"utf8");if($ instanceof ArrayBuffer)return Buffer.from($);return $}function b$($){if(Buffer.byteLength($)>v.upload*1.4+300000)throw Error("preview_frame_too_large");let Q=JSON.parse($);if(!h9(Q))throw Error("preview_frame_invalid");if(Q.type==="hello")return{type:"hello",binding:I0(Q.binding),...P0(Q.messages,v.chunk,v.upload)?{messages:Q.messages}:{},...P0(Q.window,1,v.window)?{window:Q.window}:{},...Q.bytes===!0?{bytes:!0}:{}};if(Q.type==="refused"&&typeof Q.reason==="string"&&/^[a-z_]{1,32}$/.test(Q.reason))return{type:"refused",binding:I0(Q.binding),reason:Q.reason};if(!E$(Q.id))throw Error("preview_frame_invalid");if(Q.type==="end"||Q.type==="cancel"||Q.type==="credit")return{type:Q.type,id:Q.id};if(Q.type==="ws"&&typeof Q.protocol==="string"&&/^[a-zA-Z0-9._-]{0,100}$/.test(Q.protocol))return{type:"ws",id:Q.id,protocol:Q.protocol};if(Q.type==="data"&&typeof Q.data==="string"&&typeof Q.binary==="boolean")return C9(Q.data,v.upload),{type:"data",id:Q.id,data:Q.data,binary:Q.binary};if(Q.type==="head"&&P0(Q.status,200,599)&&R$(Q.headers))return{type:"head",id:Q.id,status:Q.status,headers:Q.headers};if(Q.type==="request"&&typeof Q.method==="string"&&/^(GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS)$/.test(Q.method)&&typeof Q.path==="string"&&R$(Q.headers)&&typeof Q.body==="string"&&typeof Q.upgrade==="boolean")return C9(Q.body,v.upload),{type:"request",id:Q.id,method:Q.method,path:q9(Q.path),headers:Q.headers,body:Q.body,upgrade:Q.upgrade};throw Error("preview_frame_invalid")}function D8($){let Q=[...$],Z=new Set(Q.filter(([J])=>J.toLowerCase()==="connection").flatMap(([,J])=>J.toLowerCase().split(",").map((Y)=>Y.trim()))),X=new Set(["authorization","proxy-authorization","cookie","set-cookie","host","origin","referer","connection","upgrade","keep-alive","transfer-encoding","te","trailer","content-length","forwarded","alt-svc","service-worker-allowed","clear-site-data","refresh"]);return Q.filter(([J])=>!X.has(J.toLowerCase())&&!Z.has(J.toLowerCase())&&!/^(x-forwarded-|x-ara-|sec-websocket-|access-control-)/i.test(J))}async function _8($){let Q;try{return await Promise.race([Promise.resolve().then($).then((Z)=>Z===!0||(Z===!1?!1:void 0),()=>{return}),new Promise((Z)=>{Q=setTimeout(()=>Z(void 0),v.authorizationMs)})])}finally{clearTimeout(Q)}}async function T9($){return await _8($)===!0}function v9($,Q){let Z=new URL($);if(Z.username||Z.password||Z.search||Z.hash||!(Z.protocol==="wss:"||Z.protocol==="ws:"&&["127.0.0.1","[::1]"].includes(Z.hostname))||!new RegExp(`^/${Q}/[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]{32,}$`).test(Z.pathname))throw Error("preview_relay_invalid");return Z.href}function k$($){if(!h9($)||Object.keys($).length!==2||typeof $.deviceRelayUrl!=="string")throw Error("preview_open_invalid");return{binding:I0($.binding),deviceRelayUrl:v9($.deviceRelayUrl,"device")}}function f$($){if(!h9($)||Object.keys($).length!==1||!("binding"in $))throw Error("preview_close_invalid");return{binding:I0($.binding)}}import{request as T4}from"http";import{pipeline as O4}from"stream";import{constants as A8,createBrotliCompress as D4,createGzip as _4}from"zlib";import{WebSocket as O9}from"ws";import{randomBytes as j4,timingSafeEqual as C4}from"crypto";import{createServer as q4}from"net";var g$="x-preview-connection";async function m$($,Q){if(Q.aborted)throw Error("preview_closed");let Z=j4(32).toString("base64url"),X=new Set,J=!1,Y=q4((G)=>{if(J||Q.aborted||X.size>=v.streams*2)return G.destroy();X.add(G);let F=new AbortController;G.once("close",()=>{X.delete(G),F.abort()}),G.on("error",()=>G.destroy()),G.setTimeout(2000,()=>G.destroy());let B=Buffer.alloc(0),H=(L)=>{B=Buffer.concat([B,L]);let W=B.indexOf(`\r
|
|
3
3
|
\r
|
|
4
4
|
`);if(W<0){if(B.length>16384)G.destroy();return}if(G.pause(),G.off("data",H),W>16384||B.length>v.upload+16384)return G.destroy();z(B,W).catch(()=>G.destroy())};G.on("data",H);async function z(L,W){let U=L.subarray(0,W).toString("latin1").split(`\r
|
|
5
5
|
`),j=/^(GET|HEAD|POST|PUT|PATCH|DELETE|OPTIONS) (\S+) HTTP\/1\.1$/.exec(U.shift()??"");if(!j)throw Error("preview_request_invalid");q9(j[2]);let O=!1,q=0,A=[];for(let T of U){let S=/^([a-zA-Z0-9-]+):[ \t]*([^\x00-\x08\x0a-\x1f\x7f]*)$/.exec(T);if(!S)throw Error("preview_header_invalid");if(S[1].toLowerCase()===g$){q++;let g=Buffer.from(S[2].trim());O=g.length===Z.length&&C4(g,Buffer.from(Z))}else if(S[1].toLowerCase()!=="host")A.push(T)}if(!O||q!==1||J||F.signal.aborted)throw Error("preview_connection_denied");let R=await $.connect(F.signal);if(J||F.signal.aborted)throw R.destroy(),Error("preview_closed");X.add(R),R.on("error",()=>G.destroy()),R.once("close",()=>{X.delete(R),G.destroy()}),G.once("close",()=>R.destroy()),G.setTimeout(0);let P=[`${j[1]} ${j[2]} HTTP/1.1`,`Host: 127.0.0.1:${R.remotePort}`,...A,"",""].join(`\r
|
|
@@ -303,7 +303,7 @@ async (input) => {
|
|
|
303
303
|
if (!bridge || typeof bridge.evaluate !== "function") throw new Error("Reason Hands browser bridge is not installed");
|
|
304
304
|
return await bridge.evaluate(typeof input === "string" ? input : input && input.code);
|
|
305
305
|
}
|
|
306
|
-
`.trim();import{Buffer as X9}from"buffer";import{randomUUID as z1}from"crypto";class aQ extends Error{code;constructor($){super($==="hands_repl_private_profile_attribute_denied"?"Private browser attribute read denied.":$);this.code=$;this.name="HandsReplBrowserDispatcherError"}}var oQ=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","prototype"]),sQ=/^hands_[A-Za-z0-9_-]{8,128}$/,K1=2048,rQ=32,tQ=1e4,V1=new Set(["href","src","alt","title","role","aria-label","aria-expanded","aria-checked","aria-selected","aria-disabled","placeholder","type","name","data-testid"]);function F1($){let Q=$.split("+"),Z=(Q.pop()??"").replace(/^Key/,"").toLowerCase();if(Z==="f12")return!0;if(Q.some((X)=>["Control","ControlOrMeta","Meta"].includes(X))&&["l","n","t","j","i","p","s","w","u","o","r","tab","pageup","pagedown"].includes(Z))return!0;if(Q.some((X)=>["Control","ControlOrMeta","Meta"].includes(X))&&Q.includes("Shift")&&Z==="c")return!0;return Q.includes("Alt")&&["d","arrowleft","arrowright","home"].includes(Z)}var H1=($)=>{let Q=$.closest("a[href],area[href]");return{password:$.tagName==="INPUT"&&$.type==="password",executableLink:Boolean(Q&&!/^(https?:|about:blank)/i.test(Q.href))}},eQ={browser:{close:{returns:"void"},contexts:{returns:"context[]"},isConnected:{returns:"json"},version:{returns:"json"}},context:{addCookies:{returns:"void"},addInitScript:{returns:"void"},browser:{returns:"browser"},clearCookies:{returns:"void"},clearPermissions:{returns:"void"},close:{returns:"void"},cookies:{returns:"json"},grantPermissions:{returns:"void"},newPage:{returns:"page"},pages:{returns:"page[]"},setDefaultNavigationTimeout:{returns:"void"},setDefaultTimeout:{returns:"void"},setExtraHTTPHeaders:{returns:"void"},setGeolocation:{returns:"void"},setHTTPCredentials:{returns:"void"},setOffline:{returns:"void"},setViewportSize:{returns:"void"},storageState:{returns:"json"},viewportSize:{returns:"json",special:"contextViewportSize"}},page:{addInitScript:{returns:"void"},addScriptTag:{returns:"void"},addStyleTag:{returns:"void"},bringToFront:{returns:"void"},close:{returns:"void"},content:{returns:"json"},context:{returns:"context"},emulateMedia:{returns:"void"},evaluate:{returns:"json",requiresStringSource:!0},frame:{returns:"frame"},frameLocator:{returns:"frameLocator"},frames:{returns:"frame[]"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},goBack:{returns:"void"},goForward:{returns:"void"},goto:{returns:"void"},isClosed:{returns:"json"},locator:{returns:"locator"},mainFrame:{returns:"frame"},opener:{returns:"page"},pdf:{returns:"bytes"},reload:{returns:"void"},screenshot:{returns:"bytes"},selectOption:{returns:"json"},setContent:{returns:"void"},setDefaultNavigationTimeout:{returns:"void"},setDefaultTimeout:{returns:"void"},setExtraHTTPHeaders:{returns:"void"},setInputFiles:{returns:"void"},setViewportSize:{returns:"void"},title:{returns:"json"},url:{returns:"json"},viewportSize:{returns:"json"},waitForFunction:{returns:"void",requiresStringSource:!0},waitForLoadState:{returns:"void"},waitForNavigation:{returns:"void"},waitForTimeout:{returns:"void"},waitForURL:{returns:"void"}},locator:{all:{returns:"locator[]"},allInnerTexts:{returns:"json"},allTextContents:{returns:"json"},and:{returns:"locator"},ariaSnapshot:{returns:"json"},blur:{returns:"void"},boundingBox:{returns:"json"},check:{returns:"void"},clear:{returns:"void"},click:{returns:"void"},contentFrame:{returns:"frameLocator"},count:{returns:"json"},dblclick:{returns:"void"},dragTo:{returns:"void"},evaluate:{returns:"json",requiresStringSource:!0},evaluateAll:{returns:"json",requiresStringSource:!0},fill:{returns:"void"},filter:{returns:"locator"},first:{returns:"locator",special:"property"},focus:{returns:"void"},getAttribute:{returns:"json"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},hover:{returns:"void"},innerHTML:{returns:"json"},innerText:{returns:"json"},inputValue:{returns:"json"},isChecked:{returns:"json"},isEditable:{returns:"json"},isEnabled:{returns:"json"},isHidden:{returns:"json"},isVisible:{returns:"json"},last:{returns:"locator",special:"property"},locator:{returns:"locator"},nth:{returns:"locator"},or:{returns:"locator"},page:{returns:"page"},press:{returns:"void"},pressSequentially:{returns:"void"},scrollIntoViewIfNeeded:{returns:"void"},screenshot:{returns:"bytes"},selectOption:{returns:"json"},setInputFiles:{returns:"void"},tap:{returns:"void"},textContent:{returns:"json"},type:{returns:"void"},uncheck:{returns:"void"},waitFor:{returns:"void"}},frame:{addScriptTag:{returns:"void"},addStyleTag:{returns:"void"},childFrames:{returns:"frame[]"},content:{returns:"json"},evaluate:{returns:"json",requiresStringSource:!0},frameLocator:{returns:"frameLocator"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},goto:{returns:"void"},isDetached:{returns:"json"},locator:{returns:"locator"},name:{returns:"json"},page:{returns:"page"},parentFrame:{returns:"frame"},setContent:{returns:"void"},title:{returns:"json"},url:{returns:"json"},waitForFunction:{returns:"void",requiresStringSource:!0},waitForLoadState:{returns:"void"},waitForNavigation:{returns:"void"},waitForTimeout:{returns:"void"},waitForURL:{returns:"void"}},frameLocator:{getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},locator:{returns:"locator"},owner:{returns:"locator"}}};function I($){throw new aQ($)}function z0($){if(!$||typeof $!=="object"||Array.isArray($))return!1;let Q=Object.getPrototypeOf($);return Q===Object.prototype||Q===null}function J9($,Q=0,Z={nodes:0}){if(Q>rQ||++Z.nodes>tQ)I("hands_repl_json_too_complex");if($===null||typeof $==="boolean"||typeof $==="string")return;if(typeof $==="number"){if(!Number.isFinite($))I("hands_repl_invalid_json");return}if(Array.isArray($)){for(let X of $)J9(X,Q+1,Z);return}if(!z0($))I("hands_repl_invalid_json");for(let[X,J]of Object.entries($)){if(oQ.has(X))I("hands_repl_invalid_json");J9(J,Q+1,Z)}}function h8($){return typeof $==="string"&&Object.hasOwn(eQ,$)}function U1($){if(!$.endsWith("[]"))return null;let Q=$.slice(0,-2);return h8(Q)?Q:null}function nQ($){return z0($)&&Object.keys($).length===2&&$.$handsRepl==="bytes"&&typeof $.base64==="string"}function W1($){return z0($)&&Object.keys($).length===1&&$.$handsRepl==="undefined"}function iQ($){return z0($)&&Object.keys($).length===2&&$.$handsRepl==="routeFulfill"&&"options"in $}function k0($){return!!$&&typeof $==="object"}function r9(){return Object.freeze({$handsRepl:"undefined"})}function B1($){if(!X9.isBuffer($)&&!($ instanceof Uint8Array))I("hands_repl_expected_bytes");return Object.freeze({$handsRepl:"bytes",base64:X9.from($).toString("base64")})}function $Z($){if(!k0($.browser)||!k0($.context)||!k0($.page))I("hands_repl_invalid_roots");if(typeof $.a11y!=="function"||typeof $.view!=="function")I("hands_repl_invalid_callbacks");let Q=$.maxHandles??K1;if(!Number.isInteger(Q)||Q<3||Q>1e5)I("hands_repl_invalid_handle_limit");let Z=new Map,X=new WeakMap,J=$.createOpaqueId??z1,Y=(z,L)=>{if(!k0(L))I("hands_repl_expected_target");let W=X.get(L)?.get(z);if(W)return W;if(Z.size>=Q)I("hands_repl_handle_limit");let U="";for(let q=0;q<16;q+=1){let A=`hands_${J()}`;if(sQ.test(A)&&!Z.has(A)){U=A;break}}if(!U)I("hands_repl_invalid_opaque_id");let j=Object.freeze({$handsRepl:"handle",id:U,kind:z});Z.set(U,{kind:z,target:L});let O=X.get(L);if(!O)O=new Map,X.set(L,O);return O.set(z,j),j},K=Object.freeze({browser:Y("browser",$.browser),context:Y("context",$.context),page:Y("page",$.page)}),V=(z)=>{if(!z0(z)||Object.keys(z).length!==3||z.$handsRepl!=="handle"||typeof z.id!=="string"||!sQ.test(z.id)||!h8(z.kind))I("hands_repl_invalid_handle");let L=Z.get(z.id);if(!L||L.kind!==z.kind)I("hands_repl_unknown_handle");return L},G=(z,L=0,W=new Set)=>{if(L>rQ)I("hands_repl_json_too_complex");if(z===void 0)return r9();if(z===null||typeof z==="boolean"||typeof z==="string")return z;if(typeof z==="number"){if(!Number.isFinite(z))I("hands_repl_non_json_result");return z}if(Array.isArray(z)){if(W.has(z))I("hands_repl_cyclic_result");W.add(z);try{return z.map((U)=>G(U,L+1,W))}finally{W.delete(z)}}if(!z0(z))I("hands_repl_non_json_result");if(W.has(z))I("hands_repl_cyclic_result");W.add(z);try{let U=Object.create(null);for(let j of Object.keys(z)){let O=Object.getOwnPropertyDescriptor(z,j);if(!O||!("value"in O))continue;U[j]=G(O.value,L+1,W)}return U}finally{W.delete(z)}},F=(z,L)=>{if(L==="void")return r9();if(L==="json")return G(z);if(L==="bytes")return B1(z);let W=U1(L);if(W){if(!Array.isArray(z))I("hands_repl_expected_target_list");if(W==="context"&&z.some((U)=>U!==$.context))I("hands_repl_foreign_context");return z.map((U)=>Y(W,U))}if(z===null||z===void 0)return r9();if(!h8(L))I("hands_repl_invalid_return_kind");if(L==="context"&&z!==$.context)I("hands_repl_foreign_context");return Y(L,z)},B=(z)=>{if(z0(z)&&z.$handsRepl==="handle")return V(z).target;if(nQ(z))return X9.from(z.base64,"base64");if(W1(z))return;if(iQ(z))I("hands_repl_route_fulfill_only");if(Array.isArray(z))return z.map(B);if(!z0(z))return z;let L=Object.create(null);for(let[W,U]of Object.entries(z))L[W]=B(U);return L};return Object.freeze({roots:K,dispatch:async(z)=>{if(!z0(z)||typeof z.type!=="string")I("hands_repl_invalid_request");if(z.type==="a11y"){let T=z.target===void 0?Z.get(K.page.id):V(z.target);if(!T||T.kind!=="page"&&T.kind!=="locator")I("hands_repl_invalid_a11y_target");return G(await $.a11y(T.target))}if(z.type==="view"){if(J9(z.source),z.options!==void 0)J9(z.options);let T=nQ(z.source)?X9.from(z.source.base64,"base64"):z.source;if($.privateProfile&&!X9.isBuffer(T))I("hands_repl_profile_requires_image_bytes");return G(await $.view(T,z.options))}if(z.type!=="call")I("hands_repl_invalid_request");if(typeof z.method!=="string"||z.method.length===0||z.method.length>128)I("hands_repl_invalid_method");if(oQ.has(z.method))I("hands_repl_forbidden_method");let L=V(z.target),W=z.args??[];if(!Array.isArray(W))I("hands_repl_invalid_arguments");if(J9(W),L.kind==="page"&&z.method==="captureScreenshot"){if(W.length!==0)I("hands_repl_invalid_arguments");if(!$.screenshotExport)I("hands_repl_screenshot_export_unavailable");return G(await $.screenshotExport(L.target))}if(L.kind==="context"&&["startRecording","stopRecording"].includes(z.method)){if(!$.recording||L.target!==$.context)I("hands_repl_recording_unavailable");if(W.length>(z.method==="startRecording"?1:0))I("hands_repl_invalid_arguments");return G(z.method==="startRecording"?await $.recording.start(W[0]):await $.recording.stop())}if($.privateProfile){let T=z.method;if(["evaluate","evaluateAll","waitForFunction","addInitScript","addScriptTag","addStyleTag","setContent","setInputFiles","route","content","cookies","storageState","addCookies","clearCookies","setExtraHTTPHeaders","setHTTPCredentials","grantPermissions","clearPermissions","innerHTML","textContent","allTextContents"].includes(T)||L.kind==="browser"&&T==="close"||L.kind==="context"&&T==="close")I("hands_repl_private_profile_method_denied");if(L.kind==="browser"&&T==="contexts")return F([$.context],"context[]");if((T==="screenshot"||T==="pdf")&&z0(W[0])&&(("path"in W[0])||("style"in W[0])))I("hands_repl_private_profile_path_denied");if(T==="goto"){if(typeof W[0]!=="string")I("hands_repl_private_profile_url_denied");try{let S=new URL(W[0]);if(!["http:","https:"].includes(S.protocol)&&W[0]!=="about:blank")I("hands_repl_private_profile_url_denied")}catch{I("hands_repl_private_profile_url_denied")}}if(T==="getAttribute"&&(typeof W[0]!=="string"||!V1.has(W[0].toLowerCase())))I("hands_repl_private_profile_attribute_denied");if(L.kind==="locator"&&["innerText","allInnerTexts","getAttribute"].includes(T)){let S=[L.target];if(T==="allInnerTexts"){let g=Reflect.get(L.target,"all");if(typeof g!=="function")I("hands_repl_private_profile_probe_unavailable");let E=await Reflect.apply(g,L.target,[]);if(!Array.isArray(E)||E.length>tQ||!E.every(k0))I("hands_repl_private_profile_probe_unavailable");S=E}for(let g of S){let E=Reflect.get(g,"isVisible");if(typeof E!=="function"||!await Reflect.apply(E,g,[]))I("hands_repl_private_profile_hidden_value_denied")}}if(T==="press"&&typeof W[0]==="string"&&F1(W[0]))I("hands_repl_private_profile_browser_shortcut_denied");if(L.kind==="locator"&&["inputValue","click","dblclick","tap","press"].includes(T)){let S=Reflect.get(L.target,"evaluate");if(typeof S!=="function")I("hands_repl_private_profile_probe_unavailable");let g=await Reflect.apply(S,L.target,[H1]);if(!z0(g)||typeof g.password!=="boolean"||typeof g.executableLink!=="boolean")I("hands_repl_private_profile_probe_unavailable");if(T==="inputValue"&&g.password)I("hands_repl_private_profile_password_denied");if(T!=="inputValue"&&g.executableLink)I("hands_repl_private_profile_url_denied");if(T==="inputValue"){let E=Reflect.get(L.target,"isVisible");if(typeof E!=="function"||!await Reflect.apply(E,L.target,[]))I("hands_repl_private_profile_hidden_value_denied")}}}let U=eQ[L.kind][z.method];if(!U)I("hands_repl_method_not_allowed");if(U.requiresStringSource&&typeof W[0]!=="string")I("hands_repl_string_source_required");if(L.kind==="browser"&&z.method==="contexts")return[K.context];if(["addInitScript","addScriptTag","addStyleTag","screenshot","pdf","storageState"].includes(z.method)&&W.some((T)=>z0(T)&&("path"in T)))I("hands_repl_file_path_not_allowed");if(z.method==="goto"&&typeof W[0]==="string"){let T;try{T=new URL(W[0]).protocol}catch{I("hands_repl_invalid_url")}if(!["http:","https:","data:","about:","blob:"].includes(T))I("hands_repl_file_path_not_allowed")}if(U.special==="contextViewportSize"){let T=Reflect.get(L.target,"pages");if(typeof T!=="function")I("hands_repl_method_unavailable");let S=await Reflect.apply(T,L.target,[]),g=Array.isArray(S)?S[0]:void 0,E=k0(g)?Reflect.get(g,"viewportSize"):void 0;if(typeof E!=="function")return r9();return F(await Reflect.apply(E,g,[]),U.returns)}if(U.special==="property"){let T=Reflect.get(L.target,z.method);return F(typeof T==="function"?Reflect.apply(T,L.target,[]):T,U.returns)}let j=Reflect.get(L.target,z.method);if(typeof j!=="function")I("hands_repl_method_unavailable");if(U.special==="route"){let T=W[1];if(!iQ(T))I("hands_repl_invalid_route_handler");J9(T.options);let S=B(T.options),g=async(M)=>{if(!k0(M))I("hands_repl_invalid_route");let D=Reflect.get(M,"fulfill");if(typeof D!=="function")I("hands_repl_invalid_route");await Reflect.apply(D,M,[S])},E=[B(W[0]??null),g],N=await Reflect.apply(j,L.target,E);return F(N,U.returns)}let O=W.map(B);if(z.method==="setInputFiles"){let T=L.kind==="locator"?0:1,S=async(E)=>{if(typeof E!=="string"){if(!z0(E)||typeof E.name!=="string"||typeof E.mimeType!=="string"||!X9.isBuffer(E.buffer))I("hands_repl_invalid_file_input");return E}if(!$.readWorkspaceFile)I("hands_repl_workspace_required");return $.readWorkspaceFile(E)},g=O[T];O[T]=Array.isArray(g)?await Promise.all(g.map(S)):await S(g)}if(z.method==="goto")await $.beforeNavigation?.();let q=$.actionRecorder?.(),A=await Reflect.apply(j,L.target,O),P={click:"Click browser element",tap:"Click browser element",dblclick:"Double click browser element",fill:"Type text",type:"Type text",pressSequentially:"Type text",clear:"Clear browser field",press:"Press key",scrollIntoViewIfNeeded:"Scroll browser element into view",dragTo:"Drag on computer",selectOption:"Select browser option",check:"Check browser control",uncheck:"Uncheck browser control",hover:"Hover browser element",focus:"Focus browser element",goto:"Open browser page",reload:"Reload browser page",goBack:"Go back in browser",goForward:"Go forward in browser",screenshot:"Take browser screenshot"}[z.method];if(P){let T=Reflect.get(L.target,"page"),S=L.kind==="page"?L.target:typeof T==="function"?Reflect.apply(T,L.target,[]):void 0;q?.(P,k0(S)?S:void 0)}return F(A,U.returns)}})}import{isIP as YZ}from"net";import{Resolver as L1}from"dns/promises";import{isIP as e9}from"net";var N1=[["0.0.0.0",8],["10.0.0.0",8],["100.64.0.0",10],["127.0.0.0",8],["169.254.0.0",16],["172.16.0.0",12],["192.0.0.0",24],["192.0.2.0",24],["192.168.0.0",16],["198.18.0.0",15],["198.51.100.0",24],["203.0.113.0",24],["224.0.0.0",4],["240.0.0.0",4]];function v8($){if(e9($)!==4)return null;let Q=$.split(".");if(Q.length!==4)return null;let Z=0;for(let X of Q){let J=Number(X);if(!Number.isInteger(J)||J<0||J>255)return null;Z=Z*256+J}return Z>>>0}function M1($,Q,Z){let X=v8(Q);if(X===null)return!1;let J=Z===0?0:4294967295<<32-Z>>>0;return($&J)>>>0===(X&J)>>>0}function QZ($){let Q=v8($);if(Q===null)return!0;return N1.some(([Z,X])=>M1(Q,Z,X))}function j1($){if(e9($)!==6)return null;let Q=$.toLowerCase(),Z=Q.indexOf("%");if(Z>=0)Q=Q.slice(0,Z);let X=[],J=Q.lastIndexOf(":"),Y=J>=0?Q.slice(J+1):"";if(Y.includes(".")){let z=v8(Y);if(z===null)return null;X=[z>>>16&65535,z&65535],Q=Q.slice(0,J+1)+"0:0"}let K=Q.split("::");if(K.length>2)return null;let V=(z)=>{if(z==="")return[];let L=[];for(let W of z.split(":")){if(W===""||W.length>4||!/^[0-9a-f]+$/.test(W))return null;L.push(Number.parseInt(W,16))}return L},G=V(K[0]??"");if(G===null)return null;if(K.length===1){let z=G;if(z.length!==8)return null;return X.length>0?z.slice(0,6).concat(X):z}let F=V(K[1]??"");if(F===null)return null;let B=8-G.length-F.length;if(B<0)return null;let H=G.concat(Array(B).fill(0),F);if(H.length!==8)return null;return X.length>0?H.slice(0,6).concat(X):H}function C1($,Q){return`${$>>8&255}.${$&255}.${Q>>8&255}.${Q&255}`}function q1($){let Q=j1($);if(Q===null)return!0;let[Z,X,J]=Q;if((Z&57344)!==8192)return!0;if(Z===8193&&(X&65024)===0)return!0;if(Z===8193&&X===3512)return!0;if(Z===16383&&(X&61440)===0)return!0;if(Z===8194)return QZ(C1(X,J));return!1}function ZZ($){return $.replace(/^\[|\]$/g,"")}function t9($){let Q=ZZ($.trim()),Z=e9(Q);if(Z===4)return QZ(Q);if(Z===6)return q1(Q);return!0}function XZ($){if($ instanceof Error&&$.name==="TimeoutError")return"dns_timeout";switch(typeof $==="object"&&$!==null&&"code"in $?$.code:void 0){case"ENOTFOUND":return"dns_not_found";case"ENODATA":return"dns_empty";case"EAI_AGAIN":case"ESERVFAIL":case"ECONNREFUSED":return"dns_temporary";case"ETIMEOUT":case"ETIMEDOUT":return"dns_timeout";default:return"dns_failed"}}var JZ=5000;function T1($){return async(Q,Z)=>{if(Z?.aborted)throw Error("aborted");let X=new L1({timeout:JZ,tries:1});if($)X.setServers($);let J=()=>X.cancel();Z?.addEventListener("abort",J,{once:!0});try{let[Y,K]=await Promise.allSettled([X.resolve4(Q),X.resolve6(Q)]),V=[...Y.status==="fulfilled"?Y.value:[],...K.status==="fulfilled"?K.value:[]];if(V.length>0)return V;let G=[Y,K].flatMap((B)=>B.status==="rejected"?[B.reason]:[]);throw G.find((B)=>["dns_temporary","dns_timeout"].includes(XZ(B)))??G[0]??Object.assign(Error("DNS returned no addresses"),{code:"ENODATA"})}finally{Z?.removeEventListener("abort",J)}}}var O1=T1();async function D1($,Q,Z,X){if(X?.aborted)throw Error("aborted");let J=new AbortController,Y,K,V=Q($,J.signal);V.catch(()=>{});try{return await Promise.race([V,new Promise((G,F)=>{if(Y=setTimeout(()=>F(new DOMException("DNS lookup timed out","TimeoutError")),Z),X)K=()=>F(Error("aborted")),X.addEventListener("abort",K,{once:!0})})])}finally{if(Y!==void 0)clearTimeout(Y);if(X&&K)X.removeEventListener("abort",K);J.abort()}}async function XX($,Q=O1,Z){let X=ZZ($);if(e9(X))return t9(X)?{ok:!1,reason:"non_public_ip"}:{ok:!0,addresses:[X]};let J;try{J=await D1(X,Q,JZ,Z)}catch(Y){return{ok:!1,reason:Z?.aborted?Z.reason instanceof Error&&Z.reason.name==="TimeoutError"?"dns_timeout":"aborted":XZ(Y)}}if(J.length===0)return{ok:!1,reason:"dns_empty"};if(J.some(t9))return{ok:!1,reason:"non_public_ip"};return{ok:!0,addresses:J}}var _1=/^(?:\*\.)?[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?$/;function c8($){return $.length<=253&&_1.test($.toLowerCase())}function A1($,Q){let Z=$.trim().toLowerCase();if(!c8(Z))return!1;if(Z.startsWith("*.")){let X=Z.slice(2);return Q===X||Q.endsWith(`.${X}`)}return Z===Q}function x1($){let Q=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec($);if(!Q)return null;let Z=Q.slice(1).map(Number);return Z.some((X)=>X>255)?null:Z}function d8($,Q=[]){let Z=(X)=>{if(X=X.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,""),!X.includes(":"))return X;try{X=new URL(`http://[${X}]/`).hostname.slice(1,-1)}catch{return X}let J=/^::ffff:([\da-f]+):([\da-f]+)$/.exec(X);if(!J)return X;let Y=parseInt(J[1],16),K=parseInt(J[2],16);return`${Y>>8}.${Y&255}.${K>>8}.${K&255}`};return Q.some((X)=>Z(X)===Z($))}function l0($){$=$.toLowerCase().replace(/^\[|\]$/g,"");let Q=x1($);if(Q){let[Y,K,V]=Q;if(Y===127)return"loopback";return Y===0||Y===10||Y>=224||Y===100&&K>=64&&K<=127||Y===169&&K===254||Y===172&&K>=16&&K<=31||Y===192&&(K===168||K===0&&(V===0||V===2)||K===88&&V===99)||Y===198&&(K===18||K===19||K===51&&V===100)||Y===203&&K===0&&V===113?"private":"public"}if(!$.includes(":"))return"hostname";try{$=new URL(`http://[${$}]/`).hostname.slice(1,-1)}catch{return"private"}if($==="::1")return"loopback";let Z=/^::ffff:([\da-f]+):([\da-f]+)$/.exec($);if(Z){let Y=parseInt(Z[1],16),K=parseInt(Z[2],16);return l0(`${Y>>8}.${Y&255}.${K>>8}.${K&255}`)==="public"?"public":"private"}let[X,J=0]=$.split(":").map((Y)=>parseInt(Y||"0",16));return X<8192||X>16383||X===8194||X===8193&&(J<512||J===3512)||X===16383&&J<4096?"private":"public"}function I9($,Q){let Z;try{Z=new URL($)}catch{return{allowed:!1,url:$,host:null,reason:"invalid_url"}}if(["about:","data:","blob:"].includes(Z.protocol))return{allowed:!0,url:$,host:null,reason:"local_document"};if(!["http:","https:","ws:","wss:"].includes(Z.protocol))return{allowed:!1,url:$,host:Z.hostname||null,reason:"unsupported_protocol"};let X=Z.hostname.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");if(Q.mode==="off")return{allowed:!0,url:$,host:X,reason:"policy_off"};let J=(V)=>({allowed:!1,url:$,host:X,reason:V});if(Z.username||Z.password)return J("invalid_url");if(Q.mode==="public_web"){let V=l0(X)!=="public"&&l0(X)!=="hostname"||X==="localhost"||/\.(?:localhost|local|internal|arpa)$/.test(X)||!X.includes(".")&&!YZ(X)||Boolean(YZ(X)&&t9(X));return{allowed:!V,url:$,host:X,reason:V?"private_network":"public_web"}}let Y=Number(Z.port||(["https:","wss:"].includes(Z.protocol)?443:80));if(Q.deniedPorts?.includes(Y)||d8(X,Q.deniedHosts))return J("destination_not_allowed");let K=l0(X);if(K==="private"||["local","internal","arpa"].some((V)=>X===V||X.endsWith(`.${V}`)))return J("private_network");if(K==="loopback"||X==="localhost"||X.endsWith(".localhost"))return Q.allowedLoopbackPorts?.includes(Y)?{allowed:!0,url:$,host:X,reason:"loopback"}:J("destination_not_allowed");if(Q.allowedDomains.some((V)=>A1(V,X)))return{allowed:!0,url:$,host:X,reason:"allowed_domain"};return{allowed:!1,url:$,host:X,reason:"destination_not_allowed"}}import zZ from"child_process";import{accessSync as I1,constants as R1,readFileSync as E1,statSync as FZ}from"fs";import{createRequire as HZ}from"module";import{homedir as KZ}from"os";import{dirname as S1,isAbsolute as p8,join as Y9,resolve as w1}from"path";var $8=Object.freeze({schemaVersion:1,driver:"playwright-core",driverVersion:VZ.dependencies["playwright-core"],browser:"chromium"}),UZ=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Chromium.app/Contents/MacOS/Chromium"],l8=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable"];function R9($){try{return I1($,R1.X_OK),p8($)&&FZ($).isFile()}catch{return!1}}function u8($,Q=process.platform){let Z=Q==="darwin"?UZ:Q==="linux"?l8:null;return Z?($??Z).find(R9)??null:null}function b1(){if(!process.versions.bun)return;let $=Symbol.for("ara.headless-browser.bun-pipe-owners");if(Object.hasOwn(globalThis,$))return;let Q=[];zZ.spawn=new Proxy(zZ.spawn,{apply(Z,X,J){let Y=Reflect.apply(Z,X,J),K=J[1],V=J[2]?.stdio;if(Array.isArray(K)&&K.includes("--remote-debugging-pipe")&&Array.isArray(V)&&V[3]==="pipe"&&V[4]==="pipe")Q.push(Y);return Y}}),Object.defineProperty(globalThis,$,{value:Q})}async function Q8($){if(b1(),$!==void 0){if(!p8($))throw Error("hands_browser_driver_path_must_be_absolute");let X=Y9($,"package.json"),J=JSON.parse(E1(X,"utf8"));if(J.name!==$8.driver)throw Error("hands_browser_wrong_driver");let Y=HZ(X)($),K=Y.default?.chromium??Y.chromium;if(!K)throw Error("hands_browser_missing_chromium");return{version:J.version,chromium:K}}let[Q,Z]=await Promise.all([import("./index-p6kg955p.js"),import("./package-28msp113.js").then((m)=>P1(m.default,1))]);return{version:Z.default.version,chromium:Q.chromium}}var k1=($,Q=$8.driverVersion)=>({status:"unavailable",reason:$,expectedDriverVersion:Q}),f1=($)=>$.loadDriver?.()??Q8($.driverModuleDirectory),g1={"1.60.0":"1223"};function BX(){let $=process.platform,Q=g1[$8.driverVersion];if(!Q||$!=="linux"&&$!=="darwin")return!1;let Z=(X)=>process.env[X]??process.env[`npm_config_${X.toLowerCase()}`]??process.env[`npm_package_config_${X.toLowerCase()}`];try{let X=Z("PLAYWRIGHT_BROWSERS_PATH"),J=X==="0"?Y9(S1(HZ(import.meta.url).resolve("playwright-core/package.json")),".local-browsers"):X?w1(Z("INIT_CWD")||process.cwd(),X):Y9($==="darwin"?Y9(KZ(),"Library","Caches"):process.env.XDG_CACHE_HOME||Y9(KZ(),".cache"),"ms-playwright");return FZ(Y9(J,`chromium-${Q}`,"INSTALLATION_COMPLETE")).isFile()}catch{return!1}}async function G9($={}){return WZ($,$8.driverVersion)}async function s8($,Q={}){if($.driverVersion!=="1.61.1"||!p8($.driverModuleDirectory))throw Error("hands_browser_invalid_managed_compatibility");return WZ({...Q,driverModuleDirectory:$.driverModuleDirectory,allowSystemBrowser:!0},$.driverVersion)}async function WZ($,Q){let Z=(G)=>k1(G,Q),X=$.platform??process.platform;if(X!=="linux"&&X!=="darwin")return Z("unsupported_platform");let J;try{J=await f1($)}catch{return Z("driver_missing")}if(J.version!==Q)return Z("driver_version_mismatch");let Y=(G,F)=>({status:"resolved",executablePath:G,source:F,driverVersion:J.version});if($.executablePath!==void 0)return R9($.executablePath)?Y($.executablePath,"configured"):Z("executable_missing");let K=J.chromium.executablePath();if(R9(K))return Y(K,"managed");let V=$.allowSystemBrowser===!0?u8($.systemCandidates,X):null;return V?Y(V,"system"):Z("executable_missing")}var a1=["/usr/local/bin/chromium",...l8];function o1($,Q=qZ()){return u8($??(Q==="linux"?a1:void 0),Q)}async function r1(){try{return(await Q8()).chromium}catch{return l1(import.meta.url)("playwright-core").chromium}}var t1=1048576,e1=105000,$7=20000,NZ=5000,Q7=2000,Z7=1000,X7=30000,MZ=81920,J7={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif"};async function Y7($,Q){let Z=new URL($.url()),X={...await $.allHeaders(),host:Z.host};for(let J of Object.keys(X))if(/^(?:proxy-|connection$|upgrade$|transfer-encoding$|content-length$)/i.test(J))delete X[J];return new Promise((J,Y)=>{let V=(Z.protocol==="https:"?s1:u1)(Z,{method:$.method(),headers:X,agent:!1,lookup:(F,B,H)=>{let z=u0.isIP(Q);if(B.all)H(null,[{address:Q,family:z}]);else H(null,Q,z)}},(F)=>{let B=[],H=0;F.on("data",(z)=>{if(H+=z.length,H>33554432)V.destroy(Error("hands_browser_response_too_large"));else B.push(z)}),F.on("error",Y),F.on("end",()=>{let z={};for(let[L,W]of Object.entries(F.headers))if(W!==void 0&&!["transfer-encoding","connection","content-length"].includes(L))z[L]=Array.isArray(W)?W.join(`
|
|
306
|
+
`.trim();import{Buffer as X9}from"buffer";import{randomUUID as z1}from"crypto";class aQ extends Error{code;constructor($){super($==="hands_repl_private_profile_attribute_denied"?"Private browser attribute read denied.":$);this.code=$;this.name="HandsReplBrowserDispatcherError"}}var oQ=new Set(["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__proto__","constructor","prototype"]),sQ=/^hands_[A-Za-z0-9_-]{8,128}$/,K1=2048,rQ=32,tQ=1e4,V1=new Set(["href","src","alt","title","role","aria-label","aria-expanded","aria-checked","aria-selected","aria-disabled","placeholder","type","name","data-testid"]);function F1($){let Q=$.split("+"),Z=(Q.pop()??"").replace(/^Key/,"").toLowerCase();if(Z==="f12")return!0;if(Q.some((X)=>["Control","ControlOrMeta","Meta"].includes(X))&&["l","n","t","j","i","p","s","w","u","o","r","tab","pageup","pagedown"].includes(Z))return!0;if(Q.some((X)=>["Control","ControlOrMeta","Meta"].includes(X))&&Q.includes("Shift")&&Z==="c")return!0;return Q.includes("Alt")&&["d","arrowleft","arrowright","home"].includes(Z)}var H1=($)=>{let Q=$.closest("a[href],area[href]");return{password:$.tagName==="INPUT"&&$.type==="password",executableLink:Boolean(Q&&!/^(https?:|about:blank)/i.test(Q.href))}},eQ={browser:{close:{returns:"void"},contexts:{returns:"context[]"},isConnected:{returns:"json"},version:{returns:"json"}},context:{addCookies:{returns:"void"},addInitScript:{returns:"void"},browser:{returns:"browser"},clearCookies:{returns:"void"},clearPermissions:{returns:"void"},close:{returns:"void"},cookies:{returns:"json"},grantPermissions:{returns:"void"},newPage:{returns:"page"},pages:{returns:"page[]"},setDefaultNavigationTimeout:{returns:"void"},setDefaultTimeout:{returns:"void"},setExtraHTTPHeaders:{returns:"void"},setGeolocation:{returns:"void"},setHTTPCredentials:{returns:"void"},setOffline:{returns:"void"},setViewportSize:{returns:"void"},storageState:{returns:"json"},viewportSize:{returns:"json",special:"contextViewportSize"}},page:{addInitScript:{returns:"void"},addScriptTag:{returns:"void"},addStyleTag:{returns:"void"},bringToFront:{returns:"void"},close:{returns:"void"},content:{returns:"json"},context:{returns:"context"},emulateMedia:{returns:"void"},evaluate:{returns:"json",requiresStringSource:!0},frame:{returns:"frame"},frameLocator:{returns:"frameLocator"},frames:{returns:"frame[]"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},goBack:{returns:"void"},goForward:{returns:"void"},goto:{returns:"void"},isClosed:{returns:"json"},locator:{returns:"locator"},mainFrame:{returns:"frame"},opener:{returns:"page"},pdf:{returns:"bytes"},reload:{returns:"void"},screenshot:{returns:"bytes"},selectOption:{returns:"json"},setContent:{returns:"void"},setDefaultNavigationTimeout:{returns:"void"},setDefaultTimeout:{returns:"void"},setExtraHTTPHeaders:{returns:"void"},setInputFiles:{returns:"void"},setViewportSize:{returns:"void"},title:{returns:"json"},url:{returns:"json"},viewportSize:{returns:"json"},waitForFunction:{returns:"void",requiresStringSource:!0},waitForLoadState:{returns:"void"},waitForNavigation:{returns:"void"},waitForTimeout:{returns:"void"},waitForURL:{returns:"void"}},locator:{all:{returns:"locator[]"},allInnerTexts:{returns:"json"},allTextContents:{returns:"json"},and:{returns:"locator"},ariaSnapshot:{returns:"json"},blur:{returns:"void"},boundingBox:{returns:"json"},check:{returns:"void"},clear:{returns:"void"},click:{returns:"void"},contentFrame:{returns:"frameLocator"},count:{returns:"json"},dblclick:{returns:"void"},dragTo:{returns:"void"},evaluate:{returns:"json",requiresStringSource:!0},evaluateAll:{returns:"json",requiresStringSource:!0},fill:{returns:"void"},filter:{returns:"locator"},first:{returns:"locator",special:"property"},focus:{returns:"void"},getAttribute:{returns:"json"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},hover:{returns:"void"},innerHTML:{returns:"json"},innerText:{returns:"json"},inputValue:{returns:"json"},isChecked:{returns:"json"},isEditable:{returns:"json"},isEnabled:{returns:"json"},isHidden:{returns:"json"},isVisible:{returns:"json"},last:{returns:"locator",special:"property"},locator:{returns:"locator"},nth:{returns:"locator"},or:{returns:"locator"},page:{returns:"page"},press:{returns:"void"},pressSequentially:{returns:"void"},scrollIntoViewIfNeeded:{returns:"void"},screenshot:{returns:"bytes"},selectOption:{returns:"json"},setInputFiles:{returns:"void"},tap:{returns:"void"},textContent:{returns:"json"},type:{returns:"void"},uncheck:{returns:"void"},waitFor:{returns:"void"}},frame:{addScriptTag:{returns:"void"},addStyleTag:{returns:"void"},childFrames:{returns:"frame[]"},content:{returns:"json"},evaluate:{returns:"json",requiresStringSource:!0},frameLocator:{returns:"frameLocator"},getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},goto:{returns:"void"},isDetached:{returns:"json"},locator:{returns:"locator"},name:{returns:"json"},page:{returns:"page"},parentFrame:{returns:"frame"},setContent:{returns:"void"},title:{returns:"json"},url:{returns:"json"},waitForFunction:{returns:"void",requiresStringSource:!0},waitForLoadState:{returns:"void"},waitForNavigation:{returns:"void"},waitForTimeout:{returns:"void"},waitForURL:{returns:"void"}},frameLocator:{getByAltText:{returns:"locator"},getByLabel:{returns:"locator"},getByPlaceholder:{returns:"locator"},getByRole:{returns:"locator"},getByTestId:{returns:"locator"},getByText:{returns:"locator"},getByTitle:{returns:"locator"},locator:{returns:"locator"},owner:{returns:"locator"}}};function I($){throw new aQ($)}function z0($){if(!$||typeof $!=="object"||Array.isArray($))return!1;let Q=Object.getPrototypeOf($);return Q===Object.prototype||Q===null}function J9($,Q=0,Z={nodes:0}){if(Q>rQ||++Z.nodes>tQ)I("hands_repl_json_too_complex");if($===null||typeof $==="boolean"||typeof $==="string")return;if(typeof $==="number"){if(!Number.isFinite($))I("hands_repl_invalid_json");return}if(Array.isArray($)){for(let X of $)J9(X,Q+1,Z);return}if(!z0($))I("hands_repl_invalid_json");for(let[X,J]of Object.entries($)){if(oQ.has(X))I("hands_repl_invalid_json");J9(J,Q+1,Z)}}function h8($){return typeof $==="string"&&Object.hasOwn(eQ,$)}function U1($){if(!$.endsWith("[]"))return null;let Q=$.slice(0,-2);return h8(Q)?Q:null}function nQ($){return z0($)&&Object.keys($).length===2&&$.$handsRepl==="bytes"&&typeof $.base64==="string"}function W1($){return z0($)&&Object.keys($).length===1&&$.$handsRepl==="undefined"}function iQ($){return z0($)&&Object.keys($).length===2&&$.$handsRepl==="routeFulfill"&&"options"in $}function k0($){return!!$&&typeof $==="object"}function r9(){return Object.freeze({$handsRepl:"undefined"})}function B1($){if(!X9.isBuffer($)&&!($ instanceof Uint8Array))I("hands_repl_expected_bytes");return Object.freeze({$handsRepl:"bytes",base64:X9.from($).toString("base64")})}function $Z($){if(!k0($.browser)||!k0($.context)||!k0($.page))I("hands_repl_invalid_roots");if(typeof $.a11y!=="function"||typeof $.view!=="function")I("hands_repl_invalid_callbacks");let Q=$.maxHandles??K1;if(!Number.isInteger(Q)||Q<3||Q>1e5)I("hands_repl_invalid_handle_limit");let Z=new Map,X=new WeakMap,J=$.createOpaqueId??z1,Y=(z,L)=>{if(!k0(L))I("hands_repl_expected_target");let W=X.get(L)?.get(z);if(W)return W;if(Z.size>=Q)I("hands_repl_handle_limit");let U="";for(let q=0;q<16;q+=1){let A=`hands_${J()}`;if(sQ.test(A)&&!Z.has(A)){U=A;break}}if(!U)I("hands_repl_invalid_opaque_id");let j=Object.freeze({$handsRepl:"handle",id:U,kind:z});Z.set(U,{kind:z,target:L});let O=X.get(L);if(!O)O=new Map,X.set(L,O);return O.set(z,j),j},K=Object.freeze({browser:Y("browser",$.browser),context:Y("context",$.context),page:Y("page",$.page)}),V=(z)=>{if(!z0(z)||Object.keys(z).length!==3||z.$handsRepl!=="handle"||typeof z.id!=="string"||!sQ.test(z.id)||!h8(z.kind))I("hands_repl_invalid_handle");let L=Z.get(z.id);if(!L||L.kind!==z.kind)I("hands_repl_unknown_handle");return L},G=(z,L=0,W=new Set)=>{if(L>rQ)I("hands_repl_json_too_complex");if(z===void 0)return r9();if(z===null||typeof z==="boolean"||typeof z==="string")return z;if(typeof z==="number"){if(!Number.isFinite(z))I("hands_repl_non_json_result");return z}if(Array.isArray(z)){if(W.has(z))I("hands_repl_cyclic_result");W.add(z);try{return z.map((U)=>G(U,L+1,W))}finally{W.delete(z)}}if(!z0(z))I("hands_repl_non_json_result");if(W.has(z))I("hands_repl_cyclic_result");W.add(z);try{let U=Object.create(null);for(let j of Object.keys(z)){let O=Object.getOwnPropertyDescriptor(z,j);if(!O||!("value"in O))continue;U[j]=G(O.value,L+1,W)}return U}finally{W.delete(z)}},F=(z,L)=>{if(L==="void")return r9();if(L==="json")return G(z);if(L==="bytes")return B1(z);let W=U1(L);if(W){if(!Array.isArray(z))I("hands_repl_expected_target_list");if(W==="context"&&z.some((U)=>U!==$.context))I("hands_repl_foreign_context");return z.map((U)=>Y(W,U))}if(z===null||z===void 0)return r9();if(!h8(L))I("hands_repl_invalid_return_kind");if(L==="context"&&z!==$.context)I("hands_repl_foreign_context");return Y(L,z)},B=(z)=>{if(z0(z)&&z.$handsRepl==="handle")return V(z).target;if(nQ(z))return X9.from(z.base64,"base64");if(W1(z))return;if(iQ(z))I("hands_repl_route_fulfill_only");if(Array.isArray(z))return z.map(B);if(!z0(z))return z;let L=Object.create(null);for(let[W,U]of Object.entries(z))L[W]=B(U);return L};return Object.freeze({roots:K,dispatch:async(z)=>{if(!z0(z)||typeof z.type!=="string")I("hands_repl_invalid_request");if(z.type==="a11y"){let T=z.target===void 0?Z.get(K.page.id):V(z.target);if(!T||T.kind!=="page"&&T.kind!=="locator")I("hands_repl_invalid_a11y_target");return G(await $.a11y(T.target))}if(z.type==="view"){if(J9(z.source),z.options!==void 0)J9(z.options);let T=nQ(z.source)?X9.from(z.source.base64,"base64"):z.source;if($.privateProfile&&!X9.isBuffer(T))I("hands_repl_profile_requires_image_bytes");return G(await $.view(T,z.options))}if(z.type!=="call")I("hands_repl_invalid_request");if(typeof z.method!=="string"||z.method.length===0||z.method.length>128)I("hands_repl_invalid_method");if(oQ.has(z.method))I("hands_repl_forbidden_method");let L=V(z.target),W=z.args??[];if(!Array.isArray(W))I("hands_repl_invalid_arguments");if(J9(W),L.kind==="page"&&z.method==="captureScreenshot"){if(W.length!==0)I("hands_repl_invalid_arguments");if(!$.screenshotExport)I("hands_repl_screenshot_export_unavailable");return G(await $.screenshotExport(L.target))}if(L.kind==="context"&&["startRecording","stopRecording"].includes(z.method)){if(!$.recording||L.target!==$.context)I("hands_repl_recording_unavailable");if(W.length>(z.method==="startRecording"?1:0))I("hands_repl_invalid_arguments");return G(z.method==="startRecording"?await $.recording.start(W[0]):await $.recording.stop())}if($.privateProfile){let T=z.method;if(["evaluate","evaluateAll","waitForFunction","addInitScript","addScriptTag","addStyleTag","setContent","setInputFiles","route","content","cookies","storageState","addCookies","clearCookies","setExtraHTTPHeaders","setHTTPCredentials","grantPermissions","clearPermissions","innerHTML","textContent","allTextContents"].includes(T)||L.kind==="browser"&&T==="close"||L.kind==="context"&&T==="close")I("hands_repl_private_profile_method_denied");if(L.kind==="browser"&&T==="contexts")return F([$.context],"context[]");if((T==="screenshot"||T==="pdf")&&z0(W[0])&&(("path"in W[0])||("style"in W[0])))I("hands_repl_private_profile_path_denied");if(T==="goto"){if(typeof W[0]!=="string")I("hands_repl_private_profile_url_denied");try{let S=new URL(W[0]);if(!["http:","https:"].includes(S.protocol)&&W[0]!=="about:blank")I("hands_repl_private_profile_url_denied")}catch{I("hands_repl_private_profile_url_denied")}}if(T==="getAttribute"&&(typeof W[0]!=="string"||!V1.has(W[0].toLowerCase())))I("hands_repl_private_profile_attribute_denied");if(L.kind==="locator"&&["innerText","allInnerTexts","getAttribute"].includes(T)){let S=[L.target];if(T==="allInnerTexts"){let g=Reflect.get(L.target,"all");if(typeof g!=="function")I("hands_repl_private_profile_probe_unavailable");let E=await Reflect.apply(g,L.target,[]);if(!Array.isArray(E)||E.length>tQ||!E.every(k0))I("hands_repl_private_profile_probe_unavailable");S=E}for(let g of S){let E=Reflect.get(g,"isVisible");if(typeof E!=="function"||!await Reflect.apply(E,g,[]))I("hands_repl_private_profile_hidden_value_denied")}}if(T==="press"&&typeof W[0]==="string"&&F1(W[0]))I("hands_repl_private_profile_browser_shortcut_denied");if(L.kind==="locator"&&["inputValue","click","dblclick","tap","press"].includes(T)){let S=Reflect.get(L.target,"evaluate");if(typeof S!=="function")I("hands_repl_private_profile_probe_unavailable");let g=await Reflect.apply(S,L.target,[H1]);if(!z0(g)||typeof g.password!=="boolean"||typeof g.executableLink!=="boolean")I("hands_repl_private_profile_probe_unavailable");if(T==="inputValue"&&g.password)I("hands_repl_private_profile_password_denied");if(T!=="inputValue"&&g.executableLink)I("hands_repl_private_profile_url_denied");if(T==="inputValue"){let E=Reflect.get(L.target,"isVisible");if(typeof E!=="function"||!await Reflect.apply(E,L.target,[]))I("hands_repl_private_profile_hidden_value_denied")}}}let U=eQ[L.kind][z.method];if(!U)I("hands_repl_method_not_allowed");if(U.requiresStringSource&&typeof W[0]!=="string")I("hands_repl_string_source_required");if(L.kind==="browser"&&z.method==="contexts")return[K.context];if(["addInitScript","addScriptTag","addStyleTag","screenshot","pdf","storageState"].includes(z.method)&&W.some((T)=>z0(T)&&("path"in T)))I("hands_repl_file_path_not_allowed");if(z.method==="goto"&&typeof W[0]==="string"){let T;try{T=new URL(W[0]).protocol}catch{I("hands_repl_invalid_url")}if(!["http:","https:","data:","about:","blob:"].includes(T))I("hands_repl_file_path_not_allowed")}if(U.special==="contextViewportSize"){let T=Reflect.get(L.target,"pages");if(typeof T!=="function")I("hands_repl_method_unavailable");let S=await Reflect.apply(T,L.target,[]),g=Array.isArray(S)?S[0]:void 0,E=k0(g)?Reflect.get(g,"viewportSize"):void 0;if(typeof E!=="function")return r9();return F(await Reflect.apply(E,g,[]),U.returns)}if(U.special==="property"){let T=Reflect.get(L.target,z.method);return F(typeof T==="function"?Reflect.apply(T,L.target,[]):T,U.returns)}let j=Reflect.get(L.target,z.method);if(typeof j!=="function")I("hands_repl_method_unavailable");if(U.special==="route"){let T=W[1];if(!iQ(T))I("hands_repl_invalid_route_handler");J9(T.options);let S=B(T.options),g=async(M)=>{if(!k0(M))I("hands_repl_invalid_route");let D=Reflect.get(M,"fulfill");if(typeof D!=="function")I("hands_repl_invalid_route");await Reflect.apply(D,M,[S])},E=[B(W[0]??null),g],N=await Reflect.apply(j,L.target,E);return F(N,U.returns)}let O=W.map(B);if(z.method==="setInputFiles"){let T=L.kind==="locator"?0:1,S=async(E)=>{if(typeof E!=="string"){if(!z0(E)||typeof E.name!=="string"||typeof E.mimeType!=="string"||!X9.isBuffer(E.buffer))I("hands_repl_invalid_file_input");return E}if(!$.readWorkspaceFile)I("hands_repl_workspace_required");return $.readWorkspaceFile(E)},g=O[T];O[T]=Array.isArray(g)?await Promise.all(g.map(S)):await S(g)}if(z.method==="goto")await $.beforeNavigation?.();let q=$.actionRecorder?.(),A=await Reflect.apply(j,L.target,O),P={click:"Click browser element",tap:"Click browser element",dblclick:"Double click browser element",fill:"Type text",type:"Type text",pressSequentially:"Type text",clear:"Clear browser field",press:"Press key",scrollIntoViewIfNeeded:"Scroll browser element into view",dragTo:"Drag on computer",selectOption:"Select browser option",check:"Check browser control",uncheck:"Uncheck browser control",hover:"Hover browser element",focus:"Focus browser element",goto:"Open browser page",reload:"Reload browser page",goBack:"Go back in browser",goForward:"Go forward in browser",screenshot:"Take browser screenshot"}[z.method];if(P){let T=Reflect.get(L.target,"page"),S=L.kind==="page"?L.target:typeof T==="function"?Reflect.apply(T,L.target,[]):void 0;q?.(P,k0(S)?S:void 0)}return F(A,U.returns)}})}import{isIP as YZ}from"net";import{Resolver as L1}from"dns/promises";import{isIP as e9}from"net";var N1=[["0.0.0.0",8],["10.0.0.0",8],["100.64.0.0",10],["127.0.0.0",8],["169.254.0.0",16],["172.16.0.0",12],["192.0.0.0",24],["192.0.2.0",24],["192.168.0.0",16],["198.18.0.0",15],["198.51.100.0",24],["203.0.113.0",24],["224.0.0.0",4],["240.0.0.0",4]];function v8($){if(e9($)!==4)return null;let Q=$.split(".");if(Q.length!==4)return null;let Z=0;for(let X of Q){let J=Number(X);if(!Number.isInteger(J)||J<0||J>255)return null;Z=Z*256+J}return Z>>>0}function M1($,Q,Z){let X=v8(Q);if(X===null)return!1;let J=Z===0?0:4294967295<<32-Z>>>0;return($&J)>>>0===(X&J)>>>0}function QZ($){let Q=v8($);if(Q===null)return!0;return N1.some(([Z,X])=>M1(Q,Z,X))}function j1($){if(e9($)!==6)return null;let Q=$.toLowerCase(),Z=Q.indexOf("%");if(Z>=0)Q=Q.slice(0,Z);let X=[],J=Q.lastIndexOf(":"),Y=J>=0?Q.slice(J+1):"";if(Y.includes(".")){let z=v8(Y);if(z===null)return null;X=[z>>>16&65535,z&65535],Q=Q.slice(0,J+1)+"0:0"}let K=Q.split("::");if(K.length>2)return null;let V=(z)=>{if(z==="")return[];let L=[];for(let W of z.split(":")){if(W===""||W.length>4||!/^[0-9a-f]+$/.test(W))return null;L.push(Number.parseInt(W,16))}return L},G=V(K[0]??"");if(G===null)return null;if(K.length===1){let z=G;if(z.length!==8)return null;return X.length>0?z.slice(0,6).concat(X):z}let F=V(K[1]??"");if(F===null)return null;let B=8-G.length-F.length;if(B<0)return null;let H=G.concat(Array(B).fill(0),F);if(H.length!==8)return null;return X.length>0?H.slice(0,6).concat(X):H}function C1($,Q){return`${$>>8&255}.${$&255}.${Q>>8&255}.${Q&255}`}function q1($){let Q=j1($);if(Q===null)return!0;let[Z,X,J]=Q;if((Z&57344)!==8192)return!0;if(Z===8193&&(X&65024)===0)return!0;if(Z===8193&&X===3512)return!0;if(Z===16383&&(X&61440)===0)return!0;if(Z===8194)return QZ(C1(X,J));return!1}function ZZ($){return $.replace(/^\[|\]$/g,"")}function t9($){let Q=ZZ($.trim()),Z=e9(Q);if(Z===4)return QZ(Q);if(Z===6)return q1(Q);return!0}function XZ($){if($ instanceof Error&&$.name==="TimeoutError")return"dns_timeout";switch(typeof $==="object"&&$!==null&&"code"in $?$.code:void 0){case"ENOTFOUND":return"dns_not_found";case"ENODATA":return"dns_empty";case"EAI_AGAIN":case"ESERVFAIL":case"ECONNREFUSED":return"dns_temporary";case"ETIMEOUT":case"ETIMEDOUT":return"dns_timeout";default:return"dns_failed"}}var JZ=5000;function T1($){return async(Q,Z)=>{if(Z?.aborted)throw Error("aborted");let X=new L1({timeout:JZ,tries:1});if($)X.setServers($);let J=()=>X.cancel();Z?.addEventListener("abort",J,{once:!0});try{let[Y,K]=await Promise.allSettled([X.resolve4(Q),X.resolve6(Q)]),V=[...Y.status==="fulfilled"?Y.value:[],...K.status==="fulfilled"?K.value:[]];if(V.length>0)return V;let G=[Y,K].flatMap((B)=>B.status==="rejected"?[B.reason]:[]);throw G.find((B)=>["dns_temporary","dns_timeout"].includes(XZ(B)))??G[0]??Object.assign(Error("DNS returned no addresses"),{code:"ENODATA"})}finally{Z?.removeEventListener("abort",J)}}}var O1=T1();async function D1($,Q,Z,X){if(X?.aborted)throw Error("aborted");let J=new AbortController,Y,K,V=Q($,J.signal);V.catch(()=>{});try{return await Promise.race([V,new Promise((G,F)=>{if(Y=setTimeout(()=>F(new DOMException("DNS lookup timed out","TimeoutError")),Z),X)K=()=>F(Error("aborted")),X.addEventListener("abort",K,{once:!0})})])}finally{if(Y!==void 0)clearTimeout(Y);if(X&&K)X.removeEventListener("abort",K);J.abort()}}async function XX($,Q=O1,Z){let X=ZZ($);if(e9(X))return t9(X)?{ok:!1,reason:"non_public_ip"}:{ok:!0,addresses:[X]};let J;try{J=await D1(X,Q,JZ,Z)}catch(Y){return{ok:!1,reason:Z?.aborted?Z.reason instanceof Error&&Z.reason.name==="TimeoutError"?"dns_timeout":"aborted":XZ(Y)}}if(J.length===0)return{ok:!1,reason:"dns_empty"};if(J.some(t9))return{ok:!1,reason:"non_public_ip"};return{ok:!0,addresses:J}}var _1=/^(?:\*\.)?[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?$/;function c8($){return $.length<=253&&_1.test($.toLowerCase())}function A1($,Q){let Z=$.trim().toLowerCase();if(!c8(Z))return!1;if(Z.startsWith("*.")){let X=Z.slice(2);return Q===X||Q.endsWith(`.${X}`)}return Z===Q}function x1($){let Q=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec($);if(!Q)return null;let Z=Q.slice(1).map(Number);return Z.some((X)=>X>255)?null:Z}function d8($,Q=[]){let Z=(X)=>{if(X=X.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,""),!X.includes(":"))return X;try{X=new URL(`http://[${X}]/`).hostname.slice(1,-1)}catch{return X}let J=/^::ffff:([\da-f]+):([\da-f]+)$/.exec(X);if(!J)return X;let Y=parseInt(J[1],16),K=parseInt(J[2],16);return`${Y>>8}.${Y&255}.${K>>8}.${K&255}`};return Q.some((X)=>Z(X)===Z($))}function l0($){$=$.toLowerCase().replace(/^\[|\]$/g,"");let Q=x1($);if(Q){let[Y,K,V]=Q;if(Y===127)return"loopback";return Y===0||Y===10||Y>=224||Y===100&&K>=64&&K<=127||Y===169&&K===254||Y===172&&K>=16&&K<=31||Y===192&&(K===168||K===0&&(V===0||V===2)||K===88&&V===99)||Y===198&&(K===18||K===19||K===51&&V===100)||Y===203&&K===0&&V===113?"private":"public"}if(!$.includes(":"))return"hostname";try{$=new URL(`http://[${$}]/`).hostname.slice(1,-1)}catch{return"private"}if($==="::1")return"loopback";let Z=/^::ffff:([\da-f]+):([\da-f]+)$/.exec($);if(Z){let Y=parseInt(Z[1],16),K=parseInt(Z[2],16);return l0(`${Y>>8}.${Y&255}.${K>>8}.${K&255}`)==="public"?"public":"private"}let[X,J=0]=$.split(":").map((Y)=>parseInt(Y||"0",16));return X<8192||X>16383||X===8194||X===8193&&(J<512||J===3512)||X===16383&&J<4096?"private":"public"}function I9($,Q){let Z;try{Z=new URL($)}catch{return{allowed:!1,url:$,host:null,reason:"invalid_url"}}if(["about:","data:","blob:"].includes(Z.protocol))return{allowed:!0,url:$,host:null,reason:"local_document"};if(!["http:","https:","ws:","wss:"].includes(Z.protocol))return{allowed:!1,url:$,host:Z.hostname||null,reason:"unsupported_protocol"};let X=Z.hostname.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");if(Q.mode==="off")return{allowed:!0,url:$,host:X,reason:"policy_off"};let J=(V)=>({allowed:!1,url:$,host:X,reason:V});if(Z.username||Z.password)return J("invalid_url");if(Q.mode==="public_web"){let V=l0(X)!=="public"&&l0(X)!=="hostname"||X==="localhost"||/\.(?:localhost|local|internal|arpa)$/.test(X)||!X.includes(".")&&!YZ(X)||Boolean(YZ(X)&&t9(X));return{allowed:!V,url:$,host:X,reason:V?"private_network":"public_web"}}let Y=Number(Z.port||(["https:","wss:"].includes(Z.protocol)?443:80));if(Q.deniedPorts?.includes(Y)||d8(X,Q.deniedHosts))return J("destination_not_allowed");let K=l0(X);if(K==="private"||["local","internal","arpa"].some((V)=>X===V||X.endsWith(`.${V}`)))return J("private_network");if(K==="loopback"||X==="localhost"||X.endsWith(".localhost"))return Q.allowedLoopbackPorts?.includes(Y)?{allowed:!0,url:$,host:X,reason:"loopback"}:J("destination_not_allowed");if(Q.allowedDomains.some((V)=>A1(V,X)))return{allowed:!0,url:$,host:X,reason:"allowed_domain"};return{allowed:!1,url:$,host:X,reason:"destination_not_allowed"}}import zZ from"child_process";import{accessSync as I1,constants as R1,readFileSync as E1,statSync as FZ}from"fs";import{createRequire as HZ}from"module";import{homedir as KZ}from"os";import{dirname as S1,isAbsolute as p8,join as Y9,resolve as w1}from"path";var $8=Object.freeze({schemaVersion:1,driver:"playwright-core",driverVersion:VZ.dependencies["playwright-core"],browser:"chromium"}),UZ=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Chromium.app/Contents/MacOS/Chromium"],l8=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable"];function R9($){try{return I1($,R1.X_OK),p8($)&&FZ($).isFile()}catch{return!1}}function u8($,Q=process.platform){let Z=Q==="darwin"?UZ:Q==="linux"?l8:null;return Z?($??Z).find(R9)??null:null}function b1(){if(!process.versions.bun)return;let $=Symbol.for("ara.headless-browser.bun-pipe-owners");if(Object.hasOwn(globalThis,$))return;let Q=[];zZ.spawn=new Proxy(zZ.spawn,{apply(Z,X,J){let Y=Reflect.apply(Z,X,J),K=J[1],V=J[2]?.stdio;if(Array.isArray(K)&&K.includes("--remote-debugging-pipe")&&Array.isArray(V)&&V[3]==="pipe"&&V[4]==="pipe")Q.push(Y);return Y}}),Object.defineProperty(globalThis,$,{value:Q})}async function Q8($){if(b1(),$!==void 0){if(!p8($))throw Error("hands_browser_driver_path_must_be_absolute");let X=Y9($,"package.json"),J=JSON.parse(E1(X,"utf8"));if(J.name!==$8.driver)throw Error("hands_browser_wrong_driver");let Y=HZ(X)($),K=Y.default?.chromium??Y.chromium;if(!K)throw Error("hands_browser_missing_chromium");return{version:J.version,chromium:K}}let[Q,Z]=await Promise.all([import("./index-752q9pdp.js"),import("./package-xeh4dp97.js").then((m)=>P1(m.default,1))]);return{version:Z.default.version,chromium:Q.chromium}}var k1=($,Q=$8.driverVersion)=>({status:"unavailable",reason:$,expectedDriverVersion:Q}),f1=($)=>$.loadDriver?.()??Q8($.driverModuleDirectory),g1={"1.60.0":"1223"};function BX(){let $=process.platform,Q=g1[$8.driverVersion];if(!Q||$!=="linux"&&$!=="darwin")return!1;let Z=(X)=>process.env[X]??process.env[`npm_config_${X.toLowerCase()}`]??process.env[`npm_package_config_${X.toLowerCase()}`];try{let X=Z("PLAYWRIGHT_BROWSERS_PATH"),J=X==="0"?Y9(S1(HZ(import.meta.url).resolve("playwright-core/package.json")),".local-browsers"):X?w1(Z("INIT_CWD")||process.cwd(),X):Y9($==="darwin"?Y9(KZ(),"Library","Caches"):process.env.XDG_CACHE_HOME||Y9(KZ(),".cache"),"ms-playwright");return FZ(Y9(J,`chromium-${Q}`,"INSTALLATION_COMPLETE")).isFile()}catch{return!1}}async function G9($={}){return WZ($,$8.driverVersion)}async function s8($,Q={}){if($.driverVersion!=="1.61.1"||!p8($.driverModuleDirectory))throw Error("hands_browser_invalid_managed_compatibility");return WZ({...Q,driverModuleDirectory:$.driverModuleDirectory,allowSystemBrowser:!0},$.driverVersion)}async function WZ($,Q){let Z=(G)=>k1(G,Q),X=$.platform??process.platform;if(X!=="linux"&&X!=="darwin")return Z("unsupported_platform");let J;try{J=await f1($)}catch{return Z("driver_missing")}if(J.version!==Q)return Z("driver_version_mismatch");let Y=(G,F)=>({status:"resolved",executablePath:G,source:F,driverVersion:J.version});if($.executablePath!==void 0)return R9($.executablePath)?Y($.executablePath,"configured"):Z("executable_missing");let K=J.chromium.executablePath();if(R9(K))return Y(K,"managed");let V=$.allowSystemBrowser===!0?u8($.systemCandidates,X):null;return V?Y(V,"system"):Z("executable_missing")}var a1=["/usr/local/bin/chromium",...l8];function o1($,Q=qZ()){return u8($??(Q==="linux"?a1:void 0),Q)}async function r1(){try{return(await Q8()).chromium}catch{return l1(import.meta.url)("playwright-core").chromium}}var t1=1048576,e1=105000,$7=20000,NZ=5000,Q7=2000,Z7=1000,X7=30000,MZ=81920,J7={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif"};async function Y7($,Q){let Z=new URL($.url()),X={...await $.allHeaders(),host:Z.host};for(let J of Object.keys(X))if(/^(?:proxy-|connection$|upgrade$|transfer-encoding$|content-length$)/i.test(J))delete X[J];return new Promise((J,Y)=>{let V=(Z.protocol==="https:"?s1:u1)(Z,{method:$.method(),headers:X,agent:!1,lookup:(F,B,H)=>{let z=u0.isIP(Q);if(B.all)H(null,[{address:Q,family:z}]);else H(null,Q,z)}},(F)=>{let B=[],H=0;F.on("data",(z)=>{if(H+=z.length,H>33554432)V.destroy(Error("hands_browser_response_too_large"));else B.push(z)}),F.on("error",Y),F.on("end",()=>{let z={};for(let[L,W]of Object.entries(F.headers))if(W!==void 0&&!["transfer-encoding","connection","content-length"].includes(L))z[L]=Array.isArray(W)?W.join(`
|
|
307
307
|
`):W;J({status:F.statusCode??502,headers:z,body:Buffer.concat(B)})})}),G=setTimeout(()=>V.destroy(Error("hands_browser_fetch_timeout")),X7);V.once("close",()=>clearTimeout(G)),V.on("error",Y),V.end($.postDataBuffer()??void 0)})}async function G7($,Q,Z=()=>{},X={lookup:(J)=>p1(J,{all:!0}),fetch:Y7}){let J=new WeakSet,Y=new WeakMap,K=(V)=>{let G=Y.get(V);if(G)return G;let F=(async()=>{if(!$.newCDPSession)return;let B=await $.newCDPSession(V),H=new Map;B.on("Network.loadingFinished",({requestId:z})=>H.delete(z)),B.on("Network.loadingFailed",({requestId:z})=>H.delete(z)),B.on("Fetch.requestPaused",async(z)=>{let L=z.networkId??z.requestId,W=z.redirectedRequestId?(H.get(L)??0)+1:0;H.set(L,W);let U=I9(z.request.url,Q),j=Q.mode==="enforce"&&Boolean(z.redirectedRequestId)&&U.host!==null&&!u0.isIP(U.host),O=!U.allowed?U:j?{...U,allowed:!1,reason:"destination_not_allowed"}:W>20?{...U,allowed:!1,reason:"redirect_not_supported"}:null;try{if(O)Z(O),await B.send("Fetch.failRequest",{requestId:z.requestId,errorReason:"BlockedByClient"});else await B.send("Fetch.continueRequest",{requestId:z.requestId})}catch{await B.send("Fetch.failRequest",{requestId:z.requestId,errorReason:"Failed"}).catch(()=>{})}}),await B.send("Network.enable"),await B.send("Fetch.enable",{patterns:[{urlPattern:"*",requestStage:"Request"}]}),J.add(V)})();return Y.set(V,F),F};return await $.route("**/*",async(V)=>{let G=V.request().url(),F=I9(G,Q);if(F.allowed&&Q.mode==="public_web"){await V.continue();return}let B=V.request();if(F.allowed&&F.host&&u0.isIP(F.host)&&B.isNavigationRequest?.()){let H=B.frame();if(J.has(H.page())&&H===H.page().mainFrame()){await V.continue();return}}if(F.allowed&&(Q.mode==="off"||F.reason==="local_document")){await V.continue();return}if(F.allowed&&F.host)try{let H=F.host,z=l0(H),L,W=await(async()=>{if(z!=="hostname")return[{address:H,family:u0.isIP(H)}];if(F.reason==="loopback")return[{address:"127.0.0.1",family:4}];try{return await Promise.race([X.lookup(H),new Promise((U,j)=>{L=setTimeout(()=>j(Error("hands_browser_dns_timeout")),5000)})])}finally{if(L)clearTimeout(L)}})();if(!W.length||W.some(({address:U})=>{let j=l0(U);return!u0.isIP(U)||Q.mode==="enforce"&&d8(U,Q.deniedHosts)||(F.reason==="loopback"?j!=="loopback":j!=="public")}))F={...F,allowed:!1,reason:"private_network"};else{let U=await X.fetch(V.request(),W[0].address);if(U.status>=300&&U.status<400){let j=U.headers.location??G;try{j=new URL(j,G).href}catch{}let O=I9(j,Q);F=O.allowed?{...O,allowed:!1,reason:"redirect_not_supported"}:O}else{await V.fulfill(U);return}}}catch{await V.abort("failed");return}Z(F),await V.abort("blockedbyclient")}),await $.routeWebSocket("**/*",async(V)=>{let G=I9(V.url(),Q);if(Q.mode==="enforce"&&G.allowed&&(!G.host||!u0.isIP(G.host)))G={...G,allowed:!1,reason:"destination_not_allowed"};if(G.allowed){V.connectToServer();return}Z(G),await V.close({code:1008,reason:"Reason egress policy denied"})}),Q.mode==="off"?void 0:{preparePage:K}}async function TZ($,Q=qZ(),Z){if(Z){let J=await s8(Z,{platform:Q,systemCandidates:$});return J.status==="resolved"?J.executablePath:null}if($!==void 0){let J=o1($,Q);if(J)return J}let X=await G9({platform:Q,systemCandidates:$,allowSystemBrowser:!0});return X.status==="resolved"?X.executablePath:null}function jZ($,Q){if(!$)throw Error("hands_repl_workspace_required");let Z=i8($),X=z9($),J=a8(X,z9(X,Q)),K=J!==".."&&!J.startsWith(`..${o8}`)&&!LZ(J)?z9(Z,J):z9(Z,Q);if(b0(z9(X,Q))||b0(K))throw Error("hands_repl_protected_path");let V=(W)=>{let U=a8(Z,W);return U!==""&&U!==".."&&!U.startsWith(`..${o8}`)&&!LZ(U)},G=i8(K);if(b0(G))throw Error("hands_repl_protected_path");if(!V(K)||!V(G))throw Error("hands_repl_file_outside_workspace");let F=a8(Z,K).split(o8),B=[Z,...F.map((W,U)=>z9(Z,...F.slice(0,U+1)))],H=B.map((W)=>BZ(W));if(H.some((W)=>W.isSymbolicLink()))throw Error("hands_repl_file_symlink");let z=H[H.length-1];if(!z.isFile()||z.nlink!==1||z.size>16777216)throw Error("hands_repl_file_not_regular_or_too_large");let L=v1(K,n8.O_RDONLY|n8.O_NOFOLLOW|n8.O_NONBLOCK);try{let W=h1(L);if(W.dev!==z.dev||W.ino!==z.ino||!W.isFile())throw Error("hands_repl_file_changed");for(let q=0;q<B.length;q++){let A=BZ(B[q]);if(A.dev!==H[q].dev||A.ino!==H[q].ino||A.isSymbolicLink())throw Error("hands_repl_file_changed")}if(!V(i8(K)))throw Error("hands_repl_file_outside_workspace");let U=Buffer.alloc(16777217),j=0;while(j<U.length){let q=c1(L,U,j,U.length-j,null);if(!q)break;j+=q}if(j===U.length)throw Error("hands_repl_file_too_large");let O=U.subarray(0,j);return{name:n1(K),mimeType:J7[i1(K).toLowerCase()]??"application/octet-stream",buffer:O}}finally{y1(L)}}function K9($,Q){$.end(`${JSON.stringify(Q)}
|
|
308
308
|
`)}function Z8($){try{d1($)}catch{}}async function OZ($){if($.managedBrowser&&$.driverModuleDirectory!==void 0)throw Error("hands_browser_ambiguous_driver_configuration");let Q=$.launch||$.targetContext?null:$.managedBrowser?await s8($.managedBrowser,{executablePath:$.browserExecutablePath}):await G9({executablePath:$.browserExecutablePath,driverModuleDirectory:$.driverModuleDirectory});if(Q?.status==="unavailable")throw Error(`hands_browser_${Q.reason}`);let Z=Q?.status==="resolved"?Q.executablePath:$.browserExecutablePath;if(!Z||!R9(Z))throw Error("hands_browser_unavailable");let X=$.launch??(async(N)=>($.targetContext?await r1():(await Q8($.managedBrowser?.driverModuleDirectory??$.driverModuleDirectory)).chromium).launch(N)),J=[],Y={},K=null,V=null,G=null,F=null,B=!1,H=null,z=new Map,L=new WeakMap,W=null,U=()=>{if(B)throw Error("hands_repl_stopped");if(F)throw F},j=(N)=>{let M=L.get(N);if(M)return M;let D=Promise.resolve().then(()=>N.close()).then(()=>{z.delete(N)});return L.set(N,D),D},O=async()=>{let N=[...z.entries()].reverse(),M=W??=performance.now()+Z7,D=Promise.allSettled(N.filter(([,_])=>_==="context").map(([_])=>j(_))),w;try{await Promise.race([D,new Promise((_)=>{w=setTimeout(_,Math.max(0,M-performance.now()))})])}finally{if(w)clearTimeout(w)}let k=await Promise.allSettled(N.map(([_])=>j(_))),f=[];for(let[_,m]of k.entries()){if(m.status!=="rejected")continue;let c=m.reason instanceof Error&&["Error","TimeoutError","ProtocolError"].includes(m.reason.name)?m.reason.name:"unknown";f.push(Error(`hands_repl_close_failed: ${N[_][1]}: ${c}`))}if(f.length)throw AggregateError(f,"hands_repl_stop_unconfirmed")},q=(N,M)=>{if(z.set(N,M),B||F)j(N).catch(()=>{return}),U();return N},A=async()=>{let N=await X({executablePath:Z,headless:!0,chromiumSandbox:$.managedBrowser===void 0,args:["--disable-background-networking","--disable-quic","--disable-dev-shm-usage","--disable-gpu","--disable-software-rasterizer","--dns-prefetch-disable","--force-webrtc-ip-handling-policy=disable_non_proxied_udp","--no-pings"]}),M=null;try{q(N,"browser"),M=$.targetContext??q(await N.newContext({viewport:{width:1440,height:900},screen:{width:1440,height:900},serviceWorkers:"block",acceptDownloads:!1}),"context");let D=await G7(M,$.networkPolicy??{mode:"off"},$.onEgressDenied);if(U(),D){let b=M.newPage.bind(M);M.newPage=async()=>{let y=await b();return await D.preparePage(y),y}}let k=M.pages()[0]??await M.newPage();await D?.preparePage(k),U();let f=async(b=k)=>{let y=b;if(typeof y.ariaSnapshot==="function")return y.ariaSnapshot({timeout:1e4});return k.locator("body").innerText({timeout:1e4})},_=async(b,y={})=>{let d=y&&typeof y==="object"&&!Array.isArray(y)?y:{},u,G0="image/png";if(Buffer.isBuffer(b)||b instanceof Uint8Array)u=Buffer.from(b);else if(typeof b==="string"&&(b.startsWith("data:")||/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(b)))u=Buffer.from(b.replace(/^data:[^,]*,/,""),"base64");else if(typeof b==="string"){let q0=jZ($.workspaceRoot,b);u=q0.buffer,G0=q0.mimeType}else throw Error("view() needs a Buffer, a base64 string, or a path to an image file");if(u.length===0)throw Error("view(): the image is empty");let N0=String(d.label??"").replace(/[\r\n>]+/g," ").trim().slice(0,120),H0=Number(d.maxWidth)||1024,U0=Number(d.quality)||72,y0=$.targetContext?await N.newPage():await M.newPage();try{let q0=`data:${G0};base64,${u.toString("base64")}`;for(let r=0;r<5;r+=1){let M0=await y0.evaluate(async(W0)=>{let j0=new Image;j0.src=W0.url,await j0.decode();let h0=Math.min(1,W0.maxWidth/j0.naturalWidth),Y0=document.createElement("canvas");Y0.width=Math.max(1,Math.round(j0.naturalWidth*h0)),Y0.height=Math.max(1,Math.round(j0.naturalHeight*h0));let X0=Y0.getContext("2d");if(!X0)throw Error("view(): canvas unavailable");return X0.fillStyle="#ffffff",X0.fillRect(0,0,Y0.width,Y0.height),X0.drawImage(j0,0,0,Y0.width,Y0.height),{data:Y0.toDataURL("image/jpeg",W0.q/100).split(",")[1]??"",width:Y0.width,height:Y0.height,sourceWidth:j0.naturalWidth,sourceHeight:j0.naturalHeight}},{url:q0,maxWidth:H0,q:U0}),r0=Buffer.from(M0.data,"base64");if(r0.length<=MZ){let W0=N0||"image";return`<<<ARA_VIEW_IMAGE ${M0.data} image/jpeg ${W0}>>>
|
|
309
309
|
Viewing ${W0} (${M0.sourceWidth}x${M0.sourceHeight} source, sent at ${M0.width}x${M0.height}, ${Math.round(r0.length/1024)}KB).`}if(H0>640)H0=Math.round(H0*0.75);else U0=Math.max(30,U0-15)}throw Error(`view(): could not reduce the image under ${Math.round(MZ/1024)}KB`)}finally{await y0.close().catch(()=>{return})}},m=$Z({browser:$.targetContext?.browser()??N,context:M,page:k,a11y:f,view:_,readWorkspaceFile:(b)=>jZ($.workspaceRoot,b),privateProfile:$.privateProfile,beforeNavigation:$.beforeNavigation,recording:$.recording,screenshotExport:$.screenshotExport,actionRecorder:()=>{let b=J,y=Y;return(d,u)=>{if(b.length<CZ)b.push(d);if(u)y.page=u}}}),c=async(b)=>{U();let y=q(await N.newContext({serviceWorkers:"block",acceptDownloads:!1}),"context");try{await y.route("**/*",(u)=>u.abort()),U(),await y.routeWebSocket("**/*",(u)=>u.close({code:1008,reason:"Reason evaluator network denied"})),U(),await y.exposeBinding("__araHandsRpc",async(u,G0)=>$.onBrowserOperation?$.onBrowserOperation(b,()=>m.dispatch(G0)):m.dispatch(G0)),U();let d=await y.newPage();return U(),await d.goto("data:text/html,<title>Reason Hands evaluator</title>"),U(),await d.evaluate(`(${lQ})(${JSON.stringify(m.roots)})`),{context:y,page:d,runId:b}}catch(d){throw await j(y).catch(()=>{return}),d}},l=await c(),o={browser:N,context:M,page:k,evaluator:l,async captureProgressFrame(b){return _(await b.screenshot({type:"jpeg",quality:65,timeout:2000}),{label:"Screen after browser action"})},async resetEvaluator(b){await j(o.evaluator.context),o.evaluator=await c(b)}};return U(),o}catch(D){throw await O().catch(()=>{return}),D}},R=async()=>{if(U(),K)return K;if(!G){V=A();let N;G=Promise.race([V,new Promise((M,D)=>{N=setTimeout(()=>D(Error("hands_browser_unavailable: startup timed out")),$7)})]).then((M)=>{return U(),K=M,M}).catch(async()=>{F=Error("hands_browser_unavailable: startup failed or timed out");let M;try{await Promise.race([O(),new Promise((D,w)=>{M=setTimeout(()=>w(Error("hands_repl_stop_timeout")),NZ)})])}catch{F=Error("hands_browser_unavailable: startup cleanup unconfirmed")}finally{if(M)clearTimeout(M)}throw F}).finally(()=>{if(N)clearTimeout(N)})}return G},P=async(N,M,D=!1)=>{let w=await R(),k=Y;if($.onBrowserOperation&&w.evaluator.runId!==M)await w.resetEvaluator(M);let _=(async()=>{let l=await w.evaluator.page.evaluate(`(${uQ})(${JSON.stringify({code:N})})`);if(typeof l!=="string")throw Error("hands_repl_invalid_evaluator_output");let o=k.page;if(D&&o&&!l.includes("<<<ARA_VIEW_IMAGE")){let b=()=>w.captureProgressFrame(o);try{let y=await($.onBrowserOperation?$.onBrowserOperation(M,b):b());return k.automaticProgressImage=!0,`${l}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ee as W}from"./vm-hands-entry-lite-
|
|
2
|
+
import{ee as W}from"./vm-hands-entry-lite-psybjyay.js";var E=W.string().max(201).regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/).refine((Q)=>Q.split("/").every((Z)=>Z!=="."&&Z!=="..")),G=W.string().min(1).max(255).regex(/^[A-Za-z0-9_][A-Za-z0-9_./-]*$/).refine((Q)=>!Q.includes("..")&&!Q.includes("//")&&!Q.endsWith("/")&&!Q.endsWith(".lock")),g=W.string().regex(/^[a-f0-9]{40}$/),N=W.number().int().positive(),T=W.string().min(1).max(256),A=W.string().max(60000),q={version:W.literal(1),repoFullName:E},S=W.array(W.string().max(1024).regex(/^Co-authored-by: [^<>\r\n\x00]+ <[^<>\s]+@[^<>\s]+>$/)).max(500),y=W.strictObject({expectedTrailers:S,missingFromHead:S}),d=W.discriminatedUnion("action",[W.strictObject({action:W.literal("edit"),title:T.optional(),body:A.optional(),base:G.optional()}),W.strictObject({action:W.enum(["ready","draft","close"])}),W.strictObject({action:W.literal("metadata"),field:W.enum(["reviewer","assignee","label"]),change:W.enum(["add","remove"]),value:W.string().min(1).max(100).refine((Q)=>!/[\r\n\0]/.test(Q))})]),a=W.discriminatedUnion("kind",[W.strictObject({...q,kind:W.literal("read"),path:W.string().min(1).max(2048),accept:W.enum(["application/vnd.github+json","application/vnd.github.full+json","application/vnd.github.v3.diff"]).optional()}),W.strictObject({...q,kind:W.literal("pr_review_context"),number:N,after:W.string().min(1).max(1024).optional()}),W.strictObject({...q,kind:W.literal("prepare"),branch:G,baseSha:g,defaultBranch:G}),W.strictObject({...q,kind:W.literal("publish"),branch:G,defaultBranch:G,baseSha:g,remoteHeadSha:g.nullable(),contributorTrailers:S.optional()}),W.strictObject({...q,kind:W.literal("pr_create"),head:G,base:G,title:T,body:A,draft:W.boolean()}),W.strictObject({...q,kind:W.literal("pr_mutation"),number:N,mutation:d}),W.strictObject({...q,kind:W.literal("pr_merge"),number:N,expectedHeadSha:g,expectedBaseRef:G,method:W.enum(["merge","squash","rebase"]),commitBody:W.string().max(65536).optional()})]),I=245760,e=W.discriminatedUnion("kind",[W.strictObject({kind:W.literal("pr_review_context"),body:W.string().max(I)}),W.strictObject({kind:W.literal("prepare"),headSha:g}),W.strictObject({kind:W.literal("read"),status:W.number().int().min(200).max(599),headers:W.record(W.string(),W.string().max(8192)).refine((Q)=>Object.keys(Q).every((Z)=>Z==="link"||Z==="content-type")),body:W.string().max(I)}),W.strictObject({kind:W.literal("publish"),headSha:g,scannedObjectCount:W.number().int().min(0).max(5000),attribution:y.optional()}),W.strictObject({kind:W.literal("pr_create"),url:W.string().max(1024).regex(/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*$/)}),W.strictObject({kind:W.literal("pr_mutation"),number:N,applied:W.literal(!0)}),W.strictObject({kind:W.literal("pr_merge"),number:N,merged:W.literal(!0)})]).refine((Q)=>new TextEncoder().encode(JSON.stringify(Q)).byteLength<=I,"local_device_gh_result_too_large"),O=W.strictObject({source:W.enum(["agent","human"]),operationId:W.uuid()}),j=W.strictObject({version:W.literal(1),userId:W.guid(),deviceId:W.guid(),rootId:W.guid(),runId:W.guid(),merge:O.optional(),contributorRefresh:W.guid().optional(),repoFullName:E.nullable(),rootRevision:W.string().regex(/^[1-9][0-9]*$/),readOnly:W.boolean(),generation:W.number().int().positive().nullable(),fenceId:W.guid().nullable()}).refine((Q)=>Q.generation===null===(Q.fenceId===null));function C(Q){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(Q)&&Q.split("/").every((Z)=>Z!=="."&&Z!=="..")}function QQ(Q,Z,$={},H="read"){if(C(Q)&&(Z==="/search/issues"||Z.startsWith("/search/issues?")))return z(Q,Z,$);if(!C(Q)||!Z.startsWith(`/repos/${Q}/`)&&Z!==`/repos/${Q}`)throw Error("local_device_gh_repository_mismatch");if(/[\\#\u0000-\u001f]/.test(Z)||/%(?:2e|5c|00)/i.test(Z))throw Error("local_device_gh_path_denied");let V=new URL(Z,"https://api.github.com");if(V.pathname!==Z.split("?")[0]||V.username||V.password)throw Error("local_device_gh_path_denied");let Y;try{Y=decodeURIComponent(V.pathname.slice(`/repos/${Q}`.length))}catch{throw Error("local_device_gh_path_denied")}if(Y.includes("%")||Y.split("/").some((K)=>K==="."||K===".."))throw Error("local_device_gh_path_denied");if(($.method??"GET").toUpperCase()!=="GET"||$.body!=null)throw Error("local_device_gh_mutation_not_admitted");if(![/^$/,/^\/commits$/,/^\/pulls$/,/^\/pulls\/[1-9][0-9]*(?:\/(?:commits|files|reviews|comments))?$/,/^\/issues\/[1-9][0-9]*(?:\/comments)?$/,/^\/issues\/comments\/[1-9][0-9]*\/reactions$/,/^\/commits\/[A-Za-z0-9_./-]+(?:\/(?:check-runs|status))?$/,/^\/check-runs\/[1-9][0-9]*(?:\/annotations)?$/,/^\/branches\/[A-Za-z0-9_./-]+$/,/^\/git\/ref\/heads\/[A-Za-z0-9_./-]+$/,/^\/compare\/[A-Za-z0-9_./-]+\.\.\.[A-Za-z0-9_./-]+$/].some((K)=>K.test(Y)))throw Error("local_device_gh_path_denied");if(V.searchParams.forEach((K,B)=>{if(B==="per_page"&&/^[1-9][0-9]*$/.test(K)&&Number(K)<=100)return;if(B==="page"&&/^[1-9][0-9]*$/.test(K)&&Number(K)<=100)return;if(Y==="/pulls"&&B==="state"&&["open","closed","all"].includes(K))return;if(Y==="/pulls"&&B==="sort"&&K==="updated")return;if(Y==="/pulls"&&B==="direction"&&K==="desc")return;if(Y==="/pulls"&&["head","base"].includes(B)&&/^[A-Za-z0-9_./:-]{1,255}$/.test(K))return;throw Error("local_device_gh_query_denied")}),$.headers)new Headers($.headers).forEach((B,c)=>{if(c!=="accept"||!["application/vnd.github+json","application/vnd.github.full+json","application/vnd.github.v3.diff"].includes(B))throw Error("local_device_gh_header_denied")})}function z(Q,Z,$){if(/[\\#\u0000-\u001f]/.test(Z))throw Error("local_device_gh_path_denied");let H=new URL(Z,"https://api.github.com");if(H.pathname!=="/search/issues"||H.username||H.password)throw Error("local_device_gh_path_denied");if(($.method??"GET").toUpperCase()!=="GET"||$.body!=null)throw Error("local_device_gh_mutation_not_admitted");let V=null;H.searchParams.forEach((X,K)=>{if(K==="q"&&V===null){V=X;return}if(K==="per_page"&&/^[1-9][0-9]*$/.test(X)&&Number(X)<=100)return;if(K==="page"&&/^[1-9][0-9]*$/.test(X)&&Number(X)<=100)return;throw Error("local_device_gh_query_denied")});let Y=`repo:${Q.toLowerCase()} `,U=V?.toLowerCase()??"";if(U.length>512||!(U+" ").startsWith(Y)||/(?:^|\s)(?:repo|org|user):/.test(U.slice(Y.length)))throw Error("local_device_gh_query_denied");if($.headers)new Headers($.headers).forEach((X,K)=>{if(K!=="accept"||X!=="application/vnd.github+json")throw Error("local_device_gh_header_denied")})}var WQ=`query PullRequestReviewContext($owner: String!, $repo: String!, $number: Int!, $after: String) {
|
|
3
3
|
repository(owner: $owner, name: $repo) {
|
|
4
4
|
nameWithOwner
|
|
5
5
|
pullRequest(number: $number) {
|