acbridge 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,317 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __acbridgeCreateRequire } from "node:module";
3
+ const require = __acbridgeCreateRequire(import.meta.url);
4
+ var B_=Object.create;var fl=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var Z_=Object.getOwnPropertyNames;var G_=Object.getPrototypeOf,W_=Object.prototype.hasOwnProperty;var te=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var q=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Jt=(e,t)=>{for(var r in t)fl(e,r,{get:t[r],enumerable:!0})},V_=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Z_(t))!W_.call(e,n)&&n!==r&&fl(e,n,{get:()=>t[n],enumerable:!(o=H_(t,n))||o.enumerable});return e};var qt=(e,t,r)=>(r=e!=null?B_(G_(e)):{},V_(t||!e||!e.__esModule?fl(r,"default",{value:e,enumerable:!0}):r,e));var Nc=q(hg=>{"use strict";Object.defineProperty(hg,"__esModule",{value:!0});hg.default=OR;var y0=/[A-Z]/g;function b0(e){return e.toLowerCase()}function OR(e,t){let r=e.replace(y0,b0),o=t.replace(y0,b0);return r===o}});var vg=q(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.DnsTxt=void 0;var Lc=class{constructor(t={}){this.binary=t?t.binary:!1}encode(t={}){return Object.entries(t).map(([r,o])=>{let n=`${r}=${o}`;return Buffer.from(n)})}decode(t){var r={};try{let n=t.toString().split(/=(.+)/),i=n[0],a=n[1];r[i]=a}catch{}return r}decodeAll(t){return t.filter(r=>r.length>1).map(r=>this.decode(r)).reduce((r,o)=>{var n=r;let[i]=Object.keys(o),[a]=Object.values(o);return n[i]=a,n},{})}};Li.DnsTxt=Lc;Li.default=Lc});var yg=q(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.toType=yo.toString=void 0;var x0=e=>"_"+e,DR=e=>["name","protocol","subtype"].includes(e),NR=e=>{let t={name:e.name,protocol:e.protocol,subtype:e.subtype};return Object.entries(t).filter(([o,n])=>DR(o)&&n!==void 0).reduce((o,[n,i])=>(typeof i==="object"?i.map(a=>o.push(x0(a))):o.push(x0(i)),o),[]).join(".")};yo.toString=NR;var LR=e=>{let t=e.split("."),r;for(let o in t)t[o][0]==="_"&&(t[o]=t[o].slice(1));return t.includes("sub")&&(r=t.shift(),t.shift()),{name:t.shift(),protocol:t.shift()||null,subtype:r}};yo.toType=LR});var bg=q(lr=>{"use strict";var w0=lr&&lr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lr,"__esModule",{value:!0});lr.Service=void 0;var k0=w0(te("os")),UR=w0(vg()),zR=te("events"),jR=yg(),bo=".local",Uc=class extends zR.EventEmitter{constructor(t,r,o){if(super(),this.start=r,this.stop=o,this.probe=!0,this.published=!1,this.activated=!1,this.destroyed=!1,this.txtService=new UR.default,!t.name)throw new Error("ServiceConfig requires `name` property to be set");if(!t.type)throw new Error("ServiceConfig requires `type` property to be set");if(!t.port)throw new Error("ServiceConfig requires `port` property to be set");this.name=t.name.split(".").join("-"),this.protocol=t.protocol||"tcp",this.type=(0,jR.toString)({name:t.type,protocol:this.protocol}),this.port=t.port,this.host=t.host||k0.default.hostname(),this.fqdn=`${this.name}.${this.type}${bo}`,this.txt=t.txt,this.subtypes=t.subtypes,this.disableIPv6=!!t.disableIPv6}records(){var t=[this.RecordPTR(this),this.RecordSRV(this),this.RecordTXT(this),this.RecordServicePTR(this)];for(let o of this.subtypes||[])t.push(this.RecordSubtypePTR(this,o));let r=Object.values(k0.default.networkInterfaces());for(let o of r){let n=o;for(let i of n)if(!(i.internal||i.mac==="00:00:00:00:00:00"))switch(i.family){case"IPv4":t.push(this.RecordA(this,i.address));break;case"IPv6":if(this.disableIPv6)break;t.push(this.RecordAAAA(this,i.address));break}}return t}RecordPTR(t){return{name:`${t.type}${bo}`,type:"PTR",ttl:28800,data:t.fqdn}}RecordServicePTR(t){return{name:`_services._dns-sd._udp${bo}`,type:"PTR",ttl:120,data:`${t.type}${bo}`}}RecordSubtypePTR(t,r){return{name:`_${r}._sub.${t.type}${bo}`,type:"PTR",ttl:28800,data:`${t.name}.${t.type}${bo}`}}RecordSRV(t){return{name:t.fqdn,type:"SRV",ttl:120,data:{port:t.port,target:t.host}}}RecordTXT(t){return{name:t.fqdn,type:"TXT",ttl:4500,data:this.txtService.encode(t.txt)}}RecordA(t,r){return{name:t.host,type:"A",ttl:120,data:r}}RecordAAAA(t,r){return{name:t.host,type:"AAAA",ttl:120,data:r}}};lr.Service=Uc;lr.default=Uc});var _0=q(ur=>{"use strict";var S0=ur&&ur.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ur,"__esModule",{value:!0});ur.Registry=void 0;var FR=S0(Nc()),xg=S0(bg()),MR=3600*1e3,BR=3,HR=function(){},zc=class{constructor(t){this.services=[],this.server=t}publish(t){let r=t.probe!==!1,o=new xg.default(t,n.bind(null,this),i.bind(null,this));function n(a,{probe:s=r}={}){o.activated||(o.activated=!0,a.services.push(o),o instanceof xg.default&&(s?a.probe(a.server.mdns,o,l=>{if(l){o.stop!==void 0&&o.stop(),console.log(new Error("Service name is already in use on the network"));return}a.announce(a.server,o)}):a.announce(a.server,o)))}function i(a,s){if(s||(s=HR),!o.activated||!(o instanceof xg.default))return process.nextTick(s);a.teardown(a.server,o,s);let l=a.services.indexOf(o);l!==-1&&a.services.splice(l,1)}return o.start(),o}unpublishAll(t){this.teardown(this.server,this.services,t),this.services=[]}destroy(){this.services.map(t=>t.destroyed=!0)}probe(t,r,o){var n=!1,i=0,a;let s=()=>{!r.activated||r.destroyed||t.query(r.fqdn,"ANY",function(){n=!0,a=setTimeout(++i<3?s:d,250),a.unref()})},l=p=>{n&&(p.answers.some(u)||p.additionals.some(u))&&d(!0)},u=p=>(0,FR.default)(p.name,r.fqdn),d=p=>{t.removeListener("response",l),clearTimeout(a),o(!!p)};t.on("response",l),setTimeout(s,Math.random()*250)}announce(t,r){var o=1e3,n=r.records();t.register(n);let i=()=>{!r.activated||r.destroyed||t.mdns.respond(n,function(){r.published||(r.activated=!0,r.published=!0,r.emit("up")),o=o*BR,o<MR&&!r.destroyed&&setTimeout(i,o).unref()})};i()}teardown(t,r,o){Array.isArray(r)||(r=[r]),r=r.filter(i=>i.activated);var n=r.flatMap(function(i){i.activated=!1;var a=i.records();return a.forEach(s=>{s.ttl=0}),a});if(n.length===0)return o&&process.nextTick(o);t.unregister(n),t.mdns.respond(n,function(){r.forEach(function(i){i.published=!1}),typeof o=="function"&&o.apply(null,arguments)})}};ur.Registry=zc;ur.default=zc});var $0=q(kg=>{"use strict";kg.toString=function(e){switch(e){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+e};kg.toType=function(e){switch(e.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return e.toUpperCase().startsWith("UNKNOWN_")?parseInt(e.slice(8)):0}});var I0=q(wg=>{"use strict";wg.toString=function(e){switch(e){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+e};wg.toRcode=function(e){switch(e.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var A0=q(Sg=>{"use strict";Sg.toString=function(e){switch(e){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+e};Sg.toOpcode=function(e){switch(e.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var E0=q(_g=>{"use strict";_g.toString=function(e){switch(e){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+e};_g.toClass=function(e){switch(e.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var P0=q($g=>{"use strict";$g.toString=function(e){switch(e){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return e<0?null:`OPTION_${e}`};$g.toCode=function(e){if(typeof e=="number")return e;if(!e)return-1;switch(e.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let t=e.match(/_(\d+)$/);return t?parseInt(t[1],10):-1}});var R0=q((T0,Ig)=>{var C0=(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=p,e.encode=d,e.familyOf=u,e.name=void 0,e.sizeOf=l,e.v6=e.v4=void 0;let t=/^(\d{1,3}\.){3,3}\d{1,3}$/,r=4,o=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,n=16,i={name:"v4",size:r,isFormat:m=>t.test(m),encode(m,f,g){g=~~g,f=f||new Uint8Array(g+r);let y=m.length,k=0;for(let _=0;_<y;){let P=m.charCodeAt(_++);P===46?(f[g++]=k,k=0):k=k*10+(P-48)}return f[g]=k,f},decode(m,f){return f=~~f,`${m[f++]}.${m[f++]}.${m[f++]}.${m[f]}`}};e.v4=i;let a={name:"v6",size:n,isFormat:m=>m.length>0&&o.test(m),encode(m,f,g){g=~~g;let y=g+n,k=-1,_=0,P=0,C=!0,E=!1;f=f||new Uint8Array(g+n);for(let D=0;D<m.length;D++){let G=m.charCodeAt(D);G===58?(C?k!==-1?(g<y&&(f[g]=0),g<y-1&&(f[g+1]=0),g+=2):g<y&&(k=g):(E===!0?(g<y&&(f[g]=P),g++):(g<y&&(f[g]=_>>8),g<y-1&&(f[g+1]=_&255),g+=2),_=0,P=0),C=!0,E=!1):G===46?(g<y&&(f[g]=P),g++,P=0,_=0,C=!1,E=!0):(C=!1,G>=97?G-=87:G>=65?G-=55:(G-=48,P=P*10+G),_=(_<<4)+G)}if(C===!1)E===!0?(g<y&&(f[g]=P),g++):(g<y&&(f[g]=_>>8),g<y-1&&(f[g+1]=_&255),g+=2);else if(k===0)g<y&&(f[g]=0),g<y-1&&(f[g+1]=0),g+=2;else if(k!==-1){g+=2;for(let D=Math.min(g-1,y-1);D>=k+2;D--)f[D]=f[D-2];f[k]=0,f[k+1]=0,k=g}if(k!==g&&k!==-1)for(g>y-2&&(g=y-2);y>k;)f[--y]=g<y&&g>k?f[--g]:0;else for(;g<y;)f[g++]=0;return f},decode(m,f){f=~~f;let g="";for(let y=0;y<n;y+=2)y!==0&&(g+=":"),g+=(m[f+y]<<8|m[f+y+1]).toString(16);return g.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};e.v6=a;let s="ip";e.name=s;function l(m){if(i.isFormat(m))return i.size;if(a.isFormat(m))return a.size;throw Error(`Invalid ip address: ${m}`)}function u(m){return l(m)===i.size?1:2}function d(m,f,g){g=~~g;let y=l(m);return typeof f=="function"&&(f=f(g+y)),y===i.size?i.encode(m,f,g):a.encode(m,f,g)}function p(m,f,g){if(f=~~f,g=g||m.length-f,g===i.size)return i.decode(m,f,g);if(g===a.size)return a.decode(m,f,g);throw Error(`Invalid buffer size needs to be ${i.size} for v4 or ${a.size} for v6.`)}return"default"in e?e.default:e})({});typeof define=="function"&&define.amd?define([],function(){return C0}):typeof Ig=="object"&&typeof T0=="object"&&(Ig.exports=C0)});var N0=q(N=>{"use strict";var L=te("buffer").Buffer,yn=$0(),ZR=I0(),GR=A0(),Fc=E0(),Ag=P0(),dr=R0(),WR=0,O0=32768,Eg=32768,VR=~Eg,D0=32768,JR=~D0,R=N.name={};R.encode=function(e,t,r,{mail:o=!1}={}){t||(t=L.alloc(R.encodingLength(e))),r||(r=0);let n=r,i=e.replace(/^\.|\.$/gm,"");if(i.length){let a=[];if(o){let s="";i.split(".").forEach(l=>{l.endsWith("\\")?s+=(s.length?".":"")+l.slice(0,-1):a.length===0&&s.length?a.push(s+"."+l):a.push(l)})}else a=i.split(".");for(let s=0;s<a.length;s++){let l=t.write(a[s],r+1);t[r]=l,r+=l+1}}return t[r++]=0,R.encode.bytes=r-n,t};R.encode.bytes=0;R.decode=function(e,t,{mail:r=!1}={}){t||(t=0);let o=[],n=t,i=0,a=0,s=!1;for(;;){if(t>=e.length)throw new Error("Cannot decode name (buffer overflow)");let l=e[t++];if(a+=s?0:1,l===0)break;if((l&192)===0){if(t+l>e.length)throw new Error("Cannot decode name (buffer overflow)");if(i+=l+1,i>254)throw new Error("Cannot decode name (name too long)");let u=e.toString("utf-8",t,t+l);r&&(u=u.replace(/\./g,"\\.")),o.push(u),t+=l,a+=s?0:l}else if((l&192)===192){if(t+1>e.length)throw new Error("Cannot decode name (buffer overflow)");let u=e.readUInt16BE(t-1)-49152;if(u>=n)throw new Error("Cannot decode name (bad pointer)");t=u,n=u,a+=s?0:1,s=!0}else throw new Error("Cannot decode name (bad label)")}return R.decode.bytes=a,o.length===0?".":o.join(".")};R.decode.bytes=0;R.encodingLength=function(e){return e==="."||e===".."?1:L.byteLength(e.replace(/^\.|\.$/gm,""))+2};var J={};J.encode=function(e,t,r){t||(t=L.alloc(J.encodingLength(e))),r||(r=0);let o=t.write(e,r+1);return t[r]=o,J.encode.bytes=o+1,t};J.encode.bytes=0;J.decode=function(e,t){t||(t=0);let r=e[t],o=e.toString("utf-8",t+1,t+1+r);return J.decode.bytes=r+1,o};J.decode.bytes=0;J.encodingLength=function(e){return L.byteLength(e)+1};var Et={};Et.encode=function(e,t,r){t||(t=Et.encodingLength(e)),r||(r=0);let o=(e.flags||0)&32767,n=e.type==="response"?O0:WR;return t.writeUInt16BE(e.id||0,r),t.writeUInt16BE(o|n,r+2),t.writeUInt16BE(e.questions.length,r+4),t.writeUInt16BE(e.answers.length,r+6),t.writeUInt16BE(e.authorities.length,r+8),t.writeUInt16BE(e.additionals.length,r+10),t};Et.encode.bytes=12;Et.decode=function(e,t){if(t||(t=0),e.length<12)throw new Error("Header must be 12 bytes");let r=e.readUInt16BE(t+2);return{id:e.readUInt16BE(t),type:r&O0?"response":"query",flags:r&32767,flag_qr:(r>>15&1)===1,opcode:GR.toString(r>>11&15),flag_aa:(r>>10&1)===1,flag_tc:(r>>9&1)===1,flag_rd:(r>>8&1)===1,flag_ra:(r>>7&1)===1,flag_z:(r>>6&1)===1,flag_ad:(r>>5&1)===1,flag_cd:(r>>4&1)===1,rcode:ZR.toString(r&15),questions:new Array(e.readUInt16BE(t+4)),answers:new Array(e.readUInt16BE(t+6)),authorities:new Array(e.readUInt16BE(t+8)),additionals:new Array(e.readUInt16BE(t+10))}};Et.decode.bytes=12;Et.encodingLength=function(){return 12};var ln=N.unknown={};ln.encode=function(e,t,r){return t||(t=L.alloc(ln.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.length,r),e.copy(t,r+2),ln.encode.bytes=e.length+2,t};ln.encode.bytes=0;ln.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=e.slice(t+2,t+2+r);return ln.decode.bytes=r+2,o};ln.decode.bytes=0;ln.encodingLength=function(e){return e.length+2};var un=N.ns={};un.encode=function(e,t,r){return t||(t=L.alloc(un.encodingLength(e))),r||(r=0),R.encode(e,t,r+2),t.writeUInt16BE(R.encode.bytes,r),un.encode.bytes=R.encode.bytes+2,t};un.encode.bytes=0;un.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=R.decode(e,t+2);return un.decode.bytes=r+2,o};un.decode.bytes=0;un.encodingLength=function(e){return R.encodingLength(e)+2};var dn=N.soa={};dn.encode=function(e,t,r){t||(t=L.alloc(dn.encodingLength(e))),r||(r=0);let o=r;return r+=2,R.encode(e.mname,t,r),r+=R.encode.bytes,R.encode(e.rname,t,r,{mail:!0}),r+=R.encode.bytes,t.writeUInt32BE(e.serial||0,r),r+=4,t.writeUInt32BE(e.refresh||0,r),r+=4,t.writeUInt32BE(e.retry||0,r),r+=4,t.writeUInt32BE(e.expire||0,r),r+=4,t.writeUInt32BE(e.minimum||0,r),r+=4,t.writeUInt16BE(r-o-2,o),dn.encode.bytes=r-o,t};dn.encode.bytes=0;dn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mname=R.decode(e,t),t+=R.decode.bytes,o.rname=R.decode(e,t,{mail:!0}),t+=R.decode.bytes,o.serial=e.readUInt32BE(t),t+=4,o.refresh=e.readUInt32BE(t),t+=4,o.retry=e.readUInt32BE(t),t+=4,o.expire=e.readUInt32BE(t),t+=4,o.minimum=e.readUInt32BE(t),t+=4,dn.decode.bytes=t-r,o};dn.decode.bytes=0;dn.encodingLength=function(e){return 22+R.encodingLength(e.mname)+R.encodingLength(e.rname)};var pn=N.txt={};pn.encode=function(e,t,r){Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++)if(typeof e[n]=="string"&&(e[n]=L.from(e[n])),!L.isBuffer(e[n]))throw new Error("Must be a Buffer");t||(t=L.alloc(pn.encodingLength(e))),r||(r=0);let o=r;return r+=2,e.forEach(function(n){t[r++]=n.length,n.copy(t,r,0,n.length),r+=n.length}),t.writeUInt16BE(r-o-2,o),pn.encode.bytes=r-o,t};pn.encode.bytes=0;pn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=[];for(;o>0;){let i=e[t++];if(--o,o<i)throw new Error("Buffer overflow");n.push(e.slice(t,t+i)),t+=i,o-=i}return pn.decode.bytes=t-r,n};pn.decode.bytes=0;pn.encodingLength=function(e){Array.isArray(e)||(e=[e]);let t=2;return e.forEach(function(r){typeof r=="string"?t+=L.byteLength(r)+1:t+=r.length+1}),t};var mn=N.null={};mn.encode=function(e,t,r){t||(t=L.alloc(mn.encodingLength(e))),r||(r=0),typeof e=="string"&&(e=L.from(e)),e||(e=L.alloc(0));let o=r;r+=2;let n=e.length;return e.copy(t,r,0,n),r+=n,t.writeUInt16BE(r-o-2,o),mn.encode.bytes=r-o,t};mn.encode.bytes=0;mn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=e.slice(t,t+o);return t+=o,mn.decode.bytes=t-r,n};mn.decode.bytes=0;mn.encodingLength=function(e){return e?(L.isBuffer(e)?e.length:L.byteLength(e))+2:2};var fn=N.hinfo={};fn.encode=function(e,t,r){t||(t=L.alloc(fn.encodingLength(e))),r||(r=0);let o=r;return r+=2,J.encode(e.cpu,t,r),r+=J.encode.bytes,J.encode(e.os,t,r),r+=J.encode.bytes,t.writeUInt16BE(r-o-2,o),fn.encode.bytes=r-o,t};fn.encode.bytes=0;fn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.cpu=J.decode(e,t),t+=J.decode.bytes,o.os=J.decode(e,t),t+=J.decode.bytes,fn.decode.bytes=t-r,o};fn.decode.bytes=0;fn.encodingLength=function(e){return J.encodingLength(e.cpu)+J.encodingLength(e.os)+2};var It=N.ptr={},qR=N.cname=It,KR=N.dname=It;It.encode=function(e,t,r){return t||(t=L.alloc(It.encodingLength(e))),r||(r=0),R.encode(e,t,r+2),t.writeUInt16BE(R.encode.bytes,r),It.encode.bytes=R.encode.bytes+2,t};It.encode.bytes=0;It.decode=function(e,t){t||(t=0);let r=R.decode(e,t+2);return It.decode.bytes=R.decode.bytes+2,r};It.decode.bytes=0;It.encodingLength=function(e){return R.encodingLength(e)+2};var gn=N.srv={};gn.encode=function(e,t,r){t||(t=L.alloc(gn.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.priority||0,r+2),t.writeUInt16BE(e.weight||0,r+4),t.writeUInt16BE(e.port||0,r+6),R.encode(e.target,t,r+8);let o=R.encode.bytes+6;return t.writeUInt16BE(o,r),gn.encode.bytes=o+2,t};gn.encode.bytes=0;gn.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o={};return o.priority=e.readUInt16BE(t+2),o.weight=e.readUInt16BE(t+4),o.port=e.readUInt16BE(t+6),o.target=R.decode(e,t+8),gn.decode.bytes=r+2,o};gn.decode.bytes=0;gn.encodingLength=function(e){return 8+R.encodingLength(e.target)};var at=N.caa={};at.ISSUER_CRITICAL=128;at.encode=function(e,t,r){let o=at.encodingLength(e);return t||(t=L.alloc(at.encodingLength(e))),r||(r=0),e.issuerCritical&&(e.flags=at.ISSUER_CRITICAL),t.writeUInt16BE(o-2,r),r+=2,t.writeUInt8(e.flags||0,r),r+=1,J.encode(e.tag,t,r),r+=J.encode.bytes,t.write(e.value,r),r+=L.byteLength(e.value),at.encode.bytes=o,t};at.encode.bytes=0;at.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t);t+=2;let o=t,n={};return n.flags=e.readUInt8(t),t+=1,n.tag=J.decode(e,t),t+=J.decode.bytes,n.value=e.toString("utf-8",t,o+r),n.issuerCritical=!!(n.flags&at.ISSUER_CRITICAL),at.decode.bytes=r+2,n};at.decode.bytes=0;at.encodingLength=function(e){return J.encodingLength(e.tag)+J.encodingLength(e.value)+2};var Hn=N.mx={};Hn.encode=function(e,t,r){t||(t=L.alloc(Hn.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,R.encode(e.exchange,t,r),r+=R.encode.bytes,t.writeUInt16BE(r-o-2,o),Hn.encode.bytes=r-o,t};Hn.encode.bytes=0;Hn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.preference=e.readUInt16BE(t),t+=2,o.exchange=R.decode(e,t),t+=R.decode.bytes,Hn.decode.bytes=t-r,o};Hn.encodingLength=function(e){return 4+R.encodingLength(e.exchange)};var hn=N.a={};hn.encode=function(e,t,r){return t||(t=L.alloc(hn.encodingLength(e))),r||(r=0),t.writeUInt16BE(4,r),r+=2,dr.v4.encode(e,t,r),hn.encode.bytes=6,t};hn.encode.bytes=0;hn.decode=function(e,t){t||(t=0),t+=2;let r=dr.v4.decode(e,t);return hn.decode.bytes=6,r};hn.decode.bytes=0;hn.encodingLength=function(){return 6};var vn=N.aaaa={};vn.encode=function(e,t,r){return t||(t=L.alloc(vn.encodingLength(e))),r||(r=0),t.writeUInt16BE(16,r),r+=2,dr.v6.encode(e,t,r),vn.encode.bytes=18,t};vn.encode.bytes=0;vn.decode=function(e,t){t||(t=0),t+=2;let r=dr.v6.decode(e,t);return vn.decode.bytes=18,r};vn.decode.bytes=0;vn.encodingLength=function(){return 18};var Ye=N.option={};Ye.encode=function(e,t,r){t||(t=L.alloc(Ye.encodingLength(e))),r||(r=0);let o=r,n=Ag.toCode(e.code);if(t.writeUInt16BE(n,r),r+=2,e.data)t.writeUInt16BE(e.data.length,r),r+=2,e.data.copy(t,r),r+=e.data.length;else switch(n){case 8:let i=e.sourcePrefixLength||0,a=e.family||dr.familyOf(e.ip),s=dr.encode(e.ip,L.alloc),l=Math.ceil(i/8);t.writeUInt16BE(l+4,r),r+=2,t.writeUInt16BE(a,r),r+=2,t.writeUInt8(i,r++),t.writeUInt8(e.scopePrefixLength||0,r++),s.copy(t,r,0,l),r+=l;break;case 11:e.timeout?(t.writeUInt16BE(2,r),r+=2,t.writeUInt16BE(e.timeout,r),r+=2):(t.writeUInt16BE(0,r),r+=2);break;case 12:let u=e.length||0;t.writeUInt16BE(u,r),r+=2,t.fill(0,r,r+u),r+=u;break;case 14:let d=e.tags.length*2;t.writeUInt16BE(d,r),r+=2;for(let p of e.tags)t.writeUInt16BE(p,r),r+=2;break;default:throw new Error(`Unknown roption code: ${e.code}`)}return Ye.encode.bytes=r-o,t};Ye.encode.bytes=0;Ye.decode=function(e,t){t||(t=0);let r={};r.code=e.readUInt16BE(t),r.type=Ag.toString(r.code),t+=2;let o=e.readUInt16BE(t);switch(t+=2,r.data=e.slice(t,t+o),r.code){case 8:r.family=e.readUInt16BE(t),t+=2,r.sourcePrefixLength=e.readUInt8(t++),r.scopePrefixLength=e.readUInt8(t++);let n=L.alloc(r.family===1?4:16);e.copy(n,0,t,t+o-4),r.ip=dr.decode(n);break;case 11:o>0&&(r.timeout=e.readUInt16BE(t),t+=2);break;case 14:r.tags=[];for(let i=0;i<o;i+=2)r.tags.push(e.readUInt16BE(t)),t+=2}return Ye.decode.bytes=o+4,r};Ye.decode.bytes=0;Ye.encodingLength=function(e){if(e.data)return e.data.length+4;switch(Ag.toCode(e.code)){case 8:let r=e.sourcePrefixLength||0;return Math.ceil(r/8)+8;case 11:return typeof e.timeout=="number"?6:4;case 12:return e.length+4;case 14:return 4+e.tags.length*2}throw new Error(`Unknown roption code: ${e.code}`)};var ct=N.opt={};ct.encode=function(e,t,r){t||(t=L.alloc(ct.encodingLength(e))),r||(r=0);let o=r,n=xo(e,Ye);return t.writeUInt16BE(n,r),r=Ui(e,Ye,t,r+2),ct.encode.bytes=r-o,t};ct.encode.bytes=0;ct.decode=function(e,t){t||(t=0);let r=t,o=[],n=e.readUInt16BE(t);t+=2;let i=0;for(;n>0;)o[i++]=Ye.decode(e,t),t+=Ye.decode.bytes,n-=Ye.decode.bytes;return ct.decode.bytes=t-r,o};ct.decode.bytes=0;ct.encodingLength=function(e){return 2+xo(e||[],Ye)};var Be=N.dnskey={};Be.PROTOCOL_DNSSEC=3;Be.ZONE_KEY=128;Be.SECURE_ENTRYPOINT=32768;Be.encode=function(e,t,r){t||(t=L.alloc(Be.encodingLength(e))),r||(r=0);let o=r,n=e.key;if(!L.isBuffer(n))throw new Error("Key must be a Buffer");return r+=2,t.writeUInt16BE(e.flags,r),r+=2,t.writeUInt8(Be.PROTOCOL_DNSSEC,r),r+=1,t.writeUInt8(e.algorithm,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Be.encode.bytes=r-o,t.writeUInt16BE(Be.encode.bytes-2,o),t};Be.encode.bytes=0;Be.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);if(t+=2,o.flags=e.readUInt16BE(t),t+=2,e.readUInt8(t)!==Be.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return t+=1,o.algorithm=e.readUInt8(t),t+=1,o.key=e.slice(t,r+n+2),t+=o.key.length,Be.decode.bytes=t-r,o};Be.decode.bytes=0;Be.encodingLength=function(e){return 6+L.byteLength(e.key)};var jt=N.rrsig={};jt.encode=function(e,t,r){t||(t=L.alloc(jt.encodingLength(e))),r||(r=0);let o=r,n=e.signature;if(!L.isBuffer(n))throw new Error("Signature must be a Buffer");return r+=2,t.writeUInt16BE(yn.toType(e.typeCovered),r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.labels,r),r+=1,t.writeUInt32BE(e.originalTTL,r),r+=4,t.writeUInt32BE(e.expiration,r),r+=4,t.writeUInt32BE(e.inception,r),r+=4,t.writeUInt16BE(e.keyTag,r),r+=2,R.encode(e.signersName,t,r),r+=R.encode.bytes,n.copy(t,r,0,n.length),r+=n.length,jt.encode.bytes=r-o,t.writeUInt16BE(jt.encode.bytes-2,o),t};jt.encode.bytes=0;jt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.typeCovered=yn.toString(e.readUInt16BE(t)),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.labels=e.readUInt8(t),t+=1,o.originalTTL=e.readUInt32BE(t),t+=4,o.expiration=e.readUInt32BE(t),t+=4,o.inception=e.readUInt32BE(t),t+=4,o.keyTag=e.readUInt16BE(t),t+=2,o.signersName=R.decode(e,t),t+=R.decode.bytes,o.signature=e.slice(t,r+n+2),t+=o.signature.length,jt.decode.bytes=t-r,o};jt.decode.bytes=0;jt.encodingLength=function(e){return 20+R.encodingLength(e.signersName)+L.byteLength(e.signature)};var Ft=N.rp={};Ft.encode=function(e,t,r){t||(t=L.alloc(Ft.encodingLength(e))),r||(r=0);let o=r;return r+=2,R.encode(e.mbox||".",t,r,{mail:!0}),r+=R.encode.bytes,R.encode(e.txt||".",t,r),r+=R.encode.bytes,Ft.encode.bytes=r-o,t.writeUInt16BE(Ft.encode.bytes-2,o),t};Ft.encode.bytes=0;Ft.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mbox=R.decode(e,t,{mail:!0})||".",t+=R.decode.bytes,o.txt=R.decode(e,t)||".",t+=R.decode.bytes,Ft.decode.bytes=t-r,o};Ft.decode.bytes=0;Ft.encodingLength=function(e){return 2+R.encodingLength(e.mbox||".")+R.encodingLength(e.txt||".")};var Ie={};Ie.encode=function(e,t,r){t||(t=L.alloc(Ie.encodingLength(e))),r||(r=0);let o=r;for(var n=[],i=0;i<e.length;i++){var a=yn.toType(e[i]);n[a>>8]===void 0&&(n[a>>8]=[]),n[a>>8][a>>3&31]|=1<<7-(a&7)}for(i=0;i<n.length;i++)if(n[i]!==void 0){var s=L.from(n[i]);t.writeUInt8(i,r),r+=1,t.writeUInt8(s.length,r),r+=1,s.copy(t,r),r+=s.length}return Ie.encode.bytes=r-o,t};Ie.encode.bytes=0;Ie.decode=function(e,t,r){t||(t=0);let o=t;for(var n=[];t-o<r;){var i=e.readUInt8(t);t+=1;var a=e.readUInt8(t);t+=1;for(var s=0;s<a;s++)for(var l=e.readUInt8(t+s),u=0;u<8;u++)if(l&1<<7-u){var d=yn.toString(i<<8|s<<3|u);n.push(d)}t+=a}return Ie.decode.bytes=t-o,n};Ie.decode.bytes=0;Ie.encodingLength=function(e){for(var t=[],r=0;r<e.length;r++){var o=yn.toType(e[r]);t[o>>8]=Math.max(t[o>>8]||0,o&255)}var n=0;for(r=0;r<t.length;r++)t[r]!==void 0&&(n+=2+Math.ceil((t[r]+1)/8));return n};var Mt=N.nsec={};Mt.encode=function(e,t,r){t||(t=L.alloc(Mt.encodingLength(e))),r||(r=0);let o=r;return r+=2,R.encode(e.nextDomain,t,r),r+=R.encode.bytes,Ie.encode(e.rrtypes,t,r),r+=Ie.encode.bytes,Mt.encode.bytes=r-o,t.writeUInt16BE(Mt.encode.bytes-2,o),t};Mt.encode.bytes=0;Mt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.nextDomain=R.decode(e,t),t+=R.decode.bytes,o.rrtypes=Ie.decode(e,t,n-(t-r)),t+=Ie.decode.bytes,Mt.decode.bytes=t-r,o};Mt.decode.bytes=0;Mt.encodingLength=function(e){return 2+R.encodingLength(e.nextDomain)+Ie.encodingLength(e.rrtypes)};var Bt=N.nsec3={};Bt.encode=function(e,t,r){t||(t=L.alloc(Bt.encodingLength(e))),r||(r=0);let o=r,n=e.salt;if(!L.isBuffer(n))throw new Error("salt must be a Buffer");let i=e.nextDomain;if(!L.isBuffer(i))throw new Error("nextDomain must be a Buffer");return r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.flags,r),r+=1,t.writeUInt16BE(e.iterations,r),r+=2,t.writeUInt8(n.length,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,t.writeUInt8(i.length,r),r+=1,i.copy(t,r,0,i.length),r+=i.length,Ie.encode(e.rrtypes,t,r),r+=Ie.encode.bytes,Bt.encode.bytes=r-o,t.writeUInt16BE(Bt.encode.bytes-2,o),t};Bt.encode.bytes=0;Bt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);t+=2,o.algorithm=e.readUInt8(t),t+=1,o.flags=e.readUInt8(t),t+=1,o.iterations=e.readUInt16BE(t),t+=2;let i=e.readUInt8(t);t+=1,o.salt=e.slice(t,t+i),t+=i;let a=e.readUInt8(t);return t+=1,o.nextDomain=e.slice(t,t+a),t+=a,o.rrtypes=Ie.decode(e,t,n-(t-r)),t+=Ie.decode.bytes,Bt.decode.bytes=t-r,o};Bt.decode.bytes=0;Bt.encodingLength=function(e){return 8+e.salt.length+e.nextDomain.length+Ie.encodingLength(e.rrtypes)};var Ht=N.ds={};Ht.encode=function(e,t,r){t||(t=L.alloc(Ht.encodingLength(e))),r||(r=0);let o=r,n=e.digest;if(!L.isBuffer(n))throw new Error("Digest must be a Buffer");return r+=2,t.writeUInt16BE(e.keyTag,r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.digestType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Ht.encode.bytes=r-o,t.writeUInt16BE(Ht.encode.bytes-2,o),t};Ht.encode.bytes=0;Ht.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.keyTag=e.readUInt16BE(t),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.digestType=e.readUInt8(t),t+=1,o.digest=e.slice(t,r+n+2),t+=o.digest.length,Ht.decode.bytes=t-r,o};Ht.decode.bytes=0;Ht.encodingLength=function(e){return 6+L.byteLength(e.digest)};var st=N.sshfp={};st.getFingerprintLengthForHashType=function(t){switch(t){case 1:return 20;case 2:return 32}};st.encode=function(t,r,o){r||(r=L.alloc(st.encodingLength(t))),o||(o=0);let n=o;o+=2,r[o]=t.algorithm,o+=1,r[o]=t.hash,o+=1;let i=L.from(t.fingerprint.toUpperCase(),"hex");if(i.length!==st.getFingerprintLengthForHashType(t.hash))throw new Error("Invalid fingerprint length");return i.copy(r,o),o+=i.byteLength,st.encode.bytes=o-n,r.writeUInt16BE(st.encode.bytes-2,n),r};st.encode.bytes=0;st.decode=function(t,r){r||(r=0);let o=r,n={};r+=2,n.algorithm=t[r],r+=1,n.hash=t[r],r+=1;let i=st.getFingerprintLengthForHashType(n.hash);return n.fingerprint=t.slice(r,r+i).toString("hex").toUpperCase(),r+=i,st.decode.bytes=r-o,n};st.decode.bytes=0;st.encodingLength=function(e){return 4+L.from(e.fingerprint,"hex").byteLength};var Zt=N.naptr={};Zt.encode=function(e,t,r){t||(t=L.alloc(Zt.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.order||0,r),r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,J.encode(e.flags,t,r),r+=J.encode.bytes,J.encode(e.services,t,r),r+=J.encode.bytes,J.encode(e.regexp,t,r),r+=J.encode.bytes,R.encode(e.replacement,t,r),r+=R.encode.bytes,Zt.encode.bytes=r-o,t.writeUInt16BE(Zt.encode.bytes-2,o),t};Zt.encode.bytes=0;Zt.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.order=e.readUInt16BE(t),t+=2,o.preference=e.readUInt16BE(t),t+=2,o.flags=J.decode(e,t),t+=J.decode.bytes,o.services=J.decode(e,t),t+=J.decode.bytes,o.regexp=J.decode(e,t),t+=J.decode.bytes,o.replacement=R.decode(e,t),t+=R.decode.bytes,Zt.decode.bytes=t-r,o};Zt.decode.bytes=0;Zt.encodingLength=function(e){return J.encodingLength(e.flags)+J.encodingLength(e.services)+J.encodingLength(e.regexp)+R.encodingLength(e.replacement)+6};var Gt=N.tlsa={};Gt.encode=function(e,t,r){t||(t=L.alloc(Gt.encodingLength(e))),r||(r=0);let o=r,n=e.certificate;if(!L.isBuffer(n))throw new Error("Certificate must be a Buffer");return r+=2,t.writeUInt8(e.usage,r),r+=1,t.writeUInt8(e.selector,r),r+=1,t.writeUInt8(e.matchingType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Gt.encode.bytes=r-o,t.writeUInt16BE(Gt.encode.bytes-2,o),t};Gt.encode.bytes=0;Gt.decode=function(e,t){t||(t=0);let r=t,o={},n=e.readUInt16BE(t);return t+=2,o.usage=e.readUInt8(t),t+=1,o.selector=e.readUInt8(t),t+=1,o.matchingType=e.readUInt8(t),t+=1,o.certificate=e.slice(t,r+n+2),t+=o.certificate.length,Gt.decode.bytes=t-r,o};Gt.decode.bytes=0;Gt.encodingLength=function(e){return 5+L.byteLength(e.certificate)};var Pg=N.record=function(e){switch(e.toUpperCase()){case"A":return hn;case"PTR":return It;case"CNAME":return qR;case"DNAME":return KR;case"TXT":return pn;case"NULL":return mn;case"AAAA":return vn;case"SRV":return gn;case"HINFO":return fn;case"CAA":return at;case"NS":return un;case"SOA":return dn;case"MX":return Hn;case"OPT":return ct;case"DNSKEY":return Be;case"RRSIG":return jt;case"RP":return Ft;case"NSEC":return Mt;case"NSEC3":return Bt;case"SSHFP":return st;case"DS":return Ht;case"NAPTR":return Zt;case"TLSA":return Gt}return ln},Re=N.answer={};Re.encode=function(e,t,r){t||(t=L.alloc(Re.encodingLength(e))),r||(r=0);let o=r;if(R.encode(e.name,t,r),r+=R.encode.bytes,t.writeUInt16BE(yn.toType(e.type),r),e.type.toUpperCase()==="OPT"){if(e.name!==".")throw new Error("OPT name must be root.");t.writeUInt16BE(e.udpPayloadSize||4096,r+2),t.writeUInt8(e.extendedRcode||0,r+4),t.writeUInt8(e.ednsVersion||0,r+5),t.writeUInt16BE(e.flags||0,r+6),r+=8,ct.encode(e.options||[],t,r),r+=ct.encode.bytes}else{let n=Fc.toClass(e.class===void 0?"IN":e.class);e.flush&&(n|=Eg),t.writeUInt16BE(n,r+2),t.writeUInt32BE(e.ttl||0,r+4),r+=8;let i=Pg(e.type);i.encode(e.data,t,r),r+=i.encode.bytes}return Re.encode.bytes=r-o,t};Re.encode.bytes=0;Re.decode=function(e,t){t||(t=0);let r={},o=t;if(r.name=R.decode(e,t),t+=R.decode.bytes,r.type=yn.toString(e.readUInt16BE(t)),r.type==="OPT")r.udpPayloadSize=e.readUInt16BE(t+2),r.extendedRcode=e.readUInt8(t+4),r.ednsVersion=e.readUInt8(t+5),r.flags=e.readUInt16BE(t+6),r.flag_do=(r.flags>>15&1)===1,r.options=ct.decode(e,t+8),t+=8+ct.decode.bytes;else{let n=e.readUInt16BE(t+2);r.ttl=e.readUInt32BE(t+4),r.class=Fc.toString(n&VR),r.flush=!!(n&Eg);let i=Pg(r.type);r.data=i.decode(e,t+8),t+=8+i.decode.bytes}return Re.decode.bytes=t-o,r};Re.decode.bytes=0;Re.encodingLength=function(e){let t=e.data!==null&&e.data!==void 0?e.data:e.options;return R.encodingLength(e.name)+8+Pg(e.type).encodingLength(t)};var At=N.question={};At.encode=function(e,t,r){t||(t=L.alloc(At.encodingLength(e))),r||(r=0);let o=r;return R.encode(e.name,t,r),r+=R.encode.bytes,t.writeUInt16BE(yn.toType(e.type),r),r+=2,t.writeUInt16BE(Fc.toClass(e.class===void 0?"IN":e.class),r),r+=2,At.encode.bytes=r-o,e};At.encode.bytes=0;At.decode=function(e,t){t||(t=0);let r=t,o={};return o.name=R.decode(e,t),t+=R.decode.bytes,o.type=yn.toString(e.readUInt16BE(t)),t+=2,o.class=Fc.toString(e.readUInt16BE(t)),t+=2,o.class&D0&&(o.class&=JR),At.decode.bytes=t-r,o};At.decode.bytes=0;At.encodingLength=function(e){return R.encodingLength(e.name)+4};N.AUTHORITATIVE_ANSWER=1024;N.TRUNCATED_RESPONSE=512;N.RECURSION_DESIRED=256;N.RECURSION_AVAILABLE=128;N.AUTHENTIC_DATA=32;N.CHECKING_DISABLED=16;N.DNSSEC_OK=32768;N.encode=function(e,t,r){let o=!t;o&&(t=L.alloc(N.encodingLength(e))),r||(r=0);let n=r;return e.questions||(e.questions=[]),e.answers||(e.answers=[]),e.authorities||(e.authorities=[]),e.additionals||(e.additionals=[]),Et.encode(e,t,r),r+=Et.encode.bytes,r=Ui(e.questions,At,t,r),r=Ui(e.answers,Re,t,r),r=Ui(e.authorities,Re,t,r),r=Ui(e.additionals,Re,t,r),N.encode.bytes=r-n,o&&N.encode.bytes!==t.length?t.slice(0,N.encode.bytes):t};N.encode.bytes=0;N.decode=function(e,t){t||(t=0);let r=t,o=Et.decode(e,t);return t+=Et.decode.bytes,t=jc(o.questions,At,e,t),t=jc(o.answers,Re,e,t),t=jc(o.authorities,Re,e,t),t=jc(o.additionals,Re,e,t),N.decode.bytes=t-r,o};N.decode.bytes=0;N.encodingLength=function(e){return Et.encodingLength(e)+xo(e.questions||[],At)+xo(e.answers||[],Re)+xo(e.authorities||[],Re)+xo(e.additionals||[],Re)};N.streamEncode=function(e){let t=N.encode(e),r=L.alloc(2);r.writeUInt16BE(t.byteLength);let o=L.concat([r,t]);return N.streamEncode.bytes=o.byteLength,o};N.streamEncode.bytes=0;N.streamDecode=function(e){let t=e.readUInt16BE(0);if(e.byteLength<t+2)return null;let r=N.decode(e.slice(2));return N.streamDecode.bytes=N.decode.bytes,r};N.streamDecode.bytes=0;function xo(e,t){let r=0;for(let o=0;o<e.length;o++)r+=t.encodingLength(e[o]);return r}function Ui(e,t,r,o){for(let n=0;n<e.length;n++)t.encode(e[n],r,o),o+=t.encode.bytes;return o}function jc(e,t,r,o){for(let n=0;n<e.length;n++)e[n]=t.decode(r,o),o+=t.decode.bytes;return o}});var z0=q((BH,U0)=>{"use strict";var L0=nO;process.nextTick(tO,42);U0.exports=XR;function XR(e){var t=o;return r;function r(n){t(n||QR)}function o(n){var i=[n];t=a,e(s);function a(l){i.push(l)}function s(l){var u=arguments;for(t=YR(l)?o:d;i.length;)d(i.shift());function d(p){L0(eO,p,u)}}}}function YR(e){return Object.prototype.toString.call(e)==="[object Error]"}function QR(){}function eO(e,t){e.apply(null,t)}function tO(e){e===42&&(L0=process.nextTick)}function nO(e,t,r){process.nextTick(function(){e(t,r)})}});var M0=q((HH,F0)=>{var Cg=N0(),rO=te("dgram"),oO=z0(),iO=te("events"),Rg=te("os"),Tg=function(){};F0.exports=function(e){e||(e={});var t=new iO.EventEmitter,r=typeof e.port=="number"?e.port:5353,o=e.type||"udp4",n=e.ip||e.host||(o==="udp4"?"224.0.0.251":null),i={address:n,port:r},a={},s=!1,l=null;if(o==="udp6"&&(!n||!e.interface))throw new Error("For IPv6 multicast you must specify `ip` and `interface`");var u=e.socket||rO.createSocket({type:o,reuseAddr:e.reuseAddr!==!1,toString:function(){return o}});u.on("error",function(p){p.code==="EACCES"||p.code==="EADDRINUSE"?t.emit("error",p):t.emit("warning",p)}),u.on("message",function(p,m){try{p=Cg.decode(p)}catch(f){t.emit("warning",f);return}t.emit("packet",p,m),p.type==="query"&&t.emit("query",p,m),p.type==="response"&&t.emit("response",p,m)}),u.on("listening",function(){r||(r=i.port=u.address().port),e.multicast!==!1&&(t.update(),l=setInterval(t.update,5e3),u.setMulticastTTL(e.ttl||255),u.setMulticastLoopback(e.loopback!==!1))});var d=oO(function(p){if(!r||e.bind===!1)return p(null);u.once("error",p),u.bind(r,e.bind||e.interface,function(){u.removeListener("error",p),p(null)})});return d(function(p){if(p)return t.emit("error",p);t.emit("ready")}),t.send=function(p,m,f){if(typeof m=="function")return t.send(p,null,m);f||(f=Tg),m?!m.host&&!m.address&&(m.address=i.address):m=i,d(g);function g(y){if(s)return f();if(y)return f(y);var k=Cg.encode(p);u.send(k,0,k.length,m.port,m.address||m.host,f)}},t.response=t.respond=function(p,m,f){Array.isArray(p)&&(p={answers:p}),p.type="response",p.flags=(p.flags||0)|Cg.AUTHORITATIVE_ANSWER,t.send(p,m,f)},t.query=function(p,m,f,g){if(typeof m=="function")return t.query(p,null,null,m);if(typeof m=="object"&&m&&m.port)return t.query(p,null,m,f);if(typeof f=="function")return t.query(p,m,null,f);g||(g=Tg),typeof p=="string"&&(p=[{name:p,type:m||"ANY"}]),Array.isArray(p)&&(p={type:"query",questions:p}),p.type="query",t.send(p,f,g)},t.destroy=function(p){if(p||(p=Tg),s)return process.nextTick(p);s=!0,clearInterval(l);for(var m in a)try{u.dropMembership(n,m)}catch{}a={},u.close(p)},t.update=function(){for(var p=e.interface?[].concat(e.interface):sO(),m=!1,f=0;f<p.length;f++){var g=p[f];if(!a[g])try{u.addMembership(n,g),a[g]=!0,m=!0}catch(y){t.emit("warning",y)}}if(m){if(u.setMulticastInterface)try{u.setMulticastInterface(e.interface||aO())}catch(y){t.emit("warning",y)}t.emit("networkInterface")}},t};function aO(){for(var e=Rg.networkInterfaces(),t=Object.keys(e),r=0;r<t.length;r++)for(var o=e[t[r]],n=0;n<o.length;n++){var i=o[n];if(j0(i.family)&&!i.internal)return Rg.platform()==="darwin"&&t[r]==="en0"?i.address:"0.0.0.0"}return"127.0.0.1"}function sO(){for(var e=Rg.networkInterfaces(),t=Object.keys(e),r=[],o=0;o<t.length;o++)for(var n=e[t[o]],i=0;i<n.length;i++){var a=n[i];if(j0(a.family)){r.push(a.address);break}}return r}function j0(e){return e===4||e==="IPv4"}});var H0=q((ZH,B0)=>{"use strict";B0.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,n,i;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!e(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(t[n]!==r[n])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=o;n--!==0;){var a=i[n];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var Z0=q(pr=>{"use strict";var Og=pr&&pr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pr,"__esModule",{value:!0});pr.Server=void 0;var cO=Og(M0()),lO=Og(H0()),uO=Og(Nc()),Mc=class{constructor(t,r){this.registry={},this.mdns=(0,cO.default)(t),this.mdns.setMaxListeners(0),this.mdns.on("query",this.respondToQuery.bind(this)),this.errorCallback=r??function(o){throw o}}register(t){let r=o=>{var n=this.registry[o.type];if(!n)n=this.registry[o.type]=[];else if(n.some(this.isDuplicateRecord(o)))return;n.push(o)};Array.isArray(t)?t.forEach(r):r(t)}unregister(t){let r=o=>{let n=o.type;n in this.registry&&(this.registry[n]=this.registry[n].filter(i=>i.name!==o.name))};Array.isArray(t)?t.forEach(r):r(t)}respondToQuery(t){let r=this;t.questions.forEach(o=>{var n=o.type,i=o.name,a=n==="ANY"?Object.keys(r.registry).map(r.recordsFor.bind(r,i)).flat(1):r.recordsFor(i,n);if(a.length!==0){var s=[];n!=="ANY"&&(a.forEach(l=>{l.type==="PTR"&&(s=s.concat(r.recordsFor(l.data,"SRV")).concat(r.recordsFor(l.data,"TXT")))}),s.filter(function(l){return l.type==="SRV"}).map(function(l){return l.data.target}).filter(this.unique()).forEach(function(l){s=s.concat(r.recordsFor(l,"A")).concat(r.recordsFor(l,"AAAA"))})),r.mdns.respond({answers:a,additionals:s},l=>{l&&this.errorCallback(l)})}})}recordsFor(t,r){return r in this.registry?this.registry[r].filter(o=>{var n=~t.indexOf(".")?o.name:o.name.split(".")[0];return(0,uO.default)(n,t)}):[]}isDuplicateRecord(t){return r=>t.type===r.type&&t.name===r.name&&(0,lO.default)(t.data,r.data)}unique(){var t=[];return r=>~t.indexOf(r)?!1:(t.push(r),!0)}};pr.Server=Mc;pr.default=Mc});var G0=q(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});Dg.default=(e,t)=>{if(t===void 0)return!0;let r=e.txt,o=Object.entries(t).map(([n,i])=>{let a=r[n];return!(a===void 0||i!=a)});return o.length==0?!0:!o.includes(!1)}});var W0=q(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.default=e=>Object.keys(e).filter(t=>!t.includes("binary")).reduce((t,r)=>Object.assign(t,{[r]:e[r]}),{})});var V0=q(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.default=dO;function dO(e,t){if(e===void 0||t===void 0)return!1;let r=Object.keys(e),o=Object.keys(t);if(r.length!=o.length)return!1;for(let n of r)if(e[n]!=t[n])return!1;return!0}});var K0=q(mr=>{"use strict";var zi=mr&&mr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mr,"__esModule",{value:!0});mr.Browser=void 0;var pO=zi(vg()),Zn=zi(Nc()),mO=te("events"),Ug=yg(),J0=zi(G0()),fO=zi(W0()),gO=zi(V0()),q0=".local",hO="_services._dns-sd._udp"+q0,Bc=class e extends mO.EventEmitter{constructor(t,r,o){if(super(),this.onresponse=void 0,this.serviceMap={},this.wildcard=!1,this._services=[],typeof r=="function")return new e(t,null,r);this.mdns=t,this.txt=new pO.default(r!==null&&r.txt!=null?r.txt:void 0),r===null||r.type===void 0?(this.name=hO,this.wildcard=!0):(this.name=(0,Ug.toString)({name:r.type,protocol:r.protocol||"tcp"})+q0,r.name&&(this.name=r.name+"."+this.name),this.wildcard=!1),r!=null&&r.txt!==void 0&&(this.txtQuery=(0,fO.default)(r.txt)),o&&this.on("up",o),this.start()}start(){if(!(this.onresponse||this.name===void 0)){var t=this,r={};this.wildcard||(r[this.name]=!0),this.onresponse=(o,n)=>{t.wildcard&&o.answers.forEach(a=>{a.type!=="PTR"||a.name!==t.name||a.name in r||(r[a.data]=!0,t.mdns.query(a.data,"PTR"))});let i=Date.now();Object.keys(r).forEach(function(a){t.goodbyes(a,o).forEach(t.removeService.bind(t));var s=t.buildServicesFor(a,o,t.txt,n,i);s.length!==0&&s.forEach(l=>{let u=t._services.find(d=>(0,Zn.default)(d.fqdn,l.fqdn));if(u){t.updateServiceSrv(u,l),t.updateServiceTxt(u,l);return}t.addService(l)})})},this.mdns.on("response",this.onresponse),this.update()}}stop(){this.onresponse&&(this.mdns.removeListener("response",this.onresponse),this.onresponse=void 0)}update(){this.mdns.query(this.name,"PTR")}expire(){let t=Date.now();this._services=this._services.filter(r=>!r.ttl||r.lastSeen===void 0?!0:r.lastSeen+r.ttl*1e3<t?(this.emit("down",r),!1):!0)}get services(){return this._services}addService(t){(0,J0.default)(t,this.txtQuery)!==!1&&(this._services.push(t),this.serviceMap[t.fqdn]=!0,this.emit("up",t))}updateServiceSrv(t,r){(t.name!==r.name||t.host!==r.host||t.port!==r.port||t.type!==r.type||t.protocol!==r.protocol)&&(this.replaceService(r),this.emit("srv-update",r,t))}updateServiceTxt(t,r){if(!(0,gO.default)(r.txt,t?.txt||{})){if(!(0,J0.default)(r,this.txtQuery)){this.removeService(r.fqdn);return}this.replaceService(r),this.emit("txt-update",r,t)}}replaceService(t){this._services=this._services.map(r=>(0,Zn.default)(r.fqdn,t.fqdn)?t:r)}removeService(t){var r,o;this._services.some(function(n,i){if((0,Zn.default)(n.fqdn,t))return r=n,o=i,!0}),!(!r||o===void 0)&&(this._services.splice(o,1),delete this.serviceMap[t],this.emit("down",r))}goodbyes(t,r){return r.answers.concat(r.additionals).filter(o=>o.type==="PTR"&&o.ttl===0&&(0,Zn.default)(o.name,t)).map(o=>o.data)}buildServicesFor(t,r,o,n,i){var a=r.answers.concat(r.additionals).filter(s=>s.ttl>0);return a.filter(s=>s.type==="PTR"&&(0,Zn.default)(s.name,t)).map(s=>{let l={addresses:[],subtypes:[],ttl:s.ttl,lastSeen:i};if(a.filter(u=>u.type==="PTR"&&(0,Zn.default)(u.data,s.data)&&u.name.includes("._sub")).forEach(u=>{let d=(0,Ug.toType)(u.name);l.subtypes.push(d.subtype)}),a.filter(u=>(u.type==="SRV"||u.type==="TXT")&&(0,Zn.default)(u.name,s.data)).forEach(u=>{if(u.type==="SRV"){var d=u.name.split("."),p=d[0],m=(0,Ug.toType)(d.slice(1,-1).join("."));l.name=p,l.fqdn=u.name,l.host=u.data.target,l.referer=n,l.port=u.data.port,l.type=m.name,l.protocol=m.protocol}else u.type==="TXT"&&(l.rawTxt=u.data,l.txt=this.txt.decodeAll(u.data))}),!!l.name)return a.filter(u=>(u.type==="A"||u.type==="AAAA")&&(0,Zn.default)(u.name,l.host)).forEach(u=>l.addresses.push(u.data)),l}).filter(s=>!!s)}};mr.Browser=Bc;mr.default=Bc});var X0=q(bn=>{"use strict";var Hc=bn&&bn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bn,"__esModule",{value:!0});bn.Browser=bn.Service=void 0;var vO=Hc(_0()),yO=Hc(Z0()),zg=Hc(K0());bn.Browser=zg.default;var bO=Hc(bg());bn.Service=bO.default;var jg=class{constructor(t={},r){this.server=new yO.default(t,r),this.registry=new vO.default(this.server)}publish(t){return this.registry.publish(t)}unpublishAll(t){return this.registry.unpublishAll(t)}find(t=null,r){return new zg.default(this.server.mdns,t,r)}findOne(t=null,r=1e4,o){let n=new zg.default(this.server.mdns,t);var i;return n.once("up",a=>{i!==void 0&&clearTimeout(i),n.stop(),o&&o(a)}),i=setTimeout(()=>{n.stop(),o&&o(null)},r),n}destroy(t){this.registry.destroy(),this.server.mdns.destroy(t)}};bn.default=jg});var Q0=q((He,Y0)=>{"use strict";var xO=He&&He.__createBinding||(Object.create?(function(e,t,r,o){o===void 0&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}):(function(e,t,r,o){o===void 0&&(o=r),e[o]=t[r]})),kO=He&&He.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),wO=He&&He.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var o=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(o[o.length]=n);return o},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o=e(t),n=0;n<o.length;n++)o[n]!=="default"&&xO(r,t,o[n]);return kO(r,t),r}})();Object.defineProperty(He,"__esModule",{value:!0});He.Browser=He.Service=He.Bonjour=void 0;var ji=wO(X0());Object.defineProperty(He,"Service",{enumerable:!0,get:function(){return ji.Service}});Object.defineProperty(He,"Browser",{enumerable:!0,get:function(){return ji.Browser}});var fr=class extends ji.default{};He.Bonjour=fr;He.default=fr;Y0.exports=Object.assign(fr,{Bonjour:fr,Service:ji.Service,Browser:ji.Browser,default:fr})});var kn=q((nW,Zw)=>{"use strict";var Bw=["nodebuffer","arraybuffer","fragments"],Hw=typeof Blob<"u";Hw&&Bw.push("blob");Zw.exports={BINARY_TYPES:Bw,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Hw,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Fi=q((rW,qc)=>{"use strict";var{EMPTY_BUFFER:uN}=kn(),Zg=Buffer[Symbol.species];function dN(e,t){if(e.length===0)return uN;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),o=0;for(let n=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return o<t?new Zg(r.buffer,r.byteOffset,o):r}function Gw(e,t,r,o,n){for(let i=0;i<n;i++)r[o+i]=e[i]^t[i&3]}function Ww(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function pN(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Gg(e){if(Gg.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Zg(e):ArrayBuffer.isView(e)?t=new Zg(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Gg.readOnly=!1),t}qc.exports={concat:dN,mask:Gw,toArrayBuffer:pN,toBuffer:Gg,unmask:Ww};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=te("bufferutil");qc.exports.mask=function(t,r,o,n,i){i<48?Gw(t,r,o,n,i):e.mask(t,r,o,n,i)},qc.exports.unmask=function(t,r){t.length<32?Ww(t,r):e.unmask(t,r)}}catch{}});var qw=q((oW,Jw)=>{"use strict";var Vw=Symbol("kDone"),Wg=Symbol("kRun"),Vg=class{constructor(t){this[Vw]=()=>{this.pending--,this[Wg]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Wg]()}[Wg](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Vw])}}};Jw.exports=Vg});var $o=q((iW,Qw)=>{"use strict";var Mi=te("zlib"),Kw=Fi(),mN=qw(),{kStatusCode:Xw}=kn(),fN=Buffer[Symbol.species],gN=Buffer.from([0,0,255,255]),Xc=Symbol("permessage-deflate"),wn=Symbol("total-length"),So=Symbol("callback"),Gn=Symbol("buffers"),_o=Symbol("error"),Kc,Jg=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Kc){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Kc=new mN(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[So];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,o=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!o)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(o.server_no_context_takeover=!0),r.clientNoContextTakeover&&(o.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(o.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?o.client_max_window_bits=r.clientMaxWindowBits:(o.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete o.client_max_window_bits,o}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(o=>{let n=r[o];if(n.length>1)throw new Error(`Parameter "${o}" must have only a single value`);if(n=n[0],o==="client_max_window_bits"){if(n!==!0){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else if(o==="server_max_window_bits"){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(o==="client_no_context_takeover"||o==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else throw new Error(`Unknown parameter "${o}"`);r[o]=n})}),t}decompress(t,r,o){Kc.add(n=>{this._decompress(t,r,(i,a)=>{n(),o(i,a)})})}compress(t,r,o){Kc.add(n=>{this._compress(t,r,(i,a)=>{n(),o(i,a)})})}_decompress(t,r,o){let n=this._isServer?"client":"server";if(!this._inflate){let i=`${n}_max_window_bits`,a=typeof this.params[i]!="number"?Mi.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=Mi.createInflateRaw({...this._options.zlibInflateOptions,windowBits:a}),this._inflate[Xc]=this,this._inflate[wn]=0,this._inflate[Gn]=[],this._inflate.on("error",vN),this._inflate.on("data",Yw)}this._inflate[So]=o,this._inflate.write(t),r&&this._inflate.write(gN),this._inflate.flush(()=>{let i=this._inflate[_o];if(i){this._inflate.close(),this._inflate=null,o(i);return}let a=Kw.concat(this._inflate[Gn],this._inflate[wn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[wn]=0,this._inflate[Gn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),o(null,a)})}_compress(t,r,o){let n=this._isServer?"server":"client";if(!this._deflate){let i=`${n}_max_window_bits`,a=typeof this.params[i]!="number"?Mi.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=Mi.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:a}),this._deflate[wn]=0,this._deflate[Gn]=[],this._deflate.on("data",hN)}this._deflate[So]=o,this._deflate.write(t),this._deflate.flush(Mi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=Kw.concat(this._deflate[Gn],this._deflate[wn]);r&&(i=new fN(i.buffer,i.byteOffset,i.length-4)),this._deflate[So]=null,this._deflate[wn]=0,this._deflate[Gn]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),o(null,i)})}};Qw.exports=Jg;function hN(e){this[Gn].push(e),this[wn]+=e.length}function Yw(e){if(this[wn]+=e.length,this[Xc]._maxPayload<1||this[wn]<=this[Xc]._maxPayload){this[Gn].push(e);return}this[_o]=new RangeError("Max payload size exceeded"),this[_o].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[_o][Xw]=1009,this.removeListener("data",Yw),this.reset()}function vN(e){if(this[Xc]._inflate=null,this[_o]){this[So](this[_o]);return}e[Xw]=1007,this[So](e)}});var Io=q((aW,Yc)=>{"use strict";var{isUtf8:eS}=te("buffer"),{hasBlob:yN}=kn(),bN=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function xN(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function qg(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function kN(e){return yN&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Yc.exports={isBlob:kN,isValidStatusCode:xN,isValidUTF8:qg,tokenChars:bN};if(eS)Yc.exports.isValidUTF8=function(e){return e.length<24?qg(e):eS(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=te("utf-8-validate");Yc.exports.isValidUTF8=function(t){return t.length<32?qg(t):e(t)}}catch{}});var eh=q((sW,sS)=>{"use strict";var{Writable:wN}=te("stream"),tS=$o(),{BINARY_TYPES:SN,EMPTY_BUFFER:nS,kStatusCode:_N,kWebSocket:$N}=kn(),{concat:Kg,toArrayBuffer:IN,unmask:AN}=Fi(),{isValidStatusCode:EN,isValidUTF8:rS}=Io(),Qc=Buffer[Symbol.species],gt=0,oS=1,iS=2,aS=3,Xg=4,Yg=5,el=6,Qg=class extends wN{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||SN[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[$N]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=gt}_write(t,r,o){if(this._opcode===8&&this._state==gt)return o();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){o(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(o)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let o=this._buffers[0];return this._buffers[0]=new Qc(o.buffer,o.byteOffset+t,o.length-t),new Qc(o.buffer,o.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let o=this._buffers[0],n=r.length-t;t>=o.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(o.buffer,o.byteOffset,t),n),this._buffers[0]=new Qc(o.buffer,o.byteOffset+t,o.length-t)),t-=o.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case gt:this.getInfo(t);break;case oS:this.getPayloadLength16(t);break;case iS:this.getPayloadLength64(t);break;case aS:this.getMask();break;case Xg:this.getData(t);break;case Yg:case el:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let o=(r[0]&64)===64;if(o&&!this._extensions[tS.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=o}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=oS:this._payloadLength===127?this._state=iS:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),o=r.readUInt32BE(0);if(o>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=o*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=aS:this._state=Xg}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Xg}getData(t){let r=nS;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&AN(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Yg,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let o=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(o);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[tS.extensionName].decompress(t,this._fin,(n,i)=>{if(n)return r(n);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let a=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(a);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let a=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(a);return}this._fragments.push(i)}this.dataMessage(r),this._state===gt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=gt;return}let r=this._messageLength,o=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Kg(o,r):this._binaryType==="arraybuffer"?n=IN(Kg(o,r)):this._binaryType==="blob"?n=new Blob(o):n=o,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=gt):(this._state=el,setImmediate(()=>{this.emit("message",n,!0),this._state=gt,this.startLoop(t)}))}else{let n=Kg(o,r);if(!this._skipUTF8Validation&&!rS(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._state===Yg||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=gt):(this._state=el,setImmediate(()=>{this.emit("message",n,!1),this._state=gt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,nS),this.end();else{let o=t.readUInt16BE(0);if(!EN(o)){let i=this.createError(RangeError,`invalid status code ${o}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(i);return}let n=new Qc(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!rS(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(i);return}this._loop=!1,this.emit("conclude",o,n),this.end()}this._state=gt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=gt):(this._state=el,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=gt,this.startLoop(r)}))}createError(t,r,o,n,i){this._loop=!1,this._errored=!0;let a=new t(o?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(a,this.createError),a.code=i,a[_N]=n,a}};sS.exports=Qg});var rh=q((lW,uS)=>{"use strict";var{Duplex:cW}=te("stream"),{randomFillSync:PN}=te("crypto"),{types:{isUint8Array:CN}}=te("util"),cS=$o(),{EMPTY_BUFFER:TN,kWebSocket:RN,NOOP:ON}=kn(),{isBlob:Ao,isValidStatusCode:DN}=Io(),{mask:lS,toBuffer:hr}=Fi(),ht=Symbol("kByteLength"),NN=Buffer.alloc(4),tl=8*1024,vr,Eo=tl,Pt=0,LN=1,UN=2,th=class e{constructor(t,r,o){this._extensions=r||{},o&&(this._generateMask=o,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Pt,this.onerror=ON,this[RN]=void 0}static frame(t,r){let o,n=!1,i=2,a=!1;r.mask&&(o=r.maskBuffer||NN,r.generateMask?r.generateMask(o):(Eo===tl&&(vr===void 0&&(vr=Buffer.alloc(tl)),PN(vr,0,tl),Eo=0),o[0]=vr[Eo++],o[1]=vr[Eo++],o[2]=vr[Eo++],o[3]=vr[Eo++]),a=(o[0]|o[1]|o[2]|o[3])===0,i=6);let s;typeof t=="string"?(!r.mask||a)&&r[ht]!==void 0?s=r[ht]:(t=Buffer.from(t),s=t.length):(s=t.length,n=r.mask&&r.readOnly&&!a);let l=s;s>=65536?(i+=8,l=127):s>125&&(i+=2,l=126);let u=Buffer.allocUnsafe(n?s+i:i);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=l,l===126?u.writeUInt16BE(s,2):l===127&&(u[2]=u[3]=0,u.writeUIntBE(s,4,6)),r.mask?(u[1]|=128,u[i-4]=o[0],u[i-3]=o[1],u[i-2]=o[2],u[i-1]=o[3],a?[u,t]:n?(lS(t,o,u,i,s),[u]):(lS(t,o,t,0,s),[u,t])):[u,t]}close(t,r,o,n){let i;if(t===void 0)i=TN;else{if(typeof t!="number"||!DN(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(t,0);else{let s=Buffer.byteLength(r);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");if(i=Buffer.allocUnsafe(2+s),i.writeUInt16BE(t,0),typeof r=="string")i.write(r,2);else if(CN(r))i.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let a={[ht]:i.length,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Pt?this.enqueue([this.dispatch,i,!1,a,n]):this.sendFrame(e.frame(i,a),n)}ping(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):Ao(t)?(n=t.size,i=!1):(t=hr(t),n=t.length,i=hr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[ht]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};Ao(t)?this._state!==Pt?this.enqueue([this.getBlobData,t,!1,a,o]):this.getBlobData(t,!1,a,o):this._state!==Pt?this.enqueue([this.dispatch,t,!1,a,o]):this.sendFrame(e.frame(t,a),o)}pong(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):Ao(t)?(n=t.size,i=!1):(t=hr(t),n=t.length,i=hr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let a={[ht]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};Ao(t)?this._state!==Pt?this.enqueue([this.getBlobData,t,!1,a,o]):this.getBlobData(t,!1,a,o):this._state!==Pt?this.enqueue([this.dispatch,t,!1,a,o]):this.sendFrame(e.frame(t,a),o)}send(t,r,o){let n=this._extensions[cS.extensionName],i=r.binary?2:1,a=r.compress,s,l;typeof t=="string"?(s=Buffer.byteLength(t),l=!1):Ao(t)?(s=t.size,l=!1):(t=hr(t),s=t.length,l=hr.readOnly),this._firstFragment?(this._firstFragment=!1,a&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(a=s>=n._threshold),this._compress=a):(a=!1,i=0),r.fin&&(this._firstFragment=!0);let u={[ht]:s,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:l,rsv1:a};Ao(t)?this._state!==Pt?this.enqueue([this.getBlobData,t,this._compress,u,o]):this.getBlobData(t,this._compress,u,o):this._state!==Pt?this.enqueue([this.dispatch,t,this._compress,u,o]):this.dispatch(t,this._compress,u,o)}getBlobData(t,r,o,n){this._bufferedBytes+=o[ht],this._state=UN,t.arrayBuffer().then(i=>{if(this._socket.destroyed){let s=new Error("The socket was closed while the blob was being read");process.nextTick(nh,this,s,n);return}this._bufferedBytes-=o[ht];let a=hr(i);r?this.dispatch(a,r,o,n):(this._state=Pt,this.sendFrame(e.frame(a,o),n),this.dequeue())}).catch(i=>{process.nextTick(zN,this,i,n)})}dispatch(t,r,o,n){if(!r){this.sendFrame(e.frame(t,o),n);return}let i=this._extensions[cS.extensionName];this._bufferedBytes+=o[ht],this._state=LN,i.compress(t,o.fin,(a,s)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");nh(this,l,n);return}this._bufferedBytes-=o[ht],this._state=Pt,o.readOnly=!1,this.sendFrame(e.frame(s,o),n),this.dequeue()})}dequeue(){for(;this._state===Pt&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][ht],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][ht],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};uS.exports=th;function nh(e,t,r){typeof r=="function"&&r(t);for(let o=0;o<e._queue.length;o++){let n=e._queue[o],i=n[n.length-1];typeof i=="function"&&i(t)}}function zN(e,t,r){nh(e,t,r),e.onerror(t)}});var bS=q((uW,yS)=>{"use strict";var{kForOnEventAttribute:Bi,kListener:oh}=kn(),dS=Symbol("kCode"),pS=Symbol("kData"),mS=Symbol("kError"),fS=Symbol("kMessage"),gS=Symbol("kReason"),Po=Symbol("kTarget"),hS=Symbol("kType"),vS=Symbol("kWasClean"),Sn=class{constructor(t){this[Po]=null,this[hS]=t}get target(){return this[Po]}get type(){return this[hS]}};Object.defineProperty(Sn.prototype,"target",{enumerable:!0});Object.defineProperty(Sn.prototype,"type",{enumerable:!0});var yr=class extends Sn{constructor(t,r={}){super(t),this[dS]=r.code===void 0?0:r.code,this[gS]=r.reason===void 0?"":r.reason,this[vS]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[dS]}get reason(){return this[gS]}get wasClean(){return this[vS]}};Object.defineProperty(yr.prototype,"code",{enumerable:!0});Object.defineProperty(yr.prototype,"reason",{enumerable:!0});Object.defineProperty(yr.prototype,"wasClean",{enumerable:!0});var Co=class extends Sn{constructor(t,r={}){super(t),this[mS]=r.error===void 0?null:r.error,this[fS]=r.message===void 0?"":r.message}get error(){return this[mS]}get message(){return this[fS]}};Object.defineProperty(Co.prototype,"error",{enumerable:!0});Object.defineProperty(Co.prototype,"message",{enumerable:!0});var Hi=class extends Sn{constructor(t,r={}){super(t),this[pS]=r.data===void 0?null:r.data}get data(){return this[pS]}};Object.defineProperty(Hi.prototype,"data",{enumerable:!0});var jN={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[Bi]&&n[oh]===t&&!n[Bi])return;let o;if(e==="message")o=function(i,a){let s=new Hi("message",{data:a?i:i.toString()});s[Po]=this,nl(t,this,s)};else if(e==="close")o=function(i,a){let s=new yr("close",{code:i,reason:a.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});s[Po]=this,nl(t,this,s)};else if(e==="error")o=function(i){let a=new Co("error",{error:i,message:i.message});a[Po]=this,nl(t,this,a)};else if(e==="open")o=function(){let i=new Sn("open");i[Po]=this,nl(t,this,i)};else return;o[Bi]=!!r[Bi],o[oh]=t,r.once?this.once(e,o):this.on(e,o)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[oh]===t&&!r[Bi]){this.removeListener(e,r);break}}};yS.exports={CloseEvent:yr,ErrorEvent:Co,Event:Sn,EventTarget:jN,MessageEvent:Hi};function nl(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var rl=q((dW,xS)=>{"use strict";var{tokenChars:Zi}=Io();function Wt(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function FN(e){let t=Object.create(null),r=Object.create(null),o=!1,n=!1,i=!1,a,s,l=-1,u=-1,d=-1,p=0;for(;p<e.length;p++)if(u=e.charCodeAt(p),a===void 0)if(d===-1&&Zi[u]===1)l===-1&&(l=p);else if(p!==0&&(u===32||u===9))d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let f=e.slice(l,d);u===44?(Wt(t,f,r),r=Object.create(null)):a=f,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(s===void 0)if(d===-1&&Zi[u]===1)l===-1&&(l=p);else if(u===32||u===9)d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p),Wt(r,e.slice(l,d),!0),u===44&&(Wt(t,a,r),r=Object.create(null),a=void 0),l=d=-1}else if(u===61&&l!==-1&&d===-1)s=e.slice(l,p),l=d=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(n){if(Zi[u]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1?l=p:o||(o=!0),n=!1}else if(i)if(Zi[u]===1)l===-1&&(l=p);else if(u===34&&l!==-1)i=!1,d=p;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(u===34&&e.charCodeAt(p-1)===61)i=!0;else if(d===-1&&Zi[u]===1)l===-1&&(l=p);else if(l!==-1&&(u===32||u===9))d===-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let f=e.slice(l,d);o&&(f=f.replace(/\\/g,""),o=!1),Wt(r,s,f),u===44&&(Wt(t,a,r),r=Object.create(null),a=void 0),s=void 0,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(l===-1||i||u===32||u===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=p);let m=e.slice(l,d);return a===void 0?Wt(t,m,r):(s===void 0?Wt(r,m,!0):o?Wt(r,s,m.replace(/\\/g,"")):Wt(r,s,m),Wt(t,a,r)),t}function MN(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(o=>[t].concat(Object.keys(o).map(n=>{let i=o[n];return Array.isArray(i)||(i=[i]),i.map(a=>a===!0?n:`${n}=${a}`).join("; ")})).join("; ")).join(", ")}).join(", ")}xS.exports={format:MN,parse:FN}});var sl=q((fW,RS)=>{"use strict";var BN=te("events"),HN=te("https"),ZN=te("http"),SS=te("net"),GN=te("tls"),{randomBytes:WN,createHash:VN}=te("crypto"),{Duplex:pW,Readable:mW}=te("stream"),{URL:ih}=te("url"),Wn=$o(),JN=eh(),qN=rh(),{isBlob:KN}=Io(),{BINARY_TYPES:kS,CLOSE_TIMEOUT:XN,EMPTY_BUFFER:ol,GUID:YN,kForOnEventAttribute:ah,kListener:QN,kStatusCode:eL,kWebSocket:Ae,NOOP:_S}=kn(),{EventTarget:{addEventListener:tL,removeEventListener:nL}}=bS(),{format:rL,parse:oL}=rl(),{toBuffer:iL}=Fi(),$S=Symbol("kAborted"),sh=[8,13],_n=["CONNECTING","OPEN","CLOSING","CLOSED"],aL=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,fe=class e extends BN{constructor(t,r,o){super(),this._binaryType=kS[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ol,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(o=r,r=[]):r=[r]),IS(this,t,r,o)):(this._autoPong=o.autoPong,this._closeTimeout=o.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){kS.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,o){let n=new JN({allowSynchronousEvents:o.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation}),i=new qN(t,this._extensions,o.generateMask);this._receiver=n,this._sender=i,this._socket=t,n[Ae]=this,i[Ae]=this,t[Ae]=this,n.on("conclude",lL),n.on("drain",uL),n.on("error",dL),n.on("message",pL),n.on("ping",mL),n.on("pong",fL),i.onerror=gL,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",PS),t.on("data",al),t.on("end",CS),t.on("error",TS),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Wn.extensionName]&&this._extensions[Wn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){lt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,o=>{o||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ES(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ch(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||ol,r,o)}pong(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ch(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||ol,r,o)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(o=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ch(this,t,o);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Wn.extensionName]||(n.compress=!1),this._sender.send(t||ol,n,o)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){lt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(fe,"CONNECTING",{enumerable:!0,value:_n.indexOf("CONNECTING")});Object.defineProperty(fe.prototype,"CONNECTING",{enumerable:!0,value:_n.indexOf("CONNECTING")});Object.defineProperty(fe,"OPEN",{enumerable:!0,value:_n.indexOf("OPEN")});Object.defineProperty(fe.prototype,"OPEN",{enumerable:!0,value:_n.indexOf("OPEN")});Object.defineProperty(fe,"CLOSING",{enumerable:!0,value:_n.indexOf("CLOSING")});Object.defineProperty(fe.prototype,"CLOSING",{enumerable:!0,value:_n.indexOf("CLOSING")});Object.defineProperty(fe,"CLOSED",{enumerable:!0,value:_n.indexOf("CLOSED")});Object.defineProperty(fe.prototype,"CLOSED",{enumerable:!0,value:_n.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(fe.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(fe.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[ah])return t[QN];return null},set(t){for(let r of this.listeners(e))if(r[ah]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[ah]:!0})}})});fe.prototype.addEventListener=tL;fe.prototype.removeEventListener=nL;RS.exports=fe;function IS(e,t,r,o){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:XN,protocolVersion:sh[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...o,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!sh.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${sh.join(", ")})`);let i;if(t instanceof ih)i=t;else try{i=new ih(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),e._url=i.href;let a=i.protocol==="wss:",s=i.protocol==="ws+unix:",l;if(i.protocol!=="ws:"&&!a&&!s?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:s&&!i.pathname?l="The URL's pathname is empty":i.hash&&(l="The URL contains a fragment identifier"),l){let y=new SyntaxError(l);if(e._redirects===0)throw y;il(e,y);return}let u=a?443:80,d=WN(16).toString("base64"),p=a?HN.request:ZN.request,m=new Set,f;if(n.createConnection=n.createConnection||(a?cL:sL),n.defaultPort=n.defaultPort||u,n.port=i.port||u,n.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket"},n.path=i.pathname+i.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(f=new Wn({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=rL({[Wn.extensionName]:f.offer()})),r.length){for(let y of r){if(typeof y!="string"||!aL.test(y)||m.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(y)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(i.username||i.password)&&(n.auth=`${i.username}:${i.password}`),s){let y=n.path.split(":");n.socketPath=y[0],n.path=y[1]}let g;if(n.followRedirects){if(e._redirects===0){e._originalIpc=s,e._originalSecure=a,e._originalHostOrSocketPath=s?n.socketPath:i.host;let y=o&&o.headers;if(o={...o,headers:{}},y)for(let[k,_]of Object.entries(y))o.headers[k.toLowerCase()]=_}else if(e.listenerCount("redirect")===0){let y=s?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:i.host===e._originalHostOrSocketPath;(!y||e._originalSecure&&!a)&&(delete n.headers.authorization,delete n.headers.cookie,y||delete n.headers.host,n.auth=void 0)}n.auth&&!o.headers.authorization&&(o.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),g=e._req=p(n),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=p(n);n.timeout&&g.on("timeout",()=>{lt(e,g,"Opening handshake has timed out")}),g.on("error",y=>{g===null||g[$S]||(g=e._req=null,il(e,y))}),g.on("response",y=>{let k=y.headers.location,_=y.statusCode;if(k&&n.followRedirects&&_>=300&&_<400){if(++e._redirects>n.maxRedirects){lt(e,g,"Maximum redirects exceeded");return}g.abort();let P;try{P=new ih(k,t)}catch{let E=new SyntaxError(`Invalid URL: ${k}`);il(e,E);return}IS(e,P,r,o)}else e.emit("unexpected-response",g,y)||lt(e,g,`Unexpected server response: ${y.statusCode}`)}),g.on("upgrade",(y,k,_)=>{if(e.emit("upgrade",y),e.readyState!==fe.CONNECTING)return;g=e._req=null;let P=y.headers.upgrade;if(P===void 0||P.toLowerCase()!=="websocket"){lt(e,k,"Invalid Upgrade header");return}let C=VN("sha1").update(d+YN).digest("base64");if(y.headers["sec-websocket-accept"]!==C){lt(e,k,"Invalid Sec-WebSocket-Accept header");return}let E=y.headers["sec-websocket-protocol"],D;if(E!==void 0?m.size?m.has(E)||(D="Server sent an invalid subprotocol"):D="Server sent a subprotocol but none was requested":m.size&&(D="Server sent no subprotocol"),D){lt(e,k,D);return}E&&(e._protocol=E);let G=y.headers["sec-websocket-extensions"];if(G!==void 0){if(!f){lt(e,k,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ae;try{ae=oL(G)}catch{lt(e,k,"Invalid Sec-WebSocket-Extensions header");return}let X=Object.keys(ae);if(X.length!==1||X[0]!==Wn.extensionName){lt(e,k,"Server indicated an extension that was not requested");return}try{f.accept(ae[Wn.extensionName])}catch{lt(e,k,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Wn.extensionName]=f}e.setSocket(k,_,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(g,e):g.end()}function il(e,t){e._readyState=fe.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function sL(e){return e.path=e.socketPath,SS.connect(e)}function cL(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=SS.isIP(e.host)?"":e.host),GN.connect(e)}function lt(e,t,r){e._readyState=fe.CLOSING;let o=new Error(r);Error.captureStackTrace(o,lt),t.setHeader?(t[$S]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(il,e,o)):(t.destroy(o),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function ch(e,t,r){if(t){let o=KN(t)?t.size:iL(t).length;e._socket?e._sender._bufferedBytes+=o:e._bufferedAmount+=o}if(r){let o=new Error(`WebSocket is not open: readyState ${e.readyState} (${_n[e.readyState]})`);process.nextTick(r,o)}}function lL(e,t){let r=this[Ae];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Ae]!==void 0&&(r._socket.removeListener("data",al),process.nextTick(AS,r._socket),e===1005?r.close():r.close(e,t))}function uL(){let e=this[Ae];e.isPaused||e._socket.resume()}function dL(e){let t=this[Ae];t._socket[Ae]!==void 0&&(t._socket.removeListener("data",al),process.nextTick(AS,t._socket),t.close(e[eL])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function wS(){this[Ae].emitClose()}function pL(e,t){this[Ae].emit("message",e,t)}function mL(e){let t=this[Ae];t._autoPong&&t.pong(e,!this._isServer,_S),t.emit("ping",e)}function fL(e){this[Ae].emit("pong",e)}function AS(e){e.resume()}function gL(e){let t=this[Ae];t.readyState!==fe.CLOSED&&(t.readyState===fe.OPEN&&(t._readyState=fe.CLOSING,ES(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function ES(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function PS(){let e=this[Ae];if(this.removeListener("close",PS),this.removeListener("data",al),this.removeListener("end",CS),e._readyState=fe.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Ae]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",wS),e._receiver.on("finish",wS))}function al(e){this[Ae]._receiver.write(e)||this.pause()}function CS(){let e=this[Ae];e._readyState=fe.CLOSING,e._receiver.end(),this.end()}function TS(){let e=this[Ae];this.removeListener("error",TS),this.on("error",_S),e&&(e._readyState=fe.CLOSING,this.destroy())}});var LS=q((hW,NS)=>{"use strict";var gW=sl(),{Duplex:hL}=te("stream");function OS(e){e.emit("close")}function vL(){!this.destroyed&&this._writableState.finished&&this.destroy()}function DS(e){this.removeListener("error",DS),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function yL(e,t){let r=!0,o=new hL({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(i,a){let s=!a&&o._readableState.objectMode?i.toString():i;o.push(s)||e.pause()}),e.once("error",function(i){o.destroyed||(r=!1,o.destroy(i))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(n,i){if(e.readyState===e.CLOSED){i(n),process.nextTick(OS,o);return}let a=!1;e.once("error",function(l){a=!0,i(l)}),e.once("close",function(){a||i(n),process.nextTick(OS,o)}),r&&e.terminate()},o._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},o._read=function(){e.isPaused&&e.resume()},o._write=function(n,i,a){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(n,i,a)});return}e.send(n,a)},o.on("end",vL),o.on("error",DS),o}NS.exports=yL});var lh=q((vW,US)=>{"use strict";var{tokenChars:bL}=Io();function xL(e){let t=new Set,r=-1,o=-1,n=0;for(n;n<e.length;n++){let a=e.charCodeAt(n);if(o===-1&&bL[a]===1)r===-1&&(r=n);else if(n!==0&&(a===32||a===9))o===-1&&r!==-1&&(o=n);else if(a===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);o===-1&&(o=n);let s=e.slice(r,o);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);t.add(s),r=o=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||o!==-1)throw new SyntaxError("Unexpected end of input");let i=e.slice(r,n);if(t.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return t.add(i),t}US.exports={parse:xL}});var ZS=q((bW,HS)=>{"use strict";var kL=te("events"),cl=te("http"),{Duplex:yW}=te("stream"),{createHash:wL}=te("crypto"),zS=rl(),br=$o(),SL=lh(),_L=sl(),{CLOSE_TIMEOUT:$L,GUID:IL,kWebSocket:AL}=kn(),EL=/^[+/0-9A-Za-z]{22}==$/,jS=0,FS=1,BS=2,uh=class extends kL{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:$L,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:_L,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=cl.createServer((o,n)=>{let i=cl.STATUS_CODES[426];n.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),n.end(i)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let o=this.emit.bind(this,"connection");this._removeListeners=PL(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,i,a)=>{this.handleUpgrade(n,i,a,o)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=jS}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===BS){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Gi,this);return}if(t&&this.once("close",t),this._state!==FS)if(this._state=FS,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Gi,this):process.nextTick(Gi,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Gi(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,o,n){r.on("error",MS);let i=t.headers["sec-websocket-key"],a=t.headers.upgrade,s=+t.headers["sec-websocket-version"];if(t.method!=="GET"){xr(this,t,r,405,"Invalid HTTP method");return}if(a===void 0||a.toLowerCase()!=="websocket"){xr(this,t,r,400,"Invalid Upgrade header");return}if(i===void 0||!EL.test(i)){xr(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(s!==13&&s!==8){xr(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){Wi(r,400);return}let l=t.headers["sec-websocket-protocol"],u=new Set;if(l!==void 0)try{u=SL.parse(l)}catch{xr(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&d!==void 0){let m=new br({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=zS.parse(d);f[br.extensionName]&&(m.accept(f[br.extensionName]),p[br.extensionName]=m)}catch{xr(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${s===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(f,g,y,k)=>{if(!f)return Wi(r,g||401,y,k);this.completeUpgrade(p,i,u,t,r,o,n)});return}if(!this.options.verifyClient(m))return Wi(r,401)}this.completeUpgrade(p,i,u,t,r,o,n)}completeUpgrade(t,r,o,n,i,a,s){if(!i.readable||!i.writable)return i.destroy();if(i[AL])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>jS)return Wi(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${wL("sha1").update(r+IL).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(o.size){let p=this.options.handleProtocols?this.options.handleProtocols(o,n):o.values().next().value;p&&(u.push(`Sec-WebSocket-Protocol: ${p}`),d._protocol=p)}if(t[br.extensionName]){let p=t[br.extensionName].params,m=zS.format({[br.extensionName]:[p]});u.push(`Sec-WebSocket-Extensions: ${m}`),d._extensions=t}this.emit("headers",u,n),i.write(u.concat(`\r
5
+ `).join(`\r
6
+ `)),i.removeListener("error",MS),d.setSocket(i,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Gi,this)})),s(d,n)}};HS.exports=uh;function PL(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let o of Object.keys(t))e.removeListener(o,t[o])}}function Gi(e){e._state=BS,e.emit("close")}function MS(){this.destroy()}function Wi(e,t,r,o){r=r||cl.STATUS_CODES[t],o={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...o},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${cl.STATUS_CODES[t]}\r
7
+ `+Object.keys(o).map(n=>`${n}: ${o[n]}`).join(`\r
8
+ `)+`\r
9
+ \r
10
+ `+r)}function xr(e,t,r,o,n,i){if(e.listenerCount("wsClientError")){let a=new Error(n);Error.captureStackTrace(a,xr),e.emit("wsClientError",a,r,t)}else Wi(r,o,n,i)}});import{createHash as VA}from"node:crypto";import{chmodSync as Xv,mkdirSync as JA,readFileSync as qA,renameSync as KA,rmSync as Yv,writeFileSync as Qv}from"node:fs";import XA from"node:os";import Ue from"node:path";import J_ from"node:os";import q_ from"node:path";var W=process.env.BRIDGE_SECRET_DIR||q_.join(J_.homedir(),".claude-bridge");import{existsSync as s$,readdirSync as c$,readFileSync as l$}from"node:fs";import u$ from"node:os";import wr from"node:path";import{createHash as r$}from"node:crypto";import{readFileSync as wh,rmSync as o$}from"node:fs";import Vn from"node:path";import{mkdirSync as K_,readFileSync as X_,renameSync as Y_,rmSync as Q_,writeFileSync as e$}from"node:fs";import t$ from"node:path";function n$(e){return[...new Set(e.split(`
11
+ `).map(t=>t.trim()).filter(Boolean))]}function gl(e){try{return n$(X_(e,"utf8"))}catch{return[]}}function xh(e){let t=r=>{try{if(r.length===0){Q_(e,{force:!0});return}K_(t$.dirname(e),{recursive:!0,mode:448});let o=`${e}.tmp`;e$(o,`${r.join(`
12
+ `)}
13
+ `,{mode:384}),Y_(o,e)}catch{}};return{add(r){let o=gl(e);o.includes(r)||t([...o,r])},remove(r){let o=gl(e);o.includes(r)&&t(o.filter(n=>n!==r))}}}function kh(e,t){if(!t)return 0;let r=0;for(let o of gl(e))try{t.delete(o),r++}catch{}return r}var i$=/^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$/;function ut(e){return i$.test(e)&&!e.includes("..")?e:`h_${r$("sha256").update(e,"utf8").digest("hex").slice(0,24)}`}function ea(e){return Vn.join(W,"users",e)}function Ze(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.sub=="string"&&t.sub?t.sub:null}catch{return null}}var Lo=Vn.join(W,"active-user.json");function Sh(){try{let e=JSON.parse(wh(Lo,"utf8"));return typeof e.sub=="string"&&e.sub?e.sub:null}catch{return null}}var a$="layout-version.json";function Kt(){try{let e=JSON.parse(wh(Vn.join(W,a$),"utf8"));return typeof e.version=="number"&&Number.isFinite(e.version)?e.version:0}catch{return 0}}var Xt=3;function _h(e){if(!e||e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0"))throw new Error(`unsafe credential segment: ${JSON.stringify(e)}`)}function yt(e){_h(e);let t=ea(e);return{accessFile:Vn.join(t,"relay-access-token"),refreshFile:Vn.join(t,"relay-refresh-token")}}function hl(e,t){_h(e);let r=Vn.join(ea(e),"providers"),o=kh(Vn.join(r,".keyring-index"),t??null);return o$(r,{recursive:!0,force:!0}),o}var vl=e=>{try{return l$(e,"utf8").trim()||null}catch{return null}},Jn="hub-endpoint.json",d$=24,p$=new Set(["public","default","default user","all users","defaultapppool","administrator"]);function yl(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t?.pid!="number"||typeof t?.port!="number"?null:{pid:t.pid,port:t.port,startedAt:typeof t.startedAt=="number"?t.startedAt:0,...typeof t.sub=="string"&&t.sub?{sub:t.sub}:{}}}catch{return null}}function m$(e){let o=e.readFile("/etc/wsl.conf")?.match(/^\s*root\s*=\s*(\S+)\s*$/m)?.[1]??"/mnt";return o.length>1&&o.endsWith("/")?o.slice(0,-1):o}function bl(e){let t=[],r=n=>{t.length<d$&&!t.includes(n)&&t.push(n)},o=n=>!p$.has(n.toLowerCase());if(e.isWsl){let n=m$(e);for(let i of e.listDir(n).filter(a=>/^[a-zA-Z]$/.test(a))){let a=`${n}/${i}/Users`;o(e.userName)&&r(`${a}/${e.userName}`);for(let s of e.listDir(a))o(s)&&r(`${a}/${s}`)}return t}if(e.platform==="win32")for(let n of["\\\\wsl.localhost","\\\\wsl$"])for(let i of e.listDir(`${n}\\`)){let a=`${n}\\${i}\\home`;r(`${a}\\${e.userName}`);for(let s of e.listDir(a))r(`${a}\\${s}`)}return t}function f$(e){let t=e.isWsl?"/":"\\";return bl(e).map(r=>`${r}${t}.claude-bridge`)}function g$(e){let t=i=>yl(e.readFile(i.endsWith("\\")||i.endsWith("/")?`${i}${Jn}`:`${i}${e.platform==="win32"?"\\":"/"}${Jn}`)),r=e.env.BRIDGE_SECRET_DIR;if(r)return{dir:r,source:"env",beacon:t(r)};let o=t(e.secretDir);if(o&&e.pidAlive(o.pid))return{dir:e.secretDir,source:"local",beacon:o};let n=null;for(let i of f$(e)){let a=t(i);a&&(!n||a.startedAt>n.beacon.startedAt)&&(n={dir:i,beacon:a})}return n?{dir:n.dir,source:e.isWsl?"peer-wsl":"peer-windows",beacon:n.beacon}:{dir:e.secretDir,source:"local",beacon:null}}function $h(e,t,r){return t!=="linux"?!1:e.WSL_DISTRO_NAME||e.WSL_INTEROP?!0:/microsoft/i.test(r("/proc/version")??"")}function na(){return $h(process.env,process.platform,vl)}var ta=null;function Sr(e={}){if(ta&&!e.fresh)return ta;let t=n=>vl(n),r=n=>{try{return c$(n)}catch{return[]}},o="";try{o=u$.userInfo().username}catch{o=process.env.USER??process.env.USERNAME??""}return ta=g$({secretDir:W,env:process.env,platform:process.platform,userName:o,isWsl:$h(process.env,process.platform,t),pidAlive:n=>{try{return process.kill(n,0),!0}catch(i){return i.code==="EPERM"}},readFile:t,listDir:r}),ta}function Ih(e){return{hubTokenFile:wr.join(e,"hub-token"),activeUserFile:wr.join(e,"active-user.json"),sessionsDir:wr.join(e,"sessions"),configFile:wr.join(e,"config.json"),beaconFile:wr.join(e,Jn)}}function h$(e){let t=vl(Ih(e).activeUserFile);if(!t)return null;try{let r=JSON.parse(t);return typeof r.sub=="string"&&r.sub?r.sub:null}catch{return null}}function Ah(e){let t=h$(e);if(t){let r=wr.join(e,"users",ut(t),"hub-token");if(s$(r))return r}return Ih(e).hubTokenFile}function ra(e){if(e?.isDevBuild!==!0)return!1;let t=e.env??process.env;return t.BRIDGE_VOICE==="1"||t.BRIDGE_VOICE==="true"}var hz=256*1024;import{readFileSync as v$}from"node:fs";import Uo from"node:path";var y$=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function xl(e){if(typeof e!="string")return{kind:"invalid"};let t=y$.exec(e);return t?t[1]==="0"&&t[2]==="0"&&t[3]==="0"?{kind:"dev"}:{kind:"release",version:e}:{kind:"invalid"}}function Eh(e){let t=xl(e);return t.kind==="release"?t.version:null}function Ct(e=process.env,t=process.argv){let r=xl(e.BRIDGE_CLIENT_VERSION);if(r.kind==="release")return r.version;if(r.kind==="dev")return null;let o=Uo.join(W,"payload"),n=t[1];if(!n)return null;let i=Uo.relative(o,Uo.resolve(n));if(i===""||i.startsWith("..")||Uo.isAbsolute(i))return null;try{let a=JSON.parse(v$(Uo.join(o,"version.json"),"utf8")),s=xl(a.version);return s.kind==="release"?s.version:null}catch{return null}}import{readdirSync as b$}from"node:fs";import x$ from"node:path";var qn=class extends Error{constructor(r,o){super(r);this.status=o;this.name="RelayError"}status},k$=e=>e.replace(/\/+$/,"");async function kl(e,t,r,o){return fetch(`${k$(e)}${t}`,{method:"POST",headers:{"content-type":"application/json",...o?{authorization:`Bearer ${o}`}:{}},body:r===void 0?void 0:JSON.stringify(r)})}async function Ph(e,t){let r=await kl(e,"/node/provision",{},t);if(!r.ok)throw new qn(`provision failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);let o=await r.json().catch(()=>({}));if(typeof o.claim_code!="string")throw new qn("provision returned no claim_code",r.status);return o.claim_code}async function Ch(e,t){let r=await kl(e,"/node/claim",{claim_code:t});if(!r.ok)throw new qn(`pairing failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);return await r.json()}async function w$(e,t){let r=await kl(e,"/node/token",void 0,t);if(!r.ok)throw new qn(`refresh rejected (${r.status})`,r.status);return await r.json()}function zo(e,t={}){let r=t.log??(l=>console.warn(l)),o=Ze(e.refresh_token),n=Ze(e.access_token),i=o??n;if(o&&n&&o!==n&&r(`credential: access-token sub (${n}) differs from refresh-token sub (${o}) \u2014 trusting the refresh sub (the refresh loop re-mints the access token)`),!i)throw new Error("credential: refusing to persist an unattributable token pair (no decodable sub in refresh or access token)");let a=ut(i),s=yt(a);return ge(s.refreshFile,e.refresh_token),ge(s.accessFile,e.access_token),{sub:i,segment:a}}var S$="__none__";function he(){let e=Sh();if(e)return yt(ut(e));let[t,r]=dt();return t&&!r?yt(t.segment):yt(S$)}function Th(e){let t;try{t=b$(x$.join(W,"users"),{withFileTypes:!0})}catch{return[]}let r=[];for(let o of t){if(!o.isDirectory())continue;let n;try{n=yt(o.name)}catch{continue}let i=O(n.refreshFile),a=i?Ze(i):null;if(e){if(!a)continue;r.push({sub:a,segment:o.name});continue}let s=a?null:O(n.accessFile),l=a??(s?Ze(s):null);l&&r.push({sub:l,segment:o.name})}return r}function dt(){return Th(!1)}function oa(){return Th(!0)}function _$(e=he()){return O(e.refreshFile)}function jo(e=he()){ue(e.accessFile),ue(e.refreshFile)}function $$(e=he()){let t=O(e.accessFile);if(!t)return null;try{let r=JSON.parse(Buffer.from(t.split(".")[1]??"","base64url").toString());return typeof r.exp=="number"?r.exp-Math.floor(Date.now()/1e3):null}catch{return null}}async function Tt(e,t=60,r,o=he()){let n=$$(o);if(n!==null&&n>t)return!0;let i=_$(o);if(!i)return n!==null&&n>0;try{return zo(await w$(e,i)),!0}catch(a){return r?.(`token refresh failed: ${a instanceof Error?a.message:String(a)}`),a instanceof qn&&(a.status===400||a.status===401)&&jo(o),!1}}function wl(e){return e==="node_superseded"?"This machine was unpaired when AC Bridge was set up on another computer \u2014 only one machine can be paired at a time. Run `acbridge pair` here to take the pairing back.":e==="node_revoked"?"This machine's pairing has been revoked. Run `acbridge pair` to set it up again.":null}import Sl from"node:path";function _l(e){if(!e)return!1;try{return e.available()}catch{return!1}}function $l(e){return _l(e)?"keyring":"file"}function I$(e){let{file:t,account:r}=e,o=()=>O(t);return{backend(){return $l(e.keyring)},read(){if(_l(e.keyring))try{let n=e.keyring.get(r);if(n!==null)return n;let i=o();if(i===null)return null;try{e.keyring.set(r,i),ue(t),e.index?.add(r)}catch{}return i}catch{}return o()},write(n){if(_l(e.keyring))try{e.keyring.set(r,n),ue(t),e.index?.add(r);return}catch{}ge(t,n,384)},delete(){if(e.keyring){try{e.keyring.delete(r)}catch{}e.index?.remove(r)}ue(t)}}}function _r(e,t,r){let o=e.providerSecretFile(t,r);return I$({keyring:Fo(),file:o,account:`${t}/${r}`,index:xh(Sl.join(Sl.dirname(Sl.dirname(o)),".keyring-index"))})}var A$="AC Bridge",In,E$=new Set(["win32","darwin"]);function Fo(e={}){if(In!==void 0)return In;In=null;let t=e.require??null;if(!E$.has(e.platform??process.platform))return In;try{let r=t??P$();if(!r)return In;let{Entry:o}=r("@napi-rs/keyring"),n=i=>new o(A$,i);In={available(){try{return n("__acb_probe__").getPassword(),!0}catch{return!1}},get:i=>n(i).getPassword(),set:(i,a)=>n(i).setPassword(a),delete:i=>{n(i).deletePassword()}}}catch{In=null}return In}function P$(){try{return typeof te=="function"?te:null}catch{return null}}import{spawnSync as C$}from"node:child_process";import{existsSync as T$}from"node:fs";import R$ from"node:os";import Rh from"node:path";function ia(e){if(e==="win32"){let r="irm https://claude.ai/install.ps1 | iex";return{file:"powershell",args:["-NoProfile","-ExecutionPolicy","Bypass","-Command",r],manualCommand:r,altCommands:["winget install Anthropic.ClaudeCode"]}}let t="curl -fsSL https://claude.ai/install.sh | bash";return{file:"sh",args:["-c",t],manualCommand:t,altCommands:[]}}function Oh(e,t){if(e==="win32"){let o=Rh.win32;return[o.join(t,".local","bin","claude.exe"),o.join(t,".claude","local","claude.exe")]}let r=Rh.posix;return[r.join(t,".local","bin","claude"),r.join(t,".claude","local","claude"),"/opt/homebrew/bin/claude","/usr/local/bin/claude"]}var Dh=/\.(cmd|bat)$/i,O$=/^\/mnt\/[a-z]\//i;function Nh(e){let t=e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(a=>!O$.test(a)),o=r.length>0?r:t,n=o.find(a=>/\.exe$/i.test(a));if(n)return n;let i=o.find(a=>Dh.test(a));return i||(o[0]??null)}function aa(e){return Dh.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function Lh(e){let r=C$(e,e==="which"?["-a","claude"]:["claude"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function Uh(e,t){let r=t.home??R$.homedir(),o=t.fileExists??T$;for(let n of Oh(e,r))if(o(n))return n;return null}function An(e,t={}){let r=e?.trim();if(r)return aa(r);let o=t.platform??process.platform,n=t.runFinder??Lh,i=o==="win32"?"where":"which";try{let s=n(i);if(s.status===0){let l=Nh(s.stdout);if(l)return aa(l)}}catch{}let a=Uh(o,t);return aa(a||"claude")}function zh(e,t={}){if(e?.trim())return!0;let r=t.platform??process.platform,o=t.runFinder??Lh;try{let n=o(r==="win32"?"where":"which");if(n.status===0&&Nh(n.stdout)!==null)return!0}catch{}return Uh(r,t)!==null}import{spawnSync as D$}from"node:child_process";import{existsSync as jh,readdirSync as N$}from"node:fs";import Fh from"node:os";import ca from"node:path";var Mh=/\.(cmd|bat)$/i,L$=/^\/mnt\/[a-z]\//i;function U$(e){let t=e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(a=>!L$.test(a)),o=r.length>0?r:t,n=o.find(a=>/\.exe$/i.test(a));if(n)return n;let i=o.find(a=>Mh.test(a));return i||(o[0]??null)}function sa(e){return Mh.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function z$(e,t,r=[]){if(e==="win32"){let n=ca.win32;return[n.join(t,"AppData","Roaming","npm","codex.cmd"),n.join(t,"AppData","Roaming","npm","codex.exe"),n.join(t,".local","bin","codex.exe")]}let o=ca.posix;return[...[...r].sort().reverse().map(n=>o.join(t,".nvm","versions","node",n,"bin","codex")),"/opt/homebrew/bin/codex","/usr/local/bin/codex",o.join(t,".local","bin","codex")]}function j$(e){try{return N$(ca.posix.join(e,".nvm","versions","node"))}catch{return[]}}function F$(e,t){let r=t.home??Fh.homedir(),o=t.fileExists??jh,n=e==="win32"?[]:(t.nodeVersions??j$)(r);for(let i of z$(e,r,n))if(o(i))return i;return null}function M$(e){let r=D$(e,e==="which"?["-a","codex"]:["codex"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function $r(e,t={}){let r=e?.trim();if(r)return sa(r);let o=t.platform??process.platform,n=t.runFinder??M$,i=o==="win32"?"where":"which";try{let s=n(i);if(s.status===0){let l=U$(s.stdout);if(l)return sa(l)}}catch{}let a=F$(o,t);return sa(a||"codex")}function la(e){let t=e?.home??Fh.homedir();return jh(ca.join(t,".codex","auth.json"))}import{spawnSync as B$}from"node:child_process";import{readFileSync as Bh}from"node:fs";import Hh from"node:path";function H$(e){try{let t=Number(Bh(e,"utf8").trim());return Number.isInteger(t)&&t>0?t:null}catch{return null}}function Z$(e){B$("pkill",["-f",e])}function G$(){try{return yl(Bh(Hh.join(W,Jn),"utf8"))?.pid??null}catch{return null}}function Zh(e={}){let t=e.platform??process.platform,r=e.pidFile??Mo,o=e.readPid??H$,n=e.readBeaconPid??G$,i=e.kill??(l=>process.kill(l)),a=e.sweep??Z$,s=o(r);if(s!==null&&n()===s)try{i(s)}catch{}if(t!=="win32"){for(let l of e.sweepPatterns??[])if(Hh.isAbsolute(l))try{a(l)}catch{}}}import{accessSync as W$,constants as V$,mkdtempSync as J$,readFileSync as q$,writeFileSync as Gh}from"node:fs";import K$ from"node:os";import ua from"node:path";var Ge="bridge",tt="alexa";function Kn(e=process.platform){switch(e){case"darwin":return"/Library/Application Support/ClaudeCode/managed-settings.json";case"win32":return"C:\\Program Files\\ClaudeCode\\managed-settings.json";default:return"/etc/claude-code/managed-settings.json"}}function Wh(e,t=!1){let r={...e};if(t){r.channelsEnabled=!0;let o={marketplace:Ge,plugin:tt},n=Array.isArray(e.allowedChannelPlugins)?[...e.allowedChannelPlugins]:[];n.some(i=>i.marketplace===o.marketplace&&i.plugin===o.plugin)||n.push(o),r.allowedChannelPlugins=n}return r}function Ir(e){return`'${e.replace(/'/g,"'\\''")}'`}function Ar(e){return`"${e}"`}function X$(e){return`'${e.replace(/'/g,"''")}'`}function Y$(e,t,r){return`mkdir -p ${Ir(e)} && install -m 0644 ${Ir(t)} ${Ir(r)}`}function Al(e,t){return(e==="win32"?ua.win32:ua.posix).dirname(t)}function Q$(e,t,r){let o=Al(e,r);return e==="win32"?`md ${Ar(o)} 2>nul & copy /y ${Ar(t)} ${Ar(r)}`:Y$(o,t,r)}function eI(e,t){return e==="darwin"?[{method:"osascript",file:"osascript",args:["-e",`do shell script "${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}" with administrator privileges`]}]:e==="win32"?[{method:"uac",file:"powershell",args:["-NoProfile","-Command",`Start-Process -Verb RunAs -Wait -FilePath cmd.exe -ArgumentList '/c',${X$(t)}`]}]:[{method:"pkexec",file:"pkexec",args:["sh","-c",t]},{method:"sudo",file:"sudo",args:["sh","-c",t]}]}function Vh(e,t,r){return eI(e,Q$(e,t,r))}function Jh(e,t,r){let o=Al(e,r);return e==="win32"?`md ${Ar(o)} & copy /y ${Ar(t)} ${Ar(r)}`:`sudo mkdir -p ${Ir(o)} && sudo install -m 0644 ${Ir(t)} ${Ir(r)}`}function tI(e){try{return q$(e,"utf8")}catch{return""}}function nI(e){try{return W$(e,V$.W_OK),!0}catch{return!1}}function rI(e,t){Gh(e,t,{mode:420})}function oI(e,t,r){let o=t(e),n={};try{n=JSON.parse(o)}catch{}let i=Wh(n,r),a=JSON.stringify(i,null,2)+`
14
+ `;return!r&&JSON.stringify(i)===JSON.stringify(n)?{existing:n,json:a,changed:!1}:{existing:n,json:a,changed:o.trim()!==a.trim()}}function qh(e){let t=e.platform??process.platform,r=e.settingsPath??Kn(t),o=e.readDest??tI,n=e.dirWritable??nI,i=e.writeDirect??rI,a=e.tmpDir??K$.tmpdir(),s=e.stage??(g=>{let y=J$(ua.join(a,"acbridge-")),k=ua.join(y,"managed-settings.json");return Gh(k,g,{mode:420}),k}),l=e.voice??!1,{existing:u,json:d,changed:p}=oI(r,o,l),m=l&&u.allowedChannelPlugins===void 0;if(!p)return{path:r,changed:!1,json:d,usedSudo:!1,method:"unchanged",replacedDefaultAllowlist:m};if(n(Al(t,r)))return i(r,d),{path:r,changed:!0,json:d,usedSudo:!1,method:"direct",replacedDefaultAllowlist:m};let f=s(d);for(let g of Vh(t,f,r))if(e.runElevated(g),o(r).trim()===d.trim())return{path:r,changed:!0,json:d,usedSudo:g.method==="sudo",method:g.method,replacedDefaultAllowlist:m};throw new Error(`could not write ${r} with elevation (canceled or unavailable). Run it manually:
15
+ ${Jh(t,f,r)}`)}var El={udpDstFixed:[4002,6666,6667],udpDstMulticast:[5353],udpSrcBroadcastReply:[9999,20002,38899,56700,1900,1982]},Pl=[...El.udpDstFixed,...El.udpDstMulticast],Cl=El.udpSrcBroadcastReply;function Kh(e){return e==="app"?"AC Bridge (App)":"AC Bridge (CLI)"}var Tl=["domain","private"],Xh="AC Bridge discovery",Yh="AC Bridge replies",iI="macOS will still show one 'Local Network' permission prompt on your first scan \u2014 that prompt cannot be pre-granted; click Allow.";function da(e){return/you need to be root|need(?:s)? to be root|must be run as root|requires? (?:super\s?user|root)|operation not permitted|permission denied|are you root/i.test(e)}function Bo(e,t,r={}){if(e==="win32")return"windows";let o=r.isWsl??na();if(e==="linux"&&o)return"wsl-host";if(e==="darwin"){let i=t.alfGlobalStateOut??"";return/firewall is enabled/i.test(i)||da(i)?"macos-alf":"none"}let n=t.ufwStatusOut??"";return/status:\s*active/i.test(n)?"ufw":(t.firewallCmdStateOut??"").trim()==="running"?"firewalld":da(n)?"ufw":"none"}function Rl(e,t){if(e==="win32")return{};if(e==="darwin")return{alfGlobalStateOut:t("/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate")};let r=t("ufw status");return/status:\s*active/i.test(r)?{ufwStatusOut:r}:{ufwStatusOut:r,firewallCmdStateOut:t("firewall-cmd --state")}}function aI(e,t){if(e.length===0)return{state:"nothing-to-do"};let r=e.map((a,s)=>e.length>1?`${t} (${s+1})`:t),n=e.map((a,s)=>{let l=r[s];return`netsh advfirewall firewall delete rule name="${l}" >nul 2>&1 & netsh advfirewall firewall add rule name="${l}" dir=in action=allow program="${a}" protocol=udp profile=${Tl.join(",")} remoteip=localsubnet enable=yes`}).join(" & "),i=r.map(a=>`netsh advfirewall firewall show rule name="${a}" verbose`);return{applyScript:n,checkCommands:i,evalCheck:a=>a.every((s,l)=>uI(s,e[l])),manualCommand:n,needsElevation:!0}}function sI(e){if(e.length===0)return{state:"nothing-to-do"};let t=e.flatMap(o=>[`/usr/libexec/ApplicationFirewall/socketfilterfw --add "${o}"`,`/usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "${o}"`]),r=e.map(o=>`/usr/libexec/ApplicationFirewall/socketfilterfw --getappblocked "${o}"`);return{applyScript:t.join(" && "),checkCommands:r,evalCheck:o=>o.every((n,i)=>pI(n,e[i])),manualCommand:t.map(o=>`sudo ${o}`).join(" && "),needsElevation:!0,userNote:iI}}function cI(){let e=Pl.join(","),t=Cl.join(","),r=`ufw allow in proto udp to any port ${e} comment '${Xh}'`,o=`ufw allow in proto udp from any port ${t} comment '${Yh}'`;return{applyScript:`${r} && ${o}`,checkCommands:["ufw status"],evalCheck:n=>mI(n[0]??""),manualCommand:`sudo ${r} && sudo ${o}`,needsElevation:!0}}function lI(){let e=Pl.map(o=>`firewall-cmd --permanent --add-port=${o}/udp`),t=Cl.map(o=>`firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source-port port="${o}" protocol="udp" accept'`),r=[...e,...t,"firewall-cmd --reload"];return{applyScript:r.join(" && "),checkCommands:["firewall-cmd --list-ports","firewall-cmd --list-rich-rules"],evalCheck:o=>fI(o[0]??"",Pl)&&gI(o[1]??"",Cl),manualCommand:r.map(o=>`sudo ${o}`).join(" && "),needsElevation:!0}}function Ol(e,t){switch(e){case"windows":return aI(t.programs,t.ruleName);case"macos-alf":return sI(t.programs);case"ufw":return cI();case"firewalld":return lI();case"wsl-host":return{state:"nothing-to-do"};case"none":return{state:"nothing-to-do"}}}var Dl="You're running inside WSL, so LAN device discovery is governed by the WINDOWS firewall on the host, not by ufw/firewalld inside this distro \u2014 changing those here has no effect on scanning. If scanning misses devices, allow the bridge through Windows Defender Firewall on the Windows side (and check that the network is set to Private, not Public).";function uI(e,t){if(/no rules match/i.test(e))return!1;let r=/Enabled:\s*Yes/i.test(e),n=/Program:\s*(.+)/i.exec(e)?.[1]?.trim().toLowerCase();return r&&n===t.trim().toLowerCase()}function Qh(e){let t=[],r=/^(Domain|Private|Public) Profile Settings:/gim,o,n=[];for(;(o=r.exec(e))!==null;)n.push({profile:o[1].toLowerCase(),at:o.index});for(let i=0;i<n.length;i++){let a=e.slice(n[i].at,n[i+1]?.at??e.length);t.push({profile:n[i].profile,firewallOn:!/^\s*State\s+OFF/im.test(a)})}return t}function dI(e,t=Tl){let r=new Set(t.map(o=>o.toLowerCase()));return e.filter(o=>o.firewallOn&&!r.has(o.profile)).map(o=>o.profile)}function ev(e,t){let r=t.toLowerCase(),o=new Set;for(let n of e.split(/^Rule Name:/m).slice(1)){let i=a=>new RegExp(`^${a}:\\s*(.*)$`,"m").exec(n)?.[1]?.trim()??"";if(i("Program").toLowerCase()===r&&/^yes$/i.test(i("Enabled"))&&/^in$/i.test(i("Direction"))&&/^allow$/i.test(i("Action")))for(let a of i("Profiles").split(",")){let s=a.trim().toLowerCase();(s==="domain"||s==="private"||s==="public")&&o.add(s)}}return[...o]}function tv(e,t=Tl){if(dI(e,t).length!==0)return"This network is set to Public, and the LAN-discovery rule only covers Domain and Private networks \u2014 so Windows is still dropping the replies device scanning needs. In Settings \u2192 Network & internet, open this network and set its profile to Private, then scan again."}function pI(e,t){return e.includes(t)&&/is not blocked/i.test(e)}function mI(e){return/status:\s*active/i.test(e)&&e.includes(Xh)&&e.includes(Yh)}function fI(e,t){return t.every(r=>e.includes(`${r}/udp`))}function gI(e,t){return t.every(r=>e.includes(`source-port port="${r}"`))}function nv(e){let{platform:t,programs:r,ruleName:o,runElevated:n,runCheck:i}=e,a=e.isWsl===void 0?{}:{isWsl:e.isWsl};if(Bo(t,{},a)==="wsl-host")return{backend:"wsl-host",status:"nothing-to-do",changed:!1,userNote:Dl};let l=Bo(t,Rl(t,i),a);if(l==="none")return{backend:l,status:"nothing-to-do",changed:!1};let u=Ol(l,{programs:r,ruleName:o});if("state"in u)return{backend:l,status:"nothing-to-do",changed:!1};let d=u.checkCommands.map(i);if(u.evalCheck(d))return{backend:l,status:"unchanged",changed:!1,userNote:u.userNote};let p=d.some(da);n(u.applyScript);let m=u.checkCommands.map(i);return u.evalCheck(m)?{backend:l,status:"changed",changed:!0,userNote:u.userNote}:p||m.some(da)?{backend:l,status:"changed",changed:!0,userNote:hI(u)}:{backend:l,status:"needs-elevation",changed:!1,manualCommand:u.manualCommand,userNote:u.userNote}}function hI(e){let t=`Added the LAN-discovery firewall rule, but couldn't verify it without root. If device scanning still misses devices, re-run: ${e.manualCommand}`;return e.userNote?`${e.userNote} ${t}`:t}import{spawnSync as vI}from"node:child_process";import{existsSync as yI,readFileSync as pa,readdirSync as bI}from"node:fs";import{homedir as xI}from"node:os";import{join as bt,resolve as kI}from"node:path";var ov=()=>bt(xI(),".claude","plugins"),rv=e=>{let t=kI(e).replace(/[/\\]+$/,"");return process.platform==="win32"||process.platform==="darwin"?t.toLowerCase():t};function wI(){try{let t=JSON.parse(pa(bt(ov(),"known_marketplaces.json"),"utf8"))?.[Ge]?.source;return typeof t?.path=="string"?t.path:null}catch{return null}}function iv(){try{let t=JSON.parse(pa(bt(ov(),"installed_plugins.json"),"utf8"))?.plugins?.[`${tt}@${Ge}`]?.[0];return typeof t?.installPath=="string"?t.installPath:null}catch{return null}}var Nl=(e,t)=>{try{return pa(e,"utf8")===pa(t,"utf8")}catch{return!1}};function SI(){return["hooks/hooks.json",".mcp.json"]}function _I(e){let t=iv();if(!t)return!1;let r=bt(e,"plugins",tt);for(let i of SI())if(!Nl(bt(r,i),bt(t,i)))return!1;let o=bt(r,"dist","channel.mjs");if(yI(o)&&!Nl(o,bt(t,"dist","channel.mjs")))return!1;let n;try{n=bI(bt(r,"scripts"))}catch{return!1}return n.every(i=>Nl(bt(r,"scripts",i),bt(t,"scripts",i)))}function av(e){let{marketplaceDir:t,claudeCmd:r}=e,o=s=>{let l=vI(r.file,[...r.argsPrefix,...s],{encoding:"utf8"});return{ok:l.status===0,out:`${l.stdout??""}${l.stderr??""}${l.error?l.error.message:""}`}},n=wI(),i=!1;if(n===null||rv(n)!==rv(t)){n!==null&&o(["plugin","marketplace","remove",Ge]);let s=o(["plugin","marketplace","add",t]);if(!s.ok)throw new Error(`marketplace add failed:
16
+ ${s.out}`);i=!0}let a=!1;if(i||!_I(t)){o(["plugin","marketplace","update",Ge]),iv()!==null&&o(["plugin","uninstall",`${tt}@${Ge}`]);let s=o(["plugin","install",`${tt}@${Ge}`]);if(!s.ok)throw new Error(`plugin install failed:
17
+ ${s.out}`);a=!0}return{marketplaceRepointed:i,pluginReinstalled:a}}import{mkdirSync as $I,readFileSync as lv,writeFileSync as II}from"node:fs";import AI from"node:os";import Ll from"node:path";function uv(e,t="node"){return`${t} "${Ll.join(e,"plugins","alexa","scripts","statusline.mjs")}"`}function dv(){return Ll.join(AI.homedir(),".claude","settings.json")}var pv=e=>{let t=e.statusLine,r=t&&typeof t=="object"?t.command:void 0;return typeof r=="string"&&r?r:void 0},EI="plugins/alexa/scripts/statusline.mjs",PI="plugins\\alexa\\scripts\\statusline.mjs";function Ul(e){return e.includes(EI)||e.includes(PI)}function sv(e){let t=e.statusline,r=t&&typeof t=="object"&&!Array.isArray(t)?t.prev:void 0,o=typeof r=="string"&&r?r:null;return o!==null&&Ul(o)?{prev:null,poisoned:!0}:{prev:o,poisoned:!1}}function CI(e){let t=e.statusline,r=t&&typeof t=="object"&&!Array.isArray(t)?{...t}:{};return delete r.prev,{...e,statusline:r}}function mv(e,t){let r=pv(e);return r===t?{settings:e,prev:void 0,changed:!1}:r!==void 0&&Ul(r)?{settings:{...e,statusLine:{type:"command",command:t}},prev:void 0,changed:!0}:{settings:{...e,statusLine:{type:"command",command:t}},prev:r??null,changed:!0}}function fv(e,t){let r=t?.settingsFile??dv(),o=t?.configFile??ke,n=t?.env??process.env,i=cv(o),s=!(n.BRIDGE_STATUSLINE==="0"||n.BRIDGE_STATUSLINE==="false")&&i.autoStatusline!==!1,l=cv(r),u=uv(e,t?.nodeCommand);if(s){let g=mv(l,u),{poisoned:y}=sv(i);return!g.changed&&!y?{enabled:s,changed:!1}:(g.changed&&Ho(r,g.settings),g.prev!==void 0?Ho(o,{...i,statusline:{prev:g.prev}}):y&&Ho(o,CI(i)),{enabled:s,changed:!0})}let d=pv(l);if(!d||!Ul(d))return{enabled:s,changed:!1};let{prev:p}=sv(i),m={...l};p?m.statusLine={type:"command",command:p}:delete m.statusLine,Ho(r,m);let f={...i};return delete f.statusline,Ho(o,f),{enabled:s,changed:!0}}function cv(e){try{let t=JSON.parse(lv(e,"utf8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Ho(e,t){let r=JSON.stringify(t,null,2)+`
18
+ `;try{if(lv(e,"utf8")===r)return}catch{}$I(Ll.dirname(e),{recursive:!0}),II(e,r)}import{existsSync as TI,mkdirSync as RI,readFileSync as OI,writeFileSync as DI}from"node:fs";import hv from"node:os";import ma from"node:path";function fa(e=hv.homedir()){return ma.join(e,".codex","hooks.json")}function vv(e,t="node"){return`${t} "${ma.join(e,"plugins","alexa","scripts","codex-signal.mjs")}"`}var NI=["SessionStart","UserPromptSubmit","Stop","PermissionRequest","PreCompact","PostCompact","SubagentStart","SubagentStop","PostToolUse"],LI="plugins/alexa/scripts/codex-signal.mjs",UI="plugins\\alexa\\scripts\\codex-signal.mjs";function zI(e){return e.includes(LI)||e.includes(UI)}function yv(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e.hooks;return Array.isArray(t)?t.some(r=>{if(!r||typeof r!="object")return!1;let o=r.command;return typeof o=="string"&&zI(o)}):!1}var jI=e=>({hooks:[{type:"command",command:e,timeout:10}]});function bv(e){let t=e&&typeof e=="object"&&!Array.isArray(e)?e.hooks:void 0;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function xv(e){let t=new Map;for(let[r,o]of Object.entries(bv(e))){if(!Array.isArray(o))continue;let n=o.filter(i=>!yv(i));n.length>0&&t.set(r,n)}return t}function FI(e,t){let r=xv(e);for(let o of NI){let n=r.get(o)??[];n.push(jI(t)),r.set(o,n)}return{hooks:Object.fromEntries(r)}}function MI(e){return{hooks:Object.fromEntries(xv(e))}}function BI(e){return Object.values(bv(e)).some(t=>Array.isArray(t)&&t.some(r=>yv(r)))}function HI(e){return JSON.stringify(e,null,2)+`
19
+ `}function zl(e){try{return OI(e,"utf8")}catch{return null}}function ZI(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=e.hooks;return t===void 0||typeof t=="object"&&t!==null&&!Array.isArray(t)}function GI(e){if(e===null)return{value:void 0,corrupt:!1};let t;try{t=JSON.parse(e)}catch{return{value:void 0,corrupt:!0}}return ZI(t)?{value:t,corrupt:!1}:{value:void 0,corrupt:!0}}function WI(e){return GI(zl(e))}function VI(e){let t=zl(e);if(t===null)return{};try{let r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}}function JI(e){let t=VI(e?.configFile??ke),r=e?.env??process.env;return!(r.BRIDGE_CODEX_HOOKS==="0"||r.BRIDGE_CODEX_HOOKS==="false")&&t.autoCodexHooks!==!1}function kv(e,t){let r=t?.home??hv.homedir(),o=fa(r),n=t?.configFile??ke,i=t?.env??process.env,a=JI({configFile:n,env:i});if(!TI(ma.dirname(o)))return{enabled:a,skipped:!0,changed:!1,corrupt:!1};let{value:s,corrupt:l}=WI(o);if(l)return{enabled:a,skipped:!1,changed:!1,corrupt:!0};if(!a)return BI(s)?gv(o,MI(s),a,l):{enabled:a,skipped:!1,changed:!1,corrupt:l};let u=vv(e,t?.nodeCommand);return gv(o,FI(s,u),a,l)}function gv(e,t,r,o){let n=HI(t);return zl(e)===n?{enabled:r,skipped:!1,changed:!1,corrupt:o}:(RI(ma.dirname(e),{recursive:!0}),DI(e,n),{enabled:r,skipped:!1,changed:!0,corrupt:o})}function wv(e){let t=/(\d+)\.(\d+)\.(\d+)/.exec(e??""),r=Number(t?.[1]??0),o=Number(t?.[2]??0),n=Number(t?.[3]??0);return{ok:r>2||r===2&&(o>1||o===1&&n>=80),version:t?.[0]??null}}function Sv(e){return{ok:new RegExp(`${tt}@${Ge}`).test(e??"")}}function _v(e){if(e===null)return{present:!1,allowed:!1};let t;try{t=JSON.parse(e)}catch{return{present:!1,allowed:!1}}return{present:!0,allowed:t.channelsEnabled===!0&&Array.isArray(t.allowedChannelPlugins)&&t.allowedChannelPlugins.some(o=>o.marketplace===Ge&&o.plugin===tt)}}import{existsSync as qI,readdirSync as KI,readFileSync as XI}from"node:fs";import $v from"node:os";function YI(e,t,r){let o=r.readFile(`${e}${t}plugins${t}installed_plugins.json`);if(!o)return!1;try{return!!JSON.parse(o)?.plugins?.[`${tt}@${Ge}`]}catch{return!1}}function QI(e){return/^\\\\(?:wsl\.localhost|wsl\$)\\([^\\]+)\\/i.exec(e)?.[1]??null}function eA(e){let t=e.platform==="win32"?"\\":"/",r=(a,s,l,u,d)=>{let p=`${a}${t}.claude`;return{id:l,label:u,kind:s,home:a,claudeDir:p,claudePresent:e.exists(p),pluginInstalled:YI(p,t,e),setupHint:d}},o=e.env.WSL_DISTRO_NAME,n=e.isWsl?`this environment (WSL${o?`: ${o}`:""})`:e.platform==="win32"?"this environment (Windows)":"this environment",i=[r(e.homeDir,"current","current",n,"acbridge setup")];for(let a of bl(e)){let s=`${a}${t}.claude`;if(e.exists(s))if(e.isWsl){let l=a.split("/").pop()??e.userName;i.push(r(a,"windows",`windows:${l}`,`Windows (user ${l})`,"run `acbridge setup` in a Windows terminal"))}else{let l=QI(a)??"wsl";i.push(r(a,"wsl",`wsl:${l}`,`WSL: ${l}`,`wsl.exe -d ${l} -- acbridge setup`))}}return i}function Iv(){let e=n=>{try{return XI(n,"utf8")}catch{return null}},t=n=>{try{return KI(n)}catch{return[]}},r="";try{r=$v.userInfo().username}catch{r=process.env.USER??process.env.USERNAME??""}let o=process.platform==="linux"&&!!(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP||/microsoft/i.test(e("/proc/version")??""));return eA({homeDir:$v.homedir(),env:process.env,platform:process.platform,userName:r,isWsl:o,readFile:e,listDir:t,exists:n=>qI(n)})}import{spawnSync as tA}from"node:child_process";import{existsSync as nA}from"node:fs";import Av from"node:path";function rA(e,t){let r=e==="win32"?Av.win32:Av.posix,o=e==="win32"?"bridge-node.cmd":"bridge-node";return r.join(t,"bin",o)}function Ev(e){let t=/(\d+)\.(\d+)\.(\d+)/.exec(e??"");return t?{major:Number(t[1]),full:t[0]}:null}function Er(e){if(e.shimExists()&&Ev(e.runShimVersion())!==null)return{kind:"shim",command:e.shimPath};let t=Ev(e.runNodeVersion());return t!==null&&t.major>=20?{kind:"system",command:"node",version:t.full}:{kind:"none"}}function ga(e){return e.kind==="shim"?`"${e.command}"`:void 0}function Pr(e,t=process.platform){let r=rA(t,e),o=(n,i)=>{try{let a=tA(n,i,{encoding:"utf8"});return a.status===0?a.stdout??"":null}catch{return null}};return{platform:t,shimPath:r,shimExists:()=>nA(r),runShimVersion:()=>t==="win32"?o("cmd.exe",["/c",r,"--version"]):o(r,["--version"]),runNodeVersion:()=>o("node",["--version"])}}function ha(e={}){let t=e.configFile??ke,r={},o=O(t);if(o)try{r=JSON.parse(o)}catch{r={}}return{claudeBin:typeof r.claudeBin=="string"?r.claudeBin:null,relayUrl:typeof r.relayUrl=="string"?r.relayUrl:null,hubPort:typeof r.hubPort=="number"?r.hubPort:null,onboardedAt:typeof r.onboardedAt=="number"?r.onboardedAt:null}}function va(e,t={}){let r=t.configFile??ke,o={},n=O(r);if(n)try{o=JSON.parse(n)}catch{o={}}for(let[i,a]of Object.entries(e))a===null?delete o[i]:a!==void 0&&(o[i]=a);return ge(r,JSON.stringify(o,null,2)+`
20
+ `,384),o}import{createHash as oA,randomBytes as Pv}from"node:crypto";var jl=e=>e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function Cv(){let e=jl(Pv(32)),t=jl(oA("sha256").update(e).digest());return{verifier:e,challenge:t}}function Tv(){return jl(Pv(24))}var iA="https://api.workos.com";var aA="client_01KW2CY31D0NZKCDKNHF2XQ7VC",sA="org_01KW0DNZ14H6JMK8RHA0WSKNVZ";function Rv(e=t=>process.env[t]){let t=e("WORKOS_CLIENT_ID")??aA,r=Number(e("WORKOS_REDIRECT_PORT")??8765)||8765,o=(e("WORKOS_API_HOST")??iA).replace(/\/+$/,""),n=e("WORKOS_REDIRECT_URI")??`http://127.0.0.1:${r}/callback`;return{clientId:t,apiHost:o,redirectUri:n,port:r,organizationId:e("WORKOS_ORG_ID")??sA,configured:!!t}}var cA={google:"GoogleOAuth",github:"GitHubOAuth",microsoft:"MicrosoftOAuth"},ya=class extends Error{constructor(r,o){super(o);this.kind=r;this.name="AuthError"}kind};function ba({cfg:e,opts:t,state:r,codeChallenge:o}){let n=new URL(`${e.apiHost}/user_management/authorize`),i=n.searchParams;return i.set("response_type","code"),i.set("client_id",e.clientId),i.set("redirect_uri",e.redirectUri),i.set("state",r),i.set("code_challenge",o),i.set("code_challenge_method","S256"),t.provider==="google"||t.provider==="github"||t.provider==="microsoft"?i.set("provider",cA[t.provider]):(i.set("provider","authkit"),t.screenHint&&i.set("screen_hint",t.screenHint),t.provider==="sso"&&e.organizationId&&i.set("organization_id",e.organizationId),t.email&&i.set("login_hint",t.email)),n.toString()}function lA(e){return{id:e.id,email:e.email,firstName:e.first_name,lastName:e.last_name,profilePictureUrl:e.profile_picture_url}}async function uA(e,t,r){try{return await r(`${e.apiHost}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId,...t})})}catch(o){throw new ya("network",o instanceof Error?o.message:"Network error reaching WorkOS.")}}async function dA(e,t,r){let o=await uA(e,t,r),n=await o.text().catch(()=>"");if(!o.ok)throw new ya("rejected",`WorkOS ${o.status}: ${pA(n)}`);let i=JSON.parse(n);return{user:lA(i.user),accessToken:i.access_token,refreshToken:i.refresh_token}}function Ov(e,t,r,o=fetch){return dA(e,{grant_type:"authorization_code",code:t,code_verifier:r},o)}function pA(e){try{let t=JSON.parse(e);return t.error_description??t.message??t.error??e.slice(0,200)}catch{return e.slice(0,200)||"request failed"}}import{createServer as yA}from"node:http";var Cr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAD9CAYAAABTCakVAAA+DElEQVR42u1dd7wdVfFP6L0pTUoABZGqIB1CBAICQghpgCACIQgo6E8RUEKNoCDFghCUngoSVARBQoBEaSKELkoHAUFqSPLevbs7vz3cOb5z550yZ+/e93bvnj/m85LbdveU75nynZkBADAgSJAg1ZQwCEGCBAAIUlJZNJV1U9k2leGpHJbK91P5TSrTU7kjlRdTeT+Vhal0p1JHiZR/C+lK5YNUnk/lIfzuTalMTuWXqXwzlRGp7JHKZ1JZPIx/AIAgfSNLp7JbKl9L5XLcmC/ipq7hxu7Cvwvx32KDx7i5Y0US5W+i/D/WfE6CRE25Tg1fE//+MJV/Idj8NJWvprJXKiuGOQsAECSbLJ/KvqmcmcqMVN5UTmwpiWZDS4kMr9PvJBoQcL2u/k5kAA8JHP9J5XepTEhl71SWCHMbACBIb1kfT06htv9TObEj8ld3gseWUzxhfIcrLgDRaRQR0UKEVjI7lXNT2RO1mjD/AQAqJ+IkPCiVSam8ihukptjisWXzuTZjbPl+3hIzNAodeMnnXJDKozgOh6eySlgbAQA6VdZJ5RhUiRcqKr3tpE4YQBAZQCE2gELcwkZPmKaES/OINc8gAHA+mjzjUvlkWDMBAMosn0CPvPCeP6ac8DFRjxOGeh47bHGfU7mV0z7JYErEjN+i5o50OArt4LJUxiCAhnUVAKDQMjCVoRg2W6g5nblqeZzRNk+Ym1+8Dxk3fxatwgVgNr+F6vi8FSMMi4S1FgCgSCLi8Gen8pISMos04TfI4cT0OZld1wNozfbPw88QM8yMmDgTX0nlrFTWCmsvAEB/EnBGp3IXcd6Z4ul5ONVsm76dTr/Y42TP8l2T38IU6pTgKrSs36YyBLWvsC4DAPSJmj8OvfcR8XKbNnTUYijO9p3IQejhnN6tOgFjyO4ETCwbPbGAKvWlCDLSiaksFdZoAIB2yOLoxX9GUfFdaisNg0EG1TpxgEfEDAXqfg8yqvxxBhMlZpgtNm6DbWwjJarybCpHBZpyAIC8ZMlUvqfE613U2azEGd1nIaeTOWaYDe0yEbjhQpcJYHIWRobXXsGciEA2CgCQmazzbdz4NQ0FN3FQbaknuxWnWWRQ9yWpJnFsklY2MUcLyeIHcAFXFqG/LcbmjVROChpBAACurJTKaam8rsmaa3WxZnUAxuDnjc8rxOgr0AIPgKMB+DgQqcPwDeRkfDqs8QAAOhHOo9MxbTYyeJ5jhvoaW2xV7gkaA98J6Lpeqw5An1i+Dgg4Dj+OEzDxAFnbs3dh1uLKYc0HAJByOKbWdms2D01q4XiubTx4zsbgpuq6Tr88Tn3XaZvVqcl9Bs64+mhXkpH5VionYDg3AEBFZQdoFL6IDIvK5M3P4gRsxRa3/XakkTqJVNQNn7P9hqo+14k5FFl+z9dM4ZgAEUPb0WlsLjMrRuD/cgCAasmKmHpbJ4s9Ypw4rhPMFqvmbmrXe+rG7Fb486JuwKxUrk/lJ6kcm8pIaBQS+RzmJ7hotAPRASpqEmwAjeo/e+LviPDa+Uh1vg3t6roCOImn6dKKBpB4Oj1ddOObUxkUAKDzZTcMEdUZarqNzBNnVNu54TAdgIh/z0vl9lSuwQ05GDdrf3m5F0tlM0zY+TU0yoh9BM3VhGynNjf27wMeiQVUIsP91PC+T4GKFS6pEoPvuxY731VIw+VY82X6xZpQX0ROd7Eo70vlEmjUD/hsicZ7TWjUKDwbk3i68HlisFc1ckUKErKJI+BXPeJEWsQ9/qVKeQZVeEixcf4KPXXyIsbm57zPobuakoHod2tKost1qRzaYTnxK6AZIUJxTxv8LlwWYpYcBI45kijzIMqZfS0AQPkTds6ARuWZmkEd5XjZIyb1l2NzUqebSGj5YypHp7JxhVRPWSDlD4p2QB2QrRCBXCaAaa7qxJEqCrisEQCgfCKKaj5l8G5zNr6PeeBagJSv/g90pu0KoVCmrHi8OzounyYRh9ihsXFCnjFT09CZF0LeSWU8+loCAJSAu389OVHqHqE+HycgJ1NNXltQin+cyoZhwztlA2RjPkfGkGuy2cwzFylLt0YkIL2cyk4BAIory6AXmtbbizRkHl+GmcleNYGKDNFNwzBayFfP5rj9MppI3QbzIAIeNyO2mHEmDUAnwlw5IABA8UR0qnmCbH4TAEQWGz9h2I6xIzVVLJILUvlU2MS5agW/UYDAh2XJIRu5AF2+JxuwfCMAQHFkWCrvWSiiNB6dWMJKJvtdx56jav6b6HQM5a3b20PhYujpiOTiGiSO9OHEcVjQ79cV3sBVnUAlLvuC+D64y3HFnj6A2JEMpP5fLATRS+94NEHCJu0bEXF60XHoXYVfkEUL8DUB6PsPlJ0zUOZ8/SmWEyCxoLor2YdjAsgyVMciGy5syv6RldFD/4EjIsAtaRaBu0IxPQBEPsF2AQD6tub+3YwMMWoCRB48APqeSh1+E0/8UJ66OLIqpvl2KTF8myPQpgFETE0yIX6fkQEA2i9DEXE5seHYQubh5pOrAPAqhqdCLnlxRYRZL0WfkIub0YoJoAOVbrz2CgEA2iMjNCG+VjSAyJEgIr/3dionB9JO6UyDCw18EB8nIEcDoKFfUZh09QAA+YpgzX0I7vp6WZ2AOi+/mNArUlktbKjSyuaYB1LXRIISh53v0iRt0aTZSEoLAJCD7I9psN2GSeSq/xFzUsW/56aybdhAHSNHo+8mYmYeRox1lIC9TPkdZTAHij5xI3Hj22ywLCZAonlfOo9+FjZMR4rQ5GYqZkFiiAL4agCRhWMwu+ggUPTNXwNe+a3YAQARAwBEnbhRYaN0tCyGiVj1DExAV2k4U9n2hzFyFQDAU+3v1iBs5AkAsQMA5OafUibHTZCW5YsKdZzjK0rA3NbdlYMgrvFoUddXUTf/QgcyJx5RAN3ESjrnf8savw2SSyn4X5FsQ1u5MhNARMCrTfA48hUCAFhEZH99pJz+Ols/yagB1Mlr9yO3PGyGasvB6GSOHGHAyOKDShwORskanFs0HknRQn0fgbmKblYNQJ1UMQmi3NO3ApMviCIic/Nq6F2ZyIcH4GIZSiez4AmsGQCgWdbDjRkxHX1ZnIBiAp6BChV8DOIteyssQheblOME1OWciHV4b1EOoKKg7/OErBF58rhtoRuJvKIU1zolXZiiQOghqexVwHsbginZnVL0ZDeFdFZ3rEFuiTLqjBa/e20AAIBlU3nMwcpztehKQF8ySr4m/Al3lThPX9iMLysL54KC2c9yXm7tsCjBq5owtIkHwKkPqStMc2HVAeBmaG5jZVKnIk8noKr6i042ZWkPPQb9E2oX2xPI4pmnUR/bnZIs4tjfSWUcgrZ8/XZlzAXQbqa8JzSWK6HRe7GMILA2moy+TEAuAMQY7Tq8qgDwc4fqngC/SaeumqtYkD8u0YI7X0koeU+JG19Dnq1biV6ISrVzFOfSlm26t/vxGjVkt8nX34XmphpfwdePUUyvGmZxlhEEhNY4yxEh8AWAmDgGBQjsWTUAOMJCqOC24jY1i5De/mNKtNAGIhNRJScdgu9N1jyb3OjHQ3MT0NltuLdBmhCq9KXMh+bOuwcomoFaY//0kvMFfmehk+sqSbkAgB5eIuN0g6oAwM5KYg+3BTU3DCg3yEElW2QraUJQ4/G9SeT5xNhtje9NI4tyfhvMgcGElyGutx/RAOS97Y6v/5OcmD8hv1m2EKyo/XdVRhMgYSQYibl/qj/yBvp6IHdA9p0LKTmluyjdUvx9HQGmDE6mbRXP+Wc0DqLx+P55mqjGevi9O8l4LVDCnOK7h0GjbiK3H4HognMuOhpH4Gs7aZxhwxTTQNUApO/iBaLN/ERRqX+HgPIMrocyaWmnQqP6T8JMBuIUplFBYHZfE4X6cgAHKWpuzNj8piytxAAOwpbasQQLaSpOttgE1yljQxeH1AC2VgCujhx2+VtzSOh0gaJKTsBrCPkAeHUNHlFU3W6kZUuNTTU1hivMTfnedcrvPEFMgFPx9ZOIpnNPCU2C77WgAego6THxl9zZlyHVvszC+hu4mzP4OgHl4ImFv29JPMsRcVSKjbmcspEkH+I4ooYLFfQK5fQfgKE31ZQS47AivvcOMYuOYPAxIqJpTMLrdUFzy64toLlC7xCyaK/E55GLem98/SriT/hvSf0C1xjCepwu05HhNTUl/cxOA4ATLCc4tye8CRy6lROp6LIX0WhquLnFe38hC2Ebxu9dRjSAV5X3FhL1fLzjtzbSgOvviabRjeq9y4bfAL8jNL6J0FM//3qyDt4rKQAsgv4XUyKRSwPQ5bhQzWDLTgGAldA2j0j6JZdNZSvqGJXM4bc/meganp6yoKVQwd9P5RLm722KJ70Ek2OVBTqfhJvOdfzWJhqQvlmx3Segb2A9T7tZ/f+15BpvlDg6IMZ4BsMH4HICmnwDd3YKAFznoPJyQoG65h3dGAYr06IZrgGAXXMg6QxDx6L6ek0BSfHvcxy/s5lmzG/J+fnPg+b2XnM6IKV4jobMxuEB2DJW5XePKDsAjAG/fu4ub6qKmD8q4YL5EvSuUrtem67VRez5sxnaBNWy/tiG6If0DdQZoFSWUmPPgr1DkU3Vt7EM32l3/ko7B2YtJeRnqsHmovOasqmuL+liWRo98vJZ/t7Ga3WTsZvA1ADaCQDyOqcgBbZTuiqtm8prFie3LlyYMGjGAlRuKysA3Gng87uce7Z6AGLzz4RyN2UUYb0HU3kolc+38To1spBcGsDmmgV4R0gRZstWmKdhWuOcdOJIE/4Wa/6osgHAGZpUSo7t79IAZqFTMSw4PgBIJ+AEBgBQs+tPYRy9U6PfAX7FYZcJIF8TWuP2ZQGAHZRQlqnvmg0IdBqA+K0XMfmligtrdXR4HknUZuGd/y2mC4u2VMtoTACuE3BzzYINGoC/DAV9NeuICQIm7eAlkolZSABYAimeNjXeRQDSaQACAEZXYPGIbLqRhLUnNv/zCknkUuU9lVlXQ16AzgnIMQE20SzO28OGzpzpWnfQ2WNNlqGt7ZiYw4uKDgBngbkza9ayXmJQpldg0ZyrUIRfg55a8t8mlFGhDsr6BjeTBfU2AQCVLenSAHRRgAAA2Ss4/VuTRanrQmV6j/q+pD9g66ICwHqEfRYznYA2TrV44H9VQPUXav1HyjPXMYQq2XPq+HRh0o54by5570OFpbeAUIHPYnjn6YK8K2zmzLIHyXuIHMlAJicgPRDvLyoA3AT6cl6JJ82Xqj7bV2CxbESyGsUY/hB66gHQfgYb4XtPk037rsK+W0CYgGcxNACqgs4MG7klOUc5vaMMPADTnhhbNAD4Apg78CSOTL/EMhgndejC2IVkLm6nbG41HZgCgGRAfg7fm01MrhctuQAuH8CWGhMgOAFbTyGeA/py4z4mAN0vL0NOZe7yetCrHCm7nI6sMckhv69DF8X1iq1/uhJDrpNxOA3fu5SMjTABZOGIX5DFdZNynQWeTMAtNCGoAACty/qE/MVpX+dyjou/hxYFADYhpw2nMIKLL/0SlLeEt002JJmA7yOSr6ikzsr3xykbc4FCn51E8gAuRFv9JjJmCwiZ5BwmAAQnYP4yTJk/Uz0AW99BnVn9FORQWSmPh/sruJtwJgbtQEeJFCfjzh26EA7QTOyqRJ2XabeDCNX05FS+6sGCnE+YgC4i0KYaDeDOsHlzkx+BuQK2jxNQfe//+hsAdteEOmIL3TF2RALqmD/eqYvgMM14yY0uCnL8EhoVg4blcK0FxAdwDkOTo/ZpMAHy5cg8RXw2Lh6AK9X4DUL+6nMAeJC50W0AoLIERfx75Q5eBMcQAKiTkz5PWUCYgC4fwGZ9mAswsKIgsCM0l1eLDAxYsDgBgRyY3+8vANg9Q0afyUEo7dRvdvgCOA56NyttFwDMJ0BzFkMDoDbon9vAd5iEPqOnlHBmleQqgy+A4wTURc7+Cy10vWrlQWYT50SU0QSQn3mmApN/HNEABACs3eJvrogU4nUtJgAnCvA5DUst72Sgo0mo84YKAsAncNNGYK4IZCPK6ajFZ/Q1AOxKsv04JkBkAQC1nFUny+EapmMrDSE2RvpvhCzAbTUAwE0G2lQzZ2q/v3UUenJWmUJA5uGKmgIXMjSAxLJf6PtvZfUFZH2AWzXJDhGD7GP69zvQU822k+Vg6N0ldg3l/UGYTbYU8/cuJuzBqcp7H3maABtrnIC3KHkKXWi/XsG8t8Whdyny28g1nqwoAKwHzaXRspgA9HA9pa8AYEdiw5jKdrmcgOrnD6/IxO9P1D5hCy+tqMeyjr9IJFkLehdXpbbe3WS8n7f4AFwawLoayul0dMp2EdByNfQQ/oQX8FnmQk8vwxtJmvgDFY4KjCdJPnXgtR9PDAfrW1kc6Flu/B7gNem0OQFVraFKsealka8v4/0PKe+9Rk7zccp7VyosQLVQ5FwCpO8RDcAnCrAYLiLVQXk+9NR3UOf3cOV5LsasRLUB6NWgbwxygRILT9AkqDJN+HFCEOIyAU0AcXa7AWAT6F3swMcJqIv7f75iEy9i/K8gb3+ospFq5HQcr/hbasp4CXNpSXzvMbI531Ku8yEhAp3FuDeRgTgPf1MkGq0JjUKmdM5PhOYqvzW8L1mt6WGyqC+EnjqRTynPsWOFAUDI3tDTJ9PGBOT20xAHwLLtBIDziRc78TABdOrNbRVfAFLW1rDEZJ7AEdC7pfSu0FMPQN2cswgA+KQDq1qKWql4Gw15RWonc4jJcADSU/9BDoWfayIOq4V5/1gLuE+TLMTlz+j22YntAoDF0eOctYOvTrYLi+BjWVnRAGgy0MmabMC9lbBit7LJVR7Fm8qCqilqeJZIA2UvSqbic+T1w/D1R4nP4MIwx0bZTfGxxBlNAPW1J9oFAEdCc62/xFMDoNGCe8LkN50E/yGq4LeUnHKaK7G38j3hoZ+hcfLNVuar3oKjdRGMW0uAWqhEbF4kGoC8xlToKWMl/n4nzLFV7mM4AROHE1A194a0AwDuz3DKJ4bEhrrPTVZELlI2q9jkstX2DzQawO6M3xuCm7WG0YFWKNZ7obovnFaHKK8/S7QM+d4ueO1uNEU2CPPrTBJTfQGmZCCVCpwYXo98nKvcG/y0JlRhcgK6CAwRqohh4nvb3mchVXYf5fV9yfgKJx23RJqoM/A1aF8p9RkkpfWLJLdAtEJbPcwtSx6F5u5CcUYNQIaXV8oTAM4Ce+8+lwmQkBNsbIkn6gvovBQ02QP7yDy4UQHgiwo0Ftsh41Dc1+Q2/P46mCEpOhR9vcMBYCz0VHLmOgFtPTa+mRcACBvwZQYycSoCxag2lrUl1Epoq6v2+MF9dO3PIvgUkdu+A+RQnILIIEx3VYkywzsYABZFB14E7ma5CQMYnsgLAHYAfaMDHx+A+tq4kttqNZLMc2NQX9siY6B3Qc3LOvyZDyVcEO6e0gGA0Ca2zgMATgFzDbPEkgtAMwUl+WPZEk/QCPJcdaTjhg2bvxyhWU+/6vBnXhKZopwQIMfXdlIeAHArmIsZcpmAEgB+VvIJGqlJ550VNmtb5EhNyuxlFXjun4C5VZ6LB+Dd25Fjl3yUgZesK23UjV7pASXXAGhFnwAA7ZGjKqgBSOJVxMytSRwawPvgqL7kupk9wK9CiekzUYekfo7SmDYBANqnAdTJZri0Is/+gMehq9v8oIzZkFYA4CImP9lVFFRM5A87BAAoLTa0z2qfD6BOAPdXFXn24zScG1voz/S60+x23cgLLfL91RvZsAMmZqTGCRg0gPbFxWmzlKoAwKqGyBt386vyelYA2JLw/mNH+CEGc0+AhzpkYlQnYOIwAb6AefGisu5Ehdob8h4a9v0MdDCfaLBTx2ocYJdVaJxuA7+CIDYtYHAWADgH3HX/OBqAmMAzO2RSdGFAXQNNWlxDfO4lJY+/ynIqGRfhHB4P+gKiND/+8gqN07csuQDgoQHUbcBpu4F7wa88UWwIF9aZyStlcgK6fABfhObqt3KxbxUA4OMWZlSbnKT53DhNNKlKAPAFhh/AlCREowH/8gWAJZUcZY6X38YDEL+zRIeaACYNYHeF1x0rqbE7BwD4mNdP28VNtmgA6hqbWDFT6S0LvT5magEy/2ZjHwDYHfzKftsAopOYcqM02s1s0Jd6opxu8dkdAwA0AYA8OK51AEBcQR+AkCtIhqAPE5ACwPE+AHAS9FSa4fgATMlAQr7bQRMymkkF3kfjwQ4A0JBbNABwjcUJGFcwDKjWj6xlTAaiXbem+wDAjdC77r9L9TD1Pd+iwzQA2j3nboMGQMM44v87BQD4GADomrmOaQJUTQNYSmOK+4o8fN70AYCXDASgxJGeSCfsvZIMtEhl3QtlMYYJoA6srrTZVzTqa/AB9JgA1LdkAgBKBJroSKTZ3xbyKqncZ9hv3ChAoozj2hwAWMGgdnDSE6nde1MJBlhU4rkfkbbuYPaN1vAAdBrAfmhCqaBYd2gAh0Ojlt6vkYNRtoX6DaSwigV7gocPwAQAR5GxtmkAq6CnW9YNmNFBADCBaJO+IKBGoQ7hAMC+wOvuYwtLyIV/dAkG+Dzo3ZxhFwcTMHZoAF/WUIbFNXY1/O4l0NxIQ4DRtiVapIeQcRHP+gMHwcXlBByr0aImMijrcl727BAA2I5hjrtMADk2V3EA4FTI3qmUOr3WLMEAT9EknRzISAaS6HqvwwmodtoxqacLNOBZptyJszWnzhyPKMA1Fg2AwwScqll/B3aQFvBWCxqAugb/yQGASRang0868GslGVwfABjZghOwbtEsapoJG++4b9FYYwyaG4u2aWw+hb+/vuNzP9Zkoj1oAQC6ZlwagIsINF2zNjupfNh0jRbgwwNQNbMlXQDwACP/WOeUiMhpV5a+b1M16rpLA1A/e49BA4g8AYBqWKdZ7llsSLWPwKPou8lzXA6CRnVZaVfbinJeonE6/Q3sBWa4PICIYQJMJwBe7zAN4FiDGcBtH15X+AC72gBgIE461wGoYwJKAPh2SQZ3GlE1bQDAdQLuS5yAclHu7NAA1HG1aQDXE62lDvbGkKIn3y/xXoW6vZFjTARz80Ny7/PA3M7rIs3C+3uLADBW4wS8nGECyHnpJA1gGzA35YmZp7/cl0fZAGAdcPf+c5kAkvY6tEQAwLUfR2mcTXcZTIC6JmS4s0MD4ALA3Zr7mGIJcT4Dzf3n3nWo9dtr7qeG5oDu8xdr1sLDHkQgUxSAywScrtG2OkkDWBQdw75EoFgTiZpoA4D9wF7Xn5MOLJFmqQ7UAKgT0AQA+3oyAWsam85mAswm6nEdn0P32d1AX7D1R5bf30UzvzXo6Qno0gAiSwr4Hzw0AHrPJgC4QfPZTish/pAm8ScmvpfEwc+powZmBICxFu4xBwDkxV4p0cBOzWACqAv9LgMRqJuMifjeDjmZAH8hExvhc5hSmBOiItd1ISFFdjZoAMM9TIC/WQCA4wQ8yoMJWAUAuI5hArhC80LetgHAZR5xfhPS1EpGxNDZjzYAoKf6TEsyELW/BudkAszR3IdJAzhYo0rrWnar8iUDk3E40wlo0wCy+ABcNQFv7HAn4ABM5vF1AtIeg7I47+ImALgZeH3KbeBQw7BQGTUA1+kxRqMBzPTgAZiYgN2eGsBs6F10ZaoDtGgSkw0ABmvmW9zjATmYALd6EoHU+760whrAUA8noK3NeITkIi0APMtwLrhMALFQvlqQQVuVEcOeolk8HB6AywlY0zgBTUzAumZcuQDg0gBGGyI2tgq7O3maABdrAOCRFpmAPk7AGzXz4gIAQVL7LOTf0qxdsrwhRd+nX6Ccx1EmAOhibPCEYQLs1s+DtRguKqkOPoShMJsJEDFCSCM1TMBZDB6AvI/BDCJQwnAC3qsBgKmWe6YORpcGsC3o+87bACBmAsCfNCbANcwwYB4+ALHhr1aiIg+VhLE6AEOztuo/nFCgGNNv6QBgCeA3IlAFNAizXD8P1ClK3LSGWslMDwCwaQCUB2CKAujSgXexaAAU0cd7AEBk0QD2NSwEWxRgK8PJwTUBYgcRiK4lbj0AEwD81oMHcJSS+CVrEv6pJABwb4tMwIRGU6hKFEG25p+0N/nAfh6oyeS0qyGRxUYFVjfHCKYTMAJ7RSBqAgx2AEDCNAFmaSZ1uuGzK6DnV130kUNL28oQBrRFAWImANzG1AB8OgPdqDnlhltIVFRbmV8SU2BGC7kA6rqdqgOAnYjjygUAprTDZwrC76eLbH4OVODRmpNmtsEEqJGxtGkA3ZrxtZkAMzUm2VTL5wW/4w1l87sKa2wIvQtS2ohAOicgVwOIUCXnhAE5AODyAUzRzGGTZ7zAclUOPoAI8zF6AcB+BAC4KgWd+FsL4tmnzRUXeJgAIxhEoNgjGShyAEDNEwCmkPTlGrjbZi2GKbIbM8ZvWQRM9RpCg9jE8PkLPUwAbk1AHxPgRrImbQAwSWPGdUE5SrYfn4MJIP4+rgOA0WBu7WVr/kk1gKkF0wCkSugCAG4ykDo2NU8egIkK3OUJAOvjid6N8lwq6+Y8hkfib8taCTaT5EKNymkDgDrwawJy0oFv0PAAhjPMQ7VoZhmYq6OZxB+XCfCeDgDGgr4rqU9Z8DoUo3TzFA1gfZQDD2A09O4O/GeDCdCtSZAyUYEXegKADHHuhlpFu04vETn5MiN56KceGsAt5PTl+AA46cARUwOYrNEAukuiAQz11ABMZntNBwAToHdJL18egPj+D9o4ACJZaQjGRNuhASQeGoAEgHvBXlWJ4wTs0gDq6SUiqZwPvYtQ2jQAGko1pQPTMOBESxQgJvM9wmEeqvfb5dAAVsO5W7qfx3mDHHwAcoyWoABwuUMDcAGAHPjD2/TwslR5HVWYYY4oANcJOK1FJ+C9BqebLhloV4cGkDCZgEWTczycgH/UHDRcE+ByBwBwIjnTNQBkMgFEFt4VCBDi1BSVefqzy9WyjJwczn6NZWq3+uPXGOx+Xw1gRJtO/nnQXKz0fTAXwZhMwMwVBeDyAEZrGGezGNmArpqAdxFzQXxnXIkA4GCNTT2J6QT0SQa6nOkEtM3hVEMUYBmwFyaVc/hkP47zIsw96soXEP/fggLAlBZNAKkBDGvDgx9A7HRpx+zgmGSOCeBTD4A6YeoWJqCOSDPYkn//usJZEG3ZVykRAAxER+B8hV03yOID4PIAqBZlqwhEta0RlvmmG6gbT1cdZ4Dea1c/j3U3+FcE0jkOd6QAMJVB9EkcpkEdnUbtaMhRI6pbt+VEzcID8NEAXOnA+2pi+7aSYEJWxOseWABbs5XCFa57b0UDmGiJAnA1gGmaOawbNIBJGodldz+P8QcZiEC6zw2lADCNucldJsBObQYAVQPYmekEtPEAfJKBuJ2B9tE4sEJjkNYrArlMAI4pOkXDBOw20NenaBy5/Q0A72RIB9Z95isUAKaDu/S3ywQQ8vkM6uNyDvowDb+5TIApmgWxgMEEzKIBzHJEAaIAAL0AgFKfr2MkA0UWALhBsz5tGoCOB7CchTMQk3z6AQ5NbrM2UotfBf/WYDrezjAOAGQJA27u8TBnQKO6rbCrXsSNY9p4NY39vTMDACIlRyFPAIgtJsA+4FcWvGqtweg6u57JBJyYoxOQAsDyDtIQBwAuwoNGzP2/MXks7/F7oUUmoBEAbmD6AChAALGltvJkNdEkjk+DvhBHpCF77MSYZI4GQNV6k/o4RrOpTZ2BdBzsIQEAtE7ASeCuCMSNAriKgk7TcC5qeHLbOAMuJ+AI4ktK8NDJ25n7HGSvCKTu42G+PgCXdiA38DbMB7laY+N1YbxfV6NeFwXgAkDskQtgaypxkOZ3ZzFyAeTiGRwAAH6vWUuTGCaAiwocM/040zQaQN2gAeh8SSYN4DLNGu1qQ1TseQYdmOMEPMAUBWjFBKh72Lk3GUJll1hMAAoAO+bABJyiASJuOrApDLgn6MuC7xoA4H/jrcpkCxMwYWgA0z2IQFM1fpyaAQB0mmQN7L0aYhKpOjjn8Xvd8/Q3gcRwHQ+AowEkDgDYg/kgNxgAYALYC3FwnYBZwoAcJiD1Q+hMgD0MTMDgA2g0jKlBcw8J3ZyP0zgLObkAHA1AFwVYlmkCdDM02kTRAA7KefzmGTY5eJKBepkA13smGJhMgH2YD3Ia6CvP7sPkAbh8ADRzcT4jtTZLWXCdBrAb0Vjk2GwXAOBj77ikX3fh+C1vAAC6oSbmZALU2wAAJ2vutx1zvjAHHkCMdPUBlPQQQWtFQesens9PYkhDppwKmW0IB442+AB2ZEYBuCaACwDGaNR6HQBsQRJ85En3qQAA/5NlHBl4R3jwAKZD76rHIxiHgysKoAMAkwmwBuYKdClr7u9tGLeoxWQg+Z39TclACZgrAuk0ABoFOMLjYcSGuAAaNdl+asnIGmmwqbdnePa5UQCuCUC1kJkGbsMsaK5LeGfY9F5yhEcuwDTNfI9gmAuuXADdOrKFAbfC9HBRq+FSTNnOm2kZEXU/azLQXhQAxmfMBQCCkKe2YTEcmNEJGDN4AFM0UQCf1mAzLQQn8Tun4GJcImxqL9ExAV25AFwNIGKaADo+Sa0fx2QFzwiAzV+3AwWAozUDbutHbjIB2lEQZJjGqWYLA/pQgXW5ALbGIJzegEFal7Gak9pVEShh8ACma0hDXQYNYIom+7M/qcDbeHj+bfT9WPJtbPYtN55IqcCT2/Dg+0FzfbqYSQTi1ASc4hEFoJ2B6kG1bzsAcKIAPk7A6ZroQpdBA5isCSf3ZzbgMOCn7LtMgOUoAIwAfYca32SgdtRYXx9V+Drh1q8O7oIgeQIAlwcQpHXRaaRXMAHApyJQZAGA88i6qCERp7/GZIzG/s/iAxDjsxgFgD01PgCf/oByo7WrM/A06ClQKa5zJYNsEjN4AD5hwDGa3w0mQN+YANx0YJcTcJrGtKgZ0pjXhkZPhUhR/8/vxzH5bsZMQLpn/3cY0lM2An6RAdN7C9v08CJkdCii8n6ObCtfJ6CPBsCpBxCkbwFgukcykKkvgKmOwSCMVF2HDu7+rB48sUUAkK+9AobWYHXw7wwE5H3xGysVhG7KSeLwKQo6RqM+3h02a9sBgEsFTpgaQKLxASxTgjH5rWbP+VKBxb/n6ABAsow4BUFtSNNdAM67zgToytEECBpA34YBXclA04Ff1m26IR24DFWYHgG/1mCmCMANJgB4y4MDYGsPPrpAABA5wje+yUA0JTk4AdvrBEw8fACcsuCTNSDeVRIAWGjQun3SgZt6LNILzAR3D0BXFEAM/o/6eaCu0ywIrg+gzggDxo5cgCD5RgGytAc3zeEkDbDMR5ZdkcdjQ4vZzQkBqib6WBMATAJ98QAfDUBcYEY/D9ZoEi7stsTrJ0PvRpgcHkAcAKAwGsB0jc/HNIeHE1+XWB93lGA8DsF7baU3YEwT9uhFTrX4ALhhQCH/LMCAfTOVp6DREuxuDOnYNABOCOkg4FUECpKPE7AO/q3B5BzaktLOTuW/qBUKrXfNEozHhY7T3qYBUC7DeiYAGKXJu/dtD160dsuu4oyTPZyABwGvMUjWRI8NoBxtqvvKCUiB+TJHFIDT4VnN1Vi0ROPxO9B37eb661Qf3SImANgZmktZJRlNAHGRL5VkYCdncALmTQUWSU0v4m+Lv5sGAPBKBroBeteWPLDDxuNtpgZgqgosgfFx9XfpRZa2cAE4FYHUjKlvl2Rgp0Dv4h3DPaIAM3O4hzuU3+1GtA8mQG/vtY8JMLyDxmJt6F1uzLczkDycp9kAYACyhCLLho8NDgjaCnt6iQCA2x58lEYtbVUDGIheaBVA3woA4N0ZqJMBYCT0rjjs8gPo+niI75/pAoAbQV8QhGsCyO++UGIAaLU5qI8srUll7QoAAEdCa70BOwkALlDWSJZkoMjE0dFd7AwwVwTiOAHVSdikQwFAfeY/t3j9ZUlosY6RC7XUlKguIxpqTCgJZTXPikCc9uDTOlwDeNDhl+NsfgkA67sA4MsZIwFU1RByUgkG91porjXgqwG0CgDCI/s+iUu/Sby/dcW0OrtCGgA3HXgy9K4VMaJDxmEtaK5f4CsqCLxOf193wRURKSLPdOBYM2G3lGCAjyVpxuLv1h5RgD/ncA8zyeJV/QofQPvrLRTdBHBpAGcrn5Vz2ClNWA42OACz1AOYwQEAIY8ZAMCnVoCkWC5S8AEWhRFuU0DgdrAXZKiTKEAeLLKhCujWFBLLKtBcXbgoJKu+1gBcALByKnOhpwjrlA4ah6sMGjm3epe6dn7EBYBroXczTl8NQCLx0JIMtKgwPMRBDhmlMQHyKgkm8s5Fyactif1Pqcf/Jt8TrK5PViQd+ArHd/aAzuu/+HLG7Fxaq1PrGLWhb7eGi82hAlNv7EUdNBljCBrnpQGYZHVCzKojIUS+f7kSNfhuB4YBaZGPiRXRfqR8HnpXwzYBAFjelwCwBhcANlNUYm5z0NjAPX62gyZklCaR5NY2Xm8pNKNUDUCGVzdV5khGDpbtcB7ArysGACdrNPEsyUBifTypu4bt4m84NnrE0ACkGbB+hwGA6gRst1Pub2Q8b1eiNVQ72L5Dw4BSrqwYAMyxROS4yUAyN+dKXwC4Dnp3ZzWZAboIgLowj+yQCTlQYwL8sQ9OATVC8X9KYlIXiR7sQ6I5ok35SiUd60M0h0qVAGA5Ep3y5QHEJAPwq74AMEJjAviGAXuVICq5bKT4RiSyXtjmawqqsOjicgJuaDUzsUYmWvai3zWVDxVacRm7Em+AZk1d2QTjKgQAY8Ddq5PLAhQHxWq+ALAY9JQg4jQjiCw3LMoQL9khEyNO4HcwPi8KqKzQT/exLwKQCgBDDNlxvynpWB+AXvAuDO0NrBAAXGs5cMGTBjzHdB3XTdzqSAoyZQPS98RJ9fUOmpyBBViMn0YAkCfkQgWMniN+iqklH+9FoFq2/wAM93Io+C4QEPM/PisAjNN4Ym25ALa+gneHBJfc5WdKGHCCwYEr5uUmTXQhtCovrgwmJjUn689WEHT7rACwiiYji2P/67yRNTy1wgTnrwlsQF57icyLCgDfQ5NMvH5uGL9CyjUWp7pvMtAHNm2VczOPGzQAn5qBMhPpvDC5fSL3EvNrosI2VP0Gb4axKpwsAz31IWJwl+l32f/WuhycG7qUkQuQGLz/9Gb+U1F7rq/lh4pvoAudaQOQCloj6uGSYbwKJcdYTn+bBgAG+/+wVgFgFAk3ZfUByAU5Kkxy20UUFv0Oov9xJJuRhnY/EcarUDLXElL30QKk2b18qwAgMq3mtcgDUCMETwUtoE9kYwxZDiPkGlpbfvkwVoVK/Y2YoXWOCeCsV+mTkuhKB7bdbEz4818Pk91WGYp2ZA3Dg0fj6/soySVSRVw0jFehTv/Iklvj4wQUc3tiXgCwGzRXzeFUBIoN2oH4+3CY7LbKJGiuWSCjAMui40/O5ewwVoWRPaGn9gO3ApcLAD6fFwCIMMIzDHWE21YsIrTWIPnKX8lYP6C8tx00Cr8KUNgijFWhIjc1S8TNlwfwHw5ZzecGvwf6UmE+uQKqs/DvYdJblsOh0eLqTfQeqxWdVFAOY11s2QH3lq4ID8fW1732c861fW5yNWguT+XLA9A5Bw8Mk99SvHgBNFd8lQUf7iaOpPvCeBVa7lSyPWNwd+KmApqI21Z5A4CQaWCuTxYD32Mp33+yYgkeecp2ikNPLh5Z8ulqMifTwngVVnZScjoiDxPAZmo/xL2+783uAu4CBTYNgN64WMBHhkWQ2WmklouqYxhJvLcfJxc8SCHkHgLkiUMDAIcJIH7r2HYBgJBHwNw4xKYB6ByEEfLWlwgLwSrrY374UEVj2luJ6UsAGEnSlh/BhKEwhsWUL0FzxSOO6eyy/0UNheXaCQBfAXujQq7KolbV+U1YDEY5DGP5ddzwE5TFQ0uCBZ9KuXw4T0JzwZPIY/ProgDa0t95A8AAjB9HDAAA4NUSiLhOiwrK38kYvqAw/WqKml9DezKMWTnkXEKgiyz8GVfRD/l3gS+zsxX7s86wVxIGAMjTa3JYFFp5h5hX85T35igOpJeCQ7U0shaJ4OgAgKv+q38v9b2XVh7iAeD3DYjBXU5MLOTNK7ogVsVQkAiziirAanOQeWQMP1TeEwU/T0/lMmiUcg+bqzynf42wY1UAAM8woPyNDfsSAIZqAICTC2B7gEcqmij0C2XsaoQqPY+M00dtuP7KBkfsYhatQqdqirn7LH5PfX0J9B2FgjCNsm1vQ+8uWiYTgKtV35Xlflp9mPvBXhXIRVukGoPQAsZXcFE8Dc19FLqVDfkW0ZTyLOIxEDkCNQSascRDLerSvU+ci5+DRn9CcZ9PpLIuvr4i0sW78f1BynfU3ou7VxwALlXmOQJ7LU3ag8PEEhS/NaQ/AGAo6JuBuDoL27SABRXjqA8k6dbSK7wyvv8g5NuOXJXNCZFIBZe/KJtW7Uf4G3I/v8DXvwPNbcx/ha9vRKIVd1V4828O+toaPhqAzjy4P+s95ZXEkLV2mamRyGMVSlMdiLa/esrXlBP0UGUjdiEfIK9r765xxsp7+pBoJUvjezPIwr0RX/81mcM/4OvDCHnstYpu/kWQoVfPCACx5dDctz8BYCPlBOPkLbvajckFN70iC2NR6N0CvK6o1gPQdhabdZOcrz1cAwDC9FhSiS7I11fH79xOwOp3Bs3gLiVhST31XqkoAPxS0e5oYhwnCmAyD2a0cl952jV1B6PJJ1VYboKzK7I4Xofm/P3uPmJHDiNzsABPKhWUZGeZZfA7t5C5moSv/1yxVcXf32s0gKgVdbXEcjTZ5LpCOhwAoHtKzMvaRQCADUlYw5UIZNIMdEDwpQoskN+S039uH133i2T8/0Ick2oZN+oDkGB1krLI1Y1+Cb6+gaIBqK9Xicb9Lpib58YacABwVwQSr/201fvL80Evt4CAyzywlUB6DYkTnbxIPo200G5k+g3uw2tfj/P2GuEf7A+NsmLz8N/y9XVSeR6/82gqn8TXhdlwB55K/8TPye/8BF+/TdEkqmL33+845V1MQJMJIKIzqxQJAFbTxDc5TEDb5pef+6smttyp/oD+Wqim+1nU4Lg09URcPMT6/yc/JRtbpwXEBvPABQCX5XGPeT/w8WCvFxA7Yp2mwiHi9DgtLKggJZL9SJqvaY3rgAEcPgDxd9MiAsBADHV0Q+/y0xHwqgmZCBFCHd0uLKwgJRCpDccadd92+tcdB6eu1VuhAECGBRdokoWSFgEgwhDSemGBBSm4XMXwg8UGH4DLBJif5x5oZw57DXiVgjgxz0ghyLwCoZptkOLK98Fc+yJ2mAAmJ6D6/tfzvN92DsQllvCfbYBcnOgIU2S3DYstSMFkHPRuveZqnsOpCCTNgxvzvud2DsbSGC5yOTNMiBhbCBOys23QBIIUyenXhf4vXeTLtfltJoA89NYuEwAI2YowymKmBhA50FO+9gamn4YFGKS/k3zec8TxIwYI1EHfU7MGPe3dSgUAQr4N7tbhHA3ApD28jYy2sBCD9IcIwtPLYK+TaXIC0s2vW/d1pF8PKCsADEAijynn2UQDThxMQjXxRLRB2jksxiB9LJ9SWJEu/ktk0IRjR56AMHXXKDsAbA/NXWk5GYE+RKIaUiO3D4sySB/J6kh5jgwJb7Z1bfMB0EIfo9r5HH05YD9mcAPoJgdmiFCmWb6GPISwQIO0U1bGPIiageXH9QFEliiA+P817X6Wvi58cSvTDLDFQ3UIW4fmqjbBHAjSzpp+fzNsZlsdDB1QRBYQEIfZip0EALKQ5Ezg9RRIwC+XQFXDRCONMyuWeRak/fIJaJRit0WxXJV7I0YugPj3yL54pv4YxCUw7zzKsMltZZHogHZjHnsIEwbJQ8Q6eg7XlS0qlVh4ABwmoJDz++q5+tOB8iJxoHCZgNyehPK3RT77mLCAg7ToxH7Lks/P7Ydh0wCkH+vP0Iel8fu7UsrrmsgAxwSIGe9RbeDCkKseJIOMgEYvBlf/vsiS6+LKB5C/+xKaGQOqAAADMKf5bYcnNfF8T9eBWKKrSKNcNCzqIEz5ATSXObPV7YsYJoApDCiu8UEqX+jrZyzCIA9GhI0YA8nxD8QW1UsM9MMhVBjEIUtBo9ipTd3nagC05L0uCtDd7nh/kQFArZ7CVfNdGoAOeaUWUEPe9jFhoQfRiKg/OdfAzecAALfUnQoAp/bX8xZp4MdD79LitmQgk3NQBwB1g/p1N/oiwsIPIkRUMH6BYatnMQF0ICAOo6v685mLNPiCKHQ6YVdxw4CulOPIoiWI6kWiwGJoXFldEanrP0Q6ua02f5bOPabDSvz9OfRzM9wiTsYBSOTh9BzkAIAu08rkiLm8L9hXQQol22J8n9Ogg6MB2MKAasivEE1wizopX8GTOc5BA7BxrXXFRp6FajQjqbqIMvMTwNyl12YCmPxPkYOsJmVGUcahyBM0FHqKLHDIFtx6a5zPCQ3kT9BohR02S2cSe+ZC70adtlh+lDEKQOtaivThVQIA8EQU+ngVmpsq2qIAOiIRFwBMoCDadm0SNk1HyHKpXGGgoSceh0TCcBAmGoefSB9es0hjUoZJGwQ9RRe4LEGdE7DO2PA6VK9hnHZyKluHTVRaEfUjnzBs0sQDAEyefZd/SkQX1i7auJSp+MJjBhDg8gC4GkCiAY66AgTTQoJRqURU07kEzbpugyPPpS0mjChAZNE+hV9p3SKOT5kmchCiqAwTQkYASBzMwYQBMOL/d6YyGqrRs7CsefsiJXy+B5M0YpqFru/I367j5l+jqONUtkkVLZdmGxIyIgYAcE0GDtFImgf/hkb322AeFENWSuVkaNSJjMDelNYnYYejAdDfe7poNn/ZAWAAEifEBL/r2NytOgET5smgmgkinnxtKl9NZdWwGftUdkBW3UILmcxVjSryIJTZOAJiLfwMSlCQpswTvi76BepgL84Qe4RwXN2KuJEDCQiPILtxh/5mfHWorI4Ze0+DubtOYkkzp8I1JV1Vf88syxh2AoXzSk0OAaf1kuvU5+Qa2JyH1IEo0p5vSOWEVLYJgNASZXxPzNZbAD0VekyqvcnLb/osp/CMDgDkXF+A9xgAoA/la8jjrnvmAiQep3rM8AybuAi6BSYW7z0IYKLry46pLBs2uFE2xs31MhPUXZ2pYw8egO0wUMljR5ZtXDtpgXwObfA60wmYgB8ngFv7LfHQENSKRfIUEZGOqamcmMouFY8yfAY1prugp/kGx7HH0QZ8eACJgwr8Mmp1AwIA9H8u96MEBGzJQNySYhHwy5D5VjE2dYipKyeLKGJyMTTqJnRyRSPhwT8Qk7JeUCItHB+MT/FYjg9ABx6RZl39tchhvqoBgEzy+LFCGnJleOkonq5ipFz/QWKxJ23/d7VG/1WHkJFEjUbRw+F7qdzu8OX4OmRdoGvzAbiuLe/xirIDcqcnfDzLWFSRh7qeME56zoJ0tUezEVWkKrwA88nXKtm8bJnKWdAoDS9Ddl0e9jyHt5FYnHgJ+BfupMlAglx0RCfsk063IUUPgm+ijdZtcdhFDnU+8rDxk4ybn6MJJAaq8vUFz1wUlXbOTeUfDB9L4jm2HB9NwpwPVxhQrKFZJQTdygKAWuTxPIM96aIJc2nEHJUUGIuUu3CpSlpDzkHR4vSX4glv875zfDKJp83v0q5sYUIdENSQ8dlRPpiqeZX3hkaDh5oj8SPxIBH5nja+GkDsoK4mBARuKEDkQFxfFLr8yOF4izNEUbJoWLaKUqb+ffLf3eiQ3LET90RV2WNXQu+e7pwwITe2zP0eh6XmYxZIEJjaj0SjzUjaLdfpxjm1XQxNjhbF/ZwkcP0CGj0tBwQA6CzZKZUHLad74kEV5vIKXNmHPpsltgBAHR2EfT2mwjE2j3nqu56bqxlwtQsXCYjOt6AXD+70fRAYZgBfh0ZLphrY67f7OKpcC5xjsybAJ7iY7mnLPhzHy8GvkrPLCeijYXEiARyNrIYe/tOhIh2kAgD05BScodCJfW3NmOFsapWpFhuIKzat4vo+Gr9zPEAqcfAmuE6/GPxCrpzW3c+hZliZtR82f7N8MpVrNA7CCPw99D4e6sTzs9xwl3BgrdbmMTuOgGYWrSXJyQTg/Bb9TB1P/dPwIBgQACCI4ODfqziCIiYpxdeRlWXDcOxp9d/tDA2Oc2TXcYtwJMAjWvmy/mzAIQFe1G/4VFXXetjsdtkKvcCvOFhkPmQWjs3rS2CxObtealNE4PsOTz8H/GLwr8oTt6hhCfkvNAp2VL5JbNjk/CpEh0GjwIcpKy3x4J/7aAU+GoCpLt0eOY/H4dC7tHaSQVWPoTWCEDdFW4b13kZ+wlJhTQcAyCqH4qkaGTYBt7gEV2V2Za+5gKcG+Xaf3QidpVnYd1yeRZwRBExjVENVf92wfgMA5CEiRDQSGgU9uPUGs9r7ruo1rg1XR2JQXtV4Hm2Bfpt4mD6u77u0qzomGwkT7jNhzQYAaGelGrHI3iQU49iyYH3CfdwQo41W+1BOz3ommLvq2Oi1XM++Kwc/NoQ+I7LxRTepU1JZOazPAAB9qRWMgUa/gDo0NzExbXgAv4o1PixB9TPv5vB8m+KJWvfUZnzYeglkq9AkQfdxNNFCvcUAAP0qYrNcBI3a9HVDFqJPXJ9LojF9vrvFTSG+O9fg94jBP4Tpk/NvCt+p3ZpugUa1pIFh7QUAKFr0YN9UrlPAwFZgJGHYvKYCF7bqRWKjLNnCc4wHcy0+HyKUTzjTVLmpG5/nPiQhrRjWWQCAsoDBttBoanIbpsq6Ohv70INNmy5qEQDEPS8w8CCyMhU5QEHZmK8gS1PkbgwK6ykAQCcAwh5ISHkcmvsIZKHVxpYU4a4Wklse8WD4ZeFA2BqriHbal+A4BfU+AEBHi2gldjA02pC/aslD4PQeoADwfgs8f1s33bw0ALnpRcHTGakcn8rmYU0EAKiybIb59cJ/8Dz0rmJk4x9QHsCTGa7/Wczt5+Q6cJiA6v3IZ/kwlT+gj2FwOOUDAASxZyoeiKm3N6NTUTrEpDdcV75MbLgbMhB+HvTgHSSGTV5TqNOChvtHaPQ3ODiQcwIABGldRHXaYdBoLSYKcszCWD0lxpzt+bsna/IdODH7eegzEAAleheMhUYdxtApOQBAkD4UUQ59DQSHH6aynafpMR9P7oVIIpqLtGehSVwNjeq4AnQOSmV//M7iYdwDAAQpv6yGSTOLhbEIABAkSJAOlv8HOib1/JuFBpoAAAAASUVORK5CYII=";var xa="linear-gradient(135deg,#3aa0ff 0%,#6a6ff6 52%,#8a4ff0 100%)",mA=[58,160,255],Dv=[106,111,246],fA=[138,79,240];function gA(e){let[t,r]=e<=.5?[mA,Dv]:[Dv,fA],o=e<=.5?e/.5:(e-.5)/.5,n=(i,a)=>Math.round(i+(a-i)*o);return`rgb(${n(t[0],r[0])},${n(t[1],r[1])},${n(t[2],r[2])})`}var Fl=Array.from({length:65},(e,t)=>{let r=t/64,o=Math.exp(-(((r-.5)/.16)**2)),n=Math.round((3+o*(.8+.2*Math.abs(Math.sin(t*1.9)))*153)*10)/10,i=(1.5+t%5*.2).toFixed(1),a=(Math.abs(r-.5)*.7).toFixed(2);return`<span style="height:${n}px;background:${gA(r)};opacity:${n<6?.92:1};animation:wave ${i}s ease-in-out ${a}s infinite"></span>`}).join("");function hA(e){let t=e.markUri??Cr,r=t?`<span class="mark" style="-webkit-mask:url(&quot;${t}&quot;) center/contain no-repeat;mask:url(&quot;${t}&quot;) center/contain no-repeat"></span>`:'<span class="mono">AC</span>',o=e.compact?"body{overflow:auto;align-items:flex-start}.card{margin:auto;padding:30px 28px 44px}.badge{height:140px;margin-bottom:22px}.orb{width:104px;height:104px}.mark{width:78px;height:78px}.glow{width:114px;height:114px;margin:-57px 0 0 -57px;background:radial-gradient(circle,rgba(34,197,94,0) 35px,rgba(34,197,94,.34) 40px,rgba(34,197,94,.12) 47px,rgba(34,197,94,0) 56px)}.bars{-webkit-mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px);mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px)}h1{font-size:32px}p{font-size:15px}":"";return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${Rt(e.title)}</title>
21
+ <style>
22
+ html,body{height:100%;margin:0}
23
+ body{background:#07070f;color:#e9e8f4;font-family:'Sora','Segoe UI',system-ui,sans-serif;display:flex;align-items:center;justify-content:center;overflow:hidden}
24
+ .aur{position:fixed;top:-140px;width:520px;height:340px;border-radius:50%;pointer-events:none;animation:aur 14s ease-in-out infinite}
25
+ .aur.a{left:8%;background:radial-gradient(closest-side,rgba(56,189,248,.16),transparent)}
26
+ .aur.b{left:38%;background:radial-gradient(closest-side,rgba(139,92,246,.18),transparent);animation-delay:-7s}
27
+ .dots{position:fixed;inset:0;pointer-events:none;background-image:radial-gradient(rgba(255,255,255,.045) 1px,transparent 1px);background-size:30px 30px;-webkit-mask-image:radial-gradient(ellipse 70% 100% at 50% 0%,#000,transparent);mask-image:radial-gradient(ellipse 70% 100% at 50% 0%,#000,transparent)}
28
+ .card{position:relative;text-align:center;padding:40px 28px;max-width:680px}
29
+ .badge{position:relative;width:min(640px,92vw);height:200px;margin:0 auto 34px}
30
+ .bars{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between;padding:0 20px;-webkit-mask-image:radial-gradient(circle at 50% 50%,transparent 54px,#000 80px);mask-image:radial-gradient(circle at 50% 50%,transparent 54px,#000 80px)}
31
+ .bars span{width:4px;border-radius:4px;flex:0 0 auto;transform-origin:center}
32
+ .orb{position:absolute;left:50%;top:50%;width:140px;height:140px;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center}
33
+ .glow{position:absolute;left:50%;top:50%;width:154px;height:154px;margin:-77px 0 0 -77px;border-radius:50%;background:radial-gradient(circle,rgba(34,197,94,0) 49px,rgba(34,197,94,.34) 55px,rgba(34,197,94,.12) 63px,rgba(34,197,94,0) 74px);filter:blur(2px);animation:glow 2.6s ease-in-out infinite}
34
+ .mark{position:relative;width:106px;height:106px;background:${xa};filter:drop-shadow(0 6px 16px rgba(0,0,0,.55))}
35
+ .mono{position:relative;font-weight:800;font-size:44px;letter-spacing:-1px;background:${xa};-webkit-background-clip:text;background-clip:text;color:transparent}
36
+ .eyebrow{font-family:'JetBrains Mono',ui-monospace,monospace;font-weight:700;font-size:13px;letter-spacing:2.6px;text-transform:uppercase;color:#7dd3fc;margin-bottom:14px}
37
+ h1{font-size:40px;font-weight:700;line-height:1.1;letter-spacing:-.02em;margin:0 0 14px}
38
+ p{font-size:17px;color:#9b9ab3;margin:0 auto;max-width:460px;line-height:1.65}
39
+ @keyframes wave{0%,100%{transform:scaleY(.82)}50%{transform:scaleY(1)}}
40
+ @keyframes glow{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.04)}}
41
+ @keyframes aur{0%,5%{opacity:0}12%,28%{opacity:1}38%,100%{opacity:0}}
42
+ @media (prefers-reduced-motion:reduce){*{animation:none!important}}
43
+ ${o}${e.extraCss??""}
44
+ </style></head>
45
+ <body><div class="aur a"></div><div class="aur b"></div><div class="dots"></div>
46
+ <div class="card">
47
+ <div class="badge" aria-hidden="true"><div class="bars">${Fl}</div><div class="orb"><span class="glow"></span>${r}</div></div>
48
+ <div class="eyebrow">AC Bridge</div>
49
+ <h1>${Rt(e.headline)}</h1><p>${Rt(e.sub)}</p>${e.extraBody??""}
50
+ </div>${vA(e.cleanPath)}</body></html>`}function vA(e){return!e||!/^\/[a-z0-9-]+$/.test(e)?"":`<script>try{history.replaceState(null,"","${e}")}catch(e){}</script>`}function Ml(e,t,r=Cr,o){return hA({title:e,headline:e,sub:t,markUri:r,...o?{cleanPath:o}:{}})}function Rt(e){return e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]??t)}var bA=(e,t,r)=>Ml(e,t,void 0,r);function Nv(e,t,r,o=12e4,n="/callback",i=bA,a){let s,l,u=new Promise((p,m)=>{s=p,l=m});u.catch(()=>{});let d=new Promise((p,m)=>{let f=e,g=yA((C,E)=>{let D=C.headers.host;if(D!==`127.0.0.1:${f}`&&D!==`localhost:${f}`){E.writeHead(400,{"content-type":"text/plain"}),E.end("bad host");return}let G=new URL(C.url??"/",`http://127.0.0.1:${f}`);if(a!==void 0&&G.pathname==="/"){Zo(E,200,a);return}if(G.pathname!==n){E.writeHead(404,{"content-type":"text/plain"}),E.end("not found");return}if(G.searchParams.get("state")!==t){Zo(E,400,i("Invalid request","This sign-in link isn\u2019t valid for this session.","/sign-in-failed"));return}let ae=G.searchParams.get("code"),X=G.searchParams.get("error_description")??G.searchParams.get("error");X?(Zo(E,400,i("Sign-in failed","You can return to AC Bridge and try again.","/sign-in-failed")),_(()=>m(new Error(X)))):ae?(Zo(E,200,i("Signed in","You're connected. Return to AC Bridge \u2014 you can close this tab.","/signed-in")),_(()=>p({code:ae}))):(Zo(E,400,i("Sign-in failed","You can return to AC Bridge and try again.","/sign-in-failed")),_(()=>m(new Error("No authorization code returned."))))}),y=setTimeout(()=>_(()=>m(new Error("Sign-in timed out."))),o),k=!1;function _(C){k||(k=!0,clearTimeout(y),r?.removeEventListener("abort",P),g.close(),C())}function P(){_(()=>m(new Error("Sign-in cancelled.")))}if(r?.aborted){_(()=>m(new Error("Sign-in cancelled."))),l(new Error("Sign-in cancelled."));return}r?.addEventListener("abort",P),g.on("error",C=>{l(C instanceof Error?C:new Error(String(C))),_(()=>m(C))}),g.listen(e,"127.0.0.1",()=>{let C=g.address();f=typeof C=="object"&&C!==null?C.port:e,s(f)})});return{port:u,result:d}}function Zo(e,t,r){e.writeHead(t,{"content-type":"text/html; charset=utf-8"}),e.end(r)}function Lv(e){let t=e;return t?.code==="EADDRINUSE"?"Port 8765 is in use \u2014 a sign-in may already be open in the AC Bridge app. Finish it there, or close it and retry.":t?.code==="EACCES"||t?.code==="EPERM"?"AC Bridge was blocked from opening port 8765 on this machine \u2014 permission was denied. Security software or a group policy is the usual cause; allow it, or sign in on another machine.":t?.message??String(e)}var xA=[{provider:"google",label:"Continue with Google"},{provider:"github",label:"Continue with GitHub"},{provider:"microsoft",label:"Continue with Microsoft"},{provider:"email",label:"Log in"}];function zv({cfg:e,state:t,codeChallenge:r,email:o,screenHint:n}){return xA.map(({provider:i,label:a})=>{let s=i!=="email"&&i!=="sso";return{provider:i,label:a,direct:s,url:ba({cfg:e,opts:s?{provider:i}:{provider:i,...o?{email:o}:{},...n?{screenHint:n}:{}},state:t,codeChallenge:r})}})}var kA={google:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M21.6 12.23c0-.68-.06-1.36-.18-2.02H12v3.82h5.4a4.6 4.6 0 0 1-2 3.02v2.5h3.24c1.9-1.75 2.96-4.33 2.96-7.32z" fill="#4285F4"/><path d="M12 22c2.7 0 4.96-.9 6.62-2.43l-3.24-2.5c-.9.6-2.05.96-3.38.96-2.6 0-4.8-1.76-5.58-4.12H3.06v2.58A10 10 0 0 0 12 22z" fill="#34A853"/><path d="M6.42 13.9a6 6 0 0 1 0-3.8V7.52H3.06a10 10 0 0 0 0 8.96z" fill="#FBBC05"/><path d="M12 5.98c1.47 0 2.79.5 3.83 1.5l2.86-2.86A10 10 0 0 0 3.06 7.52L6.42 10.1C7.2 7.74 9.4 5.98 12 5.98z" fill="#EA4335"/></svg>',github:'<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.91-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.53 2.34 1.09 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.65 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.38.2 2.4.1 2.65.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/></svg>',microsoft:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M3 3h8.5v8.5H3z" fill="#F25022"/><path d="M12.5 3H21v8.5h-8.5z" fill="#7FBA00"/><path d="M3 12.5h8.5V21H3z" fill="#00A4EF"/><path d="M12.5 12.5H21V21h-8.5z" fill="#FFB900"/></svg>'},wA='<svg class="arw" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>',Uv=`-webkit-mask:url("${Cr}") center/contain no-repeat;mask:url("${Cr}") center/contain no-repeat`,Go="https://ac-bridge.com",SA=`*{box-sizing:border-box}
51
+ :root{--ac-bg:#07070f;--ac-surface-2:rgba(255,255,255,.03);--ac-border:rgba(148,132,255,.16);--ac-hairline:rgba(255,255,255,.06);--ac-text:#e9e8f4;--ac-dim:#9b9ab3;--ac-mute:#80809d;--ac-accent:#38bdf8;--ac-accent-soft:#7dd3fc;--ac-accent-3:#34d399;--ac-input:rgba(148,132,255,.16);--ac-brand-grad:${xa};--ac-brand-grad-text:linear-gradient(92deg,#67e8f9,#38bdf8 40%,#a78bfa 75%,#c084fc)}
52
+ html{background:var(--ac-bg)}
53
+ body{margin:0;min-height:100vh;background:var(--ac-bg);color:var(--ac-text);font-family:'Sora',ui-sans-serif,system-ui,sans-serif;-webkit-font-smoothing:antialiased}
54
+ .mono{font-family:'Space Mono',ui-monospace,'SFMono-Regular',monospace}
55
+ .page{display:flex;min-height:100vh;flex-direction:column}
56
+ .split{flex:1}
57
+ @media(min-width:1024px){.split{display:grid;grid-template-columns:1fr 1fr}}
58
+
59
+ /* \u2500\u2500 AuthAside: the left brand panel \u2500\u2500 */
60
+ .aside{position:relative;display:flex;flex-direction:column;overflow:hidden;background:linear-gradient(160deg,rgba(56,189,248,.08),rgba(139,92,246,.12));padding:32px 32px 48px}
61
+ @media(min-width:1024px){.aside{min-height:100vh;padding:40px 56px 48px}}
62
+ .mesh{pointer-events:none;position:absolute;inset:0;overflow:hidden}
63
+ .mesh .dots{position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.045) 1px,transparent 1px);background-size:30px 30px;-webkit-mask-image:radial-gradient(ellipse 70% 100% at 20% 0%,#000,transparent);mask-image:radial-gradient(ellipse 70% 100% at 20% 0%,#000,transparent)}
64
+ .mesh .aur{position:absolute;top:-160px;width:640px;height:400px;animation:aur 14s ease-in-out infinite}
65
+ .mesh .aur.a{left:8%;background:radial-gradient(closest-side,rgba(56,189,248,.16),transparent)}
66
+ .mesh .aur.b{left:24%;background:radial-gradient(closest-side,rgba(139,92,246,.18),transparent);animation-delay:-7s}
67
+ .lockup{position:relative;display:inline-flex;width:fit-content;align-items:center;gap:10px;color:var(--ac-text);text-decoration:none}
68
+ .lockup .mk{display:block;flex-shrink:0;width:30px;height:30px;background:var(--ac-brand-grad);${Uv}}
69
+ .lockup .wm{font-weight:700;font-size:15px;letter-spacing:-.01em;line-height:1}
70
+ .mid{position:relative;display:flex;flex:1;flex-direction:column;justify-content:center;padding:40px 0}
71
+
72
+ /* VoiceBadge \u2014 640x200, 65 bars, orb hole punched by a mask (numbers are the component's verbatim) */
73
+ .badge{position:relative;margin:0 auto 36px;width:100%;max-width:640px;height:200px}
74
+ .bars{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between;padding:0 20px;-webkit-mask-image:radial-gradient(circle at 50% 50%,transparent 54px,#000 80px);mask-image:radial-gradient(circle at 50% 50%,transparent 54px,#000 80px)}
75
+ .bars span{width:4px;border-radius:4px;flex:0 0 auto;transform-origin:center}
76
+ .orb{position:absolute;left:50%;top:50%;display:flex;width:140px;height:140px;transform:translate(-50%,-50%);align-items:center;justify-content:center}
77
+ .orb .glow{position:absolute;width:154px;height:154px;border-radius:50%;background:radial-gradient(circle,rgba(34,197,94,0) 49px,rgba(34,197,94,.34) 55px,rgba(34,197,94,.12) 63px,rgba(34,197,94,0) 74px);filter:blur(2px);animation:glow 2.6s ease-in-out infinite}
78
+ .orb .mk{position:relative;width:106px;height:106px;background:var(--ac-brand-grad);${Uv};filter:drop-shadow(0 6px 16px rgba(0,0,0,.55))}
79
+
80
+ .eyebrow{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.16em;color:var(--ac-accent-soft)}
81
+ .aside .eyebrow{margin-bottom:16px}
82
+ h1{margin:0;font-size:38px;font-weight:700;line-height:1.05;letter-spacing:-.02em;color:var(--ac-text)}
83
+ h1 .grad{background:var(--ac-brand-grad-text);-webkit-background-clip:text;background-clip:text;color:transparent}
84
+ .lede{margin:16px 0 0;max-width:440px;font-size:15px;line-height:1.625;color:var(--ac-dim)}
85
+ .livepill{margin-top:24px;display:inline-flex;width:fit-content;align-items:center;gap:10px;border-radius:999px;border:1px solid var(--ac-border);background:var(--ac-surface-2);padding:8px 14px;font-size:11px;color:var(--ac-dim)}
86
+ .livepill .dot{width:8px;height:8px;flex:0 0 auto;border-radius:50%;background:var(--ac-accent-3);animation:pulse 2s ease-in-out infinite}
87
+ .caps{margin-top:32px;font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:var(--ac-mute)}
88
+
89
+ /* \u2500\u2500 The sign-in column \u2500\u2500 */
90
+ .right{position:relative;display:flex;min-height:100vh;flex-direction:column;padding:24px}
91
+ @media(min-width:640px){.right{padding:24px 40px}}
92
+ .topright{display:flex;justify-content:flex-end;font-size:13px;color:var(--ac-dim)}
93
+ .topright a,.newto a{font-weight:600;color:var(--ac-accent-soft);text-decoration:none}
94
+ .topright a:hover,.newto a:hover{color:var(--ac-accent)}
95
+ .center{display:flex;flex:1;align-items:center;justify-content:center;padding:32px 0}
96
+ .card{width:100%;max-width:420px}
97
+ h2{margin:12px 0 0;font-size:26px;font-weight:700;letter-spacing:-.02em;color:var(--ac-text)}
98
+ .sub{margin:6px 0 0;font-size:14px;color:var(--ac-dim)}
99
+ .ssos{margin-top:24px;display:flex;flex-direction:column;gap:10px}
100
+ a.sso{display:flex;width:100%;align-items:center;gap:12px;border-radius:28px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.04);padding:12px 16px;font-size:15px;font-weight:500;color:var(--ac-text);text-decoration:none;transition:background .15s,border-color .15s}
101
+ a.sso:hover{border-color:rgba(255,255,255,.24);background:rgba(255,255,255,.09)}
102
+ a.sso:focus-visible,.inp:focus-visible,.cta:focus-visible{outline:2px solid var(--ac-accent);outline-offset:2px}
103
+ a.sso .arw{margin-left:auto;flex:0 0 auto;color:var(--ac-mute)}
104
+ .rule{margin:20px 0;display:flex;align-items:center;gap:12px}
105
+ .rule .hair{height:1px;flex:1;background:var(--ac-hairline)}
106
+ .rule .rl{font-size:10.5px;text-transform:uppercase;letter-spacing:.16em;color:var(--ac-mute)}
107
+ form.email{display:flex;flex-direction:column;gap:12px}
108
+ form.email label{display:flex;flex-direction:column;gap:6px}
109
+ form.email .flt{font-size:10.5px;text-transform:uppercase;letter-spacing:.1em;color:var(--ac-mute)}
110
+ .inp{height:36px;width:100%;min-width:0;border-radius:12px;border:1px solid var(--ac-input);background:rgba(148,132,255,.05);padding:4px 12px;font-family:inherit;font-size:14px;color:var(--ac-text);outline:none;transition:border-color .15s,box-shadow .15s}
111
+ .inp::placeholder{color:var(--ac-mute)}
112
+ .inp:focus{border-color:var(--ac-accent);box-shadow:0 0 0 3px rgba(56,189,248,.5)}
113
+ .cta{height:48px;width:100%;border:0;border-radius:28px;background:linear-gradient(90deg,#38bdf8,#8b5cf6);color:#fff;font-family:inherit;font-size:15px;font-weight:500;cursor:pointer;box-shadow:0 10px 26px -8px rgba(88,80,236,.6);transition:transform .15s,filter .15s,box-shadow .15s}
114
+ .cta:hover{transform:translateY(-2px);filter:brightness(1.1);box-shadow:0 16px 34px -10px rgba(88,80,236,.7)}
115
+ .newto{margin:20px 0 0;text-align:center;font-size:13px;color:var(--ac-dim)}
116
+
117
+ /* \u2500\u2500 SiteFooter \u2500\u2500 */
118
+ .foot{border-top:1px solid var(--ac-hairline);padding:22px 20px 26px}
119
+ @media(min-width:640px){.foot{padding-left:32px;padding-right:32px}}
120
+ @media(min-width:1024px){.foot{padding-left:40px;padding-right:40px}}
121
+ .foot .inner{margin:0 auto;display:flex;max-width:1400px;flex-direction:column;gap:12px}
122
+ .foot .row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 18px}
123
+ .foot .lockup .mk{width:26px;height:26px}
124
+ .foot nav{display:flex;flex-wrap:wrap;align-items:center;gap:6px 20px;font-size:13px;color:var(--ac-mute)}
125
+ .foot nav a{color:inherit;text-decoration:none;transition:color .15s}
126
+ .foot nav a:hover{color:var(--ac-text)}
127
+ .foot .cr{font-size:11.5px;color:var(--ac-mute)}
128
+ .foot .disc{font-size:12.5px;color:var(--ac-mute)}
129
+
130
+ @keyframes wave{0%,100%{transform:scaleY(.82)}50%{transform:scaleY(1)}}
131
+ @keyframes glow{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.04)}}
132
+ @keyframes aur{0%,5%{opacity:0}12%,28%{opacity:1}38%,100%{opacity:0}}
133
+ @keyframes pulse{0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(56,189,248,.6)}50%{opacity:.5;box-shadow:0 0 0 7px rgba(56,189,248,0)}}
134
+ @media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}`,_A=`<a class="lockup" href="${Go}/" data-testid="nav-brand" aria-label="AC Bridge home"><span class="mk"></span><span class="wm">AC Bridge</span></a>`,$A='<span class="lockup"><span class="mk"></span><span class="wm">AC Bridge</span></span>';function IA(e){return`<a class="sso" data-testid="oauth-${e.provider}" href="${Rt(e.url)}">${kA[e.provider]??""}<span>${Rt(e.label)}</span>${wA}</a>`}function AA(e){let t=new URL(e.url),r=[...t.searchParams].filter(([o])=>o!=="login_hint").map(([o,n])=>`<input type="hidden" name="${Rt(o)}" value="${Rt(n)}">`).join("");return`<form class="email" method="get" action="${Rt(`${t.origin}${t.pathname}`)}">${r}<label><span class="flt mono">Email</span><input class="inp" data-testid="email-input" name="login_hint" type="email" placeholder="you@email.com" autocomplete="email" required></label><button class="cta" data-testid="continue-email" type="submit">${Rt(e.label)}</button></form>`}function jv(e){let t=e.filter(o=>o.direct),r=e.find(o=>o.provider==="email");return`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Log in | AC Bridge</title>
135
+ <style>${SA}</style></head>
136
+ <body><div class="page" data-testid="login-page"><div class="split">
137
+
138
+ <aside class="aside" data-testid="login-session-panel">
139
+ <div class="mesh" aria-hidden="true"><div class="dots"></div><div class="aur a"></div><div class="aur b"></div></div>
140
+ ${_A}
141
+ <div class="mid">
142
+ <div class="badge" aria-hidden="true"><div class="bars">${Fl}</div><div class="orb"><span class="glow"></span><span class="mk"></span></div></div>
143
+ <div class="eyebrow mono">CLAUDE CODE + CODEX</div>
144
+ <h1>Welcome back to<br><span class="grad">the bridge.</span></h1>
145
+ <p class="lede">Your sessions are still running. Log in to pick up exactly where you left off, and see at a glance what your agents did while you were away.</p>
146
+ <div class="livepill mono"><span class="dot"></span>2 sessions live &middot; lamp is green (finished)</div>
147
+ <div class="caps mono">YOUR ROOM SHOWS EVERY AGENT STATE</div>
148
+ </div>
149
+ </aside>
150
+
151
+ <div class="right">
152
+ <div class="topright"><span>New here? <a href="${Go}/register" data-testid="nav-register">Sign up free</a></span></div>
153
+ <div class="center"><div class="card">
154
+ <div class="eyebrow mono">WELCOME BACK</div>
155
+ <h2>Log in</h2>
156
+ <p class="sub">Pick up your sessions right where you left them.</p>
157
+ <div class="ssos">${t.map(IA).join("")}</div>
158
+ <div class="rule"><span class="hair"></span><span class="rl mono">or with email</span><span class="hair"></span></div>
159
+ ${r?AA(r):""}
160
+ <p class="newto">New to AC Bridge? <a href="${Go}/register">Create a free account</a></p>
161
+ </div></div>
162
+ </div>
163
+
164
+ </div>
165
+ <footer class="foot" data-testid="site-footer"><div class="inner">
166
+ <div class="row">${$A}<nav aria-label="Footer"><a href="mailto:support@ac-bridge.com">support@ac-bridge.com</a><a href="${Go}/privacy">Privacy</a><a href="${Go}/terms">Terms</a></nav><span class="cr mono">(c) 2026 AC BRIDGE</span></div>
167
+ <span class="disc">Works with Claude Code and Codex. Not affiliated with or endorsed by Anthropic or OpenAI.</span>
168
+ </div></footer>
169
+ </div></body></html>`}import{spawn as Bl}from"node:child_process";function EA(e,t=Bl){return new Promise(r=>{let o=!1,n=s=>{o||(o=!0,r(s))},i=t("powershell.exe",["-NoProfile","-NonInteractive","-Command","$u=[Console]::In.ReadLine(); try { Start-Process $u -ErrorAction Stop } catch { exit 1 }"],{stdio:["pipe","ignore","ignore"]}),a=setTimeout(()=>{try{i.kill()}catch{}n(!1)},8e3);a.unref?.(),i.on("error",()=>{clearTimeout(a),n(!1)}),i.on("exit",s=>{clearTimeout(a),n(s===0)}),i.stdin?.on("error",()=>{}),i.stdin?.end(`${e}
170
+ `)})}function PA(e,t=Bl){return new Promise(r=>{let o=t("cmd.exe",["/c","start","",e.replace(/&/g,"^&")],{detached:!0,stdio:"ignore"});o.on("error",()=>r(!1)),o.on("spawn",()=>{o.unref(),r(!0)})})}var CA=1200;function Fv(e,t,r,o){return new Promise(n=>{let i=!1,a=u=>{i||(i=!0,n(u))},s=r(e,[t],{detached:!0,stdio:"ignore"}),l=setTimeout(()=>a(!0),o);l.unref?.(),s.on("error",()=>{clearTimeout(l),a(!1)}),s.on("exit",u=>{clearTimeout(l),a(u===0)}),s.on("spawn",()=>s.unref())})}async function ka(e,t){let r=t.platform??process.platform,o=t.spawnImpl??Bl;if(r==="win32"||t.isWsl)return await EA(e,o)?!0:PA(e,o);let n=t.graceMs??CA;return Fv(r==="darwin"?"open":"xdg-open",e,o,n)}function Vo(){return oa().length>0}function TA(){jo()}async function Mv(e,t,r){let o=(e??"").replace(/\/+$/,""),n=r?.fetchImpl??fetch;if(o&&t)try{await n(`${o}/node/revoke`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${t}`},body:"{}",signal:AbortSignal.timeout(3e3)})}catch{}(r?.clear??TA)()}var RA=4,OA=1500,DA=e=>new Promise(t=>setTimeout(t,e)),Wo=null;function Bv(e,t,r={}){if((r.hasCredential??Vo)())return Promise.resolve(!0);if(Wo)return Wo;let n=r.attempts??RA,i=r.retryMs??OA,a=r.provision??Ph,s=r.claim??Ch,l=r.store??zo,u=r.log??(d=>console.error(d));return Wo=(async()=>{let d="no attempt made";try{for(let p=1;p<=n;p++){p>1&&await DA(i);let m=t();if(!m){d="no sign-in token available yet";continue}try{let f=await a(e,m),g=await s(e,f);if(!g.access_token||!g.refresh_token)throw new Error("claim returned an incomplete pair");return l(g),!0}catch(f){d=f instanceof Error?f.message:String(f)}}return u(`[auth] node-credential provisioning failed after ${n} attempts (hub will fall back to the app-refreshed token): ${d}`),!1}finally{Wo=null}})(),Wo}async function Hv(e){let t=Cv(),r=Tv(),o=e.chooser?jv(zv({cfg:e.cfg,state:r,codeChallenge:t.challenge,...e.opts.email?{email:e.opts.email}:{},...e.opts.screenHint?{screenHint:e.opts.screenHint}:{}})):void 0,i=(e.listen??((d,p,m,f,g)=>Nv(d,p,m,f,void 0,void 0,g)))(e.cfg.port,r,e.signal,e.timeoutMs??18e4,o),a=e.openUrl??(d=>ka(d,{isWsl:!1})),s;o?(i.result.catch(()=>{}),s=`http://127.0.0.1:${await i.port}/`):s=ba({cfg:e.cfg,opts:e.opts,state:r,codeChallenge:t.challenge}),await a(s)||e.onBrowserFail?.(s);let{code:l}=await i.result;return(e.exchange??((d,p,m)=>Ov(d,p,m)))(e.cfg,l,t.verifier)}import{spawn as NA}from"node:child_process";import{existsSync as Zv}from"node:fs";import wa from"node:path";function Tr(e={}){let t=e.platform??process.platform,r=e.env??(u=>process.env[u]),o=e.read??O,n=e.exists??Zv,i=u=>({path:u,darwinBundle:t==="darwin"&&u.endsWith(".app")}),a=r("BRIDGE_APP_PATH")?.trim();if(a&&n(a))return i(a);let s=o(Gv)?.trim();if(s&&n(s))return i(s);if(t==="win32"){let u=r("LOCALAPPDATA");if(u){let d=wa.win32.join(u,"Programs","AC Bridge","ac-bridge.exe");if(n(d))return i(d)}return null}if(t==="darwin"){let u=r("HOME");for(let d of["/Applications/AC Bridge.app",...u?[wa.join(u,"Applications","AC Bridge.app")]:[]])if(n(d))return i(d);return null}let l=r("PATH")??"";for(let u of l.split(wa.delimiter).filter(Boolean)){let d=wa.join(u,"ac-bridge");if(n(d))return i(d)}return null}function Sa(e,t=NA){return new Promise(r=>{let o=e.darwinBundle?t("open",["-a",e.path],{detached:!0,stdio:"ignore"}):t(e.path,[],{detached:!0,stdio:"ignore"});o.on("error",()=>r(!1)),o.on("spawn",()=>{o.unref(),r(!0)})})}async function _a(e){let t=e?.timeoutMs??18e4,r=e?.pollMs??1e3,o=e?.exists??Zv,n=e?.exists||e?.file?()=>o(e?.file??""):Vo,i=Date.now()+t;for(;;){if(n())return!0;if(Date.now()>=i)return!1;await new Promise(a=>setTimeout(a,r))}}import We from"node:path";function $e(e={}){let t=O(e.file??Lo);if(!t)return null;try{let r=JSON.parse(t);return typeof r.sub!="string"||!r.sub?null:{sub:r.sub,...typeof r.email=="string"?{email:r.email}:{},updatedAt:typeof r.updatedAt=="number"?r.updatedAt:0}}catch{return null}}function Yt(e,t={}){let r={sub:e.sub,...e.email?{email:e.email}:{},updatedAt:Date.now()};ge(t.file??Lo,`${JSON.stringify(r,null,2)}
171
+ `,384)}function Wv(e={}){ue(e.file??Lo)}function LA(){let e=$e()?.sub;if(!e)return null;let t=yt(ut(e)),r=O(t.refreshFile),o=r?Ze(r):null;if(o)return o;let n=O(t.accessFile);return n?Ze(n):null}function pt(e={}){let t=e.readActiveUser??(()=>$e()),r=e.readCredentialSub??LA,o=e.log??(s=>console.warn(s)),n=t()?.sub??null,i=r();if(!n||!i)return null;if(n!==i)return o(`user-scope: active-user pointer sub (${n}) does not match the credential sub (${i}) \u2014 refusing to resolve a scope (stale-pointer guard)`),null;let a=ut(n);return{sub:n,segment:a,dir:ea(a)}}function qo(e){let t=e.dir;return{dir:t,providerSecretFile(r,o){return Jo("provider",r),Jo("secret name",o),We.join(t,"providers",r,`${o}.json`)},providerAccountsFile(r){return Jo("provider",r),We.join(t,"providers",r,"accounts.json")},localConfigFile:We.join(t,"local-config.json"),localDiscoveredFile:We.join(t,"local-discovered.json"),entitlementFile:We.join(t,"entitlement.json"),revertSessionFile:We.join(t,"revert-session.json"),telemetrySpoolDir:We.join(t,"telemetry","spool"),userConfigFile:We.join(t,"config.json"),relayAccessFile:We.join(t,"relay-access-token"),relayRefreshFile:We.join(t,"relay-refresh-token"),hubTokenFile:We.join(t,"hub-token"),workspaceFile:We.join(t,"workspace.json")}}function Hl(e,t){if((t?.layout??Kt())>=Xt){let o=(t?.resolveScope??(()=>pt()))();if(o)return We.join(e,"users",o.segment,"hub-token")}return We.join(e,"hub-token")}import{existsSync as UA,mkdirSync as Jv,renameSync as Zl}from"node:fs";import Le from"node:path";var zA="layout-version.json",qv=3,jA=["providers","local-config.json","local-discovered.json","entitlement.json","revert-session.json","telemetry"];function Kv(e={}){let t=e.secretDir??W,r=e.now??(()=>new Date),o=Le.join(t,zA);if(GA(o))return{archived:[],skipped:!0,credentialRelocated:null,credentialArchived:!1};let n=Le.join(t,`legacy-${ZA(r())}`),i=!1,a=()=>(i||(Jv(n,{recursive:!0,mode:448}),i=!0),n),s=jA.filter(p=>UA(Le.join(t,p))),l=[];for(let p of s)try{a(),Zl(Le.join(t,p),Le.join(n,p)),l.push(p)}catch(m){if(m.code==="ENOENT")continue;console.warn(`archiveLegacyUserState: failed to archive "${p}": ${m.message}`)}let u=l.length===s.length;ue(Le.join(t,"hub-token"));let d=u?HA(t,a):{relocated:null,archived:!1,ok:!0};return u&&d.ok&&(va({onboardedAt:null},{configFile:Le.join(t,"config.json")}),WA(o,r)),{archived:l,skipped:!1,credentialRelocated:d.relocated,credentialArchived:d.archived}}function FA(e){return{accessFile:Le.join(e,"relay-access-token"),refreshFile:Le.join(e,"relay-refresh-token")}}function MA(e,t){let r=Le.join(e,"users",t);return{accessFile:Le.join(r,"relay-access-token"),refreshFile:Le.join(r,"relay-refresh-token")}}function Vv(e,t){try{return Jv(Le.dirname(t),{recursive:!0,mode:448}),Zl(e,t),"moved"}catch(r){return r.code==="ENOENT"?"absent":(console.warn(`archiveLegacyUserState: failed to relocate credential to "${t}": ${r.message}`),"failed")}}function $a(e,t,r){try{let o=e();return Zl(t,Le.join(o,r)),"moved"}catch(o){return o.code==="ENOENT"?"absent":(console.warn(`archiveLegacyUserState: failed to archive credential "${r}": ${o.message}`),"failed")}}function BA(e,t){let r=Le.join(e,"active-user.json");if($e({file:r})===null)try{Yt({sub:t},{file:r})}catch(o){console.warn(`archiveLegacyUserState: failed to heal the active-user pointer to "${t}": ${o.message}`)}}function HA(e,t){let r=FA(e),o=O(r.refreshFile),n=O(r.accessFile);if(!o&&!n)return{relocated:null,archived:!1,ok:!0};let i=o?Ze(o):null,a=n?Ze(n):null,s=i??a;if(!s){let m=o?$a(t,r.refreshFile,"relay-refresh-token"):"absent",f=n?$a(t,r.accessFile,"relay-access-token"):"absent";return{relocated:null,archived:m==="moved"||f==="moved",ok:m!=="failed"&&f!=="failed"}}i&&a&&i!==a&&console.warn(`archiveLegacyUserState: access-token sub (${a}) differs from refresh-token sub (${i}) \u2014 relocating the refresh to its sub and archiving the access (the refresh loop re-mints a matching access)`);let l=ut(s),u=MA(e,l),d=!0,p=!1;if(o){let m=i===s?Vv(r.refreshFile,u.refreshFile):$a(t,r.refreshFile,"relay-refresh-token");m==="failed"?d=!1:m==="moved"&&i!==s&&(p=!0)}if(n){let m=a===s?Vv(r.accessFile,u.accessFile):$a(t,r.accessFile,"relay-access-token");m==="failed"?d=!1:m==="moved"&&a!==s&&(p=!0)}return d&&BA(e,s),{relocated:{sub:s,segment:l},archived:p,ok:d}}function ZA(e){return e.toISOString().replace(/[:.]/g,"-")}function GA(e){let t=O(e);if(!t)return!1;try{let r=JSON.parse(t);return typeof r.version=="number"&&r.version>=qv}catch{return!1}}function WA(e,t){let r={version:qv,migratedAt:t().toISOString()};ge(e,`${JSON.stringify(r,null,2)}
172
+ `,384)}var YA=Ue.join(W,"hub-token"),L2=Number(process.env.BRIDGE_HUB_PORT)||8790,ke=Ue.join(W,"config.json"),xt=Ue.join(W,"hub.log"),Mo=Ue.join(W,"hub.pid"),U2=Ue.join(W,Jn),Ve=Ue.join(W,"daemon.pid"),Ia=Ue.join(W,"daemon-beacon.json"),En=Ue.join(W,"daemon.log"),Ko=Ue.join(W,"hub-stop-reason.json"),Gv=Ue.join(W,"app-path"),ey=Ue.join(W,"hub-relay-status.json"),z2=Ue.join(W,"hub-holders.json"),ty=Ue.join(W,"sessions"),Gl=e=>Ue.join(ty,`${e}.json`);function ge(e,t,r=384){let o=Ue.dirname(e),n=(r&63)===0;if(JA(o,{recursive:!0,...n?{mode:448}:{}}),n)try{Xv(o,448)}catch{}let i=`${e}.tmp-${process.pid}-${process.hrtime.bigint()}`;Qv(i,t,{mode:r});try{KA(i,e)}catch(a){try{Yv(i,{force:!0})}catch{}throw a}}function O(e){try{return qA(e,"utf8").trim()||null}catch{return null}}function ny(e,t){let r=t?.write??((n,i)=>ge(n,i,384)),o=t?.now??Date.now;try{r(Ko,JSON.stringify({signal:e,ts:o()}))}catch{}}function Aa(){let e={};try{let t=O(ke);t&&(e=JSON.parse(t))}catch{}return process.env.BRIDGE_MACHINE||e.machine||XA.hostname().split(".")[0]||"node"}function ry(){let e=Number(process.env.BRIDGE_HUB_PORT);if(e)return e;try{let t=O(ke);if(t){let r=JSON.parse(t);if(r.hubPort)return Number(r.hubPort)}}catch{}return 8790}function Wl(e){try{Qv(e,"",{mode:384}),Xv(e,384)}catch{}}function ue(e){try{Yv(e,{force:!0})}catch{}}function Ea(e){try{return process.kill(e,0),!0}catch(t){return t.code!=="ESRCH"}}function Jo(e,t){if(!t||t.includes("/")||t.includes("\\")||t.includes("..")||t.includes("\0"))throw new Error(`unsafe ${e}: ${JSON.stringify(t)}`)}function Pa(e,t){return Jo("provider",e),`${e}_${VA("sha256").update(t).digest("hex").slice(0,12)}`}import{readFileSync as nE}from"node:fs";import{existsSync as QA}from"node:fs";import Qt from"node:path";import{fileURLToPath as eE}from"node:url";function tE(e){let t=process.env.BRIDGE_PKG_ROOT;if(t&&t.trim())return t.trim();let r=o=>QA(Qt.join(o,"plugin",".claude-plugin","marketplace.json"));for(let o of[Qt.join(e,".."),Qt.join(e,"..","..")])if(r(o))return o;return Qt.join(e,"..","..")}var en=tE(Qt.dirname(eE(import.meta.url))),Rr=Qt.join(en,"plugin"),Xo=Qt.join(en,"hub","dist","hub.cjs"),oy=Qt.join(en,"hub","src","index.ts"),Ca=Qt.join(en,"node_modules",".bin","tsx");var rE="https://relay.ac-bridge.com",oE=8790;function ne(){let e={};try{e=JSON.parse(nE(ke,"utf8"))}catch{}return{relayUrl:process.env.BRIDGE_RELAY_URL||e.relayUrl||rE,hubPort:Number(process.env.BRIDGE_HUB_PORT||e.hubPort||oE),machine:Aa()}}var Vl=class extends Error{constructor(r,o){super(r);this.status=o}status};async function Jl(e,t,r){let{relayUrl:o}=ne();return fetch(`${o}${e}`,{method:"POST",headers:{"content-type":"application/json",...r?{authorization:`Bearer ${r}`}:{}},body:t===void 0?void 0:JSON.stringify(t)})}async function iy(e){let t=await Jl("/node/claim",{claim_code:e});if(!t.ok)throw new Vl(`pairing failed (${t.status}): ${(await t.text()).slice(0,200)}`,t.status);return await t.json()}async function Ot(e){let{relayUrl:t}=ne();try{let r=await fetch(`${t}/entitlement`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(6e3)});return r.ok?await r.json():null}catch{return null}}async function ay(e,t=fetch){let{relayUrl:r}=ne();try{let o=await t(`${r}/sessions`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(15e3)});return o.ok?(await o.text()).trim()||"(none)":null}catch{return null}}async function sy(e){let{relayUrl:t}=ne();try{let r=await fetch(`${t}/devices`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});return r.ok?await r.json():null}catch{return null}}async function cy(e,t){try{let r=await Jl("/device/command",t,e),o=await r.json().catch(()=>({})),n=typeof o.error=="string"?o.error:void 0,i=wl(n)??n;return{ok:r.ok&&o.ok===!0,status:r.status,...i?{error:i}:{},...typeof o.verified=="boolean"?{verified:o.verified}:{},...typeof o.note=="string"?{note:o.note}:{}}}catch(r){return{ok:!1,status:0,error:r instanceof Error?r.message:"command failed"}}}async function ly(e){let{relayUrl:t}=ne();try{let r=await fetch(`${t}/device-config`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});if(!r.ok)return null;let o=await r.json();return o.config&&typeof o.config=="object"?o.config:{}}catch{return null}}async function uy(e){let{relayUrl:t}=ne();try{let r=await fetch(`${t}/connected-accounts`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});if(!r.ok)return null;let o=await r.json();return Array.isArray(o.accounts)?o.accounts:[]}catch{return null}}async function dy(e,t,r){let{relayUrl:o}=ne();try{let n=await fetch(`${o}/node/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify(r)});if(n.ok)return{ok:!0,status:n.status};let i=await n.json().catch(()=>({})),a=typeof i.error=="string"?i.error:void 0;return{ok:!1,status:n.status,error:wl(a)??a??`patch failed (${n.status})`}}catch(n){return{ok:!1,status:0,error:n instanceof Error?n.message:"patch failed"}}}async function py(e){let t=O(he().accessFile)?.trim();if(!t)return{ok:!1,error:"This machine isn't paired yet \u2014 run `acbridge pair` first."};try{let r=await Jl(`/link/${encodeURIComponent(e)}/start`,{},t),o=await r.json().catch(()=>({}));return r.ok&&typeof o.authorize_url=="string"?{ok:!0,authorizeUrl:o.authorize_url}:{ok:!1,error:typeof o.error=="string"?o.error:`link start failed (${r.status})`}}catch(r){return{ok:!1,error:r instanceof Error?r.message:"link start failed"}}}var iE=!!process.stdout.isTTY&&!process.env.NO_COLOR,Ta=e=>t=>iE?`\x1B[${e}m${t}\x1B[0m`:t,aE=Ta("32"),sE=Ta("33"),cE=Ta("31"),Se=Ta("2"),ql=!1,we=(e=!0)=>{ql=e};var Ra=e=>{ql?console.error(e):console.log(e)},xe=e=>console.log(JSON.stringify(e)),A=e=>Ra(`${aE("\u2714")} ${e}`),U=e=>Ra(`${sE("\u26A0")} ${e}`),b=e=>console.error(`${cE("\u2717")} ${e}`),h=e=>Ra(e),Y=e=>Ra(Se(`\u2022 ${e}`)),Pe=(e,t)=>(b(e),ql&&xe({error:e,exit:t}),t);var Je={logoutFirst:(e="sign in")=>`This machine is already signed in as another account. Run \`acbridge logout\` first, then ${e}.`,pointerMismatch:"This machine's signed-in account doesn't match its stored account pointer \u2014 run `acbridge logout` then `acbridge login` to reset it.",unresolved:"Couldn't resolve this machine's signed-in account \u2014 run `acbridge login` again."};function my(e,t="sign in"){return e.length===0?{ok:!0}:{ok:!1,message:Je.logoutFirst(t),ambiguous:e.length>=2}}function nt(e,t=U){return e.length<2?!1:(t(`found ${e.length} relay credentials on this machine (${e.map(r=>r.sub).join(", ")}) \u2014 a crash during an account switch can leave residue; run \`acbridge logout\` to clear it.`),!0)}function Oa(e,t=ut){return e.segment===t(e.sub)}function fy(e){let t=e.layout??Kt(),r=e.read??O,o=e.paths??he(),n=r(o.accessFile)?.trim()||"",i=e.resolveScope??(()=>pt());if(t<Xt)return n?{state:"ok",token:n,scope:i()}:{state:"signed-out"};let a=i();if(a)return n?{state:"ok",token:n,scope:a}:{state:"signed-out"};let s=(e.scan??dt)();return(e.warnAmbiguous??nt)(s),!!(e.readPointer??(()=>$e()))()||s.length>0?{state:"mismatch",message:Je.pointerMismatch}:{state:"signed-out"}}function Or(e){let t=fy(e);return t.state==="ok"?{ok:!0,token:t.token,scope:t.scope}:t.state==="mismatch"?{ok:!1,message:t.message,exitCode:3}:{ok:!1,message:e.notSignedIn.message,exitCode:e.notSignedIn.exitCode}}function Pn(e={}){return fy(e)}function kt(){let e=pt();return e?qo(e):null}function Dr(e,t){let r=O(e.providerAccountsFile(t));if(!r)return[];try{let o=JSON.parse(r);return Array.isArray(o)?o.filter(n=>typeof n=="object"&&n!==null):[]}catch{return[]}}function Da(e,t,r){ge(e.providerAccountsFile(t),`${JSON.stringify(r,null,2)}
173
+ `,384)}function lE(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.nid=="string"?t.nid:null}catch{return null}}var uE=()=>Or({notSignedIn:{message:"This machine isn't paired yet \u2014 run `acbridge pair <code>` first.",exitCode:3}});async function gy(e,t={}){let r=e[0];if(r!=="on"&&r!=="off"&&r!=="status")return b("usage: acbridge capture on|off|status"),2;let o=(t.requireToken??uE)();if(!o.ok)return b(o.message),o.exitCode;let n=o.token;if(r==="status"){let u=await(t.fetchEntitlement??Ot)(n);u?(h(`plan: ${u.plan}`),h(`capture.telemetry: ${u.capture.telemetry}`),h(`capture.transcripts: ${u.capture.transcripts}`)):b("couldn't fetch entitlement from the relay (signed out, or the relay is unreachable)");let p=(t.entitlementFileRaw??dE)();if(!p)return h("local entitlement file: absent (capture fail-closed until the hub next syncs)"),0;try{let m=JSON.parse(p),f=(Date.now()-(m.fetchedAt??0))/36e5;h(`local entitlement file: ${f.toFixed(1)}h old (${f<=24?"fresh":"STALE \u2014 capture fail-closed"})`)}catch{h("local entitlement file: unreadable (capture fail-closed)")}return 0}let i=lE(n);if(!i)return b("Couldn't read this machine's node id from its access token \u2014 re-pair with `acbridge pair`."),1;let s=await(t.patchNode??dy)(n,i,{captureEnabled:r==="on"});return s.ok?(h(`Capture ${r==="on"?"enabled":"disabled"} for this machine.`),r==="on"&&h("Note: capture is on by default for every account \u2014 this only re-enables it for THIS machine (still subject to the global capture switch)."),0):(b(`capture ${r} failed${s.status?` (${s.status})`:""}: ${s.error??"unknown"}`),1)}function dE(){let e=kt();return e?O(e.entitlementFile):null}import{readFileSync as M1}from"node:fs";import{createInterface as B1}from"node:readline";var c={};Jt(c,{$brand:()=>Xl,$input:()=>yp,$output:()=>vp,NEVER:()=>Kl,TimePrecision:()=>wp,ZodAny:()=>pf,ZodArray:()=>hf,ZodBase64:()=>sc,ZodBase64URL:()=>cc,ZodBigInt:()=>po,ZodBigIntFormat:()=>dc,ZodBoolean:()=>uo,ZodCIDRv4:()=>ic,ZodCIDRv6:()=>ac,ZodCUID:()=>Ys,ZodCUID2:()=>Qs,ZodCatch:()=>zf,ZodCodec:()=>Pi,ZodCustom:()=>Ci,ZodCustomStringFormat:()=>co,ZodDate:()=>_i,ZodDefault:()=>Rf,ZodDiscriminatedUnion:()=>yf,ZodE164:()=>lc,ZodEmail:()=>qs,ZodEmoji:()=>Ks,ZodEnum:()=>ao,ZodError:()=>BC,ZodExactOptional:()=>Pf,ZodFile:()=>Af,ZodFirstPartyTypeKind:()=>Xf,ZodFunction:()=>Jf,ZodGUID:()=>bi,ZodIPv4:()=>rc,ZodIPv6:()=>oc,ZodISODate:()=>Hs,ZodISODateTime:()=>Bs,ZodISODuration:()=>Gs,ZodISOTime:()=>Zs,ZodIntersection:()=>bf,ZodIssueCode:()=>ZC,ZodJWT:()=>uc,ZodKSUID:()=>nc,ZodLazy:()=>Gf,ZodLiteral:()=>If,ZodMAC:()=>of,ZodMap:()=>_f,ZodNaN:()=>Ff,ZodNanoID:()=>Xs,ZodNever:()=>ff,ZodNonOptional:()=>vc,ZodNull:()=>uf,ZodNullable:()=>Tf,ZodNumber:()=>lo,ZodNumberFormat:()=>ir,ZodObject:()=>Ii,ZodOptional:()=>hc,ZodPipe:()=>Ei,ZodPrefault:()=>Df,ZodPreprocess:()=>Mf,ZodPromise:()=>Vf,ZodReadonly:()=>Bf,ZodRealError:()=>Xe,ZodRecord:()=>io,ZodSet:()=>$f,ZodString:()=>so,ZodStringFormat:()=>ce,ZodSuccess:()=>Uf,ZodSymbol:()=>cf,ZodTemplateLiteral:()=>Zf,ZodTransform:()=>Ef,ZodTuple:()=>kf,ZodType:()=>B,ZodULID:()=>ec,ZodURL:()=>Si,ZodUUID:()=>Ut,ZodUndefined:()=>lf,ZodUnion:()=>Ai,ZodUnknown:()=>mf,ZodVoid:()=>gf,ZodXID:()=>tc,ZodXor:()=>vf,_ZodString:()=>Js,_default:()=>Of,_function:()=>rk,any:()=>Dx,array:()=>$i,base64:()=>vx,base64url:()=>yx,bigint:()=>Px,boolean:()=>sf,catch:()=>jf,check:()=>ok,cidrv4:()=>gx,cidrv6:()=>hx,clone:()=>ze,codec:()=>Qx,coerce:()=>Yf,config:()=>ve,core:()=>rn,cuid:()=>sx,cuid2:()=>cx,custom:()=>ik,date:()=>Lx,decode:()=>Xm,decodeAsync:()=>Qm,describe:()=>ak,discriminatedUnion:()=>Bx,e164:()=>bx,email:()=>Xb,emoji:()=>ix,encode:()=>Km,encodeAsync:()=>Ym,endsWith:()=>qr,enum:()=>fc,exactOptional:()=>Cf,file:()=>qx,flattenError:()=>ii,float32:()=>$x,float64:()=>Ix,formatError:()=>ai,fromJSONSchema:()=>mk,function:()=>rk,getErrorMap:()=>WC,globalRegistry:()=>Ce,gt:()=>Nt,gte:()=>Fe,guid:()=>Yb,hash:()=>_x,hex:()=>Sx,hostname:()=>wx,httpUrl:()=>ox,includes:()=>Vr,instanceof:()=>ck,int:()=>Ws,int32:()=>Ax,int64:()=>Cx,intersection:()=>xf,invertCodec:()=>ek,ipv4:()=>px,ipv6:()=>fx,iso:()=>oo,json:()=>uk,jwt:()=>xx,keyof:()=>Ux,ksuid:()=>dx,lazy:()=>Wf,length:()=>rr,literal:()=>Jx,locales:()=>fi,looseObject:()=>Fx,looseRecord:()=>Zx,lowercase:()=>Gr,lt:()=>Dt,lte:()=>ot,mac:()=>mx,map:()=>Gx,maxLength:()=>nr,maxSize:()=>Ln,meta:()=>sk,mime:()=>Kr,minLength:()=>nn,minSize:()=>Lt,multipleOf:()=>Nn,nan:()=>Yx,nanoid:()=>ax,nativeEnum:()=>Vx,negative:()=>Rs,never:()=>pc,nonnegative:()=>Ds,nonoptional:()=>Lf,nonpositive:()=>Os,normalize:()=>Xr,null:()=>df,nullable:()=>ki,nullish:()=>Kx,number:()=>af,object:()=>zx,optional:()=>xi,overwrite:()=>St,parse:()=>Wm,parseAsync:()=>Vm,partialRecord:()=>Hx,pipe:()=>Vs,positive:()=>Ts,prefault:()=>Nf,preprocess:()=>dk,prettifyError:()=>uu,promise:()=>nk,property:()=>Ns,readonly:()=>Hf,record:()=>Sf,refine:()=>qf,regex:()=>Zr,regexes:()=>rt,registry:()=>us,safeDecode:()=>tf,safeDecodeAsync:()=>rf,safeEncode:()=>ef,safeEncodeAsync:()=>nf,safeParse:()=>Jm,safeParseAsync:()=>qm,set:()=>Wx,setErrorMap:()=>GC,size:()=>tr,slugify:()=>to,startsWith:()=>Jr,strictObject:()=>jx,string:()=>yi,stringFormat:()=>kx,stringbool:()=>lk,success:()=>Xx,superRefine:()=>Kf,symbol:()=>Rx,templateLiteral:()=>tk,toJSONSchema:()=>js,toLowerCase:()=>Qr,toUpperCase:()=>eo,transform:()=>gc,treeifyError:()=>lu,trim:()=>Yr,tuple:()=>wf,uint32:()=>Ex,uint64:()=>Tx,ulid:()=>lx,undefined:()=>Ox,union:()=>mc,unknown:()=>or,uppercase:()=>Wr,url:()=>rx,util:()=>$,uuid:()=>Qb,uuidv4:()=>ex,uuidv6:()=>tx,uuidv7:()=>nx,void:()=>Nx,xid:()=>ux,xor:()=>Mx});var rn={};Jt(rn,{$ZodAny:()=>jd,$ZodArray:()=>Zd,$ZodAsyncError:()=>wt,$ZodBase64:()=>Pd,$ZodBase64URL:()=>Cd,$ZodBigInt:()=>ns,$ZodBigIntFormat:()=>Nd,$ZodBoolean:()=>ui,$ZodCIDRv4:()=>Id,$ZodCIDRv6:()=>Ad,$ZodCUID:()=>fd,$ZodCUID2:()=>gd,$ZodCatch:()=>cp,$ZodCheck:()=>de,$ZodCheckBigIntFormat:()=>Zu,$ZodCheckEndsWith:()=>nd,$ZodCheckGreaterThan:()=>Ka,$ZodCheckIncludes:()=>ed,$ZodCheckLengthEquals:()=>Ku,$ZodCheckLessThan:()=>qa,$ZodCheckLowerCase:()=>Yu,$ZodCheckMaxLength:()=>Ju,$ZodCheckMaxSize:()=>Gu,$ZodCheckMimeType:()=>od,$ZodCheckMinLength:()=>qu,$ZodCheckMinSize:()=>Wu,$ZodCheckMultipleOf:()=>Bu,$ZodCheckNumberFormat:()=>Hu,$ZodCheckOverwrite:()=>id,$ZodCheckProperty:()=>rd,$ZodCheckRegex:()=>Xu,$ZodCheckSizeEquals:()=>Vu,$ZodCheckStartsWith:()=>td,$ZodCheckStringFormat:()=>Br,$ZodCheckUpperCase:()=>Qu,$ZodCodec:()=>pi,$ZodCustom:()=>hp,$ZodCustomStringFormat:()=>Od,$ZodDate:()=>Hd,$ZodDefault:()=>op,$ZodDiscriminatedUnion:()=>Vd,$ZodE164:()=>Td,$ZodEmail:()=>ud,$ZodEmoji:()=>pd,$ZodEncodeError:()=>Cn,$ZodEnum:()=>Yd,$ZodError:()=>oi,$ZodExactOptional:()=>np,$ZodFile:()=>ep,$ZodFunction:()=>mp,$ZodGUID:()=>cd,$ZodIPv4:()=>Sd,$ZodIPv6:()=>_d,$ZodISODate:()=>xd,$ZodISODateTime:()=>bd,$ZodISODuration:()=>wd,$ZodISOTime:()=>kd,$ZodIntersection:()=>Jd,$ZodJWT:()=>Rd,$ZodKSUID:()=>yd,$ZodLazy:()=>gp,$ZodLiteral:()=>Qd,$ZodMAC:()=>$d,$ZodMap:()=>Kd,$ZodNaN:()=>lp,$ZodNanoID:()=>md,$ZodNever:()=>Md,$ZodNonOptional:()=>ap,$ZodNull:()=>zd,$ZodNullable:()=>rp,$ZodNumber:()=>ts,$ZodNumberFormat:()=>Dd,$ZodObject:()=>Wy,$ZodObjectJIT:()=>Gd,$ZodOptional:()=>os,$ZodPipe:()=>is,$ZodPrefault:()=>ip,$ZodPreprocess:()=>up,$ZodPromise:()=>fp,$ZodReadonly:()=>dp,$ZodRealError:()=>Ke,$ZodRecord:()=>qd,$ZodRegistry:()=>ls,$ZodSet:()=>Xd,$ZodString:()=>er,$ZodStringFormat:()=>se,$ZodSuccess:()=>sp,$ZodSymbol:()=>Ld,$ZodTemplateLiteral:()=>pp,$ZodTransform:()=>tp,$ZodTuple:()=>rs,$ZodType:()=>F,$ZodULID:()=>hd,$ZodURL:()=>dd,$ZodUUID:()=>ld,$ZodUndefined:()=>Ud,$ZodUnion:()=>di,$ZodUnknown:()=>Fd,$ZodVoid:()=>Bd,$ZodXID:()=>vd,$ZodXor:()=>Wd,$brand:()=>Xl,$constructor:()=>v,$input:()=>yp,$output:()=>vp,Doc:()=>li,JSONSchema:()=>Jb,JSONSchemaGenerator:()=>Fs,NEVER:()=>Kl,TimePrecision:()=>wp,_any:()=>Hp,_array:()=>Kp,_base64:()=>As,_base64url:()=>Es,_bigint:()=>Lp,_boolean:()=>Dp,_catch:()=>DC,_check:()=>Vb,_cidrv4:()=>$s,_cidrv6:()=>Is,_coercedBigint:()=>Up,_coercedBoolean:()=>Np,_coercedDate:()=>Jp,_coercedNumber:()=>Ep,_coercedString:()=>xp,_cuid:()=>ys,_cuid2:()=>bs,_custom:()=>Yp,_date:()=>Vp,_decode:()=>Fa,_decodeAsync:()=>Ba,_default:()=>TC,_discriminatedUnion:()=>bC,_e164:()=>Ps,_email:()=>ds,_emoji:()=>hs,_encode:()=>ja,_encodeAsync:()=>Ma,_endsWith:()=>qr,_enum:()=>$C,_file:()=>Xp,_float32:()=>Cp,_float64:()=>Tp,_gt:()=>Nt,_gte:()=>Fe,_guid:()=>gi,_includes:()=>Vr,_int:()=>Pp,_int32:()=>Rp,_int64:()=>zp,_intersection:()=>xC,_ipv4:()=>Ss,_ipv6:()=>_s,_isoDate:()=>_p,_isoDateTime:()=>Sp,_isoDuration:()=>Ip,_isoTime:()=>$p,_jwt:()=>Cs,_ksuid:()=>ws,_lazy:()=>zC,_length:()=>rr,_literal:()=>AC,_lowercase:()=>Gr,_lt:()=>Dt,_lte:()=>ot,_mac:()=>kp,_map:()=>SC,_max:()=>ot,_maxLength:()=>nr,_maxSize:()=>Ln,_mime:()=>Kr,_min:()=>Fe,_minLength:()=>nn,_minSize:()=>Lt,_multipleOf:()=>Nn,_nan:()=>qp,_nanoid:()=>vs,_nativeEnum:()=>IC,_negative:()=>Rs,_never:()=>Gp,_nonnegative:()=>Ds,_nonoptional:()=>RC,_nonpositive:()=>Os,_normalize:()=>Xr,_null:()=>Bp,_nullable:()=>CC,_number:()=>Ap,_optional:()=>PC,_overwrite:()=>St,_parse:()=>zr,_parseAsync:()=>jr,_pipe:()=>NC,_positive:()=>Ts,_promise:()=>jC,_property:()=>Ns,_readonly:()=>LC,_record:()=>wC,_refine:()=>Qp,_regex:()=>Zr,_safeDecode:()=>Za,_safeDecodeAsync:()=>Wa,_safeEncode:()=>Ha,_safeEncodeAsync:()=>Ga,_safeParse:()=>Fr,_safeParseAsync:()=>Mr,_set:()=>_C,_size:()=>tr,_slugify:()=>to,_startsWith:()=>Jr,_string:()=>bp,_stringFormat:()=>no,_stringbool:()=>rm,_success:()=>OC,_superRefine:()=>em,_symbol:()=>Fp,_templateLiteral:()=>UC,_toLowerCase:()=>Qr,_toUpperCase:()=>eo,_transform:()=>EC,_trim:()=>Yr,_tuple:()=>kC,_uint32:()=>Op,_uint64:()=>jp,_ulid:()=>xs,_undefined:()=>Mp,_union:()=>vC,_unknown:()=>Zp,_uppercase:()=>Wr,_url:()=>hi,_uuid:()=>ps,_uuidv4:()=>ms,_uuidv6:()=>fs,_uuidv7:()=>gs,_void:()=>Wp,_xid:()=>ks,_xor:()=>yC,clone:()=>ze,config:()=>ve,createStandardJSONSchemaMethod:()=>ro,createToJSONSchemaMethod:()=>om,decode:()=>jE,decodeAsync:()=>ME,describe:()=>tm,encode:()=>zE,encodeAsync:()=>FE,extractDefs:()=>zn,finalize:()=>jn,flattenError:()=>ii,formatError:()=>ai,globalConfig:()=>Xn,globalRegistry:()=>Ce,initializeContext:()=>Un,isValidBase64:()=>Ed,isValidBase64URL:()=>By,isValidJWT:()=>Hy,locales:()=>fi,meta:()=>nm,parse:()=>Ua,parseAsync:()=>za,prettifyError:()=>uu,process:()=>oe,regexes:()=>rt,registry:()=>us,safeDecode:()=>HE,safeDecodeAsync:()=>GE,safeEncode:()=>BE,safeEncodeAsync:()=>ZE,safeParse:()=>du,safeParseAsync:()=>pu,toDotPath:()=>ky,toJSONSchema:()=>js,treeifyError:()=>lu,util:()=>$,version:()=>ad});var hy,Kl=Object.freeze({status:"aborted"});function v(e,t,r){function o(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);let u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let m=d[p];m in s||(s[m]=u[m].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var l;let u=r?.Parent?new i:this;o(u,s),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Xl=Symbol("zod_brand"),wt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Cn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(hy=globalThis).__zod_globalConfig??(hy.__zod_globalConfig={});var Xn=globalThis.__zod_globalConfig;function ve(e){return e&&Object.assign(Xn,e),Xn}var $={};Jt($,{BIGINT_FORMAT_RANGES:()=>su,Class:()=>Ql,NUMBER_FORMAT_RANGES:()=>au,aborted:()=>Dn,allowsEval:()=>nu,assert:()=>hE,assertEqual:()=>pE,assertIs:()=>fE,assertNever:()=>gE,assertNotEqual:()=>mE,assignProp:()=>Rn,base64ToUint8Array:()=>yy,base64urlToUint8Array:()=>OE,cached:()=>Lr,captureStackTrace:()=>La,cleanEnum:()=>RE,cleanRegex:()=>ei,clone:()=>ze,cloneDef:()=>yE,createTransparentProxy:()=>_E,defineLazy:()=>V,esc:()=>Na,escapeRegex:()=>mt,explicitlyAborted:()=>cu,extend:()=>AE,finalizeIssue:()=>je,floatSafeRemainder:()=>eu,getElementAtPath:()=>bE,getEnumValues:()=>Qo,getLengthableOrigin:()=>ri,getParsedType:()=>SE,getSizableOrigin:()=>ni,hexToUint8Array:()=>NE,isObject:()=>Yn,isPlainObject:()=>On,issue:()=>Ur,joinValues:()=>x,jsonStringifyReplacer:()=>Nr,merge:()=>PE,mergeDefs:()=>tn,normalizeParams:()=>I,nullish:()=>Tn,numKeys:()=>wE,objectClone:()=>vE,omit:()=>IE,optionalKeys:()=>iu,parsedType:()=>S,partial:()=>CE,pick:()=>$E,prefixIssues:()=>qe,primitiveTypes:()=>ou,promiseAllObject:()=>xE,propertyKeyTypes:()=>ti,randomString:()=>kE,required:()=>TE,safeExtend:()=>EE,shallowClone:()=>ru,slugify:()=>tu,stringifyPrimitive:()=>w,uint8ArrayToBase64:()=>by,uint8ArrayToBase64url:()=>DE,uint8ArrayToHex:()=>LE,unwrapMessage:()=>Yo});function pE(e){return e}function mE(e){return e}function fE(e){}function gE(e){throw new Error("Unexpected value in exhaustive check")}function hE(e){}function Qo(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function x(e,t="|"){return e.map(r=>w(r)).join(t)}function Nr(e,t){return typeof t=="bigint"?t.toString():t}function Lr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Tn(e){return e==null}function ei(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function eu(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var vy=Symbol("evaluating");function V(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==vy)return o===void 0&&(o=vy,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function vE(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Rn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function tn(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function yE(e){return tn(e._zod.def)}function bE(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function xE(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function kE(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Na(e){return JSON.stringify(e)}function tu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var La="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Yn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var nu=Lr(()=>{if(Xn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function On(e){if(Yn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Yn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function ru(e){return On(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function wE(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var SE=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ti=new Set(["string","number","symbol"]),ou=new Set(["string","number","bigint","boolean","symbol","undefined"]);function mt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ze(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function I(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function _E(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function w(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function iu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var au={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},su={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function $E(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=tn(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Rn(this,"shape",a),a},checks:[]});return ze(e,i)}function IE(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=tn(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Rn(this,"shape",a),a},checks:[]});return ze(e,i)}function AE(e,t){if(!On(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=tn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Rn(this,"shape",i),i}});return ze(e,n)}function EE(e,t){if(!On(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=tn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Rn(this,"shape",o),o}});return ze(e,r)}function PE(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=tn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Rn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ze(e,r)}function CE(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=tn(t._zod.def,{get shape(){let s=t._zod.def.shape,l={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)l[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Rn(this,"shape",l),l},checks:[]});return ze(t,a)}function TE(e,t,r){let o=tn(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return Rn(this,"shape",i),i}});return ze(t,o)}function Dn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function cu(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function qe(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Yo(e){return typeof e=="string"?e:e?.message}function je(e,t,r){let o=e.message?e.message:Yo(e.inst?._zod.def?.error?.(e))??Yo(t?.error?.(e))??Yo(r.customError?.(e))??Yo(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function ni(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ri(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function S(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Ur(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function RE(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function yy(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function by(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function OE(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return yy(t+r)}function DE(e){return by(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function NE(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function LE(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ql=class{constructor(...t){}};var xy=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Nr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oi=v("$ZodError",xy),Ke=v("$ZodError",xy,{Parent:Error});function ii(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function ai(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let l=r,u=0;for(;u<s.length;){let d=s[u];u===s.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}}};return o(e),r}function lu(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>o({issues:u},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let u=[...i,...l.path];if(u.length===0){r.errors.push(t(l));continue}let d=r,p=0;for(;p<u.length;){let m=u[p],f=p===u.length-1;typeof m=="string"?(d.properties??(d.properties={}),(a=d.properties)[m]??(a[m]={errors:[]}),d=d.properties[m]):(d.items??(d.items=[]),(s=d.items)[m]??(s[m]={errors:[]}),d=d.items[m]),f&&d.errors.push(t(l)),p++}}};return o(e),r}function ky(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function uu(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${ky(o.path)}`);return t.join(`
174
+ `)}var zr=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new wt;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>je(l,i,ve())));throw La(s,n?.callee),s}return a.value},Ua=zr(Ke),jr=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(l=>je(l,i,ve())));throw La(s,n?.callee),s}return a.value},za=jr(Ke),Fr=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new wt;return i.issues.length?{success:!1,error:new(e??oi)(i.issues.map(a=>je(a,n,ve())))}:{success:!0,data:i.value}},du=Fr(Ke),Mr=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>je(a,n,ve())))}:{success:!0,data:i.value}},pu=Mr(Ke),ja=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zr(e)(t,r,n)},zE=ja(Ke),Fa=e=>(t,r,o)=>zr(e)(t,r,o),jE=Fa(Ke),Ma=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return jr(e)(t,r,n)},FE=Ma(Ke),Ba=e=>async(t,r,o)=>jr(e)(t,r,o),ME=Ba(Ke),Ha=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Fr(e)(t,r,n)},BE=Ha(Ke),Za=e=>(t,r,o)=>Fr(e)(t,r,o),HE=Za(Ke),Ga=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Mr(e)(t,r,n)},ZE=Ga(Ke),Wa=e=>async(t,r,o)=>Mr(e)(t,r,o),GE=Wa(Ke);var rt={};Jt(rt,{base64:()=>Eu,base64url:()=>Va,bigint:()=>Nu,boolean:()=>Uu,browserEmail:()=>QE,cidrv4:()=>Iu,cidrv6:()=>Au,cuid:()=>mu,cuid2:()=>fu,date:()=>Tu,datetime:()=>Ou,domain:()=>nP,duration:()=>bu,e164:()=>Cu,email:()=>ku,emoji:()=>wu,extendedDuration:()=>WE,guid:()=>xu,hex:()=>rP,hostname:()=>tP,html5Email:()=>KE,httpProtocol:()=>Pu,idnEmail:()=>YE,integer:()=>Lu,ipv4:()=>Su,ipv6:()=>_u,ksuid:()=>vu,lowercase:()=>Fu,mac:()=>$u,md5_base64:()=>iP,md5_base64url:()=>aP,md5_hex:()=>oP,nanoid:()=>yu,null:()=>zu,number:()=>Ja,rfc5322Email:()=>XE,sha1_base64:()=>cP,sha1_base64url:()=>lP,sha1_hex:()=>sP,sha256_base64:()=>dP,sha256_base64url:()=>pP,sha256_hex:()=>uP,sha384_base64:()=>fP,sha384_base64url:()=>gP,sha384_hex:()=>mP,sha512_base64:()=>vP,sha512_base64url:()=>yP,sha512_hex:()=>hP,string:()=>Du,time:()=>Ru,ulid:()=>gu,undefined:()=>ju,unicodeEmail:()=>wy,uppercase:()=>Mu,uuid:()=>Qn,uuid4:()=>VE,uuid6:()=>JE,uuid7:()=>qE,xid:()=>hu});var mu=/^[cC][0-9a-z]{6,}$/,fu=/^[0-9a-z]+$/,gu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hu=/^[0-9a-vA-V]{20}$/,vu=/^[A-Za-z0-9]{27}$/,yu=/^[a-zA-Z0-9_-]{21}$/,bu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,WE=/^[-+]?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)?)??$/,xu=/^([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})$/,Qn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,VE=Qn(4),JE=Qn(6),qE=Qn(7),ku=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,KE=/^[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])?)*$/,XE=/^(([^<>()\[\]\\.,;:\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,}))$/,wy=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,YE=wy,QE=/^[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])?)*$/,eP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function wu(){return new RegExp(eP,"u")}var Su=/^(?:(?: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])$/,_u=/^(([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}|:))$/,$u=e=>{let t=mt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Iu=/^((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])$/,Au=/^(([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])$/,Eu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Va=/^[A-Za-z0-9_-]*$/,tP=/^(?=.{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])?)*\.?$/,nP=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Pu=/^https?$/,Cu=/^\+[1-9]\d{6,14}$/,Sy="(?:(?:\\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])))",Tu=new RegExp(`^${Sy}$`);function _y(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ru(e){return new RegExp(`^${_y(e)}$`)}function Ou(e){let t=_y({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Sy}T(?:${o})$`)}var Du=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Nu=/^-?\d+n?$/,Lu=/^-?\d+$/,Ja=/^-?\d+(?:\.\d+)?$/,Uu=/^(?:true|false)$/i,zu=/^null$/i;var ju=/^undefined$/i;var Fu=/^[^A-Z]*$/,Mu=/^[^a-z]*$/,rP=/^[0-9a-fA-F]*$/;function si(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ci(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var oP=/^[0-9a-fA-F]{32}$/,iP=si(22,"=="),aP=ci(22),sP=/^[0-9a-fA-F]{40}$/,cP=si(27,"="),lP=ci(27),uP=/^[0-9a-fA-F]{64}$/,dP=si(43,"="),pP=ci(43),mP=/^[0-9a-fA-F]{96}$/,fP=si(64,""),gP=ci(64),hP=/^[0-9a-fA-F]{128}$/,vP=si(86,"=="),yP=ci(86);var de=v("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Iy={number:"number",bigint:"bigint",object:"date"},qa=v("$ZodCheckLessThan",(e,t)=>{de.init(e,t);let r=Iy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ka=v("$ZodCheckGreaterThan",(e,t)=>{de.init(e,t);let r=Iy[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bu=v("$ZodCheckMultipleOf",(e,t)=>{de.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):eu(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Hu=v("$ZodCheckNumberFormat",(e,t)=>{de.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=au[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=Lu)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Zu=v("$ZodCheckBigIntFormat",(e,t)=>{de.init(e,t);let[r,o]=su[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Gu=v("$ZodCheckMaxSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:ni(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wu=v("$ZodCheckMinSize",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:ni(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Vu=v("$ZodCheckSizeEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:ni(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ju=v("$ZodCheckMaxLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=ri(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qu=v("$ZodCheckMinLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=ri(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ku=v("$ZodCheckLengthEquals",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Tn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=ri(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Br=v("$ZodCheckStringFormat",(e,t)=>{var r,o;de.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Xu=v("$ZodCheckRegex",(e,t)=>{Br.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Yu=v("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Fu),Br.init(e,t)}),Qu=v("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mu),Br.init(e,t)}),ed=v("$ZodCheckIncludes",(e,t)=>{de.init(e,t);let r=mt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),td=v("$ZodCheckStartsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`^${mt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),nd=v("$ZodCheckEndsWith",(e,t)=>{de.init(e,t);let r=new RegExp(`.*${mt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function $y(e,t,r){e.issues.length&&t.issues.push(...qe(r,e.issues))}var rd=v("$ZodCheckProperty",(e,t)=>{de.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>$y(n,r,t.property));$y(o,r,t.property)}}),od=v("$ZodCheckMimeType",(e,t)=>{de.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),id=v("$ZodCheckOverwrite",(e,t)=>{de.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var li=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
175
+ `).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
176
+ `))}};var ad={major:4,minor:4,patch:3};var F=v("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ad;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,l)=>{let u=Dn(a),d;for(let p of s){if(p._zod.def.when){if(cu(a)||!p._zod.def.when(a))continue}else if(u)continue;let m=a.issues.length,f=p._zod.check(a);if(f instanceof Promise&&l?.async===!1)throw new wt;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,a.issues.length!==m&&(u||(u=Dn(a,m)))});else{if(a.issues.length===m)continue;u||(u=Dn(a,m))}}return d?d.then(()=>a):a},i=(a,s,l)=>{if(Dn(a))return a.aborted=!0,a;let u=n(s,o,l);if(u instanceof Promise){if(l.async===!1)throw new wt;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,a,s)):i(u,a,s)}let l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new wt;return l.then(u=>n(u,o,s))}return n(l,o,s)}}V(e,"~standard",()=>({validate:n=>{try{let i=du(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return pu(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),er=v("$ZodString",(e,t)=>{F.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Du(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),se=v("$ZodStringFormat",(e,t)=>{Br.init(e,t),er.init(e,t)}),cd=v("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xu),se.init(e,t)}),ld=v("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Qn(o))}else t.pattern??(t.pattern=Qn());se.init(e,t)}),ud=v("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ku),se.init(e,t)}),dd=v("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Pu.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),pd=v("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=wu()),se.init(e,t)}),md=v("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=yu),se.init(e,t)}),fd=v("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=mu),se.init(e,t)}),gd=v("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fu),se.init(e,t)}),hd=v("$ZodULID",(e,t)=>{t.pattern??(t.pattern=gu),se.init(e,t)}),vd=v("$ZodXID",(e,t)=>{t.pattern??(t.pattern=hu),se.init(e,t)}),yd=v("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vu),se.init(e,t)}),bd=v("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ou(t)),se.init(e,t)}),xd=v("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Tu),se.init(e,t)}),kd=v("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ru(t)),se.init(e,t)}),wd=v("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bu),se.init(e,t)}),Sd=v("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Su),se.init(e,t),e._zod.bag.format="ipv4"}),_d=v("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=_u),se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),$d=v("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=$u(t.delimiter)),se.init(e,t),e._zod.bag.format="mac"}),Id=v("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Iu),se.init(e,t)}),Ad=v("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Au),se.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Ed(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Pd=v("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Eu),se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ed(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function By(e){if(!Va.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ed(r)}var Cd=v("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Va),se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{By(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Td=v("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Cu),se.init(e,t)});function Hy(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Rd=v("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=r=>{Hy(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Od=v("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),ts=v("$ZodNumber",(e,t)=>{F.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ja,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),Dd=v("$ZodNumberFormat",(e,t)=>{Hu.init(e,t),ts.init(e,t)}),ui=v("$ZodBoolean",(e,t)=>{F.init(e,t),e._zod.pattern=Uu,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),ns=v("$ZodBigInt",(e,t)=>{F.init(e,t),e._zod.pattern=Nu,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Nd=v("$ZodBigIntFormat",(e,t)=>{Zu.init(e,t),ns.init(e,t)}),Ld=v("$ZodSymbol",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Ud=v("$ZodUndefined",(e,t)=>{F.init(e,t),e._zod.pattern=ju,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),zd=v("$ZodNull",(e,t)=>{F.init(e,t),e._zod.pattern=zu,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),jd=v("$ZodAny",(e,t)=>{F.init(e,t),e._zod.parse=r=>r}),Fd=v("$ZodUnknown",(e,t)=>{F.init(e,t),e._zod.parse=r=>r}),Md=v("$ZodNever",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Bd=v("$ZodVoid",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Hd=v("$ZodDate",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function Ey(e,t,r){e.issues.length&&t.issues.push(...qe(r,e.issues)),t.value[r]=e.value}var Zd=v("$ZodArray",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],l=t.element._zod.run({value:s,issues:[]},o);l instanceof Promise?i.push(l.then(u=>Ey(u,r,a))):Ey(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function es(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...qe(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function Zy(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=iu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Gy(e,t,r,o,n,i){let a=[],s=n.keySet,l=n.catchall._zod,u=l.def.type,d=l.optin==="optional",p=l.optout==="optional";for(let m in t){if(m==="__proto__"||s.has(m))continue;if(u==="never"){a.push(m);continue}let f=l.run({value:t[m],issues:[]},o);f instanceof Promise?e.push(f.then(g=>es(g,r,m,t,d,p))):es(f,r,m,t,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var Wy=v("$ZodObject",(e,t)=>{if(F.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}let o=Lr(()=>Zy(t));V(e._zod,"propValues",()=>{let s=t.shape,l={};for(let u in s){let d=s[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let p of d.values)l[u].add(p)}}return l});let n=Yn,i=t.catchall,a;e._zod.parse=(s,l)=>{a??(a=o.value);let u=s.value;if(!n(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let d=[],p=a.shape;for(let m of a.keys){let f=p[m],g=f._zod.optin==="optional",y=f._zod.optout==="optional",k=f._zod.run({value:u[m],issues:[]},l);k instanceof Promise?d.push(k.then(_=>es(_,s,m,u,g,y))):es(k,s,m,u,g,y)}return i?Gy(d,u,s,l,o.value,e):d.length?Promise.all(d).then(()=>s):s}}),Gd=v("$ZodObjectJIT",(e,t)=>{Wy.init(e,t);let r=e._zod.parse,o=Lr(()=>Zy(t)),n=m=>{let f=new li(["shape","payload","ctx"]),g=o.value,y=C=>{let E=Na(C);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};f.write("const input = payload.value;");let k=Object.create(null),_=0;for(let C of g.keys)k[C]=`key_${_++}`;f.write("const newResult = {};");for(let C of g.keys){let E=k[C],D=Na(C),G=m[C],ae=G?._zod?.optin==="optional",X=G?._zod?.optout==="optional";f.write(`const ${E} = ${y(C)};`),ae&&X?f.write(`
177
+ if (${E}.issues.length) {
178
+ if (${D} in input) {
179
+ payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
180
+ ...iss,
181
+ path: iss.path ? [${D}, ...iss.path] : [${D}]
182
+ })));
183
+ }
184
+ }
185
+
186
+ if (${E}.value === undefined) {
187
+ if (${D} in input) {
188
+ newResult[${D}] = undefined;
189
+ }
190
+ } else {
191
+ newResult[${D}] = ${E}.value;
192
+ }
193
+
194
+ `):ae?f.write(`
195
+ if (${E}.issues.length) {
196
+ payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
197
+ ...iss,
198
+ path: iss.path ? [${D}, ...iss.path] : [${D}]
199
+ })));
200
+ }
201
+
202
+ if (${E}.value === undefined) {
203
+ if (${D} in input) {
204
+ newResult[${D}] = undefined;
205
+ }
206
+ } else {
207
+ newResult[${D}] = ${E}.value;
208
+ }
209
+
210
+ `):f.write(`
211
+ const ${E}_present = ${D} in input;
212
+ if (${E}.issues.length) {
213
+ payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
214
+ ...iss,
215
+ path: iss.path ? [${D}, ...iss.path] : [${D}]
216
+ })));
217
+ }
218
+ if (!${E}_present && !${E}.issues.length) {
219
+ payload.issues.push({
220
+ code: "invalid_type",
221
+ expected: "nonoptional",
222
+ input: undefined,
223
+ path: [${D}]
224
+ });
225
+ }
226
+
227
+ if (${E}_present) {
228
+ if (${E}.value === undefined) {
229
+ newResult[${D}] = undefined;
230
+ } else {
231
+ newResult[${D}] = ${E}.value;
232
+ }
233
+ }
234
+
235
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let P=f.compile();return(C,E)=>P(m,C,E)},i,a=Yn,s=!Xn.jitless,u=s&&nu.value,d=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=o.value);let g=m.value;return a(g)?s&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=n(t.shape)),m=i(m,f),d?Gy([],g,m,f,p,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),m)}});function Py(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Dn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>je(a,o,ve())))}),t)}var di=v("$ZodUnion",(e,t)=>{F.init(e,t),V(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>ei(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);if(l instanceof Promise)a.push(l),i=!0;else{if(l.issues.length===0)return l;a.push(l)}}return i?Promise.all(a).then(s=>Py(s,o,e,n)):Py(a,o,e,n)}});function Cy(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>je(a,o,ve())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Wd=v("$ZodXor",(e,t)=>{di.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let l=s._zod.run({value:o.value,issues:[]},n);l instanceof Promise?(a.push(l),i=!0):a.push(l)}return i?Promise.all(a).then(s=>Cy(s,o,e,n)):Cy(a,o,e,n)}}),Vd=v("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,di.init(e,t);let r=e._zod.parse;V(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let u of l)n[s].add(u)}}return n});let o=Lr(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!Yn(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),Jd=v("$ZodIntersection",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,u])=>Ty(r,l,u)):Ty(r,i,a)}});function sd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(On(e)&&On(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=sd(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=sd(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Ty(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let l of s.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),Dn(e))return e;let a=sd(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var rs=v("$ZodTuple",(e,t)=>{F.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=Ry(r,"optin"),l=Ry(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let u=new Array(r.length);for(let d=0;d<r.length;d++){let p=r[d]._zod.run({value:i[d],issues:[]},n);p instanceof Promise?a.push(p.then(m=>{u[d]=m})):u[d]=p}if(t.rest){let d=r.length-1,p=i.slice(r.length);for(let m of p){d++;let f=t.rest._zod.run({value:m,issues:[]},n);f instanceof Promise?a.push(f.then(g=>Oy(g,o,d))):Oy(f,o,d)}}return a.length?Promise.all(a).then(()=>Dy(u,o,r,i,l)):Dy(u,o,r,i,l)}});function Ry(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Oy(e,t,r){e.issues.length&&t.issues.push(...qe(r,e.issues)),t.value[r]=e.value}function Dy(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...qe(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var qd=v("$ZodRecord",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!On(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>je(f,o,ve())),input:u,path:[u],inst:e});continue}let p=d.value,m=t.valueType._zod.run({value:n[u],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&r.issues.push(...qe(u,f.issues)),r.value[p]=f.value})):(m.issues.length&&r.issues.push(...qe(u,m.issues)),r.value[p]=m.value)}let l;for(let u in n)s.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let l=t.keyType._zod.run({value:s,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Ja.test(s)&&l.issues.length){let p=t.keyType._zod.run({value:Number(s),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>je(p,o,ve())),input:s,path:[s],inst:e});continue}let d=t.valueType._zod.run({value:n[s],issues:[]},o);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&r.issues.push(...qe(s,p.issues)),r.value[l.value]=p.value})):(d.issues.length&&r.issues.push(...qe(s,d.issues)),r.value[l.value]=d.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Kd=v("$ZodMap",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let l=t.keyType._zod.run({value:a,issues:[]},o),u=t.valueType._zod.run({value:s,issues:[]},o);l instanceof Promise||u instanceof Promise?i.push(Promise.all([l,u]).then(([d,p])=>{Ny(d,p,r,a,n,e,o)})):Ny(l,u,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function Ny(e,t,r,o,n,i,a){e.issues.length&&(ti.has(typeof o)?r.issues.push(...qe(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>je(s,a,ve()))})),t.issues.length&&(ti.has(typeof o)?r.issues.push(...qe(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>je(s,a,ve()))})),r.value.set(e.value,t.value)}var Xd=v("$ZodSet",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(l=>Ly(l,r))):Ly(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function Ly(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Yd=v("$ZodEnum",(e,t)=>{F.init(e,t);let r=Qo(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>ti.has(typeof n)).map(n=>typeof n=="string"?mt(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),Qd=v("$ZodLiteral",(e,t)=>{if(F.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?mt(o):o?mt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),ep=v("$ZodFile",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),tp=v("$ZodTransform",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Cn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new wt;return r.value=n,r.fallback=!0,r}});function Uy(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var os=v("$ZodOptional",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ei(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>Uy(a,n)):Uy(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),np=v("$ZodExactOptional",(e,t)=>{os.init(e,t),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),rp=v("$ZodNullable",(e,t)=>{F.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ei(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),op=v("$ZodDefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>zy(i,t)):zy(n,t)}});function zy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ip=v("$ZodPrefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),ap=v("$ZodNonOptional",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>jy(i,e)):jy(n,e)}});function jy(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var sp=v("$ZodSuccess",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Cn("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),cp=v("$ZodCatch",(e,t)=>{F.init(e,t),e._zod.optin="optional",V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>je(a,o,ve()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>je(i,o,ve()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),lp=v("$ZodNaN",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),is=v("$ZodPipe",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Xa(a,t.in,o)):Xa(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Xa(i,t.out,o)):Xa(n,t.out,o)}});function Xa(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var pi=v("$ZodCodec",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Ya(a,t,o)):Ya(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Ya(a,t,o)):Ya(i,t,o)}}});function Ya(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Qa(e,i,t.out,r)):Qa(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Qa(e,i,t.in,r)):Qa(e,n,t.in,r)}}function Qa(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var up=v("$ZodPreprocess",(e,t)=>{is.init(e,t)}),dp=v("$ZodReadonly",(e,t)=>{F.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>t.innerType?._zod?.optin),V(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Fy):Fy(n)}});function Fy(e){return e.value=Object.freeze(e.value),e}var pp=v("$ZodTemplateLiteral",(e,t)=>{F.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||ou.has(typeof o))r.push(mt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),mp=v("$ZodFunction",(e,t)=>(F.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?Ua(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Ua(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await za(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await za(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new rs({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),fp=v("$ZodPromise",(e,t)=>{F.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),gp=v("$ZodLazy",(e,t)=>{F.init(e,t),V(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),V(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),V(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),V(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),V(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),hp=v("$ZodCustom",(e,t)=>{de.init(e,t),F.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>My(i,r,o,e));My(n,r,o,e)}});function My(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Ur(n))}}var fi={};Jt(fi,{ar:()=>Vy,az:()=>Jy,be:()=>Ky,bg:()=>Xy,ca:()=>Yy,cs:()=>Qy,da:()=>eb,de:()=>tb,el:()=>nb,en:()=>as,eo:()=>rb,es:()=>ob,fa:()=>ib,fi:()=>ab,fr:()=>sb,frCA:()=>cb,he:()=>lb,hr:()=>ub,hu:()=>db,hy:()=>mb,id:()=>fb,is:()=>gb,it:()=>hb,ja:()=>vb,ka:()=>yb,kh:()=>bb,km:()=>ss,ko:()=>xb,lt:()=>wb,mk:()=>Sb,ms:()=>_b,nl:()=>$b,no:()=>Ib,ota:()=>Ab,pl:()=>Pb,ps:()=>Eb,pt:()=>Cb,ro:()=>Tb,ru:()=>Ob,sl:()=>Db,sv:()=>Nb,ta:()=>Lb,th:()=>Ub,tr:()=>zb,ua:()=>jb,uk:()=>cs,ur:()=>Fb,uz:()=>Mb,vi:()=>Bb,yo:()=>Gb,zhCN:()=>Hb,zhTW:()=>Zb});var xP=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${w(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${x(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Vy(){return{localeError:xP()}}var kP=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${w(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Jy(){return{localeError:kP()}}function qy(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var wP=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${w(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=qy(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=qy(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function Ky(){return{localeError:wP()}}var SP=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${w(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function Xy(){return{localeError:SP()}}var _P=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${w(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${x(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function Yy(){return{localeError:_P()}}var $P=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${w(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${x(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function Qy(){return{localeError:$P()}}var IP=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${w(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function eb(){return{localeError:IP()}}var AP=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${w(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function tb(){return{localeError:AP()}}var EP=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${w(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function nb(){return{localeError:EP()}}var PP=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`Invalid option: expected one of ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function as(){return{localeError:PP()}}var CP=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${w(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function rb(){return{localeError:CP()}}var TP=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${w(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function ob(){return{localeError:TP()}}var RP=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${w(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${x(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${x(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function ib(){return{localeError:RP()}}var OP=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${w(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${x(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function ab(){return{localeError:OP()}}var DP=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${w(n.values[0])} attendu`:`Option invalide : une valeur parmi ${x(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${x(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function sb(){return{localeError:DP()}}var NP=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${w(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${x(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function cb(){return{localeError:NP()}}var LP=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?e[u]:void 0,o=u=>{let d=r(u);return d?d.label:u??e.unknown.label},n=u=>`\u05D4${o(u)}`,i=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=u=>u?t[u]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=l[d??""]??o(d),m=S(u.input),f=l[m]??e[m]?.label??m;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${w(u.values[0])}`;let d=u.values.map(f=>w(f));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=u.inclusive?"<=":"<",f=i(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()}`}case"too_small":{let d=a(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let k=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${k}`}let y=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=u.inclusive?">=":">",f=i(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let p=s[d.format],m=p?.label??d.format,g=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${x(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function lb(){return{localeError:LP()}}var UP=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${w(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${x(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function ub(){return{localeError:UP()}}var zP=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${w(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function db(){return{localeError:zP()}}function pb(e,t,r){return Math.abs(e)===1?t:r}function Hr(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var jP=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${w(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=pb(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Hr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Hr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=pb(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Hr(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Hr(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${x(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Hr(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Hr(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function mb(){return{localeError:jP()}}var FP=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${w(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function fb(){return{localeError:FP()}}var MP=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${w(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${x(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function gb(){return{localeError:MP()}}var BP=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${w(n.values[0])}`:`Opzione non valida: atteso uno tra ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${x(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function hb(){return{localeError:BP()}}var HP=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${w(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${x(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${x(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function vb(){return{localeError:HP()}}var ZP=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${w(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${x(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function yb(){return{localeError:ZP()}}var GP=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${w(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${x(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function ss(){return{localeError:GP()}}function bb(){return ss()}var WP=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${w(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${x(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${x(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function xb(){return{localeError:WP()}}var mi=e=>e.charAt(0).toUpperCase()+e.slice(1);function kb(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var VP=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let l=e[n]??null;return l===null?l:{unit:l.unit[i],verb:l.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${w(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${x(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,kb(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${mi(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${mi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,kb(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${mi(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${mi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${x(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${mi(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function wb(){return{localeError:VP()}}var JP=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Sb(){return{localeError:JP()}}var qP=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${w(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${x(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function _b(){return{localeError:qP()}}var KP=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${w(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function $b(){return{localeError:KP()}}var XP=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${w(n.values[0])}`:`Ugyldig valg: forventet en av ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function Ib(){return{localeError:XP()}}var YP=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${w(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Ab(){return{localeError:YP()}}var QP=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${w(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${x(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${x(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Eb(){return{localeError:QP()}}var eC=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${w(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Pb(){return{localeError:eC()}}var tC=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${w(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function Cb(){return{localeError:tC()}}var nC=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${w(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${x(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function Tb(){return{localeError:nC()}}function Rb(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var rC=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${w(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),l=Rb(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),l=Rb(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Ob(){return{localeError:rC()}}var oC=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${w(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${x(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function Db(){return{localeError:oC()}}var iC=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${w(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${x(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Nb(){return{localeError:iC()}}var aC=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${x(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Lb(){return{localeError:aC()}}var sC=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${w(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${x(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Ub(){return{localeError:sC()}}var cC=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${w(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function zb(){return{localeError:cC()}}var lC=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${w(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${x(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function cs(){return{localeError:lC()}}function jb(){return cs()}var uC=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${w(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${x(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${x(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Fb(){return{localeError:uC()}}var dC=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${w(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Mb(){return{localeError:dC()}}var pC=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${w(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${x(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Bb(){return{localeError:pC()}}var mC=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${w(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${x(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Hb(){return{localeError:mC()}}var fC=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${w(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${x(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Zb(){return{localeError:fC()}}var gC=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=S(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${w(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${x(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${x(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Gb(){return{localeError:gC()}}var Wb,vp=Symbol("ZodOutput"),yp=Symbol("ZodInput"),ls=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function us(){return new ls}(Wb=globalThis).__zod_globalRegistry??(Wb.__zod_globalRegistry=us());var Ce=globalThis.__zod_globalRegistry;function bp(e,t){return new e({type:"string",...I(t)})}function xp(e,t){return new e({type:"string",coerce:!0,...I(t)})}function ds(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...I(t)})}function gi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...I(t)})}function ps(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...I(t)})}function ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(t)})}function fs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(t)})}function hi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...I(t)})}function hs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...I(t)})}function vs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(t)})}function ys(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...I(t)})}function bs(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(t)})}function xs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...I(t)})}function ks(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...I(t)})}function ws(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(t)})}function Ss(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(t)})}function _s(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(t)})}function kp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...I(t)})}function $s(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(t)})}function Is(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(t)})}function As(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...I(t)})}function Es(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...I(t)})}function Ps(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...I(t)})}function Cs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...I(t)})}var wp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Sp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(t)})}function _p(e,t){return new e({type:"string",format:"date",check:"string_format",...I(t)})}function $p(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...I(t)})}function Ip(e,t){return new e({type:"string",format:"duration",check:"string_format",...I(t)})}function Ap(e,t){return new e({type:"number",checks:[],...I(t)})}function Ep(e,t){return new e({type:"number",coerce:!0,checks:[],...I(t)})}function Pp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...I(t)})}function Cp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...I(t)})}function Tp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...I(t)})}function Rp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...I(t)})}function Op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...I(t)})}function Dp(e,t){return new e({type:"boolean",...I(t)})}function Np(e,t){return new e({type:"boolean",coerce:!0,...I(t)})}function Lp(e,t){return new e({type:"bigint",...I(t)})}function Up(e,t){return new e({type:"bigint",coerce:!0,...I(t)})}function zp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(t)})}function jp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(t)})}function Fp(e,t){return new e({type:"symbol",...I(t)})}function Mp(e,t){return new e({type:"undefined",...I(t)})}function Bp(e,t){return new e({type:"null",...I(t)})}function Hp(e){return new e({type:"any"})}function Zp(e){return new e({type:"unknown"})}function Gp(e,t){return new e({type:"never",...I(t)})}function Wp(e,t){return new e({type:"void",...I(t)})}function Vp(e,t){return new e({type:"date",...I(t)})}function Jp(e,t){return new e({type:"date",coerce:!0,...I(t)})}function qp(e,t){return new e({type:"nan",...I(t)})}function Dt(e,t){return new qa({check:"less_than",...I(t),value:e,inclusive:!1})}function ot(e,t){return new qa({check:"less_than",...I(t),value:e,inclusive:!0})}function Nt(e,t){return new Ka({check:"greater_than",...I(t),value:e,inclusive:!1})}function Fe(e,t){return new Ka({check:"greater_than",...I(t),value:e,inclusive:!0})}function Ts(e){return Nt(0,e)}function Rs(e){return Dt(0,e)}function Os(e){return ot(0,e)}function Ds(e){return Fe(0,e)}function Nn(e,t){return new Bu({check:"multiple_of",...I(t),value:e})}function Ln(e,t){return new Gu({check:"max_size",...I(t),maximum:e})}function Lt(e,t){return new Wu({check:"min_size",...I(t),minimum:e})}function tr(e,t){return new Vu({check:"size_equals",...I(t),size:e})}function nr(e,t){return new Ju({check:"max_length",...I(t),maximum:e})}function nn(e,t){return new qu({check:"min_length",...I(t),minimum:e})}function rr(e,t){return new Ku({check:"length_equals",...I(t),length:e})}function Zr(e,t){return new Xu({check:"string_format",format:"regex",...I(t),pattern:e})}function Gr(e){return new Yu({check:"string_format",format:"lowercase",...I(e)})}function Wr(e){return new Qu({check:"string_format",format:"uppercase",...I(e)})}function Vr(e,t){return new ed({check:"string_format",format:"includes",...I(t),includes:e})}function Jr(e,t){return new td({check:"string_format",format:"starts_with",...I(t),prefix:e})}function qr(e,t){return new nd({check:"string_format",format:"ends_with",...I(t),suffix:e})}function Ns(e,t,r){return new rd({check:"property",property:e,schema:t,...I(r)})}function Kr(e,t){return new od({check:"mime_type",mime:e,...I(t)})}function St(e){return new id({check:"overwrite",tx:e})}function Xr(e){return St(t=>t.normalize(e))}function Yr(){return St(e=>e.trim())}function Qr(){return St(e=>e.toLowerCase())}function eo(){return St(e=>e.toUpperCase())}function to(){return St(e=>tu(e))}function Kp(e,t,r){return new e({type:"array",element:t,...I(r)})}function vC(e,t,r){return new e({type:"union",options:t,...I(r)})}function yC(e,t,r){return new e({type:"union",options:t,inclusive:!1,...I(r)})}function bC(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...I(o)})}function xC(e,t,r){return new e({type:"intersection",left:t,right:r})}function kC(e,t,r,o){let n=r instanceof F,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...I(i)})}function wC(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...I(o)})}function SC(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...I(o)})}function _C(e,t,r){return new e({type:"set",valueType:t,...I(r)})}function $C(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...I(r)})}function IC(e,t,r){return new e({type:"enum",entries:t,...I(r)})}function AC(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...I(r)})}function Xp(e,t){return new e({type:"file",...I(t)})}function EC(e,t){return new e({type:"transform",transform:t})}function PC(e,t){return new e({type:"optional",innerType:t})}function CC(e,t){return new e({type:"nullable",innerType:t})}function TC(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():ru(r)}})}function RC(e,t,r){return new e({type:"nonoptional",innerType:t,...I(r)})}function OC(e,t){return new e({type:"success",innerType:t})}function DC(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function NC(e,t,r){return new e({type:"pipe",in:t,out:r})}function LC(e,t){return new e({type:"readonly",innerType:t})}function UC(e,t,r){return new e({type:"template_literal",parts:t,...I(r)})}function zC(e,t){return new e({type:"lazy",getter:t})}function jC(e,t){return new e({type:"promise",innerType:t})}function Yp(e,t,r){let o=I(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Qp(e,t,r){return new e({type:"custom",check:"custom",fn:t,...I(r)})}function em(e,t){let r=Vb(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Ur(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Ur(i))}},e(o.value,o)),t);return r}function Vb(e,t){let r=new de({check:"custom",...I(t)});return r._zod.check=e,r}function tm(e){let t=new de({check:"describe"});return t._zod.onattach=[r=>{let o=Ce.get(r)??{};Ce.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function nm(e){let t=new de({check:"meta"});return t._zod.onattach=[r=>{let o=Ce.get(r)??{};Ce.add(r,{...o,...e})}],t._zod.check=()=>{},t}function rm(e,t){let r=I(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),a=new Set(n),s=e.Codec??pi,l=e.Boolean??ui,u=e.String??er,d=new u({type:"string",error:r.error}),p=new l({type:"boolean",error:r.error}),m=new s({type:"pipe",in:d,out:p,transform:((f,g)=>{let y=f;return r.case!=="sensitive"&&(y=y.toLowerCase()),i.has(y)?!0:a.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function no(e,t,r,o={}){let n=I(o),i={...I(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Un(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ce,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function oe(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{let m=a.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,m,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),oe(p,t,d),t.seen.get(p).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Me(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function zn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let l=o.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(g=>g);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${f}`}}if(a[1]===r)return{ref:"#"};let u=`#/${s}/`,d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:l,defId:u}=n(a);s.def={...s.schema},u&&(s.defId=u);let d=s.schema;for(let p in d)delete d[p];d.$ref=l};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
236
+
237
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function jn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let l=e.seen.get(s);if(l.ref===null)return;let u=l.def??l.schema,d={...u},p=l.ref;if(l.ref=null,p){o(p);let f=e.seen.get(p),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,d),s._zod.parent===p)for(let k in u)k==="$ref"||k==="allOf"||k in d||delete u[k];if(g.$ref&&f.def)for(let k in u)k==="$ref"||k==="allOf"||k in f.def&&JSON.stringify(u[k])===JSON.stringify(f.def[k])&&delete u[k]}let m=s._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:s,jsonSchema:u,path:l.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let l=s[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,a[l.defId]=l.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:ro(t,"input",e.processors),output:ro(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Me(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Me(o.element,r);if(o.type==="set")return Me(o.valueType,r);if(o.type==="lazy")return Me(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Me(o.innerType,r);if(o.type==="intersection")return Me(o.left,r)||Me(o.right,r);if(o.type==="record"||o.type==="map")return Me(o.keyType,r)||Me(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Me(o.in,r)||Me(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Me(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Me(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Me(n,r))return!0;return!!(o.rest&&Me(o.rest,r))}return!1}var om=(e,t={})=>r=>{let o=Un({...r,processors:t});return oe(e,o),zn(o,e),jn(o,e)},ro=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=Un({...n??{},target:i,io:t,processors:r});return oe(e,a),zn(a,e),jn(a,e)};var FC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},im=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=FC[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},am=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let p=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";p?f?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d:typeof i=="number"&&(n.minimum=i),m?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof a=="number"&&(n.maximum=a),typeof l=="number"&&(n.multipleOf=l)},sm=(e,t,r,o)=>{r.type="boolean"},cm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},lm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},um=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},dm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},pm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},mm=(e,t,r,o)=>{r.not={}},fm=(e,t,r,o)=>{},gm=(e,t,r,o)=>{},hm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},vm=(e,t,r,o)=>{let n=e._zod.def,i=Qo(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},ym=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},bm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},xm=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},km=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:l}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),l?l.length===1?(i.contentMediaType=l[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,i)},wm=(e,t,r,o)=>{r.type="boolean"},Sm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_m=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},$m=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Im=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Am=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Em=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=oe(i.element,t,{...o,path:[...o.path,"items"]})},Pm=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let u in a)n.properties[u]=oe(a[u],t,{...o,path:[...o.path,"properties",u]});let s=new Set(Object.keys(a)),l=new Set([...s].filter(u=>{let d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(n.required=Array.from(l)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=oe(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Us=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,l)=>oe(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=a:r.anyOf=a},Cm=(e,t,r,o)=>{let n=e._zod.def,i=oe(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=oe(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=l},Tm=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((m,f)=>oe(m,t,{...o,path:[...o.path,a,f]})),u=i.rest?oe(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof p=="number"&&(n.maxItems=p)},Rm=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let d=oe(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let p of l)n.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=oe(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=oe(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=a._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(n.required=d)}},Om=(e,t,r,o)=>{let n=e._zod.def,i=oe(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Dm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Nm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Lm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Um=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},zm=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;oe(a,t,o);let s=t.seen.get(e);s.ref=a},jm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},Fm=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},zs=(e,t,r,o)=>{let n=e._zod.def;oe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Mm=(e,t,r,o)=>{let n=e._zod.innerType;oe(n,t,o);let i=t.seen.get(e);i.ref=n},Ls={string:im,number:am,boolean:sm,bigint:cm,symbol:lm,null:um,undefined:dm,void:pm,never:mm,any:fm,unknown:gm,date:hm,enum:vm,literal:ym,nan:bm,template_literal:xm,file:km,success:wm,custom:Sm,function:_m,transform:$m,map:Im,set:Am,array:Em,object:Pm,union:Us,intersection:Cm,tuple:Tm,record:Rm,nullable:Om,nonoptional:Dm,default:Nm,prefault:Lm,catch:Um,pipe:zm,readonly:jm,promise:Fm,optional:zs,lazy:Mm};function js(e,t){if("_idmap"in e){let o=e,n=Un({...t,processors:Ls}),i={};for(let l of o._idmap.entries()){let[u,d]=l;oe(d,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let l of o._idmap.entries()){let[u,d]=l;zn(n,d),a[u]=jn(n,d)}if(Object.keys(i).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[l]:i}}return{schemas:a}}let r=Un({...t,processors:Ls});return oe(e,r),zn(r,e),jn(r,e)}var Fs=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Un({processors:Ls,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return oe(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),zn(this.ctx,t);let o=jn(this.ctx,t),{"~standard":n,...i}=o;return i}};var Jb={};var vi={};Jt(vi,{ZodAny:()=>pf,ZodArray:()=>hf,ZodBase64:()=>sc,ZodBase64URL:()=>cc,ZodBigInt:()=>po,ZodBigIntFormat:()=>dc,ZodBoolean:()=>uo,ZodCIDRv4:()=>ic,ZodCIDRv6:()=>ac,ZodCUID:()=>Ys,ZodCUID2:()=>Qs,ZodCatch:()=>zf,ZodCodec:()=>Pi,ZodCustom:()=>Ci,ZodCustomStringFormat:()=>co,ZodDate:()=>_i,ZodDefault:()=>Rf,ZodDiscriminatedUnion:()=>yf,ZodE164:()=>lc,ZodEmail:()=>qs,ZodEmoji:()=>Ks,ZodEnum:()=>ao,ZodExactOptional:()=>Pf,ZodFile:()=>Af,ZodFunction:()=>Jf,ZodGUID:()=>bi,ZodIPv4:()=>rc,ZodIPv6:()=>oc,ZodIntersection:()=>bf,ZodJWT:()=>uc,ZodKSUID:()=>nc,ZodLazy:()=>Gf,ZodLiteral:()=>If,ZodMAC:()=>of,ZodMap:()=>_f,ZodNaN:()=>Ff,ZodNanoID:()=>Xs,ZodNever:()=>ff,ZodNonOptional:()=>vc,ZodNull:()=>uf,ZodNullable:()=>Tf,ZodNumber:()=>lo,ZodNumberFormat:()=>ir,ZodObject:()=>Ii,ZodOptional:()=>hc,ZodPipe:()=>Ei,ZodPrefault:()=>Df,ZodPreprocess:()=>Mf,ZodPromise:()=>Vf,ZodReadonly:()=>Bf,ZodRecord:()=>io,ZodSet:()=>$f,ZodString:()=>so,ZodStringFormat:()=>ce,ZodSuccess:()=>Uf,ZodSymbol:()=>cf,ZodTemplateLiteral:()=>Zf,ZodTransform:()=>Ef,ZodTuple:()=>kf,ZodType:()=>B,ZodULID:()=>ec,ZodURL:()=>Si,ZodUUID:()=>Ut,ZodUndefined:()=>lf,ZodUnion:()=>Ai,ZodUnknown:()=>mf,ZodVoid:()=>gf,ZodXID:()=>tc,ZodXor:()=>vf,_ZodString:()=>Js,_default:()=>Of,_function:()=>rk,any:()=>Dx,array:()=>$i,base64:()=>vx,base64url:()=>yx,bigint:()=>Px,boolean:()=>sf,catch:()=>jf,check:()=>ok,cidrv4:()=>gx,cidrv6:()=>hx,codec:()=>Qx,cuid:()=>sx,cuid2:()=>cx,custom:()=>ik,date:()=>Lx,describe:()=>ak,discriminatedUnion:()=>Bx,e164:()=>bx,email:()=>Xb,emoji:()=>ix,enum:()=>fc,exactOptional:()=>Cf,file:()=>qx,float32:()=>$x,float64:()=>Ix,function:()=>rk,guid:()=>Yb,hash:()=>_x,hex:()=>Sx,hostname:()=>wx,httpUrl:()=>ox,instanceof:()=>ck,int:()=>Ws,int32:()=>Ax,int64:()=>Cx,intersection:()=>xf,invertCodec:()=>ek,ipv4:()=>px,ipv6:()=>fx,json:()=>uk,jwt:()=>xx,keyof:()=>Ux,ksuid:()=>dx,lazy:()=>Wf,literal:()=>Jx,looseObject:()=>Fx,looseRecord:()=>Zx,mac:()=>mx,map:()=>Gx,meta:()=>sk,nan:()=>Yx,nanoid:()=>ax,nativeEnum:()=>Vx,never:()=>pc,nonoptional:()=>Lf,null:()=>df,nullable:()=>ki,nullish:()=>Kx,number:()=>af,object:()=>zx,optional:()=>xi,partialRecord:()=>Hx,pipe:()=>Vs,prefault:()=>Nf,preprocess:()=>dk,promise:()=>nk,readonly:()=>Hf,record:()=>Sf,refine:()=>qf,set:()=>Wx,strictObject:()=>jx,string:()=>yi,stringFormat:()=>kx,stringbool:()=>lk,success:()=>Xx,superRefine:()=>Kf,symbol:()=>Rx,templateLiteral:()=>tk,transform:()=>gc,tuple:()=>wf,uint32:()=>Ex,uint64:()=>Tx,ulid:()=>lx,undefined:()=>Ox,union:()=>mc,unknown:()=>or,url:()=>rx,uuid:()=>Qb,uuidv4:()=>ex,uuidv6:()=>tx,uuidv7:()=>nx,void:()=>Nx,xid:()=>ux,xor:()=>Mx});var Ms={};Jt(Ms,{endsWith:()=>qr,gt:()=>Nt,gte:()=>Fe,includes:()=>Vr,length:()=>rr,lowercase:()=>Gr,lt:()=>Dt,lte:()=>ot,maxLength:()=>nr,maxSize:()=>Ln,mime:()=>Kr,minLength:()=>nn,minSize:()=>Lt,multipleOf:()=>Nn,negative:()=>Rs,nonnegative:()=>Ds,nonpositive:()=>Os,normalize:()=>Xr,overwrite:()=>St,positive:()=>Ts,property:()=>Ns,regex:()=>Zr,size:()=>tr,slugify:()=>to,startsWith:()=>Jr,toLowerCase:()=>Qr,toUpperCase:()=>eo,trim:()=>Yr,uppercase:()=>Wr});var oo={};Jt(oo,{ZodISODate:()=>Hs,ZodISODateTime:()=>Bs,ZodISODuration:()=>Gs,ZodISOTime:()=>Zs,date:()=>Hm,datetime:()=>Bm,duration:()=>Gm,time:()=>Zm});var Bs=v("ZodISODateTime",(e,t)=>{bd.init(e,t),ce.init(e,t)});function Bm(e){return Sp(Bs,e)}var Hs=v("ZodISODate",(e,t)=>{xd.init(e,t),ce.init(e,t)});function Hm(e){return _p(Hs,e)}var Zs=v("ZodISOTime",(e,t)=>{kd.init(e,t),ce.init(e,t)});function Zm(e){return $p(Zs,e)}var Gs=v("ZodISODuration",(e,t)=>{wd.init(e,t),ce.init(e,t)});function Gm(e){return Ip(Gs,e)}var qb=(e,t)=>{oi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ai(e,r)},flatten:{value:r=>ii(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Nr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Nr,2)}},isEmpty:{get(){return e.issues.length===0}}})},BC=v("ZodError",qb),Xe=v("ZodError",qb,{Parent:Error});var Wm=zr(Xe),Vm=jr(Xe),Jm=Fr(Xe),qm=Mr(Xe),Km=ja(Xe),Xm=Fa(Xe),Ym=Ma(Xe),Qm=Ba(Xe),ef=Ha(Xe),tf=Za(Xe),nf=Ga(Xe),rf=Wa(Xe);var Kb=new WeakMap;function wi(e,t,r){let o=Object.getPrototypeOf(e),n=Kb.get(o);if(n||(n=new Set,Kb.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var B=v("ZodType",(e,t)=>(F.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ro(e,"input"),output:ro(e,"output")}}),e.toJSONSchema=om(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Wm(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Jm(e,r,o),e.parseAsync=async(r,o)=>Vm(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>qm(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Km(e,r,o),e.decode=(r,o)=>Xm(e,r,o),e.encodeAsync=async(r,o)=>Ym(e,r,o),e.decodeAsync=async(r,o)=>Qm(e,r,o),e.safeEncode=(r,o)=>ef(e,r,o),e.safeDecode=(r,o)=>tf(e,r,o),e.safeEncodeAsync=async(r,o)=>nf(e,r,o),e.safeDecodeAsync=async(r,o)=>rf(e,r,o),wi(e,"ZodType",{check(...r){let o=this.def;return this.clone($.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return ze(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(qf(r,o))},superRefine(r,o){return this.check(Kf(r,o))},overwrite(r){return this.check(St(r))},optional(){return xi(this)},exactOptional(){return Cf(this)},nullable(){return ki(this)},nullish(){return xi(ki(this))},nonoptional(r){return Lf(this,r)},array(){return $i(this)},or(r){return mc([this,r])},and(r){return xf(this,r)},transform(r){return Vs(this,gc(r))},default(r){return Of(this,r)},prefault(r){return Nf(this,r)},catch(r){return jf(this,r)},pipe(r){return Vs(this,r)},readonly(){return Hf(this)},describe(r){let o=this.clone();return Ce.add(o,{description:r}),o},meta(...r){if(r.length===0)return Ce.get(this);let o=this.clone();return Ce.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Ce.get(e)?.description},configurable:!0}),e)),Js=v("_ZodString",(e,t)=>{er.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>im(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,wi(e,"_ZodString",{regex(...o){return this.check(Zr(...o))},includes(...o){return this.check(Vr(...o))},startsWith(...o){return this.check(Jr(...o))},endsWith(...o){return this.check(qr(...o))},min(...o){return this.check(nn(...o))},max(...o){return this.check(nr(...o))},length(...o){return this.check(rr(...o))},nonempty(...o){return this.check(nn(1,...o))},lowercase(o){return this.check(Gr(o))},uppercase(o){return this.check(Wr(o))},trim(){return this.check(Yr())},normalize(...o){return this.check(Xr(...o))},toLowerCase(){return this.check(Qr())},toUpperCase(){return this.check(eo())},slugify(){return this.check(to())}})}),so=v("ZodString",(e,t)=>{er.init(e,t),Js.init(e,t),e.email=r=>e.check(ds(qs,r)),e.url=r=>e.check(hi(Si,r)),e.jwt=r=>e.check(Cs(uc,r)),e.emoji=r=>e.check(hs(Ks,r)),e.guid=r=>e.check(gi(bi,r)),e.uuid=r=>e.check(ps(Ut,r)),e.uuidv4=r=>e.check(ms(Ut,r)),e.uuidv6=r=>e.check(fs(Ut,r)),e.uuidv7=r=>e.check(gs(Ut,r)),e.nanoid=r=>e.check(vs(Xs,r)),e.guid=r=>e.check(gi(bi,r)),e.cuid=r=>e.check(ys(Ys,r)),e.cuid2=r=>e.check(bs(Qs,r)),e.ulid=r=>e.check(xs(ec,r)),e.base64=r=>e.check(As(sc,r)),e.base64url=r=>e.check(Es(cc,r)),e.xid=r=>e.check(ks(tc,r)),e.ksuid=r=>e.check(ws(nc,r)),e.ipv4=r=>e.check(Ss(rc,r)),e.ipv6=r=>e.check(_s(oc,r)),e.cidrv4=r=>e.check($s(ic,r)),e.cidrv6=r=>e.check(Is(ac,r)),e.e164=r=>e.check(Ps(lc,r)),e.datetime=r=>e.check(Bm(r)),e.date=r=>e.check(Hm(r)),e.time=r=>e.check(Zm(r)),e.duration=r=>e.check(Gm(r))});function yi(e){return bp(so,e)}var ce=v("ZodStringFormat",(e,t)=>{se.init(e,t),Js.init(e,t)}),qs=v("ZodEmail",(e,t)=>{ud.init(e,t),ce.init(e,t)});function Xb(e){return ds(qs,e)}var bi=v("ZodGUID",(e,t)=>{cd.init(e,t),ce.init(e,t)});function Yb(e){return gi(bi,e)}var Ut=v("ZodUUID",(e,t)=>{ld.init(e,t),ce.init(e,t)});function Qb(e){return ps(Ut,e)}function ex(e){return ms(Ut,e)}function tx(e){return fs(Ut,e)}function nx(e){return gs(Ut,e)}var Si=v("ZodURL",(e,t)=>{dd.init(e,t),ce.init(e,t)});function rx(e){return hi(Si,e)}function ox(e){return hi(Si,{protocol:rt.httpProtocol,hostname:rt.domain,...$.normalizeParams(e)})}var Ks=v("ZodEmoji",(e,t)=>{pd.init(e,t),ce.init(e,t)});function ix(e){return hs(Ks,e)}var Xs=v("ZodNanoID",(e,t)=>{md.init(e,t),ce.init(e,t)});function ax(e){return vs(Xs,e)}var Ys=v("ZodCUID",(e,t)=>{fd.init(e,t),ce.init(e,t)});function sx(e){return ys(Ys,e)}var Qs=v("ZodCUID2",(e,t)=>{gd.init(e,t),ce.init(e,t)});function cx(e){return bs(Qs,e)}var ec=v("ZodULID",(e,t)=>{hd.init(e,t),ce.init(e,t)});function lx(e){return xs(ec,e)}var tc=v("ZodXID",(e,t)=>{vd.init(e,t),ce.init(e,t)});function ux(e){return ks(tc,e)}var nc=v("ZodKSUID",(e,t)=>{yd.init(e,t),ce.init(e,t)});function dx(e){return ws(nc,e)}var rc=v("ZodIPv4",(e,t)=>{Sd.init(e,t),ce.init(e,t)});function px(e){return Ss(rc,e)}var of=v("ZodMAC",(e,t)=>{$d.init(e,t),ce.init(e,t)});function mx(e){return kp(of,e)}var oc=v("ZodIPv6",(e,t)=>{_d.init(e,t),ce.init(e,t)});function fx(e){return _s(oc,e)}var ic=v("ZodCIDRv4",(e,t)=>{Id.init(e,t),ce.init(e,t)});function gx(e){return $s(ic,e)}var ac=v("ZodCIDRv6",(e,t)=>{Ad.init(e,t),ce.init(e,t)});function hx(e){return Is(ac,e)}var sc=v("ZodBase64",(e,t)=>{Pd.init(e,t),ce.init(e,t)});function vx(e){return As(sc,e)}var cc=v("ZodBase64URL",(e,t)=>{Cd.init(e,t),ce.init(e,t)});function yx(e){return Es(cc,e)}var lc=v("ZodE164",(e,t)=>{Td.init(e,t),ce.init(e,t)});function bx(e){return Ps(lc,e)}var uc=v("ZodJWT",(e,t)=>{Rd.init(e,t),ce.init(e,t)});function xx(e){return Cs(uc,e)}var co=v("ZodCustomStringFormat",(e,t)=>{Od.init(e,t),ce.init(e,t)});function kx(e,t,r={}){return no(co,e,t,r)}function wx(e){return no(co,"hostname",rt.hostname,e)}function Sx(e){return no(co,"hex",rt.hex,e)}function _x(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=rt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return no(co,o,n,t)}var lo=v("ZodNumber",(e,t)=>{ts.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>am(e,o,n,i),wi(e,"ZodNumber",{gt(o,n){return this.check(Nt(o,n))},gte(o,n){return this.check(Fe(o,n))},min(o,n){return this.check(Fe(o,n))},lt(o,n){return this.check(Dt(o,n))},lte(o,n){return this.check(ot(o,n))},max(o,n){return this.check(ot(o,n))},int(o){return this.check(Ws(o))},safe(o){return this.check(Ws(o))},positive(o){return this.check(Nt(0,o))},nonnegative(o){return this.check(Fe(0,o))},negative(o){return this.check(Dt(0,o))},nonpositive(o){return this.check(ot(0,o))},multipleOf(o,n){return this.check(Nn(o,n))},step(o,n){return this.check(Nn(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function af(e){return Ap(lo,e)}var ir=v("ZodNumberFormat",(e,t)=>{Dd.init(e,t),lo.init(e,t)});function Ws(e){return Pp(ir,e)}function $x(e){return Cp(ir,e)}function Ix(e){return Tp(ir,e)}function Ax(e){return Rp(ir,e)}function Ex(e){return Op(ir,e)}var uo=v("ZodBoolean",(e,t)=>{ui.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sm(e,r,o,n)});function sf(e){return Dp(uo,e)}var po=v("ZodBigInt",(e,t)=>{ns.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>cm(e,o,n,i),e.gte=(o,n)=>e.check(Fe(o,n)),e.min=(o,n)=>e.check(Fe(o,n)),e.gt=(o,n)=>e.check(Nt(o,n)),e.gte=(o,n)=>e.check(Fe(o,n)),e.min=(o,n)=>e.check(Fe(o,n)),e.lt=(o,n)=>e.check(Dt(o,n)),e.lte=(o,n)=>e.check(ot(o,n)),e.max=(o,n)=>e.check(ot(o,n)),e.positive=o=>e.check(Nt(BigInt(0),o)),e.negative=o=>e.check(Dt(BigInt(0),o)),e.nonpositive=o=>e.check(ot(BigInt(0),o)),e.nonnegative=o=>e.check(Fe(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Nn(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Px(e){return Lp(po,e)}var dc=v("ZodBigIntFormat",(e,t)=>{Nd.init(e,t),po.init(e,t)});function Cx(e){return zp(dc,e)}function Tx(e){return jp(dc,e)}var cf=v("ZodSymbol",(e,t)=>{Ld.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lm(e,r,o,n)});function Rx(e){return Fp(cf,e)}var lf=v("ZodUndefined",(e,t)=>{Ud.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dm(e,r,o,n)});function Ox(e){return Mp(lf,e)}var uf=v("ZodNull",(e,t)=>{zd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>um(e,r,o,n)});function df(e){return Bp(uf,e)}var pf=v("ZodAny",(e,t)=>{jd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fm(e,r,o,n)});function Dx(){return Hp(pf)}var mf=v("ZodUnknown",(e,t)=>{Fd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gm(e,r,o,n)});function or(){return Zp(mf)}var ff=v("ZodNever",(e,t)=>{Md.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mm(e,r,o,n)});function pc(e){return Gp(ff,e)}var gf=v("ZodVoid",(e,t)=>{Bd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pm(e,r,o,n)});function Nx(e){return Wp(gf,e)}var _i=v("ZodDate",(e,t)=>{Hd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>hm(e,o,n,i),e.min=(o,n)=>e.check(Fe(o,n)),e.max=(o,n)=>e.check(ot(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Lx(e){return Vp(_i,e)}var hf=v("ZodArray",(e,t)=>{Zd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Em(e,r,o,n),e.element=t.element,wi(e,"ZodArray",{min(r,o){return this.check(nn(r,o))},nonempty(r){return this.check(nn(1,r))},max(r,o){return this.check(nr(r,o))},length(r,o){return this.check(rr(r,o))},unwrap(){return this.element}})});function $i(e,t){return Kp(hf,e,t)}function Ux(e){let t=e._zod.def.shape;return fc(Object.keys(t))}var Ii=v("ZodObject",(e,t)=>{Gd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pm(e,r,o,n),$.defineLazy(e,"shape",()=>t.shape),wi(e,"ZodObject",{keyof(){return fc(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:or()})},loose(){return this.clone({...this._zod.def,catchall:or()})},strict(){return this.clone({...this._zod.def,catchall:pc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return $.extend(this,r)},safeExtend(r){return $.safeExtend(this,r)},merge(r){return $.merge(this,r)},pick(r){return $.pick(this,r)},omit(r){return $.omit(this,r)},partial(...r){return $.partial(hc,this,r[0])},required(...r){return $.required(vc,this,r[0])}})});function zx(e,t){let r={type:"object",shape:e??{},...$.normalizeParams(t)};return new Ii(r)}function jx(e,t){return new Ii({type:"object",shape:e,catchall:pc(),...$.normalizeParams(t)})}function Fx(e,t){return new Ii({type:"object",shape:e,catchall:or(),...$.normalizeParams(t)})}var Ai=v("ZodUnion",(e,t)=>{di.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Us(e,r,o,n),e.options=t.options});function mc(e,t){return new Ai({type:"union",options:e,...$.normalizeParams(t)})}var vf=v("ZodXor",(e,t)=>{Ai.init(e,t),Wd.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Us(e,r,o,n),e.options=t.options});function Mx(e,t){return new vf({type:"union",options:e,inclusive:!1,...$.normalizeParams(t)})}var yf=v("ZodDiscriminatedUnion",(e,t)=>{Ai.init(e,t),Vd.init(e,t)});function Bx(e,t,r){return new yf({type:"union",options:t,discriminator:e,...$.normalizeParams(r)})}var bf=v("ZodIntersection",(e,t)=>{Jd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cm(e,r,o,n)});function xf(e,t){return new bf({type:"intersection",left:e,right:t})}var kf=v("ZodTuple",(e,t)=>{rs.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tm(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function wf(e,t,r){let o=t instanceof F,n=o?r:t,i=o?t:null;return new kf({type:"tuple",items:e,rest:i,...$.normalizeParams(n)})}var io=v("ZodRecord",(e,t)=>{qd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rm(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function Sf(e,t,r){return!t||!t._zod?new io({type:"record",keyType:yi(),valueType:e,...$.normalizeParams(t)}):new io({type:"record",keyType:e,valueType:t,...$.normalizeParams(r)})}function Hx(e,t,r){let o=ze(e);return o._zod.values=void 0,new io({type:"record",keyType:o,valueType:t,...$.normalizeParams(r)})}function Zx(e,t,r){return new io({type:"record",keyType:e,valueType:t,mode:"loose",...$.normalizeParams(r)})}var _f=v("ZodMap",(e,t)=>{Kd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Im(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Lt(...r)),e.nonempty=r=>e.check(Lt(1,r)),e.max=(...r)=>e.check(Ln(...r)),e.size=(...r)=>e.check(tr(...r))});function Gx(e,t,r){return new _f({type:"map",keyType:e,valueType:t,...$.normalizeParams(r)})}var $f=v("ZodSet",(e,t)=>{Xd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Am(e,r,o,n),e.min=(...r)=>e.check(Lt(...r)),e.nonempty=r=>e.check(Lt(1,r)),e.max=(...r)=>e.check(Ln(...r)),e.size=(...r)=>e.check(tr(...r))});function Wx(e,t){return new $f({type:"set",valueType:e,...$.normalizeParams(t)})}var ao=v("ZodEnum",(e,t)=>{Yd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(o,n,i)=>vm(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ao({...t,checks:[],...$.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new ao({...t,checks:[],...$.normalizeParams(n),entries:i})}});function fc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ao({type:"enum",entries:r,...$.normalizeParams(t)})}function Vx(e,t){return new ao({type:"enum",entries:e,...$.normalizeParams(t)})}var If=v("ZodLiteral",(e,t)=>{Qd.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ym(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Jx(e,t){return new If({type:"literal",values:Array.isArray(e)?e:[e],...$.normalizeParams(t)})}var Af=v("ZodFile",(e,t)=>{ep.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>km(e,r,o,n),e.min=(r,o)=>e.check(Lt(r,o)),e.max=(r,o)=>e.check(Ln(r,o)),e.mime=(r,o)=>e.check(Kr(Array.isArray(r)?r:[r],o))});function qx(e){return Xp(Af,e)}var Ef=v("ZodTransform",(e,t)=>{tp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$m(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Cn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push($.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push($.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function gc(e){return new Ef({type:"transform",transform:e})}var hc=v("ZodOptional",(e,t)=>{os.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function xi(e){return new hc({type:"optional",innerType:e})}var Pf=v("ZodExactOptional",(e,t)=>{np.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Cf(e){return new Pf({type:"optional",innerType:e})}var Tf=v("ZodNullable",(e,t)=>{rp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Om(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ki(e){return new Tf({type:"nullable",innerType:e})}function Kx(e){return xi(ki(e))}var Rf=v("ZodDefault",(e,t)=>{op.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Of(e,t){return new Rf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():$.shallowClone(t)}})}var Df=v("ZodPrefault",(e,t)=>{ip.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Nf(e,t){return new Df({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():$.shallowClone(t)}})}var vc=v("ZodNonOptional",(e,t)=>{ap.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Lf(e,t){return new vc({type:"nonoptional",innerType:e,...$.normalizeParams(t)})}var Uf=v("ZodSuccess",(e,t)=>{sp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Xx(e){return new Uf({type:"success",innerType:e})}var zf=v("ZodCatch",(e,t)=>{cp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Um(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jf(e,t){return new zf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Ff=v("ZodNaN",(e,t)=>{lp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bm(e,r,o,n)});function Yx(e){return qp(Ff,e)}var Ei=v("ZodPipe",(e,t)=>{is.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zm(e,r,o,n),e.in=t.in,e.out=t.out});function Vs(e,t){return new Ei({type:"pipe",in:e,out:t})}var Pi=v("ZodCodec",(e,t)=>{Ei.init(e,t),pi.init(e,t)});function Qx(e,t,r){return new Pi({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function ek(e){let t=e._zod.def;return new Pi({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Mf=v("ZodPreprocess",(e,t)=>{Ei.init(e,t),up.init(e,t)}),Bf=v("ZodReadonly",(e,t)=>{dp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Hf(e){return new Bf({type:"readonly",innerType:e})}var Zf=v("ZodTemplateLiteral",(e,t)=>{pp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xm(e,r,o,n)});function tk(e,t){return new Zf({type:"template_literal",parts:e,...$.normalizeParams(t)})}var Gf=v("ZodLazy",(e,t)=>{gp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mm(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Wf(e){return new Gf({type:"lazy",getter:e})}var Vf=v("ZodPromise",(e,t)=>{fp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function nk(e){return new Vf({type:"promise",innerType:e})}var Jf=v("ZodFunction",(e,t)=>{mp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_m(e,r,o,n)});function rk(e){return new Jf({type:"function",input:Array.isArray(e?.input)?wf(e?.input):e?.input??$i(or()),output:e?.output??or()})}var Ci=v("ZodCustom",(e,t)=>{hp.init(e,t),B.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sm(e,r,o,n)});function ok(e){let t=new de({check:"custom"});return t._zod.check=e,t}function ik(e,t){return Yp(Ci,e??(()=>!0),t)}function qf(e,t={}){return Qp(Ci,e,t)}function Kf(e,t){return em(e,t)}var ak=tm,sk=nm;function ck(e,t={}){let r=new Ci({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...$.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var lk=(...e)=>rm({Codec:Pi,Boolean:uo,String:so},...e);function uk(e){let t=Wf(()=>mc([yi(e),af(),sf(),df(),$i(t),Sf(yi(),t)]));return t}function dk(e,t){return new Mf({type:"pipe",in:gc(e),out:t})}var ZC={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function GC(e){ve({customError:e})}function WC(){return ve().customError}var Xf;Xf||(Xf={});var T={...vi,...Ms,iso:oo},VC=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function JC(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function qC(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function pk(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return T.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return T.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=qC(n,t),a=Oe(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return T.null();if(n.length===0)return T.never();if(n.length===1)return T.literal(n[0]);if(n.every(a=>typeof a=="string"))return T.enum(n);let i=n.map(a=>T.literal(a));return i.length<2?i[0]:T.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return T.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return pk(a,t)});return n.length===0?T.never():n.length===1?n[0]:T.union(n)}if(!r)return T.any();let o;switch(r){case"string":{let n=T.string();if(e.format){let i=e.format;i==="email"?n=n.check(T.email()):i==="uri"||i==="uri-reference"?n=n.check(T.url()):i==="uuid"||i==="guid"?n=n.check(T.uuid()):i==="date-time"?n=n.check(T.iso.datetime()):i==="date"?n=n.check(T.iso.date()):i==="time"?n=n.check(T.iso.time()):i==="duration"?n=n.check(T.iso.duration()):i==="ipv4"?n=n.check(T.ipv4()):i==="ipv6"?n=n.check(T.ipv6()):i==="mac"?n=n.check(T.mac()):i==="cidr"?n=n.check(T.cidrv4()):i==="cidr-v6"?n=n.check(T.cidrv6()):i==="base64"?n=n.check(T.base64()):i==="base64url"?n=n.check(T.base64url()):i==="e164"?n=n.check(T.e164()):i==="jwt"?n=n.check(T.jwt()):i==="emoji"?n=n.check(T.emoji()):i==="nanoid"?n=n.check(T.nanoid()):i==="cuid"?n=n.check(T.cuid()):i==="cuid2"?n=n.check(T.cuid2()):i==="ulid"?n=n.check(T.ulid()):i==="xid"?n=n.check(T.xid()):i==="ksuid"&&(n=n.check(T.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?T.number().int():T.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=T.boolean();break}case"null":{o=T.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[l,u]of Object.entries(i)){let d=Oe(u,t);n[l]=a.has(l)?d:d.optional()}if(e.propertyNames){let l=Oe(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?Oe(e.additionalProperties,t):T.any();if(Object.keys(n).length===0){o=T.record(l,u);break}let d=T.object(n).passthrough(),p=T.looseRecord(l,u);o=T.intersection(d,p);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),d=[];for(let m of u){let f=Oe(l[m],t),g=T.string().regex(new RegExp(m));d.push(T.looseRecord(g,f))}let p=[];if(Object.keys(n).length>0&&p.push(T.object(n).passthrough()),p.push(...d),p.length===0)o=T.object({}).passthrough();else if(p.length===1)o=p[0];else{let m=T.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)m=T.intersection(m,p[f]);o=m}break}let s=T.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Oe(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(l=>Oe(l,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Oe(i,t):void 0;s?o=T.tuple(a).rest(s):o=T.tuple(a),typeof e.minItems=="number"&&(o=o.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(T.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(l=>Oe(l,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Oe(e.additionalItems,t):void 0;s?o=T.tuple(a).rest(s):o=T.tuple(a),typeof e.minItems=="number"&&(o=o.check(T.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(T.maxLength(e.maxItems)))}else if(i!==void 0){let a=Oe(i,t),s=T.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=T.array(T.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Oe(e,t){if(typeof e=="boolean")return e?T.any():T.never();let r=pk(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(u=>Oe(u,t)),l=T.union(s);r=o?T.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(u=>Oe(u,t)),l=T.xor(s);r=o?T.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:T.any();else{let s=o?r:Oe(e.allOf[0],t),l=o?0:1;for(let u=l;u<e.allOf.length;u++)s=T.intersection(s,Oe(e.allOf[u],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=T.nullable(r)),e.readOnly===!0&&(r=T.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))VC.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function mk(e,t){if(typeof e=="boolean")return e?T.any():T.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=JC(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Ce};return Oe(r,i)}var Yf={};Jt(Yf,{bigint:()=>QC,boolean:()=>YC,date:()=>eT,number:()=>XC,string:()=>KC});function KC(e){return xp(so,e)}function XC(e){return Ep(lo,e)}function YC(e){return Np(uo,e)}function QC(e){return Up(po,e)}function eT(e){return Jp(_i,e)}ve(as());var ie=c.number().min(0).max(100),ar=c.number().int().min(1e3).max(12e3),sn=c.number(),H=c.number().int().nonnegative(),_t=c.enum(["hue","matter","smartthings","homeassistant","nest","alexa","google","kasa","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","mqtt","esphome","mock","other"]),tT=c.enum(["local","cloud","offline","unknown"]),Ti=c.enum(["light","plug","switch","dimmer","thermostat","lock","cover","garageDoor","valve","fan","sensor","binarySensor","camera","doorbell","speaker","tv","mediaPlayer","vacuum","appliance","airPurifier","humidifier","waterHeater","evCharger","sceneController","remote","scene","group","bridge","other"]),nT=c.enum(["temperature","humidity","illuminance","pressure","co2","pm25","pm10","voc","airQuality","noise","uvIndex","windSpeed","distance","generic"]),rT=c.enum(["motion","occupancy","presence","contact","leak","smoke","co","gas","tamper","vibration","glassBreak","button","person","sound","moisture","generic"]);var me=(e,t)=>c.object({type:c.literal(e),instance:c.string().optional(),...t}),oT=me("power",{state:c.object({on:c.boolean().nullable()})}),iT=me("brightness",{state:c.object({level:ie.nullable()})}),aT=me("colorTemperature",{config:c.object({minKelvin:ar,maxKelvin:ar}),state:c.object({kelvin:ar.nullable()})}),sT=me("color",{config:c.object({modes:c.array(c.enum(["hs","rgb","xy"])).default(["hs"])}),state:c.object({hue:c.number().min(0).max(360).nullable(),saturation:ie.nullable()})}),cT=me("segmentColor",{config:c.object({segments:c.number().int().min(1)}),state:c.object({colors:c.array(c.object({hue:c.number().min(0).max(360).nullable(),saturation:ie.nullable()})).nullable()})}),tg=c.enum(["off","heat","cool","auto","eco","fanOnly","dry"]),lT=me("thermostat",{config:c.object({modes:c.array(tg),minC:sn,maxC:sn,supportsRange:c.boolean().default(!1)}),state:c.object({mode:tg.nullable(),currentC:sn.nullable(),setpointC:sn.nullable().optional(),heatC:sn.nullable().optional(),coolC:sn.nullable().optional(),action:c.enum(["idle","heating","cooling","fan"]).nullable().optional()})}),uT=me("humidity",{config:c.object({settable:c.boolean().default(!1),minPct:ie.default(0),maxPct:ie.default(100)}),state:c.object({currentPct:ie.nullable().optional(),targetPct:ie.nullable().optional()})}),dT=me("lock",{state:c.object({state:c.enum(["locked","unlocked","jammed","unknown"])})}),pT=me("cover",{config:c.object({kind:c.enum(["blind","shade","curtain","awning","garage","door","window","valve","generic"]),supportsPosition:c.boolean().default(!1),supportsTilt:c.boolean().default(!1)}),state:c.object({position:ie.nullable().optional(),tilt:ie.nullable().optional(),state:c.enum(["open","closed","opening","closing","stopped","partial","unknown"])})}),mT=me("fan",{config:c.object({presets:c.array(c.string()).default([]),supportsOscillate:c.boolean().default(!1)}),state:c.object({on:c.boolean().nullable(),level:ie.nullable().optional(),preset:c.string().nullable().optional(),oscillating:c.boolean().nullable().optional()})}),fT=me("mode",{config:c.object({options:c.array(c.string())}),state:c.object({value:c.string().nullable()})}),gT=me("toggle",{state:c.object({on:c.boolean().nullable()})}),hT=me("range",{config:c.object({min:c.number(),max:c.number(),step:c.number().optional(),unit:c.string().optional()}),state:c.object({value:c.number().nullable()})}),vT=me("mediaTransport",{state:c.object({state:c.enum(["playing","paused","stopped","buffering","idle"]).nullable(),metadata:c.object({title:c.string().optional(),artist:c.string().optional(),album:c.string().optional(),artworkUrl:c.string().optional()}).nullable().optional(),positionSec:c.number().nonnegative().nullable().optional(),durationSec:c.number().nonnegative().nullable().optional(),shuffle:c.boolean().nullable().optional(),repeat:c.enum(["off","one","all"]).nullable().optional()})}),yT=me("volume",{state:c.object({level:ie.nullable(),muted:c.boolean().nullable()})}),bT=me("inputSource",{config:c.object({sources:c.array(c.string())}),state:c.object({source:c.string().nullable()})}),xT=me("startStop",{config:c.object({supportsPause:c.boolean().default(!1)}),state:c.object({state:c.enum(["running","paused","stopped","unknown"])})}),kT=me("scene",{state:c.object({lastActivated:H.nullable().optional()})}),wT=me("camera",{config:c.object({protocols:c.array(c.enum(["rtsp","webrtc","hls","snapshot"]))}),state:c.object({streaming:c.boolean().nullable().optional()})}),ST=me("sensor",{config:c.object({measurement:nT,unit:c.string()}),state:c.object({value:c.number().nullable(),ts:H.nullable().optional()})}),_T=me("binarySensor",{config:c.object({sensorType:rT}),state:c.object({active:c.boolean().nullable(),lastChanged:H.nullable().optional()})}),$T=me("battery",{state:c.object({level:ie.nullable(),charging:c.boolean().nullable().optional(),low:c.boolean().nullable().optional()})}),IT=me("energyMeter",{state:c.object({power:c.number().nullable().optional(),energy:c.number().nullable().optional(),voltage:c.number().nullable().optional(),current:c.number().nullable().optional()})}),AT=me("doorbell",{state:c.object({lastPress:H.nullable().optional()})}),ET=me("connectivity",{config:c.object({transport:c.enum(["wifi","thread","zigbee","zwave","ethernet","ble","cloud","matter","unknown"])}),state:c.object({online:c.boolean().nullable(),signal:c.number().nullable().optional()})}),fk=c.enum(["flash","strobe","pulse","colorFade","colorLoop","candle","rainbow","siren","meter"]),on=c.object({hue:c.number().min(0).max(360),saturation:ie}),an=c.number().int().min(20).max(6e5),Qf=c.number().int().min(1).max(1e3).nullable().default(null),ng=c.discriminatedUnion("kind",[c.object({kind:c.literal("flash"),count:c.number().int().min(1).max(100).default(3),onMs:an.default(300),offMs:an.default(300),color:on.nullable().default(null),brightness:ie.nullable().default(null)}),c.object({kind:c.literal("strobe"),hz:c.number().min(.5).max(25).default(8),durationMs:an.default(3e3),color:on.nullable().default(null)}),c.object({kind:c.literal("pulse"),periodMs:an.default(2e3),minPct:ie.default(5),maxPct:ie.default(100),color:on.nullable().default(null),cycles:Qf}),c.object({kind:c.literal("colorFade"),from:on.nullable().default(null),to:on,durationMs:an.default(2e3),easing:c.enum(["linear","ease"]).default("ease")}),c.object({kind:c.literal("colorLoop"),colors:c.array(on).min(2).max(16),holdMs:an.default(1e3),fadeMs:c.number().int().min(0).max(6e5).default(800),loops:Qf,direction:c.enum(["forward","pingpong"]).default("forward")}),c.object({kind:c.literal("candle"),intensity:ie.default(50),warmthKelvin:ar.nullable().default(null),durationMs:an.nullable().default(null)}),c.object({kind:c.literal("rainbow"),cycleMs:an.default(4e3),saturation:ie.default(100),brightness:ie.default(100),loops:Qf}),c.object({kind:c.literal("siren"),colorA:on.default({hue:0,saturation:100}),colorB:on.default({hue:240,saturation:100}),hz:c.number().min(.5).max(10).default(4),durationMs:an.nullable().default(null)}),c.object({kind:c.literal("meter"),source:c.enum(["context","usage","cost"]),stops:c.array(c.object({at:c.number().min(0),color:on})).min(2).max(6).default([{at:0,color:{hue:120,saturation:90}},{at:75,color:{hue:40,saturation:95}},{at:95,color:{hue:0,saturation:95}}])})]),PT=me("effect",{config:c.object({kinds:c.array(fk).default(["flash"]),supportsColor:c.boolean().default(!1)}),state:c.object({active:fk.nullable()})}),CT=c.discriminatedUnion("type",[oT,iT,aT,sT,cT,lT,uT,dT,pT,mT,fT,gT,hT,vT,yT,bT,xT,kT,wT,ST,_T,$T,IT,AT,ET,PT]),cn=c.enum(["power","brightness","colorTemperature","color","segmentColor","thermostat","humidity","lock","cover","fan","mode","toggle","range","mediaTransport","volume","inputSource","startStop","scene","camera","sensor","binarySensor","battery","energyMeter","doorbell","connectivity","effect"]),vk=c.enum(["needs-password"]),TT=c.object({sourceId:c.string(),provider:_t,providerAccountId:c.string(),nativeId:c.string(),nativeType:c.string().optional(),reachability:c.enum(["local","cloud"]),online:c.boolean(),attention:vk.nullable().optional(),credentialRef:c.string().nullable().optional(),lastSeen:H.nullable().optional()}),RT=c.object({id:c.string(),name:c.string(),providerRefs:c.array(c.object({provider:_t,nativeId:c.string()})).default([])}),OT=c.object({accountId:c.string(),provider:_t,displayName:c.string(),reachability:c.enum(["local","cloud"]),status:c.enum(["linked","needs_reauth","revoked"]),expiresAt:H.nullable().optional()}),DT=c.object({id:c.string(),type:Ti,name:c.string(),areaId:c.string().nullable(),manufacturer:c.string().nullable().optional(),model:c.string().nullable().optional(),firmwareVersion:c.string().nullable().optional(),online:c.boolean(),reachability:tT,attention:vk.nullable().optional(),parentId:c.string().nullable().optional(),members:c.array(c.string()).optional(),sources:c.array(TT).min(1),preferredSourceId:c.string(),capabilities:c.array(CT),updatedAt:H,raw:c.unknown().optional()}),yk=c.object({version:c.literal(1),nodeId:c.string(),updatedAt:H,areas:c.array(RT),accounts:c.array(OT),devices:c.array(DT)}),NT=c.enum(["relay-do-sealed","hub-local"]),WM=c.object({accountId:c.string(),provider:_t,providerAccountId:c.string(),nodeId:c.string(),credentialLocation:NT,scopes:c.array(c.string()).default([]),status:c.enum(["linked","needs_reauth","revoked"]),displayName:c.string(),expiresAt:H.nullable().optional(),linkedAt:H}),gk=c.enum(["open","guarded","locked"]),eg=c.enum(["allow","confirm","deny"]),LT=c.enum(["voice","claude","app","rules"]),VM=c.object({tier:gk.default("open"),perConsumer:c.partialRecord(LT,gk).default({}),perClass:c.partialRecord(cn,eg).default({}),perDeviceType:c.partialRecord(Ti,eg).default({}),perDevice:c.record(c.string(),eg).default({}),confirmWindowSec:c.number().default(60)}),ye=c.object({}),hk=e=>e.type==="cover"&&(e.config.kind==="garage"||e.config.kind==="door"),rg={power:[{command:"turnOn",params:ye},{command:"turnOff",params:ye},{command:"toggle",params:ye}],brightness:[{command:"setBrightness",params:c.object({level:ie})},{command:"adjustBrightness",params:c.object({delta:c.number().min(-100).max(100)})}],colorTemperature:[{command:"setColorTemperature",params:c.object({kelvin:ar})}],color:[{command:"setColor",params:c.object({hue:c.number().min(0).max(360),saturation:ie})}],segmentColor:[{command:"setSegmentColors",voice:!1,params:c.object({segments:c.array(c.object({index:c.number().int().nonnegative(),hue:c.number().min(0).max(360),saturation:ie})).min(1).max(512)})}],thermostat:[{command:"setThermostatMode",params:c.object({mode:tg})},{command:"setSetpoint",params:c.object({celsius:sn})},{command:"setRange",params:c.object({heatCelsius:sn,coolCelsius:sn}),gate:e=>e.type==="thermostat"&&e.config.supportsRange}],humidity:[{command:"setHumidity",params:c.object({percent:ie}),gate:e=>e.type==="humidity"&&e.config.settable}],lock:[{command:"lock",params:ye},{command:"unlock",params:ye,confirm:!0}],cover:[{command:"open",params:ye,confirm:hk},{command:"close",params:ye},{command:"stop",params:ye},{command:"setPosition",params:c.object({position:ie}),confirm:hk,gate:e=>e.type==="cover"&&e.config.supportsPosition},{command:"setTilt",params:c.object({tilt:ie}),gate:e=>e.type==="cover"&&e.config.supportsTilt}],fan:[{command:"turnOn",params:ye},{command:"turnOff",params:ye},{command:"setFanSpeed",params:c.object({level:ie})},{command:"setFanPreset",params:c.object({preset:c.string()}),gate:e=>e.type==="fan"&&e.config.presets.length>0},{command:"setOscillate",params:c.object({oscillating:c.boolean()}),gate:e=>e.type==="fan"&&e.config.supportsOscillate}],mode:[{command:"setMode",params:c.object({value:c.string()})}],toggle:[{command:"setToggle",params:c.object({on:c.boolean()})}],range:[{command:"setRange",params:c.object({value:c.number()})},{command:"adjustRange",params:c.object({delta:c.number()})}],mediaTransport:[{command:"play",params:ye},{command:"pause",params:ye},{command:"stop",params:ye},{command:"next",params:ye},{command:"previous",params:ye},{command:"seek",params:c.object({positionSec:c.number().nonnegative()})},{command:"setShuffle",params:c.object({on:c.boolean()})},{command:"setRepeat",params:c.object({mode:c.enum(["off","one","all"])})}],volume:[{command:"setVolume",params:c.object({level:ie})},{command:"adjustVolume",params:c.object({delta:c.number().min(-100).max(100)})},{command:"setMute",params:c.object({muted:c.boolean()})}],inputSource:[{command:"selectInput",params:c.object({source:c.string()})}],startStop:[{command:"start",params:ye},{command:"stop",params:ye},{command:"pause",params:ye,gate:e=>e.type==="startStop"&&e.config.supportsPause},{command:"resume",params:ye,gate:e=>e.type==="startStop"&&e.config.supportsPause}],scene:[{command:"activate",params:ye}],effect:[{command:"startEffect",params:c.object({spec:ng})},{command:"stopEffect",params:ye}],camera:[{command:"getStream",params:c.object({protocol:c.enum(["rtsp","webrtc","hls"])}),voice:!1,returns:c.object({url:c.string(),token:c.string().optional(),expiresAt:H.optional()})},{command:"getSnapshot",params:ye,voice:!1,returns:c.object({url:c.string(),expiresAt:H.optional()})}],sensor:[],binarySensor:[],battery:[],energyMeter:[],doorbell:[],connectivity:[]};var UT=c.discriminatedUnion("kind",[c.object({kind:c.literal("literal"),hue:c.number().min(0).max(360),saturation:ie}),c.object({kind:c.literal("token"),token:c.enum(["main","session"])})]),bk=c.enum(["main","session","hold","off"]),xk=c.object({color:UT.optional(),brightnessPct:ie.nullable().optional(),brightnessScale:c.number().min(0).max(2).optional(),kelvin:ar.nullable().optional(),power:c.boolean().optional()});var zT=c.enum(["added","removed","permission_request","started","ended","working","finished","error","idle","needs_permission","promptSubmitted","toolStart","toolEnd","subagentStart","subagentFinished","compacting","resumed","aborted","contextLow","contextCritical","needsInput","planReady","rateLimited","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),sr=c.enum(["claude","codex"]);var jT=c.discriminatedUnion("kind",[c.object({kind:c.literal("deviceState"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte","changed"]).default("changed"),path:c.string().optional(),value:c.unknown().optional()}),c.object({kind:c.literal("edge"),deviceId:c.string(),event:c.string()}),c.object({kind:c.literal("session"),event:zT,repo:c.string().optional(),sessionId:c.string().optional(),agent:sr.optional()}),c.object({kind:c.literal("schedule"),cron:c.string()})]),FT=c.object({deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte"]),path:c.string().optional(),value:c.unknown()}),MT=c.discriminatedUnion("kind",[c.object({kind:c.literal("device"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),command:c.string(),params:c.unknown().optional()}),c.object({kind:c.literal("session"),sessionId:c.string(),text:c.string()}),c.object({kind:c.literal("notify"),title:c.string(),body:c.string()}),c.object({kind:c.literal("intent"),deviceId:c.string(),instance:c.string().optional(),look:xk.optional(),effect:ng.optional(),returnTo:bk.optional(),hold:c.boolean().default(!1)})]),tB=c.object({id:c.string(),name:c.string().default(""),enabled:c.boolean().default(!0),trigger:jT,conditions:c.array(FT).default([]),actions:c.array(MT).min(1),allowSecurity:c.boolean().default(!1)});var mo=c.enum(["started","ended","working","finished","error","idle","needs_permission","subagentFinished","compacting","resumed","contextLow","contextCritical","needsInput","planReady","rateLimited","subagentStart","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),kk=c.object({id:c.string(),name:c.string(),cwd:c.string(),online:c.boolean().default(!0),state:mo.optional(),bridgeId:c.string().optional(),bridgeName:c.string().optional(),agent:sr.optional()}),wk=c.enum(["allow","deny"]),aB=c.object({sessionId:c.string().nullable(),text:c.string(),ts:H.optional()}),yc=c.object({latestReply:c.string().nullable(),ts:c.number().nullable(),cursor:c.number().int().nonnegative(),hasMore:c.boolean()}),sB=c.object({requestId:c.string(),behavior:wk,ts:H.optional()}),cB=c.object({id:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:H.optional()}),BT=c.object({type:c.literal("register"),userToken:c.string().optional(),sessions:c.array(kk),claudeSessionId:c.string().optional()}),HT=c.object({type:c.literal("sessions.update"),sessions:c.array(kk)}),ZT=c.object({type:c.literal("prompt"),sessionId:c.string(),requestId:c.string(),text:c.string(),ts:H.optional()});var GT=c.object({type:c.literal("reply"),sessionId:c.string(),requestId:c.string(),text:c.string(),seq:c.number().int().nonnegative().optional(),final:c.boolean().optional(),ts:H.optional()}),WT=c.object({type:c.literal("permission_request"),sessionId:c.string(),requestId:c.string(),tool:c.string(),description:c.string(),preview:c.string(),ts:H.optional()}),VT=c.object({type:c.literal("permission_verdict"),sessionId:c.string(),requestId:c.string(),behavior:wk,ts:H.optional()}),JT=c.object({type:c.literal("command"),id:c.string(),requestId:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:H.optional()}),qT=c.object({type:c.literal("command_result"),requestId:c.string(),id:c.string(),sessionId:c.string().nullable().optional(),result:c.unknown().optional(),error:c.string().optional(),ts:H.optional()}),KT=c.object({type:c.literal("devices.update"),doc:yk}),XT=c.object({type:c.literal("device_command"),requestId:c.string(),deviceId:c.string(),sourceId:c.string().nullable().optional(),ruleId:c.string().optional(),capability:cn,instance:c.string().optional(),command:c.string(),params:c.unknown(),consumer:c.enum(["voice","claude","app","rules"]),sessionId:c.string().optional(),confirm:c.boolean().optional()}),YT=c.object({type:c.literal("device_query"),requestId:c.string(),kind:c.enum(["list","get"]),deviceId:c.string().optional()}),QT=c.object({type:c.literal("device_result"),requestId:c.string(),deviceId:c.string().optional(),ok:c.boolean(),verified:c.boolean().optional(),state:c.unknown().optional(),result:c.unknown().optional(),error:c.string().optional()}),e1=c.object({type:c.literal("device_event"),deviceId:c.string(),capability:cn,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional(),ts:H}),t1=c.object({type:c.literal("device_source_event"),provider:_t,providerAccountId:c.string(),nativeId:c.string(),patch:c.array(c.object({type:cn,instance:c.string().optional(),state:c.unknown()})).optional(),edge:c.object({capability:cn,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional()}).optional(),online:c.boolean().optional(),ts:H}),n1=c.object({type:c.literal("entitlement"),plan:c.enum(["free","paid"]),planStatus:c.enum(["active","past_due","canceled"]).optional(),serviceOk:c.boolean().optional(),capture:c.object({telemetry:c.boolean(),transcripts:c.boolean()}),policyVersion:c.string(),ts:H}),r1=c.object({type:c.literal("device_config"),version:c.number().int().nonnegative(),config:c.record(c.string(),c.unknown()),ts:H}),o1=c.object({type:c.literal("disconnect"),code:c.union([c.literal(1012),c.literal(4402),c.literal(4426),c.number().int().min(1e3).max(4999)]),reason:c.string().max(120),ts:H}),i1=c.object({type:c.literal("device_audit"),requestId:c.string(),consumer:c.enum(["voice","claude","app","rules"]),deviceId:c.string(),ruleId:c.string().optional(),capability:cn,command:c.string(),params:c.unknown(),ok:c.boolean(),confirmRequired:c.boolean(),confirmedBy:c.string().optional(),error:c.string().optional(),ts:H}),a1=64,s1=c.object({type:c.literal("session_state"),sessionId:c.string(),state:mo,event:c.string(),ts:H,transitions:c.array(c.object({state:mo,event:c.string(),ts:H})).max(a1).optional()}),c1=c.object({type:c.literal("notification"),sessionId:c.string(),event:mo,repo:c.string().optional(),title:c.string().optional(),body:c.string().optional()}),l1=c.discriminatedUnion("type",[BT,HT,ZT,GT,WT,VT,JT,qT,KT,XT,YT,QT,e1,t1,i1,n1,o1,r1,s1,c1]),Sk=e=>l1.parse(typeof e=="string"?JSON.parse(e):e);var u1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zt=(e,t)=>e>>>t|e<<32-t;function d1(e){let t=[];for(let r of e){let o=r.codePointAt(0);o<128?t.push(o):o<2048?t.push(192|o>>6,128|o&63):o<65536?t.push(224|o>>12,128|o>>6&63,128|o&63):t.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}return Uint8Array.from(t)}function p1(e){let t=d1(e),r=new Uint8Array((t.length+8>>6)+1<<6);r.set(t),r[t.length]=128;let o=new DataView(r.buffer),n=t.length*8;o.setUint32(r.length-8,Math.floor(n/4294967296)),o.setUint32(r.length-4,n>>>0);let i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),a=new Uint32Array(64);for(let u=0;u<r.length;u+=64){for(let P=0;P<16;P++)a[P]=o.getUint32(u+P*4);for(let P=16;P<64;P++){let C=a[P-15],E=a[P-2],D=zt(C,7)^zt(C,18)^C>>>3,G=zt(E,17)^zt(E,19)^E>>>10;a[P]=a[P-16]+D+a[P-7]+G>>>0}let d=i[0],p=i[1],m=i[2],f=i[3],g=i[4],y=i[5],k=i[6],_=i[7];for(let P=0;P<64;P++){let C=zt(g,6)^zt(g,11)^zt(g,25),E=g&y^~g&k,D=_+C+E+u1[P]+a[P],G=zt(d,2)^zt(d,13)^zt(d,22),ae=d&p^d&m^p&m,X=G+ae;_=k,k=y,y=g,g=f+D>>>0,f=m,m=p,p=d,d=D+X>>>0}i[0]=i[0]+d>>>0,i[1]=i[1]+p>>>0,i[2]=i[2]+m>>>0,i[3]=i[3]+f>>>0,i[4]=i[4]+g>>>0,i[5]=i[5]+y>>>0,i[6]=i[6]+k>>>0,i[7]=i[7]+_>>>0}let s=new Uint8Array(32),l=new DataView(s.buffer);for(let u=0;u<8;u++)l.setUint32(u*4,i[u]);return s}var _k="abcdefghijklmnopqrstuvwxyz234567";function m1(e){let t=0,r=0,o="";for(let n of e)for(r=r<<8|n,t+=8;t>=5;)o+=_k[r>>>t-5&31],t-=5;return t>0&&(o+=_k[r<<5-t&31]),o}function Ik(e){return m1(p1(e))}var f1=c.enum(["mdns","ssdp","kasa-udp","wiz-udp","lifx-lan","yeelight","govee-udp","tuya-beacon","arp","http","meethue"]),g1=c.object({protocol:f1,detail:c.string(),at:H}),h1=c.enum(["connect-now","link-ecosystem","identified-only"]),bc=c.enum(["kasa","kasa-klap","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","esphome"]),v1=c.enum(["high","medium","low"]),y1=c.object({ip:c.string(),mac:c.string().optional(),hostname:c.string().optional(),port:c.number().int().positive().optional()}),Ak=c.object({discoveredId:c.string(),addresses:y1,evidence:c.array(g1).min(1),identity:c.object({name:c.string().optional(),manufacturer:c.string().optional(),model:c.string().optional(),hint:c.string().optional(),vendorId:c.string().optional()}).default({}),bucket:h1,kind:c.string().optional(),suggestedProvider:_t.optional(),localProtocol:bc.optional(),expectedType:Ti.optional(),expectedCapabilities:c.array(cn).default([]),alreadyLinked:c.object({provider:_t,deviceId:c.string().optional(),accountId:c.string().optional()}).nullable().optional(),confidence:v1,firstSeen:H,lastSeen:H});function $t(e){return e.trim().toLowerCase().replace(/[^0-9a-f]/g,"").replace(/(..)(?=.)/g,"$1:")}var Ek=c.object({key:c.string(),provider:_t,accountId:c.string().optional(),name:c.string(),mac:c.string().optional(),nativeType:c.string().optional(),expectedType:Ti.optional(),state:c.enum(["cloud","not-seen"]),deviceId:c.string().optional()}),Pk=c.object({wsl:c.boolean(),multicastOk:c.boolean().nullable(),broadcastOk:c.boolean().nullable(),interop:c.enum(["windows-arp"]).optional(),interfaces:c.array(c.string()).optional(),primaryInterface:c.string().optional()});function Ck(e){return e!==void 0&&(e.wsl||e.multicastOk===!1)}function Tk(e,t){return t>0||e===void 0||e.wsl?!1:e.multicastOk===!0}var Rk="Your computer's network stack is fine, so if you expected devices here the likely cause is the network itself: guest WiFi, VLANs, or an access point with client isolation all block the discovery messages between devices. Try the same scan on your main WiFi, or add a device by IP.",b1=c.enum(["running","done","failed"]),fB=c.object({id:c.string(),status:b1,startedAt:H,finishedAt:H.optional(),error:c.string().optional(),devices:c.array(Ak),accountDevices:c.array(Ek).optional(),env:Pk,probeStatus:c.record(c.string(),c.string()).optional()}),x1=c.enum(["mdns","ssdp","kasa","wiz","lifx","yeelight","govee","tuya","arp","sweep"]),gB=c.object({autoConnect:c.enum(["unset","off","open-protocols"]).default("unset"),passive:c.boolean().default(!0),protocols:c.partialRecord(x1,c.boolean()).default({}),unidentified:c.boolean().default(!0)}),hB=c.object({scanId:c.string()}),vB=c.object({devices:c.array(Ak),accountDevices:c.array(Ek).optional(),env:Pk,updatedAt:H}),yB=c.object({discoveredId:c.string().optional(),ip:c.string().optional(),protocol:bc,name:c.string().optional(),credentials:c.record(c.string(),c.string()).optional()}).refine(e=>e.discoveredId!==void 0||e.ip!==void 0,{message:"either discoveredId or ip is required"}),og={tapo:[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link ID the device was set up with"},{key:"password",label:"Password",secret:!0}],"kasa-klap":[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link/Kasa ID the device was set up with (leave blank if never linked to the cloud)"},{key:"password",label:"Password",secret:!0}],shelly:[{key:"password",label:"Device password",secret:!0,helpText:'the password set on this Shelly (its username is always "admin")'}],esphome:[{key:"encryptionKey",label:"Encryption key",secret:!0,helpText:"the `api: encryption: key` from this device's ESPHome config (base64) \u2014 leave blank if it has no encryption"}]},k1=new Set(["shelly","esphome"]);function w1(e){return k1.has(e)}var bB=c.object({ok:c.boolean(),deviceId:c.string().optional(),accountId:c.string().optional(),error:c.string().optional(),note:c.string().optional(),linkVia:_t.optional()}),xB=c.object({deviceId:c.string(),purge:c.boolean().default(!1),discoveredId:c.string().optional()}),kB=c.object({deviceId:c.string(),name:c.string()}),wB=c.object({clientId:c.string().min(1),clientSecret:c.string().min(1),region:c.string().min(1)}),SB=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),sleepyCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),_B=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1),mfaCode:c.string().optional()}),$B=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),IB=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1)}),AB=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),EB=c.object({apiKey:c.string().min(1)}),PB=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),CB=c.object({ok:c.boolean(),note:c.string().optional(),error:c.string().optional()}),TB=c.object({sessionId:c.string().optional(),revertOnStop:c.boolean().default(!0)}),RB=c.object({sessionId:c.string().optional()}),Ok=c.object({pct:c.number().min(0).max(100),usedTokens:c.number().int().nonnegative().optional(),windowTokens:c.number().int().positive().optional()}),$k=c.object({usedPct:c.number().min(0).max(100),resetsAt:H.optional()}),OB=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),state:mo,event:c.string(),ts:H.optional(),cwd:c.string().optional(),extra:c.record(c.string(),c.unknown()).optional(),context:Ok.optional(),mode:c.string().optional(),model:c.string().optional(),agent:sr.optional()}),DB=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),cwd:c.string().optional(),ts:H.optional(),context:Ok.optional(),rateLimits:c.object({fiveHour:$k.optional(),sevenDay:$k.optional()}).optional(),mode:c.string().optional(),model:c.string().optional(),modelName:c.string().optional(),review:c.string().optional(),cost:c.number().nonnegative().optional(),agent:sr.optional()}),NB=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),codexThreadId:c.string().min(1),cwd:c.string().optional(),gitBranch:c.string().optional(),ts:H.optional(),inputTokens:c.number().int().nonnegative(),cachedInputTokens:c.number().int().nonnegative().default(0),outputTokens:c.number().int().nonnegative(),agent:sr.optional()}),S1=c.object({reverted:c.number().int().nonnegative(),failed:c.number().int().nonnegative(),skipped:c.number().int().nonnegative()}),LB=c.object({active:c.boolean(),sessionId:c.string().optional(),generation:c.number().int().nonnegative().optional(),touched:c.number().int().nonnegative().default(0),revertOnStop:c.boolean().default(!0),owner:c.enum(["app","hook"]).optional(),summary:S1.optional()});function fo(e){return e.kind==="gateway"?"infrastructure":e.bucket==="connect-now"?"ready":e.bucket==="link-ecosystem"?"ecosystems":e.kind==="unidentified"||e.kind==="mdns-service"?"unidentified":e.bucket==="identified-only"?"needs-setup":"unidentified"}var xc=["govee","wiz","yeelight","kasa","esphome"],_1=new Set(["lock","cover","garageDoor","valve","camera","doorbell"]),$1=new Set(["lock","cover","camera","doorbell"]),I1=new Set(["tuya","meross","ewelink","nanoleaf","esphome"]);function Dk(e,t=og){return e.bucket==="connect-now"&&e.localProtocol!==void 0&&((t[e.localProtocol]?.length??0)===0||w1(e.localProtocol))&&!I1.has(e.localProtocol)&&e.confidence==="high"&&e.addresses.mac!==void 0&&!e.alreadyLinked&&!(e.expectedType!==void 0&&_1.has(e.expectedType))&&!e.expectedCapabilities.some(r=>$1.has(r))}function Nk(e){let t=e.trim(),r,o=/^(mqtts?|tcp|ssl|tls|wss?):\/\//i.exec(t);if(o){let s=o[1].toLowerCase();(s==="mqtts"||s==="ssl"||s==="tls"||s==="wss")&&(r=!0),t=t.slice(o[0].length)}t=t.replace(/\/.*$/,"");let n=/^(.+):(\d{1,5})$/.exec(t),i=(n?n[1]:t).trim(),a=n?Number(n[2]):void 0;return{host:i,...a!==void 0&&a>=1&&a<=65535?{port:a}:{},...r!==void 0?{tls:r}:{}}}import{spawn as P1}from"node:child_process";import{chmodSync as C1,existsSync as ag,openSync as T1,readFileSync as R1,realpathSync as O1,writeFileSync as Mk}from"node:fs";import{request as D1}from"node:http";import N1 from"node:net";import L1 from"node:path";function Ri(){return!0}function Lk(){return"1.0.0"}var Uk=3e3,A1=15e3;function E1(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;let{pid:r,startedAt:o,lastBeat:n}=t;return!Number.isInteger(r)||r<=0||typeof o!="number"||typeof n!="number"?null:{pid:r,startedAt:o,lastBeat:n}}catch{return null}}function zk(e){let t=e?.read??O;return E1(t(e?.file??Ia))}function ig(e,t){let r=t?.write??((n,i)=>ge(n,i,384)),o=t?.now??Date.now;try{r(t?.file??Ia,JSON.stringify({pid:t?.pid??process.pid,startedAt:e,lastBeat:o()}))}catch{}}function jk(e){try{(e?.remove??ue)(e?.file??Ia)}catch{}}function Fk(e){let{beacon:t,pid:r}=e;return!Number.isInteger(r)||r<=0||!t||t.pid!==r||!(e.isAlive??Ea)(r)?!1:(e.now??Date.now())-t.lastBeat<=(e.staleAfterMs??A1)}function U1(e){return new Promise(t=>{let r=N1.connect({host:"127.0.0.1",port:e},()=>{r.destroy(),t(!0)});r.on("error",()=>t(!1)),r.setTimeout(500,()=>{r.destroy(),t(!1)})})}function wc(e={}){let t=Sr(e);return{dir:t.dir,source:t.source,port:t.beacon?.port??ne().hubPort,tokenFile:Hl(t.dir),advertised:t.beacon!==null}}async function Te(){return U1(wc().port)}function z1(e=process.env,t=r=>Ct(r)){if(e.BRIDGE_CLIENT_VERSION!==void 0)return{};let r=t(e);return r===null?{}:{BRIDGE_CLIENT_VERSION:r}}function j1(e=process.env,t={}){let r=t.bundled??Ri(),o={...e};return r&&delete o.BRIDGE_VOICE,o}async function it(e={kind:"run"}){if(await Te())return Y("hub already running \u2014 reusing it"),{spawned:!1,holderId:await Bk(e.kind)??await Sc(e.kind)};let t=ne(),r=ag(Xo)?{file:process.execPath,args:[Xo]}:{file:ag(Ca)?Ca:"tsx",args:[oy]};Mk(xt,"",{mode:384}),C1(xt,384);let o=T1(xt,"a"),n=P1(r.file,r.args,{cwd:en,detached:!0,stdio:["ignore",o,o],env:{...j1(),BRIDGE_RELAY_URL:t.relayUrl,BRIDGE_HUB_PORT:String(t.hubPort),BRIDGE_HUB_HOLDER:e.kind,BRIDGE_HUB_HOLDER_PID:String(process.pid),...z1()}});n.unref(),n.pid&&Mk(Mo,String(n.pid));for(let i=0;i<30;i++){let a=_c(xt);if(/relay connected/i.test(a))return A("hub connected to relay"),{spawned:!0,holderId:await Bk(e.kind)??await Sc(e.kind)};if(/relay ws error|FATAL/i.test(a))throw new Error(`hub failed to connect:
238
+ ${Se(Zk(a,6))}`);await F1(1e3)}throw new Error(`hub timed out connecting to the relay. Last log:
239
+ ${Se(Zk(_c(xt),8))}`)}function Gk(){Zh()}function Wk(e,t){let r=t?.argv1??process.argv[1]??"",o=t?.exists??ag,n=t?.tsxBin??Ca;if(t?.bundled??Ri()){let s=r;try{s=(t?.realpath??O1)(r)}catch{}return{file:process.execPath,args:[s,"daemon",...e]}}if(/\.(mjs|cjs|js)$/.test(r))return{file:process.execPath,args:[r,"daemon",...e]};let a=r||L1.join(en,"cli","src","index.ts");return{file:o(n)?n:"tsx",args:[a,"daemon",...e]}}async function Sc(e){return(await Z("/local/hub/hold",{method:"POST",body:{kind:e,pid:process.pid}})).body?.holderId??null}function Bk(e){let t=wc(),r=_c(t.tokenFile).trim();if(!r)return Promise.resolve(null);let o=JSON.stringify({kind:e,pid:process.pid,stream:!0});return new Promise(n=>{let i=!1,a=s=>{i||(i=!0,n(s))};try{let s=D1({host:"127.0.0.1",port:t.port,path:"/local/hub/hold",method:"POST",headers:{"x-bridge-hub-token":r,"content-type":"application/json","content-length":Buffer.byteLength(o)}},l=>{if(l.statusCode!==200)return l.resume(),a(null);l.socket?.unref(),l.once("data",u=>{try{a(JSON.parse(u.toString("utf8").split(`
240
+ `)[0]??"").holderId??null)}catch{a(null)}}),l.once("close",()=>a(null))});s.on("error",()=>a(null)),s.setTimeout(5e3,()=>a(null)),s.end(o)}catch{a(null)}})}async function Vk(e){let t=await Z("/local/hub/beat",{method:"POST",body:{holderId:e},timeoutMs:4e3});return t.hubOffline?"offline":t.status===200?"ok":"unknown"}async function $c(e){await Z("/local/hub/release",{method:"POST",body:{holderId:e},timeoutMs:4e3})}async function Jk(){let e=await Z("/local/hub/shutdown",{method:"POST",body:{},timeoutMs:8e3});return!e.hubOffline&&e.status===200}async function qk(){await Z("/local/reload",{method:"POST",body:{},timeoutMs:8e3})}function go(e){return Fk({beacon:(e.readBeacon??zk)(),pid:e.pid,...e.now!==void 0?{now:e.now}:{},...e.isAlive?{isAlive:e.isAlive}:{}})}var kc=null;function De(){let e=kc;if(!e||e.reason==="offline")return"hub offline \u2014 run `acbridge daemon` or start the app";let r=e.target.source==="peer-wsl"||e.target.source==="peer-windows"?` (it runs ${e.target.source==="peer-wsl"?"on Windows":"inside WSL"}, state in ${e.target.dir})`:"";return e.reason==="absent"?`a hub is running on port ${e.target.port}${r}, but this account has no hub-token to present. Sign in with \`acbridge login\`, or restart the bridge from the side that owns it.`:`the hub on port ${e.target.port}${r} REJECTED this credential (401) \u2014 it belongs to another account or another run. Restart the bridge (\`acbridge stop\` then \`acbridge start\`) to re-mint it.`}function sg(e){return Hl(W,e)}async function Hk(e,t,r){let o=_c(e.tokenFile).trim();if(!o)return kc={reason:e.advertised?"absent":"offline",target:e},e.advertised?{hubOffline:!0,hubUnauthorized:"absent"}:{hubOffline:!0};let n=r?.body!==void 0;try{let i=await fetch(`http://127.0.0.1:${e.port}${t}`,{method:r?.method??"GET",headers:{"x-bridge-hub-token":o,...n?{"content-type":"application/json"}:{}},...n?{body:JSON.stringify(r?.body)}:{},signal:AbortSignal.timeout(r?.timeoutMs??1e4)}),a;try{a=await i.json()}catch{a=void 0}return i.status===401&&(kc={reason:"rejected",target:e}),{status:i.status,body:a,...i.status===401?{hubUnauthorized:"rejected"}:{}}}catch{return kc={reason:"offline",target:e},{hubOffline:!0}}}async function Z(e,t){let r=wc(),o=await Hk(r,e,t);if(!o.hubOffline&&!o.hubUnauthorized)return o;let n=wc({fresh:!0});return n.port===r.port&&n.tokenFile===r.tokenFile?o:Hk(n,e,t)}function _c(e){try{return R1(e,"utf8")}catch{return""}}function Zk(e,t){return e.trimEnd().split(`
241
+ `).slice(-t).join(`
242
+ `)}function F1(e){return new Promise(t=>setTimeout(t,e))}var Fn=`Usage: acbridge connect <mac|ip|discoveredId> [--name <display-name>] [--credentials-file <json>]
243
+ acbridge connect <ip> --as ${xc.join("|")} [--name <display-name>]
244
+ acbridge connect --forget <deviceId|mac|ip|discoveredId> [--purge]
245
+ acbridge connect --auto on|off
246
+
247
+ Targets come from \`acbridge scan\` (the ldev_\u2026 id, or the device's MAC/IP).
248
+ --as forces a manual "connect by IP as <protocol>" (the rescue hatch: the fingerprint missed it, the
249
+ LAN-Control toggle flipped after the scan, or multicast is filtered) \u2014 it persists ONLY after the
250
+ protocol's live probe replies at that IP; a dead IP or wrong protocol simply gets no reply.
251
+ A protocol that needs an account credential (e.g. Tapo) prompts on a TTY, or reads
252
+ --credentials-file <json> / $ACBRIDGE_CREDENTIALS_FILE (a {"field":"value"} object) when headless.`;function H1(e){let t={purge:!1},r=(o,n,i,a)=>o===`--${n}`?(t[n]=a[++i],i):o.startsWith(`--${n}=`)?(t[n]=o.slice(`--${n}=`.length),i):null;for(let o=0;o<e.length;o++){let n=e[o];if(!n)continue;if(n==="--purge"){t.purge=!0;continue}if(n==="--credentials-file"){t.credentialsFile=e[++o];continue}if(n.startsWith("--credentials-file=")){t.credentialsFile=n.slice(19);continue}let i=!1;for(let a of["forget","auto","name","as"]){let s=r(n,a,o,e);if(s!==null){o=s,i=!0;break}}i||(n.startsWith("--")?t.bad=`unknown option: ${n}`:t.target?t.bad=`unexpected argument: ${n}`:t.target=n)}return t}var Yk=e=>/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/.test($t(e)),cg=e=>/^(\d{1,3}\.){3}\d{1,3}$/.test(e),Kk=e=>`dev_${Ik(`mac:${$t(e)}`).slice(0,8)}`,Xk=e=>e==="homeassistant"?"home-assistant":e;async function Qk(e){let t=H1(e);if(t.bad)return b(t.bad),h(Fn),2;if(t.as!==void 0)return t.forget!==void 0||t.auto!==void 0?(b("--as can't combine with --forget or --auto"),h(Fn),2):t.target?Z1(t.target,t.as,t.name):(b("connect --as <protocol> needs an IP address as the target"),h(Fn),2);let r=[t.target,t.forget,t.auto].filter(o=>o!==void 0).length;return r!==1?(r>1&&b("pick one of: a connect target, --forget, --auto"),h(Fn),2):t.auto!==void 0?X1(t.auto):t.forget!==void 0?K1(t.forget,t.purge):G1(t.target,t.name,t.credentialsFile)}async function Z1(e,t,r){if(!xc.includes(t))return b(`--as takes one of: ${xc.join(", ")} (got ${t||"(none)"})`),2;if(!cg(e))return b(`connect --as needs an IP address as the target, got: ${e}`),h(Fn),2;h(Se(`probing ${e} as ${t}\u2026`));let o={ip:e,protocol:t,...r?{name:r}:{}},n=await Z("/local/connect",{method:"POST",body:o,timeoutMs:15e3});if(n.hubOffline)return b(De()),1;let i=n.body;return n.status===200&&i?.ok?(A(`connected \u2014 ${i.deviceId??e}${i.accountId?` (account ${i.accountId})`:""}`),i.note&&h(i.note),h("It now appears in `acbridge status`, the app dashboard, and to Claude."),0):(b(i?.error??`hub answered HTTP ${n.status}`),i?.note&&h(i.note),(n.status===502||n.status===422)&&h(`\u2192 no ${t} answered at ${e} \u2014 check the IP, that LAN Control is enabled, and that this machine shares the device's network/VLAN`),1)}async function G1(e,t,r){let o=await e0(e);if(typeof o=="number")return o;let n=o;if(n.bucket==="link-ecosystem"){let l=n.suggestedProvider;return b("this device is managed by an ecosystem"),h(`\u2192 link the ecosystem instead: ${l?`\`acbridge link ${Xk(l)}\``:"use the app"}`),1}if(n.bucket==="identified-only")return b("no direct local adapter for this device"),h(n.identity.hint?`\u2192 ${n.identity.hint}`:"\u2192 control it via a linked Home Assistant (`acbridge link home-assistant`), or wait for a future adapter"),1;if(!n.localProtocol)return b(`no local protocol resolved for ${n.discoveredId} \u2014 rescan and try again`),1;h(Se(`connecting ${lg(n)} via ${n.localProtocol}\u2026`));let i={discoveredId:n.discoveredId,protocol:n.localProtocol,...t?{name:t}:{}},a=await Z("/local/connect",{method:"POST",body:i,timeoutMs:15e3});if(a.hubOffline)return b(De()),1;let s=a.body;return a.status===200&&s?.ok?(A(`connected \u2014 ${s.deviceId??n.discoveredId}${s.accountId?` (account ${s.accountId})`:""}`),s.note&&h(s.note),h("It now appears in `acbridge status`, the app dashboard, and to Claude."),0):a.status===428&&s?.error==="pairing-required"?(b(s.note??"put the device in pairing mode (hold its button until it flashes), then connect again"),h(`\u2192 hold the button, then rerun: \`acbridge connect ${n.discoveredId}\``),1):a.status===428?W1(n,n.localProtocol,t,s?.note??null,r):(b(s?.error??`hub answered HTTP ${a.status}`),s?.note&&h(s.note),a.status===404&&h("\u2192 run `acbridge scan`, then retry with a fresh id"),s?.linkVia&&h(`\u2192 \`acbridge link ${Xk(s.linkVia)}\``),1)}async function W1(e,t,r,o,n){let i=og[t]??[],a=n??process.env.ACBRIDGE_CREDENTIALS_FILE,s;if(a){if(s=V1(a),!s)return 1}else if(process.stdin.isTTY&&process.stdout.isTTY&&i.length>0)s=await J1(i,o);else{b(o??"this protocol needs an account credential \u2014 supply it and retry");let p=i.length>0?` with fields: ${i.map(m=>m.key).join(", ")}`:"";return h(`\u2192 pass --credentials-file <json> (or set ACBRIDGE_CREDENTIALS_FILE)${p}`),1}h(Se(`connecting ${lg(e)} via ${t} with credentials\u2026`));let l={discoveredId:e.discoveredId,protocol:t,...r?{name:r}:{},credentials:s},u=await Z("/local/connect",{method:"POST",body:l,timeoutMs:15e3});if(u.hubOffline)return b(De()),1;let d=u.body;return u.status===200&&d?.ok?(A(`connected \u2014 ${d.deviceId??e.discoveredId}${d.accountId?` (account ${d.accountId})`:""}`),d.note&&h(d.note),h("It now appears in `acbridge status`, the app dashboard, and to Claude."),0):(b(d?.error??`hub answered HTTP ${u.status}`),d?.note&&h(d.note),1)}function V1(e){let t;try{t=M1(e,"utf8")}catch{b(`cannot read credentials file: ${e}`);return}let r;try{r=JSON.parse(t)}catch{b(`credentials file is not valid JSON: ${e}`);return}if(!r||typeof r!="object"||Array.isArray(r)){b("credentials file must be a JSON object of field \u2192 value");return}let o={};for(let[n,i]of Object.entries(r))i!=null&&(o[n]=String(i));return o}async function J1(e,t){t&&h(t);let r={};for(let o of e)o.helpText&&h(Se(o.helpText)),r[o.key]=await q1(`${o.label}: `,o.secret);return r}function q1(e,t){return new Promise(r=>{let o=B1({input:process.stdin,output:process.stdout,terminal:!0});if(t){let n=!1,i=o;i._writeToOutput=a=>{n?(a.includes(`
253
+ `)||a.includes("\r"))&&process.stdout.write(`
254
+ `):(process.stdout.write(e),n=!0)}}o.question(e,n=>{o.close(),r(n.trim())})})}async function e0(e){let t=await Z("/local/discovered");if(t.hubOffline)return b(De()),1;if(t.status!==200||!t.body)return b(`hub answered HTTP ${t.status} reading /local/discovered`),1;let r=t.body.devices;if(e.startsWith("ldev_")){let o=r.find(n=>n.discoveredId===e);return o||(b(`unknown discoveredId ${e} \u2014 run \`acbridge scan\` and use an id from its results`),1)}if(Yk(e)){let o=$t(e),n=r.find(i=>i.addresses.mac===o);return n||(b(`no discovered device with MAC ${o} \u2014 run \`acbridge scan\` first`),1)}if(cg(e)){let o=r.filter(n=>n.addresses.ip===e);if(o.length===1)return o[0];if(o.length===0)return b(`no discovered device at ${e} \u2014 run \`acbridge scan\` first`),1;b(`${o.length} devices share ${e} \u2014 pick one by id:`);for(let n of o)h(` ${n.discoveredId} ${lg(n)}`);return 1}return b(`not a MAC, IP, or ldev_\u2026 id: ${e}`),h(Fn),2}var lg=e=>{let t=[e.identity.manufacturer,e.identity.model].filter(Boolean).join(" ");return`${e.identity.name??(t||(e.identity.hint??"unknown device"))} (${e.addresses.ip}${e.addresses.mac?`, ${e.addresses.mac}`:""})`};async function K1(e,t){let r;if(e.startsWith("dev_"))r=e;else if(Yk(e))r=Kk(e);else if(e.startsWith("ldev_")||cg(e)){let n=await e0(e);if(typeof n=="number")return n;if(!n.addresses.mac)return b(`${e} has no stable identity (no MAC) \u2014 it was never connected, so there is nothing to forget`),1;r=Kk(n.addresses.mac)}else return b(`not a deviceId, MAC, IP, or ldev_\u2026 id: ${e}`),h(Fn),2;let o=await Z("/local/forget",{method:"POST",body:{deviceId:r,purge:t}});return o.hubOffline?(b(De()),1):o.status===200&&o.body?.ok?(A(`forgot ${r}${t?" (purged)":""} \u2014 it will not be auto-reconnected`),o.body.note&&h(o.body.note),0):(b(o.body?.error??`hub answered HTTP ${o.status}`),1)}async function X1(e){if(e!=="on"&&e!=="off")return b(`--auto takes on|off, got: ${e||"(none)"}`),h(Fn),2;let t=await Z("/local/config");if(t.hubOffline)return b(De()),1;if(t.status!==200||!t.body)return b(`hub answered HTTP ${t.status} reading /local/config`),1;let r={...t.body,autoConnect:e==="on"?"open-protocols":"off"},o=await Z("/local/config",{method:"POST",body:r});return o.hubOffline?(b(De()),1):o.status!==200||!o.body?(b(`hub answered HTTP ${o.status} writing /local/config`),1):(o.body.autoConnect==="open-protocols"?(A("auto-connect ON (open protocols)"),h("New lights/plugs on open local protocols connect automatically. Never locks, covers, garage doors, valves, cameras, or doorbells.")):A("auto-connect OFF"),0)}import{writeFileSync as vR}from"node:fs";function Ic(){return av({marketplaceDir:Rr,claudeCmd:An()})}function Y1(e=W){return ga(Er(Pr(e)))}function Ac(e){return fv(Rr,{settingsFile:e?.settingsFile,configFile:e?.configFile,env:e?.env,nodeCommand:e?.nodeCommand??Y1(e?.bridgeDir)})}function Ec(e={}){let t=[],r=e.ensurePluginInstalled??Ic;try{let n=r();n.marketplaceRepointed?t.push({level:"info",message:"Re-pointed the alexa plugin marketplace to this install."}):n.pluginReinstalled&&t.push({level:"info",message:"Refreshed the alexa plugin from this install."})}catch(n){t.push({level:"warn",message:`plugin refresh skipped: ${n.message}`})}let o=e.ensureStatusline??Ac;try{let n=o();n.changed&&t.push({level:"info",message:n.enabled?"Installed the AC Bridge statusline tee (chains any existing statusline).":"Removed the AC Bridge statusline tee (original restored)."})}catch(n){t.push({level:"warn",message:`statusline tee skipped: ${n.message}`})}return t}function t0(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.signal!="string"||typeof t.ts!="number"?null:{signal:t.signal,ts:t.ts}}catch{return null}}function n0(e){if(e.reason!==null&&e.now-e.reason.ts<(e.reasonFreshMs??6e4)&&e.reason.signal!=="account-switched")return{action:"exit-clean"};let r=e.windowMs??3e5;return e.respawnTimes.filter(n=>e.now-n<r).length>=(e.maxRespawns??3)?{action:"exit-fail",why:"the hub keeps dying \u2014 respawn cap reached (see ~/.claude-bridge/hub.log)"}:{action:"respawn"}}function r0(e,t,r){return t==="offline"?"handle-offline":t==="unknown"||e.holderId===null?"rehold":e.wantRevert&&r&&r.active===!1?"rearm":"none"}import{createInterface as sR}from"node:readline/promises";function Mn(e={}){let t=(e.payloadVersion??(()=>Ct()))();if(t!==null)return{version:t,channel:"app"};let r=(e.bundledVersion??Lk)(),o=Eh(r);return o!==null?{version:o,channel:"npm"}:{version:null,channel:null}}function Pc(e=O){let t=he(),r=e(t.refreshFile)?.trim(),o=r?Ze(r):null;if(o)return o;let n=e(t.accessFile)?.trim();return n?Ze(n):null}var o0="https://www.ac-bridge.com/home";function i0(e,t){return!t||typeof t.plan!="string"?{allowed:!0}:t.plan==="paid"&&t.serviceOk===!1?{allowed:!1,message:`Your subscription has ended \u2014 manage your plan at ${o0}, then retry.`}:t.plan==="free"?{allowed:!1,message:`No active subscription \u2014 start the 3-day free trial at ${o0}, then retry.`}:{allowed:!0}}var Q1=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function a0(e){let t=Q1.exec(e);if(!t)return null;let r=t[4]?t[4].split(".").map(o=>/^\d+$/.test(o)?Number(o):o):[];return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:r}}function eR(e,t){let r=typeof e=="number",o=typeof t=="number";return r&&!o?-1:!r&&o?1:e<t?-1:e>t?1:0}function Oi(e,t){let r=a0(e),o=a0(t);if(!r||!o)return null;for(let i of["major","minor","patch"])if(r[i]!==o[i])return r[i]<o[i]?-1:1;if(r.prerelease.length===0&&o.prerelease.length===0)return 0;if(r.prerelease.length===0)return 1;if(o.prerelease.length===0)return-1;let n=Math.min(r.prerelease.length,o.prerelease.length);for(let i=0;i<n;i++){let a=eR(r.prerelease[i],o.prerelease[i]);if(a!==0)return a}return r.prerelease.length!==o.prerelease.length?r.prerelease.length<o.prerelease.length?-1:1:0}var s0="npm i -g acbridge@latest",tR="https://www.ac-bridge.com/api/releases/manifest",ug=6*36e5,nR="https://www.ac-bridge.com";function rR(e=process.platform){return e==="win32"?"windows":e==="darwin"?"macos":e==="linux"?"linux":null}function c0(e){if(typeof e!="object"||e===null)return null;let t=e;if(t.schemaVersion!==1)return null;let r={},o=typeof t.platforms=="object"&&t.platforms!==null?t.platforms:{};for(let i of["windows","macos","linux"]){let a=o[i];typeof a=="object"&&a!==null&&typeof a.version=="string"&&(r[i]={version:a.version})}let n=typeof t.cli=="object"&&t.cli!==null?t.cli:null;return{schemaVersion:1,minimumVersion:typeof t.minimumVersion=="string"?t.minimumVersion:null,downloadPage:typeof t.downloadPage=="string"&&t.downloadPage?t.downloadPage:nR,platforms:r,cli:n?{version:typeof n.version=="string"?n.version:null,minimumVersion:typeof n.minimumVersion=="string"?n.minimumVersion:null}:null}}async function Cc(e={}){let t=process.env.BRIDGE_UPDATE_MANIFEST_URL||tR;try{let r=await(e.fetchImpl??fetch)(t,{signal:AbortSignal.timeout(e.timeoutMs??6e3)});if(!r.ok)return null;let o=c0(await r.json());return o&&oR(o,e.now),o}catch{return null}}function oR(e,t=Date.now()){try{let r={};try{let o=JSON.parse(O(ke)??"{}");typeof o=="object"&&o!==null&&!Array.isArray(o)&&(r=o)}catch{r={}}r.updateCheck={manifest:e,fetchedAt:t},ge(ke,`${JSON.stringify(r,null,2)}
255
+ `)}catch{}}function Tc(e=ug,t=Date.now()){try{let r=O(ke);if(!r)return null;let n=JSON.parse(r).updateCheck;return!n||typeof n!="object"||typeof n.fetchedAt!="number"||t-n.fetchedAt>e?null:c0(n.manifest)}catch{return null}}function Di(e,t,r=process.platform,o="app"){if(e===null)return{state:"dev"};if(!t)return{state:"unknown"};if(o==="npm"){let a=t.cli;return a?a.minimumVersion&&Oi(e,a.minimumVersion)===-1?{state:"blocked",current:e,minimum:a.minimumVersion,upgrade:s0}:a.version&&Oi(e,a.version)===-1?{state:"update",current:e,latest:a.version,upgrade:s0}:{state:"current",current:e}:{state:"unpublished",current:e}}if(t.minimumVersion&&Oi(e,t.minimumVersion)===-1)return{state:"blocked",current:e,minimum:t.minimumVersion,upgrade:t.downloadPage};let n=rR(r),i=n?t.platforms[n]?.version:void 0;return i&&Oi(e,i)===-1?{state:"update",current:e,latest:i,upgrade:t.downloadPage}:{state:"current",current:e}}function l0(e,t,r=process.platform,o="app"){let n=Di(e,t,r,o),i=o==="npm"?"acbridge":"app";switch(n.state){case"dev":return{grade:"info",line:"dev build \u2014 update checks skipped"};case"unknown":return{grade:"warn",line:"update check unreachable"};case"unpublished":return{grade:"info",line:`${i} ${n.current} \u2014 no update channel published yet`};case"blocked":return{grade:"bad",line:`${i} ${n.current} is below the minimum supported version ${n.minimum} \u2014 update required: ${n.upgrade}`};case"update":return{grade:"warn",line:`update available: ${n.latest} (you have ${n.current})`};case"current":return{grade:"ok",line:`${i} ${n.current} is current`}}}var cR="Not signed in on this machine. Run `acbridge login`, sign in via the AC Bridge app, or `acbridge pair <code>` (get a code from the app: System \u2192 Add another machine).";function Bn(e=O,t={}){let r=t.paths??he(),o=e(r.accessFile)?.trim(),n=e(r.refreshFile)?.trim();if(o||n)return(t.resolveScope??(()=>pt()))()?{ok:!0,paired:!!n}:(t.readPointer??(()=>$e()))()?{ok:!1,message:Je.pointerMismatch}:{ok:!0,paired:!!n};let i=(t.scan??dt)();return i.length===0?{ok:!1,message:cR}:(nt(i),{ok:!1,message:Je.pointerMismatch})}async function cr(e){if(await(e?.hubHealthy??Te)())return{ok:!0};let r=Bn(e?.read??O);return r.ok?{ok:!0}:{ok:!1,message:r.message}}function u0(e={}){let t=e.resolveScope??(()=>pt()),o=(e.layout??Kt())>=Xt,n=o?(e.scan??dt)():[];(e.warnAmbiguous??(u=>nt(u)))(n);let i=t();if(i)return i;if((e.readPointer??(()=>$e()))())return null;let s=u=>((e.writePointer??(d=>Yt({sub:d})))(u),t());if(o){if(n.length!==1)return null;let u=n[0];return Oa(u,e.segmentOf)?s(u.sub):null}let l=(e.readCredentialSub??Pc)();return l?s(l):null}function lR(){let e=u0();return e?ha({configFile:qo(e).userConfigFile}).onboardedAt:null}function uR(e){let t=u0();t&&va({onboardedAt:e},{configFile:qo(t).userConfigFile})}async function dR(e={}){let t=(e.build??Mn)(),r=e.clientVersion?e.clientVersion():t.version;if(r===null)return{ok:!0};let o=await(e.fetchManifest??Cc)()??(e.cachedManifest??Tc)(ug);if(!o)return(e.warnLine??U)("update check unreachable \u2014 continuing (it will retry next run)"),{ok:!0};let n=Di(r,o,e.platform??process.platform,t.channel??"app");return n.state==="blocked"?{ok:!1,exitCode:4,message:`This AC Bridge build (${n.current}) is below the minimum supported version (${n.minimum}). Update it: ${n.upgrade}`}:(n.state==="update"&&(e.infoLine??h)(`update available: ${n.latest} (you have ${n.current}) \u2014 ${n.upgrade}`),{ok:!0})}var pR="This machine's sign-in is no longer valid (the relay rejected its stored credential). Run `acbridge login` to sign in again.";function mR(){return!!O(he().refreshFile)?.trim()}var fR="This account hasn't completed setup yet. Run `acbridge login --if-needed` on this machine to complete it from the terminal, or finish first-run setup in the AC Bridge app.";async function ho(e={}){let t=e.read??O,r=Bn(t);if(!r.ok){let m=e.isTTY??!!(process.stdin.isTTY&&process.stdout.isTTY)?(e.findApp??(()=>Tr()))():null;if(m&&await(e.offerAndLaunch??gR)(m)&&(r=Bn(t)),!r.ok)return{ok:!1,exitCode:3,message:r.message}}let o=e.relayUrl??ne().relayUrl,n=e.fetchImpl??fetch;if(!await(e.refreshToken??(p=>Tt(p)))(o)&&!(e.hasRefreshCredential??mR)())return{ok:!1,exitCode:3,message:pR};let a=t(he().accessFile)?.trim()??"",s={reachable:!1,completedAt:null};try{let p=await n(`${o.replace(/\/+$/,"")}/settings`,{headers:{authorization:`Bearer ${a}`},signal:AbortSignal.timeout(6e3)});if(p.ok){let f=(await p.json()).config?.onboarding?.completedAt;s={reachable:!0,completedAt:typeof f=="number"?f:null}}}catch{}if(s.reachable){if(s.completedAt===null)return{ok:!1,exitCode:3,message:fR};(e.cacheOnboardedAt??uR)(s.completedAt)}else if((e.cachedOnboardedAt??lR)()===null)return{ok:!1,exitCode:1,message:"Couldn't verify this account's setup with the relay \u2014 check your connection and retry."};let l=await dR(e.updateGate);if(!l.ok)return l;let u=await(e.fetchEntitlement??Ot)(a),d=i0("preflight",u);return d.allowed?{ok:!0}:{ok:!1,exitCode:5,message:d.message}}async function gR(e){let t=sR({input:process.stdin,output:process.stdout}),r=!1;try{let n=(await t.question("Not signed in \u2014 open the AC Bridge app to sign in? [Y/n] ")).trim().toLowerCase();r=n===""||n==="y"||n==="yes"}finally{t.close()}if(!r||!await Sa(e))return!1;Y("waiting for you to finish signing in in the app\u2026");let o=await _a({timeoutMs:18e4});return o&&h("signed in \u2014 continuing."),o}var hR=["relayUrl","hubPort","machine"];async function Rc(e,t,r=fetch){let o=await r(`${e.replace(/\/+$/,"")}/settings`,{headers:{authorization:`Bearer ${t}`}});if(!o.ok)throw new Error(`relay ${o.status}`);let n=await o.json().catch(()=>null);return{version:typeof n?.version=="number"?n.version:null,config:typeof n?.config=="object"&&n?.config!==null?n.config:{}}}async function vo(e,t,r=fetch){if(!t)return null;let o;try{o=await Rc(e,t,r)}catch(n){return h(`Cloud settings sync skipped (${n instanceof Error?n.message:String(n)}).`),null}try{let n=typeof o.config.cli=="object"&&o.config.cli!==null?o.config.cli:null;if(!n)return o;let i={};for(let l of hR){let u=n[l];(l==="hubPort"?typeof u=="number"&&Number.isFinite(u):typeof u=="string"&&u)&&(i[l]=u)}if(Object.keys(i).length===0)return o;let a={};try{a=JSON.parse(O(ke)??"{}"),(typeof a!="object"||a===null||Array.isArray(a))&&(a={})}catch{a={}}let s={...a,...i};if(JSON.stringify(s)===JSON.stringify(a))return o;ge(ke,`${JSON.stringify(s,null,2)}
256
+ `),h(`Synced cloud settings into config.json (${Object.keys(i).join(", ")}).`)}catch(n){h(`Cloud settings sync skipped (${n instanceof Error?n.message:String(n)}).`)}return o}var yR=3e3;async function Oc(e=[]){let t=!e.includes("--no-revert"),{relayUrl:r}=ne(),o=await ho();if(!o.ok)return b(o.message),o.exitCode;if(!await Tt(r))return b("No valid credential. Run `acbridge login`, or sign in via the app."),3;await vo(r,O(he().accessFile)??"");for(let y of Ec())(y.level==="info"?h:U)(y.message);let n=(await it({kind:"daemon"})).holderId;try{vR(Ve,String(process.pid))}catch{}let i=Date.now();ig(i),setInterval(()=>ig(i),Uk).unref();let a,s=!1,l=async()=>{let y=await Z("/local/session/activate",{method:"POST",body:{revertOnStop:t},timeoutMs:8e3});s=!y.hubOffline&&y.status===200&&y.body?.active===!0,a=y.body?.active?y.body.sessionId:void 0};await l();let u=!1,d=async(y=0)=>{u||(u=!0,n&&await $c(n).catch(()=>{}),ue(Ve),jk(),process.exit(y))};process.once("SIGINT",()=>{d()}),process.once("SIGTERM",()=>{d()}),A(`Bridge running \u2014 hub connected, revert-on-stop ${t?"armed":"off"}. Ctrl-C to stop.`);let p=[],m=async()=>{let y=n0({reason:t0(O(Ko)),now:Date.now(),respawnTimes:p});if(y.action==="exit-clean"){A("hub stopped \u2014 daemon exiting."),await d();return}if(y.action==="exit-fail"){b(y.why),await d(1);return}p.push(Date.now()),U("hub went down without a stop \u2014 respawning it\u2026");try{n=(await it({kind:"daemon"})).holderId,await l(),A("hub respawned")}catch(k){U(`respawn failed: ${k.message} \u2014 retrying on the next beat`),n=null}},f=!1,g=async()=>{if(!(f||u)){f=!0;try{let y=n?await Vk(n):await Te()?"unknown":"offline",k=null;if(y==="ok"&&t){let P=await Z("/local/session/heartbeat",{method:"POST",body:{...a?{sessionId:a}:{}},timeoutMs:4e3});!P.hubOffline&&P.status===200&&P.body&&(k={active:P.body.active})}let _=r0({holderId:n,wantRevert:t,sessionArmed:s},y,k);_==="handle-offline"?await m():_==="rehold"?(n=await Sc("daemon"),t&&await l()):_==="rearm"&&await l()}finally{f=!1}}};return setInterval(()=>{g()},yR),await new Promise(()=>{}),0}var dg=["Usage: acbridge devices [list] [--json]"," acbridge devices on|off <device>"," acbridge devices set <device> <capability.command|command> [--param k=v ...]"].join(`
257
+ `);function pg(e,t){let r=e.find(a=>a.id===t);if(r)return{ok:!0,device:r};let o=t.toLowerCase(),n=e.filter(a=>a.name.toLowerCase()===o);if(n.length===1)return{ok:!0,device:n[0]};let i=n.length>1?n:e.filter(a=>a.name.toLowerCase().includes(o));return i.length===1?{ok:!0,device:i[0]}:i.length>1?{ok:!1,kind:"ambiguous",candidates:i.map(a=>({id:a.id,name:a.name}))}:{ok:!1,kind:"not-found",candidates:[]}}function bR(e){let t={};for(let r of e){let o=r.indexOf("=");if(o<=0)return{ok:!1,message:`--param needs k=v, got: ${r}`};let n=r.slice(0,o),i=r.slice(o+1);if(i==="true"||i==="false")t[n]=i==="true";else if(i!==""&&Number.isFinite(Number(i)))t[n]=Number(i);else if(i.startsWith("[")||i.startsWith("{"))try{t[n]=JSON.parse(i)}catch{return{ok:!1,message:`--param ${n} isn't valid JSON`}}else t[n]=i}return{ok:!0,params:t}}function d0(e,t,r){let o=t.indexOf("."),n=o>0?t.slice(0,o):null,i=o>0?t.slice(o+1):t,a=[];for(let d of e.capabilities)if(!(n&&d.type!==n))for(let p of rg[d.type]??[])p.command===i&&(p.gate&&!p.gate(d)||a.push({cap:d,entry:p}));if(a.length===0)return n&&!e.capabilities.some(d=>d.type===n)?{ok:!1,message:`${e.name} doesn't have the "${n}" capability`}:{ok:!1,message:`no command "${i}" on ${e.name}${n?` (${n})`:""}`};if(a.length>1)return{ok:!1,message:`"${i}" is ambiguous on ${e.name} \u2014 qualify it: ${a.map(d=>`${d.cap.type}.${i}`).join(" | ")}`};let{cap:s,entry:l}=a[0],u=l.params.safeParse(r);if(!u.success){let d=u.error.issues[0];return{ok:!1,message:`bad params for ${s.type}.${i}: ${d?`${d.path.join(".")} ${d.message}`:"invalid"}`}}return{ok:!0,capability:s.type,command:i,params:u.data}}function xR(e,t){return{deviceId:e,capability:t.capability,command:t.command,params:t.params,consumer:"app"}}function kR(e,t){let r=new Map(e.areas.map(n=>[n.id,n.name])),o=[];if(t?.note&&o.push(`(${t.note})`),e.devices.length===0)return o.push("no devices connected \u2014 run `acbridge scan` to find some, or add them in the app"),o;for(let n of[...e.devices].sort((i,a)=>i.name.localeCompare(a.name))){let i=n.areaId&&r.get(n.areaId)||"\u2014";o.push(`${n.name.padEnd(26)} ${n.type.padEnd(12)} ${i.padEnd(14)} ${n.reachability.padEnd(9)} ${n.id}`)}return o}async function p0(){let e=await Z("/local/devices",{method:"GET",timeoutMs:5e3});if(!e.hubOffline&&e.status===200&&e.body)return{doc:e.body};let t=Pn();if(t.state==="mismatch")return{refusal:{message:t.message,exitCode:3}};if(t.state!=="ok")return null;let r=await sy(t.token);return r?{doc:r,note:"relay cache \u2014 bridge not running; state may be stale"}:null}async function m0(e=[]){let t=e.includes("--json");t&&we(!0);let r=e.filter(d=>!d.startsWith("--")),o=r[0]??"list";if(o==="list"){let d=await p0();if(d&&"refusal"in d)return Pe(d.refusal.message,d.refusal.exitCode);if(!d)return Pe("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);if(t)xe(d.doc);else for(let p of kR(d.doc,d.note?{note:d.note}:void 0))h(p);return 0}if(o!=="on"&&o!=="off"&&o!=="set")return h(dg),Pe(`unknown devices subcommand: ${o}`,2);let n=r[1];if(!n)return h(dg),Pe("which device? give an id (dev_\u2026) or a name",2);let i=await p0();if(i&&"refusal"in i)return Pe(i.refusal.message,i.refusal.exitCode);if(!i)return Pe("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);let a=pg(i.doc.devices,n);if(!a.ok){if(a.kind==="ambiguous"){for(let d of a.candidates)h(` ${d.name} (${d.id})`);return Pe(`"${n}" matches several devices \u2014 name one of the ids above`,2)}return Pe(`no device matches "${n}" \u2014 try \`acbridge devices\``,2)}let s;if(o==="on"||o==="off")s=d0(a.device,o==="on"?"power.turnOn":"power.turnOff",{});else{let d=r[2];if(!d)return h(dg),Pe("set needs a command \u2014 e.g. `acbridge devices set lamp brightness.setBrightness --param level=40`",2);let p=[];for(let f=0;f<e.length;f++)e[f]==="--param"&&e[f+1]&&p.push(e[++f]);let m=bR(p);if(!m.ok)return Pe(m.message,2);s=d0(a.device,d,m.params)}if(!s.ok)return Pe(s.message,2);let l=Or({notSignedIn:{message:"Not signed in. Run `acbridge login`, or sign in via the AC Bridge app.",exitCode:3}});if(!l.ok)return Pe(l.message,l.exitCode);let u=await cy(l.token,xR(a.device.id,s));return u.ok?(A(`${a.device.name}: ${s.capability}.${s.command}${u.verified===!0?" (verified)":""}`),u.note&&h(Se(u.note)),t&&xe({ok:!0,deviceId:a.device.id,capability:s.capability,command:s.command}),0):u.status===503?Pe("bridge not running \u2014 run `acbridge start` (device control routes through your PC)",1):(b(u.error??`command failed (${u.status||"network"})`),t&&xe({ok:!1,error:u.error??null,status:u.status,exit:1}),1)}import{spawnSync as Zc}from"node:child_process";import{existsSync as gD}from"node:fs";import gw from"node:path";import{createSocket as AR}from"node:dgram";import{readFile as ER}from"node:fs/promises";import{networkInterfaces as g0}from"node:os";import{execFile as SR}from"node:child_process";import{existsSync as _R}from"node:fs";import{join as $R}from"node:path";import{promisify as IR}from"node:util";var vH=new TextEncoder;var _H=IR(SR);function mg(e={}){let t=e.env??process.env,r=e.exists??(o=>_R(o));for(let o of(t.PATH??"").split(":"))if(o!=="")try{if(r($R(o,"powershell.exe")))return!0}catch{}return!1}var fg="239.255.90.90",gg=35090,h0=35091;function v0(e){return!e.internal&&(e.family==="IPv4"||e.family===4)}var ft={createSocket:(e,t)=>AR({type:e,reuseAddr:t?.reuseAddr??!0}),interfaceAddresses:()=>Object.values(g0()).flatMap(e=>e??[]).filter(v0).map(e=>e.address)};async function Dc(e={}){let t=e.timeoutMs??2e3,r=e.sockets??ft,o=await PR(e.readProcVersion??(()=>ER("/proc/version","utf8")),e.env??process.env),[n,i]=await Promise.all([CR(r,t).catch(()=>null),TR(r,t).catch(()=>null)]),a;try{a=(e.interfaces??RR)()}catch{a=void 0}let s={wsl:o,multicastOk:n,broadcastOk:i};a!==void 0&&(s.interfaces=a);try{let l=e.windowsInterop??(()=>mg({env:e.env??process.env}));o&&l()&&(s.interop="windows-arp")}catch{}return s}async function PR(e,t){if(t.WSL_DISTRO_NAME||t.WSL_INTEROP)return!0;try{return/microsoft/i.test(await e())}catch{return!1}}function CR(e,t){return new Promise(r=>{let o=[],n=[],i=!1,a=s=>{if(!i){i=!0;for(let l of n)clearTimeout(l);for(let l of o)try{l.close()}catch{}r(s)}};try{let s=`acbridge-mc-${Math.random().toString(36).slice(2)}`,l=new TextEncoder().encode(s),u=e.createSocket("udp4",{reuseAddr:!0});o.push(u),u.on("error",()=>a(null)),u.on("message",d=>{new TextDecoder().decode(d)===s&&a(!0)}),u.bind(gg,()=>{try{u.addMembership(fg)}catch{a(null);return}let d=e.createSocket("udp4",{reuseAddr:!0});o.push(d),d.on("error",()=>a(null)),d.bind(0,()=>{let p=()=>{try{d.setMulticastLoopback(!0),d.send(l,gg,fg,m=>{m&&a(null)})}catch{a(null)}};p(),n.push(setTimeout(p,Math.max(1,Math.floor(t/2))))}),n.push(setTimeout(()=>a(!1),t))})}catch{a(null)}})}function TR(e,t){return new Promise(r=>{let o,n,i=!1,a=s=>{if(!i){i=!0,n&&clearTimeout(n);try{o?.close()}catch{}r(s)}};try{o=e.createSocket("udp4",{reuseAddr:!0});let s=o;s.on("error",()=>a(null)),s.bind(0,()=>{try{s.setBroadcast(!0),s.send(new TextEncoder().encode("acbridge-env-probe"),h0,"255.255.255.255",l=>{if(!l)return a(!0);let u=l.code;a(u==="EACCES"||u==="ENETUNREACH"||u==="EHOSTUNREACH"?!1:null)})}catch{a(null)}}),n=setTimeout(()=>a(null),t)}catch{a(null)}})}function RR(){return Object.entries(g0()).filter(([,e])=>e?.some(v0)).map(([e])=>e)}var AO=qt(Q0(),1);var oZ=new TextDecoder;import{createDecipheriv as sZ,createHash as EO}from"node:crypto";var uZ=EO("md5").update("yGAdlopoPVldABfn").digest(),dZ=new TextDecoder;var vZ=30*6e4;var CO=new Set(["00:33:7a","10:5a:17","10:d5:61","18:69:d8","18:de:50","1c:90:ff","20:f1:b2","2c:b4:71","30:48:7d","38:1f:8d","38:2c:e5","38:a5:c9","3c:0b:59","4c:a9:19","50:8a:06","50:8b:b9","68:57:2d","70:89:76","7c:f6:66","80:64:7c","84:e3:42","a0:92:08","a8:80:55","b8:06:0d","bc:35:1e","c0:f8:53","c4:82:e1","cc:8c:bf","d0:32:e7","d0:82:e8","d0:82:eb","d4:a6:51","d8:1f:12","d8:c8:0c","d8:d6:68","d8:fc:92","e4:ae:e4","f8:17:2d","fc:3c:d7","fc:67:1f"]),TO={"00:17:88":"Signify (Philips Hue)","c4:29:96":"Signify","fc:26:8c":"Signify","d0:73:d5":"LIFX","50:c7:bf":"TP-Link","1c:3b:f3":"TP-Link","d8:0d:17":"TP-Link","5c:e9:31":"TP-Link","3c:52:a1":"TP-Link","24:0a:c4":"Espressif","24:6f:28":"Espressif","30:ae:a4":"Espressif","5c:cf:7f":"Espressif","ec:fa:bc":"Espressif","a4:cf:12":"Espressif","48:3f:da":"Espressif","70:87:9e":"Beken","80:6d:de":"Beken","c8:47:8c":"Beken",...Object.fromEntries([...CO].map(e=>[e,"Tuya"])),"a8:bb:50":"WiZ","d8:a0:11":"WiZ","44:4f:8e":"WiZ","6c:29:90":"WiZ","94:9f:3e":"Sonos","5c:aa:fd":"Sonos","00:0e:58":"Sonos","fc:65:de":"Amazon","74:c2:46":"Amazon","44:65:0d":"Amazon","0c:47:c9":"Amazon","b8:5f:98":"Amazon","f4:f5:d8":"Google","54:60:09":"Google","1c:f2:9a":"Google","d8:eb:46":"Google","18:b4:30":"Nest Labs","64:16:66":"Nest Labs","d0:52:a8":"SmartThings","24:fd:5b":"SmartThings","28:6d:97":"SAMJIN (SmartThings)","50:14:79":"iRobot","24:9e:7d":"Roborock","b0:4a:39":"Roborock","78:0f:77":"Broadlink","34:ea:34":"Broadlink","2c:aa:8e":"Wyze","44:61:32":"Ecobee","94:10:3e":"Belkin (Wemo)","5c:e7:53":"Govee","d4:13:68":"Govee","e0:2a:25":"Govee","80:8a:f7":"Nanoleaf","f8:24:41":"Yeelight","54:ef:44":"Aqara (Lumi)","18:c2:3c":"Aqara (Lumi)","b0:e9:fe":"SwitchBot","00:1c:2b":"Hive (Centrica)","ec:e5:12":"tado\xB0"};var AZ=new TextDecoder;var ow=Buffer.from("020000010000000000000000463cb5d3","hex"),TZ=new TextEncoder,RZ=new TextDecoder;var GZ=new TextDecoder;var sw="239.255.255.250",Fg=1982,cw=["M-SEARCH * HTTP/1.1",`HOST: ${sw}:${Fg}`,'MAN: "ssdp:discover"',"ST: wifi_bulb","",""].join(`\r
258
+ `);var KZ=new TextDecoder;var l3=new TextDecoder;var lw="239.255.255.250",uw=1900,tD=["M-SEARCH * HTTP/1.1",`HOST: ${lw}:${uw}`,'MAN: "ssdp:discover"',"MX: 3","ST: ssdp:all","",""].join(`\r
259
+ `),g3=new TextDecoder;var S3=new Uint8Array([0]);import{spawnSync as dw}from"node:child_process";var Mg=Kh("cli");function mD(e){try{let t=dw(e,{shell:!0,encoding:"utf8",timeout:5e3});return`${t.stdout??""}${t.stderr??""}`}catch{return""}}function pw(e=process.platform){return nv({platform:e,programs:[process.execPath],ruleName:Mg,runCheck:mD,runElevated:t=>{e!=="win32"&&dw("sudo",["sh","-c",t],{stdio:"inherit"})}})}function mw(e){let t=[],{home:r,credential:o}=e,n=r.source==="peer-wsl"||r.source==="peer-windows";if(r.source==="env")t.push({grade:"info",line:`hub state home: ${r.dir} (BRIDGE_SECRET_DIR override)`});else if(n){let a=r.source==="peer-wsl"?"on Windows":"inside WSL";t.push({grade:"ok",line:`hub state home: ${r.dir} \u2014 the hub runs ${a}, this environment reads its home across the boundary`})}else r.beacon?t.push({grade:"ok",line:`hub state home: ${r.dir} (hub live on port ${r.beacon.port})`}):t.push({grade:"info",line:`hub state home: ${r.dir} \u2014 no hub advertising itself here yet`});o==="rejected"?t.push({grade:"bad",line:"the hub REJECTED this machine's hub-token (401) \u2014 it is stale or belongs to another home. Profiles signals from every session here are being dropped. Restart the bridge (`acbridge stop` then `acbridge start`, or Stop \u2192 Start in the app) to re-mint it."}):o==="absent"&&r.beacon?t.push({grade:"warn",line:`a hub is running (port ${r.beacon.port}) but no readable hub-token was found in ${r.dir} \u2014 sessions here cannot authenticate to it`}):o==="ok"&&t.push({grade:"ok",line:"hub credential accepted (Profiles signals from this environment are authorized)"});let i=e.lastHookError;if(i&&e.nowMs-i.ts<=864e5&&o!=="ok"){let a=Math.max(0,Math.round((e.nowMs-i.ts)/6e4));t.push({grade:"warn",line:`a Profiles signal from this machine was refused ${a}m ago (HTTP ${i.status})${i.hint?` \u2014 ${i.hint}`:""}`})}return t}import{spawnSync as fD}from"node:child_process";function Qe(e={}){let t=e.env??process.env,r=e.clientVersion!==void 0?e.clientVersion:Ct(t),o=e.bundled??Ri();return ra({isDevBuild:r===null&&!o,env:t})}function fw(){return qh({voice:Qe(),runElevated:e=>{e.method==="sudo"&&fD(e.file,e.args,{stdio:"inherit"})}})}function hD(e,t){let r=`codex: ${e??"not found"} \xB7 ${t?"logged in":"not logged in"}`;return{grade:e!==null&&t?"ok":"warn",line:r}}async function vD(){let e=await Dc();e.wsl?U("WSL detected \u2014 LAN scan degraded (mDNS/broadcast limited)"):A("host is not WSL \u2014 LAN discovery unrestricted"),e.multicastOk===!0?e.wsl?U("multicast self-test passed locally, but under WSL that only exercises the loopback stack \u2014 LAN mDNS delivery is still limited (rely on the Windows neighbor table below)"):A("multicast self-test passed (this computer's stack \u2014 it does not prove your NETWORK forwards multicast)"):e.multicastOk===!1?U("multicast self-test failed \u2014 mDNS discovery unavailable"):U("multicast self-test could not run (inconclusive)"),e.wsl&&(e.interop==="windows-arp"?A("WSL interop scanning available (powershell.exe \u2014 Windows neighbor table)"):U("WSL interop unavailable (powershell.exe not on PATH) \u2014 ARP discovery sees only the WSL subnet"));let t=await Z("/local/discovered");t.hubOffline?U("hub control API unreachable \u2014 scan/connect unavailable (start it: `acbridge daemon` or the app)"):t.status===200?A(`hub control API reachable (127.0.0.1:${ne().hubPort})`):U(`hub control API answered HTTP ${t.status} \u2014 token mismatch? restart the hub`);try{let r=a=>{let s=Zc(a,{shell:!0,encoding:"utf8",timeout:4e3});return`${s.stdout??""}${s.stderr??""}`};if(Bo(process.platform,{})==="wsl-host"){h(`firewall: ${Dl}`);return}let o=Rl(process.platform,r),n=Bo(process.platform,o),i=`${o.ufwStatusOut??""}${o.firewallCmdStateOut??""}${o.alfGlobalStateOut??""}`;if(n==="none")/permission denied|must be root|need to be root/i.test(i)?h("firewall state undetectable without sudo"):A("firewall: no active firewall detected \u2014 scanning unrestricted");else{let a=Ol(n,{programs:[process.execPath],ruleName:Mg});if("state"in a?A("firewall: no active firewall detected \u2014 scanning unrestricted"):a.evalCheck(a.checkCommands.map(r))?A(`firewall: rule present (${n})`):U(`firewall rule missing \u2014 allow it with: ${a.manualCommand} (or use the app's Scan panel to cover the desktop app)`),n==="windows"){let s=ev(r("netsh advfirewall firewall show rule name=all dir=in verbose"),process.execPath),l=tv(Qh(r("netsh advfirewall show currentprofile")),s);l&&U(l)}}$l(Fo())==="keyring"?A("integration secrets: OS keyring (encrypted at rest, as this CLI resolves it)"):h("integration secrets: 0600 FILES, not the OS keyring (as this CLI resolves it) \u2014 no session keyring here, which is normal on WSL/headless Linux. The app or hub can resolve differently if it runs in a different session.")}catch{h("firewall state undetectable without sudo")}}async function yD(){let e=Sr({fresh:!0}),t=W,r="unknown",o=e.beacon?.port??ry(),n=O(Ah(e.dir));if(!n)r="absent";else try{r=(await fetch(`http://127.0.0.1:${o}/local/devices`,{headers:{"x-bridge-hub-token":n},signal:AbortSignal.timeout(3e3)})).status===401?"rejected":"ok"}catch{r="unknown"}let i=null;try{let a=O(gw.join(t,"launch-last.json"));if(a)try{let l=JSON.parse(a);l.error?h(`last launch: REFUSED (${l.terminalId}, ${l.cwd}) \u2014 ${l.error}`):h(`last launch: ${l.terminalId} \u2192 ${l.file} ${JSON.stringify(l.args??[])}`)}catch{}let s=O(gw.join(t,"hooks-last-error.json"));if(s){let l=JSON.parse(s);typeof l.ts=="number"&&typeof l.status=="number"&&(i={ts:l.ts,status:l.status,...typeof l.hint=="string"?{hint:l.hint}:{}})}}catch{}return{home:e,localDir:t,credential:r,lastHookError:i,nowMs:Date.now()}}async function hw(e={}){let t=0,r=z=>{t++,b(z)},o=null,n=()=>o??=An(),i=(e.build??Mn)(),a=e.clientVersion?e.clientVersion():i.version,s=e.fetchManifest??Cc,l=l0(a,a===null?null:await s(),process.platform,i.channel??"app");l.grade==="ok"?A(l.line):l.grade==="warn"?U(l.line):l.grade==="bad"?r(l.line):h(l.line);let u=e.voice??Qe({clientVersion:a}),d=(e.claudeVersion??(()=>bD(n())))(),p=ia(process.platform).manualCommand;if(d===null)r(`claude CLI not found on PATH \u2014 install it: ${p}`);else{let z=wv(d);z.ok?A(`claude ${z.version}`):r(`claude ${z.version??"?"} \u2014 channels need \u2265 2.1.80 \u2014 reinstall: ${p}`)}let m=(e.codexVersion??xD)(),f=e.codexLoggedIn??la,g=hD(m,f());g.grade==="ok"?A(g.line):U(g.line);let y=(e.nodeRuntime??(()=>Er(Pr(W))))();y.kind==="shim"?A(`node runtime: bundled shim (${y.command})`):y.kind==="system"?A(`node v${y.version}`):r("node not found \u2014 install Node \u2265 20 or the AC Bridge app"),(e.pluginInstalled??(()=>kD(n())))()?A(u?"alexa@bridge plugin installed":"alexa@bridge plugin installed (agent state \u2192 device profiles)"):r("alexa@bridge plugin not installed \u2014 run `acbridge setup`");let _=Kn(),P=(e.managedSettingsRaw??(()=>O(_)))(),C=_v(P);u?C.allowed?A("channel allowlisted in managed settings"):C.present?r(`channel not allowlisted in ${_} \u2014 run \`acbridge setup\``):r(`managed settings missing at ${_} \u2014 run \`acbridge setup\``):A("managed settings not used (voice off \u2014 no channel allowlist needed)"),(e.hubBundlePresent??(()=>gD(Xo)))()?A("hub bundle present"):U("hub bundle not built \u2014 run `npm run build` (dev uses tsx)");let D=(e.signedIn??Pn)(),G=D.state==="ok"?D.token:"";D.state==="ok"?A("signed in (relay token present)"):D.state==="mismatch"?r(Je.pointerMismatch):U("not signed in \u2014 run `acbridge login`, sign in via the app, or `acbridge pair <code>`");let ae=(e.onboardingVerified??wD)();ae!==null?A(`account setup verified (${new Date(ae).toISOString().slice(0,10)})`):h("account setup not yet verified here \u2014 start/run check the relay on first use");let X=(e.appInstalled??Tr)();if(X?A(`desktop app found (${X.path})`):h("desktop app not found on this machine \u2014 sign-in handoff unavailable (browser `acbridge login` works)"),G){let vt=await(e.fetchEntitlement??Ot)(G);vt?h(`plan ${vt.plan}; capture telemetry=${vt.capture.telemetry} transcripts=${vt.capture.transcripts}`):h("entitlement: couldn't read from the relay (offline?)");let et=(e.entitlementFileAgeH??SD)();et==="absent"?h("entitlement file absent \u2014 capture off until the hub next syncs"):et==="unreadable"?U("entitlement file unreadable \u2014 capture off, fail-closed"):et<=24?A(`entitlement file fresh (${et.toFixed(1)}h)`):U(`entitlement file STALE (${et.toFixed(1)}h) \u2014 capture off, fail-closed`)}await(e.hubRunning??Te)()?A("hub running"):h(u?"hub not running (starts automatically on `acbridge run`)":"hub not running (start it: `acbridge start`)");for(let z of mw(await(e.homeFacts??yD)()))z.grade==="ok"?A(z.line):z.grade==="warn"?U(z.line):z.grade==="bad"?r(z.line):h(z.line);let Ee=(e.claudeEnvironments??Iv)();for(let z of Ee)z.claudePresent&&(z.pluginInstalled?A(`Claude Code wired for Profiles \u2014 ${z.label}`):U(`Claude Code is installed in ${z.label} WITHOUT the bridge plugin \u2014 sessions there drive no devices. Fix: ${z.setupHint}`));return await(e.discoveryPreflight??vD)(),h(""),t?b(`${t} problem(s) found`):A("all checks passed"),t?1:0}function bD(e){let t=e??An(),r=Zc(t.file,[...t.argsPrefix,"--version"],{encoding:"utf8"});return r.status===0?r.stdout??"":null}function xD(){let e=$r(),t=Zc(e.file,[...e.argsPrefix,"--version"],{encoding:"utf8",timeout:5e3});return t.status===0?(t.stdout||t.stderr||"").trim()||"unknown":null}function kD(e){let t=e??An(),r=Zc(t.file,[...t.argsPrefix,"plugin","list"],{encoding:"utf8"});return Sv(`${r.stdout??""}${r.stderr??""}`).ok}function wD(){let e=kt();return e?ha({configFile:e.userConfigFile}).onboardedAt:null}function SD(){let e=kt(),t=e?O(e.entitlementFile):null;if(!t)return"absent";try{let r=JSON.parse(t);return(Date.now()-(r.fetchedAt??0))/36e5}catch{return"unreadable"}}var _D=["tuya","meross","ewelink","govee"];function $D(e){let t=[],r=e.accounts("homeassistant");t.push({provider:"home-assistant",kind:"local",status:r.length>0?"linked":"not linked",...r.length>0?{detail:r.map(a=>String(a.baseUrl??a.accountId??"")).join(", ")}:{hint:"acbridge link home-assistant"}});let o=e.accounts("mqtt");t.push({provider:"mqtt",kind:"local",status:o.length>0?"linked":"not linked",...o.length>0?{detail:o.map(a=>`${String(a.host??a.accountId??"")}${a.port?`:${String(a.port)}`:""}`).join(", ")}:{hint:"acbridge link mqtt --host <broker>"}});let n=e.accounts("hue");t.push({provider:"hue",kind:"local",status:n.length>0?"linked":"not linked",...n.length>0?{detail:n.map(a=>String(a.host??a.bridgeId??"")).join(", ")}:{hint:"acbridge link hue"}});for(let a of _D){let s=e.hasKeystore(a);t.push({provider:a,kind:"keyed",status:s?"linked":"not linked",...s?{}:{hint:`acbridge link ${a}`}})}t.push({provider:"nanoleaf",kind:"device-paired",status:"pairs per device",hint:"acbridge connect <device> (hold the power button)"});let i=e.cloudAccounts===null?null:e.cloudAccounts.find(a=>a.provider==="smartthings");return t.push({provider:"smartthings",kind:"cloud",status:e.cloudAccounts===null?"unknown (sign in)":i?i.status??"linked":"not linked",...e.cloudAccounts!==null&&!i?{hint:"acbridge link smartthings"}:{}}),t}function ID(e){return e.map(t=>`${t.provider.padEnd(16)} ${t.status.padEnd(18)} ${t.detail??t.hint??""}`.trimEnd())}async function vw(e=[]){let t=e.includes("--json");t&&we(!0);let r=Pn(),o=r.state==="ok"?await uy(r.token):null,n=kt(),i=$D({accounts:a=>n?Dr(n,a):[],hasKeystore:a=>n?_r(n,a,"keystore").read()!==null:!1,cloudAccounts:o});if(t)xe(i);else for(let a of ID(i))h(a);return 0}import*as yw from"node:https";import{createInterface as bw}from"node:readline/promises";function Hg(){let e=Sr({fresh:!0});if(e.source==="peer-wsl"||e.source==="peer-windows"){let o=e.source==="peer-wsl"?"on Windows":"inside WSL";return b(`the bridge is running ${o} (state in ${e.dir}), so an account linked here would be saved where that hub cannot read it. Run \`acbridge link\` from ${o}, or stop that bridge and start one on this side first.`),null}let t=kt();if(t)return t;let r=Bn();return r.ok?(b($e()?"This machine's signed-in account doesn't match its stored account pointer \u2014 run `acbridge logout` then `acbridge login` to reset it.":"Couldn't resolve this machine's signed-in account \u2014 run `acbridge login` again."),null):(b(r.message),null)}var AD=e=>`${e} on the command line is world-readable via \`ps\` and saved in shell history \u2014 prefer \`${e}-file <path>\`, the interactive prompt, or its env var.`;function gr(e){if(e.file!==void 0){let t=(e.read??O)(e.file);if(t===null)return{ok:!1,message:`Couldn't read ${e.flag}-file ${e.file} \u2014 check the path and its permissions.`};let r=t.trim();return r?{ok:!0,value:r}:{ok:!1,message:`${e.flag}-file ${e.file} is empty \u2014 write the secret into it first.`}}return e.argv!==void 0?((e.warn??U)(AD(e.flag)),{ok:!0,value:e.argv.trim()}):{ok:!0,value:(e.env??"").trim()}}function ED(e){let t={},r=(o,n,i,a)=>o===`--${Bg(n)}`?(t[n]=a[++i],i):(o.startsWith(`--${Bg(n)}=`)&&(t[n]=o.slice(`--${Bg(n)}=`.length)),i);for(let o=0;o<e.length;o++){let n=e[o];if(n)for(let i of["tokenFile","keyFile","secretFile","passwordFile","url","token","units","host","bridgeId","key","clientId","secret","region","email","password","mfa","username","prefix"])o=r(n,i,o,e)}return t}var Bg=e=>e==="bridgeId"?"bridge-id":e==="clientId"?"client-id":e.endsWith("File")?`${e.slice(0,-4)}-file`:e,PD=e=>/^(https?|wss?):\/\/[^\s]+$/i.test(e),xw="Usage: acbridge link home-assistant --url http://homeassistant.local:8123 --token <long-lived-access-token> | --token-file <path> [--units metric|imperial]",kw="Usage: acbridge link hue --host <bridge-ip> [--bridge-id <id>] [--key <existing-app-key> | --key-file <path>]",ww="Usage: acbridge link smartthings (opens a browser sign-in via the relay; tokens seal at the relay)",Sw="Usage: acbridge link tuya [--client-id <id>] [--secret <access-secret> | --secret-file <path>] [--region eu|eu-w|us|us-e|cn|in] (eu-w/us-e = the Azure DCs)",_w="Usage: acbridge link meross [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|ap] [--mfa <6-digit-2fa-code>]",$w="Usage: acbridge link ewelink [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|as|cn]",Iw="Usage: acbridge link govee [--key <govee-api-key> | --key-file <path>] (Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key)",Aw="Usage: acbridge link mqtt --host <broker-host[:port]> [--username <u>] [--password <p> | --password-file <path>] [--prefix homeassistant]",CD="nanoleaf pairs per-device, not per-account: run `acbridge scan`, then `acbridge connect <device>` and hold the panel's power button.";async function Ew(e){let t=e[0],r=ED(e.slice(1));if(t==="smartthings")return DD();if(t==="tuya")return ND(r);if(t==="meross")return LD(r);if(t==="ewelink")return UD(r);if(t==="govee")return zD(r);let o;if(t==="home-assistant"||t==="homeassistant")o=TD(r);else if(t==="hue")o=await OD(r);else if(t==="mqtt")o=RD(r);else return b(`unsupported provider: ${t??"(none)"}. Supported: home-assistant, hue, smartthings, tuya, meross, ewelink, govee, mqtt`),h(xw),h(kw),h(ww),h(Sw),h(_w),h($w),h(Iw),h(Aw),h(CD),2;if(!o)return 1;Y("Bringing up the integration\u2026");try{let{spawned:n}=await it({kind:"cli"});n||await qk(),A(`Linked \u2014 your ${o.label} devices should now appear in the app and to Claude.`)}catch(n){h(`Recorded. Start the node when ready (\`acbridge daemon\`) to bring it up. (${n.message})`)}return 0}function TD(e){let t=Hg();if(!t)return null;let r=(e.url??"").trim().replace(/\/+$/,""),o=gr({flag:"--token",argv:e.token,file:e.tokenFile,env:process.env.BRIDGE_HA_TOKEN});if(!o.ok)return b(o.message),null;let n=o.value;if(!PD(r))return b("Missing/invalid --url. Give your Home Assistant base URL, e.g. http://homeassistant.local:8123"),h(xw),null;if(!n)return b("Missing --token (or BRIDGE_HA_TOKEN). Create a Long-Lived Access Token in HA \u2192 your profile \u2192 Security."),null;let i=e.units==="imperial"||e.units==="metric"?e.units:void 0,a=Pa("homeassistant",r);_r(t,"homeassistant",a).write(n);let s=Dr(t,"homeassistant").filter(l=>l.accountId!==a);return Da(t,"homeassistant",[...s,{accountId:a,baseUrl:r,...i?{unitSystem:i}:{}}]),A(`Linked Home Assistant (${r}). Token stored locally; account ${a}.`),{label:"Home Assistant"}}function RD(e){let t=Hg();if(!t)return null;let r=(e.host??e.url??"").trim(),{host:o,port:n,tls:i}=Nk(r);if(!o)return b("Missing --host. Give your broker's address, e.g. --host 192.168.1.5 (or mqtts://broker.lan:8883)."),h(Aw),null;let a=(e.username??"").trim(),s=gr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MQTT_PASSWORD});if(!s.ok)return b(s.message),null;let l=s.value;if(l&&!a)return b("A password needs a --username too \u2014 MQTT forbids a password with no user, and brokers refuse the connection."),null;let u=(e.prefix??"").trim(),d=`${o}:${n??(i?8883:1883)}`,p=Pa("mqtt",d);_r(t,"mqtt",p).write(l);let m=Dr(t,"mqtt").filter(f=>f.accountId!==p);return Da(t,"mqtt",[...m,{accountId:p,host:o,...n!==void 0?{port:n}:{},...i?{tls:i}:{},...a?{username:a}:{},...u?{discoveryPrefix:u}:{}}]),A(`Linked MQTT broker ${d}${a?` as ${a}`:" (anonymous)"}. Account ${p}.`),h(`Watching \`${u||"homeassistant"}/#\` for Home Assistant Discovery configs \u2014 Zigbee2MQTT, Tasmota and anything else that publishes them.`),{label:"MQTT"}}async function OD(e){let t=Hg();if(!t)return null;let r=(e.host??"").trim();if(!r)return b("Missing --host. Give your Hue Bridge IP, e.g. --host 192.168.1.42"),h(kw),null;let o=(e.bridgeId??"").trim().toLowerCase(),n;if(!o){let d=await jD(r);o=d.bridgeId??r.toLowerCase(),n=d.name}let i=gr({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_HUE_KEY});if(!i.ok)return b(i.message),null;let a=i.value||void 0,s;if(a)s=JSON.stringify({appkey:a.trim()}),h("Using the provided app key (skipping link-button pairing).");else{Y("Press the link button on top of your Hue Bridge now \u2014 pairing completes within 30s\u2026");try{let d=await FD(r);s=JSON.stringify({appkey:d.appkey,...d.clientkey?{clientkey:d.clientkey}:{}})}catch(d){return b(`Hue pairing failed: ${d.message}`),null}}let l=Pa("hue",o);_r(t,"hue",l).write(s);let u=Dr(t,"hue").filter(d=>d.accountId!==l);return Da(t,"hue",[...u,{accountId:l,host:r,bridgeId:o,...n?{name:n}:{}}]),A(`Linked Philips Hue (${r}, bridge ${o}). Keys stored locally; account ${l}.`),{label:"Philips Hue"}}async function DD(){let e=Bn();if(!e.ok)return b(e.message),3;Y("Starting SmartThings sign-in\u2026");let t=await py("smartthings");return!t.ok||!t.authorizeUrl?(b(t.error??"Couldn't start SmartThings linking."),h(ww),1):(A("Open this URL in a browser, sign in to Samsung, and approve access:"),h(t.authorizeUrl),h("The account links at the relay; the hub picks it up automatically on its next connect (or restart the hub)."),0)}async function ND(e){let t=await cr();if(!t.ok)return b(t.message),3;h("Tuya key wizard \u2014 one-time setup to control Smart Life / Tuya devices locally:"),h(" 1. Create a free account + Cloud Project at iot.tuya.com (data-center region MUST match your Smart Life app \u2014 UK/EU \u2192 Central Europe)."),h(" 2. Subscribe IoT Core (+ Authorization) to the project, then 'Link Tuya App Account' by scanning the QR from the Smart Life app."),h(" 3. Copy the project's Access ID (client id) + Access Secret below."),h(" Note: the IoT Core trial runs ~1 month (console \u2192 Cloud \u2192 My Services \u2192 'Extend Trial Period'). After it expires your"),h(" already-connected lamps keep working locally \u2014 only fetching NEW keys stops. Re-pairing a device rotates its key \u2192 re-run this.");let r=(e.clientId??process.env.BRIDGE_TUYA_CLIENT_ID??await ko("Access ID (client id): ")).trim(),o=gr({flag:"--secret",argv:e.secret,file:e.secretFile,env:process.env.BRIDGE_TUYA_SECRET});if(!o.ok)return b(o.message),2;let n=(o.value||await Gc("Access Secret: ")).trim(),i=((e.region??process.env.BRIDGE_TUYA_REGION??await ko("Region [eu]: "))||"eu").trim().toLowerCase();if(!r||!n)return b("Both the Access ID and Access Secret are required."),h(Sw),1;if(!["eu","eu-w","us","us-e","cn","in"].includes(i))return b(`Unknown region "${i}" \u2014 use eu, eu-w, us, us-e, cn, or in.`),1;Y("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(s){return b(`The hub isn't running and couldn't be started: ${s.message}. Start it with \`acbridge daemon\` and retry.`),1}Y("Fetching your device keys from Tuya (this can take a few seconds)\u2026");let a=await Z("/local/tuya/link",{method:"POST",body:{clientId:r,clientSecret:n,region:i},timeoutMs:9e4});if(a.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(a.status===200&&a.body?.ok){let s=a.body.deviceCount??0,l=a.body.sleepyCount??0;return A(`Imported keys for ${s} Tuya device${s===1?"":"s"}. Keys are stored only on this PC (never on your network or the cloud).`),l>0&&h(`${l} battery/sensor device${l===1?"":"s"} (e.g. a PIR) won't control locally yet \u2014 those come in a later update.`),h('Now run `acbridge scan` \u2014 your lamps should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(a.body?.error??`The hub couldn't complete the wizard (HTTP ${a.status??"?"}).`),1}async function LD(e){let t=await cr();if(!t.ok)return b(t.message),3;h("Meross account wizard \u2014 a one-time sign-in so the hub can control your Meross devices locally:"),h(" Your Meross email + password are sent ONCE to Meross to fetch the account key that signs local"),h(" requests. The key is stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=gr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MEROSS_PASSWORD});if(!r.ok)return b(r.message),2;let o=(e.email??process.env.BRIDGE_MEROSS_EMAIL??await ko("Meross email: ")).trim(),n=r.value||await Gc("Password: "),i=((e.region??process.env.BRIDGE_MEROSS_REGION??await ko("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return b("Both the email and password are required."),h(_w),1;if(!["eu","us","ap"].includes(i))return b(`Unknown region "${i}" \u2014 use eu, us, or ap.`),1;let a=(e.mfa??process.env.BRIDGE_MEROSS_MFA)?.trim()||void 0;Y("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(l){return b(`The hub isn't running and couldn't be started: ${l.message}. Start it with \`acbridge daemon\` and retry.`),1}Y("Signing in to Meross\u2026");let s=await Z("/local/meross/link",{method:"POST",body:{email:o,password:n,region:i,...a?{mfaCode:a}:{}},timeoutMs:6e4});if(s.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(s.status===200&&s.body?.ok){let l=s.body.deviceCount??0;return A(`Signed in. The account key is stored only on this PC.${l?` (${l} device${l===1?"":"s"} on the account.)`:""}`),h('Now run `acbridge scan` \u2014 your Meross plugs/bulbs should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(s.body?.error??`The hub couldn't complete the sign-in (HTTP ${s.status??"?"}).`),1}async function UD(e){let t=await cr();if(!t.ok)return b(t.message),3;h("SONOFF / eWeLink account wizard \u2014 a one-time sign-in so the hub can control your SONOFF devices locally:"),h(" Your eWeLink email + password are sent ONCE to eWeLink to fetch each device's LAN key. The keys"),h(" are stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=gr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_EWELINK_PASSWORD});if(!r.ok)return b(r.message),2;let o=(e.email??process.env.BRIDGE_EWELINK_EMAIL??await ko("eWeLink email: ")).trim(),n=r.value||await Gc("Password: "),i=((e.region??process.env.BRIDGE_EWELINK_REGION??await ko("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return b("Both the email and password are required."),h($w),1;if(!["eu","us","as","cn"].includes(i))return b(`Unknown region "${i}" \u2014 use eu, us, as, or cn.`),1;Y("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(s){return b(`The hub isn't running and couldn't be started: ${s.message}. Start it with \`acbridge daemon\` and retry.`),1}Y("Signing in to eWeLink\u2026");let a=await Z("/local/ewelink/link",{method:"POST",body:{email:o,password:n,region:i},timeoutMs:6e4});if(a.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(a.status===200&&a.body?.ok){let s=a.body.deviceCount??0;return A(`Signed in. ${s} device key${s===1?"":"s"} stored \u2014 only on this PC.`),h('Now run `acbridge scan` \u2014 your SONOFF switches/plugs should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(a.body?.error??`The hub couldn't complete the sign-in (HTTP ${a.status??"?"}).`),1}async function zD(e){let t=await cr();if(!t.ok)return b(t.message),3;h("Govee key wizard \u2014 one self-service API key imports your Govee devices:"),h(" Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key (it arrives by email within minutes).");let r=gr({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_GOVEE_KEY});if(!r.ok)return b(r.message),2;let o=(r.value||await Gc("Govee API key: ")).trim();if(!o)return b("An API key is required."),h(Iw),2;Y("Making sure the hub is running\u2026");try{await it({kind:"cli"})}catch(i){return b(`The hub isn't running and couldn't be started: ${i.message}. Start it with \`acbridge daemon\` and retry.`),1}Y("Importing your Govee devices\u2026");let n=await Z("/local/govee/link",{method:"POST",body:{apiKey:o},timeoutMs:6e4});if(n.hubOffline)return b("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(n.status===200&&n.body?.ok){let i=n.body.deviceCount??0;return A(`Imported ${i} Govee device${i===1?"":"s"}. The key is stored only on this PC.`),h('Now run `acbridge scan` \u2014 your Govee lights should appear under "Ready to connect". Connect each, then control by voice or in the app.'),0}return b(n.body?.error??`The hub couldn't complete the wizard (HTTP ${n.status??"?"}).`),1}async function ko(e){let t=bw({input:process.stdin,output:process.stdout});try{return await t.question(e)}finally{t.close()}}async function Gc(e){let t=process.stdout,r=bw({input:process.stdin,output:t}),o=r,n=o._writeToOutput?.bind(r);o._writeToOutput=i=>{(i.includes(e)||i===`\r
260
+ `||i===`
261
+ `)&&n?.(i)};try{let i=await r.question(e);return t.write(`
262
+ `),i}finally{r.close()}}function Pw(e,t,r,o){return new Promise((n,i)=>{let a=o===void 0?void 0:JSON.stringify(o),s=yw.request({host:e,port:443,method:t,path:r,rejectUnauthorized:!1,headers:{"content-type":"application/json"}},l=>{let u="";l.setEncoding("utf8"),l.on("data",d=>u+=d),l.on("end",()=>{try{n(u?JSON.parse(u):{})}catch(d){i(d instanceof Error?d:new Error(String(d)))}})});s.on("error",i),a&&s.write(a),s.end()})}async function jD(e){try{let t=await Pw(e,"GET","/api/0/config");return{bridgeId:t.bridgeid?.toLowerCase(),name:t.name}}catch{return{}}}async function FD(e){let t=Date.now()+3e4;for(;;){let r=await Pw(e,"POST","/api",{devicetype:"acbridge#cli",generateclientkey:!0}),o=Array.isArray(r)?r.find(i=>i.success)?.success:void 0;if(o)return{appkey:o.username,clientkey:o.clientkey};let n=Array.isArray(r)?r.find(i=>i.error)?.error:void 0;if(n&&n.type!==101)throw new Error(n.description??`Hue error ${n.type}`);if(Date.now()>t)throw new Error("timed out waiting for the link button (30s)");await new Promise(i=>setTimeout(i,1500))}}function MD(e){let t=e?.onboarding;return typeof t=="object"&&t!==null&&typeof t.completedAt=="number"}function BD(e){return{onboarding:{completedAt:e,completedBy:"cli"}}}async function Cw(e,t,r={}){if(!t)return"skipped";let o=r.http??fetch,n=r.now??Date.now,i=e.replace(/\/+$/,""),a=2;try{let s=r.current??await Rc(e,t,o);for(let l=0;l<a;l+=1){if(MD(s.config))return"already";if(s.version===null)return"skipped";let u=await o(`${i}/settings`,{method:"PUT",headers:{authorization:`Bearer ${t}`,"content-type":"application/json"},body:JSON.stringify({version:s.version,config:{...s.config,...BD(n())}}),signal:AbortSignal.timeout(6e3)});if(u.ok)return"claimed";if(u.status!==409)return"skipped";l+1<a&&(s=await Rc(e,t,o))}return"skipped"}catch{return"skipped"}}function HD(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return{...typeof t.sub=="string"?{sub:t.sub}:{},...typeof t.nid=="string"?{nid:t.nid}:{},...typeof t.exp=="number"?{exp:t.exp}:{}}}catch{return null}}function ZD(e){let t=[`account: ${e.claims.sub??"(unknown)"}`,...e.claims.nid?[`node: ${e.claims.nid}`]:[],`machine: ${e.machine}`,`relay: ${e.relayUrl}`,...e.plan?[`plan: ${e.plan}`]:[]],r={account:e.claims.sub??null,...e.claims.nid?{node:e.claims.nid}:{},machine:e.machine,relayUrl:e.relayUrl,...e.plan?{plan:e.plan}:{}};if(e.scope){let{pointerSub:o,resolvedSub:n}=e.scope,i=!!n&&o===n;t.push(`pointer: ${o??"(none)"}`),t.push(n?`resolved: ${n}${i?" (pointer and credential agree)":""}`:o?`resolved: MISMATCH \u2014 pointer and credential name different accounts (${Je.pointerMismatch})`:"resolved: not signed in"),r.pointer=o,r.resolved=n,r.agree=i}return{lines:t,json:r}}async function Wc(e=[]){let t=e.includes("--json");t&&we(!0);let r=O(he().accessFile)?.trim(),o=$e()?.sub??null,n=pt()?.sub??null;if(!r){let l=dt();return l.length>0&&o&&!n?(nt(l),Pe(Je.pointerMismatch,3)):Pe("Not signed in. Run `acbridge login`, or sign in via the AC Bridge app.",3)}let i=HD(r)??{},a=await Ot(r),s=ZD({claims:i,machine:Aa(),relayUrl:ne().relayUrl,plan:a?.plan??null,scope:{pointerSub:o,resolvedSub:n}});if(t)xe(s.json);else for(let l of s.lines)h(l);return 0}var GD=`Usage: acbridge login [--if-needed] [--provider google|github|microsoft|sso] [--email <you@example.com>] [--app] [--no-browser] [--timeout <s>] [--json]
263
+ --if-needed skip the sign-in when this machine already holds a usable credential (default: always sign in)`,Tw=["google","github","microsoft","email","sso"];function WD(e){let t={provider:"email",app:!1,noBrowser:!1,timeoutMs:18e4,json:!1,ifNeeded:!1,chooser:!0};for(let r=0;r<e.length;r++){let o=e[r];if(o==="--app")t.app=!0;else if(o==="--if-needed")t.ifNeeded=!0;else if(o==="--no-browser")t.noBrowser=!0;else if(o==="--json")t.json=!0;else if(o==="--provider"){let n=e[++r];Tw.includes(n)?(t.provider=n,t.chooser=!1):t.bad=`invalid --provider: ${n??"(none)"} (use ${Tw.join(" | ")})`}else if(o==="--email")t.email=e[++r],t.chooser=!1;else if(o==="--timeout"){let n=Number(e[++r]);Number.isFinite(n)?t.timeoutMs=Math.min(600,Math.max(30,Math.round(n)))*1e3:t.bad=`invalid --timeout: ${e[r]??"(none)"}`}else t.bad=`unknown option: ${o??""}`}return t}function Vc(e={}){let t=e.readCredentialSub??Pc,r=e.writePointer??(n=>Yt({sub:n})),o=e.log??U;try{let n=t();n&&r(n)}catch(n){o(`couldn't update the active-user pointer (non-fatal): ${n instanceof Error?n.message:String(n)}`)}}function VD(e={}){(e.readActiveUser??(()=>$e()))()||(e.heal??Vc)()}function JD(e={}){let t=(e.scan??dt)();return(e.warnAmbiguous??(o=>nt(o)))(t),(e.resolveScope??(()=>pt()))()?{kind:"signed-in"}:(e.readPointer??(()=>$e()))()?{kind:"refuse",message:Je.pointerMismatch}:t.length===1&&Oa(t[0],e.segmentOf)?{kind:"heal",sub:t[0].sub}:{kind:"refuse",message:Je.logoutFirst("log in")}}function qD(e){return e.hasCredential?e.refreshed?{kind:"already"}:{kind:"stale-sign-in"}:{kind:"sign-in"}}async function Rw(e,t,r={}){let o=(r.readToken??(()=>O(he().accessFile)?.trim()??""))();if(o){let n=await(r.sync??vo)(e,o);await(r.claim??Cw)(e,o,{current:n})==="claimed"&&h("Account setup completed from this machine \u2014 `acbridge start` will run here now.")}return A(t.successLine),(r.report??(n=>Wc(n?["--json"]:[])))(t.json)}async function Ow(e=[]){let t=WD(e);if(t.bad)return b(t.bad),h(GD),2;t.json&&we(!0);let r=ne().relayUrl;if(t.ifNeeded&&Vo()){if(Kt()>=Xt){let n=JD();if(n.kind==="refuse")return b(n.message),3;n.kind==="heal"&&Yt({sub:n.sub})}else VD();if(qD({hasCredential:!0,refreshed:await Tt(r)}).kind==="already")return Rw(r,{json:t.json,successLine:"already signed in on this machine"});U("this machine's stored sign-in is no longer valid \u2014 signing in again")}if(t.app){let o=Tr();if(!o)return b("Couldn't find the AC Bridge app on this machine \u2014 run `acbridge login` (browser sign-in) or install the app."),1;if(Y(`opening the AC Bridge app (${o.path})\u2026`),!await Sa(o))return b("Couldn't launch the app."),1;if(h("Complete the sign-in in the AC Bridge app \u2014 I'll pick the credential up here."),!await _a({timeoutMs:t.timeoutMs}))return b("Timed out waiting for the app sign-in."),3}else{let o=Rv(),n=na();try{t.noBrowser||Y("opening your browser to sign in\u2026");let i=await Hv({cfg:o,opts:{provider:t.provider,...t.email?{email:t.email}:{}},chooser:t.chooser,timeoutMs:t.timeoutMs,openUrl:t.noBrowser?async()=>!1:s=>ka(s,{isWsl:n}),onBrowserFail:s=>{h(t.noBrowser?"Open this URL to sign in:":"Couldn't open a browser \u2014 open this URL to sign in:"),h(s)}});if(Y("pairing this machine\u2026"),!await Bv(r,()=>i.accessToken))return b("Signed in, but couldn't pair this machine with the relay \u2014 check your connection and retry."),1}catch(i){return b(Lv(i)),3}}return Vc(),Rw(r,{json:t.json,successLine:"Signed in. This machine now holds its own relay credential and refreshes itself."})}function KD(e){let t=e.reverted+e.failed+e.skipped;if(t===0)return"no devices needed reverting";let r=[`reverted ${e.reverted} of ${t} device${t===1?"":"s"}`];return e.failed&&r.push(`${e.failed} failed`),e.skipped&&r.push(`${e.skipped} skipped`),r.join(", ")}async function wo(e=[]){let t=e.includes("--json");t&&we(!0);let r,o=d=>{t&&xe({stopped:d,...r?{revert:r}:{}})},n=await Z("/local/session/stop",{method:"POST",body:{},timeoutMs:2e4});!n.hubOffline&&n.status===200&&n.body?.summary&&(r=n.body.summary,A(`lights: ${KD(r)}`));let i=await Jk(),a=O(Ve);if(i)return a&&ue(Ve),A("hub stopping \u2014 devices reverting, holders releasing"),o(!0),0;ny("stop-requested");let s=a?Number(a):0,l=s>0&&go({pid:s}),u=await Te();if(!l&&!u)return a&&ue(Ve),A("bridge already stopped"),o(!1),0;if(l)try{process.kill(s)}catch{}return a&&ue(Ve),Gk(),await Te()?(b("the hub is still running and didn't answer the shutdown \u2014 check ~/.claude-bridge/hub.log"),1):(A("hub stopped"),o(!0),0)}var XD="Usage: acbridge logout [--json]",YD=new Set(["--json"]);async function Dw(e=[],t={}){let r=e.filter(y=>!YD.has(y));if(r.length>0)return b(`unknown option: ${r[0]}`),h(XD),2;let o=e.includes("--json");o&&we(!0);let n=t.read??O,i=t.stopBridge??wo,a=t.revoke??((y,k,_)=>Mv(y,k,{clear:_})),s=t.clearTokens??jo,l=t.keyring??Fo(),u=y=>(t.clearDeviceCredentials??hl)(y,l),d=t.clearLogs??(()=>{Wl(xt),Wl(En)}),p=t.clearPointer??Wv,m=t.relayUrl??ne().relayUrl,f=[],g=(t.scan??dt)();g.length>=2&&(t.warnAmbiguous??(y=>nt(y)))(g);for(let{segment:y}of g){let k=yt(y),_=n(k.accessFile)?.trim()??n(k.refreshFile)?.trim()??null;f.push({segment:y,paths:k,bearer:_})}if(f.length===0)return A("already signed out"),o&&xe({signedOut:!0,alreadySignedOut:!0}),0;Y("stopping the bridge\u2026"),await i([]);for(let{segment:y,paths:k,bearer:_}of f)Y("revoking this machine's credential\u2026"),await a(m,_,()=>s(k)),u(y);return d(),p(),A("signed out \u2014 this machine no longer holds a credential."),o&&xe({signedOut:!0,alreadySignedOut:!1}),0}async function Nw(e,t={}){let r=e[0];if(!r)return b('Usage: acbridge pair <claim-code> (get a code from the app: "Add another machine")'),2;let n=(t.scan??oa)(),i=my(n,"pair");if(!i.ok)return i.ambiguous&&(t.warnAmbiguous??(a=>nt(a)))(n),b(i.message),3;try{h("Pairing this machine with your account\u2026");let a=await(t.claim??iy)(r),s=(t.store??zo)(a);return s?(t.writePointer??(l=>Yt({sub:l})))(s.sub):(t.healPointer??Vc)(),await(t.syncConfig??vo)(t.relayUrl??ne().relayUrl,a.access_token),A("Paired. This machine now holds its own relay credential and refreshes itself \u2014 no app needed."),h("Start the background node with: acbridge daemon"),0}catch(a){return b(a.message),1}}function Lw(e,t,r){let o=e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{};return Object.entries(o).filter(n=>typeof n[1]=="string").map(([n,i])=>({repo:n,profile:r.get(i)??`${i} (missing)`,lane:t}))}function QD(e){let t=e??{},o=(Array.isArray(t.profiles)?t.profiles:[]).filter(a=>a!==null&&typeof a=="object").map(a=>({id:typeof a.id=="string"?a.id:"(unknown)",name:typeof a.name=="string"&&a.name.trim()?a.name:"(unnamed)",states:a.states!==null&&typeof a.states=="object"?Object.keys(a.states).length:0})),n=new Map(o.map(a=>[a.id,a.name])),i=[...Lw(t.bindings,"claude",n),...Lw(t.codexBindings,"codex",n)];return{profiles:o,bindings:i}}function eN(e){if(e.profiles.length===0)return["no profiles yet \u2014 create them in the AC Bridge app (Profiles page)"];let t=e.profiles.map(r=>`${r.name.padEnd(24)} ${r.states} state${r.states===1?"":"s"} (${r.id})`);if(e.bindings.length>0){t.push("","bindings (repo \u2192 profile):");for(let r of e.bindings)t.push(` ${r.repo} \u2192 ${r.profile} [${r.lane}]`)}return t}async function Uw(e=[]){let t=e.includes("--json");t&&we(!0);let r=Or({notSignedIn:{message:"Not signed in. Run `acbridge login`, or sign in via the AC Bridge app.",exitCode:3}});if(!r.ok)return b(r.message),r.exitCode;let o=await ly(r.token);if(o===null)return b("couldn't read the profiles document from the relay \u2014 check your connection"),1;let n=QD(o);if(t)xe(n);else for(let i of eN(n))h(i);return 0}async function zw(e=[]){let t=e[0],r=e.slice(1).join(" ").trim();if(!t||!r)return b("Usage: acbridge rename <device> <new name>"),2;let o=await cr();if(!o.ok)return b(o.message),3;let n=await Z("/local/devices",{method:"GET",timeoutMs:5e3});if(n.hubOffline||n.status!==200||!n.body)return b(De()),1;let i=pg(n.body.devices,t);if(!i.ok){if(i.kind==="ambiguous"){b(`"${t}" matches several devices:`);for(let l of i.candidates)h(` ${l.name} (${l.id})`)}else b(`no device matches "${t}" \u2014 try \`acbridge devices\``);return 2}let a={deviceId:i.device.id,name:r},s=await Z("/local/rename",{method:"POST",body:a,timeoutMs:8e3});return!s.hubOffline&&s.status===200&&s.body?.ok?(A(`renamed ${i.device.name} \u2192 ${r}`),0):(b(s.body?.error??`rename failed (HTTP ${s.status??"offline"})`),1)}import{spawn as tN}from"node:child_process";import{chmodSync as nN,openSync as rN,writeFileSync as oN}from"node:fs";var iN="Usage: acbridge start [--no-revert] [--attach] [--json]",jw=35;function aN(e){let t=e.daemonPidRaw?Number(e.daemonPidRaw):0;return t>0&&(e.identifiable||e.hubUp)?"already-running":t>0?"stale-pid":"proceed"}function sN(e,t){return e.daemonAlive?e.hubUp&&(t||e.session==="active"||e.session==="unavailable")?"ready":"waiting":"died"}async function Jc(e=[]){let t=e.includes("--json");t&&we(!0);let r=e.includes("--no-revert"),o=e.includes("--attach"),n=e.find(f=>!["--json","--no-revert","--attach"].includes(f));if(n!==void 0)return b(`unknown option: ${n}`),h(iN),2;let i=await ho();if(!i.ok)return b(i.message),i.exitCode;await Tt(ne().relayUrl);let a=O(Ve),s=a?Number(a):0,l=aN({daemonPidRaw:a,identifiable:s>0&&go({pid:s}),hubUp:await Te()});if(l==="already-running")return A(`bridge already running (daemon pid ${s})`),t&&xe({started:!1,alreadyRunning:!0}),0;l==="stale-pid"&&(ue(Ve),Y("removed a stale daemon.pid")),ue(Ko);let u=r?["--no-revert"]:[];if(o)return h("running the bridge keeper in the foreground (Ctrl-C to stop)\u2026"),Oc(u);let d=Wk(u);oN(En,"",{mode:384}),nN(En,384);let p=rN(En,"a"),m=tN(d.file,d.args,{cwd:en,detached:!0,stdio:["ignore",p,p],env:process.env});m.unref(),Y(`bridge keeper starting (pid ${m.pid??"?"})`);for(let f=0;f<jw;f++){await lN(1e3);let g={daemonAlive:m.pid?Ea(m.pid):!1,hubUp:await Te(),session:await cN()},y=sN(g,r);if(y==="ready"){let k=r?"revert-on-stop off":g.session==="active"?"revert-on-stop armed":"session probe unavailable (older hub)";return A(`bridge running \u2014 hub up, ${k}`),h("stop it with: acbridge stop"),t&&xe({started:!0,revertOnStop:!r,session:g.session}),0}if(y==="died"){b("the bridge keeper exited during startup");let k=O(En);return k&&h(Se(Fw(k,8))),1}}b(`timed out waiting for the bridge to come up (${jw}s)`);for(let f of[En,xt]){let g=O(f);g?.trim()&&h(Se(Fw(g,6)))}return 1}async function cN(){let e=await Z("/local/session",{method:"GET",timeoutMs:3e3});return e.hubOffline||e.status!==200||!e.body?"unavailable":e.body.active?"active":"inactive"}function Fw(e,t){return e.trimEnd().split(`
264
+ `).slice(-t).join(`
265
+ `)}function lN(e){return new Promise(t=>setTimeout(t,e))}async function Mw(e=[],t={}){let r=await(t.stop??wo)([]);return r!==0?r:(t.start??Jc)(e)}import{spawnSync as __}from"node:child_process";import{randomUUID as yU}from"node:crypto";import{mkdirSync as bU,writeFileSync as xU}from"node:fs";import kU from"node:os";import ul from"node:path";import{createInterface as wU}from"node:readline";import{spawn as QL,spawnSync as eU}from"node:child_process";import{randomUUID as tU}from"node:crypto";import{readFileSync as nU}from"node:fs";import{request as rU}from"node:http";import{createInterface as oU}from"node:readline";import{readFileSync as UL}from"node:fs";var CL=qt(LS(),1),TL=qt(rl(),1),RL=qt($o(),1),OL=qt(eh(),1),DL=qt(rh(),1),NL=qt(lh(),1),Vi=qt(sl(),1),LL=qt(ZS(),1);var GS=100;function WS(e){let t=null,r=!1,o=1e3,n=null,i=[],a=()=>"endpoint"in e?e.endpoint():{port:e.port,tokenFile:e.tokenFile},s=p=>{try{return UL(p,"utf8").trim()}catch(m){return console.error(`[channel] cannot read hub token file ${p}:`,m),""}},l=p=>(i.push(p),i.length>GS&&(i.shift(),console.error(`[channel] outbound buffer at cap (${GS}); dropped oldest frame`)),!0),u=p=>{for(;i.length>0&&p.readyState===Vi.default.OPEN;){let m=i.shift();m&&p.send(JSON.stringify(m))}},d=()=>{if(r)return;let{port:p,tokenFile:m}=a(),f=s(m),g=new Vi.default(`ws://${e.host??"127.0.0.1"}:${p}`,{headers:{"x-bridge-hub-token":f}});t=g;let y=!0,k=null;g.on("open",()=>{o=1e3;let _=e.hello?.();_&&g.send(JSON.stringify(_)),u(g),y=!0,k=setInterval(()=>{if(!y){g.terminate();return}y=!1;try{g.ping()}catch{}},3e4)}),g.on("pong",()=>{y=!0}),g.on("message",_=>{try{e.onMessage(Sk(_.toString()))}catch(P){console.error("[channel] bad hub frame:",P)}}),g.on("error",_=>console.error("[channel] hub ws error:",_)),g.on("close",()=>{if(k&&(clearInterval(k),k=null),t===g&&(t=null),r)return;let _=o;o=Math.min(o*2,5e3),n=setTimeout(d,_)})};return d(),{send:p=>{if(r)return!1;let m=t;return m&&m.readyState===Vi.default.OPEN&&i.length===0?(m.send(JSON.stringify(p)),!0):l(p)},close:()=>{r=!0,n&&clearTimeout(n),t?.close()}}}var Q=e=>e;var VS=Q({id:"ActivateScene",target:"hub",customHandler:!0,scaffold:!0,carrier:"scene",utterances:["activate {scene} scene","activate scene {scene}","run scene {scene}","start {scene} scene"],slots:[{name:"scene",type:"SceneName",dynamic:!0,elicitationPrompts:["Which scene?"]}],customTypes:[{name:"SceneName",values:["movie night","good morning","bedtime","focus"]}],deviceCommands:[{capability:"scene",command:"activate"}],args:c.object({scene:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({scene:e.scene??""}),ackSpeech:()=>"",speak:()=>""});var JS=Q({id:"Attach",target:"hub",skillLocal:!0,carrier:"attach",utterances:["attach to {target}","attach","switch to {target}","use {target}"],slots:[{name:"target",type:"SessionName",required:!0,dynamic:!0,elicitationPrompts:["Which session?","Which one would you like to attach to?"]}],customTypes:[{name:"SessionName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>t.sessionCount===0?"No sessions are running yet.":null,fromSlots:e=>({target:e.target??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var qS=Q({id:"AttachBridge",target:"hub",skillLocal:!0,attachLevel:"bridge",carrier:"bridge",utterances:["attach to bridge {bridge}","switch to bridge {bridge}","open bridge {bridge}","go to bridge {bridge}"],slots:[{name:"bridge",type:"BridgeName",required:!0,dynamic:!0,elicitationPrompts:["Which bridge?","Which bridge would you like to attach to?"]}],customTypes:[{name:"BridgeName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>(t.bridgeCount??0)===0?"No bridges have a running session yet.":null,fromSlots:e=>({target:e.bridge??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var KS=Q({id:"ControlDevice",target:"hub",customHandler:!0,scaffold:!0,carrier:"turn",utterances:["turn on {device}","turn off {device}","turn on the {device}","turn off the {device}","toggle {device}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"},{capability:"power",command:"toggle"}],args:c.object({device:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??""}),ackSpeech:()=>"",speak:()=>""});var XS=Q({id:"ControlGroup",target:"hub",customHandler:!0,scaffold:!0,carrier:"group",utterances:["turn on the {group} group","turn off the {group} group","turn off {group} group"],slots:[{name:"group",type:"GroupName",dynamic:!0,elicitationPrompts:["Which group or room?"]}],customTypes:[{name:"GroupName",values:["living room","bedroom","kitchen","office","studio"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"}],args:c.object({group:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({group:e.group??""}),ackSpeech:()=>"",speak:()=>""});var YS=e=>`In the current working directory, ${e}. Keep the answer brief enough to be read aloud.`;var QS=Q({id:"GitStatus",target:"session",carrier:"git",utterances:["git status","what's the git status","any uncommitted changes in git"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"Asking git status.",speak:()=>"",render:()=>YS("run git status and report the current branch and any uncommitted changes")});var zL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),e_=Q({id:"ListBridges",target:"hub",carrier:"bridge",utterances:["list bridges","list my bridges","what bridges do I have","what bridges are running","which bridges are running"],slots:[],args:c.object({}),result:c.object({bridges:c.array(zL)}),speaksResult:!0,cacheSource:"bridges",providesBridgeCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.bridges.length;if(t===0)return"No bridges have a running session.";let r=e.bridges.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} bridge${t===1?"":"s"}: ${r}.`}});var jL=c.object({name:c.string(),type:c.string(),room:c.string().nullable(),online:c.boolean()}),FL=c.object({provider:c.string(),status:c.string()}),t_=Q({id:"ListDevices",target:"hub",carrier:"device",utterances:["list devices","list my devices","what devices do I have","what devices are online"],slots:[],args:c.object({}),result:c.object({devices:c.array(jL),accounts:c.array(FL)}),speaksResult:!0,cacheSource:"devices",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.accounts.filter(i=>i.status!=="linked"),r=t.length?` ${t.map(i=>`${i.provider} needs re-linking`).join("; ")}.`:"",o=e.devices.length;if(o===0)return`No devices are connected.${r}`;let n=e.devices.filter(i=>i.online).length;return`${o} device${o===1?"":"s"}, ${n} online.${r}`}});var ML=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),n_=Q({id:"ListSessions",target:"hub",carrier:"session",utterances:["list sessions","list my sessions","what sessions do I have","what sessions are running"],slots:[],args:c.object({}),result:c.object({sessions:c.array(ML)}),speaksResult:!0,cacheSource:"sessions",providesSessionCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.sessions.length;if(t===0)return"No sessions are running.";let r=e.sessions.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} session${t===1?"":"s"}: ${r}.`}});var r_=Q({id:"ReadMore",target:"hub",carrier:"more",utterances:["read more","continue reading","keep reading"],slots:[],args:c.object({}),result:yc,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"That's the end of the output."});var o_=Q({id:"ReadOutput",target:"hub",carrier:"output",utterances:["read output","read the output","what's the output","read reply","read the reply","what's the reply","read the last reply","read it","replies","read replies","dev replies","any replies","latest reply"],slots:[],args:c.object({}),result:yc,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"No output yet."});var BL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),i_=Q({id:"RenameBridge",target:"hub",relayMutation:!0,customHandler:!0,carrier:"bridge",utterances:["rename bridge {bridge}","rename a bridge","rename this bridge","rename the bridge","rename this bridge to {name}","rename the bridge to {name}","call the bridge {name}"],slots:[{name:"bridge",type:"BridgeName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string(),bridgeId:c.string().optional()}),result:c.object({bridges:c.array(BL)}),providesBridgeCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var HL=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),a_=Q({id:"RenameSession",target:"hub",relayMutation:!0,customHandler:!0,carrier:"rename",utterances:["rename","rename a session","rename this session","rename the session","rename it","rename {target}","rename session {target}","rename to {name}","rename this session to {name}","call it {name}"],slots:[{name:"target",type:"SessionName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string()}),result:c.object({sessions:c.array(HL)}),providesSessionCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var s_=Q({id:"Return",target:"hub",skillLocal:!0,clearsAttach:!0,carrier:"return",utterances:["return","go back","back to the main menu","main menu","leave the session","leave this session"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"",speak:()=>"Back at the main menu."});var c_=Q({id:"SetBrightness",target:"hub",customHandler:!0,scaffold:!0,carrier:"brightness",utterances:["set brightness of {device} to {level}","set {device} brightness to {level}","dim {device} to {level}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]},{name:"level",type:"AMAZON.NUMBER",elicitationPrompts:["What level, 0 to 100?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"brightness",command:"setBrightness"}],args:c.object({device:c.string(),level:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",level:Number(e.level??0)}),ackSpeech:()=>"",speak:()=>""});var l_=Q({id:"SetTemperature",target:"hub",customHandler:!0,scaffold:!0,carrier:"temperature",utterances:["set temperature of {device} to {temperature}","set {device} temperature to {temperature}","set {device} to {temperature} degrees"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which thermostat?"]},{name:"temperature",type:"AMAZON.NUMBER",elicitationPrompts:["What temperature?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"thermostat",command:"setSetpoint"}],args:c.object({device:c.string(),temperature:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",temperature:Number(e.temperature??0)}),ackSpeech:()=>"",speak:()=>""});var u_=[VS,JS,qS,KS,XS,QS,e_,t_,n_,r_,o_,i_,a_,s_,c_,l_],d_=new Map(u_.map(e=>[e.id,e])),FV=new Map(u_.map(e=>[`${e.id}Intent`,e]));function p_(e){if(e.type==="prompt")return e.text;let t=d_.get(e.id);if(!t?.render)throw new Error(`channel got command "${e.id}" with no render() \u2014 not a session-target command`);return t.render(t.args.parse(e.args))}var ZL=new Set(["item/commandExecution/requestApproval","item/fileChange/requestApproval","item/permissions/requestApproval"]);function m_(e){return{decision:e}}var GL="Added to the current turn.",f_="late verdict dropped",WL="approve? [y/n/a]",dh="Codex restarted before this prompt ran \u2014 please resend.",VL=16e3;function _e(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function g_(e){let t=e.replace(/\\/g,"/").replace(/\/+$/,""),r=t.lastIndexOf("/");return(r>=0?t.slice(r+1):t)||e}function h_(e){return(Array.isArray(e)?e.map(String).join(" "):typeof e=="string"?e:"").replace(/\s+/g," ").trim()}function JL(e){return e.replace(/^```.*\n?/gm,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1")}function qL(e,t){return e.length>t?e.slice(0,t):e}function KL(e){let t=_e(e),r=t.codexErrorInfo,o=typeof r=="string"?r:r&&typeof r=="object"?String(_e(r).kind??_e(r).code??""):"",n=typeof t.message=="string"?t.message:"",i=`${o} ${n}`;return/usagelimitexceeded/i.test(i)?"rateLimited":/contextwindowexceeded/i.test(i)?"contextCritical":"error"}function XL(e,t,r,o,n){let i=_e(t);switch(e){case"item/commandExecution/requestApproval":{let a=h_(i.command),s=typeof i.cwd=="string"&&i.cwd?i.cwd:n,{command:l,cwd:u,...d}=i;return{type:"permission_request",sessionId:r,requestId:o,tool:"Shell",description:`\`${a}\` in ${g_(s)}`,preview:JSON.stringify({command:a,cwd:s,...d})}}case"item/fileChange/requestApproval":{let s=(Array.isArray(i.files)?i.files:[]).map(d=>typeof d=="string"?d:_e(d).path).filter(d=>typeof d=="string"&&d.length>0),l=s.slice(0,3).map(g_).join(", "),u=s.length>3?", \u2026":"";return{type:"permission_request",sessionId:r,requestId:o,tool:"File change",description:`edit ${s.length} file(s): ${l}${u}`,preview:JSON.stringify(i)}}case"item/permissions/requestApproval":{let a=typeof i.mode=="string"?i.mode:typeof i.requestedMode=="string"?i.requestedMode:"unknown";return{type:"permission_request",sessionId:r,requestId:o,tool:"Permissions",description:`escalate sandbox to ${a}`,preview:JSON.stringify(i)}}default:return{type:"permission_request",sessionId:r,requestId:o,tool:"Approval",description:"approve this action?",preview:JSON.stringify(i)}}}var ll=class{sessionId;cwd;steerSupported;newSeq;turnInFlight=!1;owner=null;queue=[];pendingApprovals=new Map;lastApprovalRequestId=null;planReadyFired=!1;pendingSteerAcks=new Set;constructor(t){this.sessionId=t.sessionId,this.cwd=t.cwd,this.steerSupported=t.steerSupported,this.newSeq=t.newSeq}setSteerSupported(t){this.steerSupported=t}handle(t){switch(t.kind){case"hub":return this.onHub(t.msg);case"notification":return this.onNotification(t.method,t.params);case"server-request":return this.onServerRequest(t.id,t.method,t.params);case"local-line":return this.onLocalInput(t.text);case"local-approval":return this.onLocalApproval(t.behavior);case"steer-ok":return this.onSteerOk(t.requestId);case"sigint":return this.turnInFlight?[{kind:"rpc",method:"turn/interrupt"}]:this.endSession();case"teardown":return this.endSession();case"server-exit":return this.onServerExit();default:return[]}}onHub(t){switch(t.type){case"prompt":return this.onHubInput(t.requestId,t.text);case"command":return this.onHubInput(t.requestId,p_(t));case"permission_verdict":return this.onHubVerdict(t.requestId,t.behavior);default:return[]}}onHubInput(t,r){return this.turnInFlight?this.steerSupported?(this.pendingSteerAcks.add(t),[{kind:"rpc",method:"turn/steer",params:{text:r}}]):(this.queue.push({source:"hub",requestId:t,text:r}),[]):this.startTurn({kind:"hub",requestId:t},r)}onLocalInput(t){return this.turnInFlight?this.steerSupported?[{kind:"rpc",method:"turn/steer",params:{text:t}}]:(this.queue.push({source:"local",text:t}),[]):this.startTurn({kind:"local"},t)}startTurn(t,r){this.turnInFlight=!0,this.owner=t;let o=[{kind:"rpc",method:"turn/start",params:{text:r}}];return t.kind==="hub"&&o.push({kind:"render",channel:"voice",text:`[alexa] ${r}`}),o}onSteerOk(t){return this.pendingSteerAcks.has(t)?(this.pendingSteerAcks.delete(t),[this.replyAction(t,GL)]):[]}replyAction(t,r){return{kind:"hub-send",msg:{type:"reply",sessionId:this.sessionId,requestId:t,seq:this.newSeq(),text:r,final:!0}}}statePost(t,r){return{kind:"state-post",state:t,event:`codex-adapter:${r}`}}onNotification(t,r){switch(t){case"turn/started":return this.planReadyFired=!1,[this.statePost("working","turn-started")];case"turn/completed":return this.onTurnCompleted(r);case"item/agentMessage/delta":return this.onAgentDelta(r);case"item/started":return this.onItemStarted(r);case"item/completed":return this.onItemCompleted(r);case"item/commandExecution/outputDelta":return this.onOutputDelta(r);case"turn/plan/updated":return this.onPlanUpdated(r);case"thread/tokenUsage/updated":return this.onTokenUsage(r);default:return[]}}onTurnCompleted(t){let r=_e(t),o=_e(r.turn),n=typeof o.status=="string"?o.status:typeof r.status=="string"?r.status:"",i=o.error??r.error,a=[];if(n==="completed")a.push(this.statePost("finished","turn-completed"));else if(n==="failed"){if(this.owner?.kind==="hub"){let s=_e(i),l=typeof s.message=="string"?s.message:"unknown error";a.push(this.replyAction(this.owner.requestId,`Codex hit an error: ${l}`))}a.push(this.statePost(KL(i),"turn-failed"))}else n==="interrupted"&&a.push(this.statePost("idle","turn-interrupted"));return a.push(...this.finishTurnAndDrain()),a}finishTurnAndDrain(){this.turnInFlight=!1,this.owner=null;let t=this.queue.shift();return t?t.source==="hub"?this.startTurn({kind:"hub",requestId:t.requestId},t.text):this.startTurn({kind:"local"},t.text):[]}onAgentDelta(t){let r=_e(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"agent",text:r}]:[]}onItemStarted(t){let r=_e(_e(t).item);return r.type==="commandExecution"?[{kind:"render",channel:"tool",text:`$ ${h_(r.command)}`}]:[]}onItemCompleted(t){let r=_e(_e(t).item);if(r.type==="agentMessage"){if(this.owner?.kind!=="hub")return[];let o=qL(JL(typeof r.text=="string"?r.text:""),VL);return[this.replyAction(this.owner.requestId,o)]}if(r.type==="commandExecution"){let o=r.exitCode;return[{kind:"render",channel:"tool",text:typeof o=="number"?`(exit ${o})`:"(done)"}]}return[]}onOutputDelta(t){let r=_e(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"tool",text:r}]:[]}onPlanUpdated(t){let r=_e(t).plan;if(!Array.isArray(r))return[];let o=r.map(n=>({kind:"render",channel:"meta",text:`- ${String(n)}`}));return this.planReadyFired||(this.planReadyFired=!0,o.push(this.statePost("planReady","plan-updated"))),o}onTokenUsage(t){let r=_e(t),o=_e(r.tokenUsage),n=_e(o.total),i=_e(o.last),a=m=>typeof m=="number"&&Number.isFinite(m)?m:void 0,s=[],l=a(n.inputTokens),u=a(n.outputTokens);l!==void 0&&u!==void 0&&s.push({kind:"usage-post",inputTokens:l,cachedInputTokens:a(n.cachedInputTokens)??0,outputTokens:u});let d=a(i.totalTokens),p=a(o.modelContextWindow);if(d!==void 0&&p!==void 0&&p>0){let m=Math.round(d/p*1e3)/10;s.push({kind:"context-post",pct:m,usedTokens:d,windowTokens:p})}return s}onServerRequest(t,r,o){if(!ZL.has(r))return[];let n=`codex-approval-${this.newSeq()}`,i=XL(r,o,this.sessionId,n,this.cwd);this.pendingApprovals.set(n,{serverRequestId:t}),this.lastApprovalRequestId=n;let a=r==="item/permissions/requestApproval"?"sandboxEscalation":"needs_permission";return[{kind:"hub-send",msg:i},this.statePost(a,"approval-requested"),{kind:"render",channel:"meta",text:WL}]}onHubVerdict(t,r){let o=r==="allow"?"accept":"decline",n={kind:"render",channel:"voice",text:r==="allow"?"[alexa] approved":"[alexa] denied"};return this.resolveApproval(t,o,n)}onLocalApproval(t){let r=this.lastApprovalRequestId;if(!r)return[{kind:"render",channel:"meta",text:f_}];let o=t==="allow"?"accept":t==="allow-session"?"acceptForSession":"decline",n=t==="allow"?"approved":t==="allow-session"?"approved for session":"denied";return this.resolveApproval(r,o,{kind:"render",channel:"meta",text:n})}resolveApproval(t,r,o){let n=this.pendingApprovals.get(t);if(!n)return[{kind:"render",channel:"meta",text:f_}];this.pendingApprovals.delete(t),this.lastApprovalRequestId===t&&(this.lastApprovalRequestId=null);let i=r==="decline";return[{kind:"rpc-respond",id:n.serverRequestId,result:m_(r)},this.statePost(i?"permissionDenied":"working",i?"approval-denied":"approval-allowed"),o]}endSession(){let t=[...this.pendingApprovals.values()].map(r=>({kind:"rpc-respond",id:r.serverRequestId,result:m_("decline")}));return this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),[this.statePost("ended","teardown"),...t,{kind:"exit"}]}onServerExit(){let t=[];this.turnInFlight&&t.push(this.statePost("error","server-exit"));for(let r of this.queue)r.source==="hub"&&t.push(this.replyAction(r.requestId,dh));return this.queue=[],this.turnInFlight=!1,this.owner=null,this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),t}};import YL from"node:path";function v_(e,t){let r=YL.basename(e)||"session";return{id:`${r}@${t}+codex`,name:`${r} codex (${t})`}}function y_(e){let{sub:t,...r}=e;return{...r,voice:!0,agent:"codex",...t?{sub:t}:{}}}var Ji=class extends Error{code;constructor(t,r){super(`codex app-server error ${t}: ${r}`),this.name="AppServerError",this.code=t}};function ph(e,t){let r=1,o=!1,n="",i=new Map,a=[],s=[],l=[];function u(_){o||e.write(`${JSON.stringify(_)}
266
+ `)}function d(_){let P=_.trim();if(!P)return;let C;try{C=JSON.parse(P)}catch{return}if(!C||typeof C!="object"||Array.isArray(C))return;let E=C,D=E.id,G=typeof D=="number"||typeof D=="string",ae=E.method;if(typeof ae=="string"){if(G)for(let X of s)X(D,ae,E.params);else for(let X of a)X(ae,E.params);return}if(G&&("result"in E||"error"in E)){if(typeof D!="number")return;let X=i.get(D);if(!X)return;if(i.delete(D),"error"in E&&E.error){let be=E.error,Ee=typeof be.code=="number"?be.code:-32603,z=typeof be.message=="string"?be.message:"unknown app-server error";X.reject(new Ji(Ee,z))}else X.resolve(E.result);return}}function p(_){n+=_;let P;for(;(P=n.indexOf(`
267
+ `))>=0;){let C=n.slice(0,P);n=n.slice(P+1),d(C)}}function m(){t.removeListener("data",p),t.removeListener("end",y),t.removeListener("error",k),e.removeListener("error",k)}function f(_){m();let P=_??new Error("codex app-server stream closed");for(let C of i.values())C.reject(P);i.clear()}function g(_){if(!o){o=!0,f(_);for(let P of l)P(_)}}function y(){g()}function k(_){g(_)}return t.setEncoding("utf8"),t.on("data",p),t.on("end",y),t.on("error",k),e.on("error",k),{request(_,P){if(o)return Promise.reject(new Error("codex app-server client is closed"));let C=r++;return new Promise((E,D)=>{i.set(C,{resolve:E,reject:D}),u({id:C,method:_,params:P})})},notify(_,P){u({method:_,params:P})},respond(_,P){u({id:_,result:P})},onNotification(_){a.push(_)},onServerRequest(_){s.push(_)},onClose(_){l.push(_)},close(){o||(o=!0,f())}}}function iU(e,t){return QL(e.file,[...e.argsPrefix,"app-server"],{env:t,stdio:["pipe","pipe","inherit"]})}function qi(e){if(process.platform==="win32"&&e.pid){eU("taskkill",["/pid",String(e.pid),"/T","/F"]);return}try{e.kill?.("SIGTERM")}catch{}}function aU(e){return new Promise(t=>setTimeout(t,e))}function sU(e,t){return{...t?{threadId:t}:{},input:[{type:"text",text:e}]}}function cU(e,t,r){if(e==="turn/start"||e==="turn/steer"){let o=t,n=typeof o?.text=="string"?o.text:"";return sU(n,r)}return e==="turn/interrupt"?r?{threadId:r}:void 0:t}function hh(e){if(!e||typeof e!="object")return;let t=e;if(typeof t.threadId=="string"&&t.threadId)return t.threadId;if(typeof t.thread_id=="string"&&t.thread_id)return t.thread_id;let r=t.thread;if(r&&typeof r=="object"){let o=r.id;if(typeof o=="string"&&o)return o}}function lU(e){return hh(e)!==void 0?!1:!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0}function x_(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"&&Array.isArray(e.threads))return e.threads}function uU(e){let t=x_(e);if(!t)return[];let r=[];for(let o of t){if(!o||typeof o!="object")continue;let n=o,i=typeof n.threadId=="string"?n.threadId:typeof n.thread_id=="string"?n.thread_id:typeof n.id=="string"?n.id:void 0;if(!i)continue;let a=typeof n.cwd=="string"?n.cwd:typeof n.workingDirectory=="string"?n.workingDirectory:typeof n.path=="string"?n.path:void 0,s=n.updatedAt??n.lastActiveAt??n.createdAt,l=typeof s=="number"?s:typeof s=="string"?Date.parse(s):void 0;r.push({id:i,cwd:a,updatedAt:l!==void 0&&Number.isFinite(l)?l:void 0})}return r}function dU(e){return x_(e)!==void 0?!1:!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0}function pU(e,t){let r=uU(e).filter(o=>o.cwd===t);if(r.length!==0)return r.sort((o,n)=>(n.updatedAt??0)-(o.updatedAt??0)),r[0]?.id}function mU(e){switch(e.trim().toLowerCase()){case"y":case"yes":return"allow";case"a":case"always":return"allow-session";case"n":case"no":return"deny";default:return null}}var Ki={dim:"\x1B[2m",italic:"\x1B[3m",reset:"\x1B[0m",cyan:"\x1B[36m"};function mh(e,t,r){return r?`${e}${t}${Ki.reset}`:t}var gh=class{constructor(t){this.out=t;this.colorEnabled=!!t.isTTY&&!process.env.NO_COLOR}out;atLineStart=!0;colorEnabled;render(t,r){if(t==="agent"){this.out.write(r),this.atLineStart=r.endsWith(`
268
+ `);return}if(t==="tool"){this.out.write(mh(Ki.dim,r,this.colorEnabled)),this.atLineStart=r.endsWith(`
269
+ `);return}if(this.atLineStart||this.out.write(`
270
+ `),t==="meta")this.out.write(`${mh(`${Ki.dim}${Ki.italic}`,`\u2022 ${r}`,this.colorEnabled)}
271
+ `);else{let o=/^(\[[^\]]+\]\s?)/.exec(r),n=o?`${mh(Ki.cyan,o[1],this.colorEnabled)}${r.slice(o[1].length)}`:r;this.out.write(`${n}
272
+ `)}this.atLineStart=!0}};function fh(e){return new Promise(t=>{let r="";try{r=nU(e.tokenFile,"utf8").trim()}catch{}let o=JSON.stringify(e.body),n=rU({host:"127.0.0.1",port:e.hubPort,path:e.path,method:"POST",headers:{"content-type":"application/json","content-length":Buffer.byteLength(o),"x-bridge-hub-token":r},timeout:2e3},i=>{i.on("data",()=>{}),i.on("end",()=>t())});n.on("timeout",()=>{n.destroy(),t()}),n.on("error",()=>t()),n.end(o)})}function To(e){return e instanceof Error?e.message:String(e)}function fU(e){if(e.kind!=="hub")return;let t=e.msg;return t.type==="prompt"||t.type==="command"?t.requestId:void 0}async function Xi(e,t,r){let o=await e.request("thread/start",{cwd:t});return lU(o)&&r("thread/start returned a result but no recognizable thread id (threadId/thread_id/thread.id) \u2014 codex resume may not work"),hh(o)}async function k_(e,t,r,o){try{let n=await e.request("thread/resume",{threadId:r});return hh(n)??r}catch{return o("codex thread/resume was rejected \u2014 starting a fresh thread instead"),Xi(e,t,o)}}async function gU(e,t,r){let o=await e.request("thread/list",{cwd:t});if(dU(o))return r("thread/list returned a result but no recognizable thread list \u2014 starting a fresh thread"),Xi(e,t,r);let n=pU(o,t);return n?(r(`resuming the most recent codex thread for this cwd (${n})`),k_(e,t,n,r)):(r("no existing codex thread found for this cwd \u2014 starting a fresh thread"),Xi(e,t,r))}var b_=5,hU=1e3,vU=3e4;async function w_(e){let t=e.codexCmd??$r(),r=e.clientVersion??"0.0.0",o=e.voice??ra({isDevBuild:Ct()===null}),n=e.spawn??iU,i=e.delay??aU,a=e.stdin??process.stdin,s=e.stdout??process.stdout,l=new gh(s),u=0;function d(){return u+=1,{...process.env,ACB_CODEX_ADAPTER:"1",ACB_CODEX_GENERATION:String(u)}}let p;try{p=n(t,d())}catch(C){return l.render("meta",`failed to launch codex: ${To(C)}`),1}p.on("error",C=>l.render("meta",`codex process error: ${To(C)}`));let m=ph(p.stdin,p.stdout),f=null,g=C=>(l.render("meta",C),m.close(),qi(p),f&&ue(f),1),y,k,_,P={};try{await m.request("initialize",{clientInfo:{name:"acbridge",title:"AC Bridge",version:r}}),m.notify("initialized",{});let C=E=>l.render("meta",E);y=e.resume?await gU(m,e.cwd,C):await Xi(m,e.cwd,C),_=tU(),k=v_(e.cwd,e.machine),f=Gl(_),P=y_({id:k.id,name:k.name,hubPort:e.hubPort,hubTokenFile:e.hubTokenFile,claudeSessionId:_,cwd:e.cwd,sub:e.sub}),ge(f,JSON.stringify({...P,...y?{codexThreadId:y}:{}}))}catch(C){return g(`codex bring-up failed: ${To(C)}`)}return new Promise(C=>{let E=!1,D=0,G=()=>D+=1,ae=new ll({sessionId:k.id,cwd:e.cwd,steerSupported:!0,newSeq:G}),X=!1,be=!1,Ee=[];function z(M){if(be){Ee.push(M);return}Vt(M)}function vt(){let M=Ee.splice(0,Ee.length);for(let ee of M){if(ee.kind!=="hub")continue;let j=ee.msg;j.type!=="prompt"&&j.type!=="command"||et.send({type:"reply",sessionId:k.id,requestId:j.requestId,seq:G(),text:dh,final:!0})}}let et=WS({port:e.hubPort,tokenFile:e.hubTokenFile,hello:()=>o?{type:"register",sessions:[{id:k.id,name:k.name,cwd:e.cwd,online:!0,agent:"codex"}],claudeSessionId:_}:null,onMessage:M=>z({kind:"hub",msg:M})}),Oo=oU({input:a,output:s,terminal:!!a.isTTY}),$n=null;function vh(M){E||(E=!0,$n&&(qi($n),$n=null),m.close(),et.close(),qi(p),f&&ue(f),Oo.close(),C(M))}function Yi(M,ee){fh({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/state",body:{sessionId:k.id,claudeSessionId:_,cwd:e.cwd,ts:Date.now(),state:M,event:ee,agent:"codex"}})}function U_(M,ee,j){if(M===void 0)return;let Ne={pct:M};ee!==void 0&&(Ne.usedTokens=ee),j!==void 0&&(Ne.windowTokens=j),fh({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/context",body:{sessionId:k.id,claudeSessionId:_,cwd:e.cwd,ts:Date.now(),agent:"codex",context:Ne}})}function z_(M){y&&fh({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/usage",body:{sessionId:k.id,claudeSessionId:_,codexThreadId:y,cwd:e.cwd,ts:Date.now(),agent:"codex",inputTokens:M.inputTokens,cachedInputTokens:M.cachedInputTokens,outputTokens:M.outputTokens}})}function j_(){f&&ge(f,JSON.stringify({...P,...y?{codexThreadId:y}:{}}))}function yh(M,ee){for(let j of M)switch(j.kind){case"rpc":{let Ne=j.method,No=cU(Ne,j.params,y);m.request(Ne,No).then(()=>{if(Ne!=="turn/steer")return;let kr=fU(ee);kr&&Vt({kind:"steer-ok",requestId:kr})},kr=>{if(Ne==="turn/steer"&&kr instanceof Ji&&kr.code===-32601){ae.setSteerSupported(!1),yh(ae.handle(ee),ee);return}l.render("meta",`codex error (${Ne}): ${To(kr)}`)});break}case"rpc-respond":X=!1,m.respond(j.id,j.result);break;case"hub-send":j.msg.type==="permission_request"&&(X=!0),et.send(j.msg);break;case"state-post":Yi(j.state,j.event);break;case"context-post":U_(j.pct,j.usedTokens,j.windowTokens);break;case"usage-post":z_(j);break;case"render":l.render(j.channel,j.text);break;case"exit":vh(0);break;default:break}}function Vt(M){yh(ae.handle(M),M)}let pl=!1,Qi,Do=0;function bh(){Do+=1;let M=Do;p.on("exit",ee=>{M===Do&&(Qi=ee,ml())}),m.onClose(()=>{M===Do&&(Qi!==void 0?ml():setTimeout(()=>{M===Do&&ml()},25))}),m.onNotification((ee,j)=>Vt({kind:"notification",method:ee,params:j})),m.onServerRequest((ee,j,Ne)=>Vt({kind:"server-request",id:ee,method:j,params:Ne}))}async function F_(){let M=n(t,d());$n=M,M.on("error",j=>l.render("meta",`codex process error: ${To(j)}`));let ee=ph(M.stdin,M.stdout);try{await ee.request("initialize",{clientInfo:{name:"acbridge",title:"AC Bridge",version:r}}),ee.notify("initialized",{});let j=No=>l.render("meta",No),Ne=y?await k_(ee,e.cwd,y,j):await Xi(ee,e.cwd,j);return $n=null,{child:M,client:ee,threadId:Ne}}catch(j){throw $n=null,ee.close(),qi(M),j}}async function M_(){let M=hU,ee=0;for(;;){if(await i(M),E)return;try{let j=await F_();if(E){j.client.close(),qi(j.child);return}p=j.child,m=j.client,pl=!1,Qi=void 0,X=!1,bh(),j.threadId!==void 0&&j.threadId!==y&&(y=j.threadId,j_()),l.render("meta","codex reconnected \u2014 session resumed"),Yi("resumed","codex-adapter:respawned"),be=!1;let Ne=Ee.splice(0,Ee.length);for(let No of Ne)Vt(No);return}catch(j){if(ee+=1,l.render("meta",`codex respawn attempt ${ee} failed: ${To(j)}`),E)return;if(ee>=b_){Yi("error","codex-adapter:respawn-gave-up"),l.render("meta",`codex gave up respawning after ${b_} consecutive failed attempts \u2014 ending session`),vt(),vh(1);return}M=Math.min(M*2,vU)}}}function ml(){if(pl||E)return;pl=!0;let M=Qi??null;Vt({kind:"server-exit",code:M}),l.render("meta",`codex exited unexpectedly (code ${M??"unknown"}) \u2014 attempting to respawn`),X=!1,be=!0,M_()}bh(),Oo.on("line",M=>{let ee=M.trim();if(X){let j=mU(ee);if(j){Vt({kind:"local-approval",behavior:j});return}}z({kind:"local-line",text:ee})}),Oo.on("SIGINT",()=>Vt({kind:"sigint"})),Oo.on("close",()=>{E||Vt({kind:"teardown"})}),Yi("started","codex-adapter:started")})}function SU(e){let t={hold:e.includes("--hold"),agent:"claude",resume:e.includes("--resume")},r=e.indexOf("--agent");if(r>=0){let o=e[r+1];o==="claude"||o==="codex"?t.agent=o:t.bad=`invalid --agent: ${o??"(none)"} (use claude | codex)`}return!t.bad&&t.resume&&t.agent!=="codex"&&(t.bad="--resume requires --agent codex"),t}function _U(e,t,r){let o={...r,BRIDGE_SESSION_ID:t.sessionId,BRIDGE_SESSION_NAME:t.sessionName,BRIDGE_HUB_PORT:String(t.hubPort)};return delete o.ELECTRON_RUN_AS_NODE,{file:e.file,args:[...e.argsPrefix,"--session-id",t.claudeSessionId,"--channels","plugin:alexa@bridge"],env:o}}function $U(e){let{sub:t,...r}=e;return{...r,voice:!0,...t?{sub:t}:{}}}async function IU(){h("[bridge] session closed \u2014 press Enter to exit\u2026"),await new Promise(e=>{let t=wU({input:process.stdin,output:process.stdout});t.question("",()=>{t.close(),e()})})}var S_="https://github.com/openai/codex#install";function AU(e){return __(e.file,[...e.argsPrefix,"--version"],{encoding:"utf8",timeout:5e3}).status===0}function EU(e={}){let t;try{t=(e.resolveCodex??$r)()}catch{return{ok:!1,message:`codex CLI not found \u2014 install it: ${S_}`}}return(e.probeCodex??AU)(t)?(e.codexLoggedIn??la)()?{ok:!0,codexCmd:t}:{ok:!1,message:"Run `codex login` first."}:{ok:!1,message:`codex CLI not found \u2014 install it: ${S_}`}}async function $_(e=[],t={}){let r=SU(e);if(r.bad)return b(r.bad),2;if(!(t.voice??Qe()))return b("voice sessions are turned off in this build."),h("Your devices and Profiles are unaffected \u2014 `acbridge start` keeps the bridge running."),h(`Launch the agent yourself in this folder: \`${r.agent}\` \u2014 its hooks still drive your Profiles.`),1;let{hold:o,agent:n}=r,i=ne(),a=t.preflightAccount??ho,s=t.ensureFreshToken??Tt,l=t.ensureHub??it,u=t.hubRelease??$c,d=t.readActiveUser??$e,p=t.holdForEnter??IU,m=await a();if(!m.ok)return b(m.message),m.exitCode;await s(i.relayUrl);let{holderId:f}=await l({kind:"run"});if(n==="codex"){let z=!1,vt=async()=>{if(!z&&(z=!0,f))try{await u(f)}catch{}};process.once("SIGINT",()=>{vt()}),process.once("SIGTERM",()=>{vt()});let et=(t.codexPreflight??EU)();if(!et.ok)return b(et.message),await vt(),1;h(`Launching Codex with the Alexa channel \u2014 cwd: ${process.cwd()}`);let $n=await(t.runCodexAdapter??w_)({cwd:process.cwd(),machine:i.machine,hubPort:i.hubPort,hubTokenFile:sg(),sub:d()?.sub,codexCmd:et.codexCmd,clientVersion:Ct()??void 0,voice:!0,resume:r.resume});return await vt(),o&&await p(),$n}for(let z of Ec({...t.ensurePluginInstalled?{ensurePluginInstalled:t.ensurePluginInstalled}:{},...t.ensureStatusline?{ensureStatusline:t.ensureStatusline}:{}}))(z.level==="info"?h:U)(z.message);let g=ul.basename(process.cwd())||"session",y=`${g}@${i.machine}`,k=`${g} (${i.machine})`,_=yU(),P=ul.join(W,"sessions");bU(P,{recursive:!0});let C=ul.join(P,`${_}.json`),E=process.cwd(),D=ul.join(kU.homedir(),".claude","projects",E.replace(/[^A-Za-z0-9]/g,"-"),`${_}.jsonl`),G=sg();xU(C,JSON.stringify($U({id:y,name:k,hubPort:i.hubPort,hubTokenFile:G,claudeSessionId:_,transcriptPath:D,cwd:E,sub:d()?.sub})),{mode:384});let ae=!1,X=async()=>{if(!ae&&(ae=!0,ue(C),f))try{await u(f)}catch{}};process.once("SIGINT",()=>{X()}),process.once("SIGTERM",()=>{X()}),h(`Launching Claude with the Alexa channel \u2014 session: ${y}`);let be=_U((t.resolveClaude??An)(),{sessionId:y,claudeSessionId:_,sessionName:k,hubPort:i.hubPort},process.env),Ee=__(be.file,be.args,{stdio:"inherit",env:be.env});return await X(),o&&await p(),Ee.status??0}var PU="Usage: acbridge scan [--json] [--timeout <seconds>]",CU=1e3,TU=e=>Dk(e);function RU(e){let t={json:!1,timeoutMs:3e4};for(let r=0;r<e.length;r++){let o=e[r];if(o==="--json")t.json=!0;else if(o==="--timeout"||o?.startsWith("--timeout=")){let n=o==="--timeout"?e[++r]:o.slice(10),i=Number(n);!Number.isFinite(i)||i<=0?t.bad=`invalid --timeout: ${n??"(none)"}`:t.timeoutMs=Math.min(120,Math.max(5,Math.round(i)))*1e3}else t.bad=`unknown option: ${o??""}`}return t}async function P_(e){let t=RU(e);if(t.bad)return b(t.bad),h(PU),2;if(t.json&&we(!0),!await Te()){let i=Bn();if(!i.ok)return b(i.message),3;if(t.json)return b(De()),1;try{await it({kind:"cli"})}catch(a){return b(`couldn't start the hub: ${a.message}`),h("check ~/.claude-bridge/hub.log, or start it yourself with `acbridge daemon` and re-run"),1}}let r=await Z("/local/scan",{method:"POST"});if(r.hubOffline)return b(De()),1;if(r.status!==200||!r.body?.scanId)return b(`hub answered HTTP ${r.status} starting the scan \u2014 token mismatch? restart the hub`),1;let{session:o,expired:n}=await OU(r.body.scanId,t);return o?t.json?(console.log(JSON.stringify(o)),o.status==="failed"?1:0):(n&&h(Se("(scan session expired mid-poll \u2014 showing the hub's last-known devices)")),o.status==="failed"?(b(`scan failed: ${o.error??"unknown error"}`),1):(o.status==="running"&&U("scan still running at --timeout \u2014 showing partial results (re-run `acbridge scan` for the final list)"),zU(o.devices,o.env,o.accountDevices),await MU(o.devices),0)):(b(De()),1)}async function OU(e,t){let r=Date.now()+t.timeoutMs,o=!t.json&&process.stdout.isTTY,n=null;!t.json&&!o&&h("scanning\u2026");try{for(;;){let i=await Z(`/local/scan/${e}`);if(i.hubOffline)return{session:n,expired:!1};if(i.status===404){let a=await Z("/local/discovered");return a.status===200&&a.body?{session:DU(e,a.body),expired:!0}:{session:n,expired:!0}}if(i.status===200&&i.body&&(n=i.body,o&&process.stdout.write(`\r\u2022 scanning\u2026 ${n.devices.length} device(s) found`),n.status!=="running"))return{session:n,expired:!1};if(Date.now()>=r)return{session:n,expired:!1};await new Promise(a=>setTimeout(a,CU))}}finally{o&&process.stdout.write("\r\x1B[2K")}}var DU=(e,t)=>({id:e,status:"done",startedAt:t.updatedAt,finishedAt:t.updatedAt,devices:t.devices,...t.accountDevices?{accountDevices:t.accountDevices}:{},env:t.env}),NU={ready:0,ecosystems:1,"needs-setup":2,unidentified:3,infrastructure:4},LU={ready:"Ready",ecosystems:"Link account","needs-setup":"Needs setup",unidentified:"Unknown",infrastructure:"Infrastructure"};function I_(e){return NU[fo(e)]}function UU(e){return LU[fo(e)]}function dl(e){let t=[e.identity.manufacturer,e.identity.model].filter(Boolean).join(" ");return e.identity.name??(t||e.identity.hint||e.addresses.hostname||e.addresses.ip)}function A_(e){if(e.alreadyLinked)return`connected \u2713 (via ${e.alreadyLinked.provider})`;if(e.bucket==="connect-now"&&e.localProtocol)return`acbridge connect ${e.discoveredId}`;if(e.bucket==="link-ecosystem"){let t=e.suggestedProvider;return t==="homeassistant"?"acbridge link home-assistant":t==="mqtt"?`acbridge link mqtt --host ${e.addresses.ip}`:t==="hue"||t==="smartthings"?`acbridge link ${t}`:"link via the app"}return"\u2014"}function E_(e){let t=jU(e);if(t.length!==0){h(""),h(Se(t[0]));for(let r of t.slice(1))h(r)}}function zU(e,t,r){let o=Ck(t);if(o&&t.interop==="windows-arp"?U("WSL detected \u2014 mDNS/broadcast limited; using the Windows neighbor table for ARP discovery"):o&&t.wsl?U("WSL detected \u2014 LAN scan degraded (mDNS/broadcast limited); results may be incomplete"):o&&U("multicast self-test failed \u2014 mDNS results may be missing"),e.length===0){o&&t.wsl?h("0 devices found \u2014 expected to be incomplete under WSL (see `acbridge doctor`)."):o?h("0 devices found \u2014 the multicast self-test failed, so this scan is expected to be incomplete (see `acbridge doctor`)."):Tk(t,e.length)?h(`No devices found. ${Rk}`):h("No devices found. Devices must be on the same network/VLAN; Wi-Fi isolation limits discovery."),E_(r);return}let n=[...e].sort((m,f)=>I_(m)-I_(f)||dl(m).localeCompare(dl(f))),i=n.map(m=>[C_(dl(m),28),m.expectedType??"\u2014",m.addresses.ip,m.addresses.mac??"\u2014",UU(m),A_(m)]),a=["NAME","TYPE","IP","MAC","STATUS","ACTION"],s=a.map((m,f)=>Math.max(m.length,...i.map(g=>g[f].length))),l=m=>m.map((f,g)=>f.padEnd(s[g])).join(" ").trimEnd();h(Se(l(a)));for(let m of i)h(l(m));h("");let u=new Map;for(let m of n)u.set(fo(m),(u.get(fo(m))??0)+1);let d=[["ready","ready"],["ecosystems","ecosystem"],["needs-setup","need setup"],["unidentified","unidentified"],["infrastructure","infrastructure"]].map(([m,f])=>u.get(m)?`${u.get(m)} ${f}`:null).filter(m=>m!==null);h(`${e.length} device(s)${d.length>0?` \u2014 ${d.join(" \xB7 ")}`:""}`);let p=n.filter(m=>m.identity.hint!==void 0&&A_(m)==="\u2014"&&fo(m)!=="unidentified");if(p.length>0){h(""),h(Se("Notes:"));for(let m of p)h(` \u2022 ${dl(m)} (${m.addresses.ip}): ${m.identity.hint}`)}E_(r)}var C_=(e,t)=>e.length>t?`${e.slice(0,t-1)}\u2026`:e;function jU(e){let t=e??[];if(t.length===0)return[];let r=[`Known from your accounts (${t.length}):`];for(let o of t){let n=o.state==="cloud"?`added \u2014 reads over the ${o.provider} cloud, so it never appears in a scan`:`in your ${o.provider} account \u2014 not seen on this network`;r.push(` \u2022 ${FU(o)}: ${n}`)}return r}var FU=e=>C_(e.name,40);async function MU(e){if(!e.some(TU))return;let t=await Z("/local/config");t.status!==200||t.body?.autoConnect!=="unset"||(h(""),A("Tip: `acbridge connect --auto on` auto-connects open-protocol lights/plugs (never locks, cameras, or doors)."))}import{existsSync as HU}from"node:fs";import{dirname as ZU}from"node:path";function BU(e=W){return ga(Er(Pr(e)))}function T_(e){return kv(Rr,{home:e?.home,configFile:e?.configFile,env:e?.env,nodeCommand:e?.nodeCommand??BU(e?.bridgeDir)})}function GU(e){return e?"Setup complete. Run `acbridge run` in any project to start a voice-driven session.":"Setup complete. `acbridge start` runs the bridge; launch `claude` in any project \u2014 its hooks drive your Profiles."}async function R_(e={}){let t=e.installPlugin??Ic,r=e.applyManaged??fw,o=e.applyFirewall??(()=>pw()),n=e.ensureStatusline??Ac,i=e.ensureCodexHooks??T_,a=e.voice??Qe(),s=(e.codexInstalled??(()=>HU(ZU(fa()))))(),l=(e.claudeInstalled??zh)();if(h(a?`Setting up the Alexa bridge on this machine\u2026
273
+ `:`Setting up AC Bridge on this machine\u2026
274
+ `),l)try{Y("installing the alexa@bridge plugin (bound to this install)");let u=t();A(u.marketplaceRepointed?"plugin marketplace re-pointed to this install + installed":u.pluginReinstalled?"plugin refreshed from this install":"plugin already current")}catch(u){if(!s)return b(`plugin install failed: ${u.message}`),1;U(`plugin install skipped (${u.message}) \u2014 no Claude Code here; continuing for Codex.`)}else{let u=ia(process.platform).manualCommand;if(!s)return b(`no coding agent found \u2014 setup wires the Claude Code plugin and Codex hooks. Install Claude Code (\`${u}\`) or Codex, then re-run \`acbridge setup\`. Device control works without either.`),1;U(`plugin install skipped (claude CLI not found \u2014 install it: ${u}) \u2014 no Claude Code here; continuing for Codex.`)}try{Y(a?`allowlisting the channel in ${Kn()}`:`checking managed settings in ${Kn()}`);let u=r();u.replacedDefaultAllowlist&&U("allowedChannelPlugins was unset \u2014 setting it REPLACES Anthropic's default channel list. If you also use Telegram/Discord channels, add them to the managed-settings file too."),A(u.changed?`managed settings written${u.usedSudo?" (via sudo)":""}`:"managed settings already current")}catch(u){if(!s)return b(`managed settings: ${u.message}`),h("Write it manually if needed \u2014 `acbridge doctor` prints the exact path + expected JSON."),1;U(`managed settings skipped (${u.message}) \u2014 not needed for Codex-only.`)}try{Y("adding the LAN device-scan firewall rule");let u=o();u.status==="nothing-to-do"?A("no active firewall detected \u2014 nothing to add"):u.status==="needs-elevation"?(U("firewall rule not applied (declined or unavailable)."),u.manualCommand&&h(`Run it manually if device scanning misses devices:
275
+ ${u.manualCommand}`)):(A(u.changed?"firewall rule added":"firewall rule already present"),u.userNote&&h(u.userNote))}catch(u){U(`firewall rule skipped: ${u.message}`)}try{Y("installing the statusline tee (context + usage readings)");let u=n();A(u.enabled?u.changed?"statusline tee installed (any existing statusline is chained)":"statusline tee already current":"statusline tee disabled by config \u2014 skipped")}catch(u){U(`statusline tee skipped: ${u.message}`)}try{Y("installing Codex hooks (session-state signals for OpenAI Codex CLI)");let u=i();u.skipped?A("Codex not detected (no ~/.codex) \u2014 hooks skipped"):u.corrupt?U("~/.codex/hooks.json is unparseable \u2014 fix or delete it, then re-run setup."):u.enabled?u.changed?(A("Codex hooks installed (any existing hooks are preserved)"),h("Codex hooks installed \u2014 run /hooks once inside Codex to review and trust the AC Bridge hook.")):A("Codex hooks already current"):A("Codex hooks disabled by config \u2014 skipped")}catch(u){U(`Codex hooks skipped: ${u.message}`)}return h(""),A(GU(a)),0}function WU(e){return e.voice&&e.hubUp&&e.signedIn}function VU(e){let t=[`relay: ${e.relayUrl}`,`machine: ${e.machine}`,`version: ${e.version??"dev"}`,`signed in: ${e.signedIn?e.paired?"yes (paired)":"yes":"no"}`,`hub: ${e.hubUp?"running":"stopped"}`];if(e.update&&t.push(`update: ${e.update.latest} available (you have ${e.version??"dev"})`),e.accountMismatch&&t.push("account: signed-in account does not match this machine's credential \u2014 run `acbridge logout` then `acbridge login`"),e.daemonPid!==void 0&&t.push(`daemon: running (pid ${e.daemonPid})`),e.relayLink&&t.push(`relay link: ${e.relayLink.connected?"connected":e.relayLink.code===4426?"refused \u2014 app update required":"down"}`),e.session&&t.push(e.session.active?`session: active \u2014 ${[e.session.owner?`owner ${e.session.owner}`:null,`${e.session.touched} touched`,e.session.revertOnStop?"revert on stop":"no revert"].filter(Boolean).join(", ")}`:"session: none"),e.sessions!==null&&t.push(`sessions: ${e.sessions}`),e.entitlement&&(t.push(`plan: ${e.entitlement.plan}`),t.push(`capture: telemetry=${e.entitlement.capture.telemetry} transcripts=${e.entitlement.capture.transcripts}`)),e.signedIn)if(e.entitlementFile==="absent")t.push("entitlement file: absent (capture off, fail-closed)");else if(e.entitlementFile==="unreadable")t.push("entitlement file: unreadable (capture off, fail-closed)");else{let n=e.entitlementFile.ageHours;t.push(`entitlement file: ${n.toFixed(1)}h old (${n<=24?"fresh":"STALE \u2014 capture off, fail-closed"})`)}let r;if(e.sessions!==null)try{r=JSON.parse(e.sessions)}catch{r=e.sessions}let o={relayUrl:e.relayUrl,machine:e.machine,version:e.version??"dev",...e.update?{updateAvailable:!0,latestVersion:e.update.latest}:{},signedIn:e.signedIn,paired:e.paired,hub:e.hubUp?"running":"stopped",...e.accountMismatch?{accountMismatch:!0}:{},...e.daemonPid!==void 0?{daemonPid:e.daemonPid}:{},...e.relayLink?{relayLink:e.relayLink}:{},...e.session?{session:e.session}:{},...e.sessions!==null?{sessions:r}:{},...e.entitlement?{plan:e.entitlement.plan,capture:e.entitlement.capture}:{},...typeof e.entitlementFile=="object"?{entitlementFile:{ageHours:e.entitlementFile.ageHours,fresh:e.entitlementFile.ageHours<=24}}:{}};return{lines:t,exitCode:e.hubUp?0:1,json:o}}async function O_(e=[]){let t=e.includes("--json");t&&we(!0);let r=ne(),o=Pn(),n=o.state==="ok"?o.token:"",i=!!n,a=o.state==="mismatch",s=!!O(he().refreshFile)?.trim(),l=await Te(),u=WU({voice:Qe(),hubUp:l,signedIn:i}),d=u?await ay(n):null;u&&d===null&&U("could not reach the relay /sessions endpoint");let p=i?await Ot(n):null,m=p?{plan:p.plan,capture:{telemetry:p.capture.telemetry,transcripts:p.capture.transcripts}}:null,f="absent",g=i?kt():null,y=g?O(g.entitlementFile):null;if(y)try{let z=JSON.parse(y);f={ageHours:(Date.now()-(z.fetchedAt??0))/36e5}}catch{f="unreadable"}let k=O(Ve),_=k?Number(k):0,P=_>0&&go({pid:_})?_:void 0,C,E=O(ey);if(l&&E)try{let z=JSON.parse(E);typeof z.connected=="boolean"&&(C={connected:z.connected,...typeof z.code=="number"?{code:z.code}:{}})}catch{}let D=Mn(),G=D.version,ae=Di(G,Tc(),process.platform,D.channel??"app"),X=ae.state==="update"?{latest:ae.latest}:void 0,be;if(l){let z=await Z("/local/session",{method:"GET",timeoutMs:3e3});!z.hubOffline&&z.status===200&&z.body&&(be={active:z.body.active,...z.body.owner?{owner:z.body.owner}:{},touched:z.body.touched,revertOnStop:z.body.revertOnStop})}let Ee=VU({relayUrl:r.relayUrl,machine:r.machine,version:G,...X?{update:X}:{},signedIn:i,paired:s,hubUp:l,sessions:d,entitlement:m,entitlementFile:f,...a?{accountMismatch:!0}:{},...P!==void 0?{daemonPid:P}:{},...C?{relayLink:C}:{},...be?{session:be}:{}});if(t)xe(Ee.json);else for(let z of Ee.lines)h(z);return Ee.exitCode}var JU=["tuya","meross","ewelink","nanoleaf","govee","esphome"];async function D_(e){let t=e[0];if(t===void 0||!bc.safeParse(t).success)return b(`usage: acbridge unlink <${JU.join(" | ")}>`),2;let r=await Z(`/local/${t}/unlink`,{method:"POST"});return r.hubOffline?(b(De()),1):r.status===200&&r.body?.ok?(A(`removed the ${t} account \u2014 its keys and devices are gone from this machine`),r.body.note&&h(r.body.note),0):(b(r.body?.error??`hub answered HTTP ${r.status}`),1)}function Ro(e){return`${e?"acbridge \u2014 voice-driven Claude Code, on any machine":"acbridge \u2014 the AC Bridge companion CLI: bridge, devices, and profiles from any terminal"}
276
+
277
+ Usage: acbridge <command>
278
+
279
+ Commands:
280
+ login [--provider google|github|microsoft|sso] [--email <addr>] [--app] [--no-browser] [--if-needed] [--timeout <s>] [--json]
281
+ Sign this machine in (browser sign-in; --app hands off to the desktop app;
282
+ --no-browser prints the URL to open on THIS machine; --if-needed exits 0 when
283
+ already signed in)
284
+ logout [--json] Sign out: stop the bridge + revoke this machine's credential
285
+ whoami [--json] Show the signed-in account, machine, relay, and plan
286
+ start [--no-revert] [--attach] [--json]
287
+ Start the bridge like the app's Start button (detached; lights revert on stop)
288
+ stop [--json] Stop the bridge \u2014 reverts touched devices, then tears the hub + daemon down
289
+ restart stop, then start with the same flags
290
+ ${e?` run [--hold] [--agent claude|codex] [--resume]
291
+ Launch Claude (or, with --agent codex, OpenAI Codex CLI) in the current project with
292
+ the Alexa channel/hub attached (--hold keeps the window open after; --resume, codex
293
+ only, resumes the newest existing codex thread for this cwd instead of starting fresh)`:" run Launch an agent session by voice \u2014 voice is turned off in this build; use\n `acbridge start` for the bridge, and launch `claude`/`codex` yourself (their\n hooks still drive your Profiles)"}
294
+ ${e?" setup One-time: install the channel plugin + allowlist it (managed settings)":" setup One-time: install the AC Bridge plugin (Profiles hooks + statusline tee)"}
295
+ pair <code> Pair this machine using a claim code from the app ("Add another machine")
296
+ link <provider> Link a smart-home provider (home-assistant | hue | smartthings | tuya | meross | ewelink | govee | mqtt)
297
+ unlink <provider> Remove a keyed provider's account (tuya | meross | ewelink | nanoleaf | govee | esphome): delete its keys + devices
298
+ devices [list | on <dev> | off <dev> | set <dev> <cmd> [--param k=v]] [--json]
299
+ List the connected-device graph, or control a device (same guarded path as the app)
300
+ profiles [--json] Show profiles + repo bindings (read-only \u2014 edit in the app)
301
+ integrations [--json] Show linked provider accounts
302
+ rename <dev> <name> Rename a device everywhere
303
+ scan [--json] [--timeout <s>] Scan the LAN for smart devices (--json for scripting)
304
+ connect <id> [--name <n>] [--credentials-file <path>] [--as <protocol>] [--forget] [--purge] [--auto on|off]
305
+ Connect a scanned device directly (mac | ip | discoveredId); --forget undoes
306
+ (--purge forgets credentials too); --as forces a protocol for connect-by-IP
307
+ daemon [--no-revert] Run the bridge keeper in the foreground (what "start" runs detached)
308
+ status [--json] Show relay / hub / session status (exit 0 = hub running, 1 = stopped)
309
+ capture Transcript capture for this machine: on | off | status (DB6; on by default)
310
+ doctor Diagnose prerequisites and configuration
311
+ --version Print the acbridge version (dev builds print "dev (unversioned)")
312
+
313
+ Exit codes: 0 ok \xB7 1 failure \xB7 2 usage error \xB7 3 not signed in (run \`acbridge pair\` or use the app)
314
+ \xB7 4 update required (below the minimum supported version) \xB7 5 no active subscription (ac-bridge.com/home)
315
+ `}function N_(e){return e.some(t=>t==="-h"||t==="--help")}function L_(e,t){let r=Ro(t).split(`
316
+ `),o=new RegExp(`^ {2}${e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&")}(?=\\s|$)`),n=r.findIndex(a=>o.test(a));if(n===-1)return null;let i=[r[n]];for(let a of r.slice(n+1)){if(a.trim()===""||/^ {2}\S/.test(a))break;i.push(a)}return i.join(`
317
+ `).trimEnd()}async function qU(){try{Kv()}catch(r){b(`archiveLegacyUserState() failed (non-fatal): ${r instanceof Error?r.message:String(r)}`)}let[,,e,...t]=process.argv;if(e&&N_(t)){let r=Qe();return h(L_(e,r)??Ro(r)),0}switch(e){case"login":return Ow(t);case"logout":return Dw(t);case"whoami":return Wc(t);case"start":return Jc(t);case"restart":return Mw(t);case"run":return $_(t);case"setup":return R_();case"pair":return Nw(t);case"link":return Ew(t);case"unlink":return D_(t);case"devices":return m0(t);case"profiles":return Uw(t);case"integrations":return vw(t);case"rename":return zw(t);case"scan":return P_(t);case"connect":return Qk(t);case"daemon":return Oc(t);case"stop":return wo(t);case"status":return O_(t);case"capture":return gy(t);case"doctor":return hw();case"--version":case"-V":return h(Mn().version??"dev (unversioned)"),0;case void 0:case"-h":case"--help":case"help":return h(Ro(Qe())),0;default:return b(`unknown command: ${e}`),h(Ro(Qe())),2}}qU().then(e=>process.exit(e),e=>{b(e instanceof Error?e.message:String(e)),process.exit(1)});