UNPKG

codama

Version:

A Solana framework for building standardised programs

9 lines 113 kB
"use strict";var globalThis=globalThis||{};globalThis.codama=(()=>{var ps=Object.create;var Be=Object.defineProperty;var ys=Object.getOwnPropertyDescriptor;var ms=Object.getOwnPropertyNames;var Ns=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty;var gs=(t,e,n)=>e in t?Be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ts=(t,e)=>{for(var n in e)Be(t,n,{get:e[n],enumerable:!0})},li=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of ms(e))!vs.call(t,u)&&u!==n&&Be(t,u,{get:()=>e[u],enumerable:!(r=ys(e,u))||r.enumerable});return t};var hs=(t,e,n)=>(n=t!=null?ps(Ns(t)):{},li(e||!t||!t.__esModule?Be(n,"default",{value:t,enumerable:!0}):n,t)),As=t=>li(Be({},"__esModule",{value:!0}),t);var Ge=(t,e,n)=>gs(t,typeof e!="symbol"?e+"":e,n);var $i=g((jl,Mi)=>{"use strict";var zt,h,wi={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` `,r:"\r",t:" "},pn;function me(t){throw{name:"SyntaxError",message:t,at:zt,text:pn}}function E(t){return t&&t!==h&&me("Expected '"+t+"' instead of '"+h+"'"),h=pn.charAt(zt),zt+=1,h}function Fi(){var t,e="";for(h==="-"&&(e="-",E("-"));h>="0"&&h<="9";)e+=h,E();if(h===".")for(e+=".";E()&&h>="0"&&h<="9";)e+=h;if(h==="e"||h==="E")for(e+=h,E(),(h==="-"||h==="+")&&(e+=h,E());h>="0"&&h<="9";)e+=h,E();return t=Number(e),isFinite(t)||me("Bad number"),t}function Li(){var t,e,n="",r;if(h==='"')for(;E();){if(h==='"')return E(),n;if(h==="\\")if(E(),h==="u"){for(r=0,e=0;e<4&&(t=parseInt(E(),16),!!isFinite(t));e+=1)r=r*16+t;n+=String.fromCharCode(r)}else if(typeof wi[h]=="string")n+=wi[h];else break;else n+=h}me("Bad string")}function ue(){for(;h&&h<=" ";)E()}function Qs(){switch(h){case"t":return E("t"),E("r"),E("u"),E("e"),!0;case"f":return E("f"),E("a"),E("l"),E("s"),E("e"),!1;case"n":return E("n"),E("u"),E("l"),E("l"),null;default:me("Unexpected '"+h+"'")}}function eu(){var t=[];if(h==="["){if(E("["),ue(),h==="]")return E("]"),t;for(;h;){if(t.push(qt()),ue(),h==="]")return E("]"),t;E(","),ue()}}me("Bad array")}function tu(){var t,e={};if(h==="{"){if(E("{"),ue(),h==="}")return E("}"),e;for(;h;){if(t=Li(),ue(),E(":"),Object.prototype.hasOwnProperty.call(e,t)&&me('Duplicate key "'+t+'"'),e[t]=qt(),ue(),h==="}")return E("}"),e;E(","),ue()}}me("Bad object")}function qt(){switch(ue(),h){case"{":return tu();case"[":return eu();case'"':return Li();case"-":return Fi();default:return h>="0"&&h<="9"?Fi():Qs()}}Mi.exports=function(t,e){var n;return pn=t,zt=0,h=" ",n=qt(),ue(),h&&me("Syntax error"),typeof e=="function"?function r(u,i){var s,a,o=u[i];if(o&&typeof o=="object")for(s in qt)Object.prototype.hasOwnProperty.call(o,s)&&(a=r(o,s),typeof a>"u"?delete o[s]:o[s]=a);return e.call(u,i,o)}({"":n},""):n}});var Ui=g((Ul,ji)=>{"use strict";var yn=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Z,Bt,ru={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},Ve;function mn(t){return yn.lastIndex=0,yn.test(t)?'"'+t.replace(yn,function(e){var n=ru[e];return typeof n=="string"?n:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function Gt(t,e){var n,r,u,i,s=Z,a,o=e[t];switch(o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(t)),typeof Ve=="function"&&(o=Ve.call(e,t,o)),typeof o){case"string":return mn(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(Z+=Bt,a=[],Object.prototype.toString.apply(o)==="[object Array]"){for(i=o.length,n=0;n<i;n+=1)a[n]=Gt(n,o)||"null";return u=a.length===0?"[]":Z?`[ `+Z+a.join(`, `+Z)+` `+s+"]":"["+a.join(",")+"]",Z=s,u}if(Ve&&typeof Ve=="object")for(i=Ve.length,n=0;n<i;n+=1)r=Ve[n],typeof r=="string"&&(u=Gt(r,o),u&&a.push(mn(r)+(Z?": ":":")+u));else for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(u=Gt(r,o),u&&a.push(mn(r)+(Z?": ":":")+u));return u=a.length===0?"{}":Z?`{ `+Z+a.join(`, `+Z)+` `+s+"}":"{"+a.join(",")+"}",Z=s,u;default:}}ji.exports=function(t,e,n){var r;if(Z="",Bt="",typeof n=="number")for(r=0;r<n;r+=1)Bt+=" ";else typeof n=="string"&&(Bt=n);if(Ve=e,e&&typeof e!="function"&&(typeof e!="object"||typeof e.length!="number"))throw new Error("JSON.stringify");return Gt("",{"":t})}});var zi=g(Nn=>{"use strict";Nn.parse=$i();Nn.stringify=Ui()});var Bi=g((ql,qi)=>{"use strict";var nu={}.toString;qi.exports=Array.isArray||function(t){return nu.call(t)=="[object Array]"}});var vn=g((Bl,Ki)=>{"use strict";var Gi=Object.prototype.toString;Ki.exports=function(e){var n=Gi.call(e),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Gi.call(e.callee)==="[object Function]"),r}});var to=g((Gl,eo)=>{"use strict";var Qi;Object.keys||(dt=Object.prototype.hasOwnProperty,gn=Object.prototype.toString,Hi=vn(),Tn=Object.prototype.propertyIsEnumerable,Wi=!Tn.call({toString:null},"toString"),Ji=Tn.call(function(){},"prototype"),pt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Kt=function(t){var e=t.constructor;return e&&e.prototype===t},Yi={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Zi=function(){if(typeof window>"u")return!1;for(var t in window)try{if(!Yi["$"+t]&&dt.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{Kt(window[t])}catch{return!0}}catch{return!0}return!1}(),Xi=function(t){if(typeof window>"u"||!Zi)return Kt(t);try{return Kt(t)}catch{return!1}},Qi=function(e){var n=e!==null&&typeof e=="object",r=gn.call(e)==="[object Function]",u=Hi(e),i=n&&gn.call(e)==="[object String]",s=[];if(!n&&!r&&!u)throw new TypeError("Object.keys called on a non-object");var a=Ji&&r;if(i&&e.length>0&&!dt.call(e,0))for(var o=0;o<e.length;++o)s.push(String(o));if(u&&e.length>0)for(var c=0;c<e.length;++c)s.push(String(c));else for(var f in e)!(a&&f==="prototype")&&dt.call(e,f)&&s.push(String(f));if(Wi)for(var p=Xi(e),l=0;l<pt.length;++l)!(p&&pt[l]==="constructor")&&dt.call(e,pt[l])&&s.push(pt[l]);return s});var dt,gn,Hi,Tn,Wi,Ji,pt,Kt,Yi,Zi,Xi;eo.exports=Qi});var oo=g((Kl,io)=>{"use strict";var iu=Array.prototype.slice,ou=vn(),ro=Object.keys,Ht=ro?function(e){return ro(e)}:to(),no=Object.keys;Ht.shim=function(){if(Object.keys){var e=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);e||(Object.keys=function(r){return ou(r)?no(iu.call(r)):no(r)})}else Object.keys=Ht;return Object.keys||Ht};io.exports=Ht});var so=g((Hl,ao)=>{"use strict";ao.exports=Object});var hn=g((Wl,uo)=>{"use strict";uo.exports=Error});var An=g((Jl,co)=>{"use strict";co.exports=EvalError});var Vn=g((Yl,lo)=>{"use strict";lo.exports=RangeError});var Sn=g((Zl,fo)=>{"use strict";fo.exports=ReferenceError});var Wt=g((Xl,po)=>{"use strict";po.exports=SyntaxError});var Se=g((Ql,yo)=>{"use strict";yo.exports=TypeError});var On=g((ef,mo)=>{"use strict";mo.exports=URIError});var En=g((tf,No)=>{"use strict";No.exports=Math.abs});var bn=g((rf,vo)=>{"use strict";vo.exports=Math.floor});var In=g((nf,go)=>{"use strict";go.exports=Math.max});var _n=g((of,To)=>{"use strict";To.exports=Math.min});var Dn=g((af,ho)=>{"use strict";ho.exports=Math.pow});var Vo=g((sf,Ao)=>{"use strict";Ao.exports=Object.getOwnPropertyDescriptor});var Pe=g((uf,So)=>{"use strict";var Jt=Vo();if(Jt)try{Jt([],"length")}catch{Jt=null}So.exports=Jt});var Ce=g((cf,Oo)=>{"use strict";var Yt=Object.defineProperty||!1;if(Yt)try{Yt({},"a",{value:1})}catch{Yt=!1}Oo.exports=Yt});var bo=g((lf,Eo)=>{"use strict";Eo.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var u=42;e[n]=u;for(var i in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,n);if(a.value!==u||a.enumerable!==!0)return!1}return!0}});var Rn=g((ff,_o)=>{"use strict";var Io=typeof Symbol<"u"&&Symbol,au=bo();_o.exports=function(){return typeof Io!="function"||typeof Symbol!="function"||typeof Io("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:au()}});var ko=g((df,Ro)=>{"use strict";var su="Function.prototype.bind called on incompatible ",uu=Object.prototype.toString,cu=Math.max,lu="[object Function]",Do=function(e,n){for(var r=[],u=0;u<e.length;u+=1)r[u]=e[u];for(var i=0;i<n.length;i+=1)r[i+e.length]=n[i];return r},fu=function(e,n){for(var r=[],u=n||0,i=0;u<e.length;u+=1,i+=1)r[i]=e[u];return r},du=function(t,e){for(var n="",r=0;r<t.length;r+=1)n+=t[r],r+1<t.length&&(n+=e);return n};Ro.exports=function(e){var n=this;if(typeof n!="function"||uu.apply(n)!==lu)throw new TypeError(su+n);for(var r=fu(arguments,1),u,i=function(){if(this instanceof u){var f=n.apply(this,Do(r,arguments));return Object(f)===f?f:this}return n.apply(e,Do(r,arguments))},s=cu(0,n.length-r.length),a=[],o=0;o<s;o++)a[o]="$"+o;if(u=Function("binder","return function ("+du(a,",")+"){ return binder.apply(this,arguments); }")(i),n.prototype){var c=function(){};c.prototype=n.prototype,u.prototype=new c,c.prototype=null}return u}});var ce=g((pf,Po)=>{"use strict";var pu=ko();Po.exports=Function.prototype.bind||pu});var Zt=g((yf,Co)=>{"use strict";Co.exports=Function.prototype.call});var Xt=g((mf,xo)=>{"use strict";xo.exports=Function.prototype.apply});var Fo=g((Nf,wo)=>{"use strict";wo.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var kn=g((vf,Lo)=>{"use strict";var yu=ce(),mu=Xt(),Nu=Zt(),vu=Fo();Lo.exports=vu||yu.call(Nu,mu)});var Pn=g((gf,Mo)=>{"use strict";var gu=ce(),Tu=Se(),hu=Zt(),Au=kn();Mo.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new Tu("a function is required");return Au(gu,hu,e)}});var xn=g((Tf,qo)=>{"use strict";var Vu=Pn(),$o=Pe(),Uo;try{Uo=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Cn=!!Uo&&$o&&$o(Object.prototype,"__proto__"),zo=Object,jo=zo.getPrototypeOf;qo.exports=Cn&&typeof Cn.get=="function"?Vu([Cn.get]):typeof jo=="function"?function(e){return jo(e==null?e:zo(e))}:!1});var wn=g((hf,Bo)=>{"use strict";var Su=Function.prototype.call,Ou=Object.prototype.hasOwnProperty,Eu=ce();Bo.exports=Eu.call(Su,Ou)});var Xo=g((Af,Zo)=>{"use strict";var O,Wo=so(),bu=hn(),Iu=An(),_u=Vn(),Du=Sn(),Le=Wt(),Fe=Se(),Ru=On(),ku=En(),Pu=bn(),Cu=In(),xu=_n(),wu=Dn(),Jo=Function,Fn=function(t){try{return Jo('"use strict"; return ('+t+").constructor;")()}catch{}},yt=Pe(),Fu=Ce(),Ln=function(){throw new Fe},Lu=yt?function(){try{return arguments.callee,Ln}catch{try{return yt(arguments,"callee").get}catch{return Ln}}}():Ln,xe=Rn()(),Mu=xn(),F=typeof Reflect=="function"&&Reflect.getPrototypeOf||Wo.getPrototypeOf||Mu,Yo=Xt(),mt=Zt(),we={},$u=typeof Uint8Array>"u"||!F?O:F(Uint8Array),Oe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?O:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?O:ArrayBuffer,"%ArrayIteratorPrototype%":xe&&F?F([][Symbol.iterator]()):O,"%AsyncFromSyncIteratorPrototype%":O,"%AsyncFunction%":we,"%AsyncGenerator%":we,"%AsyncGeneratorFunction%":we,"%AsyncIteratorPrototype%":we,"%Atomics%":typeof Atomics>"u"?O:Atomics,"%BigInt%":typeof BigInt>"u"?O:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?O:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?O:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?O:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":bu,"%eval%":eval,"%EvalError%":Iu,"%Float32Array%":typeof Float32Array>"u"?O:Float32Array,"%Float64Array%":typeof Float64Array>"u"?O:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?O:FinalizationRegistry,"%Function%":Jo,"%GeneratorFunction%":we,"%Int8Array%":typeof Int8Array>"u"?O:Int8Array,"%Int16Array%":typeof Int16Array>"u"?O:Int16Array,"%Int32Array%":typeof Int32Array>"u"?O:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xe&&F?F(F([][Symbol.iterator]())):O,"%JSON%":typeof JSON=="object"?JSON:O,"%Map%":typeof Map>"u"?O:Map,"%MapIteratorPrototype%":typeof Map>"u"||!xe||!F?O:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Wo,"%Object.getOwnPropertyDescriptor%":yt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?O:Promise,"%Proxy%":typeof Proxy>"u"?O:Proxy,"%RangeError%":_u,"%ReferenceError%":Du,"%Reflect%":typeof Reflect>"u"?O:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?O:Set,"%SetIteratorPrototype%":typeof Set>"u"||!xe||!F?O:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?O:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":xe&&F?F(""[Symbol.iterator]()):O,"%Symbol%":xe?Symbol:O,"%SyntaxError%":Le,"%ThrowTypeError%":Lu,"%TypedArray%":$u,"%TypeError%":Fe,"%Uint8Array%":typeof Uint8Array>"u"?O:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?O:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?O:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?O:Uint32Array,"%URIError%":Ru,"%WeakMap%":typeof WeakMap>"u"?O:WeakMap,"%WeakRef%":typeof WeakRef>"u"?O:WeakRef,"%WeakSet%":typeof WeakSet>"u"?O:WeakSet,"%Function.prototype.call%":mt,"%Function.prototype.apply%":Yo,"%Object.defineProperty%":Fu,"%Math.abs%":ku,"%Math.floor%":Pu,"%Math.max%":Cu,"%Math.min%":xu,"%Math.pow%":wu};if(F)try{null.error}catch(t){Go=F(F(t)),Oe["%Error.prototype%"]=Go}var Go,ju=function t(e){var n;if(e==="%AsyncFunction%")n=Fn("async function () {}");else if(e==="%GeneratorFunction%")n=Fn("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=Fn("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var u=t("%AsyncGenerator%");u&&F&&(n=F(u.prototype))}return Oe[e]=n,n},Ko={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Nt=ce(),Qt=wn(),Uu=Nt.call(mt,Array.prototype.concat),zu=Nt.call(Yo,Array.prototype.splice),Ho=Nt.call(mt,String.prototype.replace),er=Nt.call(mt,String.prototype.slice),qu=Nt.call(mt,RegExp.prototype.exec),Bu=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Gu=/\\(\\)?/g,Ku=function(e){var n=er(e,0,1),r=er(e,-1);if(n==="%"&&r!=="%")throw new Le("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Le("invalid intrinsic syntax, expected opening `%`");var u=[];return Ho(e,Bu,function(i,s,a,o){u[u.length]=a?Ho(o,Gu,"$1"):s||i}),u},Hu=function(e,n){var r=e,u;if(Qt(Ko,r)&&(u=Ko[r],r="%"+u[0]+"%"),Qt(Oe,r)){var i=Oe[r];if(i===we&&(i=ju(r)),typeof i>"u"&&!n)throw new Fe("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:u,name:r,value:i}}throw new Le("intrinsic "+e+" does not exist!")};Zo.exports=function(e,n){if(typeof e!="string"||e.length===0)throw new Fe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Fe('"allowMissing" argument must be a boolean');if(qu(/^%?[^%]*%?$/,e)===null)throw new Le("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Ku(e),u=r.length>0?r[0]:"",i=Hu("%"+u+"%",n),s=i.name,a=i.value,o=!1,c=i.alias;c&&(u=c[0],zu(r,Uu([0,1],c)));for(var f=1,p=!0;f<r.length;f+=1){var l=r[f],y=er(l,0,1),N=er(l,-1);if((y==='"'||y==="'"||y==="`"||N==='"'||N==="'"||N==="`")&&y!==N)throw new Le("property names with quotes must have matching quotes");if((l==="constructor"||!p)&&(o=!0),u+="."+l,s="%"+u+"%",Qt(Oe,s))a=Oe[s];else if(a!=null){if(!(l in a)){if(!n)throw new Fe("base intrinsic for "+e+" exists, but the property is not available.");return}if(yt&&f+1>=r.length){var A=yt(a,l);p=!!A,p&&"get"in A&&!("originalValue"in A.get)?a=A.get:a=a[l]}else p=Qt(a,l),a=a[l];p&&!o&&(Oe[s]=a)}}return a}});var ra=g((Vf,ta)=>{"use strict";var Qo=Ce(),Wu=Wt(),Me=Se(),ea=Pe();ta.exports=function(e,n,r){if(!e||typeof e!="object"&&typeof e!="function")throw new Me("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new Me("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Me("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Me("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Me("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Me("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,o=!!ea&&ea(e,n);if(Qo)Qo(e,n,{configurable:s===null&&o?o.configurable:!s,enumerable:u===null&&o?o.enumerable:!u,value:r,writable:i===null&&o?o.writable:!i});else if(a||!u&&!i&&!s)e[n]=r;else throw new Wu("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var oa=g((Sf,ia)=>{"use strict";var Mn=Ce(),na=function(){return!!Mn};na.hasArrayLengthDefineBug=function(){if(!Mn)return null;try{return Mn([],"length",{value:1}).length!==1}catch{return!0}};ia.exports=na});var la=g((Of,ca)=>{"use strict";var Ju=Xo(),aa=ra(),Yu=oa()(),sa=Pe(),ua=Se(),Zu=Ju("%Math.floor%");ca.exports=function(e,n){if(typeof e!="function")throw new ua("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||Zu(n)!==n)throw new ua("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],u=!0,i=!0;if("length"in e&&sa){var s=sa(e,"length");s&&!s.configurable&&(u=!1),s&&!s.writable&&(i=!1)}return(u||i||!r)&&(Yu?aa(e,"length",n,!0,!0):aa(e,"length",n)),e}});var da=g((Ef,fa)=>{"use strict";var Xu=ce(),Qu=Xt(),ec=kn();fa.exports=function(){return ec(Xu,Qu,arguments)}});var ma=g((bf,tr)=>{"use strict";var tc=la(),pa=Ce(),rc=Pn(),ya=da();tr.exports=function(e){var n=rc(arguments),r=e.length-(arguments.length-1);return tc(n,1+(r>0?r:0),!0)};pa?pa(tr.exports,"apply",{value:ya}):tr.exports.apply=ya});var $n=g((If,Na)=>{"use strict";Na.exports=Object});var ga=g((_f,va)=>{"use strict";va.exports=Math.round});var ha=g((Df,Ta)=>{"use strict";Ta.exports=Number.isNaN||function(e){return e!==e}});var Va=g((Rf,Aa)=>{"use strict";var nc=ha();Aa.exports=function(e){return nc(e)||e===0?e:e<0?-1:1}});var jn=g((kf,Sa)=>{"use strict";Sa.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Un=g((Pf,Oa)=>{"use strict";var ic=$n();Oa.exports=ic.getPrototypeOf||null});var Da=g((Cf,_a)=>{"use strict";var Ea=jn(),ba=Un(),Ia=xn();_a.exports=Ea?function(e){return Ea(e)}:ba?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return ba(e)}:Ia?function(e){return Ia(e)}:null});var zn=g((xf,Ra)=>{"use strict";Ra.exports=Function.prototype.apply});var rr=g((wf,ka)=>{"use strict";ka.exports=Function.prototype.call});var Ma=g((Ff,La)=>{"use strict";var S,oc=$n(),ac=hn(),sc=An(),uc=Vn(),cc=Sn(),ze=Wt(),Ue=Se(),lc=On(),fc=En(),dc=bn(),pc=In(),yc=_n(),mc=Dn(),Nc=ga(),vc=Va(),wa=Function,qn=function(t){try{return wa('"use strict"; return ('+t+").constructor;")()}catch{}},vt=Pe(),gc=Ce(),Bn=function(){throw new Ue},Tc=vt?function(){try{return arguments.callee,Bn}catch{try{return vt(arguments,"callee").get}catch{return Bn}}}():Bn,$e=Rn()(),L=Da(),hc=Un(),Ac=jn(),Fa=zn(),gt=rr(),je={},Vc=typeof Uint8Array>"u"||!L?S:L(Uint8Array),Ee={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?S:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?S:ArrayBuffer,"%ArrayIteratorPrototype%":$e&&L?L([][Symbol.iterator]()):S,"%AsyncFromSyncIteratorPrototype%":S,"%AsyncFunction%":je,"%AsyncGenerator%":je,"%AsyncGeneratorFunction%":je,"%AsyncIteratorPrototype%":je,"%Atomics%":typeof Atomics>"u"?S:Atomics,"%BigInt%":typeof BigInt>"u"?S:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?S:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?S:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?S:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ac,"%eval%":eval,"%EvalError%":sc,"%Float16Array%":typeof Float16Array>"u"?S:Float16Array,"%Float32Array%":typeof Float32Array>"u"?S:Float32Array,"%Float64Array%":typeof Float64Array>"u"?S:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?S:FinalizationRegistry,"%Function%":wa,"%GeneratorFunction%":je,"%Int8Array%":typeof Int8Array>"u"?S:Int8Array,"%Int16Array%":typeof Int16Array>"u"?S:Int16Array,"%Int32Array%":typeof Int32Array>"u"?S:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":$e&&L?L(L([][Symbol.iterator]())):S,"%JSON%":typeof JSON=="object"?JSON:S,"%Map%":typeof Map>"u"?S:Map,"%MapIteratorPrototype%":typeof Map>"u"||!$e||!L?S:L(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":oc,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?S:Promise,"%Proxy%":typeof Proxy>"u"?S:Proxy,"%RangeError%":uc,"%ReferenceError%":cc,"%Reflect%":typeof Reflect>"u"?S:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?S:Set,"%SetIteratorPrototype%":typeof Set>"u"||!$e||!L?S:L(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?S:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":$e&&L?L(""[Symbol.iterator]()):S,"%Symbol%":$e?Symbol:S,"%SyntaxError%":ze,"%ThrowTypeError%":Tc,"%TypedArray%":Vc,"%TypeError%":Ue,"%Uint8Array%":typeof Uint8Array>"u"?S:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?S:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?S:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?S:Uint32Array,"%URIError%":lc,"%WeakMap%":typeof WeakMap>"u"?S:WeakMap,"%WeakRef%":typeof WeakRef>"u"?S:WeakRef,"%WeakSet%":typeof WeakSet>"u"?S:WeakSet,"%Function.prototype.call%":gt,"%Function.prototype.apply%":Fa,"%Object.defineProperty%":gc,"%Object.getPrototypeOf%":hc,"%Math.abs%":fc,"%Math.floor%":dc,"%Math.max%":pc,"%Math.min%":yc,"%Math.pow%":mc,"%Math.round%":Nc,"%Math.sign%":vc,"%Reflect.getPrototypeOf%":Ac};if(L)try{null.error}catch(t){Pa=L(L(t)),Ee["%Error.prototype%"]=Pa}var Pa,Sc=function t(e){var n;if(e==="%AsyncFunction%")n=qn("async function () {}");else if(e==="%GeneratorFunction%")n=qn("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=qn("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var u=t("%AsyncGenerator%");u&&L&&(n=L(u.prototype))}return Ee[e]=n,n},Ca={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Tt=ce(),nr=wn(),Oc=Tt.call(gt,Array.prototype.concat),Ec=Tt.call(Fa,Array.prototype.splice),xa=Tt.call(gt,String.prototype.replace),ir=Tt.call(gt,String.prototype.slice),bc=Tt.call(gt,RegExp.prototype.exec),Ic=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_c=/\\(\\)?/g,Dc=function(e){var n=ir(e,0,1),r=ir(e,-1);if(n==="%"&&r!=="%")throw new ze("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new ze("invalid intrinsic syntax, expected opening `%`");var u=[];return xa(e,Ic,function(i,s,a,o){u[u.length]=a?xa(o,_c,"$1"):s||i}),u},Rc=function(e,n){var r=e,u;if(nr(Ca,r)&&(u=Ca[r],r="%"+u[0]+"%"),nr(Ee,r)){var i=Ee[r];if(i===je&&(i=Sc(r)),typeof i>"u"&&!n)throw new Ue("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:u,name:r,value:i}}throw new ze("intrinsic "+e+" does not exist!")};La.exports=function(e,n){if(typeof e!="string"||e.length===0)throw new Ue("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Ue('"allowMissing" argument must be a boolean');if(bc(/^%?[^%]*%?$/,e)===null)throw new ze("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Dc(e),u=r.length>0?r[0]:"",i=Rc("%"+u+"%",n),s=i.name,a=i.value,o=!1,c=i.alias;c&&(u=c[0],Ec(r,Oc([0,1],c)));for(var f=1,p=!0;f<r.length;f+=1){var l=r[f],y=ir(l,0,1),N=ir(l,-1);if((y==='"'||y==="'"||y==="`"||N==='"'||N==="'"||N==="`")&&y!==N)throw new ze("property names with quotes must have matching quotes");if((l==="constructor"||!p)&&(o=!0),u+="."+l,s="%"+u+"%",nr(Ee,s))a=Ee[s];else if(a!=null){if(!(l in a)){if(!n)throw new Ue("base intrinsic for "+e+" exists, but the property is not available.");return}if(vt&&f+1>=r.length){var A=vt(a,l);p=!!A,p&&"get"in A&&!("originalValue"in A.get)?a=A.get:a=a[l]}else p=nr(a,l),a=a[l];p&&!o&&(Ee[s]=a)}}return a}});var ja=g((Lf,$a)=>{"use strict";$a.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var za=g((Mf,Ua)=>{"use strict";var kc=ce(),Pc=zn(),Cc=rr(),xc=ja();Ua.exports=xc||kc.call(Cc,Pc)});var Ba=g(($f,qa)=>{"use strict";var wc=ce(),Fc=Se(),Lc=rr(),Mc=za();qa.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new Fc("a function is required");return Mc(wc,Lc,e)}});var Wa=g((jf,Ha)=>{"use strict";var Ga=Ma(),Ka=Ba(),$c=Ka([Ga("%String.prototype.indexOf%")]);Ha.exports=function(e,n){var r=Ga(e,!!n);return typeof r=="function"&&$c(e,".prototype.")>-1?Ka([r]):r}});var Xa=g((Uf,Za)=>{"use strict";var or=(typeof JSON<"u"?JSON:zi()).stringify,jc=Bi(),Uc=oo(),zc=ma(),ar=Wa(),qc=ar("Array.prototype.join"),Ja=ar("Array.prototype.indexOf"),Bc=ar("Array.prototype.splice"),Gc=ar("Array.prototype.sort"),Ya=function(e,n){for(var r="",u=0;u<e;u+=1)r+=n;return r},Kc=function(t,e,n){return n};Za.exports=function(e){var n=arguments.length>1?arguments[1]:void 0,r=n&&n.space||"";typeof r=="number"&&(r=Ya(r," "));var u=!!n&&typeof n.cycles=="boolean"&&n.cycles,i=n&&n.replacer?zc(n.replacer):Kc;if(n&&typeof n.collapseEmpty<"u"&&typeof n.collapseEmpty!="boolean")throw new TypeError("`collapseEmpty` must be a boolean, if provided");var s=!!n&&n.collapseEmpty,a=typeof n=="function"?n:n&&n.cmp,o=a&&function(f){var p=a.length>2&&function(y){return f[y]};return function(l,y){return a({key:l,value:f[l]},{key:y,value:f[y]},p?{__proto__:null,get:p}:void 0)}},c=[];return function f(p,l,y,N){var A=r?` `+Ya(N,r):"",k=r?": ":":";if(y&&y.toJSON&&typeof y.toJSON=="function"&&(y=y.toJSON()),y=i(p,l,y),y!==void 0){if(typeof y!="object"||y===null)return or(y);var K=function(ci,pr){return s&&ci.length===0?pr:(pr==="[]"?"[":"{")+qc(ci,",")+A+(pr==="[]"?"]":"}")};if(jc(y)){for(var H=[],M=0;M<y.length;M++){var fr=f(y,M,y[M],N+1)||or(null);H[H.length]=A+r+fr}return K(H,"[]")}if(Ja(c,y)!==-1){if(u)return or("__cycle__");throw new TypeError("Converting circular structure to JSON")}else c[c.length]=y;for(var Vt=Gc(Uc(y),o&&o(y)),H=[],M=0;M<Vt.length;M++){var l=Vt[M],dr=f(y,l,y[l],N+1);if(dr){var ds=or(l)+k+dr;H[H.length]=A+r+ds}}return Bc(c,Ja(c,y),1),K(H,"{}")}}({"":e},"",e,0)}});var Rl={};Ts(Rl,{CODAMA_ERROR__ANCHOR__ACCOUNT_TYPE_MISSING:()=>Ti,CODAMA_ERROR__ANCHOR__ARGUMENT_TYPE_MISSING:()=>hi,CODAMA_ERROR__ANCHOR__PROGRAM_ID_KIND_UNIMPLEMENTED:()=>Si,CODAMA_ERROR__ANCHOR__SEED_KIND_UNIMPLEMENTED:()=>Vi,CODAMA_ERROR__ANCHOR__TYPE_PATH_MISSING:()=>Ai,CODAMA_ERROR__ANCHOR__UNRECOGNIZED_IDL_TYPE:()=>gi,CODAMA_ERROR__DISCRIMINATOR_FIELD_HAS_NO_DEFAULT_VALUE:()=>Ni,CODAMA_ERROR__DISCRIMINATOR_FIELD_NOT_FOUND:()=>mi,CODAMA_ERROR__ENUM_VARIANT_NOT_FOUND:()=>yi,CODAMA_ERROR__LINKED_NODE_NOT_FOUND:()=>bt,CODAMA_ERROR__NODE_FILESYSTEM_FUNCTION_UNAVAILABLE:()=>fi,CODAMA_ERROR__RENDERERS__UNSUPPORTED_NODE:()=>Oi,CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND:()=>Et,CODAMA_ERROR__UNEXPECTED_NODE_KIND:()=>Ot,CODAMA_ERROR__UNRECOGNIZED_BYTES_ENCODING:()=>pi,CODAMA_ERROR__UNRECOGNIZED_NODE_KIND:()=>St,CODAMA_ERROR__UNRECOGNIZED_NUMBER_FORMAT:()=>di,CODAMA_ERROR__VERSION_MISMATCH:()=>It,CODAMA_ERROR__VISITORS__ACCOUNT_FIELD_NOT_FOUND:()=>Pt,CODAMA_ERROR__VISITORS__CANNOT_ADD_DUPLICATED_PDA_NAMES:()=>_t,CODAMA_ERROR__VISITORS__CANNOT_EXTEND_MISSING_VISIT_FUNCTION:()=>xt,CODAMA_ERROR__VISITORS__CANNOT_FLATTEN_STRUCT_WITH_CONFLICTING_ATTRIBUTES:()=>_e,CODAMA_ERROR__VISITORS__CANNOT_REMOVE_LAST_PATH_IN_NODE_STACK:()=>Ft,CODAMA_ERROR__VISITORS__CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE:()=>kt,CODAMA_ERROR__VISITORS__CYCLIC_DEPENDENCY_DETECTED_WHEN_RESOLVING_INSTRUCTION_DEFAULT_VALUES:()=>Rt,CODAMA_ERROR__VISITORS__FAILED_TO_VALIDATE_NODE:()=>wt,CODAMA_ERROR__VISITORS__INSTRUCTION_ENUM_ARGUMENT_NOT_FOUND:()=>He,CODAMA_ERROR__VISITORS__INVALID_INSTRUCTION_DEFAULT_VALUE_DEPENDENCY:()=>Ke,CODAMA_ERROR__VISITORS__INVALID_NUMBER_WRAPPER:()=>Ct,CODAMA_ERROR__VISITORS__INVALID_PDA_SEED_VALUES:()=>Dt,CODAMA_ERROR__VISITORS__RENDER_MAP_KEY_NOT_FOUND:()=>vi,CONTEXTUAL_VALUE_NODES:()=>Di,COUNT_NODES:()=>Qe,CodamaError:()=>V,DISCRIMINATOR_NODES:()=>_r,ENUM_VARIANT_TYPE_NODES:()=>Fr,INSTRUCTION_INPUT_VALUE_NODES:()=>fe,LINKABLE_NODES:()=>Jn,LINK_NODES:()=>Cs,LOG_LEVELS:()=>ss,LinkableDictionary:()=>$,NodeStack:()=>q,PDA_SEED_NODES:()=>Cr,REGISTERED_CONTEXTUAL_VALUE_NODE_KINDS:()=>_i,REGISTERED_COUNT_NODE_KINDS:()=>Or,REGISTERED_DISCRIMINATOR_NODE_KINDS:()=>Ir,REGISTERED_LINK_NODE_KINDS:()=>Vr,REGISTERED_NODE_KINDS:()=>z,REGISTERED_PDA_SEED_NODE_KINDS:()=>Pr,REGISTERED_TYPE_NODE_KINDS:()=>Ut,REGISTERED_VALUE_NODE_KINDS:()=>Ii,STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS:()=>vr,STANDALONE_TYPE_NODE_KINDS:()=>jr,STANDALONE_VALUE_NODE_KINDS:()=>Nr,TYPE_NODES:()=>_,VALUE_NODES:()=>x,accountBumpValueNode:()=>Ps,accountLinkNode:()=>Ye,accountNode:()=>ee,accountValueNode:()=>We,addPdasVisitor:()=>el,amountTypeNode:()=>rt,argumentValueNode:()=>Je,arrayTypeNode:()=>nt,arrayValueNode:()=>Zr,assertIsNestedTypeNode:()=>Q,assertIsNode:()=>d,assertIsNodeFilter:()=>ut,assertIsNodePath:()=>es,booleanTypeNode:()=>wr,booleanValueNode:()=>Gs,bottomUpTransformerVisitor:()=>b,bytesTypeNode:()=>tt,bytesValueNode:()=>Rr,camelCase:()=>v,capitalize:()=>bi,conditionalValueNode:()=>mr,consoleLogVisitor:()=>Jc,constantDiscriminatorNode:()=>br,constantPdaSeedNode:()=>Re,constantPdaSeedNodeFromBytes:()=>$s,constantPdaSeedNodeFromProgramId:()=>Ls,constantPdaSeedNodeFromString:()=>Ms,constantValueNode:()=>lt,constantValueNodeFromBytes:()=>Hs,constantValueNodeFromString:()=>Ks,createFromJson:()=>Dl,createFromRoot:()=>ui,createSubInstructionsFromEnumArgsVisitor:()=>rl,dateTimeTypeNode:()=>it,deduplicateIdenticalDefinedTypesVisitor:()=>nl,deduplicateInstructionDependencies:()=>Hn,definedTypeLinkNode:()=>se,definedTypeNode:()=>ft,deleteNodesVisitor:()=>Qn,enumEmptyVariantTypeNode:()=>pe,enumStructVariantTypeNode:()=>he,enumTupleVariantTypeNode:()=>ot,enumTypeNode:()=>at,enumValueNode:()=>Xr,errorNode:()=>un,extendVisitor:()=>U,fieldDiscriminatorNode:()=>et,fillDefaultPdaSeedValuesVisitor:()=>oi,findFirstNodeFromPath:()=>Wc,findInstructionNodeFromPath:()=>Gn,findLastNodeFromPath:()=>Zn,findProgramNodeFromPath:()=>le,fixedCountNode:()=>xs,fixedSizeTypeNode:()=>st,flattenInstructionArguments:()=>ii,flattenInstructionDataArgumentsVisitor:()=>tl,flattenStruct:()=>cs,flattenStructVisitor:()=>sl,getAllAccounts:()=>Zs,getAllDefinedTypes:()=>ln,getAllErrors:()=>Xs,getAllInstructionArguments:()=>re,getAllInstructions:()=>Ci,getAllInstructionsWithSubs:()=>yr,getAllPdas:()=>Ys,getAllPrograms:()=>te,getByteSizeVisitor:()=>ei,getCommonInstructionAccountDefaultRules:()=>ll,getConjunctiveNodeSelectorFunction:()=>Yn,getDebugStringVisitor:()=>Yc,getDefinedTypeHistogramVisitor:()=>ai,getInstructionDependencies:()=>be,getLastNodeFromPath:()=>P,getLevelIndex:()=>At,getNodePathUntilLastNode:()=>Kn,getNodeSelectorFunction:()=>ur,getRecordLinkablesVisitor:()=>lr,getResolvedInstructionInputsVisitor:()=>ri,getUniqueHashStringVisitor:()=>ni,getValidationItemsVisitor:()=>Xc,getVisitFunctionName:()=>ie,hiddenPrefixTypeNode:()=>Lr,hiddenSuffixTypeNode:()=>Mr,identityValueNode:()=>gr,identityVisitor:()=>qe,instructionAccountLinkNode:()=>hr,instructionAccountNode:()=>ke,instructionArgumentLinkNode:()=>Ar,instructionArgumentNode:()=>w,instructionByteDeltaNode:()=>cn,instructionLinkNode:()=>Ze,instructionNode:()=>j,instructionRemainingAccountsNode:()=>fn,interceptFirstVisitVisitor:()=>os,interceptVisitor:()=>oe,isCodamaError:()=>Es,isDataEnum:()=>Bs,isDecimal:()=>qs,isFilledNodePath:()=>Xn,isInteger:()=>zs,isNestedTypeNode:()=>ki,isNode:()=>m,isNodeFilter:()=>Ur,isNodePath:()=>Ne,isScalarEnum:()=>jt,isSignedInteger:()=>js,isUnsignedInteger:()=>Us,kebabCase:()=>Rs,logError:()=>bs,logInfo:()=>_s,logWarn:()=>Is,mapEntryValueNode:()=>Qr,mapTypeNode:()=>$r,mapValueNode:()=>en,mapVisitor:()=>ht,mergeVisitor:()=>ve,nodePathToString:()=>rs,nodePathToStringArray:()=>ts,nonNullableIdentityVisitor:()=>ae,noneValueNode:()=>Ws,numberTypeNode:()=>de,numberValueNode:()=>tn,optionTypeNode:()=>zr,parseDocs:()=>W,parseOptionalAccountStrategy:()=>xi,pascalCase:()=>Mt,payerValueNode:()=>Tr,pdaLinkNode:()=>Te,pdaNode:()=>ne,pdaSeedValueNode:()=>De,pdaValueNode:()=>Xe,pipe:()=>I,postOffsetTypeNode:()=>qr,preOffsetTypeNode:()=>Br,prefixedCountNode:()=>Er,programIdValueNode:()=>$t,programLinkNode:()=>ge,programNode:()=>Y,publicKeyTypeNode:()=>Ri,publicKeyValueNode:()=>C,recordLinkablesOnFirstVisitVisitor:()=>G,recordNodeStackVisitor:()=>B,remainderCountNode:()=>ws,remainderOptionTypeNode:()=>Gr,removeDocsVisitor:()=>is,removeNullAndAssertIsNodeFilter:()=>D,resolveNestedTypeNode:()=>Ae,resolverValueNode:()=>Sr,rootNode:()=>dn,rootNodeVisitor:()=>Ie,safeCaptureStackTrace:()=>Ds,sentinelTypeNode:()=>Kr,setAccountDiscriminatorFromFieldVisitor:()=>ul,setFixedAccountSizesVisitor:()=>cl,setInstructionAccountDefaultValuesVisitor:()=>fl,setInstructionDiscriminatorsVisitor:()=>dl,setNumberWrappersVisitor:()=>pl,setStructDefaultValuesVisitor:()=>yl,setTypeNode:()=>Hr,setValueNode:()=>rn,singleNodeVisitor:()=>ti,sizeDiscriminatorNode:()=>Fs,sizePrefixTypeNode:()=>Wr,snakeCase:()=>ks,solAmountTypeNode:()=>ct,someValueNode:()=>nn,staticVisitor:()=>sr,stringTypeNode:()=>Dr,stringValueNode:()=>kr,structFieldTypeNode:()=>X,structFieldTypeNodeFromInstructionArgumentNode:()=>Pi,structFieldValueNode:()=>on,structTypeNode:()=>J,structTypeNodeFromInstructionArgumentNodes:()=>Js,structValueNode:()=>an,tapVisitor:()=>Zc,throwValidatorItemsVisitor:()=>Qc,titleCase:()=>Lt,topDownTransformerVisitor:()=>cr,transformDefinedTypesIntoAccountsVisitor:()=>ml,transformNestedTypeNode:()=>ye,transformU8ArraysToBytesVisitor:()=>Nl,tupleTypeNode:()=>Jr,tupleValueNode:()=>sn,unwrapDefinedTypesVisitor:()=>si,unwrapInstructionArgsDefinedTypesVisitor:()=>vl,unwrapTupleEnumWithSingleStructVisitor:()=>gl,unwrapTypeDefinedLinksVisitor:()=>Tl,updateAccountsVisitor:()=>Vl,updateDefinedTypesVisitor:()=>Sl,updateErrorsVisitor:()=>Ol,updateInstructionsVisitor:()=>El,updateProgramsVisitor:()=>_l,validateCodamaVersion:()=>fs,validationItem:()=>R,variablePdaSeedNode:()=>xr,visit:()=>T,visitOrElse:()=>Hc,voidVisitor:()=>as,zeroableOptionTypeNode:()=>Yr});var St=1,Ot=2,Et=3,bt=4,fi=5,It=6,di=7,pi=8,yi=9,mi=10,Ni=11,_t=12e5,Dt=1200001,Rt=1200002,kt=1200003,Ke=1200004,Pt=1200005,Ct=1200006,xt=1200007,wt=1200008,He=1200009,_e=1200010,vi=1200011,Ft=1200012,gi=21e5,Ti=2100001,hi=2100002,Ai=2100003,Vi=2100004,Si=2100005,Oi=28e5;function Ei(t){return Array.isArray(t)?"%5B"+t.map(Ei).join("%2C%20")+"%5D":typeof t=="bigint"?`${t}n`:encodeURIComponent(String(t!=null&&Object.getPrototypeOf(t)===null?{...t}:t))}function Vs([t,e]){return`${t}=${Ei(e)}`}function Ss(t){let e=Object.entries(t).map(Vs).join("&");return btoa(e)}var Pl={[Ti]:"Account type [$name] is missing from the IDL types.",[hi]:"Argument name [$name] is missing from the instruction definition.",[Si]:"Program ID kind [$kind] is not implemented.",[Vi]:"Seed kind [$kind] is not implemented.",[Ai]:"Field type is missing for path [$path] in [$idlType].",[gi]:"Unrecognized Anchor IDL type [$idlType].",[Ni]:"Discriminator field [$field] has no default value.",[mi]:"Could not find discriminator field [$field]",[yi]:"Enum variant [$variant] not found in enum type [$enumName].",[bt]:"Could not find linked node [$name] from [$kind].",[fi]:"Node.js filesystem function [$fsFunction] is not available in your environment.",[Oi]:"Cannot render the encountered node of kind [$kind].",[Et]:"Expected nested node of kind [$expectedKinds], got [$kind]",[Ot]:"Expected node of kind [$expectedKinds], got [$kind].",[pi]:"Unrecognized bytes encoding [$encoding].",[St]:"Unrecognized node kind [$kind].",[di]:"Unrecognized number format [$format].",[It]:"The provided RootNode version [$rootVersion] is not compatible with the installed Codama version [$codamaVersion].",[Pt]:"Account [$name] does not have a field named [$missingField].",[_t]:"Cannot add PDAs to program [$programName] because the following PDA names already exist [$duplicatedPdaNames].",[xt]:"Cannot extend visitor with function [$visitFunction] as the base visitor does not support it.",[_e]:"Cannot flatten struct since this would cause the following attributes to conflict [$conflictingAttributes].",[Ft]:"Cannot remove the last path in the node stack.",[kt]:"Cannot use optional account [$seedValueName] as the [$seedName] PDA seed for the [$instructionAccountName] account of the [$instructionName] instruction.",[Rt]:"Circular dependency detected when resolving the accounts and arguments' default values of the [$instructionName] instruction. Got the following dependency cycle [$formattedCycle].",[wt]:"Failed to validate the given node [$formattedHistogram].",[He]:"Could not find an enum argument named [$argumentName] for instruction [$instructionName].",[Ke]:"Dependency [$dependencyName] of kind [$dependencyKind] is not a valid dependency of [$parentName] of kind [$parentKind] in the [$instructionName] instruction.",[Ct]:"Invalid number wrapper kind [$wrapper].",[Dt]:"Invalid seed values for PDA [$pdaName] in instruction [$instructionName].",[vi]:"Cannot find key [$key] in RenderMap."};function Os(t,e={}){{let n=`Codama error #${t}; Decode this error by running \`npx @codama/errors decode -- ${t}`;return Object.keys(e).length&&(n+=` '${Ss(e)}'`),`${n}\``}}function Es(t,e){return t instanceof Error&&t.name==="CodamaError"?e!==void 0?t.context.__code===e:!0:!1}var V=class extends Error{constructor(...[e,n]){let r,u;if(n){let{cause:s,...a}=n;s&&(u={cause:s}),Object.keys(a).length>0&&(r=a)}let i=Os(e,r);super(i,u);Ge(this,"context");this.context={__code:e,...r},this.name="CodamaError"}};function bs(t){console.error(t)}function Is(t){console.warn(t)}function _s(t){console.log(t)}function Ds(...t){"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...t)}function W(t){return t==null?[]:Array.isArray(t)?t:[t]}function bi(t){return t.length===0?t:t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function Lt(t){return t.replace(/([A-Z])/g," $1").split(/[^a-zA-Z0-9]+/).filter(e=>e.length>0).map(bi).join(" ")}function Mt(t){return Lt(t).split(" ").join("")}function v(t){if(t.length===0)return t;let e=Mt(t);return e.charAt(0).toLowerCase()+e.slice(1)}function Rs(t){return Lt(t).split(" ").join("-").toLowerCase()}function ks(t){return Lt(t).split(" ").join("_").toLowerCase()}function Ps(t){return Object.freeze({kind:"accountBumpValueNode",name:v(t)})}function We(t){return Object.freeze({kind:"accountValueNode",name:v(t)})}function Je(t){return Object.freeze({kind:"argumentValueNode",name:v(t)})}function mr(t){return Object.freeze({kind:"conditionalValueNode",condition:t.condition,...t.value!==void 0&&{value:t.value},...t.ifTrue!==void 0&&{ifTrue:t.ifTrue},...t.ifFalse!==void 0&&{ifFalse:t.ifFalse}})}var Nr=["arrayValueNode","bytesValueNode","booleanValueNode","constantValueNode","enumValueNode","mapValueNode","noneValueNode","numberValueNode","setValueNode","someValueNode","structValueNode","tupleValueNode","publicKeyValueNode","stringValueNode"],Ii=[...Nr,"mapEntryValueNode","structFieldValueNode"],x=Nr,vr=["accountBumpValueNode","accountValueNode","argumentValueNode","conditionalValueNode","identityValueNode","payerValueNode","pdaValueNode","programIdValueNode","resolverValueNode"],_i=[...vr,"pdaSeedValueNode"],Di=vr,fe=[...x,...Di,"programLinkNode"];function gr(){return Object.freeze({kind:"identityValueNode"})}function Tr(){return Object.freeze({kind:"payerValueNode"})}function De(t,e){return Object.freeze({kind:"pdaSeedValueNode",name:v(t),value:e})}function ge(t){return Object.freeze({kind:"programLinkNode",name:v(t)})}function Ye(t,e){return Object.freeze({kind:"accountLinkNode",...e===void 0?{}:{program:typeof e=="string"?ge(e):e},name:v(t)})}function se(t,e){return Object.freeze({kind:"definedTypeLinkNode",...e===void 0?{}:{program:typeof e=="string"?ge(e):e},name:v(t)})}function Ze(t,e){return Object.freeze({kind:"instructionLinkNode",...e===void 0?{}:{program:typeof e=="string"?ge(e):e},name:v(t)})}function hr(t,e){return Object.freeze({kind:"instructionAccountLinkNode",...e===void 0?{}:{instruction:typeof e=="string"?Ze(e):e},name:v(t)})}function Ar(t,e){return Object.freeze({kind:"instructionArgumentLinkNode",...e===void 0?{}:{instruction:typeof e=="string"?Ze(e):e},name:v(t)})}var Vr=["accountLinkNode","definedTypeLinkNode","instructionAccountLinkNode","instructionArgumentLinkNode","instructionLinkNode","pdaLinkNode","programLinkNode"],Cs=Vr;function Te(t,e){return Object.freeze({kind:"pdaLinkNode",...e===void 0?{}:{program:typeof e=="string"?ge(e):e},name:v(t)})}function Xe(t,e=[]){return Object.freeze({kind:"pdaValueNode",pda:typeof t=="string"?Te(t):t,seeds:e})}function $t(){return Object.freeze({kind:"programIdValueNode"})}function Sr(t,e={}){return Object.freeze({kind:"resolverValueNode",name:v(t),docs:W(e.docs),dependsOn:e.dependsOn})}var Or=["fixedCountNode","remainderCountNode","prefixedCountNode"],Qe=Or;function xs(t){return Object.freeze({kind:"fixedCountNode",value:t})}function Er(t){return Object.freeze({kind:"prefixedCountNode",prefix:t})}function ws(){return Object.freeze({kind:"remainderCountNode"})}function br(t,e=0){return Object.freeze({kind:"constantDiscriminatorNode",offset:e,constant:t})}var Ir=["constantDiscriminatorNode","fieldDiscriminatorNode","sizeDiscriminatorNode"],_r=Ir;function et(t,e=0){return Object.freeze({kind:"fieldDiscriminatorNode",name:v(t),offset:e})}function Fs(t){return Object.freeze({kind:"sizeDiscriminatorNode",size:t})}function tt(){return Object.freeze({kind:"bytesTypeNode"})}function Ri(){return Object.freeze({kind:"publicKeyTypeNode"})}function Dr(t){return Object.freeze({kind:"stringTypeNode",encoding:t})}function Rr(t,e){return Object.freeze({kind:"bytesValueNode",data:e,encoding:t})}function kr(t){return Object.freeze({kind:"stringValueNode",string:t})}function Re(t,e){return Object.freeze({kind:"constantPdaSeedNode",type:t,value:e})}function Ls(){return Re(Ri(),$t())}function Ms(t,e){return Re(Dr(t),kr(e))}function $s(t,e){return Re(tt(),Rr(t,e))}var Pr=["constantPdaSeedNode","variablePdaSeedNode"],Cr=Pr;function xr(t,e,n){return Object.freeze({kind:"variablePdaSeedNode",name:v(t),docs:W(n),type:e})}function rt(t,e,n){return Object.freeze({kind:"amountTypeNode",decimals:e,...n!==void 0&&{unit:n},number:t})}function nt(t,e){return Object.freeze({kind:"arrayTypeNode",item:t,count:e})}function de(t,e="le"){return Object.freeze({kind:"numberTypeNode",format:t,endian:e})}function js(t){return t.format.startsWith("i")}function Us(t){return t.format.startsWith("u")||t.format==="shortU16"}function zs(t){return!t.format.startsWith("f")}function qs(t){return t.format.startsWith("f")}function wr(t){return Object.freeze({kind:"booleanTypeNode",size:t!=null?t:de("u8")})}function it(t){return Object.freeze({kind:"dateTimeTypeNode",number:t})}function pe(t,e){return Object.freeze({kind:"enumEmptyVariantTypeNode",name:v(t),discriminator:e})}function he(t,e,n){return Object.freeze({kind:"enumStructVariantTypeNode",name:v(t),...n!==void 0&&{discriminator:n},struct:e})}function ot(t,e,n){return Object.freeze({kind:"enumTupleVariantTypeNode",name:v(t),...n!==void 0&&{discriminator:n},tuple:e})}function at(t,e={}){var n;return Object.freeze({kind:"enumTypeNode",variants:t,size:(n=e.size)!=null?n:de("u8")})}function jt(t){return t.variants.every(e=>e.kind==="enumEmptyVariantTypeNode")}