@junobuild/admin 0.0.44 → 0.0.45

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.
Files changed (29) hide show
  1. package/declarations/ic/ic.did.d.ts +32 -20
  2. package/declarations/mission_control/mission_control.did.d.ts +9 -7
  3. package/declarations/mission_control/mission_control.factory.did.js +2 -2
  4. package/declarations/orbiter/orbiter.did.d.ts +42 -0
  5. package/declarations/orbiter/orbiter.factory.did.js +48 -0
  6. package/declarations/orbiter/orbiter.factory.did.mjs +192 -0
  7. package/declarations/satellite/satellite.did.d.ts +5 -0
  8. package/declarations/satellite/satellite.factory.did.js +27 -20
  9. package/declarations/satellite/satellite.factory.did.mjs +27 -20
  10. package/dist/browser/index.js +7 -7
  11. package/dist/browser/index.js.map +4 -4
  12. package/dist/declarations/ic/ic.did.d.ts +32 -20
  13. package/dist/declarations/mission_control/mission_control.did.d.ts +9 -7
  14. package/dist/declarations/mission_control/mission_control.factory.did.js +2 -2
  15. package/dist/declarations/orbiter/orbiter.did.d.ts +42 -0
  16. package/dist/declarations/orbiter/orbiter.factory.did.js +48 -0
  17. package/dist/declarations/orbiter/orbiter.factory.did.mjs +192 -0
  18. package/dist/declarations/satellite/satellite.did.d.ts +5 -0
  19. package/dist/declarations/satellite/satellite.factory.did.js +27 -20
  20. package/dist/declarations/satellite/satellite.factory.did.mjs +27 -20
  21. package/dist/node/index.mjs +7 -7
  22. package/dist/node/index.mjs.map +4 -4
  23. package/dist/types/api/ic.api.d.ts +5 -0
  24. package/dist/types/api/satellite.api.d.ts +3 -0
  25. package/dist/types/index.d.ts +8 -7
  26. package/dist/types/services/satellite.services.d.ts +7 -0
  27. package/dist/types/types/build.types.d.ts +1 -0
  28. package/dist/types/utils/actor.utils.d.ts +3 -1
  29. package/package.json +1 -1
@@ -25,6 +25,26 @@ export const idlFactory = ({IDL}) => {
25
25
  cycles: IDL.Nat,
26
26
  destination_id: IDL.Principal
27
27
  });
