@learncard/idx-plugin 1.0.40 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/idx-plugin.cjs.development.js +4 -2
- package/dist/idx-plugin.cjs.development.js.map +2 -2
- package/dist/idx-plugin.cjs.production.min.js +4 -4
- package/dist/idx-plugin.cjs.production.min.js.map +3 -3
- package/dist/idx-plugin.esm.js +4 -2
- package/dist/idx-plugin.esm.js.map +2 -2
- package/package.json +4 -4
|
@@ -21,9 +21,9 @@ if (cid) {
|
|
|
21
21
|
`;var lv={};En(lv,{base36:()=>ra,base36upper:()=>bN});var ra=Yo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),bN=Yo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var $8={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function wN(e){let t=$8[e];if(typeof t<"u")return t;throw new Error(`No stream type registered for name ${e}`)}i(wN,"codeByName");function _N(e){let t=Object.entries($8).find(([,r])=>r===e);if(t)return t[0];throw new Error(`No stream type registered for index ${e}`)}i(_N,"nameByCode");var na=class{};i(na,"StreamType");na.nameByCode=_N;na.codeByName=wN;var Gv=Ys(xp(),1);function vu(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}i(vu,"asUint8Array");function Of(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?vu(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}i(Of,"allocUnsafe");function Rf(e,t){t||(t=e.reduce((a,s)=>a+s.length,0));let r=Of(t),n=0;for(let a of e)r.set(a,n),n+=a.length;return vu(r)}i(Rf,"concat");var hv={};En(hv,{identity:()=>PN});var PN=mu({prefix:"\0",name:"identity",encode:e=>P8(e),decode:e=>N8(e)});var pv={};En(pv,{base2:()=>BN});var BN=Br({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var mv={};En(mv,{base8:()=>LN});var LN=Br({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var gv={};En(gv,{base10:()=>UN});var UN=Yo({prefix:"9",name:"base10",alphabet:"0123456789"});var vv={};En(vv,{base16:()=>FN,base16upper:()=>jN});var FN=Br({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),jN=Br({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var yv={};En(yv,{base64:()=>$N,base64pad:()=>zN,base64url:()=>HN,base64urlpad:()=>qN});var $N=Br({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),zN=Br({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),HN=Br({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),qN=Br({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var bv={};En(bv,{base256emoji:()=>ZN});var Y8=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),VN=Y8.reduce((e,t,r)=>(e[r]=t,e),[]),KN=Y8.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function GN(e){return e.reduce((t,r)=>(t+=VN[r],t),"")}i(GN,"encode");function WN(e){let t=[];for(let r of e){let n=KN[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}i(WN,"decode");var ZN=mu({prefix:"\u{1F680}",name:"base256emoji",encode:GN,decode:WN});var Ev={};En(Ev,{sha256:()=>_v,sha512:()=>JN});var wv=i(({name:e,code:t,encode:r})=>new Tp(e,t,r),"from"),Tp=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?Qs(this.code,r):r.then(n=>Qs(this.code,n))}else throw Error("Unknown type, must be binary type")}};i(Tp,"Hasher");var Q8=i(e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),"sha"),_v=wv({name:"sha2-256",code:18,encode:Q8("SHA-256")}),JN=wv({name:"sha2-512",code:19,encode:Q8("SHA-512")});var Av={};En(Av,{identity:()=>QN});var eE=0,YN="identity",tE=mo,XN=i(e=>Qs(eE,tE(e)),"digest"),QN={code:eE,name:YN,encode:tE,digest:XN};var UG=new TextEncoder,FG=new TextDecoder;var Sv={...hv,...pv,...mv,...gv,...vv,...uv,...lv,...cv,...yv,...bv},HG={...Ev,...Av};function nE(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}i(nE,"createCodec");var rE=nE("utf8","u",e=>{let t=new TextDecoder("utf8");return"u"+t.decode(e)},e=>new TextEncoder().encode(e.substring(1))),xv=nE("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=Of(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),rP={utf8:rE,"utf-8":rE,hex:Sv.base16,latin1:xv,ascii:xv,binary:xv,...Sv},Tv=rP;function Cv(e,t="utf8"){let r=Tv[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}i(Cv,"toString");function fi(e){let t,r,n;return typeof e=="object"?(t=e.hashFunction,r=e.expiring,n=e.tags):t=e,(a,s,c)=>{if(c.value!=null)c.value=iE(c.value,t,r,n);else if(c.get!=null)c.get=iE(c.get,t,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}i(fi,"Memoize");var Mv=new Map;function iE(e,t,r=0,n){let a=Symbol("__memoized_map__");return function(...s){let c;this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let l=this[a];if(Array.isArray(n))for(let d of n)Mv.has(d)?Mv.get(d).push(l):Mv.set(d,[l]);if(t||s.length>0||r>0){let d;t===!0?d=s.map(v=>v.toString()).join("!"):t?d=t.apply(this,s):d=s[0];let p=`${d}__timestamp`,g=!1;if(r>0)if(!l.has(p))g=!0;else{let v=l.get(p);g=Date.now()-v>r}l.has(d)&&!g?c=l.get(d):(c=e.apply(this,s),l.set(d,c),r>0&&l.set(p,Date.now()))}else{let d=this;l.has(d)?c=l.get(d):(c=e.apply(this,s),l.set(d,c))}return c}}i(iE,"getNewFunction");var Cp=i(({enumerable:e=!0,configurable:t=!1}={})=>({enumerable:e,configurable:t,writable:!1}),"readonly"),Iv=i(function*(e,t){if(e!=null&&!(e instanceof Uint8Array))for(let[r,n]of Object.entries(e)){let a=[...t,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s],d=qt.asCID(c);d?yield[l.join("/"),d]:typeof c=="object"&&(yield*Iv(c,l))}else{let s=qt.asCID(n);s?yield[a.join("/"),s]:yield*Iv(n,a)}}},"links"),kv=i(function*(e,t){if(e!=null)for(let[r,n]of Object.entries(e)){let a=[...t,r];if(yield a.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!qt.asCID(n))if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s];yield l.join("/"),typeof c=="object"&&!qt.asCID(c)&&(yield*kv(c,l))}else yield*kv(n,a)}},"tree"),iP=i((e,t)=>{let r=e;for(let[n,a]of t.entries()){if(r=r[a],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let s=qt.asCID(r);if(s)return{value:s,remaining:t.slice(n+1).join("/")}}return{value:r}},"get"),Mp=class{constructor({cid:t,bytes:r,value:n}){if(!t||!r||typeof n>"u")throw new Error("Missing required argument");this.cid=t,this.bytes=r,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:Cp(),bytes:Cp(),value:Cp(),asBlock:Cp()})}links(){return Iv(this.value,[])}tree(){return kv(this.value,[])}get(t="/"){return iP(this.value,t.split("/").filter(Boolean))}};i(Mp,"Block");var aE=i(async({value:e,codec:t,hasher:r})=>{if(typeof e>"u")throw new Error('Missing required argument "value"');if(!t||!r)throw new Error("Missing required argument: codec or hasher");let n=t.encode(e),a=await r.digest(n),s=qt.create(1,t.code,a);return new Mp({value:e,bytes:n,cid:s})},"encode");var Vv=Ys(xp(),1);var jp={};En(jp,{code:()=>zP,decode:()=>HP,encode:()=>jv,name:()=>$P});var oP=["string","number","bigint","symbol"],sP=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function oE(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(oP.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(cP(e))return"Buffer";let r=uP(e);return r||"Object"}i(oE,"is");function cP(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}i(cP,"isBuffer");function uP(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(sP.includes(t))return t}i(uP,"getObjectType");var Ne=class{constructor(t,r,n){this.major=t,this.majorEncoded=t<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(t){return this.major<t.major?-1:this.major>t.major?1:0}};i(Ne,"Type");Ne.uint=new Ne(0,"uint",!0);Ne.negint=new Ne(1,"negint",!0);Ne.bytes=new Ne(2,"bytes",!0);Ne.string=new Ne(3,"string",!0);Ne.array=new Ne(4,"array",!1);Ne.map=new Ne(5,"map",!1);Ne.tag=new Ne(6,"tag",!1);Ne.float=new Ne(7,"float",!0);Ne.false=new Ne(7,"false",!0);Ne.true=new Ne(7,"true",!0);Ne.null=new Ne(7,"null",!0);Ne.undefined=new Ne(7,"undefined",!0);Ne.break=new Ne(7,"break",!0);var tt=class{constructor(t,r,n){this.type=t,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};i(tt,"Token");var yu=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",lP=new TextDecoder,fP=new TextEncoder;function Ip(e){return yu&&globalThis.Buffer.isBuffer(e)}i(Ip,"isBuffer");function Dv(e){return e instanceof Uint8Array?Ip(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}i(Dv,"asU8A");var lE=yu?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):cE(e,t,r):(e,t,r)=>r-t>64?lP.decode(e.subarray(t,r)):cE(e,t,r),fE=yu?e=>e.length>64?globalThis.Buffer.from(e):sE(e):e=>e.length>64?fP.encode(e):sE(e),La=i(e=>Uint8Array.from(e),"fromArray"),bu=yu?(e,t,r)=>Ip(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),dE=yu?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),Dv(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let a of e)n+a.length>r.length&&(a=a.subarray(0,r.length-n)),r.set(a,n),n+=a.length;return r},hE=yu?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function pE(e,t){if(Ip(e)&&Ip(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}i(pE,"compare");function sE(e,t=1/0){let r,n=e.length,a=null,s=[];for(let c=0;c<n;++c){if(r=e.charCodeAt(c),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(c+1===n){(t-=3)>-1&&s.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}i(sE,"utf8ToBytes");function cE(e,t,r){let n=[];for(;t<r;){let a=e[t],s=null,c=a>239?4:a>223?3:a>191?2:1;if(t+c<=r){let l,d,p,g;switch(c){case 1:a<128&&(s=a);break;case 2:l=e[t+1],(l&192)===128&&(g=(a&31)<<6|l&63,g>127&&(s=g));break;case 3:l=e[t+1],d=e[t+2],(l&192)===128&&(d&192)===128&&(g=(a&15)<<12|(l&63)<<6|d&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:l=e[t+1],d=e[t+2],p=e[t+3],(l&192)===128&&(d&192)===128&&(p&192)===128&&(g=(a&15)<<18|(l&63)<<12|(d&63)<<6|p&63,g>65535&&g<1114112&&(s=g))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),t+=c}return dP(n)}i(cE,"utf8Slice");var uE=4096;function dP(e){let t=e.length;if(t<=uE)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=uE));return r}i(dP,"decodeCodePointsArray");var hP=256,wu=class{constructor(t=hP){this.chunkSize=t,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(t){let r=this.chunks[this.chunks.length-1];if(this.cursor+t.length<=this.maxCursor+1){let a=r.length-(this.maxCursor-this.cursor)-1;r.set(t,a)}else{if(r){let a=r.length-(this.maxCursor-this.cursor)-1;a<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,a),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=hE(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(t,0)):(this.chunks.push(t),this.maxCursor+=t.length)}this.cursor+=t.length}toBytes(t=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];t&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=bu(n,0,this.cursor)}else r=dE(this.chunks,this.cursor);return t&&this.reset(),r}};i(wu,"Bl");var Rt="CBOR decode error:",Ov="CBOR encode error:",Nf=[];Nf[23]=1;Nf[24]=2;Nf[25]=3;Nf[26]=5;Nf[27]=9;function go(e,t,r){if(e.length-t<r)throw new Error(`${Rt} not enough data for type`)}i(go,"assertEnoughData");var en=[24,256,65536,4294967296,BigInt("18446744073709551616")];function di(e,t,r){go(e,t,1);let n=e[t];if(r.strict===!0&&n<en[0])throw new Error(`${Rt} integer encoded in more bytes than necessary (strict decode)`);return n}i(di,"readUint8");function hi(e,t,r){go(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<en[1])throw new Error(`${Rt} integer encoded in more bytes than necessary (strict decode)`);return n}i(hi,"readUint16");function pi(e,t,r){go(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<en[2])throw new Error(`${Rt} integer encoded in more bytes than necessary (strict decode)`);return n}i(pi,"readUint32");function mi(e,t,r){go(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],a=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(a);if(r.strict===!0&&s<en[3])throw new Error(`${Rt} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(r.allowBigInt===!0)return s;throw new Error(`${Rt} integers outside of the safe integer range are not supported`)}i(mi,"readUint64");function mE(e,t,r,n){return new tt(Ne.uint,di(e,t+1,n),2)}i(mE,"decodeUint8");function gE(e,t,r,n){return new tt(Ne.uint,hi(e,t+1,n),3)}i(gE,"decodeUint16");function vE(e,t,r,n){return new tt(Ne.uint,pi(e,t+1,n),5)}i(vE,"decodeUint32");function yE(e,t,r,n){return new tt(Ne.uint,mi(e,t+1,n),9)}i(yE,"decodeUint64");function ji(e,t){return cn(e,0,t.value)}i(ji,"encodeUint");function cn(e,t,r){if(r<en[0]){let n=Number(r);e.push([t|n])}else if(r<en[1]){let n=Number(r);e.push([t|24,n])}else if(r<en[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<en[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<en[4]){let a=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));a[8]=s&255,s=s>>8,a[7]=s&255,s=s>>8,a[6]=s&255,s=s>>8,a[5]=s&255,a[4]=c&255,c=c>>8,a[3]=c&255,c=c>>8,a[2]=c&255,c=c>>8,a[1]=c&255,e.push(a)}else throw new Error(`${Rt} encountered BigInt larger than allowable range`)}}i(cn,"encodeUintValue");ji.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");cn.encodedSize=i(function(t){return t<en[0]?1:t<en[1]?2:t<en[2]?3:t<en[3]?5:9},"encodedSize");ji.compareTokens=i(function(t,r){return t.value<r.value?-1:t.value>r.value?1:0},"compareTokens");function bE(e,t,r,n){return new tt(Ne.negint,-1-di(e,t+1,n),2)}i(bE,"decodeNegint8");function wE(e,t,r,n){return new tt(Ne.negint,-1-hi(e,t+1,n),3)}i(wE,"decodeNegint16");function _E(e,t,r,n){return new tt(Ne.negint,-1-pi(e,t+1,n),5)}i(_E,"decodeNegint32");var Rv=BigInt(-1),EE=BigInt(1);function AE(e,t,r,n){let a=mi(e,t+1,n);if(typeof a!="bigint"){let s=-1-a;if(s>=Number.MIN_SAFE_INTEGER)return new tt(Ne.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Rt} integers outside of the safe integer range are not supported`);return new tt(Ne.negint,Rv-BigInt(a),9)}i(AE,"decodeNegint64");function kp(e,t){let r=t.value,n=typeof r=="bigint"?r*Rv-EE:r*-1-1;cn(e,t.type.majorEncoded,n)}i(kp,"encodeNegint");kp.encodedSize=i(function(t){let r=t.value,n=typeof r=="bigint"?r*Rv-EE:r*-1-1;return n<en[0]?1:n<en[1]?2:n<en[2]?3:n<en[3]?5:9},"encodedSize");kp.compareTokens=i(function(t,r){return t.value<r.value?1:t.value>r.value?-1:0},"compareTokens");function Pf(e,t,r,n){go(e,t,r+n);let a=bu(e,t+r,t+r+n);return new tt(Ne.bytes,a,r+n)}i(Pf,"toToken");function SE(e,t,r,n){return Pf(e,t,1,r)}i(SE,"decodeBytesCompact");function xE(e,t,r,n){return Pf(e,t,2,di(e,t+1,n))}i(xE,"decodeBytes8");function TE(e,t,r,n){return Pf(e,t,3,hi(e,t+1,n))}i(TE,"decodeBytes16");function CE(e,t,r,n){return Pf(e,t,5,pi(e,t+1,n))}i(CE,"decodeBytes32");function ME(e,t,r,n){let a=mi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Rt} 64-bit integer bytes lengths not supported`);return Pf(e,t,9,a)}i(ME,"decodeBytes64");function Dp(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===Ne.string?fE(e.value):e.value),e.encodedBytes}i(Dp,"tokenBytes");function _u(e,t){let r=Dp(t);cn(e,t.type.majorEncoded,r.length),e.push(r)}i(_u,"encodeBytes");_u.encodedSize=i(function(t){let r=Dp(t);return cn.encodedSize(r.length)+r.length},"encodedSize");_u.compareTokens=i(function(t,r){return mP(Dp(t),Dp(r))},"compareTokens");function mP(e,t){return e.length<t.length?-1:e.length>t.length?1:pE(e,t)}i(mP,"compareBytes");function Bf(e,t,r,n,a){let s=r+n;go(e,t,s);let c=new tt(Ne.string,lE(e,t+r,t+s),s);return a.retainStringBytes===!0&&(c.byteValue=bu(e,t+r,t+s)),c}i(Bf,"toToken");function IE(e,t,r,n){return Bf(e,t,1,r,n)}i(IE,"decodeStringCompact");function kE(e,t,r,n){return Bf(e,t,2,di(e,t+1,n),n)}i(kE,"decodeString8");function DE(e,t,r,n){return Bf(e,t,3,hi(e,t+1,n),n)}i(DE,"decodeString16");function OE(e,t,r,n){return Bf(e,t,5,pi(e,t+1,n),n)}i(OE,"decodeString32");function RE(e,t,r,n){let a=mi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Rt} 64-bit integer string lengths not supported`);return Bf(e,t,9,a,n)}i(RE,"decodeString64");var NE=_u;function Eu(e,t,r,n){return new tt(Ne.array,n,r)}i(Eu,"toToken");function PE(e,t,r,n){return Eu(e,t,1,r)}i(PE,"decodeArrayCompact");function BE(e,t,r,n){return Eu(e,t,2,di(e,t+1,n))}i(BE,"decodeArray8");function LE(e,t,r,n){return Eu(e,t,3,hi(e,t+1,n))}i(LE,"decodeArray16");function UE(e,t,r,n){return Eu(e,t,5,pi(e,t+1,n))}i(UE,"decodeArray32");function FE(e,t,r,n){let a=mi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Rt} 64-bit integer array lengths not supported`);return Eu(e,t,9,a)}i(FE,"decodeArray64");function jE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Rt} indefinite length items not allowed`);return Eu(e,t,1,1/0)}i(jE,"decodeArrayIndefinite");function Op(e,t){cn(e,Ne.array.majorEncoded,t.value)}i(Op,"encodeArray");Op.compareTokens=ji.compareTokens;Op.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");function Au(e,t,r,n){return new tt(Ne.map,n,r)}i(Au,"toToken");function $E(e,t,r,n){return Au(e,t,1,r)}i($E,"decodeMapCompact");function zE(e,t,r,n){return Au(e,t,2,di(e,t+1,n))}i(zE,"decodeMap8");function HE(e,t,r,n){return Au(e,t,3,hi(e,t+1,n))}i(HE,"decodeMap16");function qE(e,t,r,n){return Au(e,t,5,pi(e,t+1,n))}i(qE,"decodeMap32");function VE(e,t,r,n){let a=mi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Rt} 64-bit integer map lengths not supported`);return Au(e,t,9,a)}i(VE,"decodeMap64");function KE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Rt} indefinite length items not allowed`);return Au(e,t,1,1/0)}i(KE,"decodeMapIndefinite");function Rp(e,t){cn(e,Ne.map.majorEncoded,t.value)}i(Rp,"encodeMap");Rp.compareTokens=ji.compareTokens;Rp.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");function GE(e,t,r,n){return new tt(Ne.tag,r,1)}i(GE,"decodeTagCompact");function WE(e,t,r,n){return new tt(Ne.tag,di(e,t+1,n),2)}i(WE,"decodeTag8");function ZE(e,t,r,n){return new tt(Ne.tag,hi(e,t+1,n),3)}i(ZE,"decodeTag16");function JE(e,t,r,n){return new tt(Ne.tag,pi(e,t+1,n),5)}i(JE,"decodeTag32");function YE(e,t,r,n){return new tt(Ne.tag,mi(e,t+1,n),9)}i(YE,"decodeTag64");function Np(e,t){cn(e,Ne.tag.majorEncoded,t.value)}i(Np,"encodeTag");Np.compareTokens=ji.compareTokens;Np.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");var _P=20,EP=21,AP=22,SP=23;function XE(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${Rt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new tt(Ne.null,null,1):new tt(Ne.undefined,void 0,1)}i(XE,"decodeUndefined");function QE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Rt} indefinite length items not allowed`);return new tt(Ne.break,void 0,1)}i(QE,"decodeBreak");function Nv(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${Rt} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${Rt} Infinity values are not supported`)}return new tt(Ne.float,e,t)}i(Nv,"createToken");function e9(e,t,r,n){return Nv(Pv(e,t+1),3,n)}i(e9,"decodeFloat16");function t9(e,t,r,n){return Nv(Bv(e,t+1),5,n)}i(t9,"decodeFloat32");function r9(e,t,r,n){return Nv(o9(e,t+1),9,n)}i(r9,"decodeFloat64");function Pp(e,t,r){let n=t.value;if(n===!1)e.push([Ne.float.majorEncoded|_P]);else if(n===!0)e.push([Ne.float.majorEncoded|EP]);else if(n===null)e.push([Ne.float.majorEncoded|AP]);else if(n===void 0)e.push([Ne.float.majorEncoded|SP]);else{let a,s=!1;(!r||r.float64!==!0)&&(i9(n),a=Pv(ia,1),n===a||Number.isNaN(n)?(ia[0]=249,e.push(ia.slice(0,3)),s=!0):(a9(n),a=Bv(ia,1),n===a&&(ia[0]=250,e.push(ia.slice(0,5)),s=!0))),s||(xP(n),a=o9(ia,1),ia[0]=251,e.push(ia.slice(0,9)))}}i(Pp,"encodeFloat");Pp.encodedSize=i(function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){i9(n);let a=Pv(ia,1);if(n===a||Number.isNaN(n))return 3;if(a9(n),a=Bv(ia,1),n===a)return 5}return 9},"encodedSize");var n9=new ArrayBuffer(9),$i=new DataView(n9,1),ia=new Uint8Array(n9,0);function i9(e){if(e===1/0)$i.setUint16(0,31744,!1);else if(e===-1/0)$i.setUint16(0,64512,!1);else if(Number.isNaN(e))$i.setUint16(0,32256,!1);else{$i.setFloat32(0,e);let t=$i.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)$i.setUint16(0,31744,!1);else if(r===0)$i.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let a=r-127;a<-24?$i.setUint16(0,0):a<-14?$i.setUint16(0,(t&2147483648)>>16|1<<24+a,!1):$i.setUint16(0,(t&2147483648)>>16|a+15<<10|n>>13,!1)}}}i(i9,"encodeFloat16");function Pv(e,t){if(e.length-t<2)throw new Error(`${Rt} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,a=r&1023,s;return n===0?s=a*2**-24:n!==31?s=(a+1024)*2**(n-25):s=a===0?1/0:NaN,r&32768?-s:s}i(Pv,"readFloat16");function a9(e){$i.setFloat32(0,e,!1)}i(a9,"encodeFloat32");function Bv(e,t){if(e.length-t<4)throw new Error(`${Rt} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}i(Bv,"readFloat32");function xP(e){$i.setFloat64(0,e,!1)}i(xP,"encodeFloat64");function o9(e,t){if(e.length-t<8)throw new Error(`${Rt} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}i(o9,"readFloat64");Pp.compareTokens=ji.compareTokens;function ur(e,t,r){throw new Error(`${Rt} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}i(ur,"invalidMinor");function Bp(e){return()=>{throw new Error(`${Rt} ${e}`)}}i(Bp,"errorer");var We=[];for(let e=0;e<=23;e++)We[e]=ur;We[24]=mE;We[25]=gE;We[26]=vE;We[27]=yE;We[28]=ur;We[29]=ur;We[30]=ur;We[31]=ur;for(let e=32;e<=55;e++)We[e]=ur;We[56]=bE;We[57]=wE;We[58]=_E;We[59]=AE;We[60]=ur;We[61]=ur;We[62]=ur;We[63]=ur;for(let e=64;e<=87;e++)We[e]=SE;We[88]=xE;We[89]=TE;We[90]=CE;We[91]=ME;We[92]=ur;We[93]=ur;We[94]=ur;We[95]=Bp("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)We[e]=IE;We[120]=kE;We[121]=DE;We[122]=OE;We[123]=RE;We[124]=ur;We[125]=ur;We[126]=ur;We[127]=Bp("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)We[e]=PE;We[152]=BE;We[153]=LE;We[154]=UE;We[155]=FE;We[156]=ur;We[157]=ur;We[158]=ur;We[159]=jE;for(let e=160;e<=183;e++)We[e]=$E;We[184]=zE;We[185]=HE;We[186]=qE;We[187]=VE;We[188]=ur;We[189]=ur;We[190]=ur;We[191]=KE;for(let e=192;e<=215;e++)We[e]=GE;We[216]=WE;We[217]=ZE;We[218]=JE;We[219]=YE;We[220]=ur;We[221]=ur;We[222]=ur;We[223]=ur;for(let e=224;e<=243;e++)We[e]=Bp("simple values are not supported");We[244]=ur;We[245]=ur;We[246]=ur;We[247]=XE;We[248]=Bp("simple values are not supported");We[249]=e9;We[250]=t9;We[251]=r9;We[252]=ur;We[253]=ur;We[254]=ur;We[255]=QE;var aa=[];for(let e=0;e<24;e++)aa[e]=new tt(Ne.uint,e,1);for(let e=-1;e>=-24;e--)aa[31-e]=new tt(Ne.negint,e,1);aa[64]=new tt(Ne.bytes,new Uint8Array(0),1);aa[96]=new tt(Ne.string,"",1);aa[128]=new tt(Ne.array,0,1);aa[160]=new tt(Ne.map,0,1);aa[244]=new tt(Ne.false,!1,1);aa[245]=new tt(Ne.true,!0,1);aa[246]=new tt(Ne.null,null,1);function s9(e){switch(e.type){case Ne.false:return La([244]);case Ne.true:return La([245]);case Ne.null:return La([246]);case Ne.bytes:return e.value.length?void 0:La([64]);case Ne.string:return e.value===""?La([96]):void 0;case Ne.array:return e.value===0?La([128]):void 0;case Ne.map:return e.value===0?La([160]):void 0;case Ne.uint:return e.value<24?La([Number(e.value)]):void 0;case Ne.negint:if(e.value>=-24)return La([31-Number(e.value)])}}i(s9,"quickEncodeToken");var CP={float64:!1,mapSorter:kP,quickEncodeToken:s9};function MP(){let e=[];return e[Ne.uint.major]=ji,e[Ne.negint.major]=kp,e[Ne.bytes.major]=_u,e[Ne.string.major]=NE,e[Ne.array.major]=Op,e[Ne.map.major]=Rp,e[Ne.tag.major]=Np,e[Ne.float.major]=Pp,e}i(MP,"makeCborEncoders");var c9=MP(),Lv=new wu,tc=class{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${Ov} object contains circular references`);return new tc(r,t)}};i(tc,"Ref");var Xo={null:new tt(Ne.null,null),undefined:new tt(Ne.undefined,void 0),true:new tt(Ne.true,!0),false:new tt(Ne.false,!1),emptyArray:new tt(Ne.array,0),emptyMap:new tt(Ne.map,0)},Qo={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new tt(Ne.float,e):e>=0?new tt(Ne.uint,e):new tt(Ne.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new tt(Ne.uint,e):new tt(Ne.negint,e)},Uint8Array(e,t,r,n){return new tt(Ne.bytes,e)},string(e,t,r,n){return new tt(Ne.string,e)},boolean(e,t,r,n){return e?Xo.true:Xo.false},null(e,t,r,n){return Xo.null},undefined(e,t,r,n){return Xo.undefined},ArrayBuffer(e,t,r,n){return new tt(Ne.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new tt(Ne.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[Xo.emptyArray,new tt(Ne.break)]:Xo.emptyArray;n=tc.createCheck(n,e);let a=[],s=0;for(let c of e)a[s++]=Lp(c,r,n);return r.addBreakTokens?[new tt(Ne.array,e.length),a,new tt(Ne.break)]:[new tt(Ne.array,e.length),a]},Object(e,t,r,n){let a=t!=="Object",s=a?e.keys():Object.keys(e),c=a?e.size:s.length;if(!c)return r.addBreakTokens===!0?[Xo.emptyMap,new tt(Ne.break)]:Xo.emptyMap;n=tc.createCheck(n,e);let l=[],d=0;for(let p of s)l[d++]=[Lp(p,r,n),Lp(a?e.get(p):e[p],r,n)];return IP(l,r),r.addBreakTokens?[new tt(Ne.map,c),l,new tt(Ne.break)]:[new tt(Ne.map,c),l]}};Qo.Map=Qo.Object;Qo.Buffer=Qo.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Qo[`${e}Array`]=Qo.DataView;function Lp(e,t={},r){let n=oE(e),a=t&&t.typeEncoders&&t.typeEncoders[n]||Qo[n];if(typeof a=="function"){let c=a(e,n,t,r);if(c!=null)return c}let s=Qo[n];if(!s)throw new Error(`${Ov} unsupported type: ${n}`);return s(e,n,t,r)}i(Lp,"objectToTokens");function IP(e,t){t.mapSorter&&e.sort(t.mapSorter)}i(IP,"sortMapEntries");function kP(e,t){let r=Array.isArray(e[0])?e[0][0]:e[0],n=Array.isArray(t[0])?t[0][0]:t[0];if(r.type!==n.type)return r.type.compare(n.type);let a=r.type.major,s=c9[a].compareTokens(r,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}i(kP,"mapSorter");function u9(e,t,r,n){if(Array.isArray(t))for(let a of t)u9(e,a,r,n);else r[t.type.major](e,t,n)}i(u9,"tokensToEncoded");function DP(e,t,r){let n=Lp(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let a=r.quickEncodeToken(n);if(a)return a;let s=t[n.type.major];if(s.encodedSize){let c=s.encodedSize(n,r),l=new wu(c);if(s(l,n,r),l.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return Dv(l.chunks[0])}}return Lv.reset(),u9(Lv,n,t,r),Lv.toBytes(!0)}i(DP,"encodeCustom");function Uv(e,t){return t=Object.assign({},CP,t),DP(e,c9,t)}i(Uv,"encode");var OP={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Up=class{constructor(t,r={}){this.pos=0,this.data=t,this.options=r}done(){return this.pos>=this.data.length}next(){let t=this.data[this.pos],r=aa[t];if(r===void 0){let n=We[t];if(!n)throw new Error(`${Rt} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let a=t&31;r=n(this.data,this.pos,a,this.options)}return this.pos+=r.encodedLength,r}};i(Up,"Tokeniser");var Lf=Symbol.for("DONE"),Fp=Symbol.for("BREAK");function RP(e,t,r){let n=[];for(let a=0;a<e.value;a++){let s=Uf(t,r);if(s===Fp){if(e.value===1/0)break;throw new Error(`${Rt} got unexpected break to lengthed array`)}if(s===Lf)throw new Error(`${Rt} found array but not enough entries (got ${a}, expected ${e.value})`);n[a]=s}return n}i(RP,"tokenToArray");function NP(e,t,r){let n=r.useMaps===!0,a=n?void 0:{},s=n?new Map:void 0;for(let c=0;c<e.value;c++){let l=Uf(t,r);if(l===Fp){if(e.value===1/0)break;throw new Error(`${Rt} got unexpected break to lengthed map`)}if(l===Lf)throw new Error(`${Rt} found map but not enough entries (got ${c} [no key], expected ${e.value})`);if(n!==!0&&typeof l!="string")throw new Error(`${Rt} non-string keys not supported (got ${typeof l})`);if(r.rejectDuplicateMapKeys===!0&&(n&&s.has(l)||!n&&l in a))throw new Error(`${Rt} found repeat map key "${l}"`);let d=Uf(t,r);if(d===Lf)throw new Error(`${Rt} found map but not enough entries (got ${c} [no value], expected ${e.value})`);n?s.set(l,d):a[l]=d}return n?s:a}i(NP,"tokenToMap");function Uf(e,t){if(e.done())return Lf;let r=e.next();if(r.type===Ne.break)return Fp;if(r.type.terminal)return r.value;if(r.type===Ne.array)return RP(r,e,t);if(r.type===Ne.map)return NP(r,e,t);if(r.type===Ne.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Uf(e,t);return t.tags[r.value](n)}throw new Error(`${Rt} tag not supported (${r.value})`)}throw new Error("unsupported")}i(Uf,"tokensToObject");function Fv(e,t){if(!(e instanceof Uint8Array))throw new Error(`${Rt} data to decode must be a Uint8Array`);t=Object.assign({},OP,t);let r=t.tokenizer||new Up(e,t),n=Uf(r,t);if(n===Lf)throw new Error(`${Rt} did not find any content to decode`);if(n===Fp)throw new Error(`${Rt} got unexpected break`);if(!r.done())throw new Error(`${Rt} too many terminals, data makes no sense`);return n}i(Fv,"decode");var l9=42;function BP(e){if(e.asCID!==e)return null;let t=qt.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new tt(Ne.tag,l9),new tt(Ne.bytes,r)]}i(BP,"cidEncoder");function LP(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}i(LP,"undefinedEncoder");function UP(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}i(UP,"numberEncoder");var FP={float64:!0,typeEncoders:{Object:BP,undefined:LP,number:UP}};function jP(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return qt.decode(e.subarray(1))}i(jP,"cidDecoder");var f9={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};f9.tags[l9]=jP;var $P="dag-cbor",zP=113,jv=i(e=>Uv(e,FP),"encode"),HP=i(e=>Fv(e,f9),"decode");function Su(e){try{return e()}catch(t){return t}}i(Su,"tryCatch");var $v=Ys(xp(),1);function rc(e){let t=$v.default.decode(e),r=$v.default.decode.bytes,n=e.subarray(r);return[t,n,r]}i(rc,"readVarint");function qP(e){return e===0||e===1}i(qP,"isCidVersion");function zv(e){let[t,r]=rc(e);if(!qP(t))throw new Error(`Unknown CID version ${t}`);let[n,a]=rc(r),[,s,c]=rc(a),[l,,d]=rc(s),p=a.subarray(0,c+d+l),g=a.subarray(c+d+l);return[qt.create(t,n,yp(p)),g]}i(zv,"readCid");function nc(e,t="StreamRef"){let[r,n]=rc(e);if(r!==206)throw new Error(`Invalid ${t}, does not include streamid codec`);let[a,s]=rc(n),c=zv(s),[l,d]=c;if(d.length===0)return{kind:"stream-id",type:a,genesis:l};if(d.length===1&&d[0]===0)return{kind:"commit-id",type:a,genesis:l,commit:null};{let[p]=zv(d);return{kind:"commit-id",type:a,genesis:l,commit:p}}}i(nc,"fromBytes");var VP=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function xu(e,t="StreamRef"){let r=VP.exec(e)||[],n=r[2];if(!n)throw new Error(`Malformed ${t} string: ${e}`);let a=ra.decode(n),s=nc(a),c=r[4];return c?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:Hv(s.genesis,c)}:s}i(xu,"fromString");function KP(e){try{return typeof e=="string"?qt.parse(e):qt.asCID(e)}catch{return null}}i(KP,"parseCID");function Hv(e,t=null){if(!t||t==="0")return null;let r=KP(t);if(r)return e.equals(r)?null:r;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}i(Hv,"parseCommit");var Ff=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},zi=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},$p=class extends Error{constructor(t){super(`Invalid StreamID bytes ${ra.encode(t)}: contains commit`)}};i($p,"InvalidStreamIDBytesError");var zp=class extends Error{constructor(t){super(`Invalid StreamID string ${t}: contains commit`)}};i(zp,"InvalidStreamIDStringError");function p9(e){let t=nc(e,"StreamID");if(t.kind==="stream-id")return new Yt(t.type,t.genesis);throw new $p(e)}i(p9,"fromBytes");function GP(e){return Su(()=>p9(e))}i(GP,"fromBytesNoThrow");function m9(e){let t=xu(e,"StreamID");if(t.kind==="stream-id")return new Yt(t.type,t.genesis);throw new zp(e)}i(m9,"fromString");function WP(e){return Su(()=>m9(e))}i(WP,"fromStringNoThrow");var h9=Symbol.for("@ceramicnetwork/streamid/StreamID"),Yt=class{constructor(t,r){if(this._tag=h9,!(t||t===0))throw new Error("StreamID constructor: type required");if(!r)throw new Error("StreamID constructor: cid required");this._type=typeof t=="string"?na.codeByName(t):t,this._cid=typeof r=="string"?qt.parse(r):r}static isInstance(t){return typeof t=="object"&&"_tag"in t&&t._tag===h9}static async fromGenesis(t,r){let n=await aE({value:r,codec:jp,hasher:_v});return new Yt(t,n.cid)}get type(){return this._type}get typeName(){return na.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let t=Vv.default.encode(206),r=Vv.default.encode(this.type);return Rf([t,r,this.cid.bytes])}get baseID(){return new Yt(this._type,this._cid)}equals(t){return Yt.isInstance(t)?this.type===t.type&&this.cid.equals(t.cid):!1}toString(){return ra.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};i(Yt,"StreamID");Yt.fromBytes=p9;Yt.fromBytesNoThrow=GP;Yt.fromString=m9;Yt.fromStringNoThrow=WP;Ff([fi(),zi("design:type",String),zi("design:paramtypes",[])],Yt.prototype,"typeName",null);Ff([fi(),zi("design:type",Uint8Array),zi("design:paramtypes",[])],Yt.prototype,"bytes",null);Ff([fi(),zi("design:type",Yt),zi("design:paramtypes",[])],Yt.prototype,"baseID",null);Ff([fi(),zi("design:type",Function),zi("design:paramtypes",[]),zi("design:returntype",String)],Yt.prototype,"toString",null);Ff([fi(),zi("design:type",Function),zi("design:paramtypes",[]),zi("design:returntype",String)],Yt.prototype,"toUrl",null);var Cu=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},Gn=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Kv=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},vo=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Tu,ic,jf,Hp=class extends Error{constructor(t){super(`Error while parsing CommitID from bytes ${ra.encode(t)}: no commit information provided`)}};i(Hp,"InvalidCommitIDBytesError");var qp=class extends Error{constructor(t){super(`Error while parsing CommitID from string ${t}: no commit information provided`)}};i(qp,"InvalidCommitIDStringError");function v9(e){let t=nc(e,"CommitID");if(t.kind==="commit-id")return new hr(t.type,t.genesis,t.commit);throw new Hp(e)}i(v9,"fromBytes");function ZP(e){return Su(()=>v9(e))}i(ZP,"fromBytesNoThrow");function y9(e){let t=xu(e,"CommitID");if(t.kind==="commit-id")return new hr(t.type,t.genesis,t.commit);throw new qp(e)}i(y9,"fromString");function JP(e){return Su(()=>y9(e))}i(JP,"fromStringNoThrow");var g9=Symbol.for("@ceramicnetwork/streamid/CommitID");function YP(e,t){return new hr(e.type,e.cid,t)}i(YP,"make");var hr=class{constructor(t,r,n=null){if(this._tag=g9,Tu.set(this,void 0),ic.set(this,void 0),jf.set(this,void 0),!t&&t!==0)throw new Error("constructor: type required");if(!r)throw new Error("constructor: cid required");Kv(this,Tu,typeof t=="string"?na.codeByName(t):t,"f"),Kv(this,ic,typeof r=="string"?qt.parse(r):r,"f"),Kv(this,jf,Hv(vo(this,ic,"f"),n),"f")}static isInstance(t){return typeof t=="object"&&"_tag"in t&&t._tag===g9}get baseID(){return new Yt(vo(this,Tu,"f"),vo(this,ic,"f"))}get type(){return vo(this,Tu,"f")}get typeName(){return na.nameByCode(vo(this,Tu,"f"))}get cid(){return vo(this,ic,"f")}get commit(){return vo(this,jf,"f")||vo(this,ic,"f")}get bytes(){let t=Gv.default.encode(206),r=Gv.default.encode(this.type),n=vo(this,jf,"f")?.bytes||new Uint8Array([0]);return Rf([t,r,this.cid.bytes,n])}equals(t){return this.type===t.type&&this.cid.equals(t.cid)&&this.commit.equals(t.commit)}toString(){return ra.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Tu=new WeakMap,ic=new WeakMap,jf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};i(hr,"CommitID");hr.fromBytes=v9;hr.fromBytesNoThrow=ZP;hr.fromString=y9;hr.fromStringNoThrow=JP;hr.make=YP;Cu([fi(),Gn("design:type",Yt),Gn("design:paramtypes",[])],hr.prototype,"baseID",null);Cu([fi(),Gn("design:type",String),Gn("design:paramtypes",[])],hr.prototype,"typeName",null);Cu([fi(),Gn("design:type",qt),Gn("design:paramtypes",[])],hr.prototype,"commit",null);Cu([fi(),Gn("design:type",Uint8Array),Gn("design:paramtypes",[])],hr.prototype,"bytes",null);Cu([fi(),Gn("design:type",Function),Gn("design:paramtypes",[]),Gn("design:returntype",String)],hr.prototype,"toString",null);Cu([fi(),Gn("design:type",Function),Gn("design:paramtypes",[]),Gn("design:returntype",String)],hr.prototype,"toUrl",null);var ac;(function(e){function t(a){let s=nc(a);switch(s.kind){case"commit-id":return new hr(s.type,s.genesis,s.commit);case"stream-id":return new Yt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${ra.encode(a)}`)}}i(t,"fromBytes"),e.fromBytes=t;function r(a){let s=xu(a);switch(s.kind){case"commit-id":return new hr(s.type,s.genesis,s.commit);case"stream-id":return new Yt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${a}`)}}i(r,"fromString"),e.fromString=r;function n(a){if(Yt.isInstance(a)||hr.isInstance(a))return a;if(a instanceof Uint8Array)return t(a);if(typeof a=="string")return r(a);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(a)}`)}i(n,"from"),e.from=n})(ac||(ac={}));var b9="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",Vp="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var Wv={};En(Wv,{JsonPatchError:()=>Lr,_areEquals:()=>Hf,applyOperation:()=>oc,applyPatch:()=>Xp,applyReducer:()=>rB,deepClone:()=>eB,getValueByPointer:()=>Jp,validate:()=>_9,validator:()=>Yp});var XP=function(){var e=i(function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},e(t,r)},"extendStatics");return function(t,r){e(t,r);function n(){this.constructor=t}i(n,"__"),t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),QP=Object.prototype.hasOwnProperty;function Gp(e,t){return QP.call(e,t)}i(Gp,"hasOwnProperty");function Wp(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var a in e)Gp(e,a)&&n.push(a);return n}i(Wp,"_objectKeys");function un(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}i(un,"_deepClone");function Zp(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}i(Zp,"isInteger");function Ua(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}i(Ua,"escapePathComponent");function $f(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}i($f,"unescapePathComponent");function Kp(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Kp(e[t]))return!0}else if(typeof e=="object"){for(var n=Wp(e),a=n.length,s=0;s<a;s++)if(Kp(e[n[s]]))return!0}}return!1}i(Kp,"hasUndefined");function w9(e,t){var r=[e];for(var n in t){var a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(n+": "+a)}return r.join(`
|
|
22
22
|
`)}i(w9,"patchErrorMessageFormatter");var zf=function(e){XP(t,e);function t(r,n,a,s,c){var l=this.constructor,d=e.call(this,w9(r,{name:n,index:a,operation:s,tree:c}))||this;return d.name=n,d.index=a,d.operation=s,d.tree=c,Object.setPrototypeOf(d,l.prototype),d.message=w9(r,{name:n,index:a,operation:s,tree:c}),d}return i(t,"PatchError"),t}(Error);var Lr=zf,eB=un,Mu={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=Jp(r,this.path);n&&(n=un(n));var a=oc(r,{op:"remove",path:this.from}).removed;return oc(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Jp(r,this.from);return oc(r,{op:"add",path:this.path,value:un(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Hf(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},tB={add:function(e,t,r){return Zp(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:Mu.move,copy:Mu.copy,test:Mu.test,_get:Mu._get};function Jp(e,t){if(t=="")return e;var r={op:"_get",path:t};return oc(e,r),r.value}i(Jp,"getValueByPointer");function oc(e,t,r,n,a,s){if(r===void 0&&(r=!1),n===void 0&&(n=!0),a===void 0&&(a=!0),s===void 0&&(s=0),r&&(typeof r=="function"?r(t,0,e,t.path):Yp(t,0)),t.path===""){var c={newDocument:e};if(t.op==="add")return c.newDocument=t.value,c;if(t.op==="replace")return c.newDocument=t.value,c.removed=e,c;if(t.op==="move"||t.op==="copy")return c.newDocument=Jp(e,t.from),t.op==="move"&&(c.removed=e),c;if(t.op==="test"){if(c.test=Hf(e,t.value),c.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c.newDocument=e,c}else{if(t.op==="remove")return c.removed=e,c.newDocument=null,c;if(t.op==="_get")return t.value=e,c;if(r)throw new Lr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return c}}else{n||(e=un(e));var l=t.path||"",d=l.split("/"),p=e,g=1,v=d.length,y=void 0,_=void 0,x=void 0;for(typeof r=="function"?x=r:x=Yp;;){if(_=d[g],_&&_.indexOf("~")!=-1&&(_=$f(_)),a&&(_=="__proto__"||_=="prototype"&&g>0&&d[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&y===void 0&&(p[_]===void 0?y=d.slice(0,g).join("/"):g==v-1&&(y=t.path),y!==void 0&&x(t,0,e,y)),g++,Array.isArray(p)){if(_==="-")_=p.length;else{if(r&&!Zp(_))throw new Lr("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);Zp(_)&&(_=~~_)}if(g>=v){if(r&&t.op==="add"&&_>p.length)throw new Lr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var c=tB[t.op].call(t,p,_,e);if(c.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}}else if(g>=v){var c=Mu[t.op].call(t,p,_,e);if(c.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}if(p=p[_],r&&g<v&&(!p||typeof p!="object"))throw new Lr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}i(oc,"applyOperation");function Xp(e,t,r,n,a){if(n===void 0&&(n=!0),a===void 0&&(a=!0),r&&!Array.isArray(t))throw new Lr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=un(e));for(var s=new Array(t.length),c=0,l=t.length;c<l;c++)s[c]=oc(e,t[c],r,!0,a,c),e=s[c].newDocument;return s.newDocument=e,s}i(Xp,"applyPatch");function rB(e,t,r){var n=oc(e,t);if(n.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}i(rB,"applyReducer");function Yp(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Lr("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Mu[e.op]){if(typeof e.path!="string")throw new Lr("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Lr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Lr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Lr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Kp(e.value))throw new Lr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var a=e.path.split("/").length,s=n.split("/").length;if(a!==s+1&&a!==s)throw new Lr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new Lr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var c={op:"_get",path:e.from,value:void 0},l=_9([c],r);if(l&&l.name==="OPERATION_PATH_UNRESOLVABLE")throw new Lr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Lr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}i(Yp,"validator");function _9(e,t,r){try{if(!Array.isArray(e))throw new Lr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Xp(un(t),un(e),r||!0);else{r=r||Yp;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(a){if(a instanceof Lr)return a;throw a}}i(_9,"validate");function Hf(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),a,s,c;if(r&&n){if(s=e.length,s!=t.length)return!1;for(a=s;a--!==0;)if(!Hf(e[a],t[a]))return!1;return!0}if(r!=n)return!1;var l=Object.keys(e);if(s=l.length,s!==Object.keys(t).length)return!1;for(a=s;a--!==0;)if(!t.hasOwnProperty(l[a]))return!1;for(a=s;a--!==0;)if(c=l[a],!Hf(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}i(Hf,"_areEquals");var Xv={};En(Xv,{compare:()=>lB,generate:()=>Zv,observe:()=>uB,unobserve:()=>cB});var Jv=new WeakMap,nB=function(){function e(t){this.observers=new Map,this.obj=t}return i(e,"Mirror"),e}(),iB=function(){function e(t,r){this.callback=t,this.observer=r}return i(e,"ObserverInfo"),e}();function aB(e){return Jv.get(e)}i(aB,"getMirror");function oB(e,t){return e.observers.get(t)}i(oB,"getObserverFromMirror");function sB(e,t){e.observers.delete(t.callback)}i(sB,"removeObserverFromMirror");function cB(e,t){t.unobserve()}i(cB,"unobserve");function uB(e,t){var r=[],n,a=aB(e);if(!a)a=new nB(e),Jv.set(e,a);else{var s=oB(a,t);n=s&&s.observer}if(n)return n;if(n={},a.value=un(e),t){n.callback=t,n.next=null;var c=i(function(){Zv(n)},"dirtyCheck"),l=i(function(){clearTimeout(n.next),n.next=setTimeout(c)},"fastCheck");typeof window<"u"&&(window.addEventListener("mouseup",l),window.addEventListener("keyup",l),window.addEventListener("mousedown",l),window.addEventListener("keydown",l),window.addEventListener("change",l))}return n.patches=r,n.object=e,n.unobserve=function(){Zv(n),clearTimeout(n.next),sB(a,n),typeof window<"u"&&(window.removeEventListener("mouseup",l),window.removeEventListener("keyup",l),window.removeEventListener("mousedown",l),window.removeEventListener("keydown",l),window.removeEventListener("change",l))},a.observers.set(t,new iB(t,n)),n}i(uB,"observe");function Zv(e,t){t===void 0&&(t=!1);var r=Jv.get(e.object);Yv(r.value,e.object,e.patches,"",t),e.patches.length&&Xp(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}i(Zv,"generate");function Yv(e,t,r,n,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=Wp(t),c=Wp(e),l=!1,d=!1,p=c.length-1;p>=0;p--){var g=c[p],v=e[g];if(Gp(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var y=t[g];typeof v=="object"&&v!=null&&typeof y=="object"&&y!=null&&Array.isArray(v)===Array.isArray(y)?Yv(v,y,r,n+"/"+Ua(g),a):v!==y&&(l=!0,a&&r.push({op:"test",path:n+"/"+Ua(g),value:un(v)}),r.push({op:"replace",path:n+"/"+Ua(g),value:un(y)}))}else Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:n+"/"+Ua(g),value:un(v)}),r.push({op:"remove",path:n+"/"+Ua(g)}),d=!0):(a&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),l=!0)}if(!(!d&&s.length==c.length))for(var p=0;p<s.length;p++){var g=s[p];!Gp(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+Ua(g),value:un(t[g])})}}}i(Yv,"_generate");function lB(e,t,r){r===void 0&&(r=!1);var n=[];return Yv(e,t,n,"",r),n}i(lB,"compare");var E9=Object.assign({},Wv,Xv,{JsonPatchError:zf,deepClone:un,escapePathComponent:Ua,unescapePathComponent:$f});var HA=Ys(hy(),1);var qA=Ys(xA(),1);var lc;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC"})(lc||(lc={}));var Dy=Ys(hy(),1);var _y=i(function(e,t){return _y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},_y(e,t)},"extendStatics");function Ey(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");_y(e,t);function r(){this.constructor=e}i(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}i(Ey,"__extends");function Ay(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}i(Ay,"__values");function Ru(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),a,s=[],c;try{for(;(t===void 0||t-- >0)&&!(a=n.next()).done;)s.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}i(Ru,"__read");function Nu(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}i(Nu,"__spreadArray");function Hi(e){return typeof e=="function"}i(Hi,"isFunction");function TA(e){var t=i(function(n){Error.call(n),n.stack=new Error().stack},"_super"),r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}i(TA,"createErrorClass");var m0=TA(function(e){return i(function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
23
23
|
`+r.map(function(n,a){return a+1+") "+n.toString()}).join(`
|
|
24
|
-
`):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl")});function Sy(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(Sy,"arrRemove");var g0=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i(e,"Subscription"),e.prototype.unsubscribe=function(){var t,r,n,a,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=Ay(c),d=l.next();!d.done;d=l.next()){var p=d.value;p.remove(this)}}catch(R){t={error:R}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}else c.remove(this);var g=this.initialTeardown;if(Hi(g))try{g()}catch(R){s=R instanceof m0?R.errors:[R]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var y=Ay(v),_=y.next();!_.done;_=y.next()){var x=_.value;try{CA(x)}catch(R){s=s??[],R instanceof m0?s=Nu(Nu([],Ru(s)),Ru(R.errors)):s.push(R)}}}catch(R){n={error:R}}finally{try{_&&!_.done&&(a=y.return)&&a.call(y)}finally{if(n)throw n.error}}}if(s)throw new m0(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)CA(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Sy(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Sy(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var wJ=g0.EMPTY;function v0(e){return e instanceof g0||e&&"closed"in e&&Hi(e.remove)&&Hi(e.add)&&Hi(e.unsubscribe)}i(v0,"isSubscription");function CA(e){Hi(e)?e():e.unsubscribe()}i(CA,"execFinalizer");var oa={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Pu={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=Pu.delegate;return a?.setTimeout?a.setTimeout.apply(a,Nu([e,t],Ru(r))):setTimeout.apply(void 0,Nu([e,t],Ru(r)))},clearTimeout:function(e){var t=Pu.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function MA(e){Pu.setTimeout(function(){var t=oa.onUnhandledError;if(t)t(e);else throw e})}i(MA,"reportUnhandledError");function xy(){}i(xy,"noop");var IA=function(){return Ty("C",void 0,void 0)}();function kA(e){return Ty("E",void 0,e)}i(kA,"errorNotification");function DA(e){return Ty("N",e,void 0)}i(DA,"nextNotification");function Ty(e,t,r){return{kind:e,value:t,error:r}}i(Ty,"createNotification");var fc=null;function OA(e){if(oa.useDeprecatedSynchronousErrorHandling){var t=!fc;if(t&&(fc={errorThrown:!1,error:null}),e(),t){var r=fc,n=r.errorThrown,a=r.error;if(fc=null,n)throw a}}else e()}i(OA,"errorContext");function RA(e){oa.useDeprecatedSynchronousErrorHandling&&fc&&(fc.errorThrown=!0,fc.error=e)}i(RA,"captureError");var Iy=function(e){Ey(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,v0(r)&&r.add(n)):n.destination=_U,n}return i(t,"Subscriber"),t.create=function(r,n,a){return new b0(r,n,a)},t.prototype.next=function(r){this.isStopped?My(DA(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?My(kA(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?My(IA,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(g0);var yU=Function.prototype.bind;function Cy(e,t){return yU.call(e,t)}i(Cy,"bind");var bU=function(){function e(t){this.partialObserver=t}return i(e,"ConsumerObserver"),e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){y0(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){y0(n)}else y0(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){y0(r)}},e}(),b0=function(e){Ey(t,e);function t(r,n,a){var s=e.call(this)||this,c;if(Hi(r)||!r)c={next:r??void 0,error:n??void 0,complete:a??void 0};else{var l;s&&oa.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return s.unsubscribe()},c={next:r.next&&Cy(r.next,l),error:r.error&&Cy(r.error,l),complete:r.complete&&Cy(r.complete,l)}):c=r}return s.destination=new bU(c),s}return i(t,"SafeSubscriber"),t}(Iy);function y0(e){oa.useDeprecatedSynchronousErrorHandling?RA(e):MA(e)}i(y0,"handleUnhandledError");function wU(e){throw e}i(wU,"defaultErrorHandler");function My(e,t){var r=oa.onStoppedNotification;r&&Pu.setTimeout(function(){return r(e,t)})}i(My,"handleStoppedNotification");var _U={closed:!0,next:xy,error:wU,complete:xy};var NA=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function PA(e){return e}i(PA,"identity");function BA(e){return e.length===0?PA:e.length===1?e[0]:i(function(r){return e.reduce(function(n,a){return a(n)},r)},"piped")}i(BA,"pipeFromArray");var ky=function(){function e(t){t&&(this._subscribe=t)}return i(e,"Observable"),e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var a=this,s=AU(t)?t:new b0(t,r,n);return OA(function(){var c=a,l=c.operator,d=c.source;s.add(l?l.call(s,d):d?a._subscribe(s):a._trySubscribe(s))}),s},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=LA(r),new r(function(a,s){var c=new b0({next:function(l){try{t(l)}catch(d){s(d),c.unsubscribe()}},error:s,complete:a});n.subscribe(c)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[NA]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return BA(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=LA(t),new t(function(n,a){var s;r.subscribe(function(c){return s=c},function(c){return a(c)},function(){return n(s)})})},e.create=function(t){return new e(t)},e}();function LA(e){var t;return(t=e??oa.Promise)!==null&&t!==void 0?t:Promise}i(LA,"getPromiseCtor");function EU(e){return e&&Hi(e.next)&&Hi(e.error)&&Hi(e.complete)}i(EU,"isObserver");function AU(e){return e&&e instanceof Iy||EU(e)&&v0(e)}i(AU,"isSubscriber");var UA;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(UA||(UA={}));var FA;(function(e){e[e.NOT_REQUESTED=0]="NOT_REQUESTED",e[e.PENDING=1]="PENDING",e[e.PROCESSING=2]="PROCESSING",e[e.ANCHORED=3]="ANCHORED",e[e.FAILED=4]="FAILED"})(FA||(FA={}));var Oy;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(Oy||(Oy={}));var Gf=class extends ky{constructor(t,r){super(n=>{t.subscribe(n)}),this.state$=t,this._context=r}get id(){return new Yt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:t,content:r}=this.state$.value;return(0,Dy.default)(t?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return hr.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:t})=>hr.make(this.id,t))}get anchorCommitIds(){return this.state$.value.log.filter(({type:t})=>t===Oy.ANCHOR).map(({cid:t})=>hr.make(this.id,t))}get state(){return(0,Dy.default)(this.state$.value)}async sync(t={}){t={sync:lc.PREFER_CACHE,...t};let r=await this.api.loadStream(this.id,t);this.state$.next(r.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};i(Gf,"Stream");function jA(){return e=>{}}i(jA,"StreamStatic");var SU=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},vi,Ry={anchor:!0,publish:!0,pin:!0,sync:lc.PREFER_CACHE},xU={sync:lc.PREFER_CACHE},$A={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Ny(e,t){if(typeof e?.schema=="string")try{hr.fromString(e.schema)}catch{throw new Error("Schema must be a CommitID")}let r={controllers:e?.controllers,family:e?.family,schema:e?.schema?.toString(),tags:e?.tags};if(t)e?.deterministic||(r.unique=Cv((0,qA.randomBytes)(12),"base64")),e?.forbidControllerChange&&(r.forbidControllerChange=!0);else{if(e?.deterministic!==void 0||e?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(e?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(r).forEach(n=>r[n]===void 0&&delete r[n]),r}i(Ny,"headerFromMetadata");async function zA(e){if(!e.did)throw new Error("No DID provided");return e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`)),e.did}i(zA,"getAuthenticatedDID");async function Py(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(Py,"throwReadOnlyError");var ts=vi=i(class extends Gf{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,HA.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,a={}){a={...Ry,...a},!n?.deterministic&&a.syncTimeoutSeconds==null&&(a.syncTimeoutSeconds=0);let s=a.asDID?{did:a.asDID}:t,c=await vi.makeGenesis(s,r,n);return t.createStreamFromGenesis(vi.STREAM_TYPE_ID,c,a)}static async createFromGenesis(t,r,n={}){n={...Ry,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=r.data?await vi._signDagJWS(t,r):r;return t.createStreamFromGenesis(vi.STREAM_TYPE_ID,a,n)}static async deterministic(t,r,n={}){if(n={...Ry,...n},r={...r,deterministic:!0},r.family==null&&r.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let a=await vi.makeGenesis(t,null,r);return t.createStreamFromGenesis(vi.STREAM_TYPE_ID,a,n)}static async load(t,r,n={}){n={...xU,...n};let a=ac.from(r);if(a.type!=vi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${vi.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async update(t,r,n={}){n={...$A,...n};let a=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(a,t,r),c=await this.api.applyCommit(this.id,s,n);this.state$.next(c.state)}async patch(t,r={}){r={...$A,...r};let a={header:Ny(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},s=await vi._signDagJWS(this.api,a),c=await this.api.applyCommit(this.id,s,r);this.state$.next(c.state)}makeReadOnly(){this.update=Py,this.patch=Py,this.sync=Py,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let a=await this._makeRawCommit(r,n);return vi._signDagJWS(t,a)}async _makeRawCommit(t,r){r||(r={});let n=Ny(r,!1);if(t==null&&(t=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let a=E9.compare(this.content,t),s=this.state.log[0];return{header:n,data:a,prev:this.tip,id:s.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await zA(t);n.controllers=[c.hasParent?c.parent:c.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let a=Ny(n,!0);if(n?.deterministic&&r)throw new Error("Initial content must be null when creating a deterministic Tile document");if(r==null){let c={header:a};return jv(c),c}let s={data:r,header:a};return vi._signDagJWS(t,s)}static async _signDagJWS(t,r){return(await zA(t)).createDagJWS(r)}},"TileDocument");ts.STREAM_TYPE_NAME="tile";ts.STREAM_TYPE_ID=0;ts=vi=SU([jA()],ts);var YA=Ys(GA(),1);function PU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(PU,"_checkPrivateRedeclaration");function BU(e,t){return t.get?t.get.call(e):t.value}i(BU,"_classApplyDescriptorGet");function LU(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(LU,"_classApplyDescriptorSet");function JA(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(JA,"_classExtractFieldDescriptor");function Fy(e,t){var r=JA(e,t,"get");return BU(e,r)}i(Fy,"_classPrivateFieldGet");function WA(e,t,r){PU(e,t),t.set(e,r)}i(WA,"_classPrivateFieldInit");function ZA(e,t,r){var n=JA(e,t,"set");return LU(e,n,r),r}i(ZA,"_classPrivateFieldSet");function UU(e){return typeof e=="string"||hr.isInstance(e)||Yt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(UU,"keyToQuery");function jy(e){return typeof e=="string"?ac.from(e).toString():hr.isInstance(e)||Yt.isInstance(e)?e.toString():e.streamId.toString()}i(jy,"keyToString");async function zy(e){let t=await ts.makeGenesis({},null,{...e,deterministic:!0}),r=await Yt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(zy,"getDeterministicQuery");var FU=i(()=>Promise.resolve([]),"tempBatchLoadFn"),w0=new WeakMap,$y=new WeakMap,dc=class extends YA.default{cache(t){if(!Fy(this,$y))return!1;let r=t.id.toString();return this.clear(r).prime(r,t),!0}async create(t,r,n){let a=await ts.create(Fy(this,w0),t,r,n);return this.cache(a),a}async deterministic(t,r){let n=await zy(t);try{return await super.load(n)}catch{let s=await ts.createFromGenesis(Fy(this,w0),n.genesis,r);return this.cache(s),s}}async load(t){return await super.load(t)}async update(t,r,n,a){let s=jy(t);this.clear(s);let c=await this.load({streamId:s});return await c.update(r,n,a),c}constructor(t){super(FU,{cache:!0,cacheKeyFn:jy,cacheMap:t.cache!=null&&typeof t.cache!="boolean"?t.cache:void 0}),WA(this,w0,{writable:!0,value:void 0}),WA(this,$y,{writable:!0,value:void 0}),this._batchLoadFn=async r=>{t.cache||this.clearAll();let n=await t.ceramic.multiQuery(r.map(UU),t.multiqueryTimeout);return r.map(a=>{let s=jy(a),c=n[s];return c||new Error(`Failed to load stream: ${s}`)})},ZA(this,w0,t.ceramic),ZA(this,$y,!!t.cache)}};i(dc,"TileLoader");function jU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(jU,"_checkPrivateRedeclaration");function $U(e,t){return t.get?t.get.call(e):t.value}i($U,"_classApplyDescriptorGet");function zU(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(zU,"_classApplyDescriptorSet");function QA(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(QA,"_classExtractFieldDescriptor");function hc(e,t){var r=QA(e,t,"get");return $U(e,r)}i(hc,"_classPrivateFieldGet");function XA(e,t,r){jU(e,t),t.set(e,r)}i(XA,"_classPrivateFieldInit");function Hy(e,t,r){var n=QA(e,t,"set");return zU(e,n,r),r}i(Hy,"_classPrivateFieldSet");var Bu=new WeakMap,Lu=new WeakMap,Uu=class{get aliases(){return hc(this,Bu)}get loader(){return hc(this,Lu)}getDefinitionID(t){return hc(this,Bu).definitions[t]??null}getSchemaURL(t){return hc(this,Bu).schemas[t]??null}getTileID(t){return hc(this,Bu).tiles[t]??null}async loadTile(t){let r=this.getTileID(t);if(r==null)throw new Error(`Tile alias "${t}" is not defined`);return await hc(this,Lu).load(r)}async createTile(t,r,n={}){let a=this.getSchemaURL(t);if(a==null)throw new Error(`Schema alias "${t}" is not defined`);let{controller:s,...c}=n,l={schema:a};return s!=null&&(l.controllers=[s]),await hc(this,Lu).create(r,l,c)}constructor(t){if(XA(this,Bu,{writable:!0,value:void 0}),XA(this,Lu,{writable:!0,value:void 0}),Hy(this,Bu,t.aliases),t.loader!=null)Hy(this,Lu,t.loader);else{if(t.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");Hy(this,Lu,new dc({ceramic:t.ceramic,cache:t.cache}))}}};i(Uu,"DataModel");function HU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(HU,"_checkPrivateRedeclaration");function qU(e,t){return t.get?t.get.call(e):t.value}i(qU,"_classApplyDescriptorGet");function VU(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(VU,"_classApplyDescriptorSet");function e7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(e7,"_classExtractFieldDescriptor");function Fa(e,t){var r=e7(e,t,"get");return qU(e,r)}i(Fa,"_classPrivateFieldGet");function _0(e,t,r){HU(e,t),t.set(e,r)}i(_0,"_classPrivateFieldInit");function E0(e,t,r){var n=e7(e,t,"set");return VU(e,n,r),r}i(E0,"_classPrivateFieldSet");var A0=new WeakMap,pc=new WeakMap,qy=new WeakMap,S0=new WeakMap,Wf=class{_createValuePromise(){E0(this,qy,new Promise((t,r)=>{E0(this,S0,{resolve:t,reject:r})}))}change(t){return new Promise((r,n)=>{let a=i(async s=>{try{let c=await t(s);r(),this._next(c)}catch(c){n(c),this._next(s)}},"run");Fa(this,pc).push({reject:n,run:a}),Fa(this,pc).length===1&&this._start()})}async changeContent(t){let r=i(async n=>(await n.update(t(n.content),n.metadata),n),"mutation");return await this.change(r)}async get(){return Fa(this,pc).length===0?await Fa(this,A0).call(this):await Fa(this,qy)}async _start(){try{let t=await Fa(this,A0).call(this);this._next(t)}catch(t){Fa(this,pc).forEach(r=>{r.reject(t)}),E0(this,pc,[]),Fa(this,S0).reject(t),this._createValuePromise()}}_next(t){let r=Fa(this,pc).shift();r==null?this._end(t):r.run(t)}_end(t){Fa(this,S0).resolve(t),this._createValuePromise()}constructor(t){_0(this,A0,{writable:!0,value:void 0}),_0(this,pc,{writable:!0,value:[]}),_0(this,qy,{writable:!0,value:void 0}),_0(this,S0,{writable:!0,value:void 0}),E0(this,A0,t),this._createValuePromise()}};i(Wf,"TileProxy");var KU=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function GU(e){return KU.test(e)}i(GU,"isDIDstring");function WU(e){if(!GU(e))throw new Error(`Invalid DID: ${e}`)}i(WU,"assertDIDstring");function Vy(e){return WU(e),{controllers:[e],family:"IDX"}}i(Vy,"getIDXMetadata");function ZU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(ZU,"_checkPrivateRedeclaration");function JU(e,t){return t.get?t.get.call(e):t.value}i(JU,"_classApplyDescriptorGet");function YU(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(YU,"_classApplyDescriptorSet");function t7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(t7,"_classExtractFieldDescriptor");function $r(e,t){var r=t7(e,t,"get");return JU(e,r)}i($r,"_classPrivateFieldGet");function Zf(e,t,r){ZU(e,t),t.set(e,r)}i(Zf,"_classPrivateFieldInit");function x0(e,t,r){var n=t7(e,t,"set");return YU(e,n,r),r}i(x0,"_classPrivateFieldSet");var wo=new WeakMap,T0=new WeakMap,Ky=new WeakMap,ja=new WeakMap,C0=new WeakMap,Jf=class{get authenticated(){return $r(this,wo).did!=null}get ceramic(){return $r(this,wo)}get id(){if($r(this,T0)!=null)return $r(this,T0);if($r(this,wo).did==null)throw new Error("Ceramic instance is not authenticated");return $r(this,wo).did.hasParent?$r(this,wo).did.parent:$r(this,wo).did.id}get loader(){return $r(this,ja)}get model(){return $r(this,C0)}async has(t,r){let n=this.getDefinitionID(t);return await this.getRecordID(n,r)!=null}async get(t,r){let n=this.getDefinitionID(t);return await this.getRecord(n,r)}async getMultiple(t,r){let n=this.getDefinitionID(t),a=await Promise.all(r.map(async l=>{let{genesis:d,streamId:p}=await zy(Vy(l));return{genesis:d,streamId:p.toString(),paths:[n]}})),s=await $r(this,wo).multiQuery(a),c=[];for(let l of a){let d=s[l.streamId]?.content?.[n],p=d?s[Yt.fromString(d).toString()]:null;c.push(p?.content??null)}return c}async set(t,r,n={}){let a=this.getDefinitionID(t),[s,c]=await this._setRecordOnly(a,r,n);return s&&await this._setReference(n.controller??this.id,a,c),c}async merge(t,r,n={}){let a=this.getDefinitionID(t),s=await this.getRecord(a),c=s?{...s,...r}:r;return await this.setRecord(a,c,n)}async setAll(t,r={}){let n=Object.entries(t).map(async([c,l])=>{let d=this.getDefinitionID(c),[p,g]=await this._setRecordOnly(d,l,r);return[p,d,g]}),s=(await Promise.all(n)).reduce((c,[l,d,p])=>(l&&(c[d]=p.toUrl()),c),{});return await this._setReferences(r.controller??this.id,s),s}async setDefaults(t,r={}){let n=await this.getIndex()??{},a=Object.entries(t).map(([l,d])=>[this.getDefinitionID(l),d]).filter(l=>n[l[0]]==null).map(async([l,d])=>{let p=await this.getDefinition(l),g=await this._createRecord(p,d,r);return{[l]:g.toUrl()}}),c=(await Promise.all(a)).reduce((l,d)=>Object.assign(l,d),{});return await this._setReferences(r.controller??this.id,c),c}async remove(t,r=this.id){await this._getIndexProxy(r).changeContent(n=>(n!=null&&delete n[this.getDefinitionID(t)],n))}async getIndex(t=this.id){let r=this.authenticated&&t===this.id?await this._getIndexProxy(t).get():await this._getIDXDoc(t);return r?r.content:null}iterator(t){let r,n=0;return{[Symbol.asyncIterator](){return this},next:async()=>{if(r==null){let l=await this.getIndex(t);r=Object.entries(l??{})}if(n===r.length)return{done:!0,value:null};let[a,s]=r[n++],c=await $r(this,ja).load(s);return{done:!1,value:{key:a,id:s,record:c.content}}}}}async _createIDXDoc(t){return await $r(this,ja).deterministic(Vy(t))}async _getIDXDoc(t){let r=await this._createIDXDoc(t);if(r.content==null||r.metadata.schema==null)return null;if(r.metadata.schema!==Vp)throw new Error("Invalid document: schema is not IdentityIndex");return r}async _getOwnIDXDoc(t){let r=await this._createIDXDoc(t);if(r.content==null||r.metadata.schema==null)await r.update({},{schema:Vp});else if(r.metadata.schema!==Vp)throw new Error("Invalid document: schema is not IdentityIndex");return r}_getIndexProxy(t){let r=$r(this,Ky)[t];return r==null&&(r=new Wf(async()=>await this._getOwnIDXDoc(t)),$r(this,Ky)[t]=r),r}getDefinitionID(t){return $r(this,C0).getDefinitionID(t)??t}async getDefinition(t){let r=await $r(this,ja).load(t);if(r.metadata.schema!==b9)throw new Error("Invalid document: schema is not Definition");return{...r.content,id:r.id}}async getRecordID(t,r){return(await this.getIndex(r??this.id))?.[t]??null}async getRecordDocument(t,r){let n=await this.getRecordID(t,r);return n?await $r(this,ja).load(n):null}async getRecord(t,r){let n=await this.getRecordDocument(t,r);return n?n.content:null}async setRecord(t,r,n={}){let[a,s]=await this._setRecordOnly(t,r,n);return a&&await this._setReference(n.controller??this.id,t,s),s}async _setRecordOnly(t,r,n){let a=await this.getRecordID(t,n.controller??this.id);if(a==null){let s=await this.getDefinition(t),c=await this._createRecord(s,r,n);return[!0,c]}else{let s=await $r(this,ja).update(a,r);return[!1,s.id]}}async _createRecord(t,r,{controller:n,pin:a}){let s=await $r(this,ja).deterministic({controllers:[n??this.id],family:t.id.toString()},{pin:a});return await s.update(r,{schema:t.schema}),s.id}async _setReference(t,r,n){await this._getIndexProxy(t).changeContent(a=>({...a,[r]:n.toUrl()}))}async _setReferences(t,r){Object.keys(r).length!==0&&await this._getIndexProxy(t).changeContent(n=>({...n,...r}))}constructor(t){Zf(this,wo,{writable:!0,value:void 0}),Zf(this,T0,{writable:!0,value:void 0}),Zf(this,Ky,{writable:!0,value:{}}),Zf(this,ja,{writable:!0,value:void 0}),Zf(this,C0,{writable:!0,value:void 0});let{cache:r,ceramic:n,id:a,loader:s,model:c}=t;x0(this,wo,n),x0(this,T0,a),x0(this,ja,s??new dc({ceramic:n,cache:r})),x0(this,C0,c instanceof Uu?c:new Uu({loader:$r(this,ja),aliases:c}))}};i(Jf,"DIDDataStore");var rr;(function(e){e.assertEqual=a=>a;function t(a){}i(t,"assertIs"),e.assertIs=t;function r(a){throw new Error}i(r,"assertNever"),e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}i(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(rr||(rr={}));var Wy;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Wy||(Wy={}));var nt=rr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rs=i(e=>{switch(typeof e){case"undefined":return nt.undefined;case"string":return nt.string;case"number":return isNaN(e)?nt.nan:nt.number;case"boolean":return nt.boolean;case"function":return nt.function;case"bigint":return nt.bigint;case"symbol":return nt.symbol;case"object":return Array.isArray(e)?nt.array:e===null?nt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?nt.promise:typeof Map<"u"&&e instanceof Map?nt.map:typeof Set<"u"&&e instanceof Set?nt.set:typeof Date<"u"&&e instanceof Date?nt.date:nt.object;default:return nt.unknown}},"getParsedType"),qe=rr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),XU=i(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Sn=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(s){return s.message},n={_errors:[]},a=i(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,d=0;for(;d<c.path.length;){let p=c.path[d];d===c.path.length-1?(l[p]=l[p]||{_errors:[]},l[p]._errors.push(r(c))):l[p]=l[p]||{_errors:[]},l=l[p],d++}}},"processError");return a(this),n}static assert(t){if(!(t instanceof Sn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};i(Sn,"ZodError");Sn.create=e=>new Sn(e);var zu=i((e,t)=>{let r;switch(e.code){case qe.invalid_type:e.received===nt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case qe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,rr.jsonStringifyReplacer)}`;break;case qe.unrecognized_keys:r=`Unrecognized key(s) in object: ${rr.joinValues(e.keys,", ")}`;break;case qe.invalid_union:r="Invalid input";break;case qe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${rr.joinValues(e.options)}`;break;case qe.invalid_enum_value:r=`Invalid enum value. Expected ${rr.joinValues(e.options)}, received '${e.received}'`;break;case qe.invalid_arguments:r="Invalid function arguments";break;case qe.invalid_return_type:r="Invalid function return type";break;case qe.invalid_date:r="Invalid date";break;case qe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:rr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case qe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case qe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case qe.custom:r="Invalid input";break;case qe.invalid_intersection_types:r="Intersection results could not be merged";break;case qe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case qe.not_finite:r="Number must be finite";break;default:r=t.defaultError,rr.assertNever(e)}return{message:r}},"errorMap"),i7=zu;function QU(e){i7=e}i(QU,"setErrorMap");function M0(){return i7}i(M0,"getErrorMap");var I0=i(e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="",d=n.filter(p=>!!p).slice().reverse();for(let p of d)l=p(c,{data:t,defaultError:l}).message;return{...a,path:s,message:l}},"makeIssue"),eF=[];function et(e,t){let r=M0(),n=I0({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===zu?void 0:zu].filter(a=>!!a)});e.common.issues.push(n)}i(et,"addIssueToContext");var Yr=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let a of r){if(a.status==="aborted")return It;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r){let s=await a.key,c=await a.value;n.push({key:s,value:c})}return Yr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:s,value:c}=a;if(s.status==="aborted"||c.status==="aborted")return It;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||a.alwaysSet)&&(n[s.value]=c.value)}return{status:t.value,value:n}}};i(Yr,"ParseStatus");var It=Object.freeze({status:"aborted"}),ju=i(e=>({status:"dirty",value:e}),"DIRTY"),Rn=i(e=>({status:"valid",value:e}),"OK"),Zy=i(e=>e.status==="aborted","isAborted"),Jy=i(e=>e.status==="dirty","isDirty"),Qf=i(e=>e.status==="valid","isValid"),ed=i(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");function k0(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}i(k0,"__classPrivateFieldGet");function a7(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r}i(a7,"__classPrivateFieldSet");var bt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(bt||(bt={}));var Yf,Xf,yi=class{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};i(yi,"ParseInputLazyPath");var r7=i((e,t)=>{if(Qf(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Sn(e.common.issues);return this._error=r,this._error}}},"handleResult");function jt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:i((c,l)=>{var d,p;let{message:g}=e;return c.code==="invalid_enum_value"?{message:g??l.defaultError}:typeof l.data>"u"?{message:(d=g??n)!==null&&d!==void 0?d:l.defaultError}:c.code!=="invalid_type"?{message:l.defaultError}:{message:(p=g??r)!==null&&p!==void 0?p:l.defaultError}},"customMap"),description:a}}i(jt,"processCreateParams");var Lt=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return rs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:rs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yr,ctx:{common:t.parent.common,data:t.data,parsedType:rs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(ed(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let a={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:rs(t)},s=this._parseSync({data:t,path:a.path,parent:a});return r7(a,s)}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:rs(t)},a=this._parse({data:t,path:n.path,parent:n}),s=await(ed(a)?a:Promise.resolve(a));return r7(n,s)}refine(t,r){let n=i(a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r,"getIssueProperties");return this._refinement((a,s)=>{let c=t(a),l=i(()=>s.addIssue({code:qe.custom,...n(a)}),"setError");return typeof Promise<"u"&&c instanceof Promise?c.then(d=>d?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new Jn({schema:this,typeName:Ct.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return wi.create(this,this._def)}nullable(){return la.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zn.create(this,this._def)}promise(){return So.create(this,this._def)}or(t){return os.create([this,t],this._def)}and(t){return ss.create(this,t,this._def)}transform(t){return new Jn({...jt(this._def),schema:this,typeName:Ct.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ds({...jt(this._def),innerType:this,defaultValue:r,typeName:Ct.ZodDefault})}brand(){return new $u({typeName:Ct.ZodBranded,type:this,...jt(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new hs({...jt(this._def),innerType:this,catchValue:r,typeName:Ct.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ps.create(this,t)}readonly(){return ms.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};i(Lt,"ZodType");var tF=/^c[^\s-]{8,}$/i,rF=/^[0-9a-z]+$/,nF=/^[0-9A-HJKMNP-TV-Z]{26}$/,iF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,aF=/^[a-z0-9_-]{21}$/i,oF=/^[-+]?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)?)??$/,sF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Gy,uF=/^(?:(?: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])$/,lF=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,fF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,o7="((\\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])))",dF=new RegExp(`^${o7}$`);function s7(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}i(s7,"timeRegexSource");function hF(e){return new RegExp(`^${s7(e)}$`)}i(hF,"timeRegex");function c7(e){let t=`${o7}T${s7(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}i(c7,"datetimeRegex");function pF(e,t){return!!((t==="v4"||!t)&&uF.test(e)||(t==="v6"||!t)&&lF.test(e))}i(pF,"isValidIP");var Wn=class extends Lt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==nt.string){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:nt.string,received:s.parsedType}),It}let n=new Yr,a;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),et(a,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),et(a,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let c=t.data.length>s.value,l=t.data.length<s.value;(c||l)&&(a=this._getOrReturnCtx(t,a),c?et(a,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&et(a,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")sF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"email",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Gy||(Gy=new RegExp(cF,"u")),Gy.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"emoji",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")iF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"uuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")aF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"nanoid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")tF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"cuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")rF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"cuid2",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")nF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"ulid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),et(a,{validation:"url",code:qe.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"regex",code:qe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?c7(s).test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?dF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?hF(s).test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?oF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"duration",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?pF(t.data,s.version)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"ip",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?fF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"base64",code:qe.invalid_string,message:s.message}),n.dirty()):rr.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:qe.invalid_string,...bt.errToObj(n)})}_addCheck(t){return new Wn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...bt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...bt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...bt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...bt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...bt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...bt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...bt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...bt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...bt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...bt.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,local:(n=t?.local)!==null&&n!==void 0?n:!1,...bt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...bt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...bt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...bt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...bt.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...bt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...bt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...bt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...bt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...bt.errToObj(r)})}nonempty(t){return this.min(1,bt.errToObj(t))}trim(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};i(Wn,"ZodString");Wn.create=e=>{var t;return new Wn({checks:[],typeName:Ct.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...jt(e)})};function mF(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}i(mF,"floatSafeRemainder");var sa=class extends Lt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==nt.number){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:nt.number,received:s.parsedType}),It}let n,a=new Yr;for(let s of this._def.checks)s.kind==="int"?rr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),et(n,{code:qe.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?mF(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),et(n,{code:qe.not_finite,message:s.message}),a.dirty()):rr.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,bt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,bt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,bt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,bt.toString(r))}setLimit(t,r,n,a){return new sa({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:bt.toString(a)}]})}_addCheck(t){return new sa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:bt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:bt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:bt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:bt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:bt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:bt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:bt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:bt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:bt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&rr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};i(sa,"ZodNumber");sa.create=e=>new sa({checks:[],typeName:Ct.ZodNumber,coerce:e?.coerce||!1,...jt(e)});var ca=class extends Lt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==nt.bigint){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:nt.bigint,received:s.parsedType}),It}let n,a=new Yr;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):rr.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,bt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,bt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,bt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,bt.toString(r))}setLimit(t,r,n,a){return new ca({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:bt.toString(a)}]})}_addCheck(t){return new ca({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:bt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:bt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:bt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:bt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:bt.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};i(ca,"ZodBigInt");ca.create=e=>{var t;return new ca({checks:[],typeName:Ct.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...jt(e)})};var ns=class extends Lt{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==nt.boolean){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.boolean,received:n.parsedType}),It}return Rn(t.data)}};i(ns,"ZodBoolean");ns.create=e=>new ns({typeName:Ct.ZodBoolean,coerce:e?.coerce||!1,...jt(e)});var $a=class extends Lt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==nt.date){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:nt.date,received:s.parsedType}),It}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_date}),It}let n=new Yr,a;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),et(a,{code:qe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),et(a,{code:qe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):rr.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new $a({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:bt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:bt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};i($a,"ZodDate");$a.create=e=>new $a({checks:[],coerce:e?.coerce||!1,typeName:Ct.ZodDate,...jt(e)});var mc=class extends Lt{_parse(t){if(this._getType(t)!==nt.symbol){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.symbol,received:n.parsedType}),It}return Rn(t.data)}};i(mc,"ZodSymbol");mc.create=e=>new mc({typeName:Ct.ZodSymbol,...jt(e)});var is=class extends Lt{_parse(t){if(this._getType(t)!==nt.undefined){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.undefined,received:n.parsedType}),It}return Rn(t.data)}};i(is,"ZodUndefined");is.create=e=>new is({typeName:Ct.ZodUndefined,...jt(e)});var as=class extends Lt{_parse(t){if(this._getType(t)!==nt.null){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.null,received:n.parsedType}),It}return Rn(t.data)}};i(as,"ZodNull");as.create=e=>new as({typeName:Ct.ZodNull,...jt(e)});var Eo=class extends Lt{constructor(){super(...arguments),this._any=!0}_parse(t){return Rn(t.data)}};i(Eo,"ZodAny");Eo.create=e=>new Eo({typeName:Ct.ZodAny,...jt(e)});var za=class extends Lt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Rn(t.data)}};i(za,"ZodUnknown");za.create=e=>new za({typeName:Ct.ZodUnknown,...jt(e)});var qi=class extends Lt{_parse(t){let r=this._getOrReturnCtx(t);return et(r,{code:qe.invalid_type,expected:nt.never,received:r.parsedType}),It}};i(qi,"ZodNever");qi.create=e=>new qi({typeName:Ct.ZodNever,...jt(e)});var gc=class extends Lt{_parse(t){if(this._getType(t)!==nt.undefined){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.void,received:n.parsedType}),It}return Rn(t.data)}};i(gc,"ZodVoid");gc.create=e=>new gc({typeName:Ct.ZodVoid,...jt(e)});var Zn=class extends Lt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==nt.array)return et(r,{code:qe.invalid_type,expected:nt.array,received:r.parsedType}),It;if(a.exactLength!==null){let c=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(c||l)&&(et(r,{code:c?qe.too_big:qe.too_small,minimum:l?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(et(r,{code:qe.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(et(r,{code:qe.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>a.type._parseAsync(new yi(r,c,r.path,l)))).then(c=>Yr.mergeArray(n,c));let s=[...r.data].map((c,l)=>a.type._parseSync(new yi(r,c,r.path,l)));return Yr.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new Zn({...this._def,minLength:{value:t,message:bt.toString(r)}})}max(t,r){return new Zn({...this._def,maxLength:{value:t,message:bt.toString(r)}})}length(t,r){return new Zn({...this._def,exactLength:{value:t,message:bt.toString(r)}})}nonempty(t){return this.min(1,t)}};i(Zn,"ZodArray");Zn.create=(e,t)=>new Zn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ct.ZodArray,...jt(t)});function Fu(e){if(e instanceof Tr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=wi.create(Fu(n))}return new Tr({...e._def,shape:()=>t})}else return e instanceof Zn?new Zn({...e._def,type:Fu(e.element)}):e instanceof wi?wi.create(Fu(e.unwrap())):e instanceof la?la.create(Fu(e.unwrap())):e instanceof bi?bi.create(e.items.map(t=>Fu(t))):e}i(Fu,"deepPartialify");var Tr=class extends Lt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=rr.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==nt.object){let p=this._getOrReturnCtx(t);return et(p,{code:qe.invalid_type,expected:nt.object,received:p.parsedType}),It}let{status:n,ctx:a}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof qi&&this._def.unknownKeys==="strip"))for(let p in a.data)c.includes(p)||l.push(p);let d=[];for(let p of c){let g=s[p],v=a.data[p];d.push({key:{status:"valid",value:p},value:g._parse(new yi(a,v,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof qi){let p=this._def.unknownKeys;if(p==="passthrough")for(let g of l)d.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(p==="strict")l.length>0&&(et(a,{code:qe.unrecognized_keys,keys:l}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let g of l){let v=a.data[g];d.push({key:{status:"valid",value:g},value:p._parse(new yi(a,v,a.path,g)),alwaysSet:g in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let g of d){let v=await g.key,y=await g.value;p.push({key:v,value:y,alwaysSet:g.alwaysSet})}return p}).then(p=>Yr.mergeObjectSync(n,p)):Yr.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(t){return bt.errToObj,new Tr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,s,c,l;let d=(c=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=bt.errToObj(t).message)!==null&&l!==void 0?l:d}:{message:d}}}:{}})}strip(){return new Tr({...this._def,unknownKeys:"strip"})}passthrough(){return new Tr({...this._def,unknownKeys:"passthrough"})}extend(t){return new Tr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Tr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ct.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Tr({...this._def,catchall:t})}pick(t){let r={};return rr.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Tr({...this._def,shape:()=>r})}omit(t){let r={};return rr.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Tr({...this._def,shape:()=>r})}deepPartial(){return Fu(this)}partial(t){let r={};return rr.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}),new Tr({...this._def,shape:()=>r})}required(t){let r={};return rr.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof wi;)s=s._def.innerType;r[n]=s}}),new Tr({...this._def,shape:()=>r})}keyof(){return u7(rr.objectKeys(this.shape))}};i(Tr,"ZodObject");Tr.create=(e,t)=>new Tr({shape:()=>e,unknownKeys:"strip",catchall:qi.create(),typeName:Ct.ZodObject,...jt(t)});Tr.strictCreate=(e,t)=>new Tr({shape:()=>e,unknownKeys:"strict",catchall:qi.create(),typeName:Ct.ZodObject,...jt(t)});Tr.lazycreate=(e,t)=>new Tr({shape:e,unknownKeys:"strip",catchall:qi.create(),typeName:Ct.ZodObject,...jt(t)});var os=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new Sn(l.ctx.common.issues));return et(r,{code:qe.invalid_union,unionErrors:c}),It}if(i(a,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(a);{let s,c=[];for(let d of n){let p={...r,common:{...r.common,issues:[]},parent:null},g=d._parseSync({data:r.data,path:r.path,parent:p});if(g.status==="valid")return g;g.status==="dirty"&&!s&&(s={result:g,ctx:p}),p.common.issues.length&&c.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(d=>new Sn(d));return et(r,{code:qe.invalid_union,unionErrors:l}),It}}get options(){return this._def.options}};i(os,"ZodUnion");os.create=(e,t)=>new os({options:e,typeName:Ct.ZodUnion,...jt(t)});var _o=i(e=>e instanceof us?_o(e.schema):e instanceof Jn?_o(e.innerType()):e instanceof ls?[e.value]:e instanceof ua?e.options:e instanceof fs?rr.objectValues(e.enum):e instanceof ds?_o(e._def.innerType):e instanceof is?[void 0]:e instanceof as?[null]:e instanceof wi?[void 0,..._o(e.unwrap())]:e instanceof la?[null,..._o(e.unwrap())]:e instanceof $u||e instanceof ms?_o(e.unwrap()):e instanceof hs?_o(e._def.innerType):[],"getDiscriminator"),vc=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.object)return et(r,{code:qe.invalid_type,expected:nt.object,received:r.parsedType}),It;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(et(r,{code:qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),It)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let s of r){let c=_o(s.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of c){if(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,s)}}return new vc({typeName:Ct.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...jt(n)})}};i(vc,"ZodDiscriminatedUnion");function Yy(e,t){let r=rs(e),n=rs(t);if(e===t)return{valid:!0,data:e};if(r===nt.object&&n===nt.object){let a=rr.objectKeys(t),s=rr.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let d=Yy(e[l],t[l]);if(!d.valid)return{valid:!1};c[l]=d.data}return{valid:!0,data:c}}else if(r===nt.array&&n===nt.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],d=Yy(c,l);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===nt.date&&n===nt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(Yy,"mergeValues");var ss=class extends Lt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=i((s,c)=>{if(Zy(s)||Zy(c))return It;let l=Yy(s.value,c.value);return l.valid?((Jy(s)||Jy(c))&&r.dirty(),{status:r.value,value:l.data}):(et(n,{code:qe.invalid_intersection_types}),It)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>a(s,c)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};i(ss,"ZodIntersection");ss.create=(e,t,r)=>new ss({left:e,right:t,typeName:Ct.ZodIntersection,...jt(r)});var bi=class extends Lt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==nt.array)return et(n,{code:qe.invalid_type,expected:nt.array,received:n.parsedType}),It;if(n.data.length<this._def.items.length)return et(n,{code:qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),It;!this._def.rest&&n.data.length>this._def.items.length&&(et(n,{code:qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((c,l)=>{let d=this._def.items[l]||this._def.rest;return d?d._parse(new yi(n,c,n.path,l)):null}).filter(c=>!!c);return n.common.async?Promise.all(s).then(c=>Yr.mergeArray(r,c)):Yr.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new bi({...this._def,rest:t})}};i(bi,"ZodTuple");bi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bi({items:e,typeName:Ct.ZodTuple,rest:null,...jt(t)})};var cs=class extends Lt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==nt.object)return et(n,{code:qe.invalid_type,expected:nt.object,received:n.parsedType}),It;let a=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)a.push({key:s._parse(new yi(n,l,n.path,l)),value:c._parse(new yi(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Yr.mergeObjectAsync(r,a):Yr.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Lt?new cs({keyType:t,valueType:r,typeName:Ct.ZodRecord,...jt(n)}):new cs({keyType:Wn.create(),valueType:t,typeName:Ct.ZodRecord,...jt(r)})}};i(cs,"ZodRecord");var yc=class extends Lt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==nt.map)return et(n,{code:qe.invalid_type,expected:nt.map,received:n.parsedType}),It;let a=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,d],p)=>({key:a._parse(new yi(n,l,n.path,[p,"key"])),value:s._parse(new yi(n,d,n.path,[p,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let d of c){let p=await d.key,g=await d.value;if(p.status==="aborted"||g.status==="aborted")return It;(p.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(p.value,g.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let d of c){let p=d.key,g=d.value;if(p.status==="aborted"||g.status==="aborted")return It;(p.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(p.value,g.value)}return{status:r.value,value:l}}}};i(yc,"ZodMap");yc.create=(e,t,r)=>new yc({valueType:t,keyType:e,typeName:Ct.ZodMap,...jt(r)});var Ha=class extends Lt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==nt.set)return et(n,{code:qe.invalid_type,expected:nt.set,received:n.parsedType}),It;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(et(n,{code:qe.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(et(n,{code:qe.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function c(d){let p=new Set;for(let g of d){if(g.status==="aborted")return It;g.status==="dirty"&&r.dirty(),p.add(g.value)}return{status:r.value,value:p}}i(c,"finalizeSet");let l=[...n.data.values()].map((d,p)=>s._parse(new yi(n,d,n.path,p)));return n.common.async?Promise.all(l).then(d=>c(d)):c(l)}min(t,r){return new Ha({...this._def,minSize:{value:t,message:bt.toString(r)}})}max(t,r){return new Ha({...this._def,maxSize:{value:t,message:bt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};i(Ha,"ZodSet");Ha.create=(e,t)=>new Ha({valueType:e,minSize:null,maxSize:null,typeName:Ct.ZodSet,...jt(t)});var Ao=class extends Lt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.function)return et(r,{code:qe.invalid_type,expected:nt.function,received:r.parsedType}),It;function n(l,d){return I0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,M0(),zu].filter(p=>!!p),issueData:{code:qe.invalid_arguments,argumentsError:d}})}i(n,"makeArgsIssue");function a(l,d){return I0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,M0(),zu].filter(p=>!!p),issueData:{code:qe.invalid_return_type,returnTypeError:d}})}i(a,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof So){let l=this;return Rn(async function(...d){let p=new Sn([]),g=await l._def.args.parseAsync(d,s).catch(_=>{throw p.addIssue(n(d,_)),p}),v=await Reflect.apply(c,this,g);return await l._def.returns._def.type.parseAsync(v,s).catch(_=>{throw p.addIssue(a(v,_)),p})})}else{let l=this;return Rn(function(...d){let p=l._def.args.safeParse(d,s);if(!p.success)throw new Sn([n(d,p.error)]);let g=Reflect.apply(c,this,p.data),v=l._def.returns.safeParse(g,s);if(!v.success)throw new Sn([a(g,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ao({...this._def,args:bi.create(t).rest(za.create())})}returns(t){return new Ao({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Ao({args:t||bi.create([]).rest(za.create()),returns:r||za.create(),typeName:Ct.ZodFunction,...jt(n)})}};i(Ao,"ZodFunction");var us=class extends Lt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};i(us,"ZodLazy");us.create=(e,t)=>new us({getter:e,typeName:Ct.ZodLazy,...jt(t)});var ls=class extends Lt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return et(r,{received:r.data,code:qe.invalid_literal,expected:this._def.value}),It}return{status:"valid",value:t.data}}get value(){return this._def.value}};i(ls,"ZodLiteral");ls.create=(e,t)=>new ls({value:e,typeName:Ct.ZodLiteral,...jt(t)});function u7(e,t){return new ua({values:e,typeName:Ct.ZodEnum,...jt(t)})}i(u7,"createZodEnum");var ua=class extends Lt{constructor(){super(...arguments),Yf.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return et(r,{expected:rr.joinValues(n),received:r.parsedType,code:qe.invalid_type}),It}if(k0(this,Yf,"f")||a7(this,Yf,new Set(this._def.values),"f"),!k0(this,Yf,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return et(r,{received:r.data,code:qe.invalid_enum_value,options:n}),It}return Rn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ua.create(t,{...this._def,...r})}exclude(t,r=this._def){return ua.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};i(ua,"ZodEnum");Yf=new WeakMap;ua.create=u7;var fs=class extends Lt{constructor(){super(...arguments),Xf.set(this,void 0)}_parse(t){let r=rr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==nt.string&&n.parsedType!==nt.number){let a=rr.objectValues(r);return et(n,{expected:rr.joinValues(a),received:n.parsedType,code:qe.invalid_type}),It}if(k0(this,Xf,"f")||a7(this,Xf,new Set(rr.getValidEnumValues(this._def.values)),"f"),!k0(this,Xf,"f").has(t.data)){let a=rr.objectValues(r);return et(n,{received:n.data,code:qe.invalid_enum_value,options:a}),It}return Rn(t.data)}get enum(){return this._def.values}};i(fs,"ZodNativeEnum");Xf=new WeakMap;fs.create=(e,t)=>new fs({values:e,typeName:Ct.ZodNativeEnum,...jt(t)});var So=class extends Lt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.promise&&r.common.async===!1)return et(r,{code:qe.invalid_type,expected:nt.promise,received:r.parsedType}),It;let n=r.parsedType===nt.promise?r.data:Promise.resolve(r.data);return Rn(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};i(So,"ZodPromise");So.create=(e,t)=>new So({type:e,typeName:Ct.ZodPromise,...jt(t)});var Jn=class extends Lt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ct.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:c=>{et(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let c=a.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return It;let d=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return d.status==="aborted"?It:d.status==="dirty"||r.value==="dirty"?ju(d.value):d});{if(r.value==="aborted")return It;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?It:l.status==="dirty"||r.value==="dirty"?ju(l.value):l}}if(a.type==="refinement"){let c=i(l=>{let d=a.refinement(l,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?It:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?It:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Qf(c))return c;let l=a.transform(c.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>Qf(c)?Promise.resolve(a.transform(c.value,s)).then(l=>({status:r.value,value:l})):c);rr.assertNever(a)}};i(Jn,"ZodEffects");Jn.create=(e,t,r)=>new Jn({schema:e,typeName:Ct.ZodEffects,effect:t,...jt(r)});Jn.createWithPreprocess=(e,t,r)=>new Jn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ct.ZodEffects,...jt(r)});var wi=class extends Lt{_parse(t){return this._getType(t)===nt.undefined?Rn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(wi,"ZodOptional");wi.create=(e,t)=>new wi({innerType:e,typeName:Ct.ZodOptional,...jt(t)});var la=class extends Lt{_parse(t){return this._getType(t)===nt.null?Rn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(la,"ZodNullable");la.create=(e,t)=>new la({innerType:e,typeName:Ct.ZodNullable,...jt(t)});var ds=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===nt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};i(ds,"ZodDefault");ds.create=(e,t)=>new ds({innerType:e,typeName:Ct.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...jt(t)});var hs=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ed(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Sn(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Sn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};i(hs,"ZodCatch");hs.create=(e,t)=>new hs({innerType:e,typeName:Ct.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...jt(t)});var bc=class extends Lt{_parse(t){if(this._getType(t)!==nt.nan){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.nan,received:n.parsedType}),It}return{status:"valid",value:t.data}}};i(bc,"ZodNaN");bc.create=e=>new bc({typeName:Ct.ZodNaN,...jt(e)});var gF=Symbol("zod_brand"),$u=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};i($u,"ZodBranded");var ps=class extends Lt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return i(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?It:s.status==="dirty"?(r.dirty(),ju(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?It:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new ps({in:t,out:r,typeName:Ct.ZodPipeline})}};i(ps,"ZodPipeline");var ms=class extends Lt{_parse(t){let r=this._def.innerType._parse(t),n=i(a=>(Qf(a)&&(a.value=Object.freeze(a.value)),a),"freeze");return ed(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}};i(ms,"ZodReadonly");ms.create=(e,t)=>new ms({innerType:e,typeName:Ct.ZodReadonly,...jt(t)});function l7(e,t={},r){return e?Eo.create().superRefine((n,a)=>{var s,c;if(!e(n)){let l=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,d=(c=(s=l.fatal)!==null&&s!==void 0?s:r)!==null&&c!==void 0?c:!0,p=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...p,fatal:d})}}):Eo.create()}i(l7,"custom");var vF={object:Tr.lazycreate},Ct;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ct||(Ct={}));var yF=i((e,t={message:`Input not instance of ${e.name}`})=>l7(r=>r instanceof e,t),"instanceOfType"),f7=Wn.create,d7=sa.create,bF=bc.create,wF=ca.create,h7=ns.create,_F=$a.create,EF=mc.create,AF=is.create,SF=as.create,xF=Eo.create,TF=za.create,CF=qi.create,MF=gc.create,IF=Zn.create,kF=Tr.create,DF=Tr.strictCreate,OF=os.create,RF=vc.create,NF=ss.create,PF=bi.create,BF=cs.create,LF=yc.create,UF=Ha.create,FF=Ao.create,jF=us.create,$F=ls.create,zF=ua.create,HF=fs.create,qF=So.create,n7=Jn.create,VF=wi.create,KF=la.create,GF=Jn.createWithPreprocess,WF=ps.create,ZF=i(()=>f7().optional(),"ostring"),JF=i(()=>d7().optional(),"onumber"),YF=i(()=>h7().optional(),"oboolean"),XF={string:e=>Wn.create({...e,coerce:!0}),number:e=>sa.create({...e,coerce:!0}),boolean:e=>ns.create({...e,coerce:!0}),bigint:e=>ca.create({...e,coerce:!0}),date:e=>$a.create({...e,coerce:!0})},QF=It,z=Object.freeze({__proto__:null,defaultErrorMap:zu,setErrorMap:QU,getErrorMap:M0,makeIssue:I0,EMPTY_PATH:eF,addIssueToContext:et,ParseStatus:Yr,INVALID:It,DIRTY:ju,OK:Rn,isAborted:Zy,isDirty:Jy,isValid:Qf,isAsync:ed,get util(){return rr},get objectUtil(){return Wy},ZodParsedType:nt,getParsedType:rs,ZodType:Lt,datetimeRegex:c7,ZodString:Wn,ZodNumber:sa,ZodBigInt:ca,ZodBoolean:ns,ZodDate:$a,ZodSymbol:mc,ZodUndefined:is,ZodNull:as,ZodAny:Eo,ZodUnknown:za,ZodNever:qi,ZodVoid:gc,ZodArray:Zn,ZodObject:Tr,ZodUnion:os,ZodDiscriminatedUnion:vc,ZodIntersection:ss,ZodTuple:bi,ZodRecord:cs,ZodMap:yc,ZodSet:Ha,ZodFunction:Ao,ZodLazy:us,ZodLiteral:ls,ZodEnum:ua,ZodNativeEnum:fs,ZodPromise:So,ZodEffects:Jn,ZodTransformer:Jn,ZodOptional:wi,ZodNullable:la,ZodDefault:ds,ZodCatch:hs,ZodNaN:bc,BRAND:gF,ZodBranded:$u,ZodPipeline:ps,ZodReadonly:ms,custom:l7,Schema:Lt,ZodSchema:Lt,late:vF,get ZodFirstPartyTypeKind(){return Ct},coerce:XF,any:xF,array:IF,bigint:wF,boolean:h7,date:_F,discriminatedUnion:RF,effect:n7,enum:zF,function:FF,instanceof:yF,intersection:NF,lazy:jF,literal:$F,map:LF,nan:bF,nativeEnum:HF,never:CF,null:SF,nullable:KF,number:d7,object:kF,oboolean:YF,onumber:JF,optional:VF,ostring:ZF,pipeline:WF,preprocess:GF,promise:qF,record:BF,set:UF,strictObject:DF,string:f7,symbol:EF,transformer:n7,tuple:PF,undefined:AF,union:OF,unknown:TF,void:MF,NEVER:QF,ZodIssueCode:qe,quotelessJson:XU,ZodError:Sn});var Hu=Symbol("current"),wc=Symbol("previous");var td=i((e,{ref:t,refType:r,param:n,header:a,...s}={})=>({...s,...e}),"mergeOpenApi");function p7(e){if(typeof e.ZodType.prototype.openapi<"u")return;e.ZodType.prototype.openapi=function(s){let{zodOpenApi:c,...l}=this._def,d=new this.constructor({...l,zodOpenApi:{openapi:td(s,c?.openapi)}});return d._def.zodOpenApi[Hu]=d,c&&(d._def.zodOpenApi[wc]=this),d};let t=e.ZodType.prototype.describe;e.ZodType.prototype.describe=function(...s){let c=t.apply(this,s),l=c._def;if(l.zodOpenApi){let d={...l.zodOpenApi};d.openapi=td({description:s[0]},d.openapi),d[wc]=this,d[Hu]=c,l.zodOpenApi=d}else l.zodOpenApi={openapi:{description:s[0]},[Hu]:c};return c};let r=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...s){let c=r.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=td({},d.openapi),d[wc]=this,c._def.zodOpenApi=d}else c._def.zodOpenApi={[wc]:this};return c};let n=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...s){let c=n.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=td({},d.openapi),delete d[wc],delete d[Hu],c._def.zodOpenApi=d}return c};let a=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...s){let c=a.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=td({},d.openapi),delete d[wc],delete d[Hu],c._def.zodOpenApi=d}return c}}i(p7,"extendZodWithOpenApi");p7(z);var ej=Object.defineProperty,tj=i((e,t)=>ej(e,"name",{value:t,configurable:!0}),"__name"),N0=z.array(z.string().or(z.record(z.any()))),BY=z.object({type:z.string().optional(),narrative:z.string().optional()}),P0=z.string().or(z.object({id:z.string(),type:z.string(),caption:z.string().optional()})),rj=z.object({type:z.string().min(1).or(z.string().array().nonempty()),latitude:z.number(),longitude:z.number()}),nj=z.object({type:z.string().min(1).or(z.string().array().nonempty()),addressCountry:z.string().optional(),addressCountryCode:z.string().optional(),addressRegion:z.string().optional(),addressLocality:z.string().optional(),streetAddress:z.string().optional(),postOfficeBoxNumber:z.string().optional(),postalCode:z.string().optional(),geo:rj.optional()}),ij=z.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(z.string()),E7=z.object({type:z.string().min(1).or(z.string().array().nonempty()),identifier:z.string(),identifierType:ij}),rd=z.string().or(z.object({id:z.string().optional(),type:z.string().or(z.string().array().nonempty().optional()),name:z.string().optional(),url:z.string().optional(),phone:z.string().optional(),description:z.string().optional(),endorsement:z.any().array().optional(),image:P0.optional(),email:z.string().email().optional(),address:nj.optional(),otherIdentifier:E7.array().optional(),official:z.string().optional(),parentOrg:z.any().optional(),familyName:z.string().optional(),givenName:z.string().optional(),additionalName:z.string().optional(),patronymicName:z.string().optional(),honorificPrefix:z.string().optional(),honorificSuffix:z.string().optional(),familyNamePrefix:z.string().optional(),dateOfBirth:z.string().optional()}).catchall(z.any())),Xy=z.object({id:z.string().optional()}).catchall(z.any()),D0=z.object({type:z.string(),id:z.string()}).catchall(z.any()),m7=z.object({id:z.string(),type:z.string()}).catchall(z.any()),g7=z.object({id:z.string().optional(),type:z.string()}).catchall(z.any()),v7=z.object({type:z.string(),id:z.string().optional()}).catchall(z.any()),y7=z.object({type:z.string().or(z.string().array().nonempty()),id:z.string().optional()}).catchall(z.any()),O0=z.object({"@context":N0,id:z.string().optional(),type:z.string().array().nonempty(),issuer:rd,credentialSubject:Xy.or(Xy.array()),refreshService:g7.or(g7.array()).optional(),credentialSchema:m7.or(m7.array()).optional(),issuanceDate:z.string().optional(),expirationDate:z.string().optional(),credentialStatus:D0.or(D0.array()).optional(),name:z.string().optional(),description:z.string().optional(),validFrom:z.string().optional(),validUntil:z.string().optional(),status:D0.or(D0.array()).optional(),termsOfUse:v7.or(v7.array()).optional(),evidence:y7.or(y7.array()).optional()}).catchall(z.any()),qa=z.object({type:z.string(),created:z.string(),challenge:z.string().optional(),domain:z.string().optional(),nonce:z.string().optional(),proofPurpose:z.string(),verificationMethod:z.string(),jws:z.string().optional()}).catchall(z.any()),R0=O0.extend({proof:qa.or(qa.array())}),aj=z.object({"@context":N0,id:z.string().optional(),type:z.string().or(z.string().array().nonempty()),verifiableCredential:R0.or(R0.array()).optional(),holder:z.string().optional()}).catchall(z.any()),LY=aj.extend({proof:qa.or(qa.array())}),tb=z.object({kty:z.string(),crv:z.string(),x:z.string(),y:z.string().optional(),n:z.string().optional(),d:z.string().optional()}),jY=tb.omit({d:!0}).extend({d:z.string()}),oj=z.object({alg:z.string(),iv:z.string(),tag:z.string(),epk:tb.partial().optional(),kid:z.string().optional(),apv:z.string().optional(),apu:z.string().optional()}),sj=z.object({header:oj,encrypted_key:z.string()}),cj=z.object({protected:z.string(),iv:z.string(),ciphertext:z.string(),tag:z.string(),aad:z.string().optional(),recipients:sj.array().optional()}),_c=z.string().or(z.object({"@context":N0.optional(),id:z.string(),type:z.string(),controller:z.string(),publicKeyJwk:tb.optional(),publicKeyBase58:z.string().optional(),blockChainAccountId:z.string().optional()}).catchall(z.any())),uj=z.object({id:z.string(),type:z.string().or(z.string().array().nonempty()),serviceEndpoint:z.any().or(z.any().array().nonempty())}).catchall(z.any()),$Y=z.object({"@context":N0,id:z.string(),alsoKnownAs:z.string().optional(),controller:z.string().or(z.string().array().nonempty()).optional(),verificationMethod:_c.array().optional(),authentication:_c.array().optional(),assertionMethod:_c.array().optional(),keyAgreement:_c.array().optional(),capabilityInvocation:_c.array().optional(),capabilityDelegation:_c.array().optional(),publicKey:_c.array().optional(),service:uj.array().optional(),proof:qa.or(qa.array()).optional()}).catchall(z.any()),lj=z.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(z.string()),B0=z.object({type:z.string().array().nonempty(),targetCode:z.string().optional(),targetDescription:z.string().optional(),targetName:z.string(),targetFramework:z.string().optional(),targetType:lj.optional(),targetUrl:z.string()}),fj=z.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),dj=fj.or(z.string()),hj=z.object({id:z.string().optional(),narrative:z.string().optional()}).catchall(z.any()),pj=z.object({id:z.string(),type:z.string().array().nonempty(),endorsementComment:z.string().optional()}),mj=O0.extend({credentialSubject:pj,proof:qa.or(qa.array()).optional()}),gj=z.object({id:z.string(),"@language":z.string().optional(),version:z.string().optional()}),vj=z.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(z.string()),yj=z.object({id:z.string(),type:z.string().array().nonempty(),alignment:B0.array().optional(),description:z.string().optional(),level:z.string().optional(),name:z.string(),points:z.string().optional()}).catchall(z.any()),bj=z.object({id:z.string(),type:z.string().array().nonempty(),alignment:B0.array().optional(),allowedValue:z.string().array().optional(),name:z.string(),requiredLevel:z.string().optional(),requiredValue:z.string().optional(),resultType:vj,rubricCriterionLevel:yj.array().optional(),valueMax:z.string().optional(),valueMin:z.string().optional()}).catchall(z.any()),wj=z.object({id:z.string().optional(),type:z.string().array().nonempty(),alignment:B0.array().optional(),achievementType:dj.optional(),creator:rd.optional(),creditsAvailable:z.number().optional(),criteria:hj,description:z.string(),endorsement:mj.array().optional(),fieldOfStudy:z.string().optional(),humanCode:z.string().optional(),image:P0.optional(),"@language":z.string().optional(),name:z.string(),otherIdentifier:E7.array().optional(),related:gj.array().optional(),resultDescription:bj.array().optional(),specialization:z.string().optional(),tag:z.string().array().optional(),version:z.string().optional()}).catchall(z.any()),_j=z.object({type:z.string(),hashed:z.boolean(),identityHash:z.string(),identityType:z.string(),salt:z.string().optional()}),Ej=z.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),Aj=z.object({type:z.string().array().nonempty(),achievedLevel:z.string().optional(),alignment:B0.array().optional(),resultDescription:z.string().optional(),status:Ej.optional(),value:z.string().optional()}).catchall(z.any()),b7=z.object({id:z.string().optional(),type:z.string().array().nonempty(),activityEndDate:z.string().optional(),activityStartDate:z.string().optional(),creditsEarned:z.number().optional(),achievement:wj.optional(),identifier:_j.array().optional(),image:P0.optional(),licenseNumber:z.string().optional(),narrative:z.string().optional(),result:Aj.array().optional(),role:z.string().optional(),source:rd.optional(),term:z.string().optional()}).catchall(z.any()),Sj=z.object({id:z.string().optional(),type:z.string().or(z.string().array().nonempty()),narrative:z.string().optional(),name:z.string().optional(),description:z.string().optional(),genre:z.string().optional(),audience:z.string().optional()}).catchall(z.any()),xj=O0.extend({name:z.string().optional(),description:z.string().optional(),image:P0.optional(),credentialSubject:b7.or(b7.array()),endorsement:O0.array().optional(),evidence:Sj.array().optional()}),HY=xj.extend({proof:qa.or(qa.array())}),VY=z.object({checks:z.string().array(),warnings:z.string().array(),errors:z.string().array()}),A7=z.enum(["Success","Failed","Error"]),KY=A7.enum,GY=z.object({check:z.string(),status:A7,message:z.string().optional(),details:z.string().optional()}),WY=z.object({title:z.string().optional(),createdAt:z.string().optional(),issuer:rd.optional(),issuee:rd.optional(),credentialSubject:Xy.optional()}),Ec=z.object({id:z.string(),uri:z.string()}).catchall(z.any()),YY=z.object({limit:z.number(),cursor:z.string().optional(),sort:z.string().optional()}),Yn=z.object({cursor:z.string().optional(),hasMore:z.boolean()}),S7=z.object({encryptedRecord:cj,fields:z.string().array()}).catchall(z.any()),XY=Yn.extend({records:S7.array()}),Tj=S7.extend({id:z.string()}),QY=Yn.extend({records:Tj.array()}),w7=tj(e=>{let t=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!t)throw new Error("Invalid RegExp string format");return{pattern:t[1],flags:t[2]}},"parseRegexString"),Cj=z.instanceof(RegExp).or(z.string().refine(e=>{try{return w7(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:t,flags:r}=w7(e);try{return new RegExp(t,r)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),pr=z.string().or(z.object({$in:z.string().array()})).or(z.object({$regex:Cj})),Mj=z.object({backgroundColor:z.string().optional(),backgroundImage:z.string().optional(),fadeBackgroundImage:z.boolean().optional(),repeatBackgroundImage:z.boolean().optional(),fontColor:z.string().optional(),accentColor:z.string().optional(),accentFontColor:z.string().optional(),idBackgroundImage:z.string().optional(),fadeIdBackgroundImage:z.boolean().optional(),idBackgroundColor:z.string().optional(),repeatIdBackgroundImage:z.boolean().optional()}),gs=z.object({profileId:z.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:z.string().default("").describe("Human-readable display name for the profile."),shortBio:z.string().default("").describe("Short bio for the profile."),bio:z.string().default("").describe("Longer bio for the profile."),did:z.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:z.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:z.string().optional().describe("Contact email address for the profile."),image:z.string().optional().describe("Profile image URL for the profile."),heroImage:z.string().optional().describe("Hero image URL for the profile."),websiteLink:z.string().optional().describe("Website link for the profile."),isServiceProfile:z.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:z.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:z.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Mj.optional().describe("Display settings for the profile."),role:z.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:z.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')}),rX=z.object({profileId:pr,displayName:pr,shortBio:pr,bio:pr,email:pr,websiteLink:pr,isServiceProfile:z.boolean(),type:pr}).partial(),nX=Yn.extend({records:gs.array()}),iX=z.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),x7=z.object({id:z.string(),created:z.string(),displayName:z.string().default("").optional(),shortBio:z.string().default("").optional(),bio:z.string().default("").optional(),email:z.string().optional(),image:z.string().optional(),heroImage:z.string().optional()}),aX=Yn.extend({records:x7.extend({did:z.string()}).array()}),oX=z.object({id:pr,displayName:pr,shortBio:pr,bio:pr,email:pr}).partial(),sX=Yn.extend({records:z.object({profile:gs,manager:x7.extend({did:z.string()}).optional()}).array()}),cX=z.object({uri:z.string(),to:z.string(),from:z.string(),sent:z.string().datetime(),received:z.string().datetime().optional()}),T7=z.object({role:z.string(),canEdit:z.boolean(),canIssue:z.boolean(),canRevoke:z.boolean(),canManagePermissions:z.boolean(),canIssueChildren:z.string(),canCreateChildren:z.string(),canEditChildren:z.string(),canRevokeChildren:z.string(),canManageChildrenPermissions:z.string(),canManageChildrenProfiles:z.boolean().default(!1).optional(),canViewAnalytics:z.boolean()}),Ij=z.object({role:pr,canEdit:z.boolean(),canIssue:z.boolean(),canRevoke:z.boolean(),canManagePermissions:z.boolean(),canIssueChildren:pr,canCreateChildren:pr,canEditChildren:pr,canRevokeChildren:pr,canManageChildrenPermissions:pr,canManageChildrenProfiles:z.boolean(),canViewAnalytics:z.boolean()}).partial(),_7=z.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),kj=z.discriminatedUnion("type",[z.object({type:z.literal(_7.Values.GRANT_PERMISSIONS),data:z.object({claimUri:z.string(),targetUri:z.string(),permissions:T7.partial()})}),z.object({type:z.literal(_7.Values.ADD_ADMIN),data:z.object({claimUri:z.string(),targetUri:z.string()})})]),uX=z.object({type:pr,data:z.object({claimUri:pr,targetUri:pr,permissions:Ij})}).deepPartial(),Dj=z.object({id:z.string(),createdAt:z.string(),updatedAt:z.string()}).and(kj),lX=Yn.extend({records:Dj.array()}),Qy=z.enum(["DRAFT","LIVE"]),Oj=z.object({uri:z.string(),name:z.string().optional(),type:z.string().optional(),category:z.string().optional(),status:Qy.optional(),autoConnectRecipients:z.boolean().optional(),meta:z.record(z.any()).optional(),claimPermissions:T7.optional()}),fX=z.object({uri:pr,name:pr,type:pr,category:pr,meta:z.record(pr),status:Qy.or(z.object({$in:Qy.array()})),autoConnectRecipients:z.boolean()}).partial(),dX=Yn.extend({records:Oj.array()}),Rj=z.object({to:gs,from:z.string(),received:z.string().optional(),uri:z.string().optional()}),hX=Yn.extend({records:Rj.array()}),pX=z.object({endpoint:z.string(),name:z.string(),did:z.string().optional()}),mX=z.object({ttlSeconds:z.number().optional(),totalUses:z.number().optional()}),Nj=z.object({endpoint:z.string()}),gX=z.object({signingAuthority:Nj,relationship:z.object({name:z.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:z.string()})}),vX=z.object({boostUri:z.string(),signingAuthority:z.object({endpoint:z.string(),name:z.string()})}),Pj=z.enum(["live","stale","withdrawn"]),Bj=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({categories:z.record(z.object({required:z.boolean()})).default({})}).default({}),personal:z.record(z.object({required:z.boolean()})).default({})}).default({}),write:z.object({credentials:z.object({categories:z.record(z.object({required:z.boolean()})).default({})}).default({}),personal:z.record(z.object({required:z.boolean()})).default({})}).default({})}),C7=z.object({contract:Bj,owner:gs,name:z.string(),subtitle:z.string().optional(),description:z.string().optional(),reasonForAccessing:z.string().optional(),image:z.string().optional(),uri:z.string(),needsGuardianConsent:z.boolean().optional(),redirectUrl:z.string().optional(),frontDoorBoostUri:z.string().optional(),createdAt:z.string(),updatedAt:z.string(),expiresAt:z.string().optional(),autoBoosts:z.string().array().optional(),writers:z.array(gs).optional()}),yX=Yn.extend({records:C7.omit({owner:!0}).array()}),Lj=z.object({credentials:z.object({categories:z.record(z.string().array()).default({})}),personal:z.record(z.string()).default({}),date:z.string()}),bX=Yn.extend({records:Lj.array()}),Uj=z.object({credentials:z.object({category:z.string(),uri:z.string()}).array(),personal:z.record(z.string()).default({}),date:z.string(),contractUri:z.string()}),wX=Yn.extend({records:Uj.array()}),M7=z.object({sharing:z.boolean().optional(),shared:z.string().array().optional(),shareAll:z.boolean().optional(),shareUntil:z.string().optional()}),I7=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({shareAll:z.boolean().optional(),sharing:z.boolean().optional(),categories:z.record(M7).default({})}).default({}),personal:z.record(z.string()).default({})}).default({}),write:z.object({credentials:z.object({categories:z.record(z.boolean()).default({})}).default({}),personal:z.record(z.boolean()).default({})}).default({}),deniedWriters:z.array(z.string()).optional()}),_X=Yn.extend({records:z.object({expiresAt:z.string().optional(),oneTime:z.boolean().optional(),terms:I7,contract:C7,uri:z.string(),consenter:gs,status:Pj}).array()}),EX=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({categories:z.record(z.object({required:z.boolean().optional()})).optional()}).optional(),personal:z.record(z.object({required:z.boolean().optional()})).optional()}).optional(),write:z.object({credentials:z.object({categories:z.record(z.object({required:z.boolean().optional()})).optional()}).optional(),personal:z.record(z.object({required:z.boolean().optional()})).optional()}).optional()}),AX=z.object({anonymize:z.boolean().optional(),credentials:z.object({categories:z.record(z.boolean()).optional()}).optional(),personal:z.record(z.boolean()).optional()}),SX=z.object({credentials:z.object({categories:z.record(z.boolean()).optional()}).optional(),personal:z.record(z.boolean()).optional(),id:pr.optional()}),Fj=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({shareAll:z.boolean().optional(),sharing:z.boolean().optional(),categories:z.record(M7.optional()).optional()}).optional(),personal:z.record(z.string()).optional()}).optional(),write:z.object({credentials:z.object({categories:z.record(z.boolean()).optional()}).optional(),personal:z.record(z.boolean()).optional()}).optional()}),eb=z.enum(["consent","update","sync","withdraw","write"]),xX=z.object({terms:Fj.optional(),action:eb.or(eb.array()).optional(),date:z.object({$gt:z.string()}).or(z.object({$lt:z.string()})).or(z.object({$eq:z.string()})).optional(),expiresAt:z.object({$gt:z.string()}).or(z.object({$lt:z.string()})).or(z.object({$eq:z.string()})).optional(),oneTime:z.boolean().optional()}),k7=z.object({expiresAt:z.string().optional(),oneTime:z.boolean().optional(),terms:I7.optional(),id:z.string(),action:eb,date:z.string(),uris:z.string().array().optional()}),TX=Yn.extend({records:k7.array()}),jj=z.object({credentialUri:z.string(),termsUri:z.string(),contractUri:z.string(),boostUri:z.string(),category:z.string().optional(),date:z.string()}),CX=Yn.extend({records:jj.array()}),$j=z.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),zj=z.object({title:z.string().optional(),body:z.string().optional()}),Hj=z.object({vcUris:z.array(z.string()).optional(),vpUris:z.array(z.string()).optional(),transaction:k7.optional()}),MX=z.object({type:$j,to:gs.partial().and(z.object({did:z.string()})),from:gs.partial().and(z.object({did:z.string()})),message:zj.optional(),data:Hj.optional(),sent:z.string().datetime().optional()}),qj="auth-grant:",IX=z.object({id:z.string(),name:z.string(),description:z.string().optional(),challenge:z.string().startsWith(qj).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:z.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:z.string(),createdAt:z.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:z.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),kX=z.object({id:z.string()}).catchall(z.any()),Vj=z.enum(["active","revoked"]),DX=z.object({id:pr,name:pr,description:pr,status:Vj}).partial();var Kj=Object.create,jd=Object.defineProperty,Gj=Object.getOwnPropertyDescriptor,k6=Object.getOwnPropertyNames,Wj=Object.getPrototypeOf,Zj=Object.prototype.hasOwnProperty,o=i((e,t)=>jd(e,"name",{value:t,configurable:!0}),"__name"),kb=(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 new Error('Dynamic require of "'+e+'" is not supported')}),gr=i((e,t)=>i(function(){return e&&(t=(0,e[k6(e)[0]])(e=0)),t},"__init"),"__esm"),ze=i((e,t)=>i(function(){return t||(0,e[k6(e)[0]])((t={exports:{}}).exports,t),t.exports},"__require2"),"__commonJS"),Sr=i((e,t)=>{for(var r in t)jd(e,r,{get:t[r],enumerable:!0})},"__export"),XS=i((e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of k6(t))!Zj.call(e,a)&&a!==r&&jd(e,a,{get:()=>t[a],enumerable:!(n=Gj(t,a))||n.enumerable});return e},"__copyProps"),ir=i((e,t,r)=>(r=e!=null?Kj(Wj(e)):{},XS(t||!e||!e.__esModule?jd(r,"default",{value:e,enumerable:!0}):r,e)),"__toESM"),rb=i(e=>XS(jd({},"__esModule",{value:!0}),e),"__toCommonJS"),Jj=ze({"../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(e,t){(function(){var r,n="4.17.21",a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",p=500,g="__lodash_placeholder__",v=1,y=2,_=4,x=1,R=2,D=1,P=2,Z=4,j=8,q=16,Q=32,Y=64,k=128,K=256,he=512,me=30,we="...",J=800,w=16,T=1,b=2,f=3,m=1/0,E=9007199254740991,O=17976931348623157e292,C=0/0,A=4294967295,B=A-1,V=A>>>1,I=[["ary",k],["bind",D],["bindKey",P],["curry",j],["curryRight",q],["flip",he],["partial",Q],["partialRight",Y],["rearg",K]],U="[object Arguments]",ge="[object Array]",L="[object AsyncFunction]",ne="[object Boolean]",oe="[object Date]",M="[object DOMException]",G="[object Error]",ae="[object Function]",fe="[object GeneratorFunction]",be="[object Map]",Oe="[object Number]",X="[object Null]",N="[object Object]",F="[object Promise]",W="[object Proxy]",ie="[object RegExp]",ee="[object Set]",ue="[object String]",Ae="[object Symbol]",De="[object Undefined]",Ie="[object WeakMap]",Be="[object WeakSet]",Ke="[object ArrayBuffer]",ve="[object DataView]",pe="[object Float32Array]",re="[object Float64Array]",le="[object Int8Array]",_e="[object Int16Array]",Te="[object Int32Array]",Ce="[object Uint8Array]",Re="[object Uint8ClampedArray]",Dt="[object Uint16Array]",Ge="[object Uint32Array]",He=/\b__p \+= '';/g,Pt=/\b(__p \+=) '' \+/g,pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vt=/&(?:amp|lt|gt|quot|#39);/g,Rr=/[&<>"']/g,lt=RegExp(vt.source),ft=RegExp(Rr.source),lr=/<%-([\s\S]+?)%>/g,dt=/<%([\s\S]+?)%>/g,at=/<%=([\s\S]+?)%>/g,or=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ot=/^\w*$/,Xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qt=/[\\^$.*+?()[\]{}|]/g,st=RegExp(Qt.source),rt=/^\s+/,sr=/\s/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Je=/\{\n\/\* \[wrapped with (.+)\] \*/,cr=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,St=/[()=,{}\[\]\/\s]/,Tn=/\\(\\)?/g,xt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,hn=/^[-+]0x[0-9a-f]+$/i,er=/^0b[01]+$/i,tr=/^\[object .+?Constructor\]$/,nn=/^0o[0-7]+$/i,an=/^(?:0|[1-9]\d*)$/,Nr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vr=/($^)/,on=/['\n\r\u2028\u2029\\]/g,Cn="\\ud800-\\udfff",ki="\\u0300-\\u036f",Di="\\ufe20-\\ufe2f",Oi="\\u20d0-\\u20ff",Un=ki+Di+Oi,pn="\\u2700-\\u27bf",ii="a-z\\xdf-\\xf6\\xf8-\\xff",Fn="\\xac\\xb1\\xd7\\xf7",Ri="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ni="\\u2000-\\u206f",Pi=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ro="A-Z\\xc0-\\xd6\\xd8-\\xde",no="\\ufe0e\\ufe0f",io=Fn+Ri+Ni+Pi,jo="['\u2019]",rh="["+Cn+"]",Nl="["+io+"]",Us="["+Un+"]",Pl="\\d+",nh="["+pn+"]",Bl="["+ii+"]",Ll="[^"+Cn+io+Pl+pn+ii+ro+"]",Fs="\\ud83c[\\udffb-\\udfff]",ih="(?:"+Us+"|"+Fs+")",Ul="[^"+Cn+"]",ao="(?:\\ud83c[\\udde6-\\uddff]){2}",Yi="[\\ud800-\\udbff][\\udc00-\\udfff]",oo="["+ro+"]",Sa="\\u200d",Fl="(?:"+Bl+"|"+Ll+")",ah="(?:"+oo+"|"+Ll+")",jl="(?:"+jo+"(?:d|ll|m|re|s|t|ve))?",$l="(?:"+jo+"(?:D|LL|M|RE|S|T|VE))?",zl=ih+"?",Hl="["+no+"]?",ql="(?:"+Sa+"(?:"+[Ul,ao,Yi].join("|")+")"+Hl+zl+")*",xa="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Jc=Hl+zl+ql,sh="(?:"+[nh,ao,Yi].join("|")+")"+Jc,Vl="(?:"+[Ul+Us+"?",Us,ao,Yi,rh].join("|")+")",Kl=RegExp(jo,"g"),ch=RegExp(Us,"g"),Gl=RegExp(Fs+"(?="+Fs+")|"+Vl+Jc,"g"),Wl=RegExp([oo+"?"+Bl+"+"+jl+"(?="+[Nl,oo,"$"].join("|")+")",ah+"+"+$l+"(?="+[Nl,oo+Fl,"$"].join("|")+")",oo+"?"+Fl+"+"+jl,oo+"+"+$l,oh,xa,Pl,sh].join("|"),"g"),uh=RegExp("["+Sa+Cn+Un+no+"]"),js=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,lh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yc=-1,wr={};wr[pe]=wr[re]=wr[le]=wr[_e]=wr[Te]=wr[Ce]=wr[Re]=wr[Dt]=wr[Ge]=!0,wr[U]=wr[ge]=wr[Ke]=wr[ne]=wr[ve]=wr[oe]=wr[G]=wr[ae]=wr[be]=wr[Oe]=wr[N]=wr[ie]=wr[ee]=wr[ue]=wr[Ie]=!1;var vr={};vr[U]=vr[ge]=vr[Ke]=vr[ve]=vr[ne]=vr[oe]=vr[pe]=vr[re]=vr[le]=vr[_e]=vr[Te]=vr[be]=vr[Oe]=vr[N]=vr[ie]=vr[ee]=vr[ue]=vr[Ae]=vr[Ce]=vr[Re]=vr[Dt]=vr[Ge]=!0,vr[G]=vr[ae]=vr[Ie]=!1;var de={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Me={"&":"&","<":"<",">":">",'"':""","'":"'"},Le={"&":"&","<":"<",">":">",""":'"',"'":"'"},mt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Kr=parseFloat,sn=parseInt,Mn=typeof global=="object"&&global&&global.Object===Object&&global,mn=typeof self=="object"&&self&&self.Object===Object&&self,Fr=Mn||mn||Function("return this")(),Ta=typeof e=="object"&&e&&!e.nodeType&&e,Ca=Ta&&typeof t=="object"&&t&&!t.nodeType&&t,Zl=Ca&&Ca.exports===Ta,Xc=Zl&&Mn.process,gn=function(){try{var Se=Ca&&Ca.require&&Ca.require("util").types;return Se||Xc&&Xc.binding&&Xc.binding("util")}catch{}}(),$s=gn&&gn.isArrayBuffer,p3=gn&&gn.isDate,m3=gn&&gn.isMap,g3=gn&&gn.isRegExp,v3=gn&&gn.isSet,y3=gn&&gn.isTypedArray;function jn(Se,Pe,ke){switch(ke.length){case 0:return Se.call(Pe);case 1:return Se.call(Pe,ke[0]);case 2:return Se.call(Pe,ke[0],ke[1]);case 3:return Se.call(Pe,ke[0],ke[1],ke[2])}return Se.apply(Pe,ke)}i(jn,"apply"),o(jn,"apply");function b3(Se,Pe,ke,ht){for(var Nt=-1,fr=Se==null?0:Se.length;++Nt<fr;){var Wr=Se[Nt];Pe(ht,Wr,ke(Wr),Se)}return ht}i(b3,"arrayAggregator"),o(b3,"arrayAggregator");function ai(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length;++ke<ht&&Pe(Se[ke],ke,Se)!==!1;);return Se}i(ai,"arrayEach"),o(ai,"arrayEach");function w3(Se,Pe){for(var ke=Se==null?0:Se.length;ke--&&Pe(Se[ke],ke,Se)!==!1;);return Se}i(w3,"arrayEachRight"),o(w3,"arrayEachRight");function w1(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length;++ke<ht;)if(!Pe(Se[ke],ke,Se))return!1;return!0}i(w1,"arrayEvery"),o(w1,"arrayEvery");function so(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length,Nt=0,fr=[];++ke<ht;){var Wr=Se[ke];Pe(Wr,ke,Se)&&(fr[Nt++]=Wr)}return fr}i(so,"arrayFilter"),o(so,"arrayFilter");function Jl(Se,Pe){var ke=Se==null?0:Se.length;return!!ke&&zs(Se,Pe,0)>-1}i(Jl,"arrayIncludes"),o(Jl,"arrayIncludes");function fh(Se,Pe,ke){for(var ht=-1,Nt=Se==null?0:Se.length;++ht<Nt;)if(ke(Pe,Se[ht]))return!0;return!1}i(fh,"arrayIncludesWith"),o(fh,"arrayIncludesWith");function Mr(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length,Nt=Array(ht);++ke<ht;)Nt[ke]=Pe(Se[ke],ke,Se);return Nt}i(Mr,"arrayMap"),o(Mr,"arrayMap");function co(Se,Pe){for(var ke=-1,ht=Pe.length,Nt=Se.length;++ke<ht;)Se[Nt+ke]=Pe[ke];return Se}i(co,"arrayPush"),o(co,"arrayPush");function dh(Se,Pe,ke,ht){var Nt=-1,fr=Se==null?0:Se.length;for(ht&&fr&&(ke=Se[++Nt]);++Nt<fr;)ke=Pe(ke,Se[Nt],Nt,Se);return ke}i(dh,"arrayReduce"),o(dh,"arrayReduce");function _3(Se,Pe,ke,ht){var Nt=Se==null?0:Se.length;for(ht&&Nt&&(ke=Se[--Nt]);Nt--;)ke=Pe(ke,Se[Nt],Nt,Se);return ke}i(_3,"arrayReduceRight"),o(_3,"arrayReduceRight");function hh(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length;++ke<ht;)if(Pe(Se[ke],ke,Se))return!0;return!1}i(hh,"arraySome"),o(hh,"arraySome");var BD=ph("length");function E3(Se){return Se.split("")}i(E3,"asciiToArray"),o(E3,"asciiToArray");function A3(Se){return Se.match(ut)||[]}i(A3,"asciiWords"),o(A3,"asciiWords");function _1(Se,Pe,ke){var ht;return ke(Se,function(Nt,fr,Wr){if(Pe(Nt,fr,Wr))return ht=fr,!1}),ht}i(_1,"baseFindKey"),o(_1,"baseFindKey");function Yl(Se,Pe,ke,ht){for(var Nt=Se.length,fr=ke+(ht?1:-1);ht?fr--:++fr<Nt;)if(Pe(Se[fr],fr,Se))return fr;return-1}i(Yl,"baseFindIndex"),o(Yl,"baseFindIndex");function zs(Se,Pe,ke){return Pe===Pe?R3(Se,Pe,ke):Yl(Se,E1,ke)}i(zs,"baseIndexOf"),o(zs,"baseIndexOf");function S3(Se,Pe,ke,ht){for(var Nt=ke-1,fr=Se.length;++Nt<fr;)if(ht(Se[Nt],Pe))return Nt;return-1}i(S3,"baseIndexOfWith"),o(S3,"baseIndexOfWith");function E1(Se){return Se!==Se}i(E1,"baseIsNaN"),o(E1,"baseIsNaN");function A1(Se,Pe){var ke=Se==null?0:Se.length;return ke?gh(Se,Pe)/ke:C}i(A1,"baseMean"),o(A1,"baseMean");function ph(Se){return function(Pe){return Pe==null?r:Pe[Se]}}i(ph,"baseProperty"),o(ph,"baseProperty");function mh(Se){return function(Pe){return Se==null?r:Se[Pe]}}i(mh,"basePropertyOf"),o(mh,"basePropertyOf");function S1(Se,Pe,ke,ht,Nt){return Nt(Se,function(fr,Wr,_r){ke=ht?(ht=!1,fr):Pe(ke,fr,Wr,_r)}),ke}i(S1,"baseReduce"),o(S1,"baseReduce");function x3(Se,Pe){var ke=Se.length;for(Se.sort(Pe);ke--;)Se[ke]=Se[ke].value;return Se}i(x3,"baseSortBy"),o(x3,"baseSortBy");function gh(Se,Pe){for(var ke,ht=-1,Nt=Se.length;++ht<Nt;){var fr=Pe(Se[ht]);fr!==r&&(ke=ke===r?fr:ke+fr)}return ke}i(gh,"baseSum"),o(gh,"baseSum");function vh(Se,Pe){for(var ke=-1,ht=Array(Se);++ke<Se;)ht[ke]=Pe(ke);return ht}i(vh,"baseTimes"),o(vh,"baseTimes");function T3(Se,Pe){return Mr(Pe,function(ke){return[ke,Se[ke]]})}i(T3,"baseToPairs"),o(T3,"baseToPairs");function x1(Se){return Se&&Se.slice(0,I1(Se)+1).replace(rt,"")}i(x1,"baseTrim"),o(x1,"baseTrim");function $n(Se){return function(Pe){return Se(Pe)}}i($n,"baseUnary"),o($n,"baseUnary");function yh(Se,Pe){return Mr(Pe,function(ke){return Se[ke]})}i(yh,"baseValues"),o(yh,"baseValues");function Qc(Se,Pe){return Se.has(Pe)}i(Qc,"cacheHas"),o(Qc,"cacheHas");function T1(Se,Pe){for(var ke=-1,ht=Se.length;++ke<ht&&zs(Pe,Se[ke],0)>-1;);return ke}i(T1,"charsStartIndex"),o(T1,"charsStartIndex");function C1(Se,Pe){for(var ke=Se.length;ke--&&zs(Pe,Se[ke],0)>-1;);return ke}i(C1,"charsEndIndex"),o(C1,"charsEndIndex");function C3(Se,Pe){for(var ke=Se.length,ht=0;ke--;)Se[ke]===Pe&&++ht;return ht}i(C3,"countHolders"),o(C3,"countHolders");var LD=mh(de),UD=mh(Me);function M3(Se){return"\\"+mt[Se]}i(M3,"escapeStringChar"),o(M3,"escapeStringChar");function I3(Se,Pe){return Se==null?r:Se[Pe]}i(I3,"getValue"),o(I3,"getValue");function Hs(Se){return uh.test(Se)}i(Hs,"hasUnicode"),o(Hs,"hasUnicode");function k3(Se){return js.test(Se)}i(k3,"hasUnicodeWord"),o(k3,"hasUnicodeWord");function D3(Se){for(var Pe,ke=[];!(Pe=Se.next()).done;)ke.push(Pe.value);return ke}i(D3,"iteratorToArray"),o(D3,"iteratorToArray");function bh(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ht,Nt){ke[++Pe]=[Nt,ht]}),ke}i(bh,"mapToArray"),o(bh,"mapToArray");function M1(Se,Pe){return function(ke){return Se(Pe(ke))}}i(M1,"overArg"),o(M1,"overArg");function uo(Se,Pe){for(var ke=-1,ht=Se.length,Nt=0,fr=[];++ke<ht;){var Wr=Se[ke];(Wr===Pe||Wr===g)&&(Se[ke]=g,fr[Nt++]=ke)}return fr}i(uo,"replaceHolders"),o(uo,"replaceHolders");function Xl(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ht){ke[++Pe]=ht}),ke}i(Xl,"setToArray"),o(Xl,"setToArray");function O3(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ht){ke[++Pe]=[ht,ht]}),ke}i(O3,"setToPairs"),o(O3,"setToPairs");function R3(Se,Pe,ke){for(var ht=ke-1,Nt=Se.length;++ht<Nt;)if(Se[ht]===Pe)return ht;return-1}i(R3,"strictIndexOf"),o(R3,"strictIndexOf");function N3(Se,Pe,ke){for(var ht=ke+1;ht--;)if(Se[ht]===Pe)return ht;return ht}i(N3,"strictLastIndexOf"),o(N3,"strictLastIndexOf");function qs(Se){return Hs(Se)?P3(Se):BD(Se)}i(qs,"stringSize"),o(qs,"stringSize");function Bi(Se){return Hs(Se)?B3(Se):E3(Se)}i(Bi,"stringToArray"),o(Bi,"stringToArray");function I1(Se){for(var Pe=Se.length;Pe--&&sr.test(Se.charAt(Pe)););return Pe}i(I1,"trimmedEndIndex"),o(I1,"trimmedEndIndex");var FD=mh(Le);function P3(Se){for(var Pe=Gl.lastIndex=0;Gl.test(Se);)++Pe;return Pe}i(P3,"unicodeSize"),o(P3,"unicodeSize");function B3(Se){return Se.match(Gl)||[]}i(B3,"unicodeToArray"),o(B3,"unicodeToArray");function L3(Se){return Se.match(Wl)||[]}i(L3,"unicodeWords"),o(L3,"unicodeWords");var jD=o(i(function Se(Pe){Pe=Pe==null?Fr:$o.defaults(Fr.Object(),Pe,$o.pick(Fr,lh));var ke=Pe.Array,ht=Pe.Date,Nt=Pe.Error,fr=Pe.Function,Wr=Pe.Math,_r=Pe.Object,k1=Pe.RegExp,$D=Pe.String,Li=Pe.TypeError,wh=ke.prototype,zD=fr.prototype,eu=_r.prototype,_h=Pe["__core-js_shared__"],Eh=zD.toString,yr=eu.hasOwnProperty,HD=0,U3=function(){var u=/[^.]+$/.exec(_h&&_h.keys&&_h.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),Ah=eu.toString,qD=Eh.call(_r),VD=Fr._,KD=k1("^"+Eh.call(yr).replace(Qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sh=Zl?Pe.Buffer:r,zo=Pe.Symbol,xh=Pe.Uint8Array,F3=Sh?Sh.allocUnsafe:r,Th=M1(_r.getPrototypeOf,_r),j3=_r.create,$3=eu.propertyIsEnumerable,Ch=wh.splice,z3=zo?zo.isConcatSpreadable:r,Ql=zo?zo.iterator:r,Vs=zo?zo.toStringTag:r,Mh=function(){try{var u=Wo(_r,"defineProperty");return u({},"",{}),u}catch{}}(),GD=Pe.clearTimeout!==Fr.clearTimeout&&Pe.clearTimeout,WD=ht&&ht.now!==Fr.Date.now&&ht.now,ZD=Pe.setTimeout!==Fr.setTimeout&&Pe.setTimeout,Ih=Wr.ceil,kh=Wr.floor,D1=_r.getOwnPropertySymbols,JD=Sh?Sh.isBuffer:r,H3=Pe.isFinite,YD=wh.join,XD=M1(_r.keys,_r),Zr=Wr.max,vn=Wr.min,QD=ht.now,eO=Pe.parseInt,q3=Wr.random,tO=wh.reverse,O1=Wo(Pe,"DataView"),ef=Wo(Pe,"Map"),R1=Wo(Pe,"Promise"),tu=Wo(Pe,"Set"),tf=Wo(Pe,"WeakMap"),rf=Wo(_r,"create"),Dh=tf&&new tf,ru={},rO=Zo(O1),nO=Zo(ef),iO=Zo(R1),aO=Zo(tu),oO=Zo(tf),Oh=zo?zo.prototype:r,nf=Oh?Oh.valueOf:r,V3=Oh?Oh.toString:r;function se(u){if(Dr(u)&&!Bt(u)&&!(u instanceof Wt)){if(u instanceof oi)return u;if(yr.call(u,"__wrapped__"))return Dg(u)}return new oi(u)}i(se,"lodash"),o(se,"lodash");var nu=function(){function u(){}return i(u,"object"),o(u,"object"),function(h){if(!kr(h))return{};if(j3)return j3(h);u.prototype=h;var S=new u;return u.prototype=r,S}}();function af(){}i(af,"baseLodash"),o(af,"baseLodash");function oi(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=r}i(oi,"LodashWrapper"),o(oi,"LodashWrapper"),se.templateSettings={escape:lr,evaluate:dt,interpolate:at,variable:"",imports:{_:se}},se.prototype=af.prototype,se.prototype.constructor=se,oi.prototype=nu(af.prototype),oi.prototype.constructor=oi;function Wt(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=A,this.__views__=[]}i(Wt,"LazyWrapper"),o(Wt,"LazyWrapper");function K3(){var u=new Wt(this.__wrapped__);return u.__actions__=In(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=In(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=In(this.__views__),u}i(K3,"lazyClone"),o(K3,"lazyClone");function G3(){if(this.__filtered__){var u=new Wt(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}i(G3,"lazyReverse"),o(G3,"lazyReverse");function W3(){var u=this.__wrapped__.value(),h=this.__dir__,S=Bt(u),$=h<0,te=S?u.length:0,ce=c5(0,te,this.__views__),ye=ce.start,Ee=ce.end,xe=Ee-ye,Ue=$?Ee:ye-1,Fe=this.__iteratees__,$e=Fe.length,Ye=0,gt=vn(xe,this.__takeCount__);if(!S||!$&&te==xe&>==xe)return tg(u,this.__actions__);var Tt=[];e:for(;xe--&&Ye<gt;){Ue+=h;for(var $t=-1,At=u[Ue];++$t<$e;){var Kt=Fe[$t],Zt=Kt.iteratee,qn=Kt.type,_n=Zt(At);if(qn==b)At=_n;else if(!_n){if(qn==T)continue e;break e}}Tt[Ye++]=At}return Tt}i(W3,"lazyValue"),o(W3,"lazyValue"),Wt.prototype=nu(af.prototype),Wt.prototype.constructor=Wt;function Ho(u){var h=-1,S=u==null?0:u.length;for(this.clear();++h<S;){var $=u[h];this.set($[0],$[1])}}i(Ho,"Hash"),o(Ho,"Hash");function Z3(){this.__data__=rf?rf(null):{},this.size=0}i(Z3,"hashClear"),o(Z3,"hashClear");function J3(u){var h=this.has(u)&&delete this.__data__[u];return this.size-=h?1:0,h}i(J3,"hashDelete"),o(J3,"hashDelete");function Y3(u){var h=this.__data__;if(rf){var S=h[u];return S===d?r:S}return yr.call(h,u)?h[u]:r}i(Y3,"hashGet"),o(Y3,"hashGet");function X3(u){var h=this.__data__;return rf?h[u]!==r:yr.call(h,u)}i(X3,"hashHas"),o(X3,"hashHas");function Q3(u,h){var S=this.__data__;return this.size+=this.has(u)?0:1,S[u]=rf&&h===r?d:h,this}i(Q3,"hashSet"),o(Q3,"hashSet"),Ho.prototype.clear=Z3,Ho.prototype.delete=J3,Ho.prototype.get=Y3,Ho.prototype.has=X3,Ho.prototype.set=Q3;function Ma(u){var h=-1,S=u==null?0:u.length;for(this.clear();++h<S;){var $=u[h];this.set($[0],$[1])}}i(Ma,"ListCache"),o(Ma,"ListCache");function ew(){this.__data__=[],this.size=0}i(ew,"listCacheClear"),o(ew,"listCacheClear");function tw(u){var h=this.__data__,S=of(h,u);if(S<0)return!1;var $=h.length-1;return S==$?h.pop():Ch.call(h,S,1),--this.size,!0}i(tw,"listCacheDelete"),o(tw,"listCacheDelete");function rw(u){var h=this.__data__,S=of(h,u);return S<0?r:h[S][1]}i(rw,"listCacheGet"),o(rw,"listCacheGet");function nw(u){return of(this.__data__,u)>-1}i(nw,"listCacheHas"),o(nw,"listCacheHas");function iw(u,h){var S=this.__data__,$=of(S,u);return $<0?(++this.size,S.push([u,h])):S[$][1]=h,this}i(iw,"listCacheSet"),o(iw,"listCacheSet"),Ma.prototype.clear=ew,Ma.prototype.delete=tw,Ma.prototype.get=rw,Ma.prototype.has=nw,Ma.prototype.set=iw;function Ia(u){var h=-1,S=u==null?0:u.length;for(this.clear();++h<S;){var $=u[h];this.set($[0],$[1])}}i(Ia,"MapCache"),o(Ia,"MapCache");function aw(){this.size=0,this.__data__={hash:new Ho,map:new(ef||Ma),string:new Ho}}i(aw,"mapCacheClear"),o(aw,"mapCacheClear");function ow(u){var h=yf(this,u).delete(u);return this.size-=h?1:0,h}i(ow,"mapCacheDelete"),o(ow,"mapCacheDelete");function sw(u){return yf(this,u).get(u)}i(sw,"mapCacheGet"),o(sw,"mapCacheGet");function cw(u){return yf(this,u).has(u)}i(cw,"mapCacheHas"),o(cw,"mapCacheHas");function uw(u,h){var S=yf(this,u),$=S.size;return S.set(u,h),this.size+=S.size==$?0:1,this}i(uw,"mapCacheSet"),o(uw,"mapCacheSet"),Ia.prototype.clear=aw,Ia.prototype.delete=ow,Ia.prototype.get=sw,Ia.prototype.has=cw,Ia.prototype.set=uw;function qo(u){var h=-1,S=u==null?0:u.length;for(this.__data__=new Ia;++h<S;)this.add(u[h])}i(qo,"SetCache"),o(qo,"SetCache");function lw(u){return this.__data__.set(u,d),this}i(lw,"setCacheAdd"),o(lw,"setCacheAdd");function fw(u){return this.__data__.has(u)}i(fw,"setCacheHas"),o(fw,"setCacheHas"),qo.prototype.add=qo.prototype.push=lw,qo.prototype.has=fw;function Ui(u){var h=this.__data__=new Ma(u);this.size=h.size}i(Ui,"Stack"),o(Ui,"Stack");function dw(){this.__data__=new Ma,this.size=0}i(dw,"stackClear"),o(dw,"stackClear");function hw(u){var h=this.__data__,S=h.delete(u);return this.size=h.size,S}i(hw,"stackDelete"),o(hw,"stackDelete");function pw(u){return this.__data__.get(u)}i(pw,"stackGet"),o(pw,"stackGet");function mw(u){return this.__data__.has(u)}i(mw,"stackHas"),o(mw,"stackHas");function gw(u,h){var S=this.__data__;if(S instanceof Ma){var $=S.__data__;if(!ef||$.length<a-1)return $.push([u,h]),this.size=++S.size,this;S=this.__data__=new Ia($)}return S.set(u,h),this.size=S.size,this}i(gw,"stackSet"),o(gw,"stackSet"),Ui.prototype.clear=dw,Ui.prototype.delete=hw,Ui.prototype.get=pw,Ui.prototype.has=mw,Ui.prototype.set=gw;function N1(u,h){var S=Bt(u),$=!S&&Zs(u),te=!S&&!$&&Jo(u),ce=!S&&!$&&!te&&du(u),ye=S||$||te||ce,Ee=ye?vh(u.length,$D):[],xe=Ee.length;for(var Ue in u)(h||yr.call(u,Ue))&&!(ye&&(Ue=="length"||te&&(Ue=="offset"||Ue=="parent")||ce&&(Ue=="buffer"||Ue=="byteLength"||Ue=="byteOffset")||Ra(Ue,xe)))&&Ee.push(Ue);return Ee}i(N1,"arrayLikeKeys"),o(N1,"arrayLikeKeys");function P1(u){var h=u.length;return h?u[zh(0,h-1)]:r}i(P1,"arraySample"),o(P1,"arraySample");function vw(u,h){return wf(In(u),Vo(h,0,u.length))}i(vw,"arraySampleSize"),o(vw,"arraySampleSize");function yw(u){return wf(In(u))}i(yw,"arrayShuffle"),o(yw,"arrayShuffle");function Rh(u,h,S){(S!==r&&!Fi(u[h],S)||S===r&&!(h in u))&&ka(u,h,S)}i(Rh,"assignMergeValue"),o(Rh,"assignMergeValue");function iu(u,h,S){var $=u[h];(!(yr.call(u,h)&&Fi($,S))||S===r&&!(h in u))&&ka(u,h,S)}i(iu,"assignValue"),o(iu,"assignValue");function of(u,h){for(var S=u.length;S--;)if(Fi(u[S][0],h))return S;return-1}i(of,"assocIndexOf"),o(of,"assocIndexOf");function bw(u,h,S,$){return Ko(u,function(te,ce,ye){h($,te,S(te),ye)}),$}i(bw,"baseAggregator"),o(bw,"baseAggregator");function B1(u,h){return u&&Qi(h,Jr(h),u)}i(B1,"baseAssign"),o(B1,"baseAssign");function ww(u,h){return u&&Qi(h,Dn(h),u)}i(ww,"baseAssignIn"),o(ww,"baseAssignIn");function ka(u,h,S){h=="__proto__"&&Mh?Mh(u,h,{configurable:!0,enumerable:!0,value:S,writable:!0}):u[h]=S}i(ka,"baseAssignValue"),o(ka,"baseAssignValue");function Nh(u,h){for(var S=-1,$=h.length,te=ke($),ce=u==null;++S<$;)te[S]=ce?r:up(u,h[S]);return te}i(Nh,"baseAt"),o(Nh,"baseAt");function Vo(u,h,S){return u===u&&(S!==r&&(u=u<=S?u:S),h!==r&&(u=u>=h?u:h)),u}i(Vo,"baseClamp"),o(Vo,"baseClamp");function si(u,h,S,$,te,ce){var ye,Ee=h&v,xe=h&y,Ue=h&_;if(S&&(ye=te?S(u,$,te,ce):S(u)),ye!==r)return ye;if(!kr(u))return u;var Fe=Bt(u);if(Fe){if(ye=l5(u),!Ee)return In(u,ye)}else{var $e=bn(u),Ye=$e==ae||$e==fe;if(Jo(u))return ng(u,Ee);if($e==N||$e==U||Ye&&!te){if(ye=xe||Ye?{}:Ag(u),!Ee)return xe?Qw(u,ww(ye,u)):Xw(u,B1(ye,u))}else{if(!vr[$e])return te?u:{};ye=f5(u,$e,Ee)}}ce||(ce=new Ui);var gt=ce.get(u);if(gt)return gt;ce.set(u,ye),s_(u)?u.forEach(function(At){ye.add(si(At,h,S,At,u,ce))}):Q4(u)&&u.forEach(function(At,Kt){ye.set(Kt,si(At,h,S,Kt,u,ce))});var Tt=Ue?xe?Qh:Xh:xe?Dn:Jr,$t=Fe?r:Tt(u);return ai($t||u,function(At,Kt){$t&&(Kt=At,At=u[Kt]),iu(ye,Kt,si(At,h,S,Kt,u,ce))}),ye}i(si,"baseClone"),o(si,"baseClone");function _w(u){var h=Jr(u);return function(S){return L1(S,u,h)}}i(_w,"baseConforms"),o(_w,"baseConforms");function L1(u,h,S){var $=S.length;if(u==null)return!$;for(u=_r(u);$--;){var te=S[$],ce=h[te],ye=u[te];if(ye===r&&!(te in u)||!ce(ye))return!1}return!0}i(L1,"baseConformsTo"),o(L1,"baseConformsTo");function U1(u,h,S){if(typeof u!="function")throw new Li(c);return bf(function(){u.apply(r,S)},h)}i(U1,"baseDelay"),o(U1,"baseDelay");function au(u,h,S,$){var te=-1,ce=Jl,ye=!0,Ee=u.length,xe=[],Ue=h.length;if(!Ee)return xe;S&&(h=Mr(h,$n(S))),$?(ce=fh,ye=!1):h.length>=a&&(ce=Qc,ye=!1,h=new qo(h));e:for(;++te<Ee;){var Fe=u[te],$e=S==null?Fe:S(Fe);if(Fe=$||Fe!==0?Fe:0,ye&&$e===$e){for(var Ye=Ue;Ye--;)if(h[Ye]===$e)continue e;xe.push(Fe)}else ce(h,$e,$)||xe.push(Fe)}return xe}i(au,"baseDifference"),o(au,"baseDifference");var Ko=cg(Xi),Ew=cg(Ph,!0);function Aw(u,h){var S=!0;return Ko(u,function($,te,ce){return S=!!h($,te,ce),S}),S}i(Aw,"baseEvery"),o(Aw,"baseEvery");function sf(u,h,S){for(var $=-1,te=u.length;++$<te;){var ce=u[$],ye=h(ce);if(ye!=null&&(Ee===r?ye===ye&&!Hn(ye):S(ye,Ee)))var Ee=ye,xe=ce}return xe}i(sf,"baseExtremum"),o(sf,"baseExtremum");function Sw(u,h,S,$){var te=u.length;for(S=Ft(S),S<0&&(S=-S>te?0:te+S),$=$===r||$>te?te:Ft($),$<0&&($+=te),$=S>$?0:Xg($);S<$;)u[S++]=h;return u}i(Sw,"baseFill"),o(Sw,"baseFill");function F1(u,h){var S=[];return Ko(u,function($,te,ce){h($,te,ce)&&S.push($)}),S}i(F1,"baseFilter"),o(F1,"baseFilter");function Qr(u,h,S,$,te){var ce=-1,ye=u.length;for(S||(S=h5),te||(te=[]);++ce<ye;){var Ee=u[ce];h>0&&S(Ee)?h>1?Qr(Ee,h-1,S,$,te):co(te,Ee):$||(te[te.length]=Ee)}return te}i(Qr,"baseFlatten"),o(Qr,"baseFlatten");var j1=ug(),xw=ug(!0);function Xi(u,h){return u&&j1(u,h,Jr)}i(Xi,"baseForOwn"),o(Xi,"baseForOwn");function Ph(u,h){return u&&xw(u,h,Jr)}i(Ph,"baseForOwnRight"),o(Ph,"baseForOwnRight");function cf(u,h){return so(h,function(S){return Na(u[S])})}i(cf,"baseFunctions"),o(cf,"baseFunctions");function Go(u,h){h=fo(h,u);for(var S=0,$=h.length;u!=null&&S<$;)u=u[ea(h[S++])];return S&&S==$?u:r}i(Go,"baseGet"),o(Go,"baseGet");function $1(u,h,S){var $=h(u);return Bt(u)?$:co($,S(u))}i($1,"baseGetAllKeys"),o($1,"baseGetAllKeys");function yn(u){return u==null?u===r?De:X:Vs&&Vs in _r(u)?o5(u):b5(u)}i(yn,"baseGetTag"),o(yn,"baseGetTag");function Bh(u,h){return u>h}i(Bh,"baseGt"),o(Bh,"baseGt");function Tw(u,h){return u!=null&&yr.call(u,h)}i(Tw,"baseHas"),o(Tw,"baseHas");function Cw(u,h){return u!=null&&h in _r(u)}i(Cw,"baseHasIn"),o(Cw,"baseHasIn");function Mw(u,h,S){return u>=vn(h,S)&&u<Zr(h,S)}i(Mw,"baseInRange"),o(Mw,"baseInRange");function Lh(u,h,S){for(var $=S?fh:Jl,te=u[0].length,ce=u.length,ye=ce,Ee=ke(ce),xe=1/0,Ue=[];ye--;){var Fe=u[ye];ye&&h&&(Fe=Mr(Fe,$n(h))),xe=vn(Fe.length,xe),Ee[ye]=!S&&(h||te>=120&&Fe.length>=120)?new qo(ye&&Fe):r}Fe=u[0];var $e=-1,Ye=Ee[0];e:for(;++$e<te&&Ue.length<xe;){var gt=Fe[$e],Tt=h?h(gt):gt;if(gt=S||gt!==0?gt:0,!(Ye?Qc(Ye,Tt):$(Ue,Tt,S))){for(ye=ce;--ye;){var $t=Ee[ye];if(!($t?Qc($t,Tt):$(u[ye],Tt,S)))continue e}Ye&&Ye.push(Tt),Ue.push(gt)}}return Ue}i(Lh,"baseIntersection"),o(Lh,"baseIntersection");function Iw(u,h,S,$){return Xi(u,function(te,ce,ye){h($,S(te),ce,ye)}),$}i(Iw,"baseInverter"),o(Iw,"baseInverter");function ou(u,h,S){h=fo(h,u),u=Cg(u,h);var $=u==null?u:u[ea(ui(h))];return $==null?r:jn($,u,S)}i(ou,"baseInvoke"),o(ou,"baseInvoke");function z1(u){return Dr(u)&&yn(u)==U}i(z1,"baseIsArguments"),o(z1,"baseIsArguments");function kw(u){return Dr(u)&&yn(u)==Ke}i(kw,"baseIsArrayBuffer"),o(kw,"baseIsArrayBuffer");function Dw(u){return Dr(u)&&yn(u)==oe}i(Dw,"baseIsDate"),o(Dw,"baseIsDate");function su(u,h,S,$,te){return u===h?!0:u==null||h==null||!Dr(u)&&!Dr(h)?u!==u&&h!==h:Ow(u,h,S,$,su,te)}i(su,"baseIsEqual"),o(su,"baseIsEqual");function Ow(u,h,S,$,te,ce){var ye=Bt(u),Ee=Bt(h),xe=ye?ge:bn(u),Ue=Ee?ge:bn(h);xe=xe==U?N:xe,Ue=Ue==U?N:Ue;var Fe=xe==N,$e=Ue==N,Ye=xe==Ue;if(Ye&&Jo(u)){if(!Jo(h))return!1;ye=!0,Fe=!1}if(Ye&&!Fe)return ce||(ce=new Ui),ye||du(u)?bg(u,h,S,$,te,ce):i5(u,h,xe,S,$,te,ce);if(!(S&x)){var gt=Fe&&yr.call(u,"__wrapped__"),Tt=$e&&yr.call(h,"__wrapped__");if(gt||Tt){var $t=gt?u.value():u,At=Tt?h.value():h;return ce||(ce=new Ui),te($t,At,S,$,ce)}}return Ye?(ce||(ce=new Ui),a5(u,h,S,$,te,ce)):!1}i(Ow,"baseIsEqualDeep"),o(Ow,"baseIsEqualDeep");function Rw(u){return Dr(u)&&bn(u)==be}i(Rw,"baseIsMap"),o(Rw,"baseIsMap");function Uh(u,h,S,$){var te=S.length,ce=te,ye=!$;if(u==null)return!ce;for(u=_r(u);te--;){var Ee=S[te];if(ye&&Ee[2]?Ee[1]!==u[Ee[0]]:!(Ee[0]in u))return!1}for(;++te<ce;){Ee=S[te];var xe=Ee[0],Ue=u[xe],Fe=Ee[1];if(ye&&Ee[2]){if(Ue===r&&!(xe in u))return!1}else{var $e=new Ui;if($)var Ye=$(Ue,Fe,xe,u,h,$e);if(!(Ye===r?su(Fe,Ue,x|R,$,$e):Ye))return!1}}return!0}i(Uh,"baseIsMatch"),o(Uh,"baseIsMatch");function H1(u){if(!kr(u)||m5(u))return!1;var h=Na(u)?KD:tr;return h.test(Zo(u))}i(H1,"baseIsNative"),o(H1,"baseIsNative");function Nw(u){return Dr(u)&&yn(u)==ie}i(Nw,"baseIsRegExp"),o(Nw,"baseIsRegExp");function Pw(u){return Dr(u)&&bn(u)==ee}i(Pw,"baseIsSet"),o(Pw,"baseIsSet");function Bw(u){return Dr(u)&&xf(u.length)&&!!wr[yn(u)]}i(Bw,"baseIsTypedArray"),o(Bw,"baseIsTypedArray");function q1(u){return typeof u=="function"?u:u==null?On:typeof u=="object"?Bt(u)?G1(u[0],u[1]):K1(u):av(u)}i(q1,"baseIteratee"),o(q1,"baseIteratee");function Fh(u){if(!lu(u))return XD(u);var h=[];for(var S in _r(u))yr.call(u,S)&&S!="constructor"&&h.push(S);return h}i(Fh,"baseKeys"),o(Fh,"baseKeys");function Lw(u){if(!kr(u))return y5(u);var h=lu(u),S=[];for(var $ in u)$=="constructor"&&(h||!yr.call(u,$))||S.push($);return S}i(Lw,"baseKeysIn"),o(Lw,"baseKeysIn");function jh(u,h){return u<h}i(jh,"baseLt"),o(jh,"baseLt");function V1(u,h){var S=-1,$=kn(u)?ke(u.length):[];return Ko(u,function(te,ce,ye){$[++S]=h(te,ce,ye)}),$}i(V1,"baseMap"),o(V1,"baseMap");function K1(u){var h=ep(u);return h.length==1&&h[0][2]?xg(h[0][0],h[0][1]):function(S){return S===u||Uh(S,u,h)}}i(K1,"baseMatches"),o(K1,"baseMatches");function G1(u,h){return tp(u)&&Sg(h)?xg(ea(u),h):function(S){var $=up(S,u);return $===r&&$===h?lp(S,u):su(h,$,x|R)}}i(G1,"baseMatchesProperty"),o(G1,"baseMatchesProperty");function uf(u,h,S,$,te){u!==h&&j1(h,function(ce,ye){if(te||(te=new Ui),kr(ce))Uw(u,h,ye,S,uf,$,te);else{var Ee=$?$(np(u,ye),ce,ye+"",u,h,te):r;Ee===r&&(Ee=ce),Rh(u,ye,Ee)}},Dn)}i(uf,"baseMerge"),o(uf,"baseMerge");function Uw(u,h,S,$,te,ce,ye){var Ee=np(u,S),xe=np(h,S),Ue=ye.get(xe);if(Ue){Rh(u,S,Ue);return}var Fe=ce?ce(Ee,xe,S+"",u,h,ye):r,$e=Fe===r;if($e){var Ye=Bt(xe),gt=!Ye&&Jo(xe),Tt=!Ye&&!gt&&du(xe);Fe=xe,Ye||gt||Tt?Bt(Ee)?Fe=Ee:Pr(Ee)?Fe=In(Ee):gt?($e=!1,Fe=ng(xe,!0)):Tt?($e=!1,Fe=ig(xe,!0)):Fe=[]:fu(xe)||Zs(xe)?(Fe=Ee,Zs(Ee)?Fe=Qg(Ee):(!kr(Ee)||Na(Ee))&&(Fe=Ag(xe))):$e=!1}$e&&(ye.set(xe,Fe),te(Fe,xe,$,ce,ye),ye.delete(xe)),Rh(u,S,Fe)}i(Uw,"baseMergeDeep"),o(Uw,"baseMergeDeep");function W1(u,h){var S=u.length;if(!!S)return h+=h<0?S:0,Ra(h,S)?u[h]:r}i(W1,"baseNth"),o(W1,"baseNth");function Z1(u,h,S){h.length?h=Mr(h,function(ce){return Bt(ce)?function(ye){return Go(ye,ce.length===1?ce[0]:ce)}:ce}):h=[On];var $=-1;h=Mr(h,$n(Et()));var te=V1(u,function(ce,ye,Ee){var xe=Mr(h,function(Ue){return Ue(ce)});return{criteria:xe,index:++$,value:ce}});return x3(te,function(ce,ye){return Yw(ce,ye,S)})}i(Z1,"baseOrderBy"),o(Z1,"baseOrderBy");function Fw(u,h){return J1(u,h,function(S,$){return lp(u,$)})}i(Fw,"basePick"),o(Fw,"basePick");function J1(u,h,S){for(var $=-1,te=h.length,ce={};++$<te;){var ye=h[$],Ee=Go(u,ye);S(Ee,ye)&&cu(ce,fo(ye,u),Ee)}return ce}i(J1,"basePickBy"),o(J1,"basePickBy");function jw(u){return function(h){return Go(h,u)}}i(jw,"basePropertyDeep"),o(jw,"basePropertyDeep");function $h(u,h,S,$){var te=$?S3:zs,ce=-1,ye=h.length,Ee=u;for(u===h&&(h=In(h)),S&&(Ee=Mr(u,$n(S)));++ce<ye;)for(var xe=0,Ue=h[ce],Fe=S?S(Ue):Ue;(xe=te(Ee,Fe,xe,$))>-1;)Ee!==u&&Ch.call(Ee,xe,1),Ch.call(u,xe,1);return u}i($h,"basePullAll"),o($h,"basePullAll");function Y1(u,h){for(var S=u?h.length:0,$=S-1;S--;){var te=h[S];if(S==$||te!==ce){var ce=te;Ra(te)?Ch.call(u,te,1):Vh(u,te)}}return u}i(Y1,"basePullAt"),o(Y1,"basePullAt");function zh(u,h){return u+kh(q3()*(h-u+1))}i(zh,"baseRandom"),o(zh,"baseRandom");function $w(u,h,S,$){for(var te=-1,ce=Zr(Ih((h-u)/(S||1)),0),ye=ke(ce);ce--;)ye[$?ce:++te]=u,u+=S;return ye}i($w,"baseRange"),o($w,"baseRange");function Hh(u,h){var S="";if(!u||h<1||h>E)return S;do h%2&&(S+=u),h=kh(h/2),h&&(u+=u);while(h);return S}i(Hh,"baseRepeat"),o(Hh,"baseRepeat");function Ht(u,h){return Mg(Tg(u,h,On),u+"")}i(Ht,"baseRest"),o(Ht,"baseRest");function zw(u){return P1(Js(u))}i(zw,"baseSample"),o(zw,"baseSample");function Hw(u,h){var S=Js(u);return wf(S,Vo(h,0,S.length))}i(Hw,"baseSampleSize"),o(Hw,"baseSampleSize");function cu(u,h,S,$){if(!kr(u))return u;h=fo(h,u);for(var te=-1,ce=h.length,ye=ce-1,Ee=u;Ee!=null&&++te<ce;){var xe=ea(h[te]),Ue=S;if(xe==="__proto__"||xe==="constructor"||xe==="prototype")return u;if(te!=ye){var Fe=Ee[xe];Ue=$?$(Fe,xe,Ee):r,Ue===r&&(Ue=kr(Fe)?Fe:Ra(h[te+1])?[]:{})}iu(Ee,xe,Ue),Ee=Ee[xe]}return u}i(cu,"baseSet"),o(cu,"baseSet");var qw=Dh?function(u,h){return Dh.set(u,h),u}:On,sO=Mh?function(u,h){return Mh(u,"toString",{configurable:!0,enumerable:!1,value:fp(h),writable:!0})}:On;function Vw(u){return wf(Js(u))}i(Vw,"baseShuffle"),o(Vw,"baseShuffle");function ci(u,h,S){var $=-1,te=u.length;h<0&&(h=-h>te?0:te+h),S=S>te?te:S,S<0&&(S+=te),te=h>S?0:S-h>>>0,h>>>=0;for(var ce=ke(te);++$<te;)ce[$]=u[$+h];return ce}i(ci,"baseSlice"),o(ci,"baseSlice");function Kw(u,h){var S;return Ko(u,function($,te,ce){return S=h($,te,ce),!S}),!!S}i(Kw,"baseSome"),o(Kw,"baseSome");function lf(u,h,S){var $=0,te=u==null?$:u.length;if(typeof h=="number"&&h===h&&te<=V){for(;$<te;){var ce=$+te>>>1,ye=u[ce];ye!==null&&!Hn(ye)&&(S?ye<=h:ye<h)?$=ce+1:te=ce}return te}return qh(u,h,On,S)}i(lf,"baseSortedIndex"),o(lf,"baseSortedIndex");function qh(u,h,S,$){var te=0,ce=u==null?0:u.length;if(ce===0)return 0;h=S(h);for(var ye=h!==h,Ee=h===null,xe=Hn(h),Ue=h===r;te<ce;){var Fe=kh((te+ce)/2),$e=S(u[Fe]),Ye=$e!==r,gt=$e===null,Tt=$e===$e,$t=Hn($e);if(ye)var At=$||Tt;else Ue?At=Tt&&($||Ye):Ee?At=Tt&&Ye&&($||!gt):xe?At=Tt&&Ye&&!gt&&($||!$t):gt||$t?At=!1:At=$?$e<=h:$e<h;At?te=Fe+1:ce=Fe}return vn(ce,B)}i(qh,"baseSortedIndexBy"),o(qh,"baseSortedIndexBy");function X1(u,h){for(var S=-1,$=u.length,te=0,ce=[];++S<$;){var ye=u[S],Ee=h?h(ye):ye;if(!S||!Fi(Ee,xe)){var xe=Ee;ce[te++]=ye===0?0:ye}}return ce}i(X1,"baseSortedUniq"),o(X1,"baseSortedUniq");function Q1(u){return typeof u=="number"?u:Hn(u)?C:+u}i(Q1,"baseToNumber"),o(Q1,"baseToNumber");function zn(u){if(typeof u=="string")return u;if(Bt(u))return Mr(u,zn)+"";if(Hn(u))return V3?V3.call(u):"";var h=u+"";return h=="0"&&1/u==-m?"-0":h}i(zn,"baseToString"),o(zn,"baseToString");function lo(u,h,S){var $=-1,te=Jl,ce=u.length,ye=!0,Ee=[],xe=Ee;if(S)ye=!1,te=fh;else if(ce>=a){var Ue=h?null:uO(u);if(Ue)return Xl(Ue);ye=!1,te=Qc,xe=new qo}else xe=h?[]:Ee;e:for(;++$<ce;){var Fe=u[$],$e=h?h(Fe):Fe;if(Fe=S||Fe!==0?Fe:0,ye&&$e===$e){for(var Ye=xe.length;Ye--;)if(xe[Ye]===$e)continue e;h&&xe.push($e),Ee.push(Fe)}else te(xe,$e,S)||(xe!==Ee&&xe.push($e),Ee.push(Fe))}return Ee}i(lo,"baseUniq"),o(lo,"baseUniq");function Vh(u,h){return h=fo(h,u),u=Cg(u,h),u==null||delete u[ea(ui(h))]}i(Vh,"baseUnset"),o(Vh,"baseUnset");function eg(u,h,S,$){return cu(u,h,S(Go(u,h)),$)}i(eg,"baseUpdate"),o(eg,"baseUpdate");function ff(u,h,S,$){for(var te=u.length,ce=$?te:-1;($?ce--:++ce<te)&&h(u[ce],ce,u););return S?ci(u,$?0:ce,$?ce+1:te):ci(u,$?ce+1:0,$?te:ce)}i(ff,"baseWhile"),o(ff,"baseWhile");function tg(u,h){var S=u;return S instanceof Wt&&(S=S.value()),dh(h,function($,te){return te.func.apply(te.thisArg,co([$],te.args))},S)}i(tg,"baseWrapperValue"),o(tg,"baseWrapperValue");function Kh(u,h,S){var $=u.length;if($<2)return $?lo(u[0]):[];for(var te=-1,ce=ke($);++te<$;)for(var ye=u[te],Ee=-1;++Ee<$;)Ee!=te&&(ce[te]=au(ce[te]||ye,u[Ee],h,S));return lo(Qr(ce,1),h,S)}i(Kh,"baseXor"),o(Kh,"baseXor");function rg(u,h,S){for(var $=-1,te=u.length,ce=h.length,ye={};++$<te;){var Ee=$<ce?h[$]:r;S(ye,u[$],Ee)}return ye}i(rg,"baseZipObject"),o(rg,"baseZipObject");function Gh(u){return Pr(u)?u:[]}i(Gh,"castArrayLikeObject"),o(Gh,"castArrayLikeObject");function Wh(u){return typeof u=="function"?u:On}i(Wh,"castFunction"),o(Wh,"castFunction");function fo(u,h){return Bt(u)?u:tp(u,h)?[u]:E5(dr(u))}i(fo,"castPath"),o(fo,"castPath");var cO=Ht;function ho(u,h,S){var $=u.length;return S=S===r?$:S,!h&&S>=$?u:ci(u,h,S)}i(ho,"castSlice"),o(ho,"castSlice");var Gw=GD||function(u){return Fr.clearTimeout(u)};function ng(u,h){if(h)return u.slice();var S=u.length,$=F3?F3(S):new u.constructor(S);return u.copy($),$}i(ng,"cloneBuffer"),o(ng,"cloneBuffer");function Zh(u){var h=new u.constructor(u.byteLength);return new xh(h).set(new xh(u)),h}i(Zh,"cloneArrayBuffer"),o(Zh,"cloneArrayBuffer");function Ww(u,h){var S=h?Zh(u.buffer):u.buffer;return new u.constructor(S,u.byteOffset,u.byteLength)}i(Ww,"cloneDataView"),o(Ww,"cloneDataView");function Zw(u){var h=new u.constructor(u.source,yt.exec(u));return h.lastIndex=u.lastIndex,h}i(Zw,"cloneRegExp"),o(Zw,"cloneRegExp");function Jw(u){return nf?_r(nf.call(u)):{}}i(Jw,"cloneSymbol"),o(Jw,"cloneSymbol");function ig(u,h){var S=h?Zh(u.buffer):u.buffer;return new u.constructor(S,u.byteOffset,u.length)}i(ig,"cloneTypedArray"),o(ig,"cloneTypedArray");function ag(u,h){if(u!==h){var S=u!==r,$=u===null,te=u===u,ce=Hn(u),ye=h!==r,Ee=h===null,xe=h===h,Ue=Hn(h);if(!Ee&&!Ue&&!ce&&u>h||ce&&ye&&xe&&!Ee&&!Ue||$&&ye&&xe||!S&&xe||!te)return 1;if(!$&&!ce&&!Ue&&u<h||Ue&&S&&te&&!$&&!ce||Ee&&S&&te||!ye&&te||!xe)return-1}return 0}i(ag,"compareAscending"),o(ag,"compareAscending");function Yw(u,h,S){for(var $=-1,te=u.criteria,ce=h.criteria,ye=te.length,Ee=S.length;++$<ye;){var xe=ag(te[$],ce[$]);if(xe){if($>=Ee)return xe;var Ue=S[$];return xe*(Ue=="desc"?-1:1)}}return u.index-h.index}i(Yw,"compareMultiple"),o(Yw,"compareMultiple");function og(u,h,S,$){for(var te=-1,ce=u.length,ye=S.length,Ee=-1,xe=h.length,Ue=Zr(ce-ye,0),Fe=ke(xe+Ue),$e=!$;++Ee<xe;)Fe[Ee]=h[Ee];for(;++te<ye;)($e||te<ce)&&(Fe[S[te]]=u[te]);for(;Ue--;)Fe[Ee++]=u[te++];return Fe}i(og,"composeArgs"),o(og,"composeArgs");function sg(u,h,S,$){for(var te=-1,ce=u.length,ye=-1,Ee=S.length,xe=-1,Ue=h.length,Fe=Zr(ce-Ee,0),$e=ke(Fe+Ue),Ye=!$;++te<Fe;)$e[te]=u[te];for(var gt=te;++xe<Ue;)$e[gt+xe]=h[xe];for(;++ye<Ee;)(Ye||te<ce)&&($e[gt+S[ye]]=u[te++]);return $e}i(sg,"composeArgsRight"),o(sg,"composeArgsRight");function In(u,h){var S=-1,$=u.length;for(h||(h=ke($));++S<$;)h[S]=u[S];return h}i(In,"copyArray"),o(In,"copyArray");function Qi(u,h,S,$){var te=!S;S||(S={});for(var ce=-1,ye=h.length;++ce<ye;){var Ee=h[ce],xe=$?$(S[Ee],u[Ee],Ee,S,u):r;xe===r&&(xe=u[Ee]),te?ka(S,Ee,xe):iu(S,Ee,xe)}return S}i(Qi,"copyObject"),o(Qi,"copyObject");function Xw(u,h){return Qi(u,_g(u),h)}i(Xw,"copySymbols"),o(Xw,"copySymbols");function Qw(u,h){return Qi(u,s5(u),h)}i(Qw,"copySymbolsIn"),o(Qw,"copySymbolsIn");function df(u,h){return function(S,$){var te=Bt(S)?b3:bw,ce=h?h():{};return te(S,u,Et($,2),ce)}}i(df,"createAggregator"),o(df,"createAggregator");function Ks(u){return Ht(function(h,S){var $=-1,te=S.length,ce=te>1?S[te-1]:r,ye=te>2?S[2]:r;for(ce=u.length>3&&typeof ce=="function"?(te--,ce):r,ye&&wn(S[0],S[1],ye)&&(ce=te<3?r:ce,te=1),h=_r(h);++$<te;){var Ee=S[$];Ee&&u(h,Ee,$,ce)}return h})}i(Ks,"createAssigner"),o(Ks,"createAssigner");function cg(u,h){return function(S,$){if(S==null)return S;if(!kn(S))return u(S,$);for(var te=S.length,ce=h?te:-1,ye=_r(S);(h?ce--:++ce<te)&&$(ye[ce],ce,ye)!==!1;);return S}}i(cg,"createBaseEach"),o(cg,"createBaseEach");function ug(u){return function(h,S,$){for(var te=-1,ce=_r(h),ye=$(h),Ee=ye.length;Ee--;){var xe=ye[u?Ee:++te];if(S(ce[xe],xe,ce)===!1)break}return h}}i(ug,"createBaseFor"),o(ug,"createBaseFor");function e5(u,h,S){var $=h&D,te=uu(u);function ce(){var ye=this&&this!==Fr&&this instanceof ce?te:u;return ye.apply($?S:this,arguments)}return i(ce,"wrapper"),o(ce,"wrapper"),ce}i(e5,"createBind"),o(e5,"createBind");function lg(u){return function(h){h=dr(h);var S=Hs(h)?Bi(h):r,$=S?S[0]:h.charAt(0),te=S?ho(S,1).join(""):h.slice(1);return $[u]()+te}}i(lg,"createCaseFirst"),o(lg,"createCaseFirst");function Gs(u){return function(h){return dh(iv(rv(h).replace(Kl,"")),u,"")}}i(Gs,"createCompounder"),o(Gs,"createCompounder");function uu(u){return function(){var h=arguments;switch(h.length){case 0:return new u;case 1:return new u(h[0]);case 2:return new u(h[0],h[1]);case 3:return new u(h[0],h[1],h[2]);case 4:return new u(h[0],h[1],h[2],h[3]);case 5:return new u(h[0],h[1],h[2],h[3],h[4]);case 6:return new u(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new u(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var S=nu(u.prototype),$=u.apply(S,h);return kr($)?$:S}}i(uu,"createCtor"),o(uu,"createCtor");function t5(u,h,S){var $=uu(u);function te(){for(var ce=arguments.length,ye=ke(ce),Ee=ce,xe=Ws(te);Ee--;)ye[Ee]=arguments[Ee];var Ue=ce<3&&ye[0]!==xe&&ye[ce-1]!==xe?[]:uo(ye,xe);if(ce-=Ue.length,ce<S)return mg(u,h,hf,te.placeholder,r,ye,Ue,r,r,S-ce);var Fe=this&&this!==Fr&&this instanceof te?$:u;return jn(Fe,this,ye)}return i(te,"wrapper"),o(te,"wrapper"),te}i(t5,"createCurry"),o(t5,"createCurry");function fg(u){return function(h,S,$){var te=_r(h);if(!kn(h)){var ce=Et(S,3);h=Jr(h),S=o(function(Ee){return ce(te[Ee],Ee,te)},"predicate")}var ye=u(h,S,$);return ye>-1?te[ce?h[ye]:ye]:r}}i(fg,"createFind"),o(fg,"createFind");function dg(u){return Oa(function(h){var S=h.length,$=S,te=oi.prototype.thru;for(u&&h.reverse();$--;){var ce=h[$];if(typeof ce!="function")throw new Li(c);if(te&&!ye&&vf(ce)=="wrapper")var ye=new oi([],!0)}for($=ye?$:S;++$<S;){ce=h[$];var Ee=vf(ce),xe=Ee=="wrapper"?wg(ce):r;xe&&rp(xe[0])&&xe[1]==(k|j|Q|K)&&!xe[4].length&&xe[9]==1?ye=ye[vf(xe[0])].apply(ye,xe[3]):ye=ce.length==1&&rp(ce)?ye[Ee]():ye.thru(ce)}return function(){var Ue=arguments,Fe=Ue[0];if(ye&&Ue.length==1&&Bt(Fe))return ye.plant(Fe).value();for(var $e=0,Ye=S?h[$e].apply(this,Ue):Fe;++$e<S;)Ye=h[$e].call(this,Ye);return Ye}})}i(dg,"createFlow"),o(dg,"createFlow");function hf(u,h,S,$,te,ce,ye,Ee,xe,Ue){var Fe=h&k,$e=h&D,Ye=h&P,gt=h&(j|q),Tt=h&he,$t=Ye?r:uu(u);function At(){for(var Kt=arguments.length,Zt=ke(Kt),qn=Kt;qn--;)Zt[qn]=arguments[qn];if(gt)var _n=Ws(At),Vn=C3(Zt,_n);if($&&(Zt=og(Zt,$,te,gt)),ce&&(Zt=sg(Zt,ce,ye,gt)),Kt-=Vn,gt&&Kt<Ue){var jr=uo(Zt,_n);return mg(u,h,hf,At.placeholder,S,Zt,jr,Ee,xe,Ue-Kt)}var ta=$e?S:this,po=Ye?ta[u]:u;return Kt=Zt.length,Ee?Zt=w5(Zt,Ee):Tt&&Kt>1&&Zt.reverse(),Fe&&xe<Kt&&(Zt.length=xe),this&&this!==Fr&&this instanceof At&&(po=$t||uu(po)),po.apply(ta,Zt)}return i(At,"wrapper"),o(At,"wrapper"),At}i(hf,"createHybrid"),o(hf,"createHybrid");function hg(u,h){return function(S,$){return Iw(S,u,h($),{})}}i(hg,"createInverter"),o(hg,"createInverter");function pf(u,h){return function(S,$){var te;if(S===r&&$===r)return h;if(S!==r&&(te=S),$!==r){if(te===r)return $;typeof S=="string"||typeof $=="string"?(S=zn(S),$=zn($)):(S=Q1(S),$=Q1($)),te=u(S,$)}return te}}i(pf,"createMathOperation"),o(pf,"createMathOperation");function Jh(u){return Oa(function(h){return h=Mr(h,$n(Et())),Ht(function(S){var $=this;return u(h,function(te){return jn(te,$,S)})})})}i(Jh,"createOver"),o(Jh,"createOver");function mf(u,h){h=h===r?" ":zn(h);var S=h.length;if(S<2)return S?Hh(h,u):h;var $=Hh(h,Ih(u/qs(h)));return Hs(h)?ho(Bi($),0,u).join(""):$.slice(0,u)}i(mf,"createPadding"),o(mf,"createPadding");function r5(u,h,S,$){var te=h&D,ce=uu(u);function ye(){for(var Ee=-1,xe=arguments.length,Ue=-1,Fe=$.length,$e=ke(Fe+xe),Ye=this&&this!==Fr&&this instanceof ye?ce:u;++Ue<Fe;)$e[Ue]=$[Ue];for(;xe--;)$e[Ue++]=arguments[++Ee];return jn(Ye,te?S:this,$e)}return i(ye,"wrapper"),o(ye,"wrapper"),ye}i(r5,"createPartial"),o(r5,"createPartial");function pg(u){return function(h,S,$){return $&&typeof $!="number"&&wn(h,S,$)&&(S=$=r),h=Pa(h),S===r?(S=h,h=0):S=Pa(S),$=$===r?h<S?1:-1:Pa($),$w(h,S,$,u)}}i(pg,"createRange"),o(pg,"createRange");function gf(u){return function(h,S){return typeof h=="string"&&typeof S=="string"||(h=li(h),S=li(S)),u(h,S)}}i(gf,"createRelationalOperation"),o(gf,"createRelationalOperation");function mg(u,h,S,$,te,ce,ye,Ee,xe,Ue){var Fe=h&j,$e=Fe?ye:r,Ye=Fe?r:ye,gt=Fe?ce:r,Tt=Fe?r:ce;h|=Fe?Q:Y,h&=~(Fe?Y:Q),h&Z||(h&=~(D|P));var $t=[u,h,te,gt,$e,Tt,Ye,Ee,xe,Ue],At=S.apply(r,$t);return rp(u)&&_5(At,$t),At.placeholder=$,Ig(At,u,h)}i(mg,"createRecurry"),o(mg,"createRecurry");function Yh(u){var h=Wr[u];return function(S,$){if(S=li(S),$=$==null?0:vn(Ft($),292),$&&H3(S)){var te=(dr(S)+"e").split("e"),ce=h(te[0]+"e"+(+te[1]+$));return te=(dr(ce)+"e").split("e"),+(te[0]+"e"+(+te[1]-$))}return h(S)}}i(Yh,"createRound"),o(Yh,"createRound");var uO=tu&&1/Xl(new tu([,-0]))[1]==m?function(u){return new tu(u)}:pp;function gg(u){return function(h){var S=bn(h);return S==be?bh(h):S==ee?O3(h):T3(h,u(h))}}i(gg,"createToPairs"),o(gg,"createToPairs");function Da(u,h,S,$,te,ce,ye,Ee){var xe=h&P;if(!xe&&typeof u!="function")throw new Li(c);var Ue=$?$.length:0;if(Ue||(h&=~(Q|Y),$=te=r),ye=ye===r?ye:Zr(Ft(ye),0),Ee=Ee===r?Ee:Ft(Ee),Ue-=te?te.length:0,h&Y){var Fe=$,$e=te;$=te=r}var Ye=xe?r:wg(u),gt=[u,h,S,$,te,Fe,$e,ce,ye,Ee];if(Ye&&v5(gt,Ye),u=gt[0],h=gt[1],S=gt[2],$=gt[3],te=gt[4],Ee=gt[9]=gt[9]===r?xe?0:u.length:Zr(gt[9]-Ue,0),!Ee&&h&(j|q)&&(h&=~(j|q)),!h||h==D)var Tt=e5(u,h,S);else h==j||h==q?Tt=t5(u,h,Ee):(h==Q||h==(D|Q))&&!te.length?Tt=r5(u,h,S,$):Tt=hf.apply(r,gt);var $t=Ye?qw:_5;return Ig($t(Tt,gt),u,h)}i(Da,"createWrap"),o(Da,"createWrap");function vg(u,h,S,$){return u===r||Fi(u,eu[S])&&!yr.call($,S)?h:u}i(vg,"customDefaultsAssignIn"),o(vg,"customDefaultsAssignIn");function yg(u,h,S,$,te,ce){return kr(u)&&kr(h)&&(ce.set(h,u),uf(u,h,r,yg,ce),ce.delete(h)),u}i(yg,"customDefaultsMerge"),o(yg,"customDefaultsMerge");function n5(u){return fu(u)?r:u}i(n5,"customOmitClone"),o(n5,"customOmitClone");function bg(u,h,S,$,te,ce){var ye=S&x,Ee=u.length,xe=h.length;if(Ee!=xe&&!(ye&&xe>Ee))return!1;var Ue=ce.get(u),Fe=ce.get(h);if(Ue&&Fe)return Ue==h&&Fe==u;var $e=-1,Ye=!0,gt=S&R?new qo:r;for(ce.set(u,h),ce.set(h,u);++$e<Ee;){var Tt=u[$e],$t=h[$e];if($)var At=ye?$($t,Tt,$e,h,u,ce):$(Tt,$t,$e,u,h,ce);if(At!==r){if(At)continue;Ye=!1;break}if(gt){if(!hh(h,function(Kt,Zt){if(!Qc(gt,Zt)&&(Tt===Kt||te(Tt,Kt,S,$,ce)))return gt.push(Zt)})){Ye=!1;break}}else if(!(Tt===$t||te(Tt,$t,S,$,ce))){Ye=!1;break}}return ce.delete(u),ce.delete(h),Ye}i(bg,"equalArrays"),o(bg,"equalArrays");function i5(u,h,S,$,te,ce,ye){switch(S){case ve:if(u.byteLength!=h.byteLength||u.byteOffset!=h.byteOffset)return!1;u=u.buffer,h=h.buffer;case Ke:return!(u.byteLength!=h.byteLength||!ce(new xh(u),new xh(h)));case ne:case oe:case Oe:return Fi(+u,+h);case G:return u.name==h.name&&u.message==h.message;case ie:case ue:return u==h+"";case be:var Ee=bh;case ee:var xe=$&x;if(Ee||(Ee=Xl),u.size!=h.size&&!xe)return!1;var Ue=ye.get(u);if(Ue)return Ue==h;$|=R,ye.set(u,h);var Fe=bg(Ee(u),Ee(h),$,te,ce,ye);return ye.delete(u),Fe;case Ae:if(nf)return nf.call(u)==nf.call(h)}return!1}i(i5,"equalByTag"),o(i5,"equalByTag");function a5(u,h,S,$,te,ce){var ye=S&x,Ee=Xh(u),xe=Ee.length,Ue=Xh(h),Fe=Ue.length;if(xe!=Fe&&!ye)return!1;for(var $e=xe;$e--;){var Ye=Ee[$e];if(!(ye?Ye in h:yr.call(h,Ye)))return!1}var gt=ce.get(u),Tt=ce.get(h);if(gt&&Tt)return gt==h&&Tt==u;var $t=!0;ce.set(u,h),ce.set(h,u);for(var At=ye;++$e<xe;){Ye=Ee[$e];var Kt=u[Ye],Zt=h[Ye];if($)var qn=ye?$(Zt,Kt,Ye,h,u,ce):$(Kt,Zt,Ye,u,h,ce);if(!(qn===r?Kt===Zt||te(Kt,Zt,S,$,ce):qn)){$t=!1;break}At||(At=Ye=="constructor")}if($t&&!At){var _n=u.constructor,Vn=h.constructor;_n!=Vn&&"constructor"in u&&"constructor"in h&&!(typeof _n=="function"&&_n instanceof _n&&typeof Vn=="function"&&Vn instanceof Vn)&&($t=!1)}return ce.delete(u),ce.delete(h),$t}i(a5,"equalObjects"),o(a5,"equalObjects");function Oa(u){return Mg(Tg(u,r,Ng),u+"")}i(Oa,"flatRest"),o(Oa,"flatRest");function Xh(u){return $1(u,Jr,_g)}i(Xh,"getAllKeys"),o(Xh,"getAllKeys");function Qh(u){return $1(u,Dn,s5)}i(Qh,"getAllKeysIn"),o(Qh,"getAllKeysIn");var wg=Dh?function(u){return Dh.get(u)}:pp;function vf(u){for(var h=u.name+"",S=ru[h],$=yr.call(ru,h)?S.length:0;$--;){var te=S[$],ce=te.func;if(ce==null||ce==u)return te.name}return h}i(vf,"getFuncName"),o(vf,"getFuncName");function Ws(u){var h=yr.call(se,"placeholder")?se:u;return h.placeholder}i(Ws,"getHolder"),o(Ws,"getHolder");function Et(){var u=se.iteratee||dp;return u=u===dp?q1:u,arguments.length?u(arguments[0],arguments[1]):u}i(Et,"getIteratee"),o(Et,"getIteratee");function yf(u,h){var S=u.__data__;return p5(h)?S[typeof h=="string"?"string":"hash"]:S.map}i(yf,"getMapData"),o(yf,"getMapData");function ep(u){for(var h=Jr(u),S=h.length;S--;){var $=h[S],te=u[$];h[S]=[$,te,Sg(te)]}return h}i(ep,"getMatchData"),o(ep,"getMatchData");function Wo(u,h){var S=I3(u,h);return H1(S)?S:r}i(Wo,"getNative"),o(Wo,"getNative");function o5(u){var h=yr.call(u,Vs),S=u[Vs];try{u[Vs]=r;var $=!0}catch{}var te=Ah.call(u);return $&&(h?u[Vs]=S:delete u[Vs]),te}i(o5,"getRawTag"),o(o5,"getRawTag");var _g=D1?function(u){return u==null?[]:(u=_r(u),so(D1(u),function(h){return $3.call(u,h)}))}:mp,s5=D1?function(u){for(var h=[];u;)co(h,_g(u)),u=Th(u);return h}:mp,bn=yn;(O1&&bn(new O1(new ArrayBuffer(1)))!=ve||ef&&bn(new ef)!=be||R1&&bn(R1.resolve())!=F||tu&&bn(new tu)!=ee||tf&&bn(new tf)!=Ie)&&(bn=o(function(u){var h=yn(u),S=h==N?u.constructor:r,$=S?Zo(S):"";if($)switch($){case rO:return ve;case nO:return be;case iO:return F;case aO:return ee;case oO:return Ie}return h},"getTag"));function c5(u,h,S){for(var $=-1,te=S.length;++$<te;){var ce=S[$],ye=ce.size;switch(ce.type){case"drop":u+=ye;break;case"dropRight":h-=ye;break;case"take":h=vn(h,u+ye);break;case"takeRight":u=Zr(u,h-ye);break}}return{start:u,end:h}}i(c5,"getView"),o(c5,"getView");function u5(u){var h=u.match(Je);return h?h[1].split(cr):[]}i(u5,"getWrapDetails"),o(u5,"getWrapDetails");function Eg(u,h,S){h=fo(h,u);for(var $=-1,te=h.length,ce=!1;++$<te;){var ye=ea(h[$]);if(!(ce=u!=null&&S(u,ye)))break;u=u[ye]}return ce||++$!=te?ce:(te=u==null?0:u.length,!!te&&xf(te)&&Ra(ye,te)&&(Bt(u)||Zs(u)))}i(Eg,"hasPath"),o(Eg,"hasPath");function l5(u){var h=u.length,S=new u.constructor(h);return h&&typeof u[0]=="string"&&yr.call(u,"index")&&(S.index=u.index,S.input=u.input),S}i(l5,"initCloneArray"),o(l5,"initCloneArray");function Ag(u){return typeof u.constructor=="function"&&!lu(u)?nu(Th(u)):{}}i(Ag,"initCloneObject"),o(Ag,"initCloneObject");function f5(u,h,S){var $=u.constructor;switch(h){case Ke:return Zh(u);case ne:case oe:return new $(+u);case ve:return Ww(u,S);case pe:case re:case le:case _e:case Te:case Ce:case Re:case Dt:case Ge:return ig(u,S);case be:return new $;case Oe:case ue:return new $(u);case ie:return Zw(u);case ee:return new $;case Ae:return Jw(u)}}i(f5,"initCloneByTag"),o(f5,"initCloneByTag");function d5(u,h){var S=h.length;if(!S)return u;var $=S-1;return h[$]=(S>1?"& ":"")+h[$],h=h.join(S>2?", ":" "),u.replace(ct,`{
|
|
24
|
+
`):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl")});function Sy(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(Sy,"arrRemove");var g0=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i(e,"Subscription"),e.prototype.unsubscribe=function(){var t,r,n,a,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=Ay(c),d=l.next();!d.done;d=l.next()){var p=d.value;p.remove(this)}}catch(R){t={error:R}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}else c.remove(this);var g=this.initialTeardown;if(Hi(g))try{g()}catch(R){s=R instanceof m0?R.errors:[R]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var y=Ay(v),_=y.next();!_.done;_=y.next()){var x=_.value;try{CA(x)}catch(R){s=s??[],R instanceof m0?s=Nu(Nu([],Ru(s)),Ru(R.errors)):s.push(R)}}}catch(R){n={error:R}}finally{try{_&&!_.done&&(a=y.return)&&a.call(y)}finally{if(n)throw n.error}}}if(s)throw new m0(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)CA(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Sy(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Sy(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var wJ=g0.EMPTY;function v0(e){return e instanceof g0||e&&"closed"in e&&Hi(e.remove)&&Hi(e.add)&&Hi(e.unsubscribe)}i(v0,"isSubscription");function CA(e){Hi(e)?e():e.unsubscribe()}i(CA,"execFinalizer");var oa={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Pu={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=Pu.delegate;return a?.setTimeout?a.setTimeout.apply(a,Nu([e,t],Ru(r))):setTimeout.apply(void 0,Nu([e,t],Ru(r)))},clearTimeout:function(e){var t=Pu.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function MA(e){Pu.setTimeout(function(){var t=oa.onUnhandledError;if(t)t(e);else throw e})}i(MA,"reportUnhandledError");function xy(){}i(xy,"noop");var IA=function(){return Ty("C",void 0,void 0)}();function kA(e){return Ty("E",void 0,e)}i(kA,"errorNotification");function DA(e){return Ty("N",e,void 0)}i(DA,"nextNotification");function Ty(e,t,r){return{kind:e,value:t,error:r}}i(Ty,"createNotification");var fc=null;function OA(e){if(oa.useDeprecatedSynchronousErrorHandling){var t=!fc;if(t&&(fc={errorThrown:!1,error:null}),e(),t){var r=fc,n=r.errorThrown,a=r.error;if(fc=null,n)throw a}}else e()}i(OA,"errorContext");function RA(e){oa.useDeprecatedSynchronousErrorHandling&&fc&&(fc.errorThrown=!0,fc.error=e)}i(RA,"captureError");var Iy=function(e){Ey(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,v0(r)&&r.add(n)):n.destination=_U,n}return i(t,"Subscriber"),t.create=function(r,n,a){return new b0(r,n,a)},t.prototype.next=function(r){this.isStopped?My(DA(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?My(kA(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?My(IA,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(g0);var yU=Function.prototype.bind;function Cy(e,t){return yU.call(e,t)}i(Cy,"bind");var bU=function(){function e(t){this.partialObserver=t}return i(e,"ConsumerObserver"),e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){y0(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){y0(n)}else y0(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){y0(r)}},e}(),b0=function(e){Ey(t,e);function t(r,n,a){var s=e.call(this)||this,c;if(Hi(r)||!r)c={next:r??void 0,error:n??void 0,complete:a??void 0};else{var l;s&&oa.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return s.unsubscribe()},c={next:r.next&&Cy(r.next,l),error:r.error&&Cy(r.error,l),complete:r.complete&&Cy(r.complete,l)}):c=r}return s.destination=new bU(c),s}return i(t,"SafeSubscriber"),t}(Iy);function y0(e){oa.useDeprecatedSynchronousErrorHandling?RA(e):MA(e)}i(y0,"handleUnhandledError");function wU(e){throw e}i(wU,"defaultErrorHandler");function My(e,t){var r=oa.onStoppedNotification;r&&Pu.setTimeout(function(){return r(e,t)})}i(My,"handleStoppedNotification");var _U={closed:!0,next:xy,error:wU,complete:xy};var NA=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function PA(e){return e}i(PA,"identity");function BA(e){return e.length===0?PA:e.length===1?e[0]:i(function(r){return e.reduce(function(n,a){return a(n)},r)},"piped")}i(BA,"pipeFromArray");var ky=function(){function e(t){t&&(this._subscribe=t)}return i(e,"Observable"),e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var a=this,s=AU(t)?t:new b0(t,r,n);return OA(function(){var c=a,l=c.operator,d=c.source;s.add(l?l.call(s,d):d?a._subscribe(s):a._trySubscribe(s))}),s},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=LA(r),new r(function(a,s){var c=new b0({next:function(l){try{t(l)}catch(d){s(d),c.unsubscribe()}},error:s,complete:a});n.subscribe(c)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[NA]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return BA(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=LA(t),new t(function(n,a){var s;r.subscribe(function(c){return s=c},function(c){return a(c)},function(){return n(s)})})},e.create=function(t){return new e(t)},e}();function LA(e){var t;return(t=e??oa.Promise)!==null&&t!==void 0?t:Promise}i(LA,"getPromiseCtor");function EU(e){return e&&Hi(e.next)&&Hi(e.error)&&Hi(e.complete)}i(EU,"isObserver");function AU(e){return e&&e instanceof Iy||EU(e)&&v0(e)}i(AU,"isSubscriber");var UA;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(UA||(UA={}));var FA;(function(e){e[e.NOT_REQUESTED=0]="NOT_REQUESTED",e[e.PENDING=1]="PENDING",e[e.PROCESSING=2]="PROCESSING",e[e.ANCHORED=3]="ANCHORED",e[e.FAILED=4]="FAILED"})(FA||(FA={}));var Oy;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(Oy||(Oy={}));var Gf=class extends ky{constructor(t,r){super(n=>{t.subscribe(n)}),this.state$=t,this._context=r}get id(){return new Yt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:t,content:r}=this.state$.value;return(0,Dy.default)(t?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return hr.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:t})=>hr.make(this.id,t))}get anchorCommitIds(){return this.state$.value.log.filter(({type:t})=>t===Oy.ANCHOR).map(({cid:t})=>hr.make(this.id,t))}get state(){return(0,Dy.default)(this.state$.value)}async sync(t={}){t={sync:lc.PREFER_CACHE,...t};let r=await this.api.loadStream(this.id,t);this.state$.next(r.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};i(Gf,"Stream");function jA(){return e=>{}}i(jA,"StreamStatic");var SU=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},vi,Ry={anchor:!0,publish:!0,pin:!0,sync:lc.PREFER_CACHE},xU={sync:lc.PREFER_CACHE},$A={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function Ny(e,t){if(typeof e?.schema=="string")try{hr.fromString(e.schema)}catch{throw new Error("Schema must be a CommitID")}let r={controllers:e?.controllers,family:e?.family,schema:e?.schema?.toString(),tags:e?.tags};if(t)e?.deterministic||(r.unique=Cv((0,qA.randomBytes)(12),"base64")),e?.forbidControllerChange&&(r.forbidControllerChange=!0);else{if(e?.deterministic!==void 0||e?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(e?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(r).forEach(n=>r[n]===void 0&&delete r[n]),r}i(Ny,"headerFromMetadata");async function zA(e){if(!e.did)throw new Error("No DID provided");return e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`)),e.did}i(zA,"getAuthenticatedDID");async function Py(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(Py,"throwReadOnlyError");var ts=vi=i(class extends Gf{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,HA.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,a={}){a={...Ry,...a},!n?.deterministic&&a.syncTimeoutSeconds==null&&(a.syncTimeoutSeconds=0);let s=a.asDID?{did:a.asDID}:t,c=await vi.makeGenesis(s,r,n);return t.createStreamFromGenesis(vi.STREAM_TYPE_ID,c,a)}static async createFromGenesis(t,r,n={}){n={...Ry,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=r.data?await vi._signDagJWS(t,r):r;return t.createStreamFromGenesis(vi.STREAM_TYPE_ID,a,n)}static async deterministic(t,r,n={}){if(n={...Ry,...n},r={...r,deterministic:!0},r.family==null&&r.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let a=await vi.makeGenesis(t,null,r);return t.createStreamFromGenesis(vi.STREAM_TYPE_ID,a,n)}static async load(t,r,n={}){n={...xU,...n};let a=ac.from(r);if(a.type!=vi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${vi.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async update(t,r,n={}){n={...$A,...n};let a=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(a,t,r),c=await this.api.applyCommit(this.id,s,n);this.state$.next(c.state)}async patch(t,r={}){r={...$A,...r};let a={header:Ny(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},s=await vi._signDagJWS(this.api,a),c=await this.api.applyCommit(this.id,s,r);this.state$.next(c.state)}makeReadOnly(){this.update=Py,this.patch=Py,this.sync=Py,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let a=await this._makeRawCommit(r,n);return vi._signDagJWS(t,a)}async _makeRawCommit(t,r){r||(r={});let n=Ny(r,!1);if(t==null&&(t=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let a=E9.compare(this.content,t),s=this.state.log[0];return{header:n,data:a,prev:this.tip,id:s.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await zA(t);n.controllers=[c.hasParent?c.parent:c.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let a=Ny(n,!0);if(n?.deterministic&&r)throw new Error("Initial content must be null when creating a deterministic Tile document");if(r==null){let c={header:a};return jv(c),c}let s={data:r,header:a};return vi._signDagJWS(t,s)}static async _signDagJWS(t,r){return(await zA(t)).createDagJWS(r)}},"TileDocument");ts.STREAM_TYPE_NAME="tile";ts.STREAM_TYPE_ID=0;ts=vi=SU([jA()],ts);var YA=Ys(GA(),1);function PU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(PU,"_checkPrivateRedeclaration");function BU(e,t){return t.get?t.get.call(e):t.value}i(BU,"_classApplyDescriptorGet");function LU(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(LU,"_classApplyDescriptorSet");function JA(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(JA,"_classExtractFieldDescriptor");function Fy(e,t){var r=JA(e,t,"get");return BU(e,r)}i(Fy,"_classPrivateFieldGet");function WA(e,t,r){PU(e,t),t.set(e,r)}i(WA,"_classPrivateFieldInit");function ZA(e,t,r){var n=JA(e,t,"set");return LU(e,n,r),r}i(ZA,"_classPrivateFieldSet");function UU(e){return typeof e=="string"||hr.isInstance(e)||Yt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(UU,"keyToQuery");function jy(e){return typeof e=="string"?ac.from(e).toString():hr.isInstance(e)||Yt.isInstance(e)?e.toString():e.streamId.toString()}i(jy,"keyToString");async function zy(e){let t=await ts.makeGenesis({},null,{...e,deterministic:!0}),r=await Yt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(zy,"getDeterministicQuery");var FU=i(()=>Promise.resolve([]),"tempBatchLoadFn"),w0=new WeakMap,$y=new WeakMap,dc=class extends YA.default{cache(t){if(!Fy(this,$y))return!1;let r=t.id.toString();return this.clear(r).prime(r,t),!0}async create(t,r,n){let a=await ts.create(Fy(this,w0),t,r,n);return this.cache(a),a}async deterministic(t,r){let n=await zy(t);try{return await super.load(n)}catch{let s=await ts.createFromGenesis(Fy(this,w0),n.genesis,r);return this.cache(s),s}}async load(t){return await super.load(t)}async update(t,r,n,a){let s=jy(t);this.clear(s);let c=await this.load({streamId:s});return await c.update(r,n,a),c}constructor(t){super(FU,{cache:!0,cacheKeyFn:jy,cacheMap:t.cache!=null&&typeof t.cache!="boolean"?t.cache:void 0}),WA(this,w0,{writable:!0,value:void 0}),WA(this,$y,{writable:!0,value:void 0}),this._batchLoadFn=async r=>{t.cache||this.clearAll();let n=await t.ceramic.multiQuery(r.map(UU),t.multiqueryTimeout);return r.map(a=>{let s=jy(a),c=n[s];return c||new Error(`Failed to load stream: ${s}`)})},ZA(this,w0,t.ceramic),ZA(this,$y,!!t.cache)}};i(dc,"TileLoader");function jU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(jU,"_checkPrivateRedeclaration");function $U(e,t){return t.get?t.get.call(e):t.value}i($U,"_classApplyDescriptorGet");function zU(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(zU,"_classApplyDescriptorSet");function QA(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(QA,"_classExtractFieldDescriptor");function hc(e,t){var r=QA(e,t,"get");return $U(e,r)}i(hc,"_classPrivateFieldGet");function XA(e,t,r){jU(e,t),t.set(e,r)}i(XA,"_classPrivateFieldInit");function Hy(e,t,r){var n=QA(e,t,"set");return zU(e,n,r),r}i(Hy,"_classPrivateFieldSet");var Bu=new WeakMap,Lu=new WeakMap,Uu=class{get aliases(){return hc(this,Bu)}get loader(){return hc(this,Lu)}getDefinitionID(t){return hc(this,Bu).definitions[t]??null}getSchemaURL(t){return hc(this,Bu).schemas[t]??null}getTileID(t){return hc(this,Bu).tiles[t]??null}async loadTile(t){let r=this.getTileID(t);if(r==null)throw new Error(`Tile alias "${t}" is not defined`);return await hc(this,Lu).load(r)}async createTile(t,r,n={}){let a=this.getSchemaURL(t);if(a==null)throw new Error(`Schema alias "${t}" is not defined`);let{controller:s,...c}=n,l={schema:a};return s!=null&&(l.controllers=[s]),await hc(this,Lu).create(r,l,c)}constructor(t){if(XA(this,Bu,{writable:!0,value:void 0}),XA(this,Lu,{writable:!0,value:void 0}),Hy(this,Bu,t.aliases),t.loader!=null)Hy(this,Lu,t.loader);else{if(t.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");Hy(this,Lu,new dc({ceramic:t.ceramic,cache:t.cache}))}}};i(Uu,"DataModel");function HU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(HU,"_checkPrivateRedeclaration");function qU(e,t){return t.get?t.get.call(e):t.value}i(qU,"_classApplyDescriptorGet");function VU(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(VU,"_classApplyDescriptorSet");function e7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(e7,"_classExtractFieldDescriptor");function Fa(e,t){var r=e7(e,t,"get");return qU(e,r)}i(Fa,"_classPrivateFieldGet");function _0(e,t,r){HU(e,t),t.set(e,r)}i(_0,"_classPrivateFieldInit");function E0(e,t,r){var n=e7(e,t,"set");return VU(e,n,r),r}i(E0,"_classPrivateFieldSet");var A0=new WeakMap,pc=new WeakMap,qy=new WeakMap,S0=new WeakMap,Wf=class{_createValuePromise(){E0(this,qy,new Promise((t,r)=>{E0(this,S0,{resolve:t,reject:r})}))}change(t){return new Promise((r,n)=>{let a=i(async s=>{try{let c=await t(s);r(),this._next(c)}catch(c){n(c),this._next(s)}},"run");Fa(this,pc).push({reject:n,run:a}),Fa(this,pc).length===1&&this._start()})}async changeContent(t){let r=i(async n=>(await n.update(t(n.content),n.metadata),n),"mutation");return await this.change(r)}async get(){return Fa(this,pc).length===0?await Fa(this,A0).call(this):await Fa(this,qy)}async _start(){try{let t=await Fa(this,A0).call(this);this._next(t)}catch(t){Fa(this,pc).forEach(r=>{r.reject(t)}),E0(this,pc,[]),Fa(this,S0).reject(t),this._createValuePromise()}}_next(t){let r=Fa(this,pc).shift();r==null?this._end(t):r.run(t)}_end(t){Fa(this,S0).resolve(t),this._createValuePromise()}constructor(t){_0(this,A0,{writable:!0,value:void 0}),_0(this,pc,{writable:!0,value:[]}),_0(this,qy,{writable:!0,value:void 0}),_0(this,S0,{writable:!0,value:void 0}),E0(this,A0,t),this._createValuePromise()}};i(Wf,"TileProxy");var KU=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function GU(e){return KU.test(e)}i(GU,"isDIDstring");function WU(e){if(!GU(e))throw new Error(`Invalid DID: ${e}`)}i(WU,"assertDIDstring");function Vy(e){return WU(e),{controllers:[e],family:"IDX"}}i(Vy,"getIDXMetadata");function ZU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(ZU,"_checkPrivateRedeclaration");function JU(e,t){return t.get?t.get.call(e):t.value}i(JU,"_classApplyDescriptorGet");function YU(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(YU,"_classApplyDescriptorSet");function t7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(t7,"_classExtractFieldDescriptor");function $r(e,t){var r=t7(e,t,"get");return JU(e,r)}i($r,"_classPrivateFieldGet");function Zf(e,t,r){ZU(e,t),t.set(e,r)}i(Zf,"_classPrivateFieldInit");function x0(e,t,r){var n=t7(e,t,"set");return YU(e,n,r),r}i(x0,"_classPrivateFieldSet");var wo=new WeakMap,T0=new WeakMap,Ky=new WeakMap,ja=new WeakMap,C0=new WeakMap,Jf=class{get authenticated(){return $r(this,wo).did!=null}get ceramic(){return $r(this,wo)}get id(){if($r(this,T0)!=null)return $r(this,T0);if($r(this,wo).did==null)throw new Error("Ceramic instance is not authenticated");return $r(this,wo).did.hasParent?$r(this,wo).did.parent:$r(this,wo).did.id}get loader(){return $r(this,ja)}get model(){return $r(this,C0)}async has(t,r){let n=this.getDefinitionID(t);return await this.getRecordID(n,r)!=null}async get(t,r){let n=this.getDefinitionID(t);return await this.getRecord(n,r)}async getMultiple(t,r){let n=this.getDefinitionID(t),a=await Promise.all(r.map(async l=>{let{genesis:d,streamId:p}=await zy(Vy(l));return{genesis:d,streamId:p.toString(),paths:[n]}})),s=await $r(this,wo).multiQuery(a),c=[];for(let l of a){let d=s[l.streamId]?.content?.[n],p=d?s[Yt.fromString(d).toString()]:null;c.push(p?.content??null)}return c}async set(t,r,n={}){let a=this.getDefinitionID(t),[s,c]=await this._setRecordOnly(a,r,n);return s&&await this._setReference(n.controller??this.id,a,c),c}async merge(t,r,n={}){let a=this.getDefinitionID(t),s=await this.getRecord(a),c=s?{...s,...r}:r;return await this.setRecord(a,c,n)}async setAll(t,r={}){let n=Object.entries(t).map(async([c,l])=>{let d=this.getDefinitionID(c),[p,g]=await this._setRecordOnly(d,l,r);return[p,d,g]}),s=(await Promise.all(n)).reduce((c,[l,d,p])=>(l&&(c[d]=p.toUrl()),c),{});return await this._setReferences(r.controller??this.id,s),s}async setDefaults(t,r={}){let n=await this.getIndex()??{},a=Object.entries(t).map(([l,d])=>[this.getDefinitionID(l),d]).filter(l=>n[l[0]]==null).map(async([l,d])=>{let p=await this.getDefinition(l),g=await this._createRecord(p,d,r);return{[l]:g.toUrl()}}),c=(await Promise.all(a)).reduce((l,d)=>Object.assign(l,d),{});return await this._setReferences(r.controller??this.id,c),c}async remove(t,r=this.id){await this._getIndexProxy(r).changeContent(n=>(n!=null&&delete n[this.getDefinitionID(t)],n))}async getIndex(t=this.id){let r=this.authenticated&&t===this.id?await this._getIndexProxy(t).get():await this._getIDXDoc(t);return r?r.content:null}iterator(t){let r,n=0;return{[Symbol.asyncIterator](){return this},next:async()=>{if(r==null){let l=await this.getIndex(t);r=Object.entries(l??{})}if(n===r.length)return{done:!0,value:null};let[a,s]=r[n++],c=await $r(this,ja).load(s);return{done:!1,value:{key:a,id:s,record:c.content}}}}}async _createIDXDoc(t){return await $r(this,ja).deterministic(Vy(t))}async _getIDXDoc(t){let r=await this._createIDXDoc(t);if(r.content==null||r.metadata.schema==null)return null;if(r.metadata.schema!==Vp)throw new Error("Invalid document: schema is not IdentityIndex");return r}async _getOwnIDXDoc(t){let r=await this._createIDXDoc(t);if(r.content==null||r.metadata.schema==null)await r.update({},{schema:Vp});else if(r.metadata.schema!==Vp)throw new Error("Invalid document: schema is not IdentityIndex");return r}_getIndexProxy(t){let r=$r(this,Ky)[t];return r==null&&(r=new Wf(async()=>await this._getOwnIDXDoc(t)),$r(this,Ky)[t]=r),r}getDefinitionID(t){return $r(this,C0).getDefinitionID(t)??t}async getDefinition(t){let r=await $r(this,ja).load(t);if(r.metadata.schema!==b9)throw new Error("Invalid document: schema is not Definition");return{...r.content,id:r.id}}async getRecordID(t,r){return(await this.getIndex(r??this.id))?.[t]??null}async getRecordDocument(t,r){let n=await this.getRecordID(t,r);return n?await $r(this,ja).load(n):null}async getRecord(t,r){let n=await this.getRecordDocument(t,r);return n?n.content:null}async setRecord(t,r,n={}){let[a,s]=await this._setRecordOnly(t,r,n);return a&&await this._setReference(n.controller??this.id,t,s),s}async _setRecordOnly(t,r,n){let a=await this.getRecordID(t,n.controller??this.id);if(a==null){let s=await this.getDefinition(t),c=await this._createRecord(s,r,n);return[!0,c]}else{let s=await $r(this,ja).update(a,r);return[!1,s.id]}}async _createRecord(t,r,{controller:n,pin:a}){let s=await $r(this,ja).deterministic({controllers:[n??this.id],family:t.id.toString()},{pin:a});return await s.update(r,{schema:t.schema}),s.id}async _setReference(t,r,n){await this._getIndexProxy(t).changeContent(a=>({...a,[r]:n.toUrl()}))}async _setReferences(t,r){Object.keys(r).length!==0&&await this._getIndexProxy(t).changeContent(n=>({...n,...r}))}constructor(t){Zf(this,wo,{writable:!0,value:void 0}),Zf(this,T0,{writable:!0,value:void 0}),Zf(this,Ky,{writable:!0,value:{}}),Zf(this,ja,{writable:!0,value:void 0}),Zf(this,C0,{writable:!0,value:void 0});let{cache:r,ceramic:n,id:a,loader:s,model:c}=t;x0(this,wo,n),x0(this,T0,a),x0(this,ja,s??new dc({ceramic:n,cache:r})),x0(this,C0,c instanceof Uu?c:new Uu({loader:$r(this,ja),aliases:c}))}};i(Jf,"DIDDataStore");var rr;(function(e){e.assertEqual=a=>a;function t(a){}i(t,"assertIs"),e.assertIs=t;function r(a){throw new Error}i(r,"assertNever"),e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}i(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(rr||(rr={}));var Wy;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Wy||(Wy={}));var nt=rr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rs=i(e=>{switch(typeof e){case"undefined":return nt.undefined;case"string":return nt.string;case"number":return isNaN(e)?nt.nan:nt.number;case"boolean":return nt.boolean;case"function":return nt.function;case"bigint":return nt.bigint;case"symbol":return nt.symbol;case"object":return Array.isArray(e)?nt.array:e===null?nt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?nt.promise:typeof Map<"u"&&e instanceof Map?nt.map:typeof Set<"u"&&e instanceof Set?nt.set:typeof Date<"u"&&e instanceof Date?nt.date:nt.object;default:return nt.unknown}},"getParsedType"),qe=rr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),XU=i(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Sn=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(s){return s.message},n={_errors:[]},a=i(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,d=0;for(;d<c.path.length;){let p=c.path[d];d===c.path.length-1?(l[p]=l[p]||{_errors:[]},l[p]._errors.push(r(c))):l[p]=l[p]||{_errors:[]},l=l[p],d++}}},"processError");return a(this),n}static assert(t){if(!(t instanceof Sn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};i(Sn,"ZodError");Sn.create=e=>new Sn(e);var zu=i((e,t)=>{let r;switch(e.code){case qe.invalid_type:e.received===nt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case qe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,rr.jsonStringifyReplacer)}`;break;case qe.unrecognized_keys:r=`Unrecognized key(s) in object: ${rr.joinValues(e.keys,", ")}`;break;case qe.invalid_union:r="Invalid input";break;case qe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${rr.joinValues(e.options)}`;break;case qe.invalid_enum_value:r=`Invalid enum value. Expected ${rr.joinValues(e.options)}, received '${e.received}'`;break;case qe.invalid_arguments:r="Invalid function arguments";break;case qe.invalid_return_type:r="Invalid function return type";break;case qe.invalid_date:r="Invalid date";break;case qe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:rr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case qe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case qe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case qe.custom:r="Invalid input";break;case qe.invalid_intersection_types:r="Intersection results could not be merged";break;case qe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case qe.not_finite:r="Number must be finite";break;default:r=t.defaultError,rr.assertNever(e)}return{message:r}},"errorMap"),i7=zu;function QU(e){i7=e}i(QU,"setErrorMap");function M0(){return i7}i(M0,"getErrorMap");var I0=i(e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="",d=n.filter(p=>!!p).slice().reverse();for(let p of d)l=p(c,{data:t,defaultError:l}).message;return{...a,path:s,message:l}},"makeIssue"),eF=[];function et(e,t){let r=M0(),n=I0({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===zu?void 0:zu].filter(a=>!!a)});e.common.issues.push(n)}i(et,"addIssueToContext");var Yr=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let a of r){if(a.status==="aborted")return It;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r){let s=await a.key,c=await a.value;n.push({key:s,value:c})}return Yr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:s,value:c}=a;if(s.status==="aborted"||c.status==="aborted")return It;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||a.alwaysSet)&&(n[s.value]=c.value)}return{status:t.value,value:n}}};i(Yr,"ParseStatus");var It=Object.freeze({status:"aborted"}),ju=i(e=>({status:"dirty",value:e}),"DIRTY"),Rn=i(e=>({status:"valid",value:e}),"OK"),Zy=i(e=>e.status==="aborted","isAborted"),Jy=i(e=>e.status==="dirty","isDirty"),Qf=i(e=>e.status==="valid","isValid"),ed=i(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");function k0(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}i(k0,"__classPrivateFieldGet");function a7(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r}i(a7,"__classPrivateFieldSet");var bt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(bt||(bt={}));var Yf,Xf,yi=class{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};i(yi,"ParseInputLazyPath");var r7=i((e,t)=>{if(Qf(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Sn(e.common.issues);return this._error=r,this._error}}},"handleResult");function jt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:i((c,l)=>{var d,p;let{message:g}=e;return c.code==="invalid_enum_value"?{message:g??l.defaultError}:typeof l.data>"u"?{message:(d=g??n)!==null&&d!==void 0?d:l.defaultError}:c.code!=="invalid_type"?{message:l.defaultError}:{message:(p=g??r)!==null&&p!==void 0?p:l.defaultError}},"customMap"),description:a}}i(jt,"processCreateParams");var Lt=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return rs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:rs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Yr,ctx:{common:t.parent.common,data:t.data,parsedType:rs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(ed(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let a={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:rs(t)},s=this._parseSync({data:t,path:a.path,parent:a});return r7(a,s)}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:rs(t)},a=this._parse({data:t,path:n.path,parent:n}),s=await(ed(a)?a:Promise.resolve(a));return r7(n,s)}refine(t,r){let n=i(a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r,"getIssueProperties");return this._refinement((a,s)=>{let c=t(a),l=i(()=>s.addIssue({code:qe.custom,...n(a)}),"setError");return typeof Promise<"u"&&c instanceof Promise?c.then(d=>d?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new Jn({schema:this,typeName:Ct.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return wi.create(this,this._def)}nullable(){return la.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zn.create(this,this._def)}promise(){return So.create(this,this._def)}or(t){return os.create([this,t],this._def)}and(t){return ss.create(this,t,this._def)}transform(t){return new Jn({...jt(this._def),schema:this,typeName:Ct.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ds({...jt(this._def),innerType:this,defaultValue:r,typeName:Ct.ZodDefault})}brand(){return new $u({typeName:Ct.ZodBranded,type:this,...jt(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new hs({...jt(this._def),innerType:this,catchValue:r,typeName:Ct.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ps.create(this,t)}readonly(){return ms.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};i(Lt,"ZodType");var tF=/^c[^\s-]{8,}$/i,rF=/^[0-9a-z]+$/,nF=/^[0-9A-HJKMNP-TV-Z]{26}$/,iF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,aF=/^[a-z0-9_-]{21}$/i,oF=/^[-+]?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)?)??$/,sF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Gy,uF=/^(?:(?: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])$/,lF=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,fF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,o7="((\\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])))",dF=new RegExp(`^${o7}$`);function s7(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}i(s7,"timeRegexSource");function hF(e){return new RegExp(`^${s7(e)}$`)}i(hF,"timeRegex");function c7(e){let t=`${o7}T${s7(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}i(c7,"datetimeRegex");function pF(e,t){return!!((t==="v4"||!t)&&uF.test(e)||(t==="v6"||!t)&&lF.test(e))}i(pF,"isValidIP");var Wn=class extends Lt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==nt.string){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:nt.string,received:s.parsedType}),It}let n=new Yr,a;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),et(a,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),et(a,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let c=t.data.length>s.value,l=t.data.length<s.value;(c||l)&&(a=this._getOrReturnCtx(t,a),c?et(a,{code:qe.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&et(a,{code:qe.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")sF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"email",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Gy||(Gy=new RegExp(cF,"u")),Gy.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"emoji",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")iF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"uuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")aF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"nanoid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")tF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"cuid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")rF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"cuid2",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")nF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"ulid",code:qe.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),et(a,{validation:"url",code:qe.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"regex",code:qe.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?c7(s).test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?dF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?hF(s).test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{code:qe.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?oF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"duration",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?pF(t.data,s.version)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"ip",code:qe.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?fF.test(t.data)||(a=this._getOrReturnCtx(t,a),et(a,{validation:"base64",code:qe.invalid_string,message:s.message}),n.dirty()):rr.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:qe.invalid_string,...bt.errToObj(n)})}_addCheck(t){return new Wn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...bt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...bt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...bt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...bt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...bt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...bt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...bt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...bt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...bt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...bt.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,local:(n=t?.local)!==null&&n!==void 0?n:!1,...bt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...bt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...bt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...bt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...bt.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...bt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...bt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...bt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...bt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...bt.errToObj(r)})}nonempty(t){return this.min(1,bt.errToObj(t))}trim(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};i(Wn,"ZodString");Wn.create=e=>{var t;return new Wn({checks:[],typeName:Ct.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...jt(e)})};function mF(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}i(mF,"floatSafeRemainder");var sa=class extends Lt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==nt.number){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:nt.number,received:s.parsedType}),It}let n,a=new Yr;for(let s of this._def.checks)s.kind==="int"?rr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),et(n,{code:qe.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?mF(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),et(n,{code:qe.not_finite,message:s.message}),a.dirty()):rr.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,bt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,bt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,bt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,bt.toString(r))}setLimit(t,r,n,a){return new sa({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:bt.toString(a)}]})}_addCheck(t){return new sa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:bt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:bt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:bt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:bt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:bt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:bt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:bt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:bt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:bt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&rr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};i(sa,"ZodNumber");sa.create=e=>new sa({checks:[],typeName:Ct.ZodNumber,coerce:e?.coerce||!1,...jt(e)});var ca=class extends Lt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==nt.bigint){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:nt.bigint,received:s.parsedType}),It}let n,a=new Yr;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),et(n,{code:qe.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):rr.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,bt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,bt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,bt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,bt.toString(r))}setLimit(t,r,n,a){return new ca({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:bt.toString(a)}]})}_addCheck(t){return new ca({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:bt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:bt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:bt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:bt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:bt.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};i(ca,"ZodBigInt");ca.create=e=>{var t;return new ca({checks:[],typeName:Ct.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...jt(e)})};var ns=class extends Lt{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==nt.boolean){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.boolean,received:n.parsedType}),It}return Rn(t.data)}};i(ns,"ZodBoolean");ns.create=e=>new ns({typeName:Ct.ZodBoolean,coerce:e?.coerce||!1,...jt(e)});var $a=class extends Lt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==nt.date){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_type,expected:nt.date,received:s.parsedType}),It}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return et(s,{code:qe.invalid_date}),It}let n=new Yr,a;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),et(a,{code:qe.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),et(a,{code:qe.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):rr.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new $a({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:bt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:bt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};i($a,"ZodDate");$a.create=e=>new $a({checks:[],coerce:e?.coerce||!1,typeName:Ct.ZodDate,...jt(e)});var mc=class extends Lt{_parse(t){if(this._getType(t)!==nt.symbol){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.symbol,received:n.parsedType}),It}return Rn(t.data)}};i(mc,"ZodSymbol");mc.create=e=>new mc({typeName:Ct.ZodSymbol,...jt(e)});var is=class extends Lt{_parse(t){if(this._getType(t)!==nt.undefined){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.undefined,received:n.parsedType}),It}return Rn(t.data)}};i(is,"ZodUndefined");is.create=e=>new is({typeName:Ct.ZodUndefined,...jt(e)});var as=class extends Lt{_parse(t){if(this._getType(t)!==nt.null){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.null,received:n.parsedType}),It}return Rn(t.data)}};i(as,"ZodNull");as.create=e=>new as({typeName:Ct.ZodNull,...jt(e)});var Eo=class extends Lt{constructor(){super(...arguments),this._any=!0}_parse(t){return Rn(t.data)}};i(Eo,"ZodAny");Eo.create=e=>new Eo({typeName:Ct.ZodAny,...jt(e)});var za=class extends Lt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Rn(t.data)}};i(za,"ZodUnknown");za.create=e=>new za({typeName:Ct.ZodUnknown,...jt(e)});var qi=class extends Lt{_parse(t){let r=this._getOrReturnCtx(t);return et(r,{code:qe.invalid_type,expected:nt.never,received:r.parsedType}),It}};i(qi,"ZodNever");qi.create=e=>new qi({typeName:Ct.ZodNever,...jt(e)});var gc=class extends Lt{_parse(t){if(this._getType(t)!==nt.undefined){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.void,received:n.parsedType}),It}return Rn(t.data)}};i(gc,"ZodVoid");gc.create=e=>new gc({typeName:Ct.ZodVoid,...jt(e)});var Zn=class extends Lt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==nt.array)return et(r,{code:qe.invalid_type,expected:nt.array,received:r.parsedType}),It;if(a.exactLength!==null){let c=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(c||l)&&(et(r,{code:c?qe.too_big:qe.too_small,minimum:l?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(et(r,{code:qe.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(et(r,{code:qe.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>a.type._parseAsync(new yi(r,c,r.path,l)))).then(c=>Yr.mergeArray(n,c));let s=[...r.data].map((c,l)=>a.type._parseSync(new yi(r,c,r.path,l)));return Yr.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new Zn({...this._def,minLength:{value:t,message:bt.toString(r)}})}max(t,r){return new Zn({...this._def,maxLength:{value:t,message:bt.toString(r)}})}length(t,r){return new Zn({...this._def,exactLength:{value:t,message:bt.toString(r)}})}nonempty(t){return this.min(1,t)}};i(Zn,"ZodArray");Zn.create=(e,t)=>new Zn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ct.ZodArray,...jt(t)});function Fu(e){if(e instanceof Tr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=wi.create(Fu(n))}return new Tr({...e._def,shape:()=>t})}else return e instanceof Zn?new Zn({...e._def,type:Fu(e.element)}):e instanceof wi?wi.create(Fu(e.unwrap())):e instanceof la?la.create(Fu(e.unwrap())):e instanceof bi?bi.create(e.items.map(t=>Fu(t))):e}i(Fu,"deepPartialify");var Tr=class extends Lt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=rr.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==nt.object){let p=this._getOrReturnCtx(t);return et(p,{code:qe.invalid_type,expected:nt.object,received:p.parsedType}),It}let{status:n,ctx:a}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof qi&&this._def.unknownKeys==="strip"))for(let p in a.data)c.includes(p)||l.push(p);let d=[];for(let p of c){let g=s[p],v=a.data[p];d.push({key:{status:"valid",value:p},value:g._parse(new yi(a,v,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof qi){let p=this._def.unknownKeys;if(p==="passthrough")for(let g of l)d.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(p==="strict")l.length>0&&(et(a,{code:qe.unrecognized_keys,keys:l}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let g of l){let v=a.data[g];d.push({key:{status:"valid",value:g},value:p._parse(new yi(a,v,a.path,g)),alwaysSet:g in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let g of d){let v=await g.key,y=await g.value;p.push({key:v,value:y,alwaysSet:g.alwaysSet})}return p}).then(p=>Yr.mergeObjectSync(n,p)):Yr.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(t){return bt.errToObj,new Tr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,s,c,l;let d=(c=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=bt.errToObj(t).message)!==null&&l!==void 0?l:d}:{message:d}}}:{}})}strip(){return new Tr({...this._def,unknownKeys:"strip"})}passthrough(){return new Tr({...this._def,unknownKeys:"passthrough"})}extend(t){return new Tr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Tr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ct.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Tr({...this._def,catchall:t})}pick(t){let r={};return rr.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Tr({...this._def,shape:()=>r})}omit(t){let r={};return rr.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Tr({...this._def,shape:()=>r})}deepPartial(){return Fu(this)}partial(t){let r={};return rr.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}),new Tr({...this._def,shape:()=>r})}required(t){let r={};return rr.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof wi;)s=s._def.innerType;r[n]=s}}),new Tr({...this._def,shape:()=>r})}keyof(){return u7(rr.objectKeys(this.shape))}};i(Tr,"ZodObject");Tr.create=(e,t)=>new Tr({shape:()=>e,unknownKeys:"strip",catchall:qi.create(),typeName:Ct.ZodObject,...jt(t)});Tr.strictCreate=(e,t)=>new Tr({shape:()=>e,unknownKeys:"strict",catchall:qi.create(),typeName:Ct.ZodObject,...jt(t)});Tr.lazycreate=(e,t)=>new Tr({shape:e,unknownKeys:"strip",catchall:qi.create(),typeName:Ct.ZodObject,...jt(t)});var os=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new Sn(l.ctx.common.issues));return et(r,{code:qe.invalid_union,unionErrors:c}),It}if(i(a,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(a);{let s,c=[];for(let d of n){let p={...r,common:{...r.common,issues:[]},parent:null},g=d._parseSync({data:r.data,path:r.path,parent:p});if(g.status==="valid")return g;g.status==="dirty"&&!s&&(s={result:g,ctx:p}),p.common.issues.length&&c.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(d=>new Sn(d));return et(r,{code:qe.invalid_union,unionErrors:l}),It}}get options(){return this._def.options}};i(os,"ZodUnion");os.create=(e,t)=>new os({options:e,typeName:Ct.ZodUnion,...jt(t)});var _o=i(e=>e instanceof us?_o(e.schema):e instanceof Jn?_o(e.innerType()):e instanceof ls?[e.value]:e instanceof ua?e.options:e instanceof fs?rr.objectValues(e.enum):e instanceof ds?_o(e._def.innerType):e instanceof is?[void 0]:e instanceof as?[null]:e instanceof wi?[void 0,..._o(e.unwrap())]:e instanceof la?[null,..._o(e.unwrap())]:e instanceof $u||e instanceof ms?_o(e.unwrap()):e instanceof hs?_o(e._def.innerType):[],"getDiscriminator"),vc=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.object)return et(r,{code:qe.invalid_type,expected:nt.object,received:r.parsedType}),It;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(et(r,{code:qe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),It)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let a=new Map;for(let s of r){let c=_o(s.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of c){if(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,s)}}return new vc({typeName:Ct.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...jt(n)})}};i(vc,"ZodDiscriminatedUnion");function Yy(e,t){let r=rs(e),n=rs(t);if(e===t)return{valid:!0,data:e};if(r===nt.object&&n===nt.object){let a=rr.objectKeys(t),s=rr.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let d=Yy(e[l],t[l]);if(!d.valid)return{valid:!1};c[l]=d.data}return{valid:!0,data:c}}else if(r===nt.array&&n===nt.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],d=Yy(c,l);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===nt.date&&n===nt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(Yy,"mergeValues");var ss=class extends Lt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=i((s,c)=>{if(Zy(s)||Zy(c))return It;let l=Yy(s.value,c.value);return l.valid?((Jy(s)||Jy(c))&&r.dirty(),{status:r.value,value:l.data}):(et(n,{code:qe.invalid_intersection_types}),It)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>a(s,c)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};i(ss,"ZodIntersection");ss.create=(e,t,r)=>new ss({left:e,right:t,typeName:Ct.ZodIntersection,...jt(r)});var bi=class extends Lt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==nt.array)return et(n,{code:qe.invalid_type,expected:nt.array,received:n.parsedType}),It;if(n.data.length<this._def.items.length)return et(n,{code:qe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),It;!this._def.rest&&n.data.length>this._def.items.length&&(et(n,{code:qe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((c,l)=>{let d=this._def.items[l]||this._def.rest;return d?d._parse(new yi(n,c,n.path,l)):null}).filter(c=>!!c);return n.common.async?Promise.all(s).then(c=>Yr.mergeArray(r,c)):Yr.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new bi({...this._def,rest:t})}};i(bi,"ZodTuple");bi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bi({items:e,typeName:Ct.ZodTuple,rest:null,...jt(t)})};var cs=class extends Lt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==nt.object)return et(n,{code:qe.invalid_type,expected:nt.object,received:n.parsedType}),It;let a=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)a.push({key:s._parse(new yi(n,l,n.path,l)),value:c._parse(new yi(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Yr.mergeObjectAsync(r,a):Yr.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Lt?new cs({keyType:t,valueType:r,typeName:Ct.ZodRecord,...jt(n)}):new cs({keyType:Wn.create(),valueType:t,typeName:Ct.ZodRecord,...jt(r)})}};i(cs,"ZodRecord");var yc=class extends Lt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==nt.map)return et(n,{code:qe.invalid_type,expected:nt.map,received:n.parsedType}),It;let a=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,d],p)=>({key:a._parse(new yi(n,l,n.path,[p,"key"])),value:s._parse(new yi(n,d,n.path,[p,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let d of c){let p=await d.key,g=await d.value;if(p.status==="aborted"||g.status==="aborted")return It;(p.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(p.value,g.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let d of c){let p=d.key,g=d.value;if(p.status==="aborted"||g.status==="aborted")return It;(p.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(p.value,g.value)}return{status:r.value,value:l}}}};i(yc,"ZodMap");yc.create=(e,t,r)=>new yc({valueType:t,keyType:e,typeName:Ct.ZodMap,...jt(r)});var Ha=class extends Lt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==nt.set)return et(n,{code:qe.invalid_type,expected:nt.set,received:n.parsedType}),It;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(et(n,{code:qe.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(et(n,{code:qe.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function c(d){let p=new Set;for(let g of d){if(g.status==="aborted")return It;g.status==="dirty"&&r.dirty(),p.add(g.value)}return{status:r.value,value:p}}i(c,"finalizeSet");let l=[...n.data.values()].map((d,p)=>s._parse(new yi(n,d,n.path,p)));return n.common.async?Promise.all(l).then(d=>c(d)):c(l)}min(t,r){return new Ha({...this._def,minSize:{value:t,message:bt.toString(r)}})}max(t,r){return new Ha({...this._def,maxSize:{value:t,message:bt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};i(Ha,"ZodSet");Ha.create=(e,t)=>new Ha({valueType:e,minSize:null,maxSize:null,typeName:Ct.ZodSet,...jt(t)});var Ao=class extends Lt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.function)return et(r,{code:qe.invalid_type,expected:nt.function,received:r.parsedType}),It;function n(l,d){return I0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,M0(),zu].filter(p=>!!p),issueData:{code:qe.invalid_arguments,argumentsError:d}})}i(n,"makeArgsIssue");function a(l,d){return I0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,M0(),zu].filter(p=>!!p),issueData:{code:qe.invalid_return_type,returnTypeError:d}})}i(a,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof So){let l=this;return Rn(async function(...d){let p=new Sn([]),g=await l._def.args.parseAsync(d,s).catch(_=>{throw p.addIssue(n(d,_)),p}),v=await Reflect.apply(c,this,g);return await l._def.returns._def.type.parseAsync(v,s).catch(_=>{throw p.addIssue(a(v,_)),p})})}else{let l=this;return Rn(function(...d){let p=l._def.args.safeParse(d,s);if(!p.success)throw new Sn([n(d,p.error)]);let g=Reflect.apply(c,this,p.data),v=l._def.returns.safeParse(g,s);if(!v.success)throw new Sn([a(g,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ao({...this._def,args:bi.create(t).rest(za.create())})}returns(t){return new Ao({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Ao({args:t||bi.create([]).rest(za.create()),returns:r||za.create(),typeName:Ct.ZodFunction,...jt(n)})}};i(Ao,"ZodFunction");var us=class extends Lt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};i(us,"ZodLazy");us.create=(e,t)=>new us({getter:e,typeName:Ct.ZodLazy,...jt(t)});var ls=class extends Lt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return et(r,{received:r.data,code:qe.invalid_literal,expected:this._def.value}),It}return{status:"valid",value:t.data}}get value(){return this._def.value}};i(ls,"ZodLiteral");ls.create=(e,t)=>new ls({value:e,typeName:Ct.ZodLiteral,...jt(t)});function u7(e,t){return new ua({values:e,typeName:Ct.ZodEnum,...jt(t)})}i(u7,"createZodEnum");var ua=class extends Lt{constructor(){super(...arguments),Yf.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return et(r,{expected:rr.joinValues(n),received:r.parsedType,code:qe.invalid_type}),It}if(k0(this,Yf,"f")||a7(this,Yf,new Set(this._def.values),"f"),!k0(this,Yf,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return et(r,{received:r.data,code:qe.invalid_enum_value,options:n}),It}return Rn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ua.create(t,{...this._def,...r})}exclude(t,r=this._def){return ua.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};i(ua,"ZodEnum");Yf=new WeakMap;ua.create=u7;var fs=class extends Lt{constructor(){super(...arguments),Xf.set(this,void 0)}_parse(t){let r=rr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==nt.string&&n.parsedType!==nt.number){let a=rr.objectValues(r);return et(n,{expected:rr.joinValues(a),received:n.parsedType,code:qe.invalid_type}),It}if(k0(this,Xf,"f")||a7(this,Xf,new Set(rr.getValidEnumValues(this._def.values)),"f"),!k0(this,Xf,"f").has(t.data)){let a=rr.objectValues(r);return et(n,{received:n.data,code:qe.invalid_enum_value,options:a}),It}return Rn(t.data)}get enum(){return this._def.values}};i(fs,"ZodNativeEnum");Xf=new WeakMap;fs.create=(e,t)=>new fs({values:e,typeName:Ct.ZodNativeEnum,...jt(t)});var So=class extends Lt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.promise&&r.common.async===!1)return et(r,{code:qe.invalid_type,expected:nt.promise,received:r.parsedType}),It;let n=r.parsedType===nt.promise?r.data:Promise.resolve(r.data);return Rn(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};i(So,"ZodPromise");So.create=(e,t)=>new So({type:e,typeName:Ct.ZodPromise,...jt(t)});var Jn=class extends Lt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ct.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:c=>{et(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let c=a.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return It;let d=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return d.status==="aborted"?It:d.status==="dirty"||r.value==="dirty"?ju(d.value):d});{if(r.value==="aborted")return It;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?It:l.status==="dirty"||r.value==="dirty"?ju(l.value):l}}if(a.type==="refinement"){let c=i(l=>{let d=a.refinement(l,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?It:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?It:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Qf(c))return c;let l=a.transform(c.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>Qf(c)?Promise.resolve(a.transform(c.value,s)).then(l=>({status:r.value,value:l})):c);rr.assertNever(a)}};i(Jn,"ZodEffects");Jn.create=(e,t,r)=>new Jn({schema:e,typeName:Ct.ZodEffects,effect:t,...jt(r)});Jn.createWithPreprocess=(e,t,r)=>new Jn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ct.ZodEffects,...jt(r)});var wi=class extends Lt{_parse(t){return this._getType(t)===nt.undefined?Rn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(wi,"ZodOptional");wi.create=(e,t)=>new wi({innerType:e,typeName:Ct.ZodOptional,...jt(t)});var la=class extends Lt{_parse(t){return this._getType(t)===nt.null?Rn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(la,"ZodNullable");la.create=(e,t)=>new la({innerType:e,typeName:Ct.ZodNullable,...jt(t)});var ds=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===nt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};i(ds,"ZodDefault");ds.create=(e,t)=>new ds({innerType:e,typeName:Ct.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...jt(t)});var hs=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ed(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Sn(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Sn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};i(hs,"ZodCatch");hs.create=(e,t)=>new hs({innerType:e,typeName:Ct.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...jt(t)});var bc=class extends Lt{_parse(t){if(this._getType(t)!==nt.nan){let n=this._getOrReturnCtx(t);return et(n,{code:qe.invalid_type,expected:nt.nan,received:n.parsedType}),It}return{status:"valid",value:t.data}}};i(bc,"ZodNaN");bc.create=e=>new bc({typeName:Ct.ZodNaN,...jt(e)});var gF=Symbol("zod_brand"),$u=class extends Lt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};i($u,"ZodBranded");var ps=class extends Lt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return i(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?It:s.status==="dirty"?(r.dirty(),ju(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?It:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new ps({in:t,out:r,typeName:Ct.ZodPipeline})}};i(ps,"ZodPipeline");var ms=class extends Lt{_parse(t){let r=this._def.innerType._parse(t),n=i(a=>(Qf(a)&&(a.value=Object.freeze(a.value)),a),"freeze");return ed(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}};i(ms,"ZodReadonly");ms.create=(e,t)=>new ms({innerType:e,typeName:Ct.ZodReadonly,...jt(t)});function l7(e,t={},r){return e?Eo.create().superRefine((n,a)=>{var s,c;if(!e(n)){let l=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,d=(c=(s=l.fatal)!==null&&s!==void 0?s:r)!==null&&c!==void 0?c:!0,p=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...p,fatal:d})}}):Eo.create()}i(l7,"custom");var vF={object:Tr.lazycreate},Ct;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ct||(Ct={}));var yF=i((e,t={message:`Input not instance of ${e.name}`})=>l7(r=>r instanceof e,t),"instanceOfType"),f7=Wn.create,d7=sa.create,bF=bc.create,wF=ca.create,h7=ns.create,_F=$a.create,EF=mc.create,AF=is.create,SF=as.create,xF=Eo.create,TF=za.create,CF=qi.create,MF=gc.create,IF=Zn.create,kF=Tr.create,DF=Tr.strictCreate,OF=os.create,RF=vc.create,NF=ss.create,PF=bi.create,BF=cs.create,LF=yc.create,UF=Ha.create,FF=Ao.create,jF=us.create,$F=ls.create,zF=ua.create,HF=fs.create,qF=So.create,n7=Jn.create,VF=wi.create,KF=la.create,GF=Jn.createWithPreprocess,WF=ps.create,ZF=i(()=>f7().optional(),"ostring"),JF=i(()=>d7().optional(),"onumber"),YF=i(()=>h7().optional(),"oboolean"),XF={string:e=>Wn.create({...e,coerce:!0}),number:e=>sa.create({...e,coerce:!0}),boolean:e=>ns.create({...e,coerce:!0}),bigint:e=>ca.create({...e,coerce:!0}),date:e=>$a.create({...e,coerce:!0})},QF=It,$=Object.freeze({__proto__:null,defaultErrorMap:zu,setErrorMap:QU,getErrorMap:M0,makeIssue:I0,EMPTY_PATH:eF,addIssueToContext:et,ParseStatus:Yr,INVALID:It,DIRTY:ju,OK:Rn,isAborted:Zy,isDirty:Jy,isValid:Qf,isAsync:ed,get util(){return rr},get objectUtil(){return Wy},ZodParsedType:nt,getParsedType:rs,ZodType:Lt,datetimeRegex:c7,ZodString:Wn,ZodNumber:sa,ZodBigInt:ca,ZodBoolean:ns,ZodDate:$a,ZodSymbol:mc,ZodUndefined:is,ZodNull:as,ZodAny:Eo,ZodUnknown:za,ZodNever:qi,ZodVoid:gc,ZodArray:Zn,ZodObject:Tr,ZodUnion:os,ZodDiscriminatedUnion:vc,ZodIntersection:ss,ZodTuple:bi,ZodRecord:cs,ZodMap:yc,ZodSet:Ha,ZodFunction:Ao,ZodLazy:us,ZodLiteral:ls,ZodEnum:ua,ZodNativeEnum:fs,ZodPromise:So,ZodEffects:Jn,ZodTransformer:Jn,ZodOptional:wi,ZodNullable:la,ZodDefault:ds,ZodCatch:hs,ZodNaN:bc,BRAND:gF,ZodBranded:$u,ZodPipeline:ps,ZodReadonly:ms,custom:l7,Schema:Lt,ZodSchema:Lt,late:vF,get ZodFirstPartyTypeKind(){return Ct},coerce:XF,any:xF,array:IF,bigint:wF,boolean:h7,date:_F,discriminatedUnion:RF,effect:n7,enum:zF,function:FF,instanceof:yF,intersection:NF,lazy:jF,literal:$F,map:LF,nan:bF,nativeEnum:HF,never:CF,null:SF,nullable:KF,number:d7,object:kF,oboolean:YF,onumber:JF,optional:VF,ostring:ZF,pipeline:WF,preprocess:GF,promise:qF,record:BF,set:UF,strictObject:DF,string:f7,symbol:EF,transformer:n7,tuple:PF,undefined:AF,union:OF,unknown:TF,void:MF,NEVER:QF,ZodIssueCode:qe,quotelessJson:XU,ZodError:Sn});var Hu=Symbol("current"),wc=Symbol("previous");var td=i((e,{ref:t,refType:r,param:n,header:a,...s}={})=>({...s,...e}),"mergeOpenApi");function p7(e){if(typeof e.ZodType.prototype.openapi<"u")return;e.ZodType.prototype.openapi=function(s){let{zodOpenApi:c,...l}=this._def,d=new this.constructor({...l,zodOpenApi:{openapi:td(s,c?.openapi)}});return d._def.zodOpenApi[Hu]=d,c&&(d._def.zodOpenApi[wc]=this),d};let t=e.ZodType.prototype.describe;e.ZodType.prototype.describe=function(...s){let c=t.apply(this,s),l=c._def;if(l.zodOpenApi){let d={...l.zodOpenApi};d.openapi=td({description:s[0]},d.openapi),d[wc]=this,d[Hu]=c,l.zodOpenApi=d}else l.zodOpenApi={openapi:{description:s[0]},[Hu]:c};return c};let r=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...s){let c=r.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=td({},d.openapi),d[wc]=this,c._def.zodOpenApi=d}else c._def.zodOpenApi={[wc]:this};return c};let n=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...s){let c=n.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=td({},d.openapi),delete d[wc],delete d[Hu],c._def.zodOpenApi=d}return c};let a=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...s){let c=a.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=td({},d.openapi),delete d[wc],delete d[Hu],c._def.zodOpenApi=d}return c}}i(p7,"extendZodWithOpenApi");p7($);var ej=Object.defineProperty,tj=i((e,t)=>ej(e,"name",{value:t,configurable:!0}),"__name"),N0=$.array($.string().or($.record($.any()))),BY=$.object({type:$.string().optional(),narrative:$.string().optional()}),P0=$.string().or($.object({id:$.string(),type:$.string(),caption:$.string().optional()})),rj=$.object({type:$.string().min(1).or($.string().array().nonempty()),latitude:$.number(),longitude:$.number()}),nj=$.object({type:$.string().min(1).or($.string().array().nonempty()),addressCountry:$.string().optional(),addressCountryCode:$.string().optional(),addressRegion:$.string().optional(),addressLocality:$.string().optional(),streetAddress:$.string().optional(),postOfficeBoxNumber:$.string().optional(),postalCode:$.string().optional(),geo:rj.optional()}),ij=$.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or($.string()),E7=$.object({type:$.string().min(1).or($.string().array().nonempty()),identifier:$.string(),identifierType:ij}),rd=$.string().or($.object({id:$.string().optional(),type:$.string().or($.string().array().nonempty().optional()),name:$.string().optional(),url:$.string().optional(),phone:$.string().optional(),description:$.string().optional(),endorsement:$.any().array().optional(),image:P0.optional(),email:$.string().email().optional(),address:nj.optional(),otherIdentifier:E7.array().optional(),official:$.string().optional(),parentOrg:$.any().optional(),familyName:$.string().optional(),givenName:$.string().optional(),additionalName:$.string().optional(),patronymicName:$.string().optional(),honorificPrefix:$.string().optional(),honorificSuffix:$.string().optional(),familyNamePrefix:$.string().optional(),dateOfBirth:$.string().optional()}).catchall($.any())),Xy=$.object({id:$.string().optional()}).catchall($.any()),D0=$.object({type:$.string(),id:$.string()}).catchall($.any()),m7=$.object({id:$.string(),type:$.string()}).catchall($.any()),g7=$.object({id:$.string().optional(),type:$.string()}).catchall($.any()),v7=$.object({type:$.string(),id:$.string().optional()}).catchall($.any()),y7=$.object({type:$.string().or($.string().array().nonempty()),id:$.string().optional()}).catchall($.any()),O0=$.object({"@context":N0,id:$.string().optional(),type:$.string().array().nonempty(),issuer:rd,credentialSubject:Xy.or(Xy.array()),refreshService:g7.or(g7.array()).optional(),credentialSchema:m7.or(m7.array()).optional(),issuanceDate:$.string().optional(),expirationDate:$.string().optional(),credentialStatus:D0.or(D0.array()).optional(),name:$.string().optional(),description:$.string().optional(),validFrom:$.string().optional(),validUntil:$.string().optional(),status:D0.or(D0.array()).optional(),termsOfUse:v7.or(v7.array()).optional(),evidence:y7.or(y7.array()).optional()}).catchall($.any()),qa=$.object({type:$.string(),created:$.string(),challenge:$.string().optional(),domain:$.string().optional(),nonce:$.string().optional(),proofPurpose:$.string(),verificationMethod:$.string(),jws:$.string().optional()}).catchall($.any()),R0=O0.extend({proof:qa.or(qa.array())}),aj=$.object({"@context":N0,id:$.string().optional(),type:$.string().or($.string().array().nonempty()),verifiableCredential:R0.or(R0.array()).optional(),holder:$.string().optional()}).catchall($.any()),LY=aj.extend({proof:qa.or(qa.array())}),tb=$.object({kty:$.string(),crv:$.string(),x:$.string(),y:$.string().optional(),n:$.string().optional(),d:$.string().optional()}),jY=tb.omit({d:!0}).extend({d:$.string()}),oj=$.object({alg:$.string(),iv:$.string(),tag:$.string(),epk:tb.partial().optional(),kid:$.string().optional(),apv:$.string().optional(),apu:$.string().optional()}),sj=$.object({header:oj,encrypted_key:$.string()}),cj=$.object({protected:$.string(),iv:$.string(),ciphertext:$.string(),tag:$.string(),aad:$.string().optional(),recipients:sj.array().optional()}),_c=$.string().or($.object({"@context":N0.optional(),id:$.string(),type:$.string(),controller:$.string(),publicKeyJwk:tb.optional(),publicKeyBase58:$.string().optional(),blockChainAccountId:$.string().optional()}).catchall($.any())),uj=$.object({id:$.string(),type:$.string().or($.string().array().nonempty()),serviceEndpoint:$.any().or($.any().array().nonempty())}).catchall($.any()),$Y=$.object({"@context":N0,id:$.string(),alsoKnownAs:$.string().optional(),controller:$.string().or($.string().array().nonempty()).optional(),verificationMethod:_c.array().optional(),authentication:_c.array().optional(),assertionMethod:_c.array().optional(),keyAgreement:_c.array().optional(),capabilityInvocation:_c.array().optional(),capabilityDelegation:_c.array().optional(),publicKey:_c.array().optional(),service:uj.array().optional(),proof:qa.or(qa.array()).optional()}).catchall($.any()),lj=$.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or($.string()),B0=$.object({type:$.string().array().nonempty(),targetCode:$.string().optional(),targetDescription:$.string().optional(),targetName:$.string(),targetFramework:$.string().optional(),targetType:lj.optional(),targetUrl:$.string()}),fj=$.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),dj=fj.or($.string()),hj=$.object({id:$.string().optional(),narrative:$.string().optional()}).catchall($.any()),pj=$.object({id:$.string(),type:$.string().array().nonempty(),endorsementComment:$.string().optional()}),mj=O0.extend({credentialSubject:pj,proof:qa.or(qa.array()).optional()}),gj=$.object({id:$.string(),"@language":$.string().optional(),version:$.string().optional()}),vj=$.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or($.string()),yj=$.object({id:$.string(),type:$.string().array().nonempty(),alignment:B0.array().optional(),description:$.string().optional(),level:$.string().optional(),name:$.string(),points:$.string().optional()}).catchall($.any()),bj=$.object({id:$.string(),type:$.string().array().nonempty(),alignment:B0.array().optional(),allowedValue:$.string().array().optional(),name:$.string(),requiredLevel:$.string().optional(),requiredValue:$.string().optional(),resultType:vj,rubricCriterionLevel:yj.array().optional(),valueMax:$.string().optional(),valueMin:$.string().optional()}).catchall($.any()),wj=$.object({id:$.string().optional(),type:$.string().array().nonempty(),alignment:B0.array().optional(),achievementType:dj.optional(),creator:rd.optional(),creditsAvailable:$.number().optional(),criteria:hj,description:$.string(),endorsement:mj.array().optional(),fieldOfStudy:$.string().optional(),humanCode:$.string().optional(),image:P0.optional(),"@language":$.string().optional(),name:$.string(),otherIdentifier:E7.array().optional(),related:gj.array().optional(),resultDescription:bj.array().optional(),specialization:$.string().optional(),tag:$.string().array().optional(),version:$.string().optional()}).catchall($.any()),_j=$.object({type:$.string(),hashed:$.boolean(),identityHash:$.string(),identityType:$.string(),salt:$.string().optional()}),Ej=$.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),Aj=$.object({type:$.string().array().nonempty(),achievedLevel:$.string().optional(),alignment:B0.array().optional(),resultDescription:$.string().optional(),status:Ej.optional(),value:$.string().optional()}).catchall($.any()),b7=$.object({id:$.string().optional(),type:$.string().array().nonempty(),activityEndDate:$.string().optional(),activityStartDate:$.string().optional(),creditsEarned:$.number().optional(),achievement:wj.optional(),identifier:_j.array().optional(),image:P0.optional(),licenseNumber:$.string().optional(),narrative:$.string().optional(),result:Aj.array().optional(),role:$.string().optional(),source:rd.optional(),term:$.string().optional()}).catchall($.any()),Sj=$.object({id:$.string().optional(),type:$.string().or($.string().array().nonempty()),narrative:$.string().optional(),name:$.string().optional(),description:$.string().optional(),genre:$.string().optional(),audience:$.string().optional()}).catchall($.any()),xj=O0.extend({name:$.string().optional(),description:$.string().optional(),image:P0.optional(),credentialSubject:b7.or(b7.array()),endorsement:O0.array().optional(),evidence:Sj.array().optional()}),HY=xj.extend({proof:qa.or(qa.array())}),VY=$.object({checks:$.string().array(),warnings:$.string().array(),errors:$.string().array()}),A7=$.enum(["Success","Failed","Error"]),KY=A7.enum,GY=$.object({check:$.string(),status:A7,message:$.string().optional(),details:$.string().optional()}),WY=$.object({title:$.string().optional(),createdAt:$.string().optional(),issuer:rd.optional(),issuee:rd.optional(),credentialSubject:Xy.optional()}),Ec=$.object({id:$.string(),uri:$.string()}).catchall($.any()),YY=$.object({limit:$.number(),cursor:$.string().optional(),sort:$.string().optional()}),Yn=$.object({cursor:$.string().optional(),hasMore:$.boolean()}),S7=$.object({encryptedRecord:cj,fields:$.string().array()}).catchall($.any()),XY=Yn.extend({records:S7.array()}),Tj=S7.extend({id:$.string()}),QY=Yn.extend({records:Tj.array()}),w7=tj(e=>{let t=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!t)throw new Error("Invalid RegExp string format");return{pattern:t[1],flags:t[2]}},"parseRegexString"),Cj=$.instanceof(RegExp).or($.string().refine(e=>{try{return w7(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:t,flags:r}=w7(e);try{return new RegExp(t,r)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),pr=$.string().or($.object({$in:$.string().array()})).or($.object({$regex:Cj})),Mj=$.object({backgroundColor:$.string().optional(),backgroundImage:$.string().optional(),fadeBackgroundImage:$.boolean().optional(),repeatBackgroundImage:$.boolean().optional(),fontColor:$.string().optional(),accentColor:$.string().optional(),accentFontColor:$.string().optional(),idBackgroundImage:$.string().optional(),fadeIdBackgroundImage:$.boolean().optional(),idBackgroundColor:$.string().optional(),repeatIdBackgroundImage:$.boolean().optional()}),gs=$.object({profileId:$.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:$.string().default("").describe("Human-readable display name for the profile."),shortBio:$.string().default("").describe("Short bio for the profile."),bio:$.string().default("").describe("Longer bio for the profile."),did:$.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:$.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:$.string().optional().describe("Contact email address for the profile."),image:$.string().optional().describe("Profile image URL for the profile."),heroImage:$.string().optional().describe("Hero image URL for the profile."),websiteLink:$.string().optional().describe("Website link for the profile."),isServiceProfile:$.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:$.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:$.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:Mj.optional().describe("Display settings for the profile."),role:$.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:$.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')}),rX=$.object({profileId:pr,displayName:pr,shortBio:pr,bio:pr,email:pr,websiteLink:pr,isServiceProfile:$.boolean(),type:pr}).partial(),nX=Yn.extend({records:gs.array()}),iX=$.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),x7=$.object({id:$.string(),created:$.string(),displayName:$.string().default("").optional(),shortBio:$.string().default("").optional(),bio:$.string().default("").optional(),email:$.string().optional(),image:$.string().optional(),heroImage:$.string().optional()}),aX=Yn.extend({records:x7.extend({did:$.string()}).array()}),oX=$.object({id:pr,displayName:pr,shortBio:pr,bio:pr,email:pr}).partial(),sX=Yn.extend({records:$.object({profile:gs,manager:x7.extend({did:$.string()}).optional()}).array()}),cX=$.object({uri:$.string(),to:$.string(),from:$.string(),sent:$.string().datetime(),received:$.string().datetime().optional()}),T7=$.object({role:$.string(),canEdit:$.boolean(),canIssue:$.boolean(),canRevoke:$.boolean(),canManagePermissions:$.boolean(),canIssueChildren:$.string(),canCreateChildren:$.string(),canEditChildren:$.string(),canRevokeChildren:$.string(),canManageChildrenPermissions:$.string(),canManageChildrenProfiles:$.boolean().default(!1).optional(),canViewAnalytics:$.boolean()}),Ij=$.object({role:pr,canEdit:$.boolean(),canIssue:$.boolean(),canRevoke:$.boolean(),canManagePermissions:$.boolean(),canIssueChildren:pr,canCreateChildren:pr,canEditChildren:pr,canRevokeChildren:pr,canManageChildrenPermissions:pr,canManageChildrenProfiles:$.boolean(),canViewAnalytics:$.boolean()}).partial(),_7=$.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),kj=$.discriminatedUnion("type",[$.object({type:$.literal(_7.Values.GRANT_PERMISSIONS),data:$.object({claimUri:$.string(),targetUri:$.string(),permissions:T7.partial()})}),$.object({type:$.literal(_7.Values.ADD_ADMIN),data:$.object({claimUri:$.string(),targetUri:$.string()})})]),uX=$.object({type:pr,data:$.object({claimUri:pr,targetUri:pr,permissions:Ij})}).deepPartial(),Dj=$.object({id:$.string(),createdAt:$.string(),updatedAt:$.string()}).and(kj),lX=Yn.extend({records:Dj.array()}),Qy=$.enum(["DRAFT","LIVE"]),Oj=$.object({uri:$.string(),name:$.string().optional(),type:$.string().optional(),category:$.string().optional(),status:Qy.optional(),autoConnectRecipients:$.boolean().optional(),meta:$.record($.any()).optional(),claimPermissions:T7.optional(),allowAnyoneToCreateChildren:$.boolean().optional()}),fX=$.object({uri:pr,name:pr,type:pr,category:pr,meta:$.record(pr),status:Qy.or($.object({$in:Qy.array()})),autoConnectRecipients:$.boolean()}).partial(),dX=Yn.extend({records:Oj.array()}),Rj=$.object({to:gs,from:$.string(),received:$.string().optional(),uri:$.string().optional()}),hX=Yn.extend({records:Rj.array()}),pX=$.object({endpoint:$.string(),name:$.string(),did:$.string().optional()}),mX=$.object({ttlSeconds:$.number().optional(),totalUses:$.number().optional()}),Nj=$.object({endpoint:$.string()}),gX=$.object({signingAuthority:Nj,relationship:$.object({name:$.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:$.string()})}),vX=$.object({boostUri:$.string(),signingAuthority:$.object({endpoint:$.string(),name:$.string()})}),Pj=$.enum(["live","stale","withdrawn"]),Bj=$.object({read:$.object({anonymize:$.boolean().optional(),credentials:$.object({categories:$.record($.object({required:$.boolean()})).default({})}).default({}),personal:$.record($.object({required:$.boolean()})).default({})}).default({}),write:$.object({credentials:$.object({categories:$.record($.object({required:$.boolean()})).default({})}).default({}),personal:$.record($.object({required:$.boolean()})).default({})}).default({})}),C7=$.object({contract:Bj,owner:gs,name:$.string(),subtitle:$.string().optional(),description:$.string().optional(),reasonForAccessing:$.string().optional(),image:$.string().optional(),uri:$.string(),needsGuardianConsent:$.boolean().optional(),redirectUrl:$.string().optional(),frontDoorBoostUri:$.string().optional(),createdAt:$.string(),updatedAt:$.string(),expiresAt:$.string().optional(),autoBoosts:$.string().array().optional(),writers:$.array(gs).optional()}),yX=Yn.extend({records:C7.omit({owner:!0}).array()}),Lj=$.object({credentials:$.object({categories:$.record($.string().array()).default({})}),personal:$.record($.string()).default({}),date:$.string()}),bX=Yn.extend({records:Lj.array()}),Uj=$.object({credentials:$.object({category:$.string(),uri:$.string()}).array(),personal:$.record($.string()).default({}),date:$.string(),contractUri:$.string()}),wX=Yn.extend({records:Uj.array()}),M7=$.object({sharing:$.boolean().optional(),shared:$.string().array().optional(),shareAll:$.boolean().optional(),shareUntil:$.string().optional()}),I7=$.object({read:$.object({anonymize:$.boolean().optional(),credentials:$.object({shareAll:$.boolean().optional(),sharing:$.boolean().optional(),categories:$.record(M7).default({})}).default({}),personal:$.record($.string()).default({})}).default({}),write:$.object({credentials:$.object({categories:$.record($.boolean()).default({})}).default({}),personal:$.record($.boolean()).default({})}).default({}),deniedWriters:$.array($.string()).optional()}),_X=Yn.extend({records:$.object({expiresAt:$.string().optional(),oneTime:$.boolean().optional(),terms:I7,contract:C7,uri:$.string(),consenter:gs,status:Pj}).array()}),EX=$.object({read:$.object({anonymize:$.boolean().optional(),credentials:$.object({categories:$.record($.object({required:$.boolean().optional()})).optional()}).optional(),personal:$.record($.object({required:$.boolean().optional()})).optional()}).optional(),write:$.object({credentials:$.object({categories:$.record($.object({required:$.boolean().optional()})).optional()}).optional(),personal:$.record($.object({required:$.boolean().optional()})).optional()}).optional()}),AX=$.object({anonymize:$.boolean().optional(),credentials:$.object({categories:$.record($.boolean()).optional()}).optional(),personal:$.record($.boolean()).optional()}),SX=$.object({credentials:$.object({categories:$.record($.boolean()).optional()}).optional(),personal:$.record($.boolean()).optional(),id:pr.optional()}),Fj=$.object({read:$.object({anonymize:$.boolean().optional(),credentials:$.object({shareAll:$.boolean().optional(),sharing:$.boolean().optional(),categories:$.record(M7.optional()).optional()}).optional(),personal:$.record($.string()).optional()}).optional(),write:$.object({credentials:$.object({categories:$.record($.boolean()).optional()}).optional(),personal:$.record($.boolean()).optional()}).optional()}),eb=$.enum(["consent","update","sync","withdraw","write"]),xX=$.object({terms:Fj.optional(),action:eb.or(eb.array()).optional(),date:$.object({$gt:$.string()}).or($.object({$lt:$.string()})).or($.object({$eq:$.string()})).optional(),expiresAt:$.object({$gt:$.string()}).or($.object({$lt:$.string()})).or($.object({$eq:$.string()})).optional(),oneTime:$.boolean().optional()}),k7=$.object({expiresAt:$.string().optional(),oneTime:$.boolean().optional(),terms:I7.optional(),id:$.string(),action:eb,date:$.string(),uris:$.string().array().optional()}),TX=Yn.extend({records:k7.array()}),jj=$.object({credentialUri:$.string(),termsUri:$.string(),contractUri:$.string(),boostUri:$.string(),category:$.string().optional(),date:$.string()}),CX=Yn.extend({records:jj.array()}),$j=$.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),zj=$.object({title:$.string().optional(),body:$.string().optional()}),Hj=$.object({vcUris:$.array($.string()).optional(),vpUris:$.array($.string()).optional(),transaction:k7.optional()}),MX=$.object({type:$j,to:gs.partial().and($.object({did:$.string()})),from:gs.partial().and($.object({did:$.string()})),message:zj.optional(),data:Hj.optional(),sent:$.string().datetime().optional()}),qj="auth-grant:",IX=$.object({id:$.string(),name:$.string(),description:$.string().optional(),challenge:$.string().startsWith(qj).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:$.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:$.string(),createdAt:$.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:$.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),kX=$.object({id:$.string()}).catchall($.any()),Vj=$.enum(["active","revoked"]),DX=$.object({id:pr,name:pr,description:pr,status:Vj}).partial();var Kj=Object.create,jd=Object.defineProperty,Gj=Object.getOwnPropertyDescriptor,k6=Object.getOwnPropertyNames,Wj=Object.getPrototypeOf,Zj=Object.prototype.hasOwnProperty,o=i((e,t)=>jd(e,"name",{value:t,configurable:!0}),"__name"),kb=(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 new Error('Dynamic require of "'+e+'" is not supported')}),gr=i((e,t)=>i(function(){return e&&(t=(0,e[k6(e)[0]])(e=0)),t},"__init"),"__esm"),ze=i((e,t)=>i(function(){return t||(0,e[k6(e)[0]])((t={exports:{}}).exports,t),t.exports},"__require2"),"__commonJS"),Sr=i((e,t)=>{for(var r in t)jd(e,r,{get:t[r],enumerable:!0})},"__export"),XS=i((e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of k6(t))!Zj.call(e,a)&&a!==r&&jd(e,a,{get:()=>t[a],enumerable:!(n=Gj(t,a))||n.enumerable});return e},"__copyProps"),ir=i((e,t,r)=>(r=e!=null?Kj(Wj(e)):{},XS(t||!e||!e.__esModule?jd(r,"default",{value:e,enumerable:!0}):r,e)),"__toESM"),rb=i(e=>XS(jd({},"__esModule",{value:!0}),e),"__toCommonJS"),Jj=ze({"../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(e,t){(function(){var r,n="4.17.21",a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",p=500,g="__lodash_placeholder__",v=1,y=2,_=4,x=1,R=2,D=1,P=2,Z=4,j=8,q=16,Q=32,Y=64,k=128,K=256,he=512,me=30,we="...",J=800,w=16,T=1,b=2,f=3,m=1/0,E=9007199254740991,O=17976931348623157e292,C=0/0,A=4294967295,B=A-1,V=A>>>1,I=[["ary",k],["bind",D],["bindKey",P],["curry",j],["curryRight",q],["flip",he],["partial",Q],["partialRight",Y],["rearg",K]],U="[object Arguments]",ge="[object Array]",L="[object AsyncFunction]",ne="[object Boolean]",oe="[object Date]",M="[object DOMException]",G="[object Error]",ae="[object Function]",fe="[object GeneratorFunction]",be="[object Map]",Oe="[object Number]",X="[object Null]",N="[object Object]",F="[object Promise]",W="[object Proxy]",ie="[object RegExp]",ee="[object Set]",ue="[object String]",Ae="[object Symbol]",De="[object Undefined]",Ie="[object WeakMap]",Be="[object WeakSet]",Ke="[object ArrayBuffer]",ve="[object DataView]",pe="[object Float32Array]",re="[object Float64Array]",le="[object Int8Array]",_e="[object Int16Array]",Te="[object Int32Array]",Ce="[object Uint8Array]",Re="[object Uint8ClampedArray]",Dt="[object Uint16Array]",Ge="[object Uint32Array]",He=/\b__p \+= '';/g,Pt=/\b(__p \+=) '' \+/g,pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vt=/&(?:amp|lt|gt|quot|#39);/g,Rr=/[&<>"']/g,lt=RegExp(vt.source),ft=RegExp(Rr.source),lr=/<%-([\s\S]+?)%>/g,dt=/<%([\s\S]+?)%>/g,at=/<%=([\s\S]+?)%>/g,or=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ot=/^\w*$/,Xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qt=/[\\^$.*+?()[\]{}|]/g,st=RegExp(Qt.source),rt=/^\s+/,sr=/\s/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Je=/\{\n\/\* \[wrapped with (.+)\] \*/,cr=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,St=/[()=,{}\[\]\/\s]/,Tn=/\\(\\)?/g,xt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,hn=/^[-+]0x[0-9a-f]+$/i,er=/^0b[01]+$/i,tr=/^\[object .+?Constructor\]$/,nn=/^0o[0-7]+$/i,an=/^(?:0|[1-9]\d*)$/,Nr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vr=/($^)/,on=/['\n\r\u2028\u2029\\]/g,Cn="\\ud800-\\udfff",ki="\\u0300-\\u036f",Di="\\ufe20-\\ufe2f",Oi="\\u20d0-\\u20ff",Un=ki+Di+Oi,pn="\\u2700-\\u27bf",ii="a-z\\xdf-\\xf6\\xf8-\\xff",Fn="\\xac\\xb1\\xd7\\xf7",Ri="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ni="\\u2000-\\u206f",Pi=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ro="A-Z\\xc0-\\xd6\\xd8-\\xde",no="\\ufe0e\\ufe0f",io=Fn+Ri+Ni+Pi,jo="['\u2019]",rh="["+Cn+"]",Nl="["+io+"]",Us="["+Un+"]",Pl="\\d+",nh="["+pn+"]",Bl="["+ii+"]",Ll="[^"+Cn+io+Pl+pn+ii+ro+"]",Fs="\\ud83c[\\udffb-\\udfff]",ih="(?:"+Us+"|"+Fs+")",Ul="[^"+Cn+"]",ao="(?:\\ud83c[\\udde6-\\uddff]){2}",Yi="[\\ud800-\\udbff][\\udc00-\\udfff]",oo="["+ro+"]",Sa="\\u200d",Fl="(?:"+Bl+"|"+Ll+")",ah="(?:"+oo+"|"+Ll+")",jl="(?:"+jo+"(?:d|ll|m|re|s|t|ve))?",$l="(?:"+jo+"(?:D|LL|M|RE|S|T|VE))?",zl=ih+"?",Hl="["+no+"]?",ql="(?:"+Sa+"(?:"+[Ul,ao,Yi].join("|")+")"+Hl+zl+")*",xa="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Jc=Hl+zl+ql,sh="(?:"+[nh,ao,Yi].join("|")+")"+Jc,Vl="(?:"+[Ul+Us+"?",Us,ao,Yi,rh].join("|")+")",Kl=RegExp(jo,"g"),ch=RegExp(Us,"g"),Gl=RegExp(Fs+"(?="+Fs+")|"+Vl+Jc,"g"),Wl=RegExp([oo+"?"+Bl+"+"+jl+"(?="+[Nl,oo,"$"].join("|")+")",ah+"+"+$l+"(?="+[Nl,oo+Fl,"$"].join("|")+")",oo+"?"+Fl+"+"+jl,oo+"+"+$l,oh,xa,Pl,sh].join("|"),"g"),uh=RegExp("["+Sa+Cn+Un+no+"]"),js=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,lh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yc=-1,wr={};wr[pe]=wr[re]=wr[le]=wr[_e]=wr[Te]=wr[Ce]=wr[Re]=wr[Dt]=wr[Ge]=!0,wr[U]=wr[ge]=wr[Ke]=wr[ne]=wr[ve]=wr[oe]=wr[G]=wr[ae]=wr[be]=wr[Oe]=wr[N]=wr[ie]=wr[ee]=wr[ue]=wr[Ie]=!1;var vr={};vr[U]=vr[ge]=vr[Ke]=vr[ve]=vr[ne]=vr[oe]=vr[pe]=vr[re]=vr[le]=vr[_e]=vr[Te]=vr[be]=vr[Oe]=vr[N]=vr[ie]=vr[ee]=vr[ue]=vr[Ae]=vr[Ce]=vr[Re]=vr[Dt]=vr[Ge]=!0,vr[G]=vr[ae]=vr[Ie]=!1;var de={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Me={"&":"&","<":"<",">":">",'"':""","'":"'"},Le={"&":"&","<":"<",">":">",""":'"',"'":"'"},mt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Kr=parseFloat,sn=parseInt,Mn=typeof global=="object"&&global&&global.Object===Object&&global,mn=typeof self=="object"&&self&&self.Object===Object&&self,Fr=Mn||mn||Function("return this")(),Ta=typeof e=="object"&&e&&!e.nodeType&&e,Ca=Ta&&typeof t=="object"&&t&&!t.nodeType&&t,Zl=Ca&&Ca.exports===Ta,Xc=Zl&&Mn.process,gn=function(){try{var Se=Ca&&Ca.require&&Ca.require("util").types;return Se||Xc&&Xc.binding&&Xc.binding("util")}catch{}}(),$s=gn&&gn.isArrayBuffer,p3=gn&&gn.isDate,m3=gn&&gn.isMap,g3=gn&&gn.isRegExp,v3=gn&&gn.isSet,y3=gn&&gn.isTypedArray;function jn(Se,Pe,ke){switch(ke.length){case 0:return Se.call(Pe);case 1:return Se.call(Pe,ke[0]);case 2:return Se.call(Pe,ke[0],ke[1]);case 3:return Se.call(Pe,ke[0],ke[1],ke[2])}return Se.apply(Pe,ke)}i(jn,"apply"),o(jn,"apply");function b3(Se,Pe,ke,ht){for(var Nt=-1,fr=Se==null?0:Se.length;++Nt<fr;){var Wr=Se[Nt];Pe(ht,Wr,ke(Wr),Se)}return ht}i(b3,"arrayAggregator"),o(b3,"arrayAggregator");function ai(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length;++ke<ht&&Pe(Se[ke],ke,Se)!==!1;);return Se}i(ai,"arrayEach"),o(ai,"arrayEach");function w3(Se,Pe){for(var ke=Se==null?0:Se.length;ke--&&Pe(Se[ke],ke,Se)!==!1;);return Se}i(w3,"arrayEachRight"),o(w3,"arrayEachRight");function w1(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length;++ke<ht;)if(!Pe(Se[ke],ke,Se))return!1;return!0}i(w1,"arrayEvery"),o(w1,"arrayEvery");function so(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length,Nt=0,fr=[];++ke<ht;){var Wr=Se[ke];Pe(Wr,ke,Se)&&(fr[Nt++]=Wr)}return fr}i(so,"arrayFilter"),o(so,"arrayFilter");function Jl(Se,Pe){var ke=Se==null?0:Se.length;return!!ke&&zs(Se,Pe,0)>-1}i(Jl,"arrayIncludes"),o(Jl,"arrayIncludes");function fh(Se,Pe,ke){for(var ht=-1,Nt=Se==null?0:Se.length;++ht<Nt;)if(ke(Pe,Se[ht]))return!0;return!1}i(fh,"arrayIncludesWith"),o(fh,"arrayIncludesWith");function Mr(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length,Nt=Array(ht);++ke<ht;)Nt[ke]=Pe(Se[ke],ke,Se);return Nt}i(Mr,"arrayMap"),o(Mr,"arrayMap");function co(Se,Pe){for(var ke=-1,ht=Pe.length,Nt=Se.length;++ke<ht;)Se[Nt+ke]=Pe[ke];return Se}i(co,"arrayPush"),o(co,"arrayPush");function dh(Se,Pe,ke,ht){var Nt=-1,fr=Se==null?0:Se.length;for(ht&&fr&&(ke=Se[++Nt]);++Nt<fr;)ke=Pe(ke,Se[Nt],Nt,Se);return ke}i(dh,"arrayReduce"),o(dh,"arrayReduce");function _3(Se,Pe,ke,ht){var Nt=Se==null?0:Se.length;for(ht&&Nt&&(ke=Se[--Nt]);Nt--;)ke=Pe(ke,Se[Nt],Nt,Se);return ke}i(_3,"arrayReduceRight"),o(_3,"arrayReduceRight");function hh(Se,Pe){for(var ke=-1,ht=Se==null?0:Se.length;++ke<ht;)if(Pe(Se[ke],ke,Se))return!0;return!1}i(hh,"arraySome"),o(hh,"arraySome");var BD=ph("length");function E3(Se){return Se.split("")}i(E3,"asciiToArray"),o(E3,"asciiToArray");function A3(Se){return Se.match(ut)||[]}i(A3,"asciiWords"),o(A3,"asciiWords");function _1(Se,Pe,ke){var ht;return ke(Se,function(Nt,fr,Wr){if(Pe(Nt,fr,Wr))return ht=fr,!1}),ht}i(_1,"baseFindKey"),o(_1,"baseFindKey");function Yl(Se,Pe,ke,ht){for(var Nt=Se.length,fr=ke+(ht?1:-1);ht?fr--:++fr<Nt;)if(Pe(Se[fr],fr,Se))return fr;return-1}i(Yl,"baseFindIndex"),o(Yl,"baseFindIndex");function zs(Se,Pe,ke){return Pe===Pe?R3(Se,Pe,ke):Yl(Se,E1,ke)}i(zs,"baseIndexOf"),o(zs,"baseIndexOf");function S3(Se,Pe,ke,ht){for(var Nt=ke-1,fr=Se.length;++Nt<fr;)if(ht(Se[Nt],Pe))return Nt;return-1}i(S3,"baseIndexOfWith"),o(S3,"baseIndexOfWith");function E1(Se){return Se!==Se}i(E1,"baseIsNaN"),o(E1,"baseIsNaN");function A1(Se,Pe){var ke=Se==null?0:Se.length;return ke?gh(Se,Pe)/ke:C}i(A1,"baseMean"),o(A1,"baseMean");function ph(Se){return function(Pe){return Pe==null?r:Pe[Se]}}i(ph,"baseProperty"),o(ph,"baseProperty");function mh(Se){return function(Pe){return Se==null?r:Se[Pe]}}i(mh,"basePropertyOf"),o(mh,"basePropertyOf");function S1(Se,Pe,ke,ht,Nt){return Nt(Se,function(fr,Wr,_r){ke=ht?(ht=!1,fr):Pe(ke,fr,Wr,_r)}),ke}i(S1,"baseReduce"),o(S1,"baseReduce");function x3(Se,Pe){var ke=Se.length;for(Se.sort(Pe);ke--;)Se[ke]=Se[ke].value;return Se}i(x3,"baseSortBy"),o(x3,"baseSortBy");function gh(Se,Pe){for(var ke,ht=-1,Nt=Se.length;++ht<Nt;){var fr=Pe(Se[ht]);fr!==r&&(ke=ke===r?fr:ke+fr)}return ke}i(gh,"baseSum"),o(gh,"baseSum");function vh(Se,Pe){for(var ke=-1,ht=Array(Se);++ke<Se;)ht[ke]=Pe(ke);return ht}i(vh,"baseTimes"),o(vh,"baseTimes");function T3(Se,Pe){return Mr(Pe,function(ke){return[ke,Se[ke]]})}i(T3,"baseToPairs"),o(T3,"baseToPairs");function x1(Se){return Se&&Se.slice(0,I1(Se)+1).replace(rt,"")}i(x1,"baseTrim"),o(x1,"baseTrim");function $n(Se){return function(Pe){return Se(Pe)}}i($n,"baseUnary"),o($n,"baseUnary");function yh(Se,Pe){return Mr(Pe,function(ke){return Se[ke]})}i(yh,"baseValues"),o(yh,"baseValues");function Qc(Se,Pe){return Se.has(Pe)}i(Qc,"cacheHas"),o(Qc,"cacheHas");function T1(Se,Pe){for(var ke=-1,ht=Se.length;++ke<ht&&zs(Pe,Se[ke],0)>-1;);return ke}i(T1,"charsStartIndex"),o(T1,"charsStartIndex");function C1(Se,Pe){for(var ke=Se.length;ke--&&zs(Pe,Se[ke],0)>-1;);return ke}i(C1,"charsEndIndex"),o(C1,"charsEndIndex");function C3(Se,Pe){for(var ke=Se.length,ht=0;ke--;)Se[ke]===Pe&&++ht;return ht}i(C3,"countHolders"),o(C3,"countHolders");var LD=mh(de),UD=mh(Me);function M3(Se){return"\\"+mt[Se]}i(M3,"escapeStringChar"),o(M3,"escapeStringChar");function I3(Se,Pe){return Se==null?r:Se[Pe]}i(I3,"getValue"),o(I3,"getValue");function Hs(Se){return uh.test(Se)}i(Hs,"hasUnicode"),o(Hs,"hasUnicode");function k3(Se){return js.test(Se)}i(k3,"hasUnicodeWord"),o(k3,"hasUnicodeWord");function D3(Se){for(var Pe,ke=[];!(Pe=Se.next()).done;)ke.push(Pe.value);return ke}i(D3,"iteratorToArray"),o(D3,"iteratorToArray");function bh(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ht,Nt){ke[++Pe]=[Nt,ht]}),ke}i(bh,"mapToArray"),o(bh,"mapToArray");function M1(Se,Pe){return function(ke){return Se(Pe(ke))}}i(M1,"overArg"),o(M1,"overArg");function uo(Se,Pe){for(var ke=-1,ht=Se.length,Nt=0,fr=[];++ke<ht;){var Wr=Se[ke];(Wr===Pe||Wr===g)&&(Se[ke]=g,fr[Nt++]=ke)}return fr}i(uo,"replaceHolders"),o(uo,"replaceHolders");function Xl(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ht){ke[++Pe]=ht}),ke}i(Xl,"setToArray"),o(Xl,"setToArray");function O3(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ht){ke[++Pe]=[ht,ht]}),ke}i(O3,"setToPairs"),o(O3,"setToPairs");function R3(Se,Pe,ke){for(var ht=ke-1,Nt=Se.length;++ht<Nt;)if(Se[ht]===Pe)return ht;return-1}i(R3,"strictIndexOf"),o(R3,"strictIndexOf");function N3(Se,Pe,ke){for(var ht=ke+1;ht--;)if(Se[ht]===Pe)return ht;return ht}i(N3,"strictLastIndexOf"),o(N3,"strictLastIndexOf");function qs(Se){return Hs(Se)?P3(Se):BD(Se)}i(qs,"stringSize"),o(qs,"stringSize");function Bi(Se){return Hs(Se)?B3(Se):E3(Se)}i(Bi,"stringToArray"),o(Bi,"stringToArray");function I1(Se){for(var Pe=Se.length;Pe--&&sr.test(Se.charAt(Pe)););return Pe}i(I1,"trimmedEndIndex"),o(I1,"trimmedEndIndex");var FD=mh(Le);function P3(Se){for(var Pe=Gl.lastIndex=0;Gl.test(Se);)++Pe;return Pe}i(P3,"unicodeSize"),o(P3,"unicodeSize");function B3(Se){return Se.match(Gl)||[]}i(B3,"unicodeToArray"),o(B3,"unicodeToArray");function L3(Se){return Se.match(Wl)||[]}i(L3,"unicodeWords"),o(L3,"unicodeWords");var jD=o(i(function Se(Pe){Pe=Pe==null?Fr:$o.defaults(Fr.Object(),Pe,$o.pick(Fr,lh));var ke=Pe.Array,ht=Pe.Date,Nt=Pe.Error,fr=Pe.Function,Wr=Pe.Math,_r=Pe.Object,k1=Pe.RegExp,$D=Pe.String,Li=Pe.TypeError,wh=ke.prototype,zD=fr.prototype,eu=_r.prototype,_h=Pe["__core-js_shared__"],Eh=zD.toString,yr=eu.hasOwnProperty,HD=0,U3=function(){var u=/[^.]+$/.exec(_h&&_h.keys&&_h.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),Ah=eu.toString,qD=Eh.call(_r),VD=Fr._,KD=k1("^"+Eh.call(yr).replace(Qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sh=Zl?Pe.Buffer:r,zo=Pe.Symbol,xh=Pe.Uint8Array,F3=Sh?Sh.allocUnsafe:r,Th=M1(_r.getPrototypeOf,_r),j3=_r.create,$3=eu.propertyIsEnumerable,Ch=wh.splice,z3=zo?zo.isConcatSpreadable:r,Ql=zo?zo.iterator:r,Vs=zo?zo.toStringTag:r,Mh=function(){try{var u=Wo(_r,"defineProperty");return u({},"",{}),u}catch{}}(),GD=Pe.clearTimeout!==Fr.clearTimeout&&Pe.clearTimeout,WD=ht&&ht.now!==Fr.Date.now&&ht.now,ZD=Pe.setTimeout!==Fr.setTimeout&&Pe.setTimeout,Ih=Wr.ceil,kh=Wr.floor,D1=_r.getOwnPropertySymbols,JD=Sh?Sh.isBuffer:r,H3=Pe.isFinite,YD=wh.join,XD=M1(_r.keys,_r),Zr=Wr.max,vn=Wr.min,QD=ht.now,eO=Pe.parseInt,q3=Wr.random,tO=wh.reverse,O1=Wo(Pe,"DataView"),ef=Wo(Pe,"Map"),R1=Wo(Pe,"Promise"),tu=Wo(Pe,"Set"),tf=Wo(Pe,"WeakMap"),rf=Wo(_r,"create"),Dh=tf&&new tf,ru={},rO=Zo(O1),nO=Zo(ef),iO=Zo(R1),aO=Zo(tu),oO=Zo(tf),Oh=zo?zo.prototype:r,nf=Oh?Oh.valueOf:r,V3=Oh?Oh.toString:r;function se(u){if(Dr(u)&&!Bt(u)&&!(u instanceof Wt)){if(u instanceof oi)return u;if(yr.call(u,"__wrapped__"))return Dg(u)}return new oi(u)}i(se,"lodash"),o(se,"lodash");var nu=function(){function u(){}return i(u,"object"),o(u,"object"),function(h){if(!kr(h))return{};if(j3)return j3(h);u.prototype=h;var S=new u;return u.prototype=r,S}}();function af(){}i(af,"baseLodash"),o(af,"baseLodash");function oi(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=r}i(oi,"LodashWrapper"),o(oi,"LodashWrapper"),se.templateSettings={escape:lr,evaluate:dt,interpolate:at,variable:"",imports:{_:se}},se.prototype=af.prototype,se.prototype.constructor=se,oi.prototype=nu(af.prototype),oi.prototype.constructor=oi;function Wt(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=A,this.__views__=[]}i(Wt,"LazyWrapper"),o(Wt,"LazyWrapper");function K3(){var u=new Wt(this.__wrapped__);return u.__actions__=In(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=In(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=In(this.__views__),u}i(K3,"lazyClone"),o(K3,"lazyClone");function G3(){if(this.__filtered__){var u=new Wt(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}i(G3,"lazyReverse"),o(G3,"lazyReverse");function W3(){var u=this.__wrapped__.value(),h=this.__dir__,S=Bt(u),z=h<0,te=S?u.length:0,ce=c5(0,te,this.__views__),ye=ce.start,Ee=ce.end,xe=Ee-ye,Ue=z?Ee:ye-1,Fe=this.__iteratees__,$e=Fe.length,Ye=0,gt=vn(xe,this.__takeCount__);if(!S||!z&&te==xe&>==xe)return tg(u,this.__actions__);var Tt=[];e:for(;xe--&&Ye<gt;){Ue+=h;for(var $t=-1,At=u[Ue];++$t<$e;){var Kt=Fe[$t],Zt=Kt.iteratee,qn=Kt.type,_n=Zt(At);if(qn==b)At=_n;else if(!_n){if(qn==T)continue e;break e}}Tt[Ye++]=At}return Tt}i(W3,"lazyValue"),o(W3,"lazyValue"),Wt.prototype=nu(af.prototype),Wt.prototype.constructor=Wt;function Ho(u){var h=-1,S=u==null?0:u.length;for(this.clear();++h<S;){var z=u[h];this.set(z[0],z[1])}}i(Ho,"Hash"),o(Ho,"Hash");function Z3(){this.__data__=rf?rf(null):{},this.size=0}i(Z3,"hashClear"),o(Z3,"hashClear");function J3(u){var h=this.has(u)&&delete this.__data__[u];return this.size-=h?1:0,h}i(J3,"hashDelete"),o(J3,"hashDelete");function Y3(u){var h=this.__data__;if(rf){var S=h[u];return S===d?r:S}return yr.call(h,u)?h[u]:r}i(Y3,"hashGet"),o(Y3,"hashGet");function X3(u){var h=this.__data__;return rf?h[u]!==r:yr.call(h,u)}i(X3,"hashHas"),o(X3,"hashHas");function Q3(u,h){var S=this.__data__;return this.size+=this.has(u)?0:1,S[u]=rf&&h===r?d:h,this}i(Q3,"hashSet"),o(Q3,"hashSet"),Ho.prototype.clear=Z3,Ho.prototype.delete=J3,Ho.prototype.get=Y3,Ho.prototype.has=X3,Ho.prototype.set=Q3;function Ma(u){var h=-1,S=u==null?0:u.length;for(this.clear();++h<S;){var z=u[h];this.set(z[0],z[1])}}i(Ma,"ListCache"),o(Ma,"ListCache");function ew(){this.__data__=[],this.size=0}i(ew,"listCacheClear"),o(ew,"listCacheClear");function tw(u){var h=this.__data__,S=of(h,u);if(S<0)return!1;var z=h.length-1;return S==z?h.pop():Ch.call(h,S,1),--this.size,!0}i(tw,"listCacheDelete"),o(tw,"listCacheDelete");function rw(u){var h=this.__data__,S=of(h,u);return S<0?r:h[S][1]}i(rw,"listCacheGet"),o(rw,"listCacheGet");function nw(u){return of(this.__data__,u)>-1}i(nw,"listCacheHas"),o(nw,"listCacheHas");function iw(u,h){var S=this.__data__,z=of(S,u);return z<0?(++this.size,S.push([u,h])):S[z][1]=h,this}i(iw,"listCacheSet"),o(iw,"listCacheSet"),Ma.prototype.clear=ew,Ma.prototype.delete=tw,Ma.prototype.get=rw,Ma.prototype.has=nw,Ma.prototype.set=iw;function Ia(u){var h=-1,S=u==null?0:u.length;for(this.clear();++h<S;){var z=u[h];this.set(z[0],z[1])}}i(Ia,"MapCache"),o(Ia,"MapCache");function aw(){this.size=0,this.__data__={hash:new Ho,map:new(ef||Ma),string:new Ho}}i(aw,"mapCacheClear"),o(aw,"mapCacheClear");function ow(u){var h=yf(this,u).delete(u);return this.size-=h?1:0,h}i(ow,"mapCacheDelete"),o(ow,"mapCacheDelete");function sw(u){return yf(this,u).get(u)}i(sw,"mapCacheGet"),o(sw,"mapCacheGet");function cw(u){return yf(this,u).has(u)}i(cw,"mapCacheHas"),o(cw,"mapCacheHas");function uw(u,h){var S=yf(this,u),z=S.size;return S.set(u,h),this.size+=S.size==z?0:1,this}i(uw,"mapCacheSet"),o(uw,"mapCacheSet"),Ia.prototype.clear=aw,Ia.prototype.delete=ow,Ia.prototype.get=sw,Ia.prototype.has=cw,Ia.prototype.set=uw;function qo(u){var h=-1,S=u==null?0:u.length;for(this.__data__=new Ia;++h<S;)this.add(u[h])}i(qo,"SetCache"),o(qo,"SetCache");function lw(u){return this.__data__.set(u,d),this}i(lw,"setCacheAdd"),o(lw,"setCacheAdd");function fw(u){return this.__data__.has(u)}i(fw,"setCacheHas"),o(fw,"setCacheHas"),qo.prototype.add=qo.prototype.push=lw,qo.prototype.has=fw;function Ui(u){var h=this.__data__=new Ma(u);this.size=h.size}i(Ui,"Stack"),o(Ui,"Stack");function dw(){this.__data__=new Ma,this.size=0}i(dw,"stackClear"),o(dw,"stackClear");function hw(u){var h=this.__data__,S=h.delete(u);return this.size=h.size,S}i(hw,"stackDelete"),o(hw,"stackDelete");function pw(u){return this.__data__.get(u)}i(pw,"stackGet"),o(pw,"stackGet");function mw(u){return this.__data__.has(u)}i(mw,"stackHas"),o(mw,"stackHas");function gw(u,h){var S=this.__data__;if(S instanceof Ma){var z=S.__data__;if(!ef||z.length<a-1)return z.push([u,h]),this.size=++S.size,this;S=this.__data__=new Ia(z)}return S.set(u,h),this.size=S.size,this}i(gw,"stackSet"),o(gw,"stackSet"),Ui.prototype.clear=dw,Ui.prototype.delete=hw,Ui.prototype.get=pw,Ui.prototype.has=mw,Ui.prototype.set=gw;function N1(u,h){var S=Bt(u),z=!S&&Zs(u),te=!S&&!z&&Jo(u),ce=!S&&!z&&!te&&du(u),ye=S||z||te||ce,Ee=ye?vh(u.length,$D):[],xe=Ee.length;for(var Ue in u)(h||yr.call(u,Ue))&&!(ye&&(Ue=="length"||te&&(Ue=="offset"||Ue=="parent")||ce&&(Ue=="buffer"||Ue=="byteLength"||Ue=="byteOffset")||Ra(Ue,xe)))&&Ee.push(Ue);return Ee}i(N1,"arrayLikeKeys"),o(N1,"arrayLikeKeys");function P1(u){var h=u.length;return h?u[zh(0,h-1)]:r}i(P1,"arraySample"),o(P1,"arraySample");function vw(u,h){return wf(In(u),Vo(h,0,u.length))}i(vw,"arraySampleSize"),o(vw,"arraySampleSize");function yw(u){return wf(In(u))}i(yw,"arrayShuffle"),o(yw,"arrayShuffle");function Rh(u,h,S){(S!==r&&!Fi(u[h],S)||S===r&&!(h in u))&&ka(u,h,S)}i(Rh,"assignMergeValue"),o(Rh,"assignMergeValue");function iu(u,h,S){var z=u[h];(!(yr.call(u,h)&&Fi(z,S))||S===r&&!(h in u))&&ka(u,h,S)}i(iu,"assignValue"),o(iu,"assignValue");function of(u,h){for(var S=u.length;S--;)if(Fi(u[S][0],h))return S;return-1}i(of,"assocIndexOf"),o(of,"assocIndexOf");function bw(u,h,S,z){return Ko(u,function(te,ce,ye){h(z,te,S(te),ye)}),z}i(bw,"baseAggregator"),o(bw,"baseAggregator");function B1(u,h){return u&&Qi(h,Jr(h),u)}i(B1,"baseAssign"),o(B1,"baseAssign");function ww(u,h){return u&&Qi(h,Dn(h),u)}i(ww,"baseAssignIn"),o(ww,"baseAssignIn");function ka(u,h,S){h=="__proto__"&&Mh?Mh(u,h,{configurable:!0,enumerable:!0,value:S,writable:!0}):u[h]=S}i(ka,"baseAssignValue"),o(ka,"baseAssignValue");function Nh(u,h){for(var S=-1,z=h.length,te=ke(z),ce=u==null;++S<z;)te[S]=ce?r:up(u,h[S]);return te}i(Nh,"baseAt"),o(Nh,"baseAt");function Vo(u,h,S){return u===u&&(S!==r&&(u=u<=S?u:S),h!==r&&(u=u>=h?u:h)),u}i(Vo,"baseClamp"),o(Vo,"baseClamp");function si(u,h,S,z,te,ce){var ye,Ee=h&v,xe=h&y,Ue=h&_;if(S&&(ye=te?S(u,z,te,ce):S(u)),ye!==r)return ye;if(!kr(u))return u;var Fe=Bt(u);if(Fe){if(ye=l5(u),!Ee)return In(u,ye)}else{var $e=bn(u),Ye=$e==ae||$e==fe;if(Jo(u))return ng(u,Ee);if($e==N||$e==U||Ye&&!te){if(ye=xe||Ye?{}:Ag(u),!Ee)return xe?Qw(u,ww(ye,u)):Xw(u,B1(ye,u))}else{if(!vr[$e])return te?u:{};ye=f5(u,$e,Ee)}}ce||(ce=new Ui);var gt=ce.get(u);if(gt)return gt;ce.set(u,ye),s_(u)?u.forEach(function(At){ye.add(si(At,h,S,At,u,ce))}):Q4(u)&&u.forEach(function(At,Kt){ye.set(Kt,si(At,h,S,Kt,u,ce))});var Tt=Ue?xe?Qh:Xh:xe?Dn:Jr,$t=Fe?r:Tt(u);return ai($t||u,function(At,Kt){$t&&(Kt=At,At=u[Kt]),iu(ye,Kt,si(At,h,S,Kt,u,ce))}),ye}i(si,"baseClone"),o(si,"baseClone");function _w(u){var h=Jr(u);return function(S){return L1(S,u,h)}}i(_w,"baseConforms"),o(_w,"baseConforms");function L1(u,h,S){var z=S.length;if(u==null)return!z;for(u=_r(u);z--;){var te=S[z],ce=h[te],ye=u[te];if(ye===r&&!(te in u)||!ce(ye))return!1}return!0}i(L1,"baseConformsTo"),o(L1,"baseConformsTo");function U1(u,h,S){if(typeof u!="function")throw new Li(c);return bf(function(){u.apply(r,S)},h)}i(U1,"baseDelay"),o(U1,"baseDelay");function au(u,h,S,z){var te=-1,ce=Jl,ye=!0,Ee=u.length,xe=[],Ue=h.length;if(!Ee)return xe;S&&(h=Mr(h,$n(S))),z?(ce=fh,ye=!1):h.length>=a&&(ce=Qc,ye=!1,h=new qo(h));e:for(;++te<Ee;){var Fe=u[te],$e=S==null?Fe:S(Fe);if(Fe=z||Fe!==0?Fe:0,ye&&$e===$e){for(var Ye=Ue;Ye--;)if(h[Ye]===$e)continue e;xe.push(Fe)}else ce(h,$e,z)||xe.push(Fe)}return xe}i(au,"baseDifference"),o(au,"baseDifference");var Ko=cg(Xi),Ew=cg(Ph,!0);function Aw(u,h){var S=!0;return Ko(u,function(z,te,ce){return S=!!h(z,te,ce),S}),S}i(Aw,"baseEvery"),o(Aw,"baseEvery");function sf(u,h,S){for(var z=-1,te=u.length;++z<te;){var ce=u[z],ye=h(ce);if(ye!=null&&(Ee===r?ye===ye&&!Hn(ye):S(ye,Ee)))var Ee=ye,xe=ce}return xe}i(sf,"baseExtremum"),o(sf,"baseExtremum");function Sw(u,h,S,z){var te=u.length;for(S=Ft(S),S<0&&(S=-S>te?0:te+S),z=z===r||z>te?te:Ft(z),z<0&&(z+=te),z=S>z?0:Xg(z);S<z;)u[S++]=h;return u}i(Sw,"baseFill"),o(Sw,"baseFill");function F1(u,h){var S=[];return Ko(u,function(z,te,ce){h(z,te,ce)&&S.push(z)}),S}i(F1,"baseFilter"),o(F1,"baseFilter");function Qr(u,h,S,z,te){var ce=-1,ye=u.length;for(S||(S=h5),te||(te=[]);++ce<ye;){var Ee=u[ce];h>0&&S(Ee)?h>1?Qr(Ee,h-1,S,z,te):co(te,Ee):z||(te[te.length]=Ee)}return te}i(Qr,"baseFlatten"),o(Qr,"baseFlatten");var j1=ug(),xw=ug(!0);function Xi(u,h){return u&&j1(u,h,Jr)}i(Xi,"baseForOwn"),o(Xi,"baseForOwn");function Ph(u,h){return u&&xw(u,h,Jr)}i(Ph,"baseForOwnRight"),o(Ph,"baseForOwnRight");function cf(u,h){return so(h,function(S){return Na(u[S])})}i(cf,"baseFunctions"),o(cf,"baseFunctions");function Go(u,h){h=fo(h,u);for(var S=0,z=h.length;u!=null&&S<z;)u=u[ea(h[S++])];return S&&S==z?u:r}i(Go,"baseGet"),o(Go,"baseGet");function $1(u,h,S){var z=h(u);return Bt(u)?z:co(z,S(u))}i($1,"baseGetAllKeys"),o($1,"baseGetAllKeys");function yn(u){return u==null?u===r?De:X:Vs&&Vs in _r(u)?o5(u):b5(u)}i(yn,"baseGetTag"),o(yn,"baseGetTag");function Bh(u,h){return u>h}i(Bh,"baseGt"),o(Bh,"baseGt");function Tw(u,h){return u!=null&&yr.call(u,h)}i(Tw,"baseHas"),o(Tw,"baseHas");function Cw(u,h){return u!=null&&h in _r(u)}i(Cw,"baseHasIn"),o(Cw,"baseHasIn");function Mw(u,h,S){return u>=vn(h,S)&&u<Zr(h,S)}i(Mw,"baseInRange"),o(Mw,"baseInRange");function Lh(u,h,S){for(var z=S?fh:Jl,te=u[0].length,ce=u.length,ye=ce,Ee=ke(ce),xe=1/0,Ue=[];ye--;){var Fe=u[ye];ye&&h&&(Fe=Mr(Fe,$n(h))),xe=vn(Fe.length,xe),Ee[ye]=!S&&(h||te>=120&&Fe.length>=120)?new qo(ye&&Fe):r}Fe=u[0];var $e=-1,Ye=Ee[0];e:for(;++$e<te&&Ue.length<xe;){var gt=Fe[$e],Tt=h?h(gt):gt;if(gt=S||gt!==0?gt:0,!(Ye?Qc(Ye,Tt):z(Ue,Tt,S))){for(ye=ce;--ye;){var $t=Ee[ye];if(!($t?Qc($t,Tt):z(u[ye],Tt,S)))continue e}Ye&&Ye.push(Tt),Ue.push(gt)}}return Ue}i(Lh,"baseIntersection"),o(Lh,"baseIntersection");function Iw(u,h,S,z){return Xi(u,function(te,ce,ye){h(z,S(te),ce,ye)}),z}i(Iw,"baseInverter"),o(Iw,"baseInverter");function ou(u,h,S){h=fo(h,u),u=Cg(u,h);var z=u==null?u:u[ea(ui(h))];return z==null?r:jn(z,u,S)}i(ou,"baseInvoke"),o(ou,"baseInvoke");function z1(u){return Dr(u)&&yn(u)==U}i(z1,"baseIsArguments"),o(z1,"baseIsArguments");function kw(u){return Dr(u)&&yn(u)==Ke}i(kw,"baseIsArrayBuffer"),o(kw,"baseIsArrayBuffer");function Dw(u){return Dr(u)&&yn(u)==oe}i(Dw,"baseIsDate"),o(Dw,"baseIsDate");function su(u,h,S,z,te){return u===h?!0:u==null||h==null||!Dr(u)&&!Dr(h)?u!==u&&h!==h:Ow(u,h,S,z,su,te)}i(su,"baseIsEqual"),o(su,"baseIsEqual");function Ow(u,h,S,z,te,ce){var ye=Bt(u),Ee=Bt(h),xe=ye?ge:bn(u),Ue=Ee?ge:bn(h);xe=xe==U?N:xe,Ue=Ue==U?N:Ue;var Fe=xe==N,$e=Ue==N,Ye=xe==Ue;if(Ye&&Jo(u)){if(!Jo(h))return!1;ye=!0,Fe=!1}if(Ye&&!Fe)return ce||(ce=new Ui),ye||du(u)?bg(u,h,S,z,te,ce):i5(u,h,xe,S,z,te,ce);if(!(S&x)){var gt=Fe&&yr.call(u,"__wrapped__"),Tt=$e&&yr.call(h,"__wrapped__");if(gt||Tt){var $t=gt?u.value():u,At=Tt?h.value():h;return ce||(ce=new Ui),te($t,At,S,z,ce)}}return Ye?(ce||(ce=new Ui),a5(u,h,S,z,te,ce)):!1}i(Ow,"baseIsEqualDeep"),o(Ow,"baseIsEqualDeep");function Rw(u){return Dr(u)&&bn(u)==be}i(Rw,"baseIsMap"),o(Rw,"baseIsMap");function Uh(u,h,S,z){var te=S.length,ce=te,ye=!z;if(u==null)return!ce;for(u=_r(u);te--;){var Ee=S[te];if(ye&&Ee[2]?Ee[1]!==u[Ee[0]]:!(Ee[0]in u))return!1}for(;++te<ce;){Ee=S[te];var xe=Ee[0],Ue=u[xe],Fe=Ee[1];if(ye&&Ee[2]){if(Ue===r&&!(xe in u))return!1}else{var $e=new Ui;if(z)var Ye=z(Ue,Fe,xe,u,h,$e);if(!(Ye===r?su(Fe,Ue,x|R,z,$e):Ye))return!1}}return!0}i(Uh,"baseIsMatch"),o(Uh,"baseIsMatch");function H1(u){if(!kr(u)||m5(u))return!1;var h=Na(u)?KD:tr;return h.test(Zo(u))}i(H1,"baseIsNative"),o(H1,"baseIsNative");function Nw(u){return Dr(u)&&yn(u)==ie}i(Nw,"baseIsRegExp"),o(Nw,"baseIsRegExp");function Pw(u){return Dr(u)&&bn(u)==ee}i(Pw,"baseIsSet"),o(Pw,"baseIsSet");function Bw(u){return Dr(u)&&xf(u.length)&&!!wr[yn(u)]}i(Bw,"baseIsTypedArray"),o(Bw,"baseIsTypedArray");function q1(u){return typeof u=="function"?u:u==null?On:typeof u=="object"?Bt(u)?G1(u[0],u[1]):K1(u):av(u)}i(q1,"baseIteratee"),o(q1,"baseIteratee");function Fh(u){if(!lu(u))return XD(u);var h=[];for(var S in _r(u))yr.call(u,S)&&S!="constructor"&&h.push(S);return h}i(Fh,"baseKeys"),o(Fh,"baseKeys");function Lw(u){if(!kr(u))return y5(u);var h=lu(u),S=[];for(var z in u)z=="constructor"&&(h||!yr.call(u,z))||S.push(z);return S}i(Lw,"baseKeysIn"),o(Lw,"baseKeysIn");function jh(u,h){return u<h}i(jh,"baseLt"),o(jh,"baseLt");function V1(u,h){var S=-1,z=kn(u)?ke(u.length):[];return Ko(u,function(te,ce,ye){z[++S]=h(te,ce,ye)}),z}i(V1,"baseMap"),o(V1,"baseMap");function K1(u){var h=ep(u);return h.length==1&&h[0][2]?xg(h[0][0],h[0][1]):function(S){return S===u||Uh(S,u,h)}}i(K1,"baseMatches"),o(K1,"baseMatches");function G1(u,h){return tp(u)&&Sg(h)?xg(ea(u),h):function(S){var z=up(S,u);return z===r&&z===h?lp(S,u):su(h,z,x|R)}}i(G1,"baseMatchesProperty"),o(G1,"baseMatchesProperty");function uf(u,h,S,z,te){u!==h&&j1(h,function(ce,ye){if(te||(te=new Ui),kr(ce))Uw(u,h,ye,S,uf,z,te);else{var Ee=z?z(np(u,ye),ce,ye+"",u,h,te):r;Ee===r&&(Ee=ce),Rh(u,ye,Ee)}},Dn)}i(uf,"baseMerge"),o(uf,"baseMerge");function Uw(u,h,S,z,te,ce,ye){var Ee=np(u,S),xe=np(h,S),Ue=ye.get(xe);if(Ue){Rh(u,S,Ue);return}var Fe=ce?ce(Ee,xe,S+"",u,h,ye):r,$e=Fe===r;if($e){var Ye=Bt(xe),gt=!Ye&&Jo(xe),Tt=!Ye&&!gt&&du(xe);Fe=xe,Ye||gt||Tt?Bt(Ee)?Fe=Ee:Pr(Ee)?Fe=In(Ee):gt?($e=!1,Fe=ng(xe,!0)):Tt?($e=!1,Fe=ig(xe,!0)):Fe=[]:fu(xe)||Zs(xe)?(Fe=Ee,Zs(Ee)?Fe=Qg(Ee):(!kr(Ee)||Na(Ee))&&(Fe=Ag(xe))):$e=!1}$e&&(ye.set(xe,Fe),te(Fe,xe,z,ce,ye),ye.delete(xe)),Rh(u,S,Fe)}i(Uw,"baseMergeDeep"),o(Uw,"baseMergeDeep");function W1(u,h){var S=u.length;if(!!S)return h+=h<0?S:0,Ra(h,S)?u[h]:r}i(W1,"baseNth"),o(W1,"baseNth");function Z1(u,h,S){h.length?h=Mr(h,function(ce){return Bt(ce)?function(ye){return Go(ye,ce.length===1?ce[0]:ce)}:ce}):h=[On];var z=-1;h=Mr(h,$n(Et()));var te=V1(u,function(ce,ye,Ee){var xe=Mr(h,function(Ue){return Ue(ce)});return{criteria:xe,index:++z,value:ce}});return x3(te,function(ce,ye){return Yw(ce,ye,S)})}i(Z1,"baseOrderBy"),o(Z1,"baseOrderBy");function Fw(u,h){return J1(u,h,function(S,z){return lp(u,z)})}i(Fw,"basePick"),o(Fw,"basePick");function J1(u,h,S){for(var z=-1,te=h.length,ce={};++z<te;){var ye=h[z],Ee=Go(u,ye);S(Ee,ye)&&cu(ce,fo(ye,u),Ee)}return ce}i(J1,"basePickBy"),o(J1,"basePickBy");function jw(u){return function(h){return Go(h,u)}}i(jw,"basePropertyDeep"),o(jw,"basePropertyDeep");function $h(u,h,S,z){var te=z?S3:zs,ce=-1,ye=h.length,Ee=u;for(u===h&&(h=In(h)),S&&(Ee=Mr(u,$n(S)));++ce<ye;)for(var xe=0,Ue=h[ce],Fe=S?S(Ue):Ue;(xe=te(Ee,Fe,xe,z))>-1;)Ee!==u&&Ch.call(Ee,xe,1),Ch.call(u,xe,1);return u}i($h,"basePullAll"),o($h,"basePullAll");function Y1(u,h){for(var S=u?h.length:0,z=S-1;S--;){var te=h[S];if(S==z||te!==ce){var ce=te;Ra(te)?Ch.call(u,te,1):Vh(u,te)}}return u}i(Y1,"basePullAt"),o(Y1,"basePullAt");function zh(u,h){return u+kh(q3()*(h-u+1))}i(zh,"baseRandom"),o(zh,"baseRandom");function $w(u,h,S,z){for(var te=-1,ce=Zr(Ih((h-u)/(S||1)),0),ye=ke(ce);ce--;)ye[z?ce:++te]=u,u+=S;return ye}i($w,"baseRange"),o($w,"baseRange");function Hh(u,h){var S="";if(!u||h<1||h>E)return S;do h%2&&(S+=u),h=kh(h/2),h&&(u+=u);while(h);return S}i(Hh,"baseRepeat"),o(Hh,"baseRepeat");function Ht(u,h){return Mg(Tg(u,h,On),u+"")}i(Ht,"baseRest"),o(Ht,"baseRest");function zw(u){return P1(Js(u))}i(zw,"baseSample"),o(zw,"baseSample");function Hw(u,h){var S=Js(u);return wf(S,Vo(h,0,S.length))}i(Hw,"baseSampleSize"),o(Hw,"baseSampleSize");function cu(u,h,S,z){if(!kr(u))return u;h=fo(h,u);for(var te=-1,ce=h.length,ye=ce-1,Ee=u;Ee!=null&&++te<ce;){var xe=ea(h[te]),Ue=S;if(xe==="__proto__"||xe==="constructor"||xe==="prototype")return u;if(te!=ye){var Fe=Ee[xe];Ue=z?z(Fe,xe,Ee):r,Ue===r&&(Ue=kr(Fe)?Fe:Ra(h[te+1])?[]:{})}iu(Ee,xe,Ue),Ee=Ee[xe]}return u}i(cu,"baseSet"),o(cu,"baseSet");var qw=Dh?function(u,h){return Dh.set(u,h),u}:On,sO=Mh?function(u,h){return Mh(u,"toString",{configurable:!0,enumerable:!1,value:fp(h),writable:!0})}:On;function Vw(u){return wf(Js(u))}i(Vw,"baseShuffle"),o(Vw,"baseShuffle");function ci(u,h,S){var z=-1,te=u.length;h<0&&(h=-h>te?0:te+h),S=S>te?te:S,S<0&&(S+=te),te=h>S?0:S-h>>>0,h>>>=0;for(var ce=ke(te);++z<te;)ce[z]=u[z+h];return ce}i(ci,"baseSlice"),o(ci,"baseSlice");function Kw(u,h){var S;return Ko(u,function(z,te,ce){return S=h(z,te,ce),!S}),!!S}i(Kw,"baseSome"),o(Kw,"baseSome");function lf(u,h,S){var z=0,te=u==null?z:u.length;if(typeof h=="number"&&h===h&&te<=V){for(;z<te;){var ce=z+te>>>1,ye=u[ce];ye!==null&&!Hn(ye)&&(S?ye<=h:ye<h)?z=ce+1:te=ce}return te}return qh(u,h,On,S)}i(lf,"baseSortedIndex"),o(lf,"baseSortedIndex");function qh(u,h,S,z){var te=0,ce=u==null?0:u.length;if(ce===0)return 0;h=S(h);for(var ye=h!==h,Ee=h===null,xe=Hn(h),Ue=h===r;te<ce;){var Fe=kh((te+ce)/2),$e=S(u[Fe]),Ye=$e!==r,gt=$e===null,Tt=$e===$e,$t=Hn($e);if(ye)var At=z||Tt;else Ue?At=Tt&&(z||Ye):Ee?At=Tt&&Ye&&(z||!gt):xe?At=Tt&&Ye&&!gt&&(z||!$t):gt||$t?At=!1:At=z?$e<=h:$e<h;At?te=Fe+1:ce=Fe}return vn(ce,B)}i(qh,"baseSortedIndexBy"),o(qh,"baseSortedIndexBy");function X1(u,h){for(var S=-1,z=u.length,te=0,ce=[];++S<z;){var ye=u[S],Ee=h?h(ye):ye;if(!S||!Fi(Ee,xe)){var xe=Ee;ce[te++]=ye===0?0:ye}}return ce}i(X1,"baseSortedUniq"),o(X1,"baseSortedUniq");function Q1(u){return typeof u=="number"?u:Hn(u)?C:+u}i(Q1,"baseToNumber"),o(Q1,"baseToNumber");function zn(u){if(typeof u=="string")return u;if(Bt(u))return Mr(u,zn)+"";if(Hn(u))return V3?V3.call(u):"";var h=u+"";return h=="0"&&1/u==-m?"-0":h}i(zn,"baseToString"),o(zn,"baseToString");function lo(u,h,S){var z=-1,te=Jl,ce=u.length,ye=!0,Ee=[],xe=Ee;if(S)ye=!1,te=fh;else if(ce>=a){var Ue=h?null:uO(u);if(Ue)return Xl(Ue);ye=!1,te=Qc,xe=new qo}else xe=h?[]:Ee;e:for(;++z<ce;){var Fe=u[z],$e=h?h(Fe):Fe;if(Fe=S||Fe!==0?Fe:0,ye&&$e===$e){for(var Ye=xe.length;Ye--;)if(xe[Ye]===$e)continue e;h&&xe.push($e),Ee.push(Fe)}else te(xe,$e,S)||(xe!==Ee&&xe.push($e),Ee.push(Fe))}return Ee}i(lo,"baseUniq"),o(lo,"baseUniq");function Vh(u,h){return h=fo(h,u),u=Cg(u,h),u==null||delete u[ea(ui(h))]}i(Vh,"baseUnset"),o(Vh,"baseUnset");function eg(u,h,S,z){return cu(u,h,S(Go(u,h)),z)}i(eg,"baseUpdate"),o(eg,"baseUpdate");function ff(u,h,S,z){for(var te=u.length,ce=z?te:-1;(z?ce--:++ce<te)&&h(u[ce],ce,u););return S?ci(u,z?0:ce,z?ce+1:te):ci(u,z?ce+1:0,z?te:ce)}i(ff,"baseWhile"),o(ff,"baseWhile");function tg(u,h){var S=u;return S instanceof Wt&&(S=S.value()),dh(h,function(z,te){return te.func.apply(te.thisArg,co([z],te.args))},S)}i(tg,"baseWrapperValue"),o(tg,"baseWrapperValue");function Kh(u,h,S){var z=u.length;if(z<2)return z?lo(u[0]):[];for(var te=-1,ce=ke(z);++te<z;)for(var ye=u[te],Ee=-1;++Ee<z;)Ee!=te&&(ce[te]=au(ce[te]||ye,u[Ee],h,S));return lo(Qr(ce,1),h,S)}i(Kh,"baseXor"),o(Kh,"baseXor");function rg(u,h,S){for(var z=-1,te=u.length,ce=h.length,ye={};++z<te;){var Ee=z<ce?h[z]:r;S(ye,u[z],Ee)}return ye}i(rg,"baseZipObject"),o(rg,"baseZipObject");function Gh(u){return Pr(u)?u:[]}i(Gh,"castArrayLikeObject"),o(Gh,"castArrayLikeObject");function Wh(u){return typeof u=="function"?u:On}i(Wh,"castFunction"),o(Wh,"castFunction");function fo(u,h){return Bt(u)?u:tp(u,h)?[u]:E5(dr(u))}i(fo,"castPath"),o(fo,"castPath");var cO=Ht;function ho(u,h,S){var z=u.length;return S=S===r?z:S,!h&&S>=z?u:ci(u,h,S)}i(ho,"castSlice"),o(ho,"castSlice");var Gw=GD||function(u){return Fr.clearTimeout(u)};function ng(u,h){if(h)return u.slice();var S=u.length,z=F3?F3(S):new u.constructor(S);return u.copy(z),z}i(ng,"cloneBuffer"),o(ng,"cloneBuffer");function Zh(u){var h=new u.constructor(u.byteLength);return new xh(h).set(new xh(u)),h}i(Zh,"cloneArrayBuffer"),o(Zh,"cloneArrayBuffer");function Ww(u,h){var S=h?Zh(u.buffer):u.buffer;return new u.constructor(S,u.byteOffset,u.byteLength)}i(Ww,"cloneDataView"),o(Ww,"cloneDataView");function Zw(u){var h=new u.constructor(u.source,yt.exec(u));return h.lastIndex=u.lastIndex,h}i(Zw,"cloneRegExp"),o(Zw,"cloneRegExp");function Jw(u){return nf?_r(nf.call(u)):{}}i(Jw,"cloneSymbol"),o(Jw,"cloneSymbol");function ig(u,h){var S=h?Zh(u.buffer):u.buffer;return new u.constructor(S,u.byteOffset,u.length)}i(ig,"cloneTypedArray"),o(ig,"cloneTypedArray");function ag(u,h){if(u!==h){var S=u!==r,z=u===null,te=u===u,ce=Hn(u),ye=h!==r,Ee=h===null,xe=h===h,Ue=Hn(h);if(!Ee&&!Ue&&!ce&&u>h||ce&&ye&&xe&&!Ee&&!Ue||z&&ye&&xe||!S&&xe||!te)return 1;if(!z&&!ce&&!Ue&&u<h||Ue&&S&&te&&!z&&!ce||Ee&&S&&te||!ye&&te||!xe)return-1}return 0}i(ag,"compareAscending"),o(ag,"compareAscending");function Yw(u,h,S){for(var z=-1,te=u.criteria,ce=h.criteria,ye=te.length,Ee=S.length;++z<ye;){var xe=ag(te[z],ce[z]);if(xe){if(z>=Ee)return xe;var Ue=S[z];return xe*(Ue=="desc"?-1:1)}}return u.index-h.index}i(Yw,"compareMultiple"),o(Yw,"compareMultiple");function og(u,h,S,z){for(var te=-1,ce=u.length,ye=S.length,Ee=-1,xe=h.length,Ue=Zr(ce-ye,0),Fe=ke(xe+Ue),$e=!z;++Ee<xe;)Fe[Ee]=h[Ee];for(;++te<ye;)($e||te<ce)&&(Fe[S[te]]=u[te]);for(;Ue--;)Fe[Ee++]=u[te++];return Fe}i(og,"composeArgs"),o(og,"composeArgs");function sg(u,h,S,z){for(var te=-1,ce=u.length,ye=-1,Ee=S.length,xe=-1,Ue=h.length,Fe=Zr(ce-Ee,0),$e=ke(Fe+Ue),Ye=!z;++te<Fe;)$e[te]=u[te];for(var gt=te;++xe<Ue;)$e[gt+xe]=h[xe];for(;++ye<Ee;)(Ye||te<ce)&&($e[gt+S[ye]]=u[te++]);return $e}i(sg,"composeArgsRight"),o(sg,"composeArgsRight");function In(u,h){var S=-1,z=u.length;for(h||(h=ke(z));++S<z;)h[S]=u[S];return h}i(In,"copyArray"),o(In,"copyArray");function Qi(u,h,S,z){var te=!S;S||(S={});for(var ce=-1,ye=h.length;++ce<ye;){var Ee=h[ce],xe=z?z(S[Ee],u[Ee],Ee,S,u):r;xe===r&&(xe=u[Ee]),te?ka(S,Ee,xe):iu(S,Ee,xe)}return S}i(Qi,"copyObject"),o(Qi,"copyObject");function Xw(u,h){return Qi(u,_g(u),h)}i(Xw,"copySymbols"),o(Xw,"copySymbols");function Qw(u,h){return Qi(u,s5(u),h)}i(Qw,"copySymbolsIn"),o(Qw,"copySymbolsIn");function df(u,h){return function(S,z){var te=Bt(S)?b3:bw,ce=h?h():{};return te(S,u,Et(z,2),ce)}}i(df,"createAggregator"),o(df,"createAggregator");function Ks(u){return Ht(function(h,S){var z=-1,te=S.length,ce=te>1?S[te-1]:r,ye=te>2?S[2]:r;for(ce=u.length>3&&typeof ce=="function"?(te--,ce):r,ye&&wn(S[0],S[1],ye)&&(ce=te<3?r:ce,te=1),h=_r(h);++z<te;){var Ee=S[z];Ee&&u(h,Ee,z,ce)}return h})}i(Ks,"createAssigner"),o(Ks,"createAssigner");function cg(u,h){return function(S,z){if(S==null)return S;if(!kn(S))return u(S,z);for(var te=S.length,ce=h?te:-1,ye=_r(S);(h?ce--:++ce<te)&&z(ye[ce],ce,ye)!==!1;);return S}}i(cg,"createBaseEach"),o(cg,"createBaseEach");function ug(u){return function(h,S,z){for(var te=-1,ce=_r(h),ye=z(h),Ee=ye.length;Ee--;){var xe=ye[u?Ee:++te];if(S(ce[xe],xe,ce)===!1)break}return h}}i(ug,"createBaseFor"),o(ug,"createBaseFor");function e5(u,h,S){var z=h&D,te=uu(u);function ce(){var ye=this&&this!==Fr&&this instanceof ce?te:u;return ye.apply(z?S:this,arguments)}return i(ce,"wrapper"),o(ce,"wrapper"),ce}i(e5,"createBind"),o(e5,"createBind");function lg(u){return function(h){h=dr(h);var S=Hs(h)?Bi(h):r,z=S?S[0]:h.charAt(0),te=S?ho(S,1).join(""):h.slice(1);return z[u]()+te}}i(lg,"createCaseFirst"),o(lg,"createCaseFirst");function Gs(u){return function(h){return dh(iv(rv(h).replace(Kl,"")),u,"")}}i(Gs,"createCompounder"),o(Gs,"createCompounder");function uu(u){return function(){var h=arguments;switch(h.length){case 0:return new u;case 1:return new u(h[0]);case 2:return new u(h[0],h[1]);case 3:return new u(h[0],h[1],h[2]);case 4:return new u(h[0],h[1],h[2],h[3]);case 5:return new u(h[0],h[1],h[2],h[3],h[4]);case 6:return new u(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new u(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var S=nu(u.prototype),z=u.apply(S,h);return kr(z)?z:S}}i(uu,"createCtor"),o(uu,"createCtor");function t5(u,h,S){var z=uu(u);function te(){for(var ce=arguments.length,ye=ke(ce),Ee=ce,xe=Ws(te);Ee--;)ye[Ee]=arguments[Ee];var Ue=ce<3&&ye[0]!==xe&&ye[ce-1]!==xe?[]:uo(ye,xe);if(ce-=Ue.length,ce<S)return mg(u,h,hf,te.placeholder,r,ye,Ue,r,r,S-ce);var Fe=this&&this!==Fr&&this instanceof te?z:u;return jn(Fe,this,ye)}return i(te,"wrapper"),o(te,"wrapper"),te}i(t5,"createCurry"),o(t5,"createCurry");function fg(u){return function(h,S,z){var te=_r(h);if(!kn(h)){var ce=Et(S,3);h=Jr(h),S=o(function(Ee){return ce(te[Ee],Ee,te)},"predicate")}var ye=u(h,S,z);return ye>-1?te[ce?h[ye]:ye]:r}}i(fg,"createFind"),o(fg,"createFind");function dg(u){return Oa(function(h){var S=h.length,z=S,te=oi.prototype.thru;for(u&&h.reverse();z--;){var ce=h[z];if(typeof ce!="function")throw new Li(c);if(te&&!ye&&vf(ce)=="wrapper")var ye=new oi([],!0)}for(z=ye?z:S;++z<S;){ce=h[z];var Ee=vf(ce),xe=Ee=="wrapper"?wg(ce):r;xe&&rp(xe[0])&&xe[1]==(k|j|Q|K)&&!xe[4].length&&xe[9]==1?ye=ye[vf(xe[0])].apply(ye,xe[3]):ye=ce.length==1&&rp(ce)?ye[Ee]():ye.thru(ce)}return function(){var Ue=arguments,Fe=Ue[0];if(ye&&Ue.length==1&&Bt(Fe))return ye.plant(Fe).value();for(var $e=0,Ye=S?h[$e].apply(this,Ue):Fe;++$e<S;)Ye=h[$e].call(this,Ye);return Ye}})}i(dg,"createFlow"),o(dg,"createFlow");function hf(u,h,S,z,te,ce,ye,Ee,xe,Ue){var Fe=h&k,$e=h&D,Ye=h&P,gt=h&(j|q),Tt=h&he,$t=Ye?r:uu(u);function At(){for(var Kt=arguments.length,Zt=ke(Kt),qn=Kt;qn--;)Zt[qn]=arguments[qn];if(gt)var _n=Ws(At),Vn=C3(Zt,_n);if(z&&(Zt=og(Zt,z,te,gt)),ce&&(Zt=sg(Zt,ce,ye,gt)),Kt-=Vn,gt&&Kt<Ue){var jr=uo(Zt,_n);return mg(u,h,hf,At.placeholder,S,Zt,jr,Ee,xe,Ue-Kt)}var ta=$e?S:this,po=Ye?ta[u]:u;return Kt=Zt.length,Ee?Zt=w5(Zt,Ee):Tt&&Kt>1&&Zt.reverse(),Fe&&xe<Kt&&(Zt.length=xe),this&&this!==Fr&&this instanceof At&&(po=$t||uu(po)),po.apply(ta,Zt)}return i(At,"wrapper"),o(At,"wrapper"),At}i(hf,"createHybrid"),o(hf,"createHybrid");function hg(u,h){return function(S,z){return Iw(S,u,h(z),{})}}i(hg,"createInverter"),o(hg,"createInverter");function pf(u,h){return function(S,z){var te;if(S===r&&z===r)return h;if(S!==r&&(te=S),z!==r){if(te===r)return z;typeof S=="string"||typeof z=="string"?(S=zn(S),z=zn(z)):(S=Q1(S),z=Q1(z)),te=u(S,z)}return te}}i(pf,"createMathOperation"),o(pf,"createMathOperation");function Jh(u){return Oa(function(h){return h=Mr(h,$n(Et())),Ht(function(S){var z=this;return u(h,function(te){return jn(te,z,S)})})})}i(Jh,"createOver"),o(Jh,"createOver");function mf(u,h){h=h===r?" ":zn(h);var S=h.length;if(S<2)return S?Hh(h,u):h;var z=Hh(h,Ih(u/qs(h)));return Hs(h)?ho(Bi(z),0,u).join(""):z.slice(0,u)}i(mf,"createPadding"),o(mf,"createPadding");function r5(u,h,S,z){var te=h&D,ce=uu(u);function ye(){for(var Ee=-1,xe=arguments.length,Ue=-1,Fe=z.length,$e=ke(Fe+xe),Ye=this&&this!==Fr&&this instanceof ye?ce:u;++Ue<Fe;)$e[Ue]=z[Ue];for(;xe--;)$e[Ue++]=arguments[++Ee];return jn(Ye,te?S:this,$e)}return i(ye,"wrapper"),o(ye,"wrapper"),ye}i(r5,"createPartial"),o(r5,"createPartial");function pg(u){return function(h,S,z){return z&&typeof z!="number"&&wn(h,S,z)&&(S=z=r),h=Pa(h),S===r?(S=h,h=0):S=Pa(S),z=z===r?h<S?1:-1:Pa(z),$w(h,S,z,u)}}i(pg,"createRange"),o(pg,"createRange");function gf(u){return function(h,S){return typeof h=="string"&&typeof S=="string"||(h=li(h),S=li(S)),u(h,S)}}i(gf,"createRelationalOperation"),o(gf,"createRelationalOperation");function mg(u,h,S,z,te,ce,ye,Ee,xe,Ue){var Fe=h&j,$e=Fe?ye:r,Ye=Fe?r:ye,gt=Fe?ce:r,Tt=Fe?r:ce;h|=Fe?Q:Y,h&=~(Fe?Y:Q),h&Z||(h&=~(D|P));var $t=[u,h,te,gt,$e,Tt,Ye,Ee,xe,Ue],At=S.apply(r,$t);return rp(u)&&_5(At,$t),At.placeholder=z,Ig(At,u,h)}i(mg,"createRecurry"),o(mg,"createRecurry");function Yh(u){var h=Wr[u];return function(S,z){if(S=li(S),z=z==null?0:vn(Ft(z),292),z&&H3(S)){var te=(dr(S)+"e").split("e"),ce=h(te[0]+"e"+(+te[1]+z));return te=(dr(ce)+"e").split("e"),+(te[0]+"e"+(+te[1]-z))}return h(S)}}i(Yh,"createRound"),o(Yh,"createRound");var uO=tu&&1/Xl(new tu([,-0]))[1]==m?function(u){return new tu(u)}:pp;function gg(u){return function(h){var S=bn(h);return S==be?bh(h):S==ee?O3(h):T3(h,u(h))}}i(gg,"createToPairs"),o(gg,"createToPairs");function Da(u,h,S,z,te,ce,ye,Ee){var xe=h&P;if(!xe&&typeof u!="function")throw new Li(c);var Ue=z?z.length:0;if(Ue||(h&=~(Q|Y),z=te=r),ye=ye===r?ye:Zr(Ft(ye),0),Ee=Ee===r?Ee:Ft(Ee),Ue-=te?te.length:0,h&Y){var Fe=z,$e=te;z=te=r}var Ye=xe?r:wg(u),gt=[u,h,S,z,te,Fe,$e,ce,ye,Ee];if(Ye&&v5(gt,Ye),u=gt[0],h=gt[1],S=gt[2],z=gt[3],te=gt[4],Ee=gt[9]=gt[9]===r?xe?0:u.length:Zr(gt[9]-Ue,0),!Ee&&h&(j|q)&&(h&=~(j|q)),!h||h==D)var Tt=e5(u,h,S);else h==j||h==q?Tt=t5(u,h,Ee):(h==Q||h==(D|Q))&&!te.length?Tt=r5(u,h,S,z):Tt=hf.apply(r,gt);var $t=Ye?qw:_5;return Ig($t(Tt,gt),u,h)}i(Da,"createWrap"),o(Da,"createWrap");function vg(u,h,S,z){return u===r||Fi(u,eu[S])&&!yr.call(z,S)?h:u}i(vg,"customDefaultsAssignIn"),o(vg,"customDefaultsAssignIn");function yg(u,h,S,z,te,ce){return kr(u)&&kr(h)&&(ce.set(h,u),uf(u,h,r,yg,ce),ce.delete(h)),u}i(yg,"customDefaultsMerge"),o(yg,"customDefaultsMerge");function n5(u){return fu(u)?r:u}i(n5,"customOmitClone"),o(n5,"customOmitClone");function bg(u,h,S,z,te,ce){var ye=S&x,Ee=u.length,xe=h.length;if(Ee!=xe&&!(ye&&xe>Ee))return!1;var Ue=ce.get(u),Fe=ce.get(h);if(Ue&&Fe)return Ue==h&&Fe==u;var $e=-1,Ye=!0,gt=S&R?new qo:r;for(ce.set(u,h),ce.set(h,u);++$e<Ee;){var Tt=u[$e],$t=h[$e];if(z)var At=ye?z($t,Tt,$e,h,u,ce):z(Tt,$t,$e,u,h,ce);if(At!==r){if(At)continue;Ye=!1;break}if(gt){if(!hh(h,function(Kt,Zt){if(!Qc(gt,Zt)&&(Tt===Kt||te(Tt,Kt,S,z,ce)))return gt.push(Zt)})){Ye=!1;break}}else if(!(Tt===$t||te(Tt,$t,S,z,ce))){Ye=!1;break}}return ce.delete(u),ce.delete(h),Ye}i(bg,"equalArrays"),o(bg,"equalArrays");function i5(u,h,S,z,te,ce,ye){switch(S){case ve:if(u.byteLength!=h.byteLength||u.byteOffset!=h.byteOffset)return!1;u=u.buffer,h=h.buffer;case Ke:return!(u.byteLength!=h.byteLength||!ce(new xh(u),new xh(h)));case ne:case oe:case Oe:return Fi(+u,+h);case G:return u.name==h.name&&u.message==h.message;case ie:case ue:return u==h+"";case be:var Ee=bh;case ee:var xe=z&x;if(Ee||(Ee=Xl),u.size!=h.size&&!xe)return!1;var Ue=ye.get(u);if(Ue)return Ue==h;z|=R,ye.set(u,h);var Fe=bg(Ee(u),Ee(h),z,te,ce,ye);return ye.delete(u),Fe;case Ae:if(nf)return nf.call(u)==nf.call(h)}return!1}i(i5,"equalByTag"),o(i5,"equalByTag");function a5(u,h,S,z,te,ce){var ye=S&x,Ee=Xh(u),xe=Ee.length,Ue=Xh(h),Fe=Ue.length;if(xe!=Fe&&!ye)return!1;for(var $e=xe;$e--;){var Ye=Ee[$e];if(!(ye?Ye in h:yr.call(h,Ye)))return!1}var gt=ce.get(u),Tt=ce.get(h);if(gt&&Tt)return gt==h&&Tt==u;var $t=!0;ce.set(u,h),ce.set(h,u);for(var At=ye;++$e<xe;){Ye=Ee[$e];var Kt=u[Ye],Zt=h[Ye];if(z)var qn=ye?z(Zt,Kt,Ye,h,u,ce):z(Kt,Zt,Ye,u,h,ce);if(!(qn===r?Kt===Zt||te(Kt,Zt,S,z,ce):qn)){$t=!1;break}At||(At=Ye=="constructor")}if($t&&!At){var _n=u.constructor,Vn=h.constructor;_n!=Vn&&"constructor"in u&&"constructor"in h&&!(typeof _n=="function"&&_n instanceof _n&&typeof Vn=="function"&&Vn instanceof Vn)&&($t=!1)}return ce.delete(u),ce.delete(h),$t}i(a5,"equalObjects"),o(a5,"equalObjects");function Oa(u){return Mg(Tg(u,r,Ng),u+"")}i(Oa,"flatRest"),o(Oa,"flatRest");function Xh(u){return $1(u,Jr,_g)}i(Xh,"getAllKeys"),o(Xh,"getAllKeys");function Qh(u){return $1(u,Dn,s5)}i(Qh,"getAllKeysIn"),o(Qh,"getAllKeysIn");var wg=Dh?function(u){return Dh.get(u)}:pp;function vf(u){for(var h=u.name+"",S=ru[h],z=yr.call(ru,h)?S.length:0;z--;){var te=S[z],ce=te.func;if(ce==null||ce==u)return te.name}return h}i(vf,"getFuncName"),o(vf,"getFuncName");function Ws(u){var h=yr.call(se,"placeholder")?se:u;return h.placeholder}i(Ws,"getHolder"),o(Ws,"getHolder");function Et(){var u=se.iteratee||dp;return u=u===dp?q1:u,arguments.length?u(arguments[0],arguments[1]):u}i(Et,"getIteratee"),o(Et,"getIteratee");function yf(u,h){var S=u.__data__;return p5(h)?S[typeof h=="string"?"string":"hash"]:S.map}i(yf,"getMapData"),o(yf,"getMapData");function ep(u){for(var h=Jr(u),S=h.length;S--;){var z=h[S],te=u[z];h[S]=[z,te,Sg(te)]}return h}i(ep,"getMatchData"),o(ep,"getMatchData");function Wo(u,h){var S=I3(u,h);return H1(S)?S:r}i(Wo,"getNative"),o(Wo,"getNative");function o5(u){var h=yr.call(u,Vs),S=u[Vs];try{u[Vs]=r;var z=!0}catch{}var te=Ah.call(u);return z&&(h?u[Vs]=S:delete u[Vs]),te}i(o5,"getRawTag"),o(o5,"getRawTag");var _g=D1?function(u){return u==null?[]:(u=_r(u),so(D1(u),function(h){return $3.call(u,h)}))}:mp,s5=D1?function(u){for(var h=[];u;)co(h,_g(u)),u=Th(u);return h}:mp,bn=yn;(O1&&bn(new O1(new ArrayBuffer(1)))!=ve||ef&&bn(new ef)!=be||R1&&bn(R1.resolve())!=F||tu&&bn(new tu)!=ee||tf&&bn(new tf)!=Ie)&&(bn=o(function(u){var h=yn(u),S=h==N?u.constructor:r,z=S?Zo(S):"";if(z)switch(z){case rO:return ve;case nO:return be;case iO:return F;case aO:return ee;case oO:return Ie}return h},"getTag"));function c5(u,h,S){for(var z=-1,te=S.length;++z<te;){var ce=S[z],ye=ce.size;switch(ce.type){case"drop":u+=ye;break;case"dropRight":h-=ye;break;case"take":h=vn(h,u+ye);break;case"takeRight":u=Zr(u,h-ye);break}}return{start:u,end:h}}i(c5,"getView"),o(c5,"getView");function u5(u){var h=u.match(Je);return h?h[1].split(cr):[]}i(u5,"getWrapDetails"),o(u5,"getWrapDetails");function Eg(u,h,S){h=fo(h,u);for(var z=-1,te=h.length,ce=!1;++z<te;){var ye=ea(h[z]);if(!(ce=u!=null&&S(u,ye)))break;u=u[ye]}return ce||++z!=te?ce:(te=u==null?0:u.length,!!te&&xf(te)&&Ra(ye,te)&&(Bt(u)||Zs(u)))}i(Eg,"hasPath"),o(Eg,"hasPath");function l5(u){var h=u.length,S=new u.constructor(h);return h&&typeof u[0]=="string"&&yr.call(u,"index")&&(S.index=u.index,S.input=u.input),S}i(l5,"initCloneArray"),o(l5,"initCloneArray");function Ag(u){return typeof u.constructor=="function"&&!lu(u)?nu(Th(u)):{}}i(Ag,"initCloneObject"),o(Ag,"initCloneObject");function f5(u,h,S){var z=u.constructor;switch(h){case Ke:return Zh(u);case ne:case oe:return new z(+u);case ve:return Ww(u,S);case pe:case re:case le:case _e:case Te:case Ce:case Re:case Dt:case Ge:return ig(u,S);case be:return new z;case Oe:case ue:return new z(u);case ie:return Zw(u);case ee:return new z;case Ae:return Jw(u)}}i(f5,"initCloneByTag"),o(f5,"initCloneByTag");function d5(u,h){var S=h.length;if(!S)return u;var z=S-1;return h[z]=(S>1?"& ":"")+h[z],h=h.join(S>2?", ":" "),u.replace(ct,`{
|
|
25
25
|
/* [wrapped with `+h+`] */
|
|
26
|
-
`)}i(d5,"insertWrapDetails"),o(d5,"insertWrapDetails");function h5(u){return Bt(u)||Zs(u)||!!(z3&&u&&u[z3])}i(h5,"isFlattenable"),o(h5,"isFlattenable");function Ra(u,h){var S=typeof u;return h=h??E,!!h&&(S=="number"||S!="symbol"&&an.test(u))&&u>-1&&u%1==0&&u<h}i(Ra,"isIndex"),o(Ra,"isIndex");function wn(u,h,S){if(!kr(S))return!1;var $=typeof h;return($=="number"?kn(S)&&Ra(h,S.length):$=="string"&&h in S)?Fi(S[h],u):!1}i(wn,"isIterateeCall"),o(wn,"isIterateeCall");function tp(u,h){if(Bt(u))return!1;var S=typeof u;return S=="number"||S=="symbol"||S=="boolean"||u==null||Hn(u)?!0:ot.test(u)||!or.test(u)||h!=null&&u in _r(h)}i(tp,"isKey"),o(tp,"isKey");function p5(u){var h=typeof u;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?u!=="__proto__":u===null}i(p5,"isKeyable"),o(p5,"isKeyable");function rp(u){var h=vf(u),S=se[h];if(typeof S!="function"||!(h in Wt.prototype))return!1;if(u===S)return!0;var $=wg(S);return!!$&&u===$[0]}i(rp,"isLaziable"),o(rp,"isLaziable");function m5(u){return!!U3&&U3 in u}i(m5,"isMasked"),o(m5,"isMasked");var lO=_h?Na:gp;function lu(u){var h=u&&u.constructor,S=typeof h=="function"&&h.prototype||eu;return u===S}i(lu,"isPrototype"),o(lu,"isPrototype");function Sg(u){return u===u&&!kr(u)}i(Sg,"isStrictComparable"),o(Sg,"isStrictComparable");function xg(u,h){return function(S){return S==null?!1:S[u]===h&&(h!==r||u in _r(S))}}i(xg,"matchesStrictComparable"),o(xg,"matchesStrictComparable");function g5(u){var h=Af(u,function($){return S.size===p&&S.clear(),$}),S=h.cache;return h}i(g5,"memoizeCapped"),o(g5,"memoizeCapped");function v5(u,h){var S=u[1],$=h[1],te=S|$,ce=te<(D|P|k),ye=$==k&&S==j||$==k&&S==K&&u[7].length<=h[8]||$==(k|K)&&h[7].length<=h[8]&&S==j;if(!(ce||ye))return u;$&D&&(u[2]=h[2],te|=S&D?0:Z);var Ee=h[3];if(Ee){var xe=u[3];u[3]=xe?og(xe,Ee,h[4]):Ee,u[4]=xe?uo(u[3],g):h[4]}return Ee=h[5],Ee&&(xe=u[5],u[5]=xe?sg(xe,Ee,h[6]):Ee,u[6]=xe?uo(u[5],g):h[6]),Ee=h[7],Ee&&(u[7]=Ee),$&k&&(u[8]=u[8]==null?h[8]:vn(u[8],h[8])),u[9]==null&&(u[9]=h[9]),u[0]=h[0],u[1]=te,u}i(v5,"mergeData"),o(v5,"mergeData");function y5(u){var h=[];if(u!=null)for(var S in _r(u))h.push(S);return h}i(y5,"nativeKeysIn"),o(y5,"nativeKeysIn");function b5(u){return Ah.call(u)}i(b5,"objectToString"),o(b5,"objectToString");function Tg(u,h,S){return h=Zr(h===r?u.length-1:h,0),function(){for(var $=arguments,te=-1,ce=Zr($.length-h,0),ye=ke(ce);++te<ce;)ye[te]=$[h+te];te=-1;for(var Ee=ke(h+1);++te<h;)Ee[te]=$[te];return Ee[h]=S(ye),jn(u,this,Ee)}}i(Tg,"overRest"),o(Tg,"overRest");function Cg(u,h){return h.length<2?u:Go(u,ci(h,0,-1))}i(Cg,"parent"),o(Cg,"parent");function w5(u,h){for(var S=u.length,$=vn(h.length,S),te=In(u);$--;){var ce=h[$];u[$]=Ra(ce,S)?te[ce]:r}return u}i(w5,"reorder"),o(w5,"reorder");function np(u,h){if(!(h==="constructor"&&typeof u[h]=="function")&&h!="__proto__")return u[h]}i(np,"safeGet"),o(np,"safeGet");var _5=kg(qw),bf=ZD||function(u,h){return Fr.setTimeout(u,h)},Mg=kg(sO);function Ig(u,h,S){var $=h+"";return Mg(u,d5($,A5(u5($),S)))}i(Ig,"setWrapToString"),o(Ig,"setWrapToString");function kg(u){var h=0,S=0;return function(){var $=QD(),te=w-($-S);if(S=$,te>0){if(++h>=J)return arguments[0]}else h=0;return u.apply(r,arguments)}}i(kg,"shortOut"),o(kg,"shortOut");function wf(u,h){var S=-1,$=u.length,te=$-1;for(h=h===r?$:h;++S<h;){var ce=zh(S,te),ye=u[ce];u[ce]=u[S],u[S]=ye}return u.length=h,u}i(wf,"shuffleSelf"),o(wf,"shuffleSelf");var E5=g5(function(u){var h=[];return u.charCodeAt(0)===46&&h.push(""),u.replace(Xe,function(S,$,te,ce){h.push(te?ce.replace(Tn,"$1"):$||S)}),h});function ea(u){if(typeof u=="string"||Hn(u))return u;var h=u+"";return h=="0"&&1/u==-m?"-0":h}i(ea,"toKey"),o(ea,"toKey");function Zo(u){if(u!=null){try{return Eh.call(u)}catch{}try{return u+""}catch{}}return""}i(Zo,"toSource"),o(Zo,"toSource");function A5(u,h){return ai(I,function(S){var $="_."+S[0];h&S[1]&&!Jl(u,$)&&u.push($)}),u.sort()}i(A5,"updateWrapDetails"),o(A5,"updateWrapDetails");function Dg(u){if(u instanceof Wt)return u.clone();var h=new oi(u.__wrapped__,u.__chain__);return h.__actions__=In(u.__actions__),h.__index__=u.__index__,h.__values__=u.__values__,h}i(Dg,"wrapperClone"),o(Dg,"wrapperClone");function S5(u,h,S){(S?wn(u,h,S):h===r)?h=1:h=Zr(Ft(h),0);var $=u==null?0:u.length;if(!$||h<1)return[];for(var te=0,ce=0,ye=ke(Ih($/h));te<$;)ye[ce++]=ci(u,te,te+=h);return ye}i(S5,"chunk"),o(S5,"chunk");function x5(u){for(var h=-1,S=u==null?0:u.length,$=0,te=[];++h<S;){var ce=u[h];ce&&(te[$++]=ce)}return te}i(x5,"compact"),o(x5,"compact");function T5(){var u=arguments.length;if(!u)return[];for(var h=ke(u-1),S=arguments[0],$=u;$--;)h[$-1]=arguments[$];return co(Bt(S)?In(S):[S],Qr(h,1))}i(T5,"concat4"),o(T5,"concat");var fO=Ht(function(u,h){return Pr(u)?au(u,Qr(h,1,Pr,!0)):[]}),dO=Ht(function(u,h){var S=ui(h);return Pr(S)&&(S=r),Pr(u)?au(u,Qr(h,1,Pr,!0),Et(S,2)):[]}),hO=Ht(function(u,h){var S=ui(h);return Pr(S)&&(S=r),Pr(u)?au(u,Qr(h,1,Pr,!0),r,S):[]});function C5(u,h,S){var $=u==null?0:u.length;return $?(h=S||h===r?1:Ft(h),ci(u,h<0?0:h,$)):[]}i(C5,"drop"),o(C5,"drop");function M5(u,h,S){var $=u==null?0:u.length;return $?(h=S||h===r?1:Ft(h),h=$-h,ci(u,0,h<0?0:h)):[]}i(M5,"dropRight"),o(M5,"dropRight");function I5(u,h){return u&&u.length?ff(u,Et(h,3),!0,!0):[]}i(I5,"dropRightWhile"),o(I5,"dropRightWhile");function k5(u,h){return u&&u.length?ff(u,Et(h,3),!0):[]}i(k5,"dropWhile"),o(k5,"dropWhile");function D5(u,h,S,$){var te=u==null?0:u.length;return te?(S&&typeof S!="number"&&wn(u,h,S)&&(S=0,$=te),Sw(u,h,S,$)):[]}i(D5,"fill"),o(D5,"fill");function Og(u,h,S){var $=u==null?0:u.length;if(!$)return-1;var te=S==null?0:Ft(S);return te<0&&(te=Zr($+te,0)),Yl(u,Et(h,3),te)}i(Og,"findIndex"),o(Og,"findIndex");function Rg(u,h,S){var $=u==null?0:u.length;if(!$)return-1;var te=$-1;return S!==r&&(te=Ft(S),te=S<0?Zr($+te,0):vn(te,$-1)),Yl(u,Et(h,3),te,!0)}i(Rg,"findLastIndex"),o(Rg,"findLastIndex");function Ng(u){var h=u==null?0:u.length;return h?Qr(u,1):[]}i(Ng,"flatten"),o(Ng,"flatten");function O5(u){var h=u==null?0:u.length;return h?Qr(u,m):[]}i(O5,"flattenDeep"),o(O5,"flattenDeep");function R5(u,h){var S=u==null?0:u.length;return S?(h=h===r?1:Ft(h),Qr(u,h)):[]}i(R5,"flattenDepth"),o(R5,"flattenDepth");function N5(u){for(var h=-1,S=u==null?0:u.length,$={};++h<S;){var te=u[h];$[te[0]]=te[1]}return $}i(N5,"fromPairs"),o(N5,"fromPairs");function Pg(u){return u&&u.length?u[0]:r}i(Pg,"head"),o(Pg,"head");function P5(u,h,S){var $=u==null?0:u.length;if(!$)return-1;var te=S==null?0:Ft(S);return te<0&&(te=Zr($+te,0)),zs(u,h,te)}i(P5,"indexOf"),o(P5,"indexOf");function B5(u){var h=u==null?0:u.length;return h?ci(u,0,-1):[]}i(B5,"initial"),o(B5,"initial");var pO=Ht(function(u){var h=Mr(u,Gh);return h.length&&h[0]===u[0]?Lh(h):[]}),mO=Ht(function(u){var h=ui(u),S=Mr(u,Gh);return h===ui(S)?h=r:S.pop(),S.length&&S[0]===u[0]?Lh(S,Et(h,2)):[]}),gO=Ht(function(u){var h=ui(u),S=Mr(u,Gh);return h=typeof h=="function"?h:r,h&&S.pop(),S.length&&S[0]===u[0]?Lh(S,r,h):[]});function L5(u,h){return u==null?"":YD.call(u,h)}i(L5,"join"),o(L5,"join");function ui(u){var h=u==null?0:u.length;return h?u[h-1]:r}i(ui,"last2"),o(ui,"last");function U5(u,h,S){var $=u==null?0:u.length;if(!$)return-1;var te=$;return S!==r&&(te=Ft(S),te=te<0?Zr($+te,0):vn(te,$-1)),h===h?N3(u,h,te):Yl(u,E1,te,!0)}i(U5,"lastIndexOf"),o(U5,"lastIndexOf");function F5(u,h){return u&&u.length?W1(u,Ft(h)):r}i(F5,"nth"),o(F5,"nth");var vO=Ht(Bg);function Bg(u,h){return u&&u.length&&h&&h.length?$h(u,h):u}i(Bg,"pullAll"),o(Bg,"pullAll");function j5(u,h,S){return u&&u.length&&h&&h.length?$h(u,h,Et(S,2)):u}i(j5,"pullAllBy"),o(j5,"pullAllBy");function $5(u,h,S){return u&&u.length&&h&&h.length?$h(u,h,r,S):u}i($5,"pullAllWith"),o($5,"pullAllWith");var yO=Oa(function(u,h){var S=u==null?0:u.length,$=Nh(u,h);return Y1(u,Mr(h,function(te){return Ra(te,S)?+te:te}).sort(ag)),$});function z5(u,h){var S=[];if(!(u&&u.length))return S;var $=-1,te=[],ce=u.length;for(h=Et(h,3);++$<ce;){var ye=u[$];h(ye,$,u)&&(S.push(ye),te.push($))}return Y1(u,te),S}i(z5,"remove"),o(z5,"remove");function ip(u){return u==null?u:tO.call(u)}i(ip,"reverse"),o(ip,"reverse");function H5(u,h,S){var $=u==null?0:u.length;return $?(S&&typeof S!="number"&&wn(u,h,S)?(h=0,S=$):(h=h==null?0:Ft(h),S=S===r?$:Ft(S)),ci(u,h,S)):[]}i(H5,"slice2"),o(H5,"slice");function q5(u,h){return lf(u,h)}i(q5,"sortedIndex"),o(q5,"sortedIndex");function V5(u,h,S){return qh(u,h,Et(S,2))}i(V5,"sortedIndexBy"),o(V5,"sortedIndexBy");function K5(u,h){var S=u==null?0:u.length;if(S){var $=lf(u,h);if($<S&&Fi(u[$],h))return $}return-1}i(K5,"sortedIndexOf"),o(K5,"sortedIndexOf");function G5(u,h){return lf(u,h,!0)}i(G5,"sortedLastIndex"),o(G5,"sortedLastIndex");function W5(u,h,S){return qh(u,h,Et(S,2),!0)}i(W5,"sortedLastIndexBy"),o(W5,"sortedLastIndexBy");function Z5(u,h){var S=u==null?0:u.length;if(S){var $=lf(u,h,!0)-1;if(Fi(u[$],h))return $}return-1}i(Z5,"sortedLastIndexOf"),o(Z5,"sortedLastIndexOf");function J5(u){return u&&u.length?X1(u):[]}i(J5,"sortedUniq"),o(J5,"sortedUniq");function Y5(u,h){return u&&u.length?X1(u,Et(h,2)):[]}i(Y5,"sortedUniqBy"),o(Y5,"sortedUniqBy");function X5(u){var h=u==null?0:u.length;return h?ci(u,1,h):[]}i(X5,"tail"),o(X5,"tail");function Q5(u,h,S){return u&&u.length?(h=S||h===r?1:Ft(h),ci(u,0,h<0?0:h)):[]}i(Q5,"take2"),o(Q5,"take");function e4(u,h,S){var $=u==null?0:u.length;return $?(h=S||h===r?1:Ft(h),h=$-h,ci(u,h<0?0:h,$)):[]}i(e4,"takeRight"),o(e4,"takeRight");function t4(u,h){return u&&u.length?ff(u,Et(h,3),!1,!0):[]}i(t4,"takeRightWhile"),o(t4,"takeRightWhile");function r4(u,h){return u&&u.length?ff(u,Et(h,3)):[]}i(r4,"takeWhile"),o(r4,"takeWhile");var bO=Ht(function(u){return lo(Qr(u,1,Pr,!0))}),wO=Ht(function(u){var h=ui(u);return Pr(h)&&(h=r),lo(Qr(u,1,Pr,!0),Et(h,2))}),_O=Ht(function(u){var h=ui(u);return h=typeof h=="function"?h:r,lo(Qr(u,1,Pr,!0),r,h)});function n4(u){return u&&u.length?lo(u):[]}i(n4,"uniq"),o(n4,"uniq");function i4(u,h){return u&&u.length?lo(u,Et(h,2)):[]}i(i4,"uniqBy"),o(i4,"uniqBy");function a4(u,h){return h=typeof h=="function"?h:r,u&&u.length?lo(u,r,h):[]}i(a4,"uniqWith"),o(a4,"uniqWith");function ap(u){if(!(u&&u.length))return[];var h=0;return u=so(u,function(S){if(Pr(S))return h=Zr(S.length,h),!0}),vh(h,function(S){return Mr(u,ph(S))})}i(ap,"unzip"),o(ap,"unzip");function Lg(u,h){if(!(u&&u.length))return[];var S=ap(u);return h==null?S:Mr(S,function($){return jn(h,r,$)})}i(Lg,"unzipWith"),o(Lg,"unzipWith");var EO=Ht(function(u,h){return Pr(u)?au(u,h):[]}),AO=Ht(function(u){return Kh(so(u,Pr))}),SO=Ht(function(u){var h=ui(u);return Pr(h)&&(h=r),Kh(so(u,Pr),Et(h,2))}),xO=Ht(function(u){var h=ui(u);return h=typeof h=="function"?h:r,Kh(so(u,Pr),r,h)}),TO=Ht(ap);function o4(u,h){return rg(u||[],h||[],iu)}i(o4,"zipObject"),o(o4,"zipObject");function s4(u,h){return rg(u||[],h||[],cu)}i(s4,"zipObjectDeep"),o(s4,"zipObjectDeep");var CO=Ht(function(u){var h=u.length,S=h>1?u[h-1]:r;return S=typeof S=="function"?(u.pop(),S):r,Lg(u,S)});function Ug(u){var h=se(u);return h.__chain__=!0,h}i(Ug,"chain"),o(Ug,"chain");function c4(u,h){return h(u),u}i(c4,"tap"),o(c4,"tap");function _f(u,h){return h(u)}i(_f,"thru"),o(_f,"thru");var MO=Oa(function(u){var h=u.length,S=h?u[0]:0,$=this.__wrapped__,te=o(function(ce){return Nh(ce,u)},"interceptor");return h>1||this.__actions__.length||!($ instanceof Wt)||!Ra(S)?this.thru(te):($=$.slice(S,+S+(h?1:0)),$.__actions__.push({func:_f,args:[te],thisArg:r}),new oi($,this.__chain__).thru(function(ce){return h&&!ce.length&&ce.push(r),ce}))});function u4(){return Ug(this)}i(u4,"wrapperChain"),o(u4,"wrapperChain");function l4(){return new oi(this.value(),this.__chain__)}i(l4,"wrapperCommit"),o(l4,"wrapperCommit");function f4(){this.__values__===r&&(this.__values__=Yg(this.value()));var u=this.__index__>=this.__values__.length,h=u?r:this.__values__[this.__index__++];return{done:u,value:h}}i(f4,"wrapperNext"),o(f4,"wrapperNext");function d4(){return this}i(d4,"wrapperToIterator"),o(d4,"wrapperToIterator");function h4(u){for(var h,S=this;S instanceof af;){var $=Dg(S);$.__index__=0,$.__values__=r,h?te.__wrapped__=$:h=$;var te=$;S=S.__wrapped__}return te.__wrapped__=u,h}i(h4,"wrapperPlant"),o(h4,"wrapperPlant");function p4(){var u=this.__wrapped__;if(u instanceof Wt){var h=u;return this.__actions__.length&&(h=new Wt(this)),h=h.reverse(),h.__actions__.push({func:_f,args:[ip],thisArg:r}),new oi(h,this.__chain__)}return this.thru(ip)}i(p4,"wrapperReverse"),o(p4,"wrapperReverse");function m4(){return tg(this.__wrapped__,this.__actions__)}i(m4,"wrapperValue"),o(m4,"wrapperValue");var IO=df(function(u,h,S){yr.call(u,S)?++u[S]:ka(u,S,1)});function g4(u,h,S){var $=Bt(u)?w1:Aw;return S&&wn(u,h,S)&&(h=r),$(u,Et(h,3))}i(g4,"every"),o(g4,"every");function v4(u,h){var S=Bt(u)?so:F1;return S(u,Et(h,3))}i(v4,"filter2"),o(v4,"filter");var kO=fg(Og),DO=fg(Rg);function y4(u,h){return Qr(Ef(u,h),1)}i(y4,"flatMap"),o(y4,"flatMap");function b4(u,h){return Qr(Ef(u,h),m)}i(b4,"flatMapDeep"),o(b4,"flatMapDeep");function w4(u,h,S){return S=S===r?1:Ft(S),Qr(Ef(u,h),S)}i(w4,"flatMapDepth"),o(w4,"flatMapDepth");function Fg(u,h){var S=Bt(u)?ai:Ko;return S(u,Et(h,3))}i(Fg,"forEach"),o(Fg,"forEach");function jg(u,h){var S=Bt(u)?w3:Ew;return S(u,Et(h,3))}i(jg,"forEachRight"),o(jg,"forEachRight");var OO=df(function(u,h,S){yr.call(u,S)?u[S].push(h):ka(u,S,[h])});function _4(u,h,S,$){u=kn(u)?u:Js(u),S=S&&!$?Ft(S):0;var te=u.length;return S<0&&(S=Zr(te+S,0)),Tf(u)?S<=te&&u.indexOf(h,S)>-1:!!te&&zs(u,h,S)>-1}i(_4,"includes"),o(_4,"includes");var RO=Ht(function(u,h,S){var $=-1,te=typeof h=="function",ce=kn(u)?ke(u.length):[];return Ko(u,function(ye){ce[++$]=te?jn(h,ye,S):ou(ye,h,S)}),ce}),NO=df(function(u,h,S){ka(u,S,h)});function Ef(u,h){var S=Bt(u)?Mr:V1;return S(u,Et(h,3))}i(Ef,"map2"),o(Ef,"map");function E4(u,h,S,$){return u==null?[]:(Bt(h)||(h=h==null?[]:[h]),S=$?r:S,Bt(S)||(S=S==null?[]:[S]),Z1(u,h,S))}i(E4,"orderBy"),o(E4,"orderBy");var PO=df(function(u,h,S){u[S?0:1].push(h)},function(){return[[],[]]});function A4(u,h,S){var $=Bt(u)?dh:S1,te=arguments.length<3;return $(u,Et(h,4),S,te,Ko)}i(A4,"reduce"),o(A4,"reduce");function S4(u,h,S){var $=Bt(u)?_3:S1,te=arguments.length<3;return $(u,Et(h,4),S,te,Ew)}i(S4,"reduceRight"),o(S4,"reduceRight");function x4(u,h){var S=Bt(u)?so:F1;return S(u,Sf(Et(h,3)))}i(x4,"reject"),o(x4,"reject");function T4(u){var h=Bt(u)?P1:zw;return h(u)}i(T4,"sample"),o(T4,"sample");function C4(u,h,S){(S?wn(u,h,S):h===r)?h=1:h=Ft(h);var $=Bt(u)?vw:Hw;return $(u,h)}i(C4,"sampleSize"),o(C4,"sampleSize");function M4(u){var h=Bt(u)?yw:Vw;return h(u)}i(M4,"shuffle"),o(M4,"shuffle");function I4(u){if(u==null)return 0;if(kn(u))return Tf(u)?qs(u):u.length;var h=bn(u);return h==be||h==ee?u.size:Fh(u).length}i(I4,"size"),o(I4,"size");function k4(u,h,S){var $=Bt(u)?hh:Kw;return S&&wn(u,h,S)&&(h=r),$(u,Et(h,3))}i(k4,"some"),o(k4,"some");var BO=Ht(function(u,h){if(u==null)return[];var S=h.length;return S>1&&wn(u,h[0],h[1])?h=[]:S>2&&wn(h[0],h[1],h[2])&&(h=[h[0]]),Z1(u,Qr(h,1),[])}),op=WD||function(){return Fr.Date.now()};function D4(u,h){if(typeof h!="function")throw new Li(c);return u=Ft(u),function(){if(--u<1)return h.apply(this,arguments)}}i(D4,"after"),o(D4,"after");function $g(u,h,S){return h=S?r:h,h=u&&h==null?u.length:h,Da(u,k,r,r,r,r,h)}i($g,"ary"),o($g,"ary");function zg(u,h){var S;if(typeof h!="function")throw new Li(c);return u=Ft(u),function(){return--u>0&&(S=h.apply(this,arguments)),u<=1&&(h=r),S}}i(zg,"before"),o(zg,"before");var Hg=Ht(function(u,h,S){var $=D;if(S.length){var te=uo(S,Ws(Hg));$|=Q}return Da(u,$,h,S,te)}),O4=Ht(function(u,h,S){var $=D|P;if(S.length){var te=uo(S,Ws(O4));$|=Q}return Da(h,$,u,S,te)});function qg(u,h,S){h=S?r:h;var $=Da(u,j,r,r,r,r,r,h);return $.placeholder=qg.placeholder,$}i(qg,"curry"),o(qg,"curry");function Vg(u,h,S){h=S?r:h;var $=Da(u,q,r,r,r,r,r,h);return $.placeholder=Vg.placeholder,$}i(Vg,"curryRight"),o(Vg,"curryRight");function Kg(u,h,S){var $,te,ce,ye,Ee,xe,Ue=0,Fe=!1,$e=!1,Ye=!0;if(typeof u!="function")throw new Li(c);h=li(h)||0,kr(S)&&(Fe=!!S.leading,$e="maxWait"in S,ce=$e?Zr(li(S.maxWait)||0,h):ce,Ye="trailing"in S?!!S.trailing:Ye);function gt(jr){var ta=$,po=te;return $=te=r,Ue=jr,ye=u.apply(po,ta),ye}i(gt,"invokeFunc"),o(gt,"invokeFunc");function Tt(jr){return Ue=jr,Ee=bf(Kt,h),Fe?gt(jr):ye}i(Tt,"leadingEdge"),o(Tt,"leadingEdge");function $t(jr){var ta=jr-xe,po=jr-Ue,M8=h-ta;return $e?vn(M8,ce-po):M8}i($t,"remainingWait"),o($t,"remainingWait");function At(jr){var ta=jr-xe,po=jr-Ue;return xe===r||ta>=h||ta<0||$e&&po>=ce}i(At,"shouldInvoke"),o(At,"shouldInvoke");function Kt(){var jr=op();if(At(jr))return Zt(jr);Ee=bf(Kt,$t(jr))}i(Kt,"timerExpired"),o(Kt,"timerExpired");function Zt(jr){return Ee=r,Ye&&$?gt(jr):($=te=r,ye)}i(Zt,"trailingEdge"),o(Zt,"trailingEdge");function qn(){Ee!==r&&Gw(Ee),Ue=0,$=xe=te=Ee=r}i(qn,"cancel"),o(qn,"cancel");function _n(){return Ee===r?ye:Zt(op())}i(_n,"flush"),o(_n,"flush");function Vn(){var jr=op(),ta=At(jr);if($=arguments,te=this,xe=jr,ta){if(Ee===r)return Tt(xe);if($e)return Gw(Ee),Ee=bf(Kt,h),gt(xe)}return Ee===r&&(Ee=bf(Kt,h)),ye}return i(Vn,"debounced"),o(Vn,"debounced"),Vn.cancel=qn,Vn.flush=_n,Vn}i(Kg,"debounce"),o(Kg,"debounce");var LO=Ht(function(u,h){return U1(u,1,h)}),UO=Ht(function(u,h,S){return U1(u,li(h)||0,S)});function R4(u){return Da(u,he)}i(R4,"flip"),o(R4,"flip");function Af(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new Li(c);var S=o(function(){var $=arguments,te=h?h.apply(this,$):$[0],ce=S.cache;if(ce.has(te))return ce.get(te);var ye=u.apply(this,$);return S.cache=ce.set(te,ye)||ce,ye},"memoized");return S.cache=new(Af.Cache||Ia),S}i(Af,"memoize"),o(Af,"memoize"),Af.Cache=Ia;function Sf(u){if(typeof u!="function")throw new Li(c);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}i(Sf,"negate"),o(Sf,"negate");function N4(u){return zg(2,u)}i(N4,"once"),o(N4,"once");var FO=cO(function(u,h){h=h.length==1&&Bt(h[0])?Mr(h[0],$n(Et())):Mr(Qr(h,1),$n(Et()));var S=h.length;return Ht(function($){for(var te=-1,ce=vn($.length,S);++te<ce;)$[te]=h[te].call(this,$[te]);return jn(u,this,$)})}),Gg=Ht(function(u,h){var S=uo(h,Ws(Gg));return Da(u,Q,r,h,S)}),P4=Ht(function(u,h){var S=uo(h,Ws(P4));return Da(u,Y,r,h,S)}),jO=Oa(function(u,h){return Da(u,K,r,r,r,h)});function B4(u,h){if(typeof u!="function")throw new Li(c);return h=h===r?h:Ft(h),Ht(u,h)}i(B4,"rest"),o(B4,"rest");function L4(u,h){if(typeof u!="function")throw new Li(c);return h=h==null?0:Zr(Ft(h),0),Ht(function(S){var $=S[h],te=ho(S,0,h);return $&&co(te,$),jn(u,this,te)})}i(L4,"spread"),o(L4,"spread");function U4(u,h,S){var $=!0,te=!0;if(typeof u!="function")throw new Li(c);return kr(S)&&($="leading"in S?!!S.leading:$,te="trailing"in S?!!S.trailing:te),Kg(u,h,{leading:$,maxWait:h,trailing:te})}i(U4,"throttle2"),o(U4,"throttle");function F4(u){return $g(u,1)}i(F4,"unary"),o(F4,"unary");function j4(u,h){return Gg(Wh(h),u)}i(j4,"wrap"),o(j4,"wrap");function $4(){if(!arguments.length)return[];var u=arguments[0];return Bt(u)?u:[u]}i($4,"castArray"),o($4,"castArray");function z4(u){return si(u,_)}i(z4,"clone"),o(z4,"clone");function H4(u,h){return h=typeof h=="function"?h:r,si(u,_,h)}i(H4,"cloneWith"),o(H4,"cloneWith");function q4(u){return si(u,v|_)}i(q4,"cloneDeep6"),o(q4,"cloneDeep");function V4(u,h){return h=typeof h=="function"?h:r,si(u,v|_,h)}i(V4,"cloneDeepWith"),o(V4,"cloneDeepWith");function K4(u,h){return h==null||L1(u,h,Jr(h))}i(K4,"conformsTo"),o(K4,"conformsTo");function Fi(u,h){return u===h||u!==u&&h!==h}i(Fi,"eq4"),o(Fi,"eq");var $O=gf(Bh),zO=gf(function(u,h){return u>=h}),Zs=z1(function(){return arguments}())?z1:function(u){return Dr(u)&&yr.call(u,"callee")&&!$3.call(u,"callee")},Bt=ke.isArray,HO=$s?$n($s):kw;function kn(u){return u!=null&&xf(u.length)&&!Na(u)}i(kn,"isArrayLike2"),o(kn,"isArrayLike");function Pr(u){return Dr(u)&&kn(u)}i(Pr,"isArrayLikeObject"),o(Pr,"isArrayLikeObject");function G4(u){return u===!0||u===!1||Dr(u)&&yn(u)==ne}i(G4,"isBoolean"),o(G4,"isBoolean");var Jo=JD||gp,qO=p3?$n(p3):Dw;function W4(u){return Dr(u)&&u.nodeType===1&&!fu(u)}i(W4,"isElement"),o(W4,"isElement");function Z4(u){if(u==null)return!0;if(kn(u)&&(Bt(u)||typeof u=="string"||typeof u.splice=="function"||Jo(u)||du(u)||Zs(u)))return!u.length;var h=bn(u);if(h==be||h==ee)return!u.size;if(lu(u))return!Fh(u).length;for(var S in u)if(yr.call(u,S))return!1;return!0}i(Z4,"isEmpty"),o(Z4,"isEmpty");function J4(u,h){return su(u,h)}i(J4,"isEqual"),o(J4,"isEqual");function Y4(u,h,S){S=typeof S=="function"?S:r;var $=S?S(u,h):r;return $===r?su(u,h,r,S):!!$}i(Y4,"isEqualWith"),o(Y4,"isEqualWith");function sp(u){if(!Dr(u))return!1;var h=yn(u);return h==G||h==M||typeof u.message=="string"&&typeof u.name=="string"&&!fu(u)}i(sp,"isError"),o(sp,"isError");function X4(u){return typeof u=="number"&&H3(u)}i(X4,"isFinite2"),o(X4,"isFinite");function Na(u){if(!kr(u))return!1;var h=yn(u);return h==ae||h==fe||h==L||h==W}i(Na,"isFunction2"),o(Na,"isFunction");function Wg(u){return typeof u=="number"&&u==Ft(u)}i(Wg,"isInteger3"),o(Wg,"isInteger");function xf(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=E}i(xf,"isLength"),o(xf,"isLength");function kr(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}i(kr,"isObject"),o(kr,"isObject");function Dr(u){return u!=null&&typeof u=="object"}i(Dr,"isObjectLike"),o(Dr,"isObjectLike");var Q4=m3?$n(m3):Rw;function e_(u,h){return u===h||Uh(u,h,ep(h))}i(e_,"isMatch"),o(e_,"isMatch");function t_(u,h,S){return S=typeof S=="function"?S:r,Uh(u,h,ep(h),S)}i(t_,"isMatchWith"),o(t_,"isMatchWith");function r_(u){return Zg(u)&&u!=+u}i(r_,"isNaN2"),o(r_,"isNaN");function n_(u){if(lO(u))throw new Nt(s);return H1(u)}i(n_,"isNative"),o(n_,"isNative");function i_(u){return u===null}i(i_,"isNull"),o(i_,"isNull");function a_(u){return u==null}i(a_,"isNil"),o(a_,"isNil");function Zg(u){return typeof u=="number"||Dr(u)&&yn(u)==Oe}i(Zg,"isNumber"),o(Zg,"isNumber");function fu(u){if(!Dr(u)||yn(u)!=N)return!1;var h=Th(u);if(h===null)return!0;var S=yr.call(h,"constructor")&&h.constructor;return typeof S=="function"&&S instanceof S&&Eh.call(S)==qD}i(fu,"isPlainObject"),o(fu,"isPlainObject");var Jg=g3?$n(g3):Nw;function o_(u){return Wg(u)&&u>=-E&&u<=E}i(o_,"isSafeInteger"),o(o_,"isSafeInteger");var s_=v3?$n(v3):Pw;function Tf(u){return typeof u=="string"||!Bt(u)&&Dr(u)&&yn(u)==ue}i(Tf,"isString"),o(Tf,"isString");function Hn(u){return typeof u=="symbol"||Dr(u)&&yn(u)==Ae}i(Hn,"isSymbol"),o(Hn,"isSymbol");var du=y3?$n(y3):Bw;function c_(u){return u===r}i(c_,"isUndefined"),o(c_,"isUndefined");function u_(u){return Dr(u)&&bn(u)==Ie}i(u_,"isWeakMap"),o(u_,"isWeakMap");function l_(u){return Dr(u)&&yn(u)==Be}i(l_,"isWeakSet"),o(l_,"isWeakSet");var VO=gf(jh),KO=gf(function(u,h){return u<=h});function Yg(u){if(!u)return[];if(kn(u))return Tf(u)?Bi(u):In(u);if(Ql&&u[Ql])return D3(u[Ql]());var h=bn(u),S=h==be?bh:h==ee?Xl:Js;return S(u)}i(Yg,"toArray"),o(Yg,"toArray");function Pa(u){if(!u)return u===0?u:0;if(u=li(u),u===m||u===-m){var h=u<0?-1:1;return h*O}return u===u?u:0}i(Pa,"toFinite"),o(Pa,"toFinite");function Ft(u){var h=Pa(u),S=h%1;return h===h?S?h-S:h:0}i(Ft,"toInteger"),o(Ft,"toInteger");function Xg(u){return u?Vo(Ft(u),0,A):0}i(Xg,"toLength"),o(Xg,"toLength");function li(u){if(typeof u=="number")return u;if(Hn(u))return C;if(kr(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=kr(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=x1(u);var S=er.test(u);return S||nn.test(u)?sn(u.slice(2),S?2:8):hn.test(u)?C:+u}i(li,"toNumber"),o(li,"toNumber");function Qg(u){return Qi(u,Dn(u))}i(Qg,"toPlainObject"),o(Qg,"toPlainObject");function f_(u){return u?Vo(Ft(u),-E,E):u===0?u:0}i(f_,"toSafeInteger"),o(f_,"toSafeInteger");function dr(u){return u==null?"":zn(u)}i(dr,"toString4"),o(dr,"toString");var GO=Ks(function(u,h){if(lu(h)||kn(h)){Qi(h,Jr(h),u);return}for(var S in h)yr.call(h,S)&&iu(u,S,h[S])}),d_=Ks(function(u,h){Qi(h,Dn(h),u)}),cp=Ks(function(u,h,S,$){Qi(h,Dn(h),u,$)}),WO=Ks(function(u,h,S,$){Qi(h,Jr(h),u,$)}),ZO=Oa(Nh);function h_(u,h){var S=nu(u);return h==null?S:B1(S,h)}i(h_,"create2"),o(h_,"create");var JO=Ht(function(u,h){u=_r(u);var S=-1,$=h.length,te=$>2?h[2]:r;for(te&&wn(h[0],h[1],te)&&($=1);++S<$;)for(var ce=h[S],ye=Dn(ce),Ee=-1,xe=ye.length;++Ee<xe;){var Ue=ye[Ee],Fe=u[Ue];(Fe===r||Fi(Fe,eu[Ue])&&!yr.call(u,Ue))&&(u[Ue]=ce[Ue])}return u}),YO=Ht(function(u){return u.push(r,yg),jn(x_,r,u)});function p_(u,h){return _1(u,Et(h,3),Xi)}i(p_,"findKey"),o(p_,"findKey");function m_(u,h){return _1(u,Et(h,3),Ph)}i(m_,"findLastKey"),o(m_,"findLastKey");function g_(u,h){return u==null?u:j1(u,Et(h,3),Dn)}i(g_,"forIn"),o(g_,"forIn");function v_(u,h){return u==null?u:xw(u,Et(h,3),Dn)}i(v_,"forInRight"),o(v_,"forInRight");function y_(u,h){return u&&Xi(u,Et(h,3))}i(y_,"forOwn"),o(y_,"forOwn");function b_(u,h){return u&&Ph(u,Et(h,3))}i(b_,"forOwnRight"),o(b_,"forOwnRight");function w_(u){return u==null?[]:cf(u,Jr(u))}i(w_,"functions"),o(w_,"functions");function __(u){return u==null?[]:cf(u,Dn(u))}i(__,"functionsIn"),o(__,"functionsIn");function up(u,h,S){var $=u==null?r:Go(u,h);return $===r?S:$}i(up,"get2"),o(up,"get");function E_(u,h){return u!=null&&Eg(u,h,Tw)}i(E_,"has"),o(E_,"has");function lp(u,h){return u!=null&&Eg(u,h,Cw)}i(lp,"hasIn"),o(lp,"hasIn");var XO=hg(function(u,h,S){h!=null&&typeof h.toString!="function"&&(h=Ah.call(h)),u[h]=S},fp(On)),QO=hg(function(u,h,S){h!=null&&typeof h.toString!="function"&&(h=Ah.call(h)),yr.call(u,h)?u[h].push(S):u[h]=[S]},Et),eR=Ht(ou);function Jr(u){return kn(u)?N1(u):Fh(u)}i(Jr,"keys"),o(Jr,"keys");function Dn(u){return kn(u)?N1(u,!0):Lw(u)}i(Dn,"keysIn"),o(Dn,"keysIn");function A_(u,h){var S={};return h=Et(h,3),Xi(u,function($,te,ce){ka(S,h($,te,ce),$)}),S}i(A_,"mapKeys"),o(A_,"mapKeys");function S_(u,h){var S={};return h=Et(h,3),Xi(u,function($,te,ce){ka(S,te,h($,te,ce))}),S}i(S_,"mapValues"),o(S_,"mapValues");var tR=Ks(function(u,h,S){uf(u,h,S)}),x_=Ks(function(u,h,S,$){uf(u,h,S,$)}),rR=Oa(function(u,h){var S={};if(u==null)return S;var $=!1;h=Mr(h,function(ce){return ce=fo(ce,u),$||($=ce.length>1),ce}),Qi(u,Qh(u),S),$&&(S=si(S,v|y|_,n5));for(var te=h.length;te--;)Vh(S,h[te]);return S});function T_(u,h){return ev(u,Sf(Et(h)))}i(T_,"omitBy"),o(T_,"omitBy");var nR=Oa(function(u,h){return u==null?{}:Fw(u,h)});function ev(u,h){if(u==null)return{};var S=Mr(Qh(u),function($){return[$]});return h=Et(h),J1(u,S,function($,te){return h($,te[0])})}i(ev,"pickBy"),o(ev,"pickBy");function C_(u,h,S){h=fo(h,u);var $=-1,te=h.length;for(te||(te=1,u=r);++$<te;){var ce=u==null?r:u[ea(h[$])];ce===r&&($=te,ce=S),u=Na(ce)?ce.call(u):ce}return u}i(C_,"result"),o(C_,"result");function M_(u,h,S){return u==null?u:cu(u,h,S)}i(M_,"set"),o(M_,"set");function I_(u,h,S,$){return $=typeof $=="function"?$:r,u==null?u:cu(u,h,S,$)}i(I_,"setWith"),o(I_,"setWith");var k_=gg(Jr),D_=gg(Dn);function O_(u,h,S){var $=Bt(u),te=$||Jo(u)||du(u);if(h=Et(h,4),S==null){var ce=u&&u.constructor;te?S=$?new ce:[]:kr(u)?S=Na(ce)?nu(Th(u)):{}:S={}}return(te?ai:Xi)(u,function(ye,Ee,xe){return h(S,ye,Ee,xe)}),S}i(O_,"transform"),o(O_,"transform");function R_(u,h){return u==null?!0:Vh(u,h)}i(R_,"unset"),o(R_,"unset");function N_(u,h,S){return u==null?u:eg(u,h,Wh(S))}i(N_,"update2"),o(N_,"update");function P_(u,h,S,$){return $=typeof $=="function"?$:r,u==null?u:eg(u,h,Wh(S),$)}i(P_,"updateWith"),o(P_,"updateWith");function Js(u){return u==null?[]:yh(u,Jr(u))}i(Js,"values"),o(Js,"values");function B_(u){return u==null?[]:yh(u,Dn(u))}i(B_,"valuesIn"),o(B_,"valuesIn");function L_(u,h,S){return S===r&&(S=h,h=r),S!==r&&(S=li(S),S=S===S?S:0),h!==r&&(h=li(h),h=h===h?h:0),Vo(li(u),h,S)}i(L_,"clamp"),o(L_,"clamp");function U_(u,h,S){return h=Pa(h),S===r?(S=h,h=0):S=Pa(S),u=li(u),Mw(u,h,S)}i(U_,"inRange"),o(U_,"inRange");function F_(u,h,S){if(S&&typeof S!="boolean"&&wn(u,h,S)&&(h=S=r),S===r&&(typeof h=="boolean"?(S=h,h=r):typeof u=="boolean"&&(S=u,u=r)),u===r&&h===r?(u=0,h=1):(u=Pa(u),h===r?(h=u,u=0):h=Pa(h)),u>h){var $=u;u=h,h=$}if(S||u%1||h%1){var te=q3();return vn(u+te*(h-u+Kr("1e-"+((te+"").length-1))),h)}return zh(u,h)}i(F_,"random"),o(F_,"random");var iR=Gs(function(u,h,S){return h=h.toLowerCase(),u+(S?tv(h):h)});function tv(u){return nv(dr(u).toLowerCase())}i(tv,"capitalize"),o(tv,"capitalize");function rv(u){return u=dr(u),u&&u.replace(Nr,LD).replace(ch,"")}i(rv,"deburr"),o(rv,"deburr");function j_(u,h,S){u=dr(u),h=zn(h);var $=u.length;S=S===r?$:Vo(Ft(S),0,$);var te=S;return S-=h.length,S>=0&&u.slice(S,te)==h}i(j_,"endsWith"),o(j_,"endsWith");function $_(u){return u=dr(u),u&&ft.test(u)?u.replace(Rr,UD):u}i($_,"escape"),o($_,"escape");function z_(u){return u=dr(u),u&&st.test(u)?u.replace(Qt,"\\$&"):u}i(z_,"escapeRegExp"),o(z_,"escapeRegExp");var aR=Gs(function(u,h,S){return u+(S?"-":"")+h.toLowerCase()}),oR=Gs(function(u,h,S){return u+(S?" ":"")+h.toLowerCase()}),sR=lg("toLowerCase");function H_(u,h,S){u=dr(u),h=Ft(h);var $=h?qs(u):0;if(!h||$>=h)return u;var te=(h-$)/2;return mf(kh(te),S)+u+mf(Ih(te),S)}i(H_,"pad2"),o(H_,"pad");function q_(u,h,S){u=dr(u),h=Ft(h);var $=h?qs(u):0;return h&&$<h?u+mf(h-$,S):u}i(q_,"padEnd"),o(q_,"padEnd");function V_(u,h,S){u=dr(u),h=Ft(h);var $=h?qs(u):0;return h&&$<h?mf(h-$,S)+u:u}i(V_,"padStart"),o(V_,"padStart");function K_(u,h,S){return S||h==null?h=0:h&&(h=+h),eO(dr(u).replace(rt,""),h||0)}i(K_,"parseInt2"),o(K_,"parseInt");function G_(u,h,S){return(S?wn(u,h,S):h===r)?h=1:h=Ft(h),Hh(dr(u),h)}i(G_,"repeat"),o(G_,"repeat");function W_(){var u=arguments,h=dr(u[0]);return u.length<3?h:h.replace(u[1],u[2])}i(W_,"replace"),o(W_,"replace");var cR=Gs(function(u,h,S){return u+(S?"_":"")+h.toLowerCase()});function Z_(u,h,S){return S&&typeof S!="number"&&wn(u,h,S)&&(h=S=r),S=S===r?A:S>>>0,S?(u=dr(u),u&&(typeof h=="string"||h!=null&&!Jg(h))&&(h=zn(h),!h&&Hs(u))?ho(Bi(u),0,S):u.split(h,S)):[]}i(Z_,"split"),o(Z_,"split");var uR=Gs(function(u,h,S){return u+(S?" ":"")+nv(h)});function J_(u,h,S){return u=dr(u),S=S==null?0:Vo(Ft(S),0,u.length),h=zn(h),u.slice(S,S+h.length)==h}i(J_,"startsWith"),o(J_,"startsWith");function Y_(u,h,S){var $=se.templateSettings;S&&wn(u,h,S)&&(h=r),u=dr(u),h=cp({},h,$,vg);var te=cp({},h.imports,$.imports,vg),ce=Jr(te),ye=yh(te,ce),Ee,xe,Ue=0,Fe=h.interpolate||Vr,$e="__p += '",Ye=k1((h.escape||Vr).source+"|"+Fe.source+"|"+(Fe===at?xt:Vr).source+"|"+(h.evaluate||Vr).source+"|$","g"),gt="//# sourceURL="+(yr.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yc+"]")+`
|
|
26
|
+
`)}i(d5,"insertWrapDetails"),o(d5,"insertWrapDetails");function h5(u){return Bt(u)||Zs(u)||!!(z3&&u&&u[z3])}i(h5,"isFlattenable"),o(h5,"isFlattenable");function Ra(u,h){var S=typeof u;return h=h??E,!!h&&(S=="number"||S!="symbol"&&an.test(u))&&u>-1&&u%1==0&&u<h}i(Ra,"isIndex"),o(Ra,"isIndex");function wn(u,h,S){if(!kr(S))return!1;var z=typeof h;return(z=="number"?kn(S)&&Ra(h,S.length):z=="string"&&h in S)?Fi(S[h],u):!1}i(wn,"isIterateeCall"),o(wn,"isIterateeCall");function tp(u,h){if(Bt(u))return!1;var S=typeof u;return S=="number"||S=="symbol"||S=="boolean"||u==null||Hn(u)?!0:ot.test(u)||!or.test(u)||h!=null&&u in _r(h)}i(tp,"isKey"),o(tp,"isKey");function p5(u){var h=typeof u;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?u!=="__proto__":u===null}i(p5,"isKeyable"),o(p5,"isKeyable");function rp(u){var h=vf(u),S=se[h];if(typeof S!="function"||!(h in Wt.prototype))return!1;if(u===S)return!0;var z=wg(S);return!!z&&u===z[0]}i(rp,"isLaziable"),o(rp,"isLaziable");function m5(u){return!!U3&&U3 in u}i(m5,"isMasked"),o(m5,"isMasked");var lO=_h?Na:gp;function lu(u){var h=u&&u.constructor,S=typeof h=="function"&&h.prototype||eu;return u===S}i(lu,"isPrototype"),o(lu,"isPrototype");function Sg(u){return u===u&&!kr(u)}i(Sg,"isStrictComparable"),o(Sg,"isStrictComparable");function xg(u,h){return function(S){return S==null?!1:S[u]===h&&(h!==r||u in _r(S))}}i(xg,"matchesStrictComparable"),o(xg,"matchesStrictComparable");function g5(u){var h=Af(u,function(z){return S.size===p&&S.clear(),z}),S=h.cache;return h}i(g5,"memoizeCapped"),o(g5,"memoizeCapped");function v5(u,h){var S=u[1],z=h[1],te=S|z,ce=te<(D|P|k),ye=z==k&&S==j||z==k&&S==K&&u[7].length<=h[8]||z==(k|K)&&h[7].length<=h[8]&&S==j;if(!(ce||ye))return u;z&D&&(u[2]=h[2],te|=S&D?0:Z);var Ee=h[3];if(Ee){var xe=u[3];u[3]=xe?og(xe,Ee,h[4]):Ee,u[4]=xe?uo(u[3],g):h[4]}return Ee=h[5],Ee&&(xe=u[5],u[5]=xe?sg(xe,Ee,h[6]):Ee,u[6]=xe?uo(u[5],g):h[6]),Ee=h[7],Ee&&(u[7]=Ee),z&k&&(u[8]=u[8]==null?h[8]:vn(u[8],h[8])),u[9]==null&&(u[9]=h[9]),u[0]=h[0],u[1]=te,u}i(v5,"mergeData"),o(v5,"mergeData");function y5(u){var h=[];if(u!=null)for(var S in _r(u))h.push(S);return h}i(y5,"nativeKeysIn"),o(y5,"nativeKeysIn");function b5(u){return Ah.call(u)}i(b5,"objectToString"),o(b5,"objectToString");function Tg(u,h,S){return h=Zr(h===r?u.length-1:h,0),function(){for(var z=arguments,te=-1,ce=Zr(z.length-h,0),ye=ke(ce);++te<ce;)ye[te]=z[h+te];te=-1;for(var Ee=ke(h+1);++te<h;)Ee[te]=z[te];return Ee[h]=S(ye),jn(u,this,Ee)}}i(Tg,"overRest"),o(Tg,"overRest");function Cg(u,h){return h.length<2?u:Go(u,ci(h,0,-1))}i(Cg,"parent"),o(Cg,"parent");function w5(u,h){for(var S=u.length,z=vn(h.length,S),te=In(u);z--;){var ce=h[z];u[z]=Ra(ce,S)?te[ce]:r}return u}i(w5,"reorder"),o(w5,"reorder");function np(u,h){if(!(h==="constructor"&&typeof u[h]=="function")&&h!="__proto__")return u[h]}i(np,"safeGet"),o(np,"safeGet");var _5=kg(qw),bf=ZD||function(u,h){return Fr.setTimeout(u,h)},Mg=kg(sO);function Ig(u,h,S){var z=h+"";return Mg(u,d5(z,A5(u5(z),S)))}i(Ig,"setWrapToString"),o(Ig,"setWrapToString");function kg(u){var h=0,S=0;return function(){var z=QD(),te=w-(z-S);if(S=z,te>0){if(++h>=J)return arguments[0]}else h=0;return u.apply(r,arguments)}}i(kg,"shortOut"),o(kg,"shortOut");function wf(u,h){var S=-1,z=u.length,te=z-1;for(h=h===r?z:h;++S<h;){var ce=zh(S,te),ye=u[ce];u[ce]=u[S],u[S]=ye}return u.length=h,u}i(wf,"shuffleSelf"),o(wf,"shuffleSelf");var E5=g5(function(u){var h=[];return u.charCodeAt(0)===46&&h.push(""),u.replace(Xe,function(S,z,te,ce){h.push(te?ce.replace(Tn,"$1"):z||S)}),h});function ea(u){if(typeof u=="string"||Hn(u))return u;var h=u+"";return h=="0"&&1/u==-m?"-0":h}i(ea,"toKey"),o(ea,"toKey");function Zo(u){if(u!=null){try{return Eh.call(u)}catch{}try{return u+""}catch{}}return""}i(Zo,"toSource"),o(Zo,"toSource");function A5(u,h){return ai(I,function(S){var z="_."+S[0];h&S[1]&&!Jl(u,z)&&u.push(z)}),u.sort()}i(A5,"updateWrapDetails"),o(A5,"updateWrapDetails");function Dg(u){if(u instanceof Wt)return u.clone();var h=new oi(u.__wrapped__,u.__chain__);return h.__actions__=In(u.__actions__),h.__index__=u.__index__,h.__values__=u.__values__,h}i(Dg,"wrapperClone"),o(Dg,"wrapperClone");function S5(u,h,S){(S?wn(u,h,S):h===r)?h=1:h=Zr(Ft(h),0);var z=u==null?0:u.length;if(!z||h<1)return[];for(var te=0,ce=0,ye=ke(Ih(z/h));te<z;)ye[ce++]=ci(u,te,te+=h);return ye}i(S5,"chunk"),o(S5,"chunk");function x5(u){for(var h=-1,S=u==null?0:u.length,z=0,te=[];++h<S;){var ce=u[h];ce&&(te[z++]=ce)}return te}i(x5,"compact"),o(x5,"compact");function T5(){var u=arguments.length;if(!u)return[];for(var h=ke(u-1),S=arguments[0],z=u;z--;)h[z-1]=arguments[z];return co(Bt(S)?In(S):[S],Qr(h,1))}i(T5,"concat4"),o(T5,"concat");var fO=Ht(function(u,h){return Pr(u)?au(u,Qr(h,1,Pr,!0)):[]}),dO=Ht(function(u,h){var S=ui(h);return Pr(S)&&(S=r),Pr(u)?au(u,Qr(h,1,Pr,!0),Et(S,2)):[]}),hO=Ht(function(u,h){var S=ui(h);return Pr(S)&&(S=r),Pr(u)?au(u,Qr(h,1,Pr,!0),r,S):[]});function C5(u,h,S){var z=u==null?0:u.length;return z?(h=S||h===r?1:Ft(h),ci(u,h<0?0:h,z)):[]}i(C5,"drop"),o(C5,"drop");function M5(u,h,S){var z=u==null?0:u.length;return z?(h=S||h===r?1:Ft(h),h=z-h,ci(u,0,h<0?0:h)):[]}i(M5,"dropRight"),o(M5,"dropRight");function I5(u,h){return u&&u.length?ff(u,Et(h,3),!0,!0):[]}i(I5,"dropRightWhile"),o(I5,"dropRightWhile");function k5(u,h){return u&&u.length?ff(u,Et(h,3),!0):[]}i(k5,"dropWhile"),o(k5,"dropWhile");function D5(u,h,S,z){var te=u==null?0:u.length;return te?(S&&typeof S!="number"&&wn(u,h,S)&&(S=0,z=te),Sw(u,h,S,z)):[]}i(D5,"fill"),o(D5,"fill");function Og(u,h,S){var z=u==null?0:u.length;if(!z)return-1;var te=S==null?0:Ft(S);return te<0&&(te=Zr(z+te,0)),Yl(u,Et(h,3),te)}i(Og,"findIndex"),o(Og,"findIndex");function Rg(u,h,S){var z=u==null?0:u.length;if(!z)return-1;var te=z-1;return S!==r&&(te=Ft(S),te=S<0?Zr(z+te,0):vn(te,z-1)),Yl(u,Et(h,3),te,!0)}i(Rg,"findLastIndex"),o(Rg,"findLastIndex");function Ng(u){var h=u==null?0:u.length;return h?Qr(u,1):[]}i(Ng,"flatten"),o(Ng,"flatten");function O5(u){var h=u==null?0:u.length;return h?Qr(u,m):[]}i(O5,"flattenDeep"),o(O5,"flattenDeep");function R5(u,h){var S=u==null?0:u.length;return S?(h=h===r?1:Ft(h),Qr(u,h)):[]}i(R5,"flattenDepth"),o(R5,"flattenDepth");function N5(u){for(var h=-1,S=u==null?0:u.length,z={};++h<S;){var te=u[h];z[te[0]]=te[1]}return z}i(N5,"fromPairs"),o(N5,"fromPairs");function Pg(u){return u&&u.length?u[0]:r}i(Pg,"head"),o(Pg,"head");function P5(u,h,S){var z=u==null?0:u.length;if(!z)return-1;var te=S==null?0:Ft(S);return te<0&&(te=Zr(z+te,0)),zs(u,h,te)}i(P5,"indexOf"),o(P5,"indexOf");function B5(u){var h=u==null?0:u.length;return h?ci(u,0,-1):[]}i(B5,"initial"),o(B5,"initial");var pO=Ht(function(u){var h=Mr(u,Gh);return h.length&&h[0]===u[0]?Lh(h):[]}),mO=Ht(function(u){var h=ui(u),S=Mr(u,Gh);return h===ui(S)?h=r:S.pop(),S.length&&S[0]===u[0]?Lh(S,Et(h,2)):[]}),gO=Ht(function(u){var h=ui(u),S=Mr(u,Gh);return h=typeof h=="function"?h:r,h&&S.pop(),S.length&&S[0]===u[0]?Lh(S,r,h):[]});function L5(u,h){return u==null?"":YD.call(u,h)}i(L5,"join"),o(L5,"join");function ui(u){var h=u==null?0:u.length;return h?u[h-1]:r}i(ui,"last2"),o(ui,"last");function U5(u,h,S){var z=u==null?0:u.length;if(!z)return-1;var te=z;return S!==r&&(te=Ft(S),te=te<0?Zr(z+te,0):vn(te,z-1)),h===h?N3(u,h,te):Yl(u,E1,te,!0)}i(U5,"lastIndexOf"),o(U5,"lastIndexOf");function F5(u,h){return u&&u.length?W1(u,Ft(h)):r}i(F5,"nth"),o(F5,"nth");var vO=Ht(Bg);function Bg(u,h){return u&&u.length&&h&&h.length?$h(u,h):u}i(Bg,"pullAll"),o(Bg,"pullAll");function j5(u,h,S){return u&&u.length&&h&&h.length?$h(u,h,Et(S,2)):u}i(j5,"pullAllBy"),o(j5,"pullAllBy");function $5(u,h,S){return u&&u.length&&h&&h.length?$h(u,h,r,S):u}i($5,"pullAllWith"),o($5,"pullAllWith");var yO=Oa(function(u,h){var S=u==null?0:u.length,z=Nh(u,h);return Y1(u,Mr(h,function(te){return Ra(te,S)?+te:te}).sort(ag)),z});function z5(u,h){var S=[];if(!(u&&u.length))return S;var z=-1,te=[],ce=u.length;for(h=Et(h,3);++z<ce;){var ye=u[z];h(ye,z,u)&&(S.push(ye),te.push(z))}return Y1(u,te),S}i(z5,"remove"),o(z5,"remove");function ip(u){return u==null?u:tO.call(u)}i(ip,"reverse"),o(ip,"reverse");function H5(u,h,S){var z=u==null?0:u.length;return z?(S&&typeof S!="number"&&wn(u,h,S)?(h=0,S=z):(h=h==null?0:Ft(h),S=S===r?z:Ft(S)),ci(u,h,S)):[]}i(H5,"slice2"),o(H5,"slice");function q5(u,h){return lf(u,h)}i(q5,"sortedIndex"),o(q5,"sortedIndex");function V5(u,h,S){return qh(u,h,Et(S,2))}i(V5,"sortedIndexBy"),o(V5,"sortedIndexBy");function K5(u,h){var S=u==null?0:u.length;if(S){var z=lf(u,h);if(z<S&&Fi(u[z],h))return z}return-1}i(K5,"sortedIndexOf"),o(K5,"sortedIndexOf");function G5(u,h){return lf(u,h,!0)}i(G5,"sortedLastIndex"),o(G5,"sortedLastIndex");function W5(u,h,S){return qh(u,h,Et(S,2),!0)}i(W5,"sortedLastIndexBy"),o(W5,"sortedLastIndexBy");function Z5(u,h){var S=u==null?0:u.length;if(S){var z=lf(u,h,!0)-1;if(Fi(u[z],h))return z}return-1}i(Z5,"sortedLastIndexOf"),o(Z5,"sortedLastIndexOf");function J5(u){return u&&u.length?X1(u):[]}i(J5,"sortedUniq"),o(J5,"sortedUniq");function Y5(u,h){return u&&u.length?X1(u,Et(h,2)):[]}i(Y5,"sortedUniqBy"),o(Y5,"sortedUniqBy");function X5(u){var h=u==null?0:u.length;return h?ci(u,1,h):[]}i(X5,"tail"),o(X5,"tail");function Q5(u,h,S){return u&&u.length?(h=S||h===r?1:Ft(h),ci(u,0,h<0?0:h)):[]}i(Q5,"take2"),o(Q5,"take");function e4(u,h,S){var z=u==null?0:u.length;return z?(h=S||h===r?1:Ft(h),h=z-h,ci(u,h<0?0:h,z)):[]}i(e4,"takeRight"),o(e4,"takeRight");function t4(u,h){return u&&u.length?ff(u,Et(h,3),!1,!0):[]}i(t4,"takeRightWhile"),o(t4,"takeRightWhile");function r4(u,h){return u&&u.length?ff(u,Et(h,3)):[]}i(r4,"takeWhile"),o(r4,"takeWhile");var bO=Ht(function(u){return lo(Qr(u,1,Pr,!0))}),wO=Ht(function(u){var h=ui(u);return Pr(h)&&(h=r),lo(Qr(u,1,Pr,!0),Et(h,2))}),_O=Ht(function(u){var h=ui(u);return h=typeof h=="function"?h:r,lo(Qr(u,1,Pr,!0),r,h)});function n4(u){return u&&u.length?lo(u):[]}i(n4,"uniq"),o(n4,"uniq");function i4(u,h){return u&&u.length?lo(u,Et(h,2)):[]}i(i4,"uniqBy"),o(i4,"uniqBy");function a4(u,h){return h=typeof h=="function"?h:r,u&&u.length?lo(u,r,h):[]}i(a4,"uniqWith"),o(a4,"uniqWith");function ap(u){if(!(u&&u.length))return[];var h=0;return u=so(u,function(S){if(Pr(S))return h=Zr(S.length,h),!0}),vh(h,function(S){return Mr(u,ph(S))})}i(ap,"unzip"),o(ap,"unzip");function Lg(u,h){if(!(u&&u.length))return[];var S=ap(u);return h==null?S:Mr(S,function(z){return jn(h,r,z)})}i(Lg,"unzipWith"),o(Lg,"unzipWith");var EO=Ht(function(u,h){return Pr(u)?au(u,h):[]}),AO=Ht(function(u){return Kh(so(u,Pr))}),SO=Ht(function(u){var h=ui(u);return Pr(h)&&(h=r),Kh(so(u,Pr),Et(h,2))}),xO=Ht(function(u){var h=ui(u);return h=typeof h=="function"?h:r,Kh(so(u,Pr),r,h)}),TO=Ht(ap);function o4(u,h){return rg(u||[],h||[],iu)}i(o4,"zipObject"),o(o4,"zipObject");function s4(u,h){return rg(u||[],h||[],cu)}i(s4,"zipObjectDeep"),o(s4,"zipObjectDeep");var CO=Ht(function(u){var h=u.length,S=h>1?u[h-1]:r;return S=typeof S=="function"?(u.pop(),S):r,Lg(u,S)});function Ug(u){var h=se(u);return h.__chain__=!0,h}i(Ug,"chain"),o(Ug,"chain");function c4(u,h){return h(u),u}i(c4,"tap"),o(c4,"tap");function _f(u,h){return h(u)}i(_f,"thru"),o(_f,"thru");var MO=Oa(function(u){var h=u.length,S=h?u[0]:0,z=this.__wrapped__,te=o(function(ce){return Nh(ce,u)},"interceptor");return h>1||this.__actions__.length||!(z instanceof Wt)||!Ra(S)?this.thru(te):(z=z.slice(S,+S+(h?1:0)),z.__actions__.push({func:_f,args:[te],thisArg:r}),new oi(z,this.__chain__).thru(function(ce){return h&&!ce.length&&ce.push(r),ce}))});function u4(){return Ug(this)}i(u4,"wrapperChain"),o(u4,"wrapperChain");function l4(){return new oi(this.value(),this.__chain__)}i(l4,"wrapperCommit"),o(l4,"wrapperCommit");function f4(){this.__values__===r&&(this.__values__=Yg(this.value()));var u=this.__index__>=this.__values__.length,h=u?r:this.__values__[this.__index__++];return{done:u,value:h}}i(f4,"wrapperNext"),o(f4,"wrapperNext");function d4(){return this}i(d4,"wrapperToIterator"),o(d4,"wrapperToIterator");function h4(u){for(var h,S=this;S instanceof af;){var z=Dg(S);z.__index__=0,z.__values__=r,h?te.__wrapped__=z:h=z;var te=z;S=S.__wrapped__}return te.__wrapped__=u,h}i(h4,"wrapperPlant"),o(h4,"wrapperPlant");function p4(){var u=this.__wrapped__;if(u instanceof Wt){var h=u;return this.__actions__.length&&(h=new Wt(this)),h=h.reverse(),h.__actions__.push({func:_f,args:[ip],thisArg:r}),new oi(h,this.__chain__)}return this.thru(ip)}i(p4,"wrapperReverse"),o(p4,"wrapperReverse");function m4(){return tg(this.__wrapped__,this.__actions__)}i(m4,"wrapperValue"),o(m4,"wrapperValue");var IO=df(function(u,h,S){yr.call(u,S)?++u[S]:ka(u,S,1)});function g4(u,h,S){var z=Bt(u)?w1:Aw;return S&&wn(u,h,S)&&(h=r),z(u,Et(h,3))}i(g4,"every"),o(g4,"every");function v4(u,h){var S=Bt(u)?so:F1;return S(u,Et(h,3))}i(v4,"filter2"),o(v4,"filter");var kO=fg(Og),DO=fg(Rg);function y4(u,h){return Qr(Ef(u,h),1)}i(y4,"flatMap"),o(y4,"flatMap");function b4(u,h){return Qr(Ef(u,h),m)}i(b4,"flatMapDeep"),o(b4,"flatMapDeep");function w4(u,h,S){return S=S===r?1:Ft(S),Qr(Ef(u,h),S)}i(w4,"flatMapDepth"),o(w4,"flatMapDepth");function Fg(u,h){var S=Bt(u)?ai:Ko;return S(u,Et(h,3))}i(Fg,"forEach"),o(Fg,"forEach");function jg(u,h){var S=Bt(u)?w3:Ew;return S(u,Et(h,3))}i(jg,"forEachRight"),o(jg,"forEachRight");var OO=df(function(u,h,S){yr.call(u,S)?u[S].push(h):ka(u,S,[h])});function _4(u,h,S,z){u=kn(u)?u:Js(u),S=S&&!z?Ft(S):0;var te=u.length;return S<0&&(S=Zr(te+S,0)),Tf(u)?S<=te&&u.indexOf(h,S)>-1:!!te&&zs(u,h,S)>-1}i(_4,"includes"),o(_4,"includes");var RO=Ht(function(u,h,S){var z=-1,te=typeof h=="function",ce=kn(u)?ke(u.length):[];return Ko(u,function(ye){ce[++z]=te?jn(h,ye,S):ou(ye,h,S)}),ce}),NO=df(function(u,h,S){ka(u,S,h)});function Ef(u,h){var S=Bt(u)?Mr:V1;return S(u,Et(h,3))}i(Ef,"map2"),o(Ef,"map");function E4(u,h,S,z){return u==null?[]:(Bt(h)||(h=h==null?[]:[h]),S=z?r:S,Bt(S)||(S=S==null?[]:[S]),Z1(u,h,S))}i(E4,"orderBy"),o(E4,"orderBy");var PO=df(function(u,h,S){u[S?0:1].push(h)},function(){return[[],[]]});function A4(u,h,S){var z=Bt(u)?dh:S1,te=arguments.length<3;return z(u,Et(h,4),S,te,Ko)}i(A4,"reduce"),o(A4,"reduce");function S4(u,h,S){var z=Bt(u)?_3:S1,te=arguments.length<3;return z(u,Et(h,4),S,te,Ew)}i(S4,"reduceRight"),o(S4,"reduceRight");function x4(u,h){var S=Bt(u)?so:F1;return S(u,Sf(Et(h,3)))}i(x4,"reject"),o(x4,"reject");function T4(u){var h=Bt(u)?P1:zw;return h(u)}i(T4,"sample"),o(T4,"sample");function C4(u,h,S){(S?wn(u,h,S):h===r)?h=1:h=Ft(h);var z=Bt(u)?vw:Hw;return z(u,h)}i(C4,"sampleSize"),o(C4,"sampleSize");function M4(u){var h=Bt(u)?yw:Vw;return h(u)}i(M4,"shuffle"),o(M4,"shuffle");function I4(u){if(u==null)return 0;if(kn(u))return Tf(u)?qs(u):u.length;var h=bn(u);return h==be||h==ee?u.size:Fh(u).length}i(I4,"size"),o(I4,"size");function k4(u,h,S){var z=Bt(u)?hh:Kw;return S&&wn(u,h,S)&&(h=r),z(u,Et(h,3))}i(k4,"some"),o(k4,"some");var BO=Ht(function(u,h){if(u==null)return[];var S=h.length;return S>1&&wn(u,h[0],h[1])?h=[]:S>2&&wn(h[0],h[1],h[2])&&(h=[h[0]]),Z1(u,Qr(h,1),[])}),op=WD||function(){return Fr.Date.now()};function D4(u,h){if(typeof h!="function")throw new Li(c);return u=Ft(u),function(){if(--u<1)return h.apply(this,arguments)}}i(D4,"after"),o(D4,"after");function $g(u,h,S){return h=S?r:h,h=u&&h==null?u.length:h,Da(u,k,r,r,r,r,h)}i($g,"ary"),o($g,"ary");function zg(u,h){var S;if(typeof h!="function")throw new Li(c);return u=Ft(u),function(){return--u>0&&(S=h.apply(this,arguments)),u<=1&&(h=r),S}}i(zg,"before"),o(zg,"before");var Hg=Ht(function(u,h,S){var z=D;if(S.length){var te=uo(S,Ws(Hg));z|=Q}return Da(u,z,h,S,te)}),O4=Ht(function(u,h,S){var z=D|P;if(S.length){var te=uo(S,Ws(O4));z|=Q}return Da(h,z,u,S,te)});function qg(u,h,S){h=S?r:h;var z=Da(u,j,r,r,r,r,r,h);return z.placeholder=qg.placeholder,z}i(qg,"curry"),o(qg,"curry");function Vg(u,h,S){h=S?r:h;var z=Da(u,q,r,r,r,r,r,h);return z.placeholder=Vg.placeholder,z}i(Vg,"curryRight"),o(Vg,"curryRight");function Kg(u,h,S){var z,te,ce,ye,Ee,xe,Ue=0,Fe=!1,$e=!1,Ye=!0;if(typeof u!="function")throw new Li(c);h=li(h)||0,kr(S)&&(Fe=!!S.leading,$e="maxWait"in S,ce=$e?Zr(li(S.maxWait)||0,h):ce,Ye="trailing"in S?!!S.trailing:Ye);function gt(jr){var ta=z,po=te;return z=te=r,Ue=jr,ye=u.apply(po,ta),ye}i(gt,"invokeFunc"),o(gt,"invokeFunc");function Tt(jr){return Ue=jr,Ee=bf(Kt,h),Fe?gt(jr):ye}i(Tt,"leadingEdge"),o(Tt,"leadingEdge");function $t(jr){var ta=jr-xe,po=jr-Ue,M8=h-ta;return $e?vn(M8,ce-po):M8}i($t,"remainingWait"),o($t,"remainingWait");function At(jr){var ta=jr-xe,po=jr-Ue;return xe===r||ta>=h||ta<0||$e&&po>=ce}i(At,"shouldInvoke"),o(At,"shouldInvoke");function Kt(){var jr=op();if(At(jr))return Zt(jr);Ee=bf(Kt,$t(jr))}i(Kt,"timerExpired"),o(Kt,"timerExpired");function Zt(jr){return Ee=r,Ye&&z?gt(jr):(z=te=r,ye)}i(Zt,"trailingEdge"),o(Zt,"trailingEdge");function qn(){Ee!==r&&Gw(Ee),Ue=0,z=xe=te=Ee=r}i(qn,"cancel"),o(qn,"cancel");function _n(){return Ee===r?ye:Zt(op())}i(_n,"flush"),o(_n,"flush");function Vn(){var jr=op(),ta=At(jr);if(z=arguments,te=this,xe=jr,ta){if(Ee===r)return Tt(xe);if($e)return Gw(Ee),Ee=bf(Kt,h),gt(xe)}return Ee===r&&(Ee=bf(Kt,h)),ye}return i(Vn,"debounced"),o(Vn,"debounced"),Vn.cancel=qn,Vn.flush=_n,Vn}i(Kg,"debounce"),o(Kg,"debounce");var LO=Ht(function(u,h){return U1(u,1,h)}),UO=Ht(function(u,h,S){return U1(u,li(h)||0,S)});function R4(u){return Da(u,he)}i(R4,"flip"),o(R4,"flip");function Af(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new Li(c);var S=o(function(){var z=arguments,te=h?h.apply(this,z):z[0],ce=S.cache;if(ce.has(te))return ce.get(te);var ye=u.apply(this,z);return S.cache=ce.set(te,ye)||ce,ye},"memoized");return S.cache=new(Af.Cache||Ia),S}i(Af,"memoize"),o(Af,"memoize"),Af.Cache=Ia;function Sf(u){if(typeof u!="function")throw new Li(c);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}i(Sf,"negate"),o(Sf,"negate");function N4(u){return zg(2,u)}i(N4,"once"),o(N4,"once");var FO=cO(function(u,h){h=h.length==1&&Bt(h[0])?Mr(h[0],$n(Et())):Mr(Qr(h,1),$n(Et()));var S=h.length;return Ht(function(z){for(var te=-1,ce=vn(z.length,S);++te<ce;)z[te]=h[te].call(this,z[te]);return jn(u,this,z)})}),Gg=Ht(function(u,h){var S=uo(h,Ws(Gg));return Da(u,Q,r,h,S)}),P4=Ht(function(u,h){var S=uo(h,Ws(P4));return Da(u,Y,r,h,S)}),jO=Oa(function(u,h){return Da(u,K,r,r,r,h)});function B4(u,h){if(typeof u!="function")throw new Li(c);return h=h===r?h:Ft(h),Ht(u,h)}i(B4,"rest"),o(B4,"rest");function L4(u,h){if(typeof u!="function")throw new Li(c);return h=h==null?0:Zr(Ft(h),0),Ht(function(S){var z=S[h],te=ho(S,0,h);return z&&co(te,z),jn(u,this,te)})}i(L4,"spread"),o(L4,"spread");function U4(u,h,S){var z=!0,te=!0;if(typeof u!="function")throw new Li(c);return kr(S)&&(z="leading"in S?!!S.leading:z,te="trailing"in S?!!S.trailing:te),Kg(u,h,{leading:z,maxWait:h,trailing:te})}i(U4,"throttle2"),o(U4,"throttle");function F4(u){return $g(u,1)}i(F4,"unary"),o(F4,"unary");function j4(u,h){return Gg(Wh(h),u)}i(j4,"wrap"),o(j4,"wrap");function $4(){if(!arguments.length)return[];var u=arguments[0];return Bt(u)?u:[u]}i($4,"castArray"),o($4,"castArray");function z4(u){return si(u,_)}i(z4,"clone"),o(z4,"clone");function H4(u,h){return h=typeof h=="function"?h:r,si(u,_,h)}i(H4,"cloneWith"),o(H4,"cloneWith");function q4(u){return si(u,v|_)}i(q4,"cloneDeep6"),o(q4,"cloneDeep");function V4(u,h){return h=typeof h=="function"?h:r,si(u,v|_,h)}i(V4,"cloneDeepWith"),o(V4,"cloneDeepWith");function K4(u,h){return h==null||L1(u,h,Jr(h))}i(K4,"conformsTo"),o(K4,"conformsTo");function Fi(u,h){return u===h||u!==u&&h!==h}i(Fi,"eq4"),o(Fi,"eq");var $O=gf(Bh),zO=gf(function(u,h){return u>=h}),Zs=z1(function(){return arguments}())?z1:function(u){return Dr(u)&&yr.call(u,"callee")&&!$3.call(u,"callee")},Bt=ke.isArray,HO=$s?$n($s):kw;function kn(u){return u!=null&&xf(u.length)&&!Na(u)}i(kn,"isArrayLike2"),o(kn,"isArrayLike");function Pr(u){return Dr(u)&&kn(u)}i(Pr,"isArrayLikeObject"),o(Pr,"isArrayLikeObject");function G4(u){return u===!0||u===!1||Dr(u)&&yn(u)==ne}i(G4,"isBoolean"),o(G4,"isBoolean");var Jo=JD||gp,qO=p3?$n(p3):Dw;function W4(u){return Dr(u)&&u.nodeType===1&&!fu(u)}i(W4,"isElement"),o(W4,"isElement");function Z4(u){if(u==null)return!0;if(kn(u)&&(Bt(u)||typeof u=="string"||typeof u.splice=="function"||Jo(u)||du(u)||Zs(u)))return!u.length;var h=bn(u);if(h==be||h==ee)return!u.size;if(lu(u))return!Fh(u).length;for(var S in u)if(yr.call(u,S))return!1;return!0}i(Z4,"isEmpty"),o(Z4,"isEmpty");function J4(u,h){return su(u,h)}i(J4,"isEqual"),o(J4,"isEqual");function Y4(u,h,S){S=typeof S=="function"?S:r;var z=S?S(u,h):r;return z===r?su(u,h,r,S):!!z}i(Y4,"isEqualWith"),o(Y4,"isEqualWith");function sp(u){if(!Dr(u))return!1;var h=yn(u);return h==G||h==M||typeof u.message=="string"&&typeof u.name=="string"&&!fu(u)}i(sp,"isError"),o(sp,"isError");function X4(u){return typeof u=="number"&&H3(u)}i(X4,"isFinite2"),o(X4,"isFinite");function Na(u){if(!kr(u))return!1;var h=yn(u);return h==ae||h==fe||h==L||h==W}i(Na,"isFunction2"),o(Na,"isFunction");function Wg(u){return typeof u=="number"&&u==Ft(u)}i(Wg,"isInteger3"),o(Wg,"isInteger");function xf(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=E}i(xf,"isLength"),o(xf,"isLength");function kr(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}i(kr,"isObject"),o(kr,"isObject");function Dr(u){return u!=null&&typeof u=="object"}i(Dr,"isObjectLike"),o(Dr,"isObjectLike");var Q4=m3?$n(m3):Rw;function e_(u,h){return u===h||Uh(u,h,ep(h))}i(e_,"isMatch"),o(e_,"isMatch");function t_(u,h,S){return S=typeof S=="function"?S:r,Uh(u,h,ep(h),S)}i(t_,"isMatchWith"),o(t_,"isMatchWith");function r_(u){return Zg(u)&&u!=+u}i(r_,"isNaN2"),o(r_,"isNaN");function n_(u){if(lO(u))throw new Nt(s);return H1(u)}i(n_,"isNative"),o(n_,"isNative");function i_(u){return u===null}i(i_,"isNull"),o(i_,"isNull");function a_(u){return u==null}i(a_,"isNil"),o(a_,"isNil");function Zg(u){return typeof u=="number"||Dr(u)&&yn(u)==Oe}i(Zg,"isNumber"),o(Zg,"isNumber");function fu(u){if(!Dr(u)||yn(u)!=N)return!1;var h=Th(u);if(h===null)return!0;var S=yr.call(h,"constructor")&&h.constructor;return typeof S=="function"&&S instanceof S&&Eh.call(S)==qD}i(fu,"isPlainObject"),o(fu,"isPlainObject");var Jg=g3?$n(g3):Nw;function o_(u){return Wg(u)&&u>=-E&&u<=E}i(o_,"isSafeInteger"),o(o_,"isSafeInteger");var s_=v3?$n(v3):Pw;function Tf(u){return typeof u=="string"||!Bt(u)&&Dr(u)&&yn(u)==ue}i(Tf,"isString"),o(Tf,"isString");function Hn(u){return typeof u=="symbol"||Dr(u)&&yn(u)==Ae}i(Hn,"isSymbol"),o(Hn,"isSymbol");var du=y3?$n(y3):Bw;function c_(u){return u===r}i(c_,"isUndefined"),o(c_,"isUndefined");function u_(u){return Dr(u)&&bn(u)==Ie}i(u_,"isWeakMap"),o(u_,"isWeakMap");function l_(u){return Dr(u)&&yn(u)==Be}i(l_,"isWeakSet"),o(l_,"isWeakSet");var VO=gf(jh),KO=gf(function(u,h){return u<=h});function Yg(u){if(!u)return[];if(kn(u))return Tf(u)?Bi(u):In(u);if(Ql&&u[Ql])return D3(u[Ql]());var h=bn(u),S=h==be?bh:h==ee?Xl:Js;return S(u)}i(Yg,"toArray"),o(Yg,"toArray");function Pa(u){if(!u)return u===0?u:0;if(u=li(u),u===m||u===-m){var h=u<0?-1:1;return h*O}return u===u?u:0}i(Pa,"toFinite"),o(Pa,"toFinite");function Ft(u){var h=Pa(u),S=h%1;return h===h?S?h-S:h:0}i(Ft,"toInteger"),o(Ft,"toInteger");function Xg(u){return u?Vo(Ft(u),0,A):0}i(Xg,"toLength"),o(Xg,"toLength");function li(u){if(typeof u=="number")return u;if(Hn(u))return C;if(kr(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=kr(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=x1(u);var S=er.test(u);return S||nn.test(u)?sn(u.slice(2),S?2:8):hn.test(u)?C:+u}i(li,"toNumber"),o(li,"toNumber");function Qg(u){return Qi(u,Dn(u))}i(Qg,"toPlainObject"),o(Qg,"toPlainObject");function f_(u){return u?Vo(Ft(u),-E,E):u===0?u:0}i(f_,"toSafeInteger"),o(f_,"toSafeInteger");function dr(u){return u==null?"":zn(u)}i(dr,"toString4"),o(dr,"toString");var GO=Ks(function(u,h){if(lu(h)||kn(h)){Qi(h,Jr(h),u);return}for(var S in h)yr.call(h,S)&&iu(u,S,h[S])}),d_=Ks(function(u,h){Qi(h,Dn(h),u)}),cp=Ks(function(u,h,S,z){Qi(h,Dn(h),u,z)}),WO=Ks(function(u,h,S,z){Qi(h,Jr(h),u,z)}),ZO=Oa(Nh);function h_(u,h){var S=nu(u);return h==null?S:B1(S,h)}i(h_,"create2"),o(h_,"create");var JO=Ht(function(u,h){u=_r(u);var S=-1,z=h.length,te=z>2?h[2]:r;for(te&&wn(h[0],h[1],te)&&(z=1);++S<z;)for(var ce=h[S],ye=Dn(ce),Ee=-1,xe=ye.length;++Ee<xe;){var Ue=ye[Ee],Fe=u[Ue];(Fe===r||Fi(Fe,eu[Ue])&&!yr.call(u,Ue))&&(u[Ue]=ce[Ue])}return u}),YO=Ht(function(u){return u.push(r,yg),jn(x_,r,u)});function p_(u,h){return _1(u,Et(h,3),Xi)}i(p_,"findKey"),o(p_,"findKey");function m_(u,h){return _1(u,Et(h,3),Ph)}i(m_,"findLastKey"),o(m_,"findLastKey");function g_(u,h){return u==null?u:j1(u,Et(h,3),Dn)}i(g_,"forIn"),o(g_,"forIn");function v_(u,h){return u==null?u:xw(u,Et(h,3),Dn)}i(v_,"forInRight"),o(v_,"forInRight");function y_(u,h){return u&&Xi(u,Et(h,3))}i(y_,"forOwn"),o(y_,"forOwn");function b_(u,h){return u&&Ph(u,Et(h,3))}i(b_,"forOwnRight"),o(b_,"forOwnRight");function w_(u){return u==null?[]:cf(u,Jr(u))}i(w_,"functions"),o(w_,"functions");function __(u){return u==null?[]:cf(u,Dn(u))}i(__,"functionsIn"),o(__,"functionsIn");function up(u,h,S){var z=u==null?r:Go(u,h);return z===r?S:z}i(up,"get2"),o(up,"get");function E_(u,h){return u!=null&&Eg(u,h,Tw)}i(E_,"has"),o(E_,"has");function lp(u,h){return u!=null&&Eg(u,h,Cw)}i(lp,"hasIn"),o(lp,"hasIn");var XO=hg(function(u,h,S){h!=null&&typeof h.toString!="function"&&(h=Ah.call(h)),u[h]=S},fp(On)),QO=hg(function(u,h,S){h!=null&&typeof h.toString!="function"&&(h=Ah.call(h)),yr.call(u,h)?u[h].push(S):u[h]=[S]},Et),eR=Ht(ou);function Jr(u){return kn(u)?N1(u):Fh(u)}i(Jr,"keys"),o(Jr,"keys");function Dn(u){return kn(u)?N1(u,!0):Lw(u)}i(Dn,"keysIn"),o(Dn,"keysIn");function A_(u,h){var S={};return h=Et(h,3),Xi(u,function(z,te,ce){ka(S,h(z,te,ce),z)}),S}i(A_,"mapKeys"),o(A_,"mapKeys");function S_(u,h){var S={};return h=Et(h,3),Xi(u,function(z,te,ce){ka(S,te,h(z,te,ce))}),S}i(S_,"mapValues"),o(S_,"mapValues");var tR=Ks(function(u,h,S){uf(u,h,S)}),x_=Ks(function(u,h,S,z){uf(u,h,S,z)}),rR=Oa(function(u,h){var S={};if(u==null)return S;var z=!1;h=Mr(h,function(ce){return ce=fo(ce,u),z||(z=ce.length>1),ce}),Qi(u,Qh(u),S),z&&(S=si(S,v|y|_,n5));for(var te=h.length;te--;)Vh(S,h[te]);return S});function T_(u,h){return ev(u,Sf(Et(h)))}i(T_,"omitBy"),o(T_,"omitBy");var nR=Oa(function(u,h){return u==null?{}:Fw(u,h)});function ev(u,h){if(u==null)return{};var S=Mr(Qh(u),function(z){return[z]});return h=Et(h),J1(u,S,function(z,te){return h(z,te[0])})}i(ev,"pickBy"),o(ev,"pickBy");function C_(u,h,S){h=fo(h,u);var z=-1,te=h.length;for(te||(te=1,u=r);++z<te;){var ce=u==null?r:u[ea(h[z])];ce===r&&(z=te,ce=S),u=Na(ce)?ce.call(u):ce}return u}i(C_,"result"),o(C_,"result");function M_(u,h,S){return u==null?u:cu(u,h,S)}i(M_,"set"),o(M_,"set");function I_(u,h,S,z){return z=typeof z=="function"?z:r,u==null?u:cu(u,h,S,z)}i(I_,"setWith"),o(I_,"setWith");var k_=gg(Jr),D_=gg(Dn);function O_(u,h,S){var z=Bt(u),te=z||Jo(u)||du(u);if(h=Et(h,4),S==null){var ce=u&&u.constructor;te?S=z?new ce:[]:kr(u)?S=Na(ce)?nu(Th(u)):{}:S={}}return(te?ai:Xi)(u,function(ye,Ee,xe){return h(S,ye,Ee,xe)}),S}i(O_,"transform"),o(O_,"transform");function R_(u,h){return u==null?!0:Vh(u,h)}i(R_,"unset"),o(R_,"unset");function N_(u,h,S){return u==null?u:eg(u,h,Wh(S))}i(N_,"update2"),o(N_,"update");function P_(u,h,S,z){return z=typeof z=="function"?z:r,u==null?u:eg(u,h,Wh(S),z)}i(P_,"updateWith"),o(P_,"updateWith");function Js(u){return u==null?[]:yh(u,Jr(u))}i(Js,"values"),o(Js,"values");function B_(u){return u==null?[]:yh(u,Dn(u))}i(B_,"valuesIn"),o(B_,"valuesIn");function L_(u,h,S){return S===r&&(S=h,h=r),S!==r&&(S=li(S),S=S===S?S:0),h!==r&&(h=li(h),h=h===h?h:0),Vo(li(u),h,S)}i(L_,"clamp"),o(L_,"clamp");function U_(u,h,S){return h=Pa(h),S===r?(S=h,h=0):S=Pa(S),u=li(u),Mw(u,h,S)}i(U_,"inRange"),o(U_,"inRange");function F_(u,h,S){if(S&&typeof S!="boolean"&&wn(u,h,S)&&(h=S=r),S===r&&(typeof h=="boolean"?(S=h,h=r):typeof u=="boolean"&&(S=u,u=r)),u===r&&h===r?(u=0,h=1):(u=Pa(u),h===r?(h=u,u=0):h=Pa(h)),u>h){var z=u;u=h,h=z}if(S||u%1||h%1){var te=q3();return vn(u+te*(h-u+Kr("1e-"+((te+"").length-1))),h)}return zh(u,h)}i(F_,"random"),o(F_,"random");var iR=Gs(function(u,h,S){return h=h.toLowerCase(),u+(S?tv(h):h)});function tv(u){return nv(dr(u).toLowerCase())}i(tv,"capitalize"),o(tv,"capitalize");function rv(u){return u=dr(u),u&&u.replace(Nr,LD).replace(ch,"")}i(rv,"deburr"),o(rv,"deburr");function j_(u,h,S){u=dr(u),h=zn(h);var z=u.length;S=S===r?z:Vo(Ft(S),0,z);var te=S;return S-=h.length,S>=0&&u.slice(S,te)==h}i(j_,"endsWith"),o(j_,"endsWith");function $_(u){return u=dr(u),u&&ft.test(u)?u.replace(Rr,UD):u}i($_,"escape"),o($_,"escape");function z_(u){return u=dr(u),u&&st.test(u)?u.replace(Qt,"\\$&"):u}i(z_,"escapeRegExp"),o(z_,"escapeRegExp");var aR=Gs(function(u,h,S){return u+(S?"-":"")+h.toLowerCase()}),oR=Gs(function(u,h,S){return u+(S?" ":"")+h.toLowerCase()}),sR=lg("toLowerCase");function H_(u,h,S){u=dr(u),h=Ft(h);var z=h?qs(u):0;if(!h||z>=h)return u;var te=(h-z)/2;return mf(kh(te),S)+u+mf(Ih(te),S)}i(H_,"pad2"),o(H_,"pad");function q_(u,h,S){u=dr(u),h=Ft(h);var z=h?qs(u):0;return h&&z<h?u+mf(h-z,S):u}i(q_,"padEnd"),o(q_,"padEnd");function V_(u,h,S){u=dr(u),h=Ft(h);var z=h?qs(u):0;return h&&z<h?mf(h-z,S)+u:u}i(V_,"padStart"),o(V_,"padStart");function K_(u,h,S){return S||h==null?h=0:h&&(h=+h),eO(dr(u).replace(rt,""),h||0)}i(K_,"parseInt2"),o(K_,"parseInt");function G_(u,h,S){return(S?wn(u,h,S):h===r)?h=1:h=Ft(h),Hh(dr(u),h)}i(G_,"repeat"),o(G_,"repeat");function W_(){var u=arguments,h=dr(u[0]);return u.length<3?h:h.replace(u[1],u[2])}i(W_,"replace"),o(W_,"replace");var cR=Gs(function(u,h,S){return u+(S?"_":"")+h.toLowerCase()});function Z_(u,h,S){return S&&typeof S!="number"&&wn(u,h,S)&&(h=S=r),S=S===r?A:S>>>0,S?(u=dr(u),u&&(typeof h=="string"||h!=null&&!Jg(h))&&(h=zn(h),!h&&Hs(u))?ho(Bi(u),0,S):u.split(h,S)):[]}i(Z_,"split"),o(Z_,"split");var uR=Gs(function(u,h,S){return u+(S?" ":"")+nv(h)});function J_(u,h,S){return u=dr(u),S=S==null?0:Vo(Ft(S),0,u.length),h=zn(h),u.slice(S,S+h.length)==h}i(J_,"startsWith"),o(J_,"startsWith");function Y_(u,h,S){var z=se.templateSettings;S&&wn(u,h,S)&&(h=r),u=dr(u),h=cp({},h,z,vg);var te=cp({},h.imports,z.imports,vg),ce=Jr(te),ye=yh(te,ce),Ee,xe,Ue=0,Fe=h.interpolate||Vr,$e="__p += '",Ye=k1((h.escape||Vr).source+"|"+Fe.source+"|"+(Fe===at?xt:Vr).source+"|"+(h.evaluate||Vr).source+"|$","g"),gt="//# sourceURL="+(yr.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yc+"]")+`
|
|
27
27
|
`;u.replace(Ye,function(At,Kt,Zt,qn,_n,Vn){return Zt||(Zt=qn),$e+=u.slice(Ue,Vn).replace(on,M3),Kt&&(Ee=!0,$e+=`' +
|
|
28
28
|
__e(`+Kt+`) +
|
|
29
29
|
'`),_n&&(xe=!0,$e+=`';
|
|
@@ -40,7 +40,7 @@ __p += '`),Zt&&($e+=`' +
|
|
|
40
40
|
function print() { __p += __j.call(arguments, '') }
|
|
41
41
|
`:`;
|
|
42
42
|
`)+$e+`return __p
|
|
43
|
-
}`;var $t=a8(function(){return fr(ce,gt+"return "+$e).apply(r,ye)});if($t.source=$e,sp($t))throw $t;return $t}i(Y_,"template"),o(Y_,"template");function X_(u){return dr(u).toLowerCase()}i(X_,"toLower"),o(X_,"toLower");function Q_(u){return dr(u).toUpperCase()}i(Q_,"toUpper"),o(Q_,"toUpper");function e8(u,h,S){if(u=dr(u),u&&(S||h===r))return x1(u);if(!u||!(h=zn(h)))return u;var $=Bi(u),te=Bi(h),ce=T1($,te),ye=C1($,te)+1;return ho($,ce,ye).join("")}i(e8,"trim"),o(e8,"trim");function t8(u,h,S){if(u=dr(u),u&&(S||h===r))return u.slice(0,I1(u)+1);if(!u||!(h=zn(h)))return u;var $=Bi(u),te=C1($,Bi(h))+1;return ho($,0,te).join("")}i(t8,"trimEnd"),o(t8,"trimEnd");function r8(u,h,S){if(u=dr(u),u&&(S||h===r))return u.replace(rt,"");if(!u||!(h=zn(h)))return u;var $=Bi(u),te=T1($,Bi(h));return ho($,te).join("")}i(r8,"trimStart"),o(r8,"trimStart");function n8(u,h){var S=me,$=we;if(kr(h)){var te="separator"in h?h.separator:te;S="length"in h?Ft(h.length):S,$="omission"in h?zn(h.omission):$}u=dr(u);var ce=u.length;if(Hs(u)){var ye=Bi(u);ce=ye.length}if(S>=ce)return u;var Ee=S-qs($);if(Ee<1)return $;var xe=ye?ho(ye,0,Ee).join(""):u.slice(0,Ee);if(te===r)return xe+$;if(ye&&(Ee+=xe.length-Ee),Jg(te)){if(u.slice(Ee).search(te)){var Ue,Fe=xe;for(te.global||(te=k1(te.source,dr(yt.exec(te))+"g")),te.lastIndex=0;Ue=te.exec(Fe);)var $e=Ue.index;xe=xe.slice(0,$e===r?Ee:$e)}}else if(u.indexOf(zn(te),Ee)!=Ee){var Ye=xe.lastIndexOf(te);Ye>-1&&(xe=xe.slice(0,Ye))}return xe+$}i(n8,"truncate"),o(n8,"truncate");function i8(u){return u=dr(u),u&<.test(u)?u.replace(vt,FD):u}i(i8,"unescape"),o(i8,"unescape");var lR=Gs(function(u,h,S){return u+(S?" ":"")+h.toUpperCase()}),nv=lg("toUpperCase");function iv(u,h,S){return u=dr(u),h=S?r:h,h===r?k3(u)?L3(u):A3(u):u.match(h)||[]}i(iv,"words"),o(iv,"words");var a8=Ht(function(u,h){try{return jn(u,r,h)}catch(S){return sp(S)?S:new Nt(S)}}),fR=Oa(function(u,h){return ai(h,function(S){S=ea(S),ka(u,S,Hg(u[S],u))}),u});function o8(u){var h=u==null?0:u.length,S=Et();return u=h?Mr(u,function($){if(typeof $[1]!="function")throw new Li(c);return[S($[0]),$[1]]}):[],Ht(function($){for(var te=-1;++te<h;){var ce=u[te];if(jn(ce[0],this,$))return jn(ce[1],this,$)}})}i(o8,"cond"),o(o8,"cond");function s8(u){return _w(si(u,v))}i(s8,"conforms"),o(s8,"conforms");function fp(u){return function(){return u}}i(fp,"constant"),o(fp,"constant");function c8(u,h){return u==null||u!==u?h:u}i(c8,"defaultTo"),o(c8,"defaultTo");var dR=dg(),hR=dg(!0);function On(u){return u}i(On,"identity4"),o(On,"identity");function dp(u){return q1(typeof u=="function"?u:si(u,v))}i(dp,"iteratee"),o(dp,"iteratee");function u8(u){return K1(si(u,v))}i(u8,"matches"),o(u8,"matches");function l8(u,h){return G1(u,si(h,v))}i(l8,"matchesProperty"),o(l8,"matchesProperty");var pR=Ht(function(u,h){return function(S){return ou(S,u,h)}}),mR=Ht(function(u,h){return function(S){return ou(u,S,h)}});function hp(u,h,S){var $=Jr(h),te=cf(h,$);S==null&&!(kr(h)&&(te.length||!$.length))&&(S=h,h=u,u=this,te=cf(h,Jr(h)));var ce=!(kr(S)&&"chain"in S)||!!S.chain,ye=Na(u);return ai(te,function(Ee){var xe=h[Ee];u[Ee]=xe,ye&&(u.prototype[Ee]=function(){var Ue=this.__chain__;if(ce||Ue){var Fe=u(this.__wrapped__),$e=Fe.__actions__=In(this.__actions__);return $e.push({func:xe,args:arguments,thisArg:u}),Fe.__chain__=Ue,Fe}return xe.apply(u,co([this.value()],arguments))})}),u}i(hp,"mixin"),o(hp,"mixin");function f8(){return Fr._===this&&(Fr._=VD),this}i(f8,"noConflict"),o(f8,"noConflict");function pp(){}i(pp,"noop2"),o(pp,"noop");function d8(u){return u=Ft(u),Ht(function(h){return W1(h,u)})}i(d8,"nthArg"),o(d8,"nthArg");var gR=Jh(Mr),vR=Jh(w1),yR=Jh(hh);function av(u){return tp(u)?ph(ea(u)):jw(u)}i(av,"property"),o(av,"property");function h8(u){return function(h){return u==null?r:Go(u,h)}}i(h8,"propertyOf"),o(h8,"propertyOf");var bR=pg(),wR=pg(!0);function mp(){return[]}i(mp,"stubArray"),o(mp,"stubArray");function gp(){return!1}i(gp,"stubFalse"),o(gp,"stubFalse");function p8(){return{}}i(p8,"stubObject"),o(p8,"stubObject");function m8(){return""}i(m8,"stubString"),o(m8,"stubString");function g8(){return!0}i(g8,"stubTrue"),o(g8,"stubTrue");function v8(u,h){if(u=Ft(u),u<1||u>E)return[];var S=A,$=vn(u,A);h=Et(h),u-=A;for(var te=vh($,h);++S<u;)h(S);return te}i(v8,"times"),o(v8,"times");function y8(u){return Bt(u)?Mr(u,ea):Hn(u)?[u]:In(E5(dr(u)))}i(y8,"toPath"),o(y8,"toPath");function b8(u){var h=++HD;return dr(u)+h}i(b8,"uniqueId"),o(b8,"uniqueId");var _R=pf(function(u,h){return u+h},0),ER=Yh("ceil"),AR=pf(function(u,h){return u/h},1),SR=Yh("floor");function w8(u){return u&&u.length?sf(u,On,Bh):r}i(w8,"max"),o(w8,"max");function _8(u,h){return u&&u.length?sf(u,Et(h,2),Bh):r}i(_8,"maxBy"),o(_8,"maxBy");function E8(u){return A1(u,On)}i(E8,"mean"),o(E8,"mean");function A8(u,h){return A1(u,Et(h,2))}i(A8,"meanBy"),o(A8,"meanBy");function S8(u){return u&&u.length?sf(u,On,jh):r}i(S8,"min"),o(S8,"min");function x8(u,h){return u&&u.length?sf(u,Et(h,2),jh):r}i(x8,"minBy"),o(x8,"minBy");var xR=pf(function(u,h){return u*h},1),TR=Yh("round"),CR=pf(function(u,h){return u-h},0);function T8(u){return u&&u.length?gh(u,On):0}i(T8,"sum"),o(T8,"sum");function C8(u,h){return u&&u.length?gh(u,Et(h,2)):0}return i(C8,"sumBy"),o(C8,"sumBy"),se.after=D4,se.ary=$g,se.assign=GO,se.assignIn=d_,se.assignInWith=cp,se.assignWith=WO,se.at=ZO,se.before=zg,se.bind=Hg,se.bindAll=fR,se.bindKey=O4,se.castArray=$4,se.chain=Ug,se.chunk=S5,se.compact=x5,se.concat=T5,se.cond=o8,se.conforms=s8,se.constant=fp,se.countBy=IO,se.create=h_,se.curry=qg,se.curryRight=Vg,se.debounce=Kg,se.defaults=JO,se.defaultsDeep=YO,se.defer=LO,se.delay=UO,se.difference=fO,se.differenceBy=dO,se.differenceWith=hO,se.drop=C5,se.dropRight=M5,se.dropRightWhile=I5,se.dropWhile=k5,se.fill=D5,se.filter=v4,se.flatMap=y4,se.flatMapDeep=b4,se.flatMapDepth=w4,se.flatten=Ng,se.flattenDeep=O5,se.flattenDepth=R5,se.flip=R4,se.flow=dR,se.flowRight=hR,se.fromPairs=N5,se.functions=w_,se.functionsIn=__,se.groupBy=OO,se.initial=B5,se.intersection=pO,se.intersectionBy=mO,se.intersectionWith=gO,se.invert=XO,se.invertBy=QO,se.invokeMap=RO,se.iteratee=dp,se.keyBy=NO,se.keys=Jr,se.keysIn=Dn,se.map=Ef,se.mapKeys=A_,se.mapValues=S_,se.matches=u8,se.matchesProperty=l8,se.memoize=Af,se.merge=tR,se.mergeWith=x_,se.method=pR,se.methodOf=mR,se.mixin=hp,se.negate=Sf,se.nthArg=d8,se.omit=rR,se.omitBy=T_,se.once=N4,se.orderBy=E4,se.over=gR,se.overArgs=FO,se.overEvery=vR,se.overSome=yR,se.partial=Gg,se.partialRight=P4,se.partition=PO,se.pick=nR,se.pickBy=ev,se.property=av,se.propertyOf=h8,se.pull=vO,se.pullAll=Bg,se.pullAllBy=j5,se.pullAllWith=$5,se.pullAt=yO,se.range=bR,se.rangeRight=wR,se.rearg=jO,se.reject=x4,se.remove=z5,se.rest=B4,se.reverse=ip,se.sampleSize=C4,se.set=M_,se.setWith=I_,se.shuffle=M4,se.slice=H5,se.sortBy=BO,se.sortedUniq=J5,se.sortedUniqBy=Y5,se.split=Z_,se.spread=L4,se.tail=X5,se.take=Q5,se.takeRight=e4,se.takeRightWhile=t4,se.takeWhile=r4,se.tap=c4,se.throttle=U4,se.thru=_f,se.toArray=Yg,se.toPairs=k_,se.toPairsIn=D_,se.toPath=y8,se.toPlainObject=Qg,se.transform=O_,se.unary=F4,se.union=bO,se.unionBy=wO,se.unionWith=_O,se.uniq=n4,se.uniqBy=i4,se.uniqWith=a4,se.unset=R_,se.unzip=ap,se.unzipWith=Lg,se.update=N_,se.updateWith=P_,se.values=Js,se.valuesIn=B_,se.without=EO,se.words=iv,se.wrap=j4,se.xor=AO,se.xorBy=SO,se.xorWith=xO,se.zip=TO,se.zipObject=o4,se.zipObjectDeep=s4,se.zipWith=CO,se.entries=k_,se.entriesIn=D_,se.extend=d_,se.extendWith=cp,hp(se,se),se.add=_R,se.attempt=a8,se.camelCase=iR,se.capitalize=tv,se.ceil=ER,se.clamp=L_,se.clone=z4,se.cloneDeep=q4,se.cloneDeepWith=V4,se.cloneWith=H4,se.conformsTo=K4,se.deburr=rv,se.defaultTo=c8,se.divide=AR,se.endsWith=j_,se.eq=Fi,se.escape=$_,se.escapeRegExp=z_,se.every=g4,se.find=kO,se.findIndex=Og,se.findKey=p_,se.findLast=DO,se.findLastIndex=Rg,se.findLastKey=m_,se.floor=SR,se.forEach=Fg,se.forEachRight=jg,se.forIn=g_,se.forInRight=v_,se.forOwn=y_,se.forOwnRight=b_,se.get=up,se.gt=$O,se.gte=zO,se.has=E_,se.hasIn=lp,se.head=Pg,se.identity=On,se.includes=_4,se.indexOf=P5,se.inRange=U_,se.invoke=eR,se.isArguments=Zs,se.isArray=Bt,se.isArrayBuffer=HO,se.isArrayLike=kn,se.isArrayLikeObject=Pr,se.isBoolean=G4,se.isBuffer=Jo,se.isDate=qO,se.isElement=W4,se.isEmpty=Z4,se.isEqual=J4,se.isEqualWith=Y4,se.isError=sp,se.isFinite=X4,se.isFunction=Na,se.isInteger=Wg,se.isLength=xf,se.isMap=Q4,se.isMatch=e_,se.isMatchWith=t_,se.isNaN=r_,se.isNative=n_,se.isNil=a_,se.isNull=i_,se.isNumber=Zg,se.isObject=kr,se.isObjectLike=Dr,se.isPlainObject=fu,se.isRegExp=Jg,se.isSafeInteger=o_,se.isSet=s_,se.isString=Tf,se.isSymbol=Hn,se.isTypedArray=du,se.isUndefined=c_,se.isWeakMap=u_,se.isWeakSet=l_,se.join=L5,se.kebabCase=aR,se.last=ui,se.lastIndexOf=U5,se.lowerCase=oR,se.lowerFirst=sR,se.lt=VO,se.lte=KO,se.max=w8,se.maxBy=_8,se.mean=E8,se.meanBy=A8,se.min=S8,se.minBy=x8,se.stubArray=mp,se.stubFalse=gp,se.stubObject=p8,se.stubString=m8,se.stubTrue=g8,se.multiply=xR,se.nth=F5,se.noConflict=f8,se.noop=pp,se.now=op,se.pad=H_,se.padEnd=q_,se.padStart=V_,se.parseInt=K_,se.random=F_,se.reduce=A4,se.reduceRight=S4,se.repeat=G_,se.replace=W_,se.result=C_,se.round=TR,se.runInContext=Se,se.sample=T4,se.size=I4,se.snakeCase=cR,se.some=k4,se.sortedIndex=q5,se.sortedIndexBy=V5,se.sortedIndexOf=K5,se.sortedLastIndex=G5,se.sortedLastIndexBy=W5,se.sortedLastIndexOf=Z5,se.startCase=uR,se.startsWith=J_,se.subtract=CR,se.sum=T8,se.sumBy=C8,se.template=Y_,se.times=v8,se.toFinite=Pa,se.toInteger=Ft,se.toLength=Xg,se.toLower=X_,se.toNumber=li,se.toSafeInteger=f_,se.toString=dr,se.toUpper=Q_,se.trim=e8,se.trimEnd=t8,se.trimStart=r8,se.truncate=n8,se.unescape=i8,se.uniqueId=b8,se.upperCase=lR,se.upperFirst=nv,se.each=Fg,se.eachRight=jg,se.first=Pg,hp(se,function(){var u={};return Xi(se,function(h,S){yr.call(se.prototype,S)||(u[S]=h)}),u}(),{chain:!1}),se.VERSION=n,ai(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){se[u].placeholder=se}),ai(["drop","take"],function(u,h){Wt.prototype[u]=function(S){S=S===r?1:Zr(Ft(S),0);var $=this.__filtered__&&!h?new Wt(this):this.clone();return $.__filtered__?$.__takeCount__=vn(S,$.__takeCount__):$.__views__.push({size:vn(S,A),type:u+($.__dir__<0?"Right":"")}),$},Wt.prototype[u+"Right"]=function(S){return this.reverse()[u](S).reverse()}}),ai(["filter","map","takeWhile"],function(u,h){var S=h+1,$=S==T||S==f;Wt.prototype[u]=function(te){var ce=this.clone();return ce.__iteratees__.push({iteratee:Et(te,3),type:S}),ce.__filtered__=ce.__filtered__||$,ce}}),ai(["head","last"],function(u,h){var S="take"+(h?"Right":"");Wt.prototype[u]=function(){return this[S](1).value()[0]}}),ai(["initial","tail"],function(u,h){var S="drop"+(h?"":"Right");Wt.prototype[u]=function(){return this.__filtered__?new Wt(this):this[S](1)}}),Wt.prototype.compact=function(){return this.filter(On)},Wt.prototype.find=function(u){return this.filter(u).head()},Wt.prototype.findLast=function(u){return this.reverse().find(u)},Wt.prototype.invokeMap=Ht(function(u,h){return typeof u=="function"?new Wt(this):this.map(function(S){return ou(S,u,h)})}),Wt.prototype.reject=function(u){return this.filter(Sf(Et(u)))},Wt.prototype.slice=function(u,h){u=Ft(u);var S=this;return S.__filtered__&&(u>0||h<0)?new Wt(S):(u<0?S=S.takeRight(-u):u&&(S=S.drop(u)),h!==r&&(h=Ft(h),S=h<0?S.dropRight(-h):S.take(h-u)),S)},Wt.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Wt.prototype.toArray=function(){return this.take(A)},Xi(Wt.prototype,function(u,h){var S=/^(?:filter|find|map|reject)|While$/.test(h),$=/^(?:head|last)$/.test(h),te=se[$?"take"+(h=="last"?"Right":""):h],ce=$||/^find/.test(h);!te||(se.prototype[h]=function(){var ye=this.__wrapped__,Ee=$?[1]:arguments,xe=ye instanceof Wt,Ue=Ee[0],Fe=xe||Bt(ye),$e=o(function(Kt){var Zt=te.apply(se,co([Kt],Ee));return $&&Ye?Zt[0]:Zt},"interceptor");Fe&&S&&typeof Ue=="function"&&Ue.length!=1&&(xe=Fe=!1);var Ye=this.__chain__,gt=!!this.__actions__.length,Tt=ce&&!Ye,$t=xe&&!gt;if(!ce&&Fe){ye=$t?ye:new Wt(this);var At=u.apply(ye,Ee);return At.__actions__.push({func:_f,args:[$e],thisArg:r}),new oi(At,Ye)}return Tt&&$t?u.apply(this,Ee):(At=this.thru($e),Tt?$?At.value()[0]:At.value():At)})}),ai(["pop","push","shift","sort","splice","unshift"],function(u){var h=wh[u],S=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",$=/^(?:pop|shift)$/.test(u);se.prototype[u]=function(){var te=arguments;if($&&!this.__chain__){var ce=this.value();return h.apply(Bt(ce)?ce:[],te)}return this[S](function(ye){return h.apply(Bt(ye)?ye:[],te)})}}),Xi(Wt.prototype,function(u,h){var S=se[h];if(S){var $=S.name+"";yr.call(ru,$)||(ru[$]=[]),ru[$].push({name:h,func:S})}}),ru[hf(r,P).name]=[{name:"wrapper",func:r}],Wt.prototype.clone=K3,Wt.prototype.reverse=G3,Wt.prototype.value=W3,se.prototype.at=MO,se.prototype.chain=u4,se.prototype.commit=l4,se.prototype.next=f4,se.prototype.plant=h4,se.prototype.reverse=p4,se.prototype.toJSON=se.prototype.valueOf=se.prototype.value=m4,se.prototype.first=se.prototype.head,Ql&&(se.prototype[Ql]=d4),se},"runInContext2"),"runInContext"),$o=jD();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Fr._=$o,define(function(){return $o})):Ca?((Ca.exports=$o)._=$o,Ta._=$o):Fr._=$o}).call(e)}});function Dm(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}i(Dm,"asUint8Array");var Om=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/util/as-uint8array.js"(){o(Dm,"asUint8Array")}});function D6(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Dm(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}i(D6,"allocUnsafe");var O6=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/alloc.js"(){Om(),o(D6,"allocUnsafe")}}),QS={};Sr(QS,{concat:()=>Es});function Es(e,t){t||(t=e.reduce((a,s)=>a+s.length,0));let r=D6(t),n=0;for(let a of e)r.set(a,n),n+=a.length;return Dm(r)}i(Es,"concat");var ex=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/concat.js"(){O6(),Om(),o(Es,"concat")}});function D7(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var a=0;a<e.length;a++){var s=e.charAt(a),c=s.charCodeAt(0);if(r[c]!==255)throw new TypeError(s+" is ambiguous");r[c]=a}var l=e.length,d=e.charAt(0),p=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function v(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var R=0,D=0,P=0,Z=x.length;P!==Z&&x[P]===0;)P++,R++;for(var j=(Z-P)*g+1>>>0,q=new Uint8Array(j);P!==Z;){for(var Q=x[P],Y=0,k=j-1;(Q!==0||Y<D)&&k!==-1;k--,Y++)Q+=256*q[k]>>>0,q[k]=Q%l>>>0,Q=Q/l>>>0;if(Q!==0)throw new Error("Non-zero carry");D=Y,P++}for(var K=j-D;K!==j&&q[K]===0;)K++;for(var he=d.repeat(R);K<j;++K)he+=e.charAt(q[K]);return he}i(v,"encode9"),o(v,"encode");function y(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var R=0;if(x[R]!==" "){for(var D=0,P=0;x[R]===d;)D++,R++;for(var Z=(x.length-R)*p+1>>>0,j=new Uint8Array(Z);x[R];){var q=r[x.charCodeAt(R)];if(q===255)return;for(var Q=0,Y=Z-1;(q!==0||Q<P)&&Y!==-1;Y--,Q++)q+=l*j[Y]>>>0,j[Y]=q%256>>>0,q=q/256>>>0;if(q!==0)throw new Error("Non-zero carry");P=Q,R++}if(x[R]!==" "){for(var k=Z-P;k!==Z&&j[k]===0;)k++;for(var K=new Uint8Array(D+(Z-k)),he=D;k!==Z;)K[he++]=j[k++];return K}}}i(y,"decodeUnsafe"),o(y,"decodeUnsafe");function _(x){var R=y(x);if(R)return R;throw new Error(`Non-${t} character`)}return i(_,"decode9"),o(_,"decode"),{encode:v,decodeUnsafe:y,decode:_}}i(D7,"base");var O7,R7,tx,Yj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/base-x.js"(){o(D7,"base"),O7=D7,R7=O7,tx=R7}}),Xj,rx,$d,nx,ix,$c=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bytes.js"(){Xj=new Uint8Array(0),rx=o((e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},"equals"),$d=o(e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),nx=o(e=>new TextEncoder().encode(e),"fromString"),ix=o(e=>new TextDecoder().decode(e),"toString")}}),nb,ib,ab,ob,sb,md,Qu,N7,P7,tn,Za=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base.js"(){Yj(),$c(),nb=i(class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},"Encoder"),o(nb,"Encoder"),ib=i(class{constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ob(this,e)}},"Decoder"),o(ib,"Decoder"),ab=i(class{constructor(e){this.decoders=e}or(e){return ob(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},"ComposedDecoder"),o(ab,"ComposedDecoder"),ob=o((e,t)=>new ab({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),"or"),sb=i(class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new nb(e,t,r),this.decoder=new ib(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},"Codec"),o(sb,"Codec"),md=o(({name:e,prefix:t,encode:r,decode:n})=>new sb(e,t,r,n),"from"),Qu=o(({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:a}=tx(r,t);return md({prefix:e,name:t,encode:n,decode:s=>$d(a(s))})},"baseX"),N7=o((e,t,r,n)=>{let a={};for(let g=0;g<t.length;++g)a[t[g]]=g;let s=e.length;for(;e[s-1]==="=";)--s;let c=new Uint8Array(s*r/8|0),l=0,d=0,p=0;for(let g=0;g<s;++g){let v=a[e[g]];if(v===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<r|v,l+=r,l>=8&&(l-=8,c[p++]=255&d>>l)}if(l>=r||255&d<<8-l)throw new SyntaxError("Unexpected end of data");return c},"decode"),P7=o((e,t,r)=>{let n=t[t.length-1]==="=",a=(1<<r)-1,s="",c=0,l=0;for(let d=0;d<e.length;++d)for(l=l<<8|e[d],c+=8;c>r;)c-=r,s+=t[a&l>>c];if(c&&(s+=t[a&l<<r-c]),n)for(;s.length*r&7;)s+="=";return s},"encode"),tn=o(({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>md({prefix:t,name:e,encode(a){return P7(a,n,r)},decode(a){return N7(a,n,r,e)}}),"rfc4648")}}),ax={};Sr(ax,{identity:()=>ox});var ox,Qj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/identity.js"(){Za(),$c(),ox=md({prefix:"\0",name:"identity",encode:e=>ix(e),decode:e=>nx(e)})}}),sx={};Sr(sx,{base2:()=>cx});var cx,e$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base2.js"(){Za(),cx=tn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}}),ux={};Sr(ux,{base8:()=>lx});var lx,t$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base8.js"(){Za(),lx=tn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}}),fx={};Sr(fx,{base10:()=>dx});var dx,r$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base10.js"(){Za(),dx=Qu({prefix:"9",name:"base10",alphabet:"0123456789"})}}),hx={};Sr(hx,{base16:()=>px,base16upper:()=>mx});var px,mx,n$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base16.js"(){Za(),px=tn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),mx=tn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})}}),gx={};Sr(gx,{base32:()=>Wu,base32hex:()=>wx,base32hexpad:()=>Ex,base32hexpadupper:()=>Ax,base32hexupper:()=>_x,base32pad:()=>yx,base32padupper:()=>bx,base32upper:()=>vx,base32z:()=>Sx});var Wu,vx,yx,bx,wx,_x,Ex,Ax,Sx,xx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base32.js"(){Za(),Wu=tn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),vx=tn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yx=tn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),bx=tn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),wx=tn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),_x=tn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ex=tn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ax=tn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Sx=tn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}}),Tx={};Sr(Tx,{base36:()=>Os,base36upper:()=>Cx});var Os,Cx,zd=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base36.js"(){Za(),Os=Qu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Cx=Qu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}}),Mx={};Sr(Mx,{base58btc:()=>ha,base58flickr:()=>Ix});var ha,Ix,R6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base58.js"(){Za(),ha=Qu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ix=Qu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})}}),kx={};Sr(kx,{base64:()=>Dx,base64pad:()=>Ox,base64url:()=>el,base64urlpad:()=>Rx});var Dx,Ox,el,Rx,N6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base64.js"(){Za(),Dx=tn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ox=tn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),el=tn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Rx=tn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})}}),Nx={};Sr(Nx,{base256emoji:()=>Lx});function B7(e){return e.reduce((t,r)=>(t+=Px[r],t),"")}i(B7,"encode2");function L7(e){let t=[];for(let r of e){let n=Bx[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}i(L7,"decode2");var cb,Px,Bx,Lx,i$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base256emoji.js"(){Za(),cb=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Px=cb.reduce((e,t,r)=>(e[r]=t,e),[]),Bx=cb.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),o(B7,"encode"),o(L7,"decode"),Lx=md({prefix:"\u{1F680}",name:"base256emoji",encode:B7,decode:L7})}});function Db(e,t,r){t=t||[],r=r||0;for(var n=r;e>=Fx;)t[r++]=e&255|Ob,e/=128;for(;e&Ux;)t[r++]=e&255|Ob,e>>>=7;return t[r]=e|0,Db.bytes=r-n+1,t}i(Db,"encode3");function nm(e,n){var r=0,n=n||0,a=0,s=n,c,l=e.length;do{if(s>=l)throw nm.bytes=0,new RangeError("Could not decode varint");c=e[s++],r+=a<28?(c&Rb)<<a:(c&Rb)*Math.pow(2,a),a+=7}while(c>=jx);return nm.bytes=s-n,r}i(nm,"read");var U7,Ob,F7,Ux,Fx,j7,jx,Rb,$7,z7,H7,q7,V7,K7,G7,W7,Z7,J7,Y7,X7,ud,a$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/varint.js"(){U7=Db,Ob=128,F7=127,Ux=~F7,Fx=Math.pow(2,31),o(Db,"encode"),j7=nm,jx=128,Rb=127,o(nm,"read"),$7=Math.pow(2,7),z7=Math.pow(2,14),H7=Math.pow(2,21),q7=Math.pow(2,28),V7=Math.pow(2,35),K7=Math.pow(2,42),G7=Math.pow(2,49),W7=Math.pow(2,56),Z7=Math.pow(2,63),J7=o(function(e){return e<$7?1:e<z7?2:e<H7?3:e<q7?4:e<V7?5:e<K7?6:e<G7?7:e<W7?8:e<Z7?9:10},"length"),Y7={encode:U7,decode:j7,encodingLength:J7},X7=Y7,ud=X7}}),im,yd,bd,P6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/varint.js"(){a$(),im=o((e,t=0)=>[ud.decode(e,t),ud.decode.bytes],"decode"),yd=o((e,t,r=0)=>(ud.encode(e,t,r),t),"encodeTo"),bd=o(e=>ud.encodingLength(e),"encodingLength")}}),tl,B6,$x,ld,bl=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/digest.js"(){$c(),P6(),tl=o((e,t)=>{let r=t.byteLength,n=bd(e),a=n+bd(r),s=new Uint8Array(a+r);return yd(e,s,0),yd(r,s,n),s.set(t,a),new ld(e,r,t,s)},"create"),B6=o(e=>{let t=$d(e),[r,n]=im(t),[a,s]=im(t.subarray(n)),c=t.subarray(n+s);if(c.byteLength!==a)throw new Error("Incorrect length");return new ld(r,a,c,t)},"decode"),$x=o((e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&rx(e.bytes,t.bytes),"equals"),ld=i(class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},"Digest"),o(ld,"Digest")}}),Nb,ub,zx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/hasher.js"(){bl(),Nb=o(({name:e,code:t,encode:r})=>new ub(e,t,r),"from"),ub=i(class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?tl(this.code,t):t.then(r=>tl(this.code,r))}else throw Error("Unknown type, must be binary type")}},"Hasher"),o(ub,"Hasher")}}),Hx={};Sr(Hx,{sha256:()=>wl,sha512:()=>qx});var lb,wl,qx,Rm=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/sha2-browser.js"(){zx(),lb=o(e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),"sha"),wl=Nb({name:"sha2-256",code:18,encode:lb("SHA-256")}),qx=Nb({name:"sha2-512",code:19,encode:lb("SHA-512")})}}),Vx={};Sr(Vx,{identity:()=>Nm});var fb,Q7,db,eS,Nm,Kx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/identity.js"(){$c(),bl(),fb=0,Q7="identity",db=$d,eS=o(e=>tl(fb,db(e)),"digest"),Nm={code:fb,name:Q7,encode:db,digest:eS}}}),o$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/raw.js"(){$c()}}),s$,c$,u$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/json.js"(){s$=new TextEncoder,c$=new TextDecoder}}),Vt,tS,rS,nS,qu,iS,hb,pb,nd,id,aS,oS,sS,Ja=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/cid.js"(){P6(),bl(),R6(),xx(),$c(),Vt=i(class{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:id,byteLength:id,code:nd,version:nd,multihash:nd,bytes:nd,_baseCache:id,asCID:id})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==qu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==iS)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Vt.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=tl(e,t);return Vt.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&$x(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:n}=this;switch(r){case 0:return rS(t,n,e||ha.encoder);default:return nS(t,n,e||Wu.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return oS(/^0\.0/,sS),!!(e&&(e[pb]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof Vt)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:a}=e;return new Vt(t,r,n,a||hb(t,r,n.bytes))}else if(e!=null&&e[pb]===!0){let{version:t,multihash:r,code:n}=e,a=B6(r);return Vt.create(t,n,a)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==qu)throw new Error(`Version 0 CID must use dag-pb (code: ${qu}) block encoding`);return new Vt(e,t,r,r.bytes)}case 1:{let n=hb(e,t,r.bytes);return new Vt(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return Vt.create(0,qu,e)}static createV1(e,t){return Vt.create(1,e,t)}static decode(e){let[t,r]=Vt.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Vt.inspectBytes(e),r=t.size-t.multihashSize,n=$d(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");let a=n.subarray(t.multihashSize-t.digestSize),s=new ld(t.multihashCode,t.digestSize,a,n);return[t.version===0?Vt.createV0(s):Vt.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=o(()=>{let[g,v]=im(e.subarray(t));return t+=v,g},"next"),n=r(),a=qu;if(n===18?(n=0,t=0):n===1&&(a=r()),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let s=t,c=r(),l=r(),d=t+l,p=d-s;return{version:n,codec:a,multihashCode:c,digestSize:l,multihashSize:p,size:d}}static parse(e,t){let[r,n]=tS(e,t),a=Vt.decode(n);return a._baseCache.set(r,e),a}},"CID"),o(Vt,"CID"),tS=o((e,t)=>{switch(e[0]){case"Q":{let r=t||ha;return[ha.prefix,r.decode(`${ha.prefix}${e}`)]}case ha.prefix:{let r=t||ha;return[ha.prefix,r.decode(e)]}case Wu.prefix:{let r=t||Wu;return[Wu.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},"parseCIDtoBytes"),rS=o((e,t,r)=>{let{prefix:n}=r;if(n!==ha.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let a=t.get(n);if(a==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return a},"toStringV0"),nS=o((e,t,r)=>{let{prefix:n}=r,a=t.get(n);if(a==null){let s=r.encode(e);return t.set(n,s),s}else return a},"toStringV1"),qu=112,iS=18,hb=o((e,t,r)=>{let n=bd(e),a=n+bd(t),s=new Uint8Array(a+r.byteLength);return yd(e,s,0),yd(t,s,n),s.set(r,a),s},"encodeCID"),pb=Symbol.for("@ipld/js-cid/CID"),nd={writable:!1,configurable:!1,enumerable:!0},id={writable:!1,enumerable:!1,configurable:!1},aS="0.0.0-dev",oS=o((e,t)=>{if(e.test(aS))console.warn(t);else throw new Error(t)},"deprecate"),sS=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
43
|
+
}`;var $t=a8(function(){return fr(ce,gt+"return "+$e).apply(r,ye)});if($t.source=$e,sp($t))throw $t;return $t}i(Y_,"template"),o(Y_,"template");function X_(u){return dr(u).toLowerCase()}i(X_,"toLower"),o(X_,"toLower");function Q_(u){return dr(u).toUpperCase()}i(Q_,"toUpper"),o(Q_,"toUpper");function e8(u,h,S){if(u=dr(u),u&&(S||h===r))return x1(u);if(!u||!(h=zn(h)))return u;var z=Bi(u),te=Bi(h),ce=T1(z,te),ye=C1(z,te)+1;return ho(z,ce,ye).join("")}i(e8,"trim"),o(e8,"trim");function t8(u,h,S){if(u=dr(u),u&&(S||h===r))return u.slice(0,I1(u)+1);if(!u||!(h=zn(h)))return u;var z=Bi(u),te=C1(z,Bi(h))+1;return ho(z,0,te).join("")}i(t8,"trimEnd"),o(t8,"trimEnd");function r8(u,h,S){if(u=dr(u),u&&(S||h===r))return u.replace(rt,"");if(!u||!(h=zn(h)))return u;var z=Bi(u),te=T1(z,Bi(h));return ho(z,te).join("")}i(r8,"trimStart"),o(r8,"trimStart");function n8(u,h){var S=me,z=we;if(kr(h)){var te="separator"in h?h.separator:te;S="length"in h?Ft(h.length):S,z="omission"in h?zn(h.omission):z}u=dr(u);var ce=u.length;if(Hs(u)){var ye=Bi(u);ce=ye.length}if(S>=ce)return u;var Ee=S-qs(z);if(Ee<1)return z;var xe=ye?ho(ye,0,Ee).join(""):u.slice(0,Ee);if(te===r)return xe+z;if(ye&&(Ee+=xe.length-Ee),Jg(te)){if(u.slice(Ee).search(te)){var Ue,Fe=xe;for(te.global||(te=k1(te.source,dr(yt.exec(te))+"g")),te.lastIndex=0;Ue=te.exec(Fe);)var $e=Ue.index;xe=xe.slice(0,$e===r?Ee:$e)}}else if(u.indexOf(zn(te),Ee)!=Ee){var Ye=xe.lastIndexOf(te);Ye>-1&&(xe=xe.slice(0,Ye))}return xe+z}i(n8,"truncate"),o(n8,"truncate");function i8(u){return u=dr(u),u&<.test(u)?u.replace(vt,FD):u}i(i8,"unescape"),o(i8,"unescape");var lR=Gs(function(u,h,S){return u+(S?" ":"")+h.toUpperCase()}),nv=lg("toUpperCase");function iv(u,h,S){return u=dr(u),h=S?r:h,h===r?k3(u)?L3(u):A3(u):u.match(h)||[]}i(iv,"words"),o(iv,"words");var a8=Ht(function(u,h){try{return jn(u,r,h)}catch(S){return sp(S)?S:new Nt(S)}}),fR=Oa(function(u,h){return ai(h,function(S){S=ea(S),ka(u,S,Hg(u[S],u))}),u});function o8(u){var h=u==null?0:u.length,S=Et();return u=h?Mr(u,function(z){if(typeof z[1]!="function")throw new Li(c);return[S(z[0]),z[1]]}):[],Ht(function(z){for(var te=-1;++te<h;){var ce=u[te];if(jn(ce[0],this,z))return jn(ce[1],this,z)}})}i(o8,"cond"),o(o8,"cond");function s8(u){return _w(si(u,v))}i(s8,"conforms"),o(s8,"conforms");function fp(u){return function(){return u}}i(fp,"constant"),o(fp,"constant");function c8(u,h){return u==null||u!==u?h:u}i(c8,"defaultTo"),o(c8,"defaultTo");var dR=dg(),hR=dg(!0);function On(u){return u}i(On,"identity4"),o(On,"identity");function dp(u){return q1(typeof u=="function"?u:si(u,v))}i(dp,"iteratee"),o(dp,"iteratee");function u8(u){return K1(si(u,v))}i(u8,"matches"),o(u8,"matches");function l8(u,h){return G1(u,si(h,v))}i(l8,"matchesProperty"),o(l8,"matchesProperty");var pR=Ht(function(u,h){return function(S){return ou(S,u,h)}}),mR=Ht(function(u,h){return function(S){return ou(u,S,h)}});function hp(u,h,S){var z=Jr(h),te=cf(h,z);S==null&&!(kr(h)&&(te.length||!z.length))&&(S=h,h=u,u=this,te=cf(h,Jr(h)));var ce=!(kr(S)&&"chain"in S)||!!S.chain,ye=Na(u);return ai(te,function(Ee){var xe=h[Ee];u[Ee]=xe,ye&&(u.prototype[Ee]=function(){var Ue=this.__chain__;if(ce||Ue){var Fe=u(this.__wrapped__),$e=Fe.__actions__=In(this.__actions__);return $e.push({func:xe,args:arguments,thisArg:u}),Fe.__chain__=Ue,Fe}return xe.apply(u,co([this.value()],arguments))})}),u}i(hp,"mixin"),o(hp,"mixin");function f8(){return Fr._===this&&(Fr._=VD),this}i(f8,"noConflict"),o(f8,"noConflict");function pp(){}i(pp,"noop2"),o(pp,"noop");function d8(u){return u=Ft(u),Ht(function(h){return W1(h,u)})}i(d8,"nthArg"),o(d8,"nthArg");var gR=Jh(Mr),vR=Jh(w1),yR=Jh(hh);function av(u){return tp(u)?ph(ea(u)):jw(u)}i(av,"property"),o(av,"property");function h8(u){return function(h){return u==null?r:Go(u,h)}}i(h8,"propertyOf"),o(h8,"propertyOf");var bR=pg(),wR=pg(!0);function mp(){return[]}i(mp,"stubArray"),o(mp,"stubArray");function gp(){return!1}i(gp,"stubFalse"),o(gp,"stubFalse");function p8(){return{}}i(p8,"stubObject"),o(p8,"stubObject");function m8(){return""}i(m8,"stubString"),o(m8,"stubString");function g8(){return!0}i(g8,"stubTrue"),o(g8,"stubTrue");function v8(u,h){if(u=Ft(u),u<1||u>E)return[];var S=A,z=vn(u,A);h=Et(h),u-=A;for(var te=vh(z,h);++S<u;)h(S);return te}i(v8,"times"),o(v8,"times");function y8(u){return Bt(u)?Mr(u,ea):Hn(u)?[u]:In(E5(dr(u)))}i(y8,"toPath"),o(y8,"toPath");function b8(u){var h=++HD;return dr(u)+h}i(b8,"uniqueId"),o(b8,"uniqueId");var _R=pf(function(u,h){return u+h},0),ER=Yh("ceil"),AR=pf(function(u,h){return u/h},1),SR=Yh("floor");function w8(u){return u&&u.length?sf(u,On,Bh):r}i(w8,"max"),o(w8,"max");function _8(u,h){return u&&u.length?sf(u,Et(h,2),Bh):r}i(_8,"maxBy"),o(_8,"maxBy");function E8(u){return A1(u,On)}i(E8,"mean"),o(E8,"mean");function A8(u,h){return A1(u,Et(h,2))}i(A8,"meanBy"),o(A8,"meanBy");function S8(u){return u&&u.length?sf(u,On,jh):r}i(S8,"min"),o(S8,"min");function x8(u,h){return u&&u.length?sf(u,Et(h,2),jh):r}i(x8,"minBy"),o(x8,"minBy");var xR=pf(function(u,h){return u*h},1),TR=Yh("round"),CR=pf(function(u,h){return u-h},0);function T8(u){return u&&u.length?gh(u,On):0}i(T8,"sum"),o(T8,"sum");function C8(u,h){return u&&u.length?gh(u,Et(h,2)):0}return i(C8,"sumBy"),o(C8,"sumBy"),se.after=D4,se.ary=$g,se.assign=GO,se.assignIn=d_,se.assignInWith=cp,se.assignWith=WO,se.at=ZO,se.before=zg,se.bind=Hg,se.bindAll=fR,se.bindKey=O4,se.castArray=$4,se.chain=Ug,se.chunk=S5,se.compact=x5,se.concat=T5,se.cond=o8,se.conforms=s8,se.constant=fp,se.countBy=IO,se.create=h_,se.curry=qg,se.curryRight=Vg,se.debounce=Kg,se.defaults=JO,se.defaultsDeep=YO,se.defer=LO,se.delay=UO,se.difference=fO,se.differenceBy=dO,se.differenceWith=hO,se.drop=C5,se.dropRight=M5,se.dropRightWhile=I5,se.dropWhile=k5,se.fill=D5,se.filter=v4,se.flatMap=y4,se.flatMapDeep=b4,se.flatMapDepth=w4,se.flatten=Ng,se.flattenDeep=O5,se.flattenDepth=R5,se.flip=R4,se.flow=dR,se.flowRight=hR,se.fromPairs=N5,se.functions=w_,se.functionsIn=__,se.groupBy=OO,se.initial=B5,se.intersection=pO,se.intersectionBy=mO,se.intersectionWith=gO,se.invert=XO,se.invertBy=QO,se.invokeMap=RO,se.iteratee=dp,se.keyBy=NO,se.keys=Jr,se.keysIn=Dn,se.map=Ef,se.mapKeys=A_,se.mapValues=S_,se.matches=u8,se.matchesProperty=l8,se.memoize=Af,se.merge=tR,se.mergeWith=x_,se.method=pR,se.methodOf=mR,se.mixin=hp,se.negate=Sf,se.nthArg=d8,se.omit=rR,se.omitBy=T_,se.once=N4,se.orderBy=E4,se.over=gR,se.overArgs=FO,se.overEvery=vR,se.overSome=yR,se.partial=Gg,se.partialRight=P4,se.partition=PO,se.pick=nR,se.pickBy=ev,se.property=av,se.propertyOf=h8,se.pull=vO,se.pullAll=Bg,se.pullAllBy=j5,se.pullAllWith=$5,se.pullAt=yO,se.range=bR,se.rangeRight=wR,se.rearg=jO,se.reject=x4,se.remove=z5,se.rest=B4,se.reverse=ip,se.sampleSize=C4,se.set=M_,se.setWith=I_,se.shuffle=M4,se.slice=H5,se.sortBy=BO,se.sortedUniq=J5,se.sortedUniqBy=Y5,se.split=Z_,se.spread=L4,se.tail=X5,se.take=Q5,se.takeRight=e4,se.takeRightWhile=t4,se.takeWhile=r4,se.tap=c4,se.throttle=U4,se.thru=_f,se.toArray=Yg,se.toPairs=k_,se.toPairsIn=D_,se.toPath=y8,se.toPlainObject=Qg,se.transform=O_,se.unary=F4,se.union=bO,se.unionBy=wO,se.unionWith=_O,se.uniq=n4,se.uniqBy=i4,se.uniqWith=a4,se.unset=R_,se.unzip=ap,se.unzipWith=Lg,se.update=N_,se.updateWith=P_,se.values=Js,se.valuesIn=B_,se.without=EO,se.words=iv,se.wrap=j4,se.xor=AO,se.xorBy=SO,se.xorWith=xO,se.zip=TO,se.zipObject=o4,se.zipObjectDeep=s4,se.zipWith=CO,se.entries=k_,se.entriesIn=D_,se.extend=d_,se.extendWith=cp,hp(se,se),se.add=_R,se.attempt=a8,se.camelCase=iR,se.capitalize=tv,se.ceil=ER,se.clamp=L_,se.clone=z4,se.cloneDeep=q4,se.cloneDeepWith=V4,se.cloneWith=H4,se.conformsTo=K4,se.deburr=rv,se.defaultTo=c8,se.divide=AR,se.endsWith=j_,se.eq=Fi,se.escape=$_,se.escapeRegExp=z_,se.every=g4,se.find=kO,se.findIndex=Og,se.findKey=p_,se.findLast=DO,se.findLastIndex=Rg,se.findLastKey=m_,se.floor=SR,se.forEach=Fg,se.forEachRight=jg,se.forIn=g_,se.forInRight=v_,se.forOwn=y_,se.forOwnRight=b_,se.get=up,se.gt=$O,se.gte=zO,se.has=E_,se.hasIn=lp,se.head=Pg,se.identity=On,se.includes=_4,se.indexOf=P5,se.inRange=U_,se.invoke=eR,se.isArguments=Zs,se.isArray=Bt,se.isArrayBuffer=HO,se.isArrayLike=kn,se.isArrayLikeObject=Pr,se.isBoolean=G4,se.isBuffer=Jo,se.isDate=qO,se.isElement=W4,se.isEmpty=Z4,se.isEqual=J4,se.isEqualWith=Y4,se.isError=sp,se.isFinite=X4,se.isFunction=Na,se.isInteger=Wg,se.isLength=xf,se.isMap=Q4,se.isMatch=e_,se.isMatchWith=t_,se.isNaN=r_,se.isNative=n_,se.isNil=a_,se.isNull=i_,se.isNumber=Zg,se.isObject=kr,se.isObjectLike=Dr,se.isPlainObject=fu,se.isRegExp=Jg,se.isSafeInteger=o_,se.isSet=s_,se.isString=Tf,se.isSymbol=Hn,se.isTypedArray=du,se.isUndefined=c_,se.isWeakMap=u_,se.isWeakSet=l_,se.join=L5,se.kebabCase=aR,se.last=ui,se.lastIndexOf=U5,se.lowerCase=oR,se.lowerFirst=sR,se.lt=VO,se.lte=KO,se.max=w8,se.maxBy=_8,se.mean=E8,se.meanBy=A8,se.min=S8,se.minBy=x8,se.stubArray=mp,se.stubFalse=gp,se.stubObject=p8,se.stubString=m8,se.stubTrue=g8,se.multiply=xR,se.nth=F5,se.noConflict=f8,se.noop=pp,se.now=op,se.pad=H_,se.padEnd=q_,se.padStart=V_,se.parseInt=K_,se.random=F_,se.reduce=A4,se.reduceRight=S4,se.repeat=G_,se.replace=W_,se.result=C_,se.round=TR,se.runInContext=Se,se.sample=T4,se.size=I4,se.snakeCase=cR,se.some=k4,se.sortedIndex=q5,se.sortedIndexBy=V5,se.sortedIndexOf=K5,se.sortedLastIndex=G5,se.sortedLastIndexBy=W5,se.sortedLastIndexOf=Z5,se.startCase=uR,se.startsWith=J_,se.subtract=CR,se.sum=T8,se.sumBy=C8,se.template=Y_,se.times=v8,se.toFinite=Pa,se.toInteger=Ft,se.toLength=Xg,se.toLower=X_,se.toNumber=li,se.toSafeInteger=f_,se.toString=dr,se.toUpper=Q_,se.trim=e8,se.trimEnd=t8,se.trimStart=r8,se.truncate=n8,se.unescape=i8,se.uniqueId=b8,se.upperCase=lR,se.upperFirst=nv,se.each=Fg,se.eachRight=jg,se.first=Pg,hp(se,function(){var u={};return Xi(se,function(h,S){yr.call(se.prototype,S)||(u[S]=h)}),u}(),{chain:!1}),se.VERSION=n,ai(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){se[u].placeholder=se}),ai(["drop","take"],function(u,h){Wt.prototype[u]=function(S){S=S===r?1:Zr(Ft(S),0);var z=this.__filtered__&&!h?new Wt(this):this.clone();return z.__filtered__?z.__takeCount__=vn(S,z.__takeCount__):z.__views__.push({size:vn(S,A),type:u+(z.__dir__<0?"Right":"")}),z},Wt.prototype[u+"Right"]=function(S){return this.reverse()[u](S).reverse()}}),ai(["filter","map","takeWhile"],function(u,h){var S=h+1,z=S==T||S==f;Wt.prototype[u]=function(te){var ce=this.clone();return ce.__iteratees__.push({iteratee:Et(te,3),type:S}),ce.__filtered__=ce.__filtered__||z,ce}}),ai(["head","last"],function(u,h){var S="take"+(h?"Right":"");Wt.prototype[u]=function(){return this[S](1).value()[0]}}),ai(["initial","tail"],function(u,h){var S="drop"+(h?"":"Right");Wt.prototype[u]=function(){return this.__filtered__?new Wt(this):this[S](1)}}),Wt.prototype.compact=function(){return this.filter(On)},Wt.prototype.find=function(u){return this.filter(u).head()},Wt.prototype.findLast=function(u){return this.reverse().find(u)},Wt.prototype.invokeMap=Ht(function(u,h){return typeof u=="function"?new Wt(this):this.map(function(S){return ou(S,u,h)})}),Wt.prototype.reject=function(u){return this.filter(Sf(Et(u)))},Wt.prototype.slice=function(u,h){u=Ft(u);var S=this;return S.__filtered__&&(u>0||h<0)?new Wt(S):(u<0?S=S.takeRight(-u):u&&(S=S.drop(u)),h!==r&&(h=Ft(h),S=h<0?S.dropRight(-h):S.take(h-u)),S)},Wt.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Wt.prototype.toArray=function(){return this.take(A)},Xi(Wt.prototype,function(u,h){var S=/^(?:filter|find|map|reject)|While$/.test(h),z=/^(?:head|last)$/.test(h),te=se[z?"take"+(h=="last"?"Right":""):h],ce=z||/^find/.test(h);!te||(se.prototype[h]=function(){var ye=this.__wrapped__,Ee=z?[1]:arguments,xe=ye instanceof Wt,Ue=Ee[0],Fe=xe||Bt(ye),$e=o(function(Kt){var Zt=te.apply(se,co([Kt],Ee));return z&&Ye?Zt[0]:Zt},"interceptor");Fe&&S&&typeof Ue=="function"&&Ue.length!=1&&(xe=Fe=!1);var Ye=this.__chain__,gt=!!this.__actions__.length,Tt=ce&&!Ye,$t=xe&&!gt;if(!ce&&Fe){ye=$t?ye:new Wt(this);var At=u.apply(ye,Ee);return At.__actions__.push({func:_f,args:[$e],thisArg:r}),new oi(At,Ye)}return Tt&&$t?u.apply(this,Ee):(At=this.thru($e),Tt?z?At.value()[0]:At.value():At)})}),ai(["pop","push","shift","sort","splice","unshift"],function(u){var h=wh[u],S=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",z=/^(?:pop|shift)$/.test(u);se.prototype[u]=function(){var te=arguments;if(z&&!this.__chain__){var ce=this.value();return h.apply(Bt(ce)?ce:[],te)}return this[S](function(ye){return h.apply(Bt(ye)?ye:[],te)})}}),Xi(Wt.prototype,function(u,h){var S=se[h];if(S){var z=S.name+"";yr.call(ru,z)||(ru[z]=[]),ru[z].push({name:h,func:S})}}),ru[hf(r,P).name]=[{name:"wrapper",func:r}],Wt.prototype.clone=K3,Wt.prototype.reverse=G3,Wt.prototype.value=W3,se.prototype.at=MO,se.prototype.chain=u4,se.prototype.commit=l4,se.prototype.next=f4,se.prototype.plant=h4,se.prototype.reverse=p4,se.prototype.toJSON=se.prototype.valueOf=se.prototype.value=m4,se.prototype.first=se.prototype.head,Ql&&(se.prototype[Ql]=d4),se},"runInContext2"),"runInContext"),$o=jD();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Fr._=$o,define(function(){return $o})):Ca?((Ca.exports=$o)._=$o,Ta._=$o):Fr._=$o}).call(e)}});function Dm(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}i(Dm,"asUint8Array");var Om=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/util/as-uint8array.js"(){o(Dm,"asUint8Array")}});function D6(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Dm(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}i(D6,"allocUnsafe");var O6=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/alloc.js"(){Om(),o(D6,"allocUnsafe")}}),QS={};Sr(QS,{concat:()=>Es});function Es(e,t){t||(t=e.reduce((a,s)=>a+s.length,0));let r=D6(t),n=0;for(let a of e)r.set(a,n),n+=a.length;return Dm(r)}i(Es,"concat");var ex=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/concat.js"(){O6(),Om(),o(Es,"concat")}});function D7(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var a=0;a<e.length;a++){var s=e.charAt(a),c=s.charCodeAt(0);if(r[c]!==255)throw new TypeError(s+" is ambiguous");r[c]=a}var l=e.length,d=e.charAt(0),p=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function v(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var R=0,D=0,P=0,Z=x.length;P!==Z&&x[P]===0;)P++,R++;for(var j=(Z-P)*g+1>>>0,q=new Uint8Array(j);P!==Z;){for(var Q=x[P],Y=0,k=j-1;(Q!==0||Y<D)&&k!==-1;k--,Y++)Q+=256*q[k]>>>0,q[k]=Q%l>>>0,Q=Q/l>>>0;if(Q!==0)throw new Error("Non-zero carry");D=Y,P++}for(var K=j-D;K!==j&&q[K]===0;)K++;for(var he=d.repeat(R);K<j;++K)he+=e.charAt(q[K]);return he}i(v,"encode9"),o(v,"encode");function y(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var R=0;if(x[R]!==" "){for(var D=0,P=0;x[R]===d;)D++,R++;for(var Z=(x.length-R)*p+1>>>0,j=new Uint8Array(Z);x[R];){var q=r[x.charCodeAt(R)];if(q===255)return;for(var Q=0,Y=Z-1;(q!==0||Q<P)&&Y!==-1;Y--,Q++)q+=l*j[Y]>>>0,j[Y]=q%256>>>0,q=q/256>>>0;if(q!==0)throw new Error("Non-zero carry");P=Q,R++}if(x[R]!==" "){for(var k=Z-P;k!==Z&&j[k]===0;)k++;for(var K=new Uint8Array(D+(Z-k)),he=D;k!==Z;)K[he++]=j[k++];return K}}}i(y,"decodeUnsafe"),o(y,"decodeUnsafe");function _(x){var R=y(x);if(R)return R;throw new Error(`Non-${t} character`)}return i(_,"decode9"),o(_,"decode"),{encode:v,decodeUnsafe:y,decode:_}}i(D7,"base");var O7,R7,tx,Yj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/base-x.js"(){o(D7,"base"),O7=D7,R7=O7,tx=R7}}),Xj,rx,$d,nx,ix,$c=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bytes.js"(){Xj=new Uint8Array(0),rx=o((e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},"equals"),$d=o(e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),nx=o(e=>new TextEncoder().encode(e),"fromString"),ix=o(e=>new TextDecoder().decode(e),"toString")}}),nb,ib,ab,ob,sb,md,Qu,N7,P7,tn,Za=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base.js"(){Yj(),$c(),nb=i(class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},"Encoder"),o(nb,"Encoder"),ib=i(class{constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ob(this,e)}},"Decoder"),o(ib,"Decoder"),ab=i(class{constructor(e){this.decoders=e}or(e){return ob(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},"ComposedDecoder"),o(ab,"ComposedDecoder"),ob=o((e,t)=>new ab({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),"or"),sb=i(class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new nb(e,t,r),this.decoder=new ib(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},"Codec"),o(sb,"Codec"),md=o(({name:e,prefix:t,encode:r,decode:n})=>new sb(e,t,r,n),"from"),Qu=o(({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:a}=tx(r,t);return md({prefix:e,name:t,encode:n,decode:s=>$d(a(s))})},"baseX"),N7=o((e,t,r,n)=>{let a={};for(let g=0;g<t.length;++g)a[t[g]]=g;let s=e.length;for(;e[s-1]==="=";)--s;let c=new Uint8Array(s*r/8|0),l=0,d=0,p=0;for(let g=0;g<s;++g){let v=a[e[g]];if(v===void 0)throw new SyntaxError(`Non-${n} character`);d=d<<r|v,l+=r,l>=8&&(l-=8,c[p++]=255&d>>l)}if(l>=r||255&d<<8-l)throw new SyntaxError("Unexpected end of data");return c},"decode"),P7=o((e,t,r)=>{let n=t[t.length-1]==="=",a=(1<<r)-1,s="",c=0,l=0;for(let d=0;d<e.length;++d)for(l=l<<8|e[d],c+=8;c>r;)c-=r,s+=t[a&l>>c];if(c&&(s+=t[a&l<<r-c]),n)for(;s.length*r&7;)s+="=";return s},"encode"),tn=o(({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>md({prefix:t,name:e,encode(a){return P7(a,n,r)},decode(a){return N7(a,n,r,e)}}),"rfc4648")}}),ax={};Sr(ax,{identity:()=>ox});var ox,Qj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/identity.js"(){Za(),$c(),ox=md({prefix:"\0",name:"identity",encode:e=>ix(e),decode:e=>nx(e)})}}),sx={};Sr(sx,{base2:()=>cx});var cx,e$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base2.js"(){Za(),cx=tn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}}),ux={};Sr(ux,{base8:()=>lx});var lx,t$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base8.js"(){Za(),lx=tn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}}),fx={};Sr(fx,{base10:()=>dx});var dx,r$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base10.js"(){Za(),dx=Qu({prefix:"9",name:"base10",alphabet:"0123456789"})}}),hx={};Sr(hx,{base16:()=>px,base16upper:()=>mx});var px,mx,n$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base16.js"(){Za(),px=tn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),mx=tn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})}}),gx={};Sr(gx,{base32:()=>Wu,base32hex:()=>wx,base32hexpad:()=>Ex,base32hexpadupper:()=>Ax,base32hexupper:()=>_x,base32pad:()=>yx,base32padupper:()=>bx,base32upper:()=>vx,base32z:()=>Sx});var Wu,vx,yx,bx,wx,_x,Ex,Ax,Sx,xx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base32.js"(){Za(),Wu=tn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),vx=tn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),yx=tn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),bx=tn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),wx=tn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),_x=tn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ex=tn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ax=tn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Sx=tn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}}),Tx={};Sr(Tx,{base36:()=>Os,base36upper:()=>Cx});var Os,Cx,zd=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base36.js"(){Za(),Os=Qu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Cx=Qu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}}),Mx={};Sr(Mx,{base58btc:()=>ha,base58flickr:()=>Ix});var ha,Ix,R6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base58.js"(){Za(),ha=Qu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ix=Qu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})}}),kx={};Sr(kx,{base64:()=>Dx,base64pad:()=>Ox,base64url:()=>el,base64urlpad:()=>Rx});var Dx,Ox,el,Rx,N6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base64.js"(){Za(),Dx=tn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ox=tn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),el=tn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Rx=tn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})}}),Nx={};Sr(Nx,{base256emoji:()=>Lx});function B7(e){return e.reduce((t,r)=>(t+=Px[r],t),"")}i(B7,"encode2");function L7(e){let t=[];for(let r of e){let n=Bx[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}i(L7,"decode2");var cb,Px,Bx,Lx,i$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base256emoji.js"(){Za(),cb=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Px=cb.reduce((e,t,r)=>(e[r]=t,e),[]),Bx=cb.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),o(B7,"encode"),o(L7,"decode"),Lx=md({prefix:"\u{1F680}",name:"base256emoji",encode:B7,decode:L7})}});function Db(e,t,r){t=t||[],r=r||0;for(var n=r;e>=Fx;)t[r++]=e&255|Ob,e/=128;for(;e&Ux;)t[r++]=e&255|Ob,e>>>=7;return t[r]=e|0,Db.bytes=r-n+1,t}i(Db,"encode3");function nm(e,n){var r=0,n=n||0,a=0,s=n,c,l=e.length;do{if(s>=l)throw nm.bytes=0,new RangeError("Could not decode varint");c=e[s++],r+=a<28?(c&Rb)<<a:(c&Rb)*Math.pow(2,a),a+=7}while(c>=jx);return nm.bytes=s-n,r}i(nm,"read");var U7,Ob,F7,Ux,Fx,j7,jx,Rb,$7,z7,H7,q7,V7,K7,G7,W7,Z7,J7,Y7,X7,ud,a$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/varint.js"(){U7=Db,Ob=128,F7=127,Ux=~F7,Fx=Math.pow(2,31),o(Db,"encode"),j7=nm,jx=128,Rb=127,o(nm,"read"),$7=Math.pow(2,7),z7=Math.pow(2,14),H7=Math.pow(2,21),q7=Math.pow(2,28),V7=Math.pow(2,35),K7=Math.pow(2,42),G7=Math.pow(2,49),W7=Math.pow(2,56),Z7=Math.pow(2,63),J7=o(function(e){return e<$7?1:e<z7?2:e<H7?3:e<q7?4:e<V7?5:e<K7?6:e<G7?7:e<W7?8:e<Z7?9:10},"length"),Y7={encode:U7,decode:j7,encodingLength:J7},X7=Y7,ud=X7}}),im,yd,bd,P6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/varint.js"(){a$(),im=o((e,t=0)=>[ud.decode(e,t),ud.decode.bytes],"decode"),yd=o((e,t,r=0)=>(ud.encode(e,t,r),t),"encodeTo"),bd=o(e=>ud.encodingLength(e),"encodingLength")}}),tl,B6,$x,ld,bl=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/digest.js"(){$c(),P6(),tl=o((e,t)=>{let r=t.byteLength,n=bd(e),a=n+bd(r),s=new Uint8Array(a+r);return yd(e,s,0),yd(r,s,n),s.set(t,a),new ld(e,r,t,s)},"create"),B6=o(e=>{let t=$d(e),[r,n]=im(t),[a,s]=im(t.subarray(n)),c=t.subarray(n+s);if(c.byteLength!==a)throw new Error("Incorrect length");return new ld(r,a,c,t)},"decode"),$x=o((e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&rx(e.bytes,t.bytes),"equals"),ld=i(class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},"Digest"),o(ld,"Digest")}}),Nb,ub,zx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/hasher.js"(){bl(),Nb=o(({name:e,code:t,encode:r})=>new ub(e,t,r),"from"),ub=i(class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?tl(this.code,t):t.then(r=>tl(this.code,r))}else throw Error("Unknown type, must be binary type")}},"Hasher"),o(ub,"Hasher")}}),Hx={};Sr(Hx,{sha256:()=>wl,sha512:()=>qx});var lb,wl,qx,Rm=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/sha2-browser.js"(){zx(),lb=o(e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),"sha"),wl=Nb({name:"sha2-256",code:18,encode:lb("SHA-256")}),qx=Nb({name:"sha2-512",code:19,encode:lb("SHA-512")})}}),Vx={};Sr(Vx,{identity:()=>Nm});var fb,Q7,db,eS,Nm,Kx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/identity.js"(){$c(),bl(),fb=0,Q7="identity",db=$d,eS=o(e=>tl(fb,db(e)),"digest"),Nm={code:fb,name:Q7,encode:db,digest:eS}}}),o$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/raw.js"(){$c()}}),s$,c$,u$=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/json.js"(){s$=new TextEncoder,c$=new TextDecoder}}),Vt,tS,rS,nS,qu,iS,hb,pb,nd,id,aS,oS,sS,Ja=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/cid.js"(){P6(),bl(),R6(),xx(),$c(),Vt=i(class{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:id,byteLength:id,code:nd,version:nd,multihash:nd,bytes:nd,_baseCache:id,asCID:id})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==qu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==iS)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Vt.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=tl(e,t);return Vt.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&$x(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:n}=this;switch(r){case 0:return rS(t,n,e||ha.encoder);default:return nS(t,n,e||Wu.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return oS(/^0\.0/,sS),!!(e&&(e[pb]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof Vt)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:a}=e;return new Vt(t,r,n,a||hb(t,r,n.bytes))}else if(e!=null&&e[pb]===!0){let{version:t,multihash:r,code:n}=e,a=B6(r);return Vt.create(t,n,a)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==qu)throw new Error(`Version 0 CID must use dag-pb (code: ${qu}) block encoding`);return new Vt(e,t,r,r.bytes)}case 1:{let n=hb(e,t,r.bytes);return new Vt(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return Vt.create(0,qu,e)}static createV1(e,t){return Vt.create(1,e,t)}static decode(e){let[t,r]=Vt.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Vt.inspectBytes(e),r=t.size-t.multihashSize,n=$d(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");let a=n.subarray(t.multihashSize-t.digestSize),s=new ld(t.multihashCode,t.digestSize,a,n);return[t.version===0?Vt.createV0(s):Vt.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=o(()=>{let[g,v]=im(e.subarray(t));return t+=v,g},"next"),n=r(),a=qu;if(n===18?(n=0,t=0):n===1&&(a=r()),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let s=t,c=r(),l=r(),d=t+l,p=d-s;return{version:n,codec:a,multihashCode:c,digestSize:l,multihashSize:p,size:d}}static parse(e,t){let[r,n]=tS(e,t),a=Vt.decode(n);return a._baseCache.set(r,e),a}},"CID"),o(Vt,"CID"),tS=o((e,t)=>{switch(e[0]){case"Q":{let r=t||ha;return[ha.prefix,r.decode(`${ha.prefix}${e}`)]}case ha.prefix:{let r=t||ha;return[ha.prefix,r.decode(e)]}case Wu.prefix:{let r=t||Wu;return[Wu.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},"parseCIDtoBytes"),rS=o((e,t,r)=>{let{prefix:n}=r;if(n!==ha.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let a=t.get(n);if(a==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return a},"toStringV0"),nS=o((e,t,r)=>{let{prefix:n}=r,a=t.get(n);if(a==null){let s=r.encode(e);return t.set(n,s),s}else return a},"toStringV1"),qu=112,iS=18,hb=o((e,t,r)=>{let n=bd(e),a=n+bd(t),s=new Uint8Array(a+r.byteLength);return yd(e,s,0),yd(t,s,n),s.set(r,a),s},"encodeCID"),pb=Symbol.for("@ipld/js-cid/CID"),nd={writable:!1,configurable:!1,enumerable:!0},id={writable:!1,enumerable:!1,configurable:!1},aS="0.0.0-dev",oS=o((e,t)=>{if(e.test(aS))console.warn(t);else throw new Error(t)},"deprecate"),sS=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
44
44
|
Following code pattern:
|
|
45
45
|
|
|
46
46
|
if (CID.isCID(value)) {
|
|
@@ -842,7 +842,7 @@ HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
|
|
|
842
842
|
`;function UM(e){return typeof e=="string"&&(e=q0(e)),t1(MM([q0(OH),q0(String(e.length)),e]))}i(UM,"hashMessage");o(UM,"hashMessage");var Ot=ir(fT()),Co=ir(Lm());function Gc(e,t,r){return r={path:t,exports:{},require:function(n,a){return FM(n,a??r.path)}},e(r,r.exports),r.exports}i(Gc,"createCommonjsModule");o(Gc,"createCommonjsModule");function FM(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}i(FM,"commonjsRequire");o(FM,"commonjsRequire");var y2=b2;function b2(e,t){if(!e)throw new Error(t||"Assertion failed")}i(b2,"assert");o(b2,"assert");b2.equal=o(i(function(t,r,n){if(t!=r)throw new Error(n||"Assertion failed: "+t+" != "+r)},"assertEqual"),"assertEqual");var ga=Gc(function(e,t){"use strict";var r=t;function n(c,l){if(Array.isArray(c))return c.slice();if(!c)return[];var d=[];if(typeof c!="string"){for(var p=0;p<c.length;p++)d[p]=c[p]|0;return d}if(l==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var p=0;p<c.length;p+=2)d.push(parseInt(c[p]+c[p+1],16))}else for(var p=0;p<c.length;p++){var g=c.charCodeAt(p),v=g>>8,y=g&255;v?d.push(v,y):d.push(y)}return d}i(n,"toArray"),o(n,"toArray"),r.toArray=n;function a(c){return c.length===1?"0"+c:c}i(a,"zero2"),o(a,"zero2"),r.zero2=a;function s(c){for(var l="",d=0;d<c.length;d++)l+=a(c[d].toString(16));return l}i(s,"toHex"),o(s,"toHex"),r.toHex=s,r.encode=o(i(function(l,d){return d==="hex"?s(l):l},"encode9"),"encode")}),Ci=Gc(function(e,t){"use strict";var r=t;r.assert=y2,r.toArray=ga.toArray,r.zero2=ga.zero2,r.toHex=ga.toHex,r.encode=ga.encode;function n(d,p,g){var v=new Array(Math.max(d.bitLength(),g)+1),y;for(y=0;y<v.length;y+=1)v[y]=0;var _=1<<p+1,x=d.clone();for(y=0;y<v.length;y++){var R,D=x.andln(_-1);x.isOdd()?(D>(_>>1)-1?R=(_>>1)-D:R=D,x.isubn(R)):R=0,v[y]=R,x.iushrn(1)}return v}i(n,"getNAF2"),o(n,"getNAF"),r.getNAF=n;function a(d,p){var g=[[],[]];d=d.clone(),p=p.clone();for(var v=0,y=0,_;d.cmpn(-v)>0||p.cmpn(-y)>0;){var x=d.andln(3)+v&3,R=p.andln(3)+y&3;x===3&&(x=-1),R===3&&(R=-1);var D;(x&1)===0?D=0:(_=d.andln(7)+v&7,(_===3||_===5)&&R===2?D=-x:D=x),g[0].push(D);var P;(R&1)===0?P=0:(_=p.andln(7)+y&7,(_===3||_===5)&&x===2?P=-R:P=R),g[1].push(P),2*v===D+1&&(v=1-v),2*y===P+1&&(y=1-y),d.iushrn(1),p.iushrn(1)}return g}i(a,"getJSF2"),o(a,"getJSF"),r.getJSF=a;function s(d,p,g){var v="_"+p;d.prototype[p]=o(i(function(){return this[v]!==void 0?this[v]:this[v]=g.call(this)},"cachedProperty2"),"cachedProperty")}i(s,"cachedProperty"),o(s,"cachedProperty"),r.cachedProperty=s;function c(d){return typeof d=="string"?r.toArray(d,"hex"):d}i(c,"parseBytes"),o(c,"parseBytes"),r.parseBytes=c;function l(d){return new Ot.default(d,"hex","le")}i(l,"intFromLE"),o(l,"intFromLE"),r.intFromLE=l}),vm=Ci.getNAF,RH=Ci.getJSF,ym=Ci.assert;function Uo(e,t){this.type=e,this.p=new Ot.default(t.p,16),this.red=t.prime?Ot.default.red(t.prime):Ot.default.mont(this.p),this.zero=new Ot.default(0).toRed(this.red),this.one=new Ot.default(1).toRed(this.red),this.two=new Ot.default(2).toRed(this.red),this.n=t.n&&new Ot.default(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}i(Uo,"BaseCurve");o(Uo,"BaseCurve");var Wc=Uo;Uo.prototype.point=o(i(function(){throw new Error("Not implemented")},"point"),"point");Uo.prototype.validate=o(i(function(){throw new Error("Not implemented")},"validate"),"validate");Uo.prototype._fixedNafMul=o(i(function(t,r){ym(t.precomputed);var n=t._getDoubles(),a=vm(r,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var c=[],l,d;for(l=0;l<a.length;l+=n.step){d=0;for(var p=l+n.step-1;p>=l;p--)d=(d<<1)+a[p];c.push(d)}for(var g=this.jpoint(null,null,null),v=this.jpoint(null,null,null),y=s;y>0;y--){for(l=0;l<c.length;l++)d=c[l],d===y?v=v.mixedAdd(n.points[l]):d===-y&&(v=v.mixedAdd(n.points[l].neg()));g=g.add(v)}return g.toP()},"_fixedNafMul"),"_fixedNafMul");Uo.prototype._wnafMul=o(i(function(t,r){var n=4,a=t._getNAFPoints(n);n=a.wnd;for(var s=a.points,c=vm(r,n,this._bitLength),l=this.jpoint(null,null,null),d=c.length-1;d>=0;d--){for(var p=0;d>=0&&c[d]===0;d--)p++;if(d>=0&&p++,l=l.dblp(p),d<0)break;var g=c[d];ym(g!==0),t.type==="affine"?g>0?l=l.mixedAdd(s[g-1>>1]):l=l.mixedAdd(s[-g-1>>1].neg()):g>0?l=l.add(s[g-1>>1]):l=l.add(s[-g-1>>1].neg())}return t.type==="affine"?l.toP():l},"_wnafMul"),"_wnafMul");Uo.prototype._wnafMulAdd=o(i(function(t,r,n,a,s){var c=this._wnafT1,l=this._wnafT2,d=this._wnafT3,p=0,g,v,y;for(g=0;g<a;g++){y=r[g];var _=y._getNAFPoints(t);c[g]=_.wnd,l[g]=_.points}for(g=a-1;g>=1;g-=2){var x=g-1,R=g;if(c[x]!==1||c[R]!==1){d[x]=vm(n[x],c[x],this._bitLength),d[R]=vm(n[R],c[R],this._bitLength),p=Math.max(d[x].length,p),p=Math.max(d[R].length,p);continue}var D=[r[x],null,null,r[R]];r[x].y.cmp(r[R].y)===0?(D[1]=r[x].add(r[R]),D[2]=r[x].toJ().mixedAdd(r[R].neg())):r[x].y.cmp(r[R].y.redNeg())===0?(D[1]=r[x].toJ().mixedAdd(r[R]),D[2]=r[x].add(r[R].neg())):(D[1]=r[x].toJ().mixedAdd(r[R]),D[2]=r[x].toJ().mixedAdd(r[R].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],Z=RH(n[x],n[R]);for(p=Math.max(Z[0].length,p),d[x]=new Array(p),d[R]=new Array(p),v=0;v<p;v++){var j=Z[0][v]|0,q=Z[1][v]|0;d[x][v]=P[(j+1)*3+(q+1)],d[R][v]=0,l[x]=D}}var Q=this.jpoint(null,null,null),Y=this._wnafT4;for(g=p;g>=0;g--){for(var k=0;g>=0;){var K=!0;for(v=0;v<a;v++)Y[v]=d[v][g]|0,Y[v]!==0&&(K=!1);if(!K)break;k++,g--}if(g>=0&&k++,Q=Q.dblp(k),g<0)break;for(v=0;v<a;v++){var he=Y[v];he!==0&&(he>0?y=l[v][he-1>>1]:he<0&&(y=l[v][-he-1>>1].neg()),y.type==="affine"?Q=Q.mixedAdd(y):Q=Q.add(y))}}for(g=0;g<a;g++)l[g]=null;return s?Q:Q.toP()},"_wnafMulAdd"),"_wnafMulAdd");function Mi(e,t){this.curve=e,this.type=t,this.precomputed=null}i(Mi,"BasePoint");o(Mi,"BasePoint");Uo.BasePoint=Mi;Mi.prototype.eq=o(i(function(){throw new Error("Not implemented")},"eq"),"eq");Mi.prototype.validate=o(i(function(){return this.curve.validate(this)},"validate2"),"validate");Uo.prototype.decodePoint=o(i(function(t,r){t=Ci.toArray(t,r);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?ym(t[t.length-1]%2===0):t[0]===7&&ym(t[t.length-1]%2===1);var a=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return a}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")},"decodePoint"),"decodePoint");Mi.prototype.encodeCompressed=o(i(function(t){return this.encode(t,!0)},"encodeCompressed"),"encodeCompressed");Mi.prototype._encode=o(i(function(t){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))},"_encode"),"_encode");Mi.prototype.encode=o(i(function(t,r){return Ci.encode(this._encode(r),t)},"encode8"),"encode");Mi.prototype.precompute=o(i(function(t){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,t),r.beta=this._getBeta(),this.precomputed=r,this},"precompute"),"precompute");Mi.prototype._hasDoubles=o(i(function(t){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((t.bitLength()+1)/r.step):!1},"_hasDoubles"),"_hasDoubles");Mi.prototype._getDoubles=o(i(function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],a=this,s=0;s<r;s+=t){for(var c=0;c<t;c++)a=a.dbl();n.push(a)}return{step:t,points:n}},"_getDoubles"),"_getDoubles");Mi.prototype._getNAFPoints=o(i(function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<t)-1,a=n===1?null:this.dbl(),s=1;s<n;s++)r[s]=r[s-1].add(a);return{wnd:t,points:r}},"_getNAFPoints"),"_getNAFPoints");Mi.prototype._getBeta=o(i(function(){return null},"_getBeta"),"_getBeta");Mi.prototype.dblp=o(i(function(t){for(var r=this,n=0;n<t;n++)r=r.dbl();return r},"dblp"),"dblp");var w2=Gc(function(e){typeof Object.create=="function"?e.exports=o(i(function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"),"inherits"):e.exports=o(i(function(r,n){if(n){r.super_=n;var a=o(function(){},"TempCtor");a.prototype=n.prototype,r.prototype=new a,r.prototype.constructor=r}},"inherits"),"inherits")}),NH=Ci.assert;function Ii(e){Wc.call(this,"short",e),this.a=new Ot.default(e.a,16).toRed(this.red),this.b=new Ot.default(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}i(Ii,"ShortCurve");o(Ii,"ShortCurve");w2(Ii,Wc);var PH=Ii;Ii.prototype._getEndomorphism=o(i(function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(t.beta)r=new Ot.default(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);r=a[0].cmp(a[1])<0?a[0]:a[1],r=r.toRed(this.red)}if(t.lambda)n=new Ot.default(t.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?n=s[0]:(n=s[1],NH(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var c;return t.basis?c=t.basis.map(function(l){return{a:new Ot.default(l.a,16),b:new Ot.default(l.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism"),"_getEndomorphism");Ii.prototype._getEndoRoots=o(i(function(t){var r=t===this.p?this.red:Ot.default.mont(t),n=new Ot.default(2).toRed(r).redInvm(),a=n.redNeg(),s=new Ot.default(3).toRed(r).redNeg().redSqrt().redMul(n),c=a.redAdd(s).fromRed(),l=a.redSub(s).fromRed();return[c,l]},"_getEndoRoots"),"_getEndoRoots");Ii.prototype._getEndoBasis=o(i(function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,a=this.n.clone(),s=new Ot.default(1),c=new Ot.default(0),l=new Ot.default(0),d=new Ot.default(1),p,g,v,y,_,x,R,D=0,P,Z;n.cmpn(0)!==0;){var j=a.div(n);P=a.sub(j.mul(n)),Z=l.sub(j.mul(s));var q=d.sub(j.mul(c));if(!v&&P.cmp(r)<0)p=R.neg(),g=s,v=P.neg(),y=Z;else if(v&&++D===2)break;R=P,a=n,n=P,l=s,s=Z,d=c,c=q}_=P.neg(),x=Z;var Q=v.sqr().add(y.sqr()),Y=_.sqr().add(x.sqr());return Y.cmp(Q)>=0&&(_=p,x=g),v.negative&&(v=v.neg(),y=y.neg()),_.negative&&(_=_.neg(),x=x.neg()),[{a:v,b:y},{a:_,b:x}]},"_getEndoBasis"),"_getEndoBasis");Ii.prototype._endoSplit=o(i(function(t){var r=this.endo.basis,n=r[0],a=r[1],s=a.b.mul(t).divRound(this.n),c=n.b.neg().mul(t).divRound(this.n),l=s.mul(n.a),d=c.mul(a.a),p=s.mul(n.b),g=c.mul(a.b),v=t.sub(l).sub(d),y=p.add(g).neg();return{k1:v,k2:y}},"_endoSplit"),"_endoSplit");Ii.prototype.pointFromX=o(i(function(t,r){t=new Ot.default(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),a=n.redSqrt();if(a.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=a.fromRed().isOdd();return(r&&!s||!r&&s)&&(a=a.redNeg()),this.point(t,a)},"pointFromX"),"pointFromX");Ii.prototype.validate=o(i(function(t){if(t.inf)return!0;var r=t.x,n=t.y,a=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(a).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate3"),"validate");Ii.prototype._endoWnafMulAdd=o(i(function(t,r,n){for(var a=this._endoWnafT1,s=this._endoWnafT2,c=0;c<t.length;c++){var l=this._endoSplit(r[c]),d=t[c],p=d._getBeta();l.k1.negative&&(l.k1.ineg(),d=d.neg(!0)),l.k2.negative&&(l.k2.ineg(),p=p.neg(!0)),a[c*2]=d,a[c*2+1]=p,s[c*2]=l.k1,s[c*2+1]=l.k2}for(var g=this._wnafMulAdd(1,a,s,c*2,n),v=0;v<c*2;v++)a[v]=null,s[v]=null;return g},"_endoWnafMulAdd"),"_endoWnafMulAdd");function Xr(e,t,r,n){Wc.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ot.default(t,16),this.y=new Ot.default(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}i(Xr,"Point");o(Xr,"Point");w2(Xr,Wc.BasePoint);Ii.prototype.point=o(i(function(t,r,n){return new Xr(this,t,r,n)},"point2"),"point");Ii.prototype.pointFromJSON=o(i(function(t,r){return Xr.fromJSON(this,t,r)},"pointFromJSON"),"pointFromJSON");Xr.prototype._getBeta=o(i(function(){if(!!this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,a=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(a)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(a)}}}return r}},"_getBeta2"),"_getBeta");Xr.prototype.toJSON=o(i(function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},"toJSON"),"toJSON");Xr.fromJSON=o(i(function(t,r,n){typeof r=="string"&&(r=JSON.parse(r));var a=t.point(r[0],r[1],n);if(!r[2])return a;function s(l){return t.point(l[0],l[1],n)}i(s,"obj2point"),o(s,"obj2point");var c=r[2];return a.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[a].concat(c.doubles.points.map(s))},naf:c.naf&&{wnd:c.naf.wnd,points:[a].concat(c.naf.points.map(s))}},a},"fromJSON"),"fromJSON");Xr.prototype.inspect=o(i(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect"),"inspect");Xr.prototype.isInfinity=o(i(function(){return this.inf},"isInfinity"),"isInfinity");Xr.prototype.add=o(i(function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(t.x),a=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,a)},"add"),"add");Xr.prototype.dbl=o(i(function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),a=t.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(a),c=s.redSqr().redISub(this.x.redAdd(this.x)),l=s.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,l)},"dbl"),"dbl");Xr.prototype.getX=o(i(function(){return this.x.fromRed()},"getX"),"getX");Xr.prototype.getY=o(i(function(){return this.y.fromRed()},"getY"),"getY");Xr.prototype.mul=o(i(function(t){return t=new Ot.default(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},"mul"),"mul");Xr.prototype.mulAdd=o(i(function(t,r,n){var a=[this,r],s=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,s):this.curve._wnafMulAdd(1,a,s,2)},"mulAdd"),"mulAdd");Xr.prototype.jmulAdd=o(i(function(t,r,n){var a=[this,r],s=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,s,!0):this.curve._wnafMulAdd(1,a,s,2,!0)},"jmulAdd"),"jmulAdd");Xr.prototype.eq=o(i(function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},"eq2"),"eq");Xr.prototype.neg=o(i(function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,a=o(function(s){return s.neg()},"negate");r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(a)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(a)}}}return r},"neg"),"neg");Xr.prototype.toJ=o(i(function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t},"toJ"),"toJ");function rn(e,t,r,n){Wc.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ot.default(0)):(this.x=new Ot.default(t,16),this.y=new Ot.default(r,16),this.z=new Ot.default(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(rn,"JPoint");o(rn,"JPoint");w2(rn,Wc.BasePoint);Ii.prototype.jpoint=o(i(function(t,r,n){return new rn(this,t,r,n)},"jpoint"),"jpoint");rn.prototype.toP=o(i(function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),n=this.x.redMul(r),a=this.y.redMul(r).redMul(t);return this.curve.point(n,a)},"toP"),"toP");rn.prototype.neg=o(i(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg2"),"neg");rn.prototype.add=o(i(function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),n=this.z.redSqr(),a=this.x.redMul(r),s=t.x.redMul(n),c=this.y.redMul(r.redMul(t.z)),l=t.y.redMul(n.redMul(this.z)),d=a.redSub(s),p=c.redSub(l);if(d.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=d.redSqr(),v=g.redMul(d),y=a.redMul(g),_=p.redSqr().redIAdd(v).redISub(y).redISub(y),x=p.redMul(y.redISub(_)).redISub(c.redMul(v)),R=this.z.redMul(t.z).redMul(d);return this.curve.jpoint(_,x,R)},"add2"),"add");rn.prototype.mixedAdd=o(i(function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),n=this.x,a=t.x.redMul(r),s=this.y,c=t.y.redMul(r).redMul(this.z),l=n.redSub(a),d=s.redSub(c);if(l.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=l.redSqr(),g=p.redMul(l),v=n.redMul(p),y=d.redSqr().redIAdd(g).redISub(v).redISub(v),_=d.redMul(v.redISub(y)).redISub(s.redMul(g)),x=this.z.redMul(l);return this.curve.jpoint(y,_,x)},"mixedAdd"),"mixedAdd");rn.prototype.dblp=o(i(function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<t;r++)n=n.dbl();return n}var a=this.curve.a,s=this.curve.tinv,c=this.x,l=this.y,d=this.z,p=d.redSqr().redSqr(),g=l.redAdd(l);for(r=0;r<t;r++){var v=c.redSqr(),y=g.redSqr(),_=y.redSqr(),x=v.redAdd(v).redIAdd(v).redIAdd(a.redMul(p)),R=c.redMul(y),D=x.redSqr().redISub(R.redAdd(R)),P=R.redISub(D),Z=x.redMul(P);Z=Z.redIAdd(Z).redISub(_);var j=g.redMul(d);r+1<t&&(p=p.redMul(_)),c=D,d=j,g=Z}return this.curve.jpoint(c,g.redMul(s),d)},"dblp2"),"dblp");rn.prototype.dbl=o(i(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl2"),"dbl");rn.prototype._zeroDbl=o(i(function(){var t,r,n;if(this.zOne){var a=this.x.redSqr(),s=this.y.redSqr(),c=s.redSqr(),l=this.x.redAdd(s).redSqr().redISub(a).redISub(c);l=l.redIAdd(l);var d=a.redAdd(a).redIAdd(a),p=d.redSqr().redISub(l).redISub(l),g=c.redIAdd(c);g=g.redIAdd(g),g=g.redIAdd(g),t=p,r=d.redMul(l.redISub(p)).redISub(g),n=this.y.redAdd(this.y)}else{var v=this.x.redSqr(),y=this.y.redSqr(),_=y.redSqr(),x=this.x.redAdd(y).redSqr().redISub(v).redISub(_);x=x.redIAdd(x);var R=v.redAdd(v).redIAdd(v),D=R.redSqr(),P=_.redIAdd(_);P=P.redIAdd(P),P=P.redIAdd(P),t=D.redISub(x).redISub(x),r=R.redMul(x.redISub(t)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,r,n)},"_zeroDbl"),"_zeroDbl");rn.prototype._threeDbl=o(i(function(){var t,r,n;if(this.zOne){var a=this.x.redSqr(),s=this.y.redSqr(),c=s.redSqr(),l=this.x.redAdd(s).redSqr().redISub(a).redISub(c);l=l.redIAdd(l);var d=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),p=d.redSqr().redISub(l).redISub(l);t=p;var g=c.redIAdd(c);g=g.redIAdd(g),g=g.redIAdd(g),r=d.redMul(l.redISub(p)).redISub(g),n=this.y.redAdd(this.y)}else{var v=this.z.redSqr(),y=this.y.redSqr(),_=this.x.redMul(y),x=this.x.redSub(v).redMul(this.x.redAdd(v));x=x.redAdd(x).redIAdd(x);var R=_.redIAdd(_);R=R.redIAdd(R);var D=R.redAdd(R);t=x.redSqr().redISub(D),n=this.y.redAdd(this.z).redSqr().redISub(y).redISub(v);var P=y.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),r=x.redMul(R.redISub(t)).redISub(P)}return this.curve.jpoint(t,r,n)},"_threeDbl"),"_threeDbl");rn.prototype._dbl=o(i(function(){var t=this.curve.a,r=this.x,n=this.y,a=this.z,s=a.redSqr().redSqr(),c=r.redSqr(),l=n.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(t.redMul(s)),p=r.redAdd(r);p=p.redIAdd(p);var g=p.redMul(l),v=d.redSqr().redISub(g.redAdd(g)),y=g.redISub(v),_=l.redSqr();_=_.redIAdd(_),_=_.redIAdd(_),_=_.redIAdd(_);var x=d.redMul(y).redISub(_),R=n.redAdd(n).redMul(a);return this.curve.jpoint(v,x,R)},"_dbl"),"_dbl");rn.prototype.trpl=o(i(function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),a=r.redSqr(),s=t.redAdd(t).redIAdd(t),c=s.redSqr(),l=this.x.redAdd(r).redSqr().redISub(t).redISub(a);l=l.redIAdd(l),l=l.redAdd(l).redIAdd(l),l=l.redISub(c);var d=l.redSqr(),p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var g=s.redIAdd(l).redSqr().redISub(c).redISub(d).redISub(p),v=r.redMul(g);v=v.redIAdd(v),v=v.redIAdd(v);var y=this.x.redMul(d).redISub(v);y=y.redIAdd(y),y=y.redIAdd(y);var _=this.y.redMul(g.redMul(p.redISub(g)).redISub(l.redMul(d)));_=_.redIAdd(_),_=_.redIAdd(_),_=_.redIAdd(_);var x=this.z.redAdd(l).redSqr().redISub(n).redISub(d);return this.curve.jpoint(y,_,x)},"trpl"),"trpl");rn.prototype.mul=o(i(function(t,r){return t=new Ot.default(t,r),this.curve._wnafMul(this,t)},"mul2"),"mul");rn.prototype.eq=o(i(function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var r=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(r)).cmpn(0)!==0)return!1;var a=r.redMul(this.z),s=n.redMul(t.z);return this.y.redMul(s).redISub(t.y.redMul(a)).cmpn(0)===0},"eq3"),"eq");rn.prototype.eqXToP=o(i(function(t){var r=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var a=t.clone(),s=this.curve.redN.redMul(r);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP"),"eqXToP");rn.prototype.inspect=o(i(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect2"),"inspect");rn.prototype.isInfinity=o(i(function(){return this.z.cmpn(0)===0},"isInfinity2"),"isInfinity");var V0=Gc(function(e,t){"use strict";var r=t;r.base=Wc,r.short=PH,r.mont=null,r.edwards=null}),K0=Gc(function(e,t){"use strict";var r=t,n=Ci.assert;function a(l){l.type==="short"?this.curve=new V0.short(l):l.type==="edwards"?this.curve=new V0.edwards(l):this.curve=new V0.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}i(a,"PresetCurve"),o(a,"PresetCurve"),r.PresetCurve=a;function s(l,d){Object.defineProperty(r,l,{configurable:!0,enumerable:!0,get:function(){var p=new a(d);return Object.defineProperty(r,l,{configurable:!0,enumerable:!0,value:p}),p}})}i(s,"defineCurve"),o(s,"defineCurve"),s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Co.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Co.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Co.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Co.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Co.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Co.default.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Co.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Co.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Oo(e){if(!(this instanceof Oo))return new Oo(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=ga.toArray(e.entropy,e.entropyEnc||"hex"),r=ga.toArray(e.nonce,e.nonceEnc||"hex"),n=ga.toArray(e.pers,e.persEnc||"hex");y2(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}i(Oo,"HmacDRBG");o(Oo,"HmacDRBG");var jM=Oo;Oo.prototype._init=o(i(function(t,r,n){var a=t.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656},"init"),"init");Oo.prototype._hmac=o(i(function(){return new Co.default.hmac(this.hash,this.K)},"hmac"),"hmac");Oo.prototype._update=o(i(function(t){var r=this._hmac().update(this.V).update([0]);t&&(r=r.update(t)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},"update"),"update");Oo.prototype.reseed=o(i(function(t,r,n,a){typeof r!="string"&&(a=n,n=r,r=null),t=ga.toArray(t,r),n=ga.toArray(n,a),y2(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},"reseed"),"reseed");Oo.prototype.generate=o(i(function(t,r,n,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(a=n,n=r,r=null),n&&(n=ga.toArray(n,a||"hex"),this._update(n));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var c=s.slice(0,t);return this._update(n),this._reseed++,ga.encode(c,r)},"generate"),"generate");var e6=Ci.assert;function fn(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}i(fn,"KeyPair");o(fn,"KeyPair");var _2=fn;fn.fromPublic=o(i(function(t,r,n){return r instanceof fn?r:new fn(t,{pub:r,pubEnc:n})},"fromPublic"),"fromPublic");fn.fromPrivate=o(i(function(t,r,n){return r instanceof fn?r:new fn(t,{priv:r,privEnc:n})},"fromPrivate"),"fromPrivate");fn.prototype.validate=o(i(function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate4"),"validate");fn.prototype.getPublic=o(i(function(t,r){return typeof t=="string"&&(r=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,t):this.pub},"getPublic"),"getPublic");fn.prototype.getPrivate=o(i(function(t){return t==="hex"?this.priv.toString(16,2):this.priv},"getPrivate"),"getPrivate");fn.prototype._importPrivate=o(i(function(t,r){this.priv=new Ot.default(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate"),"_importPrivate");fn.prototype._importPublic=o(i(function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?e6(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&e6(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,r)},"_importPublic"),"_importPublic");fn.prototype.derive=o(i(function(t){return t.validate()||e6(t.validate(),"public point not validated"),t.mul(this.priv).getX()},"derive"),"derive");fn.prototype.sign=o(i(function(t,r,n){return this.ec.sign(t,this,r,n)},"sign2"),"sign");fn.prototype.verify=o(i(function(t,r,n){return this.ec.verify(t,r,this,void 0,n)},"verify2"),"verify");fn.prototype.inspect=o(i(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect3"),"inspect");var BH=Ci.assert;function Jd(e,t){if(e instanceof Jd)return e;this._importDER(e,t)||(BH(e.r&&e.s,"Signature without r or s"),this.r=new Ot.default(e.r,16),this.s=new Ot.default(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}i(Jd,"Signature");o(Jd,"Signature");var r1=Jd;function $M(){this.place=0}i($M,"Position");o($M,"Position");function G0(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||e[t.place]===0)return!1;for(var a=0,s=0,c=t.place;s<n;s++,c++)a<<=8,a|=e[c],a>>>=0;return a<=127?!1:(t.place=c,a)}i(G0,"getLength");o(G0,"getLength");function t6(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t<r;)t++;return t===0?e:e.slice(t)}i(t6,"rmPadding");o(t6,"rmPadding");Jd.prototype._importDER=o(i(function(t,r){t=Ci.toArray(t,r);var n=new $M;if(t[n.place++]!==48)return!1;var a=G0(t,n);if(a===!1||a+n.place!==t.length||t[n.place++]!==2)return!1;var s=G0(t,n);if(s===!1||(t[n.place]&128)!==0)return!1;var c=t.slice(n.place,s+n.place);if(n.place+=s,t[n.place++]!==2)return!1;var l=G0(t,n);if(l===!1||t.length!==l+n.place||(t[n.place]&128)!==0)return!1;var d=t.slice(n.place,l+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new Ot.default(c),this.s=new Ot.default(d),this.recoveryParam=null,!0},"_importDER"),"_importDER");function W0(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}i(W0,"constructLength");o(W0,"constructLength");Jd.prototype.toDER=o(i(function(t){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=t6(r),n=t6(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var a=[2];W0(a,r.length),a=a.concat(r),a.push(2),W0(a,n.length);var s=a.concat(n),c=[48];return W0(c,s.length),c=c.concat(s),Ci.encode(c,t)},"toDER"),"toDER");var LH=o(function(){throw new Error("unsupported")},"rand"),Tc=Ci.assert;function xi(e){if(!(this instanceof xi))return new xi(e);typeof e=="string"&&(Tc(Object.prototype.hasOwnProperty.call(K0,e),"Unknown curve "+e),e=K0[e]),e instanceof K0.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}i(xi,"EC");o(xi,"EC");var UH=xi;xi.prototype.keyPair=o(i(function(t){return new _2(this,t)},"keyPair"),"keyPair");xi.prototype.keyFromPrivate=o(i(function(t,r){return _2.fromPrivate(this,t,r)},"keyFromPrivate"),"keyFromPrivate");xi.prototype.keyFromPublic=o(i(function(t,r){return _2.fromPublic(this,t,r)},"keyFromPublic"),"keyFromPublic");xi.prototype.genKeyPair=o(i(function(t){t||(t={});for(var r=new jM({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||LH(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new Ot.default(2));;){var s=new Ot.default(r.generate(n));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair"),"genKeyPair");xi.prototype._truncateToN=o(i(function(t,r,n){var a;if(Ot.default.isBN(t)||typeof t=="number")t=new Ot.default(t,16),a=t.byteLength();else if(typeof t=="object")a=t.length,t=new Ot.default(t,16);else{var s=t.toString();a=s.length+1>>>1,t=new Ot.default(s,16)}typeof n!="number"&&(n=a*8);var c=n-this.n.bitLength();return c>0&&(t=t.ushrn(c)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},"_truncateToN"),"_truncateToN");xi.prototype.sign=o(i(function(t,r,n,a){if(typeof n=="object"&&(a=n,n=null),a||(a={}),typeof t!="string"&&typeof t!="number"&&!Ot.default.isBN(t)){Tc(typeof t=="object"&&t&&typeof t.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),Tc(t.length>>>0===t.length);for(var s=0;s<t.length;s++)Tc((t[s]&255)===t[s])}r=this.keyFromPrivate(r,n),t=this._truncateToN(t,!1,a.msgBitLength),Tc(!t.isNeg(),"Can not sign a negative message");var c=this.n.byteLength(),l=r.getPrivate().toArray("be",c),d=t.toArray("be",c);Tc(new Ot.default(d).eq(t),"Can not sign message");for(var p=new jM({hash:this.hash,entropy:l,nonce:d,pers:a.pers,persEnc:a.persEnc||"utf8"}),g=this.n.sub(new Ot.default(1)),v=0;;v++){var y=a.k?a.k(v):new Ot.default(p.generate(this.n.byteLength()));if(y=this._truncateToN(y,!0),!(y.cmpn(1)<=0||y.cmp(g)>=0)){var _=this.g.mul(y);if(!_.isInfinity()){var x=_.getX(),R=x.umod(this.n);if(R.cmpn(0)!==0){var D=y.invm(this.n).mul(R.mul(r.getPrivate()).iadd(t));if(D=D.umod(this.n),D.cmpn(0)!==0){var P=(_.getY().isOdd()?1:0)|(x.cmp(R)!==0?2:0);return a.canonical&&D.cmp(this.nh)>0&&(D=this.n.sub(D),P^=1),new r1({r:R,s:D,recoveryParam:P})}}}}}},"sign3"),"sign");xi.prototype.verify=o(i(function(t,r,n,a,s){s||(s={}),t=this._truncateToN(t,!1,s.msgBitLength),n=this.keyFromPublic(n,a),r=new r1(r,"hex");var c=r.r,l=r.s;if(c.cmpn(1)<0||c.cmp(this.n)>=0||l.cmpn(1)<0||l.cmp(this.n)>=0)return!1;var d=l.invm(this.n),p=d.mul(t).umod(this.n),g=d.mul(c).umod(this.n),v;return this.curve._maxwellTrick?(v=this.g.jmulAdd(p,n.getPublic(),g),v.isInfinity()?!1:v.eqXToP(c)):(v=this.g.mulAdd(p,n.getPublic(),g),v.isInfinity()?!1:v.getX().umod(this.n).cmp(c)===0)},"verify3"),"verify");xi.prototype.recoverPubKey=function(e,t,r,n){Tc((3&r)===r,"The recovery param is more than two bits"),t=new r1(t,n);var a=this.n,s=new Ot.default(e),c=t.r,l=t.s,d=r&1,p=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?c=this.curve.pointFromX(c.add(this.curve.n),d):c=this.curve.pointFromX(c,d);var g=t.r.invm(a),v=a.sub(s).mul(g).umod(a),y=l.mul(g).umod(a);return this.g.mulAdd(v,c,y)};xi.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new r1(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var s;try{s=this.recoverPubKey(e,t,a)}catch{continue}if(s.eq(r))return a}throw new Error("Unable to find valid recovery factor")};var FH=Gc(function(e,t){"use strict";var r=t;r.version="6.6.1",r.utils=Ci,r.rand=function(){throw new Error("unsupported")},r.curve=V0,r.curves=K0,r.ec=UH,r.eddsa=null}),jH=FH.ec,$H="signing-key/5.8.0",r6=new br($H),_b=null;function ma(){return _b||(_b=new jH("secp256k1")),_b}i(ma,"getCurve");o(ma,"getCurve");var zM=i(class{constructor(e){Gu(this,"curve","secp256k1"),Gu(this,"privateKey",Pn(e)),kM(this.privateKey)!==32&&r6.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=ma().keyFromPrivate(qr(this.privateKey));Gu(this,"publicKey","0x"+t.getPublic(!1,"hex")),Gu(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Gu(this,"_isSigningKey",!0)}_addPoint(e){let t=ma().keyFromPublic(qr(this.publicKey)),r=ma().keyFromPublic(qr(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){let t=ma().keyFromPrivate(qr(this.privateKey)),r=qr(e);r.length!==32&&r6.throwArgumentError("bad digest length","digest",e);let n=t.sign(r,{canonical:!0});return m2({recoveryParam:n.recoveryParam,r:Oc("0x"+n.r.toString(16),32),s:Oc("0x"+n.s.toString(16),32)})}computeSharedSecret(e){let t=ma().keyFromPrivate(qr(this.privateKey)),r=ma().keyFromPublic(qr(E2(e)));return Oc("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}},"SigningKey");o(zM,"SigningKey");function HM(e,t){let r=m2(t),n={r:qr(r.r),s:qr(r.s)};return"0x"+ma().recoverPubKey(qr(e),n,r.recoveryParam).encode("hex",!1)}i(HM,"recoverPublicKey");o(HM,"recoverPublicKey");function E2(e,t){let r=qr(e);if(r.length===32){let n=new zM(r);return t?"0x"+ma().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return t?Pn(r):"0x"+ma().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return t?"0x"+ma().keyFromPublic(r).getPublic(!0,"hex"):Pn(r)}return r6.throwArgumentError("invalid public or private key","key","[REDACTED]")}i(E2,"computePublicKey");o(E2,"computePublicKey");var zH="transactions/5.8.0",qX=new br(zH),wS;(function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"})(wS||(wS={}));function qM(e){let t=E2(e);return NM(Xb(t1(Xb(t,1)),12))}i(qM,"computeAddress");o(qM,"computeAddress");function VM(e,t){return qM(HM(qr(e),t))}i(VM,"recoverAddress");o(VM,"recoverAddress");var HH="wallet/5.8.0",VX=new br(HH);function n6(e,t){return VM(UM(e),t)}i(n6,"verifyMessage");o(n6,"verifyMessage");function KM(){return{eip191:async(e,t)=>{GM(e,t)}}}i(KM,"getEIP191Verifier");o(KM,"getEIP191Verifier");var qH=new Date("2022-09-20").valueOf();function GM(e,t){h2(e),xM(e,t);let n=[n6(Zb.fromCacao(e).toMessage(),e.s.s).toLowerCase()];if(Date.parse(e.p.iat)<=qH){let s=n6(AM(Zb.fromCacao(e),"Ethereum"),e.s.s).toLowerCase();n.push(s)}let a=Sd.parse(e.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(a))throw new Error("Signature does not belong to issuer")}i(GM,"verifyEIP191Signature");o(GM,"verifyEIP191Signature");Hd();U6();var VH=ir(El(),1);Hd();function WM(){return Ir((0,VH.randomBytes)(16),"base64")}i(WM,"randomString");o(WM,"randomString");var ZM="base64pad",JM="base64url";function YM(e){return Ir(e,ZM)}i(YM,"encodeBase64");o(YM,"encodeBase64");function XM(e){return Ir(e,JM)}i(XM,"encodeBase64Url");o(XM,"encodeBase64Url");function QM(e){return Cr(e,ZM)}i(QM,"decodeBase64");o(QM,"decodeBase64");function Z0(e){return JSON.parse(Ir(Cr(e,JM)))}i(Z0,"base64urlToJSON");o(Z0,"base64urlToJSON");function eI(e){if(e.signatures.length>1)throw new Error("Cant convert to compact jws");return`${e.signatures[0].protected}.${e.payload}.${e.signatures[0].signature}`}i(eI,"fromDagJWS");o(eI,"fromDagJWS");function tI(e,t){if(t){let r=t.toISOString().split(".")[0]+"Z";return`${e}?versionTime=${r}`}else return e}i(tI,"didWithTime");o(tI,"didWithTime");function rI(e){return e?Array.isArray(e)?e:[e]:[]}i(rI,"extractControllers");o(rI,"extractControllers");var KH={...KM()};function nI(e){return"registry"in e&&"cache"in e}i(nI,"isResolver");o(nI,"isResolver");var iI=i(class{get capability(){if(!this._capability)throw new Error("DID has no capability attached");return this._capability}get hasCapability(){return this._capability!=null}get parent(){if(!this._parentId)throw new Error("DID has no parent DID");return this._parentId}get hasParent(){return this._parentId!=null}get id(){if(this._id==null)throw new Error("DID is not authenticated");return this._id}get authenticated(){return this._id!=null}withCapability(e){return new iI({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new Gb(e);else if(this._client.connection!==e)throw new Error("A different provider is already set, create a new DID instance to use another provider")}setResolver(e,t){this._resolver=nI(e)?e:new vT(e,t)}async authenticate({provider:e,paths:t=[],aud:r}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let n=WM(),a=await this._client.request("did_authenticate",{nonce:n,aud:r,paths:t}),{kid:s}=await this.verifyJWS(a),c=Z0(a.payload);if(!s.includes(c.did))throw new Error("Invalid authencation response, kid mismatch");if(c.nonce!==n)throw new Error("Invalid authencation response, wrong nonce");if(c.aud!==r)throw new Error("Invalid authencation response, wrong aud");if(c.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=c.did,this._id}async createJWS(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");if(this._capability){let n=this._capability.p.exp;if(n&&Date.parse(n)<Date.now())throw new Error("Capability is expired, cannot create a valid signature");let a=await mm.fromCacao(this._capability),s=Vt.asCID(a.cid);if(!s)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");t.protected=t.protected||{},t.protected.cap=`ipfs://${s?.toString()}`}let{jws:r}=await this._client.request("did_createJWS",{did:this._id,...t,payload:e});return r}async createDagJWS(e,t={}){let{cid:r,linkedBlock:n}=await rM(e),a=XM(r.bytes);Object.assign(t,{linkedBlock:YM(n)});let s=await this.createJWS(a,t),c=Vt.asCID(r);if(!c)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(s.link=c,this._capability){let l=await mm.fromCacao(this._capability);return{jws:s,linkedBlock:n,cacaoBlock:l.bytes}}return{jws:s,linkedBlock:n}}async verifyJWS(e,t={}){t=Object.assign({verifiers:KH},t),typeof e!="string"&&(e=eI(e));let r=Z0(e.split(".")[0]).kid;if(!r)throw new Error('No "kid" found in jws');let n=await this.resolve(r);if(!t.disableTimecheck){let d=n.didDocumentMetadata?.nextUpdate;if(d){let g=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,v=new Date(d).valueOf()+g;if(!(t.atTime&&t.atTime.getTime()<v))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${r}`)}let p=n.didDocumentMetadata?.updated;if(p&&t.atTime&&t.atTime.getTime()<new Date(p).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${r}`)}let s=n.didDocument?.id;if(t.issuer&&t.issuer===t.capability?.p.iss&&s===t.capability.p.aud){if(!t.verifiers)throw new Error("Registered verifiers needed for CACAO");await pm.verify(t.capability,{disableExpirationCheck:t.disableTimecheck,atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}})}else if(t.issuer&&t.issuer!==s){let d=tI(t.issuer,t.atTime),g=(await this.resolve(d)).didDocument?.controller,v=rI(g);if(t.capability?.s&&t.capability.p.aud===s&&v.includes(t.capability.p.iss))await pm.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}});else if(!(s?v.includes(s):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${r}`)}let c=n.didDocument?.verificationMethod||[];RT(e,c);let l;try{l=Z0(e.split(".")[1])}catch{}return{kid:r,payload:l,didResolutionResult:n}}async createJWE(e,t,r={}){let n=await qz(t,this._resolver);return Hz(e,n,r.protectedHeader,r.aad)}async createDagJWE(e,t,r={}){let n=await oM(e);return this.createJWE(n,t,r)}async decryptJWE(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");let{cleartext:r}=await this._client.request("did_decryptJWE",{did:this._id,...t,jwe:e});return QM(r)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return sM(t)}async resolve(e){let t=await this._resolver.resolve(e);if(t.didResolutionMetadata.error){let{error:r,message:n}=t.didResolutionMetadata,a=n?`, ${n}`:"";throw new Error(`Failed to resolve ${e}: ${r}${a}`)}return t}constructor({provider:e,resolver:t={},resolverOptions:r,capability:n,parent:a}={}){if(e!=null&&(this._client=new Gb(e)),n){if(this._capability=n,this._parentId=this._capability.p.iss,a&&this._parentId!==a)throw new Error("Capability issuer and parent not equal")}else a&&(this._parentId=a);this.setResolver(t,r)}},"DID");o(iI,"DID");function GH(e){var t=0,r=e.length,n=[];if(r%2)throw new Error("invalid hex:"+e);for(;t<r;t+=2)n.push(parseInt(e.substr(t,2),16));return new Uint8Array(n)}i(GH,"toUint8Array");o(GH,"toUint8Array");var _S=ir(Fm(),1);R6();var aI={};Sr(aI,{keyToDidDoc:()=>oI});function oI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`;return{id:r,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:r,publicKeyBase58:Ir(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(oI,"keyToDidDoc");o(oI,"keyToDidDoc");var sI={};Sr(sI,{keyToDidDoc:()=>uI});Hd();var WH=ir(j6(),1);function cI(e){let t=new Uint8Array(e.length+2);return t[0]=236,t[1]=1,t.set(e,2),`z${Ir(t,"base58btc")}`}i(cI,"encodeKey");o(cI,"encodeKey");function uI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=(0,WH.convertPublicKeyToX25519)(e),s=`${r}#${cI(a)}`;return{id:r,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:r,publicKeyBase58:Ir(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:r,publicKeyBase58:Ir(a,"base58btc")}]}}i(uI,"keyToDidDoc2");o(uI,"keyToDidDoc");var lI={};Sr(lI,{keyToDidDoc:()=>SI,pubKeyBytesToXY:()=>T2});var fI={};Sr(fI,{ECPointDecompress:()=>bI});function dI(e){return e>=0?e:-e}i(dI,"n");o(dI,"n");function hI(e,t){if(typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),e<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let r=0n,n=1n,a=1n,s=0n;for(;e!==0n;){let c=t/e,l=t%e,d=r-a*c,p=n-s*c;t=e,e=l,r=a,n=s,a=d,s=p}return{g:t,x:r,y:n}}i(hI,"r");o(hI,"r");function xd(e,t){if(typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");let r=e%t;return r<0n?r+t:r}i(xd,"e");o(xd,"e");function A2(e,t){let r=hI(xd(e,t),t);if(r.g!==1n)throw new RangeError(`${e.toString()} does not have inverse modulo ${t.toString()}`);return xd(r.x,t)}i(A2,"o");o(A2,"o");function pI(e,t,r){if(e.length!==t.length)throw new RangeError("The remainders and modulos arrays should have the same length");let n=r??t.reduce((a,s)=>a*s,1n);return t.reduce((a,s,c)=>{let l=n/s;return xd(a+l*A2(l,s)%n*e[c]%n,n)},0n)}i(pI,"i");o(pI,"i");function mI(e){return e.map(t=>t[0]**(t[1]-1n)*(t[0]-1n)).reduce((t,r)=>r*t,1n)}i(mI,"a");o(mI,"a");function nl(e,t,r,n){if(typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),typeof r=="number"&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(r===1n)return 0n;if(e=xd(e,r),t<0n)return A2(nl(e,dI(t),r,n),r);if(n!==void 0)return function(s,c,l,d){let p=d.map(y=>y[0]**y[1]),g=d.map(y=>mI([y])),v=g.map((y,_)=>nl(s,c%y,p[_]));return pI(v,p,l)}(e,t,r,function(s){let c={};return s.forEach(l=>{if(typeof l=="bigint"||typeof l=="number"){let d=String(l);c[d]===void 0?c[d]={p:BigInt(l),k:1n}:c[d].k+=1n}else{let d=String(l[0]);c[d]===void 0?c[d]={p:BigInt(l[0]),k:BigInt(l[1])}:c[d].k+=BigInt(l[1])}}),Object.values(c).map(l=>[l.p,l.k])}(n));let a=1n;for(;t>0;)t%2n===1n&&(a=a*e%r),t/=2n,e=e**2n%r;return a}i(nl,"s");o(nl,"s");var Qn={};Sr(Qn,{pubKeyBytesToHex:()=>gI,publicKeyHexToUint8ArrayPointPair:()=>S2,publicKeyIntToUint8ArrayPointPair:()=>x2,publicKeyIntToXY:()=>yI,publicKeyToXY:()=>vI,testHexString:()=>n1,testUint8Array:()=>Ol});N6();function gI(e){if(!Ol(e))throw new TypeError("input must be a Uint8Array");return Ir(e,"base16")}i(gI,"pubKeyBytesToHex");o(gI,"pubKeyBytesToHex");function vI(e){if(!n1(e))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let t=S2(e),r=el.encode(t.xOctet).slice(1),n=el.encode(t.yOctet).slice(1);return{xm:r,ym:n}}i(vI,"publicKeyToXY");o(vI,"publicKeyToXY");function S2(e){if(!n1(e))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let t=e.slice(0,e.length/2),r=e.slice(e.length/2,e.length),n=Cr(t,"base16"),a=Cr(r,"base16");return{xOctet:n,yOctet:a}}i(S2,"publicKeyHexToUint8ArrayPointPair");o(S2,"publicKeyHexToUint8ArrayPointPair");function n1(e){let t=/^[A-Fa-f0-9]+$/i;return!!(t.exec(e)!==null&&t.test(e)&&typeof e=="string")}i(n1,"testHexString");o(n1,"testHexString");function Ol(e){return e==null?!1:e.constructor===Uint8Array}i(Ol,"testUint8Array");o(Ol,"testUint8Array");function yI(e){if(e==null)throw new TypeError("input cannot be null or undefined.");if(typeof e!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(e,"x")||!Object.prototype.hasOwnProperty.call(e,"y"))throw new Error("Input must have properties x and y");if(typeof e.x!="bigint"&&typeof e.y!="bigint")throw new Error("Input coordinates must be BigInt");let t=x2(e),r=el.encode(t.xOctet).slice(1),n=el.encode(t.yOctet).slice(1);return{xm:r,ym:n}}i(yI,"publicKeyIntToXY");o(yI,"publicKeyIntToXY");function x2(e){if(e==null)throw new TypeError("input cannot be null or undefined.");if(typeof e!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(e,"x")||!Object.prototype.hasOwnProperty.call(e,"y"))throw new Error("Input must have properties x and y");if(typeof e.x!="bigint"&&typeof e.y!="bigint")throw new Error("Input coordinates must be BigInt");let t=e.x.toString(),r=e.y.toString(),n=Cr(t,"base10"),a=Cr(r,"base10");return{xOctet:n,yOctet:a}}i(x2,"publicKeyIntToUint8ArrayPointPair");o(x2,"publicKeyIntToUint8ArrayPointPair");function bI(e){if(!Ol(e))throw new TypeError("input must be a Uint8Array");let t=BigInt(2),r=t**256n-t**224n+t**192n+t**96n-1n,n=41058363725152142129326129780047268409114441015993725554835256314039467401291n,a=(r+1n)/4n,s=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Ir(c,"base10")),d=l**3n-l*3n+n,p=nl(d,a,r);return p%2n!==s&&(p=r-p),{x:l,y:p}}i(bI,"ECPointDecompress");o(bI,"ECPointDecompress");var wI={};Sr(wI,{ECPointDecompress:()=>_I});function _I(e){if(!Ol(e))throw new TypeError("input must be a Uint8Array");let t=BigInt(2),r=t**384n-t**128n-t**96n+t**32n-1n,n=27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,a=(r+1n)/4n,s=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Ir(c,"base10")),d=l**3n-l*3n+n,p=nl(d,a,r);return p%2n!==s&&(p=r-p),{x:l,y:p}}i(_I,"ECPointDecompress2");o(_I,"ECPointDecompress");var EI={};Sr(EI,{ECPointDecompress:()=>AI});function AI(e){if(!Ol(e))throw new TypeError("input must be a Uint8Array");let r=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,a=(r+1n)/4n,s=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Ir(c,"base10")),d=l**3n-l*3n+n,p=nl(d,a,r);return p%2n!==s&&(p=r-p),{x:l,y:p}}i(AI,"ECPointDecompress3");o(AI,"ECPointDecompress");function SI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=T2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-256",x:a.xm,y:a.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(SI,"keyToDidDoc3");o(SI,"keyToDidDoc");function T2(e){if(!Qn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Qn.pubKeyBytesToHex(e),r=t.length/2;if(r==64)return Qn.publicKeyToXY(t);if(r==65&&t.slice(0,2)=="04"){let n=t.slice(2);return Qn.publicKeyToXY(n)}if(r==33&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let n=Cr(t,"base16"),a=fI.ECPointDecompress(n);return Qn.publicKeyIntToXY(a)}throw new Error("Unexpected pubKeyBytes")}i(T2,"pubKeyBytesToXY");o(T2,"pubKeyBytesToXY");var xI={};Sr(xI,{keyToDidDoc:()=>TI,pubKeyBytesToXY:()=>C2});function TI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=C2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-384",x:a.xm,y:a.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(TI,"keyToDidDoc4");o(TI,"keyToDidDoc");function C2(e){if(!Qn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Qn.pubKeyBytesToHex(e),r=t.length/2;if(r==96)return Qn.publicKeyToXY(t);if(r==97&&t.slice(0,2)=="04"){let n=t.slice(2);return Qn.publicKeyToXY(n)}if(r==49&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let n=Cr(t,"base16"),a=wI.ECPointDecompress(n);return Qn.publicKeyIntToXY(a)}throw new Error("Unexpected pubKeyBytes")}i(C2,"pubKeyBytesToXY2");o(C2,"pubKeyBytesToXY");var CI={};Sr(CI,{keyToDidDoc:()=>MI,pubKeyBytesToXY:()=>M2});function MI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=M2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-521",x:a.xm,y:a.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(MI,"keyToDidDoc5");o(MI,"keyToDidDoc");function M2(e){if(!Qn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Qn.pubKeyBytesToHex(e);if(132<=t.length&&t.length<=134&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let r=Cr(t,"base16"),n=EI.ECPointDecompress(r);return Qn.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}i(M2,"pubKeyBytesToXY3");o(M2,"pubKeyBytesToXY");var ZH="application/did+ld+json",ES="application/did+json",JH={231:aI,237:sI,4608:lI,4609:xI,4610:CI};function YH(){return{key:async(e,t,r,n)=>{let a=n.accept||ES,s={didResolutionMetadata:{contentType:a},didDocument:null,didDocumentMetadata:{}};try{let c=ha.decode(t.id),l=_S.default.decode(c),d=c.slice(_S.default.decode.bytes),p=await JH[l].keyToDidDoc(d,t.id);a===ZH?(p["@context"]="https://w3id.org/did/v1",s.didDocument=p):a===ES?s.didDocument=p:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(c){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=c.toString()}return s}}}i(YH,"getResolver");o(YH,"getResolver");var II=ir(j6(),1),XH=ir(lz(),1),QH="base64pad";function i6(e){return JSON.parse((0,XH.default)(e))}i(i6,"toStableObject");o(i6,"toStableObject");function kI(e){let t=new Uint8Array(e.length+2);return t[0]=237,t[1]=1,t.set(e,2),`did:key:z${Ir(t,"base58btc")}`}i(kI,"encodeDID");o(kI,"encodeDID");function a6(e){let[t,r,n]=e.split(".");return{payload:r,signatures:[{protected:t,signature:n}]}}i(a6,"toGeneralJWS");o(a6,"toGeneralJWS");var AS=o(async(e,t,r,n={})=>{let a=`${t}#${t.split(":")[2]}`,s=MT(r),c=i6(Object.assign(n,{kid:a,alg:"EdDSA"}));return jz(typeof e=="string"?e:i6(e),s,c)},"sign"),eq={did_authenticate:async({did:e,secretKey:t},r)=>{let n=await AS({did:e,aud:r.aud,nonce:r.nonce,paths:r.paths,exp:Math.floor(Date.now()/1e3)+600},e,t);return a6(n)},did_createJWS:async({did:e,secretKey:t},r)=>{if(r.did.split("#")[0]!==e)throw new xs(4100,`Unknown DID: ${e}`);let a=await AS(r.payload,e,t,r.protected);return{jws:a6(a)}},did_decryptJWE:async({secretKey:e},t)=>{let r=$T((0,II.convertSecretKeyToX25519)(e));try{let n=await zz(t.jwe,r);return{cleartext:Ir(n,QH)}}catch(n){throw new xs(-32e3,n.message)}}},tq=i(class{constructor(e){let{secretKey:t,publicKey:r}=(0,II.generateKeyPairFromSeed)(e),n=kI(r),a=wM(eq);this._handle=async s=>await a({did:n,secretKey:t},s)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}},"Ed25519Provider");o(tq,"Ed25519Provider");var DI={};Sr(DI,{JsonPatchError:()=>Ur,_areEquals:()=>il,applyOperation:()=>ws,applyPatch:()=>i1,applyReducer:()=>RI,deepClone:()=>iq,getValueByPointer:()=>Td,validate:()=>k2,validator:()=>Cd});var rq=function(){var e=o(function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},e(t,r)},"extendStatics");return function(t,r){e(t,r);function n(){this.constructor=t}i(n,"__"),o(n,"__"),t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),nq=Object.prototype.hasOwnProperty;function bm(e,t){return nq.call(e,t)}i(bm,"hasOwnProperty");o(bm,"hasOwnProperty");function wm(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var a in e)bm(e,a)&&n.push(a);return n}i(wm,"_objectKeys");o(wm,"_objectKeys");function ei(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}i(ei,"_deepClone");o(ei,"_deepClone");function _m(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}i(_m,"isInteger2");o(_m,"isInteger");function ys(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}i(ys,"escapePathComponent");o(ys,"escapePathComponent");function I2(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}i(I2,"unescapePathComponent");o(I2,"unescapePathComponent");function Em(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Em(e[t]))return!0}else if(typeof e=="object"){for(var n=wm(e),a=n.length,s=0;s<a;s++)if(Em(e[n[s]]))return!0}}return!1}i(Em,"hasUndefined");o(Em,"hasUndefined");function o6(e,t){var r=[e];for(var n in t){var a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(n+": "+a)}return r.join(`
|
|
843
843
|
`)}i(o6,"patchErrorMessageFormatter");o(o6,"patchErrorMessageFormatter");var OI=function(e){rq(t,e);function t(r,n,a,s,c){var l=this.constructor,d=e.call(this,o6(r,{name:n,index:a,operation:s,tree:c}))||this;return d.name=n,d.index=a,d.operation=s,d.tree=c,Object.setPrototypeOf(d,l.prototype),d.message=o6(r,{name:n,index:a,operation:s,tree:c}),d}return i(t,"PatchError2"),o(t,"PatchError"),t}(Error),Ur=OI,iq=ei,Zu={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=Td(r,this.path);n&&(n=ei(n));var a=ws(r,{op:"remove",path:this.from}).removed;return ws(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Td(r,this.from);return ws(r,{op:"add",path:this.path,value:ei(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:il(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},aq={add:function(e,t,r){return _m(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:Zu.move,copy:Zu.copy,test:Zu.test,_get:Zu._get};function Td(e,t){if(t=="")return e;var r={op:"_get",path:t};return ws(e,r),r.value}i(Td,"getValueByPointer");o(Td,"getValueByPointer");function ws(e,t,r,n,a,s){if(r===void 0&&(r=!1),n===void 0&&(n=!0),a===void 0&&(a=!0),s===void 0&&(s=0),r&&(typeof r=="function"?r(t,0,e,t.path):Cd(t,0)),t.path===""){var c={newDocument:e};if(t.op==="add")return c.newDocument=t.value,c;if(t.op==="replace")return c.newDocument=t.value,c.removed=e,c;if(t.op==="move"||t.op==="copy")return c.newDocument=Td(e,t.from),t.op==="move"&&(c.removed=e),c;if(t.op==="test"){if(c.test=il(e,t.value),c.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c.newDocument=e,c}else{if(t.op==="remove")return c.removed=e,c.newDocument=null,c;if(t.op==="_get")return t.value=e,c;if(r)throw new Ur("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return c}}else{n||(e=ei(e));var l=t.path||"",d=l.split("/"),p=e,g=1,v=d.length,y=void 0,_=void 0,x=void 0;for(typeof r=="function"?x=r:x=Cd;;){if(_=d[g],_&&_.indexOf("~")!=-1&&(_=I2(_)),a&&(_=="__proto__"||_=="prototype"&&g>0&&d[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&y===void 0&&(p[_]===void 0?y=d.slice(0,g).join("/"):g==v-1&&(y=t.path),y!==void 0&&x(t,0,e,y)),g++,Array.isArray(p)){if(_==="-")_=p.length;else{if(r&&!_m(_))throw new Ur("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);_m(_)&&(_=~~_)}if(g>=v){if(r&&t.op==="add"&&_>p.length)throw new Ur("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var c=aq[t.op].call(t,p,_,e);if(c.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}}else if(g>=v){var c=Zu[t.op].call(t,p,_,e);if(c.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}if(p=p[_],r&&g<v&&(!p||typeof p!="object"))throw new Ur("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}i(ws,"applyOperation");o(ws,"applyOperation");function i1(e,t,r,n,a){if(n===void 0&&(n=!0),a===void 0&&(a=!0),r&&!Array.isArray(t))throw new Ur("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=ei(e));for(var s=new Array(t.length),c=0,l=t.length;c<l;c++)s[c]=ws(e,t[c],r,!0,a,c),e=s[c].newDocument;return s.newDocument=e,s}i(i1,"applyPatch");o(i1,"applyPatch");function RI(e,t,r){var n=ws(e,t);if(n.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}i(RI,"applyReducer");o(RI,"applyReducer");function Cd(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ur("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Zu[e.op]){if(typeof e.path!="string")throw new Ur("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ur('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Ur("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Ur("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Em(e.value))throw new Ur("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var a=e.path.split("/").length,s=n.split("/").length;if(a!==s+1&&a!==s)throw new Ur("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new Ur("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var c={op:"_get",path:e.from,value:void 0},l=k2([c],r);if(l&&l.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ur("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Ur("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}i(Cd,"validator");o(Cd,"validator");function k2(e,t,r){try{if(!Array.isArray(e))throw new Ur("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)i1(ei(t),ei(e),r||!0);else{r=r||Cd;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(a){if(a instanceof Ur)return a;throw a}}i(k2,"validate5");o(k2,"validate");function il(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),a,s,c;if(r&&n){if(s=e.length,s!=t.length)return!1;for(a=s;a--!==0;)if(!il(e[a],t[a]))return!1;return!0}if(r!=n)return!1;var l=Object.keys(e);if(s=l.length,s!==Object.keys(t).length)return!1;for(a=s;a--!==0;)if(!t.hasOwnProperty(l[a]))return!1;for(a=s;a--!==0;)if(c=l[a],!il(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}i(il,"_areEquals");o(il,"_areEquals");var NI={};Sr(NI,{compare:()=>jI,generate:()=>Am,observe:()=>FI,unobserve:()=>UI});var D2=new WeakMap,oq=function(){function e(t){this.observers=new Map,this.obj=t}return i(e,"Mirror2"),o(e,"Mirror"),e}(),sq=function(){function e(t,r){this.callback=t,this.observer=r}return i(e,"ObserverInfo2"),o(e,"ObserverInfo"),e}();function PI(e){return D2.get(e)}i(PI,"getMirror");o(PI,"getMirror");function BI(e,t){return e.observers.get(t)}i(BI,"getObserverFromMirror");o(BI,"getObserverFromMirror");function LI(e,t){e.observers.delete(t.callback)}i(LI,"removeObserverFromMirror");o(LI,"removeObserverFromMirror");function UI(e,t){t.unobserve()}i(UI,"unobserve");o(UI,"unobserve");function FI(e,t){var r=[],n,a=PI(e);if(!a)a=new oq(e),D2.set(e,a);else{var s=BI(a,t);n=s&&s.observer}if(n)return n;if(n={},a.value=ei(e),t){n.callback=t,n.next=null;var c=o(function(){Am(n)},"dirtyCheck"),l=o(function(){clearTimeout(n.next),n.next=setTimeout(c)},"fastCheck");typeof window<"u"&&(window.addEventListener("mouseup",l),window.addEventListener("keyup",l),window.addEventListener("mousedown",l),window.addEventListener("keydown",l),window.addEventListener("change",l))}return n.patches=r,n.object=e,n.unobserve=function(){Am(n),clearTimeout(n.next),LI(a,n),typeof window<"u"&&(window.removeEventListener("mouseup",l),window.removeEventListener("keyup",l),window.removeEventListener("mousedown",l),window.removeEventListener("keydown",l),window.removeEventListener("change",l))},a.observers.set(t,new sq(t,n)),n}i(FI,"observe");o(FI,"observe");function Am(e,t){t===void 0&&(t=!1);var r=D2.get(e.object);a1(r.value,e.object,e.patches,"",t),e.patches.length&&i1(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}i(Am,"generate2");o(Am,"generate");function a1(e,t,r,n,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=wm(t),c=wm(e),l=!1,d=!1,p=c.length-1;p>=0;p--){var g=c[p],v=e[g];if(bm(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var y=t[g];typeof v=="object"&&v!=null&&typeof y=="object"&&y!=null&&Array.isArray(v)===Array.isArray(y)?a1(v,y,r,n+"/"+ys(g),a):v!==y&&(l=!0,a&&r.push({op:"test",path:n+"/"+ys(g),value:ei(v)}),r.push({op:"replace",path:n+"/"+ys(g),value:ei(y)}))}else Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:n+"/"+ys(g),value:ei(v)}),r.push({op:"remove",path:n+"/"+ys(g)}),d=!0):(a&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),l=!0)}if(!(!d&&s.length==c.length))for(var p=0;p<s.length;p++){var g=s[p];!bm(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+ys(g),value:ei(t[g])})}}}i(a1,"_generate");o(a1,"_generate");function jI(e,t,r){r===void 0&&(r=!1);var n=[];return a1(e,t,n,"",r),n}i(jI,"compare3");o(jI,"compare");var $I=Object.assign({},DI,NI,{JsonPatchError:OI,deepClone:ei,escapePathComponent:ys,unescapePathComponent:I2}),cq=ir(Vd(),1),uq=ir(El(),1),ri;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC"})(ri||(ri={}));var SS=ir(Vd(),1);Ja();zd();var zI={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function HI(e){let t=zI[e];if(typeof t<"u")return t;throw new Error(`No stream type registered for name ${e}`)}i(HI,"codeByName");o(HI,"codeByName");function qI(e){let t=Object.entries(zI).find(([,r])=>r===e);if(t)return t[0];throw new Error(`No stream type registered for index ${e}`)}i(qI,"nameByCode");o(qI,"nameByCode");var Ro=i(class{},"StreamType");o(Ro,"StreamType");Ro.nameByCode=qI;Ro.codeByName=HI;var xS=ir(Fm(),1);function Ji(e){let t,r,n;return typeof e=="object"?(t=e.hashFunction,r=e.expiring,n=e.tags):t=e,(a,s,c)=>{if(c.value!=null)c.value=s6(c.value,t,r,n);else if(c.get!=null)c.get=s6(c.get,t,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}i(Ji,"Memoize");o(Ji,"Memoize");var Eb=new Map;function s6(e,t,r=0,n){let a=Symbol("__memoized_map__");return function(...s){let c;this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let l=this[a];if(Array.isArray(n))for(let d of n)Eb.has(d)?Eb.get(d).push(l):Eb.set(d,[l]);if(t||s.length>0||r>0){let d;t===!0?d=s.map(v=>v.toString()).join("!"):t?d=t.apply(this,s):d=s[0];let p=`${d}__timestamp`,g=!1;if(r>0)if(!l.has(p))g=!0;else{let v=l.get(p);g=Date.now()-v>r}l.has(d)&&!g?c=l.get(d):(c=e.apply(this,s),l.set(d,c),r>0&&l.set(p,Date.now()))}else{let d=this;l.has(d)?c=l.get(d):(c=e.apply(this,s),l.set(d,c))}return c}}i(s6,"getNewFunction");o(s6,"getNewFunction");var O2=206;Ja();zd();Rm();var TS=ir(Fm(),1);function Yd(e){try{return e()}catch(t){return t}}i(Yd,"tryCatch");o(Yd,"tryCatch");Ja();var CS=ir(Fm(),1);bl();function Mc(e){let t=CS.default.decode(e),r=CS.default.decode.bytes,n=e.subarray(r);return[t,n,r]}i(Mc,"readVarint");o(Mc,"readVarint");function VI(e){return e===0||e===1}i(VI,"isCidVersion");o(VI,"isCidVersion");function c6(e){let[t,r]=Mc(e);if(!VI(t))throw new Error(`Unknown CID version ${t}`);let[n,a]=Mc(r),[,s,c]=Mc(a),[l,,d]=Mc(s),p=a.subarray(0,c+d+l),g=a.subarray(c+d+l);return[Vt.create(t,n,B6(p)),g]}i(c6,"readCid");o(c6,"readCid");Ja();zd();function Xd(e,t="StreamRef"){let[r,n]=Mc(e);if(r!==O2)throw new Error(`Invalid ${t}, does not include streamid codec`);let[a,s]=Mc(n),c=c6(s),[l,d]=c;if(d.length===0)return{kind:"stream-id",type:a,genesis:l};if(d.length===1&&d[0]===0)return{kind:"commit-id",type:a,genesis:l,commit:null};{let[p]=c6(d);return{kind:"commit-id",type:a,genesis:l,commit:p}}}i(Xd,"fromBytes");o(Xd,"fromBytes");var lq=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function o1(e,t="StreamRef"){let r=lq.exec(e)||[],n=r[2];if(!n)throw new Error(`Malformed ${t} string: ${e}`);let a=Os.decode(n),s=Xd(a),c=r[4];return c?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:R2(s.genesis,c)}:s}i(o1,"fromString4");o(o1,"fromString");function KI(e){try{return typeof e=="string"?Vt.parse(e):Vt.asCID(e)}catch{return null}}i(KI,"parseCID");o(KI,"parseCID");function R2(e,t=null){if(!t||t==="0")return null;let r=KI(t);if(r)return e.equals(r)?null:r;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}i(R2,"parseCommit");o(R2,"parseCommit");var Qd=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate"),Gi=i(function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},"__metadata"),GI=i(class extends Error{constructor(e){super(`Invalid StreamID bytes ${Os.encode(e)}: contains commit`)}},"InvalidStreamIDBytesError");o(GI,"InvalidStreamIDBytesError");var WI=i(class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}},"InvalidStreamIDStringError");o(WI,"InvalidStreamIDStringError");function N2(e){let t=Xd(e,"StreamID");if(t.kind==="stream-id")return new Xt(t.type,t.genesis);throw new GI(e)}i(N2,"fromBytes2");o(N2,"fromBytes");function ZI(e){return Yd(()=>N2(e))}i(ZI,"fromBytesNoThrow");o(ZI,"fromBytesNoThrow");function P2(e){let t=o1(e,"StreamID");if(t.kind==="stream-id")return new Xt(t.type,t.genesis);throw new WI(e)}i(P2,"fromString5");o(P2,"fromString");function JI(e){return Yd(()=>P2(e))}i(JI,"fromStringNoThrow");o(JI,"fromStringNoThrow");var MS=Symbol.for("@ceramicnetwork/streamid/StreamID"),Xt=i(class{constructor(e,t){if(this._tag=MS,!(e||e===0))throw new Error("StreamID constructor: type required");if(!t)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?Ro.codeByName(e):e,this._cid=typeof t=="string"?Vt.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===MS}static async fromGenesis(e,t){let r=await zm({value:t,codec:xl,hasher:wl});return new Xt(e,r.cid)}get type(){return this._type}get typeName(){return Ro.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=TS.default.encode(O2),t=TS.default.encode(this.type);return Es([e,t,this.cid.bytes])}get baseID(){return new Xt(this._type,this._cid)}equals(e){return Xt.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return Os.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}},"StreamID");o(Xt,"StreamID");Xt.fromBytes=N2;Xt.fromBytesNoThrow=ZI;Xt.fromString=P2;Xt.fromStringNoThrow=JI;Qd([Ji(),Gi("design:type",String),Gi("design:paramtypes",[])],Xt.prototype,"typeName",null);Qd([Ji(),Gi("design:type",Uint8Array),Gi("design:paramtypes",[])],Xt.prototype,"bytes",null);Qd([Ji(),Gi("design:type",Xt),Gi("design:paramtypes",[])],Xt.prototype,"baseID",null);Qd([Ji(),Gi("design:type",Function),Gi("design:paramtypes",[]),Gi("design:returntype",String)],Xt.prototype,"toString",null);Qd([Ji(),Gi("design:type",Function),Gi("design:paramtypes",[]),Gi("design:returntype",String)],Xt.prototype,"toUrl",null);var Rl=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate2"),ti=i(function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},"__metadata2"),Ab=i(function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},"__classPrivateFieldSet"),To=i(function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},"__classPrivateFieldGet"),Vu,Ac,od,YI=i(class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Os.encode(e)}: no commit information provided`)}},"InvalidCommitIDBytesError");o(YI,"InvalidCommitIDBytesError");var XI=i(class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}},"InvalidCommitIDStringError");o(XI,"InvalidCommitIDStringError");function B2(e){let t=Xd(e,"CommitID");if(t.kind==="commit-id")return new Er(t.type,t.genesis,t.commit);throw new YI(e)}i(B2,"fromBytes3");o(B2,"fromBytes");function QI(e){return Yd(()=>B2(e))}i(QI,"fromBytesNoThrow2");o(QI,"fromBytesNoThrow");function L2(e){let t=o1(e,"CommitID");if(t.kind==="commit-id")return new Er(t.type,t.genesis,t.commit);throw new XI(e)}i(L2,"fromString6");o(L2,"fromString");function ek(e){return Yd(()=>L2(e))}i(ek,"fromStringNoThrow2");o(ek,"fromStringNoThrow");var IS=Symbol.for("@ceramicnetwork/streamid/CommitID");function tk(e,t){return new Er(e.type,e.cid,t)}i(tk,"make");o(tk,"make");var Er=i(class{constructor(e,t,r=null){if(this._tag=IS,Vu.set(this,void 0),Ac.set(this,void 0),od.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");Ab(this,Vu,typeof e=="string"?Ro.codeByName(e):e,"f"),Ab(this,Ac,typeof t=="string"?Vt.parse(t):t,"f"),Ab(this,od,R2(To(this,Ac,"f"),r),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===IS}get baseID(){return new Xt(To(this,Vu,"f"),To(this,Ac,"f"))}get type(){return To(this,Vu,"f")}get typeName(){return Ro.nameByCode(To(this,Vu,"f"))}get cid(){return To(this,Ac,"f")}get commit(){return To(this,od,"f")||To(this,Ac,"f")}get bytes(){let e=xS.default.encode(O2),t=xS.default.encode(this.type),r=To(this,od,"f")?.bytes||new Uint8Array([0]);return Es([e,t,this.cid.bytes,r])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return Os.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Vu=new WeakMap,Ac=new WeakMap,od=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}},"CommitID");o(Er,"CommitID");Er.fromBytes=B2;Er.fromBytesNoThrow=QI;Er.fromString=L2;Er.fromStringNoThrow=ek;Er.make=tk;Rl([Ji(),ti("design:type",Xt),ti("design:paramtypes",[])],Er.prototype,"baseID",null);Rl([Ji(),ti("design:type",String),ti("design:paramtypes",[])],Er.prototype,"typeName",null);Rl([Ji(),ti("design:type",Vt),ti("design:paramtypes",[])],Er.prototype,"commit",null);Rl([Ji(),ti("design:type",Uint8Array),ti("design:paramtypes",[])],Er.prototype,"bytes",null);Rl([Ji(),ti("design:type",Function),ti("design:paramtypes",[]),ti("design:returntype",String)],Er.prototype,"toString",null);Rl([Ji(),ti("design:type",Function),ti("design:paramtypes",[]),ti("design:returntype",String)],Er.prototype,"toUrl",null);zd();var Ts;(function(e){function t(a){let s=Xd(a);switch(s.kind){case"commit-id":return new Er(s.type,s.genesis,s.commit);case"stream-id":return new Xt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${Os.encode(a)}`)}}i(t,"fromBytes4"),o(t,"fromBytes"),e.fromBytes=t;function r(a){let s=o1(a);switch(s.kind){case"commit-id":return new Er(s.type,s.genesis,s.commit);case"stream-id":return new Xt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${a}`)}}i(r,"fromString7"),o(r,"fromString"),e.fromString=r;function n(a){if(Xt.isInstance(a)||Er.isInstance(a))return a;if(a instanceof Uint8Array)return t(a);if(typeof a=="string")return r(a);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(a)}`)}i(n,"from4"),o(n,"from"),e.from=n})(Ts||(Ts={}));var u6=o(function(e,t){return u6=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},u6(e,t)},"extendStatics");function eo(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");u6(e,t);function r(){this.constructor=e}i(r,"__"),o(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}i(eo,"__extends2");o(eo,"__extends");function rk(e,t,r,n){function a(s){return s instanceof r?s:new r(function(c){c(s)})}return i(a,"adopt"),o(a,"adopt"),new(r||(r=Promise))(function(s,c){function l(g){try{p(n.next(g))}catch(v){c(v)}}i(l,"fulfilled"),o(l,"fulfilled");function d(g){try{p(n.throw(g))}catch(v){c(v)}}i(d,"rejected"),o(d,"rejected");function p(g){g.done?s(g.value):a(g.value).then(l,d)}i(p,"step"),o(p,"step"),p((n=n.apply(e,t||[])).next())})}i(rk,"__awaiter");o(rk,"__awaiter");function U2(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=l(0),c.throw=l(1),c.return=l(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(p){return function(g){return d([p,g])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,p[0]&&(r=0)),r;)try{if(n=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,a=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){r.label=p[1];break}if(p[0]===6&&r.label<s[1]){r.label=s[1],s=p;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(p);break}s[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(g){p=[6,g],a=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}i(U2,"__generator");o(U2,"__generator");function Pc(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}i(Pc,"__values");o(Pc,"__values");function No(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),a,s=[],c;try{for(;(t===void 0||t-- >0)&&!(a=n.next()).done;)s.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}i(No,"__read");o(No,"__read");function Cs(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}i(Cs,"__spreadArray");o(Cs,"__spreadArray");function Rc(e){return this instanceof Rc?(this.v=e,this):new Rc(e)}i(Rc,"__await");o(Rc,"__await");function nk(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),a,s=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",c),a[Symbol.asyncIterator]=function(){return this},a;function c(_){return function(x){return Promise.resolve(x).then(_,v)}}function l(_,x){n[_]&&(a[_]=function(R){return new Promise(function(D,P){s.push([_,R,D,P])>1||d(_,R)})},x&&(a[_]=x(a[_])))}function d(_,x){try{p(n[_](x))}catch(R){y(s[0][3],R)}}function p(_){_.value instanceof Rc?Promise.resolve(_.value.v).then(g,v):y(s[0][2],_)}function g(_){d("next",_)}function v(_){d("throw",_)}function y(_,x){_(x),s.shift(),s.length&&d(s[0][0],s[0][1])}}i(nk,"__asyncGenerator");o(nk,"__asyncGenerator");function ik(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Pc=="function"?Pc(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(c){return new Promise(function(l,d){c=e[s](c),a(l,d,c.done,c.value)})}}function a(s,c,l,d){Promise.resolve(d).then(function(p){s({value:p,done:l})},c)}}i(ik,"__asyncValues");o(ik,"__asyncValues");function Ar(e){return typeof e=="function"}i(Ar,"isFunction");o(Ar,"isFunction");function s1(e){var t=o(function(n){Error.call(n),n.stack=new Error().stack},"_super"),r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}i(s1,"createErrorClass");o(s1,"createErrorClass");var Sb=s1(function(e){return o(i(function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
844
844
|
`+r.map(function(n,a){return a+1+") "+n.toString()}).join(`
|
|
845
|
-
`):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl"),"UnsubscriptionErrorImpl")});function Md(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(Md,"arrRemove");o(Md,"arrRemove");var eh=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i(e,"Subscription2"),o(e,"Subscription"),e.prototype.unsubscribe=function(){var t,r,n,a,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=Pc(c),d=l.next();!d.done;d=l.next()){var p=d.value;p.remove(this)}}catch(R){t={error:R}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}else c.remove(this);var g=this.initialTeardown;if(Ar(g))try{g()}catch(R){s=R instanceof Sb?R.errors:[R]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var y=Pc(v),_=y.next();!_.done;_=y.next()){var x=_.value;try{l6(x)}catch(R){s=s??[],R instanceof Sb?s=Cs(Cs([],No(s)),No(R.errors)):s.push(R)}}}catch(R){n={error:R}}finally{try{_&&!_.done&&(a=y.return)&&a.call(y)}finally{if(n)throw n.error}}}if(s)throw new Sb(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l6(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Md(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Md(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),ak=eh.EMPTY;function F2(e){return e instanceof eh||e&&"closed"in e&&Ar(e.remove)&&Ar(e.add)&&Ar(e.unsubscribe)}i(F2,"isSubscription");o(F2,"isSubscription");function l6(e){Ar(e)?e():e.unsubscribe()}i(l6,"execFinalizer");o(l6,"execFinalizer");var Zc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Sm={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=Sm.delegate;return a?.setTimeout?a.setTimeout.apply(a,Cs([e,t],No(r))):setTimeout.apply(void 0,Cs([e,t],No(r)))},clearTimeout:function(e){var t=Sm.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function j2(e){Sm.setTimeout(function(){var t=Zc.onUnhandledError;if(t)t(e);else throw e})}i(j2,"reportUnhandledError");o(j2,"reportUnhandledError");function f6(){}i(f6,"noop");o(f6,"noop");var fq=function(){return c1("C",void 0,void 0)}();function ok(e){return c1("E",void 0,e)}i(ok,"errorNotification");o(ok,"errorNotification");function sk(e){return c1("N",e,void 0)}i(sk,"nextNotification");o(sk,"nextNotification");function c1(e,t,r){return{kind:e,value:t,error:r}}i(c1,"createNotification");o(c1,"createNotification");var Ic=null;function vd(e){if(Zc.useDeprecatedSynchronousErrorHandling){var t=!Ic;if(t&&(Ic={errorThrown:!1,error:null}),e(),t){var r=Ic,n=r.errorThrown,a=r.error;if(Ic=null,n)throw a}}else e()}i(vd,"errorContext");o(vd,"errorContext");function ck(e){Zc.useDeprecatedSynchronousErrorHandling&&Ic&&(Ic.errorThrown=!0,Ic.error=e)}i(ck,"captureError");o(ck,"captureError");var $2=function(e){eo(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,F2(r)&&r.add(n)):n.destination=pq,n}return i(t,"Subscriber2"),o(t,"Subscriber"),t.create=function(r,n,a){return new d6(r,n,a)},t.prototype.next=function(r){this.isStopped?Y0(sk(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Y0(ok(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Y0(fq,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(eh),dq=Function.prototype.bind;function J0(e,t){return dq.call(e,t)}i(J0,"bind");o(J0,"bind");var hq=function(){function e(t){this.partialObserver=t}return i(e,"ConsumerObserver2"),o(e,"ConsumerObserver"),e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){dd(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){dd(n)}else dd(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){dd(r)}},e}(),d6=function(e){eo(t,e);function t(r,n,a){var s=e.call(this)||this,c;if(Ar(r)||!r)c={next:r??void 0,error:n??void 0,complete:a??void 0};else{var l;s&&Zc.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return s.unsubscribe()},c={next:r.next&&J0(r.next,l),error:r.error&&J0(r.error,l),complete:r.complete&&J0(r.complete,l)}):c=r}return s.destination=new hq(c),s}return i(t,"SafeSubscriber2"),o(t,"SafeSubscriber"),t}($2);function dd(e){Zc.useDeprecatedSynchronousErrorHandling?ck(e):j2(e)}i(dd,"handleUnhandledError");o(dd,"handleUnhandledError");function uk(e){throw e}i(uk,"defaultErrorHandler");o(uk,"defaultErrorHandler");function Y0(e,t){var r=Zc.onStoppedNotification;r&&Sm.setTimeout(function(){return r(e,t)})}i(Y0,"handleStoppedNotification");o(Y0,"handleStoppedNotification");var pq={closed:!0,next:f6,error:uk,complete:f6},z2=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function u1(e){return e}i(u1,"identity3");o(u1,"identity");function lk(e){return e.length===0?u1:e.length===1?e[0]:o(i(function(r){return e.reduce(function(n,a){return a(n)},r)},"piped"),"piped")}i(lk,"pipeFromArray");o(lk,"pipeFromArray");var dn=function(){function e(t){t&&(this._subscribe=t)}return i(e,"Observable2"),o(e,"Observable"),e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var a=this,s=dk(t)?t:new d6(t,r,n);return vd(function(){var c=a,l=c.operator,d=c.source;s.add(l?l.call(s,d):d?a._subscribe(s):a._trySubscribe(s))}),s},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=h6(r),new r(function(a,s){var c=new d6({next:function(l){try{t(l)}catch(d){s(d),c.unsubscribe()}},error:s,complete:a});n.subscribe(c)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[z2]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return lk(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=h6(t),new t(function(n,a){var s;r.subscribe(function(c){return s=c},function(c){return a(c)},function(){return n(s)})})},e.create=function(t){return new e(t)},e}();function h6(e){var t;return(t=e??Zc.Promise)!==null&&t!==void 0?t:Promise}i(h6,"getPromiseCtor");o(h6,"getPromiseCtor");function fk(e){return e&&Ar(e.next)&&Ar(e.error)&&Ar(e.complete)}i(fk,"isObserver");o(fk,"isObserver");function dk(e){return e&&e instanceof $2||fk(e)&&F2(e)}i(dk,"isSubscriber");o(dk,"isSubscriber");function hk(e){return Ar(e?.lift)}i(hk,"hasLift");o(hk,"hasLift");function to(e){return function(t){if(hk(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}i(to,"operate");o(to,"operate");function _a(e,t,r,n,a){return new mq(e,t,r,n,a)}i(_a,"createOperatorSubscriber");o(_a,"createOperatorSubscriber");var mq=function(e){eo(t,e);function t(r,n,a,s,c,l){var d=e.call(this,r)||this;return d.onFinalize=c,d.shouldUnsubscribe=l,d._next=n?function(p){try{n(p)}catch(g){r.error(g)}}:e.prototype._next,d._error=s?function(p){try{s(p)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,d._complete=a?function(){try{a()}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._complete,d}return i(t,"OperatorSubscriber2"),o(t,"OperatorSubscriber"),t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}($2),gq=s1(function(e){return o(i(function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl"),"ObjectUnsubscribedErrorImpl")}),pk=function(e){eo(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return i(t,"Subject2"),o(t,"Subject"),t.prototype.lift=function(r){var n=new kS(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new gq},t.prototype.next=function(r){var n=this;vd(function(){var a,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=Pc(n.currentObservers),l=c.next();!l.done;l=c.next()){var d=l.value;d.next(r)}}catch(p){a={error:p}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}}})},t.prototype.error=function(r){var n=this;vd(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var a=n.observers;a.length;)a.shift().error(r)}})},t.prototype.complete=function(){var r=this;vd(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,a=this,s=a.hasError,c=a.isStopped,l=a.observers;return s||c?ak:(this.currentObservers=null,l.push(r),new eh(function(){n.currentObservers=null,Md(l,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,a=n.hasError,s=n.thrownError,c=n.isStopped;a?r.error(s):c&&r.complete()},t.prototype.asObservable=function(){var r=new dn;return r.source=this,r},t.create=function(r,n){return new kS(r,n)},t}(dn),kS=function(e){eo(t,e);function t(r,n){var a=e.call(this)||this;return a.destination=r,a.source=n,a}return i(t,"AnonymousSubject2"),o(t,"AnonymousSubject"),t.prototype.next=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.next)===null||a===void 0||a.call(n,r)},t.prototype.error=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.error)===null||a===void 0||a.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,a;return(a=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&a!==void 0?a:ak},t}(pk),vq=function(e){eo(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return i(t,"BehaviorSubject2"),o(t,"BehaviorSubject"),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,a=r.thrownError,s=r._value;if(n)throw a;return this._throwIfClosed(),s},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(pk),mk={now:function(){return(mk.delegate||Date).now()},delegate:void 0},yq=function(e){eo(t,e);function t(r,n){return e.call(this)||this}return i(t,"Action2"),o(t,"Action"),t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t}(eh),xm={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=xm.delegate;return a?.setInterval?a.setInterval.apply(a,Cs([e,t],No(r))):setInterval.apply(void 0,Cs([e,t],No(r)))},clearInterval:function(e){var t=xm.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},bq=function(e){eo(t,e);function t(r,n){var a=e.call(this,r,n)||this;return a.scheduler=r,a.work=n,a.pending=!1,a}return i(t,"AsyncAction2"),o(t,"AsyncAction"),t.prototype.schedule=function(r,n){var a;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var s=this.id,c=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(c,s,n)),this.pending=!0,this.delay=n,this.id=(a=this.id)!==null&&a!==void 0?a:this.requestAsyncId(c,this.id,n),this},t.prototype.requestAsyncId=function(r,n,a){return a===void 0&&(a=0),xm.setInterval(r.flush.bind(r,this),a)},t.prototype.recycleAsyncId=function(r,n,a){if(a===void 0&&(a=0),a!=null&&this.delay===a&&this.pending===!1)return n;n!=null&&xm.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var a=this._execute(r,n);if(a)return a;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var a=!1,s;try{this.work(r)}catch(c){a=!0,s=c||new Error("Scheduled action threw falsy error")}if(a)return this.unsubscribe(),s},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,a=r.scheduler,s=a.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Md(s,this),n!=null&&(this.id=this.recycleAsyncId(a,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(yq),DS=function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return i(e,"Scheduler2"),o(e,"Scheduler"),e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=mk.now,e}(),wq=function(e){eo(t,e);function t(r,n){n===void 0&&(n=DS.now);var a=e.call(this,r,n)||this;return a.actions=[],a._active=!1,a}return i(t,"AsyncScheduler2"),o(t,"AsyncScheduler"),t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var a;this._active=!0;do if(a=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,a){for(;r=n.shift();)r.unsubscribe();throw a}},t}(DS),_q=new wq(bq),Eq=_q,gk=new dn(function(e){return e.complete()});function H2(e){return e&&Ar(e.schedule)}i(H2,"isScheduler");o(H2,"isScheduler");function q2(e){return e[e.length-1]}i(q2,"last");o(q2,"last");function vk(e){return H2(q2(e))?e.pop():void 0}i(vk,"popScheduler");o(vk,"popScheduler");function yk(e,t){return typeof q2(e)=="number"?e.pop():t}i(yk,"popNumber");o(yk,"popNumber");var V2=o(function(e){return e&&typeof e.length=="number"&&typeof e!="function"},"isArrayLike");function K2(e){return Ar(e?.then)}i(K2,"isPromise");o(K2,"isPromise");function G2(e){return Ar(e[z2])}i(G2,"isInteropObservable");o(G2,"isInteropObservable");function W2(e){return Symbol.asyncIterator&&Ar(e?.[Symbol.asyncIterator])}i(W2,"isAsyncIterable");o(W2,"isAsyncIterable");function Z2(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}i(Z2,"createInvalidObservableTypeError");o(Z2,"createInvalidObservableTypeError");function bk(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}i(bk,"getSymbolIterator");o(bk,"getSymbolIterator");var wk=bk();function J2(e){return Ar(e?.[wk])}i(J2,"isIterable");o(J2,"isIterable");function Y2(e){return nk(this,arguments,o(i(function(){var r,n,a,s;return U2(this,function(c){switch(c.label){case 0:r=e.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,Rc(r.read())];case 3:return n=c.sent(),a=n.value,s=n.done,s?[4,Rc(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,Rc(a)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"),"readableStreamLikeToAsyncGenerator_1"))}i(Y2,"readableStreamLikeToAsyncGenerator");o(Y2,"readableStreamLikeToAsyncGenerator");function X2(e){return Ar(e?.getReader)}i(X2,"isReadableStreamLike");o(X2,"isReadableStreamLike");function Fo(e){if(e instanceof dn)return e;if(e!=null){if(G2(e))return _k(e);if(V2(e))return Ek(e);if(K2(e))return Ak(e);if(W2(e))return Q2(e);if(J2(e))return Sk(e);if(X2(e))return xk(e)}throw Z2(e)}i(Fo,"innerFrom");o(Fo,"innerFrom");function _k(e){return new dn(function(t){var r=e[z2]();if(Ar(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}i(_k,"fromInteropObservable");o(_k,"fromInteropObservable");function Ek(e){return new dn(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}i(Ek,"fromArrayLike");o(Ek,"fromArrayLike");function Ak(e){return new dn(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,j2)})}i(Ak,"fromPromise");o(Ak,"fromPromise");function Sk(e){return new dn(function(t){var r,n;try{for(var a=Pc(e),s=a.next();!s.done;s=a.next()){var c=s.value;if(t.next(c),t.closed)return}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}t.complete()})}i(Sk,"fromIterable");o(Sk,"fromIterable");function Q2(e){return new dn(function(t){Tk(e,t).catch(function(r){return t.error(r)})})}i(Q2,"fromAsyncIterable");o(Q2,"fromAsyncIterable");function xk(e){return Q2(Y2(e))}i(xk,"fromReadableStreamLike");o(xk,"fromReadableStreamLike");function Tk(e,t){var r,n,a,s;return rk(this,void 0,void 0,function(){var c,l;return U2(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),r=ik(e),d.label=1;case 1:return[4,r.next()];case 2:if(n=d.sent(),!!n.done)return[3,4];if(c=n.value,t.next(c),t.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=d.sent(),a={error:l},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}i(Tk,"process2");o(Tk,"process");function Do(e,t,r,n,a){n===void 0&&(n=0),a===void 0&&(a=!1);var s=t.schedule(function(){r(),a?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!a)return s}i(Do,"executeSchedule");o(Do,"executeSchedule");function e3(e,t){return t===void 0&&(t=0),to(function(r,n){r.subscribe(_a(n,function(a){return Do(n,e,function(){return n.next(a)},t)},function(){return Do(n,e,function(){return n.complete()},t)},function(a){return Do(n,e,function(){return n.error(a)},t)}))})}i(e3,"observeOn");o(e3,"observeOn");function t3(e,t){return t===void 0&&(t=0),to(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}i(t3,"subscribeOn");o(t3,"subscribeOn");function Ck(e,t){return Fo(e).pipe(t3(t),e3(t))}i(Ck,"scheduleObservable");o(Ck,"scheduleObservable");function Mk(e,t){return Fo(e).pipe(t3(t),e3(t))}i(Mk,"schedulePromise");o(Mk,"schedulePromise");function Ik(e,t){return new dn(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}i(Ik,"scheduleArray");o(Ik,"scheduleArray");function kk(e,t){return new dn(function(r){var n;return Do(r,t,function(){n=e[wk](),Do(r,t,function(){var a,s,c;try{a=n.next(),s=a.value,c=a.done}catch(l){r.error(l);return}c?r.complete():r.next(s)},0,!0)}),function(){return Ar(n?.return)&&n.return()}})}i(kk,"scheduleIterable");o(kk,"scheduleIterable");function r3(e,t){if(!e)throw new Error("Iterable cannot be null");return new dn(function(r){Do(r,t,function(){var n=e[Symbol.asyncIterator]();Do(r,t,function(){n.next().then(function(a){a.done?r.complete():r.next(a.value)})},0,!0)})})}i(r3,"scheduleAsyncIterable");o(r3,"scheduleAsyncIterable");function Dk(e,t){return r3(Y2(e),t)}i(Dk,"scheduleReadableStreamLike");o(Dk,"scheduleReadableStreamLike");function Ok(e,t){if(e!=null){if(G2(e))return Ck(e,t);if(V2(e))return Ik(e,t);if(K2(e))return Mk(e,t);if(W2(e))return r3(e,t);if(J2(e))return kk(e,t);if(X2(e))return Dk(e,t)}throw Z2(e)}i(Ok,"scheduled");o(Ok,"scheduled");function Rk(e,t){return t?Ok(e,t):Fo(e)}i(Rk,"from3");o(Rk,"from");var Nk=s1(function(e){return o(i(function(){e(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl"),"EmptyErrorImpl")});function Pk(e){return e instanceof Date&&!isNaN(e)}i(Pk,"isValidDate");o(Pk,"isValidDate");function n3(e,t){return to(function(r,n){var a=0;r.subscribe(_a(n,function(s){n.next(e.call(t,s,a++))}))})}i(n3,"map");o(n3,"map");var Aq=Array.isArray;function Bk(e,t){return Aq(t)?e.apply(void 0,Cs([],No(t))):e(t)}i(Bk,"callOrApply");o(Bk,"callOrApply");function Lk(e){return n3(function(t){return Bk(e,t)})}i(Lk,"mapOneOrManyArgs");o(Lk,"mapOneOrManyArgs");function Uk(e,t,r,n,a,s,c,l){var d=[],p=0,g=0,v=!1,y=o(function(){v&&!d.length&&!p&&t.complete()},"checkComplete"),_=o(function(R){return p<n?x(R):d.push(R)},"outerNext"),x=o(function(R){s&&t.next(R),p++;var D=!1;Fo(r(R,g++)).subscribe(_a(t,function(P){a?.(P),s?_(P):t.next(P)},function(){D=!0},void 0,function(){if(D)try{p--;for(var P=o(function(){var Z=d.shift();c?Do(t,c,function(){return x(Z)}):x(Z)},"_loop_1");d.length&&p<n;)P();y()}catch(Z){t.error(Z)}}))},"doInnerSub");return e.subscribe(_a(t,_,function(){v=!0,y()})),function(){l?.()}}i(Uk,"mergeInternals");o(Uk,"mergeInternals");function l1(e,t,r){return r===void 0&&(r=1/0),Ar(t)?l1(function(n,a){return n3(function(s,c){return t(n,s,a,c)})(Fo(e(n,a)))},r):(typeof t=="number"&&(r=t),to(function(n,a){return Uk(n,a,e,r)}))}i(l1,"mergeMap");o(l1,"mergeMap");function Fk(e){return e===void 0&&(e=1/0),l1(u1,e)}i(Fk,"mergeAll");o(Fk,"mergeAll");var Sq=["addListener","removeListener"],xq=["addEventListener","removeEventListener"],Tq=["on","off"];function Tm(e,t,r,n){if(Ar(r)&&(n=r,r=void 0),n)return Tm(e,t,r).pipe(Lk(n));var a=No(zk(e)?xq.map(function(l){return function(d){return e[l](t,d,r)}}):jk(e)?Sq.map(p6(e,t)):$k(e)?Tq.map(p6(e,t)):[],2),s=a[0],c=a[1];if(!s&&V2(e))return l1(function(l){return Tm(l,t,r)})(Fo(e));if(!s)throw new TypeError("Invalid event target");return new dn(function(l){var d=o(function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];return l.next(1<p.length?p:p[0])},"handler");return s(d),function(){return c(d)}})}i(Tm,"fromEvent");o(Tm,"fromEvent");function p6(e,t){return function(r){return function(n){return e[r](t,n)}}}i(p6,"toCommonHandlerRegistry");o(p6,"toCommonHandlerRegistry");function jk(e){return Ar(e.addListener)&&Ar(e.removeListener)}i(jk,"isNodeStyleEventEmitter");o(jk,"isNodeStyleEventEmitter");function $k(e){return Ar(e.on)&&Ar(e.off)}i($k,"isJQueryStyleEventEmitter");o($k,"isJQueryStyleEventEmitter");function zk(e){return Ar(e.addEventListener)&&Ar(e.removeEventListener)}i(zk,"isEventTarget");o(zk,"isEventTarget");function i3(e,t,r){e===void 0&&(e=0),r===void 0&&(r=Eq);var n=-1;return t!=null&&(H2(t)?r=t:n=t),new dn(function(a){var s=Pk(e)?+e-r.now():e;s<0&&(s=0);var c=0;return r.schedule(function(){a.closed||(a.next(c++),0<=n?this.schedule(void 0,n):a.complete())},s)})}i(i3,"timer");o(i3,"timer");function Hk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=vk(e),n=yk(e,1/0),a=e;return a.length?a.length===1?Fo(a[0]):Fk(n)(Rk(a,r)):gk}i(Hk,"merge");o(Hk,"merge");function qk(e,t){return to(function(r,n){var a=0;r.subscribe(_a(n,function(s){return e.call(t,s,a++)&&n.next(s)}))})}i(qk,"filter");o(qk,"filter");function Vk(e){return to(function(t,r){var n=!1;t.subscribe(_a(r,function(a){n=!0,r.next(a)},function(){n||r.next(e),r.complete()}))})}i(Vk,"defaultIfEmpty");o(Vk,"defaultIfEmpty");function Kk(e){return e<=0?function(){return gk}:to(function(t,r){var n=0;t.subscribe(_a(r,function(a){++n<=e&&(r.next(a),e<=n&&r.complete())}))})}i(Kk,"take");o(Kk,"take");function Gk(e){return e===void 0&&(e=Wk),to(function(t,r){var n=!1;t.subscribe(_a(r,function(a){n=!0,r.next(a)},function(){return n?r.complete():r.error(e())}))})}i(Gk,"throwIfEmpty");o(Gk,"throwIfEmpty");function Wk(){return new Nk}i(Wk,"defaultErrorFactory");o(Wk,"defaultErrorFactory");function Zk(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?qk(function(a,s){return e(a,s,n)}):u1,Kk(1),r?Vk(t):Gk(function(){return new Nk}))}}i(Zk,"first");o(Zk,"first");function Jk(e,t){return to(function(r,n){var a=t??{},s=a.leading,c=s===void 0?!0:s,l=a.trailing,d=l===void 0?!1:l,p=!1,g=null,v=null,y=!1,_=o(function(){v?.unsubscribe(),v=null,d&&(D(),y&&n.complete())},"endThrottling"),x=o(function(){v=null,y&&n.complete()},"cleanupThrottling"),R=o(function(P){return v=Fo(e(P)).subscribe(_a(n,_,x))},"startThrottle"),D=o(function(){if(p){p=!1;var P=g;g=null,n.next(P),!y&&R(P)}},"send");r.subscribe(_a(n,function(P){p=!0,g=P,!(v&&!v.closed)&&(c?D():R(P))},function(){y=!0,!(d&&p&&v&&!v.closed)&&n.complete()}))})}i(Jk,"throttle");o(Jk,"throttle");var OS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(OS||(OS={}));var Cm;(function(e){e[e.NOT_REQUESTED=0]="NOT_REQUESTED",e[e.PENDING=1]="PENDING",e[e.PROCESSING=2]="PROCESSING",e[e.ANCHORED=3]="ANCHORED",e[e.FAILED=4]="FAILED"})(Cm||(Cm={}));var m6;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(m6||(m6={}));var f1=i(class extends dn{constructor(e,t){super(r=>{e.subscribe(r)}),this.state$=e,this._context=t}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,SS.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Er.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Er.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===m6.ANCHOR).map(({cid:e})=>Er.make(this.id,e))}get state(){return(0,SS.default)(this.state$.value)}async sync(e={}){e={sync:ri.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}},"Stream");o(f1,"Stream");function d1(){return e=>{}}i(d1,"StreamStatic");o(d1,"StreamStatic");var Cq=ir(fz(),1);function Yk(e){let t=new AbortController;if(e.length===0)throw Error("Need abort signals to create a merged abort signal");return e.some(r=>r.aborted)?(t.abort(),t.signal):(Hk(...e.map(r=>Tm(r,"abort"))).pipe(Zk()).subscribe(()=>{t.abort()}),t.signal)}i(Yk,"mergeAbortSignals");o(Yk,"mergeAbortSignals");var Xk=i(class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=i3(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}},"TimedAbortSignal");o(Xk,"TimedAbortSignal");async function Qk(e,t){let r=new AbortController,n=o(()=>{r.abort()},"onAbort");return e.addEventListener("abort",n),e.aborted&&r.abort(),t(r.signal).finally(()=>{e.removeEventListener("abort",n)})}i(Qk,"abortable2");o(Qk,"abortable");var Mq=60*1e3*3;async function Ai(e,t={}){t.body&&Object.assign(t,{body:JSON.stringify(t.body),headers:{...t.headers,"Content-Type":"application/json"}});let r=t.timeout||Mq,n=new Xk(r),a=t.signal?Yk([t.signal,n.signal]):n.signal,s=await Qk(a,c=>(0,Cq.default)(String(e),{...t,signal:c})).finally(()=>n.clear());if(!s.ok){let c=await s.text();throw new Error(`HTTP request to '${e}' failed with status '${s.statusText}': ${c}`)}return s.json()}i(Ai,"fetchJson");o(Ai,"fetchJson");var F0=ir(Vd(),1);Ja();function Mo(e){let t=Vt.asCID(e);if(t)return t;if(typeof e=="string")return Vt.parse(e);if(e instanceof Uint8Array)return Vt.decode(e);throw new Error(`${e} cannot be converted to a CID`)}i(Mo,"toCID");o(Mo,"toCID");var RS=0,Hr=i(class{static streamIdFromState(e){return new Xt(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,F0.default)(e);return Hr.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Ir(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Ir(t.cacaoBlock,"base64")),t):(Hr.isSignedCommit(e)&&(t.link=t.link.toString()),Hr.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),e.header?.model&&(t.header.model=Ir(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,F0.default)(e);return Hr.isSignedCommitContainer(t)?(t.jws.link=Mo(t.jws.link),t.linkedBlock=Cr(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Cr(t.cacaoBlock,"base64")),t):(Hr.isSignedCommit(t)&&(t.link=Mo(t.link)),Hr.isAnchorCommit(t)&&(t.proof=Mo(t.proof)),t.id&&(t.id=Mo(t.id)),t.prev&&(t.prev=Mo(t.prev)),t.header?.model&&(t.header.model=Cr(t.header.model,"base64")),t)}static serializeState(e){let t=(0,F0.default)(e);return t.log=t.log.map(r=>({...r,cid:r.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=Cm[t.anchorStatus]),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),e.metadata?.model&&(t.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(t.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=RS&&(t.metadata.unique=Ir(t.metadata.unique,"base64")),t.doctype=Ro.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,F0.default)(e);return t.doctype&&(t.type=Ro.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(r=>({...r,cid:Mo(r.cid)})),t.anchorProof&&(t.anchorProof.txHash=Mo(t.anchorProof.txHash),t.anchorProof.root=Mo(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=Cm[t.anchorStatus]),e.metadata?.model&&(t.metadata.model=Xt.fromString(e.metadata.model)),e.next?.metadata?.model&&(t.next.metadata.model=Xt.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=RS&&(t.metadata.unique=Cr(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Hr.serializeState(e))===JSON.stringify(Hr.serializeState(t))}static isStateSupersetOf(e,t){if(e.log.length<t.log.length)return!1;for(let r in t.log)if(!e.log[r].cid.equals(t.log[r].cid))return!1;return!(e.log.length===t.log.length&&e.anchorStatus!=t.anchorStatus)}static assertCommitLinksToState(e,t){let r=this.streamIdFromState(e);if(t.id&&!t.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${r.toString()}. Found: ${t.id}, expected ${e.log[0].cid}`);let n=e.log[e.log.length-1].cid;if(!t.prev.equals(n))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${n}, found 'prev' ${t.prev}`)}static async convertCommitToSignedCommitContainer(e,t){if(Hr.isSignedCommit(e)){let r=await t.block.get(e.link);return{jws:e,linkedBlock:r}}return e}static isSignedCommitContainer(e){return e&&e.jws!==void 0}static isSignedCommit(e){return e&&e.link!==void 0}static isAnchorCommit(e){return e&&e.proof!==void 0}static isSignedCommitData(e){return e&&e.envelope!==void 0}static isAnchorCommitData(e){return e&&e.proof!==void 0}},"StreamUtils");o(Hr,"StreamUtils");var eD=i(class extends vq{next(e){let t=this.value;Hr.statesEqual(t,e)||super.next(e)}},"StreamStateSubject");o(eD,"StreamStateSubject");var Iq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate3"),_i,xb={anchor:!0,publish:!0,pin:!0,sync:ri.PREFER_CACHE},kq={sync:ri.PREFER_CACHE},NS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function X0(e,t){if(typeof e?.schema=="string")try{Er.fromString(e.schema)}catch{throw new Error("Schema must be a CommitID")}let r={controllers:e?.controllers,family:e?.family,schema:e?.schema?.toString(),tags:e?.tags};if(t)e?.deterministic||(r.unique=Ir((0,uq.randomBytes)(12),"base64")),e?.forbidControllerChange&&(r.forbidControllerChange=!0);else{if(e?.deterministic!==void 0||e?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(e?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(r).forEach(n=>r[n]===void 0&&delete r[n]),r}i(X0,"headerFromMetadata");o(X0,"headerFromMetadata");async function g6(e){if(!e.did)throw new Error("No DID provided");return e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`)),e.did}i(g6,"getAuthenticatedDID");o(g6,"getAuthenticatedDID");async function Q0(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(Q0,"throwReadOnlyError");o(Q0,"throwReadOnlyError");var Po=_i=o(i(class extends f1{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,cq.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,a={}){a={...xb,...a},!n?.deterministic&&a.syncTimeoutSeconds==null&&(a.syncTimeoutSeconds=0);let s=a.asDID?{did:a.asDID}:t,c=await _i.makeGenesis(s,r,n);return t.createStreamFromGenesis(_i.STREAM_TYPE_ID,c,a)}static async createFromGenesis(t,r,n={}){n={...xb,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=r.data?await _i._signDagJWS(t,r):r;return t.createStreamFromGenesis(_i.STREAM_TYPE_ID,a,n)}static async deterministic(t,r,n={}){if(n={...xb,...n},r={...r,deterministic:!0},r.family==null&&r.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let a=await _i.makeGenesis(t,null,r);return t.createStreamFromGenesis(_i.STREAM_TYPE_ID,a,n)}static async load(t,r,n={}){n={...kq,...n};let a=Ts.from(r);if(a.type!=_i.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${_i.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async update(t,r,n={}){n={...NS,...n};let a=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(a,t,r),c=await this.api.applyCommit(this.id,s,n);this.state$.next(c.state)}async patch(t,r={}){r={...NS,...r};let a={header:X0(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},s=await _i._signDagJWS(this.api,a),c=await this.api.applyCommit(this.id,s,r);this.state$.next(c.state)}makeReadOnly(){this.update=Q0,this.patch=Q0,this.sync=Q0,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let a=await this._makeRawCommit(r,n);return _i._signDagJWS(t,a)}async _makeRawCommit(t,r){r||(r={});let n=X0(r,!1);if(t==null&&(t=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let a=$I.compare(this.content,t),s=this.state.log[0];return{header:n,data:a,prev:this.tip,id:s.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await g6(t);n.controllers=[c.hasParent?c.parent:c.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let a=X0(n,!0);if(n?.deterministic&&r)throw new Error("Initial content must be null when creating a deterministic Tile document");if(r==null){let c={header:a};return Xm(c),c}let s={data:r,header:a};return _i._signDagJWS(t,s)}static async _signDagJWS(t,r){return(await g6(t)).createDagJWS(r)}},"TileDocument2"),"TileDocument");Po.STREAM_TYPE_NAME="tile";Po.STREAM_TYPE_ID=0;Po=_i=Iq([d1()],Po);var Dq=ir(dz(),1);function tD(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(tD,"_checkPrivateRedeclaration2");o(tD,"_checkPrivateRedeclaration");function rD(e,t){return t.get?t.get.call(e):t.value}i(rD,"_classApplyDescriptorGet2");o(rD,"_classApplyDescriptorGet");function nD(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(nD,"_classApplyDescriptorSet2");o(nD,"_classApplyDescriptorSet");function a3(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(a3,"_classExtractFieldDescriptor2");o(a3,"_classExtractFieldDescriptor");function em(e,t){var r=a3(e,t,"get");return rD(e,r)}i(em,"_classPrivateFieldGet2");o(em,"_classPrivateFieldGet");function v6(e,t,r){tD(e,t),t.set(e,r)}i(v6,"_classPrivateFieldInit2");o(v6,"_classPrivateFieldInit");function y6(e,t,r){var n=a3(e,t,"set");return nD(e,n,r),r}i(y6,"_classPrivateFieldSet2");o(y6,"_classPrivateFieldSet");function iD(e){return typeof e=="string"||Er.isInstance(e)||Xt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(iD,"keyToQuery");o(iD,"keyToQuery");function tm(e){return typeof e=="string"?Ts.from(e).toString():Er.isInstance(e)||Xt.isInstance(e)?e.toString():e.streamId.toString()}i(tm,"keyToString");o(tm,"keyToString");async function aD(e){let t=await Po.makeGenesis({},null,{...e,deterministic:!0}),r=await Xt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(aD,"getDeterministicQuery");o(aD,"getDeterministicQuery");var Oq=o(()=>Promise.resolve([]),"tempBatchLoadFn"),j0=new WeakMap,Tb=new WeakMap,Rq=i(class extends Dq.default{cache(e){if(!em(this,Tb))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,r){let n=await Po.create(em(this,j0),e,t,r);return this.cache(n),n}async deterministic(e,t){let r=await aD(e);try{return await super.load(r)}catch{let a=await Po.createFromGenesis(em(this,j0),r.genesis,t);return this.cache(a),a}}async load(e){return await super.load(e)}async update(e,t,r,n){let a=tm(e);this.clear(a);let s=await this.load({streamId:a});return await s.update(t,r,n),s}constructor(e){super(Oq,{cache:!0,cacheKeyFn:tm,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),v6(this,j0,{writable:!0,value:void 0}),v6(this,Tb,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let r=await e.ceramic.multiQuery(t.map(iD),e.multiqueryTimeout);return t.map(n=>{let a=tm(n),s=r[a];return s||new Error(`Failed to load stream: ${a}`)})},y6(this,j0,e.ceramic),y6(this,Tb,!!e.cache)}},"TileLoader");o(Rq,"TileLoader");function b6(e){return typeof e=="string"?Xt.fromString(e):e}i(b6,"typeStreamID");o(b6,"typeStreamID");function oD(e,t){let r=new URL(e);for(let[n,a]of Object.entries(t))Xt.isInstance(a)?r.searchParams.set(n,a.toString()):typeof a=="object"?r.searchParams.set(n,JSON.stringify(a)):r.searchParams.set(n,a);return r}i(oD,"serializeObjectToSearchParams");o(oD,"serializeObjectToSearchParams");function w6(e){let t={};for(let[r,n]of Object.entries(e))Xt.isInstance(n)?t[r]=n.toString():t[r]=n;return t}i(w6,"serializeObjectForHttpPost");o(w6,"serializeObjectForHttpPost");var Ki=i(class extends dn{constructor(e,t,r){super(n=>{this.state$.observers.length===0&&(this.periodicSubscription=i3(0,r).pipe(Jk(()=>this._syncState(this.id,{sync:ri.PREFER_CACHE}))).subscribe()),this.state$.subscribe(n).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new eD(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,t){let r=await Ki._load(e,this._apiUrl,t);this.state$.next(Hr.deserializeState(r))}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,t,r,n,a){let s=new URL("./streams",e),{state:c}=await Ai(s,{method:"post",body:{type:t,genesis:Hr.serializeCommit(r),opts:n}});return new Ki(Hr.deserializeState(c),e,a)}static async applyCommit(e,t,r,n,a){let s=new URL("./commits",e),{state:c}=await Ai(s,{method:"post",body:{streamId:t.toString(),commit:Hr.serializeCommit(r),opts:n}});return new Ki(Hr.deserializeState(c),e,a)}static async _load(e,t,r){let n=oD(new URL(`./streams/${e}`,t),r),{state:a}=await Ai(n);return a}static async load(e,t,r,n){let a=await Ki._load(e,t,n);return new Ki(Hr.deserializeState(a),t,r)}static async loadStreamCommits(e,t){let r=new URL(`./commits/${e}`,t),{commits:n}=await Ai(r);return n.map(a=>({cid:a.cid,value:Hr.deserializeCommit(a.value)}))}complete(){this.state$.complete()}},"Document");o(Ki,"Document");var Id;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC",e[e.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(Id||(Id={}));var PS=ir(Vd(),1),BS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(BS||(BS={}));var _6;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(_6||(_6={}));var sD=i(class extends dn{constructor(e,t){super(r=>{e.subscribe(r)}),this.state$=e,this._context=t}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,PS.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Er.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Er.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===_6.ANCHOR).map(({cid:e})=>Er.make(this.id,e))}get state(){return(0,PS.default)(this.state$.value)}async sync(e={}){e={sync:Id.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}},"Stream2");o(sD,"Stream");function cD(){return e=>{}}i(cD,"StreamStatic2");o(cD,"StreamStatic");function uD(e){if(typeof e=="string"&&e.includes("@")){let[t,r]=e.split("@");if(!t||!r)throw new Error("Invalid accountId provided");return new Sd({address:t,chainId:r})}return new Sd(e)}i(uD,"normalizeAccountId");o(uD,"normalizeAccountId");var Nq="(?:%[0-9a-fA-F]{2})",LS=`(?:[a-zA-Z0-9._-]|${Nq})`,Pq="([a-z0-9]+)",Bq=`((?:${LS}*:)*(${LS}+))`,US="[a-zA-Z0-9_.:%-]",Lq=`;${US}+=${US}*`,Uq=`((${Lq})*)`,Fq="(/[^#?]*)?",jq="([?][^#]*)?",$q="(#.*)?",zq=new RegExp(`^did:${Pq}:${Bq}${Uq}${Fq}${jq}${$q}$`);function lD(e){if(e===""||!e)return null;let t=e.match(zq);if(t){let r={did:`did:${t[1]}:${t[2]}`,method:t[1],id:t[2],didUrl:e};if(t[4]){let n=t[4].slice(1).split(";");r.params={};for(let a of n){let s=a.split("=");r.params[s[0]]=s[1]}}return t[6]&&(r.path=t[6]),t[7]&&(r.query=t[7].slice(1)),t[8]&&(r.fragment=t[8].slice(1)),r}return null}i(lD,"parse2");o(lD,"parse");var Hq=ir(Vd(),1),qq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate4"),xc,Cb=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),FS={anchor:!1,publish:!0,sync:Id.PREFER_CACHE},Mb={anchor:!0,publish:!0},Vq={sync:Id.PREFER_CACHE},al=xc=o(i(class extends sD{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,Hq.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(t,r,n={}){n={...FS,...n};let a=uD(r),s=xc.makeGenesis(a);return xc.fromGenesis(t,s,n)}static async fromGenesis(t,r,n={}){return n={...FS,...n},t.createStreamFromGenesis(xc.STREAM_TYPE_ID,r,n)}async setDid(t,r,n={}){n={...Mb,...n};let a=typeof t=="string"?t.trim():t.id;if(lD(a)?.did!==a)throw new Error(`DID is not valid: '${a}'`);let c=await r.createLink(a);return this.setDidProof(c,n)}async setDidProof(t,r={}){r={...Mb,...r};let n=this.makeCommit(t),a=await this.api.applyCommit(this.id,n,r);this.state$.next(a.state)}async clearDid(t,r={}){r={...Mb,...r};let n=await t.createLink("");return this.setDidProof(n,r)}static async load(t,r,n={}){n={...Vq,...n};let a=Ts.from(r);if(a.type!=xc.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${xc.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}static makeGenesis(t){return t.chainId.namespace==="eip155"&&(t.address=t.address.toLowerCase()),{header:{controllers:[`${t.address}@${t.chainId.toString()}`],family:`caip10-${t.chainId.toString()}`}}}makeCommit(t){return{data:t,prev:this.tip,id:this.id.cid}}makeReadOnly(){this.setDidProof=Cb,this.setDid=Cb,this.sync=Cb,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link2"),"Caip10Link");al.STREAM_TYPE_NAME="caip10-link";al.STREAM_TYPE_ID=1;al=xc=qq([cD()],al);Ja();bl();var Kq=ir(Az(),1),Gq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate5"),Va,Wq={sync:ri.PREFER_CACHE};async function E6(e){if(e.did==null)throw new Error("No DID provided");e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`))}i(E6,"_ensureAuthenticated");o(E6,"_ensureAuthenticated");async function fD(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(fD,"throwReadOnlyError3");o(fD,"throwReadOnlyError");var Bc=Va=o(i(class extends f1{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:Va.MODEL}}static async create(t,r,n){Va.assertComplete(r);let a={publish:!0,anchor:!0,pin:!0,sync:ri.NEVER_SYNC,throwOnInvalidCommit:!0},s=await Va._makeGenesis(t,r,n);return await t.createStreamFromGenesis(Va.STREAM_TYPE_ID,s,a)}static assertComplete(t,r){if(!t.name)throw r?new Error(`Model with StreamID ${r.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!t.schema)throw r?new Error(`Model ${t.name} (${r.toString()}) is missing a 'schema' field`):new Error(`Model ${t.name} is missing a 'schema' field`);if(!t.accountRelation)throw r?new Error(`Model ${t.name} (${r.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${t.name} is missing a 'accountRelation' field`)}static async load(t,r,n={}){n={...Wq,...n};let a=Ts.from(r);if(a.type!=Va.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Va.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return await t.loadStream(a,n)}static async _makeGenesis(t,r,n){let a=await this._makeRawGenesis(t,r,n);return Va._signDagJWS(t,a)}static async _makeRawGenesis(t,r,n){if(r==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(t.did)await E6(t),n={controller:t.did.hasParent?t.did.parent:t.did.id};else throw new Error("No controller specified");let a={controllers:[n.controller],model:Va.MODEL.bytes};return{data:r,header:a}}makeReadOnly(){this.sync=fD,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(t,r){return await E6(t),t.did.createDagJWS(r)}},"Model2"),"Model");Bc.STREAM_TYPE_NAME="model";Bc.STREAM_TYPE_ID=2;Bc.MODEL=function(){let e=Xm("model-v1"),t=Kq.default.encode(e,"identity"),r=tl(fm,t),n=Vt.createV1(fm,r);return new Xt("UNLOADABLE",n)}();Bc=Va=Gq([d1()],Bc);var Zq=ir(El(),1),Jq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate6"),fa,Yq={anchor:!0,publish:!0,pin:!0,sync:ri.NEVER_SYNC,syncTimeoutSeconds:0},Xq={anchor:!1,publish:!1,pin:!0,sync:ri.PREFER_CACHE},Qq={sync:ri.PREFER_CACHE},jS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function A6(e){if(e.did==null)throw new Error("No DID provided");e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`))}i(A6,"_ensureAuthenticated2");o(A6,"_ensureAuthenticated");async function rm(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(rm,"throwReadOnlyError4");o(rm,"throwReadOnlyError");var ol=fa=o(i(class extends f1{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let t=this.state$.value.metadata;return{controller:t.controllers[0],model:t.model}}static async create(t,r,n,a={}){a={...Yq,...a};let s=a.asDID?{did:a.asDID}:t,c=await fa._makeGenesis(s,r,n);return t.createStreamFromGenesis(fa.STREAM_TYPE_ID,c,a)}static async single(t,r,n={}){n={...Xq,...n};let a=n.asDID?{did:n.asDID}:t;r={...r,deterministic:!0};let s=await fa._makeGenesis(a,null,r);return t.createStreamFromGenesis(fa.STREAM_TYPE_ID,s,n)}static async load(t,r,n={}){n={...Qq,...n};let a=Ts.from(r);if(a.type!=fa.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${fa.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async replace(t,r={}){r={...jS,...r};let n=r.asDID?{did:r.asDID}:this.api,a=await this._makeCommit(n,t),s=await this.api.applyCommit(this.id,a,r);this.state$.next(s.state)}async patch(t,r={}){r={...jS,...r};let n={data:t,prev:this.tip,id:this.id.cid},a=await fa._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,a,r);this.state$.next(s.state)}makeReadOnly(){this.replace=rm,this.patch=rm,this.sync=rm,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(t,r){let n=this._makeRawCommit(r);return fa._signDagJWS(t,n)}_makeRawCommit(t){return{data:$I.compare(this.content,t||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(t,r,n){let a=await this._makeRawGenesis(t,r,n);return n.deterministic?(Xm(a),a):fa._signDagJWS(t,a)}static async _makeRawGenesis(t,r,n){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");let a=n.controller;if(!a)if(t.did)await A6(t),a=t.did.hasParent?t.did.parent:t.did.id;else throw new Error("No controller specified");let s={controllers:[a],model:n.model.bytes};return n.deterministic||(s.unique=(0,Zq.randomBytes)(12)),{data:r,header:s}}static async _signDagJWS(t,r){return await A6(t),t.did.createDagJWS(r)}},"ModelInstanceDocument2"),"ModelInstanceDocument");ol.STREAM_TYPE_NAME="MID";ol.STREAM_TYPE_ID=3;ol=fa=Jq([d1()],ol);var dD=i(class{constructor(e){this._apiUrl=e}async add(e,t){let r={};t&&(r.force=!0);let n=new URL(`./pins/${e}`,this._apiUrl);await Ai(n,{method:"post",body:r})}async rm(e,t){let r=new URL(`./pins/${e}`,this._apiUrl);await Ai(r,{method:"delete",body:{opts:t}})}async ls(e){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let r=await Ai(t),{pinnedStreamIds:n}=r;return{[Symbol.asyncIterator](){let a=0;return{next(){return a===n.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:n[a++],done:!1})}}}}}},"RemotePinApi");o(dD,"RemotePinApi");var hD=i(class{constructor(e){this._fetchJson=Ai,this._collectionURL=new URL("./collection",e),this._countURL=new URL("./collection/count",e)}async count(e){return(await this._fetchJson(this._countURL,{method:"POST",body:w6(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:w6(e)});return{edges:t.edges.map(n=>({cursor:n.cursor,node:Hr.deserializeState(n.node)})),pageInfo:t.pageInfo}}},"RemoteIndexApi");o(hD,"RemoteIndexApi");var pD=i(class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=Ai,this.modelsPath="./admin/models",this.getCodePath="./admin/getCode"}getCodeUrl(){return new URL(this.getCodePath,this._apiUrl)}getModelsUrl(){return new URL(this.modelsPath,this._apiUrl)}async buildJWS(e,t,r){let n=r?{models:r.map(s=>s.toString())}:void 0,a=await e.createJWS({code:t,requestPath:this.getModelsUrl().pathname,requestBody:n});return`${a.signatures[0].protected}.${a.payload}.${a.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}async getIndexedModels(){let e=await this.generateCode();return(await this._fetchJson(this.getModelsUrl(),{headers:{Authorization:`Basic ${await this.buildJWS(this._getDidFn(),e)}`}})).models.map(r=>Xt.fromString(r))}async stopIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}},"RemoteAdminApi");o(pD,"RemoteAdminApi");var eV="/api/v0/",tV="http://localhost:7007",rV={syncInterval:5e3},nV={anchor:!0,publish:!0,sync:ri.PREFER_CACHE},iV={anchor:!0,publish:!0,sync:ri.PREFER_CACHE},$S={sync:ri.PREFER_CACHE},aV=i(class{constructor(e=tV,t={}){this._config={...rV,...t},this._apiUrl=new URL(eV,e),this._streamCache=new Map,this.context={api:this},this.pin=new dD(this._apiUrl),this.index=new hD(this._apiUrl);let r=(()=>this.did).bind(this);this.admin=new pD(this._apiUrl,r),this._streamConstructors={[al.STREAM_TYPE_ID]:al,[Bc.STREAM_TYPE_ID]:Bc,[ol.STREAM_TYPE_ID]:ol,[Po.STREAM_TYPE_ID]:Po}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,r={}){r={...iV,...r};let n=await Ki.createFromGenesis(this._apiUrl,e,t,r,this._config.syncInterval),a=this._streamCache.get(n.id.toString());return a?(Hr.statesEqual(n.state,a.state)||a.next(n.state),this.buildStreamFromDocument(a)):(this._streamCache.set(n.id.toString(),n),this.buildStreamFromDocument(n))}async loadStream(e,t={}){t={...$S,...t};let r=Ts.from(e),n=this._streamCache.get(r.baseID.toString());return n?await n._syncState(r,t):(n=await Ki.load(r,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(n.id.toString(),n)),this.buildStreamFromDocument(n)}async multiQuery(e,t){let r=e.map(s=>({...s,streamId:typeof s.streamId=="string"?s.streamId:s.streamId.toString()})),n=new URL("./multiqueries",this._apiUrl),a=await Ai(n,{method:"post",body:{queries:r,timeout:t}});return Object.entries(a).reduce((s,c)=>{let[l,d]=c,p=Hr.deserializeState(d),g=new Ki(p,this._apiUrl,this._config.syncInterval);return s[l]=this.buildStreamFromDocument(g),s},{})}loadStreamCommits(e){let t=b6(e);return Ki.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,r={}){r={...nV,...r};let n=b6(e),a=await Ki.applyCommit(this._apiUrl,n,t,r,this._config.syncInterval),s=this._streamCache.get(n.toString());return s?(s.next(a.state),this.buildStreamFromDocument(a)):(this._streamCache.set(n.toString(),a),this.buildStreamFromDocument(a))}async requestAnchor(e,t={}){t={...$S,...t};let{anchorStatus:r}=await Ai(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return r}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new Ki(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(t)}buildStreamFromDocument(e){let t=e.state.type,r=this._streamConstructors[t];if(!r)throw new Error(`Failed to find constructor for stream ${t}`);return new r(e,this.context)}async setDID(e){this.context.did=e}async getSupportedChains(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=await Ai(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}},"CeramicClient");o(aV,"CeramicClient");var nr;(function(e){e.assertEqual=a=>a;function t(a){}i(t,"assertIs"),o(t,"assertIs"),e.assertIs=t;function r(a){throw new Error}i(r,"assertNever"),o(r,"assertNever"),e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}i(n,"joinValues"),o(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(nr||(nr={}));var S6;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(S6||(S6={}));var it=nr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bs=o(e=>{switch(typeof e){case"undefined":return it.undefined;case"string":return it.string;case"number":return isNaN(e)?it.nan:it.number;case"boolean":return it.boolean;case"function":return it.function;case"bigint":return it.bigint;case"symbol":return it.symbol;case"object":return Array.isArray(e)?it.array:e===null?it.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?it.promise:typeof Map<"u"&&e instanceof Map?it.map:typeof Set<"u"&&e instanceof Set?it.set:typeof Date<"u"&&e instanceof Date?it.date:it.object;default:return it.unknown}},"getParsedType"),Ve=nr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),oV=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Si=i(class extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(a){return a.message},r={_errors:[]},n=o(a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)r._errors.push(t(s));else{let c=r,l=0;for(;l<s.path.length;){let d=s.path[l];l===s.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(s))):c[d]=c[d]||{_errors:[]},c=c[d],l++}}},"processError");return n(this),r}static assert(e){if(!(e instanceof Si))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,nr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}},"ZodError");o(Si,"ZodError");Si.create=e=>new Si(e);var sl=o((e,t)=>{let r;switch(e.code){case Ve.invalid_type:e.received===it.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ve.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nr.jsonStringifyReplacer)}`;break;case Ve.unrecognized_keys:r=`Unrecognized key(s) in object: ${nr.joinValues(e.keys,", ")}`;break;case Ve.invalid_union:r="Invalid input";break;case Ve.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nr.joinValues(e.options)}`;break;case Ve.invalid_enum_value:r=`Invalid enum value. Expected ${nr.joinValues(e.options)}, received '${e.received}'`;break;case Ve.invalid_arguments:r="Invalid function arguments";break;case Ve.invalid_return_type:r="Invalid function return type";break;case Ve.invalid_date:r="Invalid date";break;case Ve.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:nr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Ve.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Ve.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Ve.custom:r="Invalid input";break;case Ve.invalid_intersection_types:r="Intersection results could not be merged";break;case Ve.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ve.not_finite:r="Number must be finite";break;default:r=t.defaultError,nr.assertNever(e)}return{message:r}},"errorMap"),mD=sl;function gD(e){mD=e}i(gD,"setErrorMap");o(gD,"setErrorMap");function kd(){return mD}i(kd,"getErrorMap");o(kd,"getErrorMap");var Mm=o(e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="",d=n.filter(p=>!!p).slice().reverse();for(let p of d)l=p(c,{data:t,defaultError:l}).message;return{...a,path:s,message:l}},"makeIssue"),sV=[];function Qe(e,t){let r=kd(),n=Mm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===sl?void 0:sl].filter(a=>!!a)});e.common.issues.push(n)}i(Qe,"addIssueToContext");o(Qe,"addIssueToContext");var xn=i(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return kt;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let a=await n.key,s=await n.value;r.push({key:a,value:s})}return xn.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:a,value:s}=n;if(a.status==="aborted"||s.status==="aborted")return kt;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}},"ParseStatus");o(xn,"ParseStatus");var kt=Object.freeze({status:"aborted"}),Ju=o(e=>({status:"dirty",value:e}),"DIRTY"),Ln=o(e=>({status:"valid",value:e}),"OK"),x6=o(e=>e.status==="aborted","isAborted"),T6=o(e=>e.status==="dirty","isDirty"),Dd=o(e=>e.status==="valid","isValid"),Od=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");function Rd(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}i(Rd,"__classPrivateFieldGet2");o(Rd,"__classPrivateFieldGet");function o3(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r}i(o3,"__classPrivateFieldSet2");o(o3,"__classPrivateFieldSet");var wt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(wt||(wt={}));var hd,pd,Ea=i(class{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},"ParseInputLazyPath");o(Ea,"ParseInputLazyPath");var zS=o((e,t)=>{if(Dd(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Si(e.common.issues);return this._error=r,this._error}}},"handleResult");function Ut(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:o((c,l)=>{var d,p;let{message:g}=e;return c.code==="invalid_enum_value"?{message:g??l.defaultError}:typeof l.data>"u"?{message:(d=g??n)!==null&&d!==void 0?d:l.defaultError}:c.code!=="invalid_type"?{message:l.defaultError}:{message:(p=g??r)!==null&&p!==void 0?p:l.defaultError}},"customMap"),description:a}}i(Ut,"processCreateParams");o(Ut,"processCreateParams");var zt=i(class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return bs(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:bs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xn,ctx:{common:e.parent.common,data:e.data,parsedType:bs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Od(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:(r=t?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bs(e)},a=this._parseSync({data:e,path:n.path,parent:n});return zS(n,a)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bs(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Od(n)?n:Promise.resolve(n));return zS(r,a)}refine(e,t){let r=o(n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t,"getIssueProperties");return this._refinement((n,a)=>{let s=e(n),c=o(()=>a.addIssue({code:Ve.custom,...r(n)}),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(c(),!1)):s?!0:(c(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new Wi({schema:this,typeName:Mt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return wa.create(this,this._def)}nullable(){return Bo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ba.create(this,this._def)}promise(){return jc.create(this,this._def)}or(e){return fl.create([this,e],this._def)}and(e){return dl.create(this,e,this._def)}transform(e){return new Wi({...Ut(this._def),schema:this,typeName:Mt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new gl({...Ut(this._def),innerType:this,defaultValue:t,typeName:Mt.ZodDefault})}brand(){return new p1({typeName:Mt.ZodBranded,type:this,...Ut(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new vl({...Ut(this._def),innerType:this,catchValue:t,typeName:Mt.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return th.create(this,e)}readonly(){return yl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");o(zt,"ZodType");var cV=/^c[^\s-]{8,}$/i,uV=/^[0-9a-z]+$/,lV=/^[0-9A-HJKMNP-TV-Z]{26}$/,fV=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dV=/^[a-z0-9_-]{21}$/i,hV=/^[-+]?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)?)??$/,pV=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ib,gV=/^(?:(?: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])$/,vV=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,yV=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vD="((\\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])))",bV=new RegExp(`^${vD}$`);function s3(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}i(s3,"timeRegexSource");o(s3,"timeRegexSource");function yD(e){return new RegExp(`^${s3(e)}$`)}i(yD,"timeRegex");o(yD,"timeRegex");function c3(e){let t=`${vD}T${s3(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}i(c3,"datetimeRegex");o(c3,"datetimeRegex");function bD(e,t){return!!((t==="v4"||!t)&&gV.test(e)||(t==="v6"||!t)&&vV.test(e))}i(bD,"isValidIP");o(bD,"isValidIP");var va=i(class extends zt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==it.string){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_type,expected:it.string,received:a.parsedType}),kt}let r=new xn,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let s=e.data.length>a.value,c=e.data.length<a.value;(s||c)&&(n=this._getOrReturnCtx(e,n),s?Qe(n,{code:Ve.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):c&&Qe(n,{code:Ve.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")pV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"email",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Ib||(Ib=new RegExp(mV,"u")),Ib.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"emoji",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")fV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"uuid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")dV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"nanoid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")cV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"cuid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")uV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"cuid2",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")lV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"ulid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),Qe(n,{validation:"url",code:Ve.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"regex",code:Ve.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?c3(a).test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?bV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?yD(a).test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?hV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"duration",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?bD(e.data,a.version)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"ip",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?yV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"base64",code:Ve.invalid_string,message:a.message}),r.dirty()):nr.assertNever(a);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(n=>e.test(n),{validation:t,code:Ve.invalid_string,...wt.errToObj(r)})}_addCheck(e){return new va({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...wt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...wt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...wt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...wt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...wt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...wt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...wt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...wt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...wt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...wt.errToObj(e)})}datetime(e){var t,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,local:(r=e?.local)!==null&&r!==void 0?r:!1,...wt.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...wt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...wt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...wt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...wt.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...wt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...wt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...wt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...wt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...wt.errToObj(t)})}nonempty(e){return this.min(1,wt.errToObj(e))}trim(){return new va({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new va({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new va({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}},"ZodString");o(va,"ZodString");va.create=e=>{var t;return new va({checks:[],typeName:Mt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ut(e)})};function wD(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}i(wD,"floatSafeRemainder");o(wD,"floatSafeRemainder");var Ms=i(class extends zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==it.number){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_type,expected:it.number,received:a.parsedType}),kt}let r,n=new xn;for(let a of this._def.checks)a.kind==="int"?nr.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?wD(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.not_finite,message:a.message}),n.dirty()):nr.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,wt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,wt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,wt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,wt.toString(t))}setLimit(e,t,r,n){return new Ms({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:wt.toString(n)}]})}_addCheck(e){return new Ms({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:wt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:wt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:wt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:wt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:wt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:wt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:wt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:wt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:wt.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&nr.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}},"ZodNumber");o(Ms,"ZodNumber");Ms.create=e=>new Ms({checks:[],typeName:Mt.ZodNumber,coerce:e?.coerce||!1,...Ut(e)});var Is=i(class extends zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==it.bigint){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_type,expected:it.bigint,received:a.parsedType}),kt}let r,n=new xn;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):nr.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,wt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,wt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,wt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,wt.toString(t))}setLimit(e,t,r,n){return new Is({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:wt.toString(n)}]})}_addCheck(e){return new Is({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:wt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:wt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:wt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:wt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:wt.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}},"ZodBigInt");o(Is,"ZodBigInt");Is.create=e=>{var t;return new Is({checks:[],typeName:Mt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ut(e)})};var cl=i(class extends zt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==it.boolean){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.boolean,received:r.parsedType}),kt}return Ln(e.data)}},"ZodBoolean");o(cl,"ZodBoolean");cl.create=e=>new cl({typeName:Mt.ZodBoolean,coerce:e?.coerce||!1,...Ut(e)});var Lc=i(class extends zt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==it.date){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_type,expected:it.date,received:a.parsedType}),kt}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_date}),kt}let r=new xn,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):nr.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Lc({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:wt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:wt.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}},"ZodDate");o(Lc,"ZodDate");Lc.create=e=>new Lc({checks:[],coerce:e?.coerce||!1,typeName:Mt.ZodDate,...Ut(e)});var Nd=i(class extends zt{_parse(e){if(this._getType(e)!==it.symbol){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.symbol,received:r.parsedType}),kt}return Ln(e.data)}},"ZodSymbol");o(Nd,"ZodSymbol");Nd.create=e=>new Nd({typeName:Mt.ZodSymbol,...Ut(e)});var ul=i(class extends zt{_parse(e){if(this._getType(e)!==it.undefined){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.undefined,received:r.parsedType}),kt}return Ln(e.data)}},"ZodUndefined");o(ul,"ZodUndefined");ul.create=e=>new ul({typeName:Mt.ZodUndefined,...Ut(e)});var ll=i(class extends zt{_parse(e){if(this._getType(e)!==it.null){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.null,received:r.parsedType}),kt}return Ln(e.data)}},"ZodNull");o(ll,"ZodNull");ll.create=e=>new ll({typeName:Mt.ZodNull,...Ut(e)});var Uc=i(class extends zt{constructor(){super(...arguments),this._any=!0}_parse(e){return Ln(e.data)}},"ZodAny");o(Uc,"ZodAny");Uc.create=e=>new Uc({typeName:Mt.ZodAny,...Ut(e)});var _s=i(class extends zt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ln(e.data)}},"ZodUnknown");o(_s,"ZodUnknown");_s.create=e=>new _s({typeName:Mt.ZodUnknown,...Ut(e)});var Ka=i(class extends zt{_parse(e){let t=this._getOrReturnCtx(e);return Qe(t,{code:Ve.invalid_type,expected:it.never,received:t.parsedType}),kt}},"ZodNever");o(Ka,"ZodNever");Ka.create=e=>new Ka({typeName:Mt.ZodNever,...Ut(e)});var Pd=i(class extends zt{_parse(e){if(this._getType(e)!==it.undefined){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.void,received:r.parsedType}),kt}return Ln(e.data)}},"ZodVoid");o(Pd,"ZodVoid");Pd.create=e=>new Pd({typeName:Mt.ZodVoid,...Ut(e)});var ba=i(class extends zt{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==it.array)return Qe(t,{code:Ve.invalid_type,expected:it.array,received:t.parsedType}),kt;if(n.exactLength!==null){let s=t.data.length>n.exactLength.value,c=t.data.length<n.exactLength.value;(s||c)&&(Qe(t,{code:s?Ve.too_big:Ve.too_small,minimum:c?n.exactLength.value:void 0,maximum:s?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(Qe(t,{code:Ve.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(Qe(t,{code:Ve.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((s,c)=>n.type._parseAsync(new Ea(t,s,t.path,c)))).then(s=>xn.mergeArray(r,s));let a=[...t.data].map((s,c)=>n.type._parseSync(new Ea(t,s,t.path,c)));return xn.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new ba({...this._def,minLength:{value:e,message:wt.toString(t)}})}max(e,t){return new ba({...this._def,maxLength:{value:e,message:wt.toString(t)}})}length(e,t){return new ba({...this._def,exactLength:{value:e,message:wt.toString(t)}})}nonempty(e){return this.min(1,e)}},"ZodArray");o(ba,"ZodArray");ba.create=(e,t)=>new ba({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Mt.ZodArray,...Ut(t)});function Cc(e){if(e instanceof Or){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=wa.create(Cc(n))}return new Or({...e._def,shape:()=>t})}else return e instanceof ba?new ba({...e._def,type:Cc(e.element)}):e instanceof wa?wa.create(Cc(e.unwrap())):e instanceof Bo?Bo.create(Cc(e.unwrap())):e instanceof Ga?Ga.create(e.items.map(t=>Cc(t))):e}i(Cc,"deepPartialify");o(Cc,"deepPartialify");var Or=i(class extends zt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=nr.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==it.object){let d=this._getOrReturnCtx(e);return Qe(d,{code:Ve.invalid_type,expected:it.object,received:d.parsedType}),kt}let{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ka&&this._def.unknownKeys==="strip"))for(let d in n.data)s.includes(d)||c.push(d);let l=[];for(let d of s){let p=a[d],g=n.data[d];l.push({key:{status:"valid",value:d},value:p._parse(new Ea(n,g,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof Ka){let d=this._def.unknownKeys;if(d==="passthrough")for(let p of c)l.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(d==="strict")c.length>0&&(Qe(n,{code:Ve.unrecognized_keys,keys:c}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let p of c){let g=n.data[p];l.push({key:{status:"valid",value:p},value:d._parse(new Ea(n,g,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let d=[];for(let p of l){let g=await p.key,v=await p.value;d.push({key:g,value:v,alwaysSet:p.alwaysSet})}return d}).then(d=>xn.mergeObjectSync(r,d)):xn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return wt.errToObj,new Or({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,a,s,c;let l=(s=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,r).message)!==null&&s!==void 0?s:r.defaultError;return t.code==="unrecognized_keys"?{message:(c=wt.errToObj(e).message)!==null&&c!==void 0?c:l}:{message:l}}}:{}})}strip(){return new Or({...this._def,unknownKeys:"strip"})}passthrough(){return new Or({...this._def,unknownKeys:"passthrough"})}extend(e){return new Or({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Or({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Mt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Or({...this._def,catchall:e})}pick(e){let t={};return nr.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Or({...this._def,shape:()=>t})}omit(e){let t={};return nr.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Or({...this._def,shape:()=>t})}deepPartial(){return Cc(this)}partial(e){let t={};return nr.objectKeys(this.shape).forEach(r=>{let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}),new Or({...this._def,shape:()=>t})}required(e){let t={};return nr.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof wa;)a=a._def.innerType;t[r]=a}}),new Or({...this._def,shape:()=>t})}keyof(){return u3(nr.objectKeys(this.shape))}},"ZodObject");o(Or,"ZodObject");Or.create=(e,t)=>new Or({shape:()=>e,unknownKeys:"strip",catchall:Ka.create(),typeName:Mt.ZodObject,...Ut(t)});Or.strictCreate=(e,t)=>new Or({shape:()=>e,unknownKeys:"strict",catchall:Ka.create(),typeName:Mt.ZodObject,...Ut(t)});Or.lazycreate=(e,t)=>new Or({shape:e,unknownKeys:"strip",catchall:Ka.create(),typeName:Mt.ZodObject,...Ut(t)});var fl=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(let c of a)if(c.result.status==="valid")return c.result;for(let c of a)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let s=a.map(c=>new Si(c.ctx.common.issues));return Qe(t,{code:Ve.invalid_union,unionErrors:s}),kt}if(i(n,"handleResults"),o(n,"handleResults"),t.common.async)return Promise.all(r.map(async a=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(n);{let a,s=[];for(let l of r){let d={...t,common:{...t.common,issues:[]},parent:null},p=l._parseSync({data:t.data,path:t.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let c=s.map(l=>new Si(l));return Qe(t,{code:Ve.invalid_union,unionErrors:c}),kt}}get options(){return this._def.options}},"ZodUnion");o(fl,"ZodUnion");fl.create=(e,t)=>new fl({options:e,typeName:Mt.ZodUnion,...Ut(t)});var Io=o(e=>e instanceof hl?Io(e.schema):e instanceof Wi?Io(e.innerType()):e instanceof pl?[e.value]:e instanceof ks?e.options:e instanceof ml?nr.objectValues(e.enum):e instanceof gl?Io(e._def.innerType):e instanceof ul?[void 0]:e instanceof ll?[null]:e instanceof wa?[void 0,...Io(e.unwrap())]:e instanceof Bo?[null,...Io(e.unwrap())]:e instanceof p1||e instanceof yl?Io(e.unwrap()):e instanceof vl?Io(e._def.innerType):[],"getDiscriminator"),h1=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==it.object)return Qe(t,{code:Ve.invalid_type,expected:it.object,received:t.parsedType}),kt;let r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(Qe(t,{code:Ve.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),kt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let a of t){let s=Io(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of s){if(n.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);n.set(c,a)}}return new h1({typeName:Mt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Ut(r)})}},"ZodDiscriminatedUnion");o(h1,"ZodDiscriminatedUnion");function Im(e,t){let r=bs(e),n=bs(t);if(e===t)return{valid:!0,data:e};if(r===it.object&&n===it.object){let a=nr.objectKeys(t),s=nr.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let d=Im(e[l],t[l]);if(!d.valid)return{valid:!1};c[l]=d.data}return{valid:!0,data:c}}else if(r===it.array&&n===it.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],d=Im(c,l);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===it.date&&n===it.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(Im,"mergeValues");o(Im,"mergeValues");var dl=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=o((a,s)=>{if(x6(a)||x6(s))return kt;let c=Im(a.value,s.value);return c.valid?((T6(a)||T6(s))&&t.dirty(),{status:t.value,value:c.data}):(Qe(r,{code:Ve.invalid_intersection_types}),kt)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>n(a,s)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}},"ZodIntersection");o(dl,"ZodIntersection");dl.create=(e,t,r)=>new dl({left:e,right:t,typeName:Mt.ZodIntersection,...Ut(r)});var Ga=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==it.array)return Qe(r,{code:Ve.invalid_type,expected:it.array,received:r.parsedType}),kt;if(r.data.length<this._def.items.length)return Qe(r,{code:Ve.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),kt;!this._def.rest&&r.data.length>this._def.items.length&&(Qe(r,{code:Ve.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...r.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new Ea(r,s,r.path,c)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>xn.mergeArray(t,s)):xn.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new Ga({...this._def,rest:e})}},"ZodTuple");o(Ga,"ZodTuple");Ga.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ga({items:e,typeName:Mt.ZodTuple,rest:null,...Ut(t)})};var Bd=i(class extends zt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==it.object)return Qe(r,{code:Ve.invalid_type,expected:it.object,received:r.parsedType}),kt;let n=[],a=this._def.keyType,s=this._def.valueType;for(let c in r.data)n.push({key:a._parse(new Ea(r,c,r.path,c)),value:s._parse(new Ea(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?xn.mergeObjectAsync(t,n):xn.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof zt?new Bd({keyType:e,valueType:t,typeName:Mt.ZodRecord,...Ut(r)}):new Bd({keyType:va.create(),valueType:e,typeName:Mt.ZodRecord,...Ut(t)})}},"ZodRecord");o(Bd,"ZodRecord");var Ld=i(class extends zt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==it.map)return Qe(r,{code:Ve.invalid_type,expected:it.map,received:r.parsedType}),kt;let n=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([c,l],d)=>({key:n._parse(new Ea(r,c,r.path,[d,"key"])),value:a._parse(new Ea(r,l,r.path,[d,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let l of s){let d=await l.key,p=await l.value;if(d.status==="aborted"||p.status==="aborted")return kt;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(d.value,p.value)}return{status:t.value,value:c}})}else{let c=new Map;for(let l of s){let d=l.key,p=l.value;if(d.status==="aborted"||p.status==="aborted")return kt;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(d.value,p.value)}return{status:t.value,value:c}}}},"ZodMap");o(Ld,"ZodMap");Ld.create=(e,t,r)=>new Ld({valueType:t,keyType:e,typeName:Mt.ZodMap,...Ut(r)});var Fc=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==it.set)return Qe(r,{code:Ve.invalid_type,expected:it.set,received:r.parsedType}),kt;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(Qe(r,{code:Ve.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(Qe(r,{code:Ve.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function s(l){let d=new Set;for(let p of l){if(p.status==="aborted")return kt;p.status==="dirty"&&t.dirty(),d.add(p.value)}return{status:t.value,value:d}}i(s,"finalizeSet"),o(s,"finalizeSet");let c=[...r.data.values()].map((l,d)=>a._parse(new Ea(r,l,r.path,d)));return r.common.async?Promise.all(c).then(l=>s(l)):s(c)}min(e,t){return new Fc({...this._def,minSize:{value:e,message:wt.toString(t)}})}max(e,t){return new Fc({...this._def,maxSize:{value:e,message:wt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}},"ZodSet");o(Fc,"ZodSet");Fc.create=(e,t)=>new Fc({valueType:e,minSize:null,maxSize:null,typeName:Mt.ZodSet,...Ut(t)});var Xu=i(class extends zt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==it.function)return Qe(t,{code:Ve.invalid_type,expected:it.function,received:t.parsedType}),kt;function r(c,l){return Mm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kd(),sl].filter(d=>!!d),issueData:{code:Ve.invalid_arguments,argumentsError:l}})}i(r,"makeArgsIssue"),o(r,"makeArgsIssue");function n(c,l){return Mm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kd(),sl].filter(d=>!!d),issueData:{code:Ve.invalid_return_type,returnTypeError:l}})}i(n,"makeReturnsIssue"),o(n,"makeReturnsIssue");let a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof jc){let c=this;return Ln(async function(...l){let d=new Si([]),p=await c._def.args.parseAsync(l,a).catch(y=>{throw d.addIssue(r(l,y)),d}),g=await Reflect.apply(s,this,p);return await c._def.returns._def.type.parseAsync(g,a).catch(y=>{throw d.addIssue(n(g,y)),d})})}else{let c=this;return Ln(function(...l){let d=c._def.args.safeParse(l,a);if(!d.success)throw new Si([r(l,d.error)]);let p=Reflect.apply(s,this,d.data),g=c._def.returns.safeParse(p,a);if(!g.success)throw new Si([n(p,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xu({...this._def,args:Ga.create(e).rest(_s.create())})}returns(e){return new Xu({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Xu({args:e||Ga.create([]).rest(_s.create()),returns:t||_s.create(),typeName:Mt.ZodFunction,...Ut(r)})}},"ZodFunction");o(Xu,"ZodFunction");var hl=i(class extends zt{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}},"ZodLazy");o(hl,"ZodLazy");hl.create=(e,t)=>new hl({getter:e,typeName:Mt.ZodLazy,...Ut(t)});var pl=i(class extends zt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Qe(t,{received:t.data,code:Ve.invalid_literal,expected:this._def.value}),kt}return{status:"valid",value:e.data}}get value(){return this._def.value}},"ZodLiteral");o(pl,"ZodLiteral");pl.create=(e,t)=>new pl({value:e,typeName:Mt.ZodLiteral,...Ut(t)});function u3(e,t){return new ks({values:e,typeName:Mt.ZodEnum,...Ut(t)})}i(u3,"createZodEnum");o(u3,"createZodEnum");var ks=i(class extends zt{constructor(){super(...arguments),hd.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return Qe(t,{expected:nr.joinValues(r),received:t.parsedType,code:Ve.invalid_type}),kt}if(Rd(this,hd,"f")||o3(this,hd,new Set(this._def.values),"f"),!Rd(this,hd,"f").has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return Qe(t,{received:t.data,code:Ve.invalid_enum_value,options:r}),kt}return Ln(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ks.create(e,{...this._def,...t})}exclude(e,t=this._def){return ks.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}},"ZodEnum");o(ks,"ZodEnum");hd=new WeakMap;ks.create=u3;var ml=i(class extends zt{constructor(){super(...arguments),pd.set(this,void 0)}_parse(e){let t=nr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==it.string&&r.parsedType!==it.number){let n=nr.objectValues(t);return Qe(r,{expected:nr.joinValues(n),received:r.parsedType,code:Ve.invalid_type}),kt}if(Rd(this,pd,"f")||o3(this,pd,new Set(nr.getValidEnumValues(this._def.values)),"f"),!Rd(this,pd,"f").has(e.data)){let n=nr.objectValues(t);return Qe(r,{received:r.data,code:Ve.invalid_enum_value,options:n}),kt}return Ln(e.data)}get enum(){return this._def.values}},"ZodNativeEnum");o(ml,"ZodNativeEnum");pd=new WeakMap;ml.create=(e,t)=>new ml({values:e,typeName:Mt.ZodNativeEnum,...Ut(t)});var jc=i(class extends zt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==it.promise&&t.common.async===!1)return Qe(t,{code:Ve.invalid_type,expected:it.promise,received:t.parsedType}),kt;let r=t.parsedType===it.promise?t.data:Promise.resolve(t.data);return Ln(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}},"ZodPromise");o(jc,"ZodPromise");jc.create=(e,t)=>new jc({type:e,typeName:Mt.ZodPromise,...Ut(t)});var Wi=i(class extends zt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:s=>{Qe(r,s),s.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let s=n.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async c=>{if(t.value==="aborted")return kt;let l=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return l.status==="aborted"?kt:l.status==="dirty"||t.value==="dirty"?Ju(l.value):l});{if(t.value==="aborted")return kt;let c=this._def.schema._parseSync({data:s,path:r.path,parent:r});return c.status==="aborted"?kt:c.status==="dirty"||t.value==="dirty"?Ju(c.value):c}}if(n.type==="refinement"){let s=o(c=>{let l=n.refinement(c,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?kt:(c.status==="dirty"&&t.dirty(),s(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?kt:(c.status==="dirty"&&t.dirty(),s(c.value).then(()=>({status:t.value,value:c.value}))))}if(n.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Dd(s))return s;let c=n.transform(s.value,a);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Dd(s)?Promise.resolve(n.transform(s.value,a)).then(c=>({status:t.value,value:c})):s);nr.assertNever(n)}},"ZodEffects");o(Wi,"ZodEffects");Wi.create=(e,t,r)=>new Wi({schema:e,typeName:Mt.ZodEffects,effect:t,...Ut(r)});Wi.createWithPreprocess=(e,t,r)=>new Wi({schema:t,effect:{type:"preprocess",transform:e},typeName:Mt.ZodEffects,...Ut(r)});var wa=i(class extends zt{_parse(e){return this._getType(e)===it.undefined?Ln(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodOptional");o(wa,"ZodOptional");wa.create=(e,t)=>new wa({innerType:e,typeName:Mt.ZodOptional,...Ut(t)});var Bo=i(class extends zt{_parse(e){return this._getType(e)===it.null?Ln(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodNullable");o(Bo,"ZodNullable");Bo.create=(e,t)=>new Bo({innerType:e,typeName:Mt.ZodNullable,...Ut(t)});var gl=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===it.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}},"ZodDefault");o(gl,"ZodDefault");gl.create=(e,t)=>new gl({innerType:e,typeName:Mt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ut(t)});var vl=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Od(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Si(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Si(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");o(vl,"ZodCatch");vl.create=(e,t)=>new vl({innerType:e,typeName:Mt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ut(t)});var Ud=i(class extends zt{_parse(e){if(this._getType(e)!==it.nan){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.nan,received:r.parsedType}),kt}return{status:"valid",value:e.data}}},"ZodNaN");o(Ud,"ZodNaN");Ud.create=e=>new Ud({typeName:Mt.ZodNaN,...Ut(e)});var wV=Symbol("zod_brand"),p1=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},"ZodBranded");o(p1,"ZodBranded");var th=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return o(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?kt:a.status==="dirty"?(t.dirty(),Ju(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})},"handleAsync")();{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?kt:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new th({in:e,out:t,typeName:Mt.ZodPipeline})}},"ZodPipeline");o(th,"ZodPipeline");var yl=i(class extends zt{_parse(e){let t=this._def.innerType._parse(e),r=o(n=>(Dd(n)&&(n.value=Object.freeze(n.value)),n),"freeze");return Od(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}},"ZodReadonly");o(yl,"ZodReadonly");yl.create=(e,t)=>new yl({innerType:e,typeName:Mt.ZodReadonly,...Ut(t)});function l3(e,t={},r){return e?Uc.create().superRefine((n,a)=>{var s,c;if(!e(n)){let l=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,d=(c=(s=l.fatal)!==null&&s!==void 0?s:r)!==null&&c!==void 0?c:!0,p=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...p,fatal:d})}}):Uc.create()}i(l3,"custom");o(l3,"custom");var _V={object:Or.lazycreate},Mt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Mt||(Mt={}));var EV=o((e,t={message:`Input not instance of ${e.name}`})=>l3(r=>r instanceof e,t),"instanceOfType"),_D=va.create,ED=Ms.create,AV=Ud.create,SV=Is.create,AD=cl.create,xV=Lc.create,TV=Nd.create,CV=ul.create,MV=ll.create,IV=Uc.create,kV=_s.create,DV=Ka.create,OV=Pd.create,RV=ba.create,NV=Or.create,PV=Or.strictCreate,BV=fl.create,LV=h1.create,UV=dl.create,FV=Ga.create,jV=Bd.create,$V=Ld.create,zV=Fc.create,HV=Xu.create,qV=hl.create,VV=pl.create,KV=ks.create,GV=ml.create,WV=jc.create,HS=Wi.create,ZV=wa.create,JV=Bo.create,YV=Wi.createWithPreprocess,XV=th.create,QV=o(()=>_D().optional(),"ostring"),eK=o(()=>ED().optional(),"onumber"),tK=o(()=>AD().optional(),"oboolean"),rK={string:e=>va.create({...e,coerce:!0}),number:e=>Ms.create({...e,coerce:!0}),boolean:e=>cl.create({...e,coerce:!0}),bigint:e=>Is.create({...e,coerce:!0}),date:e=>Lc.create({...e,coerce:!0})},nK=kt,H=Object.freeze({__proto__:null,defaultErrorMap:sl,setErrorMap:gD,getErrorMap:kd,makeIssue:Mm,EMPTY_PATH:sV,addIssueToContext:Qe,ParseStatus:xn,INVALID:kt,DIRTY:Ju,OK:Ln,isAborted:x6,isDirty:T6,isValid:Dd,isAsync:Od,get util(){return nr},get objectUtil(){return S6},ZodParsedType:it,getParsedType:bs,ZodType:zt,datetimeRegex:c3,ZodString:va,ZodNumber:Ms,ZodBigInt:Is,ZodBoolean:cl,ZodDate:Lc,ZodSymbol:Nd,ZodUndefined:ul,ZodNull:ll,ZodAny:Uc,ZodUnknown:_s,ZodNever:Ka,ZodVoid:Pd,ZodArray:ba,ZodObject:Or,ZodUnion:fl,ZodDiscriminatedUnion:h1,ZodIntersection:dl,ZodTuple:Ga,ZodRecord:Bd,ZodMap:Ld,ZodSet:Fc,ZodFunction:Xu,ZodLazy:hl,ZodLiteral:pl,ZodEnum:ks,ZodNativeEnum:ml,ZodPromise:jc,ZodEffects:Wi,ZodTransformer:Wi,ZodOptional:wa,ZodNullable:Bo,ZodDefault:gl,ZodCatch:vl,ZodNaN:Ud,BRAND:wV,ZodBranded:p1,ZodPipeline:th,ZodReadonly:yl,custom:l3,Schema:zt,ZodSchema:zt,late:_V,get ZodFirstPartyTypeKind(){return Mt},coerce:rK,any:IV,array:RV,bigint:SV,boolean:AD,date:xV,discriminatedUnion:LV,effect:HS,enum:KV,function:HV,instanceof:EV,intersection:UV,lazy:qV,literal:VV,map:$V,nan:AV,nativeEnum:GV,never:DV,null:MV,nullable:JV,number:ED,object:NV,oboolean:tK,onumber:eK,optional:ZV,ostring:QV,pipeline:XV,preprocess:YV,promise:WV,record:jV,set:zV,strictObject:PV,string:_D,symbol:TV,transformer:HS,tuple:FV,undefined:CV,union:BV,unknown:kV,void:OV,NEVER:nK,ZodIssueCode:Ve,quotelessJson:oV,ZodError:Si}),sd=Symbol("current"),Ku=Symbol("previous"),cd=o((e,{ref:t,refType:r,param:n,header:a,...s}={})=>({...s,...e}),"mergeOpenApi");function SD(e){if(typeof e.ZodType.prototype.openapi<"u")return;e.ZodType.prototype.openapi=function(s){let{zodOpenApi:c,...l}=this._def,d=new this.constructor({...l,zodOpenApi:{openapi:cd(s,c?.openapi)}});return d._def.zodOpenApi[sd]=d,c&&(d._def.zodOpenApi[Ku]=this),d};let t=e.ZodType.prototype.describe;e.ZodType.prototype.describe=function(...s){let c=t.apply(this,s),l=c._def;if(l.zodOpenApi){let d={...l.zodOpenApi};d.openapi=cd({description:s[0]},d.openapi),d[Ku]=this,d[sd]=c,l.zodOpenApi=d}else l.zodOpenApi={openapi:{description:s[0]},[sd]:c};return c};let r=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...s){let c=r.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=cd({},d.openapi),d[Ku]=this,c._def.zodOpenApi=d}else c._def.zodOpenApi={[Ku]:this};return c};let n=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...s){let c=n.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=cd({},d.openapi),delete d[Ku],delete d[sd],c._def.zodOpenApi=d}return c};let a=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...s){let c=a.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=cd({},d.openapi),delete d[Ku],delete d[sd],c._def.zodOpenApi=d}return c}}i(SD,"extendZodWithOpenApi");o(SD,"extendZodWithOpenApi");SD(H);var iK=Object.defineProperty,aK=o((e,t)=>iK(e,"name",{value:t,configurable:!0}),"__name"),m1=H.array(H.string().or(H.record(H.any()))),JX=H.object({type:H.string().optional(),narrative:H.string().optional()}),g1=H.string().or(H.object({id:H.string(),type:H.string(),caption:H.string().optional()})),oK=H.object({type:H.string().min(1).or(H.string().array().nonempty()),latitude:H.number(),longitude:H.number()}),sK=H.object({type:H.string().min(1).or(H.string().array().nonempty()),addressCountry:H.string().optional(),addressCountryCode:H.string().optional(),addressRegion:H.string().optional(),addressLocality:H.string().optional(),streetAddress:H.string().optional(),postOfficeBoxNumber:H.string().optional(),postalCode:H.string().optional(),geo:oK.optional()}),cK=H.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(H.string()),xD=H.object({type:H.string().min(1).or(H.string().array().nonempty()),identifier:H.string(),identifierType:cK}),Fd=H.string().or(H.object({id:H.string().optional(),type:H.string().or(H.string().array().nonempty().optional()),name:H.string().optional(),url:H.string().optional(),phone:H.string().optional(),description:H.string().optional(),endorsement:H.any().array().optional(),image:g1.optional(),email:H.string().email().optional(),address:sK.optional(),otherIdentifier:xD.array().optional(),official:H.string().optional(),parentOrg:H.any().optional(),familyName:H.string().optional(),givenName:H.string().optional(),additionalName:H.string().optional(),patronymicName:H.string().optional(),honorificPrefix:H.string().optional(),honorificSuffix:H.string().optional(),familyNamePrefix:H.string().optional(),dateOfBirth:H.string().optional()}).catchall(H.any())),C6=H.object({id:H.string().optional()}).catchall(H.any()),$0=H.object({type:H.string(),id:H.string()}).catchall(H.any()),qS=H.object({id:H.string(),type:H.string()}).catchall(H.any()),VS=H.object({id:H.string().optional(),type:H.string()}).catchall(H.any()),KS=H.object({type:H.string(),id:H.string().optional()}).catchall(H.any()),GS=H.object({type:H.string().or(H.string().array().nonempty()),id:H.string().optional()}).catchall(H.any()),km=H.object({"@context":m1,id:H.string().optional(),type:H.string().array().nonempty(),issuer:Fd,credentialSubject:C6.or(C6.array()),refreshService:VS.or(VS.array()).optional(),credentialSchema:qS.or(qS.array()).optional(),issuanceDate:H.string().optional(),expirationDate:H.string().optional(),credentialStatus:$0.or($0.array()).optional(),name:H.string().optional(),description:H.string().optional(),validFrom:H.string().optional(),validUntil:H.string().optional(),status:$0.or($0.array()).optional(),termsOfUse:KS.or(KS.array()).optional(),evidence:GS.or(GS.array()).optional()}).catchall(H.any()),Wa=H.object({type:H.string(),created:H.string(),challenge:H.string().optional(),domain:H.string().optional(),nonce:H.string().optional(),proofPurpose:H.string(),verificationMethod:H.string(),jws:H.string().optional()}).catchall(H.any()),WS=km.extend({proof:Wa.or(Wa.array())}),uK=H.object({"@context":m1,id:H.string().optional(),type:H.string().or(H.string().array().nonempty()),verifiableCredential:WS.or(WS.array()).optional(),holder:H.string().optional()}).catchall(H.any()),YX=uK.extend({proof:Wa.or(Wa.array())}),f3=H.object({kty:H.string(),crv:H.string(),x:H.string(),y:H.string().optional(),n:H.string().optional(),d:H.string().optional()}),XX=f3.omit({d:!0}).extend({d:H.string()}),lK=H.object({alg:H.string(),iv:H.string(),tag:H.string(),epk:f3.partial().optional(),kid:H.string().optional(),apv:H.string().optional(),apu:H.string().optional()}),fK=H.object({header:lK,encrypted_key:H.string()}),dK=H.object({protected:H.string(),iv:H.string(),ciphertext:H.string(),tag:H.string(),aad:H.string().optional(),recipients:fK.array().optional()}),Sc=H.string().or(H.object({"@context":m1.optional(),id:H.string(),type:H.string(),controller:H.string(),publicKeyJwk:f3.optional(),publicKeyBase58:H.string().optional(),blockChainAccountId:H.string().optional()}).catchall(H.any())),hK=H.object({id:H.string(),type:H.string().or(H.string().array().nonempty()),serviceEndpoint:H.any().or(H.any().array().nonempty())}).catchall(H.any()),QX=H.object({"@context":m1,id:H.string(),alsoKnownAs:H.string().optional(),controller:H.string().or(H.string().array().nonempty()).optional(),verificationMethod:Sc.array().optional(),authentication:Sc.array().optional(),assertionMethod:Sc.array().optional(),keyAgreement:Sc.array().optional(),capabilityInvocation:Sc.array().optional(),capabilityDelegation:Sc.array().optional(),publicKey:Sc.array().optional(),service:hK.array().optional(),proof:Wa.or(Wa.array()).optional()}).catchall(H.any()),pK=H.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(H.string()),v1=H.object({type:H.string().array().nonempty(),targetCode:H.string().optional(),targetDescription:H.string().optional(),targetName:H.string(),targetFramework:H.string().optional(),targetType:pK.optional(),targetUrl:H.string()}),mK=H.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),gK=mK.or(H.string()),vK=H.object({id:H.string().optional(),narrative:H.string().optional()}).catchall(H.any()),yK=H.object({id:H.string(),type:H.string().array().nonempty(),endorsementComment:H.string().optional()}),bK=km.extend({credentialSubject:yK,proof:Wa.or(Wa.array()).optional()}),wK=H.object({id:H.string(),"@language":H.string().optional(),version:H.string().optional()}),_K=H.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(H.string()),EK=H.object({id:H.string(),type:H.string().array().nonempty(),alignment:v1.array().optional(),description:H.string().optional(),level:H.string().optional(),name:H.string(),points:H.string().optional()}).catchall(H.any()),AK=H.object({id:H.string(),type:H.string().array().nonempty(),alignment:v1.array().optional(),allowedValue:H.string().array().optional(),name:H.string(),requiredLevel:H.string().optional(),requiredValue:H.string().optional(),resultType:_K,rubricCriterionLevel:EK.array().optional(),valueMax:H.string().optional(),valueMin:H.string().optional()}).catchall(H.any()),SK=H.object({id:H.string().optional(),type:H.string().array().nonempty(),alignment:v1.array().optional(),achievementType:gK.optional(),creator:Fd.optional(),creditsAvailable:H.number().optional(),criteria:vK,description:H.string(),endorsement:bK.array().optional(),fieldOfStudy:H.string().optional(),humanCode:H.string().optional(),image:g1.optional(),"@language":H.string().optional(),name:H.string(),otherIdentifier:xD.array().optional(),related:wK.array().optional(),resultDescription:AK.array().optional(),specialization:H.string().optional(),tag:H.string().array().optional(),version:H.string().optional()}).catchall(H.any()),xK=H.object({type:H.string(),hashed:H.boolean(),identityHash:H.string(),identityType:H.string(),salt:H.string().optional()}),TK=H.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),CK=H.object({type:H.string().array().nonempty(),achievedLevel:H.string().optional(),alignment:v1.array().optional(),resultDescription:H.string().optional(),status:TK.optional(),value:H.string().optional()}).catchall(H.any()),ZS=H.object({id:H.string().optional(),type:H.string().array().nonempty(),activityEndDate:H.string().optional(),activityStartDate:H.string().optional(),creditsEarned:H.number().optional(),achievement:SK.optional(),identifier:xK.array().optional(),image:g1.optional(),licenseNumber:H.string().optional(),narrative:H.string().optional(),result:CK.array().optional(),role:H.string().optional(),source:Fd.optional(),term:H.string().optional()}).catchall(H.any()),MK=H.object({id:H.string().optional(),type:H.string().or(H.string().array().nonempty()),narrative:H.string().optional(),name:H.string().optional(),description:H.string().optional(),genre:H.string().optional(),audience:H.string().optional()}).catchall(H.any()),IK=km.extend({name:H.string().optional(),description:H.string().optional(),image:g1.optional(),credentialSubject:ZS.or(ZS.array()),endorsement:km.array().optional(),evidence:MK.array().optional()}),eQ=IK.extend({proof:Wa.or(Wa.array())}),tQ=H.object({checks:H.string().array(),warnings:H.string().array(),errors:H.string().array()}),TD=H.enum(["Success","Failed","Error"]),rQ=TD.enum,nQ=H.object({check:H.string(),status:TD,message:H.string().optional(),details:H.string().optional()}),iQ=H.object({title:H.string().optional(),createdAt:H.string().optional(),issuer:Fd.optional(),issuee:Fd.optional(),credentialSubject:C6.optional()}),aQ=H.object({id:H.string(),uri:H.string()}).catchall(H.any()),oQ=H.object({limit:H.number(),cursor:H.string().optional(),sort:H.string().optional()}),ni=H.object({cursor:H.string().optional(),hasMore:H.boolean()}),CD=H.object({encryptedRecord:dK,fields:H.string().array()}).catchall(H.any()),sQ=ni.extend({records:CD.array()}),kK=CD.extend({id:H.string()}),cQ=ni.extend({records:kK.array()}),JS=aK(e=>{let t=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!t)throw new Error("Invalid RegExp string format");return{pattern:t[1],flags:t[2]}},"parseRegexString"),DK=H.instanceof(RegExp).or(H.string().refine(e=>{try{return JS(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:t,flags:r}=JS(e);try{return new RegExp(t,r)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),mr=H.string().or(H.object({$in:H.string().array()})).or(H.object({$regex:DK})),OK=H.object({backgroundColor:H.string().optional(),backgroundImage:H.string().optional(),fadeBackgroundImage:H.boolean().optional(),repeatBackgroundImage:H.boolean().optional(),fontColor:H.string().optional(),accentColor:H.string().optional(),accentFontColor:H.string().optional(),idBackgroundImage:H.string().optional(),fadeIdBackgroundImage:H.boolean().optional(),idBackgroundColor:H.string().optional(),repeatIdBackgroundImage:H.boolean().optional()}),Ds=H.object({profileId:H.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:H.string().default("").describe("Human-readable display name for the profile."),shortBio:H.string().default("").describe("Short bio for the profile."),bio:H.string().default("").describe("Longer bio for the profile."),did:H.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:H.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:H.string().optional().describe("Contact email address for the profile."),image:H.string().optional().describe("Profile image URL for the profile."),heroImage:H.string().optional().describe("Hero image URL for the profile."),websiteLink:H.string().optional().describe("Website link for the profile."),isServiceProfile:H.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:H.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:H.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:OK.optional().describe("Display settings for the profile."),role:H.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:H.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')}),uQ=H.object({profileId:mr,displayName:mr,shortBio:mr,bio:mr,email:mr,websiteLink:mr,isServiceProfile:H.boolean(),type:mr}).partial(),lQ=ni.extend({records:Ds.array()}),fQ=H.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),MD=H.object({id:H.string(),created:H.string(),displayName:H.string().default("").optional(),shortBio:H.string().default("").optional(),bio:H.string().default("").optional(),email:H.string().optional(),image:H.string().optional(),heroImage:H.string().optional()}),dQ=ni.extend({records:MD.extend({did:H.string()}).array()}),hQ=H.object({id:mr,displayName:mr,shortBio:mr,bio:mr,email:mr}).partial(),pQ=ni.extend({records:H.object({profile:Ds,manager:MD.extend({did:H.string()}).optional()}).array()}),mQ=H.object({uri:H.string(),to:H.string(),from:H.string(),sent:H.string().datetime(),received:H.string().datetime().optional()}),ID=H.object({role:H.string(),canEdit:H.boolean(),canIssue:H.boolean(),canRevoke:H.boolean(),canManagePermissions:H.boolean(),canIssueChildren:H.string(),canCreateChildren:H.string(),canEditChildren:H.string(),canRevokeChildren:H.string(),canManageChildrenPermissions:H.string(),canManageChildrenProfiles:H.boolean().default(!1).optional(),canViewAnalytics:H.boolean()}),RK=H.object({role:mr,canEdit:H.boolean(),canIssue:H.boolean(),canRevoke:H.boolean(),canManagePermissions:H.boolean(),canIssueChildren:mr,canCreateChildren:mr,canEditChildren:mr,canRevokeChildren:mr,canManageChildrenPermissions:mr,canManageChildrenProfiles:H.boolean(),canViewAnalytics:H.boolean()}).partial(),YS=H.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),NK=H.discriminatedUnion("type",[H.object({type:H.literal(YS.Values.GRANT_PERMISSIONS),data:H.object({claimUri:H.string(),targetUri:H.string(),permissions:ID.partial()})}),H.object({type:H.literal(YS.Values.ADD_ADMIN),data:H.object({claimUri:H.string(),targetUri:H.string()})})]),gQ=H.object({type:mr,data:H.object({claimUri:mr,targetUri:mr,permissions:RK})}).deepPartial(),PK=H.object({id:H.string(),createdAt:H.string(),updatedAt:H.string()}).and(NK),vQ=ni.extend({records:PK.array()}),M6=H.enum(["DRAFT","LIVE"]),BK=H.object({uri:H.string(),name:H.string().optional(),type:H.string().optional(),category:H.string().optional(),status:M6.optional(),autoConnectRecipients:H.boolean().optional(),meta:H.record(H.any()).optional(),claimPermissions:ID.optional()}),yQ=H.object({uri:mr,name:mr,type:mr,category:mr,meta:H.record(mr),status:M6.or(H.object({$in:M6.array()})),autoConnectRecipients:H.boolean()}).partial(),bQ=ni.extend({records:BK.array()}),LK=H.object({to:Ds,from:H.string(),received:H.string().optional(),uri:H.string().optional()}),wQ=ni.extend({records:LK.array()}),_Q=H.object({endpoint:H.string(),name:H.string(),did:H.string().optional()}),EQ=H.object({ttlSeconds:H.number().optional(),totalUses:H.number().optional()}),UK=H.object({endpoint:H.string()}),AQ=H.object({signingAuthority:UK,relationship:H.object({name:H.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:H.string()})}),SQ=H.object({boostUri:H.string(),signingAuthority:H.object({endpoint:H.string(),name:H.string()})}),FK=H.enum(["live","stale","withdrawn"]),jK=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.object({required:H.boolean()})).default({})}).default({}),personal:H.record(H.object({required:H.boolean()})).default({})}).default({}),write:H.object({credentials:H.object({categories:H.record(H.object({required:H.boolean()})).default({})}).default({}),personal:H.record(H.object({required:H.boolean()})).default({})}).default({})}),kD=H.object({contract:jK,owner:Ds,name:H.string(),subtitle:H.string().optional(),description:H.string().optional(),reasonForAccessing:H.string().optional(),image:H.string().optional(),uri:H.string(),needsGuardianConsent:H.boolean().optional(),redirectUrl:H.string().optional(),frontDoorBoostUri:H.string().optional(),createdAt:H.string(),updatedAt:H.string(),expiresAt:H.string().optional(),autoBoosts:H.string().array().optional(),writers:H.array(Ds).optional()}),xQ=ni.extend({records:kD.omit({owner:!0}).array()}),$K=H.object({credentials:H.object({categories:H.record(H.string().array()).default({})}),personal:H.record(H.string()).default({}),date:H.string()}),TQ=ni.extend({records:$K.array()}),zK=H.object({credentials:H.object({category:H.string(),uri:H.string()}).array(),personal:H.record(H.string()).default({}),date:H.string(),contractUri:H.string()}),CQ=ni.extend({records:zK.array()}),DD=H.object({sharing:H.boolean().optional(),shared:H.string().array().optional(),shareAll:H.boolean().optional(),shareUntil:H.string().optional()}),OD=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({shareAll:H.boolean().optional(),sharing:H.boolean().optional(),categories:H.record(DD).default({})}).default({}),personal:H.record(H.string()).default({})}).default({}),write:H.object({credentials:H.object({categories:H.record(H.boolean()).default({})}).default({}),personal:H.record(H.boolean()).default({})}).default({}),deniedWriters:H.array(H.string()).optional()}),MQ=ni.extend({records:H.object({expiresAt:H.string().optional(),oneTime:H.boolean().optional(),terms:OD,contract:kD,uri:H.string(),consenter:Ds,status:FK}).array()}),IQ=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),personal:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),write:H.object({credentials:H.object({categories:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),personal:H.record(H.object({required:H.boolean().optional()})).optional()}).optional()}),kQ=H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional()}),DQ=H.object({credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional(),id:mr.optional()}),HK=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({shareAll:H.boolean().optional(),sharing:H.boolean().optional(),categories:H.record(DD.optional()).optional()}).optional(),personal:H.record(H.string()).optional()}).optional(),write:H.object({credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional()}).optional()}),I6=H.enum(["consent","update","sync","withdraw","write"]),OQ=H.object({terms:HK.optional(),action:I6.or(I6.array()).optional(),date:H.object({$gt:H.string()}).or(H.object({$lt:H.string()})).or(H.object({$eq:H.string()})).optional(),expiresAt:H.object({$gt:H.string()}).or(H.object({$lt:H.string()})).or(H.object({$eq:H.string()})).optional(),oneTime:H.boolean().optional()}),RD=H.object({expiresAt:H.string().optional(),oneTime:H.boolean().optional(),terms:OD.optional(),id:H.string(),action:I6,date:H.string(),uris:H.string().array().optional()}),RQ=ni.extend({records:RD.array()}),qK=H.object({credentialUri:H.string(),termsUri:H.string(),contractUri:H.string(),boostUri:H.string(),category:H.string().optional(),date:H.string()}),NQ=ni.extend({records:qK.array()}),VK=H.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),KK=H.object({title:H.string().optional(),body:H.string().optional()}),GK=H.object({vcUris:H.array(H.string()).optional(),vpUris:H.array(H.string()).optional(),transaction:RD.optional()}),PQ=H.object({type:VK,to:Ds.partial().and(H.object({did:H.string()})),from:Ds.partial().and(H.object({did:H.string()})),message:KK.optional(),data:GK.optional(),sent:H.string().datetime().optional()}),WK="auth-grant:",BQ=H.object({id:H.string(),name:H.string(),description:H.string().optional(),challenge:H.string().startsWith(WK).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:H.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:H.string(),createdAt:H.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:H.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),LQ=H.object({id:H.string()}).catchall(H.any()),ZK=H.enum(["active","revoked"]),UQ=H.object({id:mr,name:mr,description:mr,status:ZK}).partial(),y1=o(e=>`lc:ceramic:${e}`,"streamIdToCeramicURI"),FQ=H.string().refine(e=>e.split(":").length===3&&e.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(e=>e.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var d3=z.object({credentials:Ec.array()}).catchall(z.any()),ND=z.object({id:z.string(),title:z.string(),storageType:z.literal("ceramic").optional()}).catchall(z.any()),h3=z.object({credentials:Ec.or(ND).array()}).strict();var PD={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials"};var b1=i(async(e,{modelData:t,credentialAlias:r}=PD)=>{let n=e.invoke.getCeramicClient(),a=new Jf({ceramic:n,model:t}),s=i(async(g=r)=>{let v=await a.get(g);if(!v)return{credentials:[]};let y=await d3.spa(v);if(y.success)return y.data;let _=await h3.spa(v);if(_.success){let D={credentials:_.data.credentials.map(P=>{if("uri"in P)return P;let{title:Z,id:j,storageType:q,...Q}=P;return{...Q,id:Z,uri:`lc:ceramic:${j.replace("ceramic://","")}`}})};return await a.set(r,D),D}throw console.error(y.error),new Error("Invalid credentials list stored in IDX")},"getCredentialsListFromIdx"),c=i(async(g,v)=>{if(!g)throw new Error("Must provide id to remove");v||(v=r);let y=await s(v);return y.credentials=y.credentials.filter(_=>_.id!==g),a.set(v,y)},"removeCredentialFromIdx"),l=i(async g=>(g||(g=r),a.set(g,{credentials:[]})),"removeAllCredentialsFromIdx"),d=i(async g=>{let v=await Ec.parseAsync(g);if(!v)throw new Error("record is required");if(!v.uri)throw Error("No URI provided");await e.read.get(v.uri);let y=await s(r),_=y.credentials.findIndex(x=>x.id===v.id);return _>-1?y.credentials[_]=v:y.credentials.push(v),y1(await a.set(r,y))},"addCredentialInIdx"),p=i(async g=>{let v=Ec.array().parse(g),y=await s(r);return await Promise.all(v.map(async _=>{await e.read.get(_.uri);let x=y.credentials.findIndex(R=>R.id===_.id);x>-1?y.credentials[x]=_:y.credentials.push(_)})),y1(await a.set(r,y))},"addCredentialsInIdx");return{name:"IDX",displayName:"IDX",description:"Stores a bespoke index of credentials for an individual based on their did",index:{get:async g=>(g.debug?.("learnCard.index.IDX.get"),(await s()).credentials),add:async(g,v)=>{g.debug?.("learnCard.index.IDX.add");try{return await d(v),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},addMany:async(g,v)=>{g.debug?.("learnCard.index.IDX.add");try{return await p(v),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},update:async g=>(g.debug?.("learnCard.index.IDX.update"),!1),remove:async(g,v)=>{g.debug?.("learnCard.index.IDX.remove");try{return await c(v),!0}catch(y){return console.error("Error removing credential from IDX:",y),!1}},removeAll:async g=>{g.debug?.("learnCard.index.IDX.removeAll");try{return await l(),!0}catch(v){return console.error("Error removing credentials from IDX:",v),!1}}},methods:{getCredentialsListFromIdx:async(g,v=r)=>(await s(v)).credentials,getVerifiableCredentialFromIdx:async(g,v)=>{let _=(await s())?.credentials?.find(D=>D?.id===v),x=g.read.get(_?.uri),R=await R0.safeParseAsync(x);return R.success?R.data:void 0},getVerifiableCredentialsFromIdx:async g=>{let y=(await s())?.credentials?.map(_=>_?.uri)??[];return(await Promise.all(y.map(async _=>g.read.get(_)))).filter(_=>!!_)},addVerifiableCredentialInIdx:async(g,v)=>{let y=Ec.parse(v);if(!y)throw new Error("record is required");if(!y.uri)throw Error("No URI provided");await g.read.get(y.uri);let _=await s(r),x=_.credentials.findIndex(R=>R.id===y.id);return x>-1?_.credentials[x]=y:_.credentials.push(y),y1(await a.set(r,_))},removeVerifiableCredentialInIdx:async(g,v)=>c(v),removeAllVerifiableCredentialsInIdx:async()=>l(),getIDXIndex:async()=>a.get(r),setIDXIndex:async(g,v)=>a.set(r,v)}}},"getIDXPlugin");var JK=b1;
|
|
845
|
+
`):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl"),"UnsubscriptionErrorImpl")});function Md(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(Md,"arrRemove");o(Md,"arrRemove");var eh=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i(e,"Subscription2"),o(e,"Subscription"),e.prototype.unsubscribe=function(){var t,r,n,a,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=Pc(c),d=l.next();!d.done;d=l.next()){var p=d.value;p.remove(this)}}catch(R){t={error:R}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}else c.remove(this);var g=this.initialTeardown;if(Ar(g))try{g()}catch(R){s=R instanceof Sb?R.errors:[R]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var y=Pc(v),_=y.next();!_.done;_=y.next()){var x=_.value;try{l6(x)}catch(R){s=s??[],R instanceof Sb?s=Cs(Cs([],No(s)),No(R.errors)):s.push(R)}}}catch(R){n={error:R}}finally{try{_&&!_.done&&(a=y.return)&&a.call(y)}finally{if(n)throw n.error}}}if(s)throw new Sb(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)l6(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Md(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Md(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),ak=eh.EMPTY;function F2(e){return e instanceof eh||e&&"closed"in e&&Ar(e.remove)&&Ar(e.add)&&Ar(e.unsubscribe)}i(F2,"isSubscription");o(F2,"isSubscription");function l6(e){Ar(e)?e():e.unsubscribe()}i(l6,"execFinalizer");o(l6,"execFinalizer");var Zc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Sm={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=Sm.delegate;return a?.setTimeout?a.setTimeout.apply(a,Cs([e,t],No(r))):setTimeout.apply(void 0,Cs([e,t],No(r)))},clearTimeout:function(e){var t=Sm.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function j2(e){Sm.setTimeout(function(){var t=Zc.onUnhandledError;if(t)t(e);else throw e})}i(j2,"reportUnhandledError");o(j2,"reportUnhandledError");function f6(){}i(f6,"noop");o(f6,"noop");var fq=function(){return c1("C",void 0,void 0)}();function ok(e){return c1("E",void 0,e)}i(ok,"errorNotification");o(ok,"errorNotification");function sk(e){return c1("N",e,void 0)}i(sk,"nextNotification");o(sk,"nextNotification");function c1(e,t,r){return{kind:e,value:t,error:r}}i(c1,"createNotification");o(c1,"createNotification");var Ic=null;function vd(e){if(Zc.useDeprecatedSynchronousErrorHandling){var t=!Ic;if(t&&(Ic={errorThrown:!1,error:null}),e(),t){var r=Ic,n=r.errorThrown,a=r.error;if(Ic=null,n)throw a}}else e()}i(vd,"errorContext");o(vd,"errorContext");function ck(e){Zc.useDeprecatedSynchronousErrorHandling&&Ic&&(Ic.errorThrown=!0,Ic.error=e)}i(ck,"captureError");o(ck,"captureError");var $2=function(e){eo(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,F2(r)&&r.add(n)):n.destination=pq,n}return i(t,"Subscriber2"),o(t,"Subscriber"),t.create=function(r,n,a){return new d6(r,n,a)},t.prototype.next=function(r){this.isStopped?Y0(sk(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?Y0(ok(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?Y0(fq,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(eh),dq=Function.prototype.bind;function J0(e,t){return dq.call(e,t)}i(J0,"bind");o(J0,"bind");var hq=function(){function e(t){this.partialObserver=t}return i(e,"ConsumerObserver2"),o(e,"ConsumerObserver"),e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){dd(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){dd(n)}else dd(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){dd(r)}},e}(),d6=function(e){eo(t,e);function t(r,n,a){var s=e.call(this)||this,c;if(Ar(r)||!r)c={next:r??void 0,error:n??void 0,complete:a??void 0};else{var l;s&&Zc.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return s.unsubscribe()},c={next:r.next&&J0(r.next,l),error:r.error&&J0(r.error,l),complete:r.complete&&J0(r.complete,l)}):c=r}return s.destination=new hq(c),s}return i(t,"SafeSubscriber2"),o(t,"SafeSubscriber"),t}($2);function dd(e){Zc.useDeprecatedSynchronousErrorHandling?ck(e):j2(e)}i(dd,"handleUnhandledError");o(dd,"handleUnhandledError");function uk(e){throw e}i(uk,"defaultErrorHandler");o(uk,"defaultErrorHandler");function Y0(e,t){var r=Zc.onStoppedNotification;r&&Sm.setTimeout(function(){return r(e,t)})}i(Y0,"handleStoppedNotification");o(Y0,"handleStoppedNotification");var pq={closed:!0,next:f6,error:uk,complete:f6},z2=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function u1(e){return e}i(u1,"identity3");o(u1,"identity");function lk(e){return e.length===0?u1:e.length===1?e[0]:o(i(function(r){return e.reduce(function(n,a){return a(n)},r)},"piped"),"piped")}i(lk,"pipeFromArray");o(lk,"pipeFromArray");var dn=function(){function e(t){t&&(this._subscribe=t)}return i(e,"Observable2"),o(e,"Observable"),e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var a=this,s=dk(t)?t:new d6(t,r,n);return vd(function(){var c=a,l=c.operator,d=c.source;s.add(l?l.call(s,d):d?a._subscribe(s):a._trySubscribe(s))}),s},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=h6(r),new r(function(a,s){var c=new d6({next:function(l){try{t(l)}catch(d){s(d),c.unsubscribe()}},error:s,complete:a});n.subscribe(c)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[z2]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return lk(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=h6(t),new t(function(n,a){var s;r.subscribe(function(c){return s=c},function(c){return a(c)},function(){return n(s)})})},e.create=function(t){return new e(t)},e}();function h6(e){var t;return(t=e??Zc.Promise)!==null&&t!==void 0?t:Promise}i(h6,"getPromiseCtor");o(h6,"getPromiseCtor");function fk(e){return e&&Ar(e.next)&&Ar(e.error)&&Ar(e.complete)}i(fk,"isObserver");o(fk,"isObserver");function dk(e){return e&&e instanceof $2||fk(e)&&F2(e)}i(dk,"isSubscriber");o(dk,"isSubscriber");function hk(e){return Ar(e?.lift)}i(hk,"hasLift");o(hk,"hasLift");function to(e){return function(t){if(hk(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}i(to,"operate");o(to,"operate");function _a(e,t,r,n,a){return new mq(e,t,r,n,a)}i(_a,"createOperatorSubscriber");o(_a,"createOperatorSubscriber");var mq=function(e){eo(t,e);function t(r,n,a,s,c,l){var d=e.call(this,r)||this;return d.onFinalize=c,d.shouldUnsubscribe=l,d._next=n?function(p){try{n(p)}catch(g){r.error(g)}}:e.prototype._next,d._error=s?function(p){try{s(p)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,d._complete=a?function(){try{a()}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._complete,d}return i(t,"OperatorSubscriber2"),o(t,"OperatorSubscriber"),t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}($2),gq=s1(function(e){return o(i(function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl"),"ObjectUnsubscribedErrorImpl")}),pk=function(e){eo(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return i(t,"Subject2"),o(t,"Subject"),t.prototype.lift=function(r){var n=new kS(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new gq},t.prototype.next=function(r){var n=this;vd(function(){var a,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=Pc(n.currentObservers),l=c.next();!l.done;l=c.next()){var d=l.value;d.next(r)}}catch(p){a={error:p}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}}})},t.prototype.error=function(r){var n=this;vd(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var a=n.observers;a.length;)a.shift().error(r)}})},t.prototype.complete=function(){var r=this;vd(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,a=this,s=a.hasError,c=a.isStopped,l=a.observers;return s||c?ak:(this.currentObservers=null,l.push(r),new eh(function(){n.currentObservers=null,Md(l,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,a=n.hasError,s=n.thrownError,c=n.isStopped;a?r.error(s):c&&r.complete()},t.prototype.asObservable=function(){var r=new dn;return r.source=this,r},t.create=function(r,n){return new kS(r,n)},t}(dn),kS=function(e){eo(t,e);function t(r,n){var a=e.call(this)||this;return a.destination=r,a.source=n,a}return i(t,"AnonymousSubject2"),o(t,"AnonymousSubject"),t.prototype.next=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.next)===null||a===void 0||a.call(n,r)},t.prototype.error=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.error)===null||a===void 0||a.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,a;return(a=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&a!==void 0?a:ak},t}(pk),vq=function(e){eo(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return i(t,"BehaviorSubject2"),o(t,"BehaviorSubject"),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,a=r.thrownError,s=r._value;if(n)throw a;return this._throwIfClosed(),s},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(pk),mk={now:function(){return(mk.delegate||Date).now()},delegate:void 0},yq=function(e){eo(t,e);function t(r,n){return e.call(this)||this}return i(t,"Action2"),o(t,"Action"),t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t}(eh),xm={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=xm.delegate;return a?.setInterval?a.setInterval.apply(a,Cs([e,t],No(r))):setInterval.apply(void 0,Cs([e,t],No(r)))},clearInterval:function(e){var t=xm.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},bq=function(e){eo(t,e);function t(r,n){var a=e.call(this,r,n)||this;return a.scheduler=r,a.work=n,a.pending=!1,a}return i(t,"AsyncAction2"),o(t,"AsyncAction"),t.prototype.schedule=function(r,n){var a;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var s=this.id,c=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(c,s,n)),this.pending=!0,this.delay=n,this.id=(a=this.id)!==null&&a!==void 0?a:this.requestAsyncId(c,this.id,n),this},t.prototype.requestAsyncId=function(r,n,a){return a===void 0&&(a=0),xm.setInterval(r.flush.bind(r,this),a)},t.prototype.recycleAsyncId=function(r,n,a){if(a===void 0&&(a=0),a!=null&&this.delay===a&&this.pending===!1)return n;n!=null&&xm.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var a=this._execute(r,n);if(a)return a;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var a=!1,s;try{this.work(r)}catch(c){a=!0,s=c||new Error("Scheduled action threw falsy error")}if(a)return this.unsubscribe(),s},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,a=r.scheduler,s=a.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Md(s,this),n!=null&&(this.id=this.recycleAsyncId(a,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(yq),DS=function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return i(e,"Scheduler2"),o(e,"Scheduler"),e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=mk.now,e}(),wq=function(e){eo(t,e);function t(r,n){n===void 0&&(n=DS.now);var a=e.call(this,r,n)||this;return a.actions=[],a._active=!1,a}return i(t,"AsyncScheduler2"),o(t,"AsyncScheduler"),t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var a;this._active=!0;do if(a=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,a){for(;r=n.shift();)r.unsubscribe();throw a}},t}(DS),_q=new wq(bq),Eq=_q,gk=new dn(function(e){return e.complete()});function H2(e){return e&&Ar(e.schedule)}i(H2,"isScheduler");o(H2,"isScheduler");function q2(e){return e[e.length-1]}i(q2,"last");o(q2,"last");function vk(e){return H2(q2(e))?e.pop():void 0}i(vk,"popScheduler");o(vk,"popScheduler");function yk(e,t){return typeof q2(e)=="number"?e.pop():t}i(yk,"popNumber");o(yk,"popNumber");var V2=o(function(e){return e&&typeof e.length=="number"&&typeof e!="function"},"isArrayLike");function K2(e){return Ar(e?.then)}i(K2,"isPromise");o(K2,"isPromise");function G2(e){return Ar(e[z2])}i(G2,"isInteropObservable");o(G2,"isInteropObservable");function W2(e){return Symbol.asyncIterator&&Ar(e?.[Symbol.asyncIterator])}i(W2,"isAsyncIterable");o(W2,"isAsyncIterable");function Z2(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}i(Z2,"createInvalidObservableTypeError");o(Z2,"createInvalidObservableTypeError");function bk(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}i(bk,"getSymbolIterator");o(bk,"getSymbolIterator");var wk=bk();function J2(e){return Ar(e?.[wk])}i(J2,"isIterable");o(J2,"isIterable");function Y2(e){return nk(this,arguments,o(i(function(){var r,n,a,s;return U2(this,function(c){switch(c.label){case 0:r=e.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,Rc(r.read())];case 3:return n=c.sent(),a=n.value,s=n.done,s?[4,Rc(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,Rc(a)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"),"readableStreamLikeToAsyncGenerator_1"))}i(Y2,"readableStreamLikeToAsyncGenerator");o(Y2,"readableStreamLikeToAsyncGenerator");function X2(e){return Ar(e?.getReader)}i(X2,"isReadableStreamLike");o(X2,"isReadableStreamLike");function Fo(e){if(e instanceof dn)return e;if(e!=null){if(G2(e))return _k(e);if(V2(e))return Ek(e);if(K2(e))return Ak(e);if(W2(e))return Q2(e);if(J2(e))return Sk(e);if(X2(e))return xk(e)}throw Z2(e)}i(Fo,"innerFrom");o(Fo,"innerFrom");function _k(e){return new dn(function(t){var r=e[z2]();if(Ar(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}i(_k,"fromInteropObservable");o(_k,"fromInteropObservable");function Ek(e){return new dn(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}i(Ek,"fromArrayLike");o(Ek,"fromArrayLike");function Ak(e){return new dn(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,j2)})}i(Ak,"fromPromise");o(Ak,"fromPromise");function Sk(e){return new dn(function(t){var r,n;try{for(var a=Pc(e),s=a.next();!s.done;s=a.next()){var c=s.value;if(t.next(c),t.closed)return}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}t.complete()})}i(Sk,"fromIterable");o(Sk,"fromIterable");function Q2(e){return new dn(function(t){Tk(e,t).catch(function(r){return t.error(r)})})}i(Q2,"fromAsyncIterable");o(Q2,"fromAsyncIterable");function xk(e){return Q2(Y2(e))}i(xk,"fromReadableStreamLike");o(xk,"fromReadableStreamLike");function Tk(e,t){var r,n,a,s;return rk(this,void 0,void 0,function(){var c,l;return U2(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),r=ik(e),d.label=1;case 1:return[4,r.next()];case 2:if(n=d.sent(),!!n.done)return[3,4];if(c=n.value,t.next(c),t.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=d.sent(),a={error:l},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}i(Tk,"process2");o(Tk,"process");function Do(e,t,r,n,a){n===void 0&&(n=0),a===void 0&&(a=!1);var s=t.schedule(function(){r(),a?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!a)return s}i(Do,"executeSchedule");o(Do,"executeSchedule");function e3(e,t){return t===void 0&&(t=0),to(function(r,n){r.subscribe(_a(n,function(a){return Do(n,e,function(){return n.next(a)},t)},function(){return Do(n,e,function(){return n.complete()},t)},function(a){return Do(n,e,function(){return n.error(a)},t)}))})}i(e3,"observeOn");o(e3,"observeOn");function t3(e,t){return t===void 0&&(t=0),to(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}i(t3,"subscribeOn");o(t3,"subscribeOn");function Ck(e,t){return Fo(e).pipe(t3(t),e3(t))}i(Ck,"scheduleObservable");o(Ck,"scheduleObservable");function Mk(e,t){return Fo(e).pipe(t3(t),e3(t))}i(Mk,"schedulePromise");o(Mk,"schedulePromise");function Ik(e,t){return new dn(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}i(Ik,"scheduleArray");o(Ik,"scheduleArray");function kk(e,t){return new dn(function(r){var n;return Do(r,t,function(){n=e[wk](),Do(r,t,function(){var a,s,c;try{a=n.next(),s=a.value,c=a.done}catch(l){r.error(l);return}c?r.complete():r.next(s)},0,!0)}),function(){return Ar(n?.return)&&n.return()}})}i(kk,"scheduleIterable");o(kk,"scheduleIterable");function r3(e,t){if(!e)throw new Error("Iterable cannot be null");return new dn(function(r){Do(r,t,function(){var n=e[Symbol.asyncIterator]();Do(r,t,function(){n.next().then(function(a){a.done?r.complete():r.next(a.value)})},0,!0)})})}i(r3,"scheduleAsyncIterable");o(r3,"scheduleAsyncIterable");function Dk(e,t){return r3(Y2(e),t)}i(Dk,"scheduleReadableStreamLike");o(Dk,"scheduleReadableStreamLike");function Ok(e,t){if(e!=null){if(G2(e))return Ck(e,t);if(V2(e))return Ik(e,t);if(K2(e))return Mk(e,t);if(W2(e))return r3(e,t);if(J2(e))return kk(e,t);if(X2(e))return Dk(e,t)}throw Z2(e)}i(Ok,"scheduled");o(Ok,"scheduled");function Rk(e,t){return t?Ok(e,t):Fo(e)}i(Rk,"from3");o(Rk,"from");var Nk=s1(function(e){return o(i(function(){e(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl"),"EmptyErrorImpl")});function Pk(e){return e instanceof Date&&!isNaN(e)}i(Pk,"isValidDate");o(Pk,"isValidDate");function n3(e,t){return to(function(r,n){var a=0;r.subscribe(_a(n,function(s){n.next(e.call(t,s,a++))}))})}i(n3,"map");o(n3,"map");var Aq=Array.isArray;function Bk(e,t){return Aq(t)?e.apply(void 0,Cs([],No(t))):e(t)}i(Bk,"callOrApply");o(Bk,"callOrApply");function Lk(e){return n3(function(t){return Bk(e,t)})}i(Lk,"mapOneOrManyArgs");o(Lk,"mapOneOrManyArgs");function Uk(e,t,r,n,a,s,c,l){var d=[],p=0,g=0,v=!1,y=o(function(){v&&!d.length&&!p&&t.complete()},"checkComplete"),_=o(function(R){return p<n?x(R):d.push(R)},"outerNext"),x=o(function(R){s&&t.next(R),p++;var D=!1;Fo(r(R,g++)).subscribe(_a(t,function(P){a?.(P),s?_(P):t.next(P)},function(){D=!0},void 0,function(){if(D)try{p--;for(var P=o(function(){var Z=d.shift();c?Do(t,c,function(){return x(Z)}):x(Z)},"_loop_1");d.length&&p<n;)P();y()}catch(Z){t.error(Z)}}))},"doInnerSub");return e.subscribe(_a(t,_,function(){v=!0,y()})),function(){l?.()}}i(Uk,"mergeInternals");o(Uk,"mergeInternals");function l1(e,t,r){return r===void 0&&(r=1/0),Ar(t)?l1(function(n,a){return n3(function(s,c){return t(n,s,a,c)})(Fo(e(n,a)))},r):(typeof t=="number"&&(r=t),to(function(n,a){return Uk(n,a,e,r)}))}i(l1,"mergeMap");o(l1,"mergeMap");function Fk(e){return e===void 0&&(e=1/0),l1(u1,e)}i(Fk,"mergeAll");o(Fk,"mergeAll");var Sq=["addListener","removeListener"],xq=["addEventListener","removeEventListener"],Tq=["on","off"];function Tm(e,t,r,n){if(Ar(r)&&(n=r,r=void 0),n)return Tm(e,t,r).pipe(Lk(n));var a=No(zk(e)?xq.map(function(l){return function(d){return e[l](t,d,r)}}):jk(e)?Sq.map(p6(e,t)):$k(e)?Tq.map(p6(e,t)):[],2),s=a[0],c=a[1];if(!s&&V2(e))return l1(function(l){return Tm(l,t,r)})(Fo(e));if(!s)throw new TypeError("Invalid event target");return new dn(function(l){var d=o(function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];return l.next(1<p.length?p:p[0])},"handler");return s(d),function(){return c(d)}})}i(Tm,"fromEvent");o(Tm,"fromEvent");function p6(e,t){return function(r){return function(n){return e[r](t,n)}}}i(p6,"toCommonHandlerRegistry");o(p6,"toCommonHandlerRegistry");function jk(e){return Ar(e.addListener)&&Ar(e.removeListener)}i(jk,"isNodeStyleEventEmitter");o(jk,"isNodeStyleEventEmitter");function $k(e){return Ar(e.on)&&Ar(e.off)}i($k,"isJQueryStyleEventEmitter");o($k,"isJQueryStyleEventEmitter");function zk(e){return Ar(e.addEventListener)&&Ar(e.removeEventListener)}i(zk,"isEventTarget");o(zk,"isEventTarget");function i3(e,t,r){e===void 0&&(e=0),r===void 0&&(r=Eq);var n=-1;return t!=null&&(H2(t)?r=t:n=t),new dn(function(a){var s=Pk(e)?+e-r.now():e;s<0&&(s=0);var c=0;return r.schedule(function(){a.closed||(a.next(c++),0<=n?this.schedule(void 0,n):a.complete())},s)})}i(i3,"timer");o(i3,"timer");function Hk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=vk(e),n=yk(e,1/0),a=e;return a.length?a.length===1?Fo(a[0]):Fk(n)(Rk(a,r)):gk}i(Hk,"merge");o(Hk,"merge");function qk(e,t){return to(function(r,n){var a=0;r.subscribe(_a(n,function(s){return e.call(t,s,a++)&&n.next(s)}))})}i(qk,"filter");o(qk,"filter");function Vk(e){return to(function(t,r){var n=!1;t.subscribe(_a(r,function(a){n=!0,r.next(a)},function(){n||r.next(e),r.complete()}))})}i(Vk,"defaultIfEmpty");o(Vk,"defaultIfEmpty");function Kk(e){return e<=0?function(){return gk}:to(function(t,r){var n=0;t.subscribe(_a(r,function(a){++n<=e&&(r.next(a),e<=n&&r.complete())}))})}i(Kk,"take");o(Kk,"take");function Gk(e){return e===void 0&&(e=Wk),to(function(t,r){var n=!1;t.subscribe(_a(r,function(a){n=!0,r.next(a)},function(){return n?r.complete():r.error(e())}))})}i(Gk,"throwIfEmpty");o(Gk,"throwIfEmpty");function Wk(){return new Nk}i(Wk,"defaultErrorFactory");o(Wk,"defaultErrorFactory");function Zk(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?qk(function(a,s){return e(a,s,n)}):u1,Kk(1),r?Vk(t):Gk(function(){return new Nk}))}}i(Zk,"first");o(Zk,"first");function Jk(e,t){return to(function(r,n){var a=t??{},s=a.leading,c=s===void 0?!0:s,l=a.trailing,d=l===void 0?!1:l,p=!1,g=null,v=null,y=!1,_=o(function(){v?.unsubscribe(),v=null,d&&(D(),y&&n.complete())},"endThrottling"),x=o(function(){v=null,y&&n.complete()},"cleanupThrottling"),R=o(function(P){return v=Fo(e(P)).subscribe(_a(n,_,x))},"startThrottle"),D=o(function(){if(p){p=!1;var P=g;g=null,n.next(P),!y&&R(P)}},"send");r.subscribe(_a(n,function(P){p=!0,g=P,!(v&&!v.closed)&&(c?D():R(P))},function(){y=!0,!(d&&p&&v&&!v.closed)&&n.complete()}))})}i(Jk,"throttle");o(Jk,"throttle");var OS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(OS||(OS={}));var Cm;(function(e){e[e.NOT_REQUESTED=0]="NOT_REQUESTED",e[e.PENDING=1]="PENDING",e[e.PROCESSING=2]="PROCESSING",e[e.ANCHORED=3]="ANCHORED",e[e.FAILED=4]="FAILED"})(Cm||(Cm={}));var m6;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(m6||(m6={}));var f1=i(class extends dn{constructor(e,t){super(r=>{e.subscribe(r)}),this.state$=e,this._context=t}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,SS.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Er.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Er.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===m6.ANCHOR).map(({cid:e})=>Er.make(this.id,e))}get state(){return(0,SS.default)(this.state$.value)}async sync(e={}){e={sync:ri.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}},"Stream");o(f1,"Stream");function d1(){return e=>{}}i(d1,"StreamStatic");o(d1,"StreamStatic");var Cq=ir(fz(),1);function Yk(e){let t=new AbortController;if(e.length===0)throw Error("Need abort signals to create a merged abort signal");return e.some(r=>r.aborted)?(t.abort(),t.signal):(Hk(...e.map(r=>Tm(r,"abort"))).pipe(Zk()).subscribe(()=>{t.abort()}),t.signal)}i(Yk,"mergeAbortSignals");o(Yk,"mergeAbortSignals");var Xk=i(class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=i3(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}},"TimedAbortSignal");o(Xk,"TimedAbortSignal");async function Qk(e,t){let r=new AbortController,n=o(()=>{r.abort()},"onAbort");return e.addEventListener("abort",n),e.aborted&&r.abort(),t(r.signal).finally(()=>{e.removeEventListener("abort",n)})}i(Qk,"abortable2");o(Qk,"abortable");var Mq=60*1e3*3;async function Ai(e,t={}){t.body&&Object.assign(t,{body:JSON.stringify(t.body),headers:{...t.headers,"Content-Type":"application/json"}});let r=t.timeout||Mq,n=new Xk(r),a=t.signal?Yk([t.signal,n.signal]):n.signal,s=await Qk(a,c=>(0,Cq.default)(String(e),{...t,signal:c})).finally(()=>n.clear());if(!s.ok){let c=await s.text();throw new Error(`HTTP request to '${e}' failed with status '${s.statusText}': ${c}`)}return s.json()}i(Ai,"fetchJson");o(Ai,"fetchJson");var F0=ir(Vd(),1);Ja();function Mo(e){let t=Vt.asCID(e);if(t)return t;if(typeof e=="string")return Vt.parse(e);if(e instanceof Uint8Array)return Vt.decode(e);throw new Error(`${e} cannot be converted to a CID`)}i(Mo,"toCID");o(Mo,"toCID");var RS=0,Hr=i(class{static streamIdFromState(e){return new Xt(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,F0.default)(e);return Hr.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Ir(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Ir(t.cacaoBlock,"base64")),t):(Hr.isSignedCommit(e)&&(t.link=t.link.toString()),Hr.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),e.header?.model&&(t.header.model=Ir(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,F0.default)(e);return Hr.isSignedCommitContainer(t)?(t.jws.link=Mo(t.jws.link),t.linkedBlock=Cr(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Cr(t.cacaoBlock,"base64")),t):(Hr.isSignedCommit(t)&&(t.link=Mo(t.link)),Hr.isAnchorCommit(t)&&(t.proof=Mo(t.proof)),t.id&&(t.id=Mo(t.id)),t.prev&&(t.prev=Mo(t.prev)),t.header?.model&&(t.header.model=Cr(t.header.model,"base64")),t)}static serializeState(e){let t=(0,F0.default)(e);return t.log=t.log.map(r=>({...r,cid:r.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=Cm[t.anchorStatus]),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),e.metadata?.model&&(t.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(t.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=RS&&(t.metadata.unique=Ir(t.metadata.unique,"base64")),t.doctype=Ro.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,F0.default)(e);return t.doctype&&(t.type=Ro.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(r=>({...r,cid:Mo(r.cid)})),t.anchorProof&&(t.anchorProof.txHash=Mo(t.anchorProof.txHash),t.anchorProof.root=Mo(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=Cm[t.anchorStatus]),e.metadata?.model&&(t.metadata.model=Xt.fromString(e.metadata.model)),e.next?.metadata?.model&&(t.next.metadata.model=Xt.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=RS&&(t.metadata.unique=Cr(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Hr.serializeState(e))===JSON.stringify(Hr.serializeState(t))}static isStateSupersetOf(e,t){if(e.log.length<t.log.length)return!1;for(let r in t.log)if(!e.log[r].cid.equals(t.log[r].cid))return!1;return!(e.log.length===t.log.length&&e.anchorStatus!=t.anchorStatus)}static assertCommitLinksToState(e,t){let r=this.streamIdFromState(e);if(t.id&&!t.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${r.toString()}. Found: ${t.id}, expected ${e.log[0].cid}`);let n=e.log[e.log.length-1].cid;if(!t.prev.equals(n))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${n}, found 'prev' ${t.prev}`)}static async convertCommitToSignedCommitContainer(e,t){if(Hr.isSignedCommit(e)){let r=await t.block.get(e.link);return{jws:e,linkedBlock:r}}return e}static isSignedCommitContainer(e){return e&&e.jws!==void 0}static isSignedCommit(e){return e&&e.link!==void 0}static isAnchorCommit(e){return e&&e.proof!==void 0}static isSignedCommitData(e){return e&&e.envelope!==void 0}static isAnchorCommitData(e){return e&&e.proof!==void 0}},"StreamUtils");o(Hr,"StreamUtils");var eD=i(class extends vq{next(e){let t=this.value;Hr.statesEqual(t,e)||super.next(e)}},"StreamStateSubject");o(eD,"StreamStateSubject");var Iq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate3"),_i,xb={anchor:!0,publish:!0,pin:!0,sync:ri.PREFER_CACHE},kq={sync:ri.PREFER_CACHE},NS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function X0(e,t){if(typeof e?.schema=="string")try{Er.fromString(e.schema)}catch{throw new Error("Schema must be a CommitID")}let r={controllers:e?.controllers,family:e?.family,schema:e?.schema?.toString(),tags:e?.tags};if(t)e?.deterministic||(r.unique=Ir((0,uq.randomBytes)(12),"base64")),e?.forbidControllerChange&&(r.forbidControllerChange=!0);else{if(e?.deterministic!==void 0||e?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(e?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(r).forEach(n=>r[n]===void 0&&delete r[n]),r}i(X0,"headerFromMetadata");o(X0,"headerFromMetadata");async function g6(e){if(!e.did)throw new Error("No DID provided");return e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`)),e.did}i(g6,"getAuthenticatedDID");o(g6,"getAuthenticatedDID");async function Q0(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(Q0,"throwReadOnlyError");o(Q0,"throwReadOnlyError");var Po=_i=o(i(class extends f1{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,cq.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,a={}){a={...xb,...a},!n?.deterministic&&a.syncTimeoutSeconds==null&&(a.syncTimeoutSeconds=0);let s=a.asDID?{did:a.asDID}:t,c=await _i.makeGenesis(s,r,n);return t.createStreamFromGenesis(_i.STREAM_TYPE_ID,c,a)}static async createFromGenesis(t,r,n={}){n={...xb,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=r.data?await _i._signDagJWS(t,r):r;return t.createStreamFromGenesis(_i.STREAM_TYPE_ID,a,n)}static async deterministic(t,r,n={}){if(n={...xb,...n},r={...r,deterministic:!0},r.family==null&&r.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let a=await _i.makeGenesis(t,null,r);return t.createStreamFromGenesis(_i.STREAM_TYPE_ID,a,n)}static async load(t,r,n={}){n={...kq,...n};let a=Ts.from(r);if(a.type!=_i.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${_i.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async update(t,r,n={}){n={...NS,...n};let a=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(a,t,r),c=await this.api.applyCommit(this.id,s,n);this.state$.next(c.state)}async patch(t,r={}){r={...NS,...r};let a={header:X0(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},s=await _i._signDagJWS(this.api,a),c=await this.api.applyCommit(this.id,s,r);this.state$.next(c.state)}makeReadOnly(){this.update=Q0,this.patch=Q0,this.sync=Q0,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let a=await this._makeRawCommit(r,n);return _i._signDagJWS(t,a)}async _makeRawCommit(t,r){r||(r={});let n=X0(r,!1);if(t==null&&(t=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let a=$I.compare(this.content,t),s=this.state.log[0];return{header:n,data:a,prev:this.tip,id:s.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await g6(t);n.controllers=[c.hasParent?c.parent:c.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let a=X0(n,!0);if(n?.deterministic&&r)throw new Error("Initial content must be null when creating a deterministic Tile document");if(r==null){let c={header:a};return Xm(c),c}let s={data:r,header:a};return _i._signDagJWS(t,s)}static async _signDagJWS(t,r){return(await g6(t)).createDagJWS(r)}},"TileDocument2"),"TileDocument");Po.STREAM_TYPE_NAME="tile";Po.STREAM_TYPE_ID=0;Po=_i=Iq([d1()],Po);var Dq=ir(dz(),1);function tD(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(tD,"_checkPrivateRedeclaration2");o(tD,"_checkPrivateRedeclaration");function rD(e,t){return t.get?t.get.call(e):t.value}i(rD,"_classApplyDescriptorGet2");o(rD,"_classApplyDescriptorGet");function nD(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(nD,"_classApplyDescriptorSet2");o(nD,"_classApplyDescriptorSet");function a3(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(a3,"_classExtractFieldDescriptor2");o(a3,"_classExtractFieldDescriptor");function em(e,t){var r=a3(e,t,"get");return rD(e,r)}i(em,"_classPrivateFieldGet2");o(em,"_classPrivateFieldGet");function v6(e,t,r){tD(e,t),t.set(e,r)}i(v6,"_classPrivateFieldInit2");o(v6,"_classPrivateFieldInit");function y6(e,t,r){var n=a3(e,t,"set");return nD(e,n,r),r}i(y6,"_classPrivateFieldSet2");o(y6,"_classPrivateFieldSet");function iD(e){return typeof e=="string"||Er.isInstance(e)||Xt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(iD,"keyToQuery");o(iD,"keyToQuery");function tm(e){return typeof e=="string"?Ts.from(e).toString():Er.isInstance(e)||Xt.isInstance(e)?e.toString():e.streamId.toString()}i(tm,"keyToString");o(tm,"keyToString");async function aD(e){let t=await Po.makeGenesis({},null,{...e,deterministic:!0}),r=await Xt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(aD,"getDeterministicQuery");o(aD,"getDeterministicQuery");var Oq=o(()=>Promise.resolve([]),"tempBatchLoadFn"),j0=new WeakMap,Tb=new WeakMap,Rq=i(class extends Dq.default{cache(e){if(!em(this,Tb))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,r){let n=await Po.create(em(this,j0),e,t,r);return this.cache(n),n}async deterministic(e,t){let r=await aD(e);try{return await super.load(r)}catch{let a=await Po.createFromGenesis(em(this,j0),r.genesis,t);return this.cache(a),a}}async load(e){return await super.load(e)}async update(e,t,r,n){let a=tm(e);this.clear(a);let s=await this.load({streamId:a});return await s.update(t,r,n),s}constructor(e){super(Oq,{cache:!0,cacheKeyFn:tm,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),v6(this,j0,{writable:!0,value:void 0}),v6(this,Tb,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let r=await e.ceramic.multiQuery(t.map(iD),e.multiqueryTimeout);return t.map(n=>{let a=tm(n),s=r[a];return s||new Error(`Failed to load stream: ${a}`)})},y6(this,j0,e.ceramic),y6(this,Tb,!!e.cache)}},"TileLoader");o(Rq,"TileLoader");function b6(e){return typeof e=="string"?Xt.fromString(e):e}i(b6,"typeStreamID");o(b6,"typeStreamID");function oD(e,t){let r=new URL(e);for(let[n,a]of Object.entries(t))Xt.isInstance(a)?r.searchParams.set(n,a.toString()):typeof a=="object"?r.searchParams.set(n,JSON.stringify(a)):r.searchParams.set(n,a);return r}i(oD,"serializeObjectToSearchParams");o(oD,"serializeObjectToSearchParams");function w6(e){let t={};for(let[r,n]of Object.entries(e))Xt.isInstance(n)?t[r]=n.toString():t[r]=n;return t}i(w6,"serializeObjectForHttpPost");o(w6,"serializeObjectForHttpPost");var Ki=i(class extends dn{constructor(e,t,r){super(n=>{this.state$.observers.length===0&&(this.periodicSubscription=i3(0,r).pipe(Jk(()=>this._syncState(this.id,{sync:ri.PREFER_CACHE}))).subscribe()),this.state$.subscribe(n).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new eD(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,t){let r=await Ki._load(e,this._apiUrl,t);this.state$.next(Hr.deserializeState(r))}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,t,r,n,a){let s=new URL("./streams",e),{state:c}=await Ai(s,{method:"post",body:{type:t,genesis:Hr.serializeCommit(r),opts:n}});return new Ki(Hr.deserializeState(c),e,a)}static async applyCommit(e,t,r,n,a){let s=new URL("./commits",e),{state:c}=await Ai(s,{method:"post",body:{streamId:t.toString(),commit:Hr.serializeCommit(r),opts:n}});return new Ki(Hr.deserializeState(c),e,a)}static async _load(e,t,r){let n=oD(new URL(`./streams/${e}`,t),r),{state:a}=await Ai(n);return a}static async load(e,t,r,n){let a=await Ki._load(e,t,n);return new Ki(Hr.deserializeState(a),t,r)}static async loadStreamCommits(e,t){let r=new URL(`./commits/${e}`,t),{commits:n}=await Ai(r);return n.map(a=>({cid:a.cid,value:Hr.deserializeCommit(a.value)}))}complete(){this.state$.complete()}},"Document");o(Ki,"Document");var Id;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC",e[e.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(Id||(Id={}));var PS=ir(Vd(),1),BS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(BS||(BS={}));var _6;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(_6||(_6={}));var sD=i(class extends dn{constructor(e,t){super(r=>{e.subscribe(r)}),this.state$=e,this._context=t}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,PS.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Er.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Er.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===_6.ANCHOR).map(({cid:e})=>Er.make(this.id,e))}get state(){return(0,PS.default)(this.state$.value)}async sync(e={}){e={sync:Id.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}},"Stream2");o(sD,"Stream");function cD(){return e=>{}}i(cD,"StreamStatic2");o(cD,"StreamStatic");function uD(e){if(typeof e=="string"&&e.includes("@")){let[t,r]=e.split("@");if(!t||!r)throw new Error("Invalid accountId provided");return new Sd({address:t,chainId:r})}return new Sd(e)}i(uD,"normalizeAccountId");o(uD,"normalizeAccountId");var Nq="(?:%[0-9a-fA-F]{2})",LS=`(?:[a-zA-Z0-9._-]|${Nq})`,Pq="([a-z0-9]+)",Bq=`((?:${LS}*:)*(${LS}+))`,US="[a-zA-Z0-9_.:%-]",Lq=`;${US}+=${US}*`,Uq=`((${Lq})*)`,Fq="(/[^#?]*)?",jq="([?][^#]*)?",$q="(#.*)?",zq=new RegExp(`^did:${Pq}:${Bq}${Uq}${Fq}${jq}${$q}$`);function lD(e){if(e===""||!e)return null;let t=e.match(zq);if(t){let r={did:`did:${t[1]}:${t[2]}`,method:t[1],id:t[2],didUrl:e};if(t[4]){let n=t[4].slice(1).split(";");r.params={};for(let a of n){let s=a.split("=");r.params[s[0]]=s[1]}}return t[6]&&(r.path=t[6]),t[7]&&(r.query=t[7].slice(1)),t[8]&&(r.fragment=t[8].slice(1)),r}return null}i(lD,"parse2");o(lD,"parse");var Hq=ir(Vd(),1),qq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate4"),xc,Cb=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),FS={anchor:!1,publish:!0,sync:Id.PREFER_CACHE},Mb={anchor:!0,publish:!0},Vq={sync:Id.PREFER_CACHE},al=xc=o(i(class extends sD{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,Hq.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(t,r,n={}){n={...FS,...n};let a=uD(r),s=xc.makeGenesis(a);return xc.fromGenesis(t,s,n)}static async fromGenesis(t,r,n={}){return n={...FS,...n},t.createStreamFromGenesis(xc.STREAM_TYPE_ID,r,n)}async setDid(t,r,n={}){n={...Mb,...n};let a=typeof t=="string"?t.trim():t.id;if(lD(a)?.did!==a)throw new Error(`DID is not valid: '${a}'`);let c=await r.createLink(a);return this.setDidProof(c,n)}async setDidProof(t,r={}){r={...Mb,...r};let n=this.makeCommit(t),a=await this.api.applyCommit(this.id,n,r);this.state$.next(a.state)}async clearDid(t,r={}){r={...Mb,...r};let n=await t.createLink("");return this.setDidProof(n,r)}static async load(t,r,n={}){n={...Vq,...n};let a=Ts.from(r);if(a.type!=xc.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${xc.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}static makeGenesis(t){return t.chainId.namespace==="eip155"&&(t.address=t.address.toLowerCase()),{header:{controllers:[`${t.address}@${t.chainId.toString()}`],family:`caip10-${t.chainId.toString()}`}}}makeCommit(t){return{data:t,prev:this.tip,id:this.id.cid}}makeReadOnly(){this.setDidProof=Cb,this.setDid=Cb,this.sync=Cb,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link2"),"Caip10Link");al.STREAM_TYPE_NAME="caip10-link";al.STREAM_TYPE_ID=1;al=xc=qq([cD()],al);Ja();bl();var Kq=ir(Az(),1),Gq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate5"),Va,Wq={sync:ri.PREFER_CACHE};async function E6(e){if(e.did==null)throw new Error("No DID provided");e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`))}i(E6,"_ensureAuthenticated");o(E6,"_ensureAuthenticated");async function fD(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(fD,"throwReadOnlyError3");o(fD,"throwReadOnlyError");var Bc=Va=o(i(class extends f1{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:Va.MODEL}}static async create(t,r,n){Va.assertComplete(r);let a={publish:!0,anchor:!0,pin:!0,sync:ri.NEVER_SYNC,throwOnInvalidCommit:!0},s=await Va._makeGenesis(t,r,n);return await t.createStreamFromGenesis(Va.STREAM_TYPE_ID,s,a)}static assertComplete(t,r){if(!t.name)throw r?new Error(`Model with StreamID ${r.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!t.schema)throw r?new Error(`Model ${t.name} (${r.toString()}) is missing a 'schema' field`):new Error(`Model ${t.name} is missing a 'schema' field`);if(!t.accountRelation)throw r?new Error(`Model ${t.name} (${r.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${t.name} is missing a 'accountRelation' field`)}static async load(t,r,n={}){n={...Wq,...n};let a=Ts.from(r);if(a.type!=Va.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${Va.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return await t.loadStream(a,n)}static async _makeGenesis(t,r,n){let a=await this._makeRawGenesis(t,r,n);return Va._signDagJWS(t,a)}static async _makeRawGenesis(t,r,n){if(r==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(t.did)await E6(t),n={controller:t.did.hasParent?t.did.parent:t.did.id};else throw new Error("No controller specified");let a={controllers:[n.controller],model:Va.MODEL.bytes};return{data:r,header:a}}makeReadOnly(){this.sync=fD,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(t,r){return await E6(t),t.did.createDagJWS(r)}},"Model2"),"Model");Bc.STREAM_TYPE_NAME="model";Bc.STREAM_TYPE_ID=2;Bc.MODEL=function(){let e=Xm("model-v1"),t=Kq.default.encode(e,"identity"),r=tl(fm,t),n=Vt.createV1(fm,r);return new Xt("UNLOADABLE",n)}();Bc=Va=Gq([d1()],Bc);var Zq=ir(El(),1),Jq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate6"),fa,Yq={anchor:!0,publish:!0,pin:!0,sync:ri.NEVER_SYNC,syncTimeoutSeconds:0},Xq={anchor:!1,publish:!1,pin:!0,sync:ri.PREFER_CACHE},Qq={sync:ri.PREFER_CACHE},jS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function A6(e){if(e.did==null)throw new Error("No DID provided");e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`))}i(A6,"_ensureAuthenticated2");o(A6,"_ensureAuthenticated");async function rm(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(rm,"throwReadOnlyError4");o(rm,"throwReadOnlyError");var ol=fa=o(i(class extends f1{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let t=this.state$.value.metadata;return{controller:t.controllers[0],model:t.model}}static async create(t,r,n,a={}){a={...Yq,...a};let s=a.asDID?{did:a.asDID}:t,c=await fa._makeGenesis(s,r,n);return t.createStreamFromGenesis(fa.STREAM_TYPE_ID,c,a)}static async single(t,r,n={}){n={...Xq,...n};let a=n.asDID?{did:n.asDID}:t;r={...r,deterministic:!0};let s=await fa._makeGenesis(a,null,r);return t.createStreamFromGenesis(fa.STREAM_TYPE_ID,s,n)}static async load(t,r,n={}){n={...Qq,...n};let a=Ts.from(r);if(a.type!=fa.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${fa.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async replace(t,r={}){r={...jS,...r};let n=r.asDID?{did:r.asDID}:this.api,a=await this._makeCommit(n,t),s=await this.api.applyCommit(this.id,a,r);this.state$.next(s.state)}async patch(t,r={}){r={...jS,...r};let n={data:t,prev:this.tip,id:this.id.cid},a=await fa._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,a,r);this.state$.next(s.state)}makeReadOnly(){this.replace=rm,this.patch=rm,this.sync=rm,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(t,r){let n=this._makeRawCommit(r);return fa._signDagJWS(t,n)}_makeRawCommit(t){return{data:$I.compare(this.content,t||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(t,r,n){let a=await this._makeRawGenesis(t,r,n);return n.deterministic?(Xm(a),a):fa._signDagJWS(t,a)}static async _makeRawGenesis(t,r,n){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");let a=n.controller;if(!a)if(t.did)await A6(t),a=t.did.hasParent?t.did.parent:t.did.id;else throw new Error("No controller specified");let s={controllers:[a],model:n.model.bytes};return n.deterministic||(s.unique=(0,Zq.randomBytes)(12)),{data:r,header:s}}static async _signDagJWS(t,r){return await A6(t),t.did.createDagJWS(r)}},"ModelInstanceDocument2"),"ModelInstanceDocument");ol.STREAM_TYPE_NAME="MID";ol.STREAM_TYPE_ID=3;ol=fa=Jq([d1()],ol);var dD=i(class{constructor(e){this._apiUrl=e}async add(e,t){let r={};t&&(r.force=!0);let n=new URL(`./pins/${e}`,this._apiUrl);await Ai(n,{method:"post",body:r})}async rm(e,t){let r=new URL(`./pins/${e}`,this._apiUrl);await Ai(r,{method:"delete",body:{opts:t}})}async ls(e){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let r=await Ai(t),{pinnedStreamIds:n}=r;return{[Symbol.asyncIterator](){let a=0;return{next(){return a===n.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:n[a++],done:!1})}}}}}},"RemotePinApi");o(dD,"RemotePinApi");var hD=i(class{constructor(e){this._fetchJson=Ai,this._collectionURL=new URL("./collection",e),this._countURL=new URL("./collection/count",e)}async count(e){return(await this._fetchJson(this._countURL,{method:"POST",body:w6(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:w6(e)});return{edges:t.edges.map(n=>({cursor:n.cursor,node:Hr.deserializeState(n.node)})),pageInfo:t.pageInfo}}},"RemoteIndexApi");o(hD,"RemoteIndexApi");var pD=i(class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=Ai,this.modelsPath="./admin/models",this.getCodePath="./admin/getCode"}getCodeUrl(){return new URL(this.getCodePath,this._apiUrl)}getModelsUrl(){return new URL(this.modelsPath,this._apiUrl)}async buildJWS(e,t,r){let n=r?{models:r.map(s=>s.toString())}:void 0,a=await e.createJWS({code:t,requestPath:this.getModelsUrl().pathname,requestBody:n});return`${a.signatures[0].protected}.${a.payload}.${a.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}async getIndexedModels(){let e=await this.generateCode();return(await this._fetchJson(this.getModelsUrl(),{headers:{Authorization:`Basic ${await this.buildJWS(this._getDidFn(),e)}`}})).models.map(r=>Xt.fromString(r))}async stopIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}},"RemoteAdminApi");o(pD,"RemoteAdminApi");var eV="/api/v0/",tV="http://localhost:7007",rV={syncInterval:5e3},nV={anchor:!0,publish:!0,sync:ri.PREFER_CACHE},iV={anchor:!0,publish:!0,sync:ri.PREFER_CACHE},$S={sync:ri.PREFER_CACHE},aV=i(class{constructor(e=tV,t={}){this._config={...rV,...t},this._apiUrl=new URL(eV,e),this._streamCache=new Map,this.context={api:this},this.pin=new dD(this._apiUrl),this.index=new hD(this._apiUrl);let r=(()=>this.did).bind(this);this.admin=new pD(this._apiUrl,r),this._streamConstructors={[al.STREAM_TYPE_ID]:al,[Bc.STREAM_TYPE_ID]:Bc,[ol.STREAM_TYPE_ID]:ol,[Po.STREAM_TYPE_ID]:Po}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,r={}){r={...iV,...r};let n=await Ki.createFromGenesis(this._apiUrl,e,t,r,this._config.syncInterval),a=this._streamCache.get(n.id.toString());return a?(Hr.statesEqual(n.state,a.state)||a.next(n.state),this.buildStreamFromDocument(a)):(this._streamCache.set(n.id.toString(),n),this.buildStreamFromDocument(n))}async loadStream(e,t={}){t={...$S,...t};let r=Ts.from(e),n=this._streamCache.get(r.baseID.toString());return n?await n._syncState(r,t):(n=await Ki.load(r,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(n.id.toString(),n)),this.buildStreamFromDocument(n)}async multiQuery(e,t){let r=e.map(s=>({...s,streamId:typeof s.streamId=="string"?s.streamId:s.streamId.toString()})),n=new URL("./multiqueries",this._apiUrl),a=await Ai(n,{method:"post",body:{queries:r,timeout:t}});return Object.entries(a).reduce((s,c)=>{let[l,d]=c,p=Hr.deserializeState(d),g=new Ki(p,this._apiUrl,this._config.syncInterval);return s[l]=this.buildStreamFromDocument(g),s},{})}loadStreamCommits(e){let t=b6(e);return Ki.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,r={}){r={...nV,...r};let n=b6(e),a=await Ki.applyCommit(this._apiUrl,n,t,r,this._config.syncInterval),s=this._streamCache.get(n.toString());return s?(s.next(a.state),this.buildStreamFromDocument(a)):(this._streamCache.set(n.toString(),a),this.buildStreamFromDocument(a))}async requestAnchor(e,t={}){t={...$S,...t};let{anchorStatus:r}=await Ai(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return r}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new Ki(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(t)}buildStreamFromDocument(e){let t=e.state.type,r=this._streamConstructors[t];if(!r)throw new Error(`Failed to find constructor for stream ${t}`);return new r(e,this.context)}async setDID(e){this.context.did=e}async getSupportedChains(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=await Ai(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}},"CeramicClient");o(aV,"CeramicClient");var nr;(function(e){e.assertEqual=a=>a;function t(a){}i(t,"assertIs"),o(t,"assertIs"),e.assertIs=t;function r(a){throw new Error}i(r,"assertNever"),o(r,"assertNever"),e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}i(n,"joinValues"),o(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(nr||(nr={}));var S6;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(S6||(S6={}));var it=nr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bs=o(e=>{switch(typeof e){case"undefined":return it.undefined;case"string":return it.string;case"number":return isNaN(e)?it.nan:it.number;case"boolean":return it.boolean;case"function":return it.function;case"bigint":return it.bigint;case"symbol":return it.symbol;case"object":return Array.isArray(e)?it.array:e===null?it.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?it.promise:typeof Map<"u"&&e instanceof Map?it.map:typeof Set<"u"&&e instanceof Set?it.set:typeof Date<"u"&&e instanceof Date?it.date:it.object;default:return it.unknown}},"getParsedType"),Ve=nr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),oV=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Si=i(class extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(a){return a.message},r={_errors:[]},n=o(a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)r._errors.push(t(s));else{let c=r,l=0;for(;l<s.path.length;){let d=s.path[l];l===s.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(s))):c[d]=c[d]||{_errors:[]},c=c[d],l++}}},"processError");return n(this),r}static assert(e){if(!(e instanceof Si))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,nr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}},"ZodError");o(Si,"ZodError");Si.create=e=>new Si(e);var sl=o((e,t)=>{let r;switch(e.code){case Ve.invalid_type:e.received===it.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ve.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nr.jsonStringifyReplacer)}`;break;case Ve.unrecognized_keys:r=`Unrecognized key(s) in object: ${nr.joinValues(e.keys,", ")}`;break;case Ve.invalid_union:r="Invalid input";break;case Ve.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nr.joinValues(e.options)}`;break;case Ve.invalid_enum_value:r=`Invalid enum value. Expected ${nr.joinValues(e.options)}, received '${e.received}'`;break;case Ve.invalid_arguments:r="Invalid function arguments";break;case Ve.invalid_return_type:r="Invalid function return type";break;case Ve.invalid_date:r="Invalid date";break;case Ve.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:nr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Ve.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Ve.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Ve.custom:r="Invalid input";break;case Ve.invalid_intersection_types:r="Intersection results could not be merged";break;case Ve.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ve.not_finite:r="Number must be finite";break;default:r=t.defaultError,nr.assertNever(e)}return{message:r}},"errorMap"),mD=sl;function gD(e){mD=e}i(gD,"setErrorMap");o(gD,"setErrorMap");function kd(){return mD}i(kd,"getErrorMap");o(kd,"getErrorMap");var Mm=o(e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let l="",d=n.filter(p=>!!p).slice().reverse();for(let p of d)l=p(c,{data:t,defaultError:l}).message;return{...a,path:s,message:l}},"makeIssue"),sV=[];function Qe(e,t){let r=kd(),n=Mm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===sl?void 0:sl].filter(a=>!!a)});e.common.issues.push(n)}i(Qe,"addIssueToContext");o(Qe,"addIssueToContext");var xn=i(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return kt;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let a=await n.key,s=await n.value;r.push({key:a,value:s})}return xn.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:a,value:s}=n;if(a.status==="aborted"||s.status==="aborted")return kt;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}},"ParseStatus");o(xn,"ParseStatus");var kt=Object.freeze({status:"aborted"}),Ju=o(e=>({status:"dirty",value:e}),"DIRTY"),Ln=o(e=>({status:"valid",value:e}),"OK"),x6=o(e=>e.status==="aborted","isAborted"),T6=o(e=>e.status==="dirty","isDirty"),Dd=o(e=>e.status==="valid","isValid"),Od=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");function Rd(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}i(Rd,"__classPrivateFieldGet2");o(Rd,"__classPrivateFieldGet");function o3(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r}i(o3,"__classPrivateFieldSet2");o(o3,"__classPrivateFieldSet");var wt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(wt||(wt={}));var hd,pd,Ea=i(class{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},"ParseInputLazyPath");o(Ea,"ParseInputLazyPath");var zS=o((e,t)=>{if(Dd(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Si(e.common.issues);return this._error=r,this._error}}},"handleResult");function Ut(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:o((c,l)=>{var d,p;let{message:g}=e;return c.code==="invalid_enum_value"?{message:g??l.defaultError}:typeof l.data>"u"?{message:(d=g??n)!==null&&d!==void 0?d:l.defaultError}:c.code!=="invalid_type"?{message:l.defaultError}:{message:(p=g??r)!==null&&p!==void 0?p:l.defaultError}},"customMap"),description:a}}i(Ut,"processCreateParams");o(Ut,"processCreateParams");var zt=i(class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return bs(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:bs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xn,ctx:{common:e.parent.common,data:e.data,parsedType:bs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Od(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:(r=t?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bs(e)},a=this._parseSync({data:e,path:n.path,parent:n});return zS(n,a)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bs(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Od(n)?n:Promise.resolve(n));return zS(r,a)}refine(e,t){let r=o(n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t,"getIssueProperties");return this._refinement((n,a)=>{let s=e(n),c=o(()=>a.addIssue({code:Ve.custom,...r(n)}),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(c(),!1)):s?!0:(c(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new Wi({schema:this,typeName:Mt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return wa.create(this,this._def)}nullable(){return Bo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ba.create(this,this._def)}promise(){return jc.create(this,this._def)}or(e){return fl.create([this,e],this._def)}and(e){return dl.create(this,e,this._def)}transform(e){return new Wi({...Ut(this._def),schema:this,typeName:Mt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new gl({...Ut(this._def),innerType:this,defaultValue:t,typeName:Mt.ZodDefault})}brand(){return new p1({typeName:Mt.ZodBranded,type:this,...Ut(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new vl({...Ut(this._def),innerType:this,catchValue:t,typeName:Mt.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return th.create(this,e)}readonly(){return yl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");o(zt,"ZodType");var cV=/^c[^\s-]{8,}$/i,uV=/^[0-9a-z]+$/,lV=/^[0-9A-HJKMNP-TV-Z]{26}$/,fV=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dV=/^[a-z0-9_-]{21}$/i,hV=/^[-+]?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)?)??$/,pV=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ib,gV=/^(?:(?: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])$/,vV=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,yV=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vD="((\\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])))",bV=new RegExp(`^${vD}$`);function s3(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}i(s3,"timeRegexSource");o(s3,"timeRegexSource");function yD(e){return new RegExp(`^${s3(e)}$`)}i(yD,"timeRegex");o(yD,"timeRegex");function c3(e){let t=`${vD}T${s3(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}i(c3,"datetimeRegex");o(c3,"datetimeRegex");function bD(e,t){return!!((t==="v4"||!t)&&gV.test(e)||(t==="v6"||!t)&&vV.test(e))}i(bD,"isValidIP");o(bD,"isValidIP");var va=i(class extends zt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==it.string){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_type,expected:it.string,received:a.parsedType}),kt}let r=new xn,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let s=e.data.length>a.value,c=e.data.length<a.value;(s||c)&&(n=this._getOrReturnCtx(e,n),s?Qe(n,{code:Ve.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):c&&Qe(n,{code:Ve.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")pV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"email",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Ib||(Ib=new RegExp(mV,"u")),Ib.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"emoji",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")fV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"uuid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")dV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"nanoid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")cV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"cuid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")uV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"cuid2",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")lV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"ulid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),Qe(n,{validation:"url",code:Ve.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"regex",code:Ve.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?c3(a).test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?bV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?yD(a).test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?hV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"duration",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?bD(e.data,a.version)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"ip",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?yV.test(e.data)||(n=this._getOrReturnCtx(e,n),Qe(n,{validation:"base64",code:Ve.invalid_string,message:a.message}),r.dirty()):nr.assertNever(a);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(n=>e.test(n),{validation:t,code:Ve.invalid_string,...wt.errToObj(r)})}_addCheck(e){return new va({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...wt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...wt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...wt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...wt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...wt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...wt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...wt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...wt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...wt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...wt.errToObj(e)})}datetime(e){var t,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,local:(r=e?.local)!==null&&r!==void 0?r:!1,...wt.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...wt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...wt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...wt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...wt.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...wt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...wt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...wt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...wt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...wt.errToObj(t)})}nonempty(e){return this.min(1,wt.errToObj(e))}trim(){return new va({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new va({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new va({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}},"ZodString");o(va,"ZodString");va.create=e=>{var t;return new va({checks:[],typeName:Mt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ut(e)})};function wD(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}i(wD,"floatSafeRemainder");o(wD,"floatSafeRemainder");var Ms=i(class extends zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==it.number){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_type,expected:it.number,received:a.parsedType}),kt}let r,n=new xn;for(let a of this._def.checks)a.kind==="int"?nr.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?wD(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.not_finite,message:a.message}),n.dirty()):nr.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,wt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,wt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,wt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,wt.toString(t))}setLimit(e,t,r,n){return new Ms({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:wt.toString(n)}]})}_addCheck(e){return new Ms({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:wt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:wt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:wt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:wt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:wt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:wt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:wt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:wt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:wt.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&nr.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}},"ZodNumber");o(Ms,"ZodNumber");Ms.create=e=>new Ms({checks:[],typeName:Mt.ZodNumber,coerce:e?.coerce||!1,...Ut(e)});var Is=i(class extends zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==it.bigint){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_type,expected:it.bigint,received:a.parsedType}),kt}let r,n=new xn;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Qe(r,{code:Ve.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):nr.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,wt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,wt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,wt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,wt.toString(t))}setLimit(e,t,r,n){return new Is({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:wt.toString(n)}]})}_addCheck(e){return new Is({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:wt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:wt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:wt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:wt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:wt.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}},"ZodBigInt");o(Is,"ZodBigInt");Is.create=e=>{var t;return new Is({checks:[],typeName:Mt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ut(e)})};var cl=i(class extends zt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==it.boolean){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.boolean,received:r.parsedType}),kt}return Ln(e.data)}},"ZodBoolean");o(cl,"ZodBoolean");cl.create=e=>new cl({typeName:Mt.ZodBoolean,coerce:e?.coerce||!1,...Ut(e)});var Lc=i(class extends zt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==it.date){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_type,expected:it.date,received:a.parsedType}),kt}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return Qe(a,{code:Ve.invalid_date}),kt}let r=new xn,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),Qe(n,{code:Ve.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):nr.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Lc({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:wt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:wt.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}},"ZodDate");o(Lc,"ZodDate");Lc.create=e=>new Lc({checks:[],coerce:e?.coerce||!1,typeName:Mt.ZodDate,...Ut(e)});var Nd=i(class extends zt{_parse(e){if(this._getType(e)!==it.symbol){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.symbol,received:r.parsedType}),kt}return Ln(e.data)}},"ZodSymbol");o(Nd,"ZodSymbol");Nd.create=e=>new Nd({typeName:Mt.ZodSymbol,...Ut(e)});var ul=i(class extends zt{_parse(e){if(this._getType(e)!==it.undefined){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.undefined,received:r.parsedType}),kt}return Ln(e.data)}},"ZodUndefined");o(ul,"ZodUndefined");ul.create=e=>new ul({typeName:Mt.ZodUndefined,...Ut(e)});var ll=i(class extends zt{_parse(e){if(this._getType(e)!==it.null){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.null,received:r.parsedType}),kt}return Ln(e.data)}},"ZodNull");o(ll,"ZodNull");ll.create=e=>new ll({typeName:Mt.ZodNull,...Ut(e)});var Uc=i(class extends zt{constructor(){super(...arguments),this._any=!0}_parse(e){return Ln(e.data)}},"ZodAny");o(Uc,"ZodAny");Uc.create=e=>new Uc({typeName:Mt.ZodAny,...Ut(e)});var _s=i(class extends zt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ln(e.data)}},"ZodUnknown");o(_s,"ZodUnknown");_s.create=e=>new _s({typeName:Mt.ZodUnknown,...Ut(e)});var Ka=i(class extends zt{_parse(e){let t=this._getOrReturnCtx(e);return Qe(t,{code:Ve.invalid_type,expected:it.never,received:t.parsedType}),kt}},"ZodNever");o(Ka,"ZodNever");Ka.create=e=>new Ka({typeName:Mt.ZodNever,...Ut(e)});var Pd=i(class extends zt{_parse(e){if(this._getType(e)!==it.undefined){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.void,received:r.parsedType}),kt}return Ln(e.data)}},"ZodVoid");o(Pd,"ZodVoid");Pd.create=e=>new Pd({typeName:Mt.ZodVoid,...Ut(e)});var ba=i(class extends zt{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==it.array)return Qe(t,{code:Ve.invalid_type,expected:it.array,received:t.parsedType}),kt;if(n.exactLength!==null){let s=t.data.length>n.exactLength.value,c=t.data.length<n.exactLength.value;(s||c)&&(Qe(t,{code:s?Ve.too_big:Ve.too_small,minimum:c?n.exactLength.value:void 0,maximum:s?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(Qe(t,{code:Ve.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(Qe(t,{code:Ve.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((s,c)=>n.type._parseAsync(new Ea(t,s,t.path,c)))).then(s=>xn.mergeArray(r,s));let a=[...t.data].map((s,c)=>n.type._parseSync(new Ea(t,s,t.path,c)));return xn.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new ba({...this._def,minLength:{value:e,message:wt.toString(t)}})}max(e,t){return new ba({...this._def,maxLength:{value:e,message:wt.toString(t)}})}length(e,t){return new ba({...this._def,exactLength:{value:e,message:wt.toString(t)}})}nonempty(e){return this.min(1,e)}},"ZodArray");o(ba,"ZodArray");ba.create=(e,t)=>new ba({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Mt.ZodArray,...Ut(t)});function Cc(e){if(e instanceof Or){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=wa.create(Cc(n))}return new Or({...e._def,shape:()=>t})}else return e instanceof ba?new ba({...e._def,type:Cc(e.element)}):e instanceof wa?wa.create(Cc(e.unwrap())):e instanceof Bo?Bo.create(Cc(e.unwrap())):e instanceof Ga?Ga.create(e.items.map(t=>Cc(t))):e}i(Cc,"deepPartialify");o(Cc,"deepPartialify");var Or=i(class extends zt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=nr.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==it.object){let d=this._getOrReturnCtx(e);return Qe(d,{code:Ve.invalid_type,expected:it.object,received:d.parsedType}),kt}let{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ka&&this._def.unknownKeys==="strip"))for(let d in n.data)s.includes(d)||c.push(d);let l=[];for(let d of s){let p=a[d],g=n.data[d];l.push({key:{status:"valid",value:d},value:p._parse(new Ea(n,g,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof Ka){let d=this._def.unknownKeys;if(d==="passthrough")for(let p of c)l.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(d==="strict")c.length>0&&(Qe(n,{code:Ve.unrecognized_keys,keys:c}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let p of c){let g=n.data[p];l.push({key:{status:"valid",value:p},value:d._parse(new Ea(n,g,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let d=[];for(let p of l){let g=await p.key,v=await p.value;d.push({key:g,value:v,alwaysSet:p.alwaysSet})}return d}).then(d=>xn.mergeObjectSync(r,d)):xn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return wt.errToObj,new Or({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,a,s,c;let l=(s=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,r).message)!==null&&s!==void 0?s:r.defaultError;return t.code==="unrecognized_keys"?{message:(c=wt.errToObj(e).message)!==null&&c!==void 0?c:l}:{message:l}}}:{}})}strip(){return new Or({...this._def,unknownKeys:"strip"})}passthrough(){return new Or({...this._def,unknownKeys:"passthrough"})}extend(e){return new Or({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Or({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Mt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Or({...this._def,catchall:e})}pick(e){let t={};return nr.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Or({...this._def,shape:()=>t})}omit(e){let t={};return nr.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Or({...this._def,shape:()=>t})}deepPartial(){return Cc(this)}partial(e){let t={};return nr.objectKeys(this.shape).forEach(r=>{let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}),new Or({...this._def,shape:()=>t})}required(e){let t={};return nr.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof wa;)a=a._def.innerType;t[r]=a}}),new Or({...this._def,shape:()=>t})}keyof(){return u3(nr.objectKeys(this.shape))}},"ZodObject");o(Or,"ZodObject");Or.create=(e,t)=>new Or({shape:()=>e,unknownKeys:"strip",catchall:Ka.create(),typeName:Mt.ZodObject,...Ut(t)});Or.strictCreate=(e,t)=>new Or({shape:()=>e,unknownKeys:"strict",catchall:Ka.create(),typeName:Mt.ZodObject,...Ut(t)});Or.lazycreate=(e,t)=>new Or({shape:e,unknownKeys:"strip",catchall:Ka.create(),typeName:Mt.ZodObject,...Ut(t)});var fl=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(let c of a)if(c.result.status==="valid")return c.result;for(let c of a)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let s=a.map(c=>new Si(c.ctx.common.issues));return Qe(t,{code:Ve.invalid_union,unionErrors:s}),kt}if(i(n,"handleResults"),o(n,"handleResults"),t.common.async)return Promise.all(r.map(async a=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(n);{let a,s=[];for(let l of r){let d={...t,common:{...t.common,issues:[]},parent:null},p=l._parseSync({data:t.data,path:t.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let c=s.map(l=>new Si(l));return Qe(t,{code:Ve.invalid_union,unionErrors:c}),kt}}get options(){return this._def.options}},"ZodUnion");o(fl,"ZodUnion");fl.create=(e,t)=>new fl({options:e,typeName:Mt.ZodUnion,...Ut(t)});var Io=o(e=>e instanceof hl?Io(e.schema):e instanceof Wi?Io(e.innerType()):e instanceof pl?[e.value]:e instanceof ks?e.options:e instanceof ml?nr.objectValues(e.enum):e instanceof gl?Io(e._def.innerType):e instanceof ul?[void 0]:e instanceof ll?[null]:e instanceof wa?[void 0,...Io(e.unwrap())]:e instanceof Bo?[null,...Io(e.unwrap())]:e instanceof p1||e instanceof yl?Io(e.unwrap()):e instanceof vl?Io(e._def.innerType):[],"getDiscriminator"),h1=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==it.object)return Qe(t,{code:Ve.invalid_type,expected:it.object,received:t.parsedType}),kt;let r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(Qe(t,{code:Ve.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),kt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let a of t){let s=Io(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of s){if(n.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);n.set(c,a)}}return new h1({typeName:Mt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Ut(r)})}},"ZodDiscriminatedUnion");o(h1,"ZodDiscriminatedUnion");function Im(e,t){let r=bs(e),n=bs(t);if(e===t)return{valid:!0,data:e};if(r===it.object&&n===it.object){let a=nr.objectKeys(t),s=nr.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let d=Im(e[l],t[l]);if(!d.valid)return{valid:!1};c[l]=d.data}return{valid:!0,data:c}}else if(r===it.array&&n===it.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],d=Im(c,l);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===it.date&&n===it.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(Im,"mergeValues");o(Im,"mergeValues");var dl=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=o((a,s)=>{if(x6(a)||x6(s))return kt;let c=Im(a.value,s.value);return c.valid?((T6(a)||T6(s))&&t.dirty(),{status:t.value,value:c.data}):(Qe(r,{code:Ve.invalid_intersection_types}),kt)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>n(a,s)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}},"ZodIntersection");o(dl,"ZodIntersection");dl.create=(e,t,r)=>new dl({left:e,right:t,typeName:Mt.ZodIntersection,...Ut(r)});var Ga=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==it.array)return Qe(r,{code:Ve.invalid_type,expected:it.array,received:r.parsedType}),kt;if(r.data.length<this._def.items.length)return Qe(r,{code:Ve.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),kt;!this._def.rest&&r.data.length>this._def.items.length&&(Qe(r,{code:Ve.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...r.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new Ea(r,s,r.path,c)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>xn.mergeArray(t,s)):xn.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new Ga({...this._def,rest:e})}},"ZodTuple");o(Ga,"ZodTuple");Ga.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ga({items:e,typeName:Mt.ZodTuple,rest:null,...Ut(t)})};var Bd=i(class extends zt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==it.object)return Qe(r,{code:Ve.invalid_type,expected:it.object,received:r.parsedType}),kt;let n=[],a=this._def.keyType,s=this._def.valueType;for(let c in r.data)n.push({key:a._parse(new Ea(r,c,r.path,c)),value:s._parse(new Ea(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?xn.mergeObjectAsync(t,n):xn.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof zt?new Bd({keyType:e,valueType:t,typeName:Mt.ZodRecord,...Ut(r)}):new Bd({keyType:va.create(),valueType:e,typeName:Mt.ZodRecord,...Ut(t)})}},"ZodRecord");o(Bd,"ZodRecord");var Ld=i(class extends zt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==it.map)return Qe(r,{code:Ve.invalid_type,expected:it.map,received:r.parsedType}),kt;let n=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([c,l],d)=>({key:n._parse(new Ea(r,c,r.path,[d,"key"])),value:a._parse(new Ea(r,l,r.path,[d,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let l of s){let d=await l.key,p=await l.value;if(d.status==="aborted"||p.status==="aborted")return kt;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(d.value,p.value)}return{status:t.value,value:c}})}else{let c=new Map;for(let l of s){let d=l.key,p=l.value;if(d.status==="aborted"||p.status==="aborted")return kt;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(d.value,p.value)}return{status:t.value,value:c}}}},"ZodMap");o(Ld,"ZodMap");Ld.create=(e,t,r)=>new Ld({valueType:t,keyType:e,typeName:Mt.ZodMap,...Ut(r)});var Fc=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==it.set)return Qe(r,{code:Ve.invalid_type,expected:it.set,received:r.parsedType}),kt;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(Qe(r,{code:Ve.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(Qe(r,{code:Ve.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function s(l){let d=new Set;for(let p of l){if(p.status==="aborted")return kt;p.status==="dirty"&&t.dirty(),d.add(p.value)}return{status:t.value,value:d}}i(s,"finalizeSet"),o(s,"finalizeSet");let c=[...r.data.values()].map((l,d)=>a._parse(new Ea(r,l,r.path,d)));return r.common.async?Promise.all(c).then(l=>s(l)):s(c)}min(e,t){return new Fc({...this._def,minSize:{value:e,message:wt.toString(t)}})}max(e,t){return new Fc({...this._def,maxSize:{value:e,message:wt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}},"ZodSet");o(Fc,"ZodSet");Fc.create=(e,t)=>new Fc({valueType:e,minSize:null,maxSize:null,typeName:Mt.ZodSet,...Ut(t)});var Xu=i(class extends zt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==it.function)return Qe(t,{code:Ve.invalid_type,expected:it.function,received:t.parsedType}),kt;function r(c,l){return Mm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kd(),sl].filter(d=>!!d),issueData:{code:Ve.invalid_arguments,argumentsError:l}})}i(r,"makeArgsIssue"),o(r,"makeArgsIssue");function n(c,l){return Mm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,kd(),sl].filter(d=>!!d),issueData:{code:Ve.invalid_return_type,returnTypeError:l}})}i(n,"makeReturnsIssue"),o(n,"makeReturnsIssue");let a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof jc){let c=this;return Ln(async function(...l){let d=new Si([]),p=await c._def.args.parseAsync(l,a).catch(y=>{throw d.addIssue(r(l,y)),d}),g=await Reflect.apply(s,this,p);return await c._def.returns._def.type.parseAsync(g,a).catch(y=>{throw d.addIssue(n(g,y)),d})})}else{let c=this;return Ln(function(...l){let d=c._def.args.safeParse(l,a);if(!d.success)throw new Si([r(l,d.error)]);let p=Reflect.apply(s,this,d.data),g=c._def.returns.safeParse(p,a);if(!g.success)throw new Si([n(p,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xu({...this._def,args:Ga.create(e).rest(_s.create())})}returns(e){return new Xu({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Xu({args:e||Ga.create([]).rest(_s.create()),returns:t||_s.create(),typeName:Mt.ZodFunction,...Ut(r)})}},"ZodFunction");o(Xu,"ZodFunction");var hl=i(class extends zt{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}},"ZodLazy");o(hl,"ZodLazy");hl.create=(e,t)=>new hl({getter:e,typeName:Mt.ZodLazy,...Ut(t)});var pl=i(class extends zt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Qe(t,{received:t.data,code:Ve.invalid_literal,expected:this._def.value}),kt}return{status:"valid",value:e.data}}get value(){return this._def.value}},"ZodLiteral");o(pl,"ZodLiteral");pl.create=(e,t)=>new pl({value:e,typeName:Mt.ZodLiteral,...Ut(t)});function u3(e,t){return new ks({values:e,typeName:Mt.ZodEnum,...Ut(t)})}i(u3,"createZodEnum");o(u3,"createZodEnum");var ks=i(class extends zt{constructor(){super(...arguments),hd.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return Qe(t,{expected:nr.joinValues(r),received:t.parsedType,code:Ve.invalid_type}),kt}if(Rd(this,hd,"f")||o3(this,hd,new Set(this._def.values),"f"),!Rd(this,hd,"f").has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return Qe(t,{received:t.data,code:Ve.invalid_enum_value,options:r}),kt}return Ln(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ks.create(e,{...this._def,...t})}exclude(e,t=this._def){return ks.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}},"ZodEnum");o(ks,"ZodEnum");hd=new WeakMap;ks.create=u3;var ml=i(class extends zt{constructor(){super(...arguments),pd.set(this,void 0)}_parse(e){let t=nr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==it.string&&r.parsedType!==it.number){let n=nr.objectValues(t);return Qe(r,{expected:nr.joinValues(n),received:r.parsedType,code:Ve.invalid_type}),kt}if(Rd(this,pd,"f")||o3(this,pd,new Set(nr.getValidEnumValues(this._def.values)),"f"),!Rd(this,pd,"f").has(e.data)){let n=nr.objectValues(t);return Qe(r,{received:r.data,code:Ve.invalid_enum_value,options:n}),kt}return Ln(e.data)}get enum(){return this._def.values}},"ZodNativeEnum");o(ml,"ZodNativeEnum");pd=new WeakMap;ml.create=(e,t)=>new ml({values:e,typeName:Mt.ZodNativeEnum,...Ut(t)});var jc=i(class extends zt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==it.promise&&t.common.async===!1)return Qe(t,{code:Ve.invalid_type,expected:it.promise,received:t.parsedType}),kt;let r=t.parsedType===it.promise?t.data:Promise.resolve(t.data);return Ln(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}},"ZodPromise");o(jc,"ZodPromise");jc.create=(e,t)=>new jc({type:e,typeName:Mt.ZodPromise,...Ut(t)});var Wi=i(class extends zt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:s=>{Qe(r,s),s.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let s=n.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async c=>{if(t.value==="aborted")return kt;let l=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return l.status==="aborted"?kt:l.status==="dirty"||t.value==="dirty"?Ju(l.value):l});{if(t.value==="aborted")return kt;let c=this._def.schema._parseSync({data:s,path:r.path,parent:r});return c.status==="aborted"?kt:c.status==="dirty"||t.value==="dirty"?Ju(c.value):c}}if(n.type==="refinement"){let s=o(c=>{let l=n.refinement(c,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?kt:(c.status==="dirty"&&t.dirty(),s(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?kt:(c.status==="dirty"&&t.dirty(),s(c.value).then(()=>({status:t.value,value:c.value}))))}if(n.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Dd(s))return s;let c=n.transform(s.value,a);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Dd(s)?Promise.resolve(n.transform(s.value,a)).then(c=>({status:t.value,value:c})):s);nr.assertNever(n)}},"ZodEffects");o(Wi,"ZodEffects");Wi.create=(e,t,r)=>new Wi({schema:e,typeName:Mt.ZodEffects,effect:t,...Ut(r)});Wi.createWithPreprocess=(e,t,r)=>new Wi({schema:t,effect:{type:"preprocess",transform:e},typeName:Mt.ZodEffects,...Ut(r)});var wa=i(class extends zt{_parse(e){return this._getType(e)===it.undefined?Ln(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodOptional");o(wa,"ZodOptional");wa.create=(e,t)=>new wa({innerType:e,typeName:Mt.ZodOptional,...Ut(t)});var Bo=i(class extends zt{_parse(e){return this._getType(e)===it.null?Ln(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodNullable");o(Bo,"ZodNullable");Bo.create=(e,t)=>new Bo({innerType:e,typeName:Mt.ZodNullable,...Ut(t)});var gl=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===it.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}},"ZodDefault");o(gl,"ZodDefault");gl.create=(e,t)=>new gl({innerType:e,typeName:Mt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ut(t)});var vl=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Od(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Si(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Si(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}},"ZodCatch");o(vl,"ZodCatch");vl.create=(e,t)=>new vl({innerType:e,typeName:Mt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ut(t)});var Ud=i(class extends zt{_parse(e){if(this._getType(e)!==it.nan){let r=this._getOrReturnCtx(e);return Qe(r,{code:Ve.invalid_type,expected:it.nan,received:r.parsedType}),kt}return{status:"valid",value:e.data}}},"ZodNaN");o(Ud,"ZodNaN");Ud.create=e=>new Ud({typeName:Mt.ZodNaN,...Ut(e)});var wV=Symbol("zod_brand"),p1=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},"ZodBranded");o(p1,"ZodBranded");var th=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return o(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?kt:a.status==="dirty"?(t.dirty(),Ju(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})},"handleAsync")();{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?kt:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new th({in:e,out:t,typeName:Mt.ZodPipeline})}},"ZodPipeline");o(th,"ZodPipeline");var yl=i(class extends zt{_parse(e){let t=this._def.innerType._parse(e),r=o(n=>(Dd(n)&&(n.value=Object.freeze(n.value)),n),"freeze");return Od(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}},"ZodReadonly");o(yl,"ZodReadonly");yl.create=(e,t)=>new yl({innerType:e,typeName:Mt.ZodReadonly,...Ut(t)});function l3(e,t={},r){return e?Uc.create().superRefine((n,a)=>{var s,c;if(!e(n)){let l=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,d=(c=(s=l.fatal)!==null&&s!==void 0?s:r)!==null&&c!==void 0?c:!0,p=typeof l=="string"?{message:l}:l;a.addIssue({code:"custom",...p,fatal:d})}}):Uc.create()}i(l3,"custom");o(l3,"custom");var _V={object:Or.lazycreate},Mt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Mt||(Mt={}));var EV=o((e,t={message:`Input not instance of ${e.name}`})=>l3(r=>r instanceof e,t),"instanceOfType"),_D=va.create,ED=Ms.create,AV=Ud.create,SV=Is.create,AD=cl.create,xV=Lc.create,TV=Nd.create,CV=ul.create,MV=ll.create,IV=Uc.create,kV=_s.create,DV=Ka.create,OV=Pd.create,RV=ba.create,NV=Or.create,PV=Or.strictCreate,BV=fl.create,LV=h1.create,UV=dl.create,FV=Ga.create,jV=Bd.create,$V=Ld.create,zV=Fc.create,HV=Xu.create,qV=hl.create,VV=pl.create,KV=ks.create,GV=ml.create,WV=jc.create,HS=Wi.create,ZV=wa.create,JV=Bo.create,YV=Wi.createWithPreprocess,XV=th.create,QV=o(()=>_D().optional(),"ostring"),eK=o(()=>ED().optional(),"onumber"),tK=o(()=>AD().optional(),"oboolean"),rK={string:e=>va.create({...e,coerce:!0}),number:e=>Ms.create({...e,coerce:!0}),boolean:e=>cl.create({...e,coerce:!0}),bigint:e=>Is.create({...e,coerce:!0}),date:e=>Lc.create({...e,coerce:!0})},nK=kt,H=Object.freeze({__proto__:null,defaultErrorMap:sl,setErrorMap:gD,getErrorMap:kd,makeIssue:Mm,EMPTY_PATH:sV,addIssueToContext:Qe,ParseStatus:xn,INVALID:kt,DIRTY:Ju,OK:Ln,isAborted:x6,isDirty:T6,isValid:Dd,isAsync:Od,get util(){return nr},get objectUtil(){return S6},ZodParsedType:it,getParsedType:bs,ZodType:zt,datetimeRegex:c3,ZodString:va,ZodNumber:Ms,ZodBigInt:Is,ZodBoolean:cl,ZodDate:Lc,ZodSymbol:Nd,ZodUndefined:ul,ZodNull:ll,ZodAny:Uc,ZodUnknown:_s,ZodNever:Ka,ZodVoid:Pd,ZodArray:ba,ZodObject:Or,ZodUnion:fl,ZodDiscriminatedUnion:h1,ZodIntersection:dl,ZodTuple:Ga,ZodRecord:Bd,ZodMap:Ld,ZodSet:Fc,ZodFunction:Xu,ZodLazy:hl,ZodLiteral:pl,ZodEnum:ks,ZodNativeEnum:ml,ZodPromise:jc,ZodEffects:Wi,ZodTransformer:Wi,ZodOptional:wa,ZodNullable:Bo,ZodDefault:gl,ZodCatch:vl,ZodNaN:Ud,BRAND:wV,ZodBranded:p1,ZodPipeline:th,ZodReadonly:yl,custom:l3,Schema:zt,ZodSchema:zt,late:_V,get ZodFirstPartyTypeKind(){return Mt},coerce:rK,any:IV,array:RV,bigint:SV,boolean:AD,date:xV,discriminatedUnion:LV,effect:HS,enum:KV,function:HV,instanceof:EV,intersection:UV,lazy:qV,literal:VV,map:$V,nan:AV,nativeEnum:GV,never:DV,null:MV,nullable:JV,number:ED,object:NV,oboolean:tK,onumber:eK,optional:ZV,ostring:QV,pipeline:XV,preprocess:YV,promise:WV,record:jV,set:zV,strictObject:PV,string:_D,symbol:TV,transformer:HS,tuple:FV,undefined:CV,union:BV,unknown:kV,void:OV,NEVER:nK,ZodIssueCode:Ve,quotelessJson:oV,ZodError:Si}),sd=Symbol("current"),Ku=Symbol("previous"),cd=o((e,{ref:t,refType:r,param:n,header:a,...s}={})=>({...s,...e}),"mergeOpenApi");function SD(e){if(typeof e.ZodType.prototype.openapi<"u")return;e.ZodType.prototype.openapi=function(s){let{zodOpenApi:c,...l}=this._def,d=new this.constructor({...l,zodOpenApi:{openapi:cd(s,c?.openapi)}});return d._def.zodOpenApi[sd]=d,c&&(d._def.zodOpenApi[Ku]=this),d};let t=e.ZodType.prototype.describe;e.ZodType.prototype.describe=function(...s){let c=t.apply(this,s),l=c._def;if(l.zodOpenApi){let d={...l.zodOpenApi};d.openapi=cd({description:s[0]},d.openapi),d[Ku]=this,d[sd]=c,l.zodOpenApi=d}else l.zodOpenApi={openapi:{description:s[0]},[sd]:c};return c};let r=e.ZodObject.prototype.extend;e.ZodObject.prototype.extend=function(...s){let c=r.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=cd({},d.openapi),d[Ku]=this,c._def.zodOpenApi=d}else c._def.zodOpenApi={[Ku]:this};return c};let n=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...s){let c=n.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=cd({},d.openapi),delete d[Ku],delete d[sd],c._def.zodOpenApi=d}return c};let a=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...s){let c=a.apply(this,s),l=c._def.zodOpenApi;if(l){let d={...l};d.openapi=cd({},d.openapi),delete d[Ku],delete d[sd],c._def.zodOpenApi=d}return c}}i(SD,"extendZodWithOpenApi");o(SD,"extendZodWithOpenApi");SD(H);var iK=Object.defineProperty,aK=o((e,t)=>iK(e,"name",{value:t,configurable:!0}),"__name"),m1=H.array(H.string().or(H.record(H.any()))),JX=H.object({type:H.string().optional(),narrative:H.string().optional()}),g1=H.string().or(H.object({id:H.string(),type:H.string(),caption:H.string().optional()})),oK=H.object({type:H.string().min(1).or(H.string().array().nonempty()),latitude:H.number(),longitude:H.number()}),sK=H.object({type:H.string().min(1).or(H.string().array().nonempty()),addressCountry:H.string().optional(),addressCountryCode:H.string().optional(),addressRegion:H.string().optional(),addressLocality:H.string().optional(),streetAddress:H.string().optional(),postOfficeBoxNumber:H.string().optional(),postalCode:H.string().optional(),geo:oK.optional()}),cK=H.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(H.string()),xD=H.object({type:H.string().min(1).or(H.string().array().nonempty()),identifier:H.string(),identifierType:cK}),Fd=H.string().or(H.object({id:H.string().optional(),type:H.string().or(H.string().array().nonempty().optional()),name:H.string().optional(),url:H.string().optional(),phone:H.string().optional(),description:H.string().optional(),endorsement:H.any().array().optional(),image:g1.optional(),email:H.string().email().optional(),address:sK.optional(),otherIdentifier:xD.array().optional(),official:H.string().optional(),parentOrg:H.any().optional(),familyName:H.string().optional(),givenName:H.string().optional(),additionalName:H.string().optional(),patronymicName:H.string().optional(),honorificPrefix:H.string().optional(),honorificSuffix:H.string().optional(),familyNamePrefix:H.string().optional(),dateOfBirth:H.string().optional()}).catchall(H.any())),C6=H.object({id:H.string().optional()}).catchall(H.any()),$0=H.object({type:H.string(),id:H.string()}).catchall(H.any()),qS=H.object({id:H.string(),type:H.string()}).catchall(H.any()),VS=H.object({id:H.string().optional(),type:H.string()}).catchall(H.any()),KS=H.object({type:H.string(),id:H.string().optional()}).catchall(H.any()),GS=H.object({type:H.string().or(H.string().array().nonempty()),id:H.string().optional()}).catchall(H.any()),km=H.object({"@context":m1,id:H.string().optional(),type:H.string().array().nonempty(),issuer:Fd,credentialSubject:C6.or(C6.array()),refreshService:VS.or(VS.array()).optional(),credentialSchema:qS.or(qS.array()).optional(),issuanceDate:H.string().optional(),expirationDate:H.string().optional(),credentialStatus:$0.or($0.array()).optional(),name:H.string().optional(),description:H.string().optional(),validFrom:H.string().optional(),validUntil:H.string().optional(),status:$0.or($0.array()).optional(),termsOfUse:KS.or(KS.array()).optional(),evidence:GS.or(GS.array()).optional()}).catchall(H.any()),Wa=H.object({type:H.string(),created:H.string(),challenge:H.string().optional(),domain:H.string().optional(),nonce:H.string().optional(),proofPurpose:H.string(),verificationMethod:H.string(),jws:H.string().optional()}).catchall(H.any()),WS=km.extend({proof:Wa.or(Wa.array())}),uK=H.object({"@context":m1,id:H.string().optional(),type:H.string().or(H.string().array().nonempty()),verifiableCredential:WS.or(WS.array()).optional(),holder:H.string().optional()}).catchall(H.any()),YX=uK.extend({proof:Wa.or(Wa.array())}),f3=H.object({kty:H.string(),crv:H.string(),x:H.string(),y:H.string().optional(),n:H.string().optional(),d:H.string().optional()}),XX=f3.omit({d:!0}).extend({d:H.string()}),lK=H.object({alg:H.string(),iv:H.string(),tag:H.string(),epk:f3.partial().optional(),kid:H.string().optional(),apv:H.string().optional(),apu:H.string().optional()}),fK=H.object({header:lK,encrypted_key:H.string()}),dK=H.object({protected:H.string(),iv:H.string(),ciphertext:H.string(),tag:H.string(),aad:H.string().optional(),recipients:fK.array().optional()}),Sc=H.string().or(H.object({"@context":m1.optional(),id:H.string(),type:H.string(),controller:H.string(),publicKeyJwk:f3.optional(),publicKeyBase58:H.string().optional(),blockChainAccountId:H.string().optional()}).catchall(H.any())),hK=H.object({id:H.string(),type:H.string().or(H.string().array().nonempty()),serviceEndpoint:H.any().or(H.any().array().nonempty())}).catchall(H.any()),QX=H.object({"@context":m1,id:H.string(),alsoKnownAs:H.string().optional(),controller:H.string().or(H.string().array().nonempty()).optional(),verificationMethod:Sc.array().optional(),authentication:Sc.array().optional(),assertionMethod:Sc.array().optional(),keyAgreement:Sc.array().optional(),capabilityInvocation:Sc.array().optional(),capabilityDelegation:Sc.array().optional(),publicKey:Sc.array().optional(),service:hK.array().optional(),proof:Wa.or(Wa.array()).optional()}).catchall(H.any()),pK=H.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(H.string()),v1=H.object({type:H.string().array().nonempty(),targetCode:H.string().optional(),targetDescription:H.string().optional(),targetName:H.string(),targetFramework:H.string().optional(),targetType:pK.optional(),targetUrl:H.string()}),mK=H.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),gK=mK.or(H.string()),vK=H.object({id:H.string().optional(),narrative:H.string().optional()}).catchall(H.any()),yK=H.object({id:H.string(),type:H.string().array().nonempty(),endorsementComment:H.string().optional()}),bK=km.extend({credentialSubject:yK,proof:Wa.or(Wa.array()).optional()}),wK=H.object({id:H.string(),"@language":H.string().optional(),version:H.string().optional()}),_K=H.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(H.string()),EK=H.object({id:H.string(),type:H.string().array().nonempty(),alignment:v1.array().optional(),description:H.string().optional(),level:H.string().optional(),name:H.string(),points:H.string().optional()}).catchall(H.any()),AK=H.object({id:H.string(),type:H.string().array().nonempty(),alignment:v1.array().optional(),allowedValue:H.string().array().optional(),name:H.string(),requiredLevel:H.string().optional(),requiredValue:H.string().optional(),resultType:_K,rubricCriterionLevel:EK.array().optional(),valueMax:H.string().optional(),valueMin:H.string().optional()}).catchall(H.any()),SK=H.object({id:H.string().optional(),type:H.string().array().nonempty(),alignment:v1.array().optional(),achievementType:gK.optional(),creator:Fd.optional(),creditsAvailable:H.number().optional(),criteria:vK,description:H.string(),endorsement:bK.array().optional(),fieldOfStudy:H.string().optional(),humanCode:H.string().optional(),image:g1.optional(),"@language":H.string().optional(),name:H.string(),otherIdentifier:xD.array().optional(),related:wK.array().optional(),resultDescription:AK.array().optional(),specialization:H.string().optional(),tag:H.string().array().optional(),version:H.string().optional()}).catchall(H.any()),xK=H.object({type:H.string(),hashed:H.boolean(),identityHash:H.string(),identityType:H.string(),salt:H.string().optional()}),TK=H.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),CK=H.object({type:H.string().array().nonempty(),achievedLevel:H.string().optional(),alignment:v1.array().optional(),resultDescription:H.string().optional(),status:TK.optional(),value:H.string().optional()}).catchall(H.any()),ZS=H.object({id:H.string().optional(),type:H.string().array().nonempty(),activityEndDate:H.string().optional(),activityStartDate:H.string().optional(),creditsEarned:H.number().optional(),achievement:SK.optional(),identifier:xK.array().optional(),image:g1.optional(),licenseNumber:H.string().optional(),narrative:H.string().optional(),result:CK.array().optional(),role:H.string().optional(),source:Fd.optional(),term:H.string().optional()}).catchall(H.any()),MK=H.object({id:H.string().optional(),type:H.string().or(H.string().array().nonempty()),narrative:H.string().optional(),name:H.string().optional(),description:H.string().optional(),genre:H.string().optional(),audience:H.string().optional()}).catchall(H.any()),IK=km.extend({name:H.string().optional(),description:H.string().optional(),image:g1.optional(),credentialSubject:ZS.or(ZS.array()),endorsement:km.array().optional(),evidence:MK.array().optional()}),eQ=IK.extend({proof:Wa.or(Wa.array())}),tQ=H.object({checks:H.string().array(),warnings:H.string().array(),errors:H.string().array()}),TD=H.enum(["Success","Failed","Error"]),rQ=TD.enum,nQ=H.object({check:H.string(),status:TD,message:H.string().optional(),details:H.string().optional()}),iQ=H.object({title:H.string().optional(),createdAt:H.string().optional(),issuer:Fd.optional(),issuee:Fd.optional(),credentialSubject:C6.optional()}),aQ=H.object({id:H.string(),uri:H.string()}).catchall(H.any()),oQ=H.object({limit:H.number(),cursor:H.string().optional(),sort:H.string().optional()}),ni=H.object({cursor:H.string().optional(),hasMore:H.boolean()}),CD=H.object({encryptedRecord:dK,fields:H.string().array()}).catchall(H.any()),sQ=ni.extend({records:CD.array()}),kK=CD.extend({id:H.string()}),cQ=ni.extend({records:kK.array()}),JS=aK(e=>{let t=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!t)throw new Error("Invalid RegExp string format");return{pattern:t[1],flags:t[2]}},"parseRegexString"),DK=H.instanceof(RegExp).or(H.string().refine(e=>{try{return JS(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:t,flags:r}=JS(e);try{return new RegExp(t,r)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),mr=H.string().or(H.object({$in:H.string().array()})).or(H.object({$regex:DK})),OK=H.object({backgroundColor:H.string().optional(),backgroundImage:H.string().optional(),fadeBackgroundImage:H.boolean().optional(),repeatBackgroundImage:H.boolean().optional(),fontColor:H.string().optional(),accentColor:H.string().optional(),accentFontColor:H.string().optional(),idBackgroundImage:H.string().optional(),fadeIdBackgroundImage:H.boolean().optional(),idBackgroundColor:H.string().optional(),repeatIdBackgroundImage:H.boolean().optional()}),Ds=H.object({profileId:H.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),displayName:H.string().default("").describe("Human-readable display name for the profile."),shortBio:H.string().default("").describe("Short bio for the profile."),bio:H.string().default("").describe("Longer bio for the profile."),did:H.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),isPrivate:H.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),email:H.string().optional().describe("Contact email address for the profile."),image:H.string().optional().describe("Profile image URL for the profile."),heroImage:H.string().optional().describe("Hero image URL for the profile."),websiteLink:H.string().optional().describe("Website link for the profile."),isServiceProfile:H.boolean().default(!1).optional().describe("Whether the profile is a service profile or not."),type:H.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),notificationsWebhook:H.string().url().startsWith("http").optional().describe("URL to send notifications to."),display:OK.optional().describe("Display settings for the profile."),role:H.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),dob:H.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')}),uQ=H.object({profileId:mr,displayName:mr,shortBio:mr,bio:mr,email:mr,websiteLink:mr,isServiceProfile:H.boolean(),type:mr}).partial(),lQ=ni.extend({records:Ds.array()}),fQ=H.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),MD=H.object({id:H.string(),created:H.string(),displayName:H.string().default("").optional(),shortBio:H.string().default("").optional(),bio:H.string().default("").optional(),email:H.string().optional(),image:H.string().optional(),heroImage:H.string().optional()}),dQ=ni.extend({records:MD.extend({did:H.string()}).array()}),hQ=H.object({id:mr,displayName:mr,shortBio:mr,bio:mr,email:mr}).partial(),pQ=ni.extend({records:H.object({profile:Ds,manager:MD.extend({did:H.string()}).optional()}).array()}),mQ=H.object({uri:H.string(),to:H.string(),from:H.string(),sent:H.string().datetime(),received:H.string().datetime().optional()}),ID=H.object({role:H.string(),canEdit:H.boolean(),canIssue:H.boolean(),canRevoke:H.boolean(),canManagePermissions:H.boolean(),canIssueChildren:H.string(),canCreateChildren:H.string(),canEditChildren:H.string(),canRevokeChildren:H.string(),canManageChildrenPermissions:H.string(),canManageChildrenProfiles:H.boolean().default(!1).optional(),canViewAnalytics:H.boolean()}),RK=H.object({role:mr,canEdit:H.boolean(),canIssue:H.boolean(),canRevoke:H.boolean(),canManagePermissions:H.boolean(),canIssueChildren:mr,canCreateChildren:mr,canEditChildren:mr,canRevokeChildren:mr,canManageChildrenPermissions:mr,canManageChildrenProfiles:H.boolean(),canViewAnalytics:H.boolean()}).partial(),YS=H.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),NK=H.discriminatedUnion("type",[H.object({type:H.literal(YS.Values.GRANT_PERMISSIONS),data:H.object({claimUri:H.string(),targetUri:H.string(),permissions:ID.partial()})}),H.object({type:H.literal(YS.Values.ADD_ADMIN),data:H.object({claimUri:H.string(),targetUri:H.string()})})]),gQ=H.object({type:mr,data:H.object({claimUri:mr,targetUri:mr,permissions:RK})}).deepPartial(),PK=H.object({id:H.string(),createdAt:H.string(),updatedAt:H.string()}).and(NK),vQ=ni.extend({records:PK.array()}),M6=H.enum(["DRAFT","LIVE"]),BK=H.object({uri:H.string(),name:H.string().optional(),type:H.string().optional(),category:H.string().optional(),status:M6.optional(),autoConnectRecipients:H.boolean().optional(),meta:H.record(H.any()).optional(),claimPermissions:ID.optional(),allowAnyoneToCreateChildren:H.boolean().optional()}),yQ=H.object({uri:mr,name:mr,type:mr,category:mr,meta:H.record(mr),status:M6.or(H.object({$in:M6.array()})),autoConnectRecipients:H.boolean()}).partial(),bQ=ni.extend({records:BK.array()}),LK=H.object({to:Ds,from:H.string(),received:H.string().optional(),uri:H.string().optional()}),wQ=ni.extend({records:LK.array()}),_Q=H.object({endpoint:H.string(),name:H.string(),did:H.string().optional()}),EQ=H.object({ttlSeconds:H.number().optional(),totalUses:H.number().optional()}),UK=H.object({endpoint:H.string()}),AQ=H.object({signingAuthority:UK,relationship:H.object({name:H.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:H.string()})}),SQ=H.object({boostUri:H.string(),signingAuthority:H.object({endpoint:H.string(),name:H.string()})}),FK=H.enum(["live","stale","withdrawn"]),jK=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.object({required:H.boolean()})).default({})}).default({}),personal:H.record(H.object({required:H.boolean()})).default({})}).default({}),write:H.object({credentials:H.object({categories:H.record(H.object({required:H.boolean()})).default({})}).default({}),personal:H.record(H.object({required:H.boolean()})).default({})}).default({})}),kD=H.object({contract:jK,owner:Ds,name:H.string(),subtitle:H.string().optional(),description:H.string().optional(),reasonForAccessing:H.string().optional(),image:H.string().optional(),uri:H.string(),needsGuardianConsent:H.boolean().optional(),redirectUrl:H.string().optional(),frontDoorBoostUri:H.string().optional(),createdAt:H.string(),updatedAt:H.string(),expiresAt:H.string().optional(),autoBoosts:H.string().array().optional(),writers:H.array(Ds).optional()}),xQ=ni.extend({records:kD.omit({owner:!0}).array()}),$K=H.object({credentials:H.object({categories:H.record(H.string().array()).default({})}),personal:H.record(H.string()).default({}),date:H.string()}),TQ=ni.extend({records:$K.array()}),zK=H.object({credentials:H.object({category:H.string(),uri:H.string()}).array(),personal:H.record(H.string()).default({}),date:H.string(),contractUri:H.string()}),CQ=ni.extend({records:zK.array()}),DD=H.object({sharing:H.boolean().optional(),shared:H.string().array().optional(),shareAll:H.boolean().optional(),shareUntil:H.string().optional()}),OD=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({shareAll:H.boolean().optional(),sharing:H.boolean().optional(),categories:H.record(DD).default({})}).default({}),personal:H.record(H.string()).default({})}).default({}),write:H.object({credentials:H.object({categories:H.record(H.boolean()).default({})}).default({}),personal:H.record(H.boolean()).default({})}).default({}),deniedWriters:H.array(H.string()).optional()}),MQ=ni.extend({records:H.object({expiresAt:H.string().optional(),oneTime:H.boolean().optional(),terms:OD,contract:kD,uri:H.string(),consenter:Ds,status:FK}).array()}),IQ=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),personal:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),write:H.object({credentials:H.object({categories:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),personal:H.record(H.object({required:H.boolean().optional()})).optional()}).optional()}),kQ=H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional()}),DQ=H.object({credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional(),id:mr.optional()}),HK=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({shareAll:H.boolean().optional(),sharing:H.boolean().optional(),categories:H.record(DD.optional()).optional()}).optional(),personal:H.record(H.string()).optional()}).optional(),write:H.object({credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional()}).optional()}),I6=H.enum(["consent","update","sync","withdraw","write"]),OQ=H.object({terms:HK.optional(),action:I6.or(I6.array()).optional(),date:H.object({$gt:H.string()}).or(H.object({$lt:H.string()})).or(H.object({$eq:H.string()})).optional(),expiresAt:H.object({$gt:H.string()}).or(H.object({$lt:H.string()})).or(H.object({$eq:H.string()})).optional(),oneTime:H.boolean().optional()}),RD=H.object({expiresAt:H.string().optional(),oneTime:H.boolean().optional(),terms:OD.optional(),id:H.string(),action:I6,date:H.string(),uris:H.string().array().optional()}),RQ=ni.extend({records:RD.array()}),qK=H.object({credentialUri:H.string(),termsUri:H.string(),contractUri:H.string(),boostUri:H.string(),category:H.string().optional(),date:H.string()}),NQ=ni.extend({records:qK.array()}),VK=H.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),KK=H.object({title:H.string().optional(),body:H.string().optional()}),GK=H.object({vcUris:H.array(H.string()).optional(),vpUris:H.array(H.string()).optional(),transaction:RD.optional()}),PQ=H.object({type:VK,to:Ds.partial().and(H.object({did:H.string()})),from:Ds.partial().and(H.object({did:H.string()})),message:KK.optional(),data:GK.optional(),sent:H.string().datetime().optional()}),WK="auth-grant:",BQ=H.object({id:H.string(),name:H.string(),description:H.string().optional(),challenge:H.string().startsWith(WK).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:H.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:H.string(),createdAt:H.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:H.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),LQ=H.object({id:H.string()}).catchall(H.any()),ZK=H.enum(["active","revoked"]),UQ=H.object({id:mr,name:mr,description:mr,status:ZK}).partial(),y1=o(e=>`lc:ceramic:${e}`,"streamIdToCeramicURI"),FQ=H.string().refine(e=>e.split(":").length===3&&e.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(e=>e.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var d3=$.object({credentials:Ec.array()}).catchall($.any()),ND=$.object({id:$.string(),title:$.string(),storageType:$.literal("ceramic").optional()}).catchall($.any()),h3=$.object({credentials:Ec.or(ND).array()}).strict();var PD={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials"};var b1=i(async(e,{modelData:t,credentialAlias:r}=PD)=>{let n=e.invoke.getCeramicClient(),a=new Jf({ceramic:n,model:t}),s=i(async(g=r)=>{let v=await a.get(g);if(!v)return{credentials:[]};let y=await d3.spa(v);if(y.success)return y.data;let _=await h3.spa(v);if(_.success){let D={credentials:_.data.credentials.map(P=>{if("uri"in P)return P;let{title:Z,id:j,storageType:q,...Q}=P;return{...Q,id:Z,uri:`lc:ceramic:${j.replace("ceramic://","")}`}})};return await a.set(r,D),D}throw console.error(y.error),new Error("Invalid credentials list stored in IDX")},"getCredentialsListFromIdx"),c=i(async(g,v)=>{if(!g)throw new Error("Must provide id to remove");v||(v=r);let y=await s(v);return y.credentials=y.credentials.filter(_=>_.id!==g),a.set(v,y)},"removeCredentialFromIdx"),l=i(async g=>(g||(g=r),a.set(g,{credentials:[]})),"removeAllCredentialsFromIdx"),d=i(async g=>{let v=await Ec.parseAsync(g);if(!v)throw new Error("record is required");if(!v.uri)throw Error("No URI provided");await e.read.get(v.uri);let y=await s(r),_=y.credentials.findIndex(x=>x.id===v.id);return _>-1?y.credentials[_]=v:y.credentials.push(v),y1(await a.set(r,y))},"addCredentialInIdx"),p=i(async g=>{let v=Ec.array().parse(g),y=await s(r);return await Promise.all(v.map(async _=>{await e.read.get(_.uri);let x=y.credentials.findIndex(R=>R.id===_.id);x>-1?y.credentials[x]=_:y.credentials.push(_)})),y1(await a.set(r,y))},"addCredentialsInIdx");return{name:"IDX",displayName:"IDX",description:"Stores a bespoke index of credentials for an individual based on their did",index:{get:async g=>(g.debug?.("learnCard.index.IDX.get"),(await s()).credentials),add:async(g,v)=>{g.debug?.("learnCard.index.IDX.add");try{return await d(v),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},addMany:async(g,v)=>{g.debug?.("learnCard.index.IDX.add");try{return await p(v),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},update:async g=>(g.debug?.("learnCard.index.IDX.update"),!1),remove:async(g,v)=>{g.debug?.("learnCard.index.IDX.remove");try{return await c(v),!0}catch(y){return console.error("Error removing credential from IDX:",y),!1}},removeAll:async g=>{g.debug?.("learnCard.index.IDX.removeAll");try{return await l(),!0}catch(v){return console.error("Error removing credentials from IDX:",v),!1}}},methods:{getCredentialsListFromIdx:async(g,v=r)=>(await s(v)).credentials,getVerifiableCredentialFromIdx:async(g,v)=>{let _=(await s())?.credentials?.find(D=>D?.id===v),x=g.read.get(_?.uri),R=await R0.safeParseAsync(x);return R.success?R.data:void 0},getVerifiableCredentialsFromIdx:async g=>{let y=(await s())?.credentials?.map(_=>_?.uri)??[];return(await Promise.all(y.map(async _=>g.read.get(_)))).filter(_=>!!_)},addVerifiableCredentialInIdx:async(g,v)=>{let y=Ec.parse(v);if(!y)throw new Error("record is required");if(!y.uri)throw Error("No URI provided");await g.read.get(y.uri);let _=await s(r),x=_.credentials.findIndex(R=>R.id===y.id);return x>-1?_.credentials[x]=y:_.credentials.push(y),y1(await a.set(r,_))},removeVerifiableCredentialInIdx:async(g,v)=>c(v),removeAllVerifiableCredentialsInIdx:async()=>l(),getIDXIndex:async()=>a.get(r),setIDXIndex:async(g,v)=>a.set(r,v)}}},"getIDXPlugin");var JK=b1;
|
|
846
846
|
/*!
|
|
847
847
|
* The buffer module from node.js, for the browser.
|
|
848
848
|
*
|