@viamrobotics/sdk 0.42.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.umd.js CHANGED
@@ -1,9 +1,9 @@
1
- (function(T,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(T=typeof globalThis<"u"?globalThis:T||self,A(T.sdk={}))})(this,function(T){"use strict";function A(a,e){if(!a)throw new Error(e)}const Lv=34028234663852886e22,Gv=-34028234663852886e22,Bv=4294967295,Fv=2147483647,xv=-2147483648;function Un(a){if(typeof a!="number")throw new Error("invalid int 32: "+typeof a);if(!Number.isInteger(a)||a>Fv||a<xv)throw new Error("invalid int 32: "+a)}function Aa(a){if(typeof a!="number")throw new Error("invalid uint 32: "+typeof a);if(!Number.isInteger(a)||a>Bv||a<0)throw new Error("invalid uint 32: "+a)}function Zo(a){if(typeof a!="number")throw new Error("invalid float 32: "+typeof a);if(Number.isFinite(a)&&(a>Lv||a<Gv))throw new Error("invalid float 32: "+a)}const ei=Symbol("@bufbuild/protobuf/enum-type");function Jv(a){const e=a[ei];return A(e,"missing enum type on enum object"),e}function ni(a,e,n,t){a[ei]=ai(e,n.map(o=>({no:o.no,name:o.name,localName:a[o.no]})))}function ai(a,e,n){const t=Object.create(null),o=Object.create(null),i=[];for(const r of e){const c=ti(r);i.push(c),t[r.name]=c,o[r.no]=c}return{typeName:a,values:i,findName(r){return t[r]},findNumber(r){return o[r]}}}function zv(a,e,n){const t={};for(const o of e){const i=ti(o);t[i.localName]=i.no,t[i.no]=i.localName}return ni(t,a,e),t}function ti(a){return"localName"in a?a:Object.assign(Object.assign({},a),{localName:a.name})}class w{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,n){const t=this.getType(),o=t.runtime.bin,i=o.makeReadOptions(n);return o.readMessage(this,i.readerFactory(e),e.byteLength,i),this}fromJson(e,n){const t=this.getType(),o=t.runtime.json,i=o.makeReadOptions(n);return o.readMessage(t,e,i,this),this}fromJsonString(e,n){let t;try{t=JSON.parse(e)}catch(o){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${o instanceof Error?o.message:String(o)}`)}return this.fromJson(t,n)}toBinary(e){const n=this.getType(),t=n.runtime.bin,o=t.makeWriteOptions(e),i=o.writerFactory();return t.writeMessage(this,i,o),i.finish()}toJson(e){const n=this.getType(),t=n.runtime.json,o=t.makeWriteOptions(e);return t.writeMessage(this,o)}toJsonString(e){var n;const t=this.toJson(e);return JSON.stringify(t,null,(n=e?.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function Yv(a,e,n,t){var o;const i=(o=t?.localName)!==null&&o!==void 0?o:e.substring(e.lastIndexOf(".")+1),r={[i]:function(c){a.util.initFields(this),a.util.initPartial(c,this)}}[i];return Object.setPrototypeOf(r.prototype,new w),Object.assign(r,{runtime:a,typeName:e,fields:a.util.newFieldList(n),fromBinary(c,d){return new r().fromBinary(c,d)},fromJson(c,d){return new r().fromJson(c,d)},fromJsonString(c,d){return new r().fromJsonString(c,d)},equals(c,d){return a.util.equals(r,c,d)}}),r}function $v(){let a=0,e=0;for(let t=0;t<28;t+=7){let o=this.buf[this.pos++];if(a|=(o&127)<<t,!(o&128))return this.assertBounds(),[a,e]}let n=this.buf[this.pos++];if(a|=(n&15)<<28,e=(n&112)>>4,!(n&128))return this.assertBounds(),[a,e];for(let t=3;t<=31;t+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<t,!(o&128))return this.assertBounds(),[a,e]}throw new Error("invalid varint")}function qa(a,e,n){for(let i=0;i<28;i=i+7){const r=a>>>i,c=!(!(r>>>7)&&e==0),d=(c?r|128:r)&255;if(n.push(d),!c)return}const t=a>>>28&15|(e&7)<<4,o=!!(e>>3);if(n.push((o?t|128:t)&255),!!o){for(let i=3;i<31;i=i+7){const r=e>>>i,c=!!(r>>>7),d=(c?r|128:r)&255;if(n.push(d),!c)return}n.push(e>>>31&1)}}const Ln=4294967296;function si(a){const e=a[0]==="-";e&&(a=a.slice(1));const n=1e6;let t=0,o=0;function i(r,c){const d=Number(a.slice(r,c));o*=n,t=t*n+d,t>=Ln&&(o=o+(t/Ln|0),t=t%Ln)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),e?ii(t,o):Ua(t,o)}function Vv(a,e){let n=Ua(a,e);const t=n.hi&2147483648;t&&(n=ii(n.lo,n.hi));const o=oi(n.lo,n.hi);return t?"-"+o:o}function oi(a,e){if({lo:a,hi:e}=Wv(a,e),e<=2097151)return String(Ln*e+a);const n=a&16777215,t=(a>>>24|e<<8)&16777215,o=e>>16&65535;let i=n+t*6777216+o*6710656,r=t+o*8147497,c=o*2;const d=1e7;return i>=d&&(r+=Math.floor(i/d),i%=d),r>=d&&(c+=Math.floor(r/d),r%=d),c.toString()+ri(r)+ri(i)}function Wv(a,e){return{lo:a>>>0,hi:e>>>0}}function Ua(a,e){return{lo:a|0,hi:e|0}}function ii(a,e){return e=~e,a?a=~a+1:e+=1,Ua(a,e)}const ri=a=>{const e=String(a);return"0000000".slice(e.length)+e};function mi(a,e){if(a>=0){for(;a>127;)e.push(a&127|128),a=a>>>7;e.push(a)}else{for(let n=0;n<9;n++)e.push(a&127|128),a=a>>7;e.push(1)}}function jv(){let a=this.buf[this.pos++],e=a&127;if(!(a&128))return this.assertBounds(),e;if(a=this.buf[this.pos++],e|=(a&127)<<7,!(a&128))return this.assertBounds(),e;if(a=this.buf[this.pos++],e|=(a&127)<<14,!(a&128))return this.assertBounds(),e;if(a=this.buf[this.pos++],e|=(a&127)<<21,!(a&128))return this.assertBounds(),e;a=this.buf[this.pos++],e|=(a&15)<<28;for(let n=5;a&128&&n<10;n++)a=this.buf[this.pos++];if(a&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function Hv(){const a=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof a.getBigInt64=="function"&&typeof a.getBigUint64=="function"&&typeof a.setBigInt64=="function"&&typeof a.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const o=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),r=BigInt("0"),c=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(d){const p=typeof d=="bigint"?d:BigInt(d);if(p>i||p<o)throw new Error(`int64 invalid: ${d}`);return p},uParse(d){const p=typeof d=="bigint"?d:BigInt(d);if(p>c||p<r)throw new Error(`uint64 invalid: ${d}`);return p},enc(d){return a.setBigInt64(0,this.parse(d),!0),{lo:a.getInt32(0,!0),hi:a.getInt32(4,!0)}},uEnc(d){return a.setBigInt64(0,this.uParse(d),!0),{lo:a.getInt32(0,!0),hi:a.getInt32(4,!0)}},dec(d,p){return a.setInt32(0,d,!0),a.setInt32(4,p,!0),a.getBigInt64(0,!0)},uDec(d,p){return a.setInt32(0,d,!0),a.setInt32(4,p,!0),a.getBigUint64(0,!0)}}}const n=o=>A(/^-?[0-9]+$/.test(o),`int64 invalid: ${o}`),t=o=>A(/^[0-9]+$/.test(o),`uint64 invalid: ${o}`);return{zero:"0",supported:!1,parse(o){return typeof o!="string"&&(o=o.toString()),n(o),o},uParse(o){return typeof o!="string"&&(o=o.toString()),t(o),o},enc(o){return typeof o!="string"&&(o=o.toString()),n(o),si(o)},uEnc(o){return typeof o!="string"&&(o=o.toString()),t(o),si(o)},dec(o,i){return Vv(o,i)},uDec(o,i){return oi(o,i)}}}const V=Hv();var f;(function(a){a[a.DOUBLE=1]="DOUBLE",a[a.FLOAT=2]="FLOAT",a[a.INT64=3]="INT64",a[a.UINT64=4]="UINT64",a[a.INT32=5]="INT32",a[a.FIXED64=6]="FIXED64",a[a.FIXED32=7]="FIXED32",a[a.BOOL=8]="BOOL",a[a.STRING=9]="STRING",a[a.BYTES=12]="BYTES",a[a.UINT32=13]="UINT32",a[a.SFIXED32=15]="SFIXED32",a[a.SFIXED64=16]="SFIXED64",a[a.SINT32=17]="SINT32",a[a.SINT64=18]="SINT64"})(f||(f={}));var Le;(function(a){a[a.BIGINT=0]="BIGINT",a[a.STRING=1]="STRING"})(Le||(Le={}));function Ge(a,e,n){if(e===n)return!0;if(a==f.BYTES){if(!(e instanceof Uint8Array)||!(n instanceof Uint8Array)||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}switch(a){case f.UINT64:case f.FIXED64:case f.INT64:case f.SFIXED64:case f.SINT64:return e==n}return!1}function nn(a,e){switch(a){case f.BOOL:return!1;case f.UINT64:case f.FIXED64:case f.INT64:case f.SFIXED64:case f.SINT64:return e==0?V.zero:"0";case f.DOUBLE:case f.FLOAT:return 0;case f.BYTES:return new Uint8Array(0);case f.STRING:return"";default:return 0}}function ci(a,e){switch(a){case f.BOOL:return e===!1;case f.STRING:return e==="";case f.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var B;(function(a){a[a.Varint=0]="Varint",a[a.Bit64=1]="Bit64",a[a.LengthDelimited=2]="LengthDelimited",a[a.StartGroup=3]="StartGroup",a[a.EndGroup=4]="EndGroup",a[a.Bit32=5]="Bit32"})(B||(B={}));class Kv{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let o=0;o<this.chunks.length;o++)e+=this.chunks[o].length;let n=new Uint8Array(e),t=0;for(let o=0;o<this.chunks.length;o++)n.set(this.chunks[o],t),t+=this.chunks[o].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,n){return this.uint32((e<<3|n)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Aa(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return Un(e),mi(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.textEncoder.encode(e);return this.uint32(n.byteLength),this.raw(n)}float(e){Zo(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){Aa(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){Un(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return Un(e),e=(e<<1^e>>31)>>>0,mi(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),t=new DataView(n.buffer),o=V.enc(e);return t.setInt32(0,o.lo,!0),t.setInt32(4,o.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),t=new DataView(n.buffer),o=V.uEnc(e);return t.setInt32(0,o.lo,!0),t.setInt32(4,o.hi,!0),this.raw(n)}int64(e){let n=V.enc(e);return qa(n.lo,n.hi,this.buf),this}sint64(e){let n=V.enc(e),t=n.hi>>31,o=n.lo<<1^t,i=(n.hi<<1|n.lo>>>31)^t;return qa(o,i,this.buf),this}uint64(e){let n=V.uEnc(e);return qa(n.lo,n.hi,this.buf),this}}class li{constructor(e,n){this.varint64=$v,this.uint32=jv,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=n??new TextDecoder}tag(){let e=this.uint32(),n=e>>>3,t=e&7;if(n<=0||t<0||t>5)throw new Error("illegal tag: field no "+n+" wire type "+t);return[n,t]}skip(e,n){let t=this.pos;switch(e){case B.Varint:for(;this.buf[this.pos++]&128;);break;case B.Bit64:this.pos+=4;case B.Bit32:this.pos+=4;break;case B.LengthDelimited:let o=this.uint32();this.pos+=o;break;case B.StartGroup:for(;;){const[i,r]=this.tag();if(r===B.EndGroup){if(n!==void 0&&i!==n)throw new Error("invalid end group tag");break}this.skip(r,i)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(t,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return V.dec(...this.varint64())}uint64(){return V.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),t=-(e&1);return e=(e>>>1|(n&1)<<31)^t,n=n>>>1^t,V.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return V.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return V.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.textDecoder.decode(this.bytes())}}function Xv(a,e,n,t){let o;return{typeName:e,extendee:n,get field(){if(!o){const i=typeof t=="function"?t():t;i.name=e.split(".").pop(),i.jsonName=`[${e}]`,o=a.util.newFieldList([i]).list()[0]}return o},runtime:a}}function di(a){const e=a.field.localName,n=Object.create(null);return n[e]=Qv(a),[n,()=>n[e]]}function Qv(a){const e=a.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return nn(e.T,e.L);case"message":const n=e.T,t=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(t):t;case"map":throw"map fields are not allowed to be extensions"}}function Zv(a,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let n=a.length-1;n>=0;--n)if(a[n].no==e.no)return[a[n]];return[]}return a.filter(n=>n.no===e.no)}let pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Gn=[];for(let a=0;a<pe.length;a++)Gn[pe[a].charCodeAt(0)]=a;Gn[45]=pe.indexOf("+"),Gn[95]=pe.indexOf("/");const La={dec(a){let e=a.length*3/4;a[a.length-2]=="="?e-=2:a[a.length-1]=="="&&(e-=1);let n=new Uint8Array(e),t=0,o=0,i,r=0;for(let c=0;c<a.length;c++){if(i=Gn[a.charCodeAt(c)],i===void 0)switch(a[c]){case"=":o=0;case`
2
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(o){case 0:r=i,o=1;break;case 1:n[t++]=r<<2|(i&48)>>4,r=i,o=2;break;case 2:n[t++]=(r&15)<<4|(i&60)>>2,r=i,o=3;break;case 3:n[t++]=(r&3)<<6|i,o=0;break}}if(o==1)throw Error("invalid base64 string.");return n.subarray(0,t)},enc(a){let e="",n=0,t,o=0;for(let i=0;i<a.length;i++)switch(t=a[i],n){case 0:e+=pe[t>>2],o=(t&3)<<4,n=1;break;case 1:e+=pe[o|t>>4],o=(t&15)<<2,n=2;break;case 2:e+=pe[o|t>>6],e+=pe[t&63],n=0;break}return n&&(e+=pe[o],e+="=",n==1&&(e+="=")),e}};function eh(a,e,n){ui(e,a);const t=e.runtime.bin.makeReadOptions(n),o=Zv(a.getType().runtime.bin.listUnknownFields(a),e.field),[i,r]=di(e);for(const c of o)e.runtime.bin.readField(i,t.readerFactory(c.data),e.field,c.wireType,t);return r()}function nh(a,e,n,t){ui(e,a);const o=e.runtime.bin.makeReadOptions(t),i=e.runtime.bin.makeWriteOptions(t);if(pi(a,e)){const p=a.getType().runtime.bin.listUnknownFields(a).filter(k=>k.no!=e.field.no);a.getType().runtime.bin.discardUnknownFields(a);for(const k of p)a.getType().runtime.bin.onUnknownField(a,k.no,k.wireType,k.data)}const r=i.writerFactory();let c=e.field;!c.opt&&!c.repeated&&(c.kind=="enum"||c.kind=="scalar")&&(c=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(c,n,r,i);const d=o.readerFactory(r.finish());for(;d.pos<d.len;){const[p,k]=d.tag(),R=d.skip(k,p);a.getType().runtime.bin.onUnknownField(a,p,k,R)}}function pi(a,e){const n=a.getType();return e.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(a).find(t=>t.no==e.field.no)}function ui(a,e){A(a.extendee.typeName==e.getType().typeName,`extension ${a.typeName} can only be applied to message ${a.extendee.typeName}`)}function gi(a,e){const n=a.localName;if(a.repeated)return e[n].length>0;if(a.oneof)return e[a.oneof.localName].case===n;switch(a.kind){case"enum":case"scalar":return a.opt||a.req?e[n]!==void 0:a.kind=="enum"?e[n]!==a.T.values[0].no:!ci(a.T,e[n]);case"message":return e[n]!==void 0;case"map":return Object.keys(e[n]).length>0}}function Ti(a,e){const n=a.localName,t=!a.opt&&!a.req;if(a.repeated)e[n]=[];else if(a.oneof)e[a.oneof.localName]={case:void 0};else switch(a.kind){case"map":e[n]={};break;case"enum":e[n]=t?a.T.values[0].no:void 0;break;case"scalar":e[n]=t?nn(a.T,a.L):void 0;break;case"message":e[n]=void 0;break}}function We(a,e){if(a===null||typeof a!="object"||!Object.getOwnPropertyNames(w.prototype).every(t=>t in a&&typeof a[t]=="function"))return!1;const n=a.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:e===void 0?!0:n.typeName==e.typeName}function ki(a,e){return We(e)||!a.fieldWrapper?e:a.fieldWrapper.wrapField(e)}f.DOUBLE,f.FLOAT,f.INT64,f.UINT64,f.INT32,f.UINT32,f.BOOL,f.STRING,f.BYTES;const yi={ignoreUnknownFields:!1},vi={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function ah(a){return a?Object.assign(Object.assign({},yi),a):yi}function th(a){return a?Object.assign(Object.assign({},vi),a):vi}const Bn=Symbol(),Fn=Symbol();function sh(){return{makeReadOptions:ah,makeWriteOptions:th,readMessage(a,e,n,t){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message ${a.typeName} from JSON: ${te(e)}`);t=t??new a;const o=new Map,i=n.typeRegistry;for(const[r,c]of Object.entries(e)){const d=a.fields.findJsonName(r);if(d){if(d.oneof){if(c===null&&d.kind=="scalar")continue;const p=o.get(d.oneof);if(p!==void 0)throw new Error(`cannot decode message ${a.typeName} from JSON: multiple keys for oneof "${d.oneof.name}" present: "${p}", "${r}"`);o.set(d.oneof,r)}hi(t,c,d,n,a)}else{let p=!1;if(i?.findExtension&&r.startsWith("[")&&r.endsWith("]")){const k=i.findExtension(r.substring(1,r.length-1));if(k&&k.extendee.typeName==a.typeName){p=!0;const[R,I]=di(k);hi(R,c,k.field,n,k),nh(t,k,I(),n)}}if(!p&&!n.ignoreUnknownFields)throw new Error(`cannot decode message ${a.typeName} from JSON: key "${r}" is unknown`)}}return t},writeMessage(a,e){const n=a.getType(),t={};let o;try{for(o of n.fields.byNumber()){if(!gi(o,a)){if(o.req)throw"required field not set";if(!e.emitDefaultValues||!ih(o))continue}const r=o.oneof?a[o.oneof.localName].value:a[o.localName],c=fi(o,r,e);c!==void 0&&(t[e.useProtoFieldName?o.name:o.jsonName]=c)}const i=e.typeRegistry;if(i?.findExtensionFor)for(const r of n.runtime.bin.listUnknownFields(a)){const c=i.findExtensionFor(n.typeName,r.no);if(c&&pi(a,c)){const d=eh(a,c,e),p=fi(c.field,d,e);p!==void 0&&(t[c.field.jsonName]=p)}}}catch(i){const r=o?`cannot encode field ${n.typeName}.${o.name} to JSON`:`cannot encode message ${n.typeName} to JSON`,c=i instanceof Error?i.message:String(i);throw new Error(r+(c.length>0?`: ${c}`:""))}return t},readScalar(a,e,n){return un(a,e,n??Le.BIGINT,!0)},writeScalar(a,e,n){if(e!==void 0&&(n||ci(a,e)))return xn(a,e)},debug:te}}function te(a){if(a===null)return"null";switch(typeof a){case"object":return Array.isArray(a)?"array":"object";case"string":return a.length>100?"string":`"${a.split('"').join('\\"')}"`;default:return String(a)}}function hi(a,e,n,t,o){let i=n.localName;if(n.repeated){if(A(n.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error(`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(e)}`);const r=a[i];for(const c of e){if(c===null)throw new Error(`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(c)}`);switch(n.kind){case"message":r.push(n.T.fromJson(c,t));break;case"enum":const d=Ga(n.T,c,t.ignoreUnknownFields,!0);d!==Fn&&r.push(d);break;case"scalar":try{r.push(un(n.T,c,n.L,!0))}catch(p){let k=`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(c)}`;throw p instanceof Error&&p.message.length>0&&(k+=`: ${p.message}`),new Error(k)}break}}}else if(n.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error(`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(e)}`);const r=a[i];for(const[c,d]of Object.entries(e)){if(d===null)throw new Error(`cannot decode field ${o.typeName}.${n.name} from JSON: map value null`);let p;try{p=oh(n.K,c)}catch(k){let R=`cannot decode map key for field ${o.typeName}.${n.name} from JSON: ${te(e)}`;throw k instanceof Error&&k.message.length>0&&(R+=`: ${k.message}`),new Error(R)}switch(n.V.kind){case"message":r[p]=n.V.T.fromJson(d,t);break;case"enum":const k=Ga(n.V.T,d,t.ignoreUnknownFields,!0);k!==Fn&&(r[p]=k);break;case"scalar":try{r[p]=un(n.V.T,d,Le.BIGINT,!0)}catch(R){let I=`cannot decode map value for field ${o.typeName}.${n.name} from JSON: ${te(e)}`;throw R instanceof Error&&R.message.length>0&&(I+=`: ${R.message}`),new Error(I)}break}}}else switch(n.oneof&&(a=a[n.oneof.localName]={case:i},i="value"),n.kind){case"message":const r=n.T;if(e===null&&r.typeName!="google.protobuf.Value")return;let c=a[i];We(c)?c.fromJson(e,t):(a[i]=c=r.fromJson(e,t),r.fieldWrapper&&!n.oneof&&(a[i]=r.fieldWrapper.unwrapField(c)));break;case"enum":const d=Ga(n.T,e,t.ignoreUnknownFields,!1);switch(d){case Bn:Ti(n,a);break;case Fn:break;default:a[i]=d;break}break;case"scalar":try{const p=un(n.T,e,n.L,!1);switch(p){case Bn:Ti(n,a);break;default:a[i]=p;break}}catch(p){let k=`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(e)}`;throw p instanceof Error&&p.message.length>0&&(k+=`: ${p.message}`),new Error(k)}break}}function oh(a,e){if(a===f.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return un(a,e,Le.BIGINT,!0).toString()}function un(a,e,n,t){if(e===null)return t?nn(a,n):Bn;switch(a){case f.DOUBLE:case f.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const o=Number(e);if(Number.isNaN(o)||!Number.isFinite(o))break;return a==f.FLOAT&&Zo(o),o;case f.INT32:case f.FIXED32:case f.SFIXED32:case f.SINT32:case f.UINT32:let i;if(typeof e=="number"?i=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(i=Number(e)),i===void 0)break;return a==f.UINT32||a==f.FIXED32?Aa(i):Un(i),i;case f.INT64:case f.SFIXED64:case f.SINT64:if(typeof e!="number"&&typeof e!="string")break;const r=V.parse(e);return n?r.toString():r;case f.FIXED64:case f.UINT64:if(typeof e!="number"&&typeof e!="string")break;const c=V.uParse(e);return n?c.toString():c;case f.BOOL:if(typeof e!="boolean")break;return e;case f.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case f.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return La.dec(e)}throw new Error}function Ga(a,e,n,t){if(e===null)return a.typeName=="google.protobuf.NullValue"?0:t?a.values[0].no:Bn;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const o=a.findName(e);if(o!==void 0)return o.no;if(n)return Fn;break}throw new Error(`cannot decode enum ${a.typeName} from JSON: ${te(e)}`)}function ih(a){return a.repeated||a.kind=="map"?!0:!(a.oneof||a.kind=="message"||a.opt||a.req)}function fi(a,e,n){if(a.kind=="map"){A(typeof e=="object"&&e!=null);const t={},o=Object.entries(e);switch(a.V.kind){case"scalar":for(const[r,c]of o)t[r.toString()]=xn(a.V.T,c);break;case"message":for(const[r,c]of o)t[r.toString()]=c.toJson(n);break;case"enum":const i=a.V.T;for(const[r,c]of o)t[r.toString()]=Ba(i,c,n.enumAsInteger);break}return n.emitDefaultValues||o.length>0?t:void 0}if(a.repeated){A(Array.isArray(e));const t=[];switch(a.kind){case"scalar":for(let o=0;o<e.length;o++)t.push(xn(a.T,e[o]));break;case"enum":for(let o=0;o<e.length;o++)t.push(Ba(a.T,e[o],n.enumAsInteger));break;case"message":for(let o=0;o<e.length;o++)t.push(e[o].toJson(n));break}return n.emitDefaultValues||t.length>0?t:void 0}switch(a.kind){case"scalar":return xn(a.T,e);case"enum":return Ba(a.T,e,n.enumAsInteger);case"message":return ki(a.T,e).toJson(n)}}function Ba(a,e,n){var t;if(A(typeof e=="number"),a.typeName=="google.protobuf.NullValue")return null;if(n)return e;const o=a.findNumber(e);return(t=o?.name)!==null&&t!==void 0?t:e}function xn(a,e){switch(a){case f.INT32:case f.SFIXED32:case f.SINT32:case f.FIXED32:case f.UINT32:return A(typeof e=="number"),e;case f.FLOAT:case f.DOUBLE:return A(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case f.STRING:return A(typeof e=="string"),e;case f.BOOL:return A(typeof e=="boolean"),e;case f.UINT64:case f.FIXED64:case f.INT64:case f.SFIXED64:case f.SINT64:return A(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case f.BYTES:return A(e instanceof Uint8Array),La.enc(e)}}const an=Symbol("@bufbuild/protobuf/unknown-fields"),Ri={readUnknownFields:!0,readerFactory:a=>new li(a)},_i={writeUnknownFields:!0,writerFactory:()=>new Kv};function rh(a){return a?Object.assign(Object.assign({},Ri),a):Ri}function mh(a){return a?Object.assign(Object.assign({},_i),a):_i}function ch(){return{makeReadOptions:rh,makeWriteOptions:mh,listUnknownFields(a){var e;return(e=a[an])!==null&&e!==void 0?e:[]},discardUnknownFields(a){delete a[an]},writeUnknownFields(a,e){const t=a[an];if(t)for(const o of t)e.tag(o.no,o.wireType).raw(o.data)},onUnknownField(a,e,n,t){const o=a;Array.isArray(o[an])||(o[an]=[]),o[an].push({no:e,wireType:n,data:t})},readMessage(a,e,n,t,o){const i=a.getType(),r=o?e.len:e.pos+n;let c,d;for(;e.pos<r&&([c,d]=e.tag(),!(o===!0&&d==B.EndGroup));){const p=i.fields.find(c);if(!p){const k=e.skip(d,c);t.readUnknownFields&&this.onUnknownField(a,c,d,k);continue}Si(a,e,p,d,t)}if(o&&(d!=B.EndGroup||c!==n))throw new Error("invalid end group tag")},readField:Si,writeMessage(a,e,n){const t=a.getType();for(const o of t.fields.byNumber()){if(!gi(o,a)){if(o.req)throw new Error(`cannot encode field ${t.typeName}.${o.name} to binary: required field not set`);continue}const i=o.oneof?a[o.oneof.localName].value:a[o.localName];Ii(o,i,e,n)}return n.writeUnknownFields&&this.writeUnknownFields(a,e),e},writeField(a,e,n,t){e!==void 0&&Ii(a,e,n,t)}}}function Si(a,e,n,t,o){let{repeated:i,localName:r}=n;switch(n.oneof&&(a=a[n.oneof.localName],a.case!=r&&delete a.value,a.case=r,r="value"),n.kind){case"scalar":case"enum":const c=n.kind=="enum"?f.INT32:n.T;let d=zn;if(n.kind=="scalar"&&n.L>0&&(d=dh),i){let I=a[r];if(t==B.LengthDelimited&&c!=f.STRING&&c!=f.BYTES){let M=e.uint32()+e.pos;for(;e.pos<M;)I.push(d(e,c))}else I.push(d(e,c))}else a[r]=d(e,c);break;case"message":const p=n.T;i?a[r].push(Jn(e,new p,o,n)):We(a[r])?Jn(e,a[r],o,n):(a[r]=Jn(e,new p,o,n),p.fieldWrapper&&!n.oneof&&!n.repeated&&(a[r]=p.fieldWrapper.unwrapField(a[r])));break;case"map":let[k,R]=lh(n,e,o);a[r][k]=R;break}}function Jn(a,e,n,t){const o=e.getType().runtime.bin,i=t?.delimited;return o.readMessage(e,a,i?t.no:a.uint32(),n,i),e}function lh(a,e,n){const t=e.uint32(),o=e.pos+t;let i,r;for(;e.pos<o;){const[c]=e.tag();switch(c){case 1:i=zn(e,a.K);break;case 2:switch(a.V.kind){case"scalar":r=zn(e,a.V.T);break;case"enum":r=e.int32();break;case"message":r=Jn(e,new a.V.T,n,void 0);break}break}}if(i===void 0&&(i=nn(a.K,Le.BIGINT)),typeof i!="string"&&typeof i!="number"&&(i=i.toString()),r===void 0)switch(a.V.kind){case"scalar":r=nn(a.V.T,Le.BIGINT);break;case"enum":r=a.V.T.values[0].no;break;case"message":r=new a.V.T;break}return[i,r]}function dh(a,e){const n=zn(a,e);return typeof n=="bigint"?n.toString():n}function zn(a,e){switch(e){case f.STRING:return a.string();case f.BOOL:return a.bool();case f.DOUBLE:return a.double();case f.FLOAT:return a.float();case f.INT32:return a.int32();case f.INT64:return a.int64();case f.UINT64:return a.uint64();case f.FIXED64:return a.fixed64();case f.BYTES:return a.bytes();case f.FIXED32:return a.fixed32();case f.SFIXED32:return a.sfixed32();case f.SFIXED64:return a.sfixed64();case f.SINT64:return a.sint64();case f.UINT32:return a.uint32();case f.SINT32:return a.sint32()}}function Ii(a,e,n,t){A(e!==void 0);const o=a.repeated;switch(a.kind){case"scalar":case"enum":let i=a.kind=="enum"?f.INT32:a.T;if(o)if(A(Array.isArray(e)),a.packed)uh(n,i,a.no,e);else for(const r of e)gn(n,i,a.no,r);else gn(n,i,a.no,e);break;case"message":if(o){A(Array.isArray(e));for(const r of e)Mi(n,t,a,r)}else Mi(n,t,a,e);break;case"map":A(typeof e=="object"&&e!=null);for(const[r,c]of Object.entries(e))ph(n,t,a,r,c);break}}function ph(a,e,n,t,o){a.tag(n.no,B.LengthDelimited),a.fork();let i=t;switch(n.K){case f.INT32:case f.FIXED32:case f.UINT32:case f.SFIXED32:case f.SINT32:i=Number.parseInt(t);break;case f.BOOL:A(t=="true"||t=="false"),i=t=="true";break}switch(gn(a,n.K,1,i),n.V.kind){case"scalar":gn(a,n.V.T,2,o);break;case"enum":gn(a,f.INT32,2,o);break;case"message":A(o!==void 0),a.tag(2,B.LengthDelimited).bytes(o.toBinary(e));break}a.join()}function Mi(a,e,n,t){const o=ki(n.T,t);n.delimited?a.tag(n.no,B.StartGroup).raw(o.toBinary(e)).tag(n.no,B.EndGroup):a.tag(n.no,B.LengthDelimited).bytes(o.toBinary(e))}function gn(a,e,n,t){A(t!==void 0);let[o,i]=bi(e);a.tag(n,o)[i](t)}function uh(a,e,n,t){if(!t.length)return;a.tag(n,B.LengthDelimited).fork();let[,o]=bi(e);for(let i=0;i<t.length;i++)a[o](t[i]);a.join()}function bi(a){let e=B.Varint;switch(a){case f.BYTES:case f.STRING:e=B.LengthDelimited;break;case f.DOUBLE:case f.FIXED64:case f.SFIXED64:e=B.Bit64;break;case f.FIXED32:case f.SFIXED32:case f.FLOAT:e=B.Bit32;break}const n=f[a].toLowerCase();return[e,n]}function gh(){return{setEnumType:ni,initPartial(a,e){if(a===void 0)return;const n=e.getType();for(const t of n.fields.byMember()){const o=t.localName,i=e,r=a;if(r[o]!=null)switch(t.kind){case"oneof":const c=r[o].case;if(c===void 0)continue;const d=t.findField(c);let p=r[o].value;d&&d.kind=="message"&&!We(p,d.T)?p=new d.T(p):d&&d.kind==="scalar"&&d.T===f.BYTES&&(p=Tn(p)),i[o]={case:c,value:p};break;case"scalar":case"enum":let k=r[o];t.T===f.BYTES&&(k=t.repeated?k.map(Tn):Tn(k)),i[o]=k;break;case"map":switch(t.V.kind){case"scalar":case"enum":if(t.V.T===f.BYTES)for(const[_,M]of Object.entries(r[o]))i[o][_]=Tn(M);else Object.assign(i[o],r[o]);break;case"message":const I=t.V.T;for(const _ of Object.keys(r[o])){let M=r[o][_];I.fieldWrapper||(M=new I(M)),i[o][_]=M}break}break;case"message":const R=t.T;if(t.repeated)i[o]=r[o].map(I=>We(I,R)?I:new R(I));else{const I=r[o];R.fieldWrapper?R.typeName==="google.protobuf.BytesValue"?i[o]=Tn(I):i[o]=I:i[o]=We(I,R)?I:new R(I)}break}}},equals(a,e,n){return e===n?!0:!e||!n?!1:a.fields.byMember().every(t=>{const o=e[t.localName],i=n[t.localName];if(t.repeated){if(o.length!==i.length)return!1;switch(t.kind){case"message":return o.every((r,c)=>t.T.equals(r,i[c]));case"scalar":return o.every((r,c)=>Ge(t.T,r,i[c]));case"enum":return o.every((r,c)=>Ge(f.INT32,r,i[c]))}throw new Error(`repeated cannot contain ${t.kind}`)}switch(t.kind){case"message":return t.T.equals(o,i);case"enum":return Ge(f.INT32,o,i);case"scalar":return Ge(t.T,o,i);case"oneof":if(o.case!==i.case)return!1;const r=t.findField(o.case);if(r===void 0)return!0;switch(r.kind){case"message":return r.T.equals(o.value,i.value);case"enum":return Ge(f.INT32,o.value,i.value);case"scalar":return Ge(r.T,o.value,i.value)}throw new Error(`oneof cannot contain ${r.kind}`);case"map":const c=Object.keys(o).concat(Object.keys(i));switch(t.V.kind){case"message":const d=t.V.T;return c.every(k=>d.equals(o[k],i[k]));case"enum":return c.every(k=>Ge(f.INT32,o[k],i[k]));case"scalar":const p=t.V.T;return c.every(k=>Ge(p,o[k],i[k]))}break}})},clone(a){const e=a.getType(),n=new e,t=n;for(const o of e.fields.byMember()){const i=a[o.localName];let r;if(o.repeated)r=i.map(Yn);else if(o.kind=="map"){r=t[o.localName];for(const[c,d]of Object.entries(i))r[c]=Yn(d)}else o.kind=="oneof"?r=o.findField(i.case)?{case:i.case,value:Yn(i.value)}:{case:void 0}:r=Yn(i);t[o.localName]=r}for(const o of e.runtime.bin.listUnknownFields(a))e.runtime.bin.onUnknownField(t,o.no,o.wireType,o.data);return n}}}function Yn(a){if(a===void 0)return a;if(We(a))return a.clone();if(a instanceof Uint8Array){const e=new Uint8Array(a.byteLength);return e.set(a),e}return a}function Tn(a){return a instanceof Uint8Array?a:new Uint8Array(a)}function Ei(a,e,n){return{syntax:a,json:sh(),bin:ch(),util:Object.assign(Object.assign({},gh()),{newFieldList:e,initFields:n}),makeMessageType(t,o,i){return Yv(this,t,o,i)},makeEnum:zv,makeEnumType:ai,getEnumType:Jv,makeExtension(t,o,i){return Xv(this,t,o,i)}}}class wi{constructor(e,n){this._fields=e,this._normalizer=n}findJsonName(e){if(!this.jsonNames){const n={};for(const t of this.list())n[t.jsonName]=n[t.name]=t;this.jsonNames=n}return this.jsonNames[e]}find(e){if(!this.numbers){const n={};for(const t of this.list())n[t.no]=t;this.numbers=n}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,n)=>e.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let n;for(const t of this.list())t.oneof?t.oneof!==n&&(n=t.oneof,e.push(n)):e.push(t)}return this.members}}function Oi(a,e){const n=Ci(a);return e?n:fh(hh(n))}function Th(a){return Oi(a,!1)}const kh=Ci;function Ci(a){let e=!1;const n=[];for(let t=0;t<a.length;t++){let o=a.charAt(t);switch(o){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(o),e=!1;break;default:e&&(e=!1,o=o.toUpperCase()),n.push(o);break}}return n.join("")}const yh=new Set(["constructor","toString","toJSON","valueOf"]),vh=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),Ni=a=>`${a}$`,hh=a=>vh.has(a)?Ni(a):a,fh=a=>yh.has(a)?Ni(a):a;class Rh{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=Th(e)}addField(e){A(e.oneof===this,`field ${e.name} not one of ${this.name}`),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n<this.fields.length;n++)this._lookup[this.fields[n].localName]=this.fields[n]}return this._lookup[e]}}function Pi(a,e){var n,t,o,i,r,c;const d=[];let p;for(const k of typeof a=="function"?a():a){const R=k;if(R.localName=Oi(k.name,k.oneof!==void 0),R.jsonName=(n=k.jsonName)!==null&&n!==void 0?n:kh(k.name),R.repeated=(t=k.repeated)!==null&&t!==void 0?t:!1,k.kind=="scalar"&&(R.L=(o=k.L)!==null&&o!==void 0?o:Le.BIGINT),R.delimited=(i=k.delimited)!==null&&i!==void 0?i:!1,R.req=(r=k.req)!==null&&r!==void 0?r:!1,R.opt=(c=k.opt)!==null&&c!==void 0?c:!1,k.packed===void 0&&(e?R.packed=k.kind=="enum"||k.kind=="scalar"&&k.T!=f.BYTES&&k.T!=f.STRING:R.packed=!1),k.oneof!==void 0){const I=typeof k.oneof=="string"?k.oneof:k.oneof.name;(!p||p.name!=I)&&(p=new Rh(I)),R.oneof=p,p.addField(R)}d.push(R)}return d}const s=Ei("proto3",a=>new wi(a,e=>Pi(e,!0)),a=>{for(const e of a.getType().fields.byMember()){if(e.opt)continue;const n=e.localName,t=a;if(e.repeated){t[n]=[];continue}switch(e.kind){case"oneof":t[n]={case:void 0};break;case"enum":t[n]=0;break;case"map":t[n]={};break;case"scalar":t[n]=nn(e.T,e.L);break}}}),u=Ei("proto2",a=>new wi(a,e=>Pi(e,!1)),a=>{for(const e of a.getType().fields.byMember()){const n=e.localName,t=a;if(e.repeated){t[n]=[];continue}switch(e.kind){case"oneof":t[n]={case:void 0};break;case"map":t[n]={};break}}});var m;(function(a){a[a.Unary=0]="Unary",a[a.ServerStreaming=1]="ServerStreaming",a[a.ClientStreaming=2]="ClientStreaming",a[a.BiDiStreaming=3]="BiDiStreaming"})(m||(m={}));var Di;(function(a){a[a.NoSideEffects=1]="NoSideEffects",a[a.Idempotent=2]="Idempotent"})(Di||(Di={}));var Z;(function(a){a[a.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",a[a.EDITION_LEGACY=900]="EDITION_LEGACY",a[a.EDITION_PROTO2=998]="EDITION_PROTO2",a[a.EDITION_PROTO3=999]="EDITION_PROTO3",a[a.EDITION_2023=1e3]="EDITION_2023",a[a.EDITION_2024=1001]="EDITION_2024",a[a.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",a[a.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",a[a.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",a[a.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",a[a.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",a[a.EDITION_MAX=2147483647]="EDITION_MAX"})(Z||(Z={})),u.util.setEnumType(Z,"google.protobuf.Edition",[{no:0,name:"EDITION_UNKNOWN"},{no:900,name:"EDITION_LEGACY"},{no:998,name:"EDITION_PROTO2"},{no:999,name:"EDITION_PROTO3"},{no:1e3,name:"EDITION_2023"},{no:1001,name:"EDITION_2024"},{no:1,name:"EDITION_1_TEST_ONLY"},{no:2,name:"EDITION_2_TEST_ONLY"},{no:99997,name:"EDITION_99997_TEST_ONLY"},{no:99998,name:"EDITION_99998_TEST_ONLY"},{no:99999,name:"EDITION_99999_TEST_ONLY"},{no:2147483647,name:"EDITION_MAX"}]);class Be extends w{constructor(e){super(),this.file=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Be().fromBinary(e,n)}static fromJson(e,n){return new Be().fromJson(e,n)}static fromJsonString(e,n){return new Be().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Be,e,n)}}Be.runtime=u,Be.typeName="google.protobuf.FileDescriptorSet",Be.fields=u.util.newFieldList(()=>[{no:1,name:"file",kind:"message",T:se,repeated:!0}]);class se extends w{constructor(e){super(),this.dependency=[],this.publicDependency=[],this.weakDependency=[],this.messageType=[],this.enumType=[],this.service=[],this.extension=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new se().fromBinary(e,n)}static fromJson(e,n){return new se().fromJson(e,n)}static fromJsonString(e,n){return new se().fromJsonString(e,n)}static equals(e,n){return u.util.equals(se,e,n)}}se.runtime=u,se.typeName="google.protobuf.FileDescriptorProto",se.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"package",kind:"scalar",T:9,opt:!0},{no:3,name:"dependency",kind:"scalar",T:9,repeated:!0},{no:10,name:"public_dependency",kind:"scalar",T:5,repeated:!0},{no:11,name:"weak_dependency",kind:"scalar",T:5,repeated:!0},{no:4,name:"message_type",kind:"message",T:oe,repeated:!0},{no:5,name:"enum_type",kind:"message",T:ie,repeated:!0},{no:6,name:"service",kind:"message",T:fe,repeated:!0},{no:7,name:"extension",kind:"message",T:ee,repeated:!0},{no:8,name:"options",kind:"message",T:_e,opt:!0},{no:9,name:"source_code_info",kind:"message",T:Pe,opt:!0},{no:12,name:"syntax",kind:"scalar",T:9,opt:!0},{no:14,name:"edition",kind:"enum",T:u.getEnumType(Z),opt:!0}]);class oe extends w{constructor(e){super(),this.field=[],this.extension=[],this.nestedType=[],this.enumType=[],this.extensionRange=[],this.oneofDecl=[],this.reservedRange=[],this.reservedName=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new oe().fromBinary(e,n)}static fromJson(e,n){return new oe().fromJson(e,n)}static fromJsonString(e,n){return new oe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(oe,e,n)}}oe.runtime=u,oe.typeName="google.protobuf.DescriptorProto",oe.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"field",kind:"message",T:ee,repeated:!0},{no:6,name:"extension",kind:"message",T:ee,repeated:!0},{no:3,name:"nested_type",kind:"message",T:oe,repeated:!0},{no:4,name:"enum_type",kind:"message",T:ie,repeated:!0},{no:5,name:"extension_range",kind:"message",T:ue,repeated:!0},{no:8,name:"oneof_decl",kind:"message",T:ye,repeated:!0},{no:7,name:"options",kind:"message",T:Se,opt:!0},{no:9,name:"reserved_range",kind:"message",T:ge,repeated:!0},{no:10,name:"reserved_name",kind:"scalar",T:9,repeated:!0}]);class ue extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ue().fromBinary(e,n)}static fromJson(e,n){return new ue().fromJson(e,n)}static fromJsonString(e,n){return new ue().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ue,e,n)}}ue.runtime=u,ue.typeName="google.protobuf.DescriptorProto.ExtensionRange",ue.fields=u.util.newFieldList(()=>[{no:1,name:"start",kind:"scalar",T:5,opt:!0},{no:2,name:"end",kind:"scalar",T:5,opt:!0},{no:3,name:"options",kind:"message",T:Te,opt:!0}]);class ge extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ge().fromBinary(e,n)}static fromJson(e,n){return new ge().fromJson(e,n)}static fromJsonString(e,n){return new ge().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ge,e,n)}}ge.runtime=u,ge.typeName="google.protobuf.DescriptorProto.ReservedRange",ge.fields=u.util.newFieldList(()=>[{no:1,name:"start",kind:"scalar",T:5,opt:!0},{no:2,name:"end",kind:"scalar",T:5,opt:!0}]);class Te extends w{constructor(e){super(),this.uninterpretedOption=[],this.declaration=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Te().fromBinary(e,n)}static fromJson(e,n){return new Te().fromJson(e,n)}static fromJsonString(e,n){return new Te().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Te,e,n)}}Te.runtime=u,Te.typeName="google.protobuf.ExtensionRangeOptions",Te.fields=u.util.newFieldList(()=>[{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0},{no:2,name:"declaration",kind:"message",T:ke,repeated:!0},{no:50,name:"features",kind:"message",T:z,opt:!0},{no:3,name:"verification",kind:"enum",T:u.getEnumType(kn),opt:!0,default:kn.UNVERIFIED}]);var kn;(function(a){a[a.DECLARATION=0]="DECLARATION",a[a.UNVERIFIED=1]="UNVERIFIED"})(kn||(kn={})),u.util.setEnumType(kn,"google.protobuf.ExtensionRangeOptions.VerificationState",[{no:0,name:"DECLARATION"},{no:1,name:"UNVERIFIED"}]);class ke extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ke().fromBinary(e,n)}static fromJson(e,n){return new ke().fromJson(e,n)}static fromJsonString(e,n){return new ke().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ke,e,n)}}ke.runtime=u,ke.typeName="google.protobuf.ExtensionRangeOptions.Declaration",ke.fields=u.util.newFieldList(()=>[{no:1,name:"number",kind:"scalar",T:5,opt:!0},{no:2,name:"full_name",kind:"scalar",T:9,opt:!0},{no:3,name:"type",kind:"scalar",T:9,opt:!0},{no:5,name:"reserved",kind:"scalar",T:8,opt:!0},{no:6,name:"repeated",kind:"scalar",T:8,opt:!0}]);class ee extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ee().fromBinary(e,n)}static fromJson(e,n){return new ee().fromJson(e,n)}static fromJsonString(e,n){return new ee().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ee,e,n)}}ee.runtime=u,ee.typeName="google.protobuf.FieldDescriptorProto",ee.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:3,name:"number",kind:"scalar",T:5,opt:!0},{no:4,name:"label",kind:"enum",T:u.getEnumType(Vn),opt:!0},{no:5,name:"type",kind:"enum",T:u.getEnumType($n),opt:!0},{no:6,name:"type_name",kind:"scalar",T:9,opt:!0},{no:2,name:"extendee",kind:"scalar",T:9,opt:!0},{no:7,name:"default_value",kind:"scalar",T:9,opt:!0},{no:9,name:"oneof_index",kind:"scalar",T:5,opt:!0},{no:10,name:"json_name",kind:"scalar",T:9,opt:!0},{no:8,name:"options",kind:"message",T:Ie,opt:!0},{no:17,name:"proto3_optional",kind:"scalar",T:8,opt:!0}]);var $n;(function(a){a[a.DOUBLE=1]="DOUBLE",a[a.FLOAT=2]="FLOAT",a[a.INT64=3]="INT64",a[a.UINT64=4]="UINT64",a[a.INT32=5]="INT32",a[a.FIXED64=6]="FIXED64",a[a.FIXED32=7]="FIXED32",a[a.BOOL=8]="BOOL",a[a.STRING=9]="STRING",a[a.GROUP=10]="GROUP",a[a.MESSAGE=11]="MESSAGE",a[a.BYTES=12]="BYTES",a[a.UINT32=13]="UINT32",a[a.ENUM=14]="ENUM",a[a.SFIXED32=15]="SFIXED32",a[a.SFIXED64=16]="SFIXED64",a[a.SINT32=17]="SINT32",a[a.SINT64=18]="SINT64"})($n||($n={})),u.util.setEnumType($n,"google.protobuf.FieldDescriptorProto.Type",[{no:1,name:"TYPE_DOUBLE"},{no:2,name:"TYPE_FLOAT"},{no:3,name:"TYPE_INT64"},{no:4,name:"TYPE_UINT64"},{no:5,name:"TYPE_INT32"},{no:6,name:"TYPE_FIXED64"},{no:7,name:"TYPE_FIXED32"},{no:8,name:"TYPE_BOOL"},{no:9,name:"TYPE_STRING"},{no:10,name:"TYPE_GROUP"},{no:11,name:"TYPE_MESSAGE"},{no:12,name:"TYPE_BYTES"},{no:13,name:"TYPE_UINT32"},{no:14,name:"TYPE_ENUM"},{no:15,name:"TYPE_SFIXED32"},{no:16,name:"TYPE_SFIXED64"},{no:17,name:"TYPE_SINT32"},{no:18,name:"TYPE_SINT64"}]);var Vn;(function(a){a[a.OPTIONAL=1]="OPTIONAL",a[a.REPEATED=3]="REPEATED",a[a.REQUIRED=2]="REQUIRED"})(Vn||(Vn={})),u.util.setEnumType(Vn,"google.protobuf.FieldDescriptorProto.Label",[{no:1,name:"LABEL_OPTIONAL"},{no:3,name:"LABEL_REPEATED"},{no:2,name:"LABEL_REQUIRED"}]);class ye extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ye().fromBinary(e,n)}static fromJson(e,n){return new ye().fromJson(e,n)}static fromJsonString(e,n){return new ye().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ye,e,n)}}ye.runtime=u,ye.typeName="google.protobuf.OneofDescriptorProto",ye.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"options",kind:"message",T:be,opt:!0}]);class ie extends w{constructor(e){super(),this.value=[],this.reservedRange=[],this.reservedName=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new ie().fromBinary(e,n)}static fromJson(e,n){return new ie().fromJson(e,n)}static fromJsonString(e,n){return new ie().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ie,e,n)}}ie.runtime=u,ie.typeName="google.protobuf.EnumDescriptorProto",ie.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"value",kind:"message",T:he,repeated:!0},{no:3,name:"options",kind:"message",T:Ee,opt:!0},{no:4,name:"reserved_range",kind:"message",T:ve,repeated:!0},{no:5,name:"reserved_name",kind:"scalar",T:9,repeated:!0}]);class ve extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ve().fromBinary(e,n)}static fromJson(e,n){return new ve().fromJson(e,n)}static fromJsonString(e,n){return new ve().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ve,e,n)}}ve.runtime=u,ve.typeName="google.protobuf.EnumDescriptorProto.EnumReservedRange",ve.fields=u.util.newFieldList(()=>[{no:1,name:"start",kind:"scalar",T:5,opt:!0},{no:2,name:"end",kind:"scalar",T:5,opt:!0}]);class he extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new he().fromBinary(e,n)}static fromJson(e,n){return new he().fromJson(e,n)}static fromJsonString(e,n){return new he().fromJsonString(e,n)}static equals(e,n){return u.util.equals(he,e,n)}}he.runtime=u,he.typeName="google.protobuf.EnumValueDescriptorProto",he.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"number",kind:"scalar",T:5,opt:!0},{no:3,name:"options",kind:"message",T:we,opt:!0}]);class fe extends w{constructor(e){super(),this.method=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new fe().fromBinary(e,n)}static fromJson(e,n){return new fe().fromJson(e,n)}static fromJsonString(e,n){return new fe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(fe,e,n)}}fe.runtime=u,fe.typeName="google.protobuf.ServiceDescriptorProto",fe.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"method",kind:"message",T:Re,repeated:!0},{no:3,name:"options",kind:"message",T:Oe,opt:!0}]);class Re extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new Re().fromBinary(e,n)}static fromJson(e,n){return new Re().fromJson(e,n)}static fromJsonString(e,n){return new Re().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Re,e,n)}}Re.runtime=u,Re.typeName="google.protobuf.MethodDescriptorProto",Re.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"input_type",kind:"scalar",T:9,opt:!0},{no:3,name:"output_type",kind:"scalar",T:9,opt:!0},{no:4,name:"options",kind:"message",T:me,opt:!0},{no:5,name:"client_streaming",kind:"scalar",T:8,opt:!0,default:!1},{no:6,name:"server_streaming",kind:"scalar",T:8,opt:!0,default:!1}]);class _e extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new _e().fromBinary(e,n)}static fromJson(e,n){return new _e().fromJson(e,n)}static fromJsonString(e,n){return new _e().fromJsonString(e,n)}static equals(e,n){return u.util.equals(_e,e,n)}}_e.runtime=u,_e.typeName="google.protobuf.FileOptions",_e.fields=u.util.newFieldList(()=>[{no:1,name:"java_package",kind:"scalar",T:9,opt:!0},{no:8,name:"java_outer_classname",kind:"scalar",T:9,opt:!0},{no:10,name:"java_multiple_files",kind:"scalar",T:8,opt:!0,default:!1},{no:20,name:"java_generate_equals_and_hash",kind:"scalar",T:8,opt:!0},{no:27,name:"java_string_check_utf8",kind:"scalar",T:8,opt:!0,default:!1},{no:9,name:"optimize_for",kind:"enum",T:u.getEnumType(yn),opt:!0,default:yn.SPEED},{no:11,name:"go_package",kind:"scalar",T:9,opt:!0},{no:16,name:"cc_generic_services",kind:"scalar",T:8,opt:!0,default:!1},{no:17,name:"java_generic_services",kind:"scalar",T:8,opt:!0,default:!1},{no:18,name:"py_generic_services",kind:"scalar",T:8,opt:!0,default:!1},{no:23,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:31,name:"cc_enable_arenas",kind:"scalar",T:8,opt:!0,default:!0},{no:36,name:"objc_class_prefix",kind:"scalar",T:9,opt:!0},{no:37,name:"csharp_namespace",kind:"scalar",T:9,opt:!0},{no:39,name:"swift_prefix",kind:"scalar",T:9,opt:!0},{no:40,name:"php_class_prefix",kind:"scalar",T:9,opt:!0},{no:41,name:"php_namespace",kind:"scalar",T:9,opt:!0},{no:44,name:"php_metadata_namespace",kind:"scalar",T:9,opt:!0},{no:45,name:"ruby_package",kind:"scalar",T:9,opt:!0},{no:50,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);var yn;(function(a){a[a.SPEED=1]="SPEED",a[a.CODE_SIZE=2]="CODE_SIZE",a[a.LITE_RUNTIME=3]="LITE_RUNTIME"})(yn||(yn={})),u.util.setEnumType(yn,"google.protobuf.FileOptions.OptimizeMode",[{no:1,name:"SPEED"},{no:2,name:"CODE_SIZE"},{no:3,name:"LITE_RUNTIME"}]);class Se extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Se().fromBinary(e,n)}static fromJson(e,n){return new Se().fromJson(e,n)}static fromJsonString(e,n){return new Se().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Se,e,n)}}Se.runtime=u,Se.typeName="google.protobuf.MessageOptions",Se.fields=u.util.newFieldList(()=>[{no:1,name:"message_set_wire_format",kind:"scalar",T:8,opt:!0,default:!1},{no:2,name:"no_standard_descriptor_accessor",kind:"scalar",T:8,opt:!0,default:!1},{no:3,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:7,name:"map_entry",kind:"scalar",T:8,opt:!0},{no:11,name:"deprecated_legacy_json_field_conflicts",kind:"scalar",T:8,opt:!0},{no:12,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class Ie extends w{constructor(e){super(),this.targets=[],this.editionDefaults=[],this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Ie().fromBinary(e,n)}static fromJson(e,n){return new Ie().fromJson(e,n)}static fromJsonString(e,n){return new Ie().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ie,e,n)}}Ie.runtime=u,Ie.typeName="google.protobuf.FieldOptions",Ie.fields=u.util.newFieldList(()=>[{no:1,name:"ctype",kind:"enum",T:u.getEnumType(vn),opt:!0,default:vn.STRING},{no:2,name:"packed",kind:"scalar",T:8,opt:!0},{no:6,name:"jstype",kind:"enum",T:u.getEnumType(hn),opt:!0,default:hn.JS_NORMAL},{no:5,name:"lazy",kind:"scalar",T:8,opt:!0,default:!1},{no:15,name:"unverified_lazy",kind:"scalar",T:8,opt:!0,default:!1},{no:3,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:10,name:"weak",kind:"scalar",T:8,opt:!0,default:!1},{no:16,name:"debug_redact",kind:"scalar",T:8,opt:!0,default:!1},{no:17,name:"retention",kind:"enum",T:u.getEnumType(Wn),opt:!0},{no:19,name:"targets",kind:"enum",T:u.getEnumType(jn),repeated:!0},{no:20,name:"edition_defaults",kind:"message",T:Me,repeated:!0},{no:21,name:"features",kind:"message",T:z,opt:!0},{no:22,name:"feature_support",kind:"message",T:re,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);var vn;(function(a){a[a.STRING=0]="STRING",a[a.CORD=1]="CORD",a[a.STRING_PIECE=2]="STRING_PIECE"})(vn||(vn={})),u.util.setEnumType(vn,"google.protobuf.FieldOptions.CType",[{no:0,name:"STRING"},{no:1,name:"CORD"},{no:2,name:"STRING_PIECE"}]);var hn;(function(a){a[a.JS_NORMAL=0]="JS_NORMAL",a[a.JS_STRING=1]="JS_STRING",a[a.JS_NUMBER=2]="JS_NUMBER"})(hn||(hn={})),u.util.setEnumType(hn,"google.protobuf.FieldOptions.JSType",[{no:0,name:"JS_NORMAL"},{no:1,name:"JS_STRING"},{no:2,name:"JS_NUMBER"}]);var Wn;(function(a){a[a.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",a[a.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",a[a.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(Wn||(Wn={})),u.util.setEnumType(Wn,"google.protobuf.FieldOptions.OptionRetention",[{no:0,name:"RETENTION_UNKNOWN"},{no:1,name:"RETENTION_RUNTIME"},{no:2,name:"RETENTION_SOURCE"}]);var jn;(function(a){a[a.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",a[a.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",a[a.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",a[a.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",a[a.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",a[a.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",a[a.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",a[a.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",a[a.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",a[a.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(jn||(jn={})),u.util.setEnumType(jn,"google.protobuf.FieldOptions.OptionTargetType",[{no:0,name:"TARGET_TYPE_UNKNOWN"},{no:1,name:"TARGET_TYPE_FILE"},{no:2,name:"TARGET_TYPE_EXTENSION_RANGE"},{no:3,name:"TARGET_TYPE_MESSAGE"},{no:4,name:"TARGET_TYPE_FIELD"},{no:5,name:"TARGET_TYPE_ONEOF"},{no:6,name:"TARGET_TYPE_ENUM"},{no:7,name:"TARGET_TYPE_ENUM_ENTRY"},{no:8,name:"TARGET_TYPE_SERVICE"},{no:9,name:"TARGET_TYPE_METHOD"}]);class Me extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new Me().fromBinary(e,n)}static fromJson(e,n){return new Me().fromJson(e,n)}static fromJsonString(e,n){return new Me().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Me,e,n)}}Me.runtime=u,Me.typeName="google.protobuf.FieldOptions.EditionDefault",Me.fields=u.util.newFieldList(()=>[{no:3,name:"edition",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:2,name:"value",kind:"scalar",T:9,opt:!0}]);class re extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new re().fromBinary(e,n)}static fromJson(e,n){return new re().fromJson(e,n)}static fromJsonString(e,n){return new re().fromJsonString(e,n)}static equals(e,n){return u.util.equals(re,e,n)}}re.runtime=u,re.typeName="google.protobuf.FieldOptions.FeatureSupport",re.fields=u.util.newFieldList(()=>[{no:1,name:"edition_introduced",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:2,name:"edition_deprecated",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:3,name:"deprecation_warning",kind:"scalar",T:9,opt:!0},{no:4,name:"edition_removed",kind:"enum",T:u.getEnumType(Z),opt:!0}]);class be extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new be().fromBinary(e,n)}static fromJson(e,n){return new be().fromJson(e,n)}static fromJsonString(e,n){return new be().fromJsonString(e,n)}static equals(e,n){return u.util.equals(be,e,n)}}be.runtime=u,be.typeName="google.protobuf.OneofOptions",be.fields=u.util.newFieldList(()=>[{no:1,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class Ee extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Ee().fromBinary(e,n)}static fromJson(e,n){return new Ee().fromJson(e,n)}static fromJsonString(e,n){return new Ee().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ee,e,n)}}Ee.runtime=u,Ee.typeName="google.protobuf.EnumOptions",Ee.fields=u.util.newFieldList(()=>[{no:2,name:"allow_alias",kind:"scalar",T:8,opt:!0},{no:3,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:6,name:"deprecated_legacy_json_field_conflicts",kind:"scalar",T:8,opt:!0},{no:7,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class we extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new we().fromBinary(e,n)}static fromJson(e,n){return new we().fromJson(e,n)}static fromJsonString(e,n){return new we().fromJsonString(e,n)}static equals(e,n){return u.util.equals(we,e,n)}}we.runtime=u,we.typeName="google.protobuf.EnumValueOptions",we.fields=u.util.newFieldList(()=>[{no:1,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:2,name:"features",kind:"message",T:z,opt:!0},{no:3,name:"debug_redact",kind:"scalar",T:8,opt:!0,default:!1},{no:4,name:"feature_support",kind:"message",T:re,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class Oe extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Oe().fromBinary(e,n)}static fromJson(e,n){return new Oe().fromJson(e,n)}static fromJsonString(e,n){return new Oe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Oe,e,n)}}Oe.runtime=u,Oe.typeName="google.protobuf.ServiceOptions",Oe.fields=u.util.newFieldList(()=>[{no:34,name:"features",kind:"message",T:z,opt:!0},{no:33,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class me extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new me().fromBinary(e,n)}static fromJson(e,n){return new me().fromJson(e,n)}static fromJsonString(e,n){return new me().fromJsonString(e,n)}static equals(e,n){return u.util.equals(me,e,n)}}me.runtime=u,me.typeName="google.protobuf.MethodOptions",me.fields=u.util.newFieldList(()=>[{no:33,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:34,name:"idempotency_level",kind:"enum",T:u.getEnumType(fn),opt:!0,default:fn.IDEMPOTENCY_UNKNOWN},{no:35,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);var fn;(function(a){a[a.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",a[a.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",a[a.IDEMPOTENT=2]="IDEMPOTENT"})(fn||(fn={})),u.util.setEnumType(fn,"google.protobuf.MethodOptions.IdempotencyLevel",[{no:0,name:"IDEMPOTENCY_UNKNOWN"},{no:1,name:"NO_SIDE_EFFECTS"},{no:2,name:"IDEMPOTENT"}]);class W extends w{constructor(e){super(),this.name=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new W().fromBinary(e,n)}static fromJson(e,n){return new W().fromJson(e,n)}static fromJsonString(e,n){return new W().fromJsonString(e,n)}static equals(e,n){return u.util.equals(W,e,n)}}W.runtime=u,W.typeName="google.protobuf.UninterpretedOption",W.fields=u.util.newFieldList(()=>[{no:2,name:"name",kind:"message",T:Ce,repeated:!0},{no:3,name:"identifier_value",kind:"scalar",T:9,opt:!0},{no:4,name:"positive_int_value",kind:"scalar",T:4,opt:!0},{no:5,name:"negative_int_value",kind:"scalar",T:3,opt:!0},{no:6,name:"double_value",kind:"scalar",T:1,opt:!0},{no:7,name:"string_value",kind:"scalar",T:12,opt:!0},{no:8,name:"aggregate_value",kind:"scalar",T:9,opt:!0}]);class Ce extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new Ce().fromBinary(e,n)}static fromJson(e,n){return new Ce().fromJson(e,n)}static fromJsonString(e,n){return new Ce().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ce,e,n)}}Ce.runtime=u,Ce.typeName="google.protobuf.UninterpretedOption.NamePart",Ce.fields=u.util.newFieldList(()=>[{no:1,name:"name_part",kind:"scalar",T:9,req:!0},{no:2,name:"is_extension",kind:"scalar",T:8,req:!0}]);class z extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new z().fromBinary(e,n)}static fromJson(e,n){return new z().fromJson(e,n)}static fromJsonString(e,n){return new z().fromJsonString(e,n)}static equals(e,n){return u.util.equals(z,e,n)}}z.runtime=u,z.typeName="google.protobuf.FeatureSet",z.fields=u.util.newFieldList(()=>[{no:1,name:"field_presence",kind:"enum",T:u.getEnumType(Hn),opt:!0},{no:2,name:"enum_type",kind:"enum",T:u.getEnumType(Kn),opt:!0},{no:3,name:"repeated_field_encoding",kind:"enum",T:u.getEnumType(Xn),opt:!0},{no:4,name:"utf8_validation",kind:"enum",T:u.getEnumType(Qn),opt:!0},{no:5,name:"message_encoding",kind:"enum",T:u.getEnumType(Zn),opt:!0},{no:6,name:"json_format",kind:"enum",T:u.getEnumType(ea),opt:!0}]);var Hn;(function(a){a[a.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",a[a.EXPLICIT=1]="EXPLICIT",a[a.IMPLICIT=2]="IMPLICIT",a[a.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Hn||(Hn={})),u.util.setEnumType(Hn,"google.protobuf.FeatureSet.FieldPresence",[{no:0,name:"FIELD_PRESENCE_UNKNOWN"},{no:1,name:"EXPLICIT"},{no:2,name:"IMPLICIT"},{no:3,name:"LEGACY_REQUIRED"}]);var Kn;(function(a){a[a.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",a[a.OPEN=1]="OPEN",a[a.CLOSED=2]="CLOSED"})(Kn||(Kn={})),u.util.setEnumType(Kn,"google.protobuf.FeatureSet.EnumType",[{no:0,name:"ENUM_TYPE_UNKNOWN"},{no:1,name:"OPEN"},{no:2,name:"CLOSED"}]);var Xn;(function(a){a[a.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",a[a.PACKED=1]="PACKED",a[a.EXPANDED=2]="EXPANDED"})(Xn||(Xn={})),u.util.setEnumType(Xn,"google.protobuf.FeatureSet.RepeatedFieldEncoding",[{no:0,name:"REPEATED_FIELD_ENCODING_UNKNOWN"},{no:1,name:"PACKED"},{no:2,name:"EXPANDED"}]);var Qn;(function(a){a[a.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",a[a.VERIFY=2]="VERIFY",a[a.NONE=3]="NONE"})(Qn||(Qn={})),u.util.setEnumType(Qn,"google.protobuf.FeatureSet.Utf8Validation",[{no:0,name:"UTF8_VALIDATION_UNKNOWN"},{no:2,name:"VERIFY"},{no:3,name:"NONE"}]);var Zn;(function(a){a[a.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",a[a.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",a[a.DELIMITED=2]="DELIMITED"})(Zn||(Zn={})),u.util.setEnumType(Zn,"google.protobuf.FeatureSet.MessageEncoding",[{no:0,name:"MESSAGE_ENCODING_UNKNOWN"},{no:1,name:"LENGTH_PREFIXED"},{no:2,name:"DELIMITED"}]);var ea;(function(a){a[a.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",a[a.ALLOW=1]="ALLOW",a[a.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(ea||(ea={})),u.util.setEnumType(ea,"google.protobuf.FeatureSet.JsonFormat",[{no:0,name:"JSON_FORMAT_UNKNOWN"},{no:1,name:"ALLOW"},{no:2,name:"LEGACY_BEST_EFFORT"}]);class Fe extends w{constructor(e){super(),this.defaults=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Fe().fromBinary(e,n)}static fromJson(e,n){return new Fe().fromJson(e,n)}static fromJsonString(e,n){return new Fe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Fe,e,n)}}Fe.runtime=u,Fe.typeName="google.protobuf.FeatureSetDefaults",Fe.fields=u.util.newFieldList(()=>[{no:1,name:"defaults",kind:"message",T:Ne,repeated:!0},{no:4,name:"minimum_edition",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:5,name:"maximum_edition",kind:"enum",T:u.getEnumType(Z),opt:!0}]);class Ne extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new Ne().fromBinary(e,n)}static fromJson(e,n){return new Ne().fromJson(e,n)}static fromJsonString(e,n){return new Ne().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ne,e,n)}}Ne.runtime=u,Ne.typeName="google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",Ne.fields=u.util.newFieldList(()=>[{no:3,name:"edition",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:4,name:"overridable_features",kind:"message",T:z,opt:!0},{no:5,name:"fixed_features",kind:"message",T:z,opt:!0}]);class Pe extends w{constructor(e){super(),this.location=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Pe().fromBinary(e,n)}static fromJson(e,n){return new Pe().fromJson(e,n)}static fromJsonString(e,n){return new Pe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Pe,e,n)}}Pe.runtime=u,Pe.typeName="google.protobuf.SourceCodeInfo",Pe.fields=u.util.newFieldList(()=>[{no:1,name:"location",kind:"message",T:De,repeated:!0}]);class De extends w{constructor(e){super(),this.path=[],this.span=[],this.leadingDetachedComments=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new De().fromBinary(e,n)}static fromJson(e,n){return new De().fromJson(e,n)}static fromJsonString(e,n){return new De().fromJsonString(e,n)}static equals(e,n){return u.util.equals(De,e,n)}}De.runtime=u,De.typeName="google.protobuf.SourceCodeInfo.Location",De.fields=u.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:5,repeated:!0,packed:!0},{no:2,name:"span",kind:"scalar",T:5,repeated:!0,packed:!0},{no:3,name:"leading_comments",kind:"scalar",T:9,opt:!0},{no:4,name:"trailing_comments",kind:"scalar",T:9,opt:!0},{no:6,name:"leading_detached_comments",kind:"scalar",T:9,repeated:!0}]);class xe extends w{constructor(e){super(),this.annotation=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new xe().fromBinary(e,n)}static fromJson(e,n){return new xe().fromJson(e,n)}static fromJsonString(e,n){return new xe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(xe,e,n)}}xe.runtime=u,xe.typeName="google.protobuf.GeneratedCodeInfo",xe.fields=u.util.newFieldList(()=>[{no:1,name:"annotation",kind:"message",T:Ae,repeated:!0}]);class Ae extends w{constructor(e){super(),this.path=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Ae().fromBinary(e,n)}static fromJson(e,n){return new Ae().fromJson(e,n)}static fromJsonString(e,n){return new Ae().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ae,e,n)}}Ae.runtime=u,Ae.typeName="google.protobuf.GeneratedCodeInfo.Annotation",Ae.fields=u.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:5,repeated:!0,packed:!0},{no:2,name:"source_file",kind:"scalar",T:9,opt:!0},{no:3,name:"begin",kind:"scalar",T:5,opt:!0},{no:4,name:"end",kind:"scalar",T:5,opt:!0},{no:5,name:"semantic",kind:"enum",T:u.getEnumType(na),opt:!0}]);var na;(function(a){a[a.NONE=0]="NONE",a[a.SET=1]="SET",a[a.ALIAS=2]="ALIAS"})(na||(na={})),u.util.setEnumType(na,"google.protobuf.GeneratedCodeInfo.Annotation.Semantic",[{no:0,name:"NONE"},{no:1,name:"SET"},{no:2,name:"ALIAS"}]);class S extends w{constructor(e){super(),this.seconds=V.zero,this.nanos=0,s.util.initPartial(e,this)}fromJson(e,n){if(typeof e!="string")throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${s.json.debug(e)}`);const t=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!t)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const o=Date.parse(t[1]+"-"+t[2]+"-"+t[3]+"T"+t[4]+":"+t[5]+":"+t[6]+(t[8]?t[8]:"Z"));if(Number.isNaN(o))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(o<Date.parse("0001-01-01T00:00:00Z")||o>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=V.parse(o/1e3),this.nanos=0,t[7]&&(this.nanos=parseInt("1"+t[7]+"0".repeat(9-t[7].length))-1e9),this}toJson(e){const n=Number(this.seconds)*1e3;if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let t="Z";if(this.nanos>0){const o=(this.nanos+1e9).toString().substring(1);o.substring(3)==="000000"?t="."+o.substring(0,3)+"Z":o.substring(6)==="000"?t="."+o.substring(0,6)+"Z":t="."+o+"Z"}return new Date(n).toISOString().replace(".000Z",t)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return S.fromDate(new Date)}static fromDate(e){const n=e.getTime();return new S({seconds:V.parse(Math.floor(n/1e3)),nanos:n%1e3*1e6})}static fromBinary(e,n){return new S().fromBinary(e,n)}static fromJson(e,n){return new S().fromJson(e,n)}static fromJsonString(e,n){return new S().fromJsonString(e,n)}static equals(e,n){return s.util.equals(S,e,n)}}S.runtime=s,S.typeName="google.protobuf.Timestamp",S.fields=s.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);class F extends w{constructor(e){super(),this.seconds=V.zero,this.nanos=0,s.util.initPartial(e,this)}fromJson(e,n){if(typeof e!="string")throw new Error(`cannot decode google.protobuf.Duration from JSON: ${s.json.debug(e)}`);const t=e.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(t===null)throw new Error(`cannot decode google.protobuf.Duration from JSON: ${s.json.debug(e)}`);const o=Number(t[1]);if(o>315576e6||o<-315576e6)throw new Error(`cannot decode google.protobuf.Duration from JSON: ${s.json.debug(e)}`);if(this.seconds=V.parse(o),typeof t[2]=="string"){const i=t[2]+"0".repeat(9-t[2].length);this.nanos=parseInt(i),(o<0||Object.is(o,-0))&&(this.nanos=-this.nanos)}return this}toJson(e){if(Number(this.seconds)>315576e6||Number(this.seconds)<-315576e6)throw new Error("cannot encode google.protobuf.Duration to JSON: value out of range");let n=this.seconds.toString();if(this.nanos!==0){let t=Math.abs(this.nanos).toString();t="0".repeat(9-t.length)+t,t.substring(3)==="000000"?t=t.substring(0,3):t.substring(6)==="000"&&(t=t.substring(0,6)),n+="."+t,this.nanos<0&&Number(this.seconds)==0&&(n="-"+n)}return n+"s"}static fromBinary(e,n){return new F().fromBinary(e,n)}static fromJson(e,n){return new F().fromJson(e,n)}static fromJsonString(e,n){return new F().fromJsonString(e,n)}static equals(e,n){return s.util.equals(F,e,n)}}F.runtime=s,F.typeName="google.protobuf.Duration",F.fields=s.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);class j extends w{constructor(e){super(),this.typeUrl="",this.value=new Uint8Array(0),s.util.initPartial(e,this)}toJson(e){var n;if(this.typeUrl==="")return{};const t=this.typeUrlToName(this.typeUrl),o=(n=e?.typeRegistry)===null||n===void 0?void 0:n.findMessage(t);if(!o)throw new Error(`cannot encode message google.protobuf.Any to JSON: "${this.typeUrl}" is not in the type registry`);let r=o.fromBinary(this.value).toJson(e);return(t.startsWith("google.protobuf.")||r===null||Array.isArray(r)||typeof r!="object")&&(r={value:r}),r["@type"]=this.typeUrl,r}fromJson(e,n){var t;if(e===null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message google.protobuf.Any from JSON: expected object but got ${e===null?"null":Array.isArray(e)?"array":typeof e}`);if(Object.keys(e).length==0)return this;const o=e["@type"];if(typeof o!="string"||o=="")throw new Error('cannot decode message google.protobuf.Any from JSON: "@type" is empty');const i=this.typeUrlToName(o),r=(t=n?.typeRegistry)===null||t===void 0?void 0:t.findMessage(i);if(!r)throw new Error(`cannot decode message google.protobuf.Any from JSON: ${o} is not in the type registry`);let c;if(i.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(e,"value"))c=r.fromJson(e.value,n);else{const d=Object.assign({},e);delete d["@type"],c=r.fromJson(d,n)}return this.packFrom(c),this}packFrom(e){this.value=e.toBinary(),this.typeUrl=this.typeNameToUrl(e.getType().typeName)}unpackTo(e){return this.is(e.getType())?(e.fromBinary(this.value),!0):!1}unpack(e){if(this.typeUrl==="")return;const n=e.findMessage(this.typeUrlToName(this.typeUrl));if(n)return n.fromBinary(this.value)}is(e){if(this.typeUrl==="")return!1;const n=this.typeUrlToName(this.typeUrl);let t="";return typeof e=="string"?t=e:t=e.typeName,n===t}typeNameToUrl(e){return`type.googleapis.com/${e}`}typeUrlToName(e){if(!e.length)throw new Error(`invalid type url: ${e}`);const n=e.lastIndexOf("/"),t=n>=0?e.substring(n+1):e;if(!t.length)throw new Error(`invalid type url: ${e}`);return t}static pack(e){const n=new j;return n.packFrom(e),n}static fromBinary(e,n){return new j().fromBinary(e,n)}static fromJson(e,n){return new j().fromJson(e,n)}static fromJsonString(e,n){return new j().fromJsonString(e,n)}static equals(e,n){return s.util.equals(j,e,n)}}j.runtime=s,j.typeName="google.protobuf.Any",j.fields=s.util.newFieldList(()=>[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}]);var Rn;(function(a){a[a.NULL_VALUE=0]="NULL_VALUE"})(Rn||(Rn={})),s.util.setEnumType(Rn,"google.protobuf.NullValue",[{no:0,name:"NULL_VALUE"}]);class l extends w{constructor(e){super(),this.fields={},s.util.initPartial(e,this)}toJson(e){const n={};for(const[t,o]of Object.entries(this.fields))n[t]=o.toJson(e);return n}fromJson(e,n){if(typeof e!="object"||e==null||Array.isArray(e))throw new Error("cannot decode google.protobuf.Struct from JSON "+s.json.debug(e));for(const[t,o]of Object.entries(e))this.fields[t]=X.fromJson(o);return this}static fromBinary(e,n){return new l().fromBinary(e,n)}static fromJson(e,n){return new l().fromJson(e,n)}static fromJsonString(e,n){return new l().fromJsonString(e,n)}static equals(e,n){return s.util.equals(l,e,n)}}l.runtime=s,l.typeName="google.protobuf.Struct",l.fields=s.util.newFieldList(()=>[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:X}}]);class X extends w{constructor(e){super(),this.kind={case:void 0},s.util.initPartial(e,this)}toJson(e){switch(this.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(this.kind.value))throw new Error("google.protobuf.Value cannot be NaN or Infinity");return this.kind.value;case"boolValue":return this.kind.value;case"stringValue":return this.kind.value;case"structValue":case"listValue":return this.kind.value.toJson(Object.assign(Object.assign({},e),{emitDefaultValues:!0}))}throw new Error("google.protobuf.Value must have a value")}fromJson(e,n){switch(typeof e){case"number":this.kind={case:"numberValue",value:e};break;case"string":this.kind={case:"stringValue",value:e};break;case"boolean":this.kind={case:"boolValue",value:e};break;case"object":e===null?this.kind={case:"nullValue",value:Rn.NULL_VALUE}:Array.isArray(e)?this.kind={case:"listValue",value:ce.fromJson(e)}:this.kind={case:"structValue",value:l.fromJson(e)};break;default:throw new Error("cannot decode google.protobuf.Value from JSON "+s.json.debug(e))}return this}static fromBinary(e,n){return new X().fromBinary(e,n)}static fromJson(e,n){return new X().fromJson(e,n)}static fromJsonString(e,n){return new X().fromJsonString(e,n)}static equals(e,n){return s.util.equals(X,e,n)}}X.runtime=s,X.typeName="google.protobuf.Value",X.fields=s.util.newFieldList(()=>[{no:1,name:"null_value",kind:"enum",T:s.getEnumType(Rn),oneof:"kind"},{no:2,name:"number_value",kind:"scalar",T:1,oneof:"kind"},{no:3,name:"string_value",kind:"scalar",T:9,oneof:"kind"},{no:4,name:"bool_value",kind:"scalar",T:8,oneof:"kind"},{no:5,name:"struct_value",kind:"message",T:l,oneof:"kind"},{no:6,name:"list_value",kind:"message",T:ce,oneof:"kind"}]);class ce extends w{constructor(e){super(),this.values=[],s.util.initPartial(e,this)}toJson(e){return this.values.map(n=>n.toJson())}fromJson(e,n){if(!Array.isArray(e))throw new Error("cannot decode google.protobuf.ListValue from JSON "+s.json.debug(e));for(let t of e)this.values.push(X.fromJson(t));return this}static fromBinary(e,n){return new ce().fromBinary(e,n)}static fromJson(e,n){return new ce().fromJson(e,n)}static fromJsonString(e,n){return new ce().fromJsonString(e,n)}static equals(e,n){return s.util.equals(ce,e,n)}}ce.runtime=s,ce.typeName="google.protobuf.ListValue",ce.fields=s.util.newFieldList(()=>[{no:1,name:"values",kind:"message",T:X,repeated:!0}]),T.Code=void 0,function(a){a[a.Canceled=1]="Canceled",a[a.Unknown=2]="Unknown",a[a.InvalidArgument=3]="InvalidArgument",a[a.DeadlineExceeded=4]="DeadlineExceeded",a[a.NotFound=5]="NotFound",a[a.AlreadyExists=6]="AlreadyExists",a[a.PermissionDenied=7]="PermissionDenied",a[a.ResourceExhausted=8]="ResourceExhausted",a[a.FailedPrecondition=9]="FailedPrecondition",a[a.Aborted=10]="Aborted",a[a.OutOfRange=11]="OutOfRange",a[a.Unimplemented=12]="Unimplemented",a[a.Internal=13]="Internal",a[a.Unavailable=14]="Unavailable",a[a.DataLoss=15]="DataLoss",a[a.Unauthenticated=16]="Unauthenticated"}(T.Code||(T.Code={}));function Ai(a){const e=T.Code[a];return typeof e!="string"?a.toString():e[0].toLowerCase()+e.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}class C extends Error{constructor(e,n=T.Code.Unknown,t,o,i){super(_h(e,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=e,this.code=n,this.metadata=new Headers(t??{}),this.details=o??[],this.cause=i}static from(e,n=T.Code.Unknown){return e instanceof C?e:e instanceof Error?e.name=="AbortError"?new C(e.message,T.Code.Canceled):new C(e.message,n,void 0,void 0,e):new C(String(e),n,void 0,void 0,e)}static[Symbol.hasInstance](e){return e instanceof Error?Object.getPrototypeOf(e)===C.prototype?!0:e.name==="ConnectError"&&"code"in e&&typeof e.code=="number"&&"metadata"in e&&"details"in e&&Array.isArray(e.details)&&"rawMessage"in e&&typeof e.rawMessage=="string"&&"cause"in e:!1}findDetails(e){const n="typeName"in e?{findMessage:o=>o===e.typeName?e:void 0}:e,t=[];for(const o of this.details){if("getType"in o){n.findMessage(o.getType().typeName)&&t.push(o);continue}const i=n.findMessage(o.type);if(i)try{t.push(i.fromBinary(o.value))}catch{}}return t}}function _h(a,e){return a.length?`[${Ai(e)}] ${a}`:`[${Ai(e)}]`}function Sh(a,e,n){try{const t=La.dec(a);return e?e.fromBinary(t,n):t}catch(t){throw C.from(t,T.Code.DataLoss)}}function Ih(a,e){const n={};for(const[t,o]of Object.entries(a.methods)){const i=e(Object.assign(Object.assign({},o),{localName:t,service:a}));i!=null&&(n[t]=i)}return n}const qi=1;function Ui(a){let e,n=new Uint8Array(0);function t(o){const i=new Uint8Array(n.length+o.length);i.set(n),i.set(o,n.length),n=i}return new ReadableStream({start(){e=a.getReader()},async pull(o){let i;for(;;){if(i===void 0&&n.byteLength>=5){let d=0;for(let p=1;p<5;p++)d=(d<<8)+n[p];i={flags:n[0],length:d}}if(i!==void 0&&n.byteLength>=i.length+5)break;const c=await e.read();if(c.done)break;t(c.value)}if(i===void 0){if(n.byteLength==0){o.close();return}o.error(new C("premature end of stream",T.Code.DataLoss));return}const r=n.subarray(5,5+i.length);n=n.subarray(5+i.length),o.enqueue({flags:i.flags,data:r})}})}function Li(a,e){const n=new Uint8Array(e.length+5);n.set(e,5);const t=new DataView(n.buffer,n.byteOffset,n.byteLength);return t.setUint8(0,a),t.setUint32(1,e.length),n}var Mh=function(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=a[Symbol.asyncIterator],n;return e?e.call(a):(a=typeof __values=="function"?__values(a):a[Symbol.iterator](),n={},t("next"),t("throw"),t("return"),n[Symbol.asyncIterator]=function(){return this},n);function t(i){n[i]=a[i]&&function(r){return new Promise(function(c,d){r=a[i](r),o(c,d,r.done,r.value)})}}function o(i,r,c,d){Promise.resolve(d).then(function(p){i({value:p,done:c})},r)}},_n=function(a){return this instanceof _n?(this.v=a,this):new _n(a)},bh=function(a,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n.apply(a,e||[]),o,i=[];return o={},c("next"),c("throw"),c("return",r),o[Symbol.asyncIterator]=function(){return this},o;function r(_){return function(M){return Promise.resolve(M).then(_,R)}}function c(_,M){t[_]&&(o[_]=function(O){return new Promise(function(P,Y){i.push([_,O,P,Y])>1||d(_,O)})},M&&(o[_]=M(o[_])))}function d(_,M){try{p(t[_](M))}catch(O){I(i[0][3],O)}}function p(_){_.value instanceof _n?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){d("next",_)}function R(_){d("throw",_)}function I(_,M){_(M),i.shift(),i.length&&d(i[0][0],i[0][1])}},Eh=function(a){var e,n;return e={},t("next"),t("throw",function(o){throw o}),t("return"),e[Symbol.iterator]=function(){return this},e;function t(o,i){e[o]=a[o]?function(r){return(n=!n)?{value:_n(a[o](r)),done:!1}:i?i(r):r}:i}};function wh(){const a=[],e=[];let n,t,o,i=new Promise((d,p)=>{t=d,o=p}),r=!1;function c(){for(const d of a.splice(0,a.length))d({done:!0,value:void 0})}return{close(){r=!0,c()},async write(d){if(r)throw n??new Error("cannot write, WritableIterable already closed");const p=a.shift();if(p===void 0)e.push(d);else if(p({done:!1,value:d}),a.length>0)return;const k=e.length+1;for(let R=0;R<k;R++)await i},[Symbol.asyncIterator](){return{next(){t(),i=new Promise((R,I)=>{t=R,o=I});const d=e.shift();if(d!==void 0)return Promise.resolve({done:!1,value:d});if(r)return Promise.resolve({done:!0,value:void 0});let p;const k=new Promise(R=>p=R);return a.push(p),k},throw(d){return n=d,r=!0,e.splice(0,e.length),i.catch(()=>{}),o(n),c(),Promise.resolve({done:!0,value:void 0})},return(){return r=!0,e.splice(0,e.length),t(),i=Promise.reject(new Error("cannot write, consumer called return")),i.catch(()=>{}),c(),Promise.resolve({done:!0,value:void 0})}}}}}function Fa(a){return bh(this,arguments,function*(){yield _n(yield*Eh(Mh(a)))})}var Gi=function(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=a[Symbol.asyncIterator],n;return e?e.call(a):(a=typeof __values=="function"?__values(a):a[Symbol.iterator](),n={},t("next"),t("throw"),t("return"),n[Symbol.asyncIterator]=function(){return this},n);function t(i){n[i]=a[i]&&function(r){return new Promise(function(c,d){r=a[i](r),o(c,d,r.done,r.value)})}}function o(i,r,c,d){Promise.resolve(d).then(function(p){i({value:p,done:c})},r)}},tn=function(a){return this instanceof tn?(this.v=a,this):new tn(a)},Oh=function(a){var e,n;return e={},t("next"),t("throw",function(o){throw o}),t("return"),e[Symbol.iterator]=function(){return this},e;function t(o,i){e[o]=a[o]?function(r){return(n=!n)?{value:tn(a[o](r)),done:!1}:i?i(r):r}:i}},Ch=function(a,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n.apply(a,e||[]),o,i=[];return o={},c("next"),c("throw"),c("return",r),o[Symbol.asyncIterator]=function(){return this},o;function r(_){return function(M){return Promise.resolve(M).then(_,R)}}function c(_,M){t[_]&&(o[_]=function(O){return new Promise(function(P,Y){i.push([_,O,P,Y])>1||d(_,O)})},M&&(o[_]=M(o[_])))}function d(_,M){try{p(t[_](M))}catch(O){I(i[0][3],O)}}function p(_){_.value instanceof tn?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){d("next",_)}function R(_){d("throw",_)}function I(_,M){_(M),i.shift(),i.length&&d(i[0][0],i[0][1])}};function aa(a,e){return Ih(a,n=>{switch(n.kind){case m.Unary:return Nh(e,a,n);case m.ServerStreaming:return Ph(e,a,n);case m.ClientStreaming:return Dh(e,a,n);case m.BiDiStreaming:return Ah(e,a,n);default:return null}})}function N(a,e){return aa(a,e)}function Nh(a,e,n){return async function(t,o){var i,r;const c=await a.unary(e,n,o?.signal,o?.timeoutMs,o?.headers,t,o?.contextValues);return(i=o?.onHeader)===null||i===void 0||i.call(o,c.header),(r=o?.onTrailer)===null||r===void 0||r.call(o,c.trailer),c.message}}function Ph(a,e,n){return function(t,o){return Bi(a.stream(e,n,o?.signal,o?.timeoutMs,o?.headers,Fa([t]),o?.contextValues),o)}}function Dh(a,e,n){return async function(t,o){var i,r,c,d,p,k;const R=await a.stream(e,n,o?.signal,o?.timeoutMs,o?.headers,t,o?.contextValues);(p=o?.onHeader)===null||p===void 0||p.call(o,R.header);let I,_=0;try{for(var M=!0,O=Gi(R.message),P;P=await O.next(),i=P.done,!i;M=!0)d=P.value,M=!1,I=d,_++}catch(Y){r={error:Y}}finally{try{!M&&!i&&(c=O.return)&&await c.call(O)}finally{if(r)throw r.error}}if(!I)throw new C("protocol error: missing response message",T.Code.Unimplemented);if(_>1)throw new C("protocol error: received extra messages for client streaming method",T.Code.Unimplemented);return(k=o?.onTrailer)===null||k===void 0||k.call(o,R.trailer),I}}function Ah(a,e,n){return function(t,o){return Bi(a.stream(e,n,o?.signal,o?.timeoutMs,o?.headers,t,o?.contextValues),o)}}function Bi(a,e){const n=function(){return Ch(this,arguments,function*(){var t,o;const i=yield tn(a);(t=e?.onHeader)===null||t===void 0||t.call(e,i.header),yield tn(yield*Oh(Gi(i.message))),(o=e?.onTrailer)===null||o===void 0||o.call(e,i.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function qh(...a){const e=new AbortController,n=a.filter(o=>o!==void 0).concat(e.signal);for(const o of n){if(o.aborted){t.apply(o);break}o.addEventListener("abort",t)}function t(){e.signal.aborted||e.abort(Fi(this));for(const o of n)o.removeEventListener("abort",t)}return e}function Uh(a){const e=new AbortController,n=()=>{e.abort(new C("the operation timed out",T.Code.DeadlineExceeded))};let t;return a!==void 0&&(a<=0?n():t=setTimeout(n,a)),{signal:e.signal,cleanup:()=>clearTimeout(t)}}function Fi(a){if(!a.aborted)return;if(a.reason!==void 0)return a.reason;const e=new Error("This operation was aborted");return e.name="AbortError",e}function ta(){return{get(a){return a.id in this?this[a.id]:a.defaultValue},set(a,e){return this[a.id]=e,this},delete(a){return delete this[a.id],this}}}const xa=128;function xi(a){const e=new Headers,n=new TextDecoder().decode(a).split(`\r
3
- `);for(const t of n){if(t==="")continue;const o=t.indexOf(":");if(o>0){const i=t.substring(0,o).trim(),r=t.substring(o+1).trim();e.append(i,r)}}return e}const Lh="Content-Type",Gh="Grpc-Timeout",sn="Grpc-Status",Ji="Grpc-Message",Bh="Grpc-Status-Details-Bin",Fh="X-User-Agent",xh="X-Grpc-Web",Jh="application/grpc-web+proto",zh="application/grpc-web+json";let sa=class qn extends w{constructor(e){super(),this.code=0,this.message="",this.details=[],s.util.initPartial(e,this)}static fromBinary(e,n){return new qn().fromBinary(e,n)}static fromJson(e,n){return new qn().fromJson(e,n)}static fromJsonString(e,n){return new qn().fromJsonString(e,n)}static equals(e,n){return s.util.equals(qn,e,n)}};sa.runtime=s,sa.typeName="google.rpc.Status",sa.fields=s.util.newFieldList(()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",T:j,repeated:!0}]);const Yh="0";function zi(a){var e;const n=a.get(Bh);if(n!=null){const o=Sh(n,sa);if(o.code==0)return;const i=new C(o.message,o.code,a);return i.details=o.details.map(r=>({type:r.typeUrl.substring(r.typeUrl.lastIndexOf("/")+1),value:r.value})),i}const t=a.get(sn);if(t!=null){if(t===Yh)return;const o=parseInt(t,10);return o in T.Code?new C(decodeURIComponent((e=a.get(Ji))!==null&&e!==void 0?e:""),o,a):new C(`invalid grpc-status: ${t}`,T.Code.Internal,a)}}function Yi(a,e,n){const t=typeof e=="string"?e:e.typeName,o=typeof n=="string"?n:n.name;return a.toString().replace(/\/?$/,`/${t}/${o}`)}function $i(a,e){return e instanceof a?e:new a(e)}function $h(a,e){function n(t){return t.done===!0?t:{done:t.done,value:$i(a,t.value)}}return{[Symbol.asyncIterator](){const t=e[Symbol.asyncIterator](),o={next:()=>t.next().then(n)};return t.throw!==void 0&&(o.throw=i=>t.throw(i).then(n)),t.return!==void 0&&(o.return=i=>t.return(i).then(n)),o}}}function Vi(a,e){var n;return(n=e?.concat().reverse().reduce((t,o)=>o(t),a))!==null&&n!==void 0?n:a}function Vh(a){var e;const n=Object.assign({},a);return(e=n.ignoreUnknownFields)!==null&&e!==void 0||(n.ignoreUnknownFields=!0),n}function Ja(a,e,n,t){const o=e?Wi(a.I,t):ji(a.I,n);return{parse:(e?Wi(a.O,t):ji(a.O,n)).parse,serialize:o.serialize}}function Wi(a,e){return{parse(n){try{return a.fromBinary(n,e)}catch(t){const o=t instanceof Error?t.message:String(t);throw new C(`parse binary: ${o}`,T.Code.Internal)}},serialize(n){try{return n.toBinary(e)}catch(t){const o=t instanceof Error?t.message:String(t);throw new C(`serialize binary: ${o}`,T.Code.Internal)}}}}function ji(a,e){var n,t;const o=(n=e?.textEncoder)!==null&&n!==void 0?n:new TextEncoder,i=(t=e?.textDecoder)!==null&&t!==void 0?t:new TextDecoder,r=Vh(e);return{parse(c){try{const d=i.decode(c);return a.fromJsonString(d,r)}catch(d){throw C.from(d,T.Code.InvalidArgument)}},serialize(c){try{const d=c.toJsonString(r);return o.encode(d)}catch(d){throw C.from(d,T.Code.Internal)}}}}function Hi(a){const e=Vi(a.next,a.interceptors),[n,t,o]=Xi(a),i=Object.assign(Object.assign({},a.req),{message:$i(a.req.method.I,a.req.message),signal:n});return e(i).then(r=>(o(),r),t)}function Ki(a){const e=Vi(a.next,a.interceptors),[n,t,o]=Xi(a),i=Object.assign(Object.assign({},a.req),{message:$h(a.req.method.I,a.req.message),signal:n});let r=!1;return n.addEventListener("abort",function(){var c,d;const p=a.req.message[Symbol.asyncIterator]();r||(c=p.throw)===null||c===void 0||c.call(p,this.reason).catch(()=>{}),(d=p.return)===null||d===void 0||d.call(p).catch(()=>{})}),e(i).then(c=>Object.assign(Object.assign({},c),{message:{[Symbol.asyncIterator](){const d=c.message[Symbol.asyncIterator]();return{next(){return d.next().then(p=>(p.done==!0&&(r=!0,o()),p),t)}}}}}),t)}function Xi(a){const{signal:e,cleanup:n}=Uh(a.timeoutMs),t=qh(a.signal,e);return[t.signal,function(i){const r=C.from(e.aborted?Fi(e):i);return t.abort(r),n(),Promise.reject(r)},function(){n(),t.abort()}]}var H=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Qi={},za={},oa=H&&H.__assign||function(){return oa=Object.assign||function(a){for(var e,n=1,t=arguments.length;n<t;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(a[o]=e[o])}return a},oa.apply(this,arguments)};Object.defineProperty(za,"__esModule",{value:!0});var Wh={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function jh(a){var e=oa(oa({},Wh),a);return e.numOfAttempts<1&&(e.numOfAttempts=1),e}za.getSanitizedOptions=jh;var Ya={},$a={},ia={},Va={},Wa={};Object.defineProperty(Wa,"__esModule",{value:!0});function Hh(a){var e=Math.random()*a;return Math.round(e)}Wa.fullJitter=Hh;var ja={};Object.defineProperty(ja,"__esModule",{value:!0});function Kh(a){return a}ja.noJitter=Kh,Object.defineProperty(Va,"__esModule",{value:!0});var Xh=Wa,Qh=ja;function Zh(a){switch(a.jitter){case"full":return Xh.fullJitter;case"none":default:return Qh.noJitter}}Va.JitterFactory=Zh,Object.defineProperty(ia,"__esModule",{value:!0});var ef=Va,nf=function(){function a(e){this.options=e,this.attempt=0}return a.prototype.apply=function(){var e=this;return new Promise(function(n){return setTimeout(n,e.jitteredDelay)})},a.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(a.prototype,"jitteredDelay",{get:function(){var e=ef.JitterFactory(this.options);return e(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"delay",{get:function(){var e=this.options.startingDelay,n=this.options.timeMultiple,t=this.numOfDelayedAttempts,o=e*Math.pow(n,t);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),a}();ia.Delay=nf;var af=H&&H.__extends||function(){var a=function(e,n){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var i in o)o.hasOwnProperty(i)&&(t[i]=o[i])},a(e,n)};return function(e,n){a(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}(),tf=H&&H.__awaiter||function(a,e,n,t){function o(i){return i instanceof n?i:new n(function(r){r(i)})}return new(n||(n=Promise))(function(i,r){function c(k){try{p(t.next(k))}catch(R){r(R)}}function d(k){try{p(t.throw(k))}catch(R){r(R)}}function p(k){k.done?i(k.value):o(k.value).then(c,d)}p((t=t.apply(a,e||[])).next())})},sf=H&&H.__generator||function(a,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(p){return function(k){return d([p,k])}}function d(p){if(t)throw new TypeError("Generator is already executing.");for(;n;)try{if(t=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){n.label=p[1];break}if(p[0]===6&&n.label<i[1]){n.label=i[1],i=p;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(p);break}i[2]&&n.ops.pop(),n.trys.pop();continue}p=e.call(a,n)}catch(k){p=[6,k],o=0}finally{t=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty($a,"__esModule",{value:!0});var of=ia,rf=function(a){af(e,a);function e(){return a!==null&&a.apply(this,arguments)||this}return e.prototype.apply=function(){return tf(this,void 0,void 0,function(){return sf(this,function(n){return[2,this.isFirstAttempt?!0:a.prototype.apply.call(this)]})})},Object.defineProperty(e.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),e}(of.Delay);$a.SkipFirstDelay=rf;var Ha={},mf=H&&H.__extends||function(){var a=function(e,n){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var i in o)o.hasOwnProperty(i)&&(t[i]=o[i])},a(e,n)};return function(e,n){a(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}();Object.defineProperty(Ha,"__esModule",{value:!0});var cf=ia,lf=function(a){mf(e,a);function e(){return a!==null&&a.apply(this,arguments)||this}return e}(cf.Delay);Ha.AlwaysDelay=lf,Object.defineProperty(Ya,"__esModule",{value:!0});var df=$a,pf=Ha;function uf(a,e){var n=gf(a);return n.setAttemptNumber(e),n}Ya.DelayFactory=uf;function gf(a){return a.delayFirstAttempt?new pf.AlwaysDelay(a):new df.SkipFirstDelay(a)}var Ka=H&&H.__awaiter||function(a,e,n,t){function o(i){return i instanceof n?i:new n(function(r){r(i)})}return new(n||(n=Promise))(function(i,r){function c(k){try{p(t.next(k))}catch(R){r(R)}}function d(k){try{p(t.throw(k))}catch(R){r(R)}}function p(k){k.done?i(k.value):o(k.value).then(c,d)}p((t=t.apply(a,e||[])).next())})},Xa=H&&H.__generator||function(a,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(p){return function(k){return d([p,k])}}function d(p){if(t)throw new TypeError("Generator is already executing.");for(;n;)try{if(t=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){n.label=p[1];break}if(p[0]===6&&n.label<i[1]){n.label=i[1],i=p;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(p);break}i[2]&&n.ops.pop(),n.trys.pop();continue}p=e.call(a,n)}catch(k){p=[6,k],o=0}finally{t=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(Qi,"__esModule",{value:!0});var Tf=za,kf=Ya;function yf(a,e){return e===void 0&&(e={}),Ka(this,void 0,void 0,function(){var n,t;return Xa(this,function(o){switch(o.label){case 0:return n=Tf.getSanitizedOptions(e),t=new vf(a,n),[4,t.execute()];case 1:return[2,o.sent()]}})})}var Qa=Qi.backOff=yf,vf=function(){function a(e,n){this.request=e,this.options=n,this.attemptNumber=0}return a.prototype.execute=function(){return Ka(this,void 0,void 0,function(){var e,n;return Xa(this,function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(n=t.sent(),!n||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(a.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),a.prototype.applyDelay=function(){return Ka(this,void 0,void 0,function(){var e;return Xa(this,function(n){switch(n.label){case 0:return e=kf.DelayFactory(this.options,this.attemptNumber),[4,e.apply()];case 1:return n.sent(),[2]}})})},a}();const Zi=s.makeMessageType("proto.rpc.v1.Credentials",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9}]),Za=s.makeMessageType("proto.rpc.v1.AuthenticateRequest",()=>[{no:1,name:"entity",kind:"scalar",T:9},{no:2,name:"credentials",kind:"message",T:Zi}]),hf=s.makeMessageType("proto.rpc.v1.AuthenticateResponse",()=>[{no:1,name:"access_token",kind:"scalar",T:9}]),ff=s.makeMessageType("proto.rpc.v1.AuthenticateToRequest",()=>[{no:1,name:"entity",kind:"scalar",T:9}]),Rf=s.makeMessageType("proto.rpc.v1.AuthenticateToResponse",()=>[{no:1,name:"access_token",kind:"scalar",T:9}]),_f={typeName:"proto.rpc.v1.AuthService",methods:{authenticate:{name:"Authenticate",I:Za,O:hf,kind:m.Unary}}},Sf={typeName:"proto.rpc.v1.ExternalAuthService",methods:{authenticateTo:{name:"AuthenticateTo",I:ff,O:Rf,kind:m.Unary}}},on=s.makeMessageType("google.rpc.Status",()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",T:j,repeated:!0}]),Sn=s.makeMessageType("proto.rpc.webrtc.v1.ICECandidate",()=>[{no:1,name:"candidate",kind:"scalar",T:9},{no:2,name:"sdp_mid",kind:"scalar",T:9,opt:!0},{no:3,name:"sdpm_line_index",kind:"scalar",T:13,opt:!0},{no:4,name:"username_fragment",kind:"scalar",T:9,opt:!0}]),er=s.makeMessageType("proto.rpc.webrtc.v1.CallRequest",()=>[{no:1,name:"sdp",kind:"scalar",T:9},{no:2,name:"disable_trickle",kind:"scalar",T:8}]),If=s.makeMessageType("proto.rpc.webrtc.v1.CallResponseInitStage",()=>[{no:1,name:"sdp",kind:"scalar",T:9}]),Mf=s.makeMessageType("proto.rpc.webrtc.v1.CallResponseUpdateStage",()=>[{no:1,name:"candidate",kind:"message",T:Sn}]),bf=s.makeMessageType("proto.rpc.webrtc.v1.CallResponse",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"init",kind:"message",T:If,oneof:"stage"},{no:3,name:"update",kind:"message",T:Mf,oneof:"stage"}]),ra=s.makeMessageType("proto.rpc.webrtc.v1.CallUpdateRequest",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"candidate",kind:"message",T:Sn,oneof:"update"},{no:3,name:"done",kind:"scalar",T:8,oneof:"update"},{no:4,name:"error",kind:"message",T:on,oneof:"update"}]),Ef=s.makeMessageType("proto.rpc.webrtc.v1.CallUpdateResponse",[]),wf=s.makeMessageType("proto.rpc.webrtc.v1.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),ma=s.makeMessageType("proto.rpc.webrtc.v1.WebRTCConfig",()=>[{no:1,name:"additional_ice_servers",kind:"message",T:wf,repeated:!0},{no:2,name:"disable_trickle",kind:"scalar",T:8}]),Of=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestInitStage",()=>[{no:1,name:"sdp",kind:"scalar",T:9},{no:2,name:"optional_config",kind:"message",T:ma},{no:3,name:"deadline",kind:"message",T:S,opt:!0}]),Cf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestUpdateStage",()=>[{no:1,name:"candidate",kind:"message",T:Sn}]),Nf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestDoneStage",[]),Pf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestErrorStage",()=>[{no:1,name:"status",kind:"message",T:on}]),Df=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestHeartbeatStage",[]),Af=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequest",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"init",kind:"message",T:Of,oneof:"stage"},{no:3,name:"update",kind:"message",T:Cf,oneof:"stage"},{no:4,name:"done",kind:"message",T:Nf,oneof:"stage"},{no:5,name:"error",kind:"message",T:Pf,oneof:"stage"},{no:6,name:"heartbeat",kind:"message",T:Df,oneof:"stage"}]),qf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseInitStage",()=>[{no:1,name:"sdp",kind:"scalar",T:9}]),Uf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseUpdateStage",()=>[{no:1,name:"candidate",kind:"message",T:Sn}]),Lf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseDoneStage",[]),Gf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseErrorStage",()=>[{no:1,name:"status",kind:"message",T:on}]),Bf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponse",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"init",kind:"message",T:qf,oneof:"stage"},{no:3,name:"update",kind:"message",T:Uf,oneof:"stage"},{no:4,name:"done",kind:"message",T:Lf,oneof:"stage"},{no:5,name:"error",kind:"message",T:Gf,oneof:"stage"}]),Ff=s.makeMessageType("proto.rpc.webrtc.v1.OptionalWebRTCConfigRequest",[]),xf=s.makeMessageType("proto.rpc.webrtc.v1.OptionalWebRTCConfigResponse",()=>[{no:1,name:"config",kind:"message",T:ma}]),nr={typeName:"proto.rpc.webrtc.v1.SignalingService",methods:{call:{name:"Call",I:er,O:bf,kind:m.ServerStreaming},callUpdate:{name:"CallUpdate",I:ra,O:Ef,kind:m.Unary},answer:{name:"Answer",I:Bf,O:Af,kind:m.BiDiStreaming},optionalWebRTCConfig:{name:"OptionalWebRTCConfig",I:Ff,O:xf,kind:m.Unary}}},ar="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",et=(a="")=>{const e=a;let n="";for(let t=0,o,i=0,r=ar;e.charAt(Math.trunc(i))||(r="=",i%1);n+=r.charAt(63&t>>8-i%1*8)){if(o=e.charCodeAt(i+=3/4),o>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");t=t<<8|o}return n},tr=(a="")=>{const e=a.replace(/=+$/,"");let n="";if(e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let t=0,o=0,i,r=0;i=e.charAt(r++);~i&&(o=t%4?o*64+i:i,t++%4)?n+=String.fromCharCode(255&o>>(-2*t&6)):0)i=ar.indexOf(i);return n},nt=(a,e)=>{const n={sdp:a?.sdp,type:a?.type};if(e)for(const[t,o]of Object.entries(e))n.sdp=[n.sdp,`a=${t}:${o}\r
4
- `].join("");return n},Jf=async(a,e,n)=>{const t=e??{iceServers:[{urls:"stun:global.stun.twilio.com:3478"}]},o=new RTCPeerConnection(t);let i;const r=new Promise(R=>{i=R}),c=o.createDataChannel("data",{id:0,negotiated:!0,ordered:!0});c.binaryType="arraybuffer";const d=o.createDataChannel("negotiation",{id:1,negotiated:!0,ordered:!0});d.binaryType="arraybuffer";let p=!1;if(d.addEventListener("open",()=>{p=!0}),d.addEventListener("message",R=>{(async()=>{const I=new RTCSessionDescription(JSON.parse(tr(R.data)));if(await o.setRemoteDescription(I),I.type==="offer"){await o.setLocalDescription();const _=nt(o.localDescription,n);d.send(et(JSON.stringify(_)))}})().catch(console.error)}),o.addEventListener("negotiationneeded",()=>{(async()=>{if(!p)return;await o.setLocalDescription();const R=nt(o.localDescription,n);d.send(et(JSON.stringify(R)))})().catch(console.error)}),!a)return{pc:o,dc:c};const k=await o.createOffer({});return await o.setLocalDescription(k),o.addEventListener("icecandidate",R=>{R.candidate===null&&i({pc:o,dc:c})}),r};function zf(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}function sr(a,e){const n=zi(a);if(n)throw e.forEach((t,o)=>{n.metadata.append(o,t)}),n;if(!e.has(sn)&&!a.has(sn))throw new C("protocol error: missing status",T.Code.Internal)}function or(a,e,n,t){const o=new Headers(n??{});return o.set(Lh,a?Jh:zh),o.set(xh,"1"),o.set(Fh,"connect-es/1.6.1"),e!==void 0&&o.set(Gh,`${e}m`),o}function Yf(a){switch(a){case 400:return T.Code.Internal;case 401:return T.Code.Unauthenticated;case 403:return T.Code.PermissionDenied;case 404:return T.Code.Unimplemented;case 429:return T.Code.Unavailable;case 502:return T.Code.Unavailable;case 503:return T.Code.Unavailable;case 504:return T.Code.Unavailable;default:return T.Code.Unknown}}function ir(a,e){var n;if(a>=200&&a<300)return{foundStatus:e.has(sn),headerError:zi(e)};throw new C(decodeURIComponent((n=e.get(Ji))!==null&&n!==void 0?n:`HTTP ${a}`),Yf(a),e)}var je=function(a){return this instanceof je?(this.v=a,this):new je(a)},$f=function(a,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n.apply(a,e||[]),o,i=[];return o={},c("next"),c("throw"),c("return",r),o[Symbol.asyncIterator]=function(){return this},o;function r(_){return function(M){return Promise.resolve(M).then(_,R)}}function c(_,M){t[_]&&(o[_]=function(O){return new Promise(function(P,Y){i.push([_,O,P,Y])>1||d(_,O)})},M&&(o[_]=M(o[_])))}function d(_,M){try{p(t[_](M))}catch(O){I(i[0][3],O)}}function p(_){_.value instanceof je?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){d("next",_)}function R(_){d("throw",_)}function I(_,M){_(M),i.shift(),i.length&&d(i[0][0],i[0][1])}};function Vf(a){var e;zf();const n=(e=a.useBinaryFormat)!==null&&e!==void 0?e:!0;return{async unary(t,o,i,r,c,d,p){var k;const{serialize:R,parse:I}=Ja(o,n,a.jsonOptions,a.binaryOptions);return r=r===void 0?a.defaultTimeoutMs:r<=0?void 0:r,await Hi({interceptors:a.interceptors,signal:i,timeoutMs:r,req:{stream:!1,service:t,method:o,url:Yi(a.baseUrl,t,o),init:{method:"POST",credentials:(k=a.credentials)!==null&&k!==void 0?k:"same-origin",redirect:"error",mode:"cors"},header:or(n,r,c),contextValues:p??ta(),message:d},next:async _=>{var M;const P=await((M=a.fetch)!==null&&M!==void 0?M:globalThis.fetch)(_.url,Object.assign(Object.assign({},_.init),{headers:_.header,signal:_.signal,body:Li(0,R(_.message))})),{headerError:Y}=ir(P.status,P.headers);if(!P.body)throw Y!==void 0?Y:"missing response body";const y=Ui(P.body).getReader();let h,g;for(;;){const v=await y.read();if(v.done)break;const{flags:E,data:b}=v.value;if((E&qi)===qi)throw new C("protocol error: received unsupported compressed output",T.Code.Internal);if(E===xa){if(h!==void 0)throw"extra trailer";h=xi(b);continue}if(g!==void 0)throw new C("extra message",T.Code.Unimplemented);g=I(b)}if(h===void 0)throw Y!==void 0?Y:new C("missing trailer",P.headers.has(sn)?T.Code.Unimplemented:T.Code.Unknown);if(sr(h,P.headers),g===void 0)throw new C("missing message",h.has(sn)?T.Code.Unimplemented:T.Code.Unknown);return{stream:!1,service:t,method:o,header:P.headers,message:g,trailer:h}}})},async stream(t,o,i,r,c,d,p){var k;const{serialize:R,parse:I}=Ja(o,n,a.jsonOptions,a.binaryOptions);function _(O,P,Y,y,h){return $f(this,arguments,function*(){const v=Ui(O).getReader();if(P){if(!(yield je(v.read())).done)throw"extra data for trailers-only";return yield je(void 0)}let E=!1;for(;;){const b=yield je(v.read());if(b.done)break;const{flags:ae,data:U}=b.value;if((ae&xa)===xa){if(E)throw"extra trailer";E=!0;const $=xi(U);sr($,y),$.forEach((Xo,Qo)=>Y.set(Qo,Xo));continue}if(E)throw"extra message";yield yield je(I(U))}if("throwIfAborted"in h&&h.throwIfAborted(),!E)throw"missing trailer"})}async function M(O){if(o.kind!=m.ServerStreaming)throw"The fetch API does not support streaming request bodies";const P=await O[Symbol.asyncIterator]().next();if(P.done==!0)throw"missing request message";return Li(0,R(P.value))}return r=r===void 0?a.defaultTimeoutMs:r<=0?void 0:r,Ki({interceptors:a.interceptors,signal:i,timeoutMs:r,req:{stream:!0,service:t,method:o,url:Yi(a.baseUrl,t,o),init:{method:"POST",credentials:(k=a.credentials)!==null&&k!==void 0?k:"same-origin",redirect:"error",mode:"cors"},header:or(n,r,c),contextValues:p??ta(),message:d},next:async O=>{var P;const y=await((P=a.fetch)!==null&&P!==void 0?P:globalThis.fetch)(O.url,Object.assign(Object.assign({},O.init),{headers:O.header,signal:O.signal,body:await M(O.message)})),{foundStatus:h,headerError:g}=ir(y.status,y.headers);if(g!=null)throw g;if(!y.body)throw"missing response body";const v=new Headers;return Object.assign(Object.assign({},O),{header:y.headers,trailer:v,message:_(y.body,h,v,y.headers,O.signal)})}})}}}const ca=s.makeMessageType("proto.rpc.webrtc.v1.PacketMessage",()=>[{no:1,name:"data",kind:"scalar",T:12},{no:2,name:"eom",kind:"scalar",T:8}]),at=s.makeMessageType("proto.rpc.webrtc.v1.Stream",()=>[{no:1,name:"id",kind:"scalar",T:4}]),tt=s.makeMessageType("proto.rpc.webrtc.v1.Request",()=>[{no:1,name:"stream",kind:"message",T:at},{no:2,name:"headers",kind:"message",T:rr,oneof:"type"},{no:3,name:"message",kind:"message",T:st,oneof:"type"},{no:4,name:"rst_stream",kind:"scalar",T:8,oneof:"type"}]),rr=s.makeMessageType("proto.rpc.webrtc.v1.RequestHeaders",()=>[{no:1,name:"method",kind:"scalar",T:9},{no:2,name:"metadata",kind:"message",T:la},{no:3,name:"timeout",kind:"message",T:F}]),st=s.makeMessageType("proto.rpc.webrtc.v1.RequestMessage",()=>[{no:1,name:"has_message",kind:"scalar",T:8},{no:2,name:"packet_message",kind:"message",T:ca},{no:3,name:"eos",kind:"scalar",T:8}]),Wf=s.makeMessageType("proto.rpc.webrtc.v1.Response",()=>[{no:1,name:"stream",kind:"message",T:at},{no:2,name:"headers",kind:"message",T:jf,oneof:"type"},{no:3,name:"message",kind:"message",T:Hf,oneof:"type"},{no:4,name:"trailers",kind:"message",T:Kf,oneof:"type"}]),jf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseHeaders",()=>[{no:1,name:"metadata",kind:"message",T:la}]),Hf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseMessage",()=>[{no:1,name:"packet_message",kind:"message",T:ca}]),Kf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseTrailers",()=>[{no:1,name:"status",kind:"message",T:on},{no:2,name:"metadata",kind:"message",T:la}]),mr=s.makeMessageType("proto.rpc.webrtc.v1.Strings",()=>[{no:1,name:"values",kind:"scalar",T:9,repeated:!0}]),la=s.makeMessageType("proto.rpc.webrtc.v1.Metadata",()=>[{no:1,name:"md",kind:"map",K:9,V:{kind:"message",T:mr}}]);class le extends Error{name="ConnectionClosedError";constructor(e){super(e),Object.setPrototypeOf(this,le.prototype)}static isError(e){return e instanceof le||e instanceof C&&e.rawMessage==="closed"?!0:typeof e=="string"?e==="Response closed without headers":e instanceof Error?e.message==="Response closed without headers":!1}}class Xf{ready;peerConn;dataChannel;pResolve;pReject;closed=!1;closedReason;maxDataChannelSize=65535;constructor(e,n){this.peerConn=e,this.dataChannel=n,this.ready=new Promise((t,o)=>{this.pResolve=t,this.pReject=o}),n.addEventListener("open",()=>this.onChannelOpen()),n.addEventListener("close",()=>this.onChannelClose()),n.addEventListener("error",t=>{this.onChannelError(t)}),e.addEventListener("iceconnectionstatechange",()=>{const t=e.iceConnectionState;(t==="failed"||t==="disconnected"||t==="closed")&&this.pReject?.(new Error(`ICE connection failed with state: ${t}`))})}isClosed(){return this.closed}isClosedReason(){return this.closedReason}closeWithReason(e){this.closed||(this.closed=!0,this.closedReason=e,this.pReject?.(e),this.peerConn.close())}onChannelOpen(){this.pResolve?.(void 0)}onChannelClose(){this.closeWithReason(new le("data channel closed"))}onChannelError(e){console.error("channel error",e),this.closeWithReason(new Error(JSON.stringify(e)))}write(e){this.dataChannel.send(e.toBinary())}}const cr=33554432;class Qf{grpcStream;onDone;closed=!1;packetBuf=[];packetBufSize=0;constructor(e,n){this.grpcStream=e,this.onDone=n}closeWithRecvError(){this.closed||(this.closed=!0,this.onDone(this.grpcStream.id))}processPacketMessage(e){const{data:n}=e;if(n.length+this.packetBufSize>cr){this.packetBuf.length=0,this.packetBufSize=0,console.error(`message size larger than max ${cr}; discarding`);return}if(this.packetBuf.push(n),this.packetBufSize+=n.length,e.eom){const t=new Uint8Array(this.packetBufSize);let o=0;for(const i of this.packetBuf)t.set(i,o),o+=i.length;return this.packetBuf.length=0,this.packetBufSize=0,t}}}const Zf=16373;class lr extends Qf{channel;service;method;parseMessage;requestHeaders;headersReceived=!1;trailersReceived=!1;constructor(e,n,t,o,i,r){super(n,t),this.channel=e,this.service=o,this.method=i;const{parse:c}=Ja(i,!0,void 0,void 0);this.parseMessage=c;const d=`/${o.typeName}/${i.name}`;this.requestHeaders=new rr({method:d});const p=eR(Mn(r));p&&(this.requestHeaders.metadata=p)}startRequest(e){e&&e.addEventListener("abort",()=>{this.resetStream()});try{this.channel.writeHeaders(this.grpcStream,this.requestHeaders)}catch(n){console.error("error writing headers",n),this.closeWithRecvError()}}sendMessage(e){if(e){this.writeMessage(!1,e);return}this.writeMessage(!1,void 0)}resetStream(){if(!this.closed)try{this.channel.writeReset(this.grpcStream)}catch(e){console.error("error writing reset",e),this.closeWithRecvError()}}writeMessage(e,n){try{if(!n||n.length===0){const o=new ca({eom:!0}),i=new st({hasMessage:!!n,packetMessage:o,eos:e});this.channel.writeMessage(this.grpcStream,i);return}let t=n;for(;t.length>0;){const o=Math.min(t.length,Zf),i=new ca;i.data=t.slice(0,o),t=t.slice(o),t.length===0&&(i.eom=!0);const r=new st({hasMessage:!!t,packetMessage:i,eos:e});this.channel.writeMessage(this.grpcStream,r)}}catch(t){console.error("error writing message",t),this.closeWithRecvError()}}onResponse(e){switch(e.type.case){case"headers":{if(this.headersReceived){console.error(`invariant: headers already received for ${this.grpcStream.id}`);return}if(this.trailersReceived){console.error(`invariant: headers received after trailers for ${this.grpcStream.id}`);return}this.processHeaders(e.type.value);break}case"message":{if(!this.headersReceived){console.error(`invariant: headers not yet received for ${this.grpcStream.id}`);return}if(this.trailersReceived){console.error(`invariant: headers received after trailers for ${this.grpcStream.id}`);return}this.processMessage(e.type.value);break}case"trailers":{this.processTrailers(e.type.value);break}default:{console.error("unknown response type",e.type.case);break}}}processHeaders(e){this.headersReceived=!0,this.onHeaders(e)}processMessage(e){if(!e.packetMessage)return;const n=super.processPacketMessage(e.packetMessage);n&&this.onMessage(n)}processTrailers(e){this.trailersReceived=!0;const{status:n}=e,t=n?n.code:0;if(this.onTrailers(e),t===0){this.closeWithRecvError();return}this.closeWithRecvError()}}const eR=a=>{if(!a)return;const e=new la({md:Object.fromEntries([...a.entries()].map(([n,t])=>[n,new mr({values:[t]})]))});return Object.keys(e.md).length>0?e:void 0},ot=a=>{const e=Object.entries(a?.md??{}).flatMap(([n,{values:t}])=>t.map(o=>[n,o]));return new Headers(e)};class nR extends lr{awaitingHeadersResult;gotHeaders=!1;respStream=wh();trailers=new Headers;respStreamQueue;async run(e,n,t,o){const r={req:{stream:!0,url:"",init:{},service:this.service,method:this.method,header:new Headers,contextValues:o??ta(),message:t},next:async c=>{const p=await new Promise((k,R)=>{this.awaitingHeadersResult={success:k,failure:R},this.startRequest(),this.sendMessages(c.message).catch(I=>{console.error("error sending streaming message",I),this.closeWithRecvError()})});return{...c,header:p,trailer:this.trailers,message:this.respStream}}};return e&&(r.signal=e),n!==void 0&&(r.timeoutMs=n),Ki(r)}async sendMessages(e){for await(const n of e)this.sendMessage(n.toBinary());this.writeMessage(!0,void 0)}onHeaders(e){this.gotHeaders=!0,this.awaitingHeadersResult?.success(ot(e.metadata))}onTrailers(e){if(e.metadata?.md){for(const n in e.metadata.md)if(Object.hasOwn(e.metadata.md,n)){const t=e.metadata.md[n];for(const o of t?.values??[])this.trailers.append(n,o)}}if(this.respStream.close(),!e.status||e.status.code===0){if(this.gotHeaders)return;this.awaitingHeadersResult?.success(new Headers);return}this.gotHeaders||this.awaitingHeadersResult?.failure(e.status.message)}onMessage(e){const n=this.parseMessage(e);this.respStreamQueue=this.respStreamQueue?this.respStreamQueue.then(async()=>this.respStream.write(n)):this.respStream.write(n),this.respStreamQueue.catch(t=>{console.error(`error pushing received message into stream; failing: ${t}`),this.resetStream()})}}class aR extends lr{result;headers;message;async run(e,n,t,o){const r={req:{stream:!1,url:"",init:{},service:this.service,method:this.method,header:new Headers,contextValues:o??ta(),message:t},next:async c=>new Promise((d,p)=>{this.result={success:d,failure:p},this.startRequest(),this.sendMessage(c.message.toBinary())})};return e&&(r.signal=e),n!==void 0&&(r.timeoutMs=n),Hi(r)}onHeaders(e){if(this.headers!==void 0){this.result?.failure(new Error("invariant: received headers more than once"));return}this.headers=ot(e.metadata)}onTrailers(e){const n=ot(e.metadata);if(!e.status||e.status.code===0){if(!this.headers){this.result?.failure(new Error("invariant: received trailers for successful unary request without headers"));return}if(this.message===void 0){this.result?.failure(new Error("invariant: received trailers for successful unary request without message"));return}this.result?.success({stream:!1,header:this.headers,message:this.message,trailer:n,service:this.service,method:this.method});return}this.result?.failure(e.status.message)}onMessage(e){if(this.message!==void 0){this.result?.failure(new Error("invariant: received two response messages for unary request"));return}this.message=this.parseMessage(e)}}const tR=256;class sR extends Xf{streamIDCounter=0;streams=new Map;constructor(e,n){super(e,n),n.addEventListener("message",t=>{this.onChannelMessage(t)}),e.addEventListener("iceconnectionstatechange",()=>{const t=e.iceConnectionState;(t==="failed"||t==="disconnected"||t==="closed")&&this.onConnectionTerminated()}),n.addEventListener("close",()=>this.onConnectionTerminated())}onConnectionTerminated(){this.closeWithReason(new le("data channel closed"));for(const e of this.streams.values())e.cs.closeWithRecvError()}onChannelMessage(e){const n=Wf.fromBinary(new Uint8Array(e.data)),{stream:t}=n;if(t===void 0){console.error("no stream id; discarding");return}const{id:o}=t,i=this.streams.get(o.toString());if(i===void 0){console.error("no stream for id; discarding","id",o);return}i.cs.onResponse(n)}nextStreamID(){const e=this.streamIDCounter;return this.streamIDCounter+=1,new at({id:BigInt(e)})}newStream(e,n,t,o,i){if(this.isClosed())throw new le("connection closed");let r=this.streams.get(n.id.toString());if(r!==void 0)throw new Error("invariant: stream should not exist yet");if(Object.keys(this.streams).length>tR)throw new Error("stream limit hit");const c=new e(this,n,d=>this.removeStreamByID(d),t,o,i);return r={cs:c},this.streams.set(n.id.toString(),r),c}removeStreamByID(e){this.streams.delete(e.toString())}writeHeaders(e,n){this.write(new tt({stream:e,type:{case:"headers",value:n}}))}writeMessage(e,n){this.write(new tt({stream:e,type:{case:"message",value:n}}))}writeReset(e){this.write(new tt({stream:e,type:{case:"rstStream",value:!0}}))}async unary(e,n,t,o,i,r,c){return this.newStream(aR,this.nextStreamID(),e,n,i).run(t,o,r,c)}async stream(e,n,t,o,i,r,c){return this.newStream(nR,this.nextStreamID(),e,n,i).run(t,o,r,c)}}const it="invariant: call uuid unset";class oR{constructor(e,n,t,o,i){this.signalingClient=e,this.callOpts=n,this.pc=t,this.dc=o,this.dialOpts=i,this.clientChannel=new sR(this.pc,this.dc)}clientChannel;callUuid;sentDoneOrErrorOnce=!1;exchangeDone=!1;iceComplete=!1;haveInitResponse=!1;awaitingRemoteDescription;remoteDescriptionSet;numCallUpdates=0;maxCallUpdateDuration=0;totalCallUpdateDuration=0;async doExchange(){await this.setup();const e=nt(this.pc.localDescription,this.dialOpts?.additionalSdpFields),n=et(JSON.stringify(e)),t=new er({sdp:n});this.dialOpts&&this.dialOpts.disableTrickleICE&&(t.disableTrickle=this.dialOpts.disableTrickleICE),this.clientChannel.ready.then(()=>{this.exchangeDone=!0}).catch(console.error);const o=this.signalingClient.call(t,this.callOpts),i=this.processCallResponses(o);return await Promise.all([this.clientChannel.ready,i]),this.clientChannel}async setup(){if(this.remoteDescriptionSet=new Promise((e,n)=>{this.awaitingRemoteDescription={success:e,failure:n}}),!this.dialOpts?.disableTrickleICE){const e=await this.pc.createOffer({});this.pc.addEventListener("iceconnectionstatechange",()=>{if(this.pc.iceConnectionState!=="completed"||this.numCallUpdates===0)return;const n=this.totalCallUpdateDuration/this.numCallUpdates;console.groupCollapsed("Caller update statistics"),console.table({num_updates:this.numCallUpdates,average_duration:`${n}ms`,max_duration:`${this.maxCallUpdateDuration}ms`}),console.groupEnd()}),this.pc.addEventListener("icecandidate",n=>{this.onLocalICECandidate(n).catch(t=>{console.error(`error processing local ICE candidate ${t}`)})}),await this.pc.setLocalDescription(e)}}terminate(e){this.clientChannel.closeWithReason(e)}async processCallResponses(e){try{for await(const n of e)switch(n.stage.case){case"init":{if(!await this.handleInitResponse(n.uuid,n.stage.value))return;break}case"update":{if(!await this.handleUpdateResponse(n.uuid,n.stage.value))return;break}default:{await this.sendError("unknown CallResponse stage");return}}}catch(n){this.handleInitError(n)}}handleInitError(e){if(!(this.exchangeDone||this.pc.iceConnectionState==="connected")){if(e instanceof C&&e.code===T.Code.Unimplemented){if(e.message==="Response closed without headers")throw new le("failed to dial");if(this.clientChannel.isClosed())throw new le("client channel is closed");console.error(e.message)}throw e}}async handleInitResponse(e,n){if(this.haveInitResponse)return await this.sendError("got init stage more than once"),!1;this.haveInitResponse=!0,this.callUuid=e;const t=new RTCSessionDescription(JSON.parse(tr(n.sdp)));return this.clientChannel.isClosed()?(await this.sendError("client channel is closed"),!1):(await this.pc.setRemoteDescription(t),this.awaitingRemoteDescription?.success(!0),this.dialOpts?.disableTrickleICE?(this.exchangeDone=!0,await this.sendDone(),!1):!0)}async handleUpdateResponse(e,n){if(!this.haveInitResponse)return await this.sendError("got update stage before init stage"),!1;if(e!==this.callUuid)return await this.sendError(`uuid mismatch; have=${e} want=${this.callUuid}`),!1;if(n.candidate===void 0)return await this.sendError("no candidate"),!1;const t=iR(n.candidate);t.candidate!==void 0&&console.debug(`received remote ICE ${t.candidate}`);try{await this.pc.addIceCandidate(t)}catch(o){throw console.log("error adding ice candidate",o),await this.sendError(JSON.stringify(o)),o}return!0}async onLocalICECandidate(e){if(await this.remoteDescriptionSet,this.exchangeDone||this.pc.iceConnectionState==="connected")return;if(e.candidate===null){this.iceComplete=!0,await this.sendDone();return}if(this.callUuid===void 0||this.callUuid==="")throw new Error(it);e.candidate.candidate!==void 0&&console.debug(`gathered local ICE ${e.candidate.candidate}`);const n=rR(e.candidate),t=new ra({uuid:this.callUuid,update:{case:"candidate",value:n}}),o=new Date;try{await this.signalingClient.callUpdate(t,this.callOpts),this.numCallUpdates+=1;const r=new Date().getTime()-o.getTime();r>this.maxCallUpdateDuration&&(this.maxCallUpdateDuration=r),this.totalCallUpdateDuration+=r}catch(i){if(this.exchangeDone||this.iceComplete||this.pc.iceConnectionState==="connected")return;console.error(i)}}async sendError(e){if(this.sentDoneOrErrorOnce)return;if(this.callUuid===void 0||this.callUuid==="")throw new Error(it);this.sentDoneOrErrorOnce=!0;const n=new ra({uuid:this.callUuid,update:{case:"error",value:new on({code:T.Code.Unknown,message:e})}});try{await this.signalingClient.callUpdate(n,this.callOpts)}catch(t){console.error("failed to send call update; continuing",t)}}async sendDone(){if(this.sentDoneOrErrorOnce)return;if(this.callUuid===void 0||this.callUuid==="")throw new Error(it);this.sentDoneOrErrorOnce=!0;const e=new ra({uuid:this.callUuid,update:{case:"done",value:!0}});try{await this.signalingClient.callUpdate(e,this.callOpts)}catch(n){console.error(n)}}}const iR=a=>{const e={candidate:a.candidate};return a.sdpMid!==void 0&&(e.sdpMid=a.sdpMid),a.sdpmLineIndex!==void 0&&(e.sdpMLineIndex=a.sdpmLineIndex),a.usernameFragment!==void 0&&(e.usernameFragment=a.usernameFragment),e},rR=a=>{const e=new Sn;return a.candidate!==void 0&&(e.candidate=a.candidate),a.sdpMid!==void 0&&a.sdpMid!==null&&(e.sdpMid=a.sdpMid),a.sdpMLineIndex!==void 0&&a.sdpMLineIndex!==null&&(e.sdpmLineIndex=a.sdpMLineIndex),a.usernameFragment!==void 0&&a.usernameFragment!==null&&(e.usernameFragment=a.usernameFragment),e},In=async(a,e)=>{pr(e);const n=globalThis.VIAM?.GRPC_TRANSPORT_FACTORY??Vf,t={baseUrl:a};if(e?.accessToken!==void 0&&e.accessToken!==""&&!(e.externalAuthAddress!==void 0&&e.externalAuthAddress!==""&&e.externalAuthToEntity!==void 0&&e.externalAuthToEntity!=="")){const o=new Headers(e.extraHeaders);return o.set("authorization",`Bearer ${e.accessToken}`),new dr(t,n,o)}return e===void 0||e.credentials===void 0&&e.accessToken===void 0?n(t):mR(a,n,e,t)},rt=/^.*:\/\//u,mR=async(a,e,n,t)=>{const o=new Headers(n.extraHeaders);let i;if(n.accessToken===void 0||n.accessToken===""){const r=new Za({entity:En(n.credentials)&&n.credentials.authEntity?n.credentials.authEntity:a.replace(rt,"")});n.credentials&&(r.credentials=new Zi({type:n.credentials.type,payload:n.credentials.payload}));const c=n.externalAuthAddress??a,d=e({baseUrl:c});i=(await N(_f,d).authenticate(r)).accessToken}else i=n.accessToken;if(n.externalAuthAddress!==void 0&&n.externalAuthAddress!==""&&n.externalAuthToEntity!==void 0&&n.externalAuthToEntity!==""){const r=new Headers;r.set("authorization",`Bearer ${i}`),i="";const c=new Za({entity:n.externalAuthToEntity}),d=e({baseUrl:n.externalAuthAddress});i=(await N(Sf,d).authenticateTo(c,{headers:r})).accessToken}return o.set("authorization",`Bearer ${i}`),new dr(t,e,o)};class dr{transport;extraHeaders;constructor(e,n,t){this.extraHeaders=t,this.transport=n(e)}async unary(e,n,t,o,i,r,c){const d=Mn(i);for(const[p,k]of this.extraHeaders)d.set(p,k);return this.transport.unary(e,n,t,o,d,r,c)}async stream(e,n,t,o,i,r,c){const d=Mn(i);for(const[p,k]of this.extraHeaders)d.set(p,k);return this.transport.stream(e,n,t,o,d,r,c)}}const Mn=a=>{const e=new Headers;if(a!==void 0)if(Array.isArray(a))for(const[n,t]of a)e.append(n,t);else if("forEach"in a)typeof a.forEach=="function"&&a.forEach((n,t)=>{e.append(t,n)});else for(const[n,t]of Object.entries(a))e.append(n,t);return e},cR=async(a,e,n)=>{const t={...n},o=await In(a,t),i=N(nr,o);try{return(await i.optionalWebRTCConfig({},e)).config??new ma}catch(r){if(r instanceof C&&r.code===T.Code.Unimplemented)return new ma;throw r}},lR=async(a,e,n)=>{const t=a.replace(/\/$/u,"");pr(n);const o={headers:{"rpc-host":e}},i=await dR(t,o,n),r=pR(t,n),{pc:c,dc:d}=await Jf(i.disableTrickleICE,i.rtcConfig,i.additionalSdpFields);let p=!1,k;try{k=await In(t,r)}catch(_){throw c.close(),_}const R=N(nr,k),I=new oR(R,o,c,d,i);try{n?.dialTimeout!==void 0&&setTimeout(()=>{p||I.terminate(new Error("timed out"))},n.dialTimeout);const _=await I.doExchange();return n?.externalAuthAddress!==void 0&&n.externalAuthAddress!==""||n?.credentials?.type,p=!0,{transport:_,peerConnection:c,dataChannel:d}}catch(_){throw console.error("error dialing",_),_}finally{p||c.close()}},dR=async(a,e,n)=>{const t=await cR(a,e,n),o=t.additionalIceServers.map(c=>{const d=[];for(const p of c.urls)p.endsWith("udp")&&d.push(`${p.slice(0,-3)}tcp`),d.push(p);return{urls:d,credential:c.credential,username:c.username}}),i=n;let r;return i.webrtcOptions===void 0?r={disableTrickleICE:t.disableTrickle,rtcConfig:{iceServers:o}}:(r=JSON.parse(JSON.stringify(i.webrtcOptions)),r.rtcConfig===void 0?r.rtcConfig={iceServers:o}:r.rtcConfig.iceServers=[...r.rtcConfig.iceServers??[],...o]),r},pR=(a,e)=>{let n=e;return n={...e},e.accessToken===void 0&&(En(n.credentials)&&!n.credentials.authEntity&&(n.credentials.authEntity=n.externalAuthAddress!==void 0&&n.externalAuthAddress!==""?n.externalAuthAddress.replace(rt,""):a.replace(rt,"")),n.credentials=e.webrtcOptions?.signalingCredentials,n.accessToken=e.webrtcOptions?.signalingAccessToken),n.externalAuthAddress=e.webrtcOptions?.signalingExternalAuthAddress,n.externalAuthToEntity=e.webrtcOptions?.signalingExternalAuthToEntity,n},pr=a=>{if(a){if(a.accessToken!==void 0&&a.accessToken.length>0){if(a.credentials)throw new Error("cannot set credentials with accessToken");if(a.webrtcOptions!==void 0){if(a.webrtcOptions.signalingAccessToken!==void 0)throw new Error("cannot set webrtcOptions.signalingAccessToken with accessToken");if(a.webrtcOptions.signalingCredentials!==void 0)throw new Error("cannot set webrtcOptions.signalingCredentials with accessToken")}}if(a.webrtcOptions?.signalingAccessToken!==void 0&&a.webrtcOptions.signalingAccessToken.length>0&&a.webrtcOptions.signalingCredentials!==void 0)throw new Error("cannot set webrtcOptions.signalingCredentials with webrtcOptions.signalingAccessToken")}},uR="v0.1.436",ur=s.makeEnum("viam.common.v1.KinematicsFileFormat",[{no:0,name:"KINEMATICS_FILE_FORMAT_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"KINEMATICS_FILE_FORMAT_SVA",localName:"SVA"},{no:2,name:"KINEMATICS_FILE_FORMAT_URDF",localName:"URDF"}]),x=s.makeMessageType("viam.common.v1.ResourceName",()=>[{no:1,name:"namespace",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"subtype",kind:"scalar",T:9},{no:4,name:"name",kind:"scalar",T:9},{no:5,name:"remote_path",kind:"scalar",T:9,repeated:!0},{no:6,name:"local_name",kind:"scalar",T:9}]),qe=s.makeMessageType("viam.common.v1.Pose",()=>[{no:1,name:"x",kind:"scalar",T:1},{no:2,name:"y",kind:"scalar",T:1},{no:3,name:"z",kind:"scalar",T:1},{no:4,name:"o_x",kind:"scalar",T:1},{no:5,name:"o_y",kind:"scalar",T:1},{no:6,name:"o_z",kind:"scalar",T:1},{no:7,name:"theta",kind:"scalar",T:1}]),gr=s.makeMessageType("viam.common.v1.Orientation",()=>[{no:1,name:"o_x",kind:"scalar",T:1},{no:2,name:"o_y",kind:"scalar",T:1},{no:3,name:"o_z",kind:"scalar",T:1},{no:4,name:"theta",kind:"scalar",T:1}]),rn=s.makeMessageType("viam.common.v1.PoseInFrame",()=>[{no:1,name:"reference_frame",kind:"scalar",T:9},{no:2,name:"pose",kind:"message",T:qe}]),Ue=s.makeMessageType("viam.common.v1.Vector3",()=>[{no:1,name:"x",kind:"scalar",T:1},{no:2,name:"y",kind:"scalar",T:1},{no:3,name:"z",kind:"scalar",T:1}]),Tr=s.makeMessageType("viam.common.v1.Sphere",()=>[{no:1,name:"radius_mm",kind:"scalar",T:1}]),kr=s.makeMessageType("viam.common.v1.Capsule",()=>[{no:1,name:"radius_mm",kind:"scalar",T:1},{no:2,name:"length_mm",kind:"scalar",T:1}]),yr=s.makeMessageType("viam.common.v1.RectangularPrism",()=>[{no:1,name:"dims_mm",kind:"message",T:Ue}]),vr=s.makeMessageType("viam.common.v1.Mesh",()=>[{no:1,name:"content_type",kind:"scalar",T:9},{no:2,name:"mesh",kind:"scalar",T:12}]),He=s.makeMessageType("viam.common.v1.Geometry",()=>[{no:1,name:"center",kind:"message",T:qe},{no:2,name:"sphere",kind:"message",T:Tr,oneof:"geometry_type"},{no:3,name:"box",kind:"message",T:yr,oneof:"geometry_type"},{no:5,name:"capsule",kind:"message",T:kr,oneof:"geometry_type"},{no:6,name:"mesh",kind:"message",T:vr,oneof:"geometry_type"},{no:4,name:"label",kind:"scalar",T:9}]),mt=s.makeMessageType("viam.common.v1.GeometriesInFrame",()=>[{no:1,name:"reference_frame",kind:"scalar",T:9},{no:2,name:"geometries",kind:"message",T:He,repeated:!0}]),ct=s.makeMessageType("viam.common.v1.PointCloudObject",()=>[{no:1,name:"point_cloud",kind:"scalar",T:12},{no:2,name:"geometries",kind:"message",T:mt}]),Je=s.makeMessageType("viam.common.v1.GeoPoint",()=>[{no:1,name:"latitude",kind:"scalar",T:1},{no:2,name:"longitude",kind:"scalar",T:1}]),da=s.makeMessageType("viam.common.v1.GeoGeometry",()=>[{no:1,name:"location",kind:"message",T:Je},{no:2,name:"geometries",kind:"message",T:He,repeated:!0}]),mn=s.makeMessageType("viam.common.v1.Transform",()=>[{no:1,name:"reference_frame",kind:"scalar",T:9},{no:2,name:"pose_in_observer_frame",kind:"message",T:rn},{no:3,name:"physical_object",kind:"message",T:He,opt:!0}]),hr=s.makeMessageType("viam.common.v1.WorldState",()=>[{no:1,name:"obstacles",kind:"message",T:mt,repeated:!0},{no:3,name:"transforms",kind:"message",T:mn,repeated:!0}]),gR=s.makeMessageType("viam.common.v1.ActuatorStatus",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),fr=s.makeMessageType("viam.common.v1.ResponseMetadata",()=>[{no:1,name:"captured_at",kind:"message",T:S,opt:!0}]),q=s.makeMessageType("viam.common.v1.DoCommandRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"command",kind:"message",T:l}]),L=s.makeMessageType("viam.common.v1.DoCommandResponse",()=>[{no:1,name:"result",kind:"message",T:l}]),Rr=s.makeMessageType("viam.common.v1.GetKinematicsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),_r=s.makeMessageType("viam.common.v1.GetKinematicsResponse",()=>[{no:1,name:"format",kind:"enum",T:s.getEnumType(ur)},{no:2,name:"kinematics_data",kind:"scalar",T:12}]),J=s.makeMessageType("viam.common.v1.GetGeometriesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),K=s.makeMessageType("viam.common.v1.GetGeometriesResponse",()=>[{no:1,name:"geometries",kind:"message",T:He,repeated:!0}]),Ke=s.makeMessageType("viam.common.v1.GetReadingsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),pa=s.makeMessageType("viam.common.v1.GetReadingsResponse",()=>[{no:1,name:"readings",kind:"map",K:9,V:{kind:"message",T:X}}]),bn=s.makeMessageType("viam.common.v1.LogEntry",()=>[{no:1,name:"host",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:9},{no:3,name:"time",kind:"message",T:S},{no:4,name:"logger_name",kind:"scalar",T:9},{no:5,name:"message",kind:"scalar",T:9},{no:6,name:"caller",kind:"message",T:l},{no:7,name:"stack",kind:"scalar",T:9},{no:8,name:"fields",kind:"message",T:l,repeated:!0}]),Sr=s.makeExtension("viam.common.v1.safety_heartbeat_monitored",me,{no:84260,kind:"scalar",T:8,opt:!0}),lt=Object.freeze(Object.defineProperty({__proto__:null,ActuatorStatus:gR,Capsule:kr,DoCommandRequest:q,DoCommandResponse:L,GeoGeometry:da,GeoPoint:Je,GeometriesInFrame:mt,Geometry:He,GetGeometriesRequest:J,GetGeometriesResponse:K,GetKinematicsRequest:Rr,GetKinematicsResponse:_r,GetReadingsRequest:Ke,GetReadingsResponse:pa,KinematicsFileFormat:ur,LogEntry:bn,Mesh:vr,Orientation:gr,PointCloudObject:ct,Pose:qe,PoseInFrame:rn,RectangularPrism:yr,ResourceName:x,ResponseMetadata:fr,Sphere:Tr,Transform:mn,Vector3:Ue,WorldState:hr,safety_heartbeat_monitored:Sr},Symbol.toStringTag,{value:"Module"})),dt=new Headers({"viam-client":`typescript;v0.42.0;${uR}`}),G=async function(e,n,t,o={},i={}){const r=new q({name:n,command:t});o.requestLogger?.(r);const d=(await e(r,i)).result?.toJson();return d===void 0?{}:d},TR=(a,e)=>{const n=e??{headers:{}};let t="";if(a===void 0){const o="abcdefghijklmnopqrstuvwxyz";for(let i=0;i<6;i+=1)t+=o[Math.floor(Math.random()*26)]}else t=a;return n.headers.dtname=t,n},kR=a=>{if(a.headers){const{_:e,...n}=a.headers;a.headers=n}},yR=(a,e,n)=>{const t=n??{headers:{}};return t.headers[a]=e,t},vR=(a,e)=>{const{[e]:n,...t}=a.headers;a.headers=t},En=a=>a!==void 0&&"authEntity"in a,hR=async(a,e)=>e.type==="access-token"?In(a,{accessToken:e.payload,extraHeaders:dt}):In(a,{credentials:e,extraHeaders:dt}),pt=5e3;var ne=(a=>(a.CONNECTING="connecting",a.CONNECTED="connected",a.DISCONNECTING="disconnecting",a.DISCONNECTED="disconnected",a))(ne||{});class Ir{listeners={};on(e,n){const{listeners:t}=this;t[e]??=new Set,t[e]?.add(n)}once(e,n){const t=o=>{n(o),this.off(e,n)};this.on(e,t)}has(e,n){return this.listeners[e]?.has(n)}off(e,n){this.listeners[e]?.delete(n)}emit(e,n){for(const t of this.listeners[e]??[])t(n)}}const ut=s.makeMessageType("viam.component.arm.v1.GetEndPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Mr=s.makeMessageType("viam.component.arm.v1.GetEndPositionResponse",()=>[{no:1,name:"pose",kind:"message",T:qe}]),cn=s.makeMessageType("viam.component.arm.v1.JointPositions",()=>[{no:1,name:"values",kind:"scalar",T:1,repeated:!0}]),gt=s.makeMessageType("viam.component.arm.v1.GetJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),br=s.makeMessageType("viam.component.arm.v1.GetJointPositionsResponse",()=>[{no:1,name:"positions",kind:"message",T:cn}]),Tt=s.makeMessageType("viam.component.arm.v1.MoveToPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"to",kind:"message",T:qe},{no:99,name:"extra",kind:"message",T:l}]),Er=s.makeMessageType("viam.component.arm.v1.MoveToPositionResponse",[]),kt=s.makeMessageType("viam.component.arm.v1.MoveToJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions",kind:"message",T:cn},{no:99,name:"extra",kind:"message",T:l}]),wr=s.makeMessageType("viam.component.arm.v1.MoveToJointPositionsResponse",[]),Or=s.makeMessageType("viam.component.arm.v1.MoveThroughJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions",kind:"message",T:cn,repeated:!0},{no:3,name:"options",kind:"message",T:Dr,opt:!0},{no:99,name:"extra",kind:"message",T:l}]),Cr=s.makeMessageType("viam.component.arm.v1.MoveThroughJointPositionsResponse",[]),yt=s.makeMessageType("viam.component.arm.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Nr=s.makeMessageType("viam.component.arm.v1.StopResponse",[]),fR=s.makeMessageType("viam.component.arm.v1.Status",()=>[{no:1,name:"end_position",kind:"message",T:qe},{no:2,name:"joint_positions",kind:"message",T:cn},{no:3,name:"is_moving",kind:"scalar",T:8}]),vt=s.makeMessageType("viam.component.arm.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Pr=s.makeMessageType("viam.component.arm.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),Dr=s.makeMessageType("viam.component.arm.v1.MoveOptions",()=>[{no:1,name:"max_vel_degs_per_sec",kind:"scalar",T:1,opt:!0},{no:2,name:"max_acc_degs_per_sec2",kind:"scalar",T:1,opt:!0}]),Ar=Object.freeze(Object.defineProperty({__proto__:null,GetEndPositionRequest:ut,GetEndPositionResponse:Mr,GetJointPositionsRequest:gt,GetJointPositionsResponse:br,IsMovingRequest:vt,IsMovingResponse:Pr,JointPositions:cn,MoveOptions:Dr,MoveThroughJointPositionsRequest:Or,MoveThroughJointPositionsResponse:Cr,MoveToJointPositionsRequest:kt,MoveToJointPositionsResponse:wr,MoveToPositionRequest:Tt,MoveToPositionResponse:Er,Status:fR,StopRequest:yt,StopResponse:Nr},Symbol.toStringTag,{value:"Module"})),qr={typeName:"viam.component.arm.v1.ArmService",methods:{getEndPosition:{name:"GetEndPosition",I:ut,O:Mr,kind:m.Unary},moveToPosition:{name:"MoveToPosition",I:Tt,O:Er,kind:m.Unary},getJointPositions:{name:"GetJointPositions",I:gt,O:br,kind:m.Unary},moveToJointPositions:{name:"MoveToJointPositions",I:kt,O:wr,kind:m.Unary},moveThroughJointPositions:{name:"MoveThroughJointPositions",I:Or,O:Cr,kind:m.Unary},stop:{name:"Stop",I:yt,O:Nr,kind:m.Unary},isMoving:{name:"IsMoving",I:vt,O:Pr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getKinematics:{name:"GetKinematics",I:Rr,O:_r,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},ht=s.makeMessageType("viam.component.base.v1.MoveStraightRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"distance_mm",kind:"scalar",T:3},{no:3,name:"mm_per_sec",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Ur=s.makeMessageType("viam.component.base.v1.MoveStraightResponse",[]),ft=s.makeMessageType("viam.component.base.v1.SpinRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"angle_deg",kind:"scalar",T:1},{no:3,name:"degs_per_sec",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Lr=s.makeMessageType("viam.component.base.v1.SpinResponse",[]),Rt=s.makeMessageType("viam.component.base.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Gr=s.makeMessageType("viam.component.base.v1.StopResponse",[]),_t=s.makeMessageType("viam.component.base.v1.SetPowerRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"linear",kind:"message",T:Ue},{no:3,name:"angular",kind:"message",T:Ue},{no:99,name:"extra",kind:"message",T:l}]),Br=s.makeMessageType("viam.component.base.v1.SetPowerResponse",[]),St=s.makeMessageType("viam.component.base.v1.SetVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"linear",kind:"message",T:Ue},{no:3,name:"angular",kind:"message",T:Ue},{no:99,name:"extra",kind:"message",T:l}]),Fr=s.makeMessageType("viam.component.base.v1.SetVelocityResponse",[]),It=s.makeMessageType("viam.component.base.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),xr=s.makeMessageType("viam.component.base.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),ua=s.makeMessageType("viam.component.base.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Jr=s.makeMessageType("viam.component.base.v1.GetPropertiesResponse",()=>[{no:1,name:"width_meters",kind:"scalar",T:1},{no:2,name:"turning_radius_meters",kind:"scalar",T:1},{no:3,name:"wheel_circumference_meters",kind:"scalar",T:1}]),zr=Object.freeze(Object.defineProperty({__proto__:null,GetPropertiesRequest:ua,GetPropertiesResponse:Jr,IsMovingRequest:It,IsMovingResponse:xr,MoveStraightRequest:ht,MoveStraightResponse:Ur,SetPowerRequest:_t,SetPowerResponse:Br,SetVelocityRequest:St,SetVelocityResponse:Fr,SpinRequest:ft,SpinResponse:Lr,StopRequest:Rt,StopResponse:Gr},Symbol.toStringTag,{value:"Module"})),Yr={typeName:"viam.component.base.v1.BaseService",methods:{moveStraight:{name:"MoveStraight",I:ht,O:Ur,kind:m.Unary},spin:{name:"Spin",I:ft,O:Lr,kind:m.Unary},setPower:{name:"SetPower",I:_t,O:Br,kind:m.Unary},setVelocity:{name:"SetVelocity",I:St,O:Fr,kind:m.Unary},stop:{name:"Stop",I:Rt,O:Gr,kind:m.Unary},isMoving:{name:"IsMoving",I:It,O:xr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary},getProperties:{name:"GetProperties",I:ua,O:Jr,kind:m.Unary}}},$r=s.makeEnum("viam.component.board.v1.PowerMode",[{no:0,name:"POWER_MODE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"POWER_MODE_NORMAL",localName:"NORMAL"},{no:2,name:"POWER_MODE_OFFLINE_DEEP",localName:"OFFLINE_DEEP"}]),RR=s.makeMessageType("viam.component.board.v1.Status",()=>[{no:1,name:"analogs",kind:"map",K:9,V:{kind:"scalar",T:5}},{no:2,name:"digital_interrupts",kind:"map",K:9,V:{kind:"scalar",T:3}}]),Mt=s.makeMessageType("viam.component.board.v1.SetGPIORequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:3,name:"high",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:l}]),Vr=s.makeMessageType("viam.component.board.v1.SetGPIOResponse",[]),bt=s.makeMessageType("viam.component.board.v1.GetGPIORequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Wr=s.makeMessageType("viam.component.board.v1.GetGPIOResponse",()=>[{no:1,name:"high",kind:"scalar",T:8}]),Et=s.makeMessageType("viam.component.board.v1.PWMRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),jr=s.makeMessageType("viam.component.board.v1.PWMResponse",()=>[{no:1,name:"duty_cycle_pct",kind:"scalar",T:1}]),wt=s.makeMessageType("viam.component.board.v1.SetPWMRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:3,name:"duty_cycle_pct",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Hr=s.makeMessageType("viam.component.board.v1.SetPWMResponse",[]),Ot=s.makeMessageType("viam.component.board.v1.PWMFrequencyRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Kr=s.makeMessageType("viam.component.board.v1.PWMFrequencyResponse",()=>[{no:1,name:"frequency_hz",kind:"scalar",T:4}]),Ct=s.makeMessageType("viam.component.board.v1.SetPWMFrequencyRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:3,name:"frequency_hz",kind:"scalar",T:4},{no:99,name:"extra",kind:"message",T:l}]),Xr=s.makeMessageType("viam.component.board.v1.SetPWMFrequencyResponse",[]),Nt=s.makeMessageType("viam.component.board.v1.ReadAnalogReaderRequest",()=>[{no:1,name:"board_name",kind:"scalar",T:9},{no:2,name:"analog_reader_name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Qr=s.makeMessageType("viam.component.board.v1.ReadAnalogReaderResponse",()=>[{no:1,name:"value",kind:"scalar",T:5},{no:2,name:"min_range",kind:"scalar",T:2},{no:3,name:"max_range",kind:"scalar",T:2},{no:4,name:"step_size",kind:"scalar",T:2}]),Pt=s.makeMessageType("viam.component.board.v1.WriteAnalogRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:5},{no:99,name:"extra",kind:"message",T:l}]),Zr=s.makeMessageType("viam.component.board.v1.WriteAnalogResponse",[]),Dt=s.makeMessageType("viam.component.board.v1.GetDigitalInterruptValueRequest",()=>[{no:1,name:"board_name",kind:"scalar",T:9},{no:2,name:"digital_interrupt_name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),em=s.makeMessageType("viam.component.board.v1.GetDigitalInterruptValueResponse",()=>[{no:1,name:"value",kind:"scalar",T:3}]),At=s.makeMessageType("viam.component.board.v1.StreamTicksRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin_names",kind:"scalar",T:9,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),nm=s.makeMessageType("viam.component.board.v1.StreamTicksResponse",()=>[{no:1,name:"pin_name",kind:"scalar",T:9},{no:2,name:"time",kind:"scalar",T:4},{no:3,name:"high",kind:"scalar",T:8}]),qt=s.makeMessageType("viam.component.board.v1.SetPowerModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"power_mode",kind:"enum",T:s.getEnumType($r)},{no:3,name:"duration",kind:"message",T:F,opt:!0},{no:99,name:"extra",kind:"message",T:l}]),am=s.makeMessageType("viam.component.board.v1.SetPowerModeResponse",[]),tm=Object.freeze(Object.defineProperty({__proto__:null,GetDigitalInterruptValueRequest:Dt,GetDigitalInterruptValueResponse:em,GetGPIORequest:bt,GetGPIOResponse:Wr,PWMFrequencyRequest:Ot,PWMFrequencyResponse:Kr,PWMRequest:Et,PWMResponse:jr,PowerMode:$r,ReadAnalogReaderRequest:Nt,ReadAnalogReaderResponse:Qr,SetGPIORequest:Mt,SetGPIOResponse:Vr,SetPWMFrequencyRequest:Ct,SetPWMFrequencyResponse:Xr,SetPWMRequest:wt,SetPWMResponse:Hr,SetPowerModeRequest:qt,SetPowerModeResponse:am,Status:RR,StreamTicksRequest:At,StreamTicksResponse:nm,WriteAnalogRequest:Pt,WriteAnalogResponse:Zr},Symbol.toStringTag,{value:"Module"})),sm={typeName:"viam.component.board.v1.BoardService",methods:{setGPIO:{name:"SetGPIO",I:Mt,O:Vr,kind:m.Unary},getGPIO:{name:"GetGPIO",I:bt,O:Wr,kind:m.Unary},pWM:{name:"PWM",I:Et,O:jr,kind:m.Unary},setPWM:{name:"SetPWM",I:wt,O:Hr,kind:m.Unary},pWMFrequency:{name:"PWMFrequency",I:Ot,O:Kr,kind:m.Unary},setPWMFrequency:{name:"SetPWMFrequency",I:Ct,O:Xr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},readAnalogReader:{name:"ReadAnalogReader",I:Nt,O:Qr,kind:m.Unary},writeAnalog:{name:"WriteAnalog",I:Pt,O:Zr,kind:m.Unary},getDigitalInterruptValue:{name:"GetDigitalInterruptValue",I:Dt,O:em,kind:m.Unary},streamTicks:{name:"StreamTicks",I:At,O:nm,kind:m.ServerStreaming},setPowerMode:{name:"SetPowerMode",I:qt,O:am,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Ut=s.makeEnum("viam.component.encoder.v1.PositionType",[{no:0,name:"POSITION_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"POSITION_TYPE_TICKS_COUNT",localName:"TICKS_COUNT"},{no:2,name:"POSITION_TYPE_ANGLE_DEGREES",localName:"ANGLE_DEGREES"}]),Lt=s.makeMessageType("viam.component.encoder.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"position_type",kind:"enum",T:s.getEnumType(Ut),opt:!0},{no:99,name:"extra",kind:"message",T:l}]),om=s.makeMessageType("viam.component.encoder.v1.GetPositionResponse",()=>[{no:1,name:"value",kind:"scalar",T:2},{no:2,name:"position_type",kind:"enum",T:s.getEnumType(Ut)}]),Gt=s.makeMessageType("viam.component.encoder.v1.ResetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),im=s.makeMessageType("viam.component.encoder.v1.ResetPositionResponse",[]),Bt=s.makeMessageType("viam.component.encoder.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),rm=s.makeMessageType("viam.component.encoder.v1.GetPropertiesResponse",()=>[{no:1,name:"ticks_count_supported",kind:"scalar",T:8},{no:2,name:"angle_degrees_supported",kind:"scalar",T:8}]),mm=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:Lt,GetPositionResponse:om,GetPropertiesRequest:Bt,GetPropertiesResponse:rm,PositionType:Ut,ResetPositionRequest:Gt,ResetPositionResponse:im},Symbol.toStringTag,{value:"Module"})),cm={typeName:"viam.component.encoder.v1.EncoderService",methods:{getPosition:{name:"GetPosition",I:Lt,O:om,kind:m.Unary},resetPosition:{name:"ResetPosition",I:Gt,O:im,kind:m.Unary},getProperties:{name:"GetProperties",I:Bt,O:rm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Ft=s.makeMessageType("viam.component.gantry.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),lm=s.makeMessageType("viam.component.gantry.v1.GetPositionResponse",()=>[{no:1,name:"positions_mm",kind:"scalar",T:1,repeated:!0}]),xt=s.makeMessageType("viam.component.gantry.v1.MoveToPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions_mm",kind:"scalar",T:1,repeated:!0},{no:3,name:"speeds_mm_per_sec",kind:"scalar",T:1,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),dm=s.makeMessageType("viam.component.gantry.v1.MoveToPositionResponse",[]),Jt=s.makeMessageType("viam.component.gantry.v1.HomeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),pm=s.makeMessageType("viam.component.gantry.v1.HomeResponse",()=>[{no:1,name:"homed",kind:"scalar",T:8}]),zt=s.makeMessageType("viam.component.gantry.v1.GetLengthsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),um=s.makeMessageType("viam.component.gantry.v1.GetLengthsResponse",()=>[{no:1,name:"lengths_mm",kind:"scalar",T:1,repeated:!0}]),Yt=s.makeMessageType("viam.component.gantry.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),gm=s.makeMessageType("viam.component.gantry.v1.StopResponse",[]),_R=s.makeMessageType("viam.component.gantry.v1.Status",()=>[{no:1,name:"positions_mm",kind:"scalar",T:1,repeated:!0},{no:2,name:"lengths_mm",kind:"scalar",T:1,repeated:!0},{no:3,name:"is_moving",kind:"scalar",T:8}]),$t=s.makeMessageType("viam.component.gantry.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Tm=s.makeMessageType("viam.component.gantry.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),SR=Object.freeze(Object.defineProperty({__proto__:null,GetLengthsRequest:zt,GetLengthsResponse:um,GetPositionRequest:Ft,GetPositionResponse:lm,HomeRequest:Jt,HomeResponse:pm,IsMovingRequest:$t,IsMovingResponse:Tm,MoveToPositionRequest:xt,MoveToPositionResponse:dm,Status:_R,StopRequest:Yt,StopResponse:gm},Symbol.toStringTag,{value:"Module"})),km={typeName:"viam.component.gantry.v1.GantryService",methods:{getPosition:{name:"GetPosition",I:Ft,O:lm,kind:m.Unary},moveToPosition:{name:"MoveToPosition",I:xt,O:dm,kind:m.Unary},home:{name:"Home",I:Jt,O:pm,kind:m.Unary},getLengths:{name:"GetLengths",I:zt,O:um,kind:m.Unary},stop:{name:"Stop",I:Yt,O:gm,kind:m.Unary},isMoving:{name:"IsMoving",I:$t,O:Tm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Vt={typeName:"viam.component.generic.v1.GenericService",methods:{doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},IR=Object.freeze(Object.defineProperty({__proto__:null,GenericService:Vt},Symbol.toStringTag,{value:"Module"})),Wt=s.makeMessageType("viam.component.gripper.v1.OpenRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),ym=s.makeMessageType("viam.component.gripper.v1.OpenResponse",[]),jt=s.makeMessageType("viam.component.gripper.v1.GrabRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),vm=s.makeMessageType("viam.component.gripper.v1.GrabResponse",()=>[{no:1,name:"success",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:l}]),Ht=s.makeMessageType("viam.component.gripper.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),hm=s.makeMessageType("viam.component.gripper.v1.StopResponse",[]),Kt=s.makeMessageType("viam.component.gripper.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),fm=s.makeMessageType("viam.component.gripper.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),MR=Object.freeze(Object.defineProperty({__proto__:null,GrabRequest:jt,GrabResponse:vm,IsMovingRequest:Kt,IsMovingResponse:fm,OpenRequest:Wt,OpenResponse:ym,StopRequest:Ht,StopResponse:hm},Symbol.toStringTag,{value:"Module"})),Rm={typeName:"viam.component.gripper.v1.GripperService",methods:{open:{name:"Open",I:Wt,O:ym,kind:m.Unary},grab:{name:"Grab",I:jt,O:vm,kind:m.Unary},stop:{name:"Stop",I:Ht,O:hm,kind:m.Unary},isMoving:{name:"IsMoving",I:Kt,O:fm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},_m=s.makeMessageType("viam.component.inputcontroller.v1.GetControlsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Sm=s.makeMessageType("viam.component.inputcontroller.v1.GetControlsResponse",()=>[{no:1,name:"controls",kind:"scalar",T:9,repeated:!0}]),Xt=s.makeMessageType("viam.component.inputcontroller.v1.GetEventsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Im=s.makeMessageType("viam.component.inputcontroller.v1.GetEventsResponse",()=>[{no:1,name:"events",kind:"message",T:wn,repeated:!0}]),Qt=s.makeMessageType("viam.component.inputcontroller.v1.TriggerEventRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:2,name:"event",kind:"message",T:wn},{no:99,name:"extra",kind:"message",T:l}]),Mm=s.makeMessageType("viam.component.inputcontroller.v1.TriggerEventResponse",[]),wn=s.makeMessageType("viam.component.inputcontroller.v1.Event",()=>[{no:1,name:"time",kind:"message",T:S},{no:2,name:"event",kind:"scalar",T:9},{no:3,name:"control",kind:"scalar",T:9},{no:4,name:"value",kind:"scalar",T:1}]),bm=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:2,name:"events",kind:"message",T:Em,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),Em=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsRequest.Events",()=>[{no:1,name:"control",kind:"scalar",T:9},{no:2,name:"events",kind:"scalar",T:9,repeated:!0},{no:3,name:"cancelled_events",kind:"scalar",T:9,repeated:!0}],{localName:"StreamEventsRequest_Events"}),wm=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsResponse",()=>[{no:1,name:"event",kind:"message",T:wn}]),Om=Object.freeze(Object.defineProperty({__proto__:null,Event:wn,GetControlsRequest:_m,GetControlsResponse:Sm,GetEventsRequest:Xt,GetEventsResponse:Im,Status:s.makeMessageType("viam.component.inputcontroller.v1.Status",()=>[{no:1,name:"events",kind:"message",T:wn,repeated:!0}]),StreamEventsRequest:bm,StreamEventsRequest_Events:Em,StreamEventsResponse:wm,TriggerEventRequest:Qt,TriggerEventResponse:Mm},Symbol.toStringTag,{value:"Module"})),Cm={typeName:"viam.component.inputcontroller.v1.InputControllerService",methods:{getControls:{name:"GetControls",I:_m,O:Sm,kind:m.Unary},getEvents:{name:"GetEvents",I:Xt,O:Im,kind:m.Unary},streamEvents:{name:"StreamEvents",I:bm,O:wm,kind:m.ServerStreaming},triggerEvent:{name:"TriggerEvent",I:Qt,O:Mm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Zt=s.makeMessageType("viam.component.motor.v1.SetPowerRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"power_pct",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Nm=s.makeMessageType("viam.component.motor.v1.SetPowerResponse",[]),es=s.makeMessageType("viam.component.motor.v1.GoForRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"rpm",kind:"scalar",T:1},{no:3,name:"revolutions",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Pm=s.makeMessageType("viam.component.motor.v1.GoForResponse",[]),ns=s.makeMessageType("viam.component.motor.v1.GoToRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"rpm",kind:"scalar",T:1},{no:3,name:"position_revolutions",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Dm=s.makeMessageType("viam.component.motor.v1.GoToResponse",[]),as=s.makeMessageType("viam.component.motor.v1.SetRPMRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"rpm",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Am=s.makeMessageType("viam.component.motor.v1.SetRPMResponse",[]),ts=s.makeMessageType("viam.component.motor.v1.ResetZeroPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"offset",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),qm=s.makeMessageType("viam.component.motor.v1.ResetZeroPositionResponse",[]),ss=s.makeMessageType("viam.component.motor.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Um=s.makeMessageType("viam.component.motor.v1.GetPositionResponse",()=>[{no:1,name:"position",kind:"scalar",T:1}]),os=s.makeMessageType("viam.component.motor.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Lm=s.makeMessageType("viam.component.motor.v1.StopResponse",[]),is=s.makeMessageType("viam.component.motor.v1.IsPoweredRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Gm=s.makeMessageType("viam.component.motor.v1.IsPoweredResponse",()=>[{no:1,name:"is_on",kind:"scalar",T:8},{no:2,name:"power_pct",kind:"scalar",T:1}]),rs=s.makeMessageType("viam.component.motor.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Bm=s.makeMessageType("viam.component.motor.v1.GetPropertiesResponse",()=>[{no:1,name:"position_reporting",kind:"scalar",T:8}]),bR=s.makeMessageType("viam.component.motor.v1.Status",()=>[{no:1,name:"is_powered",kind:"scalar",T:8},{no:3,name:"position",kind:"scalar",T:1},{no:4,name:"is_moving",kind:"scalar",T:8}]),ms=s.makeMessageType("viam.component.motor.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Fm=s.makeMessageType("viam.component.motor.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),ER=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:ss,GetPositionResponse:Um,GetPropertiesRequest:rs,GetPropertiesResponse:Bm,GoForRequest:es,GoForResponse:Pm,GoToRequest:ns,GoToResponse:Dm,IsMovingRequest:ms,IsMovingResponse:Fm,IsPoweredRequest:is,IsPoweredResponse:Gm,ResetZeroPositionRequest:ts,ResetZeroPositionResponse:qm,SetPowerRequest:Zt,SetPowerResponse:Nm,SetRPMRequest:as,SetRPMResponse:Am,Status:bR,StopRequest:os,StopResponse:Lm},Symbol.toStringTag,{value:"Module"})),xm={typeName:"viam.component.motor.v1.MotorService",methods:{setPower:{name:"SetPower",I:Zt,O:Nm,kind:m.Unary},goFor:{name:"GoFor",I:es,O:Pm,kind:m.Unary},goTo:{name:"GoTo",I:ns,O:Dm,kind:m.Unary},setRPM:{name:"SetRPM",I:as,O:Am,kind:m.Unary},resetZeroPosition:{name:"ResetZeroPosition",I:ts,O:qm,kind:m.Unary},getPosition:{name:"GetPosition",I:ss,O:Um,kind:m.Unary},getProperties:{name:"GetProperties",I:rs,O:Bm,kind:m.Unary},stop:{name:"Stop",I:os,O:Lm,kind:m.Unary},isPowered:{name:"IsPowered",I:is,O:Gm,kind:m.Unary},isMoving:{name:"IsMoving",I:ms,O:Fm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},cs=s.makeMessageType("viam.component.movementsensor.v1.GetLinearVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Jm=s.makeMessageType("viam.component.movementsensor.v1.GetLinearVelocityResponse",()=>[{no:1,name:"linear_velocity",kind:"message",T:Ue}]),ls=s.makeMessageType("viam.component.movementsensor.v1.GetAngularVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),zm=s.makeMessageType("viam.component.movementsensor.v1.GetAngularVelocityResponse",()=>[{no:1,name:"angular_velocity",kind:"message",T:Ue}]),ds=s.makeMessageType("viam.component.movementsensor.v1.GetCompassHeadingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Ym=s.makeMessageType("viam.component.movementsensor.v1.GetCompassHeadingResponse",()=>[{no:1,name:"value",kind:"scalar",T:1}]),ps=s.makeMessageType("viam.component.movementsensor.v1.GetOrientationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),$m=s.makeMessageType("viam.component.movementsensor.v1.GetOrientationResponse",()=>[{no:1,name:"orientation",kind:"message",T:gr}]),us=s.makeMessageType("viam.component.movementsensor.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Vm=s.makeMessageType("viam.component.movementsensor.v1.GetPositionResponse",()=>[{no:1,name:"coordinate",kind:"message",T:Je},{no:2,name:"altitude_m",kind:"scalar",T:2}]),gs=s.makeMessageType("viam.component.movementsensor.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Wm=s.makeMessageType("viam.component.movementsensor.v1.GetPropertiesResponse",()=>[{no:1,name:"linear_velocity_supported",kind:"scalar",T:8},{no:2,name:"angular_velocity_supported",kind:"scalar",T:8},{no:3,name:"orientation_supported",kind:"scalar",T:8},{no:4,name:"position_supported",kind:"scalar",T:8},{no:5,name:"compass_heading_supported",kind:"scalar",T:8},{no:6,name:"linear_acceleration_supported",kind:"scalar",T:8}]),Ts=s.makeMessageType("viam.component.movementsensor.v1.GetAccuracyRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),jm=s.makeMessageType("viam.component.movementsensor.v1.GetAccuracyResponse",()=>[{no:1,name:"accuracy",kind:"map",K:9,V:{kind:"scalar",T:2}},{no:2,name:"position_hdop",kind:"scalar",T:2,opt:!0},{no:3,name:"position_vdop",kind:"scalar",T:2,opt:!0},{no:4,name:"position_nmea_gga_fix",kind:"scalar",T:5,opt:!0},{no:5,name:"compass_degrees_error",kind:"scalar",T:2,opt:!0}]),ks=s.makeMessageType("viam.component.movementsensor.v1.GetLinearAccelerationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Hm=s.makeMessageType("viam.component.movementsensor.v1.GetLinearAccelerationResponse",()=>[{no:1,name:"linear_acceleration",kind:"message",T:Ue}]),Km=Object.freeze(Object.defineProperty({__proto__:null,GetAccuracyRequest:Ts,GetAccuracyResponse:jm,GetAngularVelocityRequest:ls,GetAngularVelocityResponse:zm,GetCompassHeadingRequest:ds,GetCompassHeadingResponse:Ym,GetLinearAccelerationRequest:ks,GetLinearAccelerationResponse:Hm,GetLinearVelocityRequest:cs,GetLinearVelocityResponse:Jm,GetOrientationRequest:ps,GetOrientationResponse:$m,GetPositionRequest:us,GetPositionResponse:Vm,GetPropertiesRequest:gs,GetPropertiesResponse:Wm},Symbol.toStringTag,{value:"Module"})),Xm={typeName:"viam.component.movementsensor.v1.MovementSensorService",methods:{getLinearVelocity:{name:"GetLinearVelocity",I:cs,O:Jm,kind:m.Unary},getAngularVelocity:{name:"GetAngularVelocity",I:ls,O:zm,kind:m.Unary},getCompassHeading:{name:"GetCompassHeading",I:ds,O:Ym,kind:m.Unary},getOrientation:{name:"GetOrientation",I:ps,O:$m,kind:m.Unary},getPosition:{name:"GetPosition",I:us,O:Vm,kind:m.Unary},getProperties:{name:"GetProperties",I:gs,O:Wm,kind:m.Unary},getAccuracy:{name:"GetAccuracy",I:Ts,O:jm,kind:m.Unary},getLinearAcceleration:{name:"GetLinearAcceleration",I:ks,O:Hm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary},getReadings:{name:"GetReadings",I:Ke,O:pa,kind:m.Unary}}},ys=s.makeMessageType("viam.component.powersensor.v1.GetVoltageRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Qm=s.makeMessageType("viam.component.powersensor.v1.GetVoltageResponse",()=>[{no:1,name:"volts",kind:"scalar",T:1},{no:2,name:"is_ac",kind:"scalar",T:8}]),vs=s.makeMessageType("viam.component.powersensor.v1.GetCurrentRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Zm=s.makeMessageType("viam.component.powersensor.v1.GetCurrentResponse",()=>[{no:1,name:"amperes",kind:"scalar",T:1},{no:2,name:"is_ac",kind:"scalar",T:8}]),hs=s.makeMessageType("viam.component.powersensor.v1.GetPowerRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),ec=s.makeMessageType("viam.component.powersensor.v1.GetPowerResponse",()=>[{no:1,name:"watts",kind:"scalar",T:1}]),wR=Object.freeze(Object.defineProperty({__proto__:null,GetCurrentRequest:vs,GetCurrentResponse:Zm,GetPowerRequest:hs,GetPowerResponse:ec,GetVoltageRequest:ys,GetVoltageResponse:Qm},Symbol.toStringTag,{value:"Module"})),nc={typeName:"viam.component.powersensor.v1.PowerSensorService",methods:{getVoltage:{name:"GetVoltage",I:ys,O:Qm,kind:m.Unary},getCurrent:{name:"GetCurrent",I:vs,O:Zm,kind:m.Unary},getPower:{name:"GetPower",I:hs,O:ec,kind:m.Unary},getReadings:{name:"GetReadings",I:Ke,O:pa,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},fs=s.makeMessageType("viam.component.servo.v1.MoveRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"angle_deg",kind:"scalar",T:13},{no:99,name:"extra",kind:"message",T:l}]),ac=s.makeMessageType("viam.component.servo.v1.MoveResponse",[]),Rs=s.makeMessageType("viam.component.servo.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),tc=s.makeMessageType("viam.component.servo.v1.GetPositionResponse",()=>[{no:1,name:"position_deg",kind:"scalar",T:13}]),_s=s.makeMessageType("viam.component.servo.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),sc=s.makeMessageType("viam.component.servo.v1.StopResponse",[]),OR=s.makeMessageType("viam.component.servo.v1.Status",()=>[{no:1,name:"position_deg",kind:"scalar",T:13},{no:2,name:"is_moving",kind:"scalar",T:8}]),Ss=s.makeMessageType("viam.component.servo.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),oc=s.makeMessageType("viam.component.servo.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),CR=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:Rs,GetPositionResponse:tc,IsMovingRequest:Ss,IsMovingResponse:oc,MoveRequest:fs,MoveResponse:ac,Status:OR,StopRequest:_s,StopResponse:sc},Symbol.toStringTag,{value:"Module"})),ic={typeName:"viam.component.servo.v1.ServoService",methods:{move:{name:"Move",I:fs,O:ac,kind:m.Unary},getPosition:{name:"GetPosition",I:Rs,O:tc,kind:m.Unary},stop:{name:"Stop",I:_s,O:sc,kind:m.Unary},isMoving:{name:"IsMoving",I:Ss,O:oc,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},rc=s.makeEnum("viam.robot.v1.PeerConnectionType",[{no:0,name:"PEER_CONNECTION_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PEER_CONNECTION_TYPE_GRPC",localName:"GRPC"},{no:2,name:"PEER_CONNECTION_TYPE_WEBRTC",localName:"WEBRTC"}]),mc=s.makeMessageType("viam.robot.v1.TunnelRequest",()=>[{no:1,name:"destination_port",kind:"scalar",T:13},{no:2,name:"data",kind:"scalar",T:12}]),cc=s.makeMessageType("viam.robot.v1.TunnelResponse",()=>[{no:1,name:"data",kind:"scalar",T:12}]),lc=s.makeMessageType("viam.robot.v1.ListTunnelsRequest",[]),dc=s.makeMessageType("viam.robot.v1.ListTunnelsResponse",()=>[{no:1,name:"tunnels",kind:"message",T:pc,repeated:!0}]),pc=s.makeMessageType("viam.robot.v1.Tunnel",()=>[{no:1,name:"port",kind:"scalar",T:13},{no:2,name:"connection_timeout",kind:"message",T:F}]),uc=s.makeMessageType("viam.robot.v1.FrameSystemConfig",()=>[{no:1,name:"frame",kind:"message",T:mn},{no:2,name:"kinematics",kind:"message",T:l}]),gc=s.makeMessageType("viam.robot.v1.FrameSystemConfigRequest",()=>[{no:1,name:"supplemental_transforms",kind:"message",T:mn,repeated:!0}]),Tc=s.makeMessageType("viam.robot.v1.FrameSystemConfigResponse",()=>[{no:1,name:"frame_system_configs",kind:"message",T:uc,repeated:!0}]),Is=s.makeMessageType("viam.robot.v1.TransformPoseRequest",()=>[{no:1,name:"source",kind:"message",T:rn},{no:2,name:"destination",kind:"scalar",T:9},{no:3,name:"supplemental_transforms",kind:"message",T:mn,repeated:!0}]),kc=s.makeMessageType("viam.robot.v1.TransformPoseResponse",()=>[{no:1,name:"pose",kind:"message",T:rn}]),Ms=s.makeMessageType("viam.robot.v1.TransformPCDRequest",()=>[{no:1,name:"point_cloud_pcd",kind:"scalar",T:12},{no:2,name:"source",kind:"scalar",T:9},{no:3,name:"destination",kind:"scalar",T:9}]),yc=s.makeMessageType("viam.robot.v1.TransformPCDResponse",()=>[{no:1,name:"point_cloud_pcd",kind:"scalar",T:12}]),vc=s.makeMessageType("viam.robot.v1.ResourceNamesRequest",[]),hc=s.makeMessageType("viam.robot.v1.ResourceNamesResponse",()=>[{no:1,name:"resources",kind:"message",T:x,repeated:!0}]),fc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtype",()=>[{no:1,name:"subtype",kind:"message",T:x},{no:2,name:"proto_service",kind:"scalar",T:9}]),Rc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtypesRequest",[]),_c=s.makeMessageType("viam.robot.v1.ResourceRPCSubtypesResponse",()=>[{no:1,name:"resource_rpc_subtypes",kind:"message",T:fc,repeated:!0}]),Sc=s.makeMessageType("viam.robot.v1.Operation",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"arguments",kind:"message",T:l},{no:4,name:"started",kind:"message",T:S},{no:5,name:"session_id",kind:"scalar",T:9,opt:!0}]),Ic=s.makeMessageType("viam.robot.v1.GetOperationsRequest",[]),Mc=s.makeMessageType("viam.robot.v1.GetOperationsResponse",()=>[{no:1,name:"operations",kind:"message",T:Sc,repeated:!0}]),bc=s.makeMessageType("viam.robot.v1.CancelOperationRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Ec=s.makeMessageType("viam.robot.v1.CancelOperationResponse",[]),wc=s.makeMessageType("viam.robot.v1.BlockForOperationRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Oc=s.makeMessageType("viam.robot.v1.BlockForOperationResponse",[]),Cc=s.makeMessageType("viam.robot.v1.PeerConnectionInfo",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(rc)},{no:2,name:"remote_address",kind:"scalar",T:9,opt:!0},{no:3,name:"local_address",kind:"scalar",T:9,opt:!0}]),Nc=s.makeMessageType("viam.robot.v1.Session",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"peer_connection_info",kind:"message",T:Cc,opt:!0}]),Pc=s.makeMessageType("viam.robot.v1.GetSessionsRequest",[]),Dc=s.makeMessageType("viam.robot.v1.GetSessionsResponse",()=>[{no:1,name:"sessions",kind:"message",T:Nc,repeated:!0}]),Ac=s.makeMessageType("viam.robot.v1.ModuleModel",()=>[{no:1,name:"module_name",kind:"scalar",T:9},{no:2,name:"model",kind:"scalar",T:9},{no:3,name:"api",kind:"scalar",T:9},{no:4,name:"from_local_module",kind:"scalar",T:8}]),bs=s.makeMessageType("viam.robot.v1.GetModelsFromModulesRequest",[]),qc=s.makeMessageType("viam.robot.v1.GetModelsFromModulesResponse",()=>[{no:1,name:"models",kind:"message",T:Ac,repeated:!0}]),Es=s.makeMessageType("viam.robot.v1.Status",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"status",kind:"message",T:l},{no:3,name:"last_reconfigured",kind:"message",T:S}]),Uc=s.makeMessageType("viam.robot.v1.GetStatusRequest",()=>[{no:1,name:"resource_names",kind:"message",T:x,repeated:!0}]),Lc=s.makeMessageType("viam.robot.v1.GetStatusResponse",()=>[{no:1,name:"status",kind:"message",T:Es,repeated:!0}]),Gc=s.makeMessageType("viam.robot.v1.StreamStatusRequest",()=>[{no:1,name:"resource_names",kind:"message",T:x,repeated:!0},{no:2,name:"every",kind:"message",T:F}]),Bc=s.makeMessageType("viam.robot.v1.StreamStatusResponse",()=>[{no:1,name:"status",kind:"message",T:Es,repeated:!0}]),Fc=s.makeMessageType("viam.robot.v1.StopExtraParameters",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"params",kind:"message",T:l}]),xc=s.makeMessageType("viam.robot.v1.StopAllRequest",()=>[{no:99,name:"extra",kind:"message",T:Fc,repeated:!0}]),Jc=s.makeMessageType("viam.robot.v1.StopAllResponse",[]),ws=s.makeMessageType("viam.robot.v1.StartSessionRequest",()=>[{no:1,name:"resume",kind:"scalar",T:9}]),zc=s.makeMessageType("viam.robot.v1.StartSessionResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"heartbeat_window",kind:"message",T:F}]),Os=s.makeMessageType("viam.robot.v1.SendSessionHeartbeatRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Yc=s.makeMessageType("viam.robot.v1.SendSessionHeartbeatResponse",[]),$c=s.makeMessageType("viam.robot.v1.LogRequest",()=>[{no:1,name:"logs",kind:"message",T:bn,repeated:!0}]),Vc=s.makeMessageType("viam.robot.v1.LogResponse",[]),Wc=s.makeMessageType("viam.robot.v1.GetCloudMetadataRequest",[]),Cs=s.makeMessageType("viam.robot.v1.GetCloudMetadataResponse",()=>[{no:1,name:"robot_part_id",kind:"scalar",T:9},{no:2,name:"primary_org_id",kind:"scalar",T:9},{no:3,name:"location_id",kind:"scalar",T:9},{no:4,name:"machine_id",kind:"scalar",T:9},{no:5,name:"machine_part_id",kind:"scalar",T:9}]),Ns=s.makeMessageType("viam.robot.v1.RestartModuleRequest",()=>[{no:1,name:"module_id",kind:"scalar",T:9,oneof:"id_or_name"},{no:2,name:"module_name",kind:"scalar",T:9,oneof:"id_or_name"}]),jc=s.makeMessageType("viam.robot.v1.RestartModuleResponse",[]),Hc=s.makeMessageType("viam.robot.v1.ShutdownRequest",[]),Kc=s.makeMessageType("viam.robot.v1.ShutdownResponse",[]),Xc=s.makeMessageType("viam.robot.v1.GetMachineStatusRequest",[]),Qc=s.makeMessageType("viam.robot.v1.GetMachineStatusResponse",()=>[{no:1,name:"resources",kind:"message",T:el,repeated:!0},{no:2,name:"config",kind:"message",T:al},{no:3,name:"state",kind:"enum",T:s.getEnumType(Zc)}]),Zc=s.makeEnum("viam.robot.v1.GetMachineStatusResponse.State",[{no:0,name:"STATE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"STATE_INITIALIZING",localName:"INITIALIZING"},{no:2,name:"STATE_RUNNING",localName:"RUNNING"}]),el=s.makeMessageType("viam.robot.v1.ResourceStatus",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"state",kind:"enum",T:s.getEnumType(nl)},{no:3,name:"last_updated",kind:"message",T:S},{no:4,name:"revision",kind:"scalar",T:9},{no:5,name:"error",kind:"scalar",T:9},{no:6,name:"cloud_metadata",kind:"message",T:Cs,opt:!0}]),nl=s.makeEnum("viam.robot.v1.ResourceStatus.State",[{no:0,name:"STATE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"STATE_UNCONFIGURED",localName:"UNCONFIGURED"},{no:2,name:"STATE_CONFIGURING",localName:"CONFIGURING"},{no:3,name:"STATE_READY",localName:"READY"},{no:4,name:"STATE_REMOVING",localName:"REMOVING"},{no:5,name:"STATE_UNHEALTHY",localName:"UNHEALTHY"}]),al=s.makeMessageType("viam.robot.v1.ConfigStatus",()=>[{no:1,name:"revision",kind:"scalar",T:9},{no:2,name:"last_updated",kind:"message",T:S}]),tl=s.makeMessageType("viam.robot.v1.GetVersionRequest",[]),sl=s.makeMessageType("viam.robot.v1.GetVersionResponse",()=>[{no:1,name:"platform",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"api_version",kind:"scalar",T:9}]),NR=Object.freeze(Object.defineProperty({__proto__:null,BlockForOperationRequest:wc,BlockForOperationResponse:Oc,CancelOperationRequest:bc,CancelOperationResponse:Ec,ConfigStatus:al,FrameSystemConfig:uc,FrameSystemConfigRequest:gc,FrameSystemConfigResponse:Tc,GetCloudMetadataRequest:Wc,GetCloudMetadataResponse:Cs,GetMachineStatusRequest:Xc,GetMachineStatusResponse:Qc,GetMachineStatusResponse_State:Zc,GetModelsFromModulesRequest:bs,GetModelsFromModulesResponse:qc,GetOperationsRequest:Ic,GetOperationsResponse:Mc,GetSessionsRequest:Pc,GetSessionsResponse:Dc,GetStatusRequest:Uc,GetStatusResponse:Lc,GetVersionRequest:tl,GetVersionResponse:sl,ListTunnelsRequest:lc,ListTunnelsResponse:dc,LogRequest:$c,LogResponse:Vc,ModuleModel:Ac,Operation:Sc,PeerConnectionInfo:Cc,PeerConnectionType:rc,ResourceNamesRequest:vc,ResourceNamesResponse:hc,ResourceRPCSubtype:fc,ResourceRPCSubtypesRequest:Rc,ResourceRPCSubtypesResponse:_c,ResourceStatus:el,ResourceStatus_State:nl,RestartModuleRequest:Ns,RestartModuleResponse:jc,SendSessionHeartbeatRequest:Os,SendSessionHeartbeatResponse:Yc,Session:Nc,ShutdownRequest:Hc,ShutdownResponse:Kc,StartSessionRequest:ws,StartSessionResponse:zc,Status:Es,StopAllRequest:xc,StopAllResponse:Jc,StopExtraParameters:Fc,StreamStatusRequest:Gc,StreamStatusResponse:Bc,TransformPCDRequest:Ms,TransformPCDResponse:yc,TransformPoseRequest:Is,TransformPoseResponse:kc,Tunnel:pc,TunnelRequest:mc,TunnelResponse:cc},Symbol.toStringTag,{value:"Module"})),Ps={typeName:"viam.robot.v1.RobotService",methods:{getOperations:{name:"GetOperations",I:Ic,O:Mc,kind:m.Unary},getSessions:{name:"GetSessions",I:Pc,O:Dc,kind:m.Unary},resourceNames:{name:"ResourceNames",I:vc,O:hc,kind:m.Unary},resourceRPCSubtypes:{name:"ResourceRPCSubtypes",I:Rc,O:_c,kind:m.Unary},cancelOperation:{name:"CancelOperation",I:bc,O:Ec,kind:m.Unary},blockForOperation:{name:"BlockForOperation",I:wc,O:Oc,kind:m.Unary},getModelsFromModules:{name:"GetModelsFromModules",I:bs,O:qc,kind:m.Unary},frameSystemConfig:{name:"FrameSystemConfig",I:gc,O:Tc,kind:m.Unary},transformPose:{name:"TransformPose",I:Is,O:kc,kind:m.Unary},transformPCD:{name:"TransformPCD",I:Ms,O:yc,kind:m.Unary},getStatus:{name:"GetStatus",I:Uc,O:Lc,kind:m.Unary},streamStatus:{name:"StreamStatus",I:Gc,O:Bc,kind:m.ServerStreaming},stopAll:{name:"StopAll",I:xc,O:Jc,kind:m.Unary},startSession:{name:"StartSession",I:ws,O:zc,kind:m.Unary},sendSessionHeartbeat:{name:"SendSessionHeartbeat",I:Os,O:Yc,kind:m.Unary},log:{name:"Log",I:$c,O:Vc,kind:m.Unary},getCloudMetadata:{name:"GetCloudMetadata",I:Wc,O:Cs,kind:m.Unary},restartModule:{name:"RestartModule",I:Ns,O:jc,kind:m.Unary},shutdown:{name:"Shutdown",I:Hc,O:Kc,kind:m.Unary},getMachineStatus:{name:"GetMachineStatus",I:Xc,O:Qc,kind:m.Unary},getVersion:{name:"GetVersion",I:tl,O:sl,kind:m.Unary},tunnel:{name:"Tunnel",I:mc,O:cc,kind:m.BiDiStreaming},listTunnels:{name:"ListTunnels",I:lc,O:dc,kind:m.Unary}}},Ds=s.makeEnum("viam.app.v1.CredentialsType",[{no:0,name:"CREDENTIALS_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"CREDENTIALS_TYPE_INTERNAL",localName:"INTERNAL"},{no:2,name:"CREDENTIALS_TYPE_API_KEY",localName:"API_KEY"},{no:3,name:"CREDENTIALS_TYPE_ROBOT_SECRET",localName:"ROBOT_SECRET"},{no:4,name:"CREDENTIALS_TYPE_ROBOT_LOCATION_SECRET",localName:"ROBOT_LOCATION_SECRET"}]),ol=s.makeMessageType("viam.app.v1.RobotConfig",()=>[{no:1,name:"cloud",kind:"message",T:ml},{no:2,name:"remotes",kind:"message",T:bl,repeated:!0},{no:3,name:"components",kind:"message",T:As,repeated:!0},{no:4,name:"processes",kind:"message",T:cl,repeated:!0},{no:5,name:"services",kind:"message",T:ll,repeated:!0},{no:6,name:"network",kind:"message",T:dl,opt:!0},{no:7,name:"auth",kind:"message",T:gl,opt:!0},{no:8,name:"debug",kind:"scalar",T:8,opt:!0},{no:9,name:"modules",kind:"message",T:Cl,repeated:!0},{no:10,name:"disable_partial_start",kind:"scalar",T:8,opt:!0},{no:11,name:"packages",kind:"message",T:Nl,repeated:!0},{no:12,name:"overwrite_fragment_status",kind:"message",T:ga,repeated:!0},{no:13,name:"enable_web_profile",kind:"scalar",T:8},{no:14,name:"log",kind:"message",T:il,repeated:!0},{no:15,name:"revision",kind:"scalar",T:9},{no:16,name:"maintenance",kind:"message",T:Pl,opt:!0},{no:17,name:"disable_log_deduplication",kind:"scalar",T:8}]),il=s.makeMessageType("viam.app.v1.LogPatternConfig",()=>[{no:1,name:"pattern",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:9}]),rl=s.makeMessageType("viam.app.v1.LocationSecret",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"secret",kind:"scalar",T:9}]),ga=s.makeMessageType("viam.app.v1.AppValidationStatus",()=>[{no:1,name:"error",kind:"scalar",T:9}]),ml=s.makeMessageType("viam.app.v1.CloudConfig",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"fqdn",kind:"scalar",T:9},{no:3,name:"local_fqdn",kind:"scalar",T:9},{no:4,name:"managed_by",kind:"scalar",T:9},{no:5,name:"signaling_address",kind:"scalar",T:9},{no:6,name:"signaling_insecure",kind:"scalar",T:8},{no:7,name:"location_secret",kind:"scalar",T:9},{no:8,name:"secret",kind:"scalar",T:9},{no:9,name:"location_secrets",kind:"message",T:rl,repeated:!0},{no:10,name:"primary_org_id",kind:"scalar",T:9},{no:11,name:"location_id",kind:"scalar",T:9},{no:12,name:"machine_id",kind:"scalar",T:9}]),As=s.makeMessageType("viam.app.v1.ComponentConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"namespace",kind:"scalar",T:9},{no:3,name:"type",kind:"scalar",T:9},{no:4,name:"model",kind:"scalar",T:9},{no:5,name:"frame",kind:"message",T:qs},{no:6,name:"depends_on",kind:"scalar",T:9,repeated:!0},{no:7,name:"service_configs",kind:"message",T:Ta,repeated:!0},{no:8,name:"attributes",kind:"message",T:l},{no:9,name:"api",kind:"scalar",T:9},{no:10,name:"log_configuration",kind:"message",T:Us}]),Ta=s.makeMessageType("viam.app.v1.ResourceLevelServiceConfig",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"attributes",kind:"message",T:l}]),cl=s.makeMessageType("viam.app.v1.ProcessConfig",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"args",kind:"scalar",T:9,repeated:!0},{no:4,name:"cwd",kind:"scalar",T:9},{no:5,name:"one_shot",kind:"scalar",T:8},{no:6,name:"log",kind:"scalar",T:8},{no:7,name:"stop_signal",kind:"scalar",T:5},{no:8,name:"stop_timeout",kind:"message",T:F},{no:9,name:"env",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:10,name:"username",kind:"scalar",T:9}]),ll=s.makeMessageType("viam.app.v1.ServiceConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"namespace",kind:"scalar",T:9},{no:3,name:"type",kind:"scalar",T:9},{no:4,name:"attributes",kind:"message",T:l},{no:5,name:"depends_on",kind:"scalar",T:9,repeated:!0},{no:6,name:"model",kind:"scalar",T:9},{no:9,name:"api",kind:"scalar",T:9},{no:10,name:"service_configs",kind:"message",T:Ta,repeated:!0},{no:11,name:"log_configuration",kind:"message",T:Us}]),dl=s.makeMessageType("viam.app.v1.NetworkConfig",()=>[{no:1,name:"fqdn",kind:"scalar",T:9},{no:2,name:"bind_address",kind:"scalar",T:9},{no:3,name:"tls_cert_file",kind:"scalar",T:9},{no:4,name:"tls_key_file",kind:"scalar",T:9},{no:5,name:"sessions",kind:"message",T:pl},{no:6,name:"traffic_tunnel_endpoints",kind:"message",T:ul,repeated:!0},{no:7,name:"no_tls",kind:"scalar",T:8}]),pl=s.makeMessageType("viam.app.v1.SessionsConfig",()=>[{no:1,name:"heartbeat_window",kind:"message",T:F}]),ul=s.makeMessageType("viam.app.v1.TrafficTunnelEndpoint",()=>[{no:1,name:"port",kind:"scalar",T:5},{no:2,name:"connection_timeout",kind:"message",T:F}]),gl=s.makeMessageType("viam.app.v1.AuthConfig",()=>[{no:1,name:"handlers",kind:"message",T:yl,repeated:!0},{no:2,name:"tls_auth_entities",kind:"scalar",T:9,repeated:!0},{no:3,name:"external_auth_config",kind:"message",T:kl,opt:!0}]),Tl=s.makeMessageType("viam.app.v1.JWKSFile",()=>[{no:1,name:"json",kind:"message",T:l}]),kl=s.makeMessageType("viam.app.v1.ExternalAuthConfig",()=>[{no:1,name:"jwks",kind:"message",T:Tl}]),yl=s.makeMessageType("viam.app.v1.AuthHandlerConfig",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Ds)},{no:5,name:"config",kind:"message",T:l}]),qs=s.makeMessageType("viam.app.v1.Frame",()=>[{no:1,name:"parent",kind:"scalar",T:9},{no:2,name:"translation",kind:"message",T:vl},{no:3,name:"orientation",kind:"message",T:hl},{no:4,name:"geometry",kind:"message",T:He}]),Us=s.makeMessageType("viam.app.v1.LogConfiguration",()=>[{no:1,name:"level",kind:"scalar",T:9}]),vl=s.makeMessageType("viam.app.v1.Translation",()=>[{no:1,name:"x",kind:"scalar",T:1},{no:2,name:"y",kind:"scalar",T:1},{no:3,name:"z",kind:"scalar",T:1}]),hl=s.makeMessageType("viam.app.v1.Orientation",()=>[{no:1,name:"no_orientation",kind:"message",T:fl,oneof:"type"},{no:2,name:"vector_radians",kind:"message",T:Rl,oneof:"type"},{no:3,name:"vector_degrees",kind:"message",T:_l,oneof:"type"},{no:4,name:"euler_angles",kind:"message",T:Sl,oneof:"type"},{no:5,name:"axis_angles",kind:"message",T:Il,oneof:"type"},{no:6,name:"quaternion",kind:"message",T:Ml,oneof:"type"}]),fl=s.makeMessageType("viam.app.v1.Orientation.NoOrientation",[],{localName:"Orientation_NoOrientation"}),Rl=s.makeMessageType("viam.app.v1.Orientation.OrientationVectorRadians",()=>[{no:1,name:"theta",kind:"scalar",T:1},{no:2,name:"x",kind:"scalar",T:1},{no:3,name:"y",kind:"scalar",T:1},{no:4,name:"z",kind:"scalar",T:1}],{localName:"Orientation_OrientationVectorRadians"}),_l=s.makeMessageType("viam.app.v1.Orientation.OrientationVectorDegrees",()=>[{no:1,name:"theta",kind:"scalar",T:1},{no:2,name:"x",kind:"scalar",T:1},{no:3,name:"y",kind:"scalar",T:1},{no:4,name:"z",kind:"scalar",T:1}],{localName:"Orientation_OrientationVectorDegrees"}),Sl=s.makeMessageType("viam.app.v1.Orientation.EulerAngles",()=>[{no:1,name:"roll",kind:"scalar",T:1},{no:2,name:"pitch",kind:"scalar",T:1},{no:3,name:"yaw",kind:"scalar",T:1}],{localName:"Orientation_EulerAngles"}),Il=s.makeMessageType("viam.app.v1.Orientation.AxisAngles",()=>[{no:1,name:"theta",kind:"scalar",T:1},{no:2,name:"x",kind:"scalar",T:1},{no:3,name:"y",kind:"scalar",T:1},{no:4,name:"z",kind:"scalar",T:1}],{localName:"Orientation_AxisAngles"}),Ml=s.makeMessageType("viam.app.v1.Orientation.Quaternion",()=>[{no:1,name:"w",kind:"scalar",T:1},{no:2,name:"x",kind:"scalar",T:1},{no:3,name:"y",kind:"scalar",T:1},{no:4,name:"z",kind:"scalar",T:1}],{localName:"Orientation_Quaternion"}),bl=s.makeMessageType("viam.app.v1.RemoteConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"address",kind:"scalar",T:9},{no:3,name:"frame",kind:"message",T:qs},{no:4,name:"auth",kind:"message",T:El},{no:5,name:"managed_by",kind:"scalar",T:9},{no:6,name:"insecure",kind:"scalar",T:8},{no:7,name:"connection_check_interval",kind:"message",T:F},{no:8,name:"reconnect_interval",kind:"message",T:F},{no:9,name:"service_configs",kind:"message",T:Ta,repeated:!0},{no:10,name:"secret",kind:"scalar",T:9}]),El=s.makeMessageType("viam.app.v1.RemoteAuth",()=>[{no:1,name:"credentials",kind:"message",T:wl},{no:2,name:"entity",kind:"scalar",T:9}]),wl=s.makeMessageType("viam.app.v1.RemoteAuth.Credentials",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Ds)},{no:2,name:"payload",kind:"scalar",T:9}],{localName:"RemoteAuth_Credentials"}),Ol=s.makeMessageType("viam.app.v1.AgentInfo",()=>[{no:1,name:"host",kind:"scalar",T:9},{no:2,name:"os",kind:"scalar",T:9},{no:3,name:"ips",kind:"scalar",T:9,repeated:!0},{no:4,name:"version",kind:"scalar",T:9},{no:5,name:"git_revision",kind:"scalar",T:9},{no:6,name:"platform",kind:"scalar",T:9,opt:!0},{no:7,name:"platform_tags",kind:"scalar",T:9,repeated:!0}]),PR=s.makeMessageType("viam.app.v1.ConfigRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"agent_info",kind:"message",T:Ol,opt:!0}]),DR=s.makeMessageType("viam.app.v1.ConfigResponse",()=>[{no:1,name:"config",kind:"message",T:ol}]),AR=s.makeMessageType("viam.app.v1.CertificateRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),qR=s.makeMessageType("viam.app.v1.CertificateResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"tls_certificate",kind:"scalar",T:9},{no:3,name:"tls_private_key",kind:"scalar",T:9}]),UR=s.makeMessageType("viam.app.v1.LogRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"logs",kind:"message",T:bn,repeated:!0}]),LR=s.makeMessageType("viam.app.v1.LogResponse",[]),GR=s.makeMessageType("viam.app.v1.NeedsRestartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),BR=s.makeMessageType("viam.app.v1.NeedsRestartResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"must_restart",kind:"scalar",T:8},{no:3,name:"restart_check_interval",kind:"message",T:F}]),Cl=s.makeMessageType("viam.app.v1.ModuleConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"path",kind:"scalar",T:9},{no:3,name:"log_level",kind:"scalar",T:9},{no:4,name:"type",kind:"scalar",T:9},{no:5,name:"module_id",kind:"scalar",T:9},{no:6,name:"env",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"status",kind:"message",T:ga},{no:8,name:"first_run_timeout",kind:"message",T:F}]),Nl=s.makeMessageType("viam.app.v1.PackageConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"package",kind:"scalar",T:9},{no:3,name:"version",kind:"scalar",T:9},{no:4,name:"type",kind:"scalar",T:9},{no:5,name:"status",kind:"message",T:ga}]),Pl=s.makeMessageType("viam.app.v1.MaintenanceConfig",()=>[{no:1,name:"sensor_name",kind:"message",T:x},{no:2,name:"maintenance_allowed_key",kind:"scalar",T:9}]),FR=Object.freeze(Object.defineProperty({__proto__:null,AgentInfo:Ol,AppValidationStatus:ga,AuthConfig:gl,AuthHandlerConfig:yl,CertificateRequest:AR,CertificateResponse:qR,CloudConfig:ml,ComponentConfig:As,ConfigRequest:PR,ConfigResponse:DR,CredentialsType:Ds,ExternalAuthConfig:kl,Frame:qs,JWKSFile:Tl,LocationSecret:rl,LogConfiguration:Us,LogPatternConfig:il,LogRequest:UR,LogResponse:LR,MaintenanceConfig:Pl,ModuleConfig:Cl,NeedsRestartRequest:GR,NeedsRestartResponse:BR,NetworkConfig:dl,Orientation:hl,Orientation_AxisAngles:Il,Orientation_EulerAngles:Sl,Orientation_NoOrientation:fl,Orientation_OrientationVectorDegrees:_l,Orientation_OrientationVectorRadians:Rl,Orientation_Quaternion:Ml,PackageConfig:Nl,ProcessConfig:cl,RemoteAuth:El,RemoteAuth_Credentials:wl,RemoteConfig:bl,ResourceLevelServiceConfig:Ta,RobotConfig:ol,ServiceConfig:ll,SessionsConfig:pl,TrafficTunnelEndpoint:ul,Translation:vl},Symbol.toStringTag,{value:"Module"})),Ls=s.makeMessageType("viam.service.discovery.v1.DiscoverResourcesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Dl=s.makeMessageType("viam.service.discovery.v1.DiscoverResourcesResponse",()=>[{no:1,name:"discoveries",kind:"message",T:As,repeated:!0}]),xR=Object.freeze(Object.defineProperty({__proto__:null,DiscoverResourcesRequest:Ls,DiscoverResourcesResponse:Dl},Symbol.toStringTag,{value:"Module"})),Al={typeName:"viam.service.discovery.v1.DiscoveryService",methods:{discoverResources:{name:"DiscoverResources",I:Ls,O:Dl,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},ql=s.makeEnum("viam.service.motion.v1.PlanState",[{no:0,name:"PLAN_STATE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PLAN_STATE_IN_PROGRESS",localName:"IN_PROGRESS"},{no:2,name:"PLAN_STATE_STOPPED",localName:"STOPPED"},{no:3,name:"PLAN_STATE_SUCCEEDED",localName:"SUCCEEDED"},{no:4,name:"PLAN_STATE_FAILED",localName:"FAILED"}]),Gs=s.makeMessageType("viam.service.motion.v1.MoveRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"destination",kind:"message",T:rn},{no:3,name:"component_name",kind:"message",T:x},{no:4,name:"world_state",kind:"message",T:hr,opt:!0},{no:5,name:"constraints",kind:"message",T:Yl,opt:!0},{no:99,name:"extra",kind:"message",T:l}]),Ul=s.makeMessageType("viam.service.motion.v1.MoveResponse",()=>[{no:1,name:"success",kind:"scalar",T:8}]),Bs=s.makeMessageType("viam.service.motion.v1.MoveOnMapRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"destination",kind:"message",T:qe},{no:3,name:"component_name",kind:"message",T:x},{no:4,name:"slam_service_name",kind:"message",T:x},{no:5,name:"motion_configuration",kind:"message",T:Fs,opt:!0},{no:6,name:"obstacles",kind:"message",T:He,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),Ll=s.makeMessageType("viam.service.motion.v1.MoveOnMapResponse",()=>[{no:1,name:"execution_id",kind:"scalar",T:9}]),Gl=s.makeMessageType("viam.service.motion.v1.ObstacleDetector",()=>[{no:1,name:"vision_service",kind:"message",T:x},{no:2,name:"camera",kind:"message",T:x}]),Fs=s.makeMessageType("viam.service.motion.v1.MotionConfiguration",()=>[{no:1,name:"obstacle_detectors",kind:"message",T:Gl,repeated:!0},{no:2,name:"position_polling_frequency_hz",kind:"scalar",T:1,opt:!0},{no:3,name:"obstacle_polling_frequency_hz",kind:"scalar",T:1,opt:!0},{no:4,name:"plan_deviation_m",kind:"scalar",T:1,opt:!0},{no:5,name:"linear_m_per_sec",kind:"scalar",T:1,opt:!0},{no:6,name:"angular_degs_per_sec",kind:"scalar",T:1,opt:!0}]),xs=s.makeMessageType("viam.service.motion.v1.MoveOnGlobeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"destination",kind:"message",T:Je},{no:3,name:"heading",kind:"scalar",T:1,opt:!0},{no:4,name:"component_name",kind:"message",T:x},{no:5,name:"movement_sensor_name",kind:"message",T:x},{no:6,name:"obstacles",kind:"message",T:da,repeated:!0},{no:7,name:"motion_configuration",kind:"message",T:Fs,opt:!0},{no:8,name:"bounding_regions",kind:"message",T:da,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),Bl=s.makeMessageType("viam.service.motion.v1.MoveOnGlobeResponse",()=>[{no:1,name:"execution_id",kind:"scalar",T:9}]),Js=s.makeMessageType("viam.service.motion.v1.GetPoseRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:3,name:"destination_frame",kind:"scalar",T:9},{no:4,name:"supplemental_transforms",kind:"message",T:mn,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),Fl=s.makeMessageType("viam.service.motion.v1.GetPoseResponse",()=>[{no:1,name:"pose",kind:"message",T:rn}]),zs=s.makeMessageType("viam.service.motion.v1.StopPlanRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:99,name:"extra",kind:"message",T:l}]),xl=s.makeMessageType("viam.service.motion.v1.StopPlanResponse",[]),Ys=s.makeMessageType("viam.service.motion.v1.ListPlanStatusesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"only_active_plans",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:l}]),Jl=s.makeMessageType("viam.service.motion.v1.ListPlanStatusesResponse",()=>[{no:1,name:"plan_statuses_with_ids",kind:"message",T:Hl,repeated:!0}]),$s=s.makeMessageType("viam.service.motion.v1.GetPlanRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:3,name:"last_plan_only",kind:"scalar",T:8},{no:4,name:"execution_id",kind:"scalar",T:9,opt:!0},{no:99,name:"extra",kind:"message",T:l}]),zl=s.makeMessageType("viam.service.motion.v1.GetPlanResponse",()=>[{no:1,name:"current_plan_with_status",kind:"message",T:Vs},{no:2,name:"replan_history",kind:"message",T:Vs,repeated:!0}]),Yl=s.makeMessageType("viam.service.motion.v1.Constraints",()=>[{no:1,name:"linear_constraint",kind:"message",T:$l,repeated:!0},{no:2,name:"orientation_constraint",kind:"message",T:Vl,repeated:!0},{no:3,name:"collision_specification",kind:"message",T:Wl,repeated:!0}]),$l=s.makeMessageType("viam.service.motion.v1.LinearConstraint",()=>[{no:1,name:"line_tolerance_mm",kind:"scalar",T:2,opt:!0},{no:2,name:"orientation_tolerance_degs",kind:"scalar",T:2,opt:!0}]),Vl=s.makeMessageType("viam.service.motion.v1.OrientationConstraint",()=>[{no:1,name:"orientation_tolerance_degs",kind:"scalar",T:2,opt:!0}]),Wl=s.makeMessageType("viam.service.motion.v1.CollisionSpecification",()=>[{no:1,name:"allows",kind:"message",T:jl,repeated:!0}]),jl=s.makeMessageType("viam.service.motion.v1.CollisionSpecification.AllowedFrameCollisions",()=>[{no:1,name:"frame1",kind:"scalar",T:9},{no:2,name:"frame2",kind:"scalar",T:9}],{localName:"CollisionSpecification_AllowedFrameCollisions"}),Vs=s.makeMessageType("viam.service.motion.v1.PlanWithStatus",()=>[{no:1,name:"plan",kind:"message",T:Kl},{no:2,name:"status",kind:"message",T:ka},{no:3,name:"status_history",kind:"message",T:ka,repeated:!0}]),Hl=s.makeMessageType("viam.service.motion.v1.PlanStatusWithID",()=>[{no:1,name:"plan_id",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:3,name:"execution_id",kind:"scalar",T:9},{no:4,name:"status",kind:"message",T:ka}]),ka=s.makeMessageType("viam.service.motion.v1.PlanStatus",()=>[{no:1,name:"state",kind:"enum",T:s.getEnumType(ql)},{no:2,name:"timestamp",kind:"message",T:S},{no:3,name:"reason",kind:"scalar",T:9,opt:!0}]),Kl=s.makeMessageType("viam.service.motion.v1.Plan",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:3,name:"execution_id",kind:"scalar",T:9},{no:4,name:"steps",kind:"message",T:Xl,repeated:!0}]),Xl=s.makeMessageType("viam.service.motion.v1.PlanStep",()=>[{no:1,name:"step",kind:"map",K:9,V:{kind:"message",T:Ql}}]),Ql=s.makeMessageType("viam.service.motion.v1.ComponentState",()=>[{no:1,name:"pose",kind:"message",T:qe}]),Zl=Object.freeze(Object.defineProperty({__proto__:null,CollisionSpecification:Wl,CollisionSpecification_AllowedFrameCollisions:jl,ComponentState:Ql,Constraints:Yl,GetPlanRequest:$s,GetPlanResponse:zl,GetPoseRequest:Js,GetPoseResponse:Fl,LinearConstraint:$l,ListPlanStatusesRequest:Ys,ListPlanStatusesResponse:Jl,MotionConfiguration:Fs,MoveOnGlobeRequest:xs,MoveOnGlobeResponse:Bl,MoveOnMapRequest:Bs,MoveOnMapResponse:Ll,MoveRequest:Gs,MoveResponse:Ul,ObstacleDetector:Gl,OrientationConstraint:Vl,Plan:Kl,PlanState:ql,PlanStatus:ka,PlanStatusWithID:Hl,PlanStep:Xl,PlanWithStatus:Vs,StopPlanRequest:zs,StopPlanResponse:xl},Symbol.toStringTag,{value:"Module"})),ed={typeName:"viam.service.motion.v1.MotionService",methods:{move:{name:"Move",I:Gs,O:Ul,kind:m.Unary},moveOnMap:{name:"MoveOnMap",I:Bs,O:Ll,kind:m.Unary},moveOnGlobe:{name:"MoveOnGlobe",I:xs,O:Bl,kind:m.Unary},getPose:{name:"GetPose",I:Js,O:Fl,kind:m.Unary},stopPlan:{name:"StopPlan",I:zs,O:xl,kind:m.Unary},listPlanStatuses:{name:"ListPlanStatuses",I:Ys,O:Jl,kind:m.Unary},getPlan:{name:"GetPlan",I:$s,O:zl,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},nd=s.makeEnum("viam.service.navigation.v1.MapType",[{no:0,name:"MAP_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MAP_TYPE_NONE",localName:"NONE"},{no:2,name:"MAP_TYPE_GPS",localName:"GPS"}]),Ws=s.makeEnum("viam.service.navigation.v1.Mode",[{no:0,name:"MODE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MODE_MANUAL",localName:"MANUAL"},{no:2,name:"MODE_WAYPOINT",localName:"WAYPOINT"},{no:3,name:"MODE_EXPLORE",localName:"EXPLORE"}]),js=s.makeMessageType("viam.service.navigation.v1.GetModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),ad=s.makeMessageType("viam.service.navigation.v1.GetModeResponse",()=>[{no:1,name:"mode",kind:"enum",T:s.getEnumType(Ws)}]),Hs=s.makeMessageType("viam.service.navigation.v1.SetModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mode",kind:"enum",T:s.getEnumType(Ws)},{no:99,name:"extra",kind:"message",T:l}]),td=s.makeMessageType("viam.service.navigation.v1.SetModeResponse",[]),sd=s.makeMessageType("viam.service.navigation.v1.Waypoint",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"location",kind:"message",T:Je}]),Ks=s.makeMessageType("viam.service.navigation.v1.GetLocationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),od=s.makeMessageType("viam.service.navigation.v1.GetLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Je},{no:2,name:"compass_heading",kind:"scalar",T:1}]),Xs=s.makeMessageType("viam.service.navigation.v1.GetWaypointsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),id=s.makeMessageType("viam.service.navigation.v1.GetWaypointsResponse",()=>[{no:1,name:"waypoints",kind:"message",T:sd,repeated:!0}]),Qs=s.makeMessageType("viam.service.navigation.v1.AddWaypointRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"location",kind:"message",T:Je},{no:99,name:"extra",kind:"message",T:l}]),rd=s.makeMessageType("viam.service.navigation.v1.AddWaypointResponse",[]),Zs=s.makeMessageType("viam.service.navigation.v1.RemoveWaypointRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),md=s.makeMessageType("viam.service.navigation.v1.RemoveWaypointResponse",[]),eo=s.makeMessageType("viam.service.navigation.v1.GetObstaclesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),cd=s.makeMessageType("viam.service.navigation.v1.GetObstaclesResponse",()=>[{no:1,name:"obstacles",kind:"message",T:da,repeated:!0}]),ld=s.makeMessageType("viam.service.navigation.v1.Path",()=>[{no:1,name:"destination_waypoint_id",kind:"scalar",T:9},{no:2,name:"geopoints",kind:"message",T:Je,repeated:!0}]),no=s.makeMessageType("viam.service.navigation.v1.GetPathsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),dd=s.makeMessageType("viam.service.navigation.v1.GetPathsResponse",()=>[{no:1,name:"paths",kind:"message",T:ld,repeated:!0}]),ao=s.makeMessageType("viam.service.navigation.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),pd=s.makeMessageType("viam.service.navigation.v1.GetPropertiesResponse",()=>[{no:1,name:"map_type",kind:"enum",T:s.getEnumType(nd)}]),ud=Object.freeze(Object.defineProperty({__proto__:null,AddWaypointRequest:Qs,AddWaypointResponse:rd,GetLocationRequest:Ks,GetLocationResponse:od,GetModeRequest:js,GetModeResponse:ad,GetObstaclesRequest:eo,GetObstaclesResponse:cd,GetPathsRequest:no,GetPathsResponse:dd,GetPropertiesRequest:ao,GetPropertiesResponse:pd,GetWaypointsRequest:Xs,GetWaypointsResponse:id,MapType:nd,Mode:Ws,Path:ld,RemoveWaypointRequest:Zs,RemoveWaypointResponse:md,SetModeRequest:Hs,SetModeResponse:td,Waypoint:sd},Symbol.toStringTag,{value:"Module"})),gd={typeName:"viam.service.navigation.v1.NavigationService",methods:{getMode:{name:"GetMode",I:js,O:ad,kind:m.Unary},setMode:{name:"SetMode",I:Hs,O:td,kind:m.Unary},getLocation:{name:"GetLocation",I:Ks,O:od,kind:m.Unary},getWaypoints:{name:"GetWaypoints",I:Xs,O:id,kind:m.Unary},addWaypoint:{name:"AddWaypoint",I:Qs,O:rd,kind:m.Unary},removeWaypoint:{name:"RemoveWaypoint",I:Zs,O:md,kind:m.Unary},getObstacles:{name:"GetObstacles",I:eo,O:cd,kind:m.Unary},getPaths:{name:"GetPaths",I:no,O:dd,kind:m.Unary},getProperties:{name:"GetProperties",I:ao,O:pd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},Td=s.makeEnum("viam.service.slam.v1.MappingMode",[{no:0,name:"MAPPING_MODE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MAPPING_MODE_CREATE_NEW_MAP",localName:"CREATE_NEW_MAP"},{no:2,name:"MAPPING_MODE_LOCALIZE_ONLY",localName:"LOCALIZE_ONLY"},{no:3,name:"MAPPING_MODE_UPDATE_EXISTING_MAP",localName:"UPDATE_EXISTING_MAP"}]),kd=s.makeEnum("viam.service.slam.v1.SensorType",[{no:0,name:"SENSOR_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"SENSOR_TYPE_CAMERA",localName:"CAMERA"},{no:2,name:"SENSOR_TYPE_MOVEMENT_SENSOR",localName:"MOVEMENT_SENSOR"}]),to=s.makeMessageType("viam.service.slam.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),yd=s.makeMessageType("viam.service.slam.v1.GetPositionResponse",()=>[{no:1,name:"pose",kind:"message",T:qe}]),so=s.makeMessageType("viam.service.slam.v1.GetPointCloudMapRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"return_edited_map",kind:"scalar",T:8,opt:!0}]),vd=s.makeMessageType("viam.service.slam.v1.GetPointCloudMapResponse",()=>[{no:1,name:"point_cloud_pcd_chunk",kind:"scalar",T:12}]),oo=s.makeMessageType("viam.service.slam.v1.GetInternalStateRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),hd=s.makeMessageType("viam.service.slam.v1.GetInternalStateResponse",()=>[{no:1,name:"internal_state_chunk",kind:"scalar",T:12}]),io=s.makeMessageType("viam.service.slam.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),fd=s.makeMessageType("viam.service.slam.v1.GetPropertiesResponse",()=>[{no:1,name:"cloud_slam",kind:"scalar",T:8},{no:2,name:"mapping_mode",kind:"enum",T:s.getEnumType(Td)},{no:3,name:"internal_state_file_type",kind:"scalar",T:9,opt:!0},{no:4,name:"sensor_info",kind:"message",T:Rd,repeated:!0}]),Rd=s.makeMessageType("viam.service.slam.v1.SensorInfo",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:s.getEnumType(kd)}]),_d=Object.freeze(Object.defineProperty({__proto__:null,GetInternalStateRequest:oo,GetInternalStateResponse:hd,GetPointCloudMapRequest:so,GetPointCloudMapResponse:vd,GetPositionRequest:to,GetPositionResponse:yd,GetPropertiesRequest:io,GetPropertiesResponse:fd,MappingMode:Td,SensorInfo:Rd,SensorType:kd},Symbol.toStringTag,{value:"Module"})),Sd={typeName:"viam.service.slam.v1.SLAMService",methods:{getPosition:{name:"GetPosition",I:to,O:yd,kind:m.Unary},getPointCloudMap:{name:"GetPointCloudMap",I:so,O:vd,kind:m.ServerStreaming},getInternalState:{name:"GetInternalState",I:oo,O:hd,kind:m.ServerStreaming},getProperties:{name:"GetProperties",I:io,O:fd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},Id=s.makeEnum("viam.component.camera.v1.Format",[{no:0,name:"FORMAT_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"FORMAT_RAW_RGBA",localName:"RAW_RGBA"},{no:2,name:"FORMAT_RAW_DEPTH",localName:"RAW_DEPTH"},{no:3,name:"FORMAT_JPEG",localName:"JPEG"},{no:4,name:"FORMAT_PNG",localName:"PNG"}]),ro=s.makeMessageType("viam.component.camera.v1.GetImageRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Md=s.makeMessageType("viam.component.camera.v1.GetImageResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:12}]),bd=s.makeMessageType("viam.component.camera.v1.GetImagesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Ed=s.makeMessageType("viam.component.camera.v1.GetImagesResponse",()=>[{no:1,name:"images",kind:"message",T:mo,repeated:!0},{no:84260,name:"response_metadata",kind:"message",T:fr}]),mo=s.makeMessageType("viam.component.camera.v1.Image",()=>[{no:1,name:"source_name",kind:"scalar",T:9},{no:2,name:"format",kind:"enum",T:s.getEnumType(Id)},{no:3,name:"image",kind:"scalar",T:12}]),co=s.makeMessageType("viam.component.camera.v1.RenderFrameRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),lo=s.makeMessageType("viam.component.camera.v1.GetPointCloudRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),wd=s.makeMessageType("viam.component.camera.v1.GetPointCloudResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"point_cloud",kind:"scalar",T:12}]),Od=s.makeMessageType("viam.component.camera.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Cd=s.makeMessageType("viam.component.camera.v1.GetPropertiesResponse",()=>[{no:1,name:"supports_pcd",kind:"scalar",T:8},{no:2,name:"intrinsic_parameters",kind:"message",T:Dd},{no:3,name:"distortion_parameters",kind:"message",T:Ad},{no:4,name:"mime_types",kind:"scalar",T:9,repeated:!0},{no:5,name:"frame_rate",kind:"scalar",T:2,opt:!0}]),JR=s.makeMessageType("viam.component.camera.v1.Webcams",()=>[{no:1,name:"webcams",kind:"message",T:Nd,repeated:!0}]),Nd=s.makeMessageType("viam.component.camera.v1.Webcam",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"status",kind:"scalar",T:9},{no:3,name:"properties",kind:"message",T:Pd,repeated:!0},{no:4,name:"name",kind:"scalar",T:9},{no:5,name:"id",kind:"scalar",T:9}]),Pd=s.makeMessageType("viam.component.camera.v1.Property",()=>[{no:1,name:"width_px",kind:"scalar",T:5},{no:2,name:"height_px",kind:"scalar",T:5},{no:3,name:"frame_format",kind:"scalar",T:9},{no:4,name:"frame_rate",kind:"scalar",T:2}]),Dd=s.makeMessageType("viam.component.camera.v1.IntrinsicParameters",()=>[{no:1,name:"width_px",kind:"scalar",T:13},{no:2,name:"height_px",kind:"scalar",T:13},{no:3,name:"focal_x_px",kind:"scalar",T:1},{no:4,name:"focal_y_px",kind:"scalar",T:1},{no:5,name:"center_x_px",kind:"scalar",T:1},{no:6,name:"center_y_px",kind:"scalar",T:1}]),Ad=s.makeMessageType("viam.component.camera.v1.DistortionParameters",()=>[{no:1,name:"model",kind:"scalar",T:9},{no:2,name:"parameters",kind:"scalar",T:1,repeated:!0}]),zR=Object.freeze(Object.defineProperty({__proto__:null,DistortionParameters:Ad,Format:Id,GetImageRequest:ro,GetImageResponse:Md,GetImagesRequest:bd,GetImagesResponse:Ed,GetPointCloudRequest:lo,GetPointCloudResponse:wd,GetPropertiesRequest:Od,GetPropertiesResponse:Cd,Image:mo,IntrinsicParameters:Dd,Property:Pd,RenderFrameRequest:co,Webcam:Nd,Webcams:JR},Symbol.toStringTag,{value:"Module"})),po=s.makeMessageType("viam.service.vision.v1.GetDetectionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:12},{no:3,name:"width",kind:"scalar",T:3},{no:4,name:"height",kind:"scalar",T:3},{no:5,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),qd=s.makeMessageType("viam.service.vision.v1.GetDetectionsResponse",()=>[{no:1,name:"detections",kind:"message",T:ya,repeated:!0}]),uo=s.makeMessageType("viam.service.vision.v1.GetDetectionsFromCameraRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"camera_name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Ud=s.makeMessageType("viam.service.vision.v1.GetDetectionsFromCameraResponse",()=>[{no:1,name:"detections",kind:"message",T:ya,repeated:!0}]),ya=s.makeMessageType("viam.service.vision.v1.Detection",()=>[{no:1,name:"x_min",kind:"scalar",T:3,opt:!0},{no:2,name:"y_min",kind:"scalar",T:3,opt:!0},{no:3,name:"x_max",kind:"scalar",T:3,opt:!0},{no:4,name:"y_max",kind:"scalar",T:3,opt:!0},{no:5,name:"confidence",kind:"scalar",T:1},{no:6,name:"class_name",kind:"scalar",T:9},{no:7,name:"x_min_normalized",kind:"scalar",T:1,opt:!0},{no:8,name:"y_min_normalized",kind:"scalar",T:1,opt:!0},{no:9,name:"x_max_normalized",kind:"scalar",T:1,opt:!0},{no:10,name:"y_max_normalized",kind:"scalar",T:1,opt:!0}]),go=s.makeMessageType("viam.service.vision.v1.GetClassificationsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:12},{no:3,name:"width",kind:"scalar",T:5},{no:4,name:"height",kind:"scalar",T:5},{no:5,name:"mime_type",kind:"scalar",T:9},{no:6,name:"n",kind:"scalar",T:5},{no:99,name:"extra",kind:"message",T:l}]),Ld=s.makeMessageType("viam.service.vision.v1.GetClassificationsResponse",()=>[{no:1,name:"classifications",kind:"message",T:va,repeated:!0}]),To=s.makeMessageType("viam.service.vision.v1.GetClassificationsFromCameraRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"camera_name",kind:"scalar",T:9},{no:3,name:"n",kind:"scalar",T:5},{no:99,name:"extra",kind:"message",T:l}]),Gd=s.makeMessageType("viam.service.vision.v1.GetClassificationsFromCameraResponse",()=>[{no:1,name:"classifications",kind:"message",T:va,repeated:!0}]),va=s.makeMessageType("viam.service.vision.v1.Classification",()=>[{no:1,name:"class_name",kind:"scalar",T:9},{no:2,name:"confidence",kind:"scalar",T:1}]),ko=s.makeMessageType("viam.service.vision.v1.GetObjectPointCloudsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"camera_name",kind:"scalar",T:9},{no:3,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Bd=s.makeMessageType("viam.service.vision.v1.GetObjectPointCloudsResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"objects",kind:"message",T:ct,repeated:!0}]),yo=s.makeMessageType("viam.service.vision.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),vo=s.makeMessageType("viam.service.vision.v1.CaptureAllFromCameraRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"camera_name",kind:"scalar",T:9},{no:3,name:"return_image",kind:"scalar",T:8},{no:4,name:"return_classifications",kind:"scalar",T:8},{no:5,name:"return_detections",kind:"scalar",T:8},{no:6,name:"return_object_point_clouds",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:l}]),Fd=s.makeMessageType("viam.service.vision.v1.CaptureAllFromCameraResponse",()=>[{no:1,name:"image",kind:"message",T:mo},{no:2,name:"detections",kind:"message",T:ya,repeated:!0},{no:3,name:"classifications",kind:"message",T:va,repeated:!0},{no:4,name:"objects",kind:"message",T:ct,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),xd=s.makeMessageType("viam.service.vision.v1.GetPropertiesResponse",()=>[{no:1,name:"classifications_supported",kind:"scalar",T:8},{no:2,name:"detections_supported",kind:"scalar",T:8},{no:3,name:"object_point_clouds_supported",kind:"scalar",T:8}]),Jd=Object.freeze(Object.defineProperty({__proto__:null,CaptureAllFromCameraRequest:vo,CaptureAllFromCameraResponse:Fd,Classification:va,Detection:ya,GetClassificationsFromCameraRequest:To,GetClassificationsFromCameraResponse:Gd,GetClassificationsRequest:go,GetClassificationsResponse:Ld,GetDetectionsFromCameraRequest:uo,GetDetectionsFromCameraResponse:Ud,GetDetectionsRequest:po,GetDetectionsResponse:qd,GetObjectPointCloudsRequest:ko,GetObjectPointCloudsResponse:Bd,GetPropertiesRequest:yo,GetPropertiesResponse:xd},Symbol.toStringTag,{value:"Module"})),zd={typeName:"viam.service.vision.v1.VisionService",methods:{getDetectionsFromCamera:{name:"GetDetectionsFromCamera",I:uo,O:Ud,kind:m.Unary},getDetections:{name:"GetDetections",I:po,O:qd,kind:m.Unary},getClassificationsFromCamera:{name:"GetClassificationsFromCamera",I:To,O:Gd,kind:m.Unary},getClassifications:{name:"GetClassifications",I:go,O:Ld,kind:m.Unary},getObjectPointClouds:{name:"GetObjectPointClouds",I:ko,O:Bd,kind:m.Unary},getProperties:{name:"GetProperties",I:yo,O:xd,kind:m.Unary},captureAllFromCamera:{name:"CaptureAllFromCamera",I:vo,O:Fd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},YR=new Blob([`self.onmessage = function(e) {
1
+ (function(T,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(T=typeof globalThis<"u"?globalThis:T||self,A(T.sdk={}))})(this,function(T){"use strict";function A(a,e){if(!a)throw new Error(e)}const Bv=34028234663852886e22,Fv=-34028234663852886e22,xv=4294967295,Jv=2147483647,zv=-2147483648;function Un(a){if(typeof a!="number")throw new Error("invalid int 32: "+typeof a);if(!Number.isInteger(a)||a>Jv||a<zv)throw new Error("invalid int 32: "+a)}function Aa(a){if(typeof a!="number")throw new Error("invalid uint 32: "+typeof a);if(!Number.isInteger(a)||a>xv||a<0)throw new Error("invalid uint 32: "+a)}function ni(a){if(typeof a!="number")throw new Error("invalid float 32: "+typeof a);if(Number.isFinite(a)&&(a>Bv||a<Fv))throw new Error("invalid float 32: "+a)}const ai=Symbol("@bufbuild/protobuf/enum-type");function Yv(a){const e=a[ai];return A(e,"missing enum type on enum object"),e}function ti(a,e,n,t){a[ai]=si(e,n.map(o=>({no:o.no,name:o.name,localName:a[o.no]})))}function si(a,e,n){const t=Object.create(null),o=Object.create(null),i=[];for(const r of e){const c=oi(r);i.push(c),t[r.name]=c,o[r.no]=c}return{typeName:a,values:i,findName(r){return t[r]},findNumber(r){return o[r]}}}function $v(a,e,n){const t={};for(const o of e){const i=oi(o);t[i.localName]=i.no,t[i.no]=i.localName}return ti(t,a,e),t}function oi(a){return"localName"in a?a:Object.assign(Object.assign({},a),{localName:a.name})}class w{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,n){const t=this.getType(),o=t.runtime.bin,i=o.makeReadOptions(n);return o.readMessage(this,i.readerFactory(e),e.byteLength,i),this}fromJson(e,n){const t=this.getType(),o=t.runtime.json,i=o.makeReadOptions(n);return o.readMessage(t,e,i,this),this}fromJsonString(e,n){let t;try{t=JSON.parse(e)}catch(o){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${o instanceof Error?o.message:String(o)}`)}return this.fromJson(t,n)}toBinary(e){const n=this.getType(),t=n.runtime.bin,o=t.makeWriteOptions(e),i=o.writerFactory();return t.writeMessage(this,i,o),i.finish()}toJson(e){const n=this.getType(),t=n.runtime.json,o=t.makeWriteOptions(e);return t.writeMessage(this,o)}toJsonString(e){var n;const t=this.toJson(e);return JSON.stringify(t,null,(n=e?.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function Vv(a,e,n,t){var o;const i=(o=t?.localName)!==null&&o!==void 0?o:e.substring(e.lastIndexOf(".")+1),r={[i]:function(c){a.util.initFields(this),a.util.initPartial(c,this)}}[i];return Object.setPrototypeOf(r.prototype,new w),Object.assign(r,{runtime:a,typeName:e,fields:a.util.newFieldList(n),fromBinary(c,d){return new r().fromBinary(c,d)},fromJson(c,d){return new r().fromJson(c,d)},fromJsonString(c,d){return new r().fromJsonString(c,d)},equals(c,d){return a.util.equals(r,c,d)}}),r}function Wv(){let a=0,e=0;for(let t=0;t<28;t+=7){let o=this.buf[this.pos++];if(a|=(o&127)<<t,!(o&128))return this.assertBounds(),[a,e]}let n=this.buf[this.pos++];if(a|=(n&15)<<28,e=(n&112)>>4,!(n&128))return this.assertBounds(),[a,e];for(let t=3;t<=31;t+=7){let o=this.buf[this.pos++];if(e|=(o&127)<<t,!(o&128))return this.assertBounds(),[a,e]}throw new Error("invalid varint")}function qa(a,e,n){for(let i=0;i<28;i=i+7){const r=a>>>i,c=!(!(r>>>7)&&e==0),d=(c?r|128:r)&255;if(n.push(d),!c)return}const t=a>>>28&15|(e&7)<<4,o=!!(e>>3);if(n.push((o?t|128:t)&255),!!o){for(let i=3;i<31;i=i+7){const r=e>>>i,c=!!(r>>>7),d=(c?r|128:r)&255;if(n.push(d),!c)return}n.push(e>>>31&1)}}const Ln=4294967296;function ii(a){const e=a[0]==="-";e&&(a=a.slice(1));const n=1e6;let t=0,o=0;function i(r,c){const d=Number(a.slice(r,c));o*=n,t=t*n+d,t>=Ln&&(o=o+(t/Ln|0),t=t%Ln)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),e?mi(t,o):Ua(t,o)}function jv(a,e){let n=Ua(a,e);const t=n.hi&2147483648;t&&(n=mi(n.lo,n.hi));const o=ri(n.lo,n.hi);return t?"-"+o:o}function ri(a,e){if({lo:a,hi:e}=Hv(a,e),e<=2097151)return String(Ln*e+a);const n=a&16777215,t=(a>>>24|e<<8)&16777215,o=e>>16&65535;let i=n+t*6777216+o*6710656,r=t+o*8147497,c=o*2;const d=1e7;return i>=d&&(r+=Math.floor(i/d),i%=d),r>=d&&(c+=Math.floor(r/d),r%=d),c.toString()+ci(r)+ci(i)}function Hv(a,e){return{lo:a>>>0,hi:e>>>0}}function Ua(a,e){return{lo:a|0,hi:e|0}}function mi(a,e){return e=~e,a?a=~a+1:e+=1,Ua(a,e)}const ci=a=>{const e=String(a);return"0000000".slice(e.length)+e};function li(a,e){if(a>=0){for(;a>127;)e.push(a&127|128),a=a>>>7;e.push(a)}else{for(let n=0;n<9;n++)e.push(a&127|128),a=a>>7;e.push(1)}}function Kv(){let a=this.buf[this.pos++],e=a&127;if(!(a&128))return this.assertBounds(),e;if(a=this.buf[this.pos++],e|=(a&127)<<7,!(a&128))return this.assertBounds(),e;if(a=this.buf[this.pos++],e|=(a&127)<<14,!(a&128))return this.assertBounds(),e;if(a=this.buf[this.pos++],e|=(a&127)<<21,!(a&128))return this.assertBounds(),e;a=this.buf[this.pos++],e|=(a&15)<<28;for(let n=5;a&128&&n<10;n++)a=this.buf[this.pos++];if(a&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function Xv(){const a=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof a.getBigInt64=="function"&&typeof a.getBigUint64=="function"&&typeof a.setBigInt64=="function"&&typeof a.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const o=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),r=BigInt("0"),c=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(d){const p=typeof d=="bigint"?d:BigInt(d);if(p>i||p<o)throw new Error(`int64 invalid: ${d}`);return p},uParse(d){const p=typeof d=="bigint"?d:BigInt(d);if(p>c||p<r)throw new Error(`uint64 invalid: ${d}`);return p},enc(d){return a.setBigInt64(0,this.parse(d),!0),{lo:a.getInt32(0,!0),hi:a.getInt32(4,!0)}},uEnc(d){return a.setBigInt64(0,this.uParse(d),!0),{lo:a.getInt32(0,!0),hi:a.getInt32(4,!0)}},dec(d,p){return a.setInt32(0,d,!0),a.setInt32(4,p,!0),a.getBigInt64(0,!0)},uDec(d,p){return a.setInt32(0,d,!0),a.setInt32(4,p,!0),a.getBigUint64(0,!0)}}}const n=o=>A(/^-?[0-9]+$/.test(o),`int64 invalid: ${o}`),t=o=>A(/^[0-9]+$/.test(o),`uint64 invalid: ${o}`);return{zero:"0",supported:!1,parse(o){return typeof o!="string"&&(o=o.toString()),n(o),o},uParse(o){return typeof o!="string"&&(o=o.toString()),t(o),o},enc(o){return typeof o!="string"&&(o=o.toString()),n(o),ii(o)},uEnc(o){return typeof o!="string"&&(o=o.toString()),t(o),ii(o)},dec(o,i){return jv(o,i)},uDec(o,i){return ri(o,i)}}}const V=Xv();var f;(function(a){a[a.DOUBLE=1]="DOUBLE",a[a.FLOAT=2]="FLOAT",a[a.INT64=3]="INT64",a[a.UINT64=4]="UINT64",a[a.INT32=5]="INT32",a[a.FIXED64=6]="FIXED64",a[a.FIXED32=7]="FIXED32",a[a.BOOL=8]="BOOL",a[a.STRING=9]="STRING",a[a.BYTES=12]="BYTES",a[a.UINT32=13]="UINT32",a[a.SFIXED32=15]="SFIXED32",a[a.SFIXED64=16]="SFIXED64",a[a.SINT32=17]="SINT32",a[a.SINT64=18]="SINT64"})(f||(f={}));var Le;(function(a){a[a.BIGINT=0]="BIGINT",a[a.STRING=1]="STRING"})(Le||(Le={}));function Ge(a,e,n){if(e===n)return!0;if(a==f.BYTES){if(!(e instanceof Uint8Array)||!(n instanceof Uint8Array)||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}switch(a){case f.UINT64:case f.FIXED64:case f.INT64:case f.SFIXED64:case f.SINT64:return e==n}return!1}function an(a,e){switch(a){case f.BOOL:return!1;case f.UINT64:case f.FIXED64:case f.INT64:case f.SFIXED64:case f.SINT64:return e==0?V.zero:"0";case f.DOUBLE:case f.FLOAT:return 0;case f.BYTES:return new Uint8Array(0);case f.STRING:return"";default:return 0}}function di(a,e){switch(a){case f.BOOL:return e===!1;case f.STRING:return e==="";case f.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var B;(function(a){a[a.Varint=0]="Varint",a[a.Bit64=1]="Bit64",a[a.LengthDelimited=2]="LengthDelimited",a[a.StartGroup=3]="StartGroup",a[a.EndGroup=4]="EndGroup",a[a.Bit32=5]="Bit32"})(B||(B={}));class Qv{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let o=0;o<this.chunks.length;o++)e+=this.chunks[o].length;let n=new Uint8Array(e),t=0;for(let o=0;o<this.chunks.length;o++)n.set(this.chunks[o],t),t+=this.chunks[o].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,n){return this.uint32((e<<3|n)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Aa(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return Un(e),li(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.textEncoder.encode(e);return this.uint32(n.byteLength),this.raw(n)}float(e){ni(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){Aa(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){Un(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return Un(e),e=(e<<1^e>>31)>>>0,li(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),t=new DataView(n.buffer),o=V.enc(e);return t.setInt32(0,o.lo,!0),t.setInt32(4,o.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),t=new DataView(n.buffer),o=V.uEnc(e);return t.setInt32(0,o.lo,!0),t.setInt32(4,o.hi,!0),this.raw(n)}int64(e){let n=V.enc(e);return qa(n.lo,n.hi,this.buf),this}sint64(e){let n=V.enc(e),t=n.hi>>31,o=n.lo<<1^t,i=(n.hi<<1|n.lo>>>31)^t;return qa(o,i,this.buf),this}uint64(e){let n=V.uEnc(e);return qa(n.lo,n.hi,this.buf),this}}class pi{constructor(e,n){this.varint64=Wv,this.uint32=Kv,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=n??new TextDecoder}tag(){let e=this.uint32(),n=e>>>3,t=e&7;if(n<=0||t<0||t>5)throw new Error("illegal tag: field no "+n+" wire type "+t);return[n,t]}skip(e,n){let t=this.pos;switch(e){case B.Varint:for(;this.buf[this.pos++]&128;);break;case B.Bit64:this.pos+=4;case B.Bit32:this.pos+=4;break;case B.LengthDelimited:let o=this.uint32();this.pos+=o;break;case B.StartGroup:for(;;){const[i,r]=this.tag();if(r===B.EndGroup){if(n!==void 0&&i!==n)throw new Error("invalid end group tag");break}this.skip(r,i)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(t,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return V.dec(...this.varint64())}uint64(){return V.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),t=-(e&1);return e=(e>>>1|(n&1)<<31)^t,n=n>>>1^t,V.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return V.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return V.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.textDecoder.decode(this.bytes())}}function Zv(a,e,n,t){let o;return{typeName:e,extendee:n,get field(){if(!o){const i=typeof t=="function"?t():t;i.name=e.split(".").pop(),i.jsonName=`[${e}]`,o=a.util.newFieldList([i]).list()[0]}return o},runtime:a}}function ui(a){const e=a.field.localName,n=Object.create(null);return n[e]=eh(a),[n,()=>n[e]]}function eh(a){const e=a.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return an(e.T,e.L);case"message":const n=e.T,t=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(t):t;case"map":throw"map fields are not allowed to be extensions"}}function nh(a,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let n=a.length-1;n>=0;--n)if(a[n].no==e.no)return[a[n]];return[]}return a.filter(n=>n.no===e.no)}let pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Gn=[];for(let a=0;a<pe.length;a++)Gn[pe[a].charCodeAt(0)]=a;Gn[45]=pe.indexOf("+"),Gn[95]=pe.indexOf("/");const La={dec(a){let e=a.length*3/4;a[a.length-2]=="="?e-=2:a[a.length-1]=="="&&(e-=1);let n=new Uint8Array(e),t=0,o=0,i,r=0;for(let c=0;c<a.length;c++){if(i=Gn[a.charCodeAt(c)],i===void 0)switch(a[c]){case"=":o=0;case`
2
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(o){case 0:r=i,o=1;break;case 1:n[t++]=r<<2|(i&48)>>4,r=i,o=2;break;case 2:n[t++]=(r&15)<<4|(i&60)>>2,r=i,o=3;break;case 3:n[t++]=(r&3)<<6|i,o=0;break}}if(o==1)throw Error("invalid base64 string.");return n.subarray(0,t)},enc(a){let e="",n=0,t,o=0;for(let i=0;i<a.length;i++)switch(t=a[i],n){case 0:e+=pe[t>>2],o=(t&3)<<4,n=1;break;case 1:e+=pe[o|t>>4],o=(t&15)<<2,n=2;break;case 2:e+=pe[o|t>>6],e+=pe[t&63],n=0;break}return n&&(e+=pe[o],e+="=",n==1&&(e+="=")),e}};function ah(a,e,n){Ti(e,a);const t=e.runtime.bin.makeReadOptions(n),o=nh(a.getType().runtime.bin.listUnknownFields(a),e.field),[i,r]=ui(e);for(const c of o)e.runtime.bin.readField(i,t.readerFactory(c.data),e.field,c.wireType,t);return r()}function th(a,e,n,t){Ti(e,a);const o=e.runtime.bin.makeReadOptions(t),i=e.runtime.bin.makeWriteOptions(t);if(gi(a,e)){const p=a.getType().runtime.bin.listUnknownFields(a).filter(k=>k.no!=e.field.no);a.getType().runtime.bin.discardUnknownFields(a);for(const k of p)a.getType().runtime.bin.onUnknownField(a,k.no,k.wireType,k.data)}const r=i.writerFactory();let c=e.field;!c.opt&&!c.repeated&&(c.kind=="enum"||c.kind=="scalar")&&(c=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(c,n,r,i);const d=o.readerFactory(r.finish());for(;d.pos<d.len;){const[p,k]=d.tag(),R=d.skip(k,p);a.getType().runtime.bin.onUnknownField(a,p,k,R)}}function gi(a,e){const n=a.getType();return e.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(a).find(t=>t.no==e.field.no)}function Ti(a,e){A(a.extendee.typeName==e.getType().typeName,`extension ${a.typeName} can only be applied to message ${a.extendee.typeName}`)}function ki(a,e){const n=a.localName;if(a.repeated)return e[n].length>0;if(a.oneof)return e[a.oneof.localName].case===n;switch(a.kind){case"enum":case"scalar":return a.opt||a.req?e[n]!==void 0:a.kind=="enum"?e[n]!==a.T.values[0].no:!di(a.T,e[n]);case"message":return e[n]!==void 0;case"map":return Object.keys(e[n]).length>0}}function yi(a,e){const n=a.localName,t=!a.opt&&!a.req;if(a.repeated)e[n]=[];else if(a.oneof)e[a.oneof.localName]={case:void 0};else switch(a.kind){case"map":e[n]={};break;case"enum":e[n]=t?a.T.values[0].no:void 0;break;case"scalar":e[n]=t?an(a.T,a.L):void 0;break;case"message":e[n]=void 0;break}}function We(a,e){if(a===null||typeof a!="object"||!Object.getOwnPropertyNames(w.prototype).every(t=>t in a&&typeof a[t]=="function"))return!1;const n=a.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:e===void 0?!0:n.typeName==e.typeName}function vi(a,e){return We(e)||!a.fieldWrapper?e:a.fieldWrapper.wrapField(e)}f.DOUBLE,f.FLOAT,f.INT64,f.UINT64,f.INT32,f.UINT32,f.BOOL,f.STRING,f.BYTES;const hi={ignoreUnknownFields:!1},fi={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function sh(a){return a?Object.assign(Object.assign({},hi),a):hi}function oh(a){return a?Object.assign(Object.assign({},fi),a):fi}const Bn=Symbol(),Fn=Symbol();function ih(){return{makeReadOptions:sh,makeWriteOptions:oh,readMessage(a,e,n,t){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message ${a.typeName} from JSON: ${te(e)}`);t=t??new a;const o=new Map,i=n.typeRegistry;for(const[r,c]of Object.entries(e)){const d=a.fields.findJsonName(r);if(d){if(d.oneof){if(c===null&&d.kind=="scalar")continue;const p=o.get(d.oneof);if(p!==void 0)throw new Error(`cannot decode message ${a.typeName} from JSON: multiple keys for oneof "${d.oneof.name}" present: "${p}", "${r}"`);o.set(d.oneof,r)}Ri(t,c,d,n,a)}else{let p=!1;if(i?.findExtension&&r.startsWith("[")&&r.endsWith("]")){const k=i.findExtension(r.substring(1,r.length-1));if(k&&k.extendee.typeName==a.typeName){p=!0;const[R,I]=ui(k);Ri(R,c,k.field,n,k),th(t,k,I(),n)}}if(!p&&!n.ignoreUnknownFields)throw new Error(`cannot decode message ${a.typeName} from JSON: key "${r}" is unknown`)}}return t},writeMessage(a,e){const n=a.getType(),t={};let o;try{for(o of n.fields.byNumber()){if(!ki(o,a)){if(o.req)throw"required field not set";if(!e.emitDefaultValues||!mh(o))continue}const r=o.oneof?a[o.oneof.localName].value:a[o.localName],c=_i(o,r,e);c!==void 0&&(t[e.useProtoFieldName?o.name:o.jsonName]=c)}const i=e.typeRegistry;if(i?.findExtensionFor)for(const r of n.runtime.bin.listUnknownFields(a)){const c=i.findExtensionFor(n.typeName,r.no);if(c&&gi(a,c)){const d=ah(a,c,e),p=_i(c.field,d,e);p!==void 0&&(t[c.field.jsonName]=p)}}}catch(i){const r=o?`cannot encode field ${n.typeName}.${o.name} to JSON`:`cannot encode message ${n.typeName} to JSON`,c=i instanceof Error?i.message:String(i);throw new Error(r+(c.length>0?`: ${c}`:""))}return t},readScalar(a,e,n){return un(a,e,n??Le.BIGINT,!0)},writeScalar(a,e,n){if(e!==void 0&&(n||di(a,e)))return xn(a,e)},debug:te}}function te(a){if(a===null)return"null";switch(typeof a){case"object":return Array.isArray(a)?"array":"object";case"string":return a.length>100?"string":`"${a.split('"').join('\\"')}"`;default:return String(a)}}function Ri(a,e,n,t,o){let i=n.localName;if(n.repeated){if(A(n.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error(`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(e)}`);const r=a[i];for(const c of e){if(c===null)throw new Error(`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(c)}`);switch(n.kind){case"message":r.push(n.T.fromJson(c,t));break;case"enum":const d=Ga(n.T,c,t.ignoreUnknownFields,!0);d!==Fn&&r.push(d);break;case"scalar":try{r.push(un(n.T,c,n.L,!0))}catch(p){let k=`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(c)}`;throw p instanceof Error&&p.message.length>0&&(k+=`: ${p.message}`),new Error(k)}break}}}else if(n.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error(`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(e)}`);const r=a[i];for(const[c,d]of Object.entries(e)){if(d===null)throw new Error(`cannot decode field ${o.typeName}.${n.name} from JSON: map value null`);let p;try{p=rh(n.K,c)}catch(k){let R=`cannot decode map key for field ${o.typeName}.${n.name} from JSON: ${te(e)}`;throw k instanceof Error&&k.message.length>0&&(R+=`: ${k.message}`),new Error(R)}switch(n.V.kind){case"message":r[p]=n.V.T.fromJson(d,t);break;case"enum":const k=Ga(n.V.T,d,t.ignoreUnknownFields,!0);k!==Fn&&(r[p]=k);break;case"scalar":try{r[p]=un(n.V.T,d,Le.BIGINT,!0)}catch(R){let I=`cannot decode map value for field ${o.typeName}.${n.name} from JSON: ${te(e)}`;throw R instanceof Error&&R.message.length>0&&(I+=`: ${R.message}`),new Error(I)}break}}}else switch(n.oneof&&(a=a[n.oneof.localName]={case:i},i="value"),n.kind){case"message":const r=n.T;if(e===null&&r.typeName!="google.protobuf.Value")return;let c=a[i];We(c)?c.fromJson(e,t):(a[i]=c=r.fromJson(e,t),r.fieldWrapper&&!n.oneof&&(a[i]=r.fieldWrapper.unwrapField(c)));break;case"enum":const d=Ga(n.T,e,t.ignoreUnknownFields,!1);switch(d){case Bn:yi(n,a);break;case Fn:break;default:a[i]=d;break}break;case"scalar":try{const p=un(n.T,e,n.L,!1);switch(p){case Bn:yi(n,a);break;default:a[i]=p;break}}catch(p){let k=`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(e)}`;throw p instanceof Error&&p.message.length>0&&(k+=`: ${p.message}`),new Error(k)}break}}function rh(a,e){if(a===f.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return un(a,e,Le.BIGINT,!0).toString()}function un(a,e,n,t){if(e===null)return t?an(a,n):Bn;switch(a){case f.DOUBLE:case f.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const o=Number(e);if(Number.isNaN(o)||!Number.isFinite(o))break;return a==f.FLOAT&&ni(o),o;case f.INT32:case f.FIXED32:case f.SFIXED32:case f.SINT32:case f.UINT32:let i;if(typeof e=="number"?i=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(i=Number(e)),i===void 0)break;return a==f.UINT32||a==f.FIXED32?Aa(i):Un(i),i;case f.INT64:case f.SFIXED64:case f.SINT64:if(typeof e!="number"&&typeof e!="string")break;const r=V.parse(e);return n?r.toString():r;case f.FIXED64:case f.UINT64:if(typeof e!="number"&&typeof e!="string")break;const c=V.uParse(e);return n?c.toString():c;case f.BOOL:if(typeof e!="boolean")break;return e;case f.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case f.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return La.dec(e)}throw new Error}function Ga(a,e,n,t){if(e===null)return a.typeName=="google.protobuf.NullValue"?0:t?a.values[0].no:Bn;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const o=a.findName(e);if(o!==void 0)return o.no;if(n)return Fn;break}throw new Error(`cannot decode enum ${a.typeName} from JSON: ${te(e)}`)}function mh(a){return a.repeated||a.kind=="map"?!0:!(a.oneof||a.kind=="message"||a.opt||a.req)}function _i(a,e,n){if(a.kind=="map"){A(typeof e=="object"&&e!=null);const t={},o=Object.entries(e);switch(a.V.kind){case"scalar":for(const[r,c]of o)t[r.toString()]=xn(a.V.T,c);break;case"message":for(const[r,c]of o)t[r.toString()]=c.toJson(n);break;case"enum":const i=a.V.T;for(const[r,c]of o)t[r.toString()]=Ba(i,c,n.enumAsInteger);break}return n.emitDefaultValues||o.length>0?t:void 0}if(a.repeated){A(Array.isArray(e));const t=[];switch(a.kind){case"scalar":for(let o=0;o<e.length;o++)t.push(xn(a.T,e[o]));break;case"enum":for(let o=0;o<e.length;o++)t.push(Ba(a.T,e[o],n.enumAsInteger));break;case"message":for(let o=0;o<e.length;o++)t.push(e[o].toJson(n));break}return n.emitDefaultValues||t.length>0?t:void 0}switch(a.kind){case"scalar":return xn(a.T,e);case"enum":return Ba(a.T,e,n.enumAsInteger);case"message":return vi(a.T,e).toJson(n)}}function Ba(a,e,n){var t;if(A(typeof e=="number"),a.typeName=="google.protobuf.NullValue")return null;if(n)return e;const o=a.findNumber(e);return(t=o?.name)!==null&&t!==void 0?t:e}function xn(a,e){switch(a){case f.INT32:case f.SFIXED32:case f.SINT32:case f.FIXED32:case f.UINT32:return A(typeof e=="number"),e;case f.FLOAT:case f.DOUBLE:return A(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case f.STRING:return A(typeof e=="string"),e;case f.BOOL:return A(typeof e=="boolean"),e;case f.UINT64:case f.FIXED64:case f.INT64:case f.SFIXED64:case f.SINT64:return A(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case f.BYTES:return A(e instanceof Uint8Array),La.enc(e)}}const tn=Symbol("@bufbuild/protobuf/unknown-fields"),Si={readUnknownFields:!0,readerFactory:a=>new pi(a)},Ii={writeUnknownFields:!0,writerFactory:()=>new Qv};function ch(a){return a?Object.assign(Object.assign({},Si),a):Si}function lh(a){return a?Object.assign(Object.assign({},Ii),a):Ii}function dh(){return{makeReadOptions:ch,makeWriteOptions:lh,listUnknownFields(a){var e;return(e=a[tn])!==null&&e!==void 0?e:[]},discardUnknownFields(a){delete a[tn]},writeUnknownFields(a,e){const t=a[tn];if(t)for(const o of t)e.tag(o.no,o.wireType).raw(o.data)},onUnknownField(a,e,n,t){const o=a;Array.isArray(o[tn])||(o[tn]=[]),o[tn].push({no:e,wireType:n,data:t})},readMessage(a,e,n,t,o){const i=a.getType(),r=o?e.len:e.pos+n;let c,d;for(;e.pos<r&&([c,d]=e.tag(),!(o===!0&&d==B.EndGroup));){const p=i.fields.find(c);if(!p){const k=e.skip(d,c);t.readUnknownFields&&this.onUnknownField(a,c,d,k);continue}Mi(a,e,p,d,t)}if(o&&(d!=B.EndGroup||c!==n))throw new Error("invalid end group tag")},readField:Mi,writeMessage(a,e,n){const t=a.getType();for(const o of t.fields.byNumber()){if(!ki(o,a)){if(o.req)throw new Error(`cannot encode field ${t.typeName}.${o.name} to binary: required field not set`);continue}const i=o.oneof?a[o.oneof.localName].value:a[o.localName];bi(o,i,e,n)}return n.writeUnknownFields&&this.writeUnknownFields(a,e),e},writeField(a,e,n,t){e!==void 0&&bi(a,e,n,t)}}}function Mi(a,e,n,t,o){let{repeated:i,localName:r}=n;switch(n.oneof&&(a=a[n.oneof.localName],a.case!=r&&delete a.value,a.case=r,r="value"),n.kind){case"scalar":case"enum":const c=n.kind=="enum"?f.INT32:n.T;let d=zn;if(n.kind=="scalar"&&n.L>0&&(d=uh),i){let I=a[r];if(t==B.LengthDelimited&&c!=f.STRING&&c!=f.BYTES){let M=e.uint32()+e.pos;for(;e.pos<M;)I.push(d(e,c))}else I.push(d(e,c))}else a[r]=d(e,c);break;case"message":const p=n.T;i?a[r].push(Jn(e,new p,o,n)):We(a[r])?Jn(e,a[r],o,n):(a[r]=Jn(e,new p,o,n),p.fieldWrapper&&!n.oneof&&!n.repeated&&(a[r]=p.fieldWrapper.unwrapField(a[r])));break;case"map":let[k,R]=ph(n,e,o);a[r][k]=R;break}}function Jn(a,e,n,t){const o=e.getType().runtime.bin,i=t?.delimited;return o.readMessage(e,a,i?t.no:a.uint32(),n,i),e}function ph(a,e,n){const t=e.uint32(),o=e.pos+t;let i,r;for(;e.pos<o;){const[c]=e.tag();switch(c){case 1:i=zn(e,a.K);break;case 2:switch(a.V.kind){case"scalar":r=zn(e,a.V.T);break;case"enum":r=e.int32();break;case"message":r=Jn(e,new a.V.T,n,void 0);break}break}}if(i===void 0&&(i=an(a.K,Le.BIGINT)),typeof i!="string"&&typeof i!="number"&&(i=i.toString()),r===void 0)switch(a.V.kind){case"scalar":r=an(a.V.T,Le.BIGINT);break;case"enum":r=a.V.T.values[0].no;break;case"message":r=new a.V.T;break}return[i,r]}function uh(a,e){const n=zn(a,e);return typeof n=="bigint"?n.toString():n}function zn(a,e){switch(e){case f.STRING:return a.string();case f.BOOL:return a.bool();case f.DOUBLE:return a.double();case f.FLOAT:return a.float();case f.INT32:return a.int32();case f.INT64:return a.int64();case f.UINT64:return a.uint64();case f.FIXED64:return a.fixed64();case f.BYTES:return a.bytes();case f.FIXED32:return a.fixed32();case f.SFIXED32:return a.sfixed32();case f.SFIXED64:return a.sfixed64();case f.SINT64:return a.sint64();case f.UINT32:return a.uint32();case f.SINT32:return a.sint32()}}function bi(a,e,n,t){A(e!==void 0);const o=a.repeated;switch(a.kind){case"scalar":case"enum":let i=a.kind=="enum"?f.INT32:a.T;if(o)if(A(Array.isArray(e)),a.packed)Th(n,i,a.no,e);else for(const r of e)gn(n,i,a.no,r);else gn(n,i,a.no,e);break;case"message":if(o){A(Array.isArray(e));for(const r of e)Ei(n,t,a,r)}else Ei(n,t,a,e);break;case"map":A(typeof e=="object"&&e!=null);for(const[r,c]of Object.entries(e))gh(n,t,a,r,c);break}}function gh(a,e,n,t,o){a.tag(n.no,B.LengthDelimited),a.fork();let i=t;switch(n.K){case f.INT32:case f.FIXED32:case f.UINT32:case f.SFIXED32:case f.SINT32:i=Number.parseInt(t);break;case f.BOOL:A(t=="true"||t=="false"),i=t=="true";break}switch(gn(a,n.K,1,i),n.V.kind){case"scalar":gn(a,n.V.T,2,o);break;case"enum":gn(a,f.INT32,2,o);break;case"message":A(o!==void 0),a.tag(2,B.LengthDelimited).bytes(o.toBinary(e));break}a.join()}function Ei(a,e,n,t){const o=vi(n.T,t);n.delimited?a.tag(n.no,B.StartGroup).raw(o.toBinary(e)).tag(n.no,B.EndGroup):a.tag(n.no,B.LengthDelimited).bytes(o.toBinary(e))}function gn(a,e,n,t){A(t!==void 0);let[o,i]=wi(e);a.tag(n,o)[i](t)}function Th(a,e,n,t){if(!t.length)return;a.tag(n,B.LengthDelimited).fork();let[,o]=wi(e);for(let i=0;i<t.length;i++)a[o](t[i]);a.join()}function wi(a){let e=B.Varint;switch(a){case f.BYTES:case f.STRING:e=B.LengthDelimited;break;case f.DOUBLE:case f.FIXED64:case f.SFIXED64:e=B.Bit64;break;case f.FIXED32:case f.SFIXED32:case f.FLOAT:e=B.Bit32;break}const n=f[a].toLowerCase();return[e,n]}function kh(){return{setEnumType:ti,initPartial(a,e){if(a===void 0)return;const n=e.getType();for(const t of n.fields.byMember()){const o=t.localName,i=e,r=a;if(r[o]!=null)switch(t.kind){case"oneof":const c=r[o].case;if(c===void 0)continue;const d=t.findField(c);let p=r[o].value;d&&d.kind=="message"&&!We(p,d.T)?p=new d.T(p):d&&d.kind==="scalar"&&d.T===f.BYTES&&(p=Tn(p)),i[o]={case:c,value:p};break;case"scalar":case"enum":let k=r[o];t.T===f.BYTES&&(k=t.repeated?k.map(Tn):Tn(k)),i[o]=k;break;case"map":switch(t.V.kind){case"scalar":case"enum":if(t.V.T===f.BYTES)for(const[_,M]of Object.entries(r[o]))i[o][_]=Tn(M);else Object.assign(i[o],r[o]);break;case"message":const I=t.V.T;for(const _ of Object.keys(r[o])){let M=r[o][_];I.fieldWrapper||(M=new I(M)),i[o][_]=M}break}break;case"message":const R=t.T;if(t.repeated)i[o]=r[o].map(I=>We(I,R)?I:new R(I));else{const I=r[o];R.fieldWrapper?R.typeName==="google.protobuf.BytesValue"?i[o]=Tn(I):i[o]=I:i[o]=We(I,R)?I:new R(I)}break}}},equals(a,e,n){return e===n?!0:!e||!n?!1:a.fields.byMember().every(t=>{const o=e[t.localName],i=n[t.localName];if(t.repeated){if(o.length!==i.length)return!1;switch(t.kind){case"message":return o.every((r,c)=>t.T.equals(r,i[c]));case"scalar":return o.every((r,c)=>Ge(t.T,r,i[c]));case"enum":return o.every((r,c)=>Ge(f.INT32,r,i[c]))}throw new Error(`repeated cannot contain ${t.kind}`)}switch(t.kind){case"message":return t.T.equals(o,i);case"enum":return Ge(f.INT32,o,i);case"scalar":return Ge(t.T,o,i);case"oneof":if(o.case!==i.case)return!1;const r=t.findField(o.case);if(r===void 0)return!0;switch(r.kind){case"message":return r.T.equals(o.value,i.value);case"enum":return Ge(f.INT32,o.value,i.value);case"scalar":return Ge(r.T,o.value,i.value)}throw new Error(`oneof cannot contain ${r.kind}`);case"map":const c=Object.keys(o).concat(Object.keys(i));switch(t.V.kind){case"message":const d=t.V.T;return c.every(k=>d.equals(o[k],i[k]));case"enum":return c.every(k=>Ge(f.INT32,o[k],i[k]));case"scalar":const p=t.V.T;return c.every(k=>Ge(p,o[k],i[k]))}break}})},clone(a){const e=a.getType(),n=new e,t=n;for(const o of e.fields.byMember()){const i=a[o.localName];let r;if(o.repeated)r=i.map(Yn);else if(o.kind=="map"){r=t[o.localName];for(const[c,d]of Object.entries(i))r[c]=Yn(d)}else o.kind=="oneof"?r=o.findField(i.case)?{case:i.case,value:Yn(i.value)}:{case:void 0}:r=Yn(i);t[o.localName]=r}for(const o of e.runtime.bin.listUnknownFields(a))e.runtime.bin.onUnknownField(t,o.no,o.wireType,o.data);return n}}}function Yn(a){if(a===void 0)return a;if(We(a))return a.clone();if(a instanceof Uint8Array){const e=new Uint8Array(a.byteLength);return e.set(a),e}return a}function Tn(a){return a instanceof Uint8Array?a:new Uint8Array(a)}function Oi(a,e,n){return{syntax:a,json:ih(),bin:dh(),util:Object.assign(Object.assign({},kh()),{newFieldList:e,initFields:n}),makeMessageType(t,o,i){return Vv(this,t,o,i)},makeEnum:$v,makeEnumType:si,getEnumType:Yv,makeExtension(t,o,i){return Zv(this,t,o,i)}}}class Ci{constructor(e,n){this._fields=e,this._normalizer=n}findJsonName(e){if(!this.jsonNames){const n={};for(const t of this.list())n[t.jsonName]=n[t.name]=t;this.jsonNames=n}return this.jsonNames[e]}find(e){if(!this.numbers){const n={};for(const t of this.list())n[t.no]=t;this.numbers=n}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,n)=>e.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let n;for(const t of this.list())t.oneof?t.oneof!==n&&(n=t.oneof,e.push(n)):e.push(t)}return this.members}}function Ni(a,e){const n=Pi(a);return e?n:_h(Rh(n))}function yh(a){return Ni(a,!1)}const vh=Pi;function Pi(a){let e=!1;const n=[];for(let t=0;t<a.length;t++){let o=a.charAt(t);switch(o){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(o),e=!1;break;default:e&&(e=!1,o=o.toUpperCase()),n.push(o);break}}return n.join("")}const hh=new Set(["constructor","toString","toJSON","valueOf"]),fh=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),Di=a=>`${a}$`,Rh=a=>fh.has(a)?Di(a):a,_h=a=>hh.has(a)?Di(a):a;class Sh{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=yh(e)}addField(e){A(e.oneof===this,`field ${e.name} not one of ${this.name}`),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n<this.fields.length;n++)this._lookup[this.fields[n].localName]=this.fields[n]}return this._lookup[e]}}function Ai(a,e){var n,t,o,i,r,c;const d=[];let p;for(const k of typeof a=="function"?a():a){const R=k;if(R.localName=Ni(k.name,k.oneof!==void 0),R.jsonName=(n=k.jsonName)!==null&&n!==void 0?n:vh(k.name),R.repeated=(t=k.repeated)!==null&&t!==void 0?t:!1,k.kind=="scalar"&&(R.L=(o=k.L)!==null&&o!==void 0?o:Le.BIGINT),R.delimited=(i=k.delimited)!==null&&i!==void 0?i:!1,R.req=(r=k.req)!==null&&r!==void 0?r:!1,R.opt=(c=k.opt)!==null&&c!==void 0?c:!1,k.packed===void 0&&(e?R.packed=k.kind=="enum"||k.kind=="scalar"&&k.T!=f.BYTES&&k.T!=f.STRING:R.packed=!1),k.oneof!==void 0){const I=typeof k.oneof=="string"?k.oneof:k.oneof.name;(!p||p.name!=I)&&(p=new Sh(I)),R.oneof=p,p.addField(R)}d.push(R)}return d}const s=Oi("proto3",a=>new Ci(a,e=>Ai(e,!0)),a=>{for(const e of a.getType().fields.byMember()){if(e.opt)continue;const n=e.localName,t=a;if(e.repeated){t[n]=[];continue}switch(e.kind){case"oneof":t[n]={case:void 0};break;case"enum":t[n]=0;break;case"map":t[n]={};break;case"scalar":t[n]=an(e.T,e.L);break}}}),u=Oi("proto2",a=>new Ci(a,e=>Ai(e,!1)),a=>{for(const e of a.getType().fields.byMember()){const n=e.localName,t=a;if(e.repeated){t[n]=[];continue}switch(e.kind){case"oneof":t[n]={case:void 0};break;case"map":t[n]={};break}}});var m;(function(a){a[a.Unary=0]="Unary",a[a.ServerStreaming=1]="ServerStreaming",a[a.ClientStreaming=2]="ClientStreaming",a[a.BiDiStreaming=3]="BiDiStreaming"})(m||(m={}));var qi;(function(a){a[a.NoSideEffects=1]="NoSideEffects",a[a.Idempotent=2]="Idempotent"})(qi||(qi={}));var Z;(function(a){a[a.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",a[a.EDITION_LEGACY=900]="EDITION_LEGACY",a[a.EDITION_PROTO2=998]="EDITION_PROTO2",a[a.EDITION_PROTO3=999]="EDITION_PROTO3",a[a.EDITION_2023=1e3]="EDITION_2023",a[a.EDITION_2024=1001]="EDITION_2024",a[a.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",a[a.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",a[a.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",a[a.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",a[a.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",a[a.EDITION_MAX=2147483647]="EDITION_MAX"})(Z||(Z={})),u.util.setEnumType(Z,"google.protobuf.Edition",[{no:0,name:"EDITION_UNKNOWN"},{no:900,name:"EDITION_LEGACY"},{no:998,name:"EDITION_PROTO2"},{no:999,name:"EDITION_PROTO3"},{no:1e3,name:"EDITION_2023"},{no:1001,name:"EDITION_2024"},{no:1,name:"EDITION_1_TEST_ONLY"},{no:2,name:"EDITION_2_TEST_ONLY"},{no:99997,name:"EDITION_99997_TEST_ONLY"},{no:99998,name:"EDITION_99998_TEST_ONLY"},{no:99999,name:"EDITION_99999_TEST_ONLY"},{no:2147483647,name:"EDITION_MAX"}]);class Be extends w{constructor(e){super(),this.file=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Be().fromBinary(e,n)}static fromJson(e,n){return new Be().fromJson(e,n)}static fromJsonString(e,n){return new Be().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Be,e,n)}}Be.runtime=u,Be.typeName="google.protobuf.FileDescriptorSet",Be.fields=u.util.newFieldList(()=>[{no:1,name:"file",kind:"message",T:se,repeated:!0}]);class se extends w{constructor(e){super(),this.dependency=[],this.publicDependency=[],this.weakDependency=[],this.messageType=[],this.enumType=[],this.service=[],this.extension=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new se().fromBinary(e,n)}static fromJson(e,n){return new se().fromJson(e,n)}static fromJsonString(e,n){return new se().fromJsonString(e,n)}static equals(e,n){return u.util.equals(se,e,n)}}se.runtime=u,se.typeName="google.protobuf.FileDescriptorProto",se.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"package",kind:"scalar",T:9,opt:!0},{no:3,name:"dependency",kind:"scalar",T:9,repeated:!0},{no:10,name:"public_dependency",kind:"scalar",T:5,repeated:!0},{no:11,name:"weak_dependency",kind:"scalar",T:5,repeated:!0},{no:4,name:"message_type",kind:"message",T:oe,repeated:!0},{no:5,name:"enum_type",kind:"message",T:ie,repeated:!0},{no:6,name:"service",kind:"message",T:fe,repeated:!0},{no:7,name:"extension",kind:"message",T:ee,repeated:!0},{no:8,name:"options",kind:"message",T:_e,opt:!0},{no:9,name:"source_code_info",kind:"message",T:Pe,opt:!0},{no:12,name:"syntax",kind:"scalar",T:9,opt:!0},{no:14,name:"edition",kind:"enum",T:u.getEnumType(Z),opt:!0}]);class oe extends w{constructor(e){super(),this.field=[],this.extension=[],this.nestedType=[],this.enumType=[],this.extensionRange=[],this.oneofDecl=[],this.reservedRange=[],this.reservedName=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new oe().fromBinary(e,n)}static fromJson(e,n){return new oe().fromJson(e,n)}static fromJsonString(e,n){return new oe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(oe,e,n)}}oe.runtime=u,oe.typeName="google.protobuf.DescriptorProto",oe.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"field",kind:"message",T:ee,repeated:!0},{no:6,name:"extension",kind:"message",T:ee,repeated:!0},{no:3,name:"nested_type",kind:"message",T:oe,repeated:!0},{no:4,name:"enum_type",kind:"message",T:ie,repeated:!0},{no:5,name:"extension_range",kind:"message",T:ue,repeated:!0},{no:8,name:"oneof_decl",kind:"message",T:ye,repeated:!0},{no:7,name:"options",kind:"message",T:Se,opt:!0},{no:9,name:"reserved_range",kind:"message",T:ge,repeated:!0},{no:10,name:"reserved_name",kind:"scalar",T:9,repeated:!0}]);class ue extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ue().fromBinary(e,n)}static fromJson(e,n){return new ue().fromJson(e,n)}static fromJsonString(e,n){return new ue().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ue,e,n)}}ue.runtime=u,ue.typeName="google.protobuf.DescriptorProto.ExtensionRange",ue.fields=u.util.newFieldList(()=>[{no:1,name:"start",kind:"scalar",T:5,opt:!0},{no:2,name:"end",kind:"scalar",T:5,opt:!0},{no:3,name:"options",kind:"message",T:Te,opt:!0}]);class ge extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ge().fromBinary(e,n)}static fromJson(e,n){return new ge().fromJson(e,n)}static fromJsonString(e,n){return new ge().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ge,e,n)}}ge.runtime=u,ge.typeName="google.protobuf.DescriptorProto.ReservedRange",ge.fields=u.util.newFieldList(()=>[{no:1,name:"start",kind:"scalar",T:5,opt:!0},{no:2,name:"end",kind:"scalar",T:5,opt:!0}]);class Te extends w{constructor(e){super(),this.uninterpretedOption=[],this.declaration=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Te().fromBinary(e,n)}static fromJson(e,n){return new Te().fromJson(e,n)}static fromJsonString(e,n){return new Te().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Te,e,n)}}Te.runtime=u,Te.typeName="google.protobuf.ExtensionRangeOptions",Te.fields=u.util.newFieldList(()=>[{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0},{no:2,name:"declaration",kind:"message",T:ke,repeated:!0},{no:50,name:"features",kind:"message",T:z,opt:!0},{no:3,name:"verification",kind:"enum",T:u.getEnumType(kn),opt:!0,default:kn.UNVERIFIED}]);var kn;(function(a){a[a.DECLARATION=0]="DECLARATION",a[a.UNVERIFIED=1]="UNVERIFIED"})(kn||(kn={})),u.util.setEnumType(kn,"google.protobuf.ExtensionRangeOptions.VerificationState",[{no:0,name:"DECLARATION"},{no:1,name:"UNVERIFIED"}]);class ke extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ke().fromBinary(e,n)}static fromJson(e,n){return new ke().fromJson(e,n)}static fromJsonString(e,n){return new ke().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ke,e,n)}}ke.runtime=u,ke.typeName="google.protobuf.ExtensionRangeOptions.Declaration",ke.fields=u.util.newFieldList(()=>[{no:1,name:"number",kind:"scalar",T:5,opt:!0},{no:2,name:"full_name",kind:"scalar",T:9,opt:!0},{no:3,name:"type",kind:"scalar",T:9,opt:!0},{no:5,name:"reserved",kind:"scalar",T:8,opt:!0},{no:6,name:"repeated",kind:"scalar",T:8,opt:!0}]);class ee extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ee().fromBinary(e,n)}static fromJson(e,n){return new ee().fromJson(e,n)}static fromJsonString(e,n){return new ee().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ee,e,n)}}ee.runtime=u,ee.typeName="google.protobuf.FieldDescriptorProto",ee.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:3,name:"number",kind:"scalar",T:5,opt:!0},{no:4,name:"label",kind:"enum",T:u.getEnumType(Vn),opt:!0},{no:5,name:"type",kind:"enum",T:u.getEnumType($n),opt:!0},{no:6,name:"type_name",kind:"scalar",T:9,opt:!0},{no:2,name:"extendee",kind:"scalar",T:9,opt:!0},{no:7,name:"default_value",kind:"scalar",T:9,opt:!0},{no:9,name:"oneof_index",kind:"scalar",T:5,opt:!0},{no:10,name:"json_name",kind:"scalar",T:9,opt:!0},{no:8,name:"options",kind:"message",T:Ie,opt:!0},{no:17,name:"proto3_optional",kind:"scalar",T:8,opt:!0}]);var $n;(function(a){a[a.DOUBLE=1]="DOUBLE",a[a.FLOAT=2]="FLOAT",a[a.INT64=3]="INT64",a[a.UINT64=4]="UINT64",a[a.INT32=5]="INT32",a[a.FIXED64=6]="FIXED64",a[a.FIXED32=7]="FIXED32",a[a.BOOL=8]="BOOL",a[a.STRING=9]="STRING",a[a.GROUP=10]="GROUP",a[a.MESSAGE=11]="MESSAGE",a[a.BYTES=12]="BYTES",a[a.UINT32=13]="UINT32",a[a.ENUM=14]="ENUM",a[a.SFIXED32=15]="SFIXED32",a[a.SFIXED64=16]="SFIXED64",a[a.SINT32=17]="SINT32",a[a.SINT64=18]="SINT64"})($n||($n={})),u.util.setEnumType($n,"google.protobuf.FieldDescriptorProto.Type",[{no:1,name:"TYPE_DOUBLE"},{no:2,name:"TYPE_FLOAT"},{no:3,name:"TYPE_INT64"},{no:4,name:"TYPE_UINT64"},{no:5,name:"TYPE_INT32"},{no:6,name:"TYPE_FIXED64"},{no:7,name:"TYPE_FIXED32"},{no:8,name:"TYPE_BOOL"},{no:9,name:"TYPE_STRING"},{no:10,name:"TYPE_GROUP"},{no:11,name:"TYPE_MESSAGE"},{no:12,name:"TYPE_BYTES"},{no:13,name:"TYPE_UINT32"},{no:14,name:"TYPE_ENUM"},{no:15,name:"TYPE_SFIXED32"},{no:16,name:"TYPE_SFIXED64"},{no:17,name:"TYPE_SINT32"},{no:18,name:"TYPE_SINT64"}]);var Vn;(function(a){a[a.OPTIONAL=1]="OPTIONAL",a[a.REPEATED=3]="REPEATED",a[a.REQUIRED=2]="REQUIRED"})(Vn||(Vn={})),u.util.setEnumType(Vn,"google.protobuf.FieldDescriptorProto.Label",[{no:1,name:"LABEL_OPTIONAL"},{no:3,name:"LABEL_REPEATED"},{no:2,name:"LABEL_REQUIRED"}]);class ye extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ye().fromBinary(e,n)}static fromJson(e,n){return new ye().fromJson(e,n)}static fromJsonString(e,n){return new ye().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ye,e,n)}}ye.runtime=u,ye.typeName="google.protobuf.OneofDescriptorProto",ye.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"options",kind:"message",T:be,opt:!0}]);class ie extends w{constructor(e){super(),this.value=[],this.reservedRange=[],this.reservedName=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new ie().fromBinary(e,n)}static fromJson(e,n){return new ie().fromJson(e,n)}static fromJsonString(e,n){return new ie().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ie,e,n)}}ie.runtime=u,ie.typeName="google.protobuf.EnumDescriptorProto",ie.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"value",kind:"message",T:he,repeated:!0},{no:3,name:"options",kind:"message",T:Ee,opt:!0},{no:4,name:"reserved_range",kind:"message",T:ve,repeated:!0},{no:5,name:"reserved_name",kind:"scalar",T:9,repeated:!0}]);class ve extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new ve().fromBinary(e,n)}static fromJson(e,n){return new ve().fromJson(e,n)}static fromJsonString(e,n){return new ve().fromJsonString(e,n)}static equals(e,n){return u.util.equals(ve,e,n)}}ve.runtime=u,ve.typeName="google.protobuf.EnumDescriptorProto.EnumReservedRange",ve.fields=u.util.newFieldList(()=>[{no:1,name:"start",kind:"scalar",T:5,opt:!0},{no:2,name:"end",kind:"scalar",T:5,opt:!0}]);class he extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new he().fromBinary(e,n)}static fromJson(e,n){return new he().fromJson(e,n)}static fromJsonString(e,n){return new he().fromJsonString(e,n)}static equals(e,n){return u.util.equals(he,e,n)}}he.runtime=u,he.typeName="google.protobuf.EnumValueDescriptorProto",he.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"number",kind:"scalar",T:5,opt:!0},{no:3,name:"options",kind:"message",T:we,opt:!0}]);class fe extends w{constructor(e){super(),this.method=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new fe().fromBinary(e,n)}static fromJson(e,n){return new fe().fromJson(e,n)}static fromJsonString(e,n){return new fe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(fe,e,n)}}fe.runtime=u,fe.typeName="google.protobuf.ServiceDescriptorProto",fe.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"method",kind:"message",T:Re,repeated:!0},{no:3,name:"options",kind:"message",T:Oe,opt:!0}]);class Re extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new Re().fromBinary(e,n)}static fromJson(e,n){return new Re().fromJson(e,n)}static fromJsonString(e,n){return new Re().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Re,e,n)}}Re.runtime=u,Re.typeName="google.protobuf.MethodDescriptorProto",Re.fields=u.util.newFieldList(()=>[{no:1,name:"name",kind:"scalar",T:9,opt:!0},{no:2,name:"input_type",kind:"scalar",T:9,opt:!0},{no:3,name:"output_type",kind:"scalar",T:9,opt:!0},{no:4,name:"options",kind:"message",T:me,opt:!0},{no:5,name:"client_streaming",kind:"scalar",T:8,opt:!0,default:!1},{no:6,name:"server_streaming",kind:"scalar",T:8,opt:!0,default:!1}]);class _e extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new _e().fromBinary(e,n)}static fromJson(e,n){return new _e().fromJson(e,n)}static fromJsonString(e,n){return new _e().fromJsonString(e,n)}static equals(e,n){return u.util.equals(_e,e,n)}}_e.runtime=u,_e.typeName="google.protobuf.FileOptions",_e.fields=u.util.newFieldList(()=>[{no:1,name:"java_package",kind:"scalar",T:9,opt:!0},{no:8,name:"java_outer_classname",kind:"scalar",T:9,opt:!0},{no:10,name:"java_multiple_files",kind:"scalar",T:8,opt:!0,default:!1},{no:20,name:"java_generate_equals_and_hash",kind:"scalar",T:8,opt:!0},{no:27,name:"java_string_check_utf8",kind:"scalar",T:8,opt:!0,default:!1},{no:9,name:"optimize_for",kind:"enum",T:u.getEnumType(yn),opt:!0,default:yn.SPEED},{no:11,name:"go_package",kind:"scalar",T:9,opt:!0},{no:16,name:"cc_generic_services",kind:"scalar",T:8,opt:!0,default:!1},{no:17,name:"java_generic_services",kind:"scalar",T:8,opt:!0,default:!1},{no:18,name:"py_generic_services",kind:"scalar",T:8,opt:!0,default:!1},{no:23,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:31,name:"cc_enable_arenas",kind:"scalar",T:8,opt:!0,default:!0},{no:36,name:"objc_class_prefix",kind:"scalar",T:9,opt:!0},{no:37,name:"csharp_namespace",kind:"scalar",T:9,opt:!0},{no:39,name:"swift_prefix",kind:"scalar",T:9,opt:!0},{no:40,name:"php_class_prefix",kind:"scalar",T:9,opt:!0},{no:41,name:"php_namespace",kind:"scalar",T:9,opt:!0},{no:44,name:"php_metadata_namespace",kind:"scalar",T:9,opt:!0},{no:45,name:"ruby_package",kind:"scalar",T:9,opt:!0},{no:50,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);var yn;(function(a){a[a.SPEED=1]="SPEED",a[a.CODE_SIZE=2]="CODE_SIZE",a[a.LITE_RUNTIME=3]="LITE_RUNTIME"})(yn||(yn={})),u.util.setEnumType(yn,"google.protobuf.FileOptions.OptimizeMode",[{no:1,name:"SPEED"},{no:2,name:"CODE_SIZE"},{no:3,name:"LITE_RUNTIME"}]);class Se extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Se().fromBinary(e,n)}static fromJson(e,n){return new Se().fromJson(e,n)}static fromJsonString(e,n){return new Se().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Se,e,n)}}Se.runtime=u,Se.typeName="google.protobuf.MessageOptions",Se.fields=u.util.newFieldList(()=>[{no:1,name:"message_set_wire_format",kind:"scalar",T:8,opt:!0,default:!1},{no:2,name:"no_standard_descriptor_accessor",kind:"scalar",T:8,opt:!0,default:!1},{no:3,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:7,name:"map_entry",kind:"scalar",T:8,opt:!0},{no:11,name:"deprecated_legacy_json_field_conflicts",kind:"scalar",T:8,opt:!0},{no:12,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class Ie extends w{constructor(e){super(),this.targets=[],this.editionDefaults=[],this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Ie().fromBinary(e,n)}static fromJson(e,n){return new Ie().fromJson(e,n)}static fromJsonString(e,n){return new Ie().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ie,e,n)}}Ie.runtime=u,Ie.typeName="google.protobuf.FieldOptions",Ie.fields=u.util.newFieldList(()=>[{no:1,name:"ctype",kind:"enum",T:u.getEnumType(vn),opt:!0,default:vn.STRING},{no:2,name:"packed",kind:"scalar",T:8,opt:!0},{no:6,name:"jstype",kind:"enum",T:u.getEnumType(hn),opt:!0,default:hn.JS_NORMAL},{no:5,name:"lazy",kind:"scalar",T:8,opt:!0,default:!1},{no:15,name:"unverified_lazy",kind:"scalar",T:8,opt:!0,default:!1},{no:3,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:10,name:"weak",kind:"scalar",T:8,opt:!0,default:!1},{no:16,name:"debug_redact",kind:"scalar",T:8,opt:!0,default:!1},{no:17,name:"retention",kind:"enum",T:u.getEnumType(Wn),opt:!0},{no:19,name:"targets",kind:"enum",T:u.getEnumType(jn),repeated:!0},{no:20,name:"edition_defaults",kind:"message",T:Me,repeated:!0},{no:21,name:"features",kind:"message",T:z,opt:!0},{no:22,name:"feature_support",kind:"message",T:re,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);var vn;(function(a){a[a.STRING=0]="STRING",a[a.CORD=1]="CORD",a[a.STRING_PIECE=2]="STRING_PIECE"})(vn||(vn={})),u.util.setEnumType(vn,"google.protobuf.FieldOptions.CType",[{no:0,name:"STRING"},{no:1,name:"CORD"},{no:2,name:"STRING_PIECE"}]);var hn;(function(a){a[a.JS_NORMAL=0]="JS_NORMAL",a[a.JS_STRING=1]="JS_STRING",a[a.JS_NUMBER=2]="JS_NUMBER"})(hn||(hn={})),u.util.setEnumType(hn,"google.protobuf.FieldOptions.JSType",[{no:0,name:"JS_NORMAL"},{no:1,name:"JS_STRING"},{no:2,name:"JS_NUMBER"}]);var Wn;(function(a){a[a.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",a[a.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",a[a.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(Wn||(Wn={})),u.util.setEnumType(Wn,"google.protobuf.FieldOptions.OptionRetention",[{no:0,name:"RETENTION_UNKNOWN"},{no:1,name:"RETENTION_RUNTIME"},{no:2,name:"RETENTION_SOURCE"}]);var jn;(function(a){a[a.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",a[a.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",a[a.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",a[a.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",a[a.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",a[a.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",a[a.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",a[a.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",a[a.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",a[a.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(jn||(jn={})),u.util.setEnumType(jn,"google.protobuf.FieldOptions.OptionTargetType",[{no:0,name:"TARGET_TYPE_UNKNOWN"},{no:1,name:"TARGET_TYPE_FILE"},{no:2,name:"TARGET_TYPE_EXTENSION_RANGE"},{no:3,name:"TARGET_TYPE_MESSAGE"},{no:4,name:"TARGET_TYPE_FIELD"},{no:5,name:"TARGET_TYPE_ONEOF"},{no:6,name:"TARGET_TYPE_ENUM"},{no:7,name:"TARGET_TYPE_ENUM_ENTRY"},{no:8,name:"TARGET_TYPE_SERVICE"},{no:9,name:"TARGET_TYPE_METHOD"}]);class Me extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new Me().fromBinary(e,n)}static fromJson(e,n){return new Me().fromJson(e,n)}static fromJsonString(e,n){return new Me().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Me,e,n)}}Me.runtime=u,Me.typeName="google.protobuf.FieldOptions.EditionDefault",Me.fields=u.util.newFieldList(()=>[{no:3,name:"edition",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:2,name:"value",kind:"scalar",T:9,opt:!0}]);class re extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new re().fromBinary(e,n)}static fromJson(e,n){return new re().fromJson(e,n)}static fromJsonString(e,n){return new re().fromJsonString(e,n)}static equals(e,n){return u.util.equals(re,e,n)}}re.runtime=u,re.typeName="google.protobuf.FieldOptions.FeatureSupport",re.fields=u.util.newFieldList(()=>[{no:1,name:"edition_introduced",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:2,name:"edition_deprecated",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:3,name:"deprecation_warning",kind:"scalar",T:9,opt:!0},{no:4,name:"edition_removed",kind:"enum",T:u.getEnumType(Z),opt:!0}]);class be extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new be().fromBinary(e,n)}static fromJson(e,n){return new be().fromJson(e,n)}static fromJsonString(e,n){return new be().fromJsonString(e,n)}static equals(e,n){return u.util.equals(be,e,n)}}be.runtime=u,be.typeName="google.protobuf.OneofOptions",be.fields=u.util.newFieldList(()=>[{no:1,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class Ee extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Ee().fromBinary(e,n)}static fromJson(e,n){return new Ee().fromJson(e,n)}static fromJsonString(e,n){return new Ee().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ee,e,n)}}Ee.runtime=u,Ee.typeName="google.protobuf.EnumOptions",Ee.fields=u.util.newFieldList(()=>[{no:2,name:"allow_alias",kind:"scalar",T:8,opt:!0},{no:3,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:6,name:"deprecated_legacy_json_field_conflicts",kind:"scalar",T:8,opt:!0},{no:7,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class we extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new we().fromBinary(e,n)}static fromJson(e,n){return new we().fromJson(e,n)}static fromJsonString(e,n){return new we().fromJsonString(e,n)}static equals(e,n){return u.util.equals(we,e,n)}}we.runtime=u,we.typeName="google.protobuf.EnumValueOptions",we.fields=u.util.newFieldList(()=>[{no:1,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:2,name:"features",kind:"message",T:z,opt:!0},{no:3,name:"debug_redact",kind:"scalar",T:8,opt:!0,default:!1},{no:4,name:"feature_support",kind:"message",T:re,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class Oe extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Oe().fromBinary(e,n)}static fromJson(e,n){return new Oe().fromJson(e,n)}static fromJsonString(e,n){return new Oe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Oe,e,n)}}Oe.runtime=u,Oe.typeName="google.protobuf.ServiceOptions",Oe.fields=u.util.newFieldList(()=>[{no:34,name:"features",kind:"message",T:z,opt:!0},{no:33,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class me extends w{constructor(e){super(),this.uninterpretedOption=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new me().fromBinary(e,n)}static fromJson(e,n){return new me().fromJson(e,n)}static fromJsonString(e,n){return new me().fromJsonString(e,n)}static equals(e,n){return u.util.equals(me,e,n)}}me.runtime=u,me.typeName="google.protobuf.MethodOptions",me.fields=u.util.newFieldList(()=>[{no:33,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:34,name:"idempotency_level",kind:"enum",T:u.getEnumType(fn),opt:!0,default:fn.IDEMPOTENCY_UNKNOWN},{no:35,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);var fn;(function(a){a[a.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",a[a.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",a[a.IDEMPOTENT=2]="IDEMPOTENT"})(fn||(fn={})),u.util.setEnumType(fn,"google.protobuf.MethodOptions.IdempotencyLevel",[{no:0,name:"IDEMPOTENCY_UNKNOWN"},{no:1,name:"NO_SIDE_EFFECTS"},{no:2,name:"IDEMPOTENT"}]);class W extends w{constructor(e){super(),this.name=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new W().fromBinary(e,n)}static fromJson(e,n){return new W().fromJson(e,n)}static fromJsonString(e,n){return new W().fromJsonString(e,n)}static equals(e,n){return u.util.equals(W,e,n)}}W.runtime=u,W.typeName="google.protobuf.UninterpretedOption",W.fields=u.util.newFieldList(()=>[{no:2,name:"name",kind:"message",T:Ce,repeated:!0},{no:3,name:"identifier_value",kind:"scalar",T:9,opt:!0},{no:4,name:"positive_int_value",kind:"scalar",T:4,opt:!0},{no:5,name:"negative_int_value",kind:"scalar",T:3,opt:!0},{no:6,name:"double_value",kind:"scalar",T:1,opt:!0},{no:7,name:"string_value",kind:"scalar",T:12,opt:!0},{no:8,name:"aggregate_value",kind:"scalar",T:9,opt:!0}]);class Ce extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new Ce().fromBinary(e,n)}static fromJson(e,n){return new Ce().fromJson(e,n)}static fromJsonString(e,n){return new Ce().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ce,e,n)}}Ce.runtime=u,Ce.typeName="google.protobuf.UninterpretedOption.NamePart",Ce.fields=u.util.newFieldList(()=>[{no:1,name:"name_part",kind:"scalar",T:9,req:!0},{no:2,name:"is_extension",kind:"scalar",T:8,req:!0}]);class z extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new z().fromBinary(e,n)}static fromJson(e,n){return new z().fromJson(e,n)}static fromJsonString(e,n){return new z().fromJsonString(e,n)}static equals(e,n){return u.util.equals(z,e,n)}}z.runtime=u,z.typeName="google.protobuf.FeatureSet",z.fields=u.util.newFieldList(()=>[{no:1,name:"field_presence",kind:"enum",T:u.getEnumType(Hn),opt:!0},{no:2,name:"enum_type",kind:"enum",T:u.getEnumType(Kn),opt:!0},{no:3,name:"repeated_field_encoding",kind:"enum",T:u.getEnumType(Xn),opt:!0},{no:4,name:"utf8_validation",kind:"enum",T:u.getEnumType(Qn),opt:!0},{no:5,name:"message_encoding",kind:"enum",T:u.getEnumType(Zn),opt:!0},{no:6,name:"json_format",kind:"enum",T:u.getEnumType(ea),opt:!0}]);var Hn;(function(a){a[a.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",a[a.EXPLICIT=1]="EXPLICIT",a[a.IMPLICIT=2]="IMPLICIT",a[a.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Hn||(Hn={})),u.util.setEnumType(Hn,"google.protobuf.FeatureSet.FieldPresence",[{no:0,name:"FIELD_PRESENCE_UNKNOWN"},{no:1,name:"EXPLICIT"},{no:2,name:"IMPLICIT"},{no:3,name:"LEGACY_REQUIRED"}]);var Kn;(function(a){a[a.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",a[a.OPEN=1]="OPEN",a[a.CLOSED=2]="CLOSED"})(Kn||(Kn={})),u.util.setEnumType(Kn,"google.protobuf.FeatureSet.EnumType",[{no:0,name:"ENUM_TYPE_UNKNOWN"},{no:1,name:"OPEN"},{no:2,name:"CLOSED"}]);var Xn;(function(a){a[a.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",a[a.PACKED=1]="PACKED",a[a.EXPANDED=2]="EXPANDED"})(Xn||(Xn={})),u.util.setEnumType(Xn,"google.protobuf.FeatureSet.RepeatedFieldEncoding",[{no:0,name:"REPEATED_FIELD_ENCODING_UNKNOWN"},{no:1,name:"PACKED"},{no:2,name:"EXPANDED"}]);var Qn;(function(a){a[a.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",a[a.VERIFY=2]="VERIFY",a[a.NONE=3]="NONE"})(Qn||(Qn={})),u.util.setEnumType(Qn,"google.protobuf.FeatureSet.Utf8Validation",[{no:0,name:"UTF8_VALIDATION_UNKNOWN"},{no:2,name:"VERIFY"},{no:3,name:"NONE"}]);var Zn;(function(a){a[a.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",a[a.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",a[a.DELIMITED=2]="DELIMITED"})(Zn||(Zn={})),u.util.setEnumType(Zn,"google.protobuf.FeatureSet.MessageEncoding",[{no:0,name:"MESSAGE_ENCODING_UNKNOWN"},{no:1,name:"LENGTH_PREFIXED"},{no:2,name:"DELIMITED"}]);var ea;(function(a){a[a.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",a[a.ALLOW=1]="ALLOW",a[a.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(ea||(ea={})),u.util.setEnumType(ea,"google.protobuf.FeatureSet.JsonFormat",[{no:0,name:"JSON_FORMAT_UNKNOWN"},{no:1,name:"ALLOW"},{no:2,name:"LEGACY_BEST_EFFORT"}]);class Fe extends w{constructor(e){super(),this.defaults=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Fe().fromBinary(e,n)}static fromJson(e,n){return new Fe().fromJson(e,n)}static fromJsonString(e,n){return new Fe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Fe,e,n)}}Fe.runtime=u,Fe.typeName="google.protobuf.FeatureSetDefaults",Fe.fields=u.util.newFieldList(()=>[{no:1,name:"defaults",kind:"message",T:Ne,repeated:!0},{no:4,name:"minimum_edition",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:5,name:"maximum_edition",kind:"enum",T:u.getEnumType(Z),opt:!0}]);class Ne extends w{constructor(e){super(),u.util.initPartial(e,this)}static fromBinary(e,n){return new Ne().fromBinary(e,n)}static fromJson(e,n){return new Ne().fromJson(e,n)}static fromJsonString(e,n){return new Ne().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ne,e,n)}}Ne.runtime=u,Ne.typeName="google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",Ne.fields=u.util.newFieldList(()=>[{no:3,name:"edition",kind:"enum",T:u.getEnumType(Z),opt:!0},{no:4,name:"overridable_features",kind:"message",T:z,opt:!0},{no:5,name:"fixed_features",kind:"message",T:z,opt:!0}]);class Pe extends w{constructor(e){super(),this.location=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Pe().fromBinary(e,n)}static fromJson(e,n){return new Pe().fromJson(e,n)}static fromJsonString(e,n){return new Pe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Pe,e,n)}}Pe.runtime=u,Pe.typeName="google.protobuf.SourceCodeInfo",Pe.fields=u.util.newFieldList(()=>[{no:1,name:"location",kind:"message",T:De,repeated:!0}]);class De extends w{constructor(e){super(),this.path=[],this.span=[],this.leadingDetachedComments=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new De().fromBinary(e,n)}static fromJson(e,n){return new De().fromJson(e,n)}static fromJsonString(e,n){return new De().fromJsonString(e,n)}static equals(e,n){return u.util.equals(De,e,n)}}De.runtime=u,De.typeName="google.protobuf.SourceCodeInfo.Location",De.fields=u.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:5,repeated:!0,packed:!0},{no:2,name:"span",kind:"scalar",T:5,repeated:!0,packed:!0},{no:3,name:"leading_comments",kind:"scalar",T:9,opt:!0},{no:4,name:"trailing_comments",kind:"scalar",T:9,opt:!0},{no:6,name:"leading_detached_comments",kind:"scalar",T:9,repeated:!0}]);class xe extends w{constructor(e){super(),this.annotation=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new xe().fromBinary(e,n)}static fromJson(e,n){return new xe().fromJson(e,n)}static fromJsonString(e,n){return new xe().fromJsonString(e,n)}static equals(e,n){return u.util.equals(xe,e,n)}}xe.runtime=u,xe.typeName="google.protobuf.GeneratedCodeInfo",xe.fields=u.util.newFieldList(()=>[{no:1,name:"annotation",kind:"message",T:Ae,repeated:!0}]);class Ae extends w{constructor(e){super(),this.path=[],u.util.initPartial(e,this)}static fromBinary(e,n){return new Ae().fromBinary(e,n)}static fromJson(e,n){return new Ae().fromJson(e,n)}static fromJsonString(e,n){return new Ae().fromJsonString(e,n)}static equals(e,n){return u.util.equals(Ae,e,n)}}Ae.runtime=u,Ae.typeName="google.protobuf.GeneratedCodeInfo.Annotation",Ae.fields=u.util.newFieldList(()=>[{no:1,name:"path",kind:"scalar",T:5,repeated:!0,packed:!0},{no:2,name:"source_file",kind:"scalar",T:9,opt:!0},{no:3,name:"begin",kind:"scalar",T:5,opt:!0},{no:4,name:"end",kind:"scalar",T:5,opt:!0},{no:5,name:"semantic",kind:"enum",T:u.getEnumType(na),opt:!0}]);var na;(function(a){a[a.NONE=0]="NONE",a[a.SET=1]="SET",a[a.ALIAS=2]="ALIAS"})(na||(na={})),u.util.setEnumType(na,"google.protobuf.GeneratedCodeInfo.Annotation.Semantic",[{no:0,name:"NONE"},{no:1,name:"SET"},{no:2,name:"ALIAS"}]);class S extends w{constructor(e){super(),this.seconds=V.zero,this.nanos=0,s.util.initPartial(e,this)}fromJson(e,n){if(typeof e!="string")throw new Error(`cannot decode google.protobuf.Timestamp from JSON: ${s.json.debug(e)}`);const t=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!t)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const o=Date.parse(t[1]+"-"+t[2]+"-"+t[3]+"T"+t[4]+":"+t[5]+":"+t[6]+(t[8]?t[8]:"Z"));if(Number.isNaN(o))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(o<Date.parse("0001-01-01T00:00:00Z")||o>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=V.parse(o/1e3),this.nanos=0,t[7]&&(this.nanos=parseInt("1"+t[7]+"0".repeat(9-t[7].length))-1e9),this}toJson(e){const n=Number(this.seconds)*1e3;if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let t="Z";if(this.nanos>0){const o=(this.nanos+1e9).toString().substring(1);o.substring(3)==="000000"?t="."+o.substring(0,3)+"Z":o.substring(6)==="000"?t="."+o.substring(0,6)+"Z":t="."+o+"Z"}return new Date(n).toISOString().replace(".000Z",t)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return S.fromDate(new Date)}static fromDate(e){const n=e.getTime();return new S({seconds:V.parse(Math.floor(n/1e3)),nanos:n%1e3*1e6})}static fromBinary(e,n){return new S().fromBinary(e,n)}static fromJson(e,n){return new S().fromJson(e,n)}static fromJsonString(e,n){return new S().fromJsonString(e,n)}static equals(e,n){return s.util.equals(S,e,n)}}S.runtime=s,S.typeName="google.protobuf.Timestamp",S.fields=s.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);class F extends w{constructor(e){super(),this.seconds=V.zero,this.nanos=0,s.util.initPartial(e,this)}fromJson(e,n){if(typeof e!="string")throw new Error(`cannot decode google.protobuf.Duration from JSON: ${s.json.debug(e)}`);const t=e.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(t===null)throw new Error(`cannot decode google.protobuf.Duration from JSON: ${s.json.debug(e)}`);const o=Number(t[1]);if(o>315576e6||o<-315576e6)throw new Error(`cannot decode google.protobuf.Duration from JSON: ${s.json.debug(e)}`);if(this.seconds=V.parse(o),typeof t[2]=="string"){const i=t[2]+"0".repeat(9-t[2].length);this.nanos=parseInt(i),(o<0||Object.is(o,-0))&&(this.nanos=-this.nanos)}return this}toJson(e){if(Number(this.seconds)>315576e6||Number(this.seconds)<-315576e6)throw new Error("cannot encode google.protobuf.Duration to JSON: value out of range");let n=this.seconds.toString();if(this.nanos!==0){let t=Math.abs(this.nanos).toString();t="0".repeat(9-t.length)+t,t.substring(3)==="000000"?t=t.substring(0,3):t.substring(6)==="000"&&(t=t.substring(0,6)),n+="."+t,this.nanos<0&&Number(this.seconds)==0&&(n="-"+n)}return n+"s"}static fromBinary(e,n){return new F().fromBinary(e,n)}static fromJson(e,n){return new F().fromJson(e,n)}static fromJsonString(e,n){return new F().fromJsonString(e,n)}static equals(e,n){return s.util.equals(F,e,n)}}F.runtime=s,F.typeName="google.protobuf.Duration",F.fields=s.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);class j extends w{constructor(e){super(),this.typeUrl="",this.value=new Uint8Array(0),s.util.initPartial(e,this)}toJson(e){var n;if(this.typeUrl==="")return{};const t=this.typeUrlToName(this.typeUrl),o=(n=e?.typeRegistry)===null||n===void 0?void 0:n.findMessage(t);if(!o)throw new Error(`cannot encode message google.protobuf.Any to JSON: "${this.typeUrl}" is not in the type registry`);let r=o.fromBinary(this.value).toJson(e);return(t.startsWith("google.protobuf.")||r===null||Array.isArray(r)||typeof r!="object")&&(r={value:r}),r["@type"]=this.typeUrl,r}fromJson(e,n){var t;if(e===null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message google.protobuf.Any from JSON: expected object but got ${e===null?"null":Array.isArray(e)?"array":typeof e}`);if(Object.keys(e).length==0)return this;const o=e["@type"];if(typeof o!="string"||o=="")throw new Error('cannot decode message google.protobuf.Any from JSON: "@type" is empty');const i=this.typeUrlToName(o),r=(t=n?.typeRegistry)===null||t===void 0?void 0:t.findMessage(i);if(!r)throw new Error(`cannot decode message google.protobuf.Any from JSON: ${o} is not in the type registry`);let c;if(i.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(e,"value"))c=r.fromJson(e.value,n);else{const d=Object.assign({},e);delete d["@type"],c=r.fromJson(d,n)}return this.packFrom(c),this}packFrom(e){this.value=e.toBinary(),this.typeUrl=this.typeNameToUrl(e.getType().typeName)}unpackTo(e){return this.is(e.getType())?(e.fromBinary(this.value),!0):!1}unpack(e){if(this.typeUrl==="")return;const n=e.findMessage(this.typeUrlToName(this.typeUrl));if(n)return n.fromBinary(this.value)}is(e){if(this.typeUrl==="")return!1;const n=this.typeUrlToName(this.typeUrl);let t="";return typeof e=="string"?t=e:t=e.typeName,n===t}typeNameToUrl(e){return`type.googleapis.com/${e}`}typeUrlToName(e){if(!e.length)throw new Error(`invalid type url: ${e}`);const n=e.lastIndexOf("/"),t=n>=0?e.substring(n+1):e;if(!t.length)throw new Error(`invalid type url: ${e}`);return t}static pack(e){const n=new j;return n.packFrom(e),n}static fromBinary(e,n){return new j().fromBinary(e,n)}static fromJson(e,n){return new j().fromJson(e,n)}static fromJsonString(e,n){return new j().fromJsonString(e,n)}static equals(e,n){return s.util.equals(j,e,n)}}j.runtime=s,j.typeName="google.protobuf.Any",j.fields=s.util.newFieldList(()=>[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}]);var Rn;(function(a){a[a.NULL_VALUE=0]="NULL_VALUE"})(Rn||(Rn={})),s.util.setEnumType(Rn,"google.protobuf.NullValue",[{no:0,name:"NULL_VALUE"}]);class l extends w{constructor(e){super(),this.fields={},s.util.initPartial(e,this)}toJson(e){const n={};for(const[t,o]of Object.entries(this.fields))n[t]=o.toJson(e);return n}fromJson(e,n){if(typeof e!="object"||e==null||Array.isArray(e))throw new Error("cannot decode google.protobuf.Struct from JSON "+s.json.debug(e));for(const[t,o]of Object.entries(e))this.fields[t]=X.fromJson(o);return this}static fromBinary(e,n){return new l().fromBinary(e,n)}static fromJson(e,n){return new l().fromJson(e,n)}static fromJsonString(e,n){return new l().fromJsonString(e,n)}static equals(e,n){return s.util.equals(l,e,n)}}l.runtime=s,l.typeName="google.protobuf.Struct",l.fields=s.util.newFieldList(()=>[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:X}}]);class X extends w{constructor(e){super(),this.kind={case:void 0},s.util.initPartial(e,this)}toJson(e){switch(this.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(this.kind.value))throw new Error("google.protobuf.Value cannot be NaN or Infinity");return this.kind.value;case"boolValue":return this.kind.value;case"stringValue":return this.kind.value;case"structValue":case"listValue":return this.kind.value.toJson(Object.assign(Object.assign({},e),{emitDefaultValues:!0}))}throw new Error("google.protobuf.Value must have a value")}fromJson(e,n){switch(typeof e){case"number":this.kind={case:"numberValue",value:e};break;case"string":this.kind={case:"stringValue",value:e};break;case"boolean":this.kind={case:"boolValue",value:e};break;case"object":e===null?this.kind={case:"nullValue",value:Rn.NULL_VALUE}:Array.isArray(e)?this.kind={case:"listValue",value:ce.fromJson(e)}:this.kind={case:"structValue",value:l.fromJson(e)};break;default:throw new Error("cannot decode google.protobuf.Value from JSON "+s.json.debug(e))}return this}static fromBinary(e,n){return new X().fromBinary(e,n)}static fromJson(e,n){return new X().fromJson(e,n)}static fromJsonString(e,n){return new X().fromJsonString(e,n)}static equals(e,n){return s.util.equals(X,e,n)}}X.runtime=s,X.typeName="google.protobuf.Value",X.fields=s.util.newFieldList(()=>[{no:1,name:"null_value",kind:"enum",T:s.getEnumType(Rn),oneof:"kind"},{no:2,name:"number_value",kind:"scalar",T:1,oneof:"kind"},{no:3,name:"string_value",kind:"scalar",T:9,oneof:"kind"},{no:4,name:"bool_value",kind:"scalar",T:8,oneof:"kind"},{no:5,name:"struct_value",kind:"message",T:l,oneof:"kind"},{no:6,name:"list_value",kind:"message",T:ce,oneof:"kind"}]);class ce extends w{constructor(e){super(),this.values=[],s.util.initPartial(e,this)}toJson(e){return this.values.map(n=>n.toJson())}fromJson(e,n){if(!Array.isArray(e))throw new Error("cannot decode google.protobuf.ListValue from JSON "+s.json.debug(e));for(let t of e)this.values.push(X.fromJson(t));return this}static fromBinary(e,n){return new ce().fromBinary(e,n)}static fromJson(e,n){return new ce().fromJson(e,n)}static fromJsonString(e,n){return new ce().fromJsonString(e,n)}static equals(e,n){return s.util.equals(ce,e,n)}}ce.runtime=s,ce.typeName="google.protobuf.ListValue",ce.fields=s.util.newFieldList(()=>[{no:1,name:"values",kind:"message",T:X,repeated:!0}]),T.Code=void 0,function(a){a[a.Canceled=1]="Canceled",a[a.Unknown=2]="Unknown",a[a.InvalidArgument=3]="InvalidArgument",a[a.DeadlineExceeded=4]="DeadlineExceeded",a[a.NotFound=5]="NotFound",a[a.AlreadyExists=6]="AlreadyExists",a[a.PermissionDenied=7]="PermissionDenied",a[a.ResourceExhausted=8]="ResourceExhausted",a[a.FailedPrecondition=9]="FailedPrecondition",a[a.Aborted=10]="Aborted",a[a.OutOfRange=11]="OutOfRange",a[a.Unimplemented=12]="Unimplemented",a[a.Internal=13]="Internal",a[a.Unavailable=14]="Unavailable",a[a.DataLoss=15]="DataLoss",a[a.Unauthenticated=16]="Unauthenticated"}(T.Code||(T.Code={}));function Ui(a){const e=T.Code[a];return typeof e!="string"?a.toString():e[0].toLowerCase()+e.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}class C extends Error{constructor(e,n=T.Code.Unknown,t,o,i){super(Ih(e,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=e,this.code=n,this.metadata=new Headers(t??{}),this.details=o??[],this.cause=i}static from(e,n=T.Code.Unknown){return e instanceof C?e:e instanceof Error?e.name=="AbortError"?new C(e.message,T.Code.Canceled):new C(e.message,n,void 0,void 0,e):new C(String(e),n,void 0,void 0,e)}static[Symbol.hasInstance](e){return e instanceof Error?Object.getPrototypeOf(e)===C.prototype?!0:e.name==="ConnectError"&&"code"in e&&typeof e.code=="number"&&"metadata"in e&&"details"in e&&Array.isArray(e.details)&&"rawMessage"in e&&typeof e.rawMessage=="string"&&"cause"in e:!1}findDetails(e){const n="typeName"in e?{findMessage:o=>o===e.typeName?e:void 0}:e,t=[];for(const o of this.details){if("getType"in o){n.findMessage(o.getType().typeName)&&t.push(o);continue}const i=n.findMessage(o.type);if(i)try{t.push(i.fromBinary(o.value))}catch{}}return t}}function Ih(a,e){return a.length?`[${Ui(e)}] ${a}`:`[${Ui(e)}]`}function Mh(a,e,n){try{const t=La.dec(a);return e?e.fromBinary(t,n):t}catch(t){throw C.from(t,T.Code.DataLoss)}}function bh(a,e){const n={};for(const[t,o]of Object.entries(a.methods)){const i=e(Object.assign(Object.assign({},o),{localName:t,service:a}));i!=null&&(n[t]=i)}return n}const Li=1;function Gi(a){let e,n=new Uint8Array(0);function t(o){const i=new Uint8Array(n.length+o.length);i.set(n),i.set(o,n.length),n=i}return new ReadableStream({start(){e=a.getReader()},async pull(o){let i;for(;;){if(i===void 0&&n.byteLength>=5){let d=0;for(let p=1;p<5;p++)d=(d<<8)+n[p];i={flags:n[0],length:d}}if(i!==void 0&&n.byteLength>=i.length+5)break;const c=await e.read();if(c.done)break;t(c.value)}if(i===void 0){if(n.byteLength==0){o.close();return}o.error(new C("premature end of stream",T.Code.DataLoss));return}const r=n.subarray(5,5+i.length);n=n.subarray(5+i.length),o.enqueue({flags:i.flags,data:r})}})}function Bi(a,e){const n=new Uint8Array(e.length+5);n.set(e,5);const t=new DataView(n.buffer,n.byteOffset,n.byteLength);return t.setUint8(0,a),t.setUint32(1,e.length),n}var Eh=function(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=a[Symbol.asyncIterator],n;return e?e.call(a):(a=typeof __values=="function"?__values(a):a[Symbol.iterator](),n={},t("next"),t("throw"),t("return"),n[Symbol.asyncIterator]=function(){return this},n);function t(i){n[i]=a[i]&&function(r){return new Promise(function(c,d){r=a[i](r),o(c,d,r.done,r.value)})}}function o(i,r,c,d){Promise.resolve(d).then(function(p){i({value:p,done:c})},r)}},_n=function(a){return this instanceof _n?(this.v=a,this):new _n(a)},wh=function(a,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n.apply(a,e||[]),o,i=[];return o={},c("next"),c("throw"),c("return",r),o[Symbol.asyncIterator]=function(){return this},o;function r(_){return function(M){return Promise.resolve(M).then(_,R)}}function c(_,M){t[_]&&(o[_]=function(O){return new Promise(function(P,Y){i.push([_,O,P,Y])>1||d(_,O)})},M&&(o[_]=M(o[_])))}function d(_,M){try{p(t[_](M))}catch(O){I(i[0][3],O)}}function p(_){_.value instanceof _n?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){d("next",_)}function R(_){d("throw",_)}function I(_,M){_(M),i.shift(),i.length&&d(i[0][0],i[0][1])}},Oh=function(a){var e,n;return e={},t("next"),t("throw",function(o){throw o}),t("return"),e[Symbol.iterator]=function(){return this},e;function t(o,i){e[o]=a[o]?function(r){return(n=!n)?{value:_n(a[o](r)),done:!1}:i?i(r):r}:i}};function Ch(){const a=[],e=[];let n,t,o,i=new Promise((d,p)=>{t=d,o=p}),r=!1;function c(){for(const d of a.splice(0,a.length))d({done:!0,value:void 0})}return{close(){r=!0,c()},async write(d){if(r)throw n??new Error("cannot write, WritableIterable already closed");const p=a.shift();if(p===void 0)e.push(d);else if(p({done:!1,value:d}),a.length>0)return;const k=e.length+1;for(let R=0;R<k;R++)await i},[Symbol.asyncIterator](){return{next(){t(),i=new Promise((R,I)=>{t=R,o=I});const d=e.shift();if(d!==void 0)return Promise.resolve({done:!1,value:d});if(r)return Promise.resolve({done:!0,value:void 0});let p;const k=new Promise(R=>p=R);return a.push(p),k},throw(d){return n=d,r=!0,e.splice(0,e.length),i.catch(()=>{}),o(n),c(),Promise.resolve({done:!0,value:void 0})},return(){return r=!0,e.splice(0,e.length),t(),i=Promise.reject(new Error("cannot write, consumer called return")),i.catch(()=>{}),c(),Promise.resolve({done:!0,value:void 0})}}}}}function Fa(a){return wh(this,arguments,function*(){yield _n(yield*Oh(Eh(a)))})}var Fi=function(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=a[Symbol.asyncIterator],n;return e?e.call(a):(a=typeof __values=="function"?__values(a):a[Symbol.iterator](),n={},t("next"),t("throw"),t("return"),n[Symbol.asyncIterator]=function(){return this},n);function t(i){n[i]=a[i]&&function(r){return new Promise(function(c,d){r=a[i](r),o(c,d,r.done,r.value)})}}function o(i,r,c,d){Promise.resolve(d).then(function(p){i({value:p,done:c})},r)}},sn=function(a){return this instanceof sn?(this.v=a,this):new sn(a)},Nh=function(a){var e,n;return e={},t("next"),t("throw",function(o){throw o}),t("return"),e[Symbol.iterator]=function(){return this},e;function t(o,i){e[o]=a[o]?function(r){return(n=!n)?{value:sn(a[o](r)),done:!1}:i?i(r):r}:i}},Ph=function(a,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n.apply(a,e||[]),o,i=[];return o={},c("next"),c("throw"),c("return",r),o[Symbol.asyncIterator]=function(){return this},o;function r(_){return function(M){return Promise.resolve(M).then(_,R)}}function c(_,M){t[_]&&(o[_]=function(O){return new Promise(function(P,Y){i.push([_,O,P,Y])>1||d(_,O)})},M&&(o[_]=M(o[_])))}function d(_,M){try{p(t[_](M))}catch(O){I(i[0][3],O)}}function p(_){_.value instanceof sn?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){d("next",_)}function R(_){d("throw",_)}function I(_,M){_(M),i.shift(),i.length&&d(i[0][0],i[0][1])}};function aa(a,e){return bh(a,n=>{switch(n.kind){case m.Unary:return Dh(e,a,n);case m.ServerStreaming:return Ah(e,a,n);case m.ClientStreaming:return qh(e,a,n);case m.BiDiStreaming:return Uh(e,a,n);default:return null}})}function N(a,e){return aa(a,e)}function Dh(a,e,n){return async function(t,o){var i,r;const c=await a.unary(e,n,o?.signal,o?.timeoutMs,o?.headers,t,o?.contextValues);return(i=o?.onHeader)===null||i===void 0||i.call(o,c.header),(r=o?.onTrailer)===null||r===void 0||r.call(o,c.trailer),c.message}}function Ah(a,e,n){return function(t,o){return xi(a.stream(e,n,o?.signal,o?.timeoutMs,o?.headers,Fa([t]),o?.contextValues),o)}}function qh(a,e,n){return async function(t,o){var i,r,c,d,p,k;const R=await a.stream(e,n,o?.signal,o?.timeoutMs,o?.headers,t,o?.contextValues);(p=o?.onHeader)===null||p===void 0||p.call(o,R.header);let I,_=0;try{for(var M=!0,O=Fi(R.message),P;P=await O.next(),i=P.done,!i;M=!0)d=P.value,M=!1,I=d,_++}catch(Y){r={error:Y}}finally{try{!M&&!i&&(c=O.return)&&await c.call(O)}finally{if(r)throw r.error}}if(!I)throw new C("protocol error: missing response message",T.Code.Unimplemented);if(_>1)throw new C("protocol error: received extra messages for client streaming method",T.Code.Unimplemented);return(k=o?.onTrailer)===null||k===void 0||k.call(o,R.trailer),I}}function Uh(a,e,n){return function(t,o){return xi(a.stream(e,n,o?.signal,o?.timeoutMs,o?.headers,t,o?.contextValues),o)}}function xi(a,e){const n=function(){return Ph(this,arguments,function*(){var t,o;const i=yield sn(a);(t=e?.onHeader)===null||t===void 0||t.call(e,i.header),yield sn(yield*Nh(Fi(i.message))),(o=e?.onTrailer)===null||o===void 0||o.call(e,i.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function Lh(...a){const e=new AbortController,n=a.filter(o=>o!==void 0).concat(e.signal);for(const o of n){if(o.aborted){t.apply(o);break}o.addEventListener("abort",t)}function t(){e.signal.aborted||e.abort(Ji(this));for(const o of n)o.removeEventListener("abort",t)}return e}function Gh(a){const e=new AbortController,n=()=>{e.abort(new C("the operation timed out",T.Code.DeadlineExceeded))};let t;return a!==void 0&&(a<=0?n():t=setTimeout(n,a)),{signal:e.signal,cleanup:()=>clearTimeout(t)}}function Ji(a){if(!a.aborted)return;if(a.reason!==void 0)return a.reason;const e=new Error("This operation was aborted");return e.name="AbortError",e}function ta(){return{get(a){return a.id in this?this[a.id]:a.defaultValue},set(a,e){return this[a.id]=e,this},delete(a){return delete this[a.id],this}}}const xa=128;function zi(a){const e=new Headers,n=new TextDecoder().decode(a).split(`\r
3
+ `);for(const t of n){if(t==="")continue;const o=t.indexOf(":");if(o>0){const i=t.substring(0,o).trim(),r=t.substring(o+1).trim();e.append(i,r)}}return e}const Bh="Content-Type",Fh="Grpc-Timeout",on="Grpc-Status",Yi="Grpc-Message",xh="Grpc-Status-Details-Bin",Jh="X-User-Agent",zh="X-Grpc-Web",Yh="application/grpc-web+proto",$h="application/grpc-web+json";let sa=class qn extends w{constructor(e){super(),this.code=0,this.message="",this.details=[],s.util.initPartial(e,this)}static fromBinary(e,n){return new qn().fromBinary(e,n)}static fromJson(e,n){return new qn().fromJson(e,n)}static fromJsonString(e,n){return new qn().fromJsonString(e,n)}static equals(e,n){return s.util.equals(qn,e,n)}};sa.runtime=s,sa.typeName="google.rpc.Status",sa.fields=s.util.newFieldList(()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",T:j,repeated:!0}]);const Vh="0";function $i(a){var e;const n=a.get(xh);if(n!=null){const o=Mh(n,sa);if(o.code==0)return;const i=new C(o.message,o.code,a);return i.details=o.details.map(r=>({type:r.typeUrl.substring(r.typeUrl.lastIndexOf("/")+1),value:r.value})),i}const t=a.get(on);if(t!=null){if(t===Vh)return;const o=parseInt(t,10);return o in T.Code?new C(decodeURIComponent((e=a.get(Yi))!==null&&e!==void 0?e:""),o,a):new C(`invalid grpc-status: ${t}`,T.Code.Internal,a)}}function Vi(a,e,n){const t=typeof e=="string"?e:e.typeName,o=typeof n=="string"?n:n.name;return a.toString().replace(/\/?$/,`/${t}/${o}`)}function Wi(a,e){return e instanceof a?e:new a(e)}function Wh(a,e){function n(t){return t.done===!0?t:{done:t.done,value:Wi(a,t.value)}}return{[Symbol.asyncIterator](){const t=e[Symbol.asyncIterator](),o={next:()=>t.next().then(n)};return t.throw!==void 0&&(o.throw=i=>t.throw(i).then(n)),t.return!==void 0&&(o.return=i=>t.return(i).then(n)),o}}}function ji(a,e){var n;return(n=e?.concat().reverse().reduce((t,o)=>o(t),a))!==null&&n!==void 0?n:a}function jh(a){var e;const n=Object.assign({},a);return(e=n.ignoreUnknownFields)!==null&&e!==void 0||(n.ignoreUnknownFields=!0),n}function Ja(a,e,n,t){const o=e?Hi(a.I,t):Ki(a.I,n);return{parse:(e?Hi(a.O,t):Ki(a.O,n)).parse,serialize:o.serialize}}function Hi(a,e){return{parse(n){try{return a.fromBinary(n,e)}catch(t){const o=t instanceof Error?t.message:String(t);throw new C(`parse binary: ${o}`,T.Code.Internal)}},serialize(n){try{return n.toBinary(e)}catch(t){const o=t instanceof Error?t.message:String(t);throw new C(`serialize binary: ${o}`,T.Code.Internal)}}}}function Ki(a,e){var n,t;const o=(n=e?.textEncoder)!==null&&n!==void 0?n:new TextEncoder,i=(t=e?.textDecoder)!==null&&t!==void 0?t:new TextDecoder,r=jh(e);return{parse(c){try{const d=i.decode(c);return a.fromJsonString(d,r)}catch(d){throw C.from(d,T.Code.InvalidArgument)}},serialize(c){try{const d=c.toJsonString(r);return o.encode(d)}catch(d){throw C.from(d,T.Code.Internal)}}}}function Xi(a){const e=ji(a.next,a.interceptors),[n,t,o]=Zi(a),i=Object.assign(Object.assign({},a.req),{message:Wi(a.req.method.I,a.req.message),signal:n});return e(i).then(r=>(o(),r),t)}function Qi(a){const e=ji(a.next,a.interceptors),[n,t,o]=Zi(a),i=Object.assign(Object.assign({},a.req),{message:Wh(a.req.method.I,a.req.message),signal:n});let r=!1;return n.addEventListener("abort",function(){var c,d;const p=a.req.message[Symbol.asyncIterator]();r||(c=p.throw)===null||c===void 0||c.call(p,this.reason).catch(()=>{}),(d=p.return)===null||d===void 0||d.call(p).catch(()=>{})}),e(i).then(c=>Object.assign(Object.assign({},c),{message:{[Symbol.asyncIterator](){const d=c.message[Symbol.asyncIterator]();return{next(){return d.next().then(p=>(p.done==!0&&(r=!0,o()),p),t)}}}}}),t)}function Zi(a){const{signal:e,cleanup:n}=Gh(a.timeoutMs),t=Lh(a.signal,e);return[t.signal,function(i){const r=C.from(e.aborted?Ji(e):i);return t.abort(r),n(),Promise.reject(r)},function(){n(),t.abort()}]}var H=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},er={},za={},oa=H&&H.__assign||function(){return oa=Object.assign||function(a){for(var e,n=1,t=arguments.length;n<t;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(a[o]=e[o])}return a},oa.apply(this,arguments)};Object.defineProperty(za,"__esModule",{value:!0});var Hh={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Kh(a){var e=oa(oa({},Hh),a);return e.numOfAttempts<1&&(e.numOfAttempts=1),e}za.getSanitizedOptions=Kh;var Ya={},$a={},ia={},Va={},Wa={};Object.defineProperty(Wa,"__esModule",{value:!0});function Xh(a){var e=Math.random()*a;return Math.round(e)}Wa.fullJitter=Xh;var ja={};Object.defineProperty(ja,"__esModule",{value:!0});function Qh(a){return a}ja.noJitter=Qh,Object.defineProperty(Va,"__esModule",{value:!0});var Zh=Wa,ef=ja;function nf(a){switch(a.jitter){case"full":return Zh.fullJitter;case"none":default:return ef.noJitter}}Va.JitterFactory=nf,Object.defineProperty(ia,"__esModule",{value:!0});var af=Va,tf=function(){function a(e){this.options=e,this.attempt=0}return a.prototype.apply=function(){var e=this;return new Promise(function(n){return setTimeout(n,e.jitteredDelay)})},a.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(a.prototype,"jitteredDelay",{get:function(){var e=af.JitterFactory(this.options);return e(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"delay",{get:function(){var e=this.options.startingDelay,n=this.options.timeMultiple,t=this.numOfDelayedAttempts,o=e*Math.pow(n,t);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),a}();ia.Delay=tf;var sf=H&&H.__extends||function(){var a=function(e,n){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var i in o)o.hasOwnProperty(i)&&(t[i]=o[i])},a(e,n)};return function(e,n){a(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}(),of=H&&H.__awaiter||function(a,e,n,t){function o(i){return i instanceof n?i:new n(function(r){r(i)})}return new(n||(n=Promise))(function(i,r){function c(k){try{p(t.next(k))}catch(R){r(R)}}function d(k){try{p(t.throw(k))}catch(R){r(R)}}function p(k){k.done?i(k.value):o(k.value).then(c,d)}p((t=t.apply(a,e||[])).next())})},rf=H&&H.__generator||function(a,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(p){return function(k){return d([p,k])}}function d(p){if(t)throw new TypeError("Generator is already executing.");for(;n;)try{if(t=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){n.label=p[1];break}if(p[0]===6&&n.label<i[1]){n.label=i[1],i=p;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(p);break}i[2]&&n.ops.pop(),n.trys.pop();continue}p=e.call(a,n)}catch(k){p=[6,k],o=0}finally{t=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty($a,"__esModule",{value:!0});var mf=ia,cf=function(a){sf(e,a);function e(){return a!==null&&a.apply(this,arguments)||this}return e.prototype.apply=function(){return of(this,void 0,void 0,function(){return rf(this,function(n){return[2,this.isFirstAttempt?!0:a.prototype.apply.call(this)]})})},Object.defineProperty(e.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),e}(mf.Delay);$a.SkipFirstDelay=cf;var Ha={},lf=H&&H.__extends||function(){var a=function(e,n){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var i in o)o.hasOwnProperty(i)&&(t[i]=o[i])},a(e,n)};return function(e,n){a(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}}();Object.defineProperty(Ha,"__esModule",{value:!0});var df=ia,pf=function(a){lf(e,a);function e(){return a!==null&&a.apply(this,arguments)||this}return e}(df.Delay);Ha.AlwaysDelay=pf,Object.defineProperty(Ya,"__esModule",{value:!0});var uf=$a,gf=Ha;function Tf(a,e){var n=kf(a);return n.setAttemptNumber(e),n}Ya.DelayFactory=Tf;function kf(a){return a.delayFirstAttempt?new gf.AlwaysDelay(a):new uf.SkipFirstDelay(a)}var Ka=H&&H.__awaiter||function(a,e,n,t){function o(i){return i instanceof n?i:new n(function(r){r(i)})}return new(n||(n=Promise))(function(i,r){function c(k){try{p(t.next(k))}catch(R){r(R)}}function d(k){try{p(t.throw(k))}catch(R){r(R)}}function p(k){k.done?i(k.value):o(k.value).then(c,d)}p((t=t.apply(a,e||[])).next())})},Xa=H&&H.__generator||function(a,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(p){return function(k){return d([p,k])}}function d(p){if(t)throw new TypeError("Generator is already executing.");for(;n;)try{if(t=1,o&&(i=p[0]&2?o.return:p[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,p[1])).done)return i;switch(o=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){n.label=p[1];break}if(p[0]===6&&n.label<i[1]){n.label=i[1],i=p;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(p);break}i[2]&&n.ops.pop(),n.trys.pop();continue}p=e.call(a,n)}catch(k){p=[6,k],o=0}finally{t=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(er,"__esModule",{value:!0});var yf=za,vf=Ya;function hf(a,e){return e===void 0&&(e={}),Ka(this,void 0,void 0,function(){var n,t;return Xa(this,function(o){switch(o.label){case 0:return n=yf.getSanitizedOptions(e),t=new ff(a,n),[4,t.execute()];case 1:return[2,o.sent()]}})})}var Qa=er.backOff=hf,ff=function(){function a(e,n){this.request=e,this.options=n,this.attemptNumber=0}return a.prototype.execute=function(){return Ka(this,void 0,void 0,function(){var e,n;return Xa(this,function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(n=t.sent(),!n||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(a.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),a.prototype.applyDelay=function(){return Ka(this,void 0,void 0,function(){var e;return Xa(this,function(n){switch(n.label){case 0:return e=vf.DelayFactory(this.options,this.attemptNumber),[4,e.apply()];case 1:return n.sent(),[2]}})})},a}();const nr=s.makeMessageType("proto.rpc.v1.Credentials",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9}]),Za=s.makeMessageType("proto.rpc.v1.AuthenticateRequest",()=>[{no:1,name:"entity",kind:"scalar",T:9},{no:2,name:"credentials",kind:"message",T:nr}]),Rf=s.makeMessageType("proto.rpc.v1.AuthenticateResponse",()=>[{no:1,name:"access_token",kind:"scalar",T:9}]),_f=s.makeMessageType("proto.rpc.v1.AuthenticateToRequest",()=>[{no:1,name:"entity",kind:"scalar",T:9}]),Sf=s.makeMessageType("proto.rpc.v1.AuthenticateToResponse",()=>[{no:1,name:"access_token",kind:"scalar",T:9}]),If={typeName:"proto.rpc.v1.AuthService",methods:{authenticate:{name:"Authenticate",I:Za,O:Rf,kind:m.Unary}}},Mf={typeName:"proto.rpc.v1.ExternalAuthService",methods:{authenticateTo:{name:"AuthenticateTo",I:_f,O:Sf,kind:m.Unary}}},rn=s.makeMessageType("google.rpc.Status",()=>[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",T:j,repeated:!0}]),Sn=s.makeMessageType("proto.rpc.webrtc.v1.ICECandidate",()=>[{no:1,name:"candidate",kind:"scalar",T:9},{no:2,name:"sdp_mid",kind:"scalar",T:9,opt:!0},{no:3,name:"sdpm_line_index",kind:"scalar",T:13,opt:!0},{no:4,name:"username_fragment",kind:"scalar",T:9,opt:!0}]),ar=s.makeMessageType("proto.rpc.webrtc.v1.CallRequest",()=>[{no:1,name:"sdp",kind:"scalar",T:9},{no:2,name:"disable_trickle",kind:"scalar",T:8}]),bf=s.makeMessageType("proto.rpc.webrtc.v1.CallResponseInitStage",()=>[{no:1,name:"sdp",kind:"scalar",T:9}]),Ef=s.makeMessageType("proto.rpc.webrtc.v1.CallResponseUpdateStage",()=>[{no:1,name:"candidate",kind:"message",T:Sn}]),wf=s.makeMessageType("proto.rpc.webrtc.v1.CallResponse",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"init",kind:"message",T:bf,oneof:"stage"},{no:3,name:"update",kind:"message",T:Ef,oneof:"stage"}]),ra=s.makeMessageType("proto.rpc.webrtc.v1.CallUpdateRequest",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"candidate",kind:"message",T:Sn,oneof:"update"},{no:3,name:"done",kind:"scalar",T:8,oneof:"update"},{no:4,name:"error",kind:"message",T:rn,oneof:"update"}]),Of=s.makeMessageType("proto.rpc.webrtc.v1.CallUpdateResponse",[]),Cf=s.makeMessageType("proto.rpc.webrtc.v1.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),ma=s.makeMessageType("proto.rpc.webrtc.v1.WebRTCConfig",()=>[{no:1,name:"additional_ice_servers",kind:"message",T:Cf,repeated:!0},{no:2,name:"disable_trickle",kind:"scalar",T:8}]),Nf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestInitStage",()=>[{no:1,name:"sdp",kind:"scalar",T:9},{no:2,name:"optional_config",kind:"message",T:ma},{no:3,name:"deadline",kind:"message",T:S,opt:!0}]),Pf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestUpdateStage",()=>[{no:1,name:"candidate",kind:"message",T:Sn}]),Df=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestDoneStage",[]),Af=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestErrorStage",()=>[{no:1,name:"status",kind:"message",T:rn}]),qf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestHeartbeatStage",[]),Uf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequest",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"init",kind:"message",T:Nf,oneof:"stage"},{no:3,name:"update",kind:"message",T:Pf,oneof:"stage"},{no:4,name:"done",kind:"message",T:Df,oneof:"stage"},{no:5,name:"error",kind:"message",T:Af,oneof:"stage"},{no:6,name:"heartbeat",kind:"message",T:qf,oneof:"stage"}]),Lf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseInitStage",()=>[{no:1,name:"sdp",kind:"scalar",T:9}]),Gf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseUpdateStage",()=>[{no:1,name:"candidate",kind:"message",T:Sn}]),Bf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseDoneStage",[]),Ff=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseErrorStage",()=>[{no:1,name:"status",kind:"message",T:rn}]),xf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponse",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"init",kind:"message",T:Lf,oneof:"stage"},{no:3,name:"update",kind:"message",T:Gf,oneof:"stage"},{no:4,name:"done",kind:"message",T:Bf,oneof:"stage"},{no:5,name:"error",kind:"message",T:Ff,oneof:"stage"}]),Jf=s.makeMessageType("proto.rpc.webrtc.v1.OptionalWebRTCConfigRequest",[]),zf=s.makeMessageType("proto.rpc.webrtc.v1.OptionalWebRTCConfigResponse",()=>[{no:1,name:"config",kind:"message",T:ma}]),tr={typeName:"proto.rpc.webrtc.v1.SignalingService",methods:{call:{name:"Call",I:ar,O:wf,kind:m.ServerStreaming},callUpdate:{name:"CallUpdate",I:ra,O:Of,kind:m.Unary},answer:{name:"Answer",I:xf,O:Uf,kind:m.BiDiStreaming},optionalWebRTCConfig:{name:"OptionalWebRTCConfig",I:Jf,O:zf,kind:m.Unary}}},sr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",et=(a="")=>{const e=a;let n="";for(let t=0,o,i=0,r=sr;e.charAt(Math.trunc(i))||(r="=",i%1);n+=r.charAt(63&t>>8-i%1*8)){if(o=e.charCodeAt(i+=3/4),o>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");t=t<<8|o}return n},or=(a="")=>{const e=a.replace(/=+$/,"");let n="";if(e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let t=0,o=0,i,r=0;i=e.charAt(r++);~i&&(o=t%4?o*64+i:i,t++%4)?n+=String.fromCharCode(255&o>>(-2*t&6)):0)i=sr.indexOf(i);return n},nt=(a,e)=>{const n={sdp:a?.sdp,type:a?.type};if(e)for(const[t,o]of Object.entries(e))n.sdp=[n.sdp,`a=${t}:${o}\r
4
+ `].join("");return n},Yf=async(a,e,n)=>{const t=e??{iceServers:[{urls:"stun:global.stun.twilio.com:3478"}]},o=new RTCPeerConnection(t);let i;const r=new Promise(R=>{i=R}),c=o.createDataChannel("data",{id:0,negotiated:!0,ordered:!0});c.binaryType="arraybuffer";const d=o.createDataChannel("negotiation",{id:1,negotiated:!0,ordered:!0});d.binaryType="arraybuffer";let p=!1;if(d.addEventListener("open",()=>{p=!0}),d.addEventListener("message",R=>{(async()=>{const I=new RTCSessionDescription(JSON.parse(or(R.data)));if(await o.setRemoteDescription(I),I.type==="offer"){await o.setLocalDescription();const _=nt(o.localDescription,n);d.send(et(JSON.stringify(_)))}})().catch(console.error)}),o.addEventListener("negotiationneeded",()=>{(async()=>{if(!p)return;await o.setLocalDescription();const R=nt(o.localDescription,n);d.send(et(JSON.stringify(R)))})().catch(console.error)}),!a)return{pc:o,dc:c};const k=await o.createOffer({});return await o.setLocalDescription(k),o.addEventListener("icecandidate",R=>{R.candidate===null&&i({pc:o,dc:c})}),r};function $f(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}function ir(a,e){const n=$i(a);if(n)throw e.forEach((t,o)=>{n.metadata.append(o,t)}),n;if(!e.has(on)&&!a.has(on))throw new C("protocol error: missing status",T.Code.Internal)}function rr(a,e,n,t){const o=new Headers(n??{});return o.set(Bh,a?Yh:$h),o.set(zh,"1"),o.set(Jh,"connect-es/1.6.1"),e!==void 0&&o.set(Fh,`${e}m`),o}function Vf(a){switch(a){case 400:return T.Code.Internal;case 401:return T.Code.Unauthenticated;case 403:return T.Code.PermissionDenied;case 404:return T.Code.Unimplemented;case 429:return T.Code.Unavailable;case 502:return T.Code.Unavailable;case 503:return T.Code.Unavailable;case 504:return T.Code.Unavailable;default:return T.Code.Unknown}}function mr(a,e){var n;if(a>=200&&a<300)return{foundStatus:e.has(on),headerError:$i(e)};throw new C(decodeURIComponent((n=e.get(Yi))!==null&&n!==void 0?n:`HTTP ${a}`),Vf(a),e)}var je=function(a){return this instanceof je?(this.v=a,this):new je(a)},Wf=function(a,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n.apply(a,e||[]),o,i=[];return o={},c("next"),c("throw"),c("return",r),o[Symbol.asyncIterator]=function(){return this},o;function r(_){return function(M){return Promise.resolve(M).then(_,R)}}function c(_,M){t[_]&&(o[_]=function(O){return new Promise(function(P,Y){i.push([_,O,P,Y])>1||d(_,O)})},M&&(o[_]=M(o[_])))}function d(_,M){try{p(t[_](M))}catch(O){I(i[0][3],O)}}function p(_){_.value instanceof je?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){d("next",_)}function R(_){d("throw",_)}function I(_,M){_(M),i.shift(),i.length&&d(i[0][0],i[0][1])}};function jf(a){var e;$f();const n=(e=a.useBinaryFormat)!==null&&e!==void 0?e:!0;return{async unary(t,o,i,r,c,d,p){var k;const{serialize:R,parse:I}=Ja(o,n,a.jsonOptions,a.binaryOptions);return r=r===void 0?a.defaultTimeoutMs:r<=0?void 0:r,await Xi({interceptors:a.interceptors,signal:i,timeoutMs:r,req:{stream:!1,service:t,method:o,url:Vi(a.baseUrl,t,o),init:{method:"POST",credentials:(k=a.credentials)!==null&&k!==void 0?k:"same-origin",redirect:"error",mode:"cors"},header:rr(n,r,c),contextValues:p??ta(),message:d},next:async _=>{var M;const P=await((M=a.fetch)!==null&&M!==void 0?M:globalThis.fetch)(_.url,Object.assign(Object.assign({},_.init),{headers:_.header,signal:_.signal,body:Bi(0,R(_.message))})),{headerError:Y}=mr(P.status,P.headers);if(!P.body)throw Y!==void 0?Y:"missing response body";const y=Gi(P.body).getReader();let h,g;for(;;){const v=await y.read();if(v.done)break;const{flags:E,data:b}=v.value;if((E&Li)===Li)throw new C("protocol error: received unsupported compressed output",T.Code.Internal);if(E===xa){if(h!==void 0)throw"extra trailer";h=zi(b);continue}if(g!==void 0)throw new C("extra message",T.Code.Unimplemented);g=I(b)}if(h===void 0)throw Y!==void 0?Y:new C("missing trailer",P.headers.has(on)?T.Code.Unimplemented:T.Code.Unknown);if(ir(h,P.headers),g===void 0)throw new C("missing message",h.has(on)?T.Code.Unimplemented:T.Code.Unknown);return{stream:!1,service:t,method:o,header:P.headers,message:g,trailer:h}}})},async stream(t,o,i,r,c,d,p){var k;const{serialize:R,parse:I}=Ja(o,n,a.jsonOptions,a.binaryOptions);function _(O,P,Y,y,h){return Wf(this,arguments,function*(){const v=Gi(O).getReader();if(P){if(!(yield je(v.read())).done)throw"extra data for trailers-only";return yield je(void 0)}let E=!1;for(;;){const b=yield je(v.read());if(b.done)break;const{flags:ae,data:U}=b.value;if((ae&xa)===xa){if(E)throw"extra trailer";E=!0;const $=zi(U);ir($,y),$.forEach((Zo,ei)=>Y.set(ei,Zo));continue}if(E)throw"extra message";yield yield je(I(U))}if("throwIfAborted"in h&&h.throwIfAborted(),!E)throw"missing trailer"})}async function M(O){if(o.kind!=m.ServerStreaming)throw"The fetch API does not support streaming request bodies";const P=await O[Symbol.asyncIterator]().next();if(P.done==!0)throw"missing request message";return Bi(0,R(P.value))}return r=r===void 0?a.defaultTimeoutMs:r<=0?void 0:r,Qi({interceptors:a.interceptors,signal:i,timeoutMs:r,req:{stream:!0,service:t,method:o,url:Vi(a.baseUrl,t,o),init:{method:"POST",credentials:(k=a.credentials)!==null&&k!==void 0?k:"same-origin",redirect:"error",mode:"cors"},header:rr(n,r,c),contextValues:p??ta(),message:d},next:async O=>{var P;const y=await((P=a.fetch)!==null&&P!==void 0?P:globalThis.fetch)(O.url,Object.assign(Object.assign({},O.init),{headers:O.header,signal:O.signal,body:await M(O.message)})),{foundStatus:h,headerError:g}=mr(y.status,y.headers);if(g!=null)throw g;if(!y.body)throw"missing response body";const v=new Headers;return Object.assign(Object.assign({},O),{header:y.headers,trailer:v,message:_(y.body,h,v,y.headers,O.signal)})}})}}}const ca=s.makeMessageType("proto.rpc.webrtc.v1.PacketMessage",()=>[{no:1,name:"data",kind:"scalar",T:12},{no:2,name:"eom",kind:"scalar",T:8}]),at=s.makeMessageType("proto.rpc.webrtc.v1.Stream",()=>[{no:1,name:"id",kind:"scalar",T:4}]),tt=s.makeMessageType("proto.rpc.webrtc.v1.Request",()=>[{no:1,name:"stream",kind:"message",T:at},{no:2,name:"headers",kind:"message",T:cr,oneof:"type"},{no:3,name:"message",kind:"message",T:st,oneof:"type"},{no:4,name:"rst_stream",kind:"scalar",T:8,oneof:"type"}]),cr=s.makeMessageType("proto.rpc.webrtc.v1.RequestHeaders",()=>[{no:1,name:"method",kind:"scalar",T:9},{no:2,name:"metadata",kind:"message",T:la},{no:3,name:"timeout",kind:"message",T:F}]),st=s.makeMessageType("proto.rpc.webrtc.v1.RequestMessage",()=>[{no:1,name:"has_message",kind:"scalar",T:8},{no:2,name:"packet_message",kind:"message",T:ca},{no:3,name:"eos",kind:"scalar",T:8}]),Hf=s.makeMessageType("proto.rpc.webrtc.v1.Response",()=>[{no:1,name:"stream",kind:"message",T:at},{no:2,name:"headers",kind:"message",T:Kf,oneof:"type"},{no:3,name:"message",kind:"message",T:Xf,oneof:"type"},{no:4,name:"trailers",kind:"message",T:Qf,oneof:"type"}]),Kf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseHeaders",()=>[{no:1,name:"metadata",kind:"message",T:la}]),Xf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseMessage",()=>[{no:1,name:"packet_message",kind:"message",T:ca}]),Qf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseTrailers",()=>[{no:1,name:"status",kind:"message",T:rn},{no:2,name:"metadata",kind:"message",T:la}]),lr=s.makeMessageType("proto.rpc.webrtc.v1.Strings",()=>[{no:1,name:"values",kind:"scalar",T:9,repeated:!0}]),la=s.makeMessageType("proto.rpc.webrtc.v1.Metadata",()=>[{no:1,name:"md",kind:"map",K:9,V:{kind:"message",T:lr}}]);class le extends Error{name="ConnectionClosedError";constructor(e){super(e),Object.setPrototypeOf(this,le.prototype)}static isError(e){return e instanceof le||e instanceof C&&e.rawMessage==="closed"?!0:typeof e=="string"?e==="Response closed without headers":e instanceof Error?e.message==="Response closed without headers":!1}}class Zf{ready;peerConn;dataChannel;pResolve;pReject;closed=!1;closedReason;maxDataChannelSize=65535;constructor(e,n){this.peerConn=e,this.dataChannel=n,this.ready=new Promise((t,o)=>{this.pResolve=t,this.pReject=o}),n.addEventListener("open",()=>this.onChannelOpen()),n.addEventListener("close",()=>this.onChannelClose()),n.addEventListener("error",t=>{this.onChannelError(t)}),e.addEventListener("iceconnectionstatechange",()=>{const t=e.iceConnectionState;(t==="failed"||t==="disconnected"||t==="closed")&&this.pReject?.(new Error(`ICE connection failed with state: ${t}`))})}isClosed(){return this.closed}isClosedReason(){return this.closedReason}closeWithReason(e){this.closed||(this.closed=!0,this.closedReason=e,this.pReject?.(e),this.peerConn.close())}onChannelOpen(){this.pResolve?.(void 0)}onChannelClose(){this.closeWithReason(new le("data channel closed"))}onChannelError(e){console.error("channel error",e),this.closeWithReason(new Error(JSON.stringify(e)))}write(e){this.dataChannel.send(e.toBinary())}}const dr=33554432;class eR{grpcStream;onDone;closed=!1;packetBuf=[];packetBufSize=0;constructor(e,n){this.grpcStream=e,this.onDone=n}closeWithRecvError(){this.closed||(this.closed=!0,this.onDone(this.grpcStream.id))}processPacketMessage(e){const{data:n}=e;if(n.length+this.packetBufSize>dr){this.packetBuf.length=0,this.packetBufSize=0,console.error(`message size larger than max ${dr}; discarding`);return}if(this.packetBuf.push(n),this.packetBufSize+=n.length,e.eom){const t=new Uint8Array(this.packetBufSize);let o=0;for(const i of this.packetBuf)t.set(i,o),o+=i.length;return this.packetBuf.length=0,this.packetBufSize=0,t}}}const nR=16373;class pr extends eR{channel;service;method;parseMessage;requestHeaders;headersReceived=!1;trailersReceived=!1;constructor(e,n,t,o,i,r){super(n,t),this.channel=e,this.service=o,this.method=i;const{parse:c}=Ja(i,!0,void 0,void 0);this.parseMessage=c;const d=`/${o.typeName}/${i.name}`;this.requestHeaders=new cr({method:d});const p=aR(Mn(r));p&&(this.requestHeaders.metadata=p)}startRequest(e){e&&e.addEventListener("abort",()=>{this.resetStream()});try{this.channel.writeHeaders(this.grpcStream,this.requestHeaders)}catch(n){console.error("error writing headers",n),this.closeWithRecvError()}}sendMessage(e){if(e){this.writeMessage(!1,e);return}this.writeMessage(!1,void 0)}resetStream(){if(!this.closed)try{this.channel.writeReset(this.grpcStream)}catch(e){console.error("error writing reset",e),this.closeWithRecvError()}}writeMessage(e,n){try{if(!n||n.length===0){const o=new ca({eom:!0}),i=new st({hasMessage:!!n,packetMessage:o,eos:e});this.channel.writeMessage(this.grpcStream,i);return}let t=n;for(;t.length>0;){const o=Math.min(t.length,nR),i=new ca;i.data=t.slice(0,o),t=t.slice(o),t.length===0&&(i.eom=!0);const r=new st({hasMessage:!!t,packetMessage:i,eos:e});this.channel.writeMessage(this.grpcStream,r)}}catch(t){console.error("error writing message",t),this.closeWithRecvError()}}onResponse(e){switch(e.type.case){case"headers":{if(this.headersReceived){console.error(`invariant: headers already received for ${this.grpcStream.id}`);return}if(this.trailersReceived){console.error(`invariant: headers received after trailers for ${this.grpcStream.id}`);return}this.processHeaders(e.type.value);break}case"message":{if(!this.headersReceived){console.error(`invariant: headers not yet received for ${this.grpcStream.id}`);return}if(this.trailersReceived){console.error(`invariant: headers received after trailers for ${this.grpcStream.id}`);return}this.processMessage(e.type.value);break}case"trailers":{this.processTrailers(e.type.value);break}default:{console.error("unknown response type",e.type.case);break}}}processHeaders(e){this.headersReceived=!0,this.onHeaders(e)}processMessage(e){if(!e.packetMessage)return;const n=super.processPacketMessage(e.packetMessage);n&&this.onMessage(n)}processTrailers(e){this.trailersReceived=!0;const{status:n}=e,t=n?n.code:0;if(this.onTrailers(e),t===0){this.closeWithRecvError();return}this.closeWithRecvError()}}const aR=a=>{if(!a)return;const e=new la({md:Object.fromEntries([...a.entries()].map(([n,t])=>[n,new lr({values:[t]})]))});return Object.keys(e.md).length>0?e:void 0},ot=a=>{const e=Object.entries(a?.md??{}).flatMap(([n,{values:t}])=>t.map(o=>[n,o]));return new Headers(e)};class tR extends pr{awaitingHeadersResult;gotHeaders=!1;respStream=Ch();trailers=new Headers;respStreamQueue;async run(e,n,t,o){const r={req:{stream:!0,url:"",init:{},service:this.service,method:this.method,header:new Headers,contextValues:o??ta(),message:t},next:async c=>{const p=await new Promise((k,R)=>{this.awaitingHeadersResult={success:k,failure:R},this.startRequest(),this.sendMessages(c.message).catch(I=>{console.error("error sending streaming message",I),this.closeWithRecvError()})});return{...c,header:p,trailer:this.trailers,message:this.respStream}}};return e&&(r.signal=e),n!==void 0&&(r.timeoutMs=n),Qi(r)}async sendMessages(e){for await(const n of e)this.sendMessage(n.toBinary());this.writeMessage(!0,void 0)}onHeaders(e){this.gotHeaders=!0,this.awaitingHeadersResult?.success(ot(e.metadata))}onTrailers(e){if(e.metadata?.md){for(const n in e.metadata.md)if(Object.hasOwn(e.metadata.md,n)){const t=e.metadata.md[n];for(const o of t?.values??[])this.trailers.append(n,o)}}if(this.respStream.close(),!e.status||e.status.code===0){if(this.gotHeaders)return;this.awaitingHeadersResult?.success(new Headers);return}this.gotHeaders||this.awaitingHeadersResult?.failure(e.status.message)}onMessage(e){const n=this.parseMessage(e);this.respStreamQueue=this.respStreamQueue?this.respStreamQueue.then(async()=>this.respStream.write(n)):this.respStream.write(n),this.respStreamQueue.catch(t=>{console.error(`error pushing received message into stream; failing: ${t}`),this.resetStream()})}}class sR extends pr{result;headers;message;async run(e,n,t,o){const r={req:{stream:!1,url:"",init:{},service:this.service,method:this.method,header:new Headers,contextValues:o??ta(),message:t},next:async c=>new Promise((d,p)=>{this.result={success:d,failure:p},this.startRequest(),this.sendMessage(c.message.toBinary())})};return e&&(r.signal=e),n!==void 0&&(r.timeoutMs=n),Xi(r)}onHeaders(e){if(this.headers!==void 0){this.result?.failure(new Error("invariant: received headers more than once"));return}this.headers=ot(e.metadata)}onTrailers(e){const n=ot(e.metadata);if(!e.status||e.status.code===0){if(!this.headers){this.result?.failure(new Error("invariant: received trailers for successful unary request without headers"));return}if(this.message===void 0){this.result?.failure(new Error("invariant: received trailers for successful unary request without message"));return}this.result?.success({stream:!1,header:this.headers,message:this.message,trailer:n,service:this.service,method:this.method});return}this.result?.failure(e.status.message)}onMessage(e){if(this.message!==void 0){this.result?.failure(new Error("invariant: received two response messages for unary request"));return}this.message=this.parseMessage(e)}}const oR=256;class iR extends Zf{streamIDCounter=0;streams=new Map;constructor(e,n){super(e,n),n.addEventListener("message",t=>{this.onChannelMessage(t)}),e.addEventListener("iceconnectionstatechange",()=>{const t=e.iceConnectionState;(t==="failed"||t==="disconnected"||t==="closed")&&this.onConnectionTerminated()}),n.addEventListener("close",()=>this.onConnectionTerminated())}onConnectionTerminated(){this.closeWithReason(new le("data channel closed"));for(const e of this.streams.values())e.cs.closeWithRecvError()}onChannelMessage(e){const n=Hf.fromBinary(new Uint8Array(e.data)),{stream:t}=n;if(t===void 0){console.error("no stream id; discarding");return}const{id:o}=t,i=this.streams.get(o.toString());if(i===void 0){console.error("no stream for id; discarding","id",o);return}i.cs.onResponse(n)}nextStreamID(){const e=this.streamIDCounter;return this.streamIDCounter+=1,new at({id:BigInt(e)})}newStream(e,n,t,o,i){if(this.isClosed())throw new le("connection closed");let r=this.streams.get(n.id.toString());if(r!==void 0)throw new Error("invariant: stream should not exist yet");if(Object.keys(this.streams).length>oR)throw new Error("stream limit hit");const c=new e(this,n,d=>this.removeStreamByID(d),t,o,i);return r={cs:c},this.streams.set(n.id.toString(),r),c}removeStreamByID(e){this.streams.delete(e.toString())}writeHeaders(e,n){this.write(new tt({stream:e,type:{case:"headers",value:n}}))}writeMessage(e,n){this.write(new tt({stream:e,type:{case:"message",value:n}}))}writeReset(e){this.write(new tt({stream:e,type:{case:"rstStream",value:!0}}))}async unary(e,n,t,o,i,r,c){return this.newStream(sR,this.nextStreamID(),e,n,i).run(t,o,r,c)}async stream(e,n,t,o,i,r,c){return this.newStream(tR,this.nextStreamID(),e,n,i).run(t,o,r,c)}}const it="invariant: call uuid unset";class rR{constructor(e,n,t,o,i){this.signalingClient=e,this.callOpts=n,this.pc=t,this.dc=o,this.dialOpts=i,this.clientChannel=new iR(this.pc,this.dc)}clientChannel;callUuid;sentDoneOrErrorOnce=!1;exchangeDone=!1;iceComplete=!1;haveInitResponse=!1;awaitingRemoteDescription;remoteDescriptionSet;numCallUpdates=0;maxCallUpdateDuration=0;totalCallUpdateDuration=0;async doExchange(){await this.setup();const e=nt(this.pc.localDescription,this.dialOpts?.additionalSdpFields),n=et(JSON.stringify(e)),t=new ar({sdp:n});this.dialOpts&&this.dialOpts.disableTrickleICE&&(t.disableTrickle=this.dialOpts.disableTrickleICE),this.clientChannel.ready.then(()=>{this.exchangeDone=!0}).catch(console.error);const o=this.signalingClient.call(t,this.callOpts),i=this.processCallResponses(o);return await Promise.all([this.clientChannel.ready,i]),this.clientChannel}async setup(){if(this.remoteDescriptionSet=new Promise((e,n)=>{this.awaitingRemoteDescription={success:e,failure:n}}),!this.dialOpts?.disableTrickleICE){const e=await this.pc.createOffer({});this.pc.addEventListener("iceconnectionstatechange",()=>{if(this.pc.iceConnectionState!=="completed"||this.numCallUpdates===0)return;const n=this.totalCallUpdateDuration/this.numCallUpdates;console.groupCollapsed("Caller update statistics"),console.table({num_updates:this.numCallUpdates,average_duration:`${n}ms`,max_duration:`${this.maxCallUpdateDuration}ms`}),console.groupEnd()}),this.pc.addEventListener("icecandidate",n=>{this.onLocalICECandidate(n).catch(t=>{console.error(`error processing local ICE candidate ${t}`)})}),await this.pc.setLocalDescription(e)}}terminate(e){this.clientChannel.closeWithReason(e)}async processCallResponses(e){try{for await(const n of e)switch(n.stage.case){case"init":{if(!await this.handleInitResponse(n.uuid,n.stage.value))return;break}case"update":{if(!await this.handleUpdateResponse(n.uuid,n.stage.value))return;break}default:{await this.sendError("unknown CallResponse stage");return}}}catch(n){this.handleInitError(n)}}handleInitError(e){if(!(this.exchangeDone||this.pc.iceConnectionState==="connected")){if(e instanceof C&&e.code===T.Code.Unimplemented){if(e.message==="Response closed without headers")throw new le("failed to dial");if(this.clientChannel.isClosed())throw new le("client channel is closed");console.error(e.message)}throw e}}async handleInitResponse(e,n){if(this.haveInitResponse)return await this.sendError("got init stage more than once"),!1;this.haveInitResponse=!0,this.callUuid=e;const t=new RTCSessionDescription(JSON.parse(or(n.sdp)));return this.clientChannel.isClosed()?(await this.sendError("client channel is closed"),!1):(await this.pc.setRemoteDescription(t),this.awaitingRemoteDescription?.success(!0),this.dialOpts?.disableTrickleICE?(this.exchangeDone=!0,await this.sendDone(),!1):!0)}async handleUpdateResponse(e,n){if(!this.haveInitResponse)return await this.sendError("got update stage before init stage"),!1;if(e!==this.callUuid)return await this.sendError(`uuid mismatch; have=${e} want=${this.callUuid}`),!1;if(n.candidate===void 0)return await this.sendError("no candidate"),!1;const t=mR(n.candidate);t.candidate!==void 0&&console.debug(`received remote ICE ${t.candidate}`);try{await this.pc.addIceCandidate(t)}catch(o){throw console.log("error adding ice candidate",o),await this.sendError(JSON.stringify(o)),o}return!0}async onLocalICECandidate(e){if(await this.remoteDescriptionSet,this.exchangeDone||this.pc.iceConnectionState==="connected")return;if(e.candidate===null){this.iceComplete=!0,await this.sendDone();return}if(this.callUuid===void 0||this.callUuid==="")throw new Error(it);e.candidate.candidate!==void 0&&console.debug(`gathered local ICE ${e.candidate.candidate}`);const n=cR(e.candidate),t=new ra({uuid:this.callUuid,update:{case:"candidate",value:n}}),o=new Date;try{await this.signalingClient.callUpdate(t,this.callOpts),this.numCallUpdates+=1;const r=new Date().getTime()-o.getTime();r>this.maxCallUpdateDuration&&(this.maxCallUpdateDuration=r),this.totalCallUpdateDuration+=r}catch(i){if(this.exchangeDone||this.iceComplete||this.pc.iceConnectionState==="connected")return;console.error(i)}}async sendError(e){if(this.sentDoneOrErrorOnce)return;if(this.callUuid===void 0||this.callUuid==="")throw new Error(it);this.sentDoneOrErrorOnce=!0;const n=new ra({uuid:this.callUuid,update:{case:"error",value:new rn({code:T.Code.Unknown,message:e})}});try{await this.signalingClient.callUpdate(n,this.callOpts)}catch(t){console.error("failed to send call update; continuing",t)}}async sendDone(){if(this.sentDoneOrErrorOnce)return;if(this.callUuid===void 0||this.callUuid==="")throw new Error(it);this.sentDoneOrErrorOnce=!0;const e=new ra({uuid:this.callUuid,update:{case:"done",value:!0}});try{await this.signalingClient.callUpdate(e,this.callOpts)}catch(n){console.error(n)}}}const mR=a=>{const e={candidate:a.candidate};return a.sdpMid!==void 0&&(e.sdpMid=a.sdpMid),a.sdpmLineIndex!==void 0&&(e.sdpMLineIndex=a.sdpmLineIndex),a.usernameFragment!==void 0&&(e.usernameFragment=a.usernameFragment),e},cR=a=>{const e=new Sn;return a.candidate!==void 0&&(e.candidate=a.candidate),a.sdpMid!==void 0&&a.sdpMid!==null&&(e.sdpMid=a.sdpMid),a.sdpMLineIndex!==void 0&&a.sdpMLineIndex!==null&&(e.sdpmLineIndex=a.sdpMLineIndex),a.usernameFragment!==void 0&&a.usernameFragment!==null&&(e.usernameFragment=a.usernameFragment),e},In=async(a,e)=>{gr(e);const n=globalThis.VIAM?.GRPC_TRANSPORT_FACTORY??jf,t={baseUrl:a};if(e?.accessToken!==void 0&&e.accessToken!==""&&!(e.externalAuthAddress!==void 0&&e.externalAuthAddress!==""&&e.externalAuthToEntity!==void 0&&e.externalAuthToEntity!=="")){const o=new Headers(e.extraHeaders);return o.set("authorization",`Bearer ${e.accessToken}`),new ur(t,n,o)}return e===void 0||e.credentials===void 0&&e.accessToken===void 0?n(t):lR(a,n,e,t)},rt=/^.*:\/\//u,lR=async(a,e,n,t)=>{const o=new Headers(n.extraHeaders);let i;if(n.accessToken===void 0||n.accessToken===""){const r=new Za({entity:En(n.credentials)&&n.credentials.authEntity?n.credentials.authEntity:a.replace(rt,"")});n.credentials&&(r.credentials=new nr({type:n.credentials.type,payload:n.credentials.payload}));const c=n.externalAuthAddress??a,d=e({baseUrl:c});i=(await N(If,d).authenticate(r)).accessToken}else i=n.accessToken;if(n.externalAuthAddress!==void 0&&n.externalAuthAddress!==""&&n.externalAuthToEntity!==void 0&&n.externalAuthToEntity!==""){const r=new Headers;r.set("authorization",`Bearer ${i}`),i="";const c=new Za({entity:n.externalAuthToEntity}),d=e({baseUrl:n.externalAuthAddress});i=(await N(Mf,d).authenticateTo(c,{headers:r})).accessToken}return o.set("authorization",`Bearer ${i}`),new ur(t,e,o)};class ur{transport;extraHeaders;constructor(e,n,t){this.extraHeaders=t,this.transport=n(e)}async unary(e,n,t,o,i,r,c){const d=Mn(i);for(const[p,k]of this.extraHeaders)d.set(p,k);return this.transport.unary(e,n,t,o,d,r,c)}async stream(e,n,t,o,i,r,c){const d=Mn(i);for(const[p,k]of this.extraHeaders)d.set(p,k);return this.transport.stream(e,n,t,o,d,r,c)}}const Mn=a=>{const e=new Headers;if(a!==void 0)if(Array.isArray(a))for(const[n,t]of a)e.append(n,t);else if("forEach"in a)typeof a.forEach=="function"&&a.forEach((n,t)=>{e.append(t,n)});else for(const[n,t]of Object.entries(a))e.append(n,t);return e},dR=async(a,e,n)=>{const t={...n},o=await In(a,t),i=N(tr,o);try{return(await i.optionalWebRTCConfig({},e)).config??new ma}catch(r){if(r instanceof C&&r.code===T.Code.Unimplemented)return new ma;throw r}},pR=async(a,e,n)=>{const t=a.replace(/\/$/u,"");gr(n);const o={headers:{"rpc-host":e}},i=await uR(t,o,n),r=gR(t,n),{pc:c,dc:d}=await Yf(i.disableTrickleICE,i.rtcConfig,i.additionalSdpFields);let p=!1,k;try{k=await In(t,r)}catch(_){throw c.close(),_}const R=N(tr,k),I=new rR(R,o,c,d,i);try{n?.dialTimeout!==void 0&&setTimeout(()=>{p||I.terminate(new Error("timed out"))},n.dialTimeout);const _=await I.doExchange();return n?.externalAuthAddress!==void 0&&n.externalAuthAddress!==""||n?.credentials?.type,p=!0,{transport:_,peerConnection:c,dataChannel:d}}catch(_){throw console.error("error dialing",_),_}finally{p||c.close()}},uR=async(a,e,n)=>{const t=await dR(a,e,n),o=t.additionalIceServers.map(c=>{const d=[];for(const p of c.urls)p.endsWith("udp")&&d.push(`${p.slice(0,-3)}tcp`),d.push(p);return{urls:d,credential:c.credential,username:c.username}}),i=n;let r;return i.webrtcOptions===void 0?r={disableTrickleICE:t.disableTrickle,rtcConfig:{iceServers:o}}:(r=JSON.parse(JSON.stringify(i.webrtcOptions)),r.rtcConfig===void 0?r.rtcConfig={iceServers:o}:r.rtcConfig.iceServers=[...r.rtcConfig.iceServers??[],...o]),r},gR=(a,e)=>{let n=e;return n={...e},e.accessToken===void 0&&(En(n.credentials)&&!n.credentials.authEntity&&(n.credentials.authEntity=n.externalAuthAddress!==void 0&&n.externalAuthAddress!==""?n.externalAuthAddress.replace(rt,""):a.replace(rt,"")),n.credentials=e.webrtcOptions?.signalingCredentials,n.accessToken=e.webrtcOptions?.signalingAccessToken),n.externalAuthAddress=e.webrtcOptions?.signalingExternalAuthAddress,n.externalAuthToEntity=e.webrtcOptions?.signalingExternalAuthToEntity,n},gr=a=>{if(a){if(a.accessToken!==void 0&&a.accessToken.length>0){if(a.credentials)throw new Error("cannot set credentials with accessToken");if(a.webrtcOptions!==void 0){if(a.webrtcOptions.signalingAccessToken!==void 0)throw new Error("cannot set webrtcOptions.signalingAccessToken with accessToken");if(a.webrtcOptions.signalingCredentials!==void 0)throw new Error("cannot set webrtcOptions.signalingCredentials with accessToken")}}if(a.webrtcOptions?.signalingAccessToken!==void 0&&a.webrtcOptions.signalingAccessToken.length>0&&a.webrtcOptions.signalingCredentials!==void 0)throw new Error("cannot set webrtcOptions.signalingCredentials with webrtcOptions.signalingAccessToken")}},TR="v0.1.441",Tr=s.makeEnum("viam.common.v1.KinematicsFileFormat",[{no:0,name:"KINEMATICS_FILE_FORMAT_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"KINEMATICS_FILE_FORMAT_SVA",localName:"SVA"},{no:2,name:"KINEMATICS_FILE_FORMAT_URDF",localName:"URDF"}]),x=s.makeMessageType("viam.common.v1.ResourceName",()=>[{no:1,name:"namespace",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"subtype",kind:"scalar",T:9},{no:4,name:"name",kind:"scalar",T:9},{no:5,name:"remote_path",kind:"scalar",T:9,repeated:!0},{no:6,name:"local_name",kind:"scalar",T:9}]),qe=s.makeMessageType("viam.common.v1.Pose",()=>[{no:1,name:"x",kind:"scalar",T:1},{no:2,name:"y",kind:"scalar",T:1},{no:3,name:"z",kind:"scalar",T:1},{no:4,name:"o_x",kind:"scalar",T:1},{no:5,name:"o_y",kind:"scalar",T:1},{no:6,name:"o_z",kind:"scalar",T:1},{no:7,name:"theta",kind:"scalar",T:1}]),kr=s.makeMessageType("viam.common.v1.Orientation",()=>[{no:1,name:"o_x",kind:"scalar",T:1},{no:2,name:"o_y",kind:"scalar",T:1},{no:3,name:"o_z",kind:"scalar",T:1},{no:4,name:"theta",kind:"scalar",T:1}]),mn=s.makeMessageType("viam.common.v1.PoseInFrame",()=>[{no:1,name:"reference_frame",kind:"scalar",T:9},{no:2,name:"pose",kind:"message",T:qe}]),Ue=s.makeMessageType("viam.common.v1.Vector3",()=>[{no:1,name:"x",kind:"scalar",T:1},{no:2,name:"y",kind:"scalar",T:1},{no:3,name:"z",kind:"scalar",T:1}]),yr=s.makeMessageType("viam.common.v1.Sphere",()=>[{no:1,name:"radius_mm",kind:"scalar",T:1}]),vr=s.makeMessageType("viam.common.v1.Capsule",()=>[{no:1,name:"radius_mm",kind:"scalar",T:1},{no:2,name:"length_mm",kind:"scalar",T:1}]),hr=s.makeMessageType("viam.common.v1.RectangularPrism",()=>[{no:1,name:"dims_mm",kind:"message",T:Ue}]),fr=s.makeMessageType("viam.common.v1.Mesh",()=>[{no:1,name:"content_type",kind:"scalar",T:9},{no:2,name:"mesh",kind:"scalar",T:12}]),He=s.makeMessageType("viam.common.v1.Geometry",()=>[{no:1,name:"center",kind:"message",T:qe},{no:2,name:"sphere",kind:"message",T:yr,oneof:"geometry_type"},{no:3,name:"box",kind:"message",T:hr,oneof:"geometry_type"},{no:5,name:"capsule",kind:"message",T:vr,oneof:"geometry_type"},{no:6,name:"mesh",kind:"message",T:fr,oneof:"geometry_type"},{no:4,name:"label",kind:"scalar",T:9}]),mt=s.makeMessageType("viam.common.v1.GeometriesInFrame",()=>[{no:1,name:"reference_frame",kind:"scalar",T:9},{no:2,name:"geometries",kind:"message",T:He,repeated:!0}]),ct=s.makeMessageType("viam.common.v1.PointCloudObject",()=>[{no:1,name:"point_cloud",kind:"scalar",T:12},{no:2,name:"geometries",kind:"message",T:mt}]),Je=s.makeMessageType("viam.common.v1.GeoPoint",()=>[{no:1,name:"latitude",kind:"scalar",T:1},{no:2,name:"longitude",kind:"scalar",T:1}]),da=s.makeMessageType("viam.common.v1.GeoGeometry",()=>[{no:1,name:"location",kind:"message",T:Je},{no:2,name:"geometries",kind:"message",T:He,repeated:!0}]),cn=s.makeMessageType("viam.common.v1.Transform",()=>[{no:1,name:"reference_frame",kind:"scalar",T:9},{no:2,name:"pose_in_observer_frame",kind:"message",T:mn},{no:3,name:"physical_object",kind:"message",T:He,opt:!0}]),Rr=s.makeMessageType("viam.common.v1.WorldState",()=>[{no:1,name:"obstacles",kind:"message",T:mt,repeated:!0},{no:3,name:"transforms",kind:"message",T:cn,repeated:!0}]),kR=s.makeMessageType("viam.common.v1.ActuatorStatus",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),_r=s.makeMessageType("viam.common.v1.ResponseMetadata",()=>[{no:1,name:"captured_at",kind:"message",T:S,opt:!0}]),q=s.makeMessageType("viam.common.v1.DoCommandRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"command",kind:"message",T:l}]),L=s.makeMessageType("viam.common.v1.DoCommandResponse",()=>[{no:1,name:"result",kind:"message",T:l}]),lt=s.makeMessageType("viam.common.v1.GetKinematicsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),dt=s.makeMessageType("viam.common.v1.GetKinematicsResponse",()=>[{no:1,name:"format",kind:"enum",T:s.getEnumType(Tr)},{no:2,name:"kinematics_data",kind:"scalar",T:12}]),J=s.makeMessageType("viam.common.v1.GetGeometriesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),K=s.makeMessageType("viam.common.v1.GetGeometriesResponse",()=>[{no:1,name:"geometries",kind:"message",T:He,repeated:!0}]),Ke=s.makeMessageType("viam.common.v1.GetReadingsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),pa=s.makeMessageType("viam.common.v1.GetReadingsResponse",()=>[{no:1,name:"readings",kind:"map",K:9,V:{kind:"message",T:X}}]),bn=s.makeMessageType("viam.common.v1.LogEntry",()=>[{no:1,name:"host",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:9},{no:3,name:"time",kind:"message",T:S},{no:4,name:"logger_name",kind:"scalar",T:9},{no:5,name:"message",kind:"scalar",T:9},{no:6,name:"caller",kind:"message",T:l},{no:7,name:"stack",kind:"scalar",T:9},{no:8,name:"fields",kind:"message",T:l,repeated:!0}]),Sr=s.makeExtension("viam.common.v1.safety_heartbeat_monitored",me,{no:84260,kind:"scalar",T:8,opt:!0}),pt=Object.freeze(Object.defineProperty({__proto__:null,ActuatorStatus:kR,Capsule:vr,DoCommandRequest:q,DoCommandResponse:L,GeoGeometry:da,GeoPoint:Je,GeometriesInFrame:mt,Geometry:He,GetGeometriesRequest:J,GetGeometriesResponse:K,GetKinematicsRequest:lt,GetKinematicsResponse:dt,GetReadingsRequest:Ke,GetReadingsResponse:pa,KinematicsFileFormat:Tr,LogEntry:bn,Mesh:fr,Orientation:kr,PointCloudObject:ct,Pose:qe,PoseInFrame:mn,RectangularPrism:hr,ResourceName:x,ResponseMetadata:_r,Sphere:yr,Transform:cn,Vector3:Ue,WorldState:Rr,safety_heartbeat_monitored:Sr},Symbol.toStringTag,{value:"Module"})),ut=new Headers({"viam-client":`typescript;v0.43.0;${TR}`}),G=async function(e,n,t,o={},i={}){const r=new q({name:n,command:t});o.requestLogger?.(r);const d=(await e(r,i)).result?.toJson();return d===void 0?{}:d},yR=(a,e)=>{const n=e??{headers:{}};let t="";if(a===void 0){const o="abcdefghijklmnopqrstuvwxyz";for(let i=0;i<6;i+=1)t+=o[Math.floor(Math.random()*26)]}else t=a;return n.headers.dtname=t,n},vR=a=>{if(a.headers){const{_:e,...n}=a.headers;a.headers=n}},hR=(a,e,n)=>{const t=n??{headers:{}};return t.headers[a]=e,t},fR=(a,e)=>{const{[e]:n,...t}=a.headers;a.headers=t},En=a=>a!==void 0&&"authEntity"in a,RR=async(a,e)=>e.type==="access-token"?In(a,{accessToken:e.payload,extraHeaders:ut}):In(a,{credentials:e,extraHeaders:ut}),gt=5e3;var ne=(a=>(a.CONNECTING="connecting",a.CONNECTED="connected",a.DISCONNECTING="disconnecting",a.DISCONNECTED="disconnected",a))(ne||{});class Ir{listeners={};on(e,n){const{listeners:t}=this;t[e]??=new Set,t[e]?.add(n)}once(e,n){const t=o=>{n(o),this.off(e,n)};this.on(e,t)}has(e,n){return this.listeners[e]?.has(n)}off(e,n){this.listeners[e]?.delete(n)}emit(e,n){for(const t of this.listeners[e]??[])t(n)}}const Tt=s.makeMessageType("viam.component.arm.v1.GetEndPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Mr=s.makeMessageType("viam.component.arm.v1.GetEndPositionResponse",()=>[{no:1,name:"pose",kind:"message",T:qe}]),ln=s.makeMessageType("viam.component.arm.v1.JointPositions",()=>[{no:1,name:"values",kind:"scalar",T:1,repeated:!0}]),kt=s.makeMessageType("viam.component.arm.v1.GetJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),br=s.makeMessageType("viam.component.arm.v1.GetJointPositionsResponse",()=>[{no:1,name:"positions",kind:"message",T:ln}]),yt=s.makeMessageType("viam.component.arm.v1.MoveToPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"to",kind:"message",T:qe},{no:99,name:"extra",kind:"message",T:l}]),Er=s.makeMessageType("viam.component.arm.v1.MoveToPositionResponse",[]),vt=s.makeMessageType("viam.component.arm.v1.MoveToJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions",kind:"message",T:ln},{no:99,name:"extra",kind:"message",T:l}]),wr=s.makeMessageType("viam.component.arm.v1.MoveToJointPositionsResponse",[]),Or=s.makeMessageType("viam.component.arm.v1.MoveThroughJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions",kind:"message",T:ln,repeated:!0},{no:3,name:"options",kind:"message",T:Dr,opt:!0},{no:99,name:"extra",kind:"message",T:l}]),Cr=s.makeMessageType("viam.component.arm.v1.MoveThroughJointPositionsResponse",[]),ht=s.makeMessageType("viam.component.arm.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Nr=s.makeMessageType("viam.component.arm.v1.StopResponse",[]),_R=s.makeMessageType("viam.component.arm.v1.Status",()=>[{no:1,name:"end_position",kind:"message",T:qe},{no:2,name:"joint_positions",kind:"message",T:ln},{no:3,name:"is_moving",kind:"scalar",T:8}]),ft=s.makeMessageType("viam.component.arm.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Pr=s.makeMessageType("viam.component.arm.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),Dr=s.makeMessageType("viam.component.arm.v1.MoveOptions",()=>[{no:1,name:"max_vel_degs_per_sec",kind:"scalar",T:1,opt:!0},{no:2,name:"max_acc_degs_per_sec2",kind:"scalar",T:1,opt:!0}]),Ar=Object.freeze(Object.defineProperty({__proto__:null,GetEndPositionRequest:Tt,GetEndPositionResponse:Mr,GetJointPositionsRequest:kt,GetJointPositionsResponse:br,IsMovingRequest:ft,IsMovingResponse:Pr,JointPositions:ln,MoveOptions:Dr,MoveThroughJointPositionsRequest:Or,MoveThroughJointPositionsResponse:Cr,MoveToJointPositionsRequest:vt,MoveToJointPositionsResponse:wr,MoveToPositionRequest:yt,MoveToPositionResponse:Er,Status:_R,StopRequest:ht,StopResponse:Nr},Symbol.toStringTag,{value:"Module"})),qr={typeName:"viam.component.arm.v1.ArmService",methods:{getEndPosition:{name:"GetEndPosition",I:Tt,O:Mr,kind:m.Unary},moveToPosition:{name:"MoveToPosition",I:yt,O:Er,kind:m.Unary},getJointPositions:{name:"GetJointPositions",I:kt,O:br,kind:m.Unary},moveToJointPositions:{name:"MoveToJointPositions",I:vt,O:wr,kind:m.Unary},moveThroughJointPositions:{name:"MoveThroughJointPositions",I:Or,O:Cr,kind:m.Unary},stop:{name:"Stop",I:ht,O:Nr,kind:m.Unary},isMoving:{name:"IsMoving",I:ft,O:Pr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getKinematics:{name:"GetKinematics",I:lt,O:dt,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Rt=s.makeMessageType("viam.component.base.v1.MoveStraightRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"distance_mm",kind:"scalar",T:3},{no:3,name:"mm_per_sec",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Ur=s.makeMessageType("viam.component.base.v1.MoveStraightResponse",[]),_t=s.makeMessageType("viam.component.base.v1.SpinRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"angle_deg",kind:"scalar",T:1},{no:3,name:"degs_per_sec",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Lr=s.makeMessageType("viam.component.base.v1.SpinResponse",[]),St=s.makeMessageType("viam.component.base.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Gr=s.makeMessageType("viam.component.base.v1.StopResponse",[]),It=s.makeMessageType("viam.component.base.v1.SetPowerRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"linear",kind:"message",T:Ue},{no:3,name:"angular",kind:"message",T:Ue},{no:99,name:"extra",kind:"message",T:l}]),Br=s.makeMessageType("viam.component.base.v1.SetPowerResponse",[]),Mt=s.makeMessageType("viam.component.base.v1.SetVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"linear",kind:"message",T:Ue},{no:3,name:"angular",kind:"message",T:Ue},{no:99,name:"extra",kind:"message",T:l}]),Fr=s.makeMessageType("viam.component.base.v1.SetVelocityResponse",[]),bt=s.makeMessageType("viam.component.base.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),xr=s.makeMessageType("viam.component.base.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),ua=s.makeMessageType("viam.component.base.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Jr=s.makeMessageType("viam.component.base.v1.GetPropertiesResponse",()=>[{no:1,name:"width_meters",kind:"scalar",T:1},{no:2,name:"turning_radius_meters",kind:"scalar",T:1},{no:3,name:"wheel_circumference_meters",kind:"scalar",T:1}]),zr=Object.freeze(Object.defineProperty({__proto__:null,GetPropertiesRequest:ua,GetPropertiesResponse:Jr,IsMovingRequest:bt,IsMovingResponse:xr,MoveStraightRequest:Rt,MoveStraightResponse:Ur,SetPowerRequest:It,SetPowerResponse:Br,SetVelocityRequest:Mt,SetVelocityResponse:Fr,SpinRequest:_t,SpinResponse:Lr,StopRequest:St,StopResponse:Gr},Symbol.toStringTag,{value:"Module"})),Yr={typeName:"viam.component.base.v1.BaseService",methods:{moveStraight:{name:"MoveStraight",I:Rt,O:Ur,kind:m.Unary},spin:{name:"Spin",I:_t,O:Lr,kind:m.Unary},setPower:{name:"SetPower",I:It,O:Br,kind:m.Unary},setVelocity:{name:"SetVelocity",I:Mt,O:Fr,kind:m.Unary},stop:{name:"Stop",I:St,O:Gr,kind:m.Unary},isMoving:{name:"IsMoving",I:bt,O:xr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary},getProperties:{name:"GetProperties",I:ua,O:Jr,kind:m.Unary}}},$r=s.makeEnum("viam.component.board.v1.PowerMode",[{no:0,name:"POWER_MODE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"POWER_MODE_NORMAL",localName:"NORMAL"},{no:2,name:"POWER_MODE_OFFLINE_DEEP",localName:"OFFLINE_DEEP"}]),SR=s.makeMessageType("viam.component.board.v1.Status",()=>[{no:1,name:"analogs",kind:"map",K:9,V:{kind:"scalar",T:5}},{no:2,name:"digital_interrupts",kind:"map",K:9,V:{kind:"scalar",T:3}}]),Et=s.makeMessageType("viam.component.board.v1.SetGPIORequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:3,name:"high",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:l}]),Vr=s.makeMessageType("viam.component.board.v1.SetGPIOResponse",[]),wt=s.makeMessageType("viam.component.board.v1.GetGPIORequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Wr=s.makeMessageType("viam.component.board.v1.GetGPIOResponse",()=>[{no:1,name:"high",kind:"scalar",T:8}]),Ot=s.makeMessageType("viam.component.board.v1.PWMRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),jr=s.makeMessageType("viam.component.board.v1.PWMResponse",()=>[{no:1,name:"duty_cycle_pct",kind:"scalar",T:1}]),Ct=s.makeMessageType("viam.component.board.v1.SetPWMRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:3,name:"duty_cycle_pct",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Hr=s.makeMessageType("viam.component.board.v1.SetPWMResponse",[]),Nt=s.makeMessageType("viam.component.board.v1.PWMFrequencyRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Kr=s.makeMessageType("viam.component.board.v1.PWMFrequencyResponse",()=>[{no:1,name:"frequency_hz",kind:"scalar",T:4}]),Pt=s.makeMessageType("viam.component.board.v1.SetPWMFrequencyRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:3,name:"frequency_hz",kind:"scalar",T:4},{no:99,name:"extra",kind:"message",T:l}]),Xr=s.makeMessageType("viam.component.board.v1.SetPWMFrequencyResponse",[]),Dt=s.makeMessageType("viam.component.board.v1.ReadAnalogReaderRequest",()=>[{no:1,name:"board_name",kind:"scalar",T:9},{no:2,name:"analog_reader_name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Qr=s.makeMessageType("viam.component.board.v1.ReadAnalogReaderResponse",()=>[{no:1,name:"value",kind:"scalar",T:5},{no:2,name:"min_range",kind:"scalar",T:2},{no:3,name:"max_range",kind:"scalar",T:2},{no:4,name:"step_size",kind:"scalar",T:2}]),At=s.makeMessageType("viam.component.board.v1.WriteAnalogRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin",kind:"scalar",T:9},{no:3,name:"value",kind:"scalar",T:5},{no:99,name:"extra",kind:"message",T:l}]),Zr=s.makeMessageType("viam.component.board.v1.WriteAnalogResponse",[]),qt=s.makeMessageType("viam.component.board.v1.GetDigitalInterruptValueRequest",()=>[{no:1,name:"board_name",kind:"scalar",T:9},{no:2,name:"digital_interrupt_name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),em=s.makeMessageType("viam.component.board.v1.GetDigitalInterruptValueResponse",()=>[{no:1,name:"value",kind:"scalar",T:3}]),Ut=s.makeMessageType("viam.component.board.v1.StreamTicksRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"pin_names",kind:"scalar",T:9,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),nm=s.makeMessageType("viam.component.board.v1.StreamTicksResponse",()=>[{no:1,name:"pin_name",kind:"scalar",T:9},{no:2,name:"time",kind:"scalar",T:4},{no:3,name:"high",kind:"scalar",T:8}]),Lt=s.makeMessageType("viam.component.board.v1.SetPowerModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"power_mode",kind:"enum",T:s.getEnumType($r)},{no:3,name:"duration",kind:"message",T:F,opt:!0},{no:99,name:"extra",kind:"message",T:l}]),am=s.makeMessageType("viam.component.board.v1.SetPowerModeResponse",[]),tm=Object.freeze(Object.defineProperty({__proto__:null,GetDigitalInterruptValueRequest:qt,GetDigitalInterruptValueResponse:em,GetGPIORequest:wt,GetGPIOResponse:Wr,PWMFrequencyRequest:Nt,PWMFrequencyResponse:Kr,PWMRequest:Ot,PWMResponse:jr,PowerMode:$r,ReadAnalogReaderRequest:Dt,ReadAnalogReaderResponse:Qr,SetGPIORequest:Et,SetGPIOResponse:Vr,SetPWMFrequencyRequest:Pt,SetPWMFrequencyResponse:Xr,SetPWMRequest:Ct,SetPWMResponse:Hr,SetPowerModeRequest:Lt,SetPowerModeResponse:am,Status:SR,StreamTicksRequest:Ut,StreamTicksResponse:nm,WriteAnalogRequest:At,WriteAnalogResponse:Zr},Symbol.toStringTag,{value:"Module"})),sm={typeName:"viam.component.board.v1.BoardService",methods:{setGPIO:{name:"SetGPIO",I:Et,O:Vr,kind:m.Unary},getGPIO:{name:"GetGPIO",I:wt,O:Wr,kind:m.Unary},pWM:{name:"PWM",I:Ot,O:jr,kind:m.Unary},setPWM:{name:"SetPWM",I:Ct,O:Hr,kind:m.Unary},pWMFrequency:{name:"PWMFrequency",I:Nt,O:Kr,kind:m.Unary},setPWMFrequency:{name:"SetPWMFrequency",I:Pt,O:Xr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},readAnalogReader:{name:"ReadAnalogReader",I:Dt,O:Qr,kind:m.Unary},writeAnalog:{name:"WriteAnalog",I:At,O:Zr,kind:m.Unary},getDigitalInterruptValue:{name:"GetDigitalInterruptValue",I:qt,O:em,kind:m.Unary},streamTicks:{name:"StreamTicks",I:Ut,O:nm,kind:m.ServerStreaming},setPowerMode:{name:"SetPowerMode",I:Lt,O:am,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Gt=s.makeEnum("viam.component.encoder.v1.PositionType",[{no:0,name:"POSITION_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"POSITION_TYPE_TICKS_COUNT",localName:"TICKS_COUNT"},{no:2,name:"POSITION_TYPE_ANGLE_DEGREES",localName:"ANGLE_DEGREES"}]),Bt=s.makeMessageType("viam.component.encoder.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"position_type",kind:"enum",T:s.getEnumType(Gt),opt:!0},{no:99,name:"extra",kind:"message",T:l}]),om=s.makeMessageType("viam.component.encoder.v1.GetPositionResponse",()=>[{no:1,name:"value",kind:"scalar",T:2},{no:2,name:"position_type",kind:"enum",T:s.getEnumType(Gt)}]),Ft=s.makeMessageType("viam.component.encoder.v1.ResetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),im=s.makeMessageType("viam.component.encoder.v1.ResetPositionResponse",[]),xt=s.makeMessageType("viam.component.encoder.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),rm=s.makeMessageType("viam.component.encoder.v1.GetPropertiesResponse",()=>[{no:1,name:"ticks_count_supported",kind:"scalar",T:8},{no:2,name:"angle_degrees_supported",kind:"scalar",T:8}]),mm=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:Bt,GetPositionResponse:om,GetPropertiesRequest:xt,GetPropertiesResponse:rm,PositionType:Gt,ResetPositionRequest:Ft,ResetPositionResponse:im},Symbol.toStringTag,{value:"Module"})),cm={typeName:"viam.component.encoder.v1.EncoderService",methods:{getPosition:{name:"GetPosition",I:Bt,O:om,kind:m.Unary},resetPosition:{name:"ResetPosition",I:Ft,O:im,kind:m.Unary},getProperties:{name:"GetProperties",I:xt,O:rm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Jt=s.makeMessageType("viam.component.gantry.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),lm=s.makeMessageType("viam.component.gantry.v1.GetPositionResponse",()=>[{no:1,name:"positions_mm",kind:"scalar",T:1,repeated:!0}]),zt=s.makeMessageType("viam.component.gantry.v1.MoveToPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions_mm",kind:"scalar",T:1,repeated:!0},{no:3,name:"speeds_mm_per_sec",kind:"scalar",T:1,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),dm=s.makeMessageType("viam.component.gantry.v1.MoveToPositionResponse",[]),Yt=s.makeMessageType("viam.component.gantry.v1.HomeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),pm=s.makeMessageType("viam.component.gantry.v1.HomeResponse",()=>[{no:1,name:"homed",kind:"scalar",T:8}]),$t=s.makeMessageType("viam.component.gantry.v1.GetLengthsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),um=s.makeMessageType("viam.component.gantry.v1.GetLengthsResponse",()=>[{no:1,name:"lengths_mm",kind:"scalar",T:1,repeated:!0}]),Vt=s.makeMessageType("viam.component.gantry.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),gm=s.makeMessageType("viam.component.gantry.v1.StopResponse",[]),IR=s.makeMessageType("viam.component.gantry.v1.Status",()=>[{no:1,name:"positions_mm",kind:"scalar",T:1,repeated:!0},{no:2,name:"lengths_mm",kind:"scalar",T:1,repeated:!0},{no:3,name:"is_moving",kind:"scalar",T:8}]),Wt=s.makeMessageType("viam.component.gantry.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Tm=s.makeMessageType("viam.component.gantry.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),MR=Object.freeze(Object.defineProperty({__proto__:null,GetLengthsRequest:$t,GetLengthsResponse:um,GetPositionRequest:Jt,GetPositionResponse:lm,HomeRequest:Yt,HomeResponse:pm,IsMovingRequest:Wt,IsMovingResponse:Tm,MoveToPositionRequest:zt,MoveToPositionResponse:dm,Status:IR,StopRequest:Vt,StopResponse:gm},Symbol.toStringTag,{value:"Module"})),km={typeName:"viam.component.gantry.v1.GantryService",methods:{getPosition:{name:"GetPosition",I:Jt,O:lm,kind:m.Unary},moveToPosition:{name:"MoveToPosition",I:zt,O:dm,kind:m.Unary},home:{name:"Home",I:Yt,O:pm,kind:m.Unary},getLengths:{name:"GetLengths",I:$t,O:um,kind:m.Unary},stop:{name:"Stop",I:Vt,O:gm,kind:m.Unary},isMoving:{name:"IsMoving",I:Wt,O:Tm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},jt={typeName:"viam.component.generic.v1.GenericService",methods:{doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},bR=Object.freeze(Object.defineProperty({__proto__:null,GenericService:jt},Symbol.toStringTag,{value:"Module"})),Ht=s.makeMessageType("viam.component.gripper.v1.OpenRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),ym=s.makeMessageType("viam.component.gripper.v1.OpenResponse",[]),Kt=s.makeMessageType("viam.component.gripper.v1.GrabRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),vm=s.makeMessageType("viam.component.gripper.v1.GrabResponse",()=>[{no:1,name:"success",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:l}]),Xt=s.makeMessageType("viam.component.gripper.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),hm=s.makeMessageType("viam.component.gripper.v1.StopResponse",[]),Qt=s.makeMessageType("viam.component.gripper.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),fm=s.makeMessageType("viam.component.gripper.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),ER=Object.freeze(Object.defineProperty({__proto__:null,GrabRequest:Kt,GrabResponse:vm,IsMovingRequest:Qt,IsMovingResponse:fm,OpenRequest:Ht,OpenResponse:ym,StopRequest:Xt,StopResponse:hm},Symbol.toStringTag,{value:"Module"})),Rm={typeName:"viam.component.gripper.v1.GripperService",methods:{open:{name:"Open",I:Ht,O:ym,kind:m.Unary},grab:{name:"Grab",I:Kt,O:vm,kind:m.Unary},stop:{name:"Stop",I:Xt,O:hm,kind:m.Unary},isMoving:{name:"IsMoving",I:Qt,O:fm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary},getKinematics:{name:"GetKinematics",I:lt,O:dt,kind:m.Unary}}},_m=s.makeMessageType("viam.component.inputcontroller.v1.GetControlsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Sm=s.makeMessageType("viam.component.inputcontroller.v1.GetControlsResponse",()=>[{no:1,name:"controls",kind:"scalar",T:9,repeated:!0}]),Zt=s.makeMessageType("viam.component.inputcontroller.v1.GetEventsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Im=s.makeMessageType("viam.component.inputcontroller.v1.GetEventsResponse",()=>[{no:1,name:"events",kind:"message",T:wn,repeated:!0}]),es=s.makeMessageType("viam.component.inputcontroller.v1.TriggerEventRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:2,name:"event",kind:"message",T:wn},{no:99,name:"extra",kind:"message",T:l}]),Mm=s.makeMessageType("viam.component.inputcontroller.v1.TriggerEventResponse",[]),wn=s.makeMessageType("viam.component.inputcontroller.v1.Event",()=>[{no:1,name:"time",kind:"message",T:S},{no:2,name:"event",kind:"scalar",T:9},{no:3,name:"control",kind:"scalar",T:9},{no:4,name:"value",kind:"scalar",T:1}]),bm=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:2,name:"events",kind:"message",T:Em,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),Em=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsRequest.Events",()=>[{no:1,name:"control",kind:"scalar",T:9},{no:2,name:"events",kind:"scalar",T:9,repeated:!0},{no:3,name:"cancelled_events",kind:"scalar",T:9,repeated:!0}],{localName:"StreamEventsRequest_Events"}),wm=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsResponse",()=>[{no:1,name:"event",kind:"message",T:wn}]),Om=Object.freeze(Object.defineProperty({__proto__:null,Event:wn,GetControlsRequest:_m,GetControlsResponse:Sm,GetEventsRequest:Zt,GetEventsResponse:Im,Status:s.makeMessageType("viam.component.inputcontroller.v1.Status",()=>[{no:1,name:"events",kind:"message",T:wn,repeated:!0}]),StreamEventsRequest:bm,StreamEventsRequest_Events:Em,StreamEventsResponse:wm,TriggerEventRequest:es,TriggerEventResponse:Mm},Symbol.toStringTag,{value:"Module"})),Cm={typeName:"viam.component.inputcontroller.v1.InputControllerService",methods:{getControls:{name:"GetControls",I:_m,O:Sm,kind:m.Unary},getEvents:{name:"GetEvents",I:Zt,O:Im,kind:m.Unary},streamEvents:{name:"StreamEvents",I:bm,O:wm,kind:m.ServerStreaming},triggerEvent:{name:"TriggerEvent",I:es,O:Mm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},ns=s.makeMessageType("viam.component.motor.v1.SetPowerRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"power_pct",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Nm=s.makeMessageType("viam.component.motor.v1.SetPowerResponse",[]),as=s.makeMessageType("viam.component.motor.v1.GoForRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"rpm",kind:"scalar",T:1},{no:3,name:"revolutions",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Pm=s.makeMessageType("viam.component.motor.v1.GoForResponse",[]),ts=s.makeMessageType("viam.component.motor.v1.GoToRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"rpm",kind:"scalar",T:1},{no:3,name:"position_revolutions",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Dm=s.makeMessageType("viam.component.motor.v1.GoToResponse",[]),ss=s.makeMessageType("viam.component.motor.v1.SetRPMRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"rpm",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),Am=s.makeMessageType("viam.component.motor.v1.SetRPMResponse",[]),os=s.makeMessageType("viam.component.motor.v1.ResetZeroPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"offset",kind:"scalar",T:1},{no:99,name:"extra",kind:"message",T:l}]),qm=s.makeMessageType("viam.component.motor.v1.ResetZeroPositionResponse",[]),is=s.makeMessageType("viam.component.motor.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Um=s.makeMessageType("viam.component.motor.v1.GetPositionResponse",()=>[{no:1,name:"position",kind:"scalar",T:1}]),rs=s.makeMessageType("viam.component.motor.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Lm=s.makeMessageType("viam.component.motor.v1.StopResponse",[]),ms=s.makeMessageType("viam.component.motor.v1.IsPoweredRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Gm=s.makeMessageType("viam.component.motor.v1.IsPoweredResponse",()=>[{no:1,name:"is_on",kind:"scalar",T:8},{no:2,name:"power_pct",kind:"scalar",T:1}]),cs=s.makeMessageType("viam.component.motor.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Bm=s.makeMessageType("viam.component.motor.v1.GetPropertiesResponse",()=>[{no:1,name:"position_reporting",kind:"scalar",T:8}]),wR=s.makeMessageType("viam.component.motor.v1.Status",()=>[{no:1,name:"is_powered",kind:"scalar",T:8},{no:3,name:"position",kind:"scalar",T:1},{no:4,name:"is_moving",kind:"scalar",T:8}]),ls=s.makeMessageType("viam.component.motor.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Fm=s.makeMessageType("viam.component.motor.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),OR=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:is,GetPositionResponse:Um,GetPropertiesRequest:cs,GetPropertiesResponse:Bm,GoForRequest:as,GoForResponse:Pm,GoToRequest:ts,GoToResponse:Dm,IsMovingRequest:ls,IsMovingResponse:Fm,IsPoweredRequest:ms,IsPoweredResponse:Gm,ResetZeroPositionRequest:os,ResetZeroPositionResponse:qm,SetPowerRequest:ns,SetPowerResponse:Nm,SetRPMRequest:ss,SetRPMResponse:Am,Status:wR,StopRequest:rs,StopResponse:Lm},Symbol.toStringTag,{value:"Module"})),xm={typeName:"viam.component.motor.v1.MotorService",methods:{setPower:{name:"SetPower",I:ns,O:Nm,kind:m.Unary},goFor:{name:"GoFor",I:as,O:Pm,kind:m.Unary},goTo:{name:"GoTo",I:ts,O:Dm,kind:m.Unary},setRPM:{name:"SetRPM",I:ss,O:Am,kind:m.Unary},resetZeroPosition:{name:"ResetZeroPosition",I:os,O:qm,kind:m.Unary},getPosition:{name:"GetPosition",I:is,O:Um,kind:m.Unary},getProperties:{name:"GetProperties",I:cs,O:Bm,kind:m.Unary},stop:{name:"Stop",I:rs,O:Lm,kind:m.Unary},isPowered:{name:"IsPowered",I:ms,O:Gm,kind:m.Unary},isMoving:{name:"IsMoving",I:ls,O:Fm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},ds=s.makeMessageType("viam.component.movementsensor.v1.GetLinearVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Jm=s.makeMessageType("viam.component.movementsensor.v1.GetLinearVelocityResponse",()=>[{no:1,name:"linear_velocity",kind:"message",T:Ue}]),ps=s.makeMessageType("viam.component.movementsensor.v1.GetAngularVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),zm=s.makeMessageType("viam.component.movementsensor.v1.GetAngularVelocityResponse",()=>[{no:1,name:"angular_velocity",kind:"message",T:Ue}]),us=s.makeMessageType("viam.component.movementsensor.v1.GetCompassHeadingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Ym=s.makeMessageType("viam.component.movementsensor.v1.GetCompassHeadingResponse",()=>[{no:1,name:"value",kind:"scalar",T:1}]),gs=s.makeMessageType("viam.component.movementsensor.v1.GetOrientationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),$m=s.makeMessageType("viam.component.movementsensor.v1.GetOrientationResponse",()=>[{no:1,name:"orientation",kind:"message",T:kr}]),Ts=s.makeMessageType("viam.component.movementsensor.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Vm=s.makeMessageType("viam.component.movementsensor.v1.GetPositionResponse",()=>[{no:1,name:"coordinate",kind:"message",T:Je},{no:2,name:"altitude_m",kind:"scalar",T:2}]),ks=s.makeMessageType("viam.component.movementsensor.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Wm=s.makeMessageType("viam.component.movementsensor.v1.GetPropertiesResponse",()=>[{no:1,name:"linear_velocity_supported",kind:"scalar",T:8},{no:2,name:"angular_velocity_supported",kind:"scalar",T:8},{no:3,name:"orientation_supported",kind:"scalar",T:8},{no:4,name:"position_supported",kind:"scalar",T:8},{no:5,name:"compass_heading_supported",kind:"scalar",T:8},{no:6,name:"linear_acceleration_supported",kind:"scalar",T:8}]),ys=s.makeMessageType("viam.component.movementsensor.v1.GetAccuracyRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),jm=s.makeMessageType("viam.component.movementsensor.v1.GetAccuracyResponse",()=>[{no:1,name:"accuracy",kind:"map",K:9,V:{kind:"scalar",T:2}},{no:2,name:"position_hdop",kind:"scalar",T:2,opt:!0},{no:3,name:"position_vdop",kind:"scalar",T:2,opt:!0},{no:4,name:"position_nmea_gga_fix",kind:"scalar",T:5,opt:!0},{no:5,name:"compass_degrees_error",kind:"scalar",T:2,opt:!0}]),vs=s.makeMessageType("viam.component.movementsensor.v1.GetLinearAccelerationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Hm=s.makeMessageType("viam.component.movementsensor.v1.GetLinearAccelerationResponse",()=>[{no:1,name:"linear_acceleration",kind:"message",T:Ue}]),Km=Object.freeze(Object.defineProperty({__proto__:null,GetAccuracyRequest:ys,GetAccuracyResponse:jm,GetAngularVelocityRequest:ps,GetAngularVelocityResponse:zm,GetCompassHeadingRequest:us,GetCompassHeadingResponse:Ym,GetLinearAccelerationRequest:vs,GetLinearAccelerationResponse:Hm,GetLinearVelocityRequest:ds,GetLinearVelocityResponse:Jm,GetOrientationRequest:gs,GetOrientationResponse:$m,GetPositionRequest:Ts,GetPositionResponse:Vm,GetPropertiesRequest:ks,GetPropertiesResponse:Wm},Symbol.toStringTag,{value:"Module"})),Xm={typeName:"viam.component.movementsensor.v1.MovementSensorService",methods:{getLinearVelocity:{name:"GetLinearVelocity",I:ds,O:Jm,kind:m.Unary},getAngularVelocity:{name:"GetAngularVelocity",I:ps,O:zm,kind:m.Unary},getCompassHeading:{name:"GetCompassHeading",I:us,O:Ym,kind:m.Unary},getOrientation:{name:"GetOrientation",I:gs,O:$m,kind:m.Unary},getPosition:{name:"GetPosition",I:Ts,O:Vm,kind:m.Unary},getProperties:{name:"GetProperties",I:ks,O:Wm,kind:m.Unary},getAccuracy:{name:"GetAccuracy",I:ys,O:jm,kind:m.Unary},getLinearAcceleration:{name:"GetLinearAcceleration",I:vs,O:Hm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary},getReadings:{name:"GetReadings",I:Ke,O:pa,kind:m.Unary}}},hs=s.makeMessageType("viam.component.powersensor.v1.GetVoltageRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Qm=s.makeMessageType("viam.component.powersensor.v1.GetVoltageResponse",()=>[{no:1,name:"volts",kind:"scalar",T:1},{no:2,name:"is_ac",kind:"scalar",T:8}]),fs=s.makeMessageType("viam.component.powersensor.v1.GetCurrentRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Zm=s.makeMessageType("viam.component.powersensor.v1.GetCurrentResponse",()=>[{no:1,name:"amperes",kind:"scalar",T:1},{no:2,name:"is_ac",kind:"scalar",T:8}]),Rs=s.makeMessageType("viam.component.powersensor.v1.GetPowerRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),ec=s.makeMessageType("viam.component.powersensor.v1.GetPowerResponse",()=>[{no:1,name:"watts",kind:"scalar",T:1}]),CR=Object.freeze(Object.defineProperty({__proto__:null,GetCurrentRequest:fs,GetCurrentResponse:Zm,GetPowerRequest:Rs,GetPowerResponse:ec,GetVoltageRequest:hs,GetVoltageResponse:Qm},Symbol.toStringTag,{value:"Module"})),nc={typeName:"viam.component.powersensor.v1.PowerSensorService",methods:{getVoltage:{name:"GetVoltage",I:hs,O:Qm,kind:m.Unary},getCurrent:{name:"GetCurrent",I:fs,O:Zm,kind:m.Unary},getPower:{name:"GetPower",I:Rs,O:ec,kind:m.Unary},getReadings:{name:"GetReadings",I:Ke,O:pa,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},_s=s.makeMessageType("viam.component.servo.v1.MoveRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"angle_deg",kind:"scalar",T:13},{no:99,name:"extra",kind:"message",T:l}]),ac=s.makeMessageType("viam.component.servo.v1.MoveResponse",[]),Ss=s.makeMessageType("viam.component.servo.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),tc=s.makeMessageType("viam.component.servo.v1.GetPositionResponse",()=>[{no:1,name:"position_deg",kind:"scalar",T:13}]),Is=s.makeMessageType("viam.component.servo.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),sc=s.makeMessageType("viam.component.servo.v1.StopResponse",[]),NR=s.makeMessageType("viam.component.servo.v1.Status",()=>[{no:1,name:"position_deg",kind:"scalar",T:13},{no:2,name:"is_moving",kind:"scalar",T:8}]),Ms=s.makeMessageType("viam.component.servo.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),oc=s.makeMessageType("viam.component.servo.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),PR=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:Ss,GetPositionResponse:tc,IsMovingRequest:Ms,IsMovingResponse:oc,MoveRequest:_s,MoveResponse:ac,Status:NR,StopRequest:Is,StopResponse:sc},Symbol.toStringTag,{value:"Module"})),ic={typeName:"viam.component.servo.v1.ServoService",methods:{move:{name:"Move",I:_s,O:ac,kind:m.Unary},getPosition:{name:"GetPosition",I:Ss,O:tc,kind:m.Unary},stop:{name:"Stop",I:Is,O:sc,kind:m.Unary},isMoving:{name:"IsMoving",I:Ms,O:oc,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},rc=s.makeEnum("viam.robot.v1.PeerConnectionType",[{no:0,name:"PEER_CONNECTION_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PEER_CONNECTION_TYPE_GRPC",localName:"GRPC"},{no:2,name:"PEER_CONNECTION_TYPE_WEBRTC",localName:"WEBRTC"}]),mc=s.makeMessageType("viam.robot.v1.TunnelRequest",()=>[{no:1,name:"destination_port",kind:"scalar",T:13},{no:2,name:"data",kind:"scalar",T:12}]),cc=s.makeMessageType("viam.robot.v1.TunnelResponse",()=>[{no:1,name:"data",kind:"scalar",T:12}]),lc=s.makeMessageType("viam.robot.v1.ListTunnelsRequest",[]),dc=s.makeMessageType("viam.robot.v1.ListTunnelsResponse",()=>[{no:1,name:"tunnels",kind:"message",T:pc,repeated:!0}]),pc=s.makeMessageType("viam.robot.v1.Tunnel",()=>[{no:1,name:"port",kind:"scalar",T:13},{no:2,name:"connection_timeout",kind:"message",T:F}]),uc=s.makeMessageType("viam.robot.v1.FrameSystemConfig",()=>[{no:1,name:"frame",kind:"message",T:cn},{no:2,name:"kinematics",kind:"message",T:l}]),gc=s.makeMessageType("viam.robot.v1.FrameSystemConfigRequest",()=>[{no:1,name:"supplemental_transforms",kind:"message",T:cn,repeated:!0}]),Tc=s.makeMessageType("viam.robot.v1.FrameSystemConfigResponse",()=>[{no:1,name:"frame_system_configs",kind:"message",T:uc,repeated:!0}]),bs=s.makeMessageType("viam.robot.v1.TransformPoseRequest",()=>[{no:1,name:"source",kind:"message",T:mn},{no:2,name:"destination",kind:"scalar",T:9},{no:3,name:"supplemental_transforms",kind:"message",T:cn,repeated:!0}]),kc=s.makeMessageType("viam.robot.v1.TransformPoseResponse",()=>[{no:1,name:"pose",kind:"message",T:mn}]),Es=s.makeMessageType("viam.robot.v1.TransformPCDRequest",()=>[{no:1,name:"point_cloud_pcd",kind:"scalar",T:12},{no:2,name:"source",kind:"scalar",T:9},{no:3,name:"destination",kind:"scalar",T:9}]),yc=s.makeMessageType("viam.robot.v1.TransformPCDResponse",()=>[{no:1,name:"point_cloud_pcd",kind:"scalar",T:12}]),vc=s.makeMessageType("viam.robot.v1.ResourceNamesRequest",[]),hc=s.makeMessageType("viam.robot.v1.ResourceNamesResponse",()=>[{no:1,name:"resources",kind:"message",T:x,repeated:!0}]),fc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtype",()=>[{no:1,name:"subtype",kind:"message",T:x},{no:2,name:"proto_service",kind:"scalar",T:9}]),Rc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtypesRequest",[]),_c=s.makeMessageType("viam.robot.v1.ResourceRPCSubtypesResponse",()=>[{no:1,name:"resource_rpc_subtypes",kind:"message",T:fc,repeated:!0}]),Sc=s.makeMessageType("viam.robot.v1.Operation",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"arguments",kind:"message",T:l},{no:4,name:"started",kind:"message",T:S},{no:5,name:"session_id",kind:"scalar",T:9,opt:!0}]),Ic=s.makeMessageType("viam.robot.v1.GetOperationsRequest",[]),Mc=s.makeMessageType("viam.robot.v1.GetOperationsResponse",()=>[{no:1,name:"operations",kind:"message",T:Sc,repeated:!0}]),bc=s.makeMessageType("viam.robot.v1.CancelOperationRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Ec=s.makeMessageType("viam.robot.v1.CancelOperationResponse",[]),wc=s.makeMessageType("viam.robot.v1.BlockForOperationRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Oc=s.makeMessageType("viam.robot.v1.BlockForOperationResponse",[]),Cc=s.makeMessageType("viam.robot.v1.PeerConnectionInfo",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(rc)},{no:2,name:"remote_address",kind:"scalar",T:9,opt:!0},{no:3,name:"local_address",kind:"scalar",T:9,opt:!0}]),Nc=s.makeMessageType("viam.robot.v1.Session",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"peer_connection_info",kind:"message",T:Cc,opt:!0}]),Pc=s.makeMessageType("viam.robot.v1.GetSessionsRequest",[]),Dc=s.makeMessageType("viam.robot.v1.GetSessionsResponse",()=>[{no:1,name:"sessions",kind:"message",T:Nc,repeated:!0}]),Ac=s.makeMessageType("viam.robot.v1.ModuleModel",()=>[{no:1,name:"module_name",kind:"scalar",T:9},{no:2,name:"model",kind:"scalar",T:9},{no:3,name:"api",kind:"scalar",T:9},{no:4,name:"from_local_module",kind:"scalar",T:8}]),ws=s.makeMessageType("viam.robot.v1.GetModelsFromModulesRequest",[]),qc=s.makeMessageType("viam.robot.v1.GetModelsFromModulesResponse",()=>[{no:1,name:"models",kind:"message",T:Ac,repeated:!0}]),Os=s.makeMessageType("viam.robot.v1.Status",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"status",kind:"message",T:l},{no:3,name:"last_reconfigured",kind:"message",T:S}]),Uc=s.makeMessageType("viam.robot.v1.GetStatusRequest",()=>[{no:1,name:"resource_names",kind:"message",T:x,repeated:!0}]),Lc=s.makeMessageType("viam.robot.v1.GetStatusResponse",()=>[{no:1,name:"status",kind:"message",T:Os,repeated:!0}]),Gc=s.makeMessageType("viam.robot.v1.StreamStatusRequest",()=>[{no:1,name:"resource_names",kind:"message",T:x,repeated:!0},{no:2,name:"every",kind:"message",T:F}]),Bc=s.makeMessageType("viam.robot.v1.StreamStatusResponse",()=>[{no:1,name:"status",kind:"message",T:Os,repeated:!0}]),Fc=s.makeMessageType("viam.robot.v1.StopExtraParameters",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"params",kind:"message",T:l}]),xc=s.makeMessageType("viam.robot.v1.StopAllRequest",()=>[{no:99,name:"extra",kind:"message",T:Fc,repeated:!0}]),Jc=s.makeMessageType("viam.robot.v1.StopAllResponse",[]),Cs=s.makeMessageType("viam.robot.v1.StartSessionRequest",()=>[{no:1,name:"resume",kind:"scalar",T:9}]),zc=s.makeMessageType("viam.robot.v1.StartSessionResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"heartbeat_window",kind:"message",T:F}]),Ns=s.makeMessageType("viam.robot.v1.SendSessionHeartbeatRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Yc=s.makeMessageType("viam.robot.v1.SendSessionHeartbeatResponse",[]),$c=s.makeMessageType("viam.robot.v1.LogRequest",()=>[{no:1,name:"logs",kind:"message",T:bn,repeated:!0}]),Vc=s.makeMessageType("viam.robot.v1.LogResponse",[]),Wc=s.makeMessageType("viam.robot.v1.GetCloudMetadataRequest",[]),Ps=s.makeMessageType("viam.robot.v1.GetCloudMetadataResponse",()=>[{no:1,name:"robot_part_id",kind:"scalar",T:9},{no:2,name:"primary_org_id",kind:"scalar",T:9},{no:3,name:"location_id",kind:"scalar",T:9},{no:4,name:"machine_id",kind:"scalar",T:9},{no:5,name:"machine_part_id",kind:"scalar",T:9}]),Ds=s.makeMessageType("viam.robot.v1.RestartModuleRequest",()=>[{no:1,name:"module_id",kind:"scalar",T:9,oneof:"id_or_name"},{no:2,name:"module_name",kind:"scalar",T:9,oneof:"id_or_name"}]),jc=s.makeMessageType("viam.robot.v1.RestartModuleResponse",[]),Hc=s.makeMessageType("viam.robot.v1.ShutdownRequest",[]),Kc=s.makeMessageType("viam.robot.v1.ShutdownResponse",[]),Xc=s.makeMessageType("viam.robot.v1.GetMachineStatusRequest",[]),Qc=s.makeMessageType("viam.robot.v1.GetMachineStatusResponse",()=>[{no:1,name:"resources",kind:"message",T:el,repeated:!0},{no:2,name:"config",kind:"message",T:al},{no:3,name:"state",kind:"enum",T:s.getEnumType(Zc)}]),Zc=s.makeEnum("viam.robot.v1.GetMachineStatusResponse.State",[{no:0,name:"STATE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"STATE_INITIALIZING",localName:"INITIALIZING"},{no:2,name:"STATE_RUNNING",localName:"RUNNING"}]),el=s.makeMessageType("viam.robot.v1.ResourceStatus",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"state",kind:"enum",T:s.getEnumType(nl)},{no:3,name:"last_updated",kind:"message",T:S},{no:4,name:"revision",kind:"scalar",T:9},{no:5,name:"error",kind:"scalar",T:9},{no:6,name:"cloud_metadata",kind:"message",T:Ps,opt:!0}]),nl=s.makeEnum("viam.robot.v1.ResourceStatus.State",[{no:0,name:"STATE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"STATE_UNCONFIGURED",localName:"UNCONFIGURED"},{no:2,name:"STATE_CONFIGURING",localName:"CONFIGURING"},{no:3,name:"STATE_READY",localName:"READY"},{no:4,name:"STATE_REMOVING",localName:"REMOVING"},{no:5,name:"STATE_UNHEALTHY",localName:"UNHEALTHY"}]),al=s.makeMessageType("viam.robot.v1.ConfigStatus",()=>[{no:1,name:"revision",kind:"scalar",T:9},{no:2,name:"last_updated",kind:"message",T:S}]),tl=s.makeMessageType("viam.robot.v1.GetVersionRequest",[]),sl=s.makeMessageType("viam.robot.v1.GetVersionResponse",()=>[{no:1,name:"platform",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"api_version",kind:"scalar",T:9}]),DR=Object.freeze(Object.defineProperty({__proto__:null,BlockForOperationRequest:wc,BlockForOperationResponse:Oc,CancelOperationRequest:bc,CancelOperationResponse:Ec,ConfigStatus:al,FrameSystemConfig:uc,FrameSystemConfigRequest:gc,FrameSystemConfigResponse:Tc,GetCloudMetadataRequest:Wc,GetCloudMetadataResponse:Ps,GetMachineStatusRequest:Xc,GetMachineStatusResponse:Qc,GetMachineStatusResponse_State:Zc,GetModelsFromModulesRequest:ws,GetModelsFromModulesResponse:qc,GetOperationsRequest:Ic,GetOperationsResponse:Mc,GetSessionsRequest:Pc,GetSessionsResponse:Dc,GetStatusRequest:Uc,GetStatusResponse:Lc,GetVersionRequest:tl,GetVersionResponse:sl,ListTunnelsRequest:lc,ListTunnelsResponse:dc,LogRequest:$c,LogResponse:Vc,ModuleModel:Ac,Operation:Sc,PeerConnectionInfo:Cc,PeerConnectionType:rc,ResourceNamesRequest:vc,ResourceNamesResponse:hc,ResourceRPCSubtype:fc,ResourceRPCSubtypesRequest:Rc,ResourceRPCSubtypesResponse:_c,ResourceStatus:el,ResourceStatus_State:nl,RestartModuleRequest:Ds,RestartModuleResponse:jc,SendSessionHeartbeatRequest:Ns,SendSessionHeartbeatResponse:Yc,Session:Nc,ShutdownRequest:Hc,ShutdownResponse:Kc,StartSessionRequest:Cs,StartSessionResponse:zc,Status:Os,StopAllRequest:xc,StopAllResponse:Jc,StopExtraParameters:Fc,StreamStatusRequest:Gc,StreamStatusResponse:Bc,TransformPCDRequest:Es,TransformPCDResponse:yc,TransformPoseRequest:bs,TransformPoseResponse:kc,Tunnel:pc,TunnelRequest:mc,TunnelResponse:cc},Symbol.toStringTag,{value:"Module"})),As={typeName:"viam.robot.v1.RobotService",methods:{getOperations:{name:"GetOperations",I:Ic,O:Mc,kind:m.Unary},getSessions:{name:"GetSessions",I:Pc,O:Dc,kind:m.Unary},resourceNames:{name:"ResourceNames",I:vc,O:hc,kind:m.Unary},resourceRPCSubtypes:{name:"ResourceRPCSubtypes",I:Rc,O:_c,kind:m.Unary},cancelOperation:{name:"CancelOperation",I:bc,O:Ec,kind:m.Unary},blockForOperation:{name:"BlockForOperation",I:wc,O:Oc,kind:m.Unary},getModelsFromModules:{name:"GetModelsFromModules",I:ws,O:qc,kind:m.Unary},frameSystemConfig:{name:"FrameSystemConfig",I:gc,O:Tc,kind:m.Unary},transformPose:{name:"TransformPose",I:bs,O:kc,kind:m.Unary},transformPCD:{name:"TransformPCD",I:Es,O:yc,kind:m.Unary},getStatus:{name:"GetStatus",I:Uc,O:Lc,kind:m.Unary},streamStatus:{name:"StreamStatus",I:Gc,O:Bc,kind:m.ServerStreaming},stopAll:{name:"StopAll",I:xc,O:Jc,kind:m.Unary},startSession:{name:"StartSession",I:Cs,O:zc,kind:m.Unary},sendSessionHeartbeat:{name:"SendSessionHeartbeat",I:Ns,O:Yc,kind:m.Unary},log:{name:"Log",I:$c,O:Vc,kind:m.Unary},getCloudMetadata:{name:"GetCloudMetadata",I:Wc,O:Ps,kind:m.Unary},restartModule:{name:"RestartModule",I:Ds,O:jc,kind:m.Unary},shutdown:{name:"Shutdown",I:Hc,O:Kc,kind:m.Unary},getMachineStatus:{name:"GetMachineStatus",I:Xc,O:Qc,kind:m.Unary},getVersion:{name:"GetVersion",I:tl,O:sl,kind:m.Unary},tunnel:{name:"Tunnel",I:mc,O:cc,kind:m.BiDiStreaming},listTunnels:{name:"ListTunnels",I:lc,O:dc,kind:m.Unary}}},qs=s.makeEnum("viam.app.v1.CredentialsType",[{no:0,name:"CREDENTIALS_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"CREDENTIALS_TYPE_INTERNAL",localName:"INTERNAL"},{no:2,name:"CREDENTIALS_TYPE_API_KEY",localName:"API_KEY"},{no:3,name:"CREDENTIALS_TYPE_ROBOT_SECRET",localName:"ROBOT_SECRET"},{no:4,name:"CREDENTIALS_TYPE_ROBOT_LOCATION_SECRET",localName:"ROBOT_LOCATION_SECRET"}]),ol=s.makeMessageType("viam.app.v1.RobotConfig",()=>[{no:1,name:"cloud",kind:"message",T:ml},{no:2,name:"remotes",kind:"message",T:bl,repeated:!0},{no:3,name:"components",kind:"message",T:Us,repeated:!0},{no:4,name:"processes",kind:"message",T:cl,repeated:!0},{no:5,name:"services",kind:"message",T:ll,repeated:!0},{no:6,name:"network",kind:"message",T:dl,opt:!0},{no:7,name:"auth",kind:"message",T:gl,opt:!0},{no:8,name:"debug",kind:"scalar",T:8,opt:!0},{no:9,name:"modules",kind:"message",T:Cl,repeated:!0},{no:10,name:"disable_partial_start",kind:"scalar",T:8,opt:!0},{no:11,name:"packages",kind:"message",T:Nl,repeated:!0},{no:12,name:"overwrite_fragment_status",kind:"message",T:ga,repeated:!0},{no:13,name:"enable_web_profile",kind:"scalar",T:8},{no:14,name:"log",kind:"message",T:il,repeated:!0},{no:15,name:"revision",kind:"scalar",T:9},{no:16,name:"maintenance",kind:"message",T:Pl,opt:!0},{no:17,name:"disable_log_deduplication",kind:"scalar",T:8}]),il=s.makeMessageType("viam.app.v1.LogPatternConfig",()=>[{no:1,name:"pattern",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:9}]),rl=s.makeMessageType("viam.app.v1.LocationSecret",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"secret",kind:"scalar",T:9}]),ga=s.makeMessageType("viam.app.v1.AppValidationStatus",()=>[{no:1,name:"error",kind:"scalar",T:9}]),ml=s.makeMessageType("viam.app.v1.CloudConfig",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"fqdn",kind:"scalar",T:9},{no:3,name:"local_fqdn",kind:"scalar",T:9},{no:4,name:"managed_by",kind:"scalar",T:9},{no:5,name:"signaling_address",kind:"scalar",T:9},{no:6,name:"signaling_insecure",kind:"scalar",T:8},{no:7,name:"location_secret",kind:"scalar",T:9},{no:8,name:"secret",kind:"scalar",T:9},{no:9,name:"location_secrets",kind:"message",T:rl,repeated:!0},{no:10,name:"primary_org_id",kind:"scalar",T:9},{no:11,name:"location_id",kind:"scalar",T:9},{no:12,name:"machine_id",kind:"scalar",T:9}]),Us=s.makeMessageType("viam.app.v1.ComponentConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"namespace",kind:"scalar",T:9},{no:3,name:"type",kind:"scalar",T:9},{no:4,name:"model",kind:"scalar",T:9},{no:5,name:"frame",kind:"message",T:Ls},{no:6,name:"depends_on",kind:"scalar",T:9,repeated:!0},{no:7,name:"service_configs",kind:"message",T:Ta,repeated:!0},{no:8,name:"attributes",kind:"message",T:l},{no:9,name:"api",kind:"scalar",T:9},{no:10,name:"log_configuration",kind:"message",T:Gs}]),Ta=s.makeMessageType("viam.app.v1.ResourceLevelServiceConfig",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"attributes",kind:"message",T:l}]),cl=s.makeMessageType("viam.app.v1.ProcessConfig",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"args",kind:"scalar",T:9,repeated:!0},{no:4,name:"cwd",kind:"scalar",T:9},{no:5,name:"one_shot",kind:"scalar",T:8},{no:6,name:"log",kind:"scalar",T:8},{no:7,name:"stop_signal",kind:"scalar",T:5},{no:8,name:"stop_timeout",kind:"message",T:F},{no:9,name:"env",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:10,name:"username",kind:"scalar",T:9}]),ll=s.makeMessageType("viam.app.v1.ServiceConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"namespace",kind:"scalar",T:9},{no:3,name:"type",kind:"scalar",T:9},{no:4,name:"attributes",kind:"message",T:l},{no:5,name:"depends_on",kind:"scalar",T:9,repeated:!0},{no:6,name:"model",kind:"scalar",T:9},{no:9,name:"api",kind:"scalar",T:9},{no:10,name:"service_configs",kind:"message",T:Ta,repeated:!0},{no:11,name:"log_configuration",kind:"message",T:Gs}]),dl=s.makeMessageType("viam.app.v1.NetworkConfig",()=>[{no:1,name:"fqdn",kind:"scalar",T:9},{no:2,name:"bind_address",kind:"scalar",T:9},{no:3,name:"tls_cert_file",kind:"scalar",T:9},{no:4,name:"tls_key_file",kind:"scalar",T:9},{no:5,name:"sessions",kind:"message",T:pl},{no:6,name:"traffic_tunnel_endpoints",kind:"message",T:ul,repeated:!0},{no:7,name:"no_tls",kind:"scalar",T:8}]),pl=s.makeMessageType("viam.app.v1.SessionsConfig",()=>[{no:1,name:"heartbeat_window",kind:"message",T:F}]),ul=s.makeMessageType("viam.app.v1.TrafficTunnelEndpoint",()=>[{no:1,name:"port",kind:"scalar",T:5},{no:2,name:"connection_timeout",kind:"message",T:F}]),gl=s.makeMessageType("viam.app.v1.AuthConfig",()=>[{no:1,name:"handlers",kind:"message",T:yl,repeated:!0},{no:2,name:"tls_auth_entities",kind:"scalar",T:9,repeated:!0},{no:3,name:"external_auth_config",kind:"message",T:kl,opt:!0}]),Tl=s.makeMessageType("viam.app.v1.JWKSFile",()=>[{no:1,name:"json",kind:"message",T:l}]),kl=s.makeMessageType("viam.app.v1.ExternalAuthConfig",()=>[{no:1,name:"jwks",kind:"message",T:Tl}]),yl=s.makeMessageType("viam.app.v1.AuthHandlerConfig",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(qs)},{no:5,name:"config",kind:"message",T:l}]),Ls=s.makeMessageType("viam.app.v1.Frame",()=>[{no:1,name:"parent",kind:"scalar",T:9},{no:2,name:"translation",kind:"message",T:vl},{no:3,name:"orientation",kind:"message",T:hl},{no:4,name:"geometry",kind:"message",T:He}]),Gs=s.makeMessageType("viam.app.v1.LogConfiguration",()=>[{no:1,name:"level",kind:"scalar",T:9}]),vl=s.makeMessageType("viam.app.v1.Translation",()=>[{no:1,name:"x",kind:"scalar",T:1},{no:2,name:"y",kind:"scalar",T:1},{no:3,name:"z",kind:"scalar",T:1}]),hl=s.makeMessageType("viam.app.v1.Orientation",()=>[{no:1,name:"no_orientation",kind:"message",T:fl,oneof:"type"},{no:2,name:"vector_radians",kind:"message",T:Rl,oneof:"type"},{no:3,name:"vector_degrees",kind:"message",T:_l,oneof:"type"},{no:4,name:"euler_angles",kind:"message",T:Sl,oneof:"type"},{no:5,name:"axis_angles",kind:"message",T:Il,oneof:"type"},{no:6,name:"quaternion",kind:"message",T:Ml,oneof:"type"}]),fl=s.makeMessageType("viam.app.v1.Orientation.NoOrientation",[],{localName:"Orientation_NoOrientation"}),Rl=s.makeMessageType("viam.app.v1.Orientation.OrientationVectorRadians",()=>[{no:1,name:"theta",kind:"scalar",T:1},{no:2,name:"x",kind:"scalar",T:1},{no:3,name:"y",kind:"scalar",T:1},{no:4,name:"z",kind:"scalar",T:1}],{localName:"Orientation_OrientationVectorRadians"}),_l=s.makeMessageType("viam.app.v1.Orientation.OrientationVectorDegrees",()=>[{no:1,name:"theta",kind:"scalar",T:1},{no:2,name:"x",kind:"scalar",T:1},{no:3,name:"y",kind:"scalar",T:1},{no:4,name:"z",kind:"scalar",T:1}],{localName:"Orientation_OrientationVectorDegrees"}),Sl=s.makeMessageType("viam.app.v1.Orientation.EulerAngles",()=>[{no:1,name:"roll",kind:"scalar",T:1},{no:2,name:"pitch",kind:"scalar",T:1},{no:3,name:"yaw",kind:"scalar",T:1}],{localName:"Orientation_EulerAngles"}),Il=s.makeMessageType("viam.app.v1.Orientation.AxisAngles",()=>[{no:1,name:"theta",kind:"scalar",T:1},{no:2,name:"x",kind:"scalar",T:1},{no:3,name:"y",kind:"scalar",T:1},{no:4,name:"z",kind:"scalar",T:1}],{localName:"Orientation_AxisAngles"}),Ml=s.makeMessageType("viam.app.v1.Orientation.Quaternion",()=>[{no:1,name:"w",kind:"scalar",T:1},{no:2,name:"x",kind:"scalar",T:1},{no:3,name:"y",kind:"scalar",T:1},{no:4,name:"z",kind:"scalar",T:1}],{localName:"Orientation_Quaternion"}),bl=s.makeMessageType("viam.app.v1.RemoteConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"address",kind:"scalar",T:9},{no:3,name:"frame",kind:"message",T:Ls},{no:4,name:"auth",kind:"message",T:El},{no:5,name:"managed_by",kind:"scalar",T:9},{no:6,name:"insecure",kind:"scalar",T:8},{no:7,name:"connection_check_interval",kind:"message",T:F},{no:8,name:"reconnect_interval",kind:"message",T:F},{no:9,name:"service_configs",kind:"message",T:Ta,repeated:!0},{no:10,name:"secret",kind:"scalar",T:9}]),El=s.makeMessageType("viam.app.v1.RemoteAuth",()=>[{no:1,name:"credentials",kind:"message",T:wl},{no:2,name:"entity",kind:"scalar",T:9}]),wl=s.makeMessageType("viam.app.v1.RemoteAuth.Credentials",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(qs)},{no:2,name:"payload",kind:"scalar",T:9}],{localName:"RemoteAuth_Credentials"}),Ol=s.makeMessageType("viam.app.v1.AgentInfo",()=>[{no:1,name:"host",kind:"scalar",T:9},{no:2,name:"os",kind:"scalar",T:9},{no:3,name:"ips",kind:"scalar",T:9,repeated:!0},{no:4,name:"version",kind:"scalar",T:9},{no:5,name:"git_revision",kind:"scalar",T:9},{no:6,name:"platform",kind:"scalar",T:9,opt:!0},{no:7,name:"platform_tags",kind:"scalar",T:9,repeated:!0}]),AR=s.makeMessageType("viam.app.v1.ConfigRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"agent_info",kind:"message",T:Ol,opt:!0}]),qR=s.makeMessageType("viam.app.v1.ConfigResponse",()=>[{no:1,name:"config",kind:"message",T:ol}]),UR=s.makeMessageType("viam.app.v1.CertificateRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),LR=s.makeMessageType("viam.app.v1.CertificateResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"tls_certificate",kind:"scalar",T:9},{no:3,name:"tls_private_key",kind:"scalar",T:9}]),GR=s.makeMessageType("viam.app.v1.LogRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"logs",kind:"message",T:bn,repeated:!0}]),BR=s.makeMessageType("viam.app.v1.LogResponse",[]),FR=s.makeMessageType("viam.app.v1.NeedsRestartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),xR=s.makeMessageType("viam.app.v1.NeedsRestartResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"must_restart",kind:"scalar",T:8},{no:3,name:"restart_check_interval",kind:"message",T:F}]),Cl=s.makeMessageType("viam.app.v1.ModuleConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"path",kind:"scalar",T:9},{no:3,name:"log_level",kind:"scalar",T:9},{no:4,name:"type",kind:"scalar",T:9},{no:5,name:"module_id",kind:"scalar",T:9},{no:6,name:"env",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:7,name:"status",kind:"message",T:ga},{no:8,name:"first_run_timeout",kind:"message",T:F}]),Nl=s.makeMessageType("viam.app.v1.PackageConfig",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"package",kind:"scalar",T:9},{no:3,name:"version",kind:"scalar",T:9},{no:4,name:"type",kind:"scalar",T:9},{no:5,name:"status",kind:"message",T:ga}]),Pl=s.makeMessageType("viam.app.v1.MaintenanceConfig",()=>[{no:1,name:"sensor_name",kind:"message",T:x},{no:2,name:"maintenance_allowed_key",kind:"scalar",T:9}]),JR=Object.freeze(Object.defineProperty({__proto__:null,AgentInfo:Ol,AppValidationStatus:ga,AuthConfig:gl,AuthHandlerConfig:yl,CertificateRequest:UR,CertificateResponse:LR,CloudConfig:ml,ComponentConfig:Us,ConfigRequest:AR,ConfigResponse:qR,CredentialsType:qs,ExternalAuthConfig:kl,Frame:Ls,JWKSFile:Tl,LocationSecret:rl,LogConfiguration:Gs,LogPatternConfig:il,LogRequest:GR,LogResponse:BR,MaintenanceConfig:Pl,ModuleConfig:Cl,NeedsRestartRequest:FR,NeedsRestartResponse:xR,NetworkConfig:dl,Orientation:hl,Orientation_AxisAngles:Il,Orientation_EulerAngles:Sl,Orientation_NoOrientation:fl,Orientation_OrientationVectorDegrees:_l,Orientation_OrientationVectorRadians:Rl,Orientation_Quaternion:Ml,PackageConfig:Nl,ProcessConfig:cl,RemoteAuth:El,RemoteAuth_Credentials:wl,RemoteConfig:bl,ResourceLevelServiceConfig:Ta,RobotConfig:ol,ServiceConfig:ll,SessionsConfig:pl,TrafficTunnelEndpoint:ul,Translation:vl},Symbol.toStringTag,{value:"Module"})),Bs=s.makeMessageType("viam.service.discovery.v1.DiscoverResourcesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Dl=s.makeMessageType("viam.service.discovery.v1.DiscoverResourcesResponse",()=>[{no:1,name:"discoveries",kind:"message",T:Us,repeated:!0}]),zR=Object.freeze(Object.defineProperty({__proto__:null,DiscoverResourcesRequest:Bs,DiscoverResourcesResponse:Dl},Symbol.toStringTag,{value:"Module"})),Al={typeName:"viam.service.discovery.v1.DiscoveryService",methods:{discoverResources:{name:"DiscoverResources",I:Bs,O:Dl,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},ql=s.makeEnum("viam.service.motion.v1.PlanState",[{no:0,name:"PLAN_STATE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PLAN_STATE_IN_PROGRESS",localName:"IN_PROGRESS"},{no:2,name:"PLAN_STATE_STOPPED",localName:"STOPPED"},{no:3,name:"PLAN_STATE_SUCCEEDED",localName:"SUCCEEDED"},{no:4,name:"PLAN_STATE_FAILED",localName:"FAILED"}]),Fs=s.makeMessageType("viam.service.motion.v1.MoveRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"destination",kind:"message",T:mn},{no:3,name:"component_name",kind:"message",T:x},{no:4,name:"world_state",kind:"message",T:Rr,opt:!0},{no:5,name:"constraints",kind:"message",T:Yl,opt:!0},{no:99,name:"extra",kind:"message",T:l}]),Ul=s.makeMessageType("viam.service.motion.v1.MoveResponse",()=>[{no:1,name:"success",kind:"scalar",T:8}]),xs=s.makeMessageType("viam.service.motion.v1.MoveOnMapRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"destination",kind:"message",T:qe},{no:3,name:"component_name",kind:"message",T:x},{no:4,name:"slam_service_name",kind:"message",T:x},{no:5,name:"motion_configuration",kind:"message",T:Js,opt:!0},{no:6,name:"obstacles",kind:"message",T:He,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),Ll=s.makeMessageType("viam.service.motion.v1.MoveOnMapResponse",()=>[{no:1,name:"execution_id",kind:"scalar",T:9}]),Gl=s.makeMessageType("viam.service.motion.v1.ObstacleDetector",()=>[{no:1,name:"vision_service",kind:"message",T:x},{no:2,name:"camera",kind:"message",T:x}]),Js=s.makeMessageType("viam.service.motion.v1.MotionConfiguration",()=>[{no:1,name:"obstacle_detectors",kind:"message",T:Gl,repeated:!0},{no:2,name:"position_polling_frequency_hz",kind:"scalar",T:1,opt:!0},{no:3,name:"obstacle_polling_frequency_hz",kind:"scalar",T:1,opt:!0},{no:4,name:"plan_deviation_m",kind:"scalar",T:1,opt:!0},{no:5,name:"linear_m_per_sec",kind:"scalar",T:1,opt:!0},{no:6,name:"angular_degs_per_sec",kind:"scalar",T:1,opt:!0}]),zs=s.makeMessageType("viam.service.motion.v1.MoveOnGlobeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"destination",kind:"message",T:Je},{no:3,name:"heading",kind:"scalar",T:1,opt:!0},{no:4,name:"component_name",kind:"message",T:x},{no:5,name:"movement_sensor_name",kind:"message",T:x},{no:6,name:"obstacles",kind:"message",T:da,repeated:!0},{no:7,name:"motion_configuration",kind:"message",T:Js,opt:!0},{no:8,name:"bounding_regions",kind:"message",T:da,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),Bl=s.makeMessageType("viam.service.motion.v1.MoveOnGlobeResponse",()=>[{no:1,name:"execution_id",kind:"scalar",T:9}]),Ys=s.makeMessageType("viam.service.motion.v1.GetPoseRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:3,name:"destination_frame",kind:"scalar",T:9},{no:4,name:"supplemental_transforms",kind:"message",T:cn,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),Fl=s.makeMessageType("viam.service.motion.v1.GetPoseResponse",()=>[{no:1,name:"pose",kind:"message",T:mn}]),$s=s.makeMessageType("viam.service.motion.v1.StopPlanRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:99,name:"extra",kind:"message",T:l}]),xl=s.makeMessageType("viam.service.motion.v1.StopPlanResponse",[]),Vs=s.makeMessageType("viam.service.motion.v1.ListPlanStatusesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"only_active_plans",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:l}]),Jl=s.makeMessageType("viam.service.motion.v1.ListPlanStatusesResponse",()=>[{no:1,name:"plan_statuses_with_ids",kind:"message",T:Hl,repeated:!0}]),Ws=s.makeMessageType("viam.service.motion.v1.GetPlanRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:3,name:"last_plan_only",kind:"scalar",T:8},{no:4,name:"execution_id",kind:"scalar",T:9,opt:!0},{no:99,name:"extra",kind:"message",T:l}]),zl=s.makeMessageType("viam.service.motion.v1.GetPlanResponse",()=>[{no:1,name:"current_plan_with_status",kind:"message",T:js},{no:2,name:"replan_history",kind:"message",T:js,repeated:!0}]),Yl=s.makeMessageType("viam.service.motion.v1.Constraints",()=>[{no:1,name:"linear_constraint",kind:"message",T:$l,repeated:!0},{no:2,name:"orientation_constraint",kind:"message",T:Vl,repeated:!0},{no:3,name:"collision_specification",kind:"message",T:Wl,repeated:!0}]),$l=s.makeMessageType("viam.service.motion.v1.LinearConstraint",()=>[{no:1,name:"line_tolerance_mm",kind:"scalar",T:2,opt:!0},{no:2,name:"orientation_tolerance_degs",kind:"scalar",T:2,opt:!0}]),Vl=s.makeMessageType("viam.service.motion.v1.OrientationConstraint",()=>[{no:1,name:"orientation_tolerance_degs",kind:"scalar",T:2,opt:!0}]),Wl=s.makeMessageType("viam.service.motion.v1.CollisionSpecification",()=>[{no:1,name:"allows",kind:"message",T:jl,repeated:!0}]),jl=s.makeMessageType("viam.service.motion.v1.CollisionSpecification.AllowedFrameCollisions",()=>[{no:1,name:"frame1",kind:"scalar",T:9},{no:2,name:"frame2",kind:"scalar",T:9}],{localName:"CollisionSpecification_AllowedFrameCollisions"}),js=s.makeMessageType("viam.service.motion.v1.PlanWithStatus",()=>[{no:1,name:"plan",kind:"message",T:Kl},{no:2,name:"status",kind:"message",T:ka},{no:3,name:"status_history",kind:"message",T:ka,repeated:!0}]),Hl=s.makeMessageType("viam.service.motion.v1.PlanStatusWithID",()=>[{no:1,name:"plan_id",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:3,name:"execution_id",kind:"scalar",T:9},{no:4,name:"status",kind:"message",T:ka}]),ka=s.makeMessageType("viam.service.motion.v1.PlanStatus",()=>[{no:1,name:"state",kind:"enum",T:s.getEnumType(ql)},{no:2,name:"timestamp",kind:"message",T:S},{no:3,name:"reason",kind:"scalar",T:9,opt:!0}]),Kl=s.makeMessageType("viam.service.motion.v1.Plan",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"component_name",kind:"message",T:x},{no:3,name:"execution_id",kind:"scalar",T:9},{no:4,name:"steps",kind:"message",T:Xl,repeated:!0}]),Xl=s.makeMessageType("viam.service.motion.v1.PlanStep",()=>[{no:1,name:"step",kind:"map",K:9,V:{kind:"message",T:Ql}}]),Ql=s.makeMessageType("viam.service.motion.v1.ComponentState",()=>[{no:1,name:"pose",kind:"message",T:qe}]),Zl=Object.freeze(Object.defineProperty({__proto__:null,CollisionSpecification:Wl,CollisionSpecification_AllowedFrameCollisions:jl,ComponentState:Ql,Constraints:Yl,GetPlanRequest:Ws,GetPlanResponse:zl,GetPoseRequest:Ys,GetPoseResponse:Fl,LinearConstraint:$l,ListPlanStatusesRequest:Vs,ListPlanStatusesResponse:Jl,MotionConfiguration:Js,MoveOnGlobeRequest:zs,MoveOnGlobeResponse:Bl,MoveOnMapRequest:xs,MoveOnMapResponse:Ll,MoveRequest:Fs,MoveResponse:Ul,ObstacleDetector:Gl,OrientationConstraint:Vl,Plan:Kl,PlanState:ql,PlanStatus:ka,PlanStatusWithID:Hl,PlanStep:Xl,PlanWithStatus:js,StopPlanRequest:$s,StopPlanResponse:xl},Symbol.toStringTag,{value:"Module"})),ed={typeName:"viam.service.motion.v1.MotionService",methods:{move:{name:"Move",I:Fs,O:Ul,kind:m.Unary},moveOnMap:{name:"MoveOnMap",I:xs,O:Ll,kind:m.Unary},moveOnGlobe:{name:"MoveOnGlobe",I:zs,O:Bl,kind:m.Unary},getPose:{name:"GetPose",I:Ys,O:Fl,kind:m.Unary},stopPlan:{name:"StopPlan",I:$s,O:xl,kind:m.Unary},listPlanStatuses:{name:"ListPlanStatuses",I:Vs,O:Jl,kind:m.Unary},getPlan:{name:"GetPlan",I:Ws,O:zl,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},nd=s.makeEnum("viam.service.navigation.v1.MapType",[{no:0,name:"MAP_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MAP_TYPE_NONE",localName:"NONE"},{no:2,name:"MAP_TYPE_GPS",localName:"GPS"}]),Hs=s.makeEnum("viam.service.navigation.v1.Mode",[{no:0,name:"MODE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MODE_MANUAL",localName:"MANUAL"},{no:2,name:"MODE_WAYPOINT",localName:"WAYPOINT"},{no:3,name:"MODE_EXPLORE",localName:"EXPLORE"}]),Ks=s.makeMessageType("viam.service.navigation.v1.GetModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),ad=s.makeMessageType("viam.service.navigation.v1.GetModeResponse",()=>[{no:1,name:"mode",kind:"enum",T:s.getEnumType(Hs)}]),Xs=s.makeMessageType("viam.service.navigation.v1.SetModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mode",kind:"enum",T:s.getEnumType(Hs)},{no:99,name:"extra",kind:"message",T:l}]),td=s.makeMessageType("viam.service.navigation.v1.SetModeResponse",[]),sd=s.makeMessageType("viam.service.navigation.v1.Waypoint",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"location",kind:"message",T:Je}]),Qs=s.makeMessageType("viam.service.navigation.v1.GetLocationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),od=s.makeMessageType("viam.service.navigation.v1.GetLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Je},{no:2,name:"compass_heading",kind:"scalar",T:1}]),Zs=s.makeMessageType("viam.service.navigation.v1.GetWaypointsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),id=s.makeMessageType("viam.service.navigation.v1.GetWaypointsResponse",()=>[{no:1,name:"waypoints",kind:"message",T:sd,repeated:!0}]),eo=s.makeMessageType("viam.service.navigation.v1.AddWaypointRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"location",kind:"message",T:Je},{no:99,name:"extra",kind:"message",T:l}]),rd=s.makeMessageType("viam.service.navigation.v1.AddWaypointResponse",[]),no=s.makeMessageType("viam.service.navigation.v1.RemoveWaypointRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),md=s.makeMessageType("viam.service.navigation.v1.RemoveWaypointResponse",[]),ao=s.makeMessageType("viam.service.navigation.v1.GetObstaclesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),cd=s.makeMessageType("viam.service.navigation.v1.GetObstaclesResponse",()=>[{no:1,name:"obstacles",kind:"message",T:da,repeated:!0}]),ld=s.makeMessageType("viam.service.navigation.v1.Path",()=>[{no:1,name:"destination_waypoint_id",kind:"scalar",T:9},{no:2,name:"geopoints",kind:"message",T:Je,repeated:!0}]),to=s.makeMessageType("viam.service.navigation.v1.GetPathsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),dd=s.makeMessageType("viam.service.navigation.v1.GetPathsResponse",()=>[{no:1,name:"paths",kind:"message",T:ld,repeated:!0}]),so=s.makeMessageType("viam.service.navigation.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),pd=s.makeMessageType("viam.service.navigation.v1.GetPropertiesResponse",()=>[{no:1,name:"map_type",kind:"enum",T:s.getEnumType(nd)}]),ud=Object.freeze(Object.defineProperty({__proto__:null,AddWaypointRequest:eo,AddWaypointResponse:rd,GetLocationRequest:Qs,GetLocationResponse:od,GetModeRequest:Ks,GetModeResponse:ad,GetObstaclesRequest:ao,GetObstaclesResponse:cd,GetPathsRequest:to,GetPathsResponse:dd,GetPropertiesRequest:so,GetPropertiesResponse:pd,GetWaypointsRequest:Zs,GetWaypointsResponse:id,MapType:nd,Mode:Hs,Path:ld,RemoveWaypointRequest:no,RemoveWaypointResponse:md,SetModeRequest:Xs,SetModeResponse:td,Waypoint:sd},Symbol.toStringTag,{value:"Module"})),gd={typeName:"viam.service.navigation.v1.NavigationService",methods:{getMode:{name:"GetMode",I:Ks,O:ad,kind:m.Unary},setMode:{name:"SetMode",I:Xs,O:td,kind:m.Unary},getLocation:{name:"GetLocation",I:Qs,O:od,kind:m.Unary},getWaypoints:{name:"GetWaypoints",I:Zs,O:id,kind:m.Unary},addWaypoint:{name:"AddWaypoint",I:eo,O:rd,kind:m.Unary},removeWaypoint:{name:"RemoveWaypoint",I:no,O:md,kind:m.Unary},getObstacles:{name:"GetObstacles",I:ao,O:cd,kind:m.Unary},getPaths:{name:"GetPaths",I:to,O:dd,kind:m.Unary},getProperties:{name:"GetProperties",I:so,O:pd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},Td=s.makeEnum("viam.service.slam.v1.MappingMode",[{no:0,name:"MAPPING_MODE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MAPPING_MODE_CREATE_NEW_MAP",localName:"CREATE_NEW_MAP"},{no:2,name:"MAPPING_MODE_LOCALIZE_ONLY",localName:"LOCALIZE_ONLY"},{no:3,name:"MAPPING_MODE_UPDATE_EXISTING_MAP",localName:"UPDATE_EXISTING_MAP"}]),kd=s.makeEnum("viam.service.slam.v1.SensorType",[{no:0,name:"SENSOR_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"SENSOR_TYPE_CAMERA",localName:"CAMERA"},{no:2,name:"SENSOR_TYPE_MOVEMENT_SENSOR",localName:"MOVEMENT_SENSOR"}]),oo=s.makeMessageType("viam.service.slam.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),yd=s.makeMessageType("viam.service.slam.v1.GetPositionResponse",()=>[{no:1,name:"pose",kind:"message",T:qe}]),io=s.makeMessageType("viam.service.slam.v1.GetPointCloudMapRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"return_edited_map",kind:"scalar",T:8,opt:!0}]),vd=s.makeMessageType("viam.service.slam.v1.GetPointCloudMapResponse",()=>[{no:1,name:"point_cloud_pcd_chunk",kind:"scalar",T:12}]),ro=s.makeMessageType("viam.service.slam.v1.GetInternalStateRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),hd=s.makeMessageType("viam.service.slam.v1.GetInternalStateResponse",()=>[{no:1,name:"internal_state_chunk",kind:"scalar",T:12}]),mo=s.makeMessageType("viam.service.slam.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),fd=s.makeMessageType("viam.service.slam.v1.GetPropertiesResponse",()=>[{no:1,name:"cloud_slam",kind:"scalar",T:8},{no:2,name:"mapping_mode",kind:"enum",T:s.getEnumType(Td)},{no:3,name:"internal_state_file_type",kind:"scalar",T:9,opt:!0},{no:4,name:"sensor_info",kind:"message",T:Rd,repeated:!0}]),Rd=s.makeMessageType("viam.service.slam.v1.SensorInfo",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:s.getEnumType(kd)}]),_d=Object.freeze(Object.defineProperty({__proto__:null,GetInternalStateRequest:ro,GetInternalStateResponse:hd,GetPointCloudMapRequest:io,GetPointCloudMapResponse:vd,GetPositionRequest:oo,GetPositionResponse:yd,GetPropertiesRequest:mo,GetPropertiesResponse:fd,MappingMode:Td,SensorInfo:Rd,SensorType:kd},Symbol.toStringTag,{value:"Module"})),Sd={typeName:"viam.service.slam.v1.SLAMService",methods:{getPosition:{name:"GetPosition",I:oo,O:yd,kind:m.Unary},getPointCloudMap:{name:"GetPointCloudMap",I:io,O:vd,kind:m.ServerStreaming},getInternalState:{name:"GetInternalState",I:ro,O:hd,kind:m.ServerStreaming},getProperties:{name:"GetProperties",I:mo,O:fd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},Id=s.makeEnum("viam.component.camera.v1.Format",[{no:0,name:"FORMAT_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"FORMAT_RAW_RGBA",localName:"RAW_RGBA"},{no:2,name:"FORMAT_RAW_DEPTH",localName:"RAW_DEPTH"},{no:3,name:"FORMAT_JPEG",localName:"JPEG"},{no:4,name:"FORMAT_PNG",localName:"PNG"}]),co=s.makeMessageType("viam.component.camera.v1.GetImageRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Md=s.makeMessageType("viam.component.camera.v1.GetImageResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:12}]),bd=s.makeMessageType("viam.component.camera.v1.GetImagesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Ed=s.makeMessageType("viam.component.camera.v1.GetImagesResponse",()=>[{no:1,name:"images",kind:"message",T:lo,repeated:!0},{no:84260,name:"response_metadata",kind:"message",T:_r}]),lo=s.makeMessageType("viam.component.camera.v1.Image",()=>[{no:1,name:"source_name",kind:"scalar",T:9},{no:2,name:"format",kind:"enum",T:s.getEnumType(Id)},{no:3,name:"image",kind:"scalar",T:12}]),po=s.makeMessageType("viam.component.camera.v1.RenderFrameRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),uo=s.makeMessageType("viam.component.camera.v1.GetPointCloudRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),wd=s.makeMessageType("viam.component.camera.v1.GetPointCloudResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"point_cloud",kind:"scalar",T:12}]),Od=s.makeMessageType("viam.component.camera.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Cd=s.makeMessageType("viam.component.camera.v1.GetPropertiesResponse",()=>[{no:1,name:"supports_pcd",kind:"scalar",T:8},{no:2,name:"intrinsic_parameters",kind:"message",T:Dd},{no:3,name:"distortion_parameters",kind:"message",T:Ad},{no:4,name:"mime_types",kind:"scalar",T:9,repeated:!0},{no:5,name:"frame_rate",kind:"scalar",T:2,opt:!0}]),YR=s.makeMessageType("viam.component.camera.v1.Webcams",()=>[{no:1,name:"webcams",kind:"message",T:Nd,repeated:!0}]),Nd=s.makeMessageType("viam.component.camera.v1.Webcam",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"status",kind:"scalar",T:9},{no:3,name:"properties",kind:"message",T:Pd,repeated:!0},{no:4,name:"name",kind:"scalar",T:9},{no:5,name:"id",kind:"scalar",T:9}]),Pd=s.makeMessageType("viam.component.camera.v1.Property",()=>[{no:1,name:"width_px",kind:"scalar",T:5},{no:2,name:"height_px",kind:"scalar",T:5},{no:3,name:"frame_format",kind:"scalar",T:9},{no:4,name:"frame_rate",kind:"scalar",T:2}]),Dd=s.makeMessageType("viam.component.camera.v1.IntrinsicParameters",()=>[{no:1,name:"width_px",kind:"scalar",T:13},{no:2,name:"height_px",kind:"scalar",T:13},{no:3,name:"focal_x_px",kind:"scalar",T:1},{no:4,name:"focal_y_px",kind:"scalar",T:1},{no:5,name:"center_x_px",kind:"scalar",T:1},{no:6,name:"center_y_px",kind:"scalar",T:1}]),Ad=s.makeMessageType("viam.component.camera.v1.DistortionParameters",()=>[{no:1,name:"model",kind:"scalar",T:9},{no:2,name:"parameters",kind:"scalar",T:1,repeated:!0}]),$R=Object.freeze(Object.defineProperty({__proto__:null,DistortionParameters:Ad,Format:Id,GetImageRequest:co,GetImageResponse:Md,GetImagesRequest:bd,GetImagesResponse:Ed,GetPointCloudRequest:uo,GetPointCloudResponse:wd,GetPropertiesRequest:Od,GetPropertiesResponse:Cd,Image:lo,IntrinsicParameters:Dd,Property:Pd,RenderFrameRequest:po,Webcam:Nd,Webcams:YR},Symbol.toStringTag,{value:"Module"})),go=s.makeMessageType("viam.service.vision.v1.GetDetectionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:12},{no:3,name:"width",kind:"scalar",T:3},{no:4,name:"height",kind:"scalar",T:3},{no:5,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),qd=s.makeMessageType("viam.service.vision.v1.GetDetectionsResponse",()=>[{no:1,name:"detections",kind:"message",T:ya,repeated:!0}]),To=s.makeMessageType("viam.service.vision.v1.GetDetectionsFromCameraRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"camera_name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Ud=s.makeMessageType("viam.service.vision.v1.GetDetectionsFromCameraResponse",()=>[{no:1,name:"detections",kind:"message",T:ya,repeated:!0}]),ya=s.makeMessageType("viam.service.vision.v1.Detection",()=>[{no:1,name:"x_min",kind:"scalar",T:3,opt:!0},{no:2,name:"y_min",kind:"scalar",T:3,opt:!0},{no:3,name:"x_max",kind:"scalar",T:3,opt:!0},{no:4,name:"y_max",kind:"scalar",T:3,opt:!0},{no:5,name:"confidence",kind:"scalar",T:1},{no:6,name:"class_name",kind:"scalar",T:9},{no:7,name:"x_min_normalized",kind:"scalar",T:1,opt:!0},{no:8,name:"y_min_normalized",kind:"scalar",T:1,opt:!0},{no:9,name:"x_max_normalized",kind:"scalar",T:1,opt:!0},{no:10,name:"y_max_normalized",kind:"scalar",T:1,opt:!0}]),ko=s.makeMessageType("viam.service.vision.v1.GetClassificationsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:12},{no:3,name:"width",kind:"scalar",T:5},{no:4,name:"height",kind:"scalar",T:5},{no:5,name:"mime_type",kind:"scalar",T:9},{no:6,name:"n",kind:"scalar",T:5},{no:99,name:"extra",kind:"message",T:l}]),Ld=s.makeMessageType("viam.service.vision.v1.GetClassificationsResponse",()=>[{no:1,name:"classifications",kind:"message",T:va,repeated:!0}]),yo=s.makeMessageType("viam.service.vision.v1.GetClassificationsFromCameraRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"camera_name",kind:"scalar",T:9},{no:3,name:"n",kind:"scalar",T:5},{no:99,name:"extra",kind:"message",T:l}]),Gd=s.makeMessageType("viam.service.vision.v1.GetClassificationsFromCameraResponse",()=>[{no:1,name:"classifications",kind:"message",T:va,repeated:!0}]),va=s.makeMessageType("viam.service.vision.v1.Classification",()=>[{no:1,name:"class_name",kind:"scalar",T:9},{no:2,name:"confidence",kind:"scalar",T:1}]),vo=s.makeMessageType("viam.service.vision.v1.GetObjectPointCloudsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"camera_name",kind:"scalar",T:9},{no:3,name:"mime_type",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Bd=s.makeMessageType("viam.service.vision.v1.GetObjectPointCloudsResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"objects",kind:"message",T:ct,repeated:!0}]),ho=s.makeMessageType("viam.service.vision.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),fo=s.makeMessageType("viam.service.vision.v1.CaptureAllFromCameraRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"camera_name",kind:"scalar",T:9},{no:3,name:"return_image",kind:"scalar",T:8},{no:4,name:"return_classifications",kind:"scalar",T:8},{no:5,name:"return_detections",kind:"scalar",T:8},{no:6,name:"return_object_point_clouds",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:l}]),Fd=s.makeMessageType("viam.service.vision.v1.CaptureAllFromCameraResponse",()=>[{no:1,name:"image",kind:"message",T:lo},{no:2,name:"detections",kind:"message",T:ya,repeated:!0},{no:3,name:"classifications",kind:"message",T:va,repeated:!0},{no:4,name:"objects",kind:"message",T:ct,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),xd=s.makeMessageType("viam.service.vision.v1.GetPropertiesResponse",()=>[{no:1,name:"classifications_supported",kind:"scalar",T:8},{no:2,name:"detections_supported",kind:"scalar",T:8},{no:3,name:"object_point_clouds_supported",kind:"scalar",T:8}]),Jd=Object.freeze(Object.defineProperty({__proto__:null,CaptureAllFromCameraRequest:fo,CaptureAllFromCameraResponse:Fd,Classification:va,Detection:ya,GetClassificationsFromCameraRequest:yo,GetClassificationsFromCameraResponse:Gd,GetClassificationsRequest:ko,GetClassificationsResponse:Ld,GetDetectionsFromCameraRequest:To,GetDetectionsFromCameraResponse:Ud,GetDetectionsRequest:go,GetDetectionsResponse:qd,GetObjectPointCloudsRequest:vo,GetObjectPointCloudsResponse:Bd,GetPropertiesRequest:ho,GetPropertiesResponse:xd},Symbol.toStringTag,{value:"Module"})),zd={typeName:"viam.service.vision.v1.VisionService",methods:{getDetectionsFromCamera:{name:"GetDetectionsFromCamera",I:To,O:Ud,kind:m.Unary},getDetections:{name:"GetDetections",I:go,O:qd,kind:m.Unary},getClassificationsFromCamera:{name:"GetClassificationsFromCamera",I:yo,O:Gd,kind:m.Unary},getClassifications:{name:"GetClassifications",I:ko,O:Ld,kind:m.Unary},getObjectPointClouds:{name:"GetObjectPointClouds",I:vo,O:Bd,kind:m.Unary},getProperties:{name:"GetProperties",I:ho,O:xd,kind:m.Unary},captureAllFromCamera:{name:"CaptureAllFromCamera",I:fo,O:Fd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},VR=new Blob([`self.onmessage = function(e) {
5
5
  setTimeout(() => self.postMessage(""), e.data);
6
- };`],{type:"text/javascript"});class $R{constructor(e,n,t=1e4){this.deferredTransport=e,this.onDisconnect=n,this.heartbeatIntervalMs=t}connecting;get client(){const e=this.deferredTransport();return N(Ps,e)}heartbeat(){let e;const n=async()=>{try{await this.client.getOperations({})}catch{this.onDisconnect();return}e?e.postMessage(this.heartbeatIntervalMs):setTimeout(()=>{n().catch(console.error)},this.heartbeatIntervalMs)};if(globalThis.Worker!==void 0){const t=window.URL.createObjectURL(YR);e=new Worker(t),URL.revokeObjectURL(t),e.addEventListener("message",()=>{n().catch(console.error)})}n().catch(console.error)}async start(){this.connecting&&await this.connecting,this.connecting=new Promise((e,n)=>{(async()=>{await this.client.getOperations({})})().then(e).catch(n).finally(()=>{this.connecting=void 0})});try{await this.connecting}finally{this.connecting=void 0}this.heartbeat()}}const ha=s.makeMessageType("grpc.reflection.v1.ServerReflectionRequest",()=>[{no:1,name:"host",kind:"scalar",T:9},{no:3,name:"file_by_filename",kind:"scalar",T:9,oneof:"message_request"},{no:4,name:"file_containing_symbol",kind:"scalar",T:9,oneof:"message_request"},{no:5,name:"file_containing_extension",kind:"message",T:VR,oneof:"message_request"},{no:6,name:"all_extension_numbers_of_type",kind:"scalar",T:9,oneof:"message_request"},{no:7,name:"list_services",kind:"scalar",T:9,oneof:"message_request"}]),VR=s.makeMessageType("grpc.reflection.v1.ExtensionRequest",()=>[{no:1,name:"containing_type",kind:"scalar",T:9},{no:2,name:"extension_number",kind:"scalar",T:5}]),WR=s.makeMessageType("grpc.reflection.v1.ServerReflectionResponse",()=>[{no:1,name:"valid_host",kind:"scalar",T:9},{no:2,name:"original_request",kind:"message",T:ha},{no:4,name:"file_descriptor_response",kind:"message",T:jR,oneof:"message_response"},{no:5,name:"all_extension_numbers_response",kind:"message",T:HR,oneof:"message_response"},{no:6,name:"list_services_response",kind:"message",T:KR,oneof:"message_response"},{no:7,name:"error_response",kind:"message",T:QR,oneof:"message_response"}]),jR=s.makeMessageType("grpc.reflection.v1.FileDescriptorResponse",()=>[{no:1,name:"file_descriptor_proto",kind:"scalar",T:12,repeated:!0}]),HR=s.makeMessageType("grpc.reflection.v1.ExtensionNumberResponse",()=>[{no:1,name:"base_type_name",kind:"scalar",T:9},{no:2,name:"extension_number",kind:"scalar",T:5,repeated:!0}]),KR=s.makeMessageType("grpc.reflection.v1.ListServiceResponse",()=>[{no:1,name:"service",kind:"message",T:XR,repeated:!0}]),XR=s.makeMessageType("grpc.reflection.v1.ServiceResponse",()=>[{no:1,name:"name",kind:"scalar",T:9}]),QR=s.makeMessageType("grpc.reflection.v1.ErrorResponse",()=>[{no:1,name:"error_code",kind:"scalar",T:5},{no:2,name:"error_message",kind:"scalar",T:9}]),ZR={typeName:"grpc.reflection.v1.ServerReflection",methods:{serverReflectionInfo:{name:"ServerReflectionInfo",I:ha,O:WR,kind:m.BiDiStreaming}}};class e1{constructor(e,n){this.deferredTransport=e,this.sessionManager=n}async getSessionMetadata(){try{return await this.sessionManager.getSessionMetadata()}catch(e){throw e instanceof C&&e.code===T.Code.InvalidArgument&&e.message==="SESSION_EXPIRED"&&this.sessionManager.reset(),e}}async unary(e,n,t,o,i,r,c){const d=Mn(i),p=`/${e.typeName}/${n.name}`;if(Xe.heartbeatMonitoredMethods[p]??!1){const k=await this.getSessionMetadata();for(const[R,I]of k)d.set(R,I)}return this.deferredTransport().unary(e,n,t,o,d,r,c)}async stream(e,n,t,o,i,r,c){const d=Mn(i),p=`/${e.typeName}/${n.name}`;if(Xe.heartbeatMonitoredMethods[p]??!1){const k=await this.getSessionMetadata();for(const[R,I]of k)d.set(R,I)}return this.deferredTransport().stream(e,n,t,o,d,r,c)}}const n1=new Blob([`self.onmessage = function(e) {
6
+ };`],{type:"text/javascript"});class WR{constructor(e,n,t=1e4){this.deferredTransport=e,this.onDisconnect=n,this.heartbeatIntervalMs=t}connecting;get client(){const e=this.deferredTransport();return N(As,e)}heartbeat(){let e;const n=async()=>{try{await this.client.getOperations({})}catch{this.onDisconnect();return}e?e.postMessage(this.heartbeatIntervalMs):setTimeout(()=>{n().catch(console.error)},this.heartbeatIntervalMs)};if(globalThis.Worker!==void 0){const t=window.URL.createObjectURL(VR);e=new Worker(t),URL.revokeObjectURL(t),e.addEventListener("message",()=>{n().catch(console.error)})}n().catch(console.error)}async start(){this.connecting&&await this.connecting,this.connecting=new Promise((e,n)=>{(async()=>{await this.client.getOperations({})})().then(e).catch(n).finally(()=>{this.connecting=void 0})});try{await this.connecting}finally{this.connecting=void 0}this.heartbeat()}}const ha=s.makeMessageType("grpc.reflection.v1.ServerReflectionRequest",()=>[{no:1,name:"host",kind:"scalar",T:9},{no:3,name:"file_by_filename",kind:"scalar",T:9,oneof:"message_request"},{no:4,name:"file_containing_symbol",kind:"scalar",T:9,oneof:"message_request"},{no:5,name:"file_containing_extension",kind:"message",T:jR,oneof:"message_request"},{no:6,name:"all_extension_numbers_of_type",kind:"scalar",T:9,oneof:"message_request"},{no:7,name:"list_services",kind:"scalar",T:9,oneof:"message_request"}]),jR=s.makeMessageType("grpc.reflection.v1.ExtensionRequest",()=>[{no:1,name:"containing_type",kind:"scalar",T:9},{no:2,name:"extension_number",kind:"scalar",T:5}]),HR=s.makeMessageType("grpc.reflection.v1.ServerReflectionResponse",()=>[{no:1,name:"valid_host",kind:"scalar",T:9},{no:2,name:"original_request",kind:"message",T:ha},{no:4,name:"file_descriptor_response",kind:"message",T:KR,oneof:"message_response"},{no:5,name:"all_extension_numbers_response",kind:"message",T:XR,oneof:"message_response"},{no:6,name:"list_services_response",kind:"message",T:QR,oneof:"message_response"},{no:7,name:"error_response",kind:"message",T:e1,oneof:"message_response"}]),KR=s.makeMessageType("grpc.reflection.v1.FileDescriptorResponse",()=>[{no:1,name:"file_descriptor_proto",kind:"scalar",T:12,repeated:!0}]),XR=s.makeMessageType("grpc.reflection.v1.ExtensionNumberResponse",()=>[{no:1,name:"base_type_name",kind:"scalar",T:9},{no:2,name:"extension_number",kind:"scalar",T:5,repeated:!0}]),QR=s.makeMessageType("grpc.reflection.v1.ListServiceResponse",()=>[{no:1,name:"service",kind:"message",T:ZR,repeated:!0}]),ZR=s.makeMessageType("grpc.reflection.v1.ServiceResponse",()=>[{no:1,name:"name",kind:"scalar",T:9}]),e1=s.makeMessageType("grpc.reflection.v1.ErrorResponse",()=>[{no:1,name:"error_code",kind:"scalar",T:5},{no:2,name:"error_message",kind:"scalar",T:9}]),n1={typeName:"grpc.reflection.v1.ServerReflection",methods:{serverReflectionInfo:{name:"ServerReflectionInfo",I:ha,O:HR,kind:m.BiDiStreaming}}};class a1{constructor(e,n){this.deferredTransport=e,this.sessionManager=n}async getSessionMetadata(){try{return await this.sessionManager.getSessionMetadata()}catch(e){throw e instanceof C&&e.code===T.Code.InvalidArgument&&e.message==="SESSION_EXPIRED"&&this.sessionManager.reset(),e}}async unary(e,n,t,o,i,r,c){const d=Mn(i),p=`/${e.typeName}/${n.name}`;if(Xe.heartbeatMonitoredMethods[p]??!1){const k=await this.getSessionMetadata();for(const[R,I]of k)d.set(R,I)}return this.deferredTransport().unary(e,n,t,o,d,r,c)}async stream(e,n,t,o,i,r,c){const d=Mn(i),p=`/${e.typeName}/${n.name}`;if(Xe.heartbeatMonitoredMethods[p]??!1){const k=await this.getSessionMetadata();for(const[R,I]of k)d.set(R,I)}return this.deferredTransport().stream(e,n,t,o,d,r,c)}}const t1=new Blob([`self.onmessage = function(e) {
7
7
  setTimeout(() => self.postMessage(""), e.data);
8
- };`],{type:"text/javascript"});class Xe{constructor(e,n){this.deferredTransport=n,this.host=e,this.transport=new e1(this.deferredTransport,this)}static heartbeatMonitoredMethods={};transport;currentSessionID="";sessionsSupported;heartbeatIntervalMs;host="";starting;get client(){const e=this.deferredTransport();return aa(Ps,e)}get sessionID(){return this.currentSessionID}getSessionMetadataInner(){const e=new Headers;return this.sessionsSupported&&this.currentSessionID!==""&&e.set("viam-sid",this.currentSessionID),e}reset(){this.starting||(this.sessionsSupported=void 0)}backgroundHeartbeat=!0;async heartbeat(){if(!this.sessionsSupported||this.currentSessionID==="")return;for(;this.starting;)await this.starting;let e;const n=async()=>{const t=new Os({id:this.currentSessionID});try{await this.client.sendSessionHeartbeat(t)}catch(o){if(o instanceof C&&o.code===T.Code.Unimplemented){console.error("sessions unsupported; will not try again"),this.sessionsSupported=!1;return}if(o instanceof le||o instanceof C&&o.rawMessage==="closed"){this.reset();return}}e?e.postMessage(this.heartbeatIntervalMs):setTimeout(()=>{n().catch(console.error)},this.heartbeatIntervalMs)};if(this.backgroundHeartbeat&&globalThis.Worker!==void 0){const t=window.URL.createObjectURL(n1);e=new Worker(t),URL.revokeObjectURL(t),e.addEventListener("message",()=>{n().catch(console.error)})}n().catch(console.error)}async getSessionMetadata(){for(;this.starting;)await this.starting;return this.sessionsSupported!==void 0?this.getSessionMetadataInner():(this.starting=new Promise((e,n)=>{(async()=>{const t=new ws;this.currentSessionID!==""&&(t.resume=this.currentSessionID);let o;try{o=await this.client.startSession(t)}catch(r){if(r instanceof C&&r.code===T.Code.Unimplemented){console.error("sessions unsupported; will not try again"),this.sessionsSupported=!1;return}throw r}const{heartbeatWindow:i}=o;if(!i)throw new Error("expected heartbeat window in response to start session");this.sessionsSupported=!0,this.currentSessionID=o.id,this.heartbeatIntervalMs=(Number(i.seconds)*1e3+i.nanos/1e6)/5,await this.applyHeartbeatMonitoredMethods(),e(),this.heartbeat().catch(console.error)})().then(e).catch(n).finally(()=>{this.starting=void 0})}),await this.starting,this.getSessionMetadataInner())}async applyHeartbeatMonitoredMethods(){try{const e=aa(ZR,this.transport),n=new ha({host:this.host,messageRequest:{case:"listServices",value:""}}),t=e.serverReflectionInfo(Fa([n]),{timeoutMs:1e4});for await(const o of t){const i=o.messageResponse.value.service.map(c=>new ha({messageRequest:{case:"fileContainingSymbol",value:c.name}})),r=e.serverReflectionInfo(Fa(i),{timeoutMs:1e4});for await(const c of r)for(const d of c.messageResponse.value.fileDescriptorProto){const p=se.fromBinary(d);for(const k of p.service)for(const R of k.method)Xe.heartbeatMonitoredMethods[`/${p.package}.${k.name}/${R.name}`]=Xe.hasHeartbeatOption(R.options)}}}catch{Xe.heartbeatMonitoredMethods={"/viam.component.arm.v1.ArmService/MoveToPosition":!0,"/viam.component.arm.v1.ArmService/MoveToJointPositions":!0,"/viam.component.arm.v1.ArmService/MoveThroughJointPositions":!0,"/viam.component.base.v1.BaseService/MoveStraight":!0,"/viam.component.base.v1.BaseService/Spin":!0,"/viam.component.base.v1.BaseService/SetPower":!0,"/viam.component.base.v1.BaseService/SetVelocity":!0,"/viam.component.gantry.v1.GantryService/MoveToPosition":!0,"/viam.component.gripper.v1.GripperService/Open":!0,"/viam.component.gripper.v1.GripperService/Grab":!0,"/viam.component.motor.v1.MotorService/SetPower":!0,"/viam.component.motor.v1.MotorService/GoFor":!0,"/viam.component.motor.v1.MotorService/GoTo":!0,"/viam.component.motor.v1.MotorService/SetRPM":!0,"/viam.component.servo.v1.ServoService/Move":!0}}}static hasHeartbeatOption(e){if(!e)return!1;const n=new li(e.toBinary());for(;n.pos<n.len;){const t=n.tag(),[o]=t;if(o===Sr.field.no)return!0;n.string()}return!1}}const a1=s.makeEnum("viam.service.mlmodel.v1.LabelType",[{no:0,name:"LABEL_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"LABEL_TYPE_TENSOR_VALUE",localName:"TENSOR_VALUE"},{no:2,name:"LABEL_TYPE_TENSOR_AXIS",localName:"TENSOR_AXIS"}]),Yd=s.makeMessageType("viam.service.mlmodel.v1.InferRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:3,name:"input_tensors",kind:"message",T:Wd},{no:99,name:"extra",kind:"message",T:l}]),t1=s.makeMessageType("viam.service.mlmodel.v1.InferResponse",()=>[{no:3,name:"output_tensors",kind:"message",T:Wd}]),$d=s.makeMessageType("viam.service.mlmodel.v1.MetadataRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),s1=s.makeMessageType("viam.service.mlmodel.v1.MetadataResponse",()=>[{no:1,name:"metadata",kind:"message",T:o1}]),o1=s.makeMessageType("viam.service.mlmodel.v1.Metadata",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"description",kind:"scalar",T:9},{no:4,name:"input_info",kind:"message",T:Vd,repeated:!0},{no:5,name:"output_info",kind:"message",T:Vd,repeated:!0}]),Vd=s.makeMessageType("viam.service.mlmodel.v1.TensorInfo",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9},{no:3,name:"data_type",kind:"scalar",T:9},{no:4,name:"shape",kind:"scalar",T:5,repeated:!0},{no:5,name:"associated_files",kind:"message",T:i1,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),i1=s.makeMessageType("viam.service.mlmodel.v1.File",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9},{no:3,name:"label_type",kind:"enum",T:s.getEnumType(a1)}]),r1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt8",()=>[{no:1,name:"data",kind:"scalar",T:12}]),m1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt8",()=>[{no:1,name:"data",kind:"scalar",T:12}]),c1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt16",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),l1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt16",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),d1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt32",()=>[{no:1,name:"data",kind:"scalar",T:15,repeated:!0}]),p1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt32",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),u1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt64",()=>[{no:1,name:"data",kind:"scalar",T:16,repeated:!0}]),g1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt64",()=>[{no:1,name:"data",kind:"scalar",T:6,repeated:!0}]),T1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataFloat",()=>[{no:1,name:"data",kind:"scalar",T:2,repeated:!0}]),k1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataDouble",()=>[{no:1,name:"data",kind:"scalar",T:1,repeated:!0}]),y1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensor",()=>[{no:1,name:"shape",kind:"scalar",T:6,repeated:!0},{no:2,name:"int8_tensor",kind:"message",T:r1,oneof:"tensor"},{no:3,name:"uint8_tensor",kind:"message",T:m1,oneof:"tensor"},{no:4,name:"int16_tensor",kind:"message",T:c1,oneof:"tensor"},{no:5,name:"uint16_tensor",kind:"message",T:l1,oneof:"tensor"},{no:6,name:"int32_tensor",kind:"message",T:d1,oneof:"tensor"},{no:7,name:"uint32_tensor",kind:"message",T:p1,oneof:"tensor"},{no:8,name:"int64_tensor",kind:"message",T:u1,oneof:"tensor"},{no:9,name:"uint64_tensor",kind:"message",T:g1,oneof:"tensor"},{no:10,name:"float_tensor",kind:"message",T:T1,oneof:"tensor"},{no:11,name:"double_tensor",kind:"message",T:k1,oneof:"tensor"}]),Wd=s.makeMessageType("viam.service.mlmodel.v1.FlatTensors",()=>[{no:1,name:"tensors",kind:"map",K:9,V:{kind:"message",T:y1}}]),jd={typeName:"viam.service.mlmodel.v1.MLModelService",methods:{infer:{name:"Infer",I:Yd,O:t1,kind:m.Unary},metadata:{name:"Metadata",I:$d,O:s1,kind:m.Unary}}};class D extends Ir{serviceHost;webrtcOptions;directOptions;sessionOptions;gRPCConnectionManager;sessionManager;peerConn;transport;connecting;connectResolve;savedCreds;closed;robotServiceClient;armServiceClient;baseServiceClient;boardServiceClient;encoderServiceClient;gantryServiceClient;genericServiceClient;gripperServiceClient;mlModelServiceClient;movementSensorServiceClient;powerSensorServiceClient;inputControllerServiceClient;motorServiceClient;navigationServiceClient;discoveryServiceClient;motionServiceClient;visionServiceClient;servoServiceClient;slamServiceClient;constructor(e,n,t,o){super(),this.serviceHost=e,this.webrtcOptions=n,this.directOptions=o,this.sessionOptions=t,this.gRPCConnectionManager=new $R(()=>{if(!this.transport)throw new Error(D.notConnectedYetStr);return this.transport},()=>{this.onDisconnect()}),this.sessionManager=new Xe(this.serviceHost,()=>{if(!this.transport)throw new Error(D.notConnectedYetStr);return this.transport});for(const i of Object.values(ne))this.on(i,()=>{this.emit("connectionstatechange",{eventType:i})});this.closed=!1}onDisconnect(e){if(this.emit(ne.DISCONNECTED,e??{}),this.noReconnect!==void 0&&this.noReconnect||this.closed)return;console.debug("Connection closed, will try to reconnect");const n={retry:(t,o)=>(console.debug(`Failed to connect, attempt ${o} with backoff`,t),!0)};this.reconnectMaxWait!==void 0&&(n.maxDelay=this.reconnectMaxWait),this.reconnectMaxAttempts!==void 0&&(n.numOfAttempts=this.reconnectMaxAttempts),Qa(async()=>this.connect(),n).then(()=>{console.debug("Reconnected successfully!")}).catch(()=>{console.debug(`Reached max attempts: ${this.reconnectMaxAttempts}`)})}get noReconnect(){return this.webrtcOptions?.noReconnect??this.directOptions?.noReconnect}get reconnectMaxAttempts(){return this.webrtcOptions?.reconnectMaxAttempts??this.directOptions?.reconnectMaxAttempts}get reconnectMaxWait(){return this.webrtcOptions?.reconnectMaxWait??this.directOptions?.reconnectMaxWait}get sessionId(){return this.sessionManager.sessionID}static notConnectedYetStr="not connected yet";get robotService(){if(!this.robotServiceClient)throw new Error(D.notConnectedYetStr);return this.robotServiceClient}get armService(){if(!this.armServiceClient)throw new Error(D.notConnectedYetStr);return this.armServiceClient}get baseService(){if(!this.baseServiceClient)throw new Error(D.notConnectedYetStr);return this.baseServiceClient}get boardService(){if(!this.boardServiceClient)throw new Error(D.notConnectedYetStr);return this.boardServiceClient}get encoderService(){if(!this.encoderServiceClient)throw new Error(D.notConnectedYetStr);return this.encoderServiceClient}get gantryService(){if(!this.gantryServiceClient)throw new Error(D.notConnectedYetStr);return this.gantryServiceClient}get genericService(){if(!this.genericServiceClient)throw new Error(D.notConnectedYetStr);return this.genericServiceClient}get gripperService(){if(!this.gripperServiceClient)throw new Error(D.notConnectedYetStr);return this.gripperServiceClient}get mlModelService(){if(!this.mlModelServiceClient)throw new Error(D.notConnectedYetStr);return this.mlModelServiceClient}get movementSensorService(){if(!this.movementSensorServiceClient)throw new Error(D.notConnectedYetStr);return this.movementSensorServiceClient}get powerSensorService(){if(!this.powerSensorServiceClient)throw new Error(D.notConnectedYetStr);return this.powerSensorServiceClient}get inputControllerService(){if(!this.inputControllerServiceClient)throw new Error(D.notConnectedYetStr);return this.inputControllerServiceClient}get motorService(){if(!this.motorServiceClient)throw new Error(D.notConnectedYetStr);return this.motorServiceClient}get navigationService(){if(!this.navigationServiceClient)throw new Error(D.notConnectedYetStr);return this.navigationServiceClient}get discoveryService(){if(!this.discoveryServiceClient)throw new Error(D.notConnectedYetStr);return this.discoveryServiceClient}get motionService(){if(!this.motionServiceClient)throw new Error(D.notConnectedYetStr);return this.motionServiceClient}get visionService(){if(!this.visionServiceClient)throw new Error(D.notConnectedYetStr);return this.visionServiceClient}get servoService(){if(!this.servoServiceClient)throw new Error(D.notConnectedYetStr);return this.servoServiceClient}get slamService(){if(!this.slamServiceClient)throw new Error(D.notConnectedYetStr);return this.slamServiceClient}createServiceClient(e){const n=this.sessionOptions?.disabled?this.transport:this.sessionManager.transport;if(!n)throw new Error(D.notConnectedYetStr);return N(e,n)}get peerConnection(){return this.peerConn}async disconnect(){for(this.emit(ne.DISCONNECTING,{});this.connecting;)await this.connecting;this.peerConn&&(this.peerConn.close(),this.peerConn=void 0),this.sessionManager.reset(),this.closed=!0,this.emit(ne.DISCONNECTED,{})}isConnected(){return this.peerConn?.iceConnectionState==="connected"}async connect({creds:e=this.savedCreds,priority:n,dialTimeout:t}={}){if(this.emit(ne.CONNECTING,{}),this.closed=!1,this.connecting){for(;this.connecting!==void 0;)await this.connecting;return}this.connecting=new Promise(o=>{this.connectResolve=o}),this.peerConn&&(this.peerConn.close(),this.peerConn=void 0),this.sessionManager.reset();try{const o={webrtcOptions:{disableTrickleICE:!1,rtcConfig:this.webrtcOptions?.rtcConfig},dialTimeout:t??pt,extraHeaders:dt};if(e&&(En(e)?o.credentials=e:o.accessToken=e.payload),n!==void 0&&o.webrtcOptions&&(o.webrtcOptions.additionalSdpFields={"x-priority":n}),this.savedCreds=e,this.webrtcOptions?.enabled){o.webrtcOptions&&(o.webrtcOptions.signalingCredentials=o.credentials);const r=await lR(this.webrtcOptions.signalingAddress||this.serviceHost,this.webrtcOptions.host,o);this.peerConn=r.peerConnection,this.peerConn.addEventListener("iceconnectionstatechange",()=>{this.peerConn?.iceConnectionState==="connected"?this.emit(ne.CONNECTED,{}):this.peerConn?.iceConnectionState==="closed"&&this.onDisconnect()}),r.dataChannel.addEventListener("close",c=>{this.onDisconnect(c)}),this.transport=r.transport,r.peerConnection.addEventListener("track",c=>{const[d]=c.streams;if(!d)throw this.emit("track",c),new Error("expected event stream to exist");const p=d.id.replaceAll("+",":");Object.defineProperty(d,"id",{value:p}),this.emit("track",c)})}else this.transport=await In(this.serviceHost,o),await this.gRPCConnectionManager.start();const i=this.sessionOptions?.disabled?this.transport:this.sessionManager.transport;this.robotServiceClient=N(Ps,i),this.armServiceClient=N(qr,i),this.baseServiceClient=N(Yr,i),this.boardServiceClient=N(sm,i),this.encoderServiceClient=N(cm,i),this.gantryServiceClient=N(km,i),this.genericServiceClient=N(Vt,i),this.gripperServiceClient=N(Rm,i),this.mlModelServiceClient=N(jd,i),this.movementSensorServiceClient=N(Xm,i),this.powerSensorServiceClient=N(nc,i),this.inputControllerServiceClient=N(Cm,i),this.motorServiceClient=N(xm,i),this.navigationServiceClient=N(gd,i),this.motionServiceClient=N(ed,i),this.visionServiceClient=N(zd,i),this.servoServiceClient=N(ic,i),this.slamServiceClient=N(Sd,i),this.discoveryServiceClient=N(Al,i),this.emit(ne.CONNECTED,{})}catch(o){throw this.emit(ne.DISCONNECTED,{}),o}finally{this.connectResolve?.(),this.connectResolve=void 0,this.connecting=void 0}}async getSessions(){return(await this.robotService.getSessions({})).sessions}async getOperations(){return(await this.robotService.getOperations({})).operations}async cancelOperation(e){await this.robotService.cancelOperation({id:e})}async blockForOperation(e){await this.robotService.blockForOperation({id:e})}async stopAll(){await this.robotService.stopAll({})}async frameSystemConfig(e){return(await this.robotService.frameSystemConfig({supplementalTransforms:e})).frameSystemConfigs}async transformPose(e,n,t){const o=new Is({source:e,destination:n,supplementalTransforms:t}),r=(await this.robotService.transformPose(o)).pose;if(!r)throw new Error("no pose");return r}async transformPCD(e,n,t){const o=new Ms({pointCloudPcd:e,source:n,destination:t});return(await this.robotService.transformPCD(o)).pointCloudPcd}async getModelsFromModules(){const e=new bs({});return(await this.robotService.getModelsFromModules(e)).models}async getCloudMetadata(){return this.robotService.getCloudMetadata({})}async resourceNames(){return(await this.robotService.resourceNames({})).resources}async resourceRPCSubtypes(){return(await this.robotService.resourceRPCSubtypes({})).resourceRpcSubtypes}async getMachineStatus(){return this.robotService.getMachineStatus({})}async getVersion(){return this.robotService.getVersion({})}async restartModule(e,n){const t=new Ns;e!==void 0&&(t.idOrName.case="moduleId",t.idOrName.value=e),n!==void 0&&(t.idOrName.case="moduleName",t.idOrName.value=n),await this.robotService.restartModule(t)}}const Hd=a=>!!(a>0&&Number.isInteger(a)),v1=a=>a.includes("local"),Kd=async a=>{if(console.debug("dialing via gRPC..."),!v1(a.host))throw new Error(`cannot dial "${a.host}" directly, please use a local url instead.`);const e={noReconnect:a.noReconnect,reconnectMaxWait:a.reconnectMaxWait,reconnectMaxAttempts:a.reconnectMaxAttempts};let n;a.disableSessions&&(n={disabled:!0});const t=new D(a.host,void 0,n,e);return await t.connect({creds:a.credentials,dialTimeout:a.dialTimeout??pt}),console.debug("connected via gRPC"),t},Xd=async a=>{console.debug("dialing via WebRTC...");const e=a.serviceHost??a.host,{signalingAddress:n}=a,o={iceServers:a.iceServers??[]},i={enabled:!0,host:a.host,signalingAddress:n,rtcConfig:o,noReconnect:a.noReconnect,reconnectMaxWait:a.reconnectMaxWait,reconnectMaxAttempts:a.reconnectMaxAttempts};let r;a.disableSessions&&(r={disabled:!0});const c=new D(e,i,r);return await c.connect({priority:a.priority,dialTimeout:a.dialTimeout??pt,creds:a.credentials}),console.debug("connected via WebRTC"),c},h1=a=>{const e=a;return typeof e.signalingAddress!="string"?!1:!e.iceServers||Array.isArray(e.iceServers)},Qd=async a=>{f1(a);const e={retry:(n,t)=>(console.debug(`Failed to connect, attempt ${t} with backoff`,n),!a.reconnectAbortSignal?.abort)};if(a.reconnectMaxWait!==void 0&&(e.maxDelay=a.reconnectMaxWait),a.reconnectMaxAttempts!==void 0&&(e.numOfAttempts=a.reconnectMaxAttempts),h1(a)&&!a.reconnectAbortSignal?.abort)try{return a.noReconnect?await Xd(a):await Qa(async()=>Xd(a),e)}catch{console.debug("Failed to connect via WebRTC")}if(!a.reconnectAbortSignal?.abort)try{return a.noReconnect?await Kd(a):await Qa(async()=>Kd(a),e)}catch{console.debug("Failed to connect via gRPC")}throw new Error("Failed to connect to robot")},f1=a=>{if(a.credentials&&En(a.credentials))try{a.credentials.authEntity=new URL(a.credentials.authEntity).host}catch(e){if(!(e instanceof TypeError))throw e}if(a.reconnectMaxAttempts!==void 0&&!Hd(a.reconnectMaxAttempts))throw new Error(`Value of max reconnect attempts (${a.reconnectMaxAttempts}) should be a positive integer`);if(a.reconnectMaxWait!==void 0&&!Hd(a.reconnectMaxWait))throw new Error(`Value of max reconnect wait (${a.reconnectMaxWait}) should be a positive integer`)},ze=s.makeEnum("viam.app.mltraining.v1.ModelType",[{no:0,name:"MODEL_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MODEL_TYPE_SINGLE_LABEL_CLASSIFICATION",localName:"SINGLE_LABEL_CLASSIFICATION"},{no:2,name:"MODEL_TYPE_MULTI_LABEL_CLASSIFICATION",localName:"MULTI_LABEL_CLASSIFICATION"},{no:3,name:"MODEL_TYPE_OBJECT_DETECTION",localName:"OBJECT_DETECTION"}]),Qe=s.makeEnum("viam.app.mltraining.v1.ModelFramework",[{no:0,name:"MODEL_FRAMEWORK_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MODEL_FRAMEWORK_TFLITE",localName:"TFLITE"},{no:2,name:"MODEL_FRAMEWORK_TENSORFLOW",localName:"TENSORFLOW"},{no:3,name:"MODEL_FRAMEWORK_PYTORCH",localName:"PYTORCH"},{no:4,name:"MODEL_FRAMEWORK_ONNX",localName:"ONNX"}]),fa=s.makeEnum("viam.app.mltraining.v1.TrainingStatus",[{no:0,name:"TRAINING_STATUS_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"TRAINING_STATUS_PENDING",localName:"PENDING"},{no:2,name:"TRAINING_STATUS_IN_PROGRESS",localName:"IN_PROGRESS"},{no:3,name:"TRAINING_STATUS_COMPLETED",localName:"COMPLETED"},{no:4,name:"TRAINING_STATUS_FAILED",localName:"FAILED"},{no:5,name:"TRAINING_STATUS_CANCELED",localName:"CANCELED"},{no:6,name:"TRAINING_STATUS_CANCELING",localName:"CANCELING"}]),Zd=s.makeMessageType("viam.app.mltraining.v1.SubmitTrainingJobRequest",()=>[{no:7,name:"dataset_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"model_name",kind:"scalar",T:9},{no:4,name:"model_version",kind:"scalar",T:9},{no:5,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:8,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)},{no:6,name:"tags",kind:"scalar",T:9,repeated:!0}]),ep=s.makeMessageType("viam.app.mltraining.v1.SubmitTrainingJobResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),np=s.makeMessageType("viam.app.mltraining.v1.SubmitCustomTrainingJobRequest",()=>[{no:1,name:"dataset_id",kind:"scalar",T:9},{no:2,name:"registry_item_id",kind:"scalar",T:9},{no:6,name:"registry_item_version",kind:"scalar",T:9},{no:3,name:"organization_id",kind:"scalar",T:9},{no:4,name:"model_name",kind:"scalar",T:9},{no:5,name:"model_version",kind:"scalar",T:9},{no:7,name:"arguments",kind:"map",K:9,V:{kind:"scalar",T:9}}]),ap=s.makeMessageType("viam.app.mltraining.v1.SubmitCustomTrainingJobResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),tp=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),sp=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobResponse",()=>[{no:1,name:"metadata",kind:"message",T:ho}]),op=s.makeMessageType("viam.app.mltraining.v1.ListTrainingJobsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"status",kind:"enum",T:s.getEnumType(fa)}]),ip=s.makeMessageType("viam.app.mltraining.v1.ListTrainingJobsResponse",()=>[{no:1,name:"jobs",kind:"message",T:ho,repeated:!0}]),ho=s.makeMessageType("viam.app.mltraining.v1.TrainingJobMetadata",()=>[{no:7,name:"id",kind:"scalar",T:9},{no:11,name:"dataset_id",kind:"scalar",T:9},{no:12,name:"organization_id",kind:"scalar",T:9},{no:13,name:"model_name",kind:"scalar",T:9},{no:14,name:"model_version",kind:"scalar",T:9},{no:15,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:17,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)},{no:18,name:"is_custom_job",kind:"scalar",T:8},{no:19,name:"registry_item_id",kind:"scalar",T:9},{no:20,name:"registry_item_version",kind:"scalar",T:9},{no:2,name:"status",kind:"enum",T:s.getEnumType(fa)},{no:8,name:"error_status",kind:"message",T:on},{no:3,name:"created_on",kind:"message",T:S},{no:4,name:"last_modified",kind:"message",T:S},{no:9,name:"training_started",kind:"message",T:S},{no:10,name:"training_ended",kind:"message",T:S},{no:5,name:"synced_model_id",kind:"scalar",T:9},{no:16,name:"tags",kind:"scalar",T:9,repeated:!0}]),rp=s.makeMessageType("viam.app.mltraining.v1.CancelTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),mp=s.makeMessageType("viam.app.mltraining.v1.CancelTrainingJobResponse",[]),cp=s.makeMessageType("viam.app.mltraining.v1.DeleteCompletedTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),lp=s.makeMessageType("viam.app.mltraining.v1.DeleteCompletedTrainingJobResponse",[]),dp=s.makeMessageType("viam.app.mltraining.v1.TrainingJobLogEntry",()=>[{no:1,name:"level",kind:"scalar",T:9},{no:2,name:"time",kind:"message",T:S},{no:3,name:"message",kind:"scalar",T:9}]),pp=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobLogsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"page_token",kind:"scalar",T:9,opt:!0}]),up=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:dp,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),R1=Object.freeze(Object.defineProperty({__proto__:null,CancelTrainingJobRequest:rp,CancelTrainingJobResponse:mp,DeleteCompletedTrainingJobRequest:cp,DeleteCompletedTrainingJobResponse:lp,GetTrainingJobLogsRequest:pp,GetTrainingJobLogsResponse:up,GetTrainingJobRequest:tp,GetTrainingJobResponse:sp,ListTrainingJobsRequest:op,ListTrainingJobsResponse:ip,ModelFramework:Qe,ModelType:ze,SubmitCustomTrainingJobRequest:np,SubmitCustomTrainingJobResponse:ap,SubmitTrainingJobRequest:Zd,SubmitTrainingJobResponse:ep,TrainingJobLogEntry:dp,TrainingJobMetadata:ho,TrainingStatus:fa},Symbol.toStringTag,{value:"Module"})),Ra=s.makeEnum("viam.app.packages.v1.PackageType",[{no:0,name:"PACKAGE_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PACKAGE_TYPE_ARCHIVE",localName:"ARCHIVE"},{no:2,name:"PACKAGE_TYPE_ML_MODEL",localName:"ML_MODEL"},{no:3,name:"PACKAGE_TYPE_MODULE",localName:"MODULE"},{no:4,name:"PACKAGE_TYPE_SLAM_MAP",localName:"SLAM_MAP"},{no:5,name:"PACKAGE_TYPE_ML_TRAINING",localName:"ML_TRAINING"}]),gp=s.makeEnum("viam.app.v1.AuthenticationType",[{no:0,name:"AUTHENTICATION_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"AUTHENTICATION_TYPE_WEB_OAUTH",localName:"WEB_OAUTH"},{no:2,name:"AUTHENTICATION_TYPE_API_KEY",localName:"API_KEY"},{no:3,name:"AUTHENTICATION_TYPE_ROBOT_PART_SECRET",localName:"ROBOT_PART_SECRET"},{no:4,name:"AUTHENTICATION_TYPE_LOCATION_SECRET",localName:"LOCATION_SECRET"}]),On=s.makeEnum("viam.app.v1.FragmentVisibility",[{no:0,name:"FRAGMENT_VISIBILITY_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"FRAGMENT_VISIBILITY_PRIVATE",localName:"PRIVATE"},{no:2,name:"FRAGMENT_VISIBILITY_PUBLIC",localName:"PUBLIC"},{no:3,name:"FRAGMENT_VISIBILITY_PUBLIC_UNLISTED",localName:"PUBLIC_UNLISTED"}]),Tp=s.makeEnum("viam.app.v1.FragmentErrorType",[{no:0,name:"FRAGMENT_ERROR_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"FRAGMENT_ERROR_TYPE_NO_ACCESS",localName:"NO_ACCESS"},{no:2,name:"FRAGMENT_ERROR_TYPE_NESTING_LIMIT_EXCEEDED",localName:"NESTING_LIMIT_EXCEEDED"},{no:3,name:"FRAGMENT_ERROR_TYPE_CHILD_ID_INVALID",localName:"CHILD_ID_INVALID"},{no:4,name:"FRAGMENT_ERROR_TYPE_CYCLE_DETECTED",localName:"CYCLE_DETECTED"}]),kp=s.makeEnum("viam.app.v1.RegistryItemStatus",[{no:0,name:"REGISTRY_ITEM_STATUS_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"REGISTRY_ITEM_STATUS_PUBLISHED",localName:"PUBLISHED"},{no:2,name:"REGISTRY_ITEM_STATUS_IN_DEVELOPMENT",localName:"IN_DEVELOPMENT"}]),ln=s.makeEnum("viam.app.v1.Visibility",[{no:0,name:"VISIBILITY_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"VISIBILITY_PRIVATE",localName:"PRIVATE"},{no:2,name:"VISIBILITY_PUBLIC",localName:"PUBLIC"},{no:3,name:"VISIBILITY_PUBLIC_UNLISTED",localName:"PUBLIC_UNLISTED"}]),yp=s.makeEnum("viam.app.v1.ClientAuthentication",[{no:0,name:"CLIENT_AUTHENTICATION_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"CLIENT_AUTHENTICATION_REQUIRED",localName:"REQUIRED"},{no:2,name:"CLIENT_AUTHENTICATION_NOT_REQUIRED",localName:"NOT_REQUIRED"},{no:3,name:"CLIENT_AUTHENTICATION_NOT_REQUIRED_WHEN_USING_PKCE",localName:"NOT_REQUIRED_WHEN_USING_PKCE"}]),vp=s.makeEnum("viam.app.v1.PKCE",[{no:0,name:"PKCE_UNSPECIFIED"},{no:1,name:"PKCE_REQUIRED"},{no:2,name:"PKCE_NOT_REQUIRED"},{no:3,name:"PKCE_NOT_REQUIRED_WHEN_USING_CLIENT_AUTHENTICATION"}]),hp=s.makeEnum("viam.app.v1.URLValidation",[{no:0,name:"URL_VALIDATION_UNSPECIFIED"},{no:1,name:"URL_VALIDATION_EXACT_MATCH"},{no:2,name:"URL_VALIDATION_ALLOW_WILDCARDS"}]),fp=s.makeEnum("viam.app.v1.EnabledGrant",[{no:0,name:"ENABLED_GRANT_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"ENABLED_GRANT_AUTHORIZATION_CODE",localName:"AUTHORIZATION_CODE"},{no:2,name:"ENABLED_GRANT_IMPLICIT",localName:"IMPLICIT"},{no:3,name:"ENABLED_GRANT_PASSWORD",localName:"PASSWORD"},{no:4,name:"ENABLED_GRANT_REFRESH_TOKEN",localName:"REFRESH_TOKEN"},{no:5,name:"ENABLED_GRANT_DEVICE_CODE",localName:"DEVICE_CODE"}]),_a=s.makeMessageType("viam.app.v1.Robot",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"location",kind:"scalar",T:9},{no:4,name:"last_access",kind:"message",T:S},{no:5,name:"created_on",kind:"message",T:S}]),dn=s.makeMessageType("viam.app.v1.RobotPart",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:10,name:"dns_name",kind:"scalar",T:9},{no:3,name:"secret",kind:"scalar",T:9},{no:4,name:"robot",kind:"scalar",T:9},{no:12,name:"location_id",kind:"scalar",T:9},{no:5,name:"robot_config",kind:"message",T:l},{no:6,name:"last_access",kind:"message",T:S},{no:7,name:"user_supplied_info",kind:"message",T:l},{no:8,name:"main_part",kind:"scalar",T:8},{no:9,name:"fqdn",kind:"scalar",T:9},{no:11,name:"local_fqdn",kind:"scalar",T:9},{no:13,name:"created_on",kind:"message",T:S},{no:14,name:"secrets",kind:"message",T:_o,repeated:!0},{no:15,name:"last_updated",kind:"message",T:S}]),Rp=s.makeMessageType("viam.app.v1.RobotPartHistoryEntry",()=>[{no:1,name:"part",kind:"scalar",T:9},{no:2,name:"robot",kind:"scalar",T:9},{no:3,name:"when",kind:"message",T:S},{no:4,name:"old",kind:"message",T:dn},{no:5,name:"edited_by",kind:"message",T:fo}]),fo=s.makeMessageType("viam.app.v1.AuthenticatorInfo",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(gp)},{no:2,name:"value",kind:"scalar",T:9},{no:3,name:"is_deactivated",kind:"scalar",T:8}]),_p=s.makeMessageType("viam.app.v1.ListOrganizationsRequest",[]),pn=s.makeMessageType("viam.app.v1.Organization",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"created_on",kind:"message",T:S},{no:4,name:"public_namespace",kind:"scalar",T:9},{no:5,name:"default_region",kind:"scalar",T:9},{no:6,name:"cid",kind:"scalar",T:9,opt:!0}]),Sp=s.makeMessageType("viam.app.v1.OrganizationMember",()=>[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"emails",kind:"scalar",T:9,repeated:!0},{no:3,name:"date_added",kind:"message",T:S},{no:4,name:"last_login",kind:"message",T:S,opt:!0}]),Ip=s.makeMessageType("viam.app.v1.ListOrganizationsResponse",()=>[{no:1,name:"organizations",kind:"message",T:pn,repeated:!0}]),Cn=s.makeMessageType("viam.app.v1.OrganizationInvite",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9},{no:3,name:"created_on",kind:"message",T:S},{no:4,name:"authorizations",kind:"message",T:Q,repeated:!0}]),Mp=s.makeMessageType("viam.app.v1.CreateOrganizationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),bp=s.makeMessageType("viam.app.v1.CreateOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:pn}]),Ep=s.makeMessageType("viam.app.v1.GetOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),wp=s.makeMessageType("viam.app.v1.GetOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:pn}]),Op=s.makeMessageType("viam.app.v1.GetOrganizationNamespaceAvailabilityRequest",()=>[{no:1,name:"public_namespace",kind:"scalar",T:9}]),Cp=s.makeMessageType("viam.app.v1.GetOrganizationNamespaceAvailabilityResponse",()=>[{no:1,name:"available",kind:"scalar",T:8}]),Np=s.makeMessageType("viam.app.v1.UpdateOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9,opt:!0},{no:3,name:"public_namespace",kind:"scalar",T:9,opt:!0},{no:4,name:"region",kind:"scalar",T:9,opt:!0},{no:5,name:"cid",kind:"scalar",T:9,opt:!0}]),Pp=s.makeMessageType("viam.app.v1.UpdateOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:pn}]),Dp=s.makeMessageType("viam.app.v1.UpdateOrganizationNamespaceRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"new_public_namespace",kind:"scalar",T:9}]),Ap=s.makeMessageType("viam.app.v1.UpdateOrganizationNamespaceResponse",()=>[{no:1,name:"organization",kind:"message",T:pn}]),qp=s.makeMessageType("viam.app.v1.DeleteOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Up=s.makeMessageType("viam.app.v1.DeleteOrganizationResponse",[]),Lp=s.makeMessageType("viam.app.v1.GetOrganizationMetadataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Gp=s.makeMessageType("viam.app.v1.GetOrganizationMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:l}]),Bp=s.makeMessageType("viam.app.v1.UpdateOrganizationMetadataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:l}]),Fp=s.makeMessageType("viam.app.v1.UpdateOrganizationMetadataResponse",[]),xp=s.makeMessageType("viam.app.v1.ListOrganizationMembersRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Jp=s.makeMessageType("viam.app.v1.ListOrganizationMembersResponse",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"members",kind:"message",T:Sp,repeated:!0},{no:3,name:"invites",kind:"message",T:Cn,repeated:!0}]),zp=s.makeMessageType("viam.app.v1.CreateOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9},{no:3,name:"authorizations",kind:"message",T:Q,repeated:!0},{no:4,name:"send_email_invite",kind:"scalar",T:8,opt:!0}]),Yp=s.makeMessageType("viam.app.v1.CreateOrganizationInviteResponse",()=>[{no:1,name:"invite",kind:"message",T:Cn}]),$p=s.makeMessageType("viam.app.v1.UpdateOrganizationInviteAuthorizationsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9},{no:3,name:"add_authorizations",kind:"message",T:Q,repeated:!0},{no:4,name:"remove_authorizations",kind:"message",T:Q,repeated:!0}]),Vp=s.makeMessageType("viam.app.v1.UpdateOrganizationInviteAuthorizationsResponse",()=>[{no:1,name:"invite",kind:"message",T:Cn}]),Wp=s.makeMessageType("viam.app.v1.DeleteOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),jp=s.makeMessageType("viam.app.v1.DeleteOrganizationInviteResponse",[]),Hp=s.makeMessageType("viam.app.v1.ResendOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),Kp=s.makeMessageType("viam.app.v1.ResendOrganizationInviteResponse",()=>[{no:1,name:"invite",kind:"message",T:Cn}]),Xp=s.makeMessageType("viam.app.v1.DeleteOrganizationMemberRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9}]),Qp=s.makeMessageType("viam.app.v1.DeleteOrganizationMemberResponse",[]),Sa=s.makeMessageType("viam.app.v1.BillingAddress",()=>[{no:1,name:"address_line_1",kind:"scalar",T:9},{no:2,name:"address_line_2",kind:"scalar",T:9,opt:!0},{no:3,name:"city",kind:"scalar",T:9},{no:4,name:"state",kind:"scalar",T:9},{no:5,name:"zipcode",kind:"scalar",T:9},{no:6,name:"country",kind:"scalar",T:9}]),Zp=s.makeMessageType("viam.app.v1.EnableBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"billing_address",kind:"message",T:Sa}]),eu=s.makeMessageType("viam.app.v1.EnableBillingServiceResponse",[]),nu=s.makeMessageType("viam.app.v1.UpdateBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"billing_address",kind:"message",T:Sa}]),au=s.makeMessageType("viam.app.v1.UpdateBillingServiceResponse",[]),tu=s.makeMessageType("viam.app.v1.GetBillingServiceConfigRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),su=s.makeMessageType("viam.app.v1.GetBillingServiceConfigResponse",()=>[{no:1,name:"billing_address",kind:"message",T:Sa},{no:2,name:"support_email",kind:"scalar",T:9},{no:3,name:"logo_url",kind:"scalar",T:9},{no:4,name:"billing_dashboard_url",kind:"scalar",T:9}]),ou=s.makeMessageType("viam.app.v1.DisableBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),iu=s.makeMessageType("viam.app.v1.DisableBillingServiceResponse",[]),ru=s.makeMessageType("viam.app.v1.OrganizationSetSupportEmailRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),mu=s.makeMessageType("viam.app.v1.OrganizationSetSupportEmailResponse",[]),cu=s.makeMessageType("viam.app.v1.OrganizationGetSupportEmailRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),lu=s.makeMessageType("viam.app.v1.OrganizationGetSupportEmailResponse",()=>[{no:1,name:"email",kind:"scalar",T:9}]),Ro=s.makeMessageType("viam.app.v1.OrganizationIdentity",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),du=s.makeMessageType("viam.app.v1.LocationOrganization",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"primary",kind:"scalar",T:8}]),Ia=s.makeMessageType("viam.app.v1.LocationAuth",()=>[{no:1,name:"secret",kind:"scalar",T:9},{no:2,name:"location_id",kind:"scalar",T:9},{no:3,name:"secrets",kind:"message",T:_o,repeated:!0}]),pu=s.makeMessageType("viam.app.v1.StorageConfig",()=>[{no:1,name:"region",kind:"scalar",T:9}]),Nn=s.makeMessageType("viam.app.v1.Location",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:4,name:"parent_location_id",kind:"scalar",T:9},{no:5,name:"auth",kind:"message",T:Ia},{no:6,name:"organizations",kind:"message",T:du,repeated:!0},{no:3,name:"created_on",kind:"message",T:S},{no:7,name:"robot_count",kind:"scalar",T:5},{no:8,name:"config",kind:"message",T:pu},{no:9,name:"primary_org_identity",kind:"message",T:Ro,opt:!0}]),_o=s.makeMessageType("viam.app.v1.SharedSecret",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"secret",kind:"scalar",T:9},{no:3,name:"created_on",kind:"message",T:S},{no:4,name:"state",kind:"enum",T:s.getEnumType(So)}]),So=s.makeEnum("viam.app.v1.SharedSecret.State",[{no:0,name:"STATE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"STATE_ENABLED",localName:"ENABLED"},{no:2,name:"STATE_DISABLED",localName:"DISABLED"}]),uu=s.makeMessageType("viam.app.v1.CreateLocationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"parent_location_id",kind:"scalar",T:9,opt:!0}]),gu=s.makeMessageType("viam.app.v1.CreateLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Nn}]),Tu=s.makeMessageType("viam.app.v1.GetLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),ku=s.makeMessageType("viam.app.v1.GetLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Nn}]),yu=s.makeMessageType("viam.app.v1.UpdateLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9,opt:!0},{no:3,name:"parent_location_id",kind:"scalar",T:9,opt:!0},{no:4,name:"region",kind:"scalar",T:9,opt:!0}]),vu=s.makeMessageType("viam.app.v1.UpdateLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Nn}]),hu=s.makeMessageType("viam.app.v1.DeleteLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),fu=s.makeMessageType("viam.app.v1.DeleteLocationResponse",[]),Ru=s.makeMessageType("viam.app.v1.GetLocationMetadataRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),_u=s.makeMessageType("viam.app.v1.GetLocationMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:l}]),Su=s.makeMessageType("viam.app.v1.UpdateLocationMetadataRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:l}]),Iu=s.makeMessageType("viam.app.v1.UpdateLocationMetadataResponse",[]),Mu=s.makeMessageType("viam.app.v1.GetOrganizationsWithAccessToLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),bu=s.makeMessageType("viam.app.v1.GetOrganizationsWithAccessToLocationResponse",()=>[{no:1,name:"organization_identities",kind:"message",T:Ro,repeated:!0}]),Eu=s.makeMessageType("viam.app.v1.ListLocationsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),wu=s.makeMessageType("viam.app.v1.ShareLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),Ou=s.makeMessageType("viam.app.v1.ShareLocationResponse",[]),Cu=s.makeMessageType("viam.app.v1.UnshareLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),Nu=s.makeMessageType("viam.app.v1.UnshareLocationResponse",[]),Pu=s.makeMessageType("viam.app.v1.ListLocationsResponse",()=>[{no:1,name:"locations",kind:"message",T:Nn,repeated:!0}]),Du=s.makeMessageType("viam.app.v1.CreateLocationSecretRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Au=s.makeMessageType("viam.app.v1.CreateLocationSecretResponse",()=>[{no:1,name:"auth",kind:"message",T:Ia}]),qu=s.makeMessageType("viam.app.v1.DeleteLocationSecretRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"secret_id",kind:"scalar",T:9}]),Uu=s.makeMessageType("viam.app.v1.DeleteLocationSecretResponse",[]),Lu=s.makeMessageType("viam.app.v1.LocationAuthRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Gu=s.makeMessageType("viam.app.v1.LocationAuthResponse",()=>[{no:1,name:"auth",kind:"message",T:Ia}]),Bu=s.makeMessageType("viam.app.v1.GetRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Fu=s.makeMessageType("viam.app.v1.GetRoverRentalRobotsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),xu=s.makeMessageType("viam.app.v1.RoverRentalRobot",()=>[{no:1,name:"robot_id",kind:"scalar",T:9},{no:2,name:"location_id",kind:"scalar",T:9},{no:3,name:"robot_name",kind:"scalar",T:9},{no:4,name:"robot_main_part_id",kind:"scalar",T:9}]),Ju=s.makeMessageType("viam.app.v1.GetRoverRentalRobotsResponse",()=>[{no:1,name:"robots",kind:"message",T:xu,repeated:!0}]),zu=s.makeMessageType("viam.app.v1.GetRobotResponse",()=>[{no:1,name:"robot",kind:"message",T:_a}]),Yu=s.makeMessageType("viam.app.v1.GetRobotPartsRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9}]),$u=s.makeMessageType("viam.app.v1.GetRobotPartsResponse",()=>[{no:1,name:"parts",kind:"message",T:dn,repeated:!0}]),Vu=s.makeMessageType("viam.app.v1.GetRobotPartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Wu=s.makeMessageType("viam.app.v1.GetRobotPartResponse",()=>[{no:1,name:"part",kind:"message",T:dn},{no:2,name:"config_json",kind:"scalar",T:9}]),ju=s.makeMessageType("viam.app.v1.GetRobotPartLogsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"errors_only",kind:"scalar",T:8},{no:3,name:"filter",kind:"scalar",T:9,opt:!0},{no:4,name:"page_token",kind:"scalar",T:9,opt:!0},{no:5,name:"levels",kind:"scalar",T:9,repeated:!0},{no:6,name:"start",kind:"message",T:S,opt:!0},{no:7,name:"end",kind:"message",T:S,opt:!0},{no:8,name:"limit",kind:"scalar",T:3,opt:!0},{no:9,name:"source",kind:"scalar",T:9,opt:!0}]),Hu=s.makeMessageType("viam.app.v1.GetRobotPartLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:bn,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),Ku=s.makeMessageType("viam.app.v1.TailRobotPartLogsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"errors_only",kind:"scalar",T:8},{no:3,name:"filter",kind:"scalar",T:9,opt:!0}]),Xu=s.makeMessageType("viam.app.v1.TailRobotPartLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:bn,repeated:!0}]),Qu=s.makeMessageType("viam.app.v1.GetRobotPartHistoryRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Zu=s.makeMessageType("viam.app.v1.GetRobotPartHistoryResponse",()=>[{no:1,name:"history",kind:"message",T:Rp,repeated:!0}]),eg=s.makeMessageType("viam.app.v1.UpdateRobotPartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"robot_config",kind:"message",T:l},{no:4,name:"last_known_update",kind:"message",T:S,opt:!0}]),ng=s.makeMessageType("viam.app.v1.UpdateRobotPartResponse",()=>[{no:1,name:"part",kind:"message",T:dn}]),ag=s.makeMessageType("viam.app.v1.NewRobotPartRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9},{no:2,name:"part_name",kind:"scalar",T:9}]),tg=s.makeMessageType("viam.app.v1.NewRobotPartResponse",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),sg=s.makeMessageType("viam.app.v1.DeleteRobotPartRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),og=s.makeMessageType("viam.app.v1.GetRobotPartMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),ig=s.makeMessageType("viam.app.v1.GetRobotPartMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:l}]),rg=s.makeMessageType("viam.app.v1.UpdateRobotPartMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:l}]),mg=s.makeMessageType("viam.app.v1.UpdateRobotPartMetadataResponse",[]),cg=s.makeMessageType("viam.app.v1.GetRobotAPIKeysRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9}]),lg=s.makeMessageType("viam.app.v1.APIKey",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"created_on",kind:"message",T:S}]),dg=s.makeMessageType("viam.app.v1.GetRobotAPIKeysResponse",()=>[{no:1,name:"api_keys",kind:"message",T:Co,repeated:!0}]),pg=s.makeMessageType("viam.app.v1.DeleteRobotPartResponse",[]),Ye=s.makeMessageType("viam.app.v1.Fragment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"fragment",kind:"message",T:l},{no:4,name:"organization_owner",kind:"scalar",T:9},{no:5,name:"public",kind:"scalar",T:8},{no:6,name:"created_on",kind:"message",T:S},{no:7,name:"organization_name",kind:"scalar",T:9},{no:9,name:"robot_part_count",kind:"scalar",T:5},{no:10,name:"organization_count",kind:"scalar",T:5},{no:11,name:"only_used_by_owner",kind:"scalar",T:8},{no:12,name:"visibility",kind:"enum",T:s.getEnumType(On)},{no:13,name:"last_updated",kind:"message",T:S},{no:14,name:"revision",kind:"scalar",T:9}]),ug=s.makeMessageType("viam.app.v1.FragmentHistoryEntry",()=>[{no:1,name:"fragment",kind:"scalar",T:9},{no:2,name:"edited_on",kind:"message",T:S},{no:3,name:"old",kind:"message",T:Ye},{no:4,name:"edited_by",kind:"message",T:fo},{no:5,name:"revision",kind:"scalar",T:9},{no:6,name:"config",kind:"message",T:l}]),gg=s.makeMessageType("viam.app.v1.FragmentRevision",()=>[{no:1,name:"revision",kind:"scalar",T:9},{no:2,name:"created_at",kind:"message",T:S}]),Ma=s.makeMessageType("viam.app.v1.FragmentTag",()=>[{no:1,name:"tag",kind:"scalar",T:9},{no:2,name:"revision",kind:"scalar",T:9}]),Tg=s.makeMessageType("viam.app.v1.FragmentError",()=>[{no:1,name:"error_type",kind:"enum",T:s.getEnumType(Tp)},{no:2,name:"fragment_id",kind:"scalar",T:9},{no:3,name:"detail",kind:"scalar",T:9}]),ba=s.makeMessageType("viam.app.v1.FragmentUsage",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"organizations",kind:"scalar",T:5},{no:3,name:"machines",kind:"scalar",T:5},{no:4,name:"machines_in_current_org",kind:"scalar",T:5},{no:5,name:"version",kind:"scalar",T:9,opt:!0}]),Io=s.makeMessageType("viam.app.v1.ResolvedFragment",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"resolved_config",kind:"message",T:l},{no:3,name:"error",kind:"message",T:Tg},{no:4,name:"revision",kind:"scalar",T:9}]),kg=s.makeMessageType("viam.app.v1.ListFragmentsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"show_public",kind:"scalar",T:8},{no:3,name:"fragment_visibility",kind:"enum",T:s.getEnumType(On),repeated:!0}]),yg=s.makeMessageType("viam.app.v1.ListFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"fragment_usages",kind:"message",T:ba,repeated:!0}]),vg=s.makeMessageType("viam.app.v1.GetFragmentRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"current_organization_id",kind:"scalar",T:9},{no:3,name:"version",kind:"scalar",T:9,opt:!0}]),hg=s.makeMessageType("viam.app.v1.GetFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye},{no:2,name:"fragment_usage",kind:"message",T:ba},{no:3,name:"revisions",kind:"message",T:gg,repeated:!0},{no:4,name:"tags",kind:"message",T:Ma,repeated:!0}]),fg=s.makeMessageType("viam.app.v1.CreateFragmentRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"config",kind:"message",T:l},{no:3,name:"organization_id",kind:"scalar",T:9},{no:4,name:"visibility",kind:"enum",T:s.getEnumType(On),opt:!0}]),Rg=s.makeMessageType("viam.app.v1.CreateFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye}]),_g=s.makeMessageType("viam.app.v1.UpdateFragmentRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"config",kind:"message",T:l},{no:4,name:"public",kind:"scalar",T:8,opt:!0},{no:5,name:"visibility",kind:"enum",T:s.getEnumType(On),opt:!0},{no:6,name:"last_known_update",kind:"message",T:S,opt:!0}]),Sg=s.makeMessageType("viam.app.v1.UpdateFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye}]),Ig=s.makeMessageType("viam.app.v1.DeleteFragmentRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Mg=s.makeMessageType("viam.app.v1.DeleteFragmentResponse",[]),bg=s.makeMessageType("viam.app.v1.GetFragmentHistoryRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"page_token",kind:"scalar",T:9,opt:!0},{no:3,name:"page_limit",kind:"scalar",T:3,opt:!0}]),Eg=s.makeMessageType("viam.app.v1.GetFragmentHistoryResponse",()=>[{no:1,name:"history",kind:"message",T:ug,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),wg=s.makeMessageType("viam.app.v1.GetFragmentUsageRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9}]),Og=s.makeMessageType("viam.app.v1.GetFragmentUsageResponse",()=>[{no:1,name:"version_usages",kind:"message",T:ba,repeated:!0}]),Cg=s.makeMessageType("viam.app.v1.SetFragmentTagRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"tag",kind:"scalar",T:9},{no:3,name:"revision",kind:"scalar",T:9}]),Ng=s.makeMessageType("viam.app.v1.SetFragmentTagResponse",()=>[{no:1,name:"tags",kind:"message",T:Ma,repeated:!0}]),Pg=s.makeMessageType("viam.app.v1.DeleteFragmentTagRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"tag",kind:"scalar",T:9}]),Dg=s.makeMessageType("viam.app.v1.DeleteFragmentTagResponse",()=>[{no:1,name:"tags",kind:"message",T:Ma,repeated:!0}]),Ag=s.makeMessageType("viam.app.v1.ListRobotsRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Mo=s.makeMessageType("viam.app.v1.AdditionalFragment",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9,opt:!0}]),qg=s.makeMessageType("viam.app.v1.ListNestedFragmentsRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9,opt:!0},{no:2,name:"additional_fragments",kind:"message",T:Mo,repeated:!0}]),Ug=s.makeMessageType("viam.app.v1.ListNestedFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"resolved_fragments",kind:"message",T:Io,repeated:!0}]),Lg=s.makeMessageType("viam.app.v1.ListMachineFragmentsRequest",()=>[{no:1,name:"machine_id",kind:"scalar",T:9},{no:2,name:"additional_fragment_ids",kind:"scalar",T:9,repeated:!0},{no:3,name:"additional_fragments",kind:"message",T:Mo,repeated:!0}]),Gg=s.makeMessageType("viam.app.v1.ListMachineFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"resolved_fragments",kind:"message",T:Io,repeated:!0}]),Bg=s.makeMessageType("viam.app.v1.ListMachineSummariesRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Fg=s.makeMessageType("viam.app.v1.ListMachineSummariesResponse",()=>[{no:1,name:"location_summaries",kind:"message",T:xg,repeated:!0}]),xg=s.makeMessageType("viam.app.v1.LocationSummary",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"location_name",kind:"scalar",T:9},{no:3,name:"machine_summaries",kind:"message",T:Jg,repeated:!0}]),Jg=s.makeMessageType("viam.app.v1.MachineSummary",()=>[{no:1,name:"machine_id",kind:"scalar",T:9},{no:2,name:"machine_name",kind:"scalar",T:9},{no:3,name:"part_summaries",kind:"message",T:Vg,repeated:!0}]),zg=s.makeMessageType("viam.app.v1.FragmentSummary",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9}]),Yg=s.makeMessageType("viam.app.v1.ViamServerVersion",()=>[{no:1,name:"major",kind:"scalar",T:9,oneof:"version"},{no:2,name:"minor",kind:"scalar",T:9,oneof:"version"}]),$g=s.makeMessageType("viam.app.v1.ViamAgentVersion",()=>[{no:1,name:"major",kind:"scalar",T:9,oneof:"version"},{no:2,name:"minor",kind:"scalar",T:9,oneof:"version"}]),Vg=s.makeMessageType("viam.app.v1.PartSummary",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"part_name",kind:"scalar",T:9},{no:3,name:"last_online",kind:"message",T:S,opt:!0},{no:4,name:"viam_server_version",kind:"message",T:Yg,opt:!0},{no:5,name:"viam_agent_version",kind:"message",T:$g,opt:!0},{no:6,name:"os",kind:"scalar",T:9,opt:!0},{no:7,name:"platform",kind:"scalar",T:9,opt:!0},{no:8,name:"public_ip_address",kind:"scalar",T:9,opt:!0},{no:9,name:"fragments",kind:"message",T:zg,repeated:!0}]),Wg=s.makeMessageType("viam.app.v1.ListRobotsResponse",()=>[{no:1,name:"robots",kind:"message",T:_a,repeated:!0}]),jg=s.makeMessageType("viam.app.v1.NewRobotRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"location",kind:"scalar",T:9}]),Hg=s.makeMessageType("viam.app.v1.NewRobotResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Kg=s.makeMessageType("viam.app.v1.UpdateRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"location",kind:"scalar",T:9}]),Xg=s.makeMessageType("viam.app.v1.UpdateRobotResponse",()=>[{no:1,name:"robot",kind:"message",T:_a}]),Qg=s.makeMessageType("viam.app.v1.DeleteRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Zg=s.makeMessageType("viam.app.v1.DeleteRobotResponse",[]),eT=s.makeMessageType("viam.app.v1.GetRobotMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),nT=s.makeMessageType("viam.app.v1.GetRobotMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:l}]),aT=s.makeMessageType("viam.app.v1.UpdateRobotMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:l}]),tT=s.makeMessageType("viam.app.v1.UpdateRobotMetadataResponse",[]),sT=s.makeMessageType("viam.app.v1.MarkPartAsMainRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),oT=s.makeMessageType("viam.app.v1.MarkPartAsMainResponse",[]),iT=s.makeMessageType("viam.app.v1.MarkPartForRestartRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),rT=s.makeMessageType("viam.app.v1.MarkPartForRestartResponse",[]),mT=s.makeMessageType("viam.app.v1.CreateRobotPartSecretRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),cT=s.makeMessageType("viam.app.v1.CreateRobotPartSecretResponse",()=>[{no:1,name:"part",kind:"message",T:dn}]),lT=s.makeMessageType("viam.app.v1.DeleteRobotPartSecretRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"secret_id",kind:"scalar",T:9}]),dT=s.makeMessageType("viam.app.v1.DeleteRobotPartSecretResponse",[]),Q=s.makeMessageType("viam.app.v1.Authorization",()=>[{no:1,name:"authorization_type",kind:"scalar",T:9},{no:2,name:"authorization_id",kind:"scalar",T:9},{no:3,name:"resource_type",kind:"scalar",T:9},{no:4,name:"resource_id",kind:"scalar",T:9},{no:5,name:"identity_id",kind:"scalar",T:9},{no:6,name:"organization_id",kind:"scalar",T:9},{no:7,name:"identity_type",kind:"scalar",T:9}]),pT=s.makeMessageType("viam.app.v1.AddRoleRequest",()=>[{no:1,name:"authorization",kind:"message",T:Q}]),uT=s.makeMessageType("viam.app.v1.AddRoleResponse",[]),gT=s.makeMessageType("viam.app.v1.RemoveRoleRequest",()=>[{no:1,name:"authorization",kind:"message",T:Q}]),TT=s.makeMessageType("viam.app.v1.RemoveRoleResponse",[]),kT=s.makeMessageType("viam.app.v1.ChangeRoleRequest",()=>[{no:1,name:"old_authorization",kind:"message",T:Q},{no:2,name:"new_authorization",kind:"message",T:Q}]),yT=s.makeMessageType("viam.app.v1.ChangeRoleResponse",[]),vT=s.makeMessageType("viam.app.v1.ListAuthorizationsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"resource_ids",kind:"scalar",T:9,repeated:!0}]),hT=s.makeMessageType("viam.app.v1.ListAuthorizationsResponse",()=>[{no:1,name:"authorizations",kind:"message",T:Q,repeated:!0}]),fT=s.makeMessageType("viam.app.v1.CheckPermissionsRequest",()=>[{no:1,name:"permissions",kind:"message",T:bo,repeated:!0}]),bo=s.makeMessageType("viam.app.v1.AuthorizedPermissions",()=>[{no:1,name:"resource_type",kind:"scalar",T:9},{no:2,name:"resource_id",kind:"scalar",T:9},{no:3,name:"permissions",kind:"scalar",T:9,repeated:!0}]),RT=s.makeMessageType("viam.app.v1.CheckPermissionsResponse",()=>[{no:1,name:"authorized_permissions",kind:"message",T:bo,repeated:!0}]),_T=s.makeMessageType("viam.app.v1.ModuleVersion",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"files",kind:"message",T:wo,repeated:!0},{no:3,name:"models",kind:"message",T:en,repeated:!0},{no:4,name:"entrypoint",kind:"scalar",T:9},{no:5,name:"first_run",kind:"scalar",T:9,opt:!0},{no:6,name:"markdown_description",kind:"scalar",T:9,opt:!0},{no:7,name:"apps",kind:"message",T:Ze,repeated:!0}]),ST=s.makeMessageType("viam.app.v1.ModuleMetadata",()=>[{no:1,name:"models",kind:"message",T:en,repeated:!0},{no:2,name:"versions",kind:"message",T:_T,repeated:!0},{no:3,name:"entrypoint",kind:"scalar",T:9},{no:4,name:"first_run",kind:"scalar",T:9,opt:!0},{no:5,name:"markdown_description",kind:"scalar",T:9,opt:!0},{no:6,name:"apps",kind:"message",T:Ze,repeated:!0}]),IT=s.makeMessageType("viam.app.v1.MLModelMetadata",()=>[{no:1,name:"versions",kind:"scalar",T:9,repeated:!0},{no:2,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:3,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)}]),MT=s.makeMessageType("viam.app.v1.MLTrainingVersion",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"created_on",kind:"message",T:S}]),bT=s.makeMessageType("viam.app.v1.MLTrainingMetadata",()=>[{no:5,name:"versions",kind:"message",T:MT,repeated:!0},{no:2,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:3,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)},{no:4,name:"draft",kind:"scalar",T:8}]),Ea=s.makeMessageType("viam.app.v1.RegistryItem",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"public_namespace",kind:"scalar",T:9},{no:4,name:"name",kind:"scalar",T:9},{no:5,name:"type",kind:"enum",T:s.getEnumType(Ra)},{no:6,name:"visibility",kind:"enum",T:s.getEnumType(ln)},{no:7,name:"url",kind:"scalar",T:9},{no:8,name:"description",kind:"scalar",T:9},{no:9,name:"total_robot_usage",kind:"scalar",T:3},{no:13,name:"total_external_robot_usage",kind:"scalar",T:3},{no:10,name:"total_organization_usage",kind:"scalar",T:3},{no:14,name:"total_external_organization_usage",kind:"scalar",T:3},{no:11,name:"module_metadata",kind:"message",T:ST,oneof:"metadata"},{no:12,name:"ml_model_metadata",kind:"message",T:IT,oneof:"metadata"},{no:18,name:"ml_training_metadata",kind:"message",T:bT,oneof:"metadata"},{no:15,name:"created_at",kind:"message",T:S},{no:16,name:"updated_at",kind:"message",T:S}]),ET=s.makeMessageType("viam.app.v1.GetRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"include_markdown_documentation",kind:"scalar",T:8,opt:!0}]),wT=s.makeMessageType("viam.app.v1.GetRegistryItemResponse",()=>[{no:1,name:"item",kind:"message",T:Ea}]),OT=s.makeMessageType("viam.app.v1.CreateRegistryItemRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:s.getEnumType(Ra)}]),CT=s.makeMessageType("viam.app.v1.CreateRegistryItemResponse",[]),NT=s.makeMessageType("viam.app.v1.UpdateRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:s.getEnumType(Ra)},{no:3,name:"description",kind:"scalar",T:9},{no:4,name:"visibility",kind:"enum",T:s.getEnumType(ln)},{no:5,name:"url",kind:"scalar",T:9,opt:!0},{no:6,name:"update_module_metadata",kind:"message",T:$T,oneof:"metadata"},{no:7,name:"update_ml_model_metadata",kind:"message",T:VT,oneof:"metadata"},{no:8,name:"update_ml_training_metadata",kind:"message",T:WT,oneof:"metadata"},{no:9,name:"markdown_description",kind:"scalar",T:9,opt:!0}]),PT=s.makeMessageType("viam.app.v1.UpdateRegistryItemResponse",[]),DT=s.makeMessageType("viam.app.v1.ListRegistryItemsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9,opt:!0},{no:2,name:"types",kind:"enum",T:s.getEnumType(Ra),repeated:!0},{no:3,name:"visibilities",kind:"enum",T:s.getEnumType(ln),repeated:!0},{no:4,name:"platforms",kind:"scalar",T:9,repeated:!0},{no:5,name:"statuses",kind:"enum",T:s.getEnumType(kp),repeated:!0},{no:6,name:"search_term",kind:"scalar",T:9,opt:!0},{no:7,name:"page_token",kind:"scalar",T:9,opt:!0},{no:8,name:"public_namespaces",kind:"scalar",T:9,repeated:!0},{no:9,name:"include_markdown_documentation",kind:"scalar",T:8,opt:!0}]),AT=s.makeMessageType("viam.app.v1.ListRegistryItemsResponse",()=>[{no:1,name:"items",kind:"message",T:Ea,repeated:!0}]),qT=s.makeMessageType("viam.app.v1.DeleteRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9}]),UT=s.makeMessageType("viam.app.v1.DeleteRegistryItemResponse",[]),LT=s.makeMessageType("viam.app.v1.RenameRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"new_name",kind:"scalar",T:9}]),GT=s.makeMessageType("viam.app.v1.RenameRegistryItemResponse",()=>[{no:1,name:"item",kind:"message",T:Ea}]),BT=s.makeMessageType("viam.app.v1.TransferRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"new_public_namespace",kind:"scalar",T:9}]),FT=s.makeMessageType("viam.app.v1.TransferRegistryItemResponse",[]),xT=s.makeMessageType("viam.app.v1.CreateModuleRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),JT=s.makeMessageType("viam.app.v1.CreateModuleResponse",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9}]),zT=s.makeMessageType("viam.app.v1.UpdateModuleRequest",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"visibility",kind:"enum",T:s.getEnumType(ln)},{no:3,name:"url",kind:"scalar",T:9},{no:4,name:"description",kind:"scalar",T:9},{no:5,name:"models",kind:"message",T:en,repeated:!0},{no:6,name:"entrypoint",kind:"scalar",T:9},{no:7,name:"first_run",kind:"scalar",T:9,opt:!0},{no:8,name:"apps",kind:"message",T:Ze,repeated:!0},{no:9,name:"markdown_description",kind:"scalar",T:9,opt:!0}]),Ze=s.makeMessageType("viam.app.v1.App",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"entrypoint",kind:"scalar",T:9}]),YT=s.makeMessageType("viam.app.v1.UpdateModuleResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),$T=s.makeMessageType("viam.app.v1.UpdateModuleMetadata",()=>[{no:1,name:"models",kind:"message",T:en,repeated:!0},{no:2,name:"entrypoint",kind:"scalar",T:9},{no:3,name:"apps",kind:"message",T:Ze,repeated:!0}]),VT=s.makeMessageType("viam.app.v1.UpdateMLModelMetadata",()=>[{no:1,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:2,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)}]),WT=s.makeMessageType("viam.app.v1.UpdateMLTrainingMetadata",()=>[{no:1,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:2,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)},{no:3,name:"draft",kind:"scalar",T:8}]),en=s.makeMessageType("viam.app.v1.Model",()=>[{no:1,name:"api",kind:"scalar",T:9},{no:2,name:"model",kind:"scalar",T:9},{no:3,name:"markdown_documentation",kind:"scalar",T:9,opt:!0},{no:4,name:"description",kind:"scalar",T:9,opt:!0},{no:5,name:"supported_hardware",kind:"scalar",T:9,repeated:!0}]),jT=s.makeMessageType("viam.app.v1.ModuleFileInfo",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"platform",kind:"scalar",T:9},{no:5,name:"platform_tags",kind:"scalar",T:9,repeated:!0}]),HT=s.makeMessageType("viam.app.v1.UploadModuleFileRequest",()=>[{no:1,name:"module_file_info",kind:"message",T:jT,oneof:"module_file"},{no:2,name:"file",kind:"scalar",T:12,oneof:"module_file"}]),KT=s.makeMessageType("viam.app.v1.UploadModuleFileResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),XT=s.makeMessageType("viam.app.v1.GetModuleRequest",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"include_markdown_documentation",kind:"scalar",T:8,opt:!0}]),QT=s.makeMessageType("viam.app.v1.GetModuleResponse",()=>[{no:1,name:"module",kind:"message",T:Eo}]),Eo=s.makeMessageType("viam.app.v1.Module",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"visibility",kind:"enum",T:s.getEnumType(ln)},{no:4,name:"versions",kind:"message",T:ZT,repeated:!0},{no:5,name:"url",kind:"scalar",T:9},{no:6,name:"description",kind:"scalar",T:9},{no:7,name:"models",kind:"message",T:en,repeated:!0},{no:8,name:"total_robot_usage",kind:"scalar",T:3},{no:9,name:"total_organization_usage",kind:"scalar",T:3},{no:10,name:"organization_id",kind:"scalar",T:9},{no:11,name:"entrypoint",kind:"scalar",T:9},{no:12,name:"public_namespace",kind:"scalar",T:9},{no:13,name:"first_run",kind:"scalar",T:9,opt:!0},{no:14,name:"markdown_description",kind:"scalar",T:9,opt:!0},{no:15,name:"apps",kind:"message",T:Ze,repeated:!0}]),ZT=s.makeMessageType("viam.app.v1.VersionHistory",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"files",kind:"message",T:wo,repeated:!0},{no:3,name:"models",kind:"message",T:en,repeated:!0},{no:4,name:"entrypoint",kind:"scalar",T:9},{no:5,name:"first_run",kind:"scalar",T:9,opt:!0},{no:6,name:"markdown_description",kind:"scalar",T:9,opt:!0},{no:7,name:"apps",kind:"message",T:Ze,repeated:!0}]),wo=s.makeMessageType("viam.app.v1.Uploads",()=>[{no:1,name:"platform",kind:"scalar",T:9},{no:2,name:"uploaded_at",kind:"message",T:S}]),ek=s.makeMessageType("viam.app.v1.ListModulesRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9,opt:!0},{no:2,name:"include_markdown_documentation",kind:"scalar",T:8,opt:!0}]),nk=s.makeMessageType("viam.app.v1.ListModulesResponse",()=>[{no:1,name:"modules",kind:"message",T:Eo,repeated:!0}]),ak=s.makeMessageType("viam.app.v1.GetUserIDByEmailRequest",()=>[{no:1,name:"email",kind:"scalar",T:9}]),tk=s.makeMessageType("viam.app.v1.GetUserIDByEmailResponse",()=>[{no:1,name:"user_id",kind:"scalar",T:9}]),sk=s.makeMessageType("viam.app.v1.ListOrganizationsByUserRequest",()=>[{no:1,name:"user_id",kind:"scalar",T:9}]),Oo=s.makeMessageType("viam.app.v1.OrgDetails",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"org_name",kind:"scalar",T:9},{no:3,name:"org_cid",kind:"scalar",T:9,opt:!0},{no:4,name:"public_namespace",kind:"scalar",T:9,opt:!0},{no:5,name:"billing_tier",kind:"scalar",T:9,opt:!0}]),ok=s.makeMessageType("viam.app.v1.ListOrganizationsByUserResponse",()=>[{no:1,name:"orgs",kind:"message",T:Oo,repeated:!0}]),ik=s.makeMessageType("viam.app.v1.SearchOrganizationsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9,opt:!0},{no:2,name:"org_name",kind:"scalar",T:9,opt:!0},{no:3,name:"cid",kind:"scalar",T:9,opt:!0},{no:4,name:"public_namespace",kind:"scalar",T:9,opt:!0}]),rk=s.makeMessageType("viam.app.v1.SearchOrganizationsResponse",()=>[{no:1,name:"organizations",kind:"message",T:Oo,repeated:!0}]),mk=s.makeMessageType("viam.app.v1.CreateKeyRequest",()=>[{no:1,name:"authorizations",kind:"message",T:Q,repeated:!0},{no:2,name:"name",kind:"scalar",T:9}]),ck=s.makeMessageType("viam.app.v1.CreateKeyResponse",()=>[{no:1,name:"key",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:9}]),lk=s.makeMessageType("viam.app.v1.DeleteKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),dk=s.makeMessageType("viam.app.v1.DeleteKeyResponse",[]),pk=s.makeMessageType("viam.app.v1.RenameKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),uk=s.makeMessageType("viam.app.v1.RenameKeyResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),gk=s.makeMessageType("viam.app.v1.AuthorizationDetails",()=>[{no:1,name:"authorization_type",kind:"scalar",T:9},{no:2,name:"authorization_id",kind:"scalar",T:9},{no:3,name:"resource_type",kind:"scalar",T:9},{no:4,name:"resource_id",kind:"scalar",T:9},{no:5,name:"org_id",kind:"scalar",T:9}]),Co=s.makeMessageType("viam.app.v1.APIKeyWithAuthorizations",()=>[{no:1,name:"api_key",kind:"message",T:lg},{no:2,name:"authorizations",kind:"message",T:gk,repeated:!0}]),Tk=s.makeMessageType("viam.app.v1.ListKeysRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),kk=s.makeMessageType("viam.app.v1.ListKeysResponse",()=>[{no:1,name:"api_keys",kind:"message",T:Co,repeated:!0}]),yk=s.makeMessageType("viam.app.v1.RotateKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),vk=s.makeMessageType("viam.app.v1.RotateKeyResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}]),hk=s.makeMessageType("viam.app.v1.CreateKeyFromExistingKeyAuthorizationsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),fk=s.makeMessageType("viam.app.v1.CreateKeyFromExistingKeyAuthorizationsResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}]),Rk=s.makeMessageType("viam.app.v1.GetAppContentRequest",()=>[{no:1,name:"public_namespace",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),_k=s.makeMessageType("viam.app.v1.GetAppContentResponse",()=>[{no:1,name:"blob_path",kind:"scalar",T:9},{no:2,name:"entrypoint",kind:"scalar",T:9}]),Sk=s.makeMessageType("viam.app.v1.OrganizationSetLogoRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"logo",kind:"scalar",T:12}]),Ik=s.makeMessageType("viam.app.v1.OrganizationSetLogoResponse",[]),Mk=s.makeMessageType("viam.app.v1.OrganizationGetLogoRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),bk=s.makeMessageType("viam.app.v1.OrganizationGetLogoResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),Ek=s.makeMessageType("viam.app.v1.EnableAuthServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),wk=s.makeMessageType("viam.app.v1.EnableAuthServiceResponse",[]),Ok=s.makeMessageType("viam.app.v1.DisableAuthServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Ck=s.makeMessageType("viam.app.v1.DisableAuthServiceResponse",[]),Nk=s.makeMessageType("viam.app.v1.CreateOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_name",kind:"scalar",T:9},{no:3,name:"oauth_config",kind:"message",T:wa}]),Pk=s.makeMessageType("viam.app.v1.CreateOAuthAppResponse",()=>[{no:1,name:"client_id",kind:"scalar",T:9},{no:2,name:"client_secret",kind:"scalar",T:9}]),Dk=s.makeMessageType("viam.app.v1.ReadOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9}]),Ak=s.makeMessageType("viam.app.v1.ReadOAuthAppResponse",()=>[{no:1,name:"client_name",kind:"scalar",T:9},{no:2,name:"client_secret",kind:"scalar",T:9},{no:3,name:"oauth_config",kind:"message",T:wa}]),qk=s.makeMessageType("viam.app.v1.UpdateOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9},{no:3,name:"client_name",kind:"scalar",T:9},{no:4,name:"oauth_config",kind:"message",T:wa}]),Uk=s.makeMessageType("viam.app.v1.UpdateOAuthAppResponse",[]),Lk=s.makeMessageType("viam.app.v1.DeleteOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9}]),Gk=s.makeMessageType("viam.app.v1.DeleteOAuthAppResponse",[]),Bk=s.makeMessageType("viam.app.v1.ListOAuthAppsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Fk=s.makeMessageType("viam.app.v1.ListOAuthAppsResponse",()=>[{no:1,name:"client_ids",kind:"scalar",T:9,repeated:!0}]),wa=s.makeMessageType("viam.app.v1.OAuthConfig",()=>[{no:1,name:"client_authentication",kind:"enum",T:s.getEnumType(yp)},{no:2,name:"pkce",kind:"enum",T:s.getEnumType(vp)},{no:3,name:"url_validation",kind:"enum",T:s.getEnumType(hp)},{no:4,name:"origin_uris",kind:"scalar",T:9,repeated:!0},{no:5,name:"redirect_uris",kind:"scalar",T:9,repeated:!0},{no:6,name:"logout_uri",kind:"scalar",T:9},{no:7,name:"enabled_grants",kind:"enum",T:s.getEnumType(fp),repeated:!0}]),_1=Object.freeze(Object.defineProperty({__proto__:null,APIKey:lg,APIKeyWithAuthorizations:Co,AddRoleRequest:pT,AddRoleResponse:uT,AdditionalFragment:Mo,App:Ze,AuthenticationType:gp,AuthenticatorInfo:fo,Authorization:Q,AuthorizationDetails:gk,AuthorizedPermissions:bo,BillingAddress:Sa,ChangeRoleRequest:kT,ChangeRoleResponse:yT,CheckPermissionsRequest:fT,CheckPermissionsResponse:RT,ClientAuthentication:yp,CreateFragmentRequest:fg,CreateFragmentResponse:Rg,CreateKeyFromExistingKeyAuthorizationsRequest:hk,CreateKeyFromExistingKeyAuthorizationsResponse:fk,CreateKeyRequest:mk,CreateKeyResponse:ck,CreateLocationRequest:uu,CreateLocationResponse:gu,CreateLocationSecretRequest:Du,CreateLocationSecretResponse:Au,CreateModuleRequest:xT,CreateModuleResponse:JT,CreateOAuthAppRequest:Nk,CreateOAuthAppResponse:Pk,CreateOrganizationInviteRequest:zp,CreateOrganizationInviteResponse:Yp,CreateOrganizationRequest:Mp,CreateOrganizationResponse:bp,CreateRegistryItemRequest:OT,CreateRegistryItemResponse:CT,CreateRobotPartSecretRequest:mT,CreateRobotPartSecretResponse:cT,DeleteFragmentRequest:Ig,DeleteFragmentResponse:Mg,DeleteFragmentTagRequest:Pg,DeleteFragmentTagResponse:Dg,DeleteKeyRequest:lk,DeleteKeyResponse:dk,DeleteLocationRequest:hu,DeleteLocationResponse:fu,DeleteLocationSecretRequest:qu,DeleteLocationSecretResponse:Uu,DeleteOAuthAppRequest:Lk,DeleteOAuthAppResponse:Gk,DeleteOrganizationInviteRequest:Wp,DeleteOrganizationInviteResponse:jp,DeleteOrganizationMemberRequest:Xp,DeleteOrganizationMemberResponse:Qp,DeleteOrganizationRequest:qp,DeleteOrganizationResponse:Up,DeleteRegistryItemRequest:qT,DeleteRegistryItemResponse:UT,DeleteRobotPartRequest:sg,DeleteRobotPartResponse:pg,DeleteRobotPartSecretRequest:lT,DeleteRobotPartSecretResponse:dT,DeleteRobotRequest:Qg,DeleteRobotResponse:Zg,DisableAuthServiceRequest:Ok,DisableAuthServiceResponse:Ck,DisableBillingServiceRequest:ou,DisableBillingServiceResponse:iu,EnableAuthServiceRequest:Ek,EnableAuthServiceResponse:wk,EnableBillingServiceRequest:Zp,EnableBillingServiceResponse:eu,EnabledGrant:fp,Fragment:Ye,FragmentError:Tg,FragmentErrorType:Tp,FragmentHistoryEntry:ug,FragmentRevision:gg,FragmentSummary:zg,FragmentTag:Ma,FragmentUsage:ba,FragmentVisibility:On,GetAppContentRequest:Rk,GetAppContentResponse:_k,GetBillingServiceConfigRequest:tu,GetBillingServiceConfigResponse:su,GetFragmentHistoryRequest:bg,GetFragmentHistoryResponse:Eg,GetFragmentRequest:vg,GetFragmentResponse:hg,GetFragmentUsageRequest:wg,GetFragmentUsageResponse:Og,GetLocationMetadataRequest:Ru,GetLocationMetadataResponse:_u,GetLocationRequest:Tu,GetLocationResponse:ku,GetModuleRequest:XT,GetModuleResponse:QT,GetOrganizationMetadataRequest:Lp,GetOrganizationMetadataResponse:Gp,GetOrganizationNamespaceAvailabilityRequest:Op,GetOrganizationNamespaceAvailabilityResponse:Cp,GetOrganizationRequest:Ep,GetOrganizationResponse:wp,GetOrganizationsWithAccessToLocationRequest:Mu,GetOrganizationsWithAccessToLocationResponse:bu,GetRegistryItemRequest:ET,GetRegistryItemResponse:wT,GetRobotAPIKeysRequest:cg,GetRobotAPIKeysResponse:dg,GetRobotMetadataRequest:eT,GetRobotMetadataResponse:nT,GetRobotPartHistoryRequest:Qu,GetRobotPartHistoryResponse:Zu,GetRobotPartLogsRequest:ju,GetRobotPartLogsResponse:Hu,GetRobotPartMetadataRequest:og,GetRobotPartMetadataResponse:ig,GetRobotPartRequest:Vu,GetRobotPartResponse:Wu,GetRobotPartsRequest:Yu,GetRobotPartsResponse:$u,GetRobotRequest:Bu,GetRobotResponse:zu,GetRoverRentalRobotsRequest:Fu,GetRoverRentalRobotsResponse:Ju,GetUserIDByEmailRequest:ak,GetUserIDByEmailResponse:tk,ListAuthorizationsRequest:vT,ListAuthorizationsResponse:hT,ListFragmentsRequest:kg,ListFragmentsResponse:yg,ListKeysRequest:Tk,ListKeysResponse:kk,ListLocationsRequest:Eu,ListLocationsResponse:Pu,ListMachineFragmentsRequest:Lg,ListMachineFragmentsResponse:Gg,ListMachineSummariesRequest:Bg,ListMachineSummariesResponse:Fg,ListModulesRequest:ek,ListModulesResponse:nk,ListNestedFragmentsRequest:qg,ListNestedFragmentsResponse:Ug,ListOAuthAppsRequest:Bk,ListOAuthAppsResponse:Fk,ListOrganizationMembersRequest:xp,ListOrganizationMembersResponse:Jp,ListOrganizationsByUserRequest:sk,ListOrganizationsByUserResponse:ok,ListOrganizationsRequest:_p,ListOrganizationsResponse:Ip,ListRegistryItemsRequest:DT,ListRegistryItemsResponse:AT,ListRobotsRequest:Ag,ListRobotsResponse:Wg,Location:Nn,LocationAuth:Ia,LocationAuthRequest:Lu,LocationAuthResponse:Gu,LocationOrganization:du,LocationSummary:xg,MLModelMetadata:IT,MLTrainingMetadata:bT,MLTrainingVersion:MT,MachineSummary:Jg,MarkPartAsMainRequest:sT,MarkPartAsMainResponse:oT,MarkPartForRestartRequest:iT,MarkPartForRestartResponse:rT,Model:en,Module:Eo,ModuleFileInfo:jT,ModuleMetadata:ST,ModuleVersion:_T,NewRobotPartRequest:ag,NewRobotPartResponse:tg,NewRobotRequest:jg,NewRobotResponse:Hg,OAuthConfig:wa,OrgDetails:Oo,Organization:pn,OrganizationGetLogoRequest:Mk,OrganizationGetLogoResponse:bk,OrganizationGetSupportEmailRequest:cu,OrganizationGetSupportEmailResponse:lu,OrganizationIdentity:Ro,OrganizationInvite:Cn,OrganizationMember:Sp,OrganizationSetLogoRequest:Sk,OrganizationSetLogoResponse:Ik,OrganizationSetSupportEmailRequest:ru,OrganizationSetSupportEmailResponse:mu,PKCE:vp,PartSummary:Vg,ReadOAuthAppRequest:Dk,ReadOAuthAppResponse:Ak,RegistryItem:Ea,RegistryItemStatus:kp,RemoveRoleRequest:gT,RemoveRoleResponse:TT,RenameKeyRequest:pk,RenameKeyResponse:uk,RenameRegistryItemRequest:LT,RenameRegistryItemResponse:GT,ResendOrganizationInviteRequest:Hp,ResendOrganizationInviteResponse:Kp,ResolvedFragment:Io,Robot:_a,RobotPart:dn,RobotPartHistoryEntry:Rp,RotateKeyRequest:yk,RotateKeyResponse:vk,RoverRentalRobot:xu,SearchOrganizationsRequest:ik,SearchOrganizationsResponse:rk,SetFragmentTagRequest:Cg,SetFragmentTagResponse:Ng,ShareLocationRequest:wu,ShareLocationResponse:Ou,SharedSecret:_o,SharedSecret_State:So,StorageConfig:pu,TailRobotPartLogsRequest:Ku,TailRobotPartLogsResponse:Xu,TransferRegistryItemRequest:BT,TransferRegistryItemResponse:FT,URLValidation:hp,UnshareLocationRequest:Cu,UnshareLocationResponse:Nu,UpdateBillingServiceRequest:nu,UpdateBillingServiceResponse:au,UpdateFragmentRequest:_g,UpdateFragmentResponse:Sg,UpdateLocationMetadataRequest:Su,UpdateLocationMetadataResponse:Iu,UpdateLocationRequest:yu,UpdateLocationResponse:vu,UpdateMLModelMetadata:VT,UpdateMLTrainingMetadata:WT,UpdateModuleMetadata:$T,UpdateModuleRequest:zT,UpdateModuleResponse:YT,UpdateOAuthAppRequest:qk,UpdateOAuthAppResponse:Uk,UpdateOrganizationInviteAuthorizationsRequest:$p,UpdateOrganizationInviteAuthorizationsResponse:Vp,UpdateOrganizationMetadataRequest:Bp,UpdateOrganizationMetadataResponse:Fp,UpdateOrganizationNamespaceRequest:Dp,UpdateOrganizationNamespaceResponse:Ap,UpdateOrganizationRequest:Np,UpdateOrganizationResponse:Pp,UpdateRegistryItemRequest:NT,UpdateRegistryItemResponse:PT,UpdateRobotMetadataRequest:aT,UpdateRobotMetadataResponse:tT,UpdateRobotPartMetadataRequest:rg,UpdateRobotPartMetadataResponse:mg,UpdateRobotPartRequest:eg,UpdateRobotPartResponse:ng,UpdateRobotRequest:Kg,UpdateRobotResponse:Xg,UploadModuleFileRequest:HT,UploadModuleFileResponse:KT,Uploads:wo,VersionHistory:ZT,ViamAgentVersion:$g,ViamServerVersion:Yg,Visibility:ln},Symbol.toStringTag,{value:"Module"})),S1={typeName:"viam.app.v1.AppService",methods:{getUserIDByEmail:{name:"GetUserIDByEmail",I:ak,O:tk,kind:m.Unary},createOrganization:{name:"CreateOrganization",I:Mp,O:bp,kind:m.Unary},listOrganizations:{name:"ListOrganizations",I:_p,O:Ip,kind:m.Unary},getOrganizationsWithAccessToLocation:{name:"GetOrganizationsWithAccessToLocation",I:Mu,O:bu,kind:m.Unary},listOrganizationsByUser:{name:"ListOrganizationsByUser",I:sk,O:ok,kind:m.Unary},searchOrganizations:{name:"SearchOrganizations",I:ik,O:rk,kind:m.Unary},getOrganization:{name:"GetOrganization",I:Ep,O:wp,kind:m.Unary},getOrganizationNamespaceAvailability:{name:"GetOrganizationNamespaceAvailability",I:Op,O:Cp,kind:m.Unary},updateOrganization:{name:"UpdateOrganization",I:Np,O:Pp,kind:m.Unary},updateOrganizationNamespace:{name:"UpdateOrganizationNamespace",I:Dp,O:Ap,kind:m.Unary},deleteOrganization:{name:"DeleteOrganization",I:qp,O:Up,kind:m.Unary},getOrganizationMetadata:{name:"GetOrganizationMetadata",I:Lp,O:Gp,kind:m.Unary},updateOrganizationMetadata:{name:"UpdateOrganizationMetadata",I:Bp,O:Fp,kind:m.Unary},listOrganizationMembers:{name:"ListOrganizationMembers",I:xp,O:Jp,kind:m.Unary},createOrganizationInvite:{name:"CreateOrganizationInvite",I:zp,O:Yp,kind:m.Unary},updateOrganizationInviteAuthorizations:{name:"UpdateOrganizationInviteAuthorizations",I:$p,O:Vp,kind:m.Unary},deleteOrganizationMember:{name:"DeleteOrganizationMember",I:Xp,O:Qp,kind:m.Unary},deleteOrganizationInvite:{name:"DeleteOrganizationInvite",I:Wp,O:jp,kind:m.Unary},resendOrganizationInvite:{name:"ResendOrganizationInvite",I:Hp,O:Kp,kind:m.Unary},enableBillingService:{name:"EnableBillingService",I:Zp,O:eu,kind:m.Unary},disableBillingService:{name:"DisableBillingService",I:ou,O:iu,kind:m.Unary},updateBillingService:{name:"UpdateBillingService",I:nu,O:au,kind:m.Unary},getBillingServiceConfig:{name:"GetBillingServiceConfig",I:tu,O:su,kind:m.Unary},organizationSetSupportEmail:{name:"OrganizationSetSupportEmail",I:ru,O:mu,kind:m.Unary},organizationGetSupportEmail:{name:"OrganizationGetSupportEmail",I:cu,O:lu,kind:m.Unary},organizationSetLogo:{name:"OrganizationSetLogo",I:Sk,O:Ik,kind:m.Unary},organizationGetLogo:{name:"OrganizationGetLogo",I:Mk,O:bk,kind:m.Unary},enableAuthService:{name:"EnableAuthService",I:Ek,O:wk,kind:m.Unary},disableAuthService:{name:"DisableAuthService",I:Ok,O:Ck,kind:m.Unary},createOAuthApp:{name:"CreateOAuthApp",I:Nk,O:Pk,kind:m.Unary},readOAuthApp:{name:"ReadOAuthApp",I:Dk,O:Ak,kind:m.Unary},updateOAuthApp:{name:"UpdateOAuthApp",I:qk,O:Uk,kind:m.Unary},deleteOAuthApp:{name:"DeleteOAuthApp",I:Lk,O:Gk,kind:m.Unary},listOAuthApps:{name:"ListOAuthApps",I:Bk,O:Fk,kind:m.Unary},createLocation:{name:"CreateLocation",I:uu,O:gu,kind:m.Unary},getLocation:{name:"GetLocation",I:Tu,O:ku,kind:m.Unary},updateLocation:{name:"UpdateLocation",I:yu,O:vu,kind:m.Unary},deleteLocation:{name:"DeleteLocation",I:hu,O:fu,kind:m.Unary},getLocationMetadata:{name:"GetLocationMetadata",I:Ru,O:_u,kind:m.Unary},updateLocationMetadata:{name:"UpdateLocationMetadata",I:Su,O:Iu,kind:m.Unary},listLocations:{name:"ListLocations",I:Eu,O:Pu,kind:m.Unary},shareLocation:{name:"ShareLocation",I:wu,O:Ou,kind:m.Unary},unshareLocation:{name:"UnshareLocation",I:Cu,O:Nu,kind:m.Unary},locationAuth:{name:"LocationAuth",I:Lu,O:Gu,kind:m.Unary},createLocationSecret:{name:"CreateLocationSecret",I:Du,O:Au,kind:m.Unary},deleteLocationSecret:{name:"DeleteLocationSecret",I:qu,O:Uu,kind:m.Unary},getRobot:{name:"GetRobot",I:Bu,O:zu,kind:m.Unary},getRobotMetadata:{name:"GetRobotMetadata",I:eT,O:nT,kind:m.Unary},updateRobotMetadata:{name:"UpdateRobotMetadata",I:aT,O:tT,kind:m.Unary},getRoverRentalRobots:{name:"GetRoverRentalRobots",I:Fu,O:Ju,kind:m.Unary},getRobotParts:{name:"GetRobotParts",I:Yu,O:$u,kind:m.Unary},getRobotPart:{name:"GetRobotPart",I:Vu,O:Wu,kind:m.Unary},getRobotPartLogs:{name:"GetRobotPartLogs",I:ju,O:Hu,kind:m.Unary},tailRobotPartLogs:{name:"TailRobotPartLogs",I:Ku,O:Xu,kind:m.ServerStreaming},getRobotPartHistory:{name:"GetRobotPartHistory",I:Qu,O:Zu,kind:m.Unary},updateRobotPart:{name:"UpdateRobotPart",I:eg,O:ng,kind:m.Unary},newRobotPart:{name:"NewRobotPart",I:ag,O:tg,kind:m.Unary},deleteRobotPart:{name:"DeleteRobotPart",I:sg,O:pg,kind:m.Unary},getRobotPartMetadata:{name:"GetRobotPartMetadata",I:og,O:ig,kind:m.Unary},updateRobotPartMetadata:{name:"UpdateRobotPartMetadata",I:rg,O:mg,kind:m.Unary},getRobotAPIKeys:{name:"GetRobotAPIKeys",I:cg,O:dg,kind:m.Unary},markPartAsMain:{name:"MarkPartAsMain",I:sT,O:oT,kind:m.Unary},markPartForRestart:{name:"MarkPartForRestart",I:iT,O:rT,kind:m.Unary},createRobotPartSecret:{name:"CreateRobotPartSecret",I:mT,O:cT,kind:m.Unary},deleteRobotPartSecret:{name:"DeleteRobotPartSecret",I:lT,O:dT,kind:m.Unary},listRobots:{name:"ListRobots",I:Ag,O:Wg,kind:m.Unary},newRobot:{name:"NewRobot",I:jg,O:Hg,kind:m.Unary},updateRobot:{name:"UpdateRobot",I:Kg,O:Xg,kind:m.Unary},deleteRobot:{name:"DeleteRobot",I:Qg,O:Zg,kind:m.Unary},listFragments:{name:"ListFragments",I:kg,O:yg,kind:m.Unary},getFragment:{name:"GetFragment",I:vg,O:hg,kind:m.Unary},createFragment:{name:"CreateFragment",I:fg,O:Rg,kind:m.Unary},updateFragment:{name:"UpdateFragment",I:_g,O:Sg,kind:m.Unary},deleteFragment:{name:"DeleteFragment",I:Ig,O:Mg,kind:m.Unary},listNestedFragments:{name:"ListNestedFragments",I:qg,O:Ug,kind:m.Unary},listMachineFragments:{name:"ListMachineFragments",I:Lg,O:Gg,kind:m.Unary},listMachineSummaries:{name:"ListMachineSummaries",I:Bg,O:Fg,kind:m.Unary},getFragmentHistory:{name:"GetFragmentHistory",I:bg,O:Eg,kind:m.Unary},getFragmentUsage:{name:"GetFragmentUsage",I:wg,O:Og,kind:m.Unary},setFragmentTag:{name:"SetFragmentTag",I:Cg,O:Ng,kind:m.Unary},deleteFragmentTag:{name:"DeleteFragmentTag",I:Pg,O:Dg,kind:m.Unary},addRole:{name:"AddRole",I:pT,O:uT,kind:m.Unary},removeRole:{name:"RemoveRole",I:gT,O:TT,kind:m.Unary},changeRole:{name:"ChangeRole",I:kT,O:yT,kind:m.Unary},listAuthorizations:{name:"ListAuthorizations",I:vT,O:hT,kind:m.Unary},checkPermissions:{name:"CheckPermissions",I:fT,O:RT,kind:m.Unary},getRegistryItem:{name:"GetRegistryItem",I:ET,O:wT,kind:m.Unary},createRegistryItem:{name:"CreateRegistryItem",I:OT,O:CT,kind:m.Unary},updateRegistryItem:{name:"UpdateRegistryItem",I:NT,O:PT,kind:m.Unary},listRegistryItems:{name:"ListRegistryItems",I:DT,O:AT,kind:m.Unary},deleteRegistryItem:{name:"DeleteRegistryItem",I:qT,O:UT,kind:m.Unary},renameRegistryItem:{name:"RenameRegistryItem",I:LT,O:GT,kind:m.Unary},transferRegistryItem:{name:"TransferRegistryItem",I:BT,O:FT,kind:m.Unary},createModule:{name:"CreateModule",I:xT,O:JT,kind:m.Unary},updateModule:{name:"UpdateModule",I:zT,O:YT,kind:m.Unary},uploadModuleFile:{name:"UploadModuleFile",I:HT,O:KT,kind:m.ClientStreaming},getModule:{name:"GetModule",I:XT,O:QT,kind:m.Unary},listModules:{name:"ListModules",I:ek,O:nk,kind:m.Unary},createKey:{name:"CreateKey",I:mk,O:ck,kind:m.Unary},deleteKey:{name:"DeleteKey",I:lk,O:dk,kind:m.Unary},listKeys:{name:"ListKeys",I:Tk,O:kk,kind:m.Unary},renameKey:{name:"RenameKey",I:pk,O:uk,kind:m.Unary},rotateKey:{name:"RotateKey",I:yk,O:vk,kind:m.Unary},createKeyFromExistingKeyAuthorizations:{name:"CreateKeyFromExistingKeyAuthorizations",I:hk,O:fk,kind:m.Unary},getAppContent:{name:"GetAppContent",I:Rk,O:_k,kind:m.Unary}}},xk=(a,e,n,t,o,i)=>new Q({authorizationType:"role",identityId:e,identityType:o,authorizationId:`${t}_${n}`,resourceType:t,organizationId:a,resourceId:i});class I1{client;constructor(e){this.client=aa(S1,e)}async getUserIDByEmail(e){return(await this.client.getUserIDByEmail({email:e})).userId}async createOrganization(e){return(await this.client.createOrganization({name:e})).organization}async listOrganizations(){return(await this.client.listOrganizations({})).organizations}async getOrganizationsWithAccessToLocation(e){return(await this.client.getOrganizationsWithAccessToLocation({locationId:e})).organizationIdentities}async listOrganizationsByUser(e){return(await this.client.listOrganizationsByUser({userId:e})).orgs}async getOrganization(e){return(await this.client.getOrganization({organizationId:e})).organization}async getOrganizationNamespaceAvailability(e){return(await this.client.getOrganizationNamespaceAvailability({publicNamespace:e})).available}async updateOrganization(e,n,t,o,i){return(await this.client.updateOrganization({organizationId:e,name:n,publicNamespace:t,region:o,cid:i})).organization}async deleteOrganization(e){await this.client.deleteOrganization({organizationId:e})}async listOrganizationMembers(e){return this.client.listOrganizationMembers({organizationId:e})}async createOrganizationInvite(e,n,t,o=!0){return(await this.client.createOrganizationInvite({organizationId:e,email:n,authorizations:t,sendEmailInvite:o})).invite}async updateOrganizationInviteAuthorizations(e,n,t,o){return(await this.client.updateOrganizationInviteAuthorizations({organizationId:e,email:n,addAuthorizations:t,removeAuthorizations:o})).invite}async deleteOrganizationMember(e,n){await this.client.deleteOrganizationMember({organizationId:e,userId:n})}async deleteOrganizationInvite(e,n){await this.client.deleteOrganizationInvite({organizationId:e,email:n})}async resendOrganizationInvite(e,n){return(await this.client.resendOrganizationInvite({organizationId:e,email:n})).invite}async createLocation(e,n,t){return(await this.client.createLocation({organizationId:e,name:n,parentLocationId:t})).location}async getLocation(e){return(await this.client.getLocation({locationId:e})).location}async updateLocation(e,n,t,o){return(await this.client.updateLocation({locationId:e,name:n,parentLocationId:t,region:o})).location}async deleteLocation(e){await this.client.deleteLocation({locationId:e})}async listLocations(e){return(await this.client.listLocations({organizationId:e})).locations}async shareLocation(e,n){await this.client.shareLocation({organizationId:e,locationId:n})}async unshareLocation(e,n){await this.client.unshareLocation({organizationId:e,locationId:n})}async locationAuth(e){return(await this.client.locationAuth({locationId:e})).auth}async createLocationSecret(e){return(await this.client.createLocationSecret({locationId:e})).auth}async deleteLocationSecret(e,n){await this.client.deleteLocationSecret({locationId:e,secretId:n})}async getRobot(e){return(await this.client.getRobot({id:e})).robot}async getRoverRentalRobots(e){return(await this.client.getRoverRentalRobots({orgId:e})).robots}async getRobotParts(e){return(await this.client.getRobotParts({robotId:e})).parts}async getRobotPart(e){return this.client.getRobotPart({id:e})}async getRobotPartLogs(e,n,t,o=""){return this.client.getRobotPartLogs({id:e,filter:n,levels:t,pageToken:o})}async tailRobotPartLogs(e,n,t,o=!0){const i=this.client.tailRobotPartLogs({id:e,errorsOnly:o,filter:t});for await(const r of i)for(const c of r.logs)n.push(c)}async getRobotPartHistory(e){return(await this.client.getRobotPartHistory({id:e})).history}async updateRobotPart(e,n,t){return(await this.client.updateRobotPart({id:e,name:n,robotConfig:t})).part}async newRobotPart(e,n){return(await this.client.newRobotPart({robotId:e,partName:n})).partId}async deleteRobotPart(e){await this.client.deleteRobotPart({partId:e})}async getRobotAPIKeys(e){return(await this.client.getRobotAPIKeys({robotId:e})).apiKeys}async markPartAsMain(e){await this.client.markPartAsMain({partId:e})}async markPartForRestart(e){await this.client.markPartForRestart({partId:e})}async createRobotPartSecret(e){return(await this.client.createRobotPartSecret({partId:e})).part}async deleteRobotPartSecret(e,n){await this.client.deleteRobotPartSecret({partId:e,secretId:n})}async listRobots(e){return(await this.client.listRobots({locationId:e})).robots}async newRobot(e,n){return(await this.client.newRobot({name:n,location:e})).id}async updateRobot(e,n,t){return(await this.client.updateRobot({id:e,location:n,name:t})).robot}async deleteRobot(e){await this.client.deleteRobot({id:e})}async listFragments(e,n=!0,t=[]){return(await this.client.listFragments({organizationId:e,showPublic:n,fragmentVisibility:t})).fragments}async getFragment(e){return(await this.client.getFragment({id:e})).fragment}async createFragment(e,n,t){return(await this.client.createFragment({organizationId:e,name:n,config:t})).fragment}async updateFragment(e,n,t,o,i){return(await this.client.updateFragment({id:e,name:n,config:t,public:o,visibility:i})).fragment}async deleteFragment(e){await this.client.deleteFragment({id:e})}async listMachineFragments(e,n){return(await this.client.listMachineFragments({machineId:e,additionalFragmentIds:n})).fragments}async addRole(e,n,t,o,i){await this.client.addRole({authorization:xk(e,n,t,o,"",i)})}async removeRole(e,n,t,o,i){await this.client.removeRole({authorization:xk(e,n,t,o,"",i)})}async changeRole(e,n){await this.client.changeRole({oldAuthorization:e,newAuthorization:n})}async listAuthorizations(e,n){return(await this.client.listAuthorizations({organizationId:e,resourceIds:n})).authorizations}async checkPermissions(e){return(await this.client.checkPermissions({permissions:e})).authorizedPermissions}async getRegistryItem(e){return(await this.client.getRegistryItem({itemId:e})).item}async createRegistryItem(e,n,t){await this.client.createRegistryItem({organizationId:e,name:n,type:t})}async updateRegistryItem(e,n,t,o){await this.client.updateRegistryItem({itemId:e,type:n,description:t,visibility:o})}async listRegistryItems(e,n,t,o,i,r,c){const d={organizationId:e,types:n,visibilities:t,platforms:o,statuses:i,searchTerm:r,pageToken:c};return(await this.client.listRegistryItems(d)).items}async deleteRegistryItem(e){await this.client.deleteRegistryItem({itemId:e})}async createModule(e,n){return this.client.createModule({organizationId:e,name:n})}async updateModule(e,n,t,o,i,r){return(await this.client.updateModule({moduleId:e,visibility:n,url:t,description:o,models:i,entrypoint:r})).url}async getModule(e){return(await this.client.getModule({moduleId:e})).module}async listModules(e){return(await this.client.listModules({organizationId:e})).modules}async createKey(e,n){return this.client.createKey({name:n,authorizations:e})}async deleteKey(e){return this.client.deleteKey({id:e})}async listKeys(e){return(await this.client.listKeys({orgId:e})).apiKeys}async rotateKey(e){return this.client.rotateKey({id:e})}async createKeyFromExistingKeyAuthorizations(e){return this.client.createKeyFromExistingKeyAuthorizations({id:e})}async getAppContent(e,n){return this.client.getAppContent({publicNamespace:e,name:n})}async getOrganizationMetadata(e){return(await this.client.getOrganizationMetadata({organizationId:e})).toJson().data??{}}async updateOrganizationMetadata(e,n){await this.client.updateOrganizationMetadata({organizationId:e,data:l.fromJson(n)})}async getLocationMetadata(e){return(await this.client.getLocationMetadata({locationId:e})).toJson().data??{}}async updateLocationMetadata(e,n){await this.client.updateLocationMetadata({locationId:e,data:l.fromJson(n)})}async getRobotMetadata(e){return(await this.client.getRobotMetadata({id:e})).toJson().data??{}}async updateRobotMetadata(e,n){await this.client.updateRobotMetadata({id:e,data:l.fromJson(n)})}async getRobotPartMetadata(e){return(await this.client.getRobotPartMetadata({id:e})).toJson().data??{}}async updateRobotPartMetadata(e,n){await this.client.updateRobotPartMetadata({id:e,data:l.fromJson(n)})}}const Jk=s.makeEnum("viam.app.v1.PaymentMethodType",[{no:0,name:"PAYMENT_METHOD_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PAYMENT_METHOD_TYPE_CARD",localName:"CARD"}]),zk=s.makeEnum("viam.app.v1.UsageCostType",[{no:0,name:"USAGE_COST_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"USAGE_COST_TYPE_DATA_UPLOAD",localName:"DATA_UPLOAD"},{no:2,name:"USAGE_COST_TYPE_DATA_EGRESS",localName:"DATA_EGRESS"},{no:3,name:"USAGE_COST_TYPE_REMOTE_CONTROL",localName:"REMOTE_CONTROL"},{no:4,name:"USAGE_COST_TYPE_STANDARD_COMPUTE",localName:"STANDARD_COMPUTE"},{no:5,name:"USAGE_COST_TYPE_CLOUD_STORAGE",localName:"CLOUD_STORAGE"},{no:6,name:"USAGE_COST_TYPE_BINARY_DATA_CLOUD_STORAGE",localName:"BINARY_DATA_CLOUD_STORAGE"},{no:7,name:"USAGE_COST_TYPE_OTHER_CLOUD_STORAGE",localName:"OTHER_CLOUD_STORAGE"},{no:8,name:"USAGE_COST_TYPE_PER_MACHINE",localName:"PER_MACHINE"},{no:9,name:"USAGE_COST_TYPE_TRIGGER_NOTIFICATION",localName:"TRIGGER_NOTIFICATION"},{no:10,name:"USAGE_COST_TYPE_TABULAR_DATA_CLOUD_STORAGE",localName:"TABULAR_DATA_CLOUD_STORAGE"},{no:11,name:"USAGE_COST_TYPE_CONFIG_HISTORY_CLOUD_STORAGE",localName:"CONFIG_HISTORY_CLOUD_STORAGE"},{no:12,name:"USAGE_COST_TYPE_LOGS_CLOUD_STORAGE",localName:"LOGS_CLOUD_STORAGE"},{no:13,name:"USAGE_COST_TYPE_TRAINING_LOGS_CLOUD_STORAGE",localName:"TRAINING_LOGS_CLOUD_STORAGE"},{no:14,name:"USAGE_COST_TYPE_PACKAGES_CLOUD_STORAGE",localName:"PACKAGES_CLOUD_STORAGE"},{no:15,name:"USAGE_COST_TYPE_BINARY_DATA_UPLOAD",localName:"BINARY_DATA_UPLOAD"},{no:16,name:"USAGE_COST_TYPE_TABULAR_DATA_UPLOAD",localName:"TABULAR_DATA_UPLOAD"},{no:17,name:"USAGE_COST_TYPE_LOGS_UPLOAD",localName:"LOGS_UPLOAD"},{no:18,name:"USAGE_COST_TYPE_BINARY_DATA_EGRESS",localName:"BINARY_DATA_EGRESS"},{no:19,name:"USAGE_COST_TYPE_TABULAR_DATA_EGRESS",localName:"TABULAR_DATA_EGRESS"},{no:20,name:"USAGE_COST_TYPE_LOGS_EGRESS",localName:"LOGS_EGRESS"},{no:21,name:"USAGE_COST_TYPE_TRAINING_LOGS_EGRESS",localName:"TRAINING_LOGS_EGRESS"},{no:22,name:"USAGE_COST_TYPE_TABULAR_DATA_DATABASE_CLOUD_STORAGE",localName:"TABULAR_DATA_DATABASE_CLOUD_STORAGE"},{no:23,name:"USAGE_COST_TYPE_TABULAR_DATA_DATABASE_COMPUTE",localName:"TABULAR_DATA_DATABASE_COMPUTE"}]),Yk=s.makeEnum("viam.app.v1.SourceType",[{no:0,name:"SOURCE_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"SOURCE_TYPE_ORG",localName:"ORG"},{no:2,name:"SOURCE_TYPE_FRAGMENT",localName:"FRAGMENT"}]),$k=s.makeMessageType("viam.app.v1.InvoiceSummary",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"invoice_date",kind:"message",T:S},{no:3,name:"invoice_amount",kind:"scalar",T:1},{no:4,name:"status",kind:"scalar",T:9},{no:5,name:"due_date",kind:"message",T:S},{no:6,name:"paid_date",kind:"message",T:S}]),Vk=s.makeMessageType("viam.app.v1.PaymentMethodCard",()=>[{no:1,name:"brand",kind:"scalar",T:9},{no:2,name:"last_four_digits",kind:"scalar",T:9}]),Wk=s.makeMessageType("viam.app.v1.GetCurrentMonthUsageRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),jk=s.makeMessageType("viam.app.v1.UsageCost",()=>[{no:1,name:"resource_type",kind:"enum",T:s.getEnumType(zk)},{no:2,name:"cost",kind:"scalar",T:1}]),Hk=s.makeMessageType("viam.app.v1.ResourceUsageCostsBySource",()=>[{no:1,name:"source_type",kind:"enum",T:s.getEnumType(Yk)},{no:2,name:"resource_usage_costs",kind:"message",T:Kk},{no:3,name:"tier_name",kind:"scalar",T:9}]),Kk=s.makeMessageType("viam.app.v1.ResourceUsageCosts",()=>[{no:1,name:"usage_costs",kind:"message",T:jk,repeated:!0},{no:2,name:"discount",kind:"scalar",T:1},{no:3,name:"total_with_discount",kind:"scalar",T:1},{no:4,name:"total_without_discount",kind:"scalar",T:1}]),Xk=s.makeMessageType("viam.app.v1.GetCurrentMonthUsageResponse",()=>[{no:1,name:"start_date",kind:"message",T:S},{no:2,name:"end_date",kind:"message",T:S},{no:14,name:"resource_usage_costs_by_source",kind:"message",T:Hk,repeated:!0},{no:15,name:"subtotal",kind:"scalar",T:1},{no:3,name:"cloud_storage_usage_cost",kind:"scalar",T:1},{no:4,name:"data_upload_usage_cost",kind:"scalar",T:1},{no:5,name:"data_egres_usage_cost",kind:"scalar",T:1},{no:6,name:"remote_control_usage_cost",kind:"scalar",T:1},{no:7,name:"standard_compute_usage_cost",kind:"scalar",T:1},{no:8,name:"discount_amount",kind:"scalar",T:1},{no:9,name:"total_usage_with_discount",kind:"scalar",T:1},{no:10,name:"total_usage_without_discount",kind:"scalar",T:1},{no:11,name:"per_machine_usage_cost",kind:"scalar",T:1},{no:12,name:"binary_data_cloud_storage_usage_cost",kind:"scalar",T:1},{no:13,name:"other_cloud_storage_usage_cost",kind:"scalar",T:1}]),Qk=s.makeMessageType("viam.app.v1.GetOrgBillingInformationRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Zk=s.makeMessageType("viam.app.v1.GetOrgBillingInformationResponse",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Jk)},{no:2,name:"billing_email",kind:"scalar",T:9},{no:3,name:"method",kind:"message",T:Vk,opt:!0},{no:4,name:"billing_tier",kind:"scalar",T:9,opt:!0}]),ey=s.makeMessageType("viam.app.v1.GetInvoicesSummaryRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),ny=s.makeMessageType("viam.app.v1.GetInvoicesSummaryResponse",()=>[{no:1,name:"outstanding_balance",kind:"scalar",T:1},{no:2,name:"invoices",kind:"message",T:$k,repeated:!0}]),ay=s.makeMessageType("viam.app.v1.GetInvoicePdfRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"org_id",kind:"scalar",T:9}]),ty=s.makeMessageType("viam.app.v1.GetInvoicePdfResponse",()=>[{no:1,name:"chunk",kind:"scalar",T:12}]),sy=s.makeMessageType("viam.app.v1.SendPaymentRequiredEmailRequest",()=>[{no:1,name:"customer_org_id",kind:"scalar",T:9},{no:2,name:"billing_owner_org_id",kind:"scalar",T:9}]),oy=s.makeMessageType("viam.app.v1.SendPaymentRequiredEmailResponse",[]),iy=s.makeMessageType("viam.app.v1.GetAvailableBillingTiersRequest",[]),ry=s.makeMessageType("viam.app.v1.GetAvailableBillingTiersResponse",()=>[{no:1,name:"tiers",kind:"scalar",T:9,repeated:!0}]),my=s.makeMessageType("viam.app.v1.UpdateOrganizationBillingTierRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"billing_tier",kind:"scalar",T:9}]),cy=s.makeMessageType("viam.app.v1.UpdateOrganizationBillingTierResponse",[]),M1=Object.freeze(Object.defineProperty({__proto__:null,GetAvailableBillingTiersRequest:iy,GetAvailableBillingTiersResponse:ry,GetCurrentMonthUsageRequest:Wk,GetCurrentMonthUsageResponse:Xk,GetInvoicePdfRequest:ay,GetInvoicePdfResponse:ty,GetInvoicesSummaryRequest:ey,GetInvoicesSummaryResponse:ny,GetOrgBillingInformationRequest:Qk,GetOrgBillingInformationResponse:Zk,InvoiceSummary:$k,PaymentMethodCard:Vk,PaymentMethodType:Jk,ResourceUsageCosts:Kk,ResourceUsageCostsBySource:Hk,SendPaymentRequiredEmailRequest:sy,SendPaymentRequiredEmailResponse:oy,SourceType:Yk,UpdateOrganizationBillingTierRequest:my,UpdateOrganizationBillingTierResponse:cy,UsageCost:jk,UsageCostType:zk},Symbol.toStringTag,{value:"Module"})),b1={typeName:"viam.app.v1.BillingService",methods:{getCurrentMonthUsage:{name:"GetCurrentMonthUsage",I:Wk,O:Xk,kind:m.Unary},getOrgBillingInformation:{name:"GetOrgBillingInformation",I:Qk,O:Zk,kind:m.Unary},getInvoicesSummary:{name:"GetInvoicesSummary",I:ey,O:ny,kind:m.Unary},getInvoicePdf:{name:"GetInvoicePdf",I:ay,O:ty,kind:m.ServerStreaming},sendPaymentRequiredEmail:{name:"SendPaymentRequiredEmail",I:sy,O:oy,kind:m.Unary},getAvailableBillingTiers:{name:"GetAvailableBillingTiers",I:iy,O:ry,kind:m.Unary},updateOrganizationBillingTier:{name:"UpdateOrganizationBillingTier",I:my,O:cy,kind:m.Unary}}};class E1{client;constructor(e){this.client=N(b1,e)}async getCurrentMonthUsage(e){const n=await this.client.getCurrentMonthUsage({orgId:e});return n.start=n.startDate?.toDate(),n.end=n.endDate?.toDate(),n}async getOrgBillingInformation(e){return this.client.getOrgBillingInformation({orgId:e})}async getInvoicesSummary(e){return this.client.getInvoicesSummary({orgId:e})}async getInvoicePdf(e,n){const t=this.client.getInvoicePdf({id:e,orgId:n}),o=[];for await(const i of t)o.push(i.chunk);return w1(o)}}const w1=a=>{const e=a.reduce((o,i)=>o+i.length,0),n=new Uint8Array(e);let t=0;for(const o of a)n.set(o,t),t+=o.length;return n};var ly={},dy={};(function(a){Object.defineProperty(a,"__esModule",{value:!0}),function(e){var n=function(){function y(h){this._id=new Uint8Array(h)}return y.prototype.buffer=function(){return this._id},y}();e.UUID=n;var t=function(){function y(h){this._id=new Uint8Array(h)}return y.prototype.buffer=function(){return this._id},y}();e.ObjectId=t;var o=function(){function y(h){this._time=typeof h!="string"?new Uint8Array(h||_(Date.now())):_(+new Date(h))}return y.prototype.buffer=function(){return this._time},y.prototype.fromString=function(h){this._time=_(+new Date(h))},y.prototype.toNumber=function(){return M(this._time)},y.prototype.toDate=function(){return new Date(M(this._time))},y}();e.UTC=o;function i(y){var h=5;for(var g in y)h+=r(g,y[g]);return h}function r(y,h){var g=1;if(y&&(g+=Y(y)+1),h==null)return g;switch(h.constructor){case String:return g+4+Y(h)+1;case Number:return Math.floor(h)===h&&h<=2147483647&&h>=-2147483647?g+4:g+8;case Boolean:return g+1;case Array:case Object:return g+i(h);case Int8Array:case Uint8Array:return g+5+h.byteLength;case Date:case o:return g+8;case n:return g+5+16;case t:return g+12;default:return 0}}function c(y){var h=new Uint8Array(i(y));return d(y,h),h}e.serialize=c;function d(y,h,g){if(g===void 0&&(g=0),g+=k(h.length,h,g),y.constructor===Array)for(var v=0,E=y.length;v<E;v++)g=R(v.toString(),y[v],h,g);else for(var b in y)g=R(b,y[b],h,g);return h[g++]=0,g}function p(y,h,g){var v=O(y),E=v.length;return h.set(v,g),h[g+E++]=0,E}function k(y,h,g){return h[g++]=y&255,h[g++]=y>>>8&255,h[g++]=y>>>16&255,h[g++]=y>>>24&255,4}function R(y,h,g,v){if(h==null)return g[v++]=10,v+=p(y,g,v),v;switch(h.constructor){case String:g[v++]=2,v+=p(y,g,v);var E=p(h,g,v+4);return v+=k(E,g,v),v+E;case Number:if(Math.floor(h)===h)h<=2147483647&&h>=-2147483647?(g[v++]=16,v+=p(y,g,v),v+=k(h,g,v)):(g[v++]=18,v+=p(y,g,v),g.set(_(h),v),v+=8);else{g[v++]=1,v+=p(y,g,v);var b=new Float64Array([h]),ae=new Uint8Array(b.buffer);g.set(ae,v),v+=8}return v;case Boolean:return g[v++]=8,v+=p(y,g,v),g[v++]=h?1:0,v;case Array:case Object:g[v++]=h.constructor===Array?4:3,v+=p(y,g,v);var U=d(h,g,v);return k(U-v,g,v),U;case Int8Array:case Uint8Array:return g[v++]=5,v+=p(y,g,v),v+=k(h.byteLength,g,v),g[v++]=0,g.set(h,v),v+=h.byteLength,v;case Date:return g[v++]=9,v+=p(y,g,v),g.set(_(h.getTime()),v),v+=8,v;case o:return g[v++]=9,v+=p(y,g,v),g.set(h.buffer(),v),v+=8,v;case n:return g[v++]=5,v+=p(y,g,v),v+=k(16,g,v),g[v++]=4,g.set(h.buffer(),v),v+=16,v;case t:return g[v++]=7,v+=p(y,g,v),g.set(h.buffer(),v),v+=12,v;case RegExp:return g[v++]=11,v+=p(y,g,v),v+=p(h.source,g,v),h.global&&(g[v++]=115),h.ignoreCase&&(g[v++]=105),h.multiline&&(g[v++]=109),g[v++]=0,v;default:return v}}function I(y,h,g,v){if(h===void 0&&(h=!1),g===void 0&&(g=0),v===void 0&&(v=!1),!(y.length<5)){var E=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24;if(!(E<5||E>y.length)&&y[y.length-1]===0){for(var b=v?[]:{};;){var ae=y[g++];if(ae===0)break;for(var U=g;y[U]!==0&&U<y.length;U++);if(U>=y.length-1)return;var $=P(y.subarray(g,U));switch(v&&($=parseInt($)),g=++U,ae){case 1:b[$]=new Float64Array(y.slice(g,g+=8).buffer)[0];break;case 2:E=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24,b[$]=P(y.subarray(g,g+=E-1)),g++;break;case 3:E=y[g]|y[g+1]<<8|y[g+2]<<16|y[g+3]<<24,b[$]=I(y,h,g,!1),g+=E;break;case 4:E=y[g]|y[g+1]<<8|y[g+2]<<16|y[g+3]<<24,b[$]=I(y,h,g,!0),g+=E;break;case 5:if(E=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24,y[g++]===4){if(E!==16)return;b[$]=new n(y.subarray(g,g+=E))}else b[$]=y.slice(g,g+=E);break;case 6:b[$]=null;break;case 7:b[$]=new t(y.subarray(g,g+=12));break;case 8:b[$]=y[g++]===1;break;case 9:b[$]=h?new o(y.subarray(g,g+=8)):new Date(M(y.subarray(g,g+=8)));break;case 10:b[$]=null;break;case 11:for(U=g;U<y.length&&y[U++]!==0;);if(U>=y.length)return;var Xo=P(y.subarray(g,U));for(g=U;U<y.length&&y[U++]!==0;);if(U>=y.length)return;var Qo=P(y.subarray(g,U));g=U,b[$]=new RegExp(Xo,Qo);break;case 16:b[$]=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24;break;case 18:b[$]=M(y.subarray(g,g+=8));break;default:return}}return b}}}e.deserialize=I;function _(y){var h=new Uint8Array(8);if(Math.floor(y)===y){var g=4294967296,v=y%g|0,E=y/g|0;y<0&&(v=~(-y%g)|0,E=~(-y/g)|0,v=v+1&4294967295,v||E++);var b=0;h[b++]=v&255,h[b++]=v>>>8&255,h[b++]=v>>>16&255,h[b++]=v>>>24&255,h[b++]=E&255,h[b++]=E>>>8&255,h[b++]=E>>>16&255,h[b]=E>>>24&255}else{var ae=new Float64Array([y]),U=new Uint8Array(ae.buffer);h.set(U)}return h}function M(y,h){h===void 0&&(h=0);var g=4294967296,v=y[h++]|y[h++]<<8|y[h++]<<16|y[h++]<<24,E=y[h++]|y[h++]<<8|y[h++]<<16|y[h]<<24;return E*g+(v>=0?v:g+v)}function O(y){y=y.replace(/\r\n/g,`
9
- `);for(var h=[],g=0,v=0,E=y.length;v<E;v++){var b=y.charCodeAt(v);b<128?h[g++]=b:b<2048?(h[g++]=b>>>6|192,h[g++]=b&63|128):(h[g++]=b>>>12|224,h[g++]=b>>>6&63|128,h[g++]=b&63|128)}return new Uint8Array(h)}function P(y){for(var h="",g=y.length,v=0,E,b,ae;v<g;)E=y[v],E<128?(h+=String.fromCharCode(E),v++):E>191&&E<224?(b=y[v+1],h+=String.fromCharCode((E&31)<<6|b&63),v+=2):(b=y[v+1],ae=y[v+2],h+=String.fromCharCode((E&15)<<12|(b&63)<<6|ae&63),v+=3);return h}function Y(y){return encodeURI(y).split(/%..|./).length-1}}(a.BSON||(a.BSON={}))})(dy),Object.defineProperty(ly,"__esModule",{value:!0});var O1=dy,Oa=ly.BSON=O1.BSON;const py=s.makeEnum("viam.app.data.v1.Order",[{no:0,name:"ORDER_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"ORDER_DESCENDING",localName:"DESCENDING"},{no:2,name:"ORDER_ASCENDING",localName:"ASCENDING"}]),uy=s.makeEnum("viam.app.data.v1.TagsFilterType",[{no:0,name:"TAGS_FILTER_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"TAGS_FILTER_TYPE_MATCH_BY_OR",localName:"MATCH_BY_OR"},{no:2,name:"TAGS_FILTER_TYPE_TAGGED",localName:"TAGGED"},{no:3,name:"TAGS_FILTER_TYPE_UNTAGGED",localName:"UNTAGGED"}]),Ca=s.makeEnum("viam.app.data.v1.TabularDataSourceType",[{no:0,name:"TABULAR_DATA_SOURCE_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"TABULAR_DATA_SOURCE_TYPE_STANDARD",localName:"STANDARD"},{no:2,name:"TABULAR_DATA_SOURCE_TYPE_HOT_STORAGE",localName:"HOT_STORAGE"},{no:3,name:"TABULAR_DATA_SOURCE_TYPE_PIPELINE_SINK",localName:"PIPELINE_SINK"}]),No=s.makeMessageType("viam.app.data.v1.DataRequest",()=>[{no:1,name:"filter",kind:"message",T:$e},{no:2,name:"limit",kind:"scalar",T:4},{no:3,name:"last",kind:"scalar",T:9},{no:4,name:"sort_order",kind:"enum",T:s.getEnumType(py)}]),$e=s.makeMessageType("viam.app.data.v1.Filter",()=>[{no:1,name:"component_name",kind:"scalar",T:9},{no:2,name:"component_type",kind:"scalar",T:9},{no:4,name:"method",kind:"scalar",T:9},{no:6,name:"robot_name",kind:"scalar",T:9},{no:7,name:"robot_id",kind:"scalar",T:9},{no:8,name:"part_name",kind:"scalar",T:9},{no:9,name:"part_id",kind:"scalar",T:9},{no:10,name:"location_ids",kind:"scalar",T:9,repeated:!0},{no:11,name:"organization_ids",kind:"scalar",T:9,repeated:!0},{no:12,name:"mime_type",kind:"scalar",T:9,repeated:!0},{no:13,name:"interval",kind:"message",T:Pn},{no:14,name:"tags_filter",kind:"message",T:Po},{no:15,name:"bbox_labels",kind:"scalar",T:9,repeated:!0},{no:16,name:"dataset_id",kind:"scalar",T:9}]),Po=s.makeMessageType("viam.app.data.v1.TagsFilter",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(uy)},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),Na=s.makeMessageType("viam.app.data.v1.CaptureMetadata",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"location_id",kind:"scalar",T:9},{no:3,name:"robot_name",kind:"scalar",T:9},{no:4,name:"robot_id",kind:"scalar",T:9},{no:5,name:"part_name",kind:"scalar",T:9},{no:6,name:"part_id",kind:"scalar",T:9},{no:7,name:"component_type",kind:"scalar",T:9},{no:9,name:"component_name",kind:"scalar",T:9},{no:10,name:"method_name",kind:"scalar",T:9},{no:11,name:"method_parameters",kind:"map",K:9,V:{kind:"message",T:j}},{no:12,name:"tags",kind:"scalar",T:9,repeated:!0},{no:13,name:"mime_type",kind:"scalar",T:9}]),Pn=s.makeMessageType("viam.app.data.v1.CaptureInterval",()=>[{no:1,name:"start",kind:"message",T:S},{no:2,name:"end",kind:"message",T:S}]),gy=s.makeMessageType("viam.app.data.v1.TabularDataByFilterRequest",()=>[{no:1,name:"data_request",kind:"message",T:No},{no:2,name:"count_only",kind:"scalar",T:8},{no:3,name:"include_internal_data",kind:"scalar",T:8}]),Ty=s.makeMessageType("viam.app.data.v1.TabularDataByFilterResponse",()=>[{no:1,name:"metadata",kind:"message",T:Na,repeated:!0},{no:2,name:"data",kind:"message",T:ky,repeated:!0},{no:3,name:"count",kind:"scalar",T:4},{no:4,name:"last",kind:"scalar",T:9},{no:5,name:"total_size_bytes",kind:"scalar",T:4}]),ky=s.makeMessageType("viam.app.data.v1.TabularData",()=>[{no:1,name:"data",kind:"message",T:l},{no:2,name:"metadata_index",kind:"scalar",T:13},{no:3,name:"time_requested",kind:"message",T:S},{no:4,name:"time_received",kind:"message",T:S}]),yy=s.makeMessageType("viam.app.data.v1.TabularDataBySQLRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"sql_query",kind:"scalar",T:9}]),vy=s.makeMessageType("viam.app.data.v1.TabularDataBySQLResponse",()=>[{no:2,name:"raw_data",kind:"scalar",T:12,repeated:!0}]),Do=s.makeMessageType("viam.app.data.v1.TabularDataSource",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Ca)},{no:2,name:"pipeline_id",kind:"scalar",T:9,opt:!0}]),hy=s.makeMessageType("viam.app.data.v1.TabularDataByMQLRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:3,name:"mql_binary",kind:"scalar",T:12,repeated:!0},{no:4,name:"use_recent_data",kind:"scalar",T:8,opt:!0},{no:6,name:"data_source",kind:"message",T:Do,opt:!0}]),fy=s.makeMessageType("viam.app.data.v1.TabularDataByMQLResponse",()=>[{no:2,name:"raw_data",kind:"scalar",T:12,repeated:!0}]),Ry=s.makeMessageType("viam.app.data.v1.ExportTabularDataRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"resource_name",kind:"scalar",T:9},{no:3,name:"resource_subtype",kind:"scalar",T:9},{no:4,name:"method_name",kind:"scalar",T:9},{no:5,name:"interval",kind:"message",T:Pn}]),_y=s.makeMessageType("viam.app.data.v1.ExportTabularDataResponse",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"resource_name",kind:"scalar",T:9},{no:3,name:"resource_subtype",kind:"scalar",T:9},{no:4,name:"method_name",kind:"scalar",T:9},{no:5,name:"time_captured",kind:"message",T:S},{no:6,name:"organization_id",kind:"scalar",T:9},{no:7,name:"location_id",kind:"scalar",T:9},{no:8,name:"robot_name",kind:"scalar",T:9},{no:9,name:"robot_id",kind:"scalar",T:9},{no:10,name:"part_name",kind:"scalar",T:9},{no:11,name:"method_parameters",kind:"message",T:l},{no:12,name:"tags",kind:"scalar",T:9,repeated:!0},{no:13,name:"payload",kind:"message",T:l}]),Sy=s.makeMessageType("viam.app.data.v1.GetLatestTabularDataRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"resource_name",kind:"scalar",T:9},{no:3,name:"method_name",kind:"scalar",T:9},{no:4,name:"resource_subtype",kind:"scalar",T:9}]),Iy=s.makeMessageType("viam.app.data.v1.GetLatestTabularDataResponse",()=>[{no:1,name:"time_captured",kind:"message",T:S},{no:2,name:"time_synced",kind:"message",T:S},{no:3,name:"payload",kind:"message",T:l}]),Ao=s.makeMessageType("viam.app.data.v1.BinaryData",()=>[{no:1,name:"binary",kind:"scalar",T:12},{no:2,name:"metadata",kind:"message",T:Ny}]),My=s.makeMessageType("viam.app.data.v1.BinaryDataByFilterRequest",()=>[{no:1,name:"data_request",kind:"message",T:No},{no:2,name:"include_binary",kind:"scalar",T:8},{no:3,name:"count_only",kind:"scalar",T:8},{no:4,name:"include_internal_data",kind:"scalar",T:8}]),by=s.makeMessageType("viam.app.data.v1.BinaryDataByFilterResponse",()=>[{no:1,name:"data",kind:"message",T:Ao,repeated:!0},{no:2,name:"count",kind:"scalar",T:4},{no:3,name:"last",kind:"scalar",T:9},{no:4,name:"total_size_bytes",kind:"scalar",T:4}]),de=s.makeMessageType("viam.app.data.v1.BinaryID",()=>[{no:1,name:"file_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"location_id",kind:"scalar",T:9}]),Ey=s.makeMessageType("viam.app.data.v1.BinaryDataByIDsRequest",()=>[{no:2,name:"include_binary",kind:"scalar",T:8},{no:3,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0}]),wy=s.makeMessageType("viam.app.data.v1.BinaryDataByIDsResponse",()=>[{no:1,name:"data",kind:"message",T:Ao,repeated:!0},{no:2,name:"count",kind:"scalar",T:4}]),Oy=s.makeMessageType("viam.app.data.v1.BoundingBox",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"label",kind:"scalar",T:9},{no:3,name:"x_min_normalized",kind:"scalar",T:1},{no:4,name:"y_min_normalized",kind:"scalar",T:1},{no:5,name:"x_max_normalized",kind:"scalar",T:1},{no:6,name:"y_max_normalized",kind:"scalar",T:1},{no:7,name:"confidence",kind:"scalar",T:1,opt:!0}]),Cy=s.makeMessageType("viam.app.data.v1.Classification",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"confidence",kind:"scalar",T:1,opt:!0}]),qo=s.makeMessageType("viam.app.data.v1.Annotations",()=>[{no:1,name:"bboxes",kind:"message",T:Oy,repeated:!0},{no:2,name:"classifications",kind:"message",T:Cy,repeated:!0}]),Ny=s.makeMessageType("viam.app.data.v1.BinaryMetadata",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"capture_metadata",kind:"message",T:Na},{no:3,name:"time_requested",kind:"message",T:S},{no:4,name:"time_received",kind:"message",T:S},{no:5,name:"file_name",kind:"scalar",T:9},{no:6,name:"file_ext",kind:"scalar",T:9},{no:7,name:"uri",kind:"scalar",T:9},{no:8,name:"annotations",kind:"message",T:qo},{no:9,name:"dataset_ids",kind:"scalar",T:9,repeated:!0},{no:10,name:"binary_data_id",kind:"scalar",T:9}]),Py=s.makeMessageType("viam.app.data.v1.DeleteTabularDataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"delete_older_than_days",kind:"scalar",T:13}]),Dy=s.makeMessageType("viam.app.data.v1.DeleteTabularDataResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Ay=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e},{no:2,name:"include_internal_data",kind:"scalar",T:8}]),qy=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByFilterResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Uy=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByIDsRequest",()=>[{no:2,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0}]),Ly=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByIDsResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Gy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByIDsRequest",()=>[{no:3,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),By=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByIDsResponse",[]),Fy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),xy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByFilterResponse",[]),Jy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByIDsRequest",()=>[{no:3,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),zy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByIDsResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Yy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),$y=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByFilterResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Vy=s.makeMessageType("viam.app.data.v1.TagsByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e}]),Wy=s.makeMessageType("viam.app.data.v1.TagsByFilterResponse",()=>[{no:1,name:"tags",kind:"scalar",T:9,repeated:!0}]),jy=s.makeMessageType("viam.app.data.v1.AddBoundingBoxToImageByIDRequest",()=>[{no:7,name:"binary_id",kind:"message",T:de},{no:8,name:"binary_data_id",kind:"scalar",T:9},{no:2,name:"label",kind:"scalar",T:9},{no:3,name:"x_min_normalized",kind:"scalar",T:1},{no:4,name:"y_min_normalized",kind:"scalar",T:1},{no:5,name:"x_max_normalized",kind:"scalar",T:1},{no:6,name:"y_max_normalized",kind:"scalar",T:1}]),Hy=s.makeMessageType("viam.app.data.v1.AddBoundingBoxToImageByIDResponse",()=>[{no:1,name:"bbox_id",kind:"scalar",T:9}]),Ky=s.makeMessageType("viam.app.data.v1.RemoveBoundingBoxFromImageByIDRequest",()=>[{no:3,name:"binary_id",kind:"message",T:de},{no:4,name:"binary_data_id",kind:"scalar",T:9},{no:2,name:"bbox_id",kind:"scalar",T:9}]),Xy=s.makeMessageType("viam.app.data.v1.RemoveBoundingBoxFromImageByIDResponse",[]),Qy=s.makeMessageType("viam.app.data.v1.UpdateBoundingBoxRequest",()=>[{no:1,name:"binary_id",kind:"message",T:de},{no:8,name:"binary_data_id",kind:"scalar",T:9},{no:2,name:"bbox_id",kind:"scalar",T:9},{no:3,name:"label",kind:"scalar",T:9,opt:!0},{no:4,name:"x_min_normalized",kind:"scalar",T:1,opt:!0},{no:5,name:"y_min_normalized",kind:"scalar",T:1,opt:!0},{no:6,name:"x_max_normalized",kind:"scalar",T:1,opt:!0},{no:7,name:"y_max_normalized",kind:"scalar",T:1,opt:!0}]),Zy=s.makeMessageType("viam.app.data.v1.UpdateBoundingBoxResponse",[]),ev=s.makeMessageType("viam.app.data.v1.BoundingBoxLabelsByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e}]),nv=s.makeMessageType("viam.app.data.v1.BoundingBoxLabelsByFilterResponse",()=>[{no:1,name:"labels",kind:"scalar",T:9,repeated:!0}]),av=s.makeMessageType("viam.app.data.v1.ConfigureDatabaseUserRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"password",kind:"scalar",T:9}]),tv=s.makeMessageType("viam.app.data.v1.ConfigureDatabaseUserResponse",[]),sv=s.makeMessageType("viam.app.data.v1.GetDatabaseConnectionRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),ov=s.makeMessageType("viam.app.data.v1.GetDatabaseConnectionResponse",()=>[{no:1,name:"hostname",kind:"scalar",T:9},{no:2,name:"mongodb_uri",kind:"scalar",T:9},{no:3,name:"has_database_user",kind:"scalar",T:8}]),iv=s.makeMessageType("viam.app.data.v1.AddBinaryDataToDatasetByIDsRequest",()=>[{no:1,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"dataset_id",kind:"scalar",T:9}]),rv=s.makeMessageType("viam.app.data.v1.AddBinaryDataToDatasetByIDsResponse",[]),mv=s.makeMessageType("viam.app.data.v1.RemoveBinaryDataFromDatasetByIDsRequest",()=>[{no:1,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"dataset_id",kind:"scalar",T:9}]),cv=s.makeMessageType("viam.app.data.v1.RemoveBinaryDataFromDatasetByIDsResponse",[]),C1=Object.freeze(Object.defineProperty({__proto__:null,AddBinaryDataToDatasetByIDsRequest:iv,AddBinaryDataToDatasetByIDsResponse:rv,AddBoundingBoxToImageByIDRequest:jy,AddBoundingBoxToImageByIDResponse:Hy,AddTagsToBinaryDataByFilterRequest:Fy,AddTagsToBinaryDataByFilterResponse:xy,AddTagsToBinaryDataByIDsRequest:Gy,AddTagsToBinaryDataByIDsResponse:By,Annotations:qo,BinaryData:Ao,BinaryDataByFilterRequest:My,BinaryDataByFilterResponse:by,BinaryDataByIDsRequest:Ey,BinaryDataByIDsResponse:wy,BinaryID:de,BinaryMetadata:Ny,BoundingBox:Oy,BoundingBoxLabelsByFilterRequest:ev,BoundingBoxLabelsByFilterResponse:nv,CaptureInterval:Pn,CaptureMetadata:Na,Classification:Cy,ConfigureDatabaseUserRequest:av,ConfigureDatabaseUserResponse:tv,DataRequest:No,DeleteBinaryDataByFilterRequest:Ay,DeleteBinaryDataByFilterResponse:qy,DeleteBinaryDataByIDsRequest:Uy,DeleteBinaryDataByIDsResponse:Ly,DeleteTabularDataRequest:Py,DeleteTabularDataResponse:Dy,ExportTabularDataRequest:Ry,ExportTabularDataResponse:_y,Filter:$e,GetDatabaseConnectionRequest:sv,GetDatabaseConnectionResponse:ov,GetLatestTabularDataRequest:Sy,GetLatestTabularDataResponse:Iy,Order:py,RemoveBinaryDataFromDatasetByIDsRequest:mv,RemoveBinaryDataFromDatasetByIDsResponse:cv,RemoveBoundingBoxFromImageByIDRequest:Ky,RemoveBoundingBoxFromImageByIDResponse:Xy,RemoveTagsFromBinaryDataByFilterRequest:Yy,RemoveTagsFromBinaryDataByFilterResponse:$y,RemoveTagsFromBinaryDataByIDsRequest:Jy,RemoveTagsFromBinaryDataByIDsResponse:zy,TabularData:ky,TabularDataByFilterRequest:gy,TabularDataByFilterResponse:Ty,TabularDataByMQLRequest:hy,TabularDataByMQLResponse:fy,TabularDataBySQLRequest:yy,TabularDataBySQLResponse:vy,TabularDataSource:Do,TabularDataSourceType:Ca,TagsByFilterRequest:Vy,TagsByFilterResponse:Wy,TagsFilter:Po,TagsFilterType:uy,UpdateBoundingBoxRequest:Qy,UpdateBoundingBoxResponse:Zy},Symbol.toStringTag,{value:"Module"})),N1={typeName:"viam.app.data.v1.DataService",methods:{tabularDataByFilter:{name:"TabularDataByFilter",I:gy,O:Ty,kind:m.Unary},tabularDataBySQL:{name:"TabularDataBySQL",I:yy,O:vy,kind:m.Unary},tabularDataByMQL:{name:"TabularDataByMQL",I:hy,O:fy,kind:m.Unary},exportTabularData:{name:"ExportTabularData",I:Ry,O:_y,kind:m.ServerStreaming},getLatestTabularData:{name:"GetLatestTabularData",I:Sy,O:Iy,kind:m.Unary},binaryDataByFilter:{name:"BinaryDataByFilter",I:My,O:by,kind:m.Unary},binaryDataByIDs:{name:"BinaryDataByIDs",I:Ey,O:wy,kind:m.Unary},deleteTabularData:{name:"DeleteTabularData",I:Py,O:Dy,kind:m.Unary},deleteBinaryDataByFilter:{name:"DeleteBinaryDataByFilter",I:Ay,O:qy,kind:m.Unary},deleteBinaryDataByIDs:{name:"DeleteBinaryDataByIDs",I:Uy,O:Ly,kind:m.Unary},addTagsToBinaryDataByIDs:{name:"AddTagsToBinaryDataByIDs",I:Gy,O:By,kind:m.Unary},addTagsToBinaryDataByFilter:{name:"AddTagsToBinaryDataByFilter",I:Fy,O:xy,kind:m.Unary},removeTagsFromBinaryDataByIDs:{name:"RemoveTagsFromBinaryDataByIDs",I:Jy,O:zy,kind:m.Unary},removeTagsFromBinaryDataByFilter:{name:"RemoveTagsFromBinaryDataByFilter",I:Yy,O:$y,kind:m.Unary},tagsByFilter:{name:"TagsByFilter",I:Vy,O:Wy,kind:m.Unary},addBoundingBoxToImageByID:{name:"AddBoundingBoxToImageByID",I:jy,O:Hy,kind:m.Unary},removeBoundingBoxFromImageByID:{name:"RemoveBoundingBoxFromImageByID",I:Ky,O:Xy,kind:m.Unary},boundingBoxLabelsByFilter:{name:"BoundingBoxLabelsByFilter",I:ev,O:nv,kind:m.Unary},updateBoundingBox:{name:"UpdateBoundingBox",I:Qy,O:Zy,kind:m.Unary},getDatabaseConnection:{name:"GetDatabaseConnection",I:sv,O:ov,kind:m.Unary},configureDatabaseUser:{name:"ConfigureDatabaseUser",I:av,O:tv,kind:m.Unary},addBinaryDataToDatasetByIDs:{name:"AddBinaryDataToDatasetByIDs",I:iv,O:rv,kind:m.Unary},removeBinaryDataFromDatasetByIDs:{name:"RemoveBinaryDataFromDatasetByIDs",I:mv,O:cv,kind:m.Unary}}},lv=s.makeMessageType("viam.app.dataset.v1.Dataset",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"organization_id",kind:"scalar",T:9},{no:4,name:"time_created",kind:"message",T:S}]),P1=s.makeMessageType("viam.app.dataset.v1.CreateDatasetRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),D1=s.makeMessageType("viam.app.dataset.v1.CreateDatasetResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),A1=s.makeMessageType("viam.app.dataset.v1.DeleteDatasetRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),q1=s.makeMessageType("viam.app.dataset.v1.DeleteDatasetResponse",[]),U1=s.makeMessageType("viam.app.dataset.v1.RenameDatasetRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),L1=s.makeMessageType("viam.app.dataset.v1.RenameDatasetResponse",[]),G1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByOrganizationIDRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),B1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByOrganizationIDResponse",()=>[{no:1,name:"datasets",kind:"message",T:lv,repeated:!0}]),F1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByIDsRequest",()=>[{no:1,name:"ids",kind:"scalar",T:9,repeated:!0}]),x1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByIDsResponse",()=>[{no:1,name:"datasets",kind:"message",T:lv,repeated:!0}]),J1={typeName:"viam.app.dataset.v1.DatasetService",methods:{createDataset:{name:"CreateDataset",I:P1,O:D1,kind:m.Unary},deleteDataset:{name:"DeleteDataset",I:A1,O:q1,kind:m.Unary},renameDataset:{name:"RenameDataset",I:U1,O:L1,kind:m.Unary},listDatasetsByOrganizationID:{name:"ListDatasetsByOrganizationID",I:G1,O:B1,kind:m.Unary},listDatasetsByIDs:{name:"ListDatasetsByIDs",I:F1,O:x1,kind:m.Unary}}},z1=s.makeEnum("viam.app.datasync.v1.MimeType",[{no:0,name:"MIME_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MIME_TYPE_IMAGE_JPEG",localName:"IMAGE_JPEG"},{no:2,name:"MIME_TYPE_IMAGE_PNG",localName:"IMAGE_PNG"},{no:3,name:"MIME_TYPE_APPLICATION_PCD",localName:"APPLICATION_PCD"}]),Uo=s.makeEnum("viam.app.datasync.v1.DataType",[{no:0,name:"DATA_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"DATA_TYPE_BINARY_SENSOR",localName:"BINARY_SENSOR"},{no:2,name:"DATA_TYPE_TABULAR_SENSOR",localName:"TABULAR_SENSOR"},{no:3,name:"DATA_TYPE_FILE",localName:"FILE"}]),Lo=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:Dn},{no:2,name:"sensor_contents",kind:"message",T:Bo,repeated:!0}]),Y1=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadResponse",()=>[{no:1,name:"file_id",kind:"scalar",T:9},{no:2,name:"binary_data_id",kind:"scalar",T:9}]),$1=s.makeMessageType("viam.app.datasync.v1.FileUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:Dn,oneof:"upload_packet"},{no:2,name:"file_contents",kind:"message",T:H1,oneof:"upload_packet"}]),V1=s.makeMessageType("viam.app.datasync.v1.FileUploadResponse",()=>[{no:1,name:"file_id",kind:"scalar",T:9},{no:2,name:"binary_data_id",kind:"scalar",T:9}]),W1=s.makeMessageType("viam.app.datasync.v1.StreamingDataCaptureUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:K1,oneof:"upload_packet"},{no:2,name:"data",kind:"scalar",T:12,oneof:"upload_packet"}]),j1=s.makeMessageType("viam.app.datasync.v1.StreamingDataCaptureUploadResponse",()=>[{no:1,name:"file_id",kind:"scalar",T:9},{no:2,name:"binary_data_id",kind:"scalar",T:9}]),Go=s.makeMessageType("viam.app.datasync.v1.SensorMetadata",()=>[{no:1,name:"time_requested",kind:"message",T:S},{no:2,name:"time_received",kind:"message",T:S},{no:3,name:"mime_type",kind:"enum",T:s.getEnumType(z1)},{no:4,name:"annotations",kind:"message",T:qo}]),Bo=s.makeMessageType("viam.app.datasync.v1.SensorData",()=>[{no:1,name:"metadata",kind:"message",T:Go},{no:2,name:"struct",kind:"message",T:l,oneof:"data"},{no:3,name:"binary",kind:"scalar",T:12,oneof:"data"}]),H1=s.makeMessageType("viam.app.datasync.v1.FileData",()=>[{no:1,name:"data",kind:"scalar",T:12}]),Dn=s.makeMessageType("viam.app.datasync.v1.UploadMetadata",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"component_type",kind:"scalar",T:9},{no:3,name:"component_name",kind:"scalar",T:9},{no:5,name:"method_name",kind:"scalar",T:9},{no:6,name:"type",kind:"enum",T:s.getEnumType(Uo)},{no:7,name:"file_name",kind:"scalar",T:9},{no:8,name:"method_parameters",kind:"map",K:9,V:{kind:"message",T:j}},{no:9,name:"file_extension",kind:"scalar",T:9},{no:10,name:"tags",kind:"scalar",T:9,repeated:!0}]),K1=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadMetadata",()=>[{no:1,name:"upload_metadata",kind:"message",T:Dn},{no:2,name:"sensor_metadata",kind:"message",T:Go}]),X1={typeName:"viam.app.datasync.v1.DataSyncService",methods:{dataCaptureUpload:{name:"DataCaptureUpload",I:Lo,O:Y1,kind:m.Unary},fileUpload:{name:"FileUpload",I:$1,O:V1,kind:m.ClientStreaming},streamingDataCaptureUpload:{name:"StreamingDataCaptureUpload",I:W1,O:j1,kind:m.ClientStreaming}}},Q1=s.makeEnum("viam.app.datapipelines.v1.DataPipelineRunStatus",[{no:0,name:"DATA_PIPELINE_RUN_STATUS_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"DATA_PIPELINE_RUN_STATUS_SCHEDULED",localName:"SCHEDULED"},{no:2,name:"DATA_PIPELINE_RUN_STATUS_STARTED",localName:"STARTED"},{no:3,name:"DATA_PIPELINE_RUN_STATUS_COMPLETED",localName:"COMPLETED"},{no:4,name:"DATA_PIPELINE_RUN_STATUS_FAILED",localName:"FAILED"}]),dv=s.makeMessageType("viam.app.datapipelines.v1.DataPipeline",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"mql_binary",kind:"scalar",T:12,repeated:!0},{no:5,name:"schedule",kind:"scalar",T:9},{no:6,name:"enabled",kind:"scalar",T:8},{no:7,name:"created_on",kind:"message",T:S},{no:8,name:"updated_at",kind:"message",T:S}]),Z1=s.makeMessageType("viam.app.datapipelines.v1.GetDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),e_=s.makeMessageType("viam.app.datapipelines.v1.GetDataPipelineResponse",()=>[{no:1,name:"data_pipeline",kind:"message",T:dv}]),n_=s.makeMessageType("viam.app.datapipelines.v1.ListDataPipelinesRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),a_=s.makeMessageType("viam.app.datapipelines.v1.ListDataPipelinesResponse",()=>[{no:1,name:"data_pipelines",kind:"message",T:dv,repeated:!0}]),t_=s.makeMessageType("viam.app.datapipelines.v1.CreateDataPipelineRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"mql_binary",kind:"scalar",T:12,repeated:!0},{no:4,name:"schedule",kind:"scalar",T:9}]),s_=s.makeMessageType("viam.app.datapipelines.v1.CreateDataPipelineResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),o_=s.makeMessageType("viam.app.datapipelines.v1.UpdateDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"mql_binary",kind:"scalar",T:12,repeated:!0},{no:4,name:"schedule",kind:"scalar",T:9}]),i_=s.makeMessageType("viam.app.datapipelines.v1.UpdateDataPipelineResponse",[]),r_=s.makeMessageType("viam.app.datapipelines.v1.DeleteDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),m_=s.makeMessageType("viam.app.datapipelines.v1.DeleteDataPipelineResponse",[]),c_=s.makeMessageType("viam.app.datapipelines.v1.EnableDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),l_=s.makeMessageType("viam.app.datapipelines.v1.EnableDataPipelineResponse",[]),d_=s.makeMessageType("viam.app.datapipelines.v1.DisableDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),p_=s.makeMessageType("viam.app.datapipelines.v1.DisableDataPipelineResponse",[]),u_=s.makeMessageType("viam.app.datapipelines.v1.ListDataPipelineRunsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"page_size",kind:"scalar",T:13},{no:3,name:"page_token",kind:"scalar",T:9}]),g_=s.makeMessageType("viam.app.datapipelines.v1.ListDataPipelineRunsResponse",()=>[{no:1,name:"pipeline_id",kind:"scalar",T:9},{no:2,name:"runs",kind:"message",T:T_,repeated:!0},{no:3,name:"next_page_token",kind:"scalar",T:9}]),T_=s.makeMessageType("viam.app.datapipelines.v1.DataPipelineRun",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"start_time",kind:"message",T:S},{no:3,name:"end_time",kind:"message",T:S},{no:4,name:"data_start_time",kind:"message",T:S},{no:5,name:"data_end_time",kind:"message",T:S},{no:6,name:"status",kind:"enum",T:s.getEnumType(Q1)}]),k_={typeName:"viam.app.datapipelines.v1.DataPipelinesService",methods:{getDataPipeline:{name:"GetDataPipeline",I:Z1,O:e_,kind:m.Unary},listDataPipelines:{name:"ListDataPipelines",I:n_,O:a_,kind:m.Unary},createDataPipeline:{name:"CreateDataPipeline",I:t_,O:s_,kind:m.Unary},updateDataPipeline:{name:"UpdateDataPipeline",I:o_,O:i_,kind:m.Unary},deleteDataPipeline:{name:"DeleteDataPipeline",I:r_,O:m_,kind:m.Unary},enableDataPipeline:{name:"EnableDataPipeline",I:c_,O:l_,kind:m.Unary},disableDataPipeline:{name:"DisableDataPipeline",I:d_,O:p_,kind:m.Unary},listDataPipelineRuns:{name:"ListDataPipelineRuns",I:u_,O:g_,kind:m.Unary}}},Ve=()=>{console.warn("The BinaryID type is deprecated and will be removed in a future release. Please migrate to the BinaryDataId field instead.")};class y_{dataClient;datasetClient;dataSyncClient;dataPipelinesClient;constructor(e){this.dataClient=N(N1,e),this.datasetClient=N(J1,e),this.dataSyncClient=N(X1,e),this.dataPipelinesClient=N(k_,e)}async exportTabularData(e,n,t,o,i,r){const c=new Pn;i&&(c.start=S.fromDate(i)),r&&(c.end=S.fromDate(r));const d={partId:e,resourceName:n,resourceSubtype:t,methodName:o,interval:c},p=this.dataClient.exportTabularData(d),k=[];for await(const R of p)k.push({partId:R.partId,resourceName:R.resourceName,resourceSubtype:R.resourceSubtype,methodName:R.methodName,timeCaptured:R.timeCaptured.toDate(),organizationId:R.organizationId,locationId:R.locationId,robotName:R.robotName,robotId:R.robotId,partName:R.partName,methodParameters:R.methodParameters.toJson(),tags:R.tags,payload:R.payload.toJson()});return k}async tabularDataBySQL(e,n){return(await this.dataClient.tabularDataBySQL({organizationId:e,sqlQuery:n})).rawData.map(o=>Oa.deserialize(o))}async tabularDataByMQL(e,n,t,o){const i=n[0]instanceof Uint8Array?n:n.map(d=>Oa.serialize(d));let r=o;return t&&(!r||r.type===Ca.UNSPECIFIED)&&(r=new Do({type:Ca.HOT_STORAGE})),(await this.dataClient.tabularDataByMQL({organizationId:e,mqlBinary:i,dataSource:r})).rawData.map(d=>Oa.deserialize(d))}async tabularDataByFilter(e,n,t,o="",i=!1,r=!1){const d={dataRequest:{filter:e,limit:n===void 0?void 0:BigInt(n),sortOrder:t,last:o},countOnly:i,includeInternalData:r},p=await this.dataClient.tabularDataByFilter(d),k=p.metadata.length,R=[];return R.push(...p.data.map(I=>{const _=I.metadataIndex,M=k!==0&&_>=k?new Na:p.metadata[_];return{data:I.data?.toJson(),metadata:M,timeRequested:I.timeRequested?.toDate(),timeReceived:I.timeRequested?.toDate()}})),{data:R,count:p.count,last:p.last}}async binaryDataByFilter(e,n,t,o="",i=!0,r=!1,c=!1){const p={dataRequest:{filter:e,limit:n===void 0?void 0:BigInt(n),sortOrder:t,last:o},includeBinary:i,countOnly:r,includeInternalData:c},k=await this.dataClient.binaryDataByFilter(p);return{data:k.data,count:k.count,last:k.last}}async binaryDataByIds(e){return Array.isArray(e)&&typeof e[0]=="string"?(await this.dataClient.binaryDataByIDs({binaryDataIds:e,includeBinary:!0})).data:(Ve(),(await this.dataClient.binaryDataByIDs({binaryIds:e,includeBinary:!0})).data)}async deleteTabularData(e,n){return(await this.dataClient.deleteTabularData({organizationId:e,deleteOlderThanDays:n})).deletedCount}async deleteBinaryDataByFilter(e,n=!0){return(await this.dataClient.deleteBinaryDataByFilter({filter:e,includeInternalData:n})).deletedCount}async deleteBinaryDataByIds(e){return Array.isArray(e)&&typeof e[0]=="string"?(await this.dataClient.deleteBinaryDataByIDs({binaryDataIds:e})).deletedCount:(Ve(),(await this.dataClient.deleteBinaryDataByIDs({binaryIds:e})).deletedCount)}async addTagsToBinaryDataByIds(e,n){if(Array.isArray(n)&&typeof n[0]=="string"){await this.dataClient.addTagsToBinaryDataByIDs({tags:e,binaryDataIds:n});return}Ve(),await this.dataClient.addTagsToBinaryDataByIDs({tags:e,binaryIds:n})}async addTagsToBinaryDataByFilter(e,n){await this.dataClient.addTagsToBinaryDataByFilter({tags:e,filter:n})}async removeTagsFromBinaryDataByIds(e,n){return Array.isArray(n)&&typeof n[0]=="string"?(await this.dataClient.removeTagsFromBinaryDataByIDs({tags:e,binaryDataIds:n})).deletedCount:(Ve(),(await this.dataClient.removeTagsFromBinaryDataByIDs({tags:e,binaryIds:n})).deletedCount)}async removeTagsFromBinaryDataByFilter(e,n){return(await this.dataClient.removeTagsFromBinaryDataByFilter({tags:e,filter:n})).deletedCount}async tagsByFilter(e){return(await this.dataClient.tagsByFilter({filter:e})).tags}async addBoundingBoxToImageById(e,n,t,o,i,r){return typeof e=="string"?(await this.dataClient.addBoundingBoxToImageByID({binaryDataId:e,label:n,xMinNormalized:t,yMinNormalized:o,xMaxNormalized:i,yMaxNormalized:r})).bboxId:(Ve(),(await this.dataClient.addBoundingBoxToImageByID({binaryId:e,label:n,xMinNormalized:t,yMinNormalized:o,xMaxNormalized:i,yMaxNormalized:r})).bboxId)}async removeBoundingBoxFromImageById(e,n){if(typeof e=="string"){await this.dataClient.removeBoundingBoxFromImageByID({binaryDataId:e,bboxId:n});return}Ve(),await this.dataClient.removeBoundingBoxFromImageByID({binaryId:e,bboxId:n})}async boundingBoxLabelsByFilter(e){return(await this.dataClient.boundingBoxLabelsByFilter({filter:e})).labels}async configureDatabaseUser(e,n){await this.dataClient.configureDatabaseUser({organizationId:e,password:n})}async getDatabaseConnection(e){return(await this.dataClient.getDatabaseConnection({organizationId:e})).hostname}async addBinaryDataToDatasetByIds(e,n){if(Array.isArray(e)&&typeof e[0]=="string"){await this.dataClient.addBinaryDataToDatasetByIDs({binaryDataIds:e,datasetId:n});return}Ve(),await this.dataClient.addBinaryDataToDatasetByIDs({binaryIds:e,datasetId:n})}async removeBinaryDataFromDatasetByIds(e,n){if(Array.isArray(e)&&typeof e[0]=="string"){await this.dataClient.removeBinaryDataFromDatasetByIDs({binaryDataIds:e,datasetId:n});return}Ve(),await this.dataClient.removeBinaryDataFromDatasetByIDs({binaryIds:e,datasetId:n})}async createDataset(e,n){return(await this.datasetClient.createDataset({name:e,organizationId:n})).id}async deleteDataset(e){await this.datasetClient.deleteDataset({id:e})}async renameDataset(e,n){await this.datasetClient.renameDataset({id:e,name:n})}async listDatasetsByOrganizationID(e){return(await this.datasetClient.listDatasetsByOrganizationID({organizationId:e})).datasets.map(t=>({created:t.timeCreated?.toDate(),...t}))}async listDatasetsByIds(e){return(await this.datasetClient.listDatasetsByIDs({ids:e})).datasets.map(t=>({created:t.timeCreated?.toDate(),...t}))}async tabularDataCaptureUpload(e,n,t,o,i,r,c){if(r.length!==e.length)throw new Error("dataRequestTimes and data lengths must be equal.");const d=new Dn({partId:n,componentType:t,componentName:o,methodName:i,type:Uo.TABULAR_SENSOR,tags:c}),p=[];for(const[I,_]of e.entries()){const M=new Go,O=r[I];O&&(M.timeRequested=S.fromDate(O[0]),M.timeReceived=S.fromDate(O[1])),p.push(new Bo({metadata:M,data:{case:"struct",value:l.fromJson(_)}}))}const k=new Lo({metadata:d,sensorContents:p});return(await this.dataSyncClient.dataCaptureUpload(k)).fileId}async binaryDataCaptureUpload(e,n,t,o,i,r,c,d){const p=new Dn({partId:n,componentType:t,componentName:o,methodName:i,type:Uo.BINARY_SENSOR,tags:d,fileExtension:r}),k=new Bo({metadata:{timeRequested:S.fromDate(c[0]),timeReceived:S.fromDate(c[1])},data:{case:"binary",value:e}}),R=new Lo({metadata:p,sensorContents:[k]});return(await this.dataSyncClient.dataCaptureUpload(R)).binaryDataId}createFilter(e){const n=new $e(e);if(e.startTime??e.endTime){const o=new Pn;e.startTime&&(o.start=S.fromDate(e.startTime)),e.endTime&&(o.end=S.fromDate(e.endTime)),n.interval=o}const t=new Po;return e.tags&&(t.tags=e.tags,n.tagsFilter=t),n}async getLatestTabularData(e,n,t,o){const i=await this.dataClient.getLatestTabularData({partId:e,resourceName:n,resourceSubtype:t,methodName:o});return!i.payload||!i.timeCaptured||!i.timeSynced?null:[i.timeCaptured.toDate(),i.timeSynced.toDate(),i.payload.toJson()]}async listDataPipelines(e){return(await this.dataPipelinesClient.listDataPipelines({organizationId:e})).dataPipelines}async getDataPipeline(e){return(await this.dataPipelinesClient.getDataPipeline({id:e})).dataPipeline??null}async createDataPipeline(e,n,t,o){const i=t[0]instanceof Uint8Array?t:t.map(c=>Oa.serialize(c));return(await this.dataPipelinesClient.createDataPipeline({organizationId:e,name:n,mqlBinary:i,schedule:o})).id}async deleteDataPipeline(e){await this.dataPipelinesClient.deleteDataPipeline({id:e})}async listDataPipelineRuns(e,n){const t=await this.dataPipelinesClient.listDataPipelineRuns({id:e,pageSize:n});return new Pa(this.dataPipelinesClient,e,t.runs,n,t.nextPageToken)}}class Pa{constructor(e,n,t=[],o,i){this.dataPipelinesClient=e,this.pipelineId=n,this.runs=t,this.pageSize=o,this.nextPageToken=i}async nextPage(){if(this.nextPageToken===void 0||this.nextPageToken==="")return new Pa(this.dataPipelinesClient,this.pipelineId,[],this.pageSize,"");const e=await this.dataPipelinesClient.listDataPipelineRuns({id:this.pipelineId,pageSize:this.pageSize,pageToken:this.nextPageToken});return new Pa(this.dataPipelinesClient,this.pipelineId,e.runs,this.pageSize,e.nextPageToken)}}const v_={typeName:"viam.app.mltraining.v1.MLTrainingService",methods:{submitTrainingJob:{name:"SubmitTrainingJob",I:Zd,O:ep,kind:m.Unary},submitCustomTrainingJob:{name:"SubmitCustomTrainingJob",I:np,O:ap,kind:m.Unary},getTrainingJob:{name:"GetTrainingJob",I:tp,O:sp,kind:m.Unary},listTrainingJobs:{name:"ListTrainingJobs",I:op,O:ip,kind:m.Unary},cancelTrainingJob:{name:"CancelTrainingJob",I:rp,O:mp,kind:m.Unary},deleteCompletedTrainingJob:{name:"DeleteCompletedTrainingJob",I:cp,O:lp,kind:m.Unary},getTrainingJobLogs:{name:"GetTrainingJobLogs",I:pp,O:up,kind:m.Unary}}};class h_{client;constructor(e){this.client=N(v_,e)}async submitTrainingJob(e,n,t,o,i,r){return(await this.client.submitTrainingJob({organizationId:e,datasetId:n,modelName:t,modelVersion:o,modelType:i,tags:r})).id}async submitCustomTrainingJob(e,n,t,o,i,r){return(await this.client.submitCustomTrainingJob({organizationId:e,datasetId:n,registryItemId:t,registryItemVersion:o,modelName:i,modelVersion:r})).id}async getTrainingJob(e){return(await this.client.getTrainingJob({id:e})).metadata}async listTrainingJobs(e,n){return(await this.client.listTrainingJobs({organizationId:e,status:n})).jobs}async cancelTrainingJob(e){return await this.client.cancelTrainingJob({id:e}),null}async deleteCompletedTrainingJob(e){return await this.client.deleteCompletedTrainingJob({id:e}),null}}const pv=s.makeMessageType("viam.provisioning.v1.GetSmartMachineStatusRequest",[]),uv=s.makeMessageType("viam.provisioning.v1.GetSmartMachineStatusResponse",()=>[{no:1,name:"provisioning_info",kind:"message",T:fv},{no:2,name:"has_smart_machine_credentials",kind:"scalar",T:8},{no:3,name:"is_online",kind:"scalar",T:8},{no:4,name:"latest_connection_attempt",kind:"message",T:Fo},{no:5,name:"errors",kind:"scalar",T:9,repeated:!0}]),gv=s.makeMessageType("viam.provisioning.v1.SetNetworkCredentialsRequest",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"ssid",kind:"scalar",T:9},{no:3,name:"psk",kind:"scalar",T:9}]),Tv=s.makeMessageType("viam.provisioning.v1.SetNetworkCredentialsResponse",[]),kv=s.makeMessageType("viam.provisioning.v1.SetSmartMachineCredentialsRequest",()=>[{no:1,name:"cloud",kind:"message",T:xo}]),yv=s.makeMessageType("viam.provisioning.v1.SetSmartMachineCredentialsResponse",[]),vv=s.makeMessageType("viam.provisioning.v1.GetNetworkListRequest",[]),hv=s.makeMessageType("viam.provisioning.v1.GetNetworkListResponse",()=>[{no:1,name:"networks",kind:"message",T:Fo,repeated:!0}]),fv=s.makeMessageType("viam.provisioning.v1.ProvisioningInfo",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"model",kind:"scalar",T:9},{no:3,name:"manufacturer",kind:"scalar",T:9}]),Fo=s.makeMessageType("viam.provisioning.v1.NetworkInfo",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"ssid",kind:"scalar",T:9},{no:3,name:"security",kind:"scalar",T:9},{no:4,name:"signal",kind:"scalar",T:5},{no:5,name:"connected",kind:"scalar",T:8},{no:6,name:"last_error",kind:"scalar",T:9}]),xo=s.makeMessageType("viam.provisioning.v1.CloudConfig",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"secret",kind:"scalar",T:9},{no:3,name:"app_address",kind:"scalar",T:9}]),f_=Object.freeze(Object.defineProperty({__proto__:null,CloudConfig:xo,GetNetworkListRequest:vv,GetNetworkListResponse:hv,GetSmartMachineStatusRequest:pv,GetSmartMachineStatusResponse:uv,NetworkInfo:Fo,ProvisioningInfo:fv,SetNetworkCredentialsRequest:gv,SetNetworkCredentialsResponse:Tv,SetSmartMachineCredentialsRequest:kv,SetSmartMachineCredentialsResponse:yv},Symbol.toStringTag,{value:"Module"})),R_={typeName:"viam.provisioning.v1.ProvisioningService",methods:{getSmartMachineStatus:{name:"GetSmartMachineStatus",I:pv,O:uv,kind:m.Unary},setNetworkCredentials:{name:"SetNetworkCredentials",I:gv,O:Tv,kind:m.Unary},setSmartMachineCredentials:{name:"SetSmartMachineCredentials",I:kv,O:yv,kind:m.Unary},getNetworkList:{name:"GetNetworkList",I:vv,O:hv,kind:m.Unary}}};class __{client;constructor(e){this.client=N(R_,e)}async getSmartMachineStatus(){return this.client.getSmartMachineStatus({})}async setNetworkCredentials(e,n,t){await this.client.setNetworkCredentials({type:e,ssid:n,psk:t})}async setSmartMachineCredentials(e){await this.client.setSmartMachineCredentials({cloud:e})}async getNetworkList(){return(await this.client.getNetworkList({})).networks}}const S_=async({serviceHost:a="https://app.viam.com",credentials:e})=>{const n=await hR(a,e);return new I_(n,e)};class I_{transport;credentials;dataClient;appClient;mlTrainingClient;provisioningClient;billingClient;constructor(e,n){this.transport=e,this.credentials=n,this.dataClient=new y_(this.transport),this.appClient=new I1(this.transport),this.mlTrainingClient=new h_(this.transport),this.provisioningClient=new __(this.transport),this.billingClient=new E1(this.transport)}async connectToMachine({host:e=void 0,id:n=void 0}){if(e===void 0&&n===void 0)throw new Error("Either a machine address or ID must be provided");let t=e,o;if(n!==void 0&&e===void 0){const c=(await this.appClient.getRobotParts(n)).find(d=>d.mainPart);if(!c)throw new Error(`Could not find a main part for the machine with UUID: ${n}`);t=c.fqdn,o=c.locationId}if(t===void 0||t==="")throw new Error("Host was not provided and could not be obtained from the machine ID");let i=this.credentials;if(!En(i)){if(o===void 0){const c=t.split(".viam.")[0]?.split(".");c!==void 0&&(o=c.at(-1))}o!==void 0&&(i={type:"robot-location-secret",payload:(await this.appClient.getLocation(o))?.auth?.secrets.find(d=>d.state===So.ENABLED)?.secret,authEntity:t})}return Qd({host:t,credentials:i,signalingAddress:"https://app.viam.com:443",reconnectMaxAttempts:1})}}const{JointPositions:M_}=Ar;class b_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(qr),this.name=n,this.options=t}async getEndPosition(e={},n=this.callOptions){const t=new ut({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getEndPosition(t,n)).pose;if(!i)throw new Error("no pose");return i}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async moveToPosition(e,n={},t=this.callOptions){const o=new Tt({name:this.name,to:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.moveToPosition(o,t)}async moveToJointPositions(e,n={},t=this.callOptions){const o=new cn({values:e}),i=new kt({name:this.name,positions:o,extra:l.fromJson(n)});this.options.requestLogger?.(i),await this.client.moveToJointPositions(i,t)}async getJointPositions(e={},n=this.callOptions){const t=new gt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getJointPositions(t,n)).positions;if(!i)throw new Error("no pose");return i}async stop(e={},n=this.callOptions){const t=new yt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new vt({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{GetPropertiesResponse:E_}=zr;class w_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Yr),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async moveStraight(e,n,t={},o=this.callOptions){const i=new ht({name:this.name,mmPerSec:n,distanceMm:e?BigInt(e):void 0,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.moveStraight(i,o)}async spin(e,n,t={},o=this.callOptions){const i=new ft({name:this.name,angleDeg:e,degsPerSec:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.spin(i,o)}async setPower(e,n,t={},o=this.callOptions){const i=new _t({name:this.name,linear:e,angular:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPower(i,o)}async setVelocity(e,n,t={},o=this.callOptions){const i=new St({name:this.name,linear:e,angular:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setVelocity(i,o)}async stop(e={},n=this.callOptions){const t=new Rt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new It({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}async getProperties(e={},n=this.callOptions){const t=new ua({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}}const{ReadAnalogReaderResponse:O_,PowerMode:C_}=tm;class N_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(sm),this.name=n,this.options=t}async setGPIO(e,n,t={},o=this.callOptions){const i=new Mt({name:this.name,pin:e,high:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setGPIO(i,o)}async getGPIO(e,n={},t=this.callOptions){const o=new bt({name:this.name,pin:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getGPIO(o,t)).high}async getPWM(e,n={},t=this.callOptions){const o=new Et({name:this.name,pin:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.pWM(o,t)).dutyCyclePct}async setPWM(e,n,t={},o=this.callOptions){const i=new wt({name:this.name,pin:e,dutyCyclePct:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPWM(i,o)}async getPWMFrequency(e,n={},t=this.callOptions){const o=new Ot({name:this.name,pin:e,extra:l.fromJson(n)});this.options.requestLogger?.(o);const i=await this.client.pWMFrequency(o,t);return Number(i.frequencyHz)}async setPWMFrequency(e,n,t={},o=this.callOptions){const i=new Ct({name:this.name,pin:e,frequencyHz:n?BigInt(n):void 0,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPWMFrequency(i,o)}async readAnalogReader(e,n={},t=this.callOptions){const o=new Nt({boardName:this.name,analogReaderName:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),this.client.readAnalogReader(o,t)}async writeAnalog(e,n,t={},o=this.callOptions){const i=new Pt({name:this.name,pin:e,value:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.writeAnalog(i,o)}async getDigitalInterruptValue(e,n={},t=this.callOptions){const o=new Dt({boardName:this.name,digitalInterruptName:e,extra:l.fromJson(n)});this.options.requestLogger?.(o);const i=await this.client.getDigitalInterruptValue(o,t);return Number(i.value)}async streamTicks(e,n,t={},o=this.callOptions){const i=new At({name:this.name,pinNames:e,extra:l.fromJson(t)});this.options.requestLogger?.(i);const r=this.client.streamTicks(i,o);for await(const c of r)n.push({pinName:c.pinName,high:c.high,time:c.time?Number(c.time):0})}async setPowerMode(e,n,t={},o=this.callOptions){const i=new qt({name:this.name,powerMode:e,duration:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPowerMode(i,o)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const Jo=s.makeMessageType("viam.component.button.v1.PushRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Rv=s.makeMessageType("viam.component.button.v1.PushResponse",[]),P_=Object.freeze(Object.defineProperty({__proto__:null,PushRequest:Jo,PushResponse:Rv},Symbol.toStringTag,{value:"Module"})),D_={typeName:"viam.component.button.v1.ButtonService",methods:{push:{name:"Push",I:Jo,O:Rv,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}};class A_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(D_),this.name=n,this.options=t}async push(e={},n=this.callOptions){const t=new Jo({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.push(t,n)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const q_=s.makeMessageType("google.api.HttpBody",()=>[{no:1,name:"content_type",kind:"scalar",T:9},{no:2,name:"data",kind:"scalar",T:12},{no:3,name:"extensions",kind:"message",T:j,repeated:!0}]),U_={typeName:"viam.component.camera.v1.CameraService",methods:{getImage:{name:"GetImage",I:ro,O:Md,kind:m.Unary},getImages:{name:"GetImages",I:bd,O:Ed,kind:m.Unary},renderFrame:{name:"RenderFrame",I:co,O:q_,kind:m.Unary},getPointCloud:{name:"GetPointCloud",I:lo,O:wd,kind:m.Unary},getProperties:{name:"GetProperties",I:Od,O:Cd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},L_="pointcloud/pcd";class G_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(U_),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async getImage(e="",n={},t=this.callOptions){const o=new ro({name:this.name,mimeType:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getImage(o,t)).image}async renderFrame(e="",n={},t=this.callOptions){const o=new co({name:this.name,mimeType:e,extra:l.fromJson(n)});this.options.requestLogger?.(o);const i=await this.client.renderFrame(o,t);return new Blob([i.data],{type:e})}async getPointCloud(e={},n=this.callOptions){const t=new lo({name:this.name,mimeType:L_,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPointCloud(t,n)).pointCloud}async getProperties(e=this.callOptions){const n=new ua({name:this.name});return this.options.requestLogger?.(n),this.client.getProperties(n,e)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class B_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Al),this.name=n,this.options=t}async discoverResources(e={},n=this.callOptions){const t=new Ls({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.discoverResources(t,n)).discoveries}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{GetPropertiesResponse:F_,PositionType:_v}=mm;class x_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(cm),this.name=n,this.options=t}async resetPosition(e={},n=this.callOptions){const t=new Gt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.resetPosition(t,n)}async getProperties(e={},n=this.callOptions){const t=new Bt({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}async getPosition(e=_v.UNSPECIFIED,n={},t=this.callOptions){const o=new Lt({name:this.name,positionType:e,extra:l.fromJson(n)});this.options.requestLogger?.(o);const i=await this.client.getPosition(o,t);return[i.value,i.positionType]}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class J_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(km),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async getPosition(e={},n=this.callOptions){const t=new Ft({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).positionsMm}async moveToPosition(e,n,t={},o=this.callOptions){const i=new xt({name:this.name,positionsMm:e,speedsMmPerSec:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.moveToPosition(i,o)}async home(e={},n=this.callOptions){const t=new Jt({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.home(t,n)).homed}async getLengths(e={},n=this.callOptions){const t=new zt({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getLengths(t,n)).lengthsMm}async stop(e={},n=this.callOptions){const t=new Yt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new $t({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{Capsule:z_,GeoGeometry:Y_,GeoPoint:$_,GeometriesInFrame:V_,Geometry:W_,Orientation:j_,Pose:H_,PoseInFrame:K_,RectangularPrism:X_,ResourceName:Q_,Sphere:Z_,Transform:eS,Vector3:nS,WorldState:aS}=lt,Sv=a=>{const{latitude:e,longitude:n}=a;return!(typeof e!="number"||typeof n!="number"||Number.isNaN(e)||Number.isNaN(n))};class tS{client;options;name;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(jd),this.name=n,this.options=t}async metadata(e={},n=this.callOptions){const t=new $d({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.metadata(t,n)}async infer(e,n={},t=this.callOptions){const o=new Yd({name:this.name,inputTensors:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),this.client.infer(o,t)}}class sS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(xm),this.name=n,this.options=t}async setPower(e,n={},t=this.callOptions){const o=new Zt({name:this.name,powerPct:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.setPower(o,t)}async goFor(e,n,t={},o=this.callOptions){const i=new es({name:this.name,rpm:e,revolutions:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.goFor(i,o)}async goTo(e,n,t={},o=this.callOptions){const i=new ns({name:this.name,rpm:e,positionRevolutions:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.goTo(i,o)}async setRPM(e,n={},t=this.callOptions){const o=new as({name:this.name,rpm:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.setRPM(o,t)}async resetZeroPosition(e,n={},t=this.callOptions){const o=new ts({name:this.name,offset:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.resetZeroPosition(o,t)}async stop(e={},n=this.callOptions){const t=new os({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async getProperties(e={},n=this.callOptions){const t=new rs({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),{positionReporting:(await this.client.getProperties(t,n)).positionReporting}}async getPosition(e={},n=this.callOptions){const t=new ss({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).position}async isPowered(e={},n=this.callOptions){const t=new is({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.isPowered(t,n);return[o.isOn,o.powerPct]}async isMoving(e=this.callOptions){const n=new ms({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class oS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Xm),this.name=n,this.options=t}async getLinearVelocity(e={},n=this.callOptions){const t=new cs({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getLinearVelocity(t,n)).linearVelocity;if(!i)throw new Error("no linear velocity");return i}async getAngularVelocity(e={},n=this.callOptions){const t=new ls({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getAngularVelocity(t,n)).angularVelocity;if(!i)throw new Error("no angular velocity");return i}async getCompassHeading(e={},n=this.callOptions){const t=new ds({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getCompassHeading(t,n)).value}async getOrientation(e={},n=this.callOptions){const t=new ps({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getOrientation(t,n)).orientation;if(!i)throw new Error("no orientation");return i}async getPosition(e={},n=this.callOptions){const t=new us({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getPosition(t,n)}async getProperties(e={},n=this.callOptions){const t=new gs({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}async getAccuracy(e={},n=this.callOptions){const t=new Ts({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getAccuracy(t,n)}async getLinearAcceleration(e={},n=this.callOptions){const t=new ks({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getLinearAcceleration(t,n)).linearAcceleration;if(!i)throw new Error("no linear acceleration");return i}async getReadings(e={},n=this.callOptions){const t=new Ke({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getReadings(t,n),i={};for(const r of Object.keys(o.readings)){const c=o.readings[r];c&&(i[r]=c.toJson())}return i}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{GetAccuracyResponse:iS,GetPositionResponse:rS,GetPropertiesResponse:mS}=Km;class cS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(nc),this.name=n,this.options=t}async getVoltage(e={},n=this.callOptions){const t=new ys({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getVoltage(t,n);return[o.volts,o.isAc]}async getCurrent(e={},n=this.callOptions){const t=new vs({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getCurrent(t,n);return[o.amperes,o.isAc]}async getPower(e={},n=this.callOptions){const t=new hs({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPower(t,n)).watts}async getReadings(e={},n=this.callOptions){const t=new Ke({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getReadings(t,n),i={};for(const r of Object.keys(o.readings)){const c=o.readings[r];c&&(i[r]=c.toJson())}return i}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const Iv={typeName:"viam.component.sensor.v1.SensorService",methods:{getReadings:{name:"GetReadings",I:Ke,O:pa,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},lS=Object.freeze(Object.defineProperty({__proto__:null,SensorService:Iv},Symbol.toStringTag,{value:"Module"}));class dS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Iv),this.name=n,this.options=t}async getReadings(e={},n=this.callOptions){const t=new Ke({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getReadings(t,n),i={};for(const r of Object.keys(o.readings)){const c=o.readings[r];c&&(i[r]=c.toJson())}return i}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const Mv=s.makeMessageType("proto.stream.v1.ListStreamsRequest",[]),bv=s.makeMessageType("proto.stream.v1.ListStreamsResponse",()=>[{no:1,name:"names",kind:"scalar",T:9,repeated:!0}]),zo=s.makeMessageType("proto.stream.v1.AddStreamRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Ev=s.makeMessageType("proto.stream.v1.AddStreamResponse",[]),Yo=s.makeMessageType("proto.stream.v1.RemoveStreamRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),wv=s.makeMessageType("proto.stream.v1.RemoveStreamResponse",[]),$o=s.makeMessageType("proto.stream.v1.Resolution",()=>[{no:1,name:"width",kind:"scalar",T:5},{no:2,name:"height",kind:"scalar",T:5}]),Vo=s.makeMessageType("proto.stream.v1.GetStreamOptionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Ov=s.makeMessageType("proto.stream.v1.GetStreamOptionsResponse",()=>[{no:1,name:"resolutions",kind:"message",T:$o,repeated:!0}]),Da=s.makeMessageType("proto.stream.v1.SetStreamOptionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"resolution",kind:"message",T:$o}]),Cv=s.makeMessageType("proto.stream.v1.SetStreamOptionsResponse",[]),pS=Object.freeze(Object.defineProperty({__proto__:null,AddStreamRequest:zo,AddStreamResponse:Ev,GetStreamOptionsRequest:Vo,GetStreamOptionsResponse:Ov,ListStreamsRequest:Mv,ListStreamsResponse:bv,RemoveStreamRequest:Yo,RemoveStreamResponse:wv,Resolution:$o,SetStreamOptionsRequest:Da,SetStreamOptionsResponse:Cv},Symbol.toStringTag,{value:"Module"})),uS={typeName:"proto.stream.v1.StreamService",methods:{listStreams:{name:"ListStreams",I:Mv,O:bv,kind:m.Unary},addStream:{name:"AddStream",I:zo,O:Ev,kind:m.Unary},getStreamOptions:{name:"GetStreamOptions",I:Vo,O:Ov,kind:m.Unary},setStreamOptions:{name:"SetStreamOptions",I:Da,O:Cv,kind:m.Unary},removeStream:{name:"RemoveStream",I:Yo,O:wv,kind:m.Unary}}},An=a=>a.replaceAll(":","+");class gS extends Ir{client;options;streams;constructor(e,n={}){super(),this.client=e.createServiceClient(uS),this.options=n,this.streams=new Set,e.on("track",t=>{this.emit("track",t)}),e.on(ne.CONNECTED,()=>{for(const t of this.streams.values())this.add(t)})}async add(e){const n=new zo({name:An(e)});this.options.requestLogger?.(n);try{await this.client.addStream(n),this.streams.add(e)}catch{n.name=e,this.options.requestLogger?.(n),await this.client.addStream(n),this.streams.add(e)}}async remove(e){const n=new Yo({name:An(e)});this.options.requestLogger?.(n);try{await this.client.removeStream(n),this.streams.delete(e)}catch{n.name=e,this.options.requestLogger?.(n),await this.client.removeStream(n),this.streams.delete(e)}}async getOptions(e){const n=async i=>{const r=new Vo({name:i});this.options.requestLogger?.(r);try{return(await this.client.getStreamOptions(r)).resolutions}catch{return[]}},t=An(e);let o=await n(t);return o.length>0||(o=await n(e)),o}async setOptions(e,n,t){const o=new Da({name:An(e),resolution:{width:n,height:t}});this.options.requestLogger?.(o);try{await this.client.setStreamOptions(o)}catch{o.name=e,this.options.requestLogger?.(o),await this.client.setStreamOptions(o)}}async resetOptions(e){const n=new Da({name:An(e)});this.options.requestLogger?.(n);try{await this.client.setStreamOptions(n)}catch{n.name=e,this.options.requestLogger?.(n),await this.client.setStreamOptions(n)}}STREAM_TIMEOUT=5e3;getStream=async e=>{const n=new Promise((t,o)=>{const i=r=>{const[c]=r.streams;c?c.id===e&&(this.off("track",i),t(c)):(this.off("track",i),o(new Error("Received track event with no streams")))};this.on("track",i),setTimeout(()=>{this.off("track",i),o(new Error(`Did not receive a stream after ${this.STREAM_TIMEOUT} ms`))},this.STREAM_TIMEOUT)});return await this.add(e),n}}const Wo=s.makeMessageType("viam.component.switch.v1.SetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"position",kind:"scalar",T:13},{no:99,name:"extra",kind:"message",T:l}]),Nv=s.makeMessageType("viam.component.switch.v1.SetPositionResponse",[]),jo=s.makeMessageType("viam.component.switch.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Pv=s.makeMessageType("viam.component.switch.v1.GetPositionResponse",()=>[{no:1,name:"position",kind:"scalar",T:13}]),Ho=s.makeMessageType("viam.component.switch.v1.GetNumberOfPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Dv=s.makeMessageType("viam.component.switch.v1.GetNumberOfPositionsResponse",()=>[{no:1,name:"number_of_positions",kind:"scalar",T:13}]),TS=Object.freeze(Object.defineProperty({__proto__:null,GetNumberOfPositionsRequest:Ho,GetNumberOfPositionsResponse:Dv,GetPositionRequest:jo,GetPositionResponse:Pv,SetPositionRequest:Wo,SetPositionResponse:Nv},Symbol.toStringTag,{value:"Module"})),kS={typeName:"viam.component.switch.v1.SwitchService",methods:{setPosition:{name:"SetPosition",I:Wo,O:Nv,kind:m.Unary},getPosition:{name:"GetPosition",I:jo,O:Pv,kind:m.Unary},getNumberOfPositions:{name:"GetNumberOfPositions",I:Ho,O:Dv,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}};class yS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(kS),this.name=n,this.options=t}async setPosition(e,n={},t=this.callOptions){const o=new Wo({name:this.name,position:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.setPosition(o,t)}async getPosition(e={},n=this.callOptions){const t=new jo({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).position}async getNumberOfPositions(e={},n=this.callOptions){const t=new Ho({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getNumberOfPositions(t,n)).numberOfPositions}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}let vS=class{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Vt),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}};class hS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Rm),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async open(e={},n=this.callOptions){const t=new Wt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.open(t,n)}async grab(e={},n=this.callOptions){const t=new jt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.grab(t,n)}async stop(e={},n=this.callOptions){const t=new Ht({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new Kt({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class fS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Cm),this.name=n,this.options=t}async getEvents(e={},n=this.callOptions){const t=new Xt({controller:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getEvents(t,n)).events}async triggerEvent(e,n={},t=this.callOptions){const o=new Qt({controller:this.name,event:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.triggerEvent(o,t)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{Event:RS}=Om,{CollisionSpecification:_S,Constraints:SS,GetPlanResponse:KS,LinearConstraint:IS,ListPlanStatusesResponse:MS,MotionConfiguration:bS,ObstacleDetector:ES,OrientationConstraint:wS,PlanState:XS}=Zl;class OS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(ed),this.name=n,this.options=t}async move(e,n,t,o,i={},r=this.callOptions){const c=new Gs({name:this.name,destination:e,componentName:n,worldState:t,constraints:o,extra:l.fromJson(i)});return this.options.requestLogger?.(c),(await this.client.move(c,r)).success}async moveOnMap(e,n,t,o,i,r={},c=this.callOptions){const d=new Bs({name:this.name,destination:e,componentName:n,slamServiceName:t,motionConfiguration:o,obstacles:i,extra:l.fromJson(r)});return this.options.requestLogger?.(d),(await this.client.moveOnMap(d,c)).executionId}async moveOnGlobe(e,n,t,o,i,r,c,d={},p=this.callOptions){const k=new xs({name:this.name,destination:e,componentName:n,movementSensorName:t,heading:o,obstacles:i,boundingRegions:c,motionConfiguration:r,extra:l.fromJson(d)});return this.options.requestLogger?.(k),(await this.client.moveOnGlobe(k,p)).executionId}async stopPlan(e,n={},t=this.callOptions){const o=new zs({name:this.name,componentName:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),await this.client.stopPlan(o,t),null}async getPlan(e,n,t,o={},i=this.callOptions){const r=new $s({name:this.name,componentName:e,lastPlanOnly:n,executionId:t,extra:l.fromJson(o)});return this.options.requestLogger?.(r),this.client.getPlan(r,i)}async listPlanStatuses(e,n={},t=this.callOptions){const o=new Ys({name:this.name,onlyActivePlans:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),this.client.listPlanStatuses(o,t)}async getPose(e,n,t,o={},i=this.callOptions){const r=new Js({name:this.name,componentName:e,destinationFrame:n,supplementalTransforms:t,extra:l.fromJson(o)});this.options.requestLogger?.(r);const d=(await this.client.getPose(r,i)).pose;if(!d)throw new Error("no pose");return d}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const Ko=s.makeMessageType("viam.service.datamanager.v1.SyncRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Av=s.makeMessageType("viam.service.datamanager.v1.SyncResponse",[]),CS=Object.freeze(Object.defineProperty({__proto__:null,SyncRequest:Ko,SyncResponse:Av},Symbol.toStringTag,{value:"Module"})),NS={typeName:"viam.service.datamanager.v1.DataManagerService",methods:{sync:{name:"Sync",I:Ko,O:Av,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}};class PS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(NS),this.name=n,this.options=t}async sync(e={},n=this.callOptions){const t=new Ko({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.sync(t,n)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class DS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(gd),this.name=n,this.options=t}async getMode(e={},n=this.callOptions){const t=new js({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getMode(t,n)).mode}async setMode(e,n={},t=this.callOptions){const o=new Hs({name:this.name,mode:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.setMode(o,t)}async getLocation(e={},n=this.callOptions){const t=new Ks({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getLocation(t,n);if(!o.location)throw new Error("no location");if(!Sv(o.location))throw new Error("invalid location");return o}async getWayPoints(e={},n=this.callOptions){const t=new Xs({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getWaypoints(t,n)).waypoints}async addWayPoint(e,n={},t=this.callOptions){const o=new Qs({name:this.name,location:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.addWaypoint(o,t)}async removeWayPoint(e,n={},t=this.callOptions){const o=new Zs({name:this.name,id:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.removeWaypoint(o,t)}async getObstacles(e={},n=this.callOptions){const t=new eo({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getObstacles(t,n)).obstacles}async getPaths(e={},n=this.callOptions){const t=new no({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPaths(t,n)).paths}async getProperties(e=this.callOptions){const n=new ao({name:this.name});return this.options.requestLogger?.(n),this.client.getProperties(n,e)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{GetLocationResponse:AS,GetPropertiesResponse:qS,Mode:QS,Path:US,Waypoint:LS}=ud;class GS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(ic),this.name=n,this.options=t}async move(e,n={},t=this.callOptions){const o=new fs({name:this.name,angleDeg:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.move(o,t)}async getPosition(e={},n=this.callOptions){const t=new Rs({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).positionDeg}async stop(e={},n=this.callOptions){const t=new _s({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new Ss({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class BS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Sd),this.name=n,this.options=t}async getPosition(e=this.callOptions){const n=new to({name:this.name});return this.options.requestLogger?.(n),this.client.getPosition(n,e)}async getPointCloudMap(e,n=this.callOptions){const t=new so({name:this.name,returnEditedMap:e});this.options.requestLogger?.(t);const o=[],i=this.client.getPointCloudMap(t,n);for await(const r of i)o.push(r.pointCloudPcdChunk);return qv(o)}async getInternalState(e=this.callOptions){const n=new oo({name:this.name});this.options.requestLogger?.(n);const t=[],o=this.client.getInternalState(n,e);for await(const i of o)t.push(i.internalStateChunk);return qv(t)}async getProperties(e=this.callOptions){const n=new io({name:this.name});return this.options.requestLogger?.(n),this.client.getProperties(n,e)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const qv=a=>{const e=a.reduce((o,i)=>o+i.length,0),n=new Uint8Array(e);let t=0;for(const o of a)n.set(o,t),t+=o.length;return n},{GetPositionResponse:FS,GetPropertiesResponse:xS}=_d;class JS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(zd),this.name=n,this.options=t}async getDetectionsFromCamera(e,n={},t=this.callOptions){const o=new uo({name:this.name,cameraName:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getDetectionsFromCamera(o,t)).detections}async getDetections(e,n,t,o,i={},r=this.callOptions){const c=new po({name:this.name,image:e,width:n?BigInt(n):void 0,height:t?BigInt(t):void 0,mimeType:o,extra:l.fromJson(i)});return this.options.requestLogger?.(c),(await this.client.getDetections(c,r)).detections}async getClassificationsFromCamera(e,n,t={},o=this.callOptions){const i=new To({name:this.name,cameraName:e,n,extra:l.fromJson(t)});return this.options.requestLogger?.(i),(await this.client.getClassificationsFromCamera(i,o)).classifications}async getClassifications(e,n,t,o,i,r={},c=this.callOptions){const d=new go({name:this.name,image:e,width:n,height:t,mimeType:o,n:i,extra:l.fromJson(r)});return this.options.requestLogger?.(d),(await this.client.getClassifications(d,c)).classifications}async getObjectPointClouds(e,n={},t=this.callOptions){const o=new ko({name:this.name,cameraName:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getObjectPointClouds(o,t)).objects}async getProperties(e={},n=this.callOptions){const t=new yo({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getProperties(t,n);return{classificationsSupported:o.classificationsSupported,detectionsSupported:o.detectionsSupported,objectPointCloudsSupported:o.objectPointCloudsSupported}}async captureAllFromCamera(e,{returnImage:n,returnClassifications:t,returnDetections:o,returnObjectPointClouds:i},r={},c=this.callOptions){const d=new vo({name:this.name,cameraName:e,returnImage:n,returnClassifications:t,returnDetections:o,returnObjectPointClouds:i,extra:l.fromJson(r)});this.options.requestLogger?.(d);const p=await this.client.captureAllFromCamera(d,c);return{image:p.image,classifications:p.classifications,detections:p.detections,objectPointClouds:p.objects,extra:p.extra}}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{Classification:zS,Detection:YS}=Jd,{PointCloudObject:$S}=lt,Uv={typeName:"viam.service.generic.v1.GenericService",methods:{doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},VS=Object.freeze(Object.defineProperty({__proto__:null,GenericService:Uv},Symbol.toStringTag,{value:"Module"}));class WS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Uv),this.name=n,this.options=t}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const jS="0.42.0";T.AnalogValue=O_,T.ArmClient=b_,T.ArmJointPositions=M_,T.BaseClient=w_,T.BaseProperties=E_,T.BoardClient=N_,T.ButtonClient=A_,T.CameraClient=G_,T.Capsule=z_,T.Classification=zS,T.Client=D,T.CloudConfig=xo,T.CollisionSpecification=_S,T.ConnectError=C,T.ConnectionClosedError=le,T.Constraints=SS,T.DataManagerClient=PS,T.Detection=YS,T.DiscoveryClient=B_,T.Duration=F,T.EncoderClient=x_,T.EncoderPositionType=_v,T.EncoderProperties=F_,T.GantryClient=J_,T.GenericComponentClient=vS,T.GenericServiceClient=WS,T.GeoGeometry=Y_,T.GeoPoint=$_,T.GeometriesInFrame=V_,T.Geometry=W_,T.GripperClient=hS,T.InputControllerClient=fS,T.InputControllerEvent=RS,T.LinearConstraint=IS,T.ListPlanStatusesResponse=MS,T.MLModelClient=tS,T.MachineConnectionEvent=ne,T.ModelType=ze,T.MotionClient=OS,T.MotionConfiguration=bS,T.MotorClient=sS,T.MovementSensorAccuracy=iS,T.MovementSensorClient=oS,T.MovementSensorPosition=rS,T.MovementSensorProperties=mS,T.NavigationClient=DS,T.NavigationPosition=AS,T.NavigationProperties=qS,T.ObstacleDetector=ES,T.Orientation=j_,T.OrientationConstraint=wS,T.Path=US,T.PointCloudObject=$S,T.Pose=H_,T.PoseInFrame=K_,T.PowerMode=C_,T.PowerSensorClient=cS,T.RectangularPrism=X_,T.ResourceName=Q_,T.RobotClient=D,T.SensorClient=dS,T.ServoClient=GS,T.SlamClient=BS,T.SlamPosition=FS,T.SlamProperties=xS,T.Sphere=Z_,T.StreamClient=gS,T.Struct=l,T.SwitchClient=yS,T.Timestamp=S,T.TrainingStatus=fa,T.Transform=eS,T.Vector3=nS,T.VisionClient=JS,T.Waypoint=LS,T.WorldState=aS,T.addMetadata=yR,T.appApi=_1,T.appRobotApi=FR,T.armApi=Ar,T.baseApi=zr,T.billingApi=M1,T.boardApi=tm,T.buttonApi=P_,T.cameraApi=zR,T.commonApi=lt,T.createRobotClient=Qd,T.createViamClient=S_,T.dataApi=C1,T.dataManagerApi=CS,T.deleteMetadata=vR,T.disableDebugLogging=kR,T.discoveryApi=xR,T.doCommandFromClient=G,T.enableDebugLogging=TR,T.encoderApi=mm,T.gantryApi=SR,T.genericComponentApi=IR,T.genericServiceApi=VS,T.gripperApi=MR,T.inputControllerApi=Om,T.isValidGeoPoint=Sv,T.mlTrainingApi=R1,T.motionApi=Zl,T.motorApi=ER,T.movementSensorApi=Km,T.navigationApi=ud,T.powerSensorApi=wR,T.provisioningApi=f_,T.robotApi=NR,T.sensorApi=lS,T.servoApi=CR,T.slamApi=_d,T.streamApi=pS,T.switchApi=TS,T.version=jS,T.visionApi=Jd,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
8
+ };`],{type:"text/javascript"});class Xe{constructor(e,n){this.deferredTransport=n,this.host=e,this.transport=new a1(this.deferredTransport,this)}static heartbeatMonitoredMethods={};transport;currentSessionID="";sessionsSupported;heartbeatIntervalMs;host="";starting;get client(){const e=this.deferredTransport();return aa(As,e)}get sessionID(){return this.currentSessionID}getSessionMetadataInner(){const e=new Headers;return this.sessionsSupported&&this.currentSessionID!==""&&e.set("viam-sid",this.currentSessionID),e}reset(){this.starting||(this.sessionsSupported=void 0)}backgroundHeartbeat=!0;async heartbeat(){if(!this.sessionsSupported||this.currentSessionID==="")return;for(;this.starting;)await this.starting;let e;const n=async()=>{const t=new Ns({id:this.currentSessionID});try{await this.client.sendSessionHeartbeat(t)}catch(o){if(o instanceof C&&o.code===T.Code.Unimplemented){console.error("sessions unsupported; will not try again"),this.sessionsSupported=!1;return}if(o instanceof le||o instanceof C&&o.rawMessage==="closed"){this.reset();return}}e?e.postMessage(this.heartbeatIntervalMs):setTimeout(()=>{n().catch(console.error)},this.heartbeatIntervalMs)};if(this.backgroundHeartbeat&&globalThis.Worker!==void 0){const t=window.URL.createObjectURL(t1);e=new Worker(t),URL.revokeObjectURL(t),e.addEventListener("message",()=>{n().catch(console.error)})}n().catch(console.error)}async getSessionMetadata(){for(;this.starting;)await this.starting;return this.sessionsSupported!==void 0?this.getSessionMetadataInner():(this.starting=new Promise((e,n)=>{(async()=>{const t=new Cs;this.currentSessionID!==""&&(t.resume=this.currentSessionID);let o;try{o=await this.client.startSession(t)}catch(r){if(r instanceof C&&r.code===T.Code.Unimplemented){console.error("sessions unsupported; will not try again"),this.sessionsSupported=!1;return}throw r}const{heartbeatWindow:i}=o;if(!i)throw new Error("expected heartbeat window in response to start session");this.sessionsSupported=!0,this.currentSessionID=o.id,this.heartbeatIntervalMs=(Number(i.seconds)*1e3+i.nanos/1e6)/5,await this.applyHeartbeatMonitoredMethods(),e(),this.heartbeat().catch(console.error)})().then(e).catch(n).finally(()=>{this.starting=void 0})}),await this.starting,this.getSessionMetadataInner())}async applyHeartbeatMonitoredMethods(){try{const e=aa(n1,this.transport),n=new ha({host:this.host,messageRequest:{case:"listServices",value:""}}),t=e.serverReflectionInfo(Fa([n]),{timeoutMs:1e4});for await(const o of t){const i=o.messageResponse.value.service.map(c=>new ha({messageRequest:{case:"fileContainingSymbol",value:c.name}})),r=e.serverReflectionInfo(Fa(i),{timeoutMs:1e4});for await(const c of r)for(const d of c.messageResponse.value.fileDescriptorProto){const p=se.fromBinary(d);for(const k of p.service)for(const R of k.method)Xe.heartbeatMonitoredMethods[`/${p.package}.${k.name}/${R.name}`]=Xe.hasHeartbeatOption(R.options)}}}catch{Xe.heartbeatMonitoredMethods={"/viam.component.arm.v1.ArmService/MoveToPosition":!0,"/viam.component.arm.v1.ArmService/MoveToJointPositions":!0,"/viam.component.arm.v1.ArmService/MoveThroughJointPositions":!0,"/viam.component.base.v1.BaseService/MoveStraight":!0,"/viam.component.base.v1.BaseService/Spin":!0,"/viam.component.base.v1.BaseService/SetPower":!0,"/viam.component.base.v1.BaseService/SetVelocity":!0,"/viam.component.gantry.v1.GantryService/MoveToPosition":!0,"/viam.component.gripper.v1.GripperService/Open":!0,"/viam.component.gripper.v1.GripperService/Grab":!0,"/viam.component.motor.v1.MotorService/SetPower":!0,"/viam.component.motor.v1.MotorService/GoFor":!0,"/viam.component.motor.v1.MotorService/GoTo":!0,"/viam.component.motor.v1.MotorService/SetRPM":!0,"/viam.component.servo.v1.ServoService/Move":!0}}}static hasHeartbeatOption(e){if(!e)return!1;const n=new pi(e.toBinary());for(;n.pos<n.len;){const t=n.tag(),[o]=t;if(o===Sr.field.no)return!0;n.string()}return!1}}const s1=s.makeEnum("viam.service.mlmodel.v1.LabelType",[{no:0,name:"LABEL_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"LABEL_TYPE_TENSOR_VALUE",localName:"TENSOR_VALUE"},{no:2,name:"LABEL_TYPE_TENSOR_AXIS",localName:"TENSOR_AXIS"}]),Yd=s.makeMessageType("viam.service.mlmodel.v1.InferRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:3,name:"input_tensors",kind:"message",T:Wd},{no:99,name:"extra",kind:"message",T:l}]),o1=s.makeMessageType("viam.service.mlmodel.v1.InferResponse",()=>[{no:3,name:"output_tensors",kind:"message",T:Wd}]),$d=s.makeMessageType("viam.service.mlmodel.v1.MetadataRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),i1=s.makeMessageType("viam.service.mlmodel.v1.MetadataResponse",()=>[{no:1,name:"metadata",kind:"message",T:r1}]),r1=s.makeMessageType("viam.service.mlmodel.v1.Metadata",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"description",kind:"scalar",T:9},{no:4,name:"input_info",kind:"message",T:Vd,repeated:!0},{no:5,name:"output_info",kind:"message",T:Vd,repeated:!0}]),Vd=s.makeMessageType("viam.service.mlmodel.v1.TensorInfo",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9},{no:3,name:"data_type",kind:"scalar",T:9},{no:4,name:"shape",kind:"scalar",T:5,repeated:!0},{no:5,name:"associated_files",kind:"message",T:m1,repeated:!0},{no:99,name:"extra",kind:"message",T:l}]),m1=s.makeMessageType("viam.service.mlmodel.v1.File",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"description",kind:"scalar",T:9},{no:3,name:"label_type",kind:"enum",T:s.getEnumType(s1)}]),c1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt8",()=>[{no:1,name:"data",kind:"scalar",T:12}]),l1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt8",()=>[{no:1,name:"data",kind:"scalar",T:12}]),d1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt16",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),p1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt16",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),u1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt32",()=>[{no:1,name:"data",kind:"scalar",T:15,repeated:!0}]),g1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt32",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),T1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt64",()=>[{no:1,name:"data",kind:"scalar",T:16,repeated:!0}]),k1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt64",()=>[{no:1,name:"data",kind:"scalar",T:6,repeated:!0}]),y1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataFloat",()=>[{no:1,name:"data",kind:"scalar",T:2,repeated:!0}]),v1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataDouble",()=>[{no:1,name:"data",kind:"scalar",T:1,repeated:!0}]),h1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensor",()=>[{no:1,name:"shape",kind:"scalar",T:6,repeated:!0},{no:2,name:"int8_tensor",kind:"message",T:c1,oneof:"tensor"},{no:3,name:"uint8_tensor",kind:"message",T:l1,oneof:"tensor"},{no:4,name:"int16_tensor",kind:"message",T:d1,oneof:"tensor"},{no:5,name:"uint16_tensor",kind:"message",T:p1,oneof:"tensor"},{no:6,name:"int32_tensor",kind:"message",T:u1,oneof:"tensor"},{no:7,name:"uint32_tensor",kind:"message",T:g1,oneof:"tensor"},{no:8,name:"int64_tensor",kind:"message",T:T1,oneof:"tensor"},{no:9,name:"uint64_tensor",kind:"message",T:k1,oneof:"tensor"},{no:10,name:"float_tensor",kind:"message",T:y1,oneof:"tensor"},{no:11,name:"double_tensor",kind:"message",T:v1,oneof:"tensor"}]),Wd=s.makeMessageType("viam.service.mlmodel.v1.FlatTensors",()=>[{no:1,name:"tensors",kind:"map",K:9,V:{kind:"message",T:h1}}]),jd={typeName:"viam.service.mlmodel.v1.MLModelService",methods:{infer:{name:"Infer",I:Yd,O:o1,kind:m.Unary},metadata:{name:"Metadata",I:$d,O:i1,kind:m.Unary}}};class D extends Ir{serviceHost;webrtcOptions;directOptions;sessionOptions;gRPCConnectionManager;sessionManager;peerConn;transport;connecting;connectResolve;savedCreds;closed;robotServiceClient;armServiceClient;baseServiceClient;boardServiceClient;encoderServiceClient;gantryServiceClient;genericServiceClient;gripperServiceClient;mlModelServiceClient;movementSensorServiceClient;powerSensorServiceClient;inputControllerServiceClient;motorServiceClient;navigationServiceClient;discoveryServiceClient;motionServiceClient;visionServiceClient;servoServiceClient;slamServiceClient;constructor(e,n,t,o){super(),this.serviceHost=e,this.webrtcOptions=n,this.directOptions=o,this.sessionOptions=t,this.gRPCConnectionManager=new WR(()=>{if(!this.transport)throw new Error(D.notConnectedYetStr);return this.transport},()=>{this.onDisconnect()}),this.sessionManager=new Xe(this.serviceHost,()=>{if(!this.transport)throw new Error(D.notConnectedYetStr);return this.transport});for(const i of Object.values(ne))this.on(i,()=>{this.emit("connectionstatechange",{eventType:i})});this.closed=!1}onDisconnect(e){if(this.emit(ne.DISCONNECTED,e??{}),this.noReconnect!==void 0&&this.noReconnect||this.closed)return;console.debug("Connection closed, will try to reconnect");const n={retry:(t,o)=>(console.debug(`Failed to connect, attempt ${o} with backoff`,t),!0)};this.reconnectMaxWait!==void 0&&(n.maxDelay=this.reconnectMaxWait),this.reconnectMaxAttempts!==void 0&&(n.numOfAttempts=this.reconnectMaxAttempts),Qa(async()=>this.connect(),n).then(()=>{console.debug("Reconnected successfully!")}).catch(()=>{console.debug(`Reached max attempts: ${this.reconnectMaxAttempts}`)})}get noReconnect(){return this.webrtcOptions?.noReconnect??this.directOptions?.noReconnect}get reconnectMaxAttempts(){return this.webrtcOptions?.reconnectMaxAttempts??this.directOptions?.reconnectMaxAttempts}get reconnectMaxWait(){return this.webrtcOptions?.reconnectMaxWait??this.directOptions?.reconnectMaxWait}get sessionId(){return this.sessionManager.sessionID}static notConnectedYetStr="not connected yet";get robotService(){if(!this.robotServiceClient)throw new Error(D.notConnectedYetStr);return this.robotServiceClient}get armService(){if(!this.armServiceClient)throw new Error(D.notConnectedYetStr);return this.armServiceClient}get baseService(){if(!this.baseServiceClient)throw new Error(D.notConnectedYetStr);return this.baseServiceClient}get boardService(){if(!this.boardServiceClient)throw new Error(D.notConnectedYetStr);return this.boardServiceClient}get encoderService(){if(!this.encoderServiceClient)throw new Error(D.notConnectedYetStr);return this.encoderServiceClient}get gantryService(){if(!this.gantryServiceClient)throw new Error(D.notConnectedYetStr);return this.gantryServiceClient}get genericService(){if(!this.genericServiceClient)throw new Error(D.notConnectedYetStr);return this.genericServiceClient}get gripperService(){if(!this.gripperServiceClient)throw new Error(D.notConnectedYetStr);return this.gripperServiceClient}get mlModelService(){if(!this.mlModelServiceClient)throw new Error(D.notConnectedYetStr);return this.mlModelServiceClient}get movementSensorService(){if(!this.movementSensorServiceClient)throw new Error(D.notConnectedYetStr);return this.movementSensorServiceClient}get powerSensorService(){if(!this.powerSensorServiceClient)throw new Error(D.notConnectedYetStr);return this.powerSensorServiceClient}get inputControllerService(){if(!this.inputControllerServiceClient)throw new Error(D.notConnectedYetStr);return this.inputControllerServiceClient}get motorService(){if(!this.motorServiceClient)throw new Error(D.notConnectedYetStr);return this.motorServiceClient}get navigationService(){if(!this.navigationServiceClient)throw new Error(D.notConnectedYetStr);return this.navigationServiceClient}get discoveryService(){if(!this.discoveryServiceClient)throw new Error(D.notConnectedYetStr);return this.discoveryServiceClient}get motionService(){if(!this.motionServiceClient)throw new Error(D.notConnectedYetStr);return this.motionServiceClient}get visionService(){if(!this.visionServiceClient)throw new Error(D.notConnectedYetStr);return this.visionServiceClient}get servoService(){if(!this.servoServiceClient)throw new Error(D.notConnectedYetStr);return this.servoServiceClient}get slamService(){if(!this.slamServiceClient)throw new Error(D.notConnectedYetStr);return this.slamServiceClient}createServiceClient(e){const n=this.sessionOptions?.disabled?this.transport:this.sessionManager.transport;if(!n)throw new Error(D.notConnectedYetStr);return N(e,n)}get peerConnection(){return this.peerConn}async disconnect(){for(this.emit(ne.DISCONNECTING,{});this.connecting;)await this.connecting;this.peerConn&&(this.peerConn.close(),this.peerConn=void 0),this.sessionManager.reset(),this.closed=!0,this.emit(ne.DISCONNECTED,{})}isConnected(){return this.peerConn?.iceConnectionState==="connected"}async connect({creds:e=this.savedCreds,priority:n,dialTimeout:t}={}){if(this.emit(ne.CONNECTING,{}),this.closed=!1,this.connecting){for(;this.connecting!==void 0;)await this.connecting;return}this.connecting=new Promise(o=>{this.connectResolve=o}),this.peerConn&&(this.peerConn.close(),this.peerConn=void 0),this.sessionManager.reset();try{const o={webrtcOptions:{disableTrickleICE:!1,rtcConfig:this.webrtcOptions?.rtcConfig},dialTimeout:t??gt,extraHeaders:ut};if(e&&(En(e)?o.credentials=e:o.accessToken=e.payload),n!==void 0&&o.webrtcOptions&&(o.webrtcOptions.additionalSdpFields={"x-priority":n}),this.savedCreds=e,this.webrtcOptions?.enabled){o.webrtcOptions&&(o.webrtcOptions.signalingCredentials=o.credentials);const r=await pR(this.webrtcOptions.signalingAddress||this.serviceHost,this.webrtcOptions.host,o);this.peerConn=r.peerConnection,this.peerConn.addEventListener("iceconnectionstatechange",()=>{this.peerConn?.iceConnectionState==="connected"?this.emit(ne.CONNECTED,{}):this.peerConn?.iceConnectionState==="closed"&&this.onDisconnect()}),r.dataChannel.addEventListener("close",c=>{this.onDisconnect(c)}),this.transport=r.transport,r.peerConnection.addEventListener("track",c=>{const[d]=c.streams;if(!d)throw this.emit("track",c),new Error("expected event stream to exist");const p=d.id.replaceAll("+",":");Object.defineProperty(d,"id",{value:p}),this.emit("track",c)})}else this.transport=await In(this.serviceHost,o),await this.gRPCConnectionManager.start();const i=this.sessionOptions?.disabled?this.transport:this.sessionManager.transport;this.robotServiceClient=N(As,i),this.armServiceClient=N(qr,i),this.baseServiceClient=N(Yr,i),this.boardServiceClient=N(sm,i),this.encoderServiceClient=N(cm,i),this.gantryServiceClient=N(km,i),this.genericServiceClient=N(jt,i),this.gripperServiceClient=N(Rm,i),this.mlModelServiceClient=N(jd,i),this.movementSensorServiceClient=N(Xm,i),this.powerSensorServiceClient=N(nc,i),this.inputControllerServiceClient=N(Cm,i),this.motorServiceClient=N(xm,i),this.navigationServiceClient=N(gd,i),this.motionServiceClient=N(ed,i),this.visionServiceClient=N(zd,i),this.servoServiceClient=N(ic,i),this.slamServiceClient=N(Sd,i),this.discoveryServiceClient=N(Al,i),this.emit(ne.CONNECTED,{})}catch(o){throw this.emit(ne.DISCONNECTED,{}),o}finally{this.connectResolve?.(),this.connectResolve=void 0,this.connecting=void 0}}async getSessions(){return(await this.robotService.getSessions({})).sessions}async getOperations(){return(await this.robotService.getOperations({})).operations}async cancelOperation(e){await this.robotService.cancelOperation({id:e})}async blockForOperation(e){await this.robotService.blockForOperation({id:e})}async stopAll(){await this.robotService.stopAll({})}async frameSystemConfig(e){return(await this.robotService.frameSystemConfig({supplementalTransforms:e})).frameSystemConfigs}async transformPose(e,n,t){const o=new bs({source:e,destination:n,supplementalTransforms:t}),r=(await this.robotService.transformPose(o)).pose;if(!r)throw new Error("no pose");return r}async transformPCD(e,n,t){const o=new Es({pointCloudPcd:e,source:n,destination:t});return(await this.robotService.transformPCD(o)).pointCloudPcd}async getModelsFromModules(){const e=new ws({});return(await this.robotService.getModelsFromModules(e)).models}async getCloudMetadata(){return this.robotService.getCloudMetadata({})}async resourceNames(){return(await this.robotService.resourceNames({})).resources}async resourceRPCSubtypes(){return(await this.robotService.resourceRPCSubtypes({})).resourceRpcSubtypes}async getMachineStatus(){return this.robotService.getMachineStatus({})}async getVersion(){return this.robotService.getVersion({})}async restartModule(e,n){const t=new Ds;e!==void 0&&(t.idOrName.case="moduleId",t.idOrName.value=e),n!==void 0&&(t.idOrName.case="moduleName",t.idOrName.value=n),await this.robotService.restartModule(t)}}const Hd=a=>!!(a>0&&Number.isInteger(a)),f1=a=>a.includes("local"),Kd=async a=>{if(console.debug("dialing via gRPC..."),!f1(a.host))throw new Error(`cannot dial "${a.host}" directly, please use a local url instead.`);const e={noReconnect:a.noReconnect,reconnectMaxWait:a.reconnectMaxWait,reconnectMaxAttempts:a.reconnectMaxAttempts};let n;a.disableSessions&&(n={disabled:!0});const t=new D(a.host,void 0,n,e);return await t.connect({creds:a.credentials,dialTimeout:a.dialTimeout??gt}),console.debug("connected via gRPC"),t},Xd=async a=>{console.debug("dialing via WebRTC...");const e=a.serviceHost??a.host,{signalingAddress:n}=a,o={iceServers:a.iceServers??[]},i={enabled:!0,host:a.host,signalingAddress:n,rtcConfig:o,noReconnect:a.noReconnect,reconnectMaxWait:a.reconnectMaxWait,reconnectMaxAttempts:a.reconnectMaxAttempts};let r;a.disableSessions&&(r={disabled:!0});const c=new D(e,i,r);return await c.connect({priority:a.priority,dialTimeout:a.dialTimeout??gt,creds:a.credentials}),console.debug("connected via WebRTC"),c},R1=a=>{const e=a;return typeof e.signalingAddress!="string"?!1:!e.iceServers||Array.isArray(e.iceServers)},Qd=async a=>{_1(a);const e={retry:(n,t)=>(console.debug(`Failed to connect, attempt ${t} with backoff`,n),!a.reconnectAbortSignal?.abort)};if(a.reconnectMaxWait!==void 0&&(e.maxDelay=a.reconnectMaxWait),a.reconnectMaxAttempts!==void 0&&(e.numOfAttempts=a.reconnectMaxAttempts),R1(a)&&!a.reconnectAbortSignal?.abort)try{return a.noReconnect?await Xd(a):await Qa(async()=>Xd(a),e)}catch{console.debug("Failed to connect via WebRTC")}if(!a.reconnectAbortSignal?.abort)try{return a.noReconnect?await Kd(a):await Qa(async()=>Kd(a),e)}catch{console.debug("Failed to connect via gRPC")}throw new Error("Failed to connect to robot")},_1=a=>{if(a.credentials&&En(a.credentials))try{a.credentials.authEntity=new URL(a.credentials.authEntity).host}catch(e){if(!(e instanceof TypeError))throw e}if(a.reconnectMaxAttempts!==void 0&&!Hd(a.reconnectMaxAttempts))throw new Error(`Value of max reconnect attempts (${a.reconnectMaxAttempts}) should be a positive integer`);if(a.reconnectMaxWait!==void 0&&!Hd(a.reconnectMaxWait))throw new Error(`Value of max reconnect wait (${a.reconnectMaxWait}) should be a positive integer`)},ze=s.makeEnum("viam.app.mltraining.v1.ModelType",[{no:0,name:"MODEL_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MODEL_TYPE_SINGLE_LABEL_CLASSIFICATION",localName:"SINGLE_LABEL_CLASSIFICATION"},{no:2,name:"MODEL_TYPE_MULTI_LABEL_CLASSIFICATION",localName:"MULTI_LABEL_CLASSIFICATION"},{no:3,name:"MODEL_TYPE_OBJECT_DETECTION",localName:"OBJECT_DETECTION"}]),Qe=s.makeEnum("viam.app.mltraining.v1.ModelFramework",[{no:0,name:"MODEL_FRAMEWORK_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MODEL_FRAMEWORK_TFLITE",localName:"TFLITE"},{no:2,name:"MODEL_FRAMEWORK_TENSORFLOW",localName:"TENSORFLOW"},{no:3,name:"MODEL_FRAMEWORK_PYTORCH",localName:"PYTORCH"},{no:4,name:"MODEL_FRAMEWORK_ONNX",localName:"ONNX"}]),fa=s.makeEnum("viam.app.mltraining.v1.TrainingStatus",[{no:0,name:"TRAINING_STATUS_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"TRAINING_STATUS_PENDING",localName:"PENDING"},{no:2,name:"TRAINING_STATUS_IN_PROGRESS",localName:"IN_PROGRESS"},{no:3,name:"TRAINING_STATUS_COMPLETED",localName:"COMPLETED"},{no:4,name:"TRAINING_STATUS_FAILED",localName:"FAILED"},{no:5,name:"TRAINING_STATUS_CANCELED",localName:"CANCELED"},{no:6,name:"TRAINING_STATUS_CANCELING",localName:"CANCELING"}]),Zd=s.makeMessageType("viam.app.mltraining.v1.SubmitTrainingJobRequest",()=>[{no:7,name:"dataset_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"model_name",kind:"scalar",T:9},{no:4,name:"model_version",kind:"scalar",T:9},{no:5,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:8,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)},{no:6,name:"tags",kind:"scalar",T:9,repeated:!0}]),ep=s.makeMessageType("viam.app.mltraining.v1.SubmitTrainingJobResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),np=s.makeMessageType("viam.app.mltraining.v1.SubmitCustomTrainingJobRequest",()=>[{no:1,name:"dataset_id",kind:"scalar",T:9},{no:2,name:"registry_item_id",kind:"scalar",T:9},{no:6,name:"registry_item_version",kind:"scalar",T:9},{no:3,name:"organization_id",kind:"scalar",T:9},{no:4,name:"model_name",kind:"scalar",T:9},{no:5,name:"model_version",kind:"scalar",T:9},{no:7,name:"arguments",kind:"map",K:9,V:{kind:"scalar",T:9}}]),ap=s.makeMessageType("viam.app.mltraining.v1.SubmitCustomTrainingJobResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),tp=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),sp=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobResponse",()=>[{no:1,name:"metadata",kind:"message",T:Ro}]),op=s.makeMessageType("viam.app.mltraining.v1.ListTrainingJobsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"status",kind:"enum",T:s.getEnumType(fa)}]),ip=s.makeMessageType("viam.app.mltraining.v1.ListTrainingJobsResponse",()=>[{no:1,name:"jobs",kind:"message",T:Ro,repeated:!0}]),Ro=s.makeMessageType("viam.app.mltraining.v1.TrainingJobMetadata",()=>[{no:7,name:"id",kind:"scalar",T:9},{no:11,name:"dataset_id",kind:"scalar",T:9},{no:12,name:"organization_id",kind:"scalar",T:9},{no:13,name:"model_name",kind:"scalar",T:9},{no:14,name:"model_version",kind:"scalar",T:9},{no:15,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:17,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)},{no:18,name:"is_custom_job",kind:"scalar",T:8},{no:19,name:"registry_item_id",kind:"scalar",T:9},{no:20,name:"registry_item_version",kind:"scalar",T:9},{no:2,name:"status",kind:"enum",T:s.getEnumType(fa)},{no:8,name:"error_status",kind:"message",T:rn},{no:3,name:"created_on",kind:"message",T:S},{no:4,name:"last_modified",kind:"message",T:S},{no:9,name:"training_started",kind:"message",T:S},{no:10,name:"training_ended",kind:"message",T:S},{no:5,name:"synced_model_id",kind:"scalar",T:9},{no:16,name:"tags",kind:"scalar",T:9,repeated:!0},{no:21,name:"arguments",kind:"map",K:9,V:{kind:"scalar",T:9}}]),rp=s.makeMessageType("viam.app.mltraining.v1.CancelTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),mp=s.makeMessageType("viam.app.mltraining.v1.CancelTrainingJobResponse",[]),cp=s.makeMessageType("viam.app.mltraining.v1.DeleteCompletedTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),lp=s.makeMessageType("viam.app.mltraining.v1.DeleteCompletedTrainingJobResponse",[]),dp=s.makeMessageType("viam.app.mltraining.v1.TrainingJobLogEntry",()=>[{no:1,name:"level",kind:"scalar",T:9},{no:2,name:"time",kind:"message",T:S},{no:3,name:"message",kind:"scalar",T:9}]),pp=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobLogsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"page_token",kind:"scalar",T:9,opt:!0}]),up=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:dp,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),S1=Object.freeze(Object.defineProperty({__proto__:null,CancelTrainingJobRequest:rp,CancelTrainingJobResponse:mp,DeleteCompletedTrainingJobRequest:cp,DeleteCompletedTrainingJobResponse:lp,GetTrainingJobLogsRequest:pp,GetTrainingJobLogsResponse:up,GetTrainingJobRequest:tp,GetTrainingJobResponse:sp,ListTrainingJobsRequest:op,ListTrainingJobsResponse:ip,ModelFramework:Qe,ModelType:ze,SubmitCustomTrainingJobRequest:np,SubmitCustomTrainingJobResponse:ap,SubmitTrainingJobRequest:Zd,SubmitTrainingJobResponse:ep,TrainingJobLogEntry:dp,TrainingJobMetadata:Ro,TrainingStatus:fa},Symbol.toStringTag,{value:"Module"})),Ra=s.makeEnum("viam.app.packages.v1.PackageType",[{no:0,name:"PACKAGE_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PACKAGE_TYPE_ARCHIVE",localName:"ARCHIVE"},{no:2,name:"PACKAGE_TYPE_ML_MODEL",localName:"ML_MODEL"},{no:3,name:"PACKAGE_TYPE_MODULE",localName:"MODULE"},{no:4,name:"PACKAGE_TYPE_SLAM_MAP",localName:"SLAM_MAP"},{no:5,name:"PACKAGE_TYPE_ML_TRAINING",localName:"ML_TRAINING"}]),gp=s.makeEnum("viam.app.v1.AuthenticationType",[{no:0,name:"AUTHENTICATION_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"AUTHENTICATION_TYPE_WEB_OAUTH",localName:"WEB_OAUTH"},{no:2,name:"AUTHENTICATION_TYPE_API_KEY",localName:"API_KEY"},{no:3,name:"AUTHENTICATION_TYPE_ROBOT_PART_SECRET",localName:"ROBOT_PART_SECRET"},{no:4,name:"AUTHENTICATION_TYPE_LOCATION_SECRET",localName:"LOCATION_SECRET"}]),On=s.makeEnum("viam.app.v1.FragmentVisibility",[{no:0,name:"FRAGMENT_VISIBILITY_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"FRAGMENT_VISIBILITY_PRIVATE",localName:"PRIVATE"},{no:2,name:"FRAGMENT_VISIBILITY_PUBLIC",localName:"PUBLIC"},{no:3,name:"FRAGMENT_VISIBILITY_PUBLIC_UNLISTED",localName:"PUBLIC_UNLISTED"}]),Tp=s.makeEnum("viam.app.v1.FragmentErrorType",[{no:0,name:"FRAGMENT_ERROR_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"FRAGMENT_ERROR_TYPE_NO_ACCESS",localName:"NO_ACCESS"},{no:2,name:"FRAGMENT_ERROR_TYPE_NESTING_LIMIT_EXCEEDED",localName:"NESTING_LIMIT_EXCEEDED"},{no:3,name:"FRAGMENT_ERROR_TYPE_CHILD_ID_INVALID",localName:"CHILD_ID_INVALID"},{no:4,name:"FRAGMENT_ERROR_TYPE_CYCLE_DETECTED",localName:"CYCLE_DETECTED"}]),kp=s.makeEnum("viam.app.v1.RegistryItemStatus",[{no:0,name:"REGISTRY_ITEM_STATUS_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"REGISTRY_ITEM_STATUS_PUBLISHED",localName:"PUBLISHED"},{no:2,name:"REGISTRY_ITEM_STATUS_IN_DEVELOPMENT",localName:"IN_DEVELOPMENT"}]),dn=s.makeEnum("viam.app.v1.Visibility",[{no:0,name:"VISIBILITY_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"VISIBILITY_PRIVATE",localName:"PRIVATE"},{no:2,name:"VISIBILITY_PUBLIC",localName:"PUBLIC"},{no:3,name:"VISIBILITY_PUBLIC_UNLISTED",localName:"PUBLIC_UNLISTED"}]),yp=s.makeEnum("viam.app.v1.ClientAuthentication",[{no:0,name:"CLIENT_AUTHENTICATION_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"CLIENT_AUTHENTICATION_REQUIRED",localName:"REQUIRED"},{no:2,name:"CLIENT_AUTHENTICATION_NOT_REQUIRED",localName:"NOT_REQUIRED"},{no:3,name:"CLIENT_AUTHENTICATION_NOT_REQUIRED_WHEN_USING_PKCE",localName:"NOT_REQUIRED_WHEN_USING_PKCE"}]),vp=s.makeEnum("viam.app.v1.PKCE",[{no:0,name:"PKCE_UNSPECIFIED"},{no:1,name:"PKCE_REQUIRED"},{no:2,name:"PKCE_NOT_REQUIRED"},{no:3,name:"PKCE_NOT_REQUIRED_WHEN_USING_CLIENT_AUTHENTICATION"}]),hp=s.makeEnum("viam.app.v1.URLValidation",[{no:0,name:"URL_VALIDATION_UNSPECIFIED"},{no:1,name:"URL_VALIDATION_EXACT_MATCH"},{no:2,name:"URL_VALIDATION_ALLOW_WILDCARDS"}]),fp=s.makeEnum("viam.app.v1.EnabledGrant",[{no:0,name:"ENABLED_GRANT_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"ENABLED_GRANT_AUTHORIZATION_CODE",localName:"AUTHORIZATION_CODE"},{no:2,name:"ENABLED_GRANT_IMPLICIT",localName:"IMPLICIT"},{no:3,name:"ENABLED_GRANT_PASSWORD",localName:"PASSWORD"},{no:4,name:"ENABLED_GRANT_REFRESH_TOKEN",localName:"REFRESH_TOKEN"},{no:5,name:"ENABLED_GRANT_DEVICE_CODE",localName:"DEVICE_CODE"}]),_a=s.makeMessageType("viam.app.v1.Robot",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"location",kind:"scalar",T:9},{no:4,name:"last_access",kind:"message",T:S},{no:5,name:"created_on",kind:"message",T:S}]),Ze=s.makeMessageType("viam.app.v1.RobotPart",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:10,name:"dns_name",kind:"scalar",T:9},{no:3,name:"secret",kind:"scalar",T:9},{no:4,name:"robot",kind:"scalar",T:9},{no:12,name:"location_id",kind:"scalar",T:9},{no:5,name:"robot_config",kind:"message",T:l},{no:6,name:"last_access",kind:"message",T:S},{no:7,name:"user_supplied_info",kind:"message",T:l},{no:8,name:"main_part",kind:"scalar",T:8},{no:9,name:"fqdn",kind:"scalar",T:9},{no:11,name:"local_fqdn",kind:"scalar",T:9},{no:13,name:"created_on",kind:"message",T:S},{no:14,name:"secrets",kind:"message",T:Io,repeated:!0},{no:15,name:"last_updated",kind:"message",T:S}]),Rp=s.makeMessageType("viam.app.v1.RobotPartHistoryEntry",()=>[{no:1,name:"part",kind:"scalar",T:9},{no:2,name:"robot",kind:"scalar",T:9},{no:3,name:"when",kind:"message",T:S},{no:4,name:"old",kind:"message",T:Ze},{no:5,name:"edited_by",kind:"message",T:_o}]),_o=s.makeMessageType("viam.app.v1.AuthenticatorInfo",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(gp)},{no:2,name:"value",kind:"scalar",T:9},{no:3,name:"is_deactivated",kind:"scalar",T:8}]),_p=s.makeMessageType("viam.app.v1.ListOrganizationsRequest",[]),pn=s.makeMessageType("viam.app.v1.Organization",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"created_on",kind:"message",T:S},{no:4,name:"public_namespace",kind:"scalar",T:9},{no:5,name:"default_region",kind:"scalar",T:9},{no:6,name:"cid",kind:"scalar",T:9,opt:!0}]),Sp=s.makeMessageType("viam.app.v1.OrganizationMember",()=>[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"emails",kind:"scalar",T:9,repeated:!0},{no:3,name:"date_added",kind:"message",T:S},{no:4,name:"last_login",kind:"message",T:S,opt:!0}]),Ip=s.makeMessageType("viam.app.v1.ListOrganizationsResponse",()=>[{no:1,name:"organizations",kind:"message",T:pn,repeated:!0}]),Cn=s.makeMessageType("viam.app.v1.OrganizationInvite",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9},{no:3,name:"created_on",kind:"message",T:S},{no:4,name:"authorizations",kind:"message",T:Q,repeated:!0}]),Mp=s.makeMessageType("viam.app.v1.CreateOrganizationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),bp=s.makeMessageType("viam.app.v1.CreateOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:pn}]),Ep=s.makeMessageType("viam.app.v1.GetOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),wp=s.makeMessageType("viam.app.v1.GetOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:pn}]),Op=s.makeMessageType("viam.app.v1.GetOrganizationNamespaceAvailabilityRequest",()=>[{no:1,name:"public_namespace",kind:"scalar",T:9}]),Cp=s.makeMessageType("viam.app.v1.GetOrganizationNamespaceAvailabilityResponse",()=>[{no:1,name:"available",kind:"scalar",T:8}]),Np=s.makeMessageType("viam.app.v1.UpdateOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9,opt:!0},{no:3,name:"public_namespace",kind:"scalar",T:9,opt:!0},{no:4,name:"region",kind:"scalar",T:9,opt:!0},{no:5,name:"cid",kind:"scalar",T:9,opt:!0}]),Pp=s.makeMessageType("viam.app.v1.UpdateOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:pn}]),Dp=s.makeMessageType("viam.app.v1.UpdateOrganizationNamespaceRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"new_public_namespace",kind:"scalar",T:9}]),Ap=s.makeMessageType("viam.app.v1.UpdateOrganizationNamespaceResponse",()=>[{no:1,name:"organization",kind:"message",T:pn}]),qp=s.makeMessageType("viam.app.v1.DeleteOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Up=s.makeMessageType("viam.app.v1.DeleteOrganizationResponse",[]),Lp=s.makeMessageType("viam.app.v1.GetOrganizationMetadataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Gp=s.makeMessageType("viam.app.v1.GetOrganizationMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:l}]),Bp=s.makeMessageType("viam.app.v1.UpdateOrganizationMetadataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:l}]),Fp=s.makeMessageType("viam.app.v1.UpdateOrganizationMetadataResponse",[]),xp=s.makeMessageType("viam.app.v1.ListOrganizationMembersRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Jp=s.makeMessageType("viam.app.v1.ListOrganizationMembersResponse",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"members",kind:"message",T:Sp,repeated:!0},{no:3,name:"invites",kind:"message",T:Cn,repeated:!0}]),zp=s.makeMessageType("viam.app.v1.CreateOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9},{no:3,name:"authorizations",kind:"message",T:Q,repeated:!0},{no:4,name:"send_email_invite",kind:"scalar",T:8,opt:!0}]),Yp=s.makeMessageType("viam.app.v1.CreateOrganizationInviteResponse",()=>[{no:1,name:"invite",kind:"message",T:Cn}]),$p=s.makeMessageType("viam.app.v1.UpdateOrganizationInviteAuthorizationsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9},{no:3,name:"add_authorizations",kind:"message",T:Q,repeated:!0},{no:4,name:"remove_authorizations",kind:"message",T:Q,repeated:!0}]),Vp=s.makeMessageType("viam.app.v1.UpdateOrganizationInviteAuthorizationsResponse",()=>[{no:1,name:"invite",kind:"message",T:Cn}]),Wp=s.makeMessageType("viam.app.v1.DeleteOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),jp=s.makeMessageType("viam.app.v1.DeleteOrganizationInviteResponse",[]),Hp=s.makeMessageType("viam.app.v1.ResendOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9},{no:3,name:"send_email_invite",kind:"scalar",T:8,opt:!0}]),Kp=s.makeMessageType("viam.app.v1.ResendOrganizationInviteResponse",()=>[{no:1,name:"invite",kind:"message",T:Cn}]),Xp=s.makeMessageType("viam.app.v1.DeleteOrganizationMemberRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9}]),Qp=s.makeMessageType("viam.app.v1.DeleteOrganizationMemberResponse",[]),Sa=s.makeMessageType("viam.app.v1.BillingAddress",()=>[{no:1,name:"address_line_1",kind:"scalar",T:9},{no:2,name:"address_line_2",kind:"scalar",T:9,opt:!0},{no:3,name:"city",kind:"scalar",T:9},{no:4,name:"state",kind:"scalar",T:9},{no:5,name:"zipcode",kind:"scalar",T:9},{no:6,name:"country",kind:"scalar",T:9}]),Zp=s.makeMessageType("viam.app.v1.EnableBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"billing_address",kind:"message",T:Sa}]),eu=s.makeMessageType("viam.app.v1.EnableBillingServiceResponse",[]),nu=s.makeMessageType("viam.app.v1.UpdateBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"billing_address",kind:"message",T:Sa}]),au=s.makeMessageType("viam.app.v1.UpdateBillingServiceResponse",[]),tu=s.makeMessageType("viam.app.v1.GetBillingServiceConfigRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),su=s.makeMessageType("viam.app.v1.GetBillingServiceConfigResponse",()=>[{no:1,name:"billing_address",kind:"message",T:Sa},{no:2,name:"support_email",kind:"scalar",T:9},{no:3,name:"logo_url",kind:"scalar",T:9},{no:4,name:"billing_dashboard_url",kind:"scalar",T:9}]),ou=s.makeMessageType("viam.app.v1.DisableBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),iu=s.makeMessageType("viam.app.v1.DisableBillingServiceResponse",[]),ru=s.makeMessageType("viam.app.v1.OrganizationSetSupportEmailRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),mu=s.makeMessageType("viam.app.v1.OrganizationSetSupportEmailResponse",[]),cu=s.makeMessageType("viam.app.v1.OrganizationGetSupportEmailRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),lu=s.makeMessageType("viam.app.v1.OrganizationGetSupportEmailResponse",()=>[{no:1,name:"email",kind:"scalar",T:9}]),So=s.makeMessageType("viam.app.v1.OrganizationIdentity",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),du=s.makeMessageType("viam.app.v1.LocationOrganization",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"primary",kind:"scalar",T:8}]),Ia=s.makeMessageType("viam.app.v1.LocationAuth",()=>[{no:1,name:"secret",kind:"scalar",T:9},{no:2,name:"location_id",kind:"scalar",T:9},{no:3,name:"secrets",kind:"message",T:Io,repeated:!0}]),pu=s.makeMessageType("viam.app.v1.StorageConfig",()=>[{no:1,name:"region",kind:"scalar",T:9}]),Nn=s.makeMessageType("viam.app.v1.Location",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:4,name:"parent_location_id",kind:"scalar",T:9},{no:5,name:"auth",kind:"message",T:Ia},{no:6,name:"organizations",kind:"message",T:du,repeated:!0},{no:3,name:"created_on",kind:"message",T:S},{no:7,name:"robot_count",kind:"scalar",T:5},{no:8,name:"config",kind:"message",T:pu},{no:9,name:"primary_org_identity",kind:"message",T:So,opt:!0}]),Io=s.makeMessageType("viam.app.v1.SharedSecret",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"secret",kind:"scalar",T:9},{no:3,name:"created_on",kind:"message",T:S},{no:4,name:"state",kind:"enum",T:s.getEnumType(Mo)}]),Mo=s.makeEnum("viam.app.v1.SharedSecret.State",[{no:0,name:"STATE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"STATE_ENABLED",localName:"ENABLED"},{no:2,name:"STATE_DISABLED",localName:"DISABLED"}]),uu=s.makeMessageType("viam.app.v1.CreateLocationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"parent_location_id",kind:"scalar",T:9,opt:!0}]),gu=s.makeMessageType("viam.app.v1.CreateLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Nn}]),Tu=s.makeMessageType("viam.app.v1.GetLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),ku=s.makeMessageType("viam.app.v1.GetLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Nn}]),yu=s.makeMessageType("viam.app.v1.UpdateLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9,opt:!0},{no:3,name:"parent_location_id",kind:"scalar",T:9,opt:!0},{no:4,name:"region",kind:"scalar",T:9,opt:!0}]),vu=s.makeMessageType("viam.app.v1.UpdateLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Nn}]),hu=s.makeMessageType("viam.app.v1.DeleteLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),fu=s.makeMessageType("viam.app.v1.DeleteLocationResponse",[]),Ru=s.makeMessageType("viam.app.v1.GetLocationMetadataRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),_u=s.makeMessageType("viam.app.v1.GetLocationMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:l}]),Su=s.makeMessageType("viam.app.v1.UpdateLocationMetadataRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:l}]),Iu=s.makeMessageType("viam.app.v1.UpdateLocationMetadataResponse",[]),Mu=s.makeMessageType("viam.app.v1.GetOrganizationsWithAccessToLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),bu=s.makeMessageType("viam.app.v1.GetOrganizationsWithAccessToLocationResponse",()=>[{no:1,name:"organization_identities",kind:"message",T:So,repeated:!0}]),Eu=s.makeMessageType("viam.app.v1.ListLocationsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),wu=s.makeMessageType("viam.app.v1.ShareLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),Ou=s.makeMessageType("viam.app.v1.ShareLocationResponse",[]),Cu=s.makeMessageType("viam.app.v1.UnshareLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),Nu=s.makeMessageType("viam.app.v1.UnshareLocationResponse",[]),Pu=s.makeMessageType("viam.app.v1.ListLocationsResponse",()=>[{no:1,name:"locations",kind:"message",T:Nn,repeated:!0}]),Du=s.makeMessageType("viam.app.v1.CreateLocationSecretRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Au=s.makeMessageType("viam.app.v1.CreateLocationSecretResponse",()=>[{no:1,name:"auth",kind:"message",T:Ia}]),qu=s.makeMessageType("viam.app.v1.DeleteLocationSecretRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"secret_id",kind:"scalar",T:9}]),Uu=s.makeMessageType("viam.app.v1.DeleteLocationSecretResponse",[]),Lu=s.makeMessageType("viam.app.v1.LocationAuthRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Gu=s.makeMessageType("viam.app.v1.LocationAuthResponse",()=>[{no:1,name:"auth",kind:"message",T:Ia}]),Bu=s.makeMessageType("viam.app.v1.GetRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Fu=s.makeMessageType("viam.app.v1.GetRoverRentalRobotsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),xu=s.makeMessageType("viam.app.v1.RoverRentalRobot",()=>[{no:1,name:"robot_id",kind:"scalar",T:9},{no:2,name:"location_id",kind:"scalar",T:9},{no:3,name:"robot_name",kind:"scalar",T:9},{no:4,name:"robot_main_part_id",kind:"scalar",T:9}]),Ju=s.makeMessageType("viam.app.v1.GetRoverRentalRobotsResponse",()=>[{no:1,name:"robots",kind:"message",T:xu,repeated:!0}]),zu=s.makeMessageType("viam.app.v1.GetRobotResponse",()=>[{no:1,name:"robot",kind:"message",T:_a}]),Yu=s.makeMessageType("viam.app.v1.GetRobotPartsRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9}]),$u=s.makeMessageType("viam.app.v1.GetRobotPartsResponse",()=>[{no:1,name:"parts",kind:"message",T:Ze,repeated:!0}]),Vu=s.makeMessageType("viam.app.v1.GetRobotPartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Wu=s.makeMessageType("viam.app.v1.GetRobotPartResponse",()=>[{no:1,name:"part",kind:"message",T:Ze},{no:2,name:"config_json",kind:"scalar",T:9}]),ju=s.makeMessageType("viam.app.v1.GetRobotPartByNameAndLocationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"location_id",kind:"scalar",T:9}]),Hu=s.makeMessageType("viam.app.v1.GetRobotPartByNameAndLocationResponse",()=>[{no:1,name:"part",kind:"message",T:Ze}]),Ku=s.makeMessageType("viam.app.v1.GetRobotPartLogsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"errors_only",kind:"scalar",T:8},{no:3,name:"filter",kind:"scalar",T:9,opt:!0},{no:4,name:"page_token",kind:"scalar",T:9,opt:!0},{no:5,name:"levels",kind:"scalar",T:9,repeated:!0},{no:6,name:"start",kind:"message",T:S,opt:!0},{no:7,name:"end",kind:"message",T:S,opt:!0},{no:8,name:"limit",kind:"scalar",T:3,opt:!0},{no:9,name:"source",kind:"scalar",T:9,opt:!0}]),Xu=s.makeMessageType("viam.app.v1.GetRobotPartLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:bn,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),Qu=s.makeMessageType("viam.app.v1.TailRobotPartLogsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"errors_only",kind:"scalar",T:8},{no:3,name:"filter",kind:"scalar",T:9,opt:!0}]),Zu=s.makeMessageType("viam.app.v1.TailRobotPartLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:bn,repeated:!0}]),eg=s.makeMessageType("viam.app.v1.GetRobotPartHistoryRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),ng=s.makeMessageType("viam.app.v1.GetRobotPartHistoryResponse",()=>[{no:1,name:"history",kind:"message",T:Rp,repeated:!0}]),ag=s.makeMessageType("viam.app.v1.UpdateRobotPartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"robot_config",kind:"message",T:l},{no:4,name:"last_known_update",kind:"message",T:S,opt:!0}]),tg=s.makeMessageType("viam.app.v1.UpdateRobotPartResponse",()=>[{no:1,name:"part",kind:"message",T:Ze}]),sg=s.makeMessageType("viam.app.v1.NewRobotPartRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9},{no:2,name:"part_name",kind:"scalar",T:9}]),og=s.makeMessageType("viam.app.v1.NewRobotPartResponse",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),ig=s.makeMessageType("viam.app.v1.DeleteRobotPartRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),rg=s.makeMessageType("viam.app.v1.GetRobotPartMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),mg=s.makeMessageType("viam.app.v1.GetRobotPartMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:l}]),cg=s.makeMessageType("viam.app.v1.UpdateRobotPartMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:l}]),lg=s.makeMessageType("viam.app.v1.UpdateRobotPartMetadataResponse",[]),dg=s.makeMessageType("viam.app.v1.GetRobotAPIKeysRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9}]),pg=s.makeMessageType("viam.app.v1.APIKey",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"created_on",kind:"message",T:S}]),ug=s.makeMessageType("viam.app.v1.GetRobotAPIKeysResponse",()=>[{no:1,name:"api_keys",kind:"message",T:Po,repeated:!0}]),gg=s.makeMessageType("viam.app.v1.DeleteRobotPartResponse",[]),Ye=s.makeMessageType("viam.app.v1.Fragment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"fragment",kind:"message",T:l},{no:4,name:"organization_owner",kind:"scalar",T:9},{no:5,name:"public",kind:"scalar",T:8},{no:6,name:"created_on",kind:"message",T:S},{no:7,name:"organization_name",kind:"scalar",T:9},{no:9,name:"robot_part_count",kind:"scalar",T:5},{no:10,name:"organization_count",kind:"scalar",T:5},{no:11,name:"only_used_by_owner",kind:"scalar",T:8},{no:12,name:"visibility",kind:"enum",T:s.getEnumType(On)},{no:13,name:"last_updated",kind:"message",T:S},{no:14,name:"revision",kind:"scalar",T:9}]),Tg=s.makeMessageType("viam.app.v1.FragmentHistoryEntry",()=>[{no:1,name:"fragment",kind:"scalar",T:9},{no:2,name:"edited_on",kind:"message",T:S},{no:3,name:"old",kind:"message",T:Ye},{no:4,name:"edited_by",kind:"message",T:_o},{no:5,name:"revision",kind:"scalar",T:9},{no:6,name:"config",kind:"message",T:l}]),kg=s.makeMessageType("viam.app.v1.FragmentRevision",()=>[{no:1,name:"revision",kind:"scalar",T:9},{no:2,name:"created_at",kind:"message",T:S}]),Ma=s.makeMessageType("viam.app.v1.FragmentTag",()=>[{no:1,name:"tag",kind:"scalar",T:9},{no:2,name:"revision",kind:"scalar",T:9}]),yg=s.makeMessageType("viam.app.v1.FragmentError",()=>[{no:1,name:"error_type",kind:"enum",T:s.getEnumType(Tp)},{no:2,name:"fragment_id",kind:"scalar",T:9},{no:3,name:"detail",kind:"scalar",T:9}]),ba=s.makeMessageType("viam.app.v1.FragmentUsage",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"organizations",kind:"scalar",T:5},{no:3,name:"machines",kind:"scalar",T:5},{no:4,name:"machines_in_current_org",kind:"scalar",T:5},{no:5,name:"version",kind:"scalar",T:9,opt:!0}]),bo=s.makeMessageType("viam.app.v1.ResolvedFragment",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"resolved_config",kind:"message",T:l},{no:3,name:"error",kind:"message",T:yg},{no:4,name:"revision",kind:"scalar",T:9}]),vg=s.makeMessageType("viam.app.v1.ListFragmentsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"show_public",kind:"scalar",T:8},{no:3,name:"fragment_visibility",kind:"enum",T:s.getEnumType(On),repeated:!0}]),hg=s.makeMessageType("viam.app.v1.ListFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"fragment_usages",kind:"message",T:ba,repeated:!0}]),fg=s.makeMessageType("viam.app.v1.GetFragmentRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"current_organization_id",kind:"scalar",T:9},{no:3,name:"version",kind:"scalar",T:9,opt:!0}]),Rg=s.makeMessageType("viam.app.v1.GetFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye},{no:2,name:"fragment_usage",kind:"message",T:ba},{no:3,name:"revisions",kind:"message",T:kg,repeated:!0},{no:4,name:"tags",kind:"message",T:Ma,repeated:!0}]),_g=s.makeMessageType("viam.app.v1.CreateFragmentRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"config",kind:"message",T:l},{no:3,name:"organization_id",kind:"scalar",T:9},{no:4,name:"visibility",kind:"enum",T:s.getEnumType(On),opt:!0}]),Sg=s.makeMessageType("viam.app.v1.CreateFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye}]),Ig=s.makeMessageType("viam.app.v1.UpdateFragmentRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"config",kind:"message",T:l},{no:4,name:"public",kind:"scalar",T:8,opt:!0},{no:5,name:"visibility",kind:"enum",T:s.getEnumType(On),opt:!0},{no:6,name:"last_known_update",kind:"message",T:S,opt:!0}]),Mg=s.makeMessageType("viam.app.v1.UpdateFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye}]),bg=s.makeMessageType("viam.app.v1.DeleteFragmentRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Eg=s.makeMessageType("viam.app.v1.DeleteFragmentResponse",[]),wg=s.makeMessageType("viam.app.v1.GetFragmentHistoryRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"page_token",kind:"scalar",T:9,opt:!0},{no:3,name:"page_limit",kind:"scalar",T:3,opt:!0}]),Og=s.makeMessageType("viam.app.v1.GetFragmentHistoryResponse",()=>[{no:1,name:"history",kind:"message",T:Tg,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),Cg=s.makeMessageType("viam.app.v1.GetFragmentUsageRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9}]),Ng=s.makeMessageType("viam.app.v1.GetFragmentUsageResponse",()=>[{no:1,name:"version_usages",kind:"message",T:ba,repeated:!0}]),Pg=s.makeMessageType("viam.app.v1.SetFragmentTagRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"tag",kind:"scalar",T:9},{no:3,name:"revision",kind:"scalar",T:9}]),Dg=s.makeMessageType("viam.app.v1.SetFragmentTagResponse",()=>[{no:1,name:"tags",kind:"message",T:Ma,repeated:!0}]),Ag=s.makeMessageType("viam.app.v1.DeleteFragmentTagRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"tag",kind:"scalar",T:9}]),qg=s.makeMessageType("viam.app.v1.DeleteFragmentTagResponse",()=>[{no:1,name:"tags",kind:"message",T:Ma,repeated:!0}]),Ug=s.makeMessageType("viam.app.v1.ListRobotsRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Eo=s.makeMessageType("viam.app.v1.AdditionalFragment",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9,opt:!0}]),Lg=s.makeMessageType("viam.app.v1.ListNestedFragmentsRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9,opt:!0},{no:2,name:"additional_fragments",kind:"message",T:Eo,repeated:!0}]),Gg=s.makeMessageType("viam.app.v1.ListNestedFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"resolved_fragments",kind:"message",T:bo,repeated:!0}]),Bg=s.makeMessageType("viam.app.v1.ListMachineFragmentsRequest",()=>[{no:1,name:"machine_id",kind:"scalar",T:9},{no:2,name:"additional_fragment_ids",kind:"scalar",T:9,repeated:!0},{no:3,name:"additional_fragments",kind:"message",T:Eo,repeated:!0}]),Fg=s.makeMessageType("viam.app.v1.ListMachineFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"resolved_fragments",kind:"message",T:bo,repeated:!0}]),xg=s.makeMessageType("viam.app.v1.ListMachineSummariesRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Jg=s.makeMessageType("viam.app.v1.ListMachineSummariesResponse",()=>[{no:1,name:"location_summaries",kind:"message",T:zg,repeated:!0}]),zg=s.makeMessageType("viam.app.v1.LocationSummary",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"location_name",kind:"scalar",T:9},{no:3,name:"machine_summaries",kind:"message",T:Yg,repeated:!0}]),Yg=s.makeMessageType("viam.app.v1.MachineSummary",()=>[{no:1,name:"machine_id",kind:"scalar",T:9},{no:2,name:"machine_name",kind:"scalar",T:9},{no:3,name:"part_summaries",kind:"message",T:jg,repeated:!0}]),$g=s.makeMessageType("viam.app.v1.FragmentSummary",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9}]),Vg=s.makeMessageType("viam.app.v1.ViamServerVersion",()=>[{no:1,name:"major",kind:"scalar",T:9,oneof:"version"},{no:2,name:"minor",kind:"scalar",T:9,oneof:"version"}]),Wg=s.makeMessageType("viam.app.v1.ViamAgentVersion",()=>[{no:1,name:"major",kind:"scalar",T:9,oneof:"version"},{no:2,name:"minor",kind:"scalar",T:9,oneof:"version"}]),jg=s.makeMessageType("viam.app.v1.PartSummary",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"part_name",kind:"scalar",T:9},{no:3,name:"last_online",kind:"message",T:S,opt:!0},{no:4,name:"viam_server_version",kind:"message",T:Vg,opt:!0},{no:5,name:"viam_agent_version",kind:"message",T:Wg,opt:!0},{no:6,name:"os",kind:"scalar",T:9,opt:!0},{no:7,name:"platform",kind:"scalar",T:9,opt:!0},{no:8,name:"public_ip_address",kind:"scalar",T:9,opt:!0},{no:9,name:"fragments",kind:"message",T:$g,repeated:!0}]),Hg=s.makeMessageType("viam.app.v1.ListRobotsResponse",()=>[{no:1,name:"robots",kind:"message",T:_a,repeated:!0}]),Kg=s.makeMessageType("viam.app.v1.NewRobotRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"location",kind:"scalar",T:9}]),Xg=s.makeMessageType("viam.app.v1.NewRobotResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Qg=s.makeMessageType("viam.app.v1.UpdateRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"location",kind:"scalar",T:9}]),Zg=s.makeMessageType("viam.app.v1.UpdateRobotResponse",()=>[{no:1,name:"robot",kind:"message",T:_a}]),eT=s.makeMessageType("viam.app.v1.DeleteRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),nT=s.makeMessageType("viam.app.v1.DeleteRobotResponse",[]),aT=s.makeMessageType("viam.app.v1.GetRobotMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),tT=s.makeMessageType("viam.app.v1.GetRobotMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:l}]),sT=s.makeMessageType("viam.app.v1.UpdateRobotMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:l}]),oT=s.makeMessageType("viam.app.v1.UpdateRobotMetadataResponse",[]),iT=s.makeMessageType("viam.app.v1.MarkPartAsMainRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),rT=s.makeMessageType("viam.app.v1.MarkPartAsMainResponse",[]),mT=s.makeMessageType("viam.app.v1.MarkPartForRestartRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),cT=s.makeMessageType("viam.app.v1.MarkPartForRestartResponse",[]),lT=s.makeMessageType("viam.app.v1.CreateRobotPartSecretRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),dT=s.makeMessageType("viam.app.v1.CreateRobotPartSecretResponse",()=>[{no:1,name:"part",kind:"message",T:Ze}]),pT=s.makeMessageType("viam.app.v1.DeleteRobotPartSecretRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"secret_id",kind:"scalar",T:9}]),uT=s.makeMessageType("viam.app.v1.DeleteRobotPartSecretResponse",[]),Q=s.makeMessageType("viam.app.v1.Authorization",()=>[{no:1,name:"authorization_type",kind:"scalar",T:9},{no:2,name:"authorization_id",kind:"scalar",T:9},{no:3,name:"resource_type",kind:"scalar",T:9},{no:4,name:"resource_id",kind:"scalar",T:9},{no:5,name:"identity_id",kind:"scalar",T:9},{no:6,name:"organization_id",kind:"scalar",T:9},{no:7,name:"identity_type",kind:"scalar",T:9}]),gT=s.makeMessageType("viam.app.v1.AddRoleRequest",()=>[{no:1,name:"authorization",kind:"message",T:Q}]),TT=s.makeMessageType("viam.app.v1.AddRoleResponse",[]),kT=s.makeMessageType("viam.app.v1.RemoveRoleRequest",()=>[{no:1,name:"authorization",kind:"message",T:Q}]),yT=s.makeMessageType("viam.app.v1.RemoveRoleResponse",[]),vT=s.makeMessageType("viam.app.v1.ChangeRoleRequest",()=>[{no:1,name:"old_authorization",kind:"message",T:Q},{no:2,name:"new_authorization",kind:"message",T:Q}]),hT=s.makeMessageType("viam.app.v1.ChangeRoleResponse",[]),fT=s.makeMessageType("viam.app.v1.ListAuthorizationsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"resource_ids",kind:"scalar",T:9,repeated:!0}]),RT=s.makeMessageType("viam.app.v1.ListAuthorizationsResponse",()=>[{no:1,name:"authorizations",kind:"message",T:Q,repeated:!0}]),_T=s.makeMessageType("viam.app.v1.CheckPermissionsRequest",()=>[{no:1,name:"permissions",kind:"message",T:wo,repeated:!0}]),wo=s.makeMessageType("viam.app.v1.AuthorizedPermissions",()=>[{no:1,name:"resource_type",kind:"scalar",T:9},{no:2,name:"resource_id",kind:"scalar",T:9},{no:3,name:"permissions",kind:"scalar",T:9,repeated:!0}]),ST=s.makeMessageType("viam.app.v1.CheckPermissionsResponse",()=>[{no:1,name:"authorized_permissions",kind:"message",T:wo,repeated:!0}]),IT=s.makeMessageType("viam.app.v1.ModuleVersion",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"files",kind:"message",T:Co,repeated:!0},{no:3,name:"models",kind:"message",T:nn,repeated:!0},{no:4,name:"entrypoint",kind:"scalar",T:9},{no:5,name:"first_run",kind:"scalar",T:9,opt:!0},{no:6,name:"markdown_description",kind:"scalar",T:9,opt:!0},{no:7,name:"apps",kind:"message",T:en,repeated:!0}]),MT=s.makeMessageType("viam.app.v1.ModuleMetadata",()=>[{no:1,name:"models",kind:"message",T:nn,repeated:!0},{no:2,name:"versions",kind:"message",T:IT,repeated:!0},{no:3,name:"entrypoint",kind:"scalar",T:9},{no:4,name:"first_run",kind:"scalar",T:9,opt:!0},{no:5,name:"markdown_description",kind:"scalar",T:9,opt:!0},{no:6,name:"apps",kind:"message",T:en,repeated:!0}]),bT=s.makeMessageType("viam.app.v1.MLModelMetadata",()=>[{no:1,name:"versions",kind:"scalar",T:9,repeated:!0},{no:2,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:3,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)}]),ET=s.makeMessageType("viam.app.v1.MLTrainingVersion",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"created_on",kind:"message",T:S}]),wT=s.makeMessageType("viam.app.v1.MLTrainingMetadata",()=>[{no:5,name:"versions",kind:"message",T:ET,repeated:!0},{no:2,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:3,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)},{no:4,name:"draft",kind:"scalar",T:8}]),Ea=s.makeMessageType("viam.app.v1.RegistryItem",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"public_namespace",kind:"scalar",T:9},{no:4,name:"name",kind:"scalar",T:9},{no:5,name:"type",kind:"enum",T:s.getEnumType(Ra)},{no:6,name:"visibility",kind:"enum",T:s.getEnumType(dn)},{no:7,name:"url",kind:"scalar",T:9},{no:8,name:"description",kind:"scalar",T:9},{no:9,name:"total_robot_usage",kind:"scalar",T:3},{no:13,name:"total_external_robot_usage",kind:"scalar",T:3},{no:10,name:"total_organization_usage",kind:"scalar",T:3},{no:14,name:"total_external_organization_usage",kind:"scalar",T:3},{no:11,name:"module_metadata",kind:"message",T:MT,oneof:"metadata"},{no:12,name:"ml_model_metadata",kind:"message",T:bT,oneof:"metadata"},{no:18,name:"ml_training_metadata",kind:"message",T:wT,oneof:"metadata"},{no:15,name:"created_at",kind:"message",T:S},{no:16,name:"updated_at",kind:"message",T:S}]),OT=s.makeMessageType("viam.app.v1.GetRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"include_markdown_documentation",kind:"scalar",T:8,opt:!0}]),CT=s.makeMessageType("viam.app.v1.GetRegistryItemResponse",()=>[{no:1,name:"item",kind:"message",T:Ea}]),NT=s.makeMessageType("viam.app.v1.CreateRegistryItemRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:s.getEnumType(Ra)}]),PT=s.makeMessageType("viam.app.v1.CreateRegistryItemResponse",[]),DT=s.makeMessageType("viam.app.v1.UpdateRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:s.getEnumType(Ra)},{no:3,name:"description",kind:"scalar",T:9},{no:4,name:"visibility",kind:"enum",T:s.getEnumType(dn)},{no:5,name:"url",kind:"scalar",T:9,opt:!0},{no:6,name:"update_module_metadata",kind:"message",T:WT,oneof:"metadata"},{no:7,name:"update_ml_model_metadata",kind:"message",T:jT,oneof:"metadata"},{no:8,name:"update_ml_training_metadata",kind:"message",T:HT,oneof:"metadata"},{no:9,name:"markdown_description",kind:"scalar",T:9,opt:!0}]),AT=s.makeMessageType("viam.app.v1.UpdateRegistryItemResponse",[]),qT=s.makeMessageType("viam.app.v1.ListRegistryItemsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9,opt:!0},{no:2,name:"types",kind:"enum",T:s.getEnumType(Ra),repeated:!0},{no:3,name:"visibilities",kind:"enum",T:s.getEnumType(dn),repeated:!0},{no:4,name:"platforms",kind:"scalar",T:9,repeated:!0},{no:5,name:"statuses",kind:"enum",T:s.getEnumType(kp),repeated:!0},{no:6,name:"search_term",kind:"scalar",T:9,opt:!0},{no:7,name:"page_token",kind:"scalar",T:9,opt:!0},{no:8,name:"public_namespaces",kind:"scalar",T:9,repeated:!0},{no:9,name:"include_markdown_documentation",kind:"scalar",T:8,opt:!0}]),UT=s.makeMessageType("viam.app.v1.ListRegistryItemsResponse",()=>[{no:1,name:"items",kind:"message",T:Ea,repeated:!0}]),LT=s.makeMessageType("viam.app.v1.DeleteRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9}]),GT=s.makeMessageType("viam.app.v1.DeleteRegistryItemResponse",[]),BT=s.makeMessageType("viam.app.v1.RenameRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"new_name",kind:"scalar",T:9}]),FT=s.makeMessageType("viam.app.v1.RenameRegistryItemResponse",()=>[{no:1,name:"item",kind:"message",T:Ea}]),xT=s.makeMessageType("viam.app.v1.TransferRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"new_public_namespace",kind:"scalar",T:9}]),JT=s.makeMessageType("viam.app.v1.TransferRegistryItemResponse",[]),zT=s.makeMessageType("viam.app.v1.CreateModuleRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),YT=s.makeMessageType("viam.app.v1.CreateModuleResponse",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9}]),$T=s.makeMessageType("viam.app.v1.UpdateModuleRequest",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"visibility",kind:"enum",T:s.getEnumType(dn)},{no:3,name:"url",kind:"scalar",T:9},{no:4,name:"description",kind:"scalar",T:9},{no:5,name:"models",kind:"message",T:nn,repeated:!0},{no:6,name:"entrypoint",kind:"scalar",T:9},{no:7,name:"first_run",kind:"scalar",T:9,opt:!0},{no:8,name:"apps",kind:"message",T:en,repeated:!0},{no:9,name:"markdown_description",kind:"scalar",T:9,opt:!0}]),en=s.makeMessageType("viam.app.v1.App",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"entrypoint",kind:"scalar",T:9}]),VT=s.makeMessageType("viam.app.v1.UpdateModuleResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),WT=s.makeMessageType("viam.app.v1.UpdateModuleMetadata",()=>[{no:1,name:"models",kind:"message",T:nn,repeated:!0},{no:2,name:"entrypoint",kind:"scalar",T:9},{no:3,name:"apps",kind:"message",T:en,repeated:!0}]),jT=s.makeMessageType("viam.app.v1.UpdateMLModelMetadata",()=>[{no:1,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:2,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)}]),HT=s.makeMessageType("viam.app.v1.UpdateMLTrainingMetadata",()=>[{no:1,name:"model_type",kind:"enum",T:s.getEnumType(ze)},{no:2,name:"model_framework",kind:"enum",T:s.getEnumType(Qe)},{no:3,name:"draft",kind:"scalar",T:8}]),nn=s.makeMessageType("viam.app.v1.Model",()=>[{no:1,name:"api",kind:"scalar",T:9},{no:2,name:"model",kind:"scalar",T:9},{no:3,name:"markdown_documentation",kind:"scalar",T:9,opt:!0},{no:4,name:"description",kind:"scalar",T:9,opt:!0},{no:5,name:"supported_hardware",kind:"scalar",T:9,repeated:!0}]),KT=s.makeMessageType("viam.app.v1.ModuleFileInfo",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"platform",kind:"scalar",T:9},{no:5,name:"platform_tags",kind:"scalar",T:9,repeated:!0}]),XT=s.makeMessageType("viam.app.v1.UploadModuleFileRequest",()=>[{no:1,name:"module_file_info",kind:"message",T:KT,oneof:"module_file"},{no:2,name:"file",kind:"scalar",T:12,oneof:"module_file"}]),QT=s.makeMessageType("viam.app.v1.UploadModuleFileResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),ZT=s.makeMessageType("viam.app.v1.GetModuleRequest",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"include_markdown_documentation",kind:"scalar",T:8,opt:!0}]),ek=s.makeMessageType("viam.app.v1.GetModuleResponse",()=>[{no:1,name:"module",kind:"message",T:Oo}]),Oo=s.makeMessageType("viam.app.v1.Module",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"visibility",kind:"enum",T:s.getEnumType(dn)},{no:4,name:"versions",kind:"message",T:nk,repeated:!0},{no:5,name:"url",kind:"scalar",T:9},{no:6,name:"description",kind:"scalar",T:9},{no:7,name:"models",kind:"message",T:nn,repeated:!0},{no:8,name:"total_robot_usage",kind:"scalar",T:3},{no:9,name:"total_organization_usage",kind:"scalar",T:3},{no:10,name:"organization_id",kind:"scalar",T:9},{no:11,name:"entrypoint",kind:"scalar",T:9},{no:12,name:"public_namespace",kind:"scalar",T:9},{no:13,name:"first_run",kind:"scalar",T:9,opt:!0},{no:14,name:"markdown_description",kind:"scalar",T:9,opt:!0},{no:15,name:"apps",kind:"message",T:en,repeated:!0}]),nk=s.makeMessageType("viam.app.v1.VersionHistory",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"files",kind:"message",T:Co,repeated:!0},{no:3,name:"models",kind:"message",T:nn,repeated:!0},{no:4,name:"entrypoint",kind:"scalar",T:9},{no:5,name:"first_run",kind:"scalar",T:9,opt:!0},{no:6,name:"markdown_description",kind:"scalar",T:9,opt:!0},{no:7,name:"apps",kind:"message",T:en,repeated:!0}]),Co=s.makeMessageType("viam.app.v1.Uploads",()=>[{no:1,name:"platform",kind:"scalar",T:9},{no:2,name:"uploaded_at",kind:"message",T:S}]),ak=s.makeMessageType("viam.app.v1.ListModulesRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9,opt:!0},{no:2,name:"include_markdown_documentation",kind:"scalar",T:8,opt:!0}]),tk=s.makeMessageType("viam.app.v1.ListModulesResponse",()=>[{no:1,name:"modules",kind:"message",T:Oo,repeated:!0}]),sk=s.makeMessageType("viam.app.v1.GetUserIDByEmailRequest",()=>[{no:1,name:"email",kind:"scalar",T:9}]),ok=s.makeMessageType("viam.app.v1.GetUserIDByEmailResponse",()=>[{no:1,name:"user_id",kind:"scalar",T:9}]),ik=s.makeMessageType("viam.app.v1.ListOrganizationsByUserRequest",()=>[{no:1,name:"user_id",kind:"scalar",T:9}]),No=s.makeMessageType("viam.app.v1.OrgDetails",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"org_name",kind:"scalar",T:9},{no:3,name:"org_cid",kind:"scalar",T:9,opt:!0},{no:4,name:"public_namespace",kind:"scalar",T:9,opt:!0},{no:5,name:"billing_tier",kind:"scalar",T:9,opt:!0}]),rk=s.makeMessageType("viam.app.v1.ListOrganizationsByUserResponse",()=>[{no:1,name:"orgs",kind:"message",T:No,repeated:!0}]),mk=s.makeMessageType("viam.app.v1.SearchOrganizationsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9,opt:!0},{no:2,name:"org_name",kind:"scalar",T:9,opt:!0},{no:3,name:"cid",kind:"scalar",T:9,opt:!0},{no:4,name:"public_namespace",kind:"scalar",T:9,opt:!0}]),ck=s.makeMessageType("viam.app.v1.SearchOrganizationsResponse",()=>[{no:1,name:"organizations",kind:"message",T:No,repeated:!0}]),lk=s.makeMessageType("viam.app.v1.CreateKeyRequest",()=>[{no:1,name:"authorizations",kind:"message",T:Q,repeated:!0},{no:2,name:"name",kind:"scalar",T:9}]),dk=s.makeMessageType("viam.app.v1.CreateKeyResponse",()=>[{no:1,name:"key",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:9}]),pk=s.makeMessageType("viam.app.v1.DeleteKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),uk=s.makeMessageType("viam.app.v1.DeleteKeyResponse",[]),gk=s.makeMessageType("viam.app.v1.RenameKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),Tk=s.makeMessageType("viam.app.v1.RenameKeyResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),kk=s.makeMessageType("viam.app.v1.AuthorizationDetails",()=>[{no:1,name:"authorization_type",kind:"scalar",T:9},{no:2,name:"authorization_id",kind:"scalar",T:9},{no:3,name:"resource_type",kind:"scalar",T:9},{no:4,name:"resource_id",kind:"scalar",T:9},{no:5,name:"org_id",kind:"scalar",T:9}]),Po=s.makeMessageType("viam.app.v1.APIKeyWithAuthorizations",()=>[{no:1,name:"api_key",kind:"message",T:pg},{no:2,name:"authorizations",kind:"message",T:kk,repeated:!0}]),yk=s.makeMessageType("viam.app.v1.ListKeysRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),vk=s.makeMessageType("viam.app.v1.ListKeysResponse",()=>[{no:1,name:"api_keys",kind:"message",T:Po,repeated:!0}]),hk=s.makeMessageType("viam.app.v1.RotateKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),fk=s.makeMessageType("viam.app.v1.RotateKeyResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}]),Rk=s.makeMessageType("viam.app.v1.CreateKeyFromExistingKeyAuthorizationsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),_k=s.makeMessageType("viam.app.v1.CreateKeyFromExistingKeyAuthorizationsResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}]),Sk=s.makeMessageType("viam.app.v1.GetAppContentRequest",()=>[{no:1,name:"public_namespace",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),Ik=s.makeMessageType("viam.app.v1.GetAppContentResponse",()=>[{no:1,name:"blob_path",kind:"scalar",T:9},{no:2,name:"entrypoint",kind:"scalar",T:9}]),Mk=s.makeMessageType("viam.app.v1.OrganizationSetLogoRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"logo",kind:"scalar",T:12}]),bk=s.makeMessageType("viam.app.v1.OrganizationSetLogoResponse",[]),Ek=s.makeMessageType("viam.app.v1.OrganizationGetLogoRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),wk=s.makeMessageType("viam.app.v1.OrganizationGetLogoResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),Ok=s.makeMessageType("viam.app.v1.EnableAuthServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Ck=s.makeMessageType("viam.app.v1.EnableAuthServiceResponse",[]),Nk=s.makeMessageType("viam.app.v1.DisableAuthServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Pk=s.makeMessageType("viam.app.v1.DisableAuthServiceResponse",[]),Dk=s.makeMessageType("viam.app.v1.CreateOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_name",kind:"scalar",T:9},{no:3,name:"oauth_config",kind:"message",T:wa}]),Ak=s.makeMessageType("viam.app.v1.CreateOAuthAppResponse",()=>[{no:1,name:"client_id",kind:"scalar",T:9},{no:2,name:"client_secret",kind:"scalar",T:9}]),qk=s.makeMessageType("viam.app.v1.ReadOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9}]),Uk=s.makeMessageType("viam.app.v1.ReadOAuthAppResponse",()=>[{no:1,name:"client_name",kind:"scalar",T:9},{no:2,name:"client_secret",kind:"scalar",T:9},{no:3,name:"oauth_config",kind:"message",T:wa}]),Lk=s.makeMessageType("viam.app.v1.UpdateOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9},{no:3,name:"client_name",kind:"scalar",T:9},{no:4,name:"oauth_config",kind:"message",T:wa}]),Gk=s.makeMessageType("viam.app.v1.UpdateOAuthAppResponse",[]),Bk=s.makeMessageType("viam.app.v1.DeleteOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9}]),Fk=s.makeMessageType("viam.app.v1.DeleteOAuthAppResponse",[]),xk=s.makeMessageType("viam.app.v1.ListOAuthAppsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Jk=s.makeMessageType("viam.app.v1.ListOAuthAppsResponse",()=>[{no:1,name:"client_ids",kind:"scalar",T:9,repeated:!0}]),wa=s.makeMessageType("viam.app.v1.OAuthConfig",()=>[{no:1,name:"client_authentication",kind:"enum",T:s.getEnumType(yp)},{no:2,name:"pkce",kind:"enum",T:s.getEnumType(vp)},{no:3,name:"url_validation",kind:"enum",T:s.getEnumType(hp)},{no:4,name:"origin_uris",kind:"scalar",T:9,repeated:!0},{no:5,name:"redirect_uris",kind:"scalar",T:9,repeated:!0},{no:6,name:"logout_uri",kind:"scalar",T:9},{no:7,name:"enabled_grants",kind:"enum",T:s.getEnumType(fp),repeated:!0}]),I1=Object.freeze(Object.defineProperty({__proto__:null,APIKey:pg,APIKeyWithAuthorizations:Po,AddRoleRequest:gT,AddRoleResponse:TT,AdditionalFragment:Eo,App:en,AuthenticationType:gp,AuthenticatorInfo:_o,Authorization:Q,AuthorizationDetails:kk,AuthorizedPermissions:wo,BillingAddress:Sa,ChangeRoleRequest:vT,ChangeRoleResponse:hT,CheckPermissionsRequest:_T,CheckPermissionsResponse:ST,ClientAuthentication:yp,CreateFragmentRequest:_g,CreateFragmentResponse:Sg,CreateKeyFromExistingKeyAuthorizationsRequest:Rk,CreateKeyFromExistingKeyAuthorizationsResponse:_k,CreateKeyRequest:lk,CreateKeyResponse:dk,CreateLocationRequest:uu,CreateLocationResponse:gu,CreateLocationSecretRequest:Du,CreateLocationSecretResponse:Au,CreateModuleRequest:zT,CreateModuleResponse:YT,CreateOAuthAppRequest:Dk,CreateOAuthAppResponse:Ak,CreateOrganizationInviteRequest:zp,CreateOrganizationInviteResponse:Yp,CreateOrganizationRequest:Mp,CreateOrganizationResponse:bp,CreateRegistryItemRequest:NT,CreateRegistryItemResponse:PT,CreateRobotPartSecretRequest:lT,CreateRobotPartSecretResponse:dT,DeleteFragmentRequest:bg,DeleteFragmentResponse:Eg,DeleteFragmentTagRequest:Ag,DeleteFragmentTagResponse:qg,DeleteKeyRequest:pk,DeleteKeyResponse:uk,DeleteLocationRequest:hu,DeleteLocationResponse:fu,DeleteLocationSecretRequest:qu,DeleteLocationSecretResponse:Uu,DeleteOAuthAppRequest:Bk,DeleteOAuthAppResponse:Fk,DeleteOrganizationInviteRequest:Wp,DeleteOrganizationInviteResponse:jp,DeleteOrganizationMemberRequest:Xp,DeleteOrganizationMemberResponse:Qp,DeleteOrganizationRequest:qp,DeleteOrganizationResponse:Up,DeleteRegistryItemRequest:LT,DeleteRegistryItemResponse:GT,DeleteRobotPartRequest:ig,DeleteRobotPartResponse:gg,DeleteRobotPartSecretRequest:pT,DeleteRobotPartSecretResponse:uT,DeleteRobotRequest:eT,DeleteRobotResponse:nT,DisableAuthServiceRequest:Nk,DisableAuthServiceResponse:Pk,DisableBillingServiceRequest:ou,DisableBillingServiceResponse:iu,EnableAuthServiceRequest:Ok,EnableAuthServiceResponse:Ck,EnableBillingServiceRequest:Zp,EnableBillingServiceResponse:eu,EnabledGrant:fp,Fragment:Ye,FragmentError:yg,FragmentErrorType:Tp,FragmentHistoryEntry:Tg,FragmentRevision:kg,FragmentSummary:$g,FragmentTag:Ma,FragmentUsage:ba,FragmentVisibility:On,GetAppContentRequest:Sk,GetAppContentResponse:Ik,GetBillingServiceConfigRequest:tu,GetBillingServiceConfigResponse:su,GetFragmentHistoryRequest:wg,GetFragmentHistoryResponse:Og,GetFragmentRequest:fg,GetFragmentResponse:Rg,GetFragmentUsageRequest:Cg,GetFragmentUsageResponse:Ng,GetLocationMetadataRequest:Ru,GetLocationMetadataResponse:_u,GetLocationRequest:Tu,GetLocationResponse:ku,GetModuleRequest:ZT,GetModuleResponse:ek,GetOrganizationMetadataRequest:Lp,GetOrganizationMetadataResponse:Gp,GetOrganizationNamespaceAvailabilityRequest:Op,GetOrganizationNamespaceAvailabilityResponse:Cp,GetOrganizationRequest:Ep,GetOrganizationResponse:wp,GetOrganizationsWithAccessToLocationRequest:Mu,GetOrganizationsWithAccessToLocationResponse:bu,GetRegistryItemRequest:OT,GetRegistryItemResponse:CT,GetRobotAPIKeysRequest:dg,GetRobotAPIKeysResponse:ug,GetRobotMetadataRequest:aT,GetRobotMetadataResponse:tT,GetRobotPartByNameAndLocationRequest:ju,GetRobotPartByNameAndLocationResponse:Hu,GetRobotPartHistoryRequest:eg,GetRobotPartHistoryResponse:ng,GetRobotPartLogsRequest:Ku,GetRobotPartLogsResponse:Xu,GetRobotPartMetadataRequest:rg,GetRobotPartMetadataResponse:mg,GetRobotPartRequest:Vu,GetRobotPartResponse:Wu,GetRobotPartsRequest:Yu,GetRobotPartsResponse:$u,GetRobotRequest:Bu,GetRobotResponse:zu,GetRoverRentalRobotsRequest:Fu,GetRoverRentalRobotsResponse:Ju,GetUserIDByEmailRequest:sk,GetUserIDByEmailResponse:ok,ListAuthorizationsRequest:fT,ListAuthorizationsResponse:RT,ListFragmentsRequest:vg,ListFragmentsResponse:hg,ListKeysRequest:yk,ListKeysResponse:vk,ListLocationsRequest:Eu,ListLocationsResponse:Pu,ListMachineFragmentsRequest:Bg,ListMachineFragmentsResponse:Fg,ListMachineSummariesRequest:xg,ListMachineSummariesResponse:Jg,ListModulesRequest:ak,ListModulesResponse:tk,ListNestedFragmentsRequest:Lg,ListNestedFragmentsResponse:Gg,ListOAuthAppsRequest:xk,ListOAuthAppsResponse:Jk,ListOrganizationMembersRequest:xp,ListOrganizationMembersResponse:Jp,ListOrganizationsByUserRequest:ik,ListOrganizationsByUserResponse:rk,ListOrganizationsRequest:_p,ListOrganizationsResponse:Ip,ListRegistryItemsRequest:qT,ListRegistryItemsResponse:UT,ListRobotsRequest:Ug,ListRobotsResponse:Hg,Location:Nn,LocationAuth:Ia,LocationAuthRequest:Lu,LocationAuthResponse:Gu,LocationOrganization:du,LocationSummary:zg,MLModelMetadata:bT,MLTrainingMetadata:wT,MLTrainingVersion:ET,MachineSummary:Yg,MarkPartAsMainRequest:iT,MarkPartAsMainResponse:rT,MarkPartForRestartRequest:mT,MarkPartForRestartResponse:cT,Model:nn,Module:Oo,ModuleFileInfo:KT,ModuleMetadata:MT,ModuleVersion:IT,NewRobotPartRequest:sg,NewRobotPartResponse:og,NewRobotRequest:Kg,NewRobotResponse:Xg,OAuthConfig:wa,OrgDetails:No,Organization:pn,OrganizationGetLogoRequest:Ek,OrganizationGetLogoResponse:wk,OrganizationGetSupportEmailRequest:cu,OrganizationGetSupportEmailResponse:lu,OrganizationIdentity:So,OrganizationInvite:Cn,OrganizationMember:Sp,OrganizationSetLogoRequest:Mk,OrganizationSetLogoResponse:bk,OrganizationSetSupportEmailRequest:ru,OrganizationSetSupportEmailResponse:mu,PKCE:vp,PartSummary:jg,ReadOAuthAppRequest:qk,ReadOAuthAppResponse:Uk,RegistryItem:Ea,RegistryItemStatus:kp,RemoveRoleRequest:kT,RemoveRoleResponse:yT,RenameKeyRequest:gk,RenameKeyResponse:Tk,RenameRegistryItemRequest:BT,RenameRegistryItemResponse:FT,ResendOrganizationInviteRequest:Hp,ResendOrganizationInviteResponse:Kp,ResolvedFragment:bo,Robot:_a,RobotPart:Ze,RobotPartHistoryEntry:Rp,RotateKeyRequest:hk,RotateKeyResponse:fk,RoverRentalRobot:xu,SearchOrganizationsRequest:mk,SearchOrganizationsResponse:ck,SetFragmentTagRequest:Pg,SetFragmentTagResponse:Dg,ShareLocationRequest:wu,ShareLocationResponse:Ou,SharedSecret:Io,SharedSecret_State:Mo,StorageConfig:pu,TailRobotPartLogsRequest:Qu,TailRobotPartLogsResponse:Zu,TransferRegistryItemRequest:xT,TransferRegistryItemResponse:JT,URLValidation:hp,UnshareLocationRequest:Cu,UnshareLocationResponse:Nu,UpdateBillingServiceRequest:nu,UpdateBillingServiceResponse:au,UpdateFragmentRequest:Ig,UpdateFragmentResponse:Mg,UpdateLocationMetadataRequest:Su,UpdateLocationMetadataResponse:Iu,UpdateLocationRequest:yu,UpdateLocationResponse:vu,UpdateMLModelMetadata:jT,UpdateMLTrainingMetadata:HT,UpdateModuleMetadata:WT,UpdateModuleRequest:$T,UpdateModuleResponse:VT,UpdateOAuthAppRequest:Lk,UpdateOAuthAppResponse:Gk,UpdateOrganizationInviteAuthorizationsRequest:$p,UpdateOrganizationInviteAuthorizationsResponse:Vp,UpdateOrganizationMetadataRequest:Bp,UpdateOrganizationMetadataResponse:Fp,UpdateOrganizationNamespaceRequest:Dp,UpdateOrganizationNamespaceResponse:Ap,UpdateOrganizationRequest:Np,UpdateOrganizationResponse:Pp,UpdateRegistryItemRequest:DT,UpdateRegistryItemResponse:AT,UpdateRobotMetadataRequest:sT,UpdateRobotMetadataResponse:oT,UpdateRobotPartMetadataRequest:cg,UpdateRobotPartMetadataResponse:lg,UpdateRobotPartRequest:ag,UpdateRobotPartResponse:tg,UpdateRobotRequest:Qg,UpdateRobotResponse:Zg,UploadModuleFileRequest:XT,UploadModuleFileResponse:QT,Uploads:Co,VersionHistory:nk,ViamAgentVersion:Wg,ViamServerVersion:Vg,Visibility:dn},Symbol.toStringTag,{value:"Module"})),M1={typeName:"viam.app.v1.AppService",methods:{getUserIDByEmail:{name:"GetUserIDByEmail",I:sk,O:ok,kind:m.Unary},createOrganization:{name:"CreateOrganization",I:Mp,O:bp,kind:m.Unary},listOrganizations:{name:"ListOrganizations",I:_p,O:Ip,kind:m.Unary},getOrganizationsWithAccessToLocation:{name:"GetOrganizationsWithAccessToLocation",I:Mu,O:bu,kind:m.Unary},listOrganizationsByUser:{name:"ListOrganizationsByUser",I:ik,O:rk,kind:m.Unary},searchOrganizations:{name:"SearchOrganizations",I:mk,O:ck,kind:m.Unary},getOrganization:{name:"GetOrganization",I:Ep,O:wp,kind:m.Unary},getOrganizationNamespaceAvailability:{name:"GetOrganizationNamespaceAvailability",I:Op,O:Cp,kind:m.Unary},updateOrganization:{name:"UpdateOrganization",I:Np,O:Pp,kind:m.Unary},updateOrganizationNamespace:{name:"UpdateOrganizationNamespace",I:Dp,O:Ap,kind:m.Unary},deleteOrganization:{name:"DeleteOrganization",I:qp,O:Up,kind:m.Unary},getOrganizationMetadata:{name:"GetOrganizationMetadata",I:Lp,O:Gp,kind:m.Unary},updateOrganizationMetadata:{name:"UpdateOrganizationMetadata",I:Bp,O:Fp,kind:m.Unary},listOrganizationMembers:{name:"ListOrganizationMembers",I:xp,O:Jp,kind:m.Unary},createOrganizationInvite:{name:"CreateOrganizationInvite",I:zp,O:Yp,kind:m.Unary},updateOrganizationInviteAuthorizations:{name:"UpdateOrganizationInviteAuthorizations",I:$p,O:Vp,kind:m.Unary},deleteOrganizationMember:{name:"DeleteOrganizationMember",I:Xp,O:Qp,kind:m.Unary},deleteOrganizationInvite:{name:"DeleteOrganizationInvite",I:Wp,O:jp,kind:m.Unary},resendOrganizationInvite:{name:"ResendOrganizationInvite",I:Hp,O:Kp,kind:m.Unary},enableBillingService:{name:"EnableBillingService",I:Zp,O:eu,kind:m.Unary},disableBillingService:{name:"DisableBillingService",I:ou,O:iu,kind:m.Unary},updateBillingService:{name:"UpdateBillingService",I:nu,O:au,kind:m.Unary},getBillingServiceConfig:{name:"GetBillingServiceConfig",I:tu,O:su,kind:m.Unary},organizationSetSupportEmail:{name:"OrganizationSetSupportEmail",I:ru,O:mu,kind:m.Unary},organizationGetSupportEmail:{name:"OrganizationGetSupportEmail",I:cu,O:lu,kind:m.Unary},organizationSetLogo:{name:"OrganizationSetLogo",I:Mk,O:bk,kind:m.Unary},organizationGetLogo:{name:"OrganizationGetLogo",I:Ek,O:wk,kind:m.Unary},enableAuthService:{name:"EnableAuthService",I:Ok,O:Ck,kind:m.Unary},disableAuthService:{name:"DisableAuthService",I:Nk,O:Pk,kind:m.Unary},createOAuthApp:{name:"CreateOAuthApp",I:Dk,O:Ak,kind:m.Unary},readOAuthApp:{name:"ReadOAuthApp",I:qk,O:Uk,kind:m.Unary},updateOAuthApp:{name:"UpdateOAuthApp",I:Lk,O:Gk,kind:m.Unary},deleteOAuthApp:{name:"DeleteOAuthApp",I:Bk,O:Fk,kind:m.Unary},listOAuthApps:{name:"ListOAuthApps",I:xk,O:Jk,kind:m.Unary},createLocation:{name:"CreateLocation",I:uu,O:gu,kind:m.Unary},getLocation:{name:"GetLocation",I:Tu,O:ku,kind:m.Unary},updateLocation:{name:"UpdateLocation",I:yu,O:vu,kind:m.Unary},deleteLocation:{name:"DeleteLocation",I:hu,O:fu,kind:m.Unary},getLocationMetadata:{name:"GetLocationMetadata",I:Ru,O:_u,kind:m.Unary},updateLocationMetadata:{name:"UpdateLocationMetadata",I:Su,O:Iu,kind:m.Unary},listLocations:{name:"ListLocations",I:Eu,O:Pu,kind:m.Unary},shareLocation:{name:"ShareLocation",I:wu,O:Ou,kind:m.Unary},unshareLocation:{name:"UnshareLocation",I:Cu,O:Nu,kind:m.Unary},locationAuth:{name:"LocationAuth",I:Lu,O:Gu,kind:m.Unary},createLocationSecret:{name:"CreateLocationSecret",I:Du,O:Au,kind:m.Unary},deleteLocationSecret:{name:"DeleteLocationSecret",I:qu,O:Uu,kind:m.Unary},getRobot:{name:"GetRobot",I:Bu,O:zu,kind:m.Unary},getRobotMetadata:{name:"GetRobotMetadata",I:aT,O:tT,kind:m.Unary},updateRobotMetadata:{name:"UpdateRobotMetadata",I:sT,O:oT,kind:m.Unary},getRoverRentalRobots:{name:"GetRoverRentalRobots",I:Fu,O:Ju,kind:m.Unary},getRobotParts:{name:"GetRobotParts",I:Yu,O:$u,kind:m.Unary},getRobotPart:{name:"GetRobotPart",I:Vu,O:Wu,kind:m.Unary},getRobotPartByNameAndLocation:{name:"GetRobotPartByNameAndLocation",I:ju,O:Hu,kind:m.Unary},getRobotPartLogs:{name:"GetRobotPartLogs",I:Ku,O:Xu,kind:m.Unary},tailRobotPartLogs:{name:"TailRobotPartLogs",I:Qu,O:Zu,kind:m.ServerStreaming},getRobotPartHistory:{name:"GetRobotPartHistory",I:eg,O:ng,kind:m.Unary},updateRobotPart:{name:"UpdateRobotPart",I:ag,O:tg,kind:m.Unary},newRobotPart:{name:"NewRobotPart",I:sg,O:og,kind:m.Unary},deleteRobotPart:{name:"DeleteRobotPart",I:ig,O:gg,kind:m.Unary},getRobotPartMetadata:{name:"GetRobotPartMetadata",I:rg,O:mg,kind:m.Unary},updateRobotPartMetadata:{name:"UpdateRobotPartMetadata",I:cg,O:lg,kind:m.Unary},getRobotAPIKeys:{name:"GetRobotAPIKeys",I:dg,O:ug,kind:m.Unary},markPartAsMain:{name:"MarkPartAsMain",I:iT,O:rT,kind:m.Unary},markPartForRestart:{name:"MarkPartForRestart",I:mT,O:cT,kind:m.Unary},createRobotPartSecret:{name:"CreateRobotPartSecret",I:lT,O:dT,kind:m.Unary},deleteRobotPartSecret:{name:"DeleteRobotPartSecret",I:pT,O:uT,kind:m.Unary},listRobots:{name:"ListRobots",I:Ug,O:Hg,kind:m.Unary},newRobot:{name:"NewRobot",I:Kg,O:Xg,kind:m.Unary},updateRobot:{name:"UpdateRobot",I:Qg,O:Zg,kind:m.Unary},deleteRobot:{name:"DeleteRobot",I:eT,O:nT,kind:m.Unary},listFragments:{name:"ListFragments",I:vg,O:hg,kind:m.Unary},getFragment:{name:"GetFragment",I:fg,O:Rg,kind:m.Unary},createFragment:{name:"CreateFragment",I:_g,O:Sg,kind:m.Unary},updateFragment:{name:"UpdateFragment",I:Ig,O:Mg,kind:m.Unary},deleteFragment:{name:"DeleteFragment",I:bg,O:Eg,kind:m.Unary},listNestedFragments:{name:"ListNestedFragments",I:Lg,O:Gg,kind:m.Unary},listMachineFragments:{name:"ListMachineFragments",I:Bg,O:Fg,kind:m.Unary},listMachineSummaries:{name:"ListMachineSummaries",I:xg,O:Jg,kind:m.Unary},getFragmentHistory:{name:"GetFragmentHistory",I:wg,O:Og,kind:m.Unary},getFragmentUsage:{name:"GetFragmentUsage",I:Cg,O:Ng,kind:m.Unary},setFragmentTag:{name:"SetFragmentTag",I:Pg,O:Dg,kind:m.Unary},deleteFragmentTag:{name:"DeleteFragmentTag",I:Ag,O:qg,kind:m.Unary},addRole:{name:"AddRole",I:gT,O:TT,kind:m.Unary},removeRole:{name:"RemoveRole",I:kT,O:yT,kind:m.Unary},changeRole:{name:"ChangeRole",I:vT,O:hT,kind:m.Unary},listAuthorizations:{name:"ListAuthorizations",I:fT,O:RT,kind:m.Unary},checkPermissions:{name:"CheckPermissions",I:_T,O:ST,kind:m.Unary},getRegistryItem:{name:"GetRegistryItem",I:OT,O:CT,kind:m.Unary},createRegistryItem:{name:"CreateRegistryItem",I:NT,O:PT,kind:m.Unary},updateRegistryItem:{name:"UpdateRegistryItem",I:DT,O:AT,kind:m.Unary},listRegistryItems:{name:"ListRegistryItems",I:qT,O:UT,kind:m.Unary},deleteRegistryItem:{name:"DeleteRegistryItem",I:LT,O:GT,kind:m.Unary},renameRegistryItem:{name:"RenameRegistryItem",I:BT,O:FT,kind:m.Unary},transferRegistryItem:{name:"TransferRegistryItem",I:xT,O:JT,kind:m.Unary},createModule:{name:"CreateModule",I:zT,O:YT,kind:m.Unary},updateModule:{name:"UpdateModule",I:$T,O:VT,kind:m.Unary},uploadModuleFile:{name:"UploadModuleFile",I:XT,O:QT,kind:m.ClientStreaming},getModule:{name:"GetModule",I:ZT,O:ek,kind:m.Unary},listModules:{name:"ListModules",I:ak,O:tk,kind:m.Unary},createKey:{name:"CreateKey",I:lk,O:dk,kind:m.Unary},deleteKey:{name:"DeleteKey",I:pk,O:uk,kind:m.Unary},listKeys:{name:"ListKeys",I:yk,O:vk,kind:m.Unary},renameKey:{name:"RenameKey",I:gk,O:Tk,kind:m.Unary},rotateKey:{name:"RotateKey",I:hk,O:fk,kind:m.Unary},createKeyFromExistingKeyAuthorizations:{name:"CreateKeyFromExistingKeyAuthorizations",I:Rk,O:_k,kind:m.Unary},getAppContent:{name:"GetAppContent",I:Sk,O:Ik,kind:m.Unary}}},zk=(a,e,n,t,o,i)=>new Q({authorizationType:"role",identityId:e,identityType:o,authorizationId:`${t}_${n}`,resourceType:t,organizationId:a,resourceId:i});class b1{client;constructor(e){this.client=aa(M1,e)}async getUserIDByEmail(e){return(await this.client.getUserIDByEmail({email:e})).userId}async createOrganization(e){return(await this.client.createOrganization({name:e})).organization}async listOrganizations(){return(await this.client.listOrganizations({})).organizations}async getOrganizationsWithAccessToLocation(e){return(await this.client.getOrganizationsWithAccessToLocation({locationId:e})).organizationIdentities}async listOrganizationsByUser(e){return(await this.client.listOrganizationsByUser({userId:e})).orgs}async getOrganization(e){return(await this.client.getOrganization({organizationId:e})).organization}async getOrganizationNamespaceAvailability(e){return(await this.client.getOrganizationNamespaceAvailability({publicNamespace:e})).available}async updateOrganization(e,n,t,o,i){return(await this.client.updateOrganization({organizationId:e,name:n,publicNamespace:t,region:o,cid:i})).organization}async deleteOrganization(e){await this.client.deleteOrganization({organizationId:e})}async listOrganizationMembers(e){return this.client.listOrganizationMembers({organizationId:e})}async createOrganizationInvite(e,n,t,o=!0){return(await this.client.createOrganizationInvite({organizationId:e,email:n,authorizations:t,sendEmailInvite:o})).invite}async updateOrganizationInviteAuthorizations(e,n,t,o){return(await this.client.updateOrganizationInviteAuthorizations({organizationId:e,email:n,addAuthorizations:t,removeAuthorizations:o})).invite}async deleteOrganizationMember(e,n){await this.client.deleteOrganizationMember({organizationId:e,userId:n})}async deleteOrganizationInvite(e,n){await this.client.deleteOrganizationInvite({organizationId:e,email:n})}async resendOrganizationInvite(e,n){return(await this.client.resendOrganizationInvite({organizationId:e,email:n})).invite}async createLocation(e,n,t){return(await this.client.createLocation({organizationId:e,name:n,parentLocationId:t})).location}async getLocation(e){return(await this.client.getLocation({locationId:e})).location}async updateLocation(e,n,t,o){return(await this.client.updateLocation({locationId:e,name:n,parentLocationId:t,region:o})).location}async deleteLocation(e){await this.client.deleteLocation({locationId:e})}async listLocations(e){return(await this.client.listLocations({organizationId:e})).locations}async shareLocation(e,n){await this.client.shareLocation({organizationId:e,locationId:n})}async unshareLocation(e,n){await this.client.unshareLocation({organizationId:e,locationId:n})}async locationAuth(e){return(await this.client.locationAuth({locationId:e})).auth}async createLocationSecret(e){return(await this.client.createLocationSecret({locationId:e})).auth}async deleteLocationSecret(e,n){await this.client.deleteLocationSecret({locationId:e,secretId:n})}async getRobot(e){return(await this.client.getRobot({id:e})).robot}async getRoverRentalRobots(e){return(await this.client.getRoverRentalRobots({orgId:e})).robots}async getRobotParts(e){return(await this.client.getRobotParts({robotId:e})).parts}async getRobotPart(e){return this.client.getRobotPart({id:e})}async getRobotPartByNameAndLocation(e,n){return this.client.getRobotPartByNameAndLocation({name:e,locationId:n})}async getRobotPartLogs(e,n,t,o=""){return this.client.getRobotPartLogs({id:e,filter:n,levels:t,pageToken:o})}async tailRobotPartLogs(e,n,t,o=!0){const i=this.client.tailRobotPartLogs({id:e,errorsOnly:o,filter:t});for await(const r of i)for(const c of r.logs)n.push(c)}async getRobotPartHistory(e){return(await this.client.getRobotPartHistory({id:e})).history}async updateRobotPart(e,n,t){return(await this.client.updateRobotPart({id:e,name:n,robotConfig:t})).part}async newRobotPart(e,n){return(await this.client.newRobotPart({robotId:e,partName:n})).partId}async deleteRobotPart(e){await this.client.deleteRobotPart({partId:e})}async getRobotAPIKeys(e){return(await this.client.getRobotAPIKeys({robotId:e})).apiKeys}async markPartAsMain(e){await this.client.markPartAsMain({partId:e})}async markPartForRestart(e){await this.client.markPartForRestart({partId:e})}async createRobotPartSecret(e){return(await this.client.createRobotPartSecret({partId:e})).part}async deleteRobotPartSecret(e,n){await this.client.deleteRobotPartSecret({partId:e,secretId:n})}async listRobots(e){return(await this.client.listRobots({locationId:e})).robots}async newRobot(e,n){return(await this.client.newRobot({name:n,location:e})).id}async updateRobot(e,n,t){return(await this.client.updateRobot({id:e,location:n,name:t})).robot}async deleteRobot(e){await this.client.deleteRobot({id:e})}async listFragments(e,n=!0,t=[]){return(await this.client.listFragments({organizationId:e,showPublic:n,fragmentVisibility:t})).fragments}async getFragment(e){return(await this.client.getFragment({id:e})).fragment}async createFragment(e,n,t){return(await this.client.createFragment({organizationId:e,name:n,config:t})).fragment}async updateFragment(e,n,t,o,i){return(await this.client.updateFragment({id:e,name:n,config:t,public:o,visibility:i})).fragment}async deleteFragment(e){await this.client.deleteFragment({id:e})}async listMachineFragments(e,n){return(await this.client.listMachineFragments({machineId:e,additionalFragmentIds:n})).fragments}async addRole(e,n,t,o,i){await this.client.addRole({authorization:zk(e,n,t,o,"",i)})}async removeRole(e,n,t,o,i){await this.client.removeRole({authorization:zk(e,n,t,o,"",i)})}async changeRole(e,n){await this.client.changeRole({oldAuthorization:e,newAuthorization:n})}async listAuthorizations(e,n){return(await this.client.listAuthorizations({organizationId:e,resourceIds:n})).authorizations}async checkPermissions(e){return(await this.client.checkPermissions({permissions:e})).authorizedPermissions}async getRegistryItem(e){return(await this.client.getRegistryItem({itemId:e})).item}async createRegistryItem(e,n,t){await this.client.createRegistryItem({organizationId:e,name:n,type:t})}async updateRegistryItem(e,n,t,o){await this.client.updateRegistryItem({itemId:e,type:n,description:t,visibility:o})}async listRegistryItems(e,n,t,o,i,r,c){const d={organizationId:e,types:n,visibilities:t,platforms:o,statuses:i,searchTerm:r,pageToken:c};return(await this.client.listRegistryItems(d)).items}async deleteRegistryItem(e){await this.client.deleteRegistryItem({itemId:e})}async createModule(e,n){return this.client.createModule({organizationId:e,name:n})}async updateModule(e,n,t,o,i,r){return(await this.client.updateModule({moduleId:e,visibility:n,url:t,description:o,models:i,entrypoint:r})).url}async getModule(e){return(await this.client.getModule({moduleId:e})).module}async listModules(e){return(await this.client.listModules({organizationId:e})).modules}async createKey(e,n){return this.client.createKey({name:n,authorizations:e})}async deleteKey(e){return this.client.deleteKey({id:e})}async listKeys(e){return(await this.client.listKeys({orgId:e})).apiKeys}async rotateKey(e){return this.client.rotateKey({id:e})}async createKeyFromExistingKeyAuthorizations(e){return this.client.createKeyFromExistingKeyAuthorizations({id:e})}async getAppContent(e,n){return this.client.getAppContent({publicNamespace:e,name:n})}async getOrganizationMetadata(e){return(await this.client.getOrganizationMetadata({organizationId:e})).toJson().data??{}}async updateOrganizationMetadata(e,n){await this.client.updateOrganizationMetadata({organizationId:e,data:l.fromJson(n)})}async getLocationMetadata(e){return(await this.client.getLocationMetadata({locationId:e})).toJson().data??{}}async updateLocationMetadata(e,n){await this.client.updateLocationMetadata({locationId:e,data:l.fromJson(n)})}async getRobotMetadata(e){return(await this.client.getRobotMetadata({id:e})).toJson().data??{}}async updateRobotMetadata(e,n){await this.client.updateRobotMetadata({id:e,data:l.fromJson(n)})}async getRobotPartMetadata(e){return(await this.client.getRobotPartMetadata({id:e})).toJson().data??{}}async updateRobotPartMetadata(e,n){await this.client.updateRobotPartMetadata({id:e,data:l.fromJson(n)})}}const Yk=s.makeEnum("viam.app.v1.PaymentMethodType",[{no:0,name:"PAYMENT_METHOD_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PAYMENT_METHOD_TYPE_CARD",localName:"CARD"}]),$k=s.makeEnum("viam.app.v1.UsageCostType",[{no:0,name:"USAGE_COST_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"USAGE_COST_TYPE_DATA_UPLOAD",localName:"DATA_UPLOAD"},{no:2,name:"USAGE_COST_TYPE_DATA_EGRESS",localName:"DATA_EGRESS"},{no:3,name:"USAGE_COST_TYPE_REMOTE_CONTROL",localName:"REMOTE_CONTROL"},{no:4,name:"USAGE_COST_TYPE_STANDARD_COMPUTE",localName:"STANDARD_COMPUTE"},{no:5,name:"USAGE_COST_TYPE_CLOUD_STORAGE",localName:"CLOUD_STORAGE"},{no:6,name:"USAGE_COST_TYPE_BINARY_DATA_CLOUD_STORAGE",localName:"BINARY_DATA_CLOUD_STORAGE"},{no:7,name:"USAGE_COST_TYPE_OTHER_CLOUD_STORAGE",localName:"OTHER_CLOUD_STORAGE"},{no:8,name:"USAGE_COST_TYPE_PER_MACHINE",localName:"PER_MACHINE"},{no:9,name:"USAGE_COST_TYPE_TRIGGER_NOTIFICATION",localName:"TRIGGER_NOTIFICATION"},{no:10,name:"USAGE_COST_TYPE_TABULAR_DATA_CLOUD_STORAGE",localName:"TABULAR_DATA_CLOUD_STORAGE"},{no:11,name:"USAGE_COST_TYPE_CONFIG_HISTORY_CLOUD_STORAGE",localName:"CONFIG_HISTORY_CLOUD_STORAGE"},{no:12,name:"USAGE_COST_TYPE_LOGS_CLOUD_STORAGE",localName:"LOGS_CLOUD_STORAGE"},{no:13,name:"USAGE_COST_TYPE_TRAINING_LOGS_CLOUD_STORAGE",localName:"TRAINING_LOGS_CLOUD_STORAGE"},{no:14,name:"USAGE_COST_TYPE_PACKAGES_CLOUD_STORAGE",localName:"PACKAGES_CLOUD_STORAGE"},{no:15,name:"USAGE_COST_TYPE_BINARY_DATA_UPLOAD",localName:"BINARY_DATA_UPLOAD"},{no:16,name:"USAGE_COST_TYPE_TABULAR_DATA_UPLOAD",localName:"TABULAR_DATA_UPLOAD"},{no:17,name:"USAGE_COST_TYPE_LOGS_UPLOAD",localName:"LOGS_UPLOAD"},{no:18,name:"USAGE_COST_TYPE_BINARY_DATA_EGRESS",localName:"BINARY_DATA_EGRESS"},{no:19,name:"USAGE_COST_TYPE_TABULAR_DATA_EGRESS",localName:"TABULAR_DATA_EGRESS"},{no:20,name:"USAGE_COST_TYPE_LOGS_EGRESS",localName:"LOGS_EGRESS"},{no:21,name:"USAGE_COST_TYPE_TRAINING_LOGS_EGRESS",localName:"TRAINING_LOGS_EGRESS"},{no:22,name:"USAGE_COST_TYPE_TABULAR_DATA_DATABASE_CLOUD_STORAGE",localName:"TABULAR_DATA_DATABASE_CLOUD_STORAGE"},{no:23,name:"USAGE_COST_TYPE_TABULAR_DATA_DATABASE_COMPUTE",localName:"TABULAR_DATA_DATABASE_COMPUTE"}]),Vk=s.makeEnum("viam.app.v1.SourceType",[{no:0,name:"SOURCE_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"SOURCE_TYPE_ORG",localName:"ORG"},{no:2,name:"SOURCE_TYPE_FRAGMENT",localName:"FRAGMENT"}]),Wk=s.makeMessageType("viam.app.v1.InvoiceSummary",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"invoice_date",kind:"message",T:S},{no:3,name:"invoice_amount",kind:"scalar",T:1},{no:4,name:"status",kind:"scalar",T:9},{no:5,name:"due_date",kind:"message",T:S},{no:6,name:"paid_date",kind:"message",T:S}]),jk=s.makeMessageType("viam.app.v1.PaymentMethodCard",()=>[{no:1,name:"brand",kind:"scalar",T:9},{no:2,name:"last_four_digits",kind:"scalar",T:9}]),Hk=s.makeMessageType("viam.app.v1.GetCurrentMonthUsageRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Kk=s.makeMessageType("viam.app.v1.UsageCost",()=>[{no:1,name:"resource_type",kind:"enum",T:s.getEnumType($k)},{no:2,name:"cost",kind:"scalar",T:1}]),Xk=s.makeMessageType("viam.app.v1.ResourceUsageCostsBySource",()=>[{no:1,name:"source_type",kind:"enum",T:s.getEnumType(Vk)},{no:2,name:"resource_usage_costs",kind:"message",T:Qk},{no:3,name:"tier_name",kind:"scalar",T:9}]),Qk=s.makeMessageType("viam.app.v1.ResourceUsageCosts",()=>[{no:1,name:"usage_costs",kind:"message",T:Kk,repeated:!0},{no:2,name:"discount",kind:"scalar",T:1},{no:3,name:"total_with_discount",kind:"scalar",T:1},{no:4,name:"total_without_discount",kind:"scalar",T:1}]),Zk=s.makeMessageType("viam.app.v1.GetCurrentMonthUsageResponse",()=>[{no:1,name:"start_date",kind:"message",T:S},{no:2,name:"end_date",kind:"message",T:S},{no:14,name:"resource_usage_costs_by_source",kind:"message",T:Xk,repeated:!0},{no:15,name:"subtotal",kind:"scalar",T:1},{no:3,name:"cloud_storage_usage_cost",kind:"scalar",T:1},{no:4,name:"data_upload_usage_cost",kind:"scalar",T:1},{no:5,name:"data_egres_usage_cost",kind:"scalar",T:1},{no:6,name:"remote_control_usage_cost",kind:"scalar",T:1},{no:7,name:"standard_compute_usage_cost",kind:"scalar",T:1},{no:8,name:"discount_amount",kind:"scalar",T:1},{no:9,name:"total_usage_with_discount",kind:"scalar",T:1},{no:10,name:"total_usage_without_discount",kind:"scalar",T:1},{no:11,name:"per_machine_usage_cost",kind:"scalar",T:1},{no:12,name:"binary_data_cloud_storage_usage_cost",kind:"scalar",T:1},{no:13,name:"other_cloud_storage_usage_cost",kind:"scalar",T:1}]),ey=s.makeMessageType("viam.app.v1.GetOrgBillingInformationRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),ny=s.makeMessageType("viam.app.v1.GetOrgBillingInformationResponse",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Yk)},{no:2,name:"billing_email",kind:"scalar",T:9},{no:3,name:"method",kind:"message",T:jk,opt:!0},{no:4,name:"billing_tier",kind:"scalar",T:9,opt:!0}]),ay=s.makeMessageType("viam.app.v1.GetInvoicesSummaryRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),ty=s.makeMessageType("viam.app.v1.GetInvoicesSummaryResponse",()=>[{no:1,name:"outstanding_balance",kind:"scalar",T:1},{no:2,name:"invoices",kind:"message",T:Wk,repeated:!0}]),sy=s.makeMessageType("viam.app.v1.GetInvoicePdfRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"org_id",kind:"scalar",T:9}]),oy=s.makeMessageType("viam.app.v1.GetInvoicePdfResponse",()=>[{no:1,name:"chunk",kind:"scalar",T:12}]),iy=s.makeMessageType("viam.app.v1.SendPaymentRequiredEmailRequest",()=>[{no:1,name:"customer_org_id",kind:"scalar",T:9},{no:2,name:"billing_owner_org_id",kind:"scalar",T:9}]),ry=s.makeMessageType("viam.app.v1.SendPaymentRequiredEmailResponse",[]),my=s.makeMessageType("viam.app.v1.GetAvailableBillingTiersRequest",[]),cy=s.makeMessageType("viam.app.v1.GetAvailableBillingTiersResponse",()=>[{no:1,name:"tiers",kind:"scalar",T:9,repeated:!0}]),ly=s.makeMessageType("viam.app.v1.UpdateOrganizationBillingTierRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"billing_tier",kind:"scalar",T:9}]),dy=s.makeMessageType("viam.app.v1.UpdateOrganizationBillingTierResponse",[]),E1=Object.freeze(Object.defineProperty({__proto__:null,GetAvailableBillingTiersRequest:my,GetAvailableBillingTiersResponse:cy,GetCurrentMonthUsageRequest:Hk,GetCurrentMonthUsageResponse:Zk,GetInvoicePdfRequest:sy,GetInvoicePdfResponse:oy,GetInvoicesSummaryRequest:ay,GetInvoicesSummaryResponse:ty,GetOrgBillingInformationRequest:ey,GetOrgBillingInformationResponse:ny,InvoiceSummary:Wk,PaymentMethodCard:jk,PaymentMethodType:Yk,ResourceUsageCosts:Qk,ResourceUsageCostsBySource:Xk,SendPaymentRequiredEmailRequest:iy,SendPaymentRequiredEmailResponse:ry,SourceType:Vk,UpdateOrganizationBillingTierRequest:ly,UpdateOrganizationBillingTierResponse:dy,UsageCost:Kk,UsageCostType:$k},Symbol.toStringTag,{value:"Module"})),w1={typeName:"viam.app.v1.BillingService",methods:{getCurrentMonthUsage:{name:"GetCurrentMonthUsage",I:Hk,O:Zk,kind:m.Unary},getOrgBillingInformation:{name:"GetOrgBillingInformation",I:ey,O:ny,kind:m.Unary},getInvoicesSummary:{name:"GetInvoicesSummary",I:ay,O:ty,kind:m.Unary},getInvoicePdf:{name:"GetInvoicePdf",I:sy,O:oy,kind:m.ServerStreaming},sendPaymentRequiredEmail:{name:"SendPaymentRequiredEmail",I:iy,O:ry,kind:m.Unary},getAvailableBillingTiers:{name:"GetAvailableBillingTiers",I:my,O:cy,kind:m.Unary},updateOrganizationBillingTier:{name:"UpdateOrganizationBillingTier",I:ly,O:dy,kind:m.Unary}}};class O1{client;constructor(e){this.client=N(w1,e)}async getCurrentMonthUsage(e){const n=await this.client.getCurrentMonthUsage({orgId:e});return n.start=n.startDate?.toDate(),n.end=n.endDate?.toDate(),n}async getOrgBillingInformation(e){return this.client.getOrgBillingInformation({orgId:e})}async getInvoicesSummary(e){return this.client.getInvoicesSummary({orgId:e})}async getInvoicePdf(e,n){const t=this.client.getInvoicePdf({id:e,orgId:n}),o=[];for await(const i of t)o.push(i.chunk);return C1(o)}}const C1=a=>{const e=a.reduce((o,i)=>o+i.length,0),n=new Uint8Array(e);let t=0;for(const o of a)n.set(o,t),t+=o.length;return n};var py={},uy={};(function(a){Object.defineProperty(a,"__esModule",{value:!0}),function(e){var n=function(){function y(h){this._id=new Uint8Array(h)}return y.prototype.buffer=function(){return this._id},y}();e.UUID=n;var t=function(){function y(h){this._id=new Uint8Array(h)}return y.prototype.buffer=function(){return this._id},y}();e.ObjectId=t;var o=function(){function y(h){this._time=typeof h!="string"?new Uint8Array(h||_(Date.now())):_(+new Date(h))}return y.prototype.buffer=function(){return this._time},y.prototype.fromString=function(h){this._time=_(+new Date(h))},y.prototype.toNumber=function(){return M(this._time)},y.prototype.toDate=function(){return new Date(M(this._time))},y}();e.UTC=o;function i(y){var h=5;for(var g in y)h+=r(g,y[g]);return h}function r(y,h){var g=1;if(y&&(g+=Y(y)+1),h==null)return g;switch(h.constructor){case String:return g+4+Y(h)+1;case Number:return Math.floor(h)===h&&h<=2147483647&&h>=-2147483647?g+4:g+8;case Boolean:return g+1;case Array:case Object:return g+i(h);case Int8Array:case Uint8Array:return g+5+h.byteLength;case Date:case o:return g+8;case n:return g+5+16;case t:return g+12;default:return 0}}function c(y){var h=new Uint8Array(i(y));return d(y,h),h}e.serialize=c;function d(y,h,g){if(g===void 0&&(g=0),g+=k(h.length,h,g),y.constructor===Array)for(var v=0,E=y.length;v<E;v++)g=R(v.toString(),y[v],h,g);else for(var b in y)g=R(b,y[b],h,g);return h[g++]=0,g}function p(y,h,g){var v=O(y),E=v.length;return h.set(v,g),h[g+E++]=0,E}function k(y,h,g){return h[g++]=y&255,h[g++]=y>>>8&255,h[g++]=y>>>16&255,h[g++]=y>>>24&255,4}function R(y,h,g,v){if(h==null)return g[v++]=10,v+=p(y,g,v),v;switch(h.constructor){case String:g[v++]=2,v+=p(y,g,v);var E=p(h,g,v+4);return v+=k(E,g,v),v+E;case Number:if(Math.floor(h)===h)h<=2147483647&&h>=-2147483647?(g[v++]=16,v+=p(y,g,v),v+=k(h,g,v)):(g[v++]=18,v+=p(y,g,v),g.set(_(h),v),v+=8);else{g[v++]=1,v+=p(y,g,v);var b=new Float64Array([h]),ae=new Uint8Array(b.buffer);g.set(ae,v),v+=8}return v;case Boolean:return g[v++]=8,v+=p(y,g,v),g[v++]=h?1:0,v;case Array:case Object:g[v++]=h.constructor===Array?4:3,v+=p(y,g,v);var U=d(h,g,v);return k(U-v,g,v),U;case Int8Array:case Uint8Array:return g[v++]=5,v+=p(y,g,v),v+=k(h.byteLength,g,v),g[v++]=0,g.set(h,v),v+=h.byteLength,v;case Date:return g[v++]=9,v+=p(y,g,v),g.set(_(h.getTime()),v),v+=8,v;case o:return g[v++]=9,v+=p(y,g,v),g.set(h.buffer(),v),v+=8,v;case n:return g[v++]=5,v+=p(y,g,v),v+=k(16,g,v),g[v++]=4,g.set(h.buffer(),v),v+=16,v;case t:return g[v++]=7,v+=p(y,g,v),g.set(h.buffer(),v),v+=12,v;case RegExp:return g[v++]=11,v+=p(y,g,v),v+=p(h.source,g,v),h.global&&(g[v++]=115),h.ignoreCase&&(g[v++]=105),h.multiline&&(g[v++]=109),g[v++]=0,v;default:return v}}function I(y,h,g,v){if(h===void 0&&(h=!1),g===void 0&&(g=0),v===void 0&&(v=!1),!(y.length<5)){var E=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24;if(!(E<5||E>y.length)&&y[y.length-1]===0){for(var b=v?[]:{};;){var ae=y[g++];if(ae===0)break;for(var U=g;y[U]!==0&&U<y.length;U++);if(U>=y.length-1)return;var $=P(y.subarray(g,U));switch(v&&($=parseInt($)),g=++U,ae){case 1:b[$]=new Float64Array(y.slice(g,g+=8).buffer)[0];break;case 2:E=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24,b[$]=P(y.subarray(g,g+=E-1)),g++;break;case 3:E=y[g]|y[g+1]<<8|y[g+2]<<16|y[g+3]<<24,b[$]=I(y,h,g,!1),g+=E;break;case 4:E=y[g]|y[g+1]<<8|y[g+2]<<16|y[g+3]<<24,b[$]=I(y,h,g,!0),g+=E;break;case 5:if(E=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24,y[g++]===4){if(E!==16)return;b[$]=new n(y.subarray(g,g+=E))}else b[$]=y.slice(g,g+=E);break;case 6:b[$]=null;break;case 7:b[$]=new t(y.subarray(g,g+=12));break;case 8:b[$]=y[g++]===1;break;case 9:b[$]=h?new o(y.subarray(g,g+=8)):new Date(M(y.subarray(g,g+=8)));break;case 10:b[$]=null;break;case 11:for(U=g;U<y.length&&y[U++]!==0;);if(U>=y.length)return;var Zo=P(y.subarray(g,U));for(g=U;U<y.length&&y[U++]!==0;);if(U>=y.length)return;var ei=P(y.subarray(g,U));g=U,b[$]=new RegExp(Zo,ei);break;case 16:b[$]=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24;break;case 18:b[$]=M(y.subarray(g,g+=8));break;default:return}}return b}}}e.deserialize=I;function _(y){var h=new Uint8Array(8);if(Math.floor(y)===y){var g=4294967296,v=y%g|0,E=y/g|0;y<0&&(v=~(-y%g)|0,E=~(-y/g)|0,v=v+1&4294967295,v||E++);var b=0;h[b++]=v&255,h[b++]=v>>>8&255,h[b++]=v>>>16&255,h[b++]=v>>>24&255,h[b++]=E&255,h[b++]=E>>>8&255,h[b++]=E>>>16&255,h[b]=E>>>24&255}else{var ae=new Float64Array([y]),U=new Uint8Array(ae.buffer);h.set(U)}return h}function M(y,h){h===void 0&&(h=0);var g=4294967296,v=y[h++]|y[h++]<<8|y[h++]<<16|y[h++]<<24,E=y[h++]|y[h++]<<8|y[h++]<<16|y[h]<<24;return E*g+(v>=0?v:g+v)}function O(y){y=y.replace(/\r\n/g,`
9
+ `);for(var h=[],g=0,v=0,E=y.length;v<E;v++){var b=y.charCodeAt(v);b<128?h[g++]=b:b<2048?(h[g++]=b>>>6|192,h[g++]=b&63|128):(h[g++]=b>>>12|224,h[g++]=b>>>6&63|128,h[g++]=b&63|128)}return new Uint8Array(h)}function P(y){for(var h="",g=y.length,v=0,E,b,ae;v<g;)E=y[v],E<128?(h+=String.fromCharCode(E),v++):E>191&&E<224?(b=y[v+1],h+=String.fromCharCode((E&31)<<6|b&63),v+=2):(b=y[v+1],ae=y[v+2],h+=String.fromCharCode((E&15)<<12|(b&63)<<6|ae&63),v+=3);return h}function Y(y){return encodeURI(y).split(/%..|./).length-1}}(a.BSON||(a.BSON={}))})(uy),Object.defineProperty(py,"__esModule",{value:!0});var N1=uy,Oa=py.BSON=N1.BSON;const gy=s.makeEnum("viam.app.data.v1.Order",[{no:0,name:"ORDER_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"ORDER_DESCENDING",localName:"DESCENDING"},{no:2,name:"ORDER_ASCENDING",localName:"ASCENDING"}]),Ty=s.makeEnum("viam.app.data.v1.TagsFilterType",[{no:0,name:"TAGS_FILTER_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"TAGS_FILTER_TYPE_MATCH_BY_OR",localName:"MATCH_BY_OR"},{no:2,name:"TAGS_FILTER_TYPE_TAGGED",localName:"TAGGED"},{no:3,name:"TAGS_FILTER_TYPE_UNTAGGED",localName:"UNTAGGED"}]),Ca=s.makeEnum("viam.app.data.v1.TabularDataSourceType",[{no:0,name:"TABULAR_DATA_SOURCE_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"TABULAR_DATA_SOURCE_TYPE_STANDARD",localName:"STANDARD"},{no:2,name:"TABULAR_DATA_SOURCE_TYPE_HOT_STORAGE",localName:"HOT_STORAGE"},{no:3,name:"TABULAR_DATA_SOURCE_TYPE_PIPELINE_SINK",localName:"PIPELINE_SINK"}]),Do=s.makeMessageType("viam.app.data.v1.DataRequest",()=>[{no:1,name:"filter",kind:"message",T:$e},{no:2,name:"limit",kind:"scalar",T:4},{no:3,name:"last",kind:"scalar",T:9},{no:4,name:"sort_order",kind:"enum",T:s.getEnumType(gy)}]),$e=s.makeMessageType("viam.app.data.v1.Filter",()=>[{no:1,name:"component_name",kind:"scalar",T:9},{no:2,name:"component_type",kind:"scalar",T:9},{no:4,name:"method",kind:"scalar",T:9},{no:6,name:"robot_name",kind:"scalar",T:9},{no:7,name:"robot_id",kind:"scalar",T:9},{no:8,name:"part_name",kind:"scalar",T:9},{no:9,name:"part_id",kind:"scalar",T:9},{no:10,name:"location_ids",kind:"scalar",T:9,repeated:!0},{no:11,name:"organization_ids",kind:"scalar",T:9,repeated:!0},{no:12,name:"mime_type",kind:"scalar",T:9,repeated:!0},{no:13,name:"interval",kind:"message",T:Pn},{no:14,name:"tags_filter",kind:"message",T:Ao},{no:15,name:"bbox_labels",kind:"scalar",T:9,repeated:!0},{no:16,name:"dataset_id",kind:"scalar",T:9}]),Ao=s.makeMessageType("viam.app.data.v1.TagsFilter",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Ty)},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),Na=s.makeMessageType("viam.app.data.v1.CaptureMetadata",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"location_id",kind:"scalar",T:9},{no:3,name:"robot_name",kind:"scalar",T:9},{no:4,name:"robot_id",kind:"scalar",T:9},{no:5,name:"part_name",kind:"scalar",T:9},{no:6,name:"part_id",kind:"scalar",T:9},{no:7,name:"component_type",kind:"scalar",T:9},{no:9,name:"component_name",kind:"scalar",T:9},{no:10,name:"method_name",kind:"scalar",T:9},{no:11,name:"method_parameters",kind:"map",K:9,V:{kind:"message",T:j}},{no:12,name:"tags",kind:"scalar",T:9,repeated:!0},{no:13,name:"mime_type",kind:"scalar",T:9}]),Pn=s.makeMessageType("viam.app.data.v1.CaptureInterval",()=>[{no:1,name:"start",kind:"message",T:S},{no:2,name:"end",kind:"message",T:S}]),ky=s.makeMessageType("viam.app.data.v1.TabularDataByFilterRequest",()=>[{no:1,name:"data_request",kind:"message",T:Do},{no:2,name:"count_only",kind:"scalar",T:8},{no:3,name:"include_internal_data",kind:"scalar",T:8}]),yy=s.makeMessageType("viam.app.data.v1.TabularDataByFilterResponse",()=>[{no:1,name:"metadata",kind:"message",T:Na,repeated:!0},{no:2,name:"data",kind:"message",T:vy,repeated:!0},{no:3,name:"count",kind:"scalar",T:4},{no:4,name:"last",kind:"scalar",T:9},{no:5,name:"total_size_bytes",kind:"scalar",T:4}]),vy=s.makeMessageType("viam.app.data.v1.TabularData",()=>[{no:1,name:"data",kind:"message",T:l},{no:2,name:"metadata_index",kind:"scalar",T:13},{no:3,name:"time_requested",kind:"message",T:S},{no:4,name:"time_received",kind:"message",T:S}]),hy=s.makeMessageType("viam.app.data.v1.TabularDataBySQLRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"sql_query",kind:"scalar",T:9}]),fy=s.makeMessageType("viam.app.data.v1.TabularDataBySQLResponse",()=>[{no:2,name:"raw_data",kind:"scalar",T:12,repeated:!0}]),qo=s.makeMessageType("viam.app.data.v1.TabularDataSource",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Ca)},{no:2,name:"pipeline_id",kind:"scalar",T:9,opt:!0}]),Ry=s.makeMessageType("viam.app.data.v1.TabularDataByMQLRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:3,name:"mql_binary",kind:"scalar",T:12,repeated:!0},{no:4,name:"use_recent_data",kind:"scalar",T:8,opt:!0},{no:6,name:"data_source",kind:"message",T:qo,opt:!0}]),_y=s.makeMessageType("viam.app.data.v1.TabularDataByMQLResponse",()=>[{no:2,name:"raw_data",kind:"scalar",T:12,repeated:!0}]),Sy=s.makeMessageType("viam.app.data.v1.ExportTabularDataRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"resource_name",kind:"scalar",T:9},{no:3,name:"resource_subtype",kind:"scalar",T:9},{no:4,name:"method_name",kind:"scalar",T:9},{no:5,name:"interval",kind:"message",T:Pn}]),Iy=s.makeMessageType("viam.app.data.v1.ExportTabularDataResponse",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"resource_name",kind:"scalar",T:9},{no:3,name:"resource_subtype",kind:"scalar",T:9},{no:4,name:"method_name",kind:"scalar",T:9},{no:5,name:"time_captured",kind:"message",T:S},{no:6,name:"organization_id",kind:"scalar",T:9},{no:7,name:"location_id",kind:"scalar",T:9},{no:8,name:"robot_name",kind:"scalar",T:9},{no:9,name:"robot_id",kind:"scalar",T:9},{no:10,name:"part_name",kind:"scalar",T:9},{no:11,name:"method_parameters",kind:"message",T:l},{no:12,name:"tags",kind:"scalar",T:9,repeated:!0},{no:13,name:"payload",kind:"message",T:l}]),My=s.makeMessageType("viam.app.data.v1.GetLatestTabularDataRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"resource_name",kind:"scalar",T:9},{no:3,name:"method_name",kind:"scalar",T:9},{no:4,name:"resource_subtype",kind:"scalar",T:9}]),by=s.makeMessageType("viam.app.data.v1.GetLatestTabularDataResponse",()=>[{no:1,name:"time_captured",kind:"message",T:S},{no:2,name:"time_synced",kind:"message",T:S},{no:3,name:"payload",kind:"message",T:l}]),Uo=s.makeMessageType("viam.app.data.v1.BinaryData",()=>[{no:1,name:"binary",kind:"scalar",T:12},{no:2,name:"metadata",kind:"message",T:Dy}]),Ey=s.makeMessageType("viam.app.data.v1.BinaryDataByFilterRequest",()=>[{no:1,name:"data_request",kind:"message",T:Do},{no:2,name:"include_binary",kind:"scalar",T:8},{no:3,name:"count_only",kind:"scalar",T:8},{no:4,name:"include_internal_data",kind:"scalar",T:8}]),wy=s.makeMessageType("viam.app.data.v1.BinaryDataByFilterResponse",()=>[{no:1,name:"data",kind:"message",T:Uo,repeated:!0},{no:2,name:"count",kind:"scalar",T:4},{no:3,name:"last",kind:"scalar",T:9},{no:4,name:"total_size_bytes",kind:"scalar",T:4}]),de=s.makeMessageType("viam.app.data.v1.BinaryID",()=>[{no:1,name:"file_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"location_id",kind:"scalar",T:9}]),Oy=s.makeMessageType("viam.app.data.v1.BinaryDataByIDsRequest",()=>[{no:2,name:"include_binary",kind:"scalar",T:8},{no:3,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0}]),Cy=s.makeMessageType("viam.app.data.v1.BinaryDataByIDsResponse",()=>[{no:1,name:"data",kind:"message",T:Uo,repeated:!0},{no:2,name:"count",kind:"scalar",T:4}]),Ny=s.makeMessageType("viam.app.data.v1.BoundingBox",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"label",kind:"scalar",T:9},{no:3,name:"x_min_normalized",kind:"scalar",T:1},{no:4,name:"y_min_normalized",kind:"scalar",T:1},{no:5,name:"x_max_normalized",kind:"scalar",T:1},{no:6,name:"y_max_normalized",kind:"scalar",T:1},{no:7,name:"confidence",kind:"scalar",T:1,opt:!0}]),Py=s.makeMessageType("viam.app.data.v1.Classification",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"confidence",kind:"scalar",T:1,opt:!0}]),Lo=s.makeMessageType("viam.app.data.v1.Annotations",()=>[{no:1,name:"bboxes",kind:"message",T:Ny,repeated:!0},{no:2,name:"classifications",kind:"message",T:Py,repeated:!0}]),Dy=s.makeMessageType("viam.app.data.v1.BinaryMetadata",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"capture_metadata",kind:"message",T:Na},{no:3,name:"time_requested",kind:"message",T:S},{no:4,name:"time_received",kind:"message",T:S},{no:5,name:"file_name",kind:"scalar",T:9},{no:6,name:"file_ext",kind:"scalar",T:9},{no:7,name:"uri",kind:"scalar",T:9},{no:8,name:"annotations",kind:"message",T:Lo},{no:9,name:"dataset_ids",kind:"scalar",T:9,repeated:!0},{no:10,name:"binary_data_id",kind:"scalar",T:9}]),Ay=s.makeMessageType("viam.app.data.v1.DeleteTabularDataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"delete_older_than_days",kind:"scalar",T:13}]),qy=s.makeMessageType("viam.app.data.v1.DeleteTabularDataResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Uy=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e},{no:2,name:"include_internal_data",kind:"scalar",T:8}]),Ly=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByFilterResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Gy=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByIDsRequest",()=>[{no:2,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0}]),By=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByIDsResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Fy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByIDsRequest",()=>[{no:3,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),xy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByIDsResponse",[]),Jy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),zy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByFilterResponse",[]),Yy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByIDsRequest",()=>[{no:3,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),$y=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByIDsResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Vy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),Wy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByFilterResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),jy=s.makeMessageType("viam.app.data.v1.TagsByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e}]),Hy=s.makeMessageType("viam.app.data.v1.TagsByFilterResponse",()=>[{no:1,name:"tags",kind:"scalar",T:9,repeated:!0}]),Ky=s.makeMessageType("viam.app.data.v1.AddBoundingBoxToImageByIDRequest",()=>[{no:7,name:"binary_id",kind:"message",T:de},{no:8,name:"binary_data_id",kind:"scalar",T:9},{no:2,name:"label",kind:"scalar",T:9},{no:3,name:"x_min_normalized",kind:"scalar",T:1},{no:4,name:"y_min_normalized",kind:"scalar",T:1},{no:5,name:"x_max_normalized",kind:"scalar",T:1},{no:6,name:"y_max_normalized",kind:"scalar",T:1}]),Xy=s.makeMessageType("viam.app.data.v1.AddBoundingBoxToImageByIDResponse",()=>[{no:1,name:"bbox_id",kind:"scalar",T:9}]),Qy=s.makeMessageType("viam.app.data.v1.RemoveBoundingBoxFromImageByIDRequest",()=>[{no:3,name:"binary_id",kind:"message",T:de},{no:4,name:"binary_data_id",kind:"scalar",T:9},{no:2,name:"bbox_id",kind:"scalar",T:9}]),Zy=s.makeMessageType("viam.app.data.v1.RemoveBoundingBoxFromImageByIDResponse",[]),ev=s.makeMessageType("viam.app.data.v1.UpdateBoundingBoxRequest",()=>[{no:1,name:"binary_id",kind:"message",T:de},{no:8,name:"binary_data_id",kind:"scalar",T:9},{no:2,name:"bbox_id",kind:"scalar",T:9},{no:3,name:"label",kind:"scalar",T:9,opt:!0},{no:4,name:"x_min_normalized",kind:"scalar",T:1,opt:!0},{no:5,name:"y_min_normalized",kind:"scalar",T:1,opt:!0},{no:6,name:"x_max_normalized",kind:"scalar",T:1,opt:!0},{no:7,name:"y_max_normalized",kind:"scalar",T:1,opt:!0}]),nv=s.makeMessageType("viam.app.data.v1.UpdateBoundingBoxResponse",[]),av=s.makeMessageType("viam.app.data.v1.BoundingBoxLabelsByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e}]),tv=s.makeMessageType("viam.app.data.v1.BoundingBoxLabelsByFilterResponse",()=>[{no:1,name:"labels",kind:"scalar",T:9,repeated:!0}]),sv=s.makeMessageType("viam.app.data.v1.ConfigureDatabaseUserRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"password",kind:"scalar",T:9}]),ov=s.makeMessageType("viam.app.data.v1.ConfigureDatabaseUserResponse",[]),iv=s.makeMessageType("viam.app.data.v1.GetDatabaseConnectionRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),rv=s.makeMessageType("viam.app.data.v1.GetDatabaseConnectionResponse",()=>[{no:1,name:"hostname",kind:"scalar",T:9},{no:2,name:"mongodb_uri",kind:"scalar",T:9},{no:3,name:"has_database_user",kind:"scalar",T:8}]),mv=s.makeMessageType("viam.app.data.v1.AddBinaryDataToDatasetByIDsRequest",()=>[{no:1,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"dataset_id",kind:"scalar",T:9}]),cv=s.makeMessageType("viam.app.data.v1.AddBinaryDataToDatasetByIDsResponse",[]),lv=s.makeMessageType("viam.app.data.v1.RemoveBinaryDataFromDatasetByIDsRequest",()=>[{no:1,name:"binary_ids",kind:"message",T:de,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"dataset_id",kind:"scalar",T:9}]),dv=s.makeMessageType("viam.app.data.v1.RemoveBinaryDataFromDatasetByIDsResponse",[]),P1=Object.freeze(Object.defineProperty({__proto__:null,AddBinaryDataToDatasetByIDsRequest:mv,AddBinaryDataToDatasetByIDsResponse:cv,AddBoundingBoxToImageByIDRequest:Ky,AddBoundingBoxToImageByIDResponse:Xy,AddTagsToBinaryDataByFilterRequest:Jy,AddTagsToBinaryDataByFilterResponse:zy,AddTagsToBinaryDataByIDsRequest:Fy,AddTagsToBinaryDataByIDsResponse:xy,Annotations:Lo,BinaryData:Uo,BinaryDataByFilterRequest:Ey,BinaryDataByFilterResponse:wy,BinaryDataByIDsRequest:Oy,BinaryDataByIDsResponse:Cy,BinaryID:de,BinaryMetadata:Dy,BoundingBox:Ny,BoundingBoxLabelsByFilterRequest:av,BoundingBoxLabelsByFilterResponse:tv,CaptureInterval:Pn,CaptureMetadata:Na,Classification:Py,ConfigureDatabaseUserRequest:sv,ConfigureDatabaseUserResponse:ov,DataRequest:Do,DeleteBinaryDataByFilterRequest:Uy,DeleteBinaryDataByFilterResponse:Ly,DeleteBinaryDataByIDsRequest:Gy,DeleteBinaryDataByIDsResponse:By,DeleteTabularDataRequest:Ay,DeleteTabularDataResponse:qy,ExportTabularDataRequest:Sy,ExportTabularDataResponse:Iy,Filter:$e,GetDatabaseConnectionRequest:iv,GetDatabaseConnectionResponse:rv,GetLatestTabularDataRequest:My,GetLatestTabularDataResponse:by,Order:gy,RemoveBinaryDataFromDatasetByIDsRequest:lv,RemoveBinaryDataFromDatasetByIDsResponse:dv,RemoveBoundingBoxFromImageByIDRequest:Qy,RemoveBoundingBoxFromImageByIDResponse:Zy,RemoveTagsFromBinaryDataByFilterRequest:Vy,RemoveTagsFromBinaryDataByFilterResponse:Wy,RemoveTagsFromBinaryDataByIDsRequest:Yy,RemoveTagsFromBinaryDataByIDsResponse:$y,TabularData:vy,TabularDataByFilterRequest:ky,TabularDataByFilterResponse:yy,TabularDataByMQLRequest:Ry,TabularDataByMQLResponse:_y,TabularDataBySQLRequest:hy,TabularDataBySQLResponse:fy,TabularDataSource:qo,TabularDataSourceType:Ca,TagsByFilterRequest:jy,TagsByFilterResponse:Hy,TagsFilter:Ao,TagsFilterType:Ty,UpdateBoundingBoxRequest:ev,UpdateBoundingBoxResponse:nv},Symbol.toStringTag,{value:"Module"})),D1={typeName:"viam.app.data.v1.DataService",methods:{tabularDataByFilter:{name:"TabularDataByFilter",I:ky,O:yy,kind:m.Unary},tabularDataBySQL:{name:"TabularDataBySQL",I:hy,O:fy,kind:m.Unary},tabularDataByMQL:{name:"TabularDataByMQL",I:Ry,O:_y,kind:m.Unary},exportTabularData:{name:"ExportTabularData",I:Sy,O:Iy,kind:m.ServerStreaming},getLatestTabularData:{name:"GetLatestTabularData",I:My,O:by,kind:m.Unary},binaryDataByFilter:{name:"BinaryDataByFilter",I:Ey,O:wy,kind:m.Unary},binaryDataByIDs:{name:"BinaryDataByIDs",I:Oy,O:Cy,kind:m.Unary},deleteTabularData:{name:"DeleteTabularData",I:Ay,O:qy,kind:m.Unary},deleteBinaryDataByFilter:{name:"DeleteBinaryDataByFilter",I:Uy,O:Ly,kind:m.Unary},deleteBinaryDataByIDs:{name:"DeleteBinaryDataByIDs",I:Gy,O:By,kind:m.Unary},addTagsToBinaryDataByIDs:{name:"AddTagsToBinaryDataByIDs",I:Fy,O:xy,kind:m.Unary},addTagsToBinaryDataByFilter:{name:"AddTagsToBinaryDataByFilter",I:Jy,O:zy,kind:m.Unary},removeTagsFromBinaryDataByIDs:{name:"RemoveTagsFromBinaryDataByIDs",I:Yy,O:$y,kind:m.Unary},removeTagsFromBinaryDataByFilter:{name:"RemoveTagsFromBinaryDataByFilter",I:Vy,O:Wy,kind:m.Unary},tagsByFilter:{name:"TagsByFilter",I:jy,O:Hy,kind:m.Unary},addBoundingBoxToImageByID:{name:"AddBoundingBoxToImageByID",I:Ky,O:Xy,kind:m.Unary},removeBoundingBoxFromImageByID:{name:"RemoveBoundingBoxFromImageByID",I:Qy,O:Zy,kind:m.Unary},boundingBoxLabelsByFilter:{name:"BoundingBoxLabelsByFilter",I:av,O:tv,kind:m.Unary},updateBoundingBox:{name:"UpdateBoundingBox",I:ev,O:nv,kind:m.Unary},getDatabaseConnection:{name:"GetDatabaseConnection",I:iv,O:rv,kind:m.Unary},configureDatabaseUser:{name:"ConfigureDatabaseUser",I:sv,O:ov,kind:m.Unary},addBinaryDataToDatasetByIDs:{name:"AddBinaryDataToDatasetByIDs",I:mv,O:cv,kind:m.Unary},removeBinaryDataFromDatasetByIDs:{name:"RemoveBinaryDataFromDatasetByIDs",I:lv,O:dv,kind:m.Unary}}},pv=s.makeMessageType("viam.app.dataset.v1.Dataset",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"organization_id",kind:"scalar",T:9},{no:4,name:"time_created",kind:"message",T:S}]),A1=s.makeMessageType("viam.app.dataset.v1.CreateDatasetRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),q1=s.makeMessageType("viam.app.dataset.v1.CreateDatasetResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),U1=s.makeMessageType("viam.app.dataset.v1.DeleteDatasetRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),L1=s.makeMessageType("viam.app.dataset.v1.DeleteDatasetResponse",[]),G1=s.makeMessageType("viam.app.dataset.v1.RenameDatasetRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),B1=s.makeMessageType("viam.app.dataset.v1.RenameDatasetResponse",[]),F1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByOrganizationIDRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),x1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByOrganizationIDResponse",()=>[{no:1,name:"datasets",kind:"message",T:pv,repeated:!0}]),J1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByIDsRequest",()=>[{no:1,name:"ids",kind:"scalar",T:9,repeated:!0}]),z1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByIDsResponse",()=>[{no:1,name:"datasets",kind:"message",T:pv,repeated:!0}]),Y1={typeName:"viam.app.dataset.v1.DatasetService",methods:{createDataset:{name:"CreateDataset",I:A1,O:q1,kind:m.Unary},deleteDataset:{name:"DeleteDataset",I:U1,O:L1,kind:m.Unary},renameDataset:{name:"RenameDataset",I:G1,O:B1,kind:m.Unary},listDatasetsByOrganizationID:{name:"ListDatasetsByOrganizationID",I:F1,O:x1,kind:m.Unary},listDatasetsByIDs:{name:"ListDatasetsByIDs",I:J1,O:z1,kind:m.Unary}}},$1=s.makeEnum("viam.app.datasync.v1.MimeType",[{no:0,name:"MIME_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"MIME_TYPE_IMAGE_JPEG",localName:"IMAGE_JPEG"},{no:2,name:"MIME_TYPE_IMAGE_PNG",localName:"IMAGE_PNG"},{no:3,name:"MIME_TYPE_APPLICATION_PCD",localName:"APPLICATION_PCD"}]),Go=s.makeEnum("viam.app.datasync.v1.DataType",[{no:0,name:"DATA_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"DATA_TYPE_BINARY_SENSOR",localName:"BINARY_SENSOR"},{no:2,name:"DATA_TYPE_TABULAR_SENSOR",localName:"TABULAR_SENSOR"},{no:3,name:"DATA_TYPE_FILE",localName:"FILE"}]),Bo=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:Dn},{no:2,name:"sensor_contents",kind:"message",T:xo,repeated:!0}]),V1=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadResponse",()=>[{no:1,name:"file_id",kind:"scalar",T:9},{no:2,name:"binary_data_id",kind:"scalar",T:9}]),W1=s.makeMessageType("viam.app.datasync.v1.FileUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:Dn,oneof:"upload_packet"},{no:2,name:"file_contents",kind:"message",T:X1,oneof:"upload_packet"}]),j1=s.makeMessageType("viam.app.datasync.v1.FileUploadResponse",()=>[{no:1,name:"file_id",kind:"scalar",T:9},{no:2,name:"binary_data_id",kind:"scalar",T:9}]),H1=s.makeMessageType("viam.app.datasync.v1.StreamingDataCaptureUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:Q1,oneof:"upload_packet"},{no:2,name:"data",kind:"scalar",T:12,oneof:"upload_packet"}]),K1=s.makeMessageType("viam.app.datasync.v1.StreamingDataCaptureUploadResponse",()=>[{no:1,name:"file_id",kind:"scalar",T:9},{no:2,name:"binary_data_id",kind:"scalar",T:9}]),Fo=s.makeMessageType("viam.app.datasync.v1.SensorMetadata",()=>[{no:1,name:"time_requested",kind:"message",T:S},{no:2,name:"time_received",kind:"message",T:S},{no:3,name:"mime_type",kind:"enum",T:s.getEnumType($1)},{no:4,name:"annotations",kind:"message",T:Lo}]),xo=s.makeMessageType("viam.app.datasync.v1.SensorData",()=>[{no:1,name:"metadata",kind:"message",T:Fo},{no:2,name:"struct",kind:"message",T:l,oneof:"data"},{no:3,name:"binary",kind:"scalar",T:12,oneof:"data"}]),X1=s.makeMessageType("viam.app.datasync.v1.FileData",()=>[{no:1,name:"data",kind:"scalar",T:12}]),Dn=s.makeMessageType("viam.app.datasync.v1.UploadMetadata",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"component_type",kind:"scalar",T:9},{no:3,name:"component_name",kind:"scalar",T:9},{no:5,name:"method_name",kind:"scalar",T:9},{no:6,name:"type",kind:"enum",T:s.getEnumType(Go)},{no:7,name:"file_name",kind:"scalar",T:9},{no:8,name:"method_parameters",kind:"map",K:9,V:{kind:"message",T:j}},{no:9,name:"file_extension",kind:"scalar",T:9},{no:10,name:"tags",kind:"scalar",T:9,repeated:!0}]),Q1=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadMetadata",()=>[{no:1,name:"upload_metadata",kind:"message",T:Dn},{no:2,name:"sensor_metadata",kind:"message",T:Fo}]),Z1={typeName:"viam.app.datasync.v1.DataSyncService",methods:{dataCaptureUpload:{name:"DataCaptureUpload",I:Bo,O:V1,kind:m.Unary},fileUpload:{name:"FileUpload",I:W1,O:j1,kind:m.ClientStreaming},streamingDataCaptureUpload:{name:"StreamingDataCaptureUpload",I:H1,O:K1,kind:m.ClientStreaming}}},e_=s.makeEnum("viam.app.datapipelines.v1.DataPipelineRunStatus",[{no:0,name:"DATA_PIPELINE_RUN_STATUS_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"DATA_PIPELINE_RUN_STATUS_SCHEDULED",localName:"SCHEDULED"},{no:2,name:"DATA_PIPELINE_RUN_STATUS_STARTED",localName:"STARTED"},{no:3,name:"DATA_PIPELINE_RUN_STATUS_COMPLETED",localName:"COMPLETED"},{no:4,name:"DATA_PIPELINE_RUN_STATUS_FAILED",localName:"FAILED"}]),uv=s.makeMessageType("viam.app.datapipelines.v1.DataPipeline",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"mql_binary",kind:"scalar",T:12,repeated:!0},{no:5,name:"schedule",kind:"scalar",T:9},{no:6,name:"enabled",kind:"scalar",T:8},{no:7,name:"created_on",kind:"message",T:S},{no:8,name:"updated_at",kind:"message",T:S}]),n_=s.makeMessageType("viam.app.datapipelines.v1.GetDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),a_=s.makeMessageType("viam.app.datapipelines.v1.GetDataPipelineResponse",()=>[{no:1,name:"data_pipeline",kind:"message",T:uv}]),t_=s.makeMessageType("viam.app.datapipelines.v1.ListDataPipelinesRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),s_=s.makeMessageType("viam.app.datapipelines.v1.ListDataPipelinesResponse",()=>[{no:1,name:"data_pipelines",kind:"message",T:uv,repeated:!0}]),o_=s.makeMessageType("viam.app.datapipelines.v1.CreateDataPipelineRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"mql_binary",kind:"scalar",T:12,repeated:!0},{no:4,name:"schedule",kind:"scalar",T:9},{no:5,name:"enable_backfill",kind:"scalar",T:8,opt:!0}]),i_=s.makeMessageType("viam.app.datapipelines.v1.CreateDataPipelineResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),r_=s.makeMessageType("viam.app.datapipelines.v1.UpdateDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"mql_binary",kind:"scalar",T:12,repeated:!0},{no:4,name:"schedule",kind:"scalar",T:9}]),m_=s.makeMessageType("viam.app.datapipelines.v1.UpdateDataPipelineResponse",[]),c_=s.makeMessageType("viam.app.datapipelines.v1.DeleteDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),l_=s.makeMessageType("viam.app.datapipelines.v1.DeleteDataPipelineResponse",[]),d_=s.makeMessageType("viam.app.datapipelines.v1.EnableDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),p_=s.makeMessageType("viam.app.datapipelines.v1.EnableDataPipelineResponse",[]),u_=s.makeMessageType("viam.app.datapipelines.v1.DisableDataPipelineRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),g_=s.makeMessageType("viam.app.datapipelines.v1.DisableDataPipelineResponse",[]),T_=s.makeMessageType("viam.app.datapipelines.v1.ListDataPipelineRunsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"page_size",kind:"scalar",T:13},{no:3,name:"page_token",kind:"scalar",T:9}]),k_=s.makeMessageType("viam.app.datapipelines.v1.ListDataPipelineRunsResponse",()=>[{no:1,name:"pipeline_id",kind:"scalar",T:9},{no:2,name:"runs",kind:"message",T:y_,repeated:!0},{no:3,name:"next_page_token",kind:"scalar",T:9}]),y_=s.makeMessageType("viam.app.datapipelines.v1.DataPipelineRun",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"start_time",kind:"message",T:S},{no:3,name:"end_time",kind:"message",T:S},{no:4,name:"data_start_time",kind:"message",T:S},{no:5,name:"data_end_time",kind:"message",T:S},{no:6,name:"status",kind:"enum",T:s.getEnumType(e_)}]),v_={typeName:"viam.app.datapipelines.v1.DataPipelinesService",methods:{getDataPipeline:{name:"GetDataPipeline",I:n_,O:a_,kind:m.Unary},listDataPipelines:{name:"ListDataPipelines",I:t_,O:s_,kind:m.Unary},createDataPipeline:{name:"CreateDataPipeline",I:o_,O:i_,kind:m.Unary},updateDataPipeline:{name:"UpdateDataPipeline",I:r_,O:m_,kind:m.Unary},deleteDataPipeline:{name:"DeleteDataPipeline",I:c_,O:l_,kind:m.Unary},enableDataPipeline:{name:"EnableDataPipeline",I:d_,O:p_,kind:m.Unary},disableDataPipeline:{name:"DisableDataPipeline",I:u_,O:g_,kind:m.Unary},listDataPipelineRuns:{name:"ListDataPipelineRuns",I:T_,O:k_,kind:m.Unary}}},Ve=()=>{console.warn("The BinaryID type is deprecated and will be removed in a future release. Please migrate to the BinaryDataId field instead.")};class h_{dataClient;datasetClient;dataSyncClient;dataPipelinesClient;constructor(e){this.dataClient=N(D1,e),this.datasetClient=N(Y1,e),this.dataSyncClient=N(Z1,e),this.dataPipelinesClient=N(v_,e)}async exportTabularData(e,n,t,o,i,r){const c=new Pn;i&&(c.start=S.fromDate(i)),r&&(c.end=S.fromDate(r));const d={partId:e,resourceName:n,resourceSubtype:t,methodName:o,interval:c},p=this.dataClient.exportTabularData(d),k=[];for await(const R of p)k.push({partId:R.partId,resourceName:R.resourceName,resourceSubtype:R.resourceSubtype,methodName:R.methodName,timeCaptured:R.timeCaptured.toDate(),organizationId:R.organizationId,locationId:R.locationId,robotName:R.robotName,robotId:R.robotId,partName:R.partName,methodParameters:R.methodParameters.toJson(),tags:R.tags,payload:R.payload.toJson()});return k}async tabularDataBySQL(e,n){return(await this.dataClient.tabularDataBySQL({organizationId:e,sqlQuery:n})).rawData.map(o=>Oa.deserialize(o))}async tabularDataByMQL(e,n,t,o){const i=n[0]instanceof Uint8Array?n:n.map(d=>Oa.serialize(d));let r=o;return t&&(!r||r.type===Ca.UNSPECIFIED)&&(r=new qo({type:Ca.HOT_STORAGE})),(await this.dataClient.tabularDataByMQL({organizationId:e,mqlBinary:i,dataSource:r})).rawData.map(d=>Oa.deserialize(d))}async tabularDataByFilter(e,n,t,o="",i=!1,r=!1){const d={dataRequest:{filter:e,limit:n===void 0?void 0:BigInt(n),sortOrder:t,last:o},countOnly:i,includeInternalData:r},p=await this.dataClient.tabularDataByFilter(d),k=p.metadata.length,R=[];return R.push(...p.data.map(I=>{const _=I.metadataIndex,M=k!==0&&_>=k?new Na:p.metadata[_];return{data:I.data?.toJson(),metadata:M,timeRequested:I.timeRequested?.toDate(),timeReceived:I.timeRequested?.toDate()}})),{data:R,count:p.count,last:p.last}}async binaryDataByFilter(e,n,t,o="",i=!0,r=!1,c=!1){const p={dataRequest:{filter:e,limit:n===void 0?void 0:BigInt(n),sortOrder:t,last:o},includeBinary:i,countOnly:r,includeInternalData:c},k=await this.dataClient.binaryDataByFilter(p);return{data:k.data,count:k.count,last:k.last}}async binaryDataByIds(e){return Array.isArray(e)&&typeof e[0]=="string"?(await this.dataClient.binaryDataByIDs({binaryDataIds:e,includeBinary:!0})).data:(Ve(),(await this.dataClient.binaryDataByIDs({binaryIds:e,includeBinary:!0})).data)}async deleteTabularData(e,n){return(await this.dataClient.deleteTabularData({organizationId:e,deleteOlderThanDays:n})).deletedCount}async deleteBinaryDataByFilter(e,n=!0){return(await this.dataClient.deleteBinaryDataByFilter({filter:e,includeInternalData:n})).deletedCount}async deleteBinaryDataByIds(e){return Array.isArray(e)&&typeof e[0]=="string"?(await this.dataClient.deleteBinaryDataByIDs({binaryDataIds:e})).deletedCount:(Ve(),(await this.dataClient.deleteBinaryDataByIDs({binaryIds:e})).deletedCount)}async addTagsToBinaryDataByIds(e,n){if(Array.isArray(n)&&typeof n[0]=="string"){await this.dataClient.addTagsToBinaryDataByIDs({tags:e,binaryDataIds:n});return}Ve(),await this.dataClient.addTagsToBinaryDataByIDs({tags:e,binaryIds:n})}async addTagsToBinaryDataByFilter(e,n){await this.dataClient.addTagsToBinaryDataByFilter({tags:e,filter:n})}async removeTagsFromBinaryDataByIds(e,n){return Array.isArray(n)&&typeof n[0]=="string"?(await this.dataClient.removeTagsFromBinaryDataByIDs({tags:e,binaryDataIds:n})).deletedCount:(Ve(),(await this.dataClient.removeTagsFromBinaryDataByIDs({tags:e,binaryIds:n})).deletedCount)}async removeTagsFromBinaryDataByFilter(e,n){return(await this.dataClient.removeTagsFromBinaryDataByFilter({tags:e,filter:n})).deletedCount}async tagsByFilter(e){return(await this.dataClient.tagsByFilter({filter:e})).tags}async addBoundingBoxToImageById(e,n,t,o,i,r){return typeof e=="string"?(await this.dataClient.addBoundingBoxToImageByID({binaryDataId:e,label:n,xMinNormalized:t,yMinNormalized:o,xMaxNormalized:i,yMaxNormalized:r})).bboxId:(Ve(),(await this.dataClient.addBoundingBoxToImageByID({binaryId:e,label:n,xMinNormalized:t,yMinNormalized:o,xMaxNormalized:i,yMaxNormalized:r})).bboxId)}async removeBoundingBoxFromImageById(e,n){if(typeof e=="string"){await this.dataClient.removeBoundingBoxFromImageByID({binaryDataId:e,bboxId:n});return}Ve(),await this.dataClient.removeBoundingBoxFromImageByID({binaryId:e,bboxId:n})}async boundingBoxLabelsByFilter(e){return(await this.dataClient.boundingBoxLabelsByFilter({filter:e})).labels}async configureDatabaseUser(e,n){await this.dataClient.configureDatabaseUser({organizationId:e,password:n})}async getDatabaseConnection(e){return(await this.dataClient.getDatabaseConnection({organizationId:e})).hostname}async addBinaryDataToDatasetByIds(e,n){if(Array.isArray(e)&&typeof e[0]=="string"){await this.dataClient.addBinaryDataToDatasetByIDs({binaryDataIds:e,datasetId:n});return}Ve(),await this.dataClient.addBinaryDataToDatasetByIDs({binaryIds:e,datasetId:n})}async removeBinaryDataFromDatasetByIds(e,n){if(Array.isArray(e)&&typeof e[0]=="string"){await this.dataClient.removeBinaryDataFromDatasetByIDs({binaryDataIds:e,datasetId:n});return}Ve(),await this.dataClient.removeBinaryDataFromDatasetByIDs({binaryIds:e,datasetId:n})}async createDataset(e,n){return(await this.datasetClient.createDataset({name:e,organizationId:n})).id}async deleteDataset(e){await this.datasetClient.deleteDataset({id:e})}async renameDataset(e,n){await this.datasetClient.renameDataset({id:e,name:n})}async listDatasetsByOrganizationID(e){return(await this.datasetClient.listDatasetsByOrganizationID({organizationId:e})).datasets.map(t=>({created:t.timeCreated?.toDate(),...t}))}async listDatasetsByIds(e){return(await this.datasetClient.listDatasetsByIDs({ids:e})).datasets.map(t=>({created:t.timeCreated?.toDate(),...t}))}async tabularDataCaptureUpload(e,n,t,o,i,r,c){if(r.length!==e.length)throw new Error("dataRequestTimes and data lengths must be equal.");const d=new Dn({partId:n,componentType:t,componentName:o,methodName:i,type:Go.TABULAR_SENSOR,tags:c}),p=[];for(const[I,_]of e.entries()){const M=new Fo,O=r[I];O&&(M.timeRequested=S.fromDate(O[0]),M.timeReceived=S.fromDate(O[1])),p.push(new xo({metadata:M,data:{case:"struct",value:l.fromJson(_)}}))}const k=new Bo({metadata:d,sensorContents:p});return(await this.dataSyncClient.dataCaptureUpload(k)).fileId}async binaryDataCaptureUpload(e,n,t,o,i,r,c,d){const p=new Dn({partId:n,componentType:t,componentName:o,methodName:i,type:Go.BINARY_SENSOR,tags:d,fileExtension:r}),k=new xo({metadata:{timeRequested:S.fromDate(c[0]),timeReceived:S.fromDate(c[1])},data:{case:"binary",value:e}}),R=new Bo({metadata:p,sensorContents:[k]});return(await this.dataSyncClient.dataCaptureUpload(R)).binaryDataId}createFilter(e){const n=new $e(e);if(e.startTime??e.endTime){const o=new Pn;e.startTime&&(o.start=S.fromDate(e.startTime)),e.endTime&&(o.end=S.fromDate(e.endTime)),n.interval=o}const t=new Ao;return e.tags&&(t.tags=e.tags,n.tagsFilter=t),n}async getLatestTabularData(e,n,t,o){const i=await this.dataClient.getLatestTabularData({partId:e,resourceName:n,resourceSubtype:t,methodName:o});return!i.payload||!i.timeCaptured||!i.timeSynced?null:[i.timeCaptured.toDate(),i.timeSynced.toDate(),i.payload.toJson()]}async listDataPipelines(e){return(await this.dataPipelinesClient.listDataPipelines({organizationId:e})).dataPipelines}async getDataPipeline(e){return(await this.dataPipelinesClient.getDataPipeline({id:e})).dataPipeline??null}async createDataPipeline(e,n,t,o){const i=t[0]instanceof Uint8Array?t:t.map(c=>Oa.serialize(c));return(await this.dataPipelinesClient.createDataPipeline({organizationId:e,name:n,mqlBinary:i,schedule:o})).id}async deleteDataPipeline(e){await this.dataPipelinesClient.deleteDataPipeline({id:e})}async listDataPipelineRuns(e,n){const t=await this.dataPipelinesClient.listDataPipelineRuns({id:e,pageSize:n});return new Pa(this.dataPipelinesClient,e,t.runs,n,t.nextPageToken)}}class Pa{constructor(e,n,t=[],o,i){this.dataPipelinesClient=e,this.pipelineId=n,this.runs=t,this.pageSize=o,this.nextPageToken=i}async nextPage(){if(this.nextPageToken===void 0||this.nextPageToken==="")return new Pa(this.dataPipelinesClient,this.pipelineId,[],this.pageSize,"");const e=await this.dataPipelinesClient.listDataPipelineRuns({id:this.pipelineId,pageSize:this.pageSize,pageToken:this.nextPageToken});return new Pa(this.dataPipelinesClient,this.pipelineId,e.runs,this.pageSize,e.nextPageToken)}}const f_={typeName:"viam.app.mltraining.v1.MLTrainingService",methods:{submitTrainingJob:{name:"SubmitTrainingJob",I:Zd,O:ep,kind:m.Unary},submitCustomTrainingJob:{name:"SubmitCustomTrainingJob",I:np,O:ap,kind:m.Unary},getTrainingJob:{name:"GetTrainingJob",I:tp,O:sp,kind:m.Unary},listTrainingJobs:{name:"ListTrainingJobs",I:op,O:ip,kind:m.Unary},cancelTrainingJob:{name:"CancelTrainingJob",I:rp,O:mp,kind:m.Unary},deleteCompletedTrainingJob:{name:"DeleteCompletedTrainingJob",I:cp,O:lp,kind:m.Unary},getTrainingJobLogs:{name:"GetTrainingJobLogs",I:pp,O:up,kind:m.Unary}}};class R_{client;constructor(e){this.client=N(f_,e)}async submitTrainingJob(e,n,t,o,i,r){return(await this.client.submitTrainingJob({organizationId:e,datasetId:n,modelName:t,modelVersion:o,modelType:i,tags:r})).id}async submitCustomTrainingJob(e,n,t,o,i,r){return(await this.client.submitCustomTrainingJob({organizationId:e,datasetId:n,registryItemId:t,registryItemVersion:o,modelName:i,modelVersion:r})).id}async getTrainingJob(e){return(await this.client.getTrainingJob({id:e})).metadata}async listTrainingJobs(e,n){return(await this.client.listTrainingJobs({organizationId:e,status:n})).jobs}async cancelTrainingJob(e){return await this.client.cancelTrainingJob({id:e}),null}async deleteCompletedTrainingJob(e){return await this.client.deleteCompletedTrainingJob({id:e}),null}}const gv=s.makeMessageType("viam.provisioning.v1.GetSmartMachineStatusRequest",[]),Tv=s.makeMessageType("viam.provisioning.v1.GetSmartMachineStatusResponse",()=>[{no:1,name:"provisioning_info",kind:"message",T:_v},{no:2,name:"has_smart_machine_credentials",kind:"scalar",T:8},{no:3,name:"is_online",kind:"scalar",T:8},{no:4,name:"latest_connection_attempt",kind:"message",T:Jo},{no:5,name:"errors",kind:"scalar",T:9,repeated:!0}]),kv=s.makeMessageType("viam.provisioning.v1.SetNetworkCredentialsRequest",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"ssid",kind:"scalar",T:9},{no:3,name:"psk",kind:"scalar",T:9}]),yv=s.makeMessageType("viam.provisioning.v1.SetNetworkCredentialsResponse",[]),vv=s.makeMessageType("viam.provisioning.v1.SetSmartMachineCredentialsRequest",()=>[{no:1,name:"cloud",kind:"message",T:zo}]),hv=s.makeMessageType("viam.provisioning.v1.SetSmartMachineCredentialsResponse",[]),fv=s.makeMessageType("viam.provisioning.v1.GetNetworkListRequest",[]),Rv=s.makeMessageType("viam.provisioning.v1.GetNetworkListResponse",()=>[{no:1,name:"networks",kind:"message",T:Jo,repeated:!0}]),_v=s.makeMessageType("viam.provisioning.v1.ProvisioningInfo",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"model",kind:"scalar",T:9},{no:3,name:"manufacturer",kind:"scalar",T:9}]),Jo=s.makeMessageType("viam.provisioning.v1.NetworkInfo",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"ssid",kind:"scalar",T:9},{no:3,name:"security",kind:"scalar",T:9},{no:4,name:"signal",kind:"scalar",T:5},{no:5,name:"connected",kind:"scalar",T:8},{no:6,name:"last_error",kind:"scalar",T:9}]),zo=s.makeMessageType("viam.provisioning.v1.CloudConfig",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"secret",kind:"scalar",T:9},{no:3,name:"app_address",kind:"scalar",T:9}]),__=Object.freeze(Object.defineProperty({__proto__:null,CloudConfig:zo,GetNetworkListRequest:fv,GetNetworkListResponse:Rv,GetSmartMachineStatusRequest:gv,GetSmartMachineStatusResponse:Tv,NetworkInfo:Jo,ProvisioningInfo:_v,SetNetworkCredentialsRequest:kv,SetNetworkCredentialsResponse:yv,SetSmartMachineCredentialsRequest:vv,SetSmartMachineCredentialsResponse:hv},Symbol.toStringTag,{value:"Module"})),S_={typeName:"viam.provisioning.v1.ProvisioningService",methods:{getSmartMachineStatus:{name:"GetSmartMachineStatus",I:gv,O:Tv,kind:m.Unary},setNetworkCredentials:{name:"SetNetworkCredentials",I:kv,O:yv,kind:m.Unary},setSmartMachineCredentials:{name:"SetSmartMachineCredentials",I:vv,O:hv,kind:m.Unary},getNetworkList:{name:"GetNetworkList",I:fv,O:Rv,kind:m.Unary}}};class I_{client;constructor(e){this.client=N(S_,e)}async getSmartMachineStatus(){return this.client.getSmartMachineStatus({})}async setNetworkCredentials(e,n,t){await this.client.setNetworkCredentials({type:e,ssid:n,psk:t})}async setSmartMachineCredentials(e){await this.client.setSmartMachineCredentials({cloud:e})}async getNetworkList(){return(await this.client.getNetworkList({})).networks}}const M_=async({serviceHost:a="https://app.viam.com",credentials:e})=>{const n=await RR(a,e);return new b_(n,e)};class b_{transport;credentials;dataClient;appClient;mlTrainingClient;provisioningClient;billingClient;constructor(e,n){this.transport=e,this.credentials=n,this.dataClient=new h_(this.transport),this.appClient=new b1(this.transport),this.mlTrainingClient=new R_(this.transport),this.provisioningClient=new I_(this.transport),this.billingClient=new O1(this.transport)}async connectToMachine({host:e=void 0,id:n=void 0}){if(e===void 0&&n===void 0)throw new Error("Either a machine address or ID must be provided");let t=e,o;if(n!==void 0&&e===void 0){const c=(await this.appClient.getRobotParts(n)).find(d=>d.mainPart);if(!c)throw new Error(`Could not find a main part for the machine with UUID: ${n}`);t=c.fqdn,o=c.locationId}if(t===void 0||t==="")throw new Error("Host was not provided and could not be obtained from the machine ID");let i=this.credentials;if(!En(i)){if(o===void 0){const c=t.split(".viam.")[0]?.split(".");c!==void 0&&(o=c.at(-1))}o!==void 0&&(i={type:"robot-location-secret",payload:(await this.appClient.getLocation(o))?.auth?.secrets.find(d=>d.state===Mo.ENABLED)?.secret,authEntity:t})}return Qd({host:t,credentials:i,signalingAddress:"https://app.viam.com:443",reconnectMaxAttempts:1})}}const{JointPositions:E_}=Ar;class w_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(qr),this.name=n,this.options=t}async getEndPosition(e={},n=this.callOptions){const t=new Tt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getEndPosition(t,n)).pose;if(!i)throw new Error("no pose");return i}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async moveToPosition(e,n={},t=this.callOptions){const o=new yt({name:this.name,to:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.moveToPosition(o,t)}async moveToJointPositions(e,n={},t=this.callOptions){const o=new ln({values:e}),i=new vt({name:this.name,positions:o,extra:l.fromJson(n)});this.options.requestLogger?.(i),await this.client.moveToJointPositions(i,t)}async getJointPositions(e={},n=this.callOptions){const t=new kt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getJointPositions(t,n)).positions;if(!i)throw new Error("no pose");return i}async stop(e={},n=this.callOptions){const t=new ht({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new ft({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{GetPropertiesResponse:O_}=zr;class C_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Yr),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async moveStraight(e,n,t={},o=this.callOptions){const i=new Rt({name:this.name,mmPerSec:n,distanceMm:e?BigInt(e):void 0,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.moveStraight(i,o)}async spin(e,n,t={},o=this.callOptions){const i=new _t({name:this.name,angleDeg:e,degsPerSec:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.spin(i,o)}async setPower(e,n,t={},o=this.callOptions){const i=new It({name:this.name,linear:e,angular:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPower(i,o)}async setVelocity(e,n,t={},o=this.callOptions){const i=new Mt({name:this.name,linear:e,angular:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setVelocity(i,o)}async stop(e={},n=this.callOptions){const t=new St({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new bt({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}async getProperties(e={},n=this.callOptions){const t=new ua({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}}const{ReadAnalogReaderResponse:N_,PowerMode:P_}=tm;class D_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(sm),this.name=n,this.options=t}async setGPIO(e,n,t={},o=this.callOptions){const i=new Et({name:this.name,pin:e,high:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setGPIO(i,o)}async getGPIO(e,n={},t=this.callOptions){const o=new wt({name:this.name,pin:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getGPIO(o,t)).high}async getPWM(e,n={},t=this.callOptions){const o=new Ot({name:this.name,pin:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.pWM(o,t)).dutyCyclePct}async setPWM(e,n,t={},o=this.callOptions){const i=new Ct({name:this.name,pin:e,dutyCyclePct:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPWM(i,o)}async getPWMFrequency(e,n={},t=this.callOptions){const o=new Nt({name:this.name,pin:e,extra:l.fromJson(n)});this.options.requestLogger?.(o);const i=await this.client.pWMFrequency(o,t);return Number(i.frequencyHz)}async setPWMFrequency(e,n,t={},o=this.callOptions){const i=new Pt({name:this.name,pin:e,frequencyHz:n?BigInt(n):void 0,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPWMFrequency(i,o)}async readAnalogReader(e,n={},t=this.callOptions){const o=new Dt({boardName:this.name,analogReaderName:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),this.client.readAnalogReader(o,t)}async writeAnalog(e,n,t={},o=this.callOptions){const i=new At({name:this.name,pin:e,value:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.writeAnalog(i,o)}async getDigitalInterruptValue(e,n={},t=this.callOptions){const o=new qt({boardName:this.name,digitalInterruptName:e,extra:l.fromJson(n)});this.options.requestLogger?.(o);const i=await this.client.getDigitalInterruptValue(o,t);return Number(i.value)}async streamTicks(e,n,t={},o=this.callOptions){const i=new Ut({name:this.name,pinNames:e,extra:l.fromJson(t)});this.options.requestLogger?.(i);const r=this.client.streamTicks(i,o);for await(const c of r)n.push({pinName:c.pinName,high:c.high,time:c.time?Number(c.time):0})}async setPowerMode(e,n,t={},o=this.callOptions){const i=new Lt({name:this.name,powerMode:e,duration:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPowerMode(i,o)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const Yo=s.makeMessageType("viam.component.button.v1.PushRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Sv=s.makeMessageType("viam.component.button.v1.PushResponse",[]),A_=Object.freeze(Object.defineProperty({__proto__:null,PushRequest:Yo,PushResponse:Sv},Symbol.toStringTag,{value:"Module"})),q_={typeName:"viam.component.button.v1.ButtonService",methods:{push:{name:"Push",I:Yo,O:Sv,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}};class U_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(q_),this.name=n,this.options=t}async push(e={},n=this.callOptions){const t=new Yo({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.push(t,n)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const L_=s.makeMessageType("google.api.HttpBody",()=>[{no:1,name:"content_type",kind:"scalar",T:9},{no:2,name:"data",kind:"scalar",T:12},{no:3,name:"extensions",kind:"message",T:j,repeated:!0}]),G_={typeName:"viam.component.camera.v1.CameraService",methods:{getImage:{name:"GetImage",I:co,O:Md,kind:m.Unary},getImages:{name:"GetImages",I:bd,O:Ed,kind:m.Unary},renderFrame:{name:"RenderFrame",I:po,O:L_,kind:m.Unary},getPointCloud:{name:"GetPointCloud",I:uo,O:wd,kind:m.Unary},getProperties:{name:"GetProperties",I:Od,O:Cd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},B_="pointcloud/pcd";class F_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(G_),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async getImage(e="",n={},t=this.callOptions){const o=new co({name:this.name,mimeType:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getImage(o,t)).image}async renderFrame(e="",n={},t=this.callOptions){const o=new po({name:this.name,mimeType:e,extra:l.fromJson(n)});this.options.requestLogger?.(o);const i=await this.client.renderFrame(o,t);return new Blob([i.data],{type:e})}async getPointCloud(e={},n=this.callOptions){const t=new uo({name:this.name,mimeType:B_,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPointCloud(t,n)).pointCloud}async getProperties(e=this.callOptions){const n=new ua({name:this.name});return this.options.requestLogger?.(n),this.client.getProperties(n,e)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class x_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Al),this.name=n,this.options=t}async discoverResources(e={},n=this.callOptions){const t=new Bs({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.discoverResources(t,n)).discoveries}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{GetPropertiesResponse:J_,PositionType:Iv}=mm;class z_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(cm),this.name=n,this.options=t}async resetPosition(e={},n=this.callOptions){const t=new Ft({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.resetPosition(t,n)}async getProperties(e={},n=this.callOptions){const t=new xt({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}async getPosition(e=Iv.UNSPECIFIED,n={},t=this.callOptions){const o=new Bt({name:this.name,positionType:e,extra:l.fromJson(n)});this.options.requestLogger?.(o);const i=await this.client.getPosition(o,t);return[i.value,i.positionType]}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class Y_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(km),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async getPosition(e={},n=this.callOptions){const t=new Jt({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).positionsMm}async moveToPosition(e,n,t={},o=this.callOptions){const i=new zt({name:this.name,positionsMm:e,speedsMmPerSec:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.moveToPosition(i,o)}async home(e={},n=this.callOptions){const t=new Yt({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.home(t,n)).homed}async getLengths(e={},n=this.callOptions){const t=new $t({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getLengths(t,n)).lengthsMm}async stop(e={},n=this.callOptions){const t=new Vt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new Wt({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{Capsule:$_,GeoGeometry:V_,GeoPoint:W_,GeometriesInFrame:j_,Geometry:H_,Orientation:K_,Pose:X_,PoseInFrame:Q_,RectangularPrism:Z_,ResourceName:eS,Sphere:nS,Transform:aS,Vector3:tS,WorldState:sS}=pt,Mv=a=>{const{latitude:e,longitude:n}=a;return!(typeof e!="number"||typeof n!="number"||Number.isNaN(e)||Number.isNaN(n))};class oS{client;options;name;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(jd),this.name=n,this.options=t}async metadata(e={},n=this.callOptions){const t=new $d({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.metadata(t,n)}async infer(e,n={},t=this.callOptions){const o=new Yd({name:this.name,inputTensors:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),this.client.infer(o,t)}}class iS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(xm),this.name=n,this.options=t}async setPower(e,n={},t=this.callOptions){const o=new ns({name:this.name,powerPct:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.setPower(o,t)}async goFor(e,n,t={},o=this.callOptions){const i=new as({name:this.name,rpm:e,revolutions:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.goFor(i,o)}async goTo(e,n,t={},o=this.callOptions){const i=new ts({name:this.name,rpm:e,positionRevolutions:n,extra:l.fromJson(t)});this.options.requestLogger?.(i),await this.client.goTo(i,o)}async setRPM(e,n={},t=this.callOptions){const o=new ss({name:this.name,rpm:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.setRPM(o,t)}async resetZeroPosition(e,n={},t=this.callOptions){const o=new os({name:this.name,offset:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.resetZeroPosition(o,t)}async stop(e={},n=this.callOptions){const t=new rs({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async getProperties(e={},n=this.callOptions){const t=new cs({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),{positionReporting:(await this.client.getProperties(t,n)).positionReporting}}async getPosition(e={},n=this.callOptions){const t=new is({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).position}async isPowered(e={},n=this.callOptions){const t=new ms({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.isPowered(t,n);return[o.isOn,o.powerPct]}async isMoving(e=this.callOptions){const n=new ls({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class rS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Xm),this.name=n,this.options=t}async getLinearVelocity(e={},n=this.callOptions){const t=new ds({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getLinearVelocity(t,n)).linearVelocity;if(!i)throw new Error("no linear velocity");return i}async getAngularVelocity(e={},n=this.callOptions){const t=new ps({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getAngularVelocity(t,n)).angularVelocity;if(!i)throw new Error("no angular velocity");return i}async getCompassHeading(e={},n=this.callOptions){const t=new us({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getCompassHeading(t,n)).value}async getOrientation(e={},n=this.callOptions){const t=new gs({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getOrientation(t,n)).orientation;if(!i)throw new Error("no orientation");return i}async getPosition(e={},n=this.callOptions){const t=new Ts({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getPosition(t,n)}async getProperties(e={},n=this.callOptions){const t=new ks({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}async getAccuracy(e={},n=this.callOptions){const t=new ys({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),this.client.getAccuracy(t,n)}async getLinearAcceleration(e={},n=this.callOptions){const t=new vs({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const i=(await this.client.getLinearAcceleration(t,n)).linearAcceleration;if(!i)throw new Error("no linear acceleration");return i}async getReadings(e={},n=this.callOptions){const t=new Ke({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getReadings(t,n),i={};for(const r of Object.keys(o.readings)){const c=o.readings[r];c&&(i[r]=c.toJson())}return i}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{GetAccuracyResponse:mS,GetPositionResponse:cS,GetPropertiesResponse:lS}=Km;class dS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(nc),this.name=n,this.options=t}async getVoltage(e={},n=this.callOptions){const t=new hs({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getVoltage(t,n);return[o.volts,o.isAc]}async getCurrent(e={},n=this.callOptions){const t=new fs({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getCurrent(t,n);return[o.amperes,o.isAc]}async getPower(e={},n=this.callOptions){const t=new Rs({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPower(t,n)).watts}async getReadings(e={},n=this.callOptions){const t=new Ke({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getReadings(t,n),i={};for(const r of Object.keys(o.readings)){const c=o.readings[r];c&&(i[r]=c.toJson())}return i}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const bv={typeName:"viam.component.sensor.v1.SensorService",methods:{getReadings:{name:"GetReadings",I:Ke,O:pa,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},pS=Object.freeze(Object.defineProperty({__proto__:null,SensorService:bv},Symbol.toStringTag,{value:"Module"}));class uS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(bv),this.name=n,this.options=t}async getReadings(e={},n=this.callOptions){const t=new Ke({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getReadings(t,n),i={};for(const r of Object.keys(o.readings)){const c=o.readings[r];c&&(i[r]=c.toJson())}return i}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const Ev=s.makeMessageType("proto.stream.v1.ListStreamsRequest",[]),wv=s.makeMessageType("proto.stream.v1.ListStreamsResponse",()=>[{no:1,name:"names",kind:"scalar",T:9,repeated:!0}]),$o=s.makeMessageType("proto.stream.v1.AddStreamRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Ov=s.makeMessageType("proto.stream.v1.AddStreamResponse",[]),Vo=s.makeMessageType("proto.stream.v1.RemoveStreamRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Cv=s.makeMessageType("proto.stream.v1.RemoveStreamResponse",[]),Wo=s.makeMessageType("proto.stream.v1.Resolution",()=>[{no:1,name:"width",kind:"scalar",T:5},{no:2,name:"height",kind:"scalar",T:5}]),jo=s.makeMessageType("proto.stream.v1.GetStreamOptionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Nv=s.makeMessageType("proto.stream.v1.GetStreamOptionsResponse",()=>[{no:1,name:"resolutions",kind:"message",T:Wo,repeated:!0}]),Da=s.makeMessageType("proto.stream.v1.SetStreamOptionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"resolution",kind:"message",T:Wo}]),Pv=s.makeMessageType("proto.stream.v1.SetStreamOptionsResponse",[]),gS=Object.freeze(Object.defineProperty({__proto__:null,AddStreamRequest:$o,AddStreamResponse:Ov,GetStreamOptionsRequest:jo,GetStreamOptionsResponse:Nv,ListStreamsRequest:Ev,ListStreamsResponse:wv,RemoveStreamRequest:Vo,RemoveStreamResponse:Cv,Resolution:Wo,SetStreamOptionsRequest:Da,SetStreamOptionsResponse:Pv},Symbol.toStringTag,{value:"Module"})),TS={typeName:"proto.stream.v1.StreamService",methods:{listStreams:{name:"ListStreams",I:Ev,O:wv,kind:m.Unary},addStream:{name:"AddStream",I:$o,O:Ov,kind:m.Unary},getStreamOptions:{name:"GetStreamOptions",I:jo,O:Nv,kind:m.Unary},setStreamOptions:{name:"SetStreamOptions",I:Da,O:Pv,kind:m.Unary},removeStream:{name:"RemoveStream",I:Vo,O:Cv,kind:m.Unary}}},An=a=>a.replaceAll(":","+");class kS extends Ir{client;options;streams;constructor(e,n={}){super(),this.client=e.createServiceClient(TS),this.options=n,this.streams=new Set,e.on("track",t=>{this.emit("track",t)}),e.on(ne.CONNECTED,()=>{for(const t of this.streams.values())this.add(t)})}async add(e){const n=new $o({name:An(e)});this.options.requestLogger?.(n);try{await this.client.addStream(n),this.streams.add(e)}catch{n.name=e,this.options.requestLogger?.(n),await this.client.addStream(n),this.streams.add(e)}}async remove(e){const n=new Vo({name:An(e)});this.options.requestLogger?.(n);try{await this.client.removeStream(n),this.streams.delete(e)}catch{n.name=e,this.options.requestLogger?.(n),await this.client.removeStream(n),this.streams.delete(e)}}async getOptions(e){const n=async i=>{const r=new jo({name:i});this.options.requestLogger?.(r);try{return(await this.client.getStreamOptions(r)).resolutions}catch{return[]}},t=An(e);let o=await n(t);return o.length>0||(o=await n(e)),o}async setOptions(e,n,t){const o=new Da({name:An(e),resolution:{width:n,height:t}});this.options.requestLogger?.(o);try{await this.client.setStreamOptions(o)}catch{o.name=e,this.options.requestLogger?.(o),await this.client.setStreamOptions(o)}}async resetOptions(e){const n=new Da({name:An(e)});this.options.requestLogger?.(n);try{await this.client.setStreamOptions(n)}catch{n.name=e,this.options.requestLogger?.(n),await this.client.setStreamOptions(n)}}STREAM_TIMEOUT=5e3;getStream=async e=>{const n=new Promise((t,o)=>{const i=r=>{const[c]=r.streams;c?c.id===e&&(this.off("track",i),t(c)):(this.off("track",i),o(new Error("Received track event with no streams")))};this.on("track",i),setTimeout(()=>{this.off("track",i),o(new Error(`Did not receive a stream after ${this.STREAM_TIMEOUT} ms`))},this.STREAM_TIMEOUT)});return await this.add(e),n}}const Ho=s.makeMessageType("viam.component.switch.v1.SetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"position",kind:"scalar",T:13},{no:99,name:"extra",kind:"message",T:l}]),Dv=s.makeMessageType("viam.component.switch.v1.SetPositionResponse",[]),Ko=s.makeMessageType("viam.component.switch.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Av=s.makeMessageType("viam.component.switch.v1.GetPositionResponse",()=>[{no:1,name:"position",kind:"scalar",T:13}]),Xo=s.makeMessageType("viam.component.switch.v1.GetNumberOfPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),qv=s.makeMessageType("viam.component.switch.v1.GetNumberOfPositionsResponse",()=>[{no:1,name:"number_of_positions",kind:"scalar",T:13}]),yS=Object.freeze(Object.defineProperty({__proto__:null,GetNumberOfPositionsRequest:Xo,GetNumberOfPositionsResponse:qv,GetPositionRequest:Ko,GetPositionResponse:Av,SetPositionRequest:Ho,SetPositionResponse:Dv},Symbol.toStringTag,{value:"Module"})),vS={typeName:"viam.component.switch.v1.SwitchService",methods:{setPosition:{name:"SetPosition",I:Ho,O:Dv,kind:m.Unary},getPosition:{name:"GetPosition",I:Ko,O:Av,kind:m.Unary},getNumberOfPositions:{name:"GetNumberOfPositions",I:Xo,O:qv,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}};class hS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(vS),this.name=n,this.options=t}async setPosition(e,n={},t=this.callOptions){const o=new Ho({name:this.name,position:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.setPosition(o,t)}async getPosition(e={},n=this.callOptions){const t=new Ko({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).position}async getNumberOfPositions(e={},n=this.callOptions){const t=new Xo({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getNumberOfPositions(t,n)).numberOfPositions}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}let fS=class{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(jt),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}};class RS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Rm),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:l.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async open(e={},n=this.callOptions){const t=new Ht({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.open(t,n)}async grab(e={},n=this.callOptions){const t=new Kt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.grab(t,n)}async stop(e={},n=this.callOptions){const t=new Xt({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new Qt({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class _S{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Cm),this.name=n,this.options=t}async getEvents(e={},n=this.callOptions){const t=new Zt({controller:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getEvents(t,n)).events}async triggerEvent(e,n={},t=this.callOptions){const o=new es({controller:this.name,event:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.triggerEvent(o,t)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{Event:SS}=Om,{CollisionSpecification:IS,Constraints:MS,GetPlanResponse:QS,LinearConstraint:bS,ListPlanStatusesResponse:ES,MotionConfiguration:wS,ObstacleDetector:OS,OrientationConstraint:CS,PlanState:ZS}=Zl;class NS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(ed),this.name=n,this.options=t}async move(e,n,t,o,i={},r=this.callOptions){const c=new Fs({name:this.name,destination:e,componentName:n,worldState:t,constraints:o,extra:l.fromJson(i)});return this.options.requestLogger?.(c),(await this.client.move(c,r)).success}async moveOnMap(e,n,t,o,i,r={},c=this.callOptions){const d=new xs({name:this.name,destination:e,componentName:n,slamServiceName:t,motionConfiguration:o,obstacles:i,extra:l.fromJson(r)});return this.options.requestLogger?.(d),(await this.client.moveOnMap(d,c)).executionId}async moveOnGlobe(e,n,t,o,i,r,c,d={},p=this.callOptions){const k=new zs({name:this.name,destination:e,componentName:n,movementSensorName:t,heading:o,obstacles:i,boundingRegions:c,motionConfiguration:r,extra:l.fromJson(d)});return this.options.requestLogger?.(k),(await this.client.moveOnGlobe(k,p)).executionId}async stopPlan(e,n={},t=this.callOptions){const o=new $s({name:this.name,componentName:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),await this.client.stopPlan(o,t),null}async getPlan(e,n,t,o={},i=this.callOptions){const r=new Ws({name:this.name,componentName:e,lastPlanOnly:n,executionId:t,extra:l.fromJson(o)});return this.options.requestLogger?.(r),this.client.getPlan(r,i)}async listPlanStatuses(e,n={},t=this.callOptions){const o=new Vs({name:this.name,onlyActivePlans:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),this.client.listPlanStatuses(o,t)}async getPose(e,n,t,o={},i=this.callOptions){const r=new Ys({name:this.name,componentName:e,destinationFrame:n,supplementalTransforms:t,extra:l.fromJson(o)});this.options.requestLogger?.(r);const d=(await this.client.getPose(r,i)).pose;if(!d)throw new Error("no pose");return d}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const Qo=s.makeMessageType("viam.service.datamanager.v1.SyncRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:l}]),Uv=s.makeMessageType("viam.service.datamanager.v1.SyncResponse",[]),PS=Object.freeze(Object.defineProperty({__proto__:null,SyncRequest:Qo,SyncResponse:Uv},Symbol.toStringTag,{value:"Module"})),DS={typeName:"viam.service.datamanager.v1.DataManagerService",methods:{sync:{name:"Sync",I:Qo,O:Uv,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}};class AS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(DS),this.name=n,this.options=t}async sync(e={},n=this.callOptions){const t=new Qo({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.sync(t,n)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class qS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(gd),this.name=n,this.options=t}async getMode(e={},n=this.callOptions){const t=new Ks({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getMode(t,n)).mode}async setMode(e,n={},t=this.callOptions){const o=new Xs({name:this.name,mode:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.setMode(o,t)}async getLocation(e={},n=this.callOptions){const t=new Qs({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getLocation(t,n);if(!o.location)throw new Error("no location");if(!Mv(o.location))throw new Error("invalid location");return o}async getWayPoints(e={},n=this.callOptions){const t=new Zs({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getWaypoints(t,n)).waypoints}async addWayPoint(e,n={},t=this.callOptions){const o=new eo({name:this.name,location:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.addWaypoint(o,t)}async removeWayPoint(e,n={},t=this.callOptions){const o=new no({name:this.name,id:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.removeWaypoint(o,t)}async getObstacles(e={},n=this.callOptions){const t=new ao({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getObstacles(t,n)).obstacles}async getPaths(e={},n=this.callOptions){const t=new to({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPaths(t,n)).paths}async getProperties(e=this.callOptions){const n=new so({name:this.name});return this.options.requestLogger?.(n),this.client.getProperties(n,e)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{GetLocationResponse:US,GetPropertiesResponse:LS,Mode:eI,Path:GS,Waypoint:BS}=ud;class FS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(ic),this.name=n,this.options=t}async move(e,n={},t=this.callOptions){const o=new _s({name:this.name,angleDeg:e,extra:l.fromJson(n)});this.options.requestLogger?.(o),await this.client.move(o,t)}async getPosition(e={},n=this.callOptions){const t=new Ss({name:this.name,extra:l.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).positionDeg}async stop(e={},n=this.callOptions){const t=new Is({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new Ms({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}class xS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Sd),this.name=n,this.options=t}async getPosition(e=this.callOptions){const n=new oo({name:this.name});return this.options.requestLogger?.(n),this.client.getPosition(n,e)}async getPointCloudMap(e,n=this.callOptions){const t=new io({name:this.name,returnEditedMap:e});this.options.requestLogger?.(t);const o=[],i=this.client.getPointCloudMap(t,n);for await(const r of i)o.push(r.pointCloudPcdChunk);return Lv(o)}async getInternalState(e=this.callOptions){const n=new ro({name:this.name});this.options.requestLogger?.(n);const t=[],o=this.client.getInternalState(n,e);for await(const i of o)t.push(i.internalStateChunk);return Lv(t)}async getProperties(e=this.callOptions){const n=new mo({name:this.name});return this.options.requestLogger?.(n),this.client.getProperties(n,e)}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const Lv=a=>{const e=a.reduce((o,i)=>o+i.length,0),n=new Uint8Array(e);let t=0;for(const o of a)n.set(o,t),t+=o.length;return n},{GetPositionResponse:JS,GetPropertiesResponse:zS}=_d;class YS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(zd),this.name=n,this.options=t}async getDetectionsFromCamera(e,n={},t=this.callOptions){const o=new To({name:this.name,cameraName:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getDetectionsFromCamera(o,t)).detections}async getDetections(e,n,t,o,i={},r=this.callOptions){const c=new go({name:this.name,image:e,width:n?BigInt(n):void 0,height:t?BigInt(t):void 0,mimeType:o,extra:l.fromJson(i)});return this.options.requestLogger?.(c),(await this.client.getDetections(c,r)).detections}async getClassificationsFromCamera(e,n,t={},o=this.callOptions){const i=new yo({name:this.name,cameraName:e,n,extra:l.fromJson(t)});return this.options.requestLogger?.(i),(await this.client.getClassificationsFromCamera(i,o)).classifications}async getClassifications(e,n,t,o,i,r={},c=this.callOptions){const d=new ko({name:this.name,image:e,width:n,height:t,mimeType:o,n:i,extra:l.fromJson(r)});return this.options.requestLogger?.(d),(await this.client.getClassifications(d,c)).classifications}async getObjectPointClouds(e,n={},t=this.callOptions){const o=new vo({name:this.name,cameraName:e,extra:l.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getObjectPointClouds(o,t)).objects}async getProperties(e={},n=this.callOptions){const t=new ho({name:this.name,extra:l.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getProperties(t,n);return{classificationsSupported:o.classificationsSupported,detectionsSupported:o.detectionsSupported,objectPointCloudsSupported:o.objectPointCloudsSupported}}async captureAllFromCamera(e,{returnImage:n,returnClassifications:t,returnDetections:o,returnObjectPointClouds:i},r={},c=this.callOptions){const d=new fo({name:this.name,cameraName:e,returnImage:n,returnClassifications:t,returnDetections:o,returnObjectPointClouds:i,extra:l.fromJson(r)});this.options.requestLogger?.(d);const p=await this.client.captureAllFromCamera(d,c);return{image:p.image,classifications:p.classifications,detections:p.detections,objectPointClouds:p.objects,extra:p.extra}}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const{Classification:$S,Detection:VS}=Jd,{PointCloudObject:WS}=pt,Gv={typeName:"viam.service.generic.v1.GenericService",methods:{doCommand:{name:"DoCommand",I:q,O:L,kind:m.Unary}}},jS=Object.freeze(Object.defineProperty({__proto__:null,GenericService:Gv},Symbol.toStringTag,{value:"Module"}));class HS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Gv),this.name=n,this.options=t}async doCommand(e,n=this.callOptions){return G(this.client.doCommand,this.name,e,this.options,n)}}const KS="0.43.0";T.AnalogValue=N_,T.ArmClient=w_,T.ArmJointPositions=E_,T.BaseClient=C_,T.BaseProperties=O_,T.BoardClient=D_,T.ButtonClient=U_,T.CameraClient=F_,T.Capsule=$_,T.Classification=$S,T.Client=D,T.CloudConfig=zo,T.CollisionSpecification=IS,T.ConnectError=C,T.ConnectionClosedError=le,T.Constraints=MS,T.DataManagerClient=AS,T.Detection=VS,T.DiscoveryClient=x_,T.Duration=F,T.EncoderClient=z_,T.EncoderPositionType=Iv,T.EncoderProperties=J_,T.GantryClient=Y_,T.GenericComponentClient=fS,T.GenericServiceClient=HS,T.GeoGeometry=V_,T.GeoPoint=W_,T.GeometriesInFrame=j_,T.Geometry=H_,T.GripperClient=RS,T.InputControllerClient=_S,T.InputControllerEvent=SS,T.LinearConstraint=bS,T.ListPlanStatusesResponse=ES,T.MLModelClient=oS,T.MachineConnectionEvent=ne,T.ModelType=ze,T.MotionClient=NS,T.MotionConfiguration=wS,T.MotorClient=iS,T.MovementSensorAccuracy=mS,T.MovementSensorClient=rS,T.MovementSensorPosition=cS,T.MovementSensorProperties=lS,T.NavigationClient=qS,T.NavigationPosition=US,T.NavigationProperties=LS,T.ObstacleDetector=OS,T.Orientation=K_,T.OrientationConstraint=CS,T.Path=GS,T.PointCloudObject=WS,T.Pose=X_,T.PoseInFrame=Q_,T.PowerMode=P_,T.PowerSensorClient=dS,T.RectangularPrism=Z_,T.ResourceName=eS,T.RobotClient=D,T.SensorClient=uS,T.ServoClient=FS,T.SlamClient=xS,T.SlamPosition=JS,T.SlamProperties=zS,T.Sphere=nS,T.StreamClient=kS,T.Struct=l,T.SwitchClient=hS,T.Timestamp=S,T.TrainingStatus=fa,T.Transform=aS,T.Vector3=tS,T.VisionClient=YS,T.Waypoint=BS,T.WorldState=sS,T.addMetadata=hR,T.appApi=I1,T.appRobotApi=JR,T.armApi=Ar,T.baseApi=zr,T.billingApi=E1,T.boardApi=tm,T.buttonApi=A_,T.cameraApi=$R,T.commonApi=pt,T.createRobotClient=Qd,T.createViamClient=M_,T.dataApi=P1,T.dataManagerApi=PS,T.deleteMetadata=fR,T.disableDebugLogging=vR,T.discoveryApi=zR,T.doCommandFromClient=G,T.enableDebugLogging=yR,T.encoderApi=mm,T.gantryApi=MR,T.genericComponentApi=bR,T.genericServiceApi=jS,T.gripperApi=ER,T.inputControllerApi=Om,T.isValidGeoPoint=Mv,T.mlTrainingApi=S1,T.motionApi=Zl,T.motorApi=OR,T.movementSensorApi=Km,T.navigationApi=ud,T.powerSensorApi=CR,T.provisioningApi=__,T.robotApi=DR,T.sensorApi=pS,T.servoApi=PR,T.slamApi=_d,T.streamApi=gS,T.switchApi=yS,T.version=KS,T.visionApi=Jd,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});