28
+ const AssetKey = IDL.Record({
29
+ token: IDL.Opt(IDL.Text),
30
+ collection: IDL.Text,
31
+ owner: IDL.Principal,
32
+ name: IDL.Text,
33
+ description: IDL.Opt(IDL.Text),
34
+ full_path: IDL.Text
35
+ });
36
+ const AssetEncodingNoContent = IDL.Record({
37
+ modified: IDL.Nat64,
38
+ sha256: IDL.Vec(IDL.Nat8),
39
+ total_length: IDL.Nat
40
+ });
41
+ const AssetNoContent = IDL.Record({
42
+ key: AssetKey,
43
+ updated_at: IDL.Nat64,
44
+ encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
45
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
46
+ created_at: IDL.Nat64
47
+ });
28
48
  const StorageConfigIFrame = IDL.Variant({
29
49
  Deny: IDL.Null,
30
50
  AllowAny: IDL.Null,
@@ -110,26 +130,6 @@ export const idlFactory = ({IDL}) => {
110
130
  matcher: IDL.Opt(ListMatcher),
111
131
  paginate: IDL.Opt(ListPaginate)
112
132
  });
113
- const AssetKey = IDL.Record({
114
- token: IDL.Opt(IDL.Text),
115
- collection: IDL.Text,
116
- owner: IDL.Principal,
117
- name: IDL.Text,
118
- description: IDL.Opt(IDL.Text),
119
- full_path: IDL.Text
120
- });
121
- const AssetEncodingNoContent = IDL.Record({
122
- modified: IDL.Nat64,
123
- sha256: IDL.Vec(IDL.Nat8),
124
- total_length: IDL.Nat
125
- });
126
- const AssetNoContent = IDL.Record({
127
- key: AssetKey,
128
- updated_at: IDL.Nat64,
129
- encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
130
- headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
131
- created_at: IDL.Nat64
132
- });
133
133
  const ListResults = IDL.Record({
134
134
  matches_pages: IDL.Opt(IDL.Nat64),
135
135
  matches_length: IDL.Nat64,
@@ -194,6 +194,7 @@ export const idlFactory = ({IDL}) => {
194
194
  });
195
195
  const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
196
196
  return IDL.Service({
197
+ build_version: IDL.Func([], [IDL.Text], ['query']),
197
198
  commit_asset_upload: IDL.Func([CommitBatch], [], []),
198
199
  count_assets: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),
199
200
  count_docs: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),
@@ -211,8 +212,14 @@ export const idlFactory = ({IDL}) => {
211
212
  del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),
212
213
  del_rule: IDL.Func([RulesType, IDL.Text, DelDoc], [], []),
213
214
  deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
215
+ get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),
214
216
  get_config: IDL.Func([], [Config], []),
215
217
  get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
218
+ get_many_assets: IDL.Func(
219
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
220
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],
221
+ ['query']
222
+ ),
216
223
  get_many_docs: IDL.Func(
217
224
  [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
218
225
  [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],
@@ -1,16 +1,16 @@
1
1
  import { createRequire as topLevelCreateRequire } from 'module';
2
2
  const require = topLevelCreateRequire(import.meta.url);
3
- var $r=Object.create;var mt=Object.defineProperty;var Ur=Object.getOwnPropertyDescriptor;var qr=Object.getOwnPropertyNames;var jr=Object.getPrototypeOf,zr=Object.prototype.hasOwnProperty;var ft=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Hr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of qr(t))!zr.call(e,o)&&o!==r&&mt(e,o,{get:()=>t[o],enumerable:!(n=Ur(t,o))||n.enumerable});return e};var ht=(e,t,r)=>(r=e!=null?$r(jr(e)):{},Hr(t||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e));var _e=z($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.PipeArrayBuffer=$.fromHexString=$.toHexString=$.concat=void 0;function Zr(...e){let t=new Uint8Array(e.reduce((n,o)=>n+o.byteLength,0)),r=0;for(let n of e)t.set(new Uint8Array(n),r),r+=n.byteLength;return t}$.concat=Zr;function Ir(e){return new Uint8Array(e).reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}$.toHexString=Ir;function Dr(e){var t;return new Uint8Array(((t=e.match(/.{1,2}/g))!==null&&t!==void 0?t:[]).map(r=>parseInt(r,16)))}$.fromHexString=Dr;var $e=class{constructor(t,r=t?.byteLength||0){this._buffer=t||new ArrayBuffer(0),this._view=new Uint8Array(this._buffer,0,r)}get buffer(){return this._view.slice()}get byteLength(){return this._view.byteLength}read(t){let r=this._view.subarray(0,t);return this._view=this._view.subarray(t),r.slice().buffer}readUint8(){let t=this._view[0];return this._view=this._view.subarray(1),t}write(t){let r=new Uint8Array(t),n=this._view.byteLength;this._view.byteOffset+this._view.byteLength+r.byteLength>=this._buffer.byteLength?this.alloc(r.byteLength):this._view=new Uint8Array(this._buffer,this._view.byteOffset,this._view.byteLength+r.byteLength),this._view.set(r,n)}get end(){return this._view.byteLength===0}alloc(t){let r=new ArrayBuffer((this._buffer.byteLength+t)*1.2|0),n=new Uint8Array(r,0,this._view.byteLength+t);n.set(this._view),this._buffer=r,this._view=n}};$.PipeArrayBuffer=$e});var Ue=z(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.idlLabelToId=void 0;function Lr(e){let r=new TextEncoder().encode(e),n=0;for(let o of r)n=(n*223+o)%2**32;return n}function en(e){if(/^_\d+_$/.test(e)||/^_0x[0-9a-fA-F]+_$/.test(e)){let t=+e.slice(1,-1);if(Number.isSafeInteger(t)&&t>=0&&t<2**32)return t}return Lr(e)}ye.idlLabelToId=en});var je=z(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.readIntLE=x.readUIntLE=x.writeIntLE=x.writeUIntLE=x.slebDecode=x.slebEncode=x.lebDecode=x.lebEncode=x.safeReadUint8=x.safeRead=void 0;var qe=_e();function At(){throw new Error("unexpected end of buffer")}function Bt(e,t){return e.byteLength<t&&At(),e.read(t)}x.safeRead=Bt;function ge(e){let t=e.readUint8();return t===void 0&&At(),t}x.safeReadUint8=ge;function tn(e){if(typeof e=="number"&&(e=BigInt(e)),e<BigInt(0))throw new Error("Cannot leb encode negative values.");let t=(e===BigInt(0)?0:Math.ceil(Math.log2(Number(e))))+1,r=new qe.PipeArrayBuffer(new ArrayBuffer(t),0);for(;;){let n=Number(e&BigInt(127));if(e/=BigInt(128),e===BigInt(0)){r.write(new Uint8Array([n]));break}else r.write(new Uint8Array([n|128]))}return r.buffer}x.lebEncode=tn;function Mt(e){let t=BigInt(1),r=BigInt(0),n;do n=ge(e),r+=BigInt(n&127).valueOf()*t,t*=BigInt(128);while(n>=128);return r}x.lebDecode=Mt;function rn(e){typeof e=="number"&&(e=BigInt(e));let t=e<BigInt(0);t&&(e=-e-BigInt(1));let r=(e===BigInt(0)?0:Math.ceil(Math.log2(Number(e))))+1,n=new qe.PipeArrayBuffer(new ArrayBuffer(r),0);for(;;){let i=o(e);if(e/=BigInt(128),t&&e===BigInt(0)&&i&64||!t&&e===BigInt(0)&&!(i&64)){n.write(new Uint8Array([i]));break}else n.write(new Uint8Array([i|128]))}function o(i){let a=i%BigInt(128);return Number(t?BigInt(128)-a-BigInt(1):a)}return n.buffer}x.slebEncode=rn;function nn(e){let t=new Uint8Array(e.buffer),r=0;for(;r<t.byteLength;r++)if(t[r]<128){if(!(t[r]&64))return Mt(e);break}let n=new Uint8Array(Bt(e,r+1)),o=BigInt(0);for(let i=n.byteLength-1;i>=0;i--)o=o*BigInt(128)+BigInt(128-(n[i]&127)-1);return-o-BigInt(1)}x.slebDecode=nn;function on(e,t){if(BigInt(e)<BigInt(0))throw new Error("Cannot write negative values.");return kt(e,t)}x.writeUIntLE=on;function kt(e,t){e=BigInt(e);let r=new qe.PipeArrayBuffer(new ArrayBuffer(Math.min(1,t)),0),n=0,o=BigInt(256),i=BigInt(0),a=Number(e%o);for(r.write(new Uint8Array([a]));++n<t;)e<0&&i===BigInt(0)&&a!==0&&(i=BigInt(1)),a=Number((e/o-i)%BigInt(256)),r.write(new Uint8Array([a])),o*=BigInt(256);return r.buffer}x.writeIntLE=kt;function $t(e,t){let r=BigInt(ge(e)),n=BigInt(1),o=0;for(;++o<t;){n*=BigInt(256);let i=BigInt(ge(e));r=r+n*i}return r}x.readUIntLE=$t;function sn(e,t){let r=$t(e,t),n=BigInt(2)**(BigInt(8)*BigInt(t-1)+BigInt(7));return r>=n&&(r-=n*BigInt(2)),r}x.readIntLE=sn});var Ut=z(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.iexp2=Z.ilog2=void 0;function an(e){let t=BigInt(e);if(e<=0)throw new RangeError("Input must be positive");return t.toString(2).length-1}Z.ilog2=an;function cn(e){let t=BigInt(e);if(e<0)throw new RangeError("Input must be non-negative");return BigInt(1)<<t}Z.iexp2=cn});var Je=z(s=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});s.Variant=s.Record=s.Opt=s.Vec=s.Tuple=s.Principal=s.Nat64=s.Nat32=s.Nat16=s.Nat8=s.Int64=s.Int32=s.Int16=s.Int8=s.Float64=s.Float32=s.Nat=s.Int=s.Text=s.Null=s.Bool=s.Unknown=s.Reserved=s.Empty=s.decode=s.encode=s.ServiceClass=s.FuncClass=s.PrincipalClass=s.RecClass=s.VariantClass=s.TupleClass=s.RecordClass=s.OptClass=s.VecClass=s.FixedNatClass=s.FixedIntClass=s.FloatClass=s.NatClass=s.IntClass=s.TextClass=s.ReservedClass=s.NullClass=s.BoolClass=s.UnknownClass=s.EmptyClass=s.ConstructType=s.PrimitiveType=s.Type=s.Visitor=void 0;s.Service=s.Func=s.Rec=void 0;var ln=ft("@dfinity/principal"),_=_e(),U=Ue(),c=je(),ze=Ut(),Te="DIDL",qt=400;function le(e,t,r){return e.map((n,o)=>r(n,t[o]))}var He=class{constructor(){this._typs=[],this._idx=new Map}has(t){return this._idx.has(t.name)}add(t,r){let n=this._typs.length;this._idx.set(t.name,n),this._typs.push(r)}merge(t,r){let n=this._idx.get(t.name),o=this._idx.get(r);if(n===void 0)throw new Error("Missing type index for "+t);if(o===void 0)throw new Error("Missing type index for "+r);this._typs[n]=this._typs[o],this._typs.splice(o,1),this._idx.delete(r)}encode(){let t=(0,c.lebEncode)(this._typs.length),r=(0,_.concat)(...this._typs);return(0,_.concat)(t,r)}indexOf(t){if(!this._idx.has(t))throw new Error("Missing type index for "+t);return(0,c.slebEncode)(this._idx.get(t)||0)}},Ke=class{visitType(t,r){throw new Error("Not implemented")}visitPrimitive(t,r){return this.visitType(t,r)}visitEmpty(t,r){return this.visitPrimitive(t,r)}visitBool(t,r){return this.visitPrimitive(t,r)}visitNull(t,r){return this.visitPrimitive(t,r)}visitReserved(t,r){return this.visitPrimitive(t,r)}visitText(t,r){return this.visitPrimitive(t,r)}visitNumber(t,r){return this.visitPrimitive(t,r)}visitInt(t,r){return this.visitNumber(t,r)}visitNat(t,r){return this.visitNumber(t,r)}visitFloat(t,r){return this.visitPrimitive(t,r)}visitFixedInt(t,r){return this.visitNumber(t,r)}visitFixedNat(t,r){return this.visitNumber(t,r)}visitPrincipal(t,r){return this.visitPrimitive(t,r)}visitConstruct(t,r){return this.visitType(t,r)}visitVec(t,r,n){return this.visitConstruct(t,n)}visitOpt(t,r,n){return this.visitConstruct(t,n)}visitRecord(t,r,n){return this.visitConstruct(t,n)}visitTuple(t,r,n){let o=r.map((i,a)=>[`_${a}_`,i]);return this.visitRecord(t,o,n)}visitVariant(t,r,n){return this.visitConstruct(t,n)}visitRec(t,r,n){return this.visitConstruct(r,n)}visitFunc(t,r){return this.visitConstruct(t,r)}visitService(t,r){return this.visitConstruct(t,r)}};s.Visitor=Ke;var I=class{display(){return this.name}valueToString(t){return N(t)}buildTypeTable(t){t.has(this)||this._buildTypeTableImpl(t)}};s.Type=I;var B=class extends I{checkType(t){if(this.name!==t.name)throw new Error(`type mismatch: type on the wire ${t.name}, expect type ${this.name}`);return t}_buildTypeTableImpl(t){}};s.PrimitiveType=B;var j=class extends I{checkType(t){if(t instanceof W){let r=t.getType();if(typeof r>"u")throw new Error("type mismatch with uninitialized type");return r}throw new Error(`type mismatch: type on the wire ${t.name}, expect type ${this.name}`)}encodeType(t){return t.indexOf(this.name)}};s.ConstructType=j;var be=class extends B{accept(t,r){return t.visitEmpty(this,r)}covariant(t){throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(){throw new Error("Empty cannot appear as a function argument")}valueToString(){throw new Error("Empty cannot appear as a value")}encodeType(){return(0,c.slebEncode)(-17)}decodeValue(){throw new Error("Empty cannot appear as an output")}get name(){return"empty"}};s.EmptyClass=be;var xe=class extends I{checkType(t){throw new Error("Method not implemented for unknown.")}accept(t,r){throw t.visitType(this,r)}covariant(t){throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(){throw new Error("Unknown cannot appear as a function argument")}valueToString(){throw new Error("Unknown cannot appear as a value")}encodeType(){throw new Error("Unknown cannot be serialized")}decodeValue(t,r){let n=r.decodeValue(t,r);Object(n)!==n&&(n=Object(n));let o;return r instanceof W?o=()=>r.getType():o=()=>r,Object.defineProperty(n,"type",{value:o,writable:!0,enumerable:!1,configurable:!0}),n}_buildTypeTableImpl(){throw new Error("Unknown cannot be serialized")}get name(){return"Unknown"}};s.UnknownClass=xe;var we=class extends B{accept(t,r){return t.visitBool(this,r)}covariant(t){if(typeof t=="boolean")return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){return new Uint8Array([t?1:0])}encodeType(){return(0,c.slebEncode)(-2)}decodeValue(t,r){switch(this.checkType(r),(0,c.safeReadUint8)(t)){case 0:return!1;case 1:return!0;default:throw new Error("Boolean value out of range")}}get name(){return"bool"}};s.BoolClass=we;var ve=class extends B{accept(t,r){return t.visitNull(this,r)}covariant(t){if(t===null)return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(){return new ArrayBuffer(0)}encodeType(){return(0,c.slebEncode)(-1)}decodeValue(t,r){return this.checkType(r),null}get name(){return"null"}};s.NullClass=ve;var D=class extends B{accept(t,r){return t.visitReserved(this,r)}covariant(t){return!0}encodeValue(){return new ArrayBuffer(0)}encodeType(){return(0,c.slebEncode)(-16)}decodeValue(t,r){return r.name!==this.name&&r.decodeValue(t,r),null}get name(){return"reserved"}};s.ReservedClass=D;var Ne=class extends B{accept(t,r){return t.visitText(this,r)}covariant(t){if(typeof t=="string")return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){let r=new TextEncoder().encode(t),n=(0,c.lebEncode)(r.byteLength);return(0,_.concat)(n,r)}encodeType(){return(0,c.slebEncode)(-15)}decodeValue(t,r){this.checkType(r);let n=(0,c.lebDecode)(t),o=(0,c.safeRead)(t,Number(n));return new TextDecoder("utf8",{fatal:!0}).decode(o)}get name(){return"text"}valueToString(t){return'"'+t+'"'}};s.TextClass=Ne;var Pe=class extends B{accept(t,r){return t.visitInt(this,r)}covariant(t){if(typeof t=="bigint"||Number.isInteger(t))return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){return(0,c.slebEncode)(t)}encodeType(){return(0,c.slebEncode)(-4)}decodeValue(t,r){return this.checkType(r),(0,c.slebDecode)(t)}get name(){return"int"}valueToString(t){return t.toString()}};s.IntClass=Pe;var Re=class extends B{accept(t,r){return t.visitNat(this,r)}covariant(t){if(typeof t=="bigint"&&t>=BigInt(0)||Number.isInteger(t)&&t>=0)return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){return(0,c.lebEncode)(t)}encodeType(){return(0,c.slebEncode)(-3)}decodeValue(t,r){return this.checkType(r),(0,c.lebDecode)(t)}get name(){return"nat"}valueToString(t){return t.toString()}};s.NatClass=Re;var ue=class extends B{constructor(t){if(super(),this._bits=t,t!==32&&t!==64)throw new Error("not a valid float type")}accept(t,r){return t.visitFloat(this,r)}covariant(t){if(typeof t=="number"||t instanceof Number)return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){let r=new ArrayBuffer(this._bits/8),n=new DataView(r);return this._bits===32?n.setFloat32(0,t,!0):n.setFloat64(0,t,!0),r}encodeType(){let t=this._bits===32?-13:-14;return(0,c.slebEncode)(t)}decodeValue(t,r){this.checkType(r);let n=(0,c.safeRead)(t,this._bits/8),o=new DataView(n);return this._bits===32?o.getFloat32(0,!0):o.getFloat64(0,!0)}get name(){return"float"+this._bits}valueToString(t){return t.toString()}};s.FloatClass=ue;var H=class extends B{constructor(t){super(),this._bits=t}accept(t,r){return t.visitFixedInt(this,r)}covariant(t){let r=(0,ze.iexp2)(this._bits-1)*BigInt(-1),n=(0,ze.iexp2)(this._bits-1)-BigInt(1),o=!1;if(typeof t=="bigint")o=t>=r&&t<=n;else if(Number.isInteger(t)){let i=BigInt(t);o=i>=r&&i<=n}else o=!1;if(o)return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){return(0,c.writeIntLE)(t,this._bits/8)}encodeType(){let t=Math.log2(this._bits)-3;return(0,c.slebEncode)(-9-t)}decodeValue(t,r){this.checkType(r);let n=(0,c.readIntLE)(t,this._bits/8);return this._bits<=32?Number(n):n}get name(){return`int${this._bits}`}valueToString(t){return t.toString()}};s.FixedIntClass=H;var q=class extends B{constructor(t){super(),this._bits=t}accept(t,r){return t.visitFixedNat(this,r)}covariant(t){let r=(0,ze.iexp2)(this._bits),n=!1;if(typeof t=="bigint"&&t>=BigInt(0)?n=t<r:Number.isInteger(t)&&t>=0?n=BigInt(t)<r:n=!1,n)return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){return(0,c.writeUIntLE)(t,this._bits/8)}encodeType(){let t=Math.log2(this._bits)-3;return(0,c.slebEncode)(-5-t)}decodeValue(t,r){this.checkType(r);let n=(0,c.readUIntLE)(t,this._bits/8);return this._bits<=32?Number(n):n}get name(){return`nat${this._bits}`}valueToString(t){return t.toString()}};s.FixedNatClass=q;var Ve=class e extends j{constructor(t){super(),this._type=t,this._blobOptimization=!1,t instanceof q&&t._bits===8&&(this._blobOptimization=!0)}accept(t,r){return t.visitVec(this,this._type,r)}covariant(t){let r=this._type instanceof q?this._type._bits:this._type instanceof H?this._type._bits:0;if(ArrayBuffer.isView(t)&&r==t.BYTES_PER_ELEMENT*8||Array.isArray(t)&&t.every((n,o)=>{try{return this._type.covariant(n)}catch(i){throw new Error(`Invalid ${this.display()} argument:
3
+ var jr=Object.create;var ft=Object.defineProperty;var zr=Object.getOwnPropertyDescriptor;var Hr=Object.getOwnPropertyNames;var Kr=Object.getPrototypeOf,Wr=Object.prototype.hasOwnProperty;var ht=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Jr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Hr(t))!Wr.call(e,o)&&o!==r&&ft(e,o,{get:()=>t[o],enumerable:!(n=zr(t,o))||n.enumerable});return e};var _t=(e,t,r)=>(r=e!=null?jr(Kr(e)):{},Jr(t||!e||!e.__esModule?ft(r,"default",{value:e,enumerable:!0}):r,e));var _e=z($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.PipeArrayBuffer=$.fromHexString=$.toHexString=$.concat=void 0;function nn(...e){let t=new Uint8Array(e.reduce((n,o)=>n+o.byteLength,0)),r=0;for(let n of e)t.set(new Uint8Array(n),r),r+=n.byteLength;return t}$.concat=nn;function on(e){return new Uint8Array(e).reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}$.toHexString=on;function sn(e){var t;return new Uint8Array(((t=e.match(/.{1,2}/g))!==null&&t!==void 0?t:[]).map(r=>parseInt(r,16)))}$.fromHexString=sn;var qe=class{constructor(t,r=t?.byteLength||0){this._buffer=t||new ArrayBuffer(0),this._view=new Uint8Array(this._buffer,0,r)}get buffer(){return this._view.slice()}get byteLength(){return this._view.byteLength}read(t){let r=this._view.subarray(0,t);return this._view=this._view.subarray(t),r.slice().buffer}readUint8(){let t=this._view[0];return this._view=this._view.subarray(1),t}write(t){let r=new Uint8Array(t),n=this._view.byteLength;this._view.byteOffset+this._view.byteLength+r.byteLength>=this._buffer.byteLength?this.alloc(r.byteLength):this._view=new Uint8Array(this._buffer,this._view.byteOffset,this._view.byteLength+r.byteLength),this._view.set(r,n)}get end(){return this._view.byteLength===0}alloc(t){let r=new ArrayBuffer((this._buffer.byteLength+t)*1.2|0),n=new Uint8Array(r,0,this._view.byteLength+t);n.set(this._view),this._buffer=r,this._view=n}};$.PipeArrayBuffer=qe});var Ue=z(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.idlLabelToId=void 0;function an(e){let r=new TextEncoder().encode(e),n=0;for(let o of r)n=(n*223+o)%2**32;return n}function cn(e){if(/^_\d+_$/.test(e)||/^_0x[0-9a-fA-F]+_$/.test(e)){let t=+e.slice(1,-1);if(Number.isSafeInteger(t)&&t>=0&&t<2**32)return t}return an(e)}ye.idlLabelToId=cn});var ze=z(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.readIntLE=w.readUIntLE=w.writeIntLE=w.writeUIntLE=w.slebDecode=w.slebEncode=w.lebDecode=w.lebEncode=w.safeReadUint8=w.safeRead=void 0;var je=_e();function Mt(){throw new Error("unexpected end of buffer")}function kt(e,t){return e.byteLength<t&&Mt(),e.read(t)}w.safeRead=kt;function ge(e){let t=e.readUint8();return t===void 0&&Mt(),t}w.safeReadUint8=ge;function ln(e){if(typeof e=="number"&&(e=BigInt(e)),e<BigInt(0))throw new Error("Cannot leb encode negative values.");let t=(e===BigInt(0)?0:Math.ceil(Math.log2(Number(e))))+1,r=new je.PipeArrayBuffer(new ArrayBuffer(t),0);for(;;){let n=Number(e&BigInt(127));if(e/=BigInt(128),e===BigInt(0)){r.write(new Uint8Array([n]));break}else r.write(new Uint8Array([n|128]))}return r.buffer}w.lebEncode=ln;function $t(e){let t=BigInt(1),r=BigInt(0),n;do n=ge(e),r+=BigInt(n&127).valueOf()*t,t*=BigInt(128);while(n>=128);return r}w.lebDecode=$t;function un(e){typeof e=="number"&&(e=BigInt(e));let t=e<BigInt(0);t&&(e=-e-BigInt(1));let r=(e===BigInt(0)?0:Math.ceil(Math.log2(Number(e))))+1,n=new je.PipeArrayBuffer(new ArrayBuffer(r),0);for(;;){let i=o(e);if(e/=BigInt(128),t&&e===BigInt(0)&&i&64||!t&&e===BigInt(0)&&!(i&64)){n.write(new Uint8Array([i]));break}else n.write(new Uint8Array([i|128]))}function o(i){let a=i%BigInt(128);return Number(t?BigInt(128)-a-BigInt(1):a)}return n.buffer}w.slebEncode=un;function dn(e){let t=new Uint8Array(e.buffer),r=0;for(;r<t.byteLength;r++)if(t[r]<128){if(!(t[r]&64))return $t(e);break}let n=new Uint8Array(kt(e,r+1)),o=BigInt(0);for(let i=n.byteLength-1;i>=0;i--)o=o*BigInt(128)+BigInt(128-(n[i]&127)-1);return-o-BigInt(1)}w.slebDecode=dn;function pn(e,t){if(BigInt(e)<BigInt(0))throw new Error("Cannot write negative values.");return qt(e,t)}w.writeUIntLE=pn;function qt(e,t){e=BigInt(e);let r=new je.PipeArrayBuffer(new ArrayBuffer(Math.min(1,t)),0),n=0,o=BigInt(256),i=BigInt(0),a=Number(e%o);for(r.write(new Uint8Array([a]));++n<t;)e<0&&i===BigInt(0)&&a!==0&&(i=BigInt(1)),a=Number((e/o-i)%BigInt(256)),r.write(new Uint8Array([a])),o*=BigInt(256);return r.buffer}w.writeIntLE=qt;function Ut(e,t){let r=BigInt(ge(e)),n=BigInt(1),o=0;for(;++o<t;){n*=BigInt(256);let i=BigInt(ge(e));r=r+n*i}return r}w.readUIntLE=Ut;function mn(e,t){let r=Ut(e,t),n=BigInt(2)**(BigInt(8)*BigInt(t-1)+BigInt(7));return r>=n&&(r-=n*BigInt(2)),r}w.readIntLE=mn});var jt=z(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.iexp2=D.ilog2=void 0;function fn(e){let t=BigInt(e);if(e<=0)throw new RangeError("Input must be positive");return t.toString(2).length-1}D.ilog2=fn;function hn(e){let t=BigInt(e);if(e<0)throw new RangeError("Input must be non-negative");return BigInt(1)<<t}D.iexp2=hn});var Ge=z(s=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});s.Variant=s.Record=s.Opt=s.Vec=s.Tuple=s.Principal=s.Nat64=s.Nat32=s.Nat16=s.Nat8=s.Int64=s.Int32=s.Int16=s.Int8=s.Float64=s.Float32=s.Nat=s.Int=s.Text=s.Null=s.Bool=s.Unknown=s.Reserved=s.Empty=s.decode=s.encode=s.ServiceClass=s.FuncClass=s.PrincipalClass=s.RecClass=s.VariantClass=s.TupleClass=s.RecordClass=s.OptClass=s.VecClass=s.FixedNatClass=s.FixedIntClass=s.FloatClass=s.NatClass=s.IntClass=s.TextClass=s.ReservedClass=s.NullClass=s.BoolClass=s.UnknownClass=s.EmptyClass=s.ConstructType=s.PrimitiveType=s.Type=s.Visitor=void 0;s.Service=s.Func=s.Rec=void 0;var _n=ht("@dfinity/principal"),_=_e(),q=Ue(),c=ze(),He=jt(),Te="DIDL",zt=400;function le(e,t,r){return e.map((n,o)=>r(n,t[o]))}var Ke=class{constructor(){this._typs=[],this._idx=new Map}has(t){return this._idx.has(t.name)}add(t,r){let n=this._typs.length;this._idx.set(t.name,n),this._typs.push(r)}merge(t,r){let n=this._idx.get(t.name),o=this._idx.get(r);if(n===void 0)throw new Error("Missing type index for "+t);if(o===void 0)throw new Error("Missing type index for "+r);this._typs[n]=this._typs[o],this._typs.splice(o,1),this._idx.delete(r)}encode(){let t=(0,c.lebEncode)(this._typs.length),r=(0,_.concat)(...this._typs);return(0,_.concat)(t,r)}indexOf(t){if(!this._idx.has(t))throw new Error("Missing type index for "+t);return(0,c.slebEncode)(this._idx.get(t)||0)}},We=class{visitType(t,r){throw new Error("Not implemented")}visitPrimitive(t,r){return this.visitType(t,r)}visitEmpty(t,r){return this.visitPrimitive(t,r)}visitBool(t,r){return this.visitPrimitive(t,r)}visitNull(t,r){return this.visitPrimitive(t,r)}visitReserved(t,r){return this.visitPrimitive(t,r)}visitText(t,r){return this.visitPrimitive(t,r)}visitNumber(t,r){return this.visitPrimitive(t,r)}visitInt(t,r){return this.visitNumber(t,r)}visitNat(t,r){return this.visitNumber(t,r)}visitFloat(t,r){return this.visitPrimitive(t,r)}visitFixedInt(t,r){return this.visitNumber(t,r)}visitFixedNat(t,r){return this.visitNumber(t,r)}visitPrincipal(t,r){return this.visitPrimitive(t,r)}visitConstruct(t,r){return this.visitType(t,r)}visitVec(t,r,n){return this.visitConstruct(t,n)}visitOpt(t,r,n){return this.visitConstruct(t,n)}visitRecord(t,r,n){return this.visitConstruct(t,n)}visitTuple(t,r,n){let o=r.map((i,a)=>[`_${a}_`,i]);return this.visitRecord(t,o,n)}visitVariant(t,r,n){return this.visitConstruct(t,n)}visitRec(t,r,n){return this.visitConstruct(r,n)}visitFunc(t,r){return this.visitConstruct(t,r)}visitService(t,r){return this.visitConstruct(t,r)}};s.Visitor=We;var L=class{display(){return this.name}valueToString(t){return v(t)}buildTypeTable(t){t.has(this)||this._buildTypeTableImpl(t)}};s.Type=L;var M=class extends L{checkType(t){if(this.name!==t.name)throw new Error(`type mismatch: type on the wire ${t.name}, expect type ${this.name}`);return t}_buildTypeTableImpl(t){}};s.PrimitiveType=M;var j=class extends L{checkType(t){if(t instanceof W){let r=t.getType();if(typeof r>"u")throw new Error("type mismatch with uninitialized type");return r}throw new Error(`type mismatch: type on the wire ${t.name}, expect type ${this.name}`)}encodeType(t){return t.indexOf(this.name)}};s.ConstructType=j;var be=class extends M{accept(t,r){return t.visitEmpty(this,r)}covariant(t){throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(){throw new Error("Empty cannot appear as a function argument")}valueToString(){throw new Error("Empty cannot appear as a value")}encodeType(){return(0,c.slebEncode)(-17)}decodeValue(){throw new Error("Empty cannot appear as an output")}get name(){return"empty"}};s.EmptyClass=be;var xe=class extends L{checkType(t){throw new Error("Method not implemented for unknown.")}accept(t,r){throw t.visitType(this,r)}covariant(t){throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(){throw new Error("Unknown cannot appear as a function argument")}valueToString(){throw new Error("Unknown cannot appear as a value")}encodeType(){throw new Error("Unknown cannot be serialized")}decodeValue(t,r){let n=r.decodeValue(t,r);Object(n)!==n&&(n=Object(n));let o;return r instanceof W?o=()=>r.getType():o=()=>r,Object.defineProperty(n,"type",{value:o,writable:!0,enumerable:!1,configurable:!0}),n}_buildTypeTableImpl(){throw new Error("Unknown cannot be serialized")}get name(){return"Unknown"}};s.UnknownClass=xe;var we=class extends M{accept(t,r){return t.visitBool(this,r)}covariant(t){if(typeof t=="boolean")return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){return new Uint8Array([t?1:0])}encodeType(){return(0,c.slebEncode)(-2)}decodeValue(t,r){switch(this.checkType(r),(0,c.safeReadUint8)(t)){case 0:return!1;case 1:return!0;default:throw new Error("Boolean value out of range")}}get name(){return"bool"}};s.BoolClass=we;var ve=class extends M{accept(t,r){return t.visitNull(this,r)}covariant(t){if(t===null)return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(){return new ArrayBuffer(0)}encodeType(){return(0,c.slebEncode)(-1)}decodeValue(t,r){return this.checkType(r),null}get name(){return"null"}};s.NullClass=ve;var ee=class extends M{accept(t,r){return t.visitReserved(this,r)}covariant(t){return!0}encodeValue(){return new ArrayBuffer(0)}encodeType(){return(0,c.slebEncode)(-16)}decodeValue(t,r){return r.name!==this.name&&r.decodeValue(t,r),null}get name(){return"reserved"}};s.ReservedClass=ee;var Ne=class extends M{accept(t,r){return t.visitText(this,r)}covariant(t){if(typeof t=="string")return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){let r=new TextEncoder().encode(t),n=(0,c.lebEncode)(r.byteLength);return(0,_.concat)(n,r)}encodeType(){return(0,c.slebEncode)(-15)}decodeValue(t,r){this.checkType(r);let n=(0,c.lebDecode)(t),o=(0,c.safeRead)(t,Number(n));return new TextDecoder("utf8",{fatal:!0}).decode(o)}get name(){return"text"}valueToString(t){return'"'+t+'"'}};s.TextClass=Ne;var Pe=class extends M{accept(t,r){return t.visitInt(this,r)}covariant(t){if(typeof t=="bigint"||Number.isInteger(t))return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){return(0,c.slebEncode)(t)}encodeType(){return(0,c.slebEncode)(-4)}decodeValue(t,r){return this.checkType(r),(0,c.slebDecode)(t)}get name(){return"int"}valueToString(t){return t.toString()}};s.IntClass=Pe;var Ve=class extends M{accept(t,r){return t.visitNat(this,r)}covariant(t){if(typeof t=="bigint"&&t>=BigInt(0)||Number.isInteger(t)&&t>=0)return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){return(0,c.lebEncode)(t)}encodeType(){return(0,c.slebEncode)(-3)}decodeValue(t,r){return this.checkType(r),(0,c.lebDecode)(t)}get name(){return"nat"}valueToString(t){return t.toString()}};s.NatClass=Ve;var ue=class extends M{constructor(t){if(super(),this._bits=t,t!==32&&t!==64)throw new Error("not a valid float type")}accept(t,r){return t.visitFloat(this,r)}covariant(t){if(typeof t=="number"||t instanceof Number)return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){let r=new ArrayBuffer(this._bits/8),n=new DataView(r);return this._bits===32?n.setFloat32(0,t,!0):n.setFloat64(0,t,!0),r}encodeType(){let t=this._bits===32?-13:-14;return(0,c.slebEncode)(t)}decodeValue(t,r){this.checkType(r);let n=(0,c.safeRead)(t,this._bits/8),o=new DataView(n);return this._bits===32?o.getFloat32(0,!0):o.getFloat64(0,!0)}get name(){return"float"+this._bits}valueToString(t){return t.toString()}};s.FloatClass=ue;var H=class extends M{constructor(t){super(),this._bits=t}accept(t,r){return t.visitFixedInt(this,r)}covariant(t){let r=(0,He.iexp2)(this._bits-1)*BigInt(-1),n=(0,He.iexp2)(this._bits-1)-BigInt(1),o=!1;if(typeof t=="bigint")o=t>=r&&t<=n;else if(Number.isInteger(t)){let i=BigInt(t);o=i>=r&&i<=n}else o=!1;if(o)return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){return(0,c.writeIntLE)(t,this._bits/8)}encodeType(){let t=Math.log2(this._bits)-3;return(0,c.slebEncode)(-9-t)}decodeValue(t,r){this.checkType(r);let n=(0,c.readIntLE)(t,this._bits/8);return this._bits<=32?Number(n):n}get name(){return`int${this._bits}`}valueToString(t){return t.toString()}};s.FixedIntClass=H;var U=class extends M{constructor(t){super(),this._bits=t}accept(t,r){return t.visitFixedNat(this,r)}covariant(t){let r=(0,He.iexp2)(this._bits),n=!1;if(typeof t=="bigint"&&t>=BigInt(0)?n=t<r:Number.isInteger(t)&&t>=0?n=BigInt(t)<r:n=!1,n)return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){return(0,c.writeUIntLE)(t,this._bits/8)}encodeType(){let t=Math.log2(this._bits)-3;return(0,c.slebEncode)(-5-t)}decodeValue(t,r){this.checkType(r);let n=(0,c.readUIntLE)(t,this._bits/8);return this._bits<=32?Number(n):n}get name(){return`nat${this._bits}`}valueToString(t){return t.toString()}};s.FixedNatClass=U;var Re=class e extends j{constructor(t){super(),this._type=t,this._blobOptimization=!1,t instanceof U&&t._bits===8&&(this._blobOptimization=!0)}accept(t,r){return t.visitVec(this,this._type,r)}covariant(t){let r=this._type instanceof U?this._type._bits:this._type instanceof H?this._type._bits:0;if(ArrayBuffer.isView(t)&&r==t.BYTES_PER_ELEMENT*8||Array.isArray(t)&&t.every((n,o)=>{try{return this._type.covariant(n)}catch(i){throw new Error(`Invalid ${this.display()} argument:
4
4
 
5
- index ${o} -> ${i.message}`)}}))return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){let r=(0,c.lebEncode)(t.length);if(this._blobOptimization)return(0,_.concat)(r,new Uint8Array(t));if(ArrayBuffer.isView(t))return(0,_.concat)(r,new Uint8Array(t.buffer));let n=new _.PipeArrayBuffer(new ArrayBuffer(r.byteLength+t.length),0);n.write(r);for(let o of t){let i=this._type.encodeValue(o);n.write(new Uint8Array(i))}return n.buffer}_buildTypeTableImpl(t){this._type.buildTypeTable(t);let r=(0,c.slebEncode)(-19),n=this._type.encodeType(t);t.add(this,(0,_.concat)(r,n))}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("Not a vector type");let o=Number((0,c.lebDecode)(t));if(this._type instanceof q){if(this._type._bits==8)return new Uint8Array(t.read(o));if(this._type._bits==16)return new Uint16Array(t.read(o*2));if(this._type._bits==32)return new Uint32Array(t.read(o*4));if(this._type._bits==64)return new BigUint64Array(t.read(o*8))}if(this._type instanceof H){if(this._type._bits==8)return new Int8Array(t.read(o));if(this._type._bits==16)return new Int16Array(t.read(o*2));if(this._type._bits==32)return new Int32Array(t.read(o*4));if(this._type._bits==64)return new BigInt64Array(t.read(o*8))}let i=[];for(let a=0;a<o;a++)i.push(this._type.decodeValue(t,n._type));return i}get name(){return`vec ${this._type.name}`}display(){return`vec ${this._type.display()}`}valueToString(t){return"vec {"+t.map(n=>this._type.valueToString(n)).join("; ")+"}"}};s.VecClass=Ve;var L=class e extends j{constructor(t){super(),this._type=t}accept(t,r){return t.visitOpt(this,this._type,r)}covariant(t){try{if(Array.isArray(t)&&(t.length===0||t.length===1&&this._type.covariant(t[0])))return!0}catch(r){throw new Error(`Invalid ${this.display()} argument: ${N(t)}
5
+ index ${o} -> ${i.message}`)}}))return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){let r=(0,c.lebEncode)(t.length);if(this._blobOptimization)return(0,_.concat)(r,new Uint8Array(t));if(ArrayBuffer.isView(t))return(0,_.concat)(r,new Uint8Array(t.buffer));let n=new _.PipeArrayBuffer(new ArrayBuffer(r.byteLength+t.length),0);n.write(r);for(let o of t){let i=this._type.encodeValue(o);n.write(new Uint8Array(i))}return n.buffer}_buildTypeTableImpl(t){this._type.buildTypeTable(t);let r=(0,c.slebEncode)(-19),n=this._type.encodeType(t);t.add(this,(0,_.concat)(r,n))}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("Not a vector type");let o=Number((0,c.lebDecode)(t));if(this._type instanceof U){if(this._type._bits==8)return new Uint8Array(t.read(o));if(this._type._bits==16)return new Uint16Array(t.read(o*2));if(this._type._bits==32)return new Uint32Array(t.read(o*4));if(this._type._bits==64)return new BigUint64Array(t.read(o*8))}if(this._type instanceof H){if(this._type._bits==8)return new Int8Array(t.read(o));if(this._type._bits==16)return new Int16Array(t.read(o*2));if(this._type._bits==32)return new Int32Array(t.read(o*4));if(this._type._bits==64)return new BigInt64Array(t.read(o*8))}let i=[];for(let a=0;a<o;a++)i.push(this._type.decodeValue(t,n._type));return i}get name(){return`vec ${this._type.name}`}display(){return`vec ${this._type.display()}`}valueToString(t){return"vec {"+t.map(n=>this._type.valueToString(n)).join("; ")+"}"}};s.VecClass=Re;var te=class e extends j{constructor(t){super(),this._type=t}accept(t,r){return t.visitOpt(this,this._type,r)}covariant(t){try{if(Array.isArray(t)&&(t.length===0||t.length===1&&this._type.covariant(t[0])))return!0}catch(r){throw new Error(`Invalid ${this.display()} argument: ${v(t)}
6
6
 
7
- -> ${r.message}`)}throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){return t.length===0?new Uint8Array([0]):(0,_.concat)(new Uint8Array([1]),this._type.encodeValue(t[0]))}_buildTypeTableImpl(t){this._type.buildTypeTable(t);let r=(0,c.slebEncode)(-18),n=this._type.encodeType(t);t.add(this,(0,_.concat)(r,n))}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("Not an option type");switch((0,c.safeReadUint8)(t)){case 0:return[];case 1:return[this._type.decodeValue(t,n._type)];default:throw new Error("Not an option value")}}get name(){return`opt ${this._type.name}`}display(){return`opt ${this._type.display()}`}valueToString(t){return t.length===0?"null":`opt ${this._type.valueToString(t[0])}`}};s.OptClass=L;var de=class e extends j{constructor(t={}){super(),this._fields=Object.entries(t).sort((r,n)=>(0,U.idlLabelToId)(r[0])-(0,U.idlLabelToId)(n[0]))}accept(t,r){return t.visitRecord(this,this._fields,r)}tryAsTuple(){let t=[];for(let r=0;r<this._fields.length;r++){let[n,o]=this._fields[r];if(n!==`_${r}_`)return null;t.push(o)}return t}covariant(t){if(typeof t=="object"&&this._fields.every(([r,n])=>{if(!t.hasOwnProperty(r))throw new Error(`Record is missing key "${r}".`);try{return n.covariant(t[r])}catch(o){throw new Error(`Invalid ${this.display()} argument:
7
+ -> ${r.message}`)}throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){return t.length===0?new Uint8Array([0]):(0,_.concat)(new Uint8Array([1]),this._type.encodeValue(t[0]))}_buildTypeTableImpl(t){this._type.buildTypeTable(t);let r=(0,c.slebEncode)(-18),n=this._type.encodeType(t);t.add(this,(0,_.concat)(r,n))}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("Not an option type");switch((0,c.safeReadUint8)(t)){case 0:return[];case 1:return[this._type.decodeValue(t,n._type)];default:throw new Error("Not an option value")}}get name(){return`opt ${this._type.name}`}display(){return`opt ${this._type.display()}`}valueToString(t){return t.length===0?"null":`opt ${this._type.valueToString(t[0])}`}};s.OptClass=te;var de=class e extends j{constructor(t={}){super(),this._fields=Object.entries(t).sort((r,n)=>(0,q.idlLabelToId)(r[0])-(0,q.idlLabelToId)(n[0]))}accept(t,r){return t.visitRecord(this,this._fields,r)}tryAsTuple(){let t=[];for(let r=0;r<this._fields.length;r++){let[n,o]=this._fields[r];if(n!==`_${r}_`)return null;t.push(o)}return t}covariant(t){if(typeof t=="object"&&this._fields.every(([r,n])=>{if(!t.hasOwnProperty(r))throw new Error(`Record is missing key "${r}".`);try{return n.covariant(t[r])}catch(o){throw new Error(`Invalid ${this.display()} argument:
8
8
 
9
- field ${r} -> ${o.message}`)}}))return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){let r=this._fields.map(([o])=>t[o]),n=le(this._fields,r,([,o],i)=>o.encodeValue(i));return(0,_.concat)(...n)}_buildTypeTableImpl(t){this._fields.forEach(([i,a])=>a.buildTypeTable(t));let r=(0,c.slebEncode)(-20),n=(0,c.lebEncode)(this._fields.length),o=this._fields.map(([i,a])=>(0,_.concat)((0,c.lebEncode)((0,U.idlLabelToId)(i)),a.encodeType(t)));t.add(this,(0,_.concat)(r,n,(0,_.concat)(...o)))}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("Not a record type");let o={},i=0,a=0;for(;a<n._fields.length;){let[u,p]=n._fields[a];if(i>=this._fields.length){p.decodeValue(t,p),a++;continue}let[d,h]=this._fields[i],g=(0,U.idlLabelToId)(this._fields[i][0]),w=(0,U.idlLabelToId)(u);if(g===w)o[d]=h.decodeValue(t,p),i++,a++;else if(w>g)if(h instanceof L||h instanceof D)o[d]=[],i++;else throw new Error("Cannot find required field "+d);else p.decodeValue(t,p),a++}for(let[u,p]of this._fields.slice(i))if(p instanceof L||p instanceof D)o[u]=[];else throw new Error("Cannot find required field "+u);return o}get name(){return`record {${this._fields.map(([r,n])=>r+":"+n.name).join("; ")}}`}display(){return`record {${this._fields.map(([r,n])=>r+":"+n.display()).join("; ")}}`}valueToString(t){let r=this._fields.map(([o])=>t[o]);return`record {${le(this._fields,r,([o,i],a)=>o+"="+i.valueToString(a)).join("; ")}}`}};s.RecordClass=de;var Ce=class e extends de{constructor(t){let r={};t.forEach((n,o)=>r["_"+o+"_"]=n),super(r),this._components=t}accept(t,r){return t.visitTuple(this,this._components,r)}covariant(t){if(Array.isArray(t)&&t.length>=this._fields.length&&this._components.every((r,n)=>{try{return r.covariant(t[n])}catch(o){throw new Error(`Invalid ${this.display()} argument:
9
+ field ${r} -> ${o.message}`)}}))return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){let r=this._fields.map(([o])=>t[o]),n=le(this._fields,r,([,o],i)=>o.encodeValue(i));return(0,_.concat)(...n)}_buildTypeTableImpl(t){this._fields.forEach(([i,a])=>a.buildTypeTable(t));let r=(0,c.slebEncode)(-20),n=(0,c.lebEncode)(this._fields.length),o=this._fields.map(([i,a])=>(0,_.concat)((0,c.lebEncode)((0,q.idlLabelToId)(i)),a.encodeType(t)));t.add(this,(0,_.concat)(r,n,(0,_.concat)(...o)))}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("Not a record type");let o={},i=0,a=0;for(;a<n._fields.length;){let[d,p]=n._fields[a];if(i>=this._fields.length){p.decodeValue(t,p),a++;continue}let[u,h]=this._fields[i],T=(0,q.idlLabelToId)(this._fields[i][0]),S=(0,q.idlLabelToId)(d);if(T===S)o[u]=h.decodeValue(t,p),i++,a++;else if(S>T)if(h instanceof te||h instanceof ee)o[u]=[],i++;else throw new Error("Cannot find required field "+u);else p.decodeValue(t,p),a++}for(let[d,p]of this._fields.slice(i))if(p instanceof te||p instanceof ee)o[d]=[];else throw new Error("Cannot find required field "+d);return o}get name(){return`record {${this._fields.map(([r,n])=>r+":"+n.name).join("; ")}}`}display(){return`record {${this._fields.map(([r,n])=>r+":"+n.display()).join("; ")}}`}valueToString(t){let r=this._fields.map(([o])=>t[o]);return`record {${le(this._fields,r,([o,i],a)=>o+"="+i.valueToString(a)).join("; ")}}`}};s.RecordClass=de;var Ce=class e extends de{constructor(t){let r={};t.forEach((n,o)=>r["_"+o+"_"]=n),super(r),this._components=t}accept(t,r){return t.visitTuple(this,this._components,r)}covariant(t){if(Array.isArray(t)&&t.length>=this._fields.length&&this._components.every((r,n)=>{try{return r.covariant(t[n])}catch(o){throw new Error(`Invalid ${this.display()} argument:
10
10
 
11
- index ${n} -> ${o.message}`)}}))return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){let r=le(this._components,t,(n,o)=>n.encodeValue(o));return(0,_.concat)(...r)}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("not a tuple type");if(n._components.length<this._components.length)throw new Error("tuple mismatch");let o=[];for(let[i,a]of n._components.entries())i>=this._components.length?a.decodeValue(t,a):o.push(this._components[i].decodeValue(t,a));return o}display(){return`record {${this._components.map(r=>r.display()).join("; ")}}`}valueToString(t){return`record {${le(this._components,t,(n,o)=>n.valueToString(o)).join("; ")}}`}};s.TupleClass=Ce;var Se=class e extends j{constructor(t={}){super(),this._fields=Object.entries(t).sort((r,n)=>(0,U.idlLabelToId)(r[0])-(0,U.idlLabelToId)(n[0]))}accept(t,r){return t.visitVariant(this,this._fields,r)}covariant(t){if(typeof t=="object"&&Object.entries(t).length===1&&this._fields.every(([r,n])=>{try{return!t.hasOwnProperty(r)||n.covariant(t[r])}catch(o){throw new Error(`Invalid ${this.display()} argument:
11
+ index ${n} -> ${o.message}`)}}))return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){let r=le(this._components,t,(n,o)=>n.encodeValue(o));return(0,_.concat)(...r)}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("not a tuple type");if(n._components.length<this._components.length)throw new Error("tuple mismatch");let o=[];for(let[i,a]of n._components.entries())i>=this._components.length?a.decodeValue(t,a):o.push(this._components[i].decodeValue(t,a));return o}display(){return`record {${this._components.map(r=>r.display()).join("; ")}}`}valueToString(t){return`record {${le(this._components,t,(n,o)=>n.valueToString(o)).join("; ")}}`}};s.TupleClass=Ce;var Se=class e extends j{constructor(t={}){super(),this._fields=Object.entries(t).sort((r,n)=>(0,q.idlLabelToId)(r[0])-(0,q.idlLabelToId)(n[0]))}accept(t,r){return t.visitVariant(this,this._fields,r)}covariant(t){if(typeof t=="object"&&Object.entries(t).length===1&&this._fields.every(([r,n])=>{try{return!t.hasOwnProperty(r)||n.covariant(t[r])}catch(o){throw new Error(`Invalid ${this.display()} argument:
12
12
 
13
- variant ${r} -> ${o.message}`)}}))return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){for(let r=0;r<this._fields.length;r++){let[n,o]=this._fields[r];if(t.hasOwnProperty(n)){let i=(0,c.lebEncode)(r),a=o.encodeValue(t[n]);return(0,_.concat)(i,a)}}throw Error("Variant has no data: "+t)}_buildTypeTableImpl(t){this._fields.forEach(([,i])=>{i.buildTypeTable(t)});let r=(0,c.slebEncode)(-21),n=(0,c.lebEncode)(this._fields.length),o=this._fields.map(([i,a])=>(0,_.concat)((0,c.lebEncode)((0,U.idlLabelToId)(i)),a.encodeType(t)));t.add(this,(0,_.concat)(r,n,...o))}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("Not a variant type");let o=Number((0,c.lebDecode)(t));if(o>=n._fields.length)throw Error("Invalid variant index: "+o);let[i,a]=n._fields[o];for(let[u,p]of this._fields)if((0,U.idlLabelToId)(i)===(0,U.idlLabelToId)(u)){let d=p.decodeValue(t,a);return{[u]:d}}throw new Error("Cannot find field hash "+i)}get name(){return`variant {${this._fields.map(([r,n])=>r+":"+n.name).join("; ")}}`}display(){return`variant {${this._fields.map(([r,n])=>r+(n.name==="null"?"":`:${n.display()}`)).join("; ")}}`}valueToString(t){for(let[r,n]of this._fields)if(t.hasOwnProperty(r)){let o=n.valueToString(t[r]);return o==="null"?`variant {${r}}`:`variant {${r}=${o}}`}throw new Error("Variant has no data: "+t)}};s.VariantClass=Se;var W=class e extends j{constructor(){super(...arguments),this._id=e._counter++,this._type=void 0}accept(t,r){if(!this._type)throw Error("Recursive type uninitialized.");return t.visitRec(this,this._type,r)}fill(t){this._type=t}getType(){return this._type}covariant(t){if(this._type&&this._type.covariant(t))return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){if(!this._type)throw Error("Recursive type uninitialized.");return this._type.encodeValue(t)}_buildTypeTableImpl(t){if(!this._type)throw Error("Recursive type uninitialized.");t.add(this,new Uint8Array([])),this._type.buildTypeTable(t),t.merge(this,this._type.name)}decodeValue(t,r){if(!this._type)throw Error("Recursive type uninitialized.");return this._type.decodeValue(t,r)}get name(){return`rec_${this._id}`}display(){if(!this._type)throw Error("Recursive type uninitialized.");return`\u03BC${this.name}.${this._type.name}`}valueToString(t){if(!this._type)throw Error("Recursive type uninitialized.");return this._type.valueToString(t)}};s.RecClass=W;W._counter=0;function We(e){if((0,c.safeReadUint8)(e)!==1)throw new Error("Cannot decode principal");let r=Number((0,c.lebDecode)(e));return ln.Principal.fromUint8Array(new Uint8Array((0,c.safeRead)(e,r)))}var Fe=class extends B{accept(t,r){return t.visitPrincipal(this,r)}covariant(t){if(t&&t._isPrincipal)return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){let r=t.toUint8Array(),n=(0,c.lebEncode)(r.byteLength);return(0,_.concat)(new Uint8Array([1]),n,r)}encodeType(){return(0,c.slebEncode)(-24)}decodeValue(t,r){return this.checkType(r),We(t)}get name(){return"principal"}valueToString(t){return`${this.name} "${t.toText()}"`}};s.PrincipalClass=Fe;var pe=class extends j{constructor(t,r,n=[]){super(),this.argTypes=t,this.retTypes=r,this.annotations=n}static argsToString(t,r){if(t.length!==r.length)throw new Error("arity mismatch");return"("+t.map((n,o)=>n.valueToString(r[o])).join(", ")+")"}accept(t,r){return t.visitFunc(this,r)}covariant(t){if(Array.isArray(t)&&t.length===2&&t[0]&&t[0]._isPrincipal&&typeof t[1]=="string")return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue([t,r]){let n=t.toUint8Array(),o=(0,c.lebEncode)(n.byteLength),i=(0,_.concat)(new Uint8Array([1]),o,n),a=new TextEncoder().encode(r),u=(0,c.lebEncode)(a.byteLength);return(0,_.concat)(new Uint8Array([1]),i,u,a)}_buildTypeTableImpl(t){this.argTypes.forEach(d=>d.buildTypeTable(t)),this.retTypes.forEach(d=>d.buildTypeTable(t));let r=(0,c.slebEncode)(-22),n=(0,c.lebEncode)(this.argTypes.length),o=(0,_.concat)(...this.argTypes.map(d=>d.encodeType(t))),i=(0,c.lebEncode)(this.retTypes.length),a=(0,_.concat)(...this.retTypes.map(d=>d.encodeType(t))),u=(0,c.lebEncode)(this.annotations.length),p=(0,_.concat)(...this.annotations.map(d=>this.encodeAnnotation(d)));t.add(this,(0,_.concat)(r,n,o,i,a,u,p))}decodeValue(t){if((0,c.safeReadUint8)(t)!==1)throw new Error("Cannot decode function reference");let n=We(t),o=Number((0,c.lebDecode)(t)),i=(0,c.safeRead)(t,o),u=new TextDecoder("utf8",{fatal:!0}).decode(i);return[n,u]}get name(){let t=this.argTypes.map(o=>o.name).join(", "),r=this.retTypes.map(o=>o.name).join(", "),n=" "+this.annotations.join(" ");return`(${t}) -> (${r})${n}`}valueToString([t,r]){return`func "${t.toText()}".${r}`}display(){let t=this.argTypes.map(o=>o.display()).join(", "),r=this.retTypes.map(o=>o.display()).join(", "),n=" "+this.annotations.join(" ");return`(${t}) \u2192 (${r})${n}`}encodeAnnotation(t){if(t==="query")return new Uint8Array([1]);if(t==="oneway")return new Uint8Array([2]);if(t==="composite_query")return new Uint8Array([3]);throw new Error("Illegal function annotation")}};s.FuncClass=pe;var Oe=class extends j{constructor(t){super(),this._fields=Object.entries(t).sort((r,n)=>r[0]<n[0]?-1:r[0]>n[0]?1:0)}accept(t,r){return t.visitService(this,r)}covariant(t){if(t&&t._isPrincipal)return!0;throw new Error(`Invalid ${this.display()} argument: ${N(t)}`)}encodeValue(t){let r=t.toUint8Array(),n=(0,c.lebEncode)(r.length);return(0,_.concat)(new Uint8Array([1]),n,r)}_buildTypeTableImpl(t){this._fields.forEach(([i,a])=>a.buildTypeTable(t));let r=(0,c.slebEncode)(-23),n=(0,c.lebEncode)(this._fields.length),o=this._fields.map(([i,a])=>{let u=new TextEncoder().encode(i),p=(0,c.lebEncode)(u.length);return(0,_.concat)(p,u,a.encodeType(t))});t.add(this,(0,_.concat)(r,n,...o))}decodeValue(t){return We(t)}get name(){return`service {${this._fields.map(([r,n])=>r+":"+n.name).join("; ")}}`}valueToString(t){return`service "${t.toText()}"`}};s.ServiceClass=Oe;function N(e){let t=JSON.stringify(e,(r,n)=>typeof n=="bigint"?`BigInt(${n})`:n);return t&&t.length>qt?t.substring(0,qt-3)+"...":t}function un(e,t){if(t.length<e.length)throw Error("Wrong number of message arguments");let r=new He;e.forEach(p=>p.buildTypeTable(r));let n=new TextEncoder().encode(Te),o=r.encode(),i=(0,c.lebEncode)(t.length),a=(0,_.concat)(...e.map(p=>p.encodeType(r))),u=(0,_.concat)(...le(e,t,(p,d)=>{try{p.covariant(d)}catch(h){throw new Error(h.message+`
13
+ variant ${r} -> ${o.message}`)}}))return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){for(let r=0;r<this._fields.length;r++){let[n,o]=this._fields[r];if(t.hasOwnProperty(n)){let i=(0,c.lebEncode)(r),a=o.encodeValue(t[n]);return(0,_.concat)(i,a)}}throw Error("Variant has no data: "+t)}_buildTypeTableImpl(t){this._fields.forEach(([,i])=>{i.buildTypeTable(t)});let r=(0,c.slebEncode)(-21),n=(0,c.lebEncode)(this._fields.length),o=this._fields.map(([i,a])=>(0,_.concat)((0,c.lebEncode)((0,q.idlLabelToId)(i)),a.encodeType(t)));t.add(this,(0,_.concat)(r,n,...o))}decodeValue(t,r){let n=this.checkType(r);if(!(n instanceof e))throw new Error("Not a variant type");let o=Number((0,c.lebDecode)(t));if(o>=n._fields.length)throw Error("Invalid variant index: "+o);let[i,a]=n._fields[o];for(let[d,p]of this._fields)if((0,q.idlLabelToId)(i)===(0,q.idlLabelToId)(d)){let u=p.decodeValue(t,a);return{[d]:u}}throw new Error("Cannot find field hash "+i)}get name(){return`variant {${this._fields.map(([r,n])=>r+":"+n.name).join("; ")}}`}display(){return`variant {${this._fields.map(([r,n])=>r+(n.name==="null"?"":`:${n.display()}`)).join("; ")}}`}valueToString(t){for(let[r,n]of this._fields)if(t.hasOwnProperty(r)){let o=n.valueToString(t[r]);return o==="null"?`variant {${r}}`:`variant {${r}=${o}}`}throw new Error("Variant has no data: "+t)}};s.VariantClass=Se;var W=class e extends j{constructor(){super(...arguments),this._id=e._counter++,this._type=void 0}accept(t,r){if(!this._type)throw Error("Recursive type uninitialized.");return t.visitRec(this,this._type,r)}fill(t){this._type=t}getType(){return this._type}covariant(t){if(this._type&&this._type.covariant(t))return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){if(!this._type)throw Error("Recursive type uninitialized.");return this._type.encodeValue(t)}_buildTypeTableImpl(t){if(!this._type)throw Error("Recursive type uninitialized.");t.add(this,new Uint8Array([])),this._type.buildTypeTable(t),t.merge(this,this._type.name)}decodeValue(t,r){if(!this._type)throw Error("Recursive type uninitialized.");return this._type.decodeValue(t,r)}get name(){return`rec_${this._id}`}display(){if(!this._type)throw Error("Recursive type uninitialized.");return`\u03BC${this.name}.${this._type.name}`}valueToString(t){if(!this._type)throw Error("Recursive type uninitialized.");return this._type.valueToString(t)}};s.RecClass=W;W._counter=0;function Je(e){if((0,c.safeReadUint8)(e)!==1)throw new Error("Cannot decode principal");let r=Number((0,c.lebDecode)(e));return _n.Principal.fromUint8Array(new Uint8Array((0,c.safeRead)(e,r)))}var Fe=class extends M{accept(t,r){return t.visitPrincipal(this,r)}covariant(t){if(t&&t._isPrincipal)return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){let r=t.toUint8Array(),n=(0,c.lebEncode)(r.byteLength);return(0,_.concat)(new Uint8Array([1]),n,r)}encodeType(){return(0,c.slebEncode)(-24)}decodeValue(t,r){return this.checkType(r),Je(t)}get name(){return"principal"}valueToString(t){return`${this.name} "${t.toText()}"`}};s.PrincipalClass=Fe;var pe=class extends j{constructor(t,r,n=[]){super(),this.argTypes=t,this.retTypes=r,this.annotations=n}static argsToString(t,r){if(t.length!==r.length)throw new Error("arity mismatch");return"("+t.map((n,o)=>n.valueToString(r[o])).join(", ")+")"}accept(t,r){return t.visitFunc(this,r)}covariant(t){if(Array.isArray(t)&&t.length===2&&t[0]&&t[0]._isPrincipal&&typeof t[1]=="string")return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue([t,r]){let n=t.toUint8Array(),o=(0,c.lebEncode)(n.byteLength),i=(0,_.concat)(new Uint8Array([1]),o,n),a=new TextEncoder().encode(r),d=(0,c.lebEncode)(a.byteLength);return(0,_.concat)(new Uint8Array([1]),i,d,a)}_buildTypeTableImpl(t){this.argTypes.forEach(u=>u.buildTypeTable(t)),this.retTypes.forEach(u=>u.buildTypeTable(t));let r=(0,c.slebEncode)(-22),n=(0,c.lebEncode)(this.argTypes.length),o=(0,_.concat)(...this.argTypes.map(u=>u.encodeType(t))),i=(0,c.lebEncode)(this.retTypes.length),a=(0,_.concat)(...this.retTypes.map(u=>u.encodeType(t))),d=(0,c.lebEncode)(this.annotations.length),p=(0,_.concat)(...this.annotations.map(u=>this.encodeAnnotation(u)));t.add(this,(0,_.concat)(r,n,o,i,a,d,p))}decodeValue(t){if((0,c.safeReadUint8)(t)!==1)throw new Error("Cannot decode function reference");let n=Je(t),o=Number((0,c.lebDecode)(t)),i=(0,c.safeRead)(t,o),d=new TextDecoder("utf8",{fatal:!0}).decode(i);return[n,d]}get name(){let t=this.argTypes.map(o=>o.name).join(", "),r=this.retTypes.map(o=>o.name).join(", "),n=" "+this.annotations.join(" ");return`(${t}) -> (${r})${n}`}valueToString([t,r]){return`func "${t.toText()}".${r}`}display(){let t=this.argTypes.map(o=>o.display()).join(", "),r=this.retTypes.map(o=>o.display()).join(", "),n=" "+this.annotations.join(" ");return`(${t}) \u2192 (${r})${n}`}encodeAnnotation(t){if(t==="query")return new Uint8Array([1]);if(t==="oneway")return new Uint8Array([2]);if(t==="composite_query")return new Uint8Array([3]);throw new Error("Illegal function annotation")}};s.FuncClass=pe;var Oe=class extends j{constructor(t){super(),this._fields=Object.entries(t).sort((r,n)=>r[0]<n[0]?-1:r[0]>n[0]?1:0)}accept(t,r){return t.visitService(this,r)}covariant(t){if(t&&t._isPrincipal)return!0;throw new Error(`Invalid ${this.display()} argument: ${v(t)}`)}encodeValue(t){let r=t.toUint8Array(),n=(0,c.lebEncode)(r.length);return(0,_.concat)(new Uint8Array([1]),n,r)}_buildTypeTableImpl(t){this._fields.forEach(([i,a])=>a.buildTypeTable(t));let r=(0,c.slebEncode)(-23),n=(0,c.lebEncode)(this._fields.length),o=this._fields.map(([i,a])=>{let d=new TextEncoder().encode(i),p=(0,c.lebEncode)(d.length);return(0,_.concat)(p,d,a.encodeType(t))});t.add(this,(0,_.concat)(r,n,...o))}decodeValue(t){return Je(t)}get name(){return`service {${this._fields.map(([r,n])=>r+":"+n.name).join("; ")}}`}valueToString(t){return`service "${t.toText()}"`}};s.ServiceClass=Oe;function v(e){let t=JSON.stringify(e,(r,n)=>typeof n=="bigint"?`BigInt(${n})`:n);return t&&t.length>zt?t.substring(0,zt-3)+"...":t}function yn(e,t){if(t.length<e.length)throw Error("Wrong number of message arguments");let r=new Ke;e.forEach(p=>p.buildTypeTable(r));let n=new TextEncoder().encode(Te),o=r.encode(),i=(0,c.lebEncode)(t.length),a=(0,_.concat)(...e.map(p=>p.encodeType(r))),d=(0,_.concat)(...le(e,t,(p,u)=>{try{p.covariant(u)}catch(h){throw new Error(h.message+`
14
14
 
15
- `)}return p.encodeValue(d)}));return(0,_.concat)(n,o,i,a,u)}s.encode=un;function dn(e,t){let r=new _.PipeArrayBuffer(t);if(t.byteLength<Te.length)throw new Error("Message length smaller than magic number");let n=(0,c.safeRead)(r,Te.length),o=new TextDecoder().decode(n);if(o!==Te)throw new Error("Wrong magic number: "+JSON.stringify(o));function i(l){let m=[],y=Number((0,c.lebDecode)(l));for(let T=0;T<y;T++){let P=Number((0,c.slebDecode)(l));switch(P){case-18:case-19:{let R=Number((0,c.slebDecode)(l));m.push([P,R]);break}case-20:case-21:{let R=[],C=Number((0,c.lebDecode)(l)),S;for(;C--;){let O=Number((0,c.lebDecode)(l));if(O>=Math.pow(2,32))throw new Error("field id out of 32-bit range");if(typeof S=="number"&&S>=O)throw new Error("field id collision or not sorted");S=O;let E=Number((0,c.slebDecode)(l));R.push([O,E])}m.push([P,R]);break}case-22:{let R=[],C=Number((0,c.lebDecode)(l));for(;C--;)R.push(Number((0,c.slebDecode)(l)));let S=[],O=Number((0,c.lebDecode)(l));for(;O--;)S.push(Number((0,c.slebDecode)(l)));let E=[],k=Number((0,c.lebDecode)(l));for(;k--;)switch(Number((0,c.lebDecode)(l))){case 1:{E.push("query");break}case 2:{E.push("oneway");break}case 3:{E.push("composite_query");break}default:throw new Error("unknown annotation")}m.push([P,[R,S,E]]);break}case-23:{let R=Number((0,c.lebDecode)(l)),C=[];for(;R--;){let S=Number((0,c.lebDecode)(l)),O=new TextDecoder().decode((0,c.safeRead)(l,S)),E=(0,c.slebDecode)(l);C.push([O,E])}m.push([P,C]);break}default:throw new Error("Illegal op_code: "+P)}}let v=[],b=Number((0,c.lebDecode)(l));for(let T=0;T<b;T++)v.push(Number((0,c.slebDecode)(l)));return[m,v]}let[a,u]=i(r);if(u.length<e.length)throw new Error("Wrong number of return values");let p=a.map(l=>Jt());function d(l){if(l<-24)throw new Error("future value not supported");if(l<0)switch(l){case-1:return s.Null;case-2:return s.Bool;case-3:return s.Nat;case-4:return s.Int;case-5:return s.Nat8;case-6:return s.Nat16;case-7:return s.Nat32;case-8:return s.Nat64;case-9:return s.Int8;case-10:return s.Int16;case-11:return s.Int32;case-12:return s.Int64;case-13:return s.Float32;case-14:return s.Float64;case-15:return s.Text;case-16:return s.Reserved;case-17:return s.Empty;case-24:return s.Principal;default:throw new Error("Illegal op_code: "+l)}if(l>=a.length)throw new Error("type index out of range");return p[l]}function h(l){switch(l[0]){case-19:{let m=d(l[1]);return zt(m)}case-18:{let m=d(l[1]);return Ht(m)}case-20:{let m={};for(let[b,T]of l[1]){let P=`_${b}_`;m[P]=d(T)}let y=Kt(m),v=y.tryAsTuple();return Array.isArray(v)?jt(...v):y}case-21:{let m={};for(let[y,v]of l[1]){let b=`_${y}_`;m[b]=d(v)}return Wt(m)}case-22:{let[m,y,v]=l[1];return Gt(m.map(b=>d(b)),y.map(b=>d(b)),v)}case-23:{let m={},y=l[1];for(let[v,b]of y){let T=d(b);if(T instanceof W&&(T=T.getType()),!(T instanceof pe))throw new Error("Illegal service definition: services can only contain functions");m[v]=T}return Yt(m)}default:throw new Error("Illegal op_code: "+l[0])}}a.forEach((l,m)=>{if(l[0]===-22){let y=h(l);p[m].fill(y)}}),a.forEach((l,m)=>{if(l[0]!==-22){let y=h(l);p[m].fill(y)}});let g=u.map(l=>d(l)),w=e.map((l,m)=>l.decodeValue(r,g[m]));for(let l=e.length;l<g.length;l++)g[l].decodeValue(r,g[l]);if(r.byteLength>0)throw new Error("decode: Left-over bytes");return w}s.decode=dn;s.Empty=new be;s.Reserved=new D;s.Unknown=new xe;s.Bool=new we;s.Null=new ve;s.Text=new Ne;s.Int=new Pe;s.Nat=new Re;s.Float32=new ue(32);s.Float64=new ue(64);s.Int8=new H(8);s.Int16=new H(16);s.Int32=new H(32);s.Int64=new H(64);s.Nat8=new q(8);s.Nat16=new q(16);s.Nat32=new q(32);s.Nat64=new q(64);s.Principal=new Fe;function jt(...e){return new Ce(e)}s.Tuple=jt;function zt(e){return new Ve(e)}s.Vec=zt;function Ht(e){return new L(e)}s.Opt=Ht;function Kt(e){return new de(e)}s.Record=Kt;function Wt(e){return new Se(e)}s.Variant=Wt;function Jt(){return new W}s.Rec=Jt;function Gt(e,t,r=[]){return new pe(e,t,r)}s.Func=Gt;function Yt(e){return new Oe(e)}s.Service=Yt});var De=z(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.VecForm=F.OptionForm=F.VariantForm=F.TupleForm=F.RecordForm=F.InputForm=F.InputBox=void 0;var Ge=class{constructor(t,r){this.idl=t,this.ui=r,this.label=null,this.value=void 0;let n=document.createElement("span");n.className="status",this.status=n,r.input&&(r.input.addEventListener("blur",()=>{r.input.value!==""&&this.parse()}),r.input.addEventListener("input",()=>{n.style.display="none",r.input.classList.remove("reject")}))}isRejected(){return this.value===void 0}parse(t={}){if(this.ui.form){let r=this.ui.form.parse(t);return this.value=r,r}if(this.ui.input){let r=this.ui.input;try{let n=this.ui.parse(this.idl,t,r.value);if(!this.idl.covariant(n))throw new Error(`${r.value} is not of type ${this.idl.display()}`);return this.status.style.display="none",this.value=n,n}catch(n){r.classList.add("reject"),this.status.style.display="block",this.status.innerHTML="InputError: "+n.message,this.value=void 0;return}}return null}render(t){let r=document.createElement("span");if(this.label){let n=document.createElement("label");n.innerText=this.label,r.appendChild(n)}this.ui.input&&(r.appendChild(this.ui.input),r.appendChild(this.status)),this.ui.form&&this.ui.form.render(r),t.appendChild(r)}};F.InputBox=Ge;var J=class{constructor(t){this.ui=t,this.form=[]}renderForm(t){this.ui.container?(this.form.forEach(r=>r.render(this.ui.container)),t.appendChild(this.ui.container)):this.form.forEach(r=>r.render(t))}render(t){if(this.ui.open&&this.ui.event){t.appendChild(this.ui.open);let r=this;r.ui.open.addEventListener(r.ui.event,()=>{if(r.ui.container)r.ui.container.innerHTML="";else{let n=r.ui.open.nextElementSibling;n&&n.parentNode.removeChild(n)}r.generateForm(),r.renderForm(t)})}else this.generateForm(),this.renderForm(t)}};F.InputForm=J;var Ye=class extends J{constructor(t,r){super(r),this.fields=t,this.ui=r}generateForm(){this.form=this.fields.map(([t,r])=>{let n=this.ui.render(r);return this.ui.labelMap&&this.ui.labelMap.hasOwnProperty(t)?n.label=this.ui.labelMap[t]+" ":n.label=t+" ",n})}parse(t){let r={};if(this.fields.forEach(([n,o],i)=>{let a=this.form[i].parse(t);r[n]=a}),!this.form.some(n=>n.isRejected()))return r}};F.RecordForm=Ye;var Qe=class extends J{constructor(t,r){super(r),this.components=t,this.ui=r}generateForm(){this.form=this.components.map(t=>this.ui.render(t))}parse(t){let r=[];if(this.components.forEach((n,o)=>{let i=this.form[o].parse(t);r.push(i)}),!this.form.some(n=>n.isRejected()))return r}};F.TupleForm=Qe;var Xe=class extends J{constructor(t,r){super(r),this.fields=t,this.ui=r}generateForm(){let t=this.ui.open.selectedIndex,[r,n]=this.fields[t],o=this.ui.render(n);this.form=[o]}parse(t){let r=this.ui.open,n=r.options[r.selectedIndex].value,o=this.form[0].parse(t);if(o===void 0)return;let i={};return i[n]=o,i}};F.VariantForm=Xe;var Ze=class extends J{constructor(t,r){super(r),this.ty=t,this.ui=r}generateForm(){if(this.ui.open.checked){let t=this.ui.render(this.ty);this.form=[t]}else this.form=[]}parse(t){if(this.form.length===0)return[];{let r=this.form[0].parse(t);return r===void 0?void 0:[r]}}};F.OptionForm=Ze;var Ie=class extends J{constructor(t,r){super(r),this.ty=t,this.ui=r}generateForm(){let t=+this.ui.open.value;this.form=[];for(let r=0;r<t;r++){let n=this.ui.render(this.ty);this.form.push(n)}}parse(t){let r=this.form.map(n=>n.parse(t));if(!this.form.some(n=>n.isRejected()))return r}};F.VecForm=Ie});var Xt=z(f=>{"use strict";var pn=f&&f.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),mn=f&&f.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Qt=f&&f.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&pn(t,e,r);return mn(t,e),t};Object.defineProperty(f,"__esModule",{value:!0});f.renderValue=f.renderInput=f.Render=f.vecForm=f.optForm=f.variantForm=f.tupleForm=f.recordForm=f.inputBox=void 0;var Ae=Qt(Je()),Le=ft("@dfinity/principal"),ee=Qt(De()),fn={parse:xn},me={render:nt},hn=(e,t)=>new ee.InputBox(e,Object.assign(Object.assign({},fn),t));f.inputBox=hn;var _n=(e,t)=>new ee.RecordForm(e,Object.assign(Object.assign({},me),t));f.recordForm=_n;var yn=(e,t)=>new ee.TupleForm(e,Object.assign(Object.assign({},me),t));f.tupleForm=yn;var gn=(e,t)=>new ee.VariantForm(e,Object.assign(Object.assign({},me),t));f.variantForm=gn;var Tn=(e,t)=>new ee.OptionForm(e,Object.assign(Object.assign({},me),t));f.optForm=Tn;var bn=(e,t)=>new ee.VecForm(e,Object.assign(Object.assign({},me),t));f.vecForm=bn;var Ee=class extends Ae.Visitor{visitType(t,r){let n=document.createElement("input");return n.classList.add("argument"),n.placeholder=t.display(),(0,f.inputBox)(t,{input:n})}visitNull(t,r){return(0,f.inputBox)(t,{})}visitRecord(t,r,n){let o={};if(r.length>1){let a=document.createElement("div");a.classList.add("popup-form"),o={container:a}}let i=(0,f.recordForm)(r,o);return(0,f.inputBox)(t,{form:i})}visitTuple(t,r,n){let o={};if(r.length>1){let a=document.createElement("div");a.classList.add("popup-form"),o={container:a}}let i=(0,f.tupleForm)(r,o);return(0,f.inputBox)(t,{form:i})}visitVariant(t,r,n){let o=document.createElement("select");for(let[u,p]of r){let d=new Option(u);o.add(d)}o.selectedIndex=-1,o.classList.add("open");let i={open:o,event:"change"},a=(0,f.variantForm)(r,i);return(0,f.inputBox)(t,{form:a})}visitOpt(t,r,n){let o=document.createElement("input");o.type="checkbox",o.classList.add("open");let i=(0,f.optForm)(r,{open:o,event:"change"});return(0,f.inputBox)(t,{form:i})}visitVec(t,r,n){let o=document.createElement("input");o.type="number",o.min="0",o.max="100",o.style.width="8rem",o.placeholder="len",o.classList.add("open");let i=document.createElement("div");i.classList.add("popup-form");let a=(0,f.vecForm)(r,{open:o,event:"change",container:i});return(0,f.inputBox)(t,{form:a})}visitRec(t,r,n){return nt(r)}};f.Render=Ee;var et=class extends Ae.Visitor{visitNull(t,r){return null}visitBool(t,r){if(r==="true")return!0;if(r==="false")return!1;throw new Error(`Cannot parse ${r} as boolean`)}visitText(t,r){return r}visitFloat(t,r){return parseFloat(r)}visitFixedInt(t,r){return t._bits<=32?parseInt(r,10):BigInt(r)}visitFixedNat(t,r){return t._bits<=32?parseInt(r,10):BigInt(r)}visitNumber(t,r){return BigInt(r)}visitPrincipal(t,r){return Le.Principal.fromText(r)}visitService(t,r){return Le.Principal.fromText(r)}visitFunc(t,r){let n=r.split(".",2);return[Le.Principal.fromText(n[0]),n[1]]}},tt=class extends Ae.Visitor{visitNull(t,r){return null}visitBool(t,r){return Math.random()<.5}visitText(t,r){return Math.random().toString(36).substring(6)}visitFloat(t,r){return Math.random()}visitInt(t,r){return BigInt(this.generateNumber(!0))}visitNat(t,r){return BigInt(this.generateNumber(!1))}visitFixedInt(t,r){let n=this.generateNumber(!0);return t._bits<=32?n:BigInt(r)}visitFixedNat(t,r){let n=this.generateNumber(!1);return t._bits<=32?n:BigInt(r)}generateNumber(t){let r=Math.floor(Math.random()*100);return t&&Math.random()<.5?-r:r}};function xn(e,t,r){return t.random&&r===""?e.accept(new tt,r):e.accept(new et,r)}function nt(e){return e.accept(new Ee,null)}f.renderInput=nt;function Q(e,t,r){return e.accept(new rt,{input:t,value:r})}f.renderValue=Q;var rt=class extends Ae.Visitor{visitType(t,r){r.input.ui.input.value=t.valueToString(r.value)}visitNull(t,r){}visitText(t,r){r.input.ui.input.value=r.value}visitRec(t,r,n){Q(r,n.input,n.value)}visitOpt(t,r,n){if(n.value.length!==0){let o=n.input.ui.form,i=o.ui.open;i.checked=!0,i.dispatchEvent(new Event(o.ui.event)),Q(r,o.form[0],n.value[0])}}visitRecord(t,r,n){let o=n.input.ui.form;r.forEach(([i,a],u)=>{Q(a,o.form[u],n.value[i])})}visitTuple(t,r,n){let o=n.input.ui.form;r.forEach((i,a)=>{Q(i,o.form[a],n.value[a])})}visitVariant(t,r,n){let o=n.input.ui.form,i=Object.entries(n.value)[0];r.forEach(([a,u],p)=>{if(a===i[0]){let d=o.ui.open;d.selectedIndex=p,d.dispatchEvent(new Event(o.ui.event)),Q(u,o.form[0],i[1])}})}visitVec(t,r,n){let o=n.input.ui.form,i=n.value.length,a=o.ui.open;a.value=i,a.dispatchEvent(new Event(o.ui.event)),n.value.forEach((u,p)=>{Q(r,o.form[p],u)})}}});var It=z(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0})});var ot=z(V=>{"use strict";var Dt=V&&V.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),wn=V&&V.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),te=V&&V.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Dt(t,e,r)},vn=V&&V.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Dt(t,e,r);return wn(t,e),t};Object.defineProperty(V,"__esModule",{value:!0});V.IDL=void 0;te(Xt(),V);te(De(),V);V.IDL=vn(Je());te(Ue(),V);te(je(),V);te(_e(),V);te(It(),V)});import{Principal as Nn}from"@dfinity/principal";import{Principal as vt}from"@dfinity/principal";var _t=({IDL:e})=>{let t=e.Variant({mainnet:e.Null,testnet:e.Null}),r=e.Text,n=e.Record({network:t,address:r,min_confirmations:e.Opt(e.Nat32)}),o=e.Nat64,i=e.Record({network:t}),a=e.Nat64,u=e.Record({network:t,filter:e.Opt(e.Variant({page:e.Vec(e.Nat8),min_confirmations:e.Nat32})),address:r}),p=e.Vec(e.Nat8),d=e.Record({txid:e.Vec(e.Nat8),vout:e.Nat32}),h=e.Record({height:e.Nat32,value:o,outpoint:d}),g=e.Record({next_page:e.Opt(e.Vec(e.Nat8)),tip_height:e.Nat32,tip_block_hash:p,utxos:e.Vec(h)}),w=e.Record({transaction:e.Vec(e.Nat8),network:t}),l=e.Principal,m=e.Variant({from_user:e.Record({user_id:e.Principal}),from_canister:e.Record({canister_version:e.Opt(e.Nat64),canister_id:e.Principal})}),y=e.Variant({creation:e.Record({controllers:e.Vec(e.Principal)}),code_deployment:e.Record({mode:e.Variant({reinstall:e.Null,upgrade:e.Null,install:e.Null}),module_hash:e.Vec(e.Nat8)}),controllers_change:e.Record({controllers:e.Vec(e.Principal)}),code_uninstall:e.Null}),v=e.Record({timestamp_nanos:e.Nat64,canister_version:e.Nat64,origin:m,details:y}),b=e.Record({freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),T=e.Record({freezing_threshold:e.Opt(e.Nat),controllers:e.Opt(e.Vec(e.Principal)),memory_allocation:e.Opt(e.Nat),compute_allocation:e.Opt(e.Nat)}),P=e.Variant({secp256k1:e.Null}),R=e.Record({value:e.Text,name:e.Text}),C=e.Record({status:e.Nat,body:e.Vec(e.Nat8),headers:e.Vec(R)}),S=e.Vec(e.Nat8);return e.Service({bitcoin_get_balance:e.Func([n],[o],[]),bitcoin_get_current_fee_percentiles:e.Func([i],[e.Vec(a)],[]),bitcoin_get_utxos:e.Func([u],[g],[]),bitcoin_send_transaction:e.Func([w],[],[]),canister_info:e.Func([e.Record({canister_id:l,num_requested_changes:e.Opt(e.Nat64)})],[e.Record({controllers:e.Vec(e.Principal),module_hash:e.Opt(e.Vec(e.Nat8)),recent_changes:e.Vec(v),total_num_changes:e.Nat64})],[]),canister_status:e.Func([e.Record({canister_id:l})],[e.Record({status:e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),memory_size:e.Nat,cycles:e.Nat,settings:b,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))})],[]),create_canister:e.Func([e.Record({settings:e.Opt(T),sender_canister_version:e.Opt(e.Nat64)})],[e.Record({canister_id:l})],[]),delete_canister:e.Func([e.Record({canister_id:l})],[],[]),deposit_cycles:e.Func([e.Record({canister_id:l})],[],[]),ecdsa_public_key:e.Func([e.Record({key_id:e.Record({name:e.Text,curve:P}),canister_id:e.Opt(l),derivation_path:e.Vec(e.Vec(e.Nat8))})],[e.Record({public_key:e.Vec(e.Nat8),chain_code:e.Vec(e.Nat8)})],[]),http_request:e.Func([e.Record({url:e.Text,method:e.Variant({get:e.Null,head:e.Null,post:e.Null}),max_response_bytes:e.Opt(e.Nat64),body:e.Opt(e.Vec(e.Nat8)),transform:e.Opt(e.Record({function:e.Func([e.Record({context:e.Vec(e.Nat8),response:C})],[C],["query"]),context:e.Vec(e.Nat8)})),headers:e.Vec(R)})],[C],[]),install_code:e.Func([e.Record({arg:e.Vec(e.Nat8),wasm_module:S,mode:e.Variant({reinstall:e.Null,upgrade:e.Null,install:e.Null}),canister_id:l,sender_canister_version:e.Opt(e.Nat64)})],[],[]),provisional_create_canister_with_cycles:e.Func([e.Record({settings:e.Opt(T),specified_id:e.Opt(l),amount:e.Opt(e.Nat)})],[e.Record({canister_id:l})],[]),provisional_top_up_canister:e.Func([e.Record({canister_id:l,amount:e.Nat})],[],[]),raw_rand:e.Func([],[e.Vec(e.Nat8)],[]),sign_with_ecdsa:e.Func([e.Record({key_id:e.Record({name:e.Text,curve:P}),derivation_path:e.Vec(e.Vec(e.Nat8)),message_hash:e.Vec(e.Nat8)})],[e.Record({signature:e.Vec(e.Nat8)})],[]),start_canister:e.Func([e.Record({canister_id:l})],[],[]),stop_canister:e.Func([e.Record({canister_id:l})],[],[]),uninstall_code:e.Func([e.Record({canister_id:l,sender_canister_version:e.Opt(e.Nat64)})],[],[]),update_settings:e.Func([e.Record({canister_id:e.Principal,settings:T,sender_canister_version:e.Opt(e.Nat64)})],[],[])})};var yt=({IDL:e})=>{let t=e.Record({updated_at:e.Nat64,orbiter_id:e.Principal,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64}),r=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,satellite_id:e.Principal}),n=e.Record({cycles:e.Nat,destination_id:e.Principal}),o=e.Variant({Write:e.Null,Admin:e.Null}),i=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,scope:o,expires_at:e.Opt(e.Nat64)}),a=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),u=e.Record({freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),p=e.Record({status:a,memory_size:e.Nat,cycles:e.Nat,settings:u,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),d=e.Record({id:e.Principal,status:p,metadata:e.Opt(e.Vec(e.Tuple(e.Text,e.Text))),status_at:e.Nat64}),h=e.Variant({Ok:d,Err:e.Text}),g=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),scope:o,expires_at:e.Opt(e.Nat64)}),w=e.Record({enabled:e.Bool,cycles_threshold:e.Opt(e.Nat64)}),l=e.Record({mission_control_cycles_threshold:e.Opt(e.Nat64),orbiters:e.Vec(e.Tuple(e.Principal,w)),satellites:e.Vec(e.Tuple(e.Principal,w)),cycles_threshold:e.Opt(e.Nat64)}),m=e.Record({orbiters:e.Opt(e.Vec(h)),satellites:e.Opt(e.Vec(h)),mission_control:h}),y=e.Record({e8s:e.Nat64});return e.Service({add_mission_control_controllers:e.Func([e.Vec(e.Principal)],[],[]),add_satellites_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal)],[],[]),create_orbiter:e.Func([e.Opt(e.Text)],[t],[]),create_satellite:e.Func([e.Text],[r],[]),del_mission_control_controllers:e.Func([e.Vec(e.Principal)],[],[]),del_orbiter:e.Func([e.Principal,e.Nat],[],[]),del_orbiters_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal)],[],[]),del_satellite:e.Func([e.Principal,e.Nat],[],[]),del_satellites_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal)],[],[]),deposit_cycles:e.Func([n],[],[]),get_user:e.Func([],[e.Principal],["query"]),list_mission_control_controllers:e.Func([],[e.Vec(e.Tuple(e.Principal,i))],["query"]),list_mission_control_statuses:e.Func([],[e.Vec(e.Tuple(e.Nat64,h))],["query"]),list_orbiter_statuses:e.Func([e.Principal],[e.Opt(e.Vec(e.Tuple(e.Nat64,h)))],["query"]),list_orbiters:e.Func([],[e.Vec(e.Tuple(e.Principal,t))],["query"]),list_satellite_statuses:e.Func([e.Principal],[e.Opt(e.Vec(e.Tuple(e.Nat64,h)))],["query"]),list_satellites:e.Func([],[e.Vec(e.Tuple(e.Principal,r))],["query"]),remove_mission_control_controllers:e.Func([e.Vec(e.Principal)],[],[]),remove_satellites_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal)],[],[]),set_metadata:e.Func([e.Vec(e.Tuple(e.Text,e.Text))],[],[]),set_mission_control_controllers:e.Func([e.Vec(e.Principal),g],[],[]),set_orbiter:e.Func([e.Principal,e.Opt(e.Text)],[t],[]),set_orbiter_metadata:e.Func([e.Principal,e.Vec(e.Tuple(e.Text,e.Text))],[t],[]),set_orbiters_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal),g],[],[]),set_satellite_metadata:e.Func([e.Principal,e.Vec(e.Tuple(e.Text,e.Text))],[r],[]),set_satellites_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal),g],[],[]),status:e.Func([l],[m],[]),top_up:e.Func([e.Principal,y],[],[]),version:e.Func([],[e.Text],["query"])})};var gt=({IDL:e})=>{let t=e.Record({controllers:e.Vec(e.Principal)}),r=e.Variant({Write:e.Null,Admin:e.Null}),n=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,scope:r,expires_at:e.Opt(e.Nat64)}),o=e.Record({updated_at:e.Opt(e.Nat64)}),i=e.Record({cycles:e.Nat,destination_id:e.Principal}),a=e.Record({to:e.Opt(e.Nat64),from:e.Opt(e.Nat64),satellite_id:e.Opt(e.Principal)}),u=e.Record({key:e.Text,collected_at:e.Nat64}),p=e.Record({inner_height:e.Nat16,inner_width:e.Nat16}),d=e.Record({title:e.Text,updated_at:e.Nat64,referrer:e.Opt(e.Text),time_zone:e.Text,session_id:e.Text,href:e.Text,created_at:e.Nat64,satellite_id:e.Principal,device:p,user_agent:e.Opt(e.Text)}),h=e.Record({updated_at:e.Nat64,session_id:e.Text,metadata:e.Opt(e.Vec(e.Tuple(e.Text,e.Text))),name:e.Text,created_at:e.Nat64,satellite_id:e.Principal}),g=e.Record({updated_at:e.Nat64,created_at:e.Nat64,enabled:e.Bool}),w=e.Record({stable:e.Nat64,heap:e.Nat64}),l=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),scope:r,expires_at:e.Opt(e.Nat64)}),m=e.Record({controller:l,controllers:e.Vec(e.Principal)}),y=e.Record({title:e.Text,updated_at:e.Opt(e.Nat64),referrer:e.Opt(e.Text),time_zone:e.Text,session_id:e.Text,href:e.Text,satellite_id:e.Principal,device:p,user_agent:e.Opt(e.Text)}),v=e.Variant({Ok:d,Err:e.Text}),b=e.Variant({Ok:e.Null,Err:e.Vec(e.Tuple(u,e.Text))}),T=e.Record({updated_at:e.Opt(e.Nat64),enabled:e.Bool}),P=e.Record({updated_at:e.Opt(e.Nat64),session_id:e.Text,metadata:e.Opt(e.Vec(e.Tuple(e.Text,e.Text))),name:e.Text,satellite_id:e.Principal,user_agent:e.Opt(e.Text)}),R=e.Variant({Ok:h,Err:e.Text});return e.Service({del_controllers:e.Func([t],[e.Vec(e.Tuple(e.Principal,n))],[]),del_satellite_config:e.Func([e.Principal,o],[],[]),deposit_cycles:e.Func([i],[],[]),get_page_views:e.Func([a],[e.Vec(e.Tuple(u,d))],["query"]),get_track_events:e.Func([a],[e.Vec(e.Tuple(u,h))],["query"]),list_controllers:e.Func([],[e.Vec(e.Tuple(e.Principal,n))],["query"]),list_satellite_configs:e.Func([],[e.Vec(e.Tuple(e.Principal,g))],["query"]),memory_size:e.Func([],[w],["query"]),set_controllers:e.Func([m],[e.Vec(e.Tuple(e.Principal,n))],[]),set_page_view:e.Func([u,y],[v],[]),set_page_views:e.Func([e.Vec(e.Tuple(u,y))],[b],[]),set_satellite_configs:e.Func([e.Vec(e.Tuple(e.Principal,T))],[e.Vec(e.Tuple(e.Principal,g))],[]),set_track_event:e.Func([u,P],[R],[]),set_track_events:e.Func([e.Vec(e.Tuple(u,P))],[b],[]),version:e.Func([],[e.Text],["query"])})};var Tt=({IDL:e})=>{let t=e.Record({batch_id:e.Nat,headers:e.Vec(e.Tuple(e.Text,e.Text)),chunk_ids:e.Vec(e.Nat)}),r=e.Record({controllers:e.Vec(e.Principal)}),n=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,expires_at:e.Opt(e.Nat64)}),o=e.Record({updated_at:e.Opt(e.Nat64)}),i=e.Record({headers:e.Vec(e.Tuple(e.Text,e.Vec(e.Tuple(e.Text,e.Text))))}),a=e.Record({storage:i}),u=e.Record({updated_at:e.Nat64,owner:e.Principal,data:e.Vec(e.Nat8),created_at:e.Nat64}),p=e.Record({url:e.Text,method:e.Text,body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text))}),d=e.Record({token:e.Opt(e.Text),sha256:e.Opt(e.Vec(e.Nat8)),headers:e.Vec(e.Tuple(e.Text,e.Text)),index:e.Nat64,encoding_type:e.Text,full_path:e.Text}),h=e.Variant({Callback:e.Record({token:d,callback:e.Func([],[],[])})}),g=e.Record({body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text)),streaming_strategy:e.Opt(h),status_code:e.Nat16}),w=e.Record({token:e.Opt(d),body:e.Vec(e.Nat8)}),l=e.Record({token:e.Opt(e.Text),collection:e.Text,name:e.Text,encoding_type:e.Opt(e.Text),full_path:e.Text}),m=e.Record({batch_id:e.Nat}),y=e.Variant({UpdatedAt:e.Null,Keys:e.Null,CreatedAt:e.Null}),v=e.Record({field:y,desc:e.Bool}),b=e.Record({start_after:e.Opt(e.Text),limit:e.Opt(e.Nat64)}),T=e.Record({order:e.Opt(v),owner:e.Opt(e.Principal),matcher:e.Opt(e.Text),paginate:e.Opt(b)}),P=e.Record({token:e.Opt(e.Text),collection:e.Text,owner:e.Principal,name:e.Text,full_path:e.Text}),R=e.Record({modified:e.Nat64,sha256:e.Vec(e.Nat8),total_length:e.Nat}),C=e.Record({key:P,updated_at:e.Nat64,encodings:e.Vec(e.Tuple(e.Text,R)),headers:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64}),S=e.Record({matches_length:e.Nat64,length:e.Nat64,items:e.Vec(e.Tuple(e.Text,C))}),O=e.Record({updated_at:e.Nat64,created_at:e.Nat64,bn_id:e.Opt(e.Text)}),E=e.Record({matches_length:e.Nat64,length:e.Nat64,items:e.Vec(e.Tuple(e.Text,u))}),k=e.Variant({Db:e.Null,Storage:e.Null}),M=e.Variant({Controllers:e.Null,Private:e.Null,Public:e.Null,Managed:e.Null}),re=e.Record({updated_at:e.Nat64,max_size:e.Opt(e.Nat),read:M,created_at:e.Nat64,write:M}),ne=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),expires_at:e.Opt(e.Nat64)}),oe=e.Record({controller:ne,controllers:e.Vec(e.Principal)}),ie=e.Record({updated_at:e.Opt(e.Nat64),data:e.Vec(e.Nat8)}),se=e.Record({updated_at:e.Opt(e.Nat64),max_size:e.Opt(e.Nat),read:M,write:M}),K=e.Record({content:e.Vec(e.Nat8),batch_id:e.Nat}),ae=e.Record({chunk_id:e.Nat});return e.Service({commit_asset_upload:e.Func([t],[],[]),del_asset:e.Func([e.Text,e.Text],[],[]),del_assets:e.Func([e.Opt(e.Text)],[],[]),del_controllers:e.Func([r],[e.Vec(e.Tuple(e.Principal,n))],[]),del_custom_domain:e.Func([e.Text],[],[]),del_doc:e.Func([e.Text,e.Text,o],[],[]),get_config:e.Func([],[a],[]),get_doc:e.Func([e.Text,e.Text],[e.Opt(u)],["query"]),http_request:e.Func([p],[g],["query"]),http_request_streaming_callback:e.Func([d],[w],["query"]),init_asset_upload:e.Func([l],[m],[]),list_assets:e.Func([e.Opt(e.Text),T],[S],["query"]),list_controllers:e.Func([],[e.Vec(e.Tuple(e.Principal,n))],["query"]),list_custom_domains:e.Func([],[e.Vec(e.Tuple(e.Text,O))],["query"]),list_docs:e.Func([e.Text,T],[E],["query"]),list_rules:e.Func([k],[e.Vec(e.Tuple(e.Text,re))],["query"]),set_config:e.Func([a],[],[]),set_controllers:e.Func([oe],[e.Vec(e.Tuple(e.Principal,n))],[]),set_custom_domain:e.Func([e.Text,e.Opt(e.Text)],[],[]),set_doc:e.Func([e.Text,e.Text,ie],[u],[]),set_rule:e.Func([k,e.Text,se],[],[]),upload_asset_chunk:e.Func([K],[ae],[]),version:e.Func([],[e.Text],["query"])})};var bt=({IDL:e})=>{let t=e.Record({batch_id:e.Nat,headers:e.Vec(e.Tuple(e.Text,e.Text)),chunk_ids:e.Vec(e.Nat)}),r=e.Record({controllers:e.Vec(e.Principal)}),n=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,expires_at:e.Opt(e.Nat64)}),o=e.Record({updated_at:e.Opt(e.Nat64)}),i=e.Record({headers:e.Vec(e.Tuple(e.Text,e.Vec(e.Tuple(e.Text,e.Text))))}),a=e.Record({storage:i}),u=e.Record({updated_at:e.Nat64,owner:e.Principal,data:e.Vec(e.Nat8),created_at:e.Nat64}),p=e.Record({url:e.Text,method:e.Text,body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text))}),d=e.Record({token:e.Opt(e.Text),sha256:e.Opt(e.Vec(e.Nat8)),headers:e.Vec(e.Tuple(e.Text,e.Text)),index:e.Nat64,encoding_type:e.Text,full_path:e.Text}),h=e.Variant({Callback:e.Record({token:d,callback:e.Func([],[],[])})}),g=e.Record({body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text)),streaming_strategy:e.Opt(h),status_code:e.Nat16}),w=e.Record({token:e.Opt(d),body:e.Vec(e.Nat8)}),l=e.Record({token:e.Opt(e.Text),collection:e.Text,name:e.Text,encoding_type:e.Opt(e.Text),full_path:e.Text}),m=e.Record({batch_id:e.Nat}),y=e.Variant({UpdatedAt:e.Null,Keys:e.Null,CreatedAt:e.Null}),v=e.Record({field:y,desc:e.Bool}),b=e.Record({start_after:e.Opt(e.Text),limit:e.Opt(e.Nat64)}),T=e.Record({order:e.Opt(v),matcher:e.Opt(e.Text),paginate:e.Opt(b)}),P=e.Record({token:e.Opt(e.Text),collection:e.Text,owner:e.Principal,name:e.Text,full_path:e.Text}),R=e.Record({modified:e.Nat64,sha256:e.Vec(e.Nat8),total_length:e.Nat}),C=e.Record({key:P,updated_at:e.Nat64,encodings:e.Vec(e.Tuple(e.Text,R)),headers:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64}),S=e.Record({matches_length:e.Nat64,length:e.Nat64,items:e.Vec(e.Tuple(e.Text,C))}),O=e.Record({updated_at:e.Nat64,created_at:e.Nat64,bn_id:e.Opt(e.Text)}),E=e.Record({matches_length:e.Nat64,length:e.Nat64,items:e.Vec(e.Tuple(e.Text,u))}),k=e.Variant({Db:e.Null,Storage:e.Null}),M=e.Variant({Controllers:e.Null,Private:e.Null,Public:e.Null,Managed:e.Null}),re=e.Record({updated_at:e.Nat64,max_size:e.Opt(e.Nat),read:M,created_at:e.Nat64,write:M}),ne=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),expires_at:e.Opt(e.Nat64)}),oe=e.Record({controller:ne,controllers:e.Vec(e.Principal)}),ie=e.Record({updated_at:e.Opt(e.Nat64),data:e.Vec(e.Nat8)}),se=e.Record({updated_at:e.Opt(e.Nat64),max_size:e.Opt(e.Nat),read:M,write:M}),K=e.Record({content:e.Vec(e.Nat8),batch_id:e.Nat}),ae=e.Record({chunk_id:e.Nat});return e.Service({commit_asset_upload:e.Func([t],[],[]),del_asset:e.Func([e.Text,e.Text],[],[]),del_assets:e.Func([e.Opt(e.Text)],[],[]),del_controllers:e.Func([r],[e.Vec(e.Tuple(e.Principal,n))],[]),del_custom_domain:e.Func([e.Text],[],[]),del_doc:e.Func([e.Text,e.Text,o],[],[]),get_config:e.Func([],[a],[]),get_doc:e.Func([e.Text,e.Text],[e.Opt(u)],["query"]),http_request:e.Func([p],[g],["query"]),http_request_streaming_callback:e.Func([d],[w],["query"]),init_asset_upload:e.Func([l],[m],[]),list_assets:e.Func([e.Opt(e.Text),T],[S],["query"]),list_controllers:e.Func([],[e.Vec(e.Principal)],["query"]),list_custom_domains:e.Func([],[e.Vec(e.Tuple(e.Text,O))],["query"]),list_docs:e.Func([e.Text,T],[E],["query"]),list_rules:e.Func([k],[e.Vec(e.Tuple(e.Text,re))],["query"]),set_config:e.Func([a],[],[]),set_controllers:e.Func([oe],[e.Vec(e.Tuple(e.Principal,n))],[]),set_custom_domain:e.Func([e.Text,e.Opt(e.Text)],[],[]),set_doc:e.Func([e.Text,e.Text,ie],[u],[]),set_rule:e.Func([k,e.Text,se],[],[]),upload_asset_chunk:e.Func([K],[ae],[]),version:e.Func([],[e.Text],["query"])})};var xt=({IDL:e})=>{let t=e.Record({batch_id:e.Nat,headers:e.Vec(e.Tuple(e.Text,e.Text)),chunk_ids:e.Vec(e.Nat)}),r=e.Record({controllers:e.Vec(e.Principal)}),n=e.Variant({Write:e.Null,Admin:e.Null}),o=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,scope:n,expires_at:e.Opt(e.Nat64)}),i=e.Record({updated_at:e.Opt(e.Nat64)}),a=e.Variant({Db:e.Null,Storage:e.Null}),u=e.Record({cycles:e.Nat,destination_id:e.Principal}),p=e.Variant({Deny:e.Null,AllowAny:e.Null,SameOrigin:e.Null}),d=e.Record({status_code:e.Nat16,location:e.Text}),h=e.Record({iframe:e.Opt(p),rewrites:e.Vec(e.Tuple(e.Text,e.Text)),headers:e.Vec(e.Tuple(e.Text,e.Vec(e.Tuple(e.Text,e.Text)))),redirects:e.Opt(e.Vec(e.Tuple(e.Text,d)))}),g=e.Record({storage:h}),w=e.Record({updated_at:e.Nat64,owner:e.Principal,data:e.Vec(e.Nat8),description:e.Opt(e.Text),created_at:e.Nat64}),l=e.Record({url:e.Text,method:e.Text,body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text)),certificate_version:e.Opt(e.Nat16)}),m=e.Variant({Heap:e.Null,Stable:e.Null}),y=e.Record({memory:m,token:e.Opt(e.Text),sha256:e.Opt(e.Vec(e.Nat8)),headers:e.Vec(e.Tuple(e.Text,e.Text)),index:e.Nat64,encoding_type:e.Text,full_path:e.Text}),v=e.Variant({Callback:e.Record({token:y,callback:e.Func([],[],["query"])})}),b=e.Record({body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text)),streaming_strategy:e.Opt(v),status_code:e.Nat16}),T=e.Record({token:e.Opt(y),body:e.Vec(e.Nat8)}),P=e.Record({token:e.Opt(e.Text),collection:e.Text,name:e.Text,description:e.Opt(e.Text),encoding_type:e.Opt(e.Text),full_path:e.Text}),R=e.Record({batch_id:e.Nat}),C=e.Variant({UpdatedAt:e.Null,Keys:e.Null,CreatedAt:e.Null}),S=e.Record({field:C,desc:e.Bool}),O=e.Record({key:e.Opt(e.Text),description:e.Opt(e.Text)}),E=e.Record({start_after:e.Opt(e.Text),limit:e.Opt(e.Nat64)}),k=e.Record({order:e.Opt(S),owner:e.Opt(e.Principal),matcher:e.Opt(O),paginate:e.Opt(E)}),M=e.Record({token:e.Opt(e.Text),collection:e.Text,owner:e.Principal,name:e.Text,description:e.Opt(e.Text),full_path:e.Text}),re=e.Record({modified:e.Nat64,sha256:e.Vec(e.Nat8),total_length:e.Nat}),ne=e.Record({key:M,updated_at:e.Nat64,encodings:e.Vec(e.Tuple(e.Text,re)),headers:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64}),oe=e.Record({matches_pages:e.Opt(e.Nat64),matches_length:e.Nat64,items_page:e.Opt(e.Nat64),items:e.Vec(e.Tuple(e.Text,ne)),items_length:e.Nat64}),ie=e.Record({updated_at:e.Nat64,created_at:e.Nat64,bn_id:e.Opt(e.Text)}),se=e.Record({matches_pages:e.Opt(e.Nat64),matches_length:e.Nat64,items_page:e.Opt(e.Nat64),items:e.Vec(e.Tuple(e.Text,w)),items_length:e.Nat64}),K=e.Variant({Controllers:e.Null,Private:e.Null,Public:e.Null,Managed:e.Null}),ae=e.Record({memory:e.Opt(m),updated_at:e.Nat64,max_size:e.Opt(e.Nat),read:K,created_at:e.Nat64,mutable_permissions:e.Opt(e.Bool),write:K}),Or=e.Record({stable:e.Nat64,heap:e.Nat64}),Er=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),scope:n,expires_at:e.Opt(e.Nat64)}),Ar=e.Record({controller:Er,controllers:e.Vec(e.Principal)}),pt=e.Record({updated_at:e.Opt(e.Nat64),data:e.Vec(e.Nat8),description:e.Opt(e.Text)}),Br=e.Record({memory:e.Opt(m),updated_at:e.Opt(e.Nat64),max_size:e.Opt(e.Nat),read:K,mutable_permissions:e.Opt(e.Bool),write:K}),Mr=e.Record({content:e.Vec(e.Nat8),batch_id:e.Nat,order_id:e.Opt(e.Nat)}),kr=e.Record({chunk_id:e.Nat});return e.Service({commit_asset_upload:e.Func([t],[],[]),count_assets:e.Func([e.Text],[e.Nat64],["query"]),count_docs:e.Func([e.Text],[e.Nat64],["query"]),del_asset:e.Func([e.Text,e.Text],[],[]),del_assets:e.Func([e.Text],[],[]),del_controllers:e.Func([r],[e.Vec(e.Tuple(e.Principal,o))],[]),del_custom_domain:e.Func([e.Text],[],[]),del_doc:e.Func([e.Text,e.Text,i],[],[]),del_docs:e.Func([e.Text],[],[]),del_many_assets:e.Func([e.Vec(e.Tuple(e.Text,e.Text))],[],[]),del_many_docs:e.Func([e.Vec(e.Tuple(e.Text,e.Text,i))],[],[]),del_rule:e.Func([a,e.Text,i],[],[]),deposit_cycles:e.Func([u],[],[]),get_config:e.Func([],[g],[]),get_doc:e.Func([e.Text,e.Text],[e.Opt(w)],["query"]),get_many_docs:e.Func([e.Vec(e.Tuple(e.Text,e.Text))],[e.Vec(e.Tuple(e.Text,e.Opt(w)))],["query"]),http_request:e.Func([l],[b],["query"]),http_request_streaming_callback:e.Func([y],[T],["query"]),init_asset_upload:e.Func([P],[R],[]),list_assets:e.Func([e.Text,k],[oe],["query"]),list_controllers:e.Func([],[e.Vec(e.Tuple(e.Principal,o))],["query"]),list_custom_domains:e.Func([],[e.Vec(e.Tuple(e.Text,ie))],["query"]),list_docs:e.Func([e.Text,k],[se],["query"]),list_rules:e.Func([a],[e.Vec(e.Tuple(e.Text,ae))],["query"]),memory_size:e.Func([],[Or],["query"]),set_config:e.Func([g],[],[]),set_controllers:e.Func([Ar],[e.Vec(e.Tuple(e.Principal,o))],[]),set_custom_domain:e.Func([e.Text,e.Opt(e.Text)],[],[]),set_doc:e.Func([e.Text,e.Text,pt],[w],[]),set_many_docs:e.Func([e.Vec(e.Tuple(e.Text,e.Text,pt))],[e.Vec(e.Tuple(e.Text,w))],[]),set_rule:e.Func([a,e.Text,Br],[],[]),upload_asset_chunk:e.Func([Mr],[kr],[]),version:e.Func([],[e.Text],["query"])})};import{Actor as Kr,HttpAgent as Wr}from"@dfinity/agent";import{nonNullish as Jr}from"@junobuild/utils";var Me=async({canisterId:e,idlFactory:t,identity:r,fetch:n,container:o,config:i})=>{let a=Jr(o)&&o!==!1,u=a?o===!0?"http://127.0.0.1:5987":o:"https://icp-api.io",p=new Wr({identity:r,host:u,...n&&{fetch:n}});return a&&await p.fetchRootKey(),Kr.createActor(t,{agent:p,canisterId:e,...i!==void 0?i:{}})};var Nt=async({satelliteId:e,...t})=>ce({canisterId:e,...t,idlFactory:bt}),A=async({satelliteId:e,...t})=>ce({canisterId:e,...t,idlFactory:xt}),Pt=async({satelliteId:e,...t})=>ce({canisterId:e,...t,idlFactory:Tt}),X=async({missionControlId:e,...t})=>ce({canisterId:e,...t,idlFactory:yt}),he=async({orbiterId:e,...t})=>ce({canisterId:e,...t,idlFactory:gt}),ce=async({canisterId:e,idlFactory:t,...r})=>{if(!e)throw new Error("No canister ID provided.");return Me({canisterId:e,idlFactory:t,...r})},Rt=vt.fromText("aaaaa-aa"),wt=(e,t,r)=>{let n=t[0],o=Rt;return n&&typeof n=="object"&&n.canister_id&&(o=vt.from(n.canister_id)),{effectiveCanisterId:o}},Vt=e=>Me({canisterId:Rt.toText(),config:{callTransform:wt,queryTransform:wt},idlFactory:_t,...e});var Y=async({actor:e,code:t})=>{let{install_code:r}=await Vt(e);return r({...t,sender_canister_version:[]})};var Ct=async({missionControl:e})=>(await X(e)).version(),St=async({missionControl:e})=>(await X(e)).get_user(),Ft=async({missionControl:e})=>(await X(e)).list_mission_control_controllers(),Ot=async({missionControl:e,satelliteIds:t,controllerIds:r,controller:n})=>(await X(e)).set_satellites_controllers(t,r,n),Et=async({missionControl:e,controllerIds:t,controller:r})=>(await X(e)).set_mission_control_controllers(t,r);import{Principal as Gr}from"@dfinity/principal";import{nonNullish as Yr,toNullable as Qr}from"@junobuild/utils";var ke=({controllerId:e,profile:t})=>({controllerIds:[Gr.fromText(e)],controller:Xr(t)}),Xr=e=>({metadata:Yr(e)&&e!==""?[["profile",e]]:[],expires_at:Qr(void 0),scope:{Admin:null}});var G=ht(ot(),1),Lt=e=>G.IDL.encode([G.IDL.Record({user:G.IDL.Principal})],[{user:e}]),Be=e=>G.IDL.encode([G.IDL.Record({controllers:G.IDL.Vec(G.IDL.Principal)})],[{controllers:e.map(([t,r])=>t)}]);var bo=async e=>Ct(e),xo=async({missionControl:e,wasm_module:t})=>{let r=await St({missionControl:e}),{missionControlId:n,...o}=e;if(!n)throw new Error("No mission control principal defined.");let i=Lt(r);await Y({actor:o,code:{canister_id:Nn.fromText(n),arg:new Uint8Array(i),wasm_module:t,mode:{upgrade:null}}})},wo=async({controllerId:e,profile:t,...r})=>Ot({...r,...ke({controllerId:e,profile:t})}),vo=async({controllerId:e,profile:t,...r})=>Et({...r,...ke({controllerId:e,profile:t})}),No=e=>Ft(e);import{Principal as Pn}from"@dfinity/principal";var er=async({orbiter:e})=>(await he(e)).version(),it=async({orbiter:e})=>(await he(e)).list_controllers(),tr=async({orbiter:e})=>{let{memory_size:t}=await he(e);return t()};var Eo=async e=>er(e),Ao=async({orbiter:e,wasm_module:t,reset:r=!1})=>{let{orbiterId:n,...o}=e;if(!n)throw new Error("No orbiter principal defined.");let i=await it({orbiter:e}),a=Be(i);await Y({actor:o,code:{canister_id:Pn.fromText(n),arg:new Uint8Array(a),wasm_module:t,mode:r?{reinstall:null}:{upgrade:null}}})},Bo=e=>tr(e),Mo=e=>it(e);import{major as rr,minor as nr,patch as or}from"semver";var Uo=({currentVersion:e,selectedVersion:t})=>{let r=rr(e),n=rr(t),o=nr(e),i=nr(t),a=or(e),u=or(t);return r<n-1||o<i-1||a<u-1?{canUpgrade:!1}:{canUpgrade:!0}};var fe=ht(ot(),1);import{Principal as Fr}from"@dfinity/principal";import{fromNullable as Fn,isNullish as On}from"@junobuild/utils";import{toNullable as Rn}from"@junobuild/utils";var ir=async({config:e,satellite:t})=>(await A(t)).set_config(e),sr=async({satellite:e,type:t})=>(await A(e)).list_rules(t),ar=async({type:e,collection:t,rule:r,satellite:n})=>(await A(n)).set_rule(e,t,r),cr=async({satellite:e})=>(await A(e)).version(),lr=async({satellite:e})=>(await Nt(e)).list_controllers(),st=async({satellite:e})=>(await Pt(e)).list_controllers(),at=async({satellite:e})=>(await A(e)).list_controllers(),ur=async({satellite:e})=>{let{list_custom_domains:t}=await A(e);return t()},dr=async({satellite:e,domainName:t,boundaryNodesId:r})=>{let{set_custom_domain:n}=await A(e);await n(t,Rn(r))},pr=async({satellite:e})=>{let{memory_size:t}=await A(e);return t()},mr=async({collection:e,satellite:t})=>{let{count_docs:r}=await A(t);return r(e)},fr=async({collection:e,satellite:t})=>{let{count_assets:r}=await A(t);return r(e)},hr=async({collection:e,satellite:t})=>{let{del_docs:r}=await A(t);return r(e)},_r=async({collection:e,satellite:t})=>{let{del_assets:r}=await A(t);return r(e)},yr=async({args:e,satellite:t})=>{let{set_controllers:r}=await A(t);return r(e)};import{fromNullable as lt,isNullish as Vn,nonNullish as ut,toNullable as Pr}from"@junobuild/utils";var gr={Db:null},Tr={Storage:null},br={Public:null},xr={Private:null},wr={Managed:null},vr={Controllers:null},ct={Heap:null},Nr={Stable:null};var dt=e=>e==="storage"?Tr:gr,Cr=({read:e,write:t,memory:r,max_size:n,updated_at:o,mutablePermissions:i})=>({read:Vr(e),write:Vr(t),memory:ut(r)?[Cn(r)]:[],updated_at:Vn(o)?[]:[o],max_size:Pr(ut(n)&&n>0?BigInt(n):void 0),mutable_permissions:Pr(i)}),Sr=([e,t])=>{let{read:r,write:n,updated_at:o,created_at:i,max_size:a,memory:u,mutable_permissions:p}=t,d=a?.[0]??0n>0n?Number(lt(a)):void 0;return{collection:e,read:Rr(r),write:Rr(n),memory:Sn(lt(u)??ct),updated_at:o,created_at:i,...ut(d)&&{max_size:d},mutablePermissions:lt(p)??!0}},Rr=e=>"Public"in e?"public":"Private"in e?"private":"Managed"in e?"managed":"controllers",Vr=e=>{switch(e){case"public":return br;case"private":return xr;case"managed":return wr;default:return vr}},Cn=e=>{switch(e){case"Stable":return Nr;default:return ct}},Sn=e=>"Stable"in e?"Stable":"Heap";var Lo=async({config:{storage:{headers:e,rewrites:t,redirects:r,iframe:n}},satellite:o})=>{let i=(e??[]).map(({source:d,headers:h})=>[d,h]),a=(t??[]).map(({source:d,destination:h})=>[d,h]),u=(r??[]).map(({source:d,location:h,code:g})=>[d,{status_code:g,location:h}]);return ir({satellite:o,config:{storage:{headers:i,rewrites:a,redirects:[u],iframe:[n==="same-origin"?{SameOrigin:null}:n==="allow-any"?{AllowAny:null}:{Deny:null}]}}})},ei=async({type:e,satellite:t})=>(await sr({satellite:t,type:dt(e)})).map(n=>Sr(n)),ti=async({rule:{collection:e,...t},type:r,satellite:n})=>ar({type:dt(r),rule:Cr(t),satellite:n,collection:e}),ri=async e=>cr(e),ni=async({satellite:e,wasm_module:t,deprecated:r,deprecatedNoScope:n,reset:o=!1})=>{let{satelliteId:i,...a}=e;if(On(i))throw new Error("No satellite principal defined.");if(r){let h=await lr({satellite:e}),g=fe.IDL.encode([fe.IDL.Record({controllers:fe.IDL.Vec(fe.IDL.Principal)})],[{controllers:h}]);await Y({actor:a,code:{canister_id:Fr.fromText(i),arg:new Uint8Array(g),wasm_module:t,mode:o?{reinstall:null}:{upgrade:null}}});return}let p=await(n?st:at)({satellite:e}),d=Be(p);await Y({actor:a,code:{canister_id:Fr.fromText(i),arg:new Uint8Array(d),wasm_module:t,mode:o?{reinstall:null}:{upgrade:null}}})},oi=async({satellite:e})=>(await ur({satellite:e})).map(([r,n])=>({domain:r,bn_id:Fn(n.bn_id),created_at:n.created_at,updated_at:n.updated_at})),ii=async({satellite:e,domains:t})=>Promise.all(t.map(({domain:r,bn_id:n})=>dr({satellite:e,domainName:r,boundaryNodesId:n}))),si=e=>pr(e),ai=async e=>mr(e),ci=async e=>hr(e),li=async e=>fr(e),ui=async e=>_r(e),di=({deprecatedNoScope:e,...t})=>(e===!0?st:at)(t),pi=e=>yr(e);export{Uo as checkUpgradeVersion,li as countAssets,ai as countDocs,ui as deleteAssets,ci as deleteDocs,oi as listCustomDomains,No as listMissionControlControllers,Mo as listOrbiterControllers,ei as listRules,di as listSatelliteControllers,bo as missionControlVersion,Bo as orbiterMemorySize,Eo as orbiterVersion,si as satelliteMemorySize,ri as satelliteVersion,Lo as setConfig,ii as setCustomDomains,vo as setMissionControlController,ti as setRule,pi as setSatelliteControllers,wo as setSatellitesController,xo as upgradeMissionControl,Ao as upgradeOrbiter,ni as upgradeSatellite};
15
+ `)}return p.encodeValue(u)}));return(0,_.concat)(n,o,i,a,d)}s.encode=yn;function gn(e,t){let r=new _.PipeArrayBuffer(t);if(t.byteLength<Te.length)throw new Error("Message length smaller than magic number");let n=(0,c.safeRead)(r,Te.length),o=new TextDecoder().decode(n);if(o!==Te)throw new Error("Wrong magic number: "+JSON.stringify(o));function i(l){let m=[],y=Number((0,c.lebDecode)(l));for(let g=0;g<y;g++){let P=Number((0,c.slebDecode)(l));switch(P){case-18:case-19:{let N=Number((0,c.slebDecode)(l));m.push([P,N]);break}case-20:case-21:{let N=[],R=Number((0,c.lebDecode)(l)),V;for(;R--;){let O=Number((0,c.lebDecode)(l));if(O>=Math.pow(2,32))throw new Error("field id out of 32-bit range");if(typeof V=="number"&&V>=O)throw new Error("field id collision or not sorted");V=O;let F=Number((0,c.slebDecode)(l));N.push([O,F])}m.push([P,N]);break}case-22:{let N=[],R=Number((0,c.lebDecode)(l));for(;R--;)N.push(Number((0,c.slebDecode)(l)));let V=[],O=Number((0,c.lebDecode)(l));for(;O--;)V.push(Number((0,c.slebDecode)(l)));let F=[],k=Number((0,c.lebDecode)(l));for(;k--;)switch(Number((0,c.lebDecode)(l))){case 1:{F.push("query");break}case 2:{F.push("oneway");break}case 3:{F.push("composite_query");break}default:throw new Error("unknown annotation")}m.push([P,[N,V,F]]);break}case-23:{let N=Number((0,c.lebDecode)(l)),R=[];for(;N--;){let V=Number((0,c.lebDecode)(l)),O=new TextDecoder().decode((0,c.safeRead)(l,V)),F=(0,c.slebDecode)(l);R.push([O,F])}m.push([P,R]);break}default:throw new Error("Illegal op_code: "+P)}}let x=[],b=Number((0,c.lebDecode)(l));for(let g=0;g<b;g++)x.push(Number((0,c.slebDecode)(l)));return[m,x]}let[a,d]=i(r);if(d.length<e.length)throw new Error("Wrong number of return values");let p=a.map(l=>Yt());function u(l){if(l<-24)throw new Error("future value not supported");if(l<0)switch(l){case-1:return s.Null;case-2:return s.Bool;case-3:return s.Nat;case-4:return s.Int;case-5:return s.Nat8;case-6:return s.Nat16;case-7:return s.Nat32;case-8:return s.Nat64;case-9:return s.Int8;case-10:return s.Int16;case-11:return s.Int32;case-12:return s.Int64;case-13:return s.Float32;case-14:return s.Float64;case-15:return s.Text;case-16:return s.Reserved;case-17:return s.Empty;case-24:return s.Principal;default:throw new Error("Illegal op_code: "+l)}if(l>=a.length)throw new Error("type index out of range");return p[l]}function h(l){switch(l[0]){case-19:{let m=u(l[1]);return Kt(m)}case-18:{let m=u(l[1]);return Wt(m)}case-20:{let m={};for(let[b,g]of l[1]){let P=`_${b}_`;m[P]=u(g)}let y=Jt(m),x=y.tryAsTuple();return Array.isArray(x)?Ht(...x):y}case-21:{let m={};for(let[y,x]of l[1]){let b=`_${y}_`;m[b]=u(x)}return Gt(m)}case-22:{let[m,y,x]=l[1];return Qt(m.map(b=>u(b)),y.map(b=>u(b)),x)}case-23:{let m={},y=l[1];for(let[x,b]of y){let g=u(b);if(g instanceof W&&(g=g.getType()),!(g instanceof pe))throw new Error("Illegal service definition: services can only contain functions");m[x]=g}return Xt(m)}default:throw new Error("Illegal op_code: "+l[0])}}a.forEach((l,m)=>{if(l[0]===-22){let y=h(l);p[m].fill(y)}}),a.forEach((l,m)=>{if(l[0]!==-22){let y=h(l);p[m].fill(y)}});let T=d.map(l=>u(l)),S=e.map((l,m)=>l.decodeValue(r,T[m]));for(let l=e.length;l<T.length;l++)T[l].decodeValue(r,T[l]);if(r.byteLength>0)throw new Error("decode: Left-over bytes");return S}s.decode=gn;s.Empty=new be;s.Reserved=new ee;s.Unknown=new xe;s.Bool=new we;s.Null=new ve;s.Text=new Ne;s.Int=new Pe;s.Nat=new Ve;s.Float32=new ue(32);s.Float64=new ue(64);s.Int8=new H(8);s.Int16=new H(16);s.Int32=new H(32);s.Int64=new H(64);s.Nat8=new U(8);s.Nat16=new U(16);s.Nat32=new U(32);s.Nat64=new U(64);s.Principal=new Fe;function Ht(...e){return new Ce(e)}s.Tuple=Ht;function Kt(e){return new Re(e)}s.Vec=Kt;function Wt(e){return new te(e)}s.Opt=Wt;function Jt(e){return new de(e)}s.Record=Jt;function Gt(e){return new Se(e)}s.Variant=Gt;function Yt(){return new W}s.Rec=Yt;function Qt(e,t,r=[]){return new pe(e,t,r)}s.Func=Qt;function Xt(e){return new Oe(e)}s.Service=Xt});var Le=z(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});E.VecForm=E.OptionForm=E.VariantForm=E.TupleForm=E.RecordForm=E.InputForm=E.InputBox=void 0;var Ye=class{constructor(t,r){this.idl=t,this.ui=r,this.label=null,this.value=void 0;let n=document.createElement("span");n.className="status",this.status=n,r.input&&(r.input.addEventListener("blur",()=>{r.input.value!==""&&this.parse()}),r.input.addEventListener("input",()=>{n.style.display="none",r.input.classList.remove("reject")}))}isRejected(){return this.value===void 0}parse(t={}){if(this.ui.form){let r=this.ui.form.parse(t);return this.value=r,r}if(this.ui.input){let r=this.ui.input;try{let n=this.ui.parse(this.idl,t,r.value);if(!this.idl.covariant(n))throw new Error(`${r.value} is not of type ${this.idl.display()}`);return this.status.style.display="none",this.value=n,n}catch(n){r.classList.add("reject"),this.status.style.display="block",this.status.innerHTML="InputError: "+n.message,this.value=void 0;return}}return null}render(t){let r=document.createElement("span");if(this.label){let n=document.createElement("label");n.innerText=this.label,r.appendChild(n)}this.ui.input&&(r.appendChild(this.ui.input),r.appendChild(this.status)),this.ui.form&&this.ui.form.render(r),t.appendChild(r)}};E.InputBox=Ye;var J=class{constructor(t){this.ui=t,this.form=[]}renderForm(t){this.ui.container?(this.form.forEach(r=>r.render(this.ui.container)),t.appendChild(this.ui.container)):this.form.forEach(r=>r.render(t))}render(t){if(this.ui.open&&this.ui.event){t.appendChild(this.ui.open);let r=this;r.ui.open.addEventListener(r.ui.event,()=>{if(r.ui.container)r.ui.container.innerHTML="";else{let n=r.ui.open.nextElementSibling;n&&n.parentNode.removeChild(n)}r.generateForm(),r.renderForm(t)})}else this.generateForm(),this.renderForm(t)}};E.InputForm=J;var Qe=class extends J{constructor(t,r){super(r),this.fields=t,this.ui=r}generateForm(){this.form=this.fields.map(([t,r])=>{let n=this.ui.render(r);return this.ui.labelMap&&this.ui.labelMap.hasOwnProperty(t)?n.label=this.ui.labelMap[t]+" ":n.label=t+" ",n})}parse(t){let r={};if(this.fields.forEach(([n,o],i)=>{let a=this.form[i].parse(t);r[n]=a}),!this.form.some(n=>n.isRejected()))return r}};E.RecordForm=Qe;var Xe=class extends J{constructor(t,r){super(r),this.components=t,this.ui=r}generateForm(){this.form=this.components.map(t=>this.ui.render(t))}parse(t){let r=[];if(this.components.forEach((n,o)=>{let i=this.form[o].parse(t);r.push(i)}),!this.form.some(n=>n.isRejected()))return r}};E.TupleForm=Xe;var Ze=class extends J{constructor(t,r){super(r),this.fields=t,this.ui=r}generateForm(){let t=this.ui.open.selectedIndex,[r,n]=this.fields[t],o=this.ui.render(n);this.form=[o]}parse(t){let r=this.ui.open,n=r.options[r.selectedIndex].value,o=this.form[0].parse(t);if(o===void 0)return;let i={};return i[n]=o,i}};E.VariantForm=Ze;var Ie=class extends J{constructor(t,r){super(r),this.ty=t,this.ui=r}generateForm(){if(this.ui.open.checked){let t=this.ui.render(this.ty);this.form=[t]}else this.form=[]}parse(t){if(this.form.length===0)return[];{let r=this.form[0].parse(t);return r===void 0?void 0:[r]}}};E.OptionForm=Ie;var De=class extends J{constructor(t,r){super(r),this.ty=t,this.ui=r}generateForm(){let t=+this.ui.open.value;this.form=[];for(let r=0;r<t;r++){let n=this.ui.render(this.ty);this.form.push(n)}}parse(t){let r=this.form.map(n=>n.parse(t));if(!this.form.some(n=>n.isRejected()))return r}};E.VecForm=De});var It=z(f=>{"use strict";var Tn=f&&f.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),bn=f&&f.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Zt=f&&f.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Tn(t,e,r);return bn(t,e),t};Object.defineProperty(f,"__esModule",{value:!0});f.renderValue=f.renderInput=f.Render=f.vecForm=f.optForm=f.variantForm=f.tupleForm=f.recordForm=f.inputBox=void 0;var Ae=Zt(Ge()),et=ht("@dfinity/principal"),re=Zt(Le()),xn={parse:Cn},me={render:ot},wn=(e,t)=>new re.InputBox(e,Object.assign(Object.assign({},xn),t));f.inputBox=wn;var vn=(e,t)=>new re.RecordForm(e,Object.assign(Object.assign({},me),t));f.recordForm=vn;var Nn=(e,t)=>new re.TupleForm(e,Object.assign(Object.assign({},me),t));f.tupleForm=Nn;var Pn=(e,t)=>new re.VariantForm(e,Object.assign(Object.assign({},me),t));f.variantForm=Pn;var Vn=(e,t)=>new re.OptionForm(e,Object.assign(Object.assign({},me),t));f.optForm=Vn;var Rn=(e,t)=>new re.VecForm(e,Object.assign(Object.assign({},me),t));f.vecForm=Rn;var Ee=class extends Ae.Visitor{visitType(t,r){let n=document.createElement("input");return n.classList.add("argument"),n.placeholder=t.display(),(0,f.inputBox)(t,{input:n})}visitNull(t,r){return(0,f.inputBox)(t,{})}visitRecord(t,r,n){let o={};if(r.length>1){let a=document.createElement("div");a.classList.add("popup-form"),o={container:a}}let i=(0,f.recordForm)(r,o);return(0,f.inputBox)(t,{form:i})}visitTuple(t,r,n){let o={};if(r.length>1){let a=document.createElement("div");a.classList.add("popup-form"),o={container:a}}let i=(0,f.tupleForm)(r,o);return(0,f.inputBox)(t,{form:i})}visitVariant(t,r,n){let o=document.createElement("select");for(let[d,p]of r){let u=new Option(d);o.add(u)}o.selectedIndex=-1,o.classList.add("open");let i={open:o,event:"change"},a=(0,f.variantForm)(r,i);return(0,f.inputBox)(t,{form:a})}visitOpt(t,r,n){let o=document.createElement("input");o.type="checkbox",o.classList.add("open");let i=(0,f.optForm)(r,{open:o,event:"change"});return(0,f.inputBox)(t,{form:i})}visitVec(t,r,n){let o=document.createElement("input");o.type="number",o.min="0",o.max="100",o.style.width="8rem",o.placeholder="len",o.classList.add("open");let i=document.createElement("div");i.classList.add("popup-form");let a=(0,f.vecForm)(r,{open:o,event:"change",container:i});return(0,f.inputBox)(t,{form:a})}visitRec(t,r,n){return ot(r)}};f.Render=Ee;var tt=class extends Ae.Visitor{visitNull(t,r){return null}visitBool(t,r){if(r==="true")return!0;if(r==="false")return!1;throw new Error(`Cannot parse ${r} as boolean`)}visitText(t,r){return r}visitFloat(t,r){return parseFloat(r)}visitFixedInt(t,r){return t._bits<=32?parseInt(r,10):BigInt(r)}visitFixedNat(t,r){return t._bits<=32?parseInt(r,10):BigInt(r)}visitNumber(t,r){return BigInt(r)}visitPrincipal(t,r){return et.Principal.fromText(r)}visitService(t,r){return et.Principal.fromText(r)}visitFunc(t,r){let n=r.split(".",2);return[et.Principal.fromText(n[0]),n[1]]}},rt=class extends Ae.Visitor{visitNull(t,r){return null}visitBool(t,r){return Math.random()<.5}visitText(t,r){return Math.random().toString(36).substring(6)}visitFloat(t,r){return Math.random()}visitInt(t,r){return BigInt(this.generateNumber(!0))}visitNat(t,r){return BigInt(this.generateNumber(!1))}visitFixedInt(t,r){let n=this.generateNumber(!0);return t._bits<=32?n:BigInt(r)}visitFixedNat(t,r){let n=this.generateNumber(!1);return t._bits<=32?n:BigInt(r)}generateNumber(t){let r=Math.floor(Math.random()*100);return t&&Math.random()<.5?-r:r}};function Cn(e,t,r){return t.random&&r===""?e.accept(new rt,r):e.accept(new tt,r)}function ot(e){return e.accept(new Ee,null)}f.renderInput=ot;function X(e,t,r){return e.accept(new nt,{input:t,value:r})}f.renderValue=X;var nt=class extends Ae.Visitor{visitType(t,r){r.input.ui.input.value=t.valueToString(r.value)}visitNull(t,r){}visitText(t,r){r.input.ui.input.value=r.value}visitRec(t,r,n){X(r,n.input,n.value)}visitOpt(t,r,n){if(n.value.length!==0){let o=n.input.ui.form,i=o.ui.open;i.checked=!0,i.dispatchEvent(new Event(o.ui.event)),X(r,o.form[0],n.value[0])}}visitRecord(t,r,n){let o=n.input.ui.form;r.forEach(([i,a],d)=>{X(a,o.form[d],n.value[i])})}visitTuple(t,r,n){let o=n.input.ui.form;r.forEach((i,a)=>{X(i,o.form[a],n.value[a])})}visitVariant(t,r,n){let o=n.input.ui.form,i=Object.entries(n.value)[0];r.forEach(([a,d],p)=>{if(a===i[0]){let u=o.ui.open;u.selectedIndex=p,u.dispatchEvent(new Event(o.ui.event)),X(d,o.form[0],i[1])}})}visitVec(t,r,n){let o=n.input.ui.form,i=n.value.length,a=o.ui.open;a.value=i,a.dispatchEvent(new Event(o.ui.event)),n.value.forEach((d,p)=>{X(r,o.form[p],d)})}}});var Lt=z(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0})});var it=z(C=>{"use strict";var er=C&&C.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Sn=C&&C.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ne=C&&C.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&er(t,e,r)},Fn=C&&C.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&er(t,e,r);return Sn(t,e),t};Object.defineProperty(C,"__esModule",{value:!0});C.IDL=void 0;ne(It(),C);ne(Le(),C);C.IDL=Fn(Ge());ne(Ue(),C);ne(ze(),C);ne(_e(),C);ne(Lt(),C)});import{Principal as On}from"@dfinity/principal";import{CanisterStatus as Zr}from"@dfinity/agent";import{Principal as Ir}from"@dfinity/principal";import{assertNonNullish as Dr}from"@junobuild/utils";import{Actor as Gr,HttpAgent as Yr}from"@dfinity/agent";import{nonNullish as Qr}from"@junobuild/utils";var Me=async({canisterId:e,idlFactory:t,config:r,...n})=>{let o=await ke(n);return Gr.createActor(t,{agent:o,canisterId:e,...r!==void 0?r:{}})},ke=async({identity:e,fetch:t,container:r})=>{let n=Qr(r)&&r!==!1,o=n?r===!0?"http://127.0.0.1:5987":r:"https://icp-api.io",i=new Yr({identity:e,host:o,...t&&{fetch:t}});return n&&await i.fetchRootKey(),i};import{Principal as Nt}from"@dfinity/principal";import{isNullish as Xr}from"@junobuild/utils";var yt=({IDL:e})=>{let t=e.Variant({mainnet:e.Null,testnet:e.Null}),r=e.Text,n=e.Record({network:t,address:r,min_confirmations:e.Opt(e.Nat32)}),o=e.Nat64,i=e.Record({network:t}),a=e.Nat64,d=e.Record({network:t,filter:e.Opt(e.Variant({page:e.Vec(e.Nat8),min_confirmations:e.Nat32})),address:r}),p=e.Vec(e.Nat8),u=e.Record({txid:e.Vec(e.Nat8),vout:e.Nat32}),h=e.Record({height:e.Nat32,value:o,outpoint:u}),T=e.Record({next_page:e.Opt(e.Vec(e.Nat8)),tip_height:e.Nat32,tip_block_hash:p,utxos:e.Vec(h)}),S=e.Record({transaction:e.Vec(e.Nat8),network:t}),l=e.Principal,m=e.Variant({from_user:e.Record({user_id:e.Principal}),from_canister:e.Record({canister_version:e.Opt(e.Nat64),canister_id:e.Principal})}),y=e.Variant({creation:e.Record({controllers:e.Vec(e.Principal)}),code_deployment:e.Record({mode:e.Variant({reinstall:e.Null,upgrade:e.Null,install:e.Null}),module_hash:e.Vec(e.Nat8)}),controllers_change:e.Record({controllers:e.Vec(e.Principal)}),code_uninstall:e.Null}),x=e.Record({timestamp_nanos:e.Nat64,canister_version:e.Nat64,origin:m,details:y}),b=e.Record({freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),g=e.Record({freezing_threshold:e.Opt(e.Nat),controllers:e.Opt(e.Vec(e.Principal)),memory_allocation:e.Opt(e.Nat),compute_allocation:e.Opt(e.Nat)}),P=e.Variant({secp256k1:e.Null}),N=e.Record({value:e.Text,name:e.Text}),R=e.Record({status:e.Nat,body:e.Vec(e.Nat8),headers:e.Vec(N)}),V=e.Vec(e.Nat8);return e.Service({bitcoin_get_balance:e.Func([n],[o],[]),bitcoin_get_current_fee_percentiles:e.Func([i],[e.Vec(a)],[]),bitcoin_get_utxos:e.Func([d],[T],[]),bitcoin_send_transaction:e.Func([S],[],[]),canister_info:e.Func([e.Record({canister_id:l,num_requested_changes:e.Opt(e.Nat64)})],[e.Record({controllers:e.Vec(e.Principal),module_hash:e.Opt(e.Vec(e.Nat8)),recent_changes:e.Vec(x),total_num_changes:e.Nat64})],[]),canister_status:e.Func([e.Record({canister_id:l})],[e.Record({status:e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),memory_size:e.Nat,cycles:e.Nat,settings:b,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))})],[]),create_canister:e.Func([e.Record({settings:e.Opt(g),sender_canister_version:e.Opt(e.Nat64)})],[e.Record({canister_id:l})],[]),delete_canister:e.Func([e.Record({canister_id:l})],[],[]),deposit_cycles:e.Func([e.Record({canister_id:l})],[],[]),ecdsa_public_key:e.Func([e.Record({key_id:e.Record({name:e.Text,curve:P}),canister_id:e.Opt(l),derivation_path:e.Vec(e.Vec(e.Nat8))})],[e.Record({public_key:e.Vec(e.Nat8),chain_code:e.Vec(e.Nat8)})],[]),http_request:e.Func([e.Record({url:e.Text,method:e.Variant({get:e.Null,head:e.Null,post:e.Null}),max_response_bytes:e.Opt(e.Nat64),body:e.Opt(e.Vec(e.Nat8)),transform:e.Opt(e.Record({function:e.Func([e.Record({context:e.Vec(e.Nat8),response:R})],[R],["query"]),context:e.Vec(e.Nat8)})),headers:e.Vec(N)})],[R],[]),install_code:e.Func([e.Record({arg:e.Vec(e.Nat8),wasm_module:V,mode:e.Variant({reinstall:e.Null,upgrade:e.Null,install:e.Null}),canister_id:l,sender_canister_version:e.Opt(e.Nat64)})],[],[]),provisional_create_canister_with_cycles:e.Func([e.Record({settings:e.Opt(g),specified_id:e.Opt(l),amount:e.Opt(e.Nat)})],[e.Record({canister_id:l})],[]),provisional_top_up_canister:e.Func([e.Record({canister_id:l,amount:e.Nat})],[],[]),raw_rand:e.Func([],[e.Vec(e.Nat8)],[]),sign_with_ecdsa:e.Func([e.Record({key_id:e.Record({name:e.Text,curve:P}),derivation_path:e.Vec(e.Vec(e.Nat8)),message_hash:e.Vec(e.Nat8)})],[e.Record({signature:e.Vec(e.Nat8)})],[]),start_canister:e.Func([e.Record({canister_id:l})],[],[]),stop_canister:e.Func([e.Record({canister_id:l})],[],[]),uninstall_code:e.Func([e.Record({canister_id:l,sender_canister_version:e.Opt(e.Nat64)})],[],[]),update_settings:e.Func([e.Record({canister_id:e.Principal,settings:g,sender_canister_version:e.Opt(e.Nat64)})],[],[])})};var gt=({IDL:e})=>{let t=e.Record({updated_at:e.Nat64,orbiter_id:e.Principal,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64}),r=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,satellite_id:e.Principal}),n=e.Record({cycles:e.Nat,destination_id:e.Principal}),o=e.Variant({Write:e.Null,Admin:e.Null}),i=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,scope:o,expires_at:e.Opt(e.Nat64)}),a=e.Variant({stopped:e.Null,stopping:e.Null,running:e.Null}),d=e.Record({freezing_threshold:e.Nat,controllers:e.Vec(e.Principal),memory_allocation:e.Nat,compute_allocation:e.Nat}),p=e.Record({status:a,memory_size:e.Nat,cycles:e.Nat,settings:d,idle_cycles_burned_per_day:e.Nat,module_hash:e.Opt(e.Vec(e.Nat8))}),u=e.Record({id:e.Principal,status:p,metadata:e.Opt(e.Vec(e.Tuple(e.Text,e.Text))),status_at:e.Nat64}),h=e.Variant({Ok:u,Err:e.Text}),T=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),scope:o,expires_at:e.Opt(e.Nat64)}),S=e.Record({enabled:e.Bool,cycles_threshold:e.Opt(e.Nat64)}),l=e.Record({mission_control_cycles_threshold:e.Opt(e.Nat64),orbiters:e.Vec(e.Tuple(e.Principal,S)),satellites:e.Vec(e.Tuple(e.Principal,S)),cycles_threshold:e.Opt(e.Nat64)}),m=e.Record({orbiters:e.Opt(e.Vec(h)),satellites:e.Opt(e.Vec(h)),mission_control:h}),y=e.Record({e8s:e.Nat64});return e.Service({add_mission_control_controllers:e.Func([e.Vec(e.Principal)],[],[]),add_satellites_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal)],[],[]),create_orbiter:e.Func([e.Opt(e.Text)],[t],[]),create_satellite:e.Func([e.Text],[r],[]),del_mission_control_controllers:e.Func([e.Vec(e.Principal)],[],[]),del_orbiter:e.Func([e.Principal,e.Nat],[],[]),del_orbiters_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal)],[],[]),del_satellite:e.Func([e.Principal,e.Nat],[],[]),del_satellites_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal)],[],[]),deposit_cycles:e.Func([n],[],[]),get_user:e.Func([],[e.Principal],["query"]),list_mission_control_controllers:e.Func([],[e.Vec(e.Tuple(e.Principal,i))],["query"]),list_mission_control_statuses:e.Func([],[e.Vec(e.Tuple(e.Nat64,h))],["query"]),list_orbiter_statuses:e.Func([e.Principal],[e.Opt(e.Vec(e.Tuple(e.Nat64,h)))],["query"]),list_orbiters:e.Func([],[e.Vec(e.Tuple(e.Principal,t))],["query"]),list_satellite_statuses:e.Func([e.Principal],[e.Opt(e.Vec(e.Tuple(e.Nat64,h)))],["query"]),list_satellites:e.Func([],[e.Vec(e.Tuple(e.Principal,r))],["query"]),remove_mission_control_controllers:e.Func([e.Vec(e.Principal)],[],[]),remove_satellites_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal)],[],[]),set_metadata:e.Func([e.Vec(e.Tuple(e.Text,e.Text))],[],[]),set_mission_control_controllers:e.Func([e.Vec(e.Principal),T],[],[]),set_orbiter:e.Func([e.Principal,e.Opt(e.Text)],[t],[]),set_orbiter_metadata:e.Func([e.Principal,e.Vec(e.Tuple(e.Text,e.Text))],[t],[]),set_orbiters_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal),T],[],[]),set_satellite_metadata:e.Func([e.Principal,e.Vec(e.Tuple(e.Text,e.Text))],[r],[]),set_satellites_controllers:e.Func([e.Vec(e.Principal),e.Vec(e.Principal),T],[],[]),status:e.Func([l],[m],[]),top_up:e.Func([e.Principal,y],[],[]),version:e.Func([],[e.Text],["query"])})};var Tt=({IDL:e})=>{let t=e.Record({controllers:e.Vec(e.Principal)}),r=e.Variant({Write:e.Null,Admin:e.Null}),n=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,scope:r,expires_at:e.Opt(e.Nat64)}),o=e.Record({updated_at:e.Opt(e.Nat64)}),i=e.Record({cycles:e.Nat,destination_id:e.Principal}),a=e.Record({to:e.Opt(e.Nat64),from:e.Opt(e.Nat64),satellite_id:e.Opt(e.Principal)}),d=e.Record({key:e.Text,collected_at:e.Nat64}),p=e.Record({inner_height:e.Nat16,inner_width:e.Nat16}),u=e.Record({title:e.Text,updated_at:e.Nat64,referrer:e.Opt(e.Text),time_zone:e.Text,session_id:e.Text,href:e.Text,created_at:e.Nat64,satellite_id:e.Principal,device:p,user_agent:e.Opt(e.Text)}),h=e.Record({safari:e.Float64,opera:e.Float64,others:e.Float64,firefox:e.Float64,chrome:e.Float64}),T=e.Record({desktop:e.Float64,others:e.Float64,mobile:e.Float64}),S=e.Record({browsers:h,devices:T}),l=e.Record({day:e.Nat8,month:e.Nat8,year:e.Int32}),m=e.Record({bounce_rate:e.Float64,average_page_views_per_session:e.Float64,daily_total_page_views:e.Vec(e.Tuple(l,e.Nat32)),total_page_views:e.Nat32,unique_page_views:e.Nat64,unique_sessions:e.Nat64}),y=e.Record({referrers:e.Vec(e.Tuple(e.Text,e.Nat32)),pages:e.Vec(e.Tuple(e.Text,e.Nat32))}),x=e.Record({updated_at:e.Nat64,session_id:e.Text,metadata:e.Opt(e.Vec(e.Tuple(e.Text,e.Text))),name:e.Text,created_at:e.Nat64,satellite_id:e.Principal}),b=e.Record({total:e.Vec(e.Tuple(e.Text,e.Nat32))}),g=e.Record({updated_at:e.Nat64,created_at:e.Nat64,enabled:e.Bool}),P=e.Record({stable:e.Nat64,heap:e.Nat64}),N=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),scope:r,expires_at:e.Opt(e.Nat64)}),R=e.Record({controller:N,controllers:e.Vec(e.Principal)}),V=e.Record({title:e.Text,updated_at:e.Opt(e.Nat64),referrer:e.Opt(e.Text),time_zone:e.Text,session_id:e.Text,href:e.Text,satellite_id:e.Principal,device:p,user_agent:e.Opt(e.Text)}),O=e.Variant({Ok:u,Err:e.Text}),F=e.Variant({Ok:e.Null,Err:e.Vec(e.Tuple(d,e.Text))}),k=e.Record({updated_at:e.Opt(e.Nat64),enabled:e.Bool}),A=e.Record({updated_at:e.Opt(e.Nat64),session_id:e.Text,metadata:e.Opt(e.Vec(e.Tuple(e.Text,e.Text))),name:e.Text,satellite_id:e.Principal,user_agent:e.Opt(e.Text)}),Y=e.Variant({Ok:x,Err:e.Text});return e.Service({del_controllers:e.Func([t],[e.Vec(e.Tuple(e.Principal,n))],[]),del_satellite_config:e.Func([e.Principal,o],[],[]),deposit_cycles:e.Func([i],[],[]),get_page_views:e.Func([a],[e.Vec(e.Tuple(d,u))],["query"]),get_page_views_analytics_clients:e.Func([a],[S],["query"]),get_page_views_analytics_metrics:e.Func([a],[m],["query"]),get_page_views_analytics_top_10:e.Func([a],[y],["query"]),get_track_events:e.Func([a],[e.Vec(e.Tuple(d,x))],["query"]),get_track_events_analytics:e.Func([a],[b],["query"]),list_controllers:e.Func([],[e.Vec(e.Tuple(e.Principal,n))],["query"]),list_satellite_configs:e.Func([],[e.Vec(e.Tuple(e.Principal,g))],["query"]),memory_size:e.Func([],[P],["query"]),set_controllers:e.Func([R],[e.Vec(e.Tuple(e.Principal,n))],[]),set_page_view:e.Func([d,V],[O],[]),set_page_views:e.Func([e.Vec(e.Tuple(d,V))],[F],[]),set_satellite_configs:e.Func([e.Vec(e.Tuple(e.Principal,k))],[e.Vec(e.Tuple(e.Principal,g))],[]),set_track_event:e.Func([d,A],[Y],[]),set_track_events:e.Func([e.Vec(e.Tuple(d,A))],[F],[]),version:e.Func([],[e.Text],["query"])})};var bt=({IDL:e})=>{let t=e.Record({batch_id:e.Nat,headers:e.Vec(e.Tuple(e.Text,e.Text)),chunk_ids:e.Vec(e.Nat)}),r=e.Record({controllers:e.Vec(e.Principal)}),n=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,expires_at:e.Opt(e.Nat64)}),o=e.Record({updated_at:e.Opt(e.Nat64)}),i=e.Record({headers:e.Vec(e.Tuple(e.Text,e.Vec(e.Tuple(e.Text,e.Text))))}),a=e.Record({storage:i}),d=e.Record({updated_at:e.Nat64,owner:e.Principal,data:e.Vec(e.Nat8),created_at:e.Nat64}),p=e.Record({url:e.Text,method:e.Text,body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text))}),u=e.Record({token:e.Opt(e.Text),sha256:e.Opt(e.Vec(e.Nat8)),headers:e.Vec(e.Tuple(e.Text,e.Text)),index:e.Nat64,encoding_type:e.Text,full_path:e.Text}),h=e.Variant({Callback:e.Record({token:u,callback:e.Func([],[],[])})}),T=e.Record({body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text)),streaming_strategy:e.Opt(h),status_code:e.Nat16}),S=e.Record({token:e.Opt(u),body:e.Vec(e.Nat8)}),l=e.Record({token:e.Opt(e.Text),collection:e.Text,name:e.Text,encoding_type:e.Opt(e.Text),full_path:e.Text}),m=e.Record({batch_id:e.Nat}),y=e.Variant({UpdatedAt:e.Null,Keys:e.Null,CreatedAt:e.Null}),x=e.Record({field:y,desc:e.Bool}),b=e.Record({start_after:e.Opt(e.Text),limit:e.Opt(e.Nat64)}),g=e.Record({order:e.Opt(x),owner:e.Opt(e.Principal),matcher:e.Opt(e.Text),paginate:e.Opt(b)}),P=e.Record({token:e.Opt(e.Text),collection:e.Text,owner:e.Principal,name:e.Text,full_path:e.Text}),N=e.Record({modified:e.Nat64,sha256:e.Vec(e.Nat8),total_length:e.Nat}),R=e.Record({key:P,updated_at:e.Nat64,encodings:e.Vec(e.Tuple(e.Text,N)),headers:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64}),V=e.Record({matches_length:e.Nat64,length:e.Nat64,items:e.Vec(e.Tuple(e.Text,R))}),O=e.Record({updated_at:e.Nat64,created_at:e.Nat64,bn_id:e.Opt(e.Text)}),F=e.Record({matches_length:e.Nat64,length:e.Nat64,items:e.Vec(e.Tuple(e.Text,d))}),k=e.Variant({Db:e.Null,Storage:e.Null}),A=e.Variant({Controllers:e.Null,Private:e.Null,Public:e.Null,Managed:e.Null}),Y=e.Record({updated_at:e.Nat64,max_size:e.Opt(e.Nat),read:A,created_at:e.Nat64,write:A}),Z=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),expires_at:e.Opt(e.Nat64)}),oe=e.Record({controller:Z,controllers:e.Vec(e.Principal)}),ie=e.Record({updated_at:e.Opt(e.Nat64),data:e.Vec(e.Nat8)}),se=e.Record({updated_at:e.Opt(e.Nat64),max_size:e.Opt(e.Nat),read:A,write:A}),K=e.Record({content:e.Vec(e.Nat8),batch_id:e.Nat}),ae=e.Record({chunk_id:e.Nat});return e.Service({commit_asset_upload:e.Func([t],[],[]),del_asset:e.Func([e.Text,e.Text],[],[]),del_assets:e.Func([e.Opt(e.Text)],[],[]),del_controllers:e.Func([r],[e.Vec(e.Tuple(e.Principal,n))],[]),del_custom_domain:e.Func([e.Text],[],[]),del_doc:e.Func([e.Text,e.Text,o],[],[]),get_config:e.Func([],[a],[]),get_doc:e.Func([e.Text,e.Text],[e.Opt(d)],["query"]),http_request:e.Func([p],[T],["query"]),http_request_streaming_callback:e.Func([u],[S],["query"]),init_asset_upload:e.Func([l],[m],[]),list_assets:e.Func([e.Opt(e.Text),g],[V],["query"]),list_controllers:e.Func([],[e.Vec(e.Tuple(e.Principal,n))],["query"]),list_custom_domains:e.Func([],[e.Vec(e.Tuple(e.Text,O))],["query"]),list_docs:e.Func([e.Text,g],[F],["query"]),list_rules:e.Func([k],[e.Vec(e.Tuple(e.Text,Y))],["query"]),set_config:e.Func([a],[],[]),set_controllers:e.Func([oe],[e.Vec(e.Tuple(e.Principal,n))],[]),set_custom_domain:e.Func([e.Text,e.Opt(e.Text)],[],[]),set_doc:e.Func([e.Text,e.Text,ie],[d],[]),set_rule:e.Func([k,e.Text,se],[],[]),upload_asset_chunk:e.Func([K],[ae],[]),version:e.Func([],[e.Text],["query"])})};var xt=({IDL:e})=>{let t=e.Record({batch_id:e.Nat,headers:e.Vec(e.Tuple(e.Text,e.Text)),chunk_ids:e.Vec(e.Nat)}),r=e.Record({controllers:e.Vec(e.Principal)}),n=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,expires_at:e.Opt(e.Nat64)}),o=e.Record({updated_at:e.Opt(e.Nat64)}),i=e.Record({headers:e.Vec(e.Tuple(e.Text,e.Vec(e.Tuple(e.Text,e.Text))))}),a=e.Record({storage:i}),d=e.Record({updated_at:e.Nat64,owner:e.Principal,data:e.Vec(e.Nat8),created_at:e.Nat64}),p=e.Record({url:e.Text,method:e.Text,body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text))}),u=e.Record({token:e.Opt(e.Text),sha256:e.Opt(e.Vec(e.Nat8)),headers:e.Vec(e.Tuple(e.Text,e.Text)),index:e.Nat64,encoding_type:e.Text,full_path:e.Text}),h=e.Variant({Callback:e.Record({token:u,callback:e.Func([],[],[])})}),T=e.Record({body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text)),streaming_strategy:e.Opt(h),status_code:e.Nat16}),S=e.Record({token:e.Opt(u),body:e.Vec(e.Nat8)}),l=e.Record({token:e.Opt(e.Text),collection:e.Text,name:e.Text,encoding_type:e.Opt(e.Text),full_path:e.Text}),m=e.Record({batch_id:e.Nat}),y=e.Variant({UpdatedAt:e.Null,Keys:e.Null,CreatedAt:e.Null}),x=e.Record({field:y,desc:e.Bool}),b=e.Record({start_after:e.Opt(e.Text),limit:e.Opt(e.Nat64)}),g=e.Record({order:e.Opt(x),matcher:e.Opt(e.Text),paginate:e.Opt(b)}),P=e.Record({token:e.Opt(e.Text),collection:e.Text,owner:e.Principal,name:e.Text,full_path:e.Text}),N=e.Record({modified:e.Nat64,sha256:e.Vec(e.Nat8),total_length:e.Nat}),R=e.Record({key:P,updated_at:e.Nat64,encodings:e.Vec(e.Tuple(e.Text,N)),headers:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64}),V=e.Record({matches_length:e.Nat64,length:e.Nat64,items:e.Vec(e.Tuple(e.Text,R))}),O=e.Record({updated_at:e.Nat64,created_at:e.Nat64,bn_id:e.Opt(e.Text)}),F=e.Record({matches_length:e.Nat64,length:e.Nat64,items:e.Vec(e.Tuple(e.Text,d))}),k=e.Variant({Db:e.Null,Storage:e.Null}),A=e.Variant({Controllers:e.Null,Private:e.Null,Public:e.Null,Managed:e.Null}),Y=e.Record({updated_at:e.Nat64,max_size:e.Opt(e.Nat),read:A,created_at:e.Nat64,write:A}),Z=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),expires_at:e.Opt(e.Nat64)}),oe=e.Record({controller:Z,controllers:e.Vec(e.Principal)}),ie=e.Record({updated_at:e.Opt(e.Nat64),data:e.Vec(e.Nat8)}),se=e.Record({updated_at:e.Opt(e.Nat64),max_size:e.Opt(e.Nat),read:A,write:A}),K=e.Record({content:e.Vec(e.Nat8),batch_id:e.Nat}),ae=e.Record({chunk_id:e.Nat});return e.Service({commit_asset_upload:e.Func([t],[],[]),del_asset:e.Func([e.Text,e.Text],[],[]),del_assets:e.Func([e.Opt(e.Text)],[],[]),del_controllers:e.Func([r],[e.Vec(e.Tuple(e.Principal,n))],[]),del_custom_domain:e.Func([e.Text],[],[]),del_doc:e.Func([e.Text,e.Text,o],[],[]),get_config:e.Func([],[a],[]),get_doc:e.Func([e.Text,e.Text],[e.Opt(d)],["query"]),http_request:e.Func([p],[T],["query"]),http_request_streaming_callback:e.Func([u],[S],["query"]),init_asset_upload:e.Func([l],[m],[]),list_assets:e.Func([e.Opt(e.Text),g],[V],["query"]),list_controllers:e.Func([],[e.Vec(e.Principal)],["query"]),list_custom_domains:e.Func([],[e.Vec(e.Tuple(e.Text,O))],["query"]),list_docs:e.Func([e.Text,g],[F],["query"]),list_rules:e.Func([k],[e.Vec(e.Tuple(e.Text,Y))],["query"]),set_config:e.Func([a],[],[]),set_controllers:e.Func([oe],[e.Vec(e.Tuple(e.Principal,n))],[]),set_custom_domain:e.Func([e.Text,e.Opt(e.Text)],[],[]),set_doc:e.Func([e.Text,e.Text,ie],[d],[]),set_rule:e.Func([k,e.Text,se],[],[]),upload_asset_chunk:e.Func([K],[ae],[]),version:e.Func([],[e.Text],["query"])})};var wt=({IDL:e})=>{let t=e.Record({batch_id:e.Nat,headers:e.Vec(e.Tuple(e.Text,e.Text)),chunk_ids:e.Vec(e.Nat)}),r=e.Record({controllers:e.Vec(e.Principal)}),n=e.Variant({Write:e.Null,Admin:e.Null}),o=e.Record({updated_at:e.Nat64,metadata:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64,scope:n,expires_at:e.Opt(e.Nat64)}),i=e.Record({updated_at:e.Opt(e.Nat64)}),a=e.Variant({Db:e.Null,Storage:e.Null}),d=e.Record({cycles:e.Nat,destination_id:e.Principal}),p=e.Record({token:e.Opt(e.Text),collection:e.Text,owner:e.Principal,name:e.Text,description:e.Opt(e.Text),full_path:e.Text}),u=e.Record({modified:e.Nat64,sha256:e.Vec(e.Nat8),total_length:e.Nat}),h=e.Record({key:p,updated_at:e.Nat64,encodings:e.Vec(e.Tuple(e.Text,u)),headers:e.Vec(e.Tuple(e.Text,e.Text)),created_at:e.Nat64}),T=e.Variant({Deny:e.Null,AllowAny:e.Null,SameOrigin:e.Null}),S=e.Record({status_code:e.Nat16,location:e.Text}),l=e.Record({iframe:e.Opt(T),rewrites:e.Vec(e.Tuple(e.Text,e.Text)),headers:e.Vec(e.Tuple(e.Text,e.Vec(e.Tuple(e.Text,e.Text)))),redirects:e.Opt(e.Vec(e.Tuple(e.Text,S)))}),m=e.Record({storage:l}),y=e.Record({updated_at:e.Nat64,owner:e.Principal,data:e.Vec(e.Nat8),description:e.Opt(e.Text),created_at:e.Nat64}),x=e.Record({url:e.Text,method:e.Text,body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text)),certificate_version:e.Opt(e.Nat16)}),b=e.Variant({Heap:e.Null,Stable:e.Null}),g=e.Record({memory:b,token:e.Opt(e.Text),sha256:e.Opt(e.Vec(e.Nat8)),headers:e.Vec(e.Tuple(e.Text,e.Text)),index:e.Nat64,encoding_type:e.Text,full_path:e.Text}),P=e.Variant({Callback:e.Record({token:g,callback:e.Func([],[],["query"])})}),N=e.Record({body:e.Vec(e.Nat8),headers:e.Vec(e.Tuple(e.Text,e.Text)),streaming_strategy:e.Opt(P),status_code:e.Nat16}),R=e.Record({token:e.Opt(g),body:e.Vec(e.Nat8)}),V=e.Record({token:e.Opt(e.Text),collection:e.Text,name:e.Text,description:e.Opt(e.Text),encoding_type:e.Opt(e.Text),full_path:e.Text}),O=e.Record({batch_id:e.Nat}),F=e.Variant({UpdatedAt:e.Null,Keys:e.Null,CreatedAt:e.Null}),k=e.Record({field:F,desc:e.Bool}),A=e.Record({key:e.Opt(e.Text),description:e.Opt(e.Text)}),Y=e.Record({start_after:e.Opt(e.Text),limit:e.Opt(e.Nat64)}),Z=e.Record({order:e.Opt(k),owner:e.Opt(e.Principal),matcher:e.Opt(A),paginate:e.Opt(Y)}),oe=e.Record({matches_pages:e.Opt(e.Nat64),matches_length:e.Nat64,items_page:e.Opt(e.Nat64),items:e.Vec(e.Tuple(e.Text,h)),items_length:e.Nat64}),ie=e.Record({updated_at:e.Nat64,created_at:e.Nat64,bn_id:e.Opt(e.Text)}),se=e.Record({matches_pages:e.Opt(e.Nat64),matches_length:e.Nat64,items_page:e.Opt(e.Nat64),items:e.Vec(e.Tuple(e.Text,y)),items_length:e.Nat64}),K=e.Variant({Controllers:e.Null,Private:e.Null,Public:e.Null,Managed:e.Null}),ae=e.Record({memory:e.Opt(b),updated_at:e.Nat64,max_size:e.Opt(e.Nat),read:K,created_at:e.Nat64,mutable_permissions:e.Opt(e.Bool),write:K}),Br=e.Record({stable:e.Nat64,heap:e.Nat64}),Mr=e.Record({metadata:e.Vec(e.Tuple(e.Text,e.Text)),scope:n,expires_at:e.Opt(e.Nat64)}),kr=e.Record({controller:Mr,controllers:e.Vec(e.Principal)}),mt=e.Record({updated_at:e.Opt(e.Nat64),data:e.Vec(e.Nat8),description:e.Opt(e.Text)}),$r=e.Record({memory:e.Opt(b),updated_at:e.Opt(e.Nat64),max_size:e.Opt(e.Nat),read:K,mutable_permissions:e.Opt(e.Bool),write:K}),qr=e.Record({content:e.Vec(e.Nat8),batch_id:e.Nat,order_id:e.Opt(e.Nat)}),Ur=e.Record({chunk_id:e.Nat});return e.Service({build_version:e.Func([],[e.Text],["query"]),commit_asset_upload:e.Func([t],[],[]),count_assets:e.Func([e.Text],[e.Nat64],["query"]),count_docs:e.Func([e.Text],[e.Nat64],["query"]),del_asset:e.Func([e.Text,e.Text],[],[]),del_assets:e.Func([e.Text],[],[]),del_controllers:e.Func([r],[e.Vec(e.Tuple(e.Principal,o))],[]),del_custom_domain:e.Func([e.Text],[],[]),del_doc:e.Func([e.Text,e.Text,i],[],[]),del_docs:e.Func([e.Text],[],[]),del_many_assets:e.Func([e.Vec(e.Tuple(e.Text,e.Text))],[],[]),del_many_docs:e.Func([e.Vec(e.Tuple(e.Text,e.Text,i))],[],[]),del_rule:e.Func([a,e.Text,i],[],[]),deposit_cycles:e.Func([d],[],[]),get_asset:e.Func([e.Text,e.Text],[e.Opt(h)],["query"]),get_config:e.Func([],[m],[]),get_doc:e.Func([e.Text,e.Text],[e.Opt(y)],["query"]),get_many_assets:e.Func([e.Vec(e.Tuple(e.Text,e.Text))],[e.Vec(e.Tuple(e.Text,e.Opt(h)))],["query"]),get_many_docs:e.Func([e.Vec(e.Tuple(e.Text,e.Text))],[e.Vec(e.Tuple(e.Text,e.Opt(y)))],["query"]),http_request:e.Func([x],[N],["query"]),http_request_streaming_callback:e.Func([g],[R],["query"]),init_asset_upload:e.Func([V],[O],[]),list_assets:e.Func([e.Text,Z],[oe],["query"]),list_controllers:e.Func([],[e.Vec(e.Tuple(e.Principal,o))],["query"]),list_custom_domains:e.Func([],[e.Vec(e.Tuple(e.Text,ie))],["query"]),list_docs:e.Func([e.Text,Z],[se],["query"]),list_rules:e.Func([a],[e.Vec(e.Tuple(e.Text,ae))],["query"]),memory_size:e.Func([],[Br],["query"]),set_config:e.Func([m],[],[]),set_controllers:e.Func([kr],[e.Vec(e.Tuple(e.Principal,o))],[]),set_custom_domain:e.Func([e.Text,e.Opt(e.Text)],[],[]),set_doc:e.Func([e.Text,e.Text,mt],[y],[]),set_many_docs:e.Func([e.Vec(e.Tuple(e.Text,e.Text,mt))],[e.Vec(e.Tuple(e.Text,y))],[]),set_rule:e.Func([a,e.Text,$r],[],[]),upload_asset_chunk:e.Func([qr],[Ur],[]),version:e.Func([],[e.Text],["query"])})};var Pt=async({satelliteId:e,...t})=>ce({canisterId:e,...t,idlFactory:xt}),B=async({satelliteId:e,...t})=>ce({canisterId:e,...t,idlFactory:wt}),Vt=async({satelliteId:e,...t})=>ce({canisterId:e,...t,idlFactory:bt}),I=async({missionControlId:e,...t})=>ce({canisterId:e,...t,idlFactory:gt}),he=async({orbiterId:e,...t})=>ce({canisterId:e,...t,idlFactory:Tt}),ce=async({canisterId:e,idlFactory:t,...r})=>{if(Xr(e))throw new Error("No canister ID provided.");return Me({canisterId:e,idlFactory:t,...r})},Rt=Nt.fromText("aaaaa-aa"),vt=(e,t,r)=>{let n=t[0],o=Rt;return n&&typeof n=="object"&&n.canister_id&&(o=Nt.from(n.canister_id)),{effectiveCanisterId:o}},Ct=e=>Me({canisterId:Rt.toText(),config:{callTransform:vt,queryTransform:vt},idlFactory:yt,...e});var Q=async({actor:e,code:t})=>{let{install_code:r}=await Ct(e);return r({...t,sender_canister_version:[]})},St=async({canisterId:e,path:t,...r})=>{Dr(e,"A canister ID must be provided to request its status.");let n=await ke(r);return(await Zr.request({canisterId:Ir.from(e),agent:n,paths:[{kind:"metadata",key:t,path:t,decodeStrategy:"utf-8"}]})).get(t)};var Ft=async({missionControl:e})=>(await I(e)).version(),Ot=async({missionControl:e})=>(await I(e)).get_user(),Et=async({missionControl:e})=>(await I(e)).list_mission_control_controllers(),At=async({missionControl:e,satelliteIds:t,controllerIds:r,controller:n})=>(await I(e)).set_satellites_controllers(t,r,n),Bt=async({missionControl:e,controllerIds:t,controller:r})=>(await I(e)).set_mission_control_controllers(t,r);import{Principal as Lr}from"@dfinity/principal";import{nonNullish as en,toNullable as tn}from"@junobuild/utils";var $e=({controllerId:e,profile:t})=>({controllerIds:[Lr.fromText(e)],controller:rn(t)}),rn=e=>({metadata:en(e)&&e!==""?[["profile",e]]:[],expires_at:tn(void 0),scope:{Admin:null}});var G=_t(it(),1),tr=e=>G.IDL.encode([G.IDL.Record({user:G.IDL.Principal})],[{user:e}]),Be=e=>G.IDL.encode([G.IDL.Record({controllers:G.IDL.Vec(G.IDL.Principal)})],[{controllers:e.map(([t,r])=>t)}]);var Ao=async e=>Ft(e),Bo=async({missionControl:e,wasm_module:t})=>{let r=await Ot({missionControl:e}),{missionControlId:n,...o}=e;if(!n)throw new Error("No mission control principal defined.");let i=tr(r);await Q({actor:o,code:{canister_id:On.fromText(n),arg:new Uint8Array(i),wasm_module:t,mode:{upgrade:null}}})},Mo=async({controllerId:e,profile:t,...r})=>At({...r,...$e({controllerId:e,profile:t})}),ko=async({controllerId:e,profile:t,...r})=>Bt({...r,...$e({controllerId:e,profile:t})}),$o=e=>Et(e);import{Principal as En}from"@dfinity/principal";var rr=async({orbiter:e})=>(await he(e)).version(),st=async({orbiter:e})=>(await he(e)).list_controllers(),nr=async({orbiter:e})=>{let{memory_size:t}=await he(e);return t()};var Jo=async e=>rr(e),Go=async({orbiter:e,wasm_module:t,reset:r=!1})=>{let{orbiterId:n,...o}=e;if(!n)throw new Error("No orbiter principal defined.");let i=await st({orbiter:e}),a=Be(i);await Q({actor:o,code:{canister_id:En.fromText(n),arg:new Uint8Array(a),wasm_module:t,mode:r?{reinstall:null}:{upgrade:null}}})},Yo=e=>nr(e),Qo=e=>st(e);import{major as or,minor as ir,patch as sr}from"semver";var Io=({currentVersion:e,selectedVersion:t})=>{let r=or(e),n=or(t),o=ir(e),i=ir(t),a=sr(e),d=sr(t);return r<n-1||o<i-1||a<d-1?{canUpgrade:!1}:{canUpgrade:!0}};var fe=_t(it(),1);import{Principal as Ar}from"@dfinity/principal";import{fromNullable as $n,isNullish as qn,nonNullish as Un}from"@junobuild/utils";import{toNullable as An}from"@junobuild/utils";var ar=async({config:e,satellite:t})=>(await B(t)).set_config(e),cr=async({satellite:e,type:t})=>(await B(e)).list_rules(t),lr=async({type:e,collection:t,rule:r,satellite:n})=>(await B(n)).set_rule(e,t,r),ur=async({satellite:e})=>{let{version:t}=await B(e);return t()},dr=async({satellite:e})=>{let{build_version:t}=await B(e);return t()},pr=async({satellite:e})=>(await Pt(e)).list_controllers(),at=async({satellite:e})=>(await Vt(e)).list_controllers(),ct=async({satellite:e})=>(await B(e)).list_controllers(),mr=async({satellite:e})=>{let{list_custom_domains:t}=await B(e);return t()},fr=async({satellite:e,domainName:t,boundaryNodesId:r})=>{let{set_custom_domain:n}=await B(e);await n(t,An(r))},hr=async({satellite:e})=>{let{memory_size:t}=await B(e);return t()},_r=async({collection:e,satellite:t})=>{let{count_docs:r}=await B(t);return r(e)},yr=async({collection:e,satellite:t})=>{let{count_assets:r}=await B(t);return r(e)},gr=async({collection:e,satellite:t})=>{let{del_docs:r}=await B(t);return r(e)},Tr=async({collection:e,satellite:t})=>{let{del_assets:r}=await B(t);return r(e)},br=async({args:e,satellite:t})=>{let{set_controllers:r}=await B(t);return r(e)};import{fromNullable as ut,isNullish as Bn,nonNullish as dt,toNullable as Cr}from"@junobuild/utils";var xr={Db:null},wr={Storage:null},vr={Public:null},Nr={Private:null},Pr={Managed:null},Vr={Controllers:null},lt={Heap:null},Rr={Stable:null};var pt=e=>e==="storage"?wr:xr,Or=({read:e,write:t,memory:r,max_size:n,updated_at:o,mutablePermissions:i})=>({read:Fr(e),write:Fr(t),memory:dt(r)?[Mn(r)]:[],updated_at:Bn(o)?[]:[o],max_size:Cr(dt(n)&&n>0?BigInt(n):void 0),mutable_permissions:Cr(i)}),Er=([e,t])=>{let{read:r,write:n,updated_at:o,created_at:i,max_size:a,memory:d,mutable_permissions:p}=t,u=a?.[0]??0n>0n?Number(ut(a)):void 0;return{collection:e,read:Sr(r),write:Sr(n),memory:kn(ut(d)??lt),updated_at:o,created_at:i,...dt(u)&&{max_size:u},mutablePermissions:ut(p)??!0}},Sr=e=>"Public"in e?"public":"Private"in e?"private":"Managed"in e?"managed":"controllers",Fr=e=>{switch(e){case"public":return vr;case"private":return Nr;case"managed":return Pr;default:return Vr}},Mn=e=>{switch(e){case"Stable":return Rr;default:return lt}},kn=e=>"Stable"in e?"Stable":"Heap";var pi=async({config:{storage:{headers:e,rewrites:t,redirects:r,iframe:n}},satellite:o})=>{let i=(e??[]).map(({source:u,headers:h})=>[u,h]),a=(t??[]).map(({source:u,destination:h})=>[u,h]),d=(r??[]).map(({source:u,location:h,code:T})=>[u,{status_code:T,location:h}]);return ar({satellite:o,config:{storage:{headers:i,rewrites:a,redirects:[d],iframe:[n==="same-origin"?{SameOrigin:null}:n==="allow-any"?{AllowAny:null}:{Deny:null}]}}})},mi=async({type:e,satellite:t})=>(await cr({satellite:t,type:pt(e)})).map(n=>Er(n)),fi=async({rule:{collection:e,...t},type:r,satellite:n})=>lr({type:pt(r),rule:Or(t),satellite:n,collection:e}),hi=e=>ur(e),_i=e=>dr(e),yi=async({satellite:{satelliteId:e,...t}})=>{let r=await St({...t,canisterId:e,path:"juno:build"});return Un(r)&&["stock","extended"].includes(r)?r:void 0},gi=async({satellite:e,wasm_module:t,deprecated:r,deprecatedNoScope:n,reset:o=!1})=>{let{satelliteId:i,...a}=e;if(qn(i))throw new Error("No satellite principal defined.");if(r){let h=await pr({satellite:e}),T=fe.IDL.encode([fe.IDL.Record({controllers:fe.IDL.Vec(fe.IDL.Principal)})],[{controllers:h}]);await Q({actor:a,code:{canister_id:Ar.fromText(i),arg:new Uint8Array(T),wasm_module:t,mode:o?{reinstall:null}:{upgrade:null}}});return}let p=await(n?at:ct)({satellite:e}),u=Be(p);await Q({actor:a,code:{canister_id:Ar.fromText(i),arg:new Uint8Array(u),wasm_module:t,mode:o?{reinstall:null}:{upgrade:null}}})},Ti=async({satellite:e})=>(await mr({satellite:e})).map(([r,n])=>({domain:r,bn_id:$n(n.bn_id),created_at:n.created_at,updated_at:n.updated_at})),bi=async({satellite:e,domains:t})=>Promise.all(t.map(({domain:r,bn_id:n})=>fr({satellite:e,domainName:r,boundaryNodesId:n}))),xi=e=>hr(e),wi=async e=>_r(e),vi=async e=>gr(e),Ni=async e=>yr(e),Pi=async e=>Tr(e),Vi=({deprecatedNoScope:e,...t})=>(e===!0?at:ct)(t),Ri=e=>br(e);export{Io as checkUpgradeVersion,Ni as countAssets,wi as countDocs,Pi as deleteAssets,vi as deleteDocs,Ti as listCustomDomains,$o as listMissionControlControllers,Qo as listOrbiterControllers,mi as listRules,Vi as listSatelliteControllers,Ao as missionControlVersion,Yo as orbiterMemorySize,Jo as orbiterVersion,yi as satelliteBuildType,_i as satelliteBuildVersion,xi as satelliteMemorySize,hi as satelliteVersion,pi as setConfig,bi as setCustomDomains,ko as setMissionControlController,fi as setRule,Ri as setSatelliteControllers,Mo as setSatellitesController,Bo as upgradeMissionControl,Go as upgradeOrbiter,gi as upgradeSatellite};
16
16
  //# sourceMappingURL=index.mjs.map