@viamrobotics/sdk 0.40.1 → 0.40.2

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
1
  (function(T,D){typeof exports=="object"&&typeof module<"u"?D(exports):typeof define=="function"&&define.amd?define(["exports"],D):(T=typeof globalThis<"u"?globalThis:T||self,D(T.sdk={}))})(this,function(T){"use strict";function D(a,e){if(!a)throw new Error(e)}const Av=34028234663852886e22,Dv=-34028234663852886e22,qv=4294967295,Uv=2147483647,Gv=-2147483648;function qn(a){if(typeof a!="number")throw new Error("invalid int 32: "+typeof a);if(!Number.isInteger(a)||a>Uv||a<Gv)throw new Error("invalid int 32: "+a)}function Ca(a){if(typeof a!="number")throw new Error("invalid uint 32: "+typeof a);if(!Number.isInteger(a)||a>qv||a<0)throw new Error("invalid uint 32: "+a)}function Ho(a){if(typeof a!="number")throw new Error("invalid float 32: "+typeof a);if(Number.isFinite(a)&&(a>Av||a<Dv))throw new Error("invalid float 32: "+a)}const Ko=Symbol("@bufbuild/protobuf/enum-type");function Lv(a){const e=a[Ko];return D(e,"missing enum type on enum object"),e}function Xo(a,e,n,t){a[Ko]=Qo(e,n.map(o=>({no:o.no,name:o.name,localName:a[o.no]})))}function Qo(a,e,n){const t=Object.create(null),o=Object.create(null),i=[];for(const r of e){const c=Zo(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 Bv(a,e,n){const t={};for(const o of e){const i=Zo(o);t[i.localName]=i.no,t[i.no]=i.localName}return Xo(t,a,e),t}function Zo(a){return"localName"in a?a:Object.assign(Object.assign({},a),{localName:a.name})}class E{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 Fv(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 E),Object.assign(r,{runtime:a,typeName:e,fields:a.util.newFieldList(n),fromBinary(c,u){return new r().fromBinary(c,u)},fromJson(c,u){return new r().fromJson(c,u)},fromJsonString(c,u){return new r().fromJsonString(c,u)},equals(c,u){return a.util.equals(r,c,u)}}),r}function xv(){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 Na(a,e,n){for(let i=0;i<28;i=i+7){const r=a>>>i,c=!(!(r>>>7)&&e==0),u=(c?r|128:r)&255;if(n.push(u),!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),u=(c?r|128:r)&255;if(n.push(u),!c)return}n.push(e>>>31&1)}}const Un=4294967296;function ei(a){const e=a[0]==="-";e&&(a=a.slice(1));const n=1e6;let t=0,o=0;function i(r,c){const u=Number(a.slice(r,c));o*=n,t=t*n+u,t>=Un&&(o=o+(t/Un|0),t=t%Un)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),e?ai(t,o):Pa(t,o)}function Jv(a,e){let n=Pa(a,e);const t=n.hi&2147483648;t&&(n=ai(n.lo,n.hi));const o=ni(n.lo,n.hi);return t?"-"+o:o}function ni(a,e){if({lo:a,hi:e}=zv(a,e),e<=2097151)return String(Un*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 u=1e7;return i>=u&&(r+=Math.floor(i/u),i%=u),r>=u&&(c+=Math.floor(r/u),r%=u),c.toString()+ti(r)+ti(i)}function zv(a,e){return{lo:a>>>0,hi:e>>>0}}function Pa(a,e){return{lo:a|0,hi:e|0}}function ai(a,e){return e=~e,a?a=~a+1:e+=1,Pa(a,e)}const ti=a=>{const e=String(a);return"0000000".slice(e.length)+e};function si(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 Yv(){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 $v(){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(u){const l=typeof u=="bigint"?u:BigInt(u);if(l>i||l<o)throw new Error(`int64 invalid: ${u}`);return l},uParse(u){const l=typeof u=="bigint"?u:BigInt(u);if(l>c||l<r)throw new Error(`uint64 invalid: ${u}`);return l},enc(u){return a.setBigInt64(0,this.parse(u),!0),{lo:a.getInt32(0,!0),hi:a.getInt32(4,!0)}},uEnc(u){return a.setBigInt64(0,this.uParse(u),!0),{lo:a.getInt32(0,!0),hi:a.getInt32(4,!0)}},dec(u,l){return a.setInt32(0,u,!0),a.setInt32(4,l,!0),a.getBigInt64(0,!0)},uDec(u,l){return a.setInt32(0,u,!0),a.setInt32(4,l,!0),a.getBigUint64(0,!0)}}}const n=o=>D(/^-?[0-9]+$/.test(o),`int64 invalid: ${o}`),t=o=>D(/^[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),ei(o)},uEnc(o){return typeof o!="string"&&(o=o.toString()),t(o),ei(o)},dec(o,i){return Jv(o,i)},uDec(o,i){return ni(o,i)}}}const V=$v();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 Ge;(function(a){a[a.BIGINT=0]="BIGINT",a[a.STRING=1]="STRING"})(Ge||(Ge={}));function Le(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 en(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 oi(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 Vv{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(Ca(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return qn(e),si(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){Ho(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){Ca(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){qn(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return qn(e),e=(e<<1^e>>31)>>>0,si(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 Na(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 Na(o,i,this.buf),this}uint64(e){let n=V.uEnc(e);return Na(n.lo,n.hi,this.buf),this}}class ii{constructor(e,n){this.varint64=xv,this.uint32=Yv,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 Wv(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 ri(a){const e=a.field.localName,n=Object.create(null);return n[e]=jv(a),[n,()=>n[e]]}function jv(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 en(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 Hv(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 ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Gn=[];for(let a=0;a<ue.length;a++)Gn[ue[a].charCodeAt(0)]=a;Gn[45]=ue.indexOf("+"),Gn[95]=ue.indexOf("/");const Aa={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
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+=ue[t>>2],o=(t&3)<<4,n=1;break;case 1:e+=ue[o|t>>4],o=(t&15)<<2,n=2;break;case 2:e+=ue[o|t>>6],e+=ue[t&63],n=0;break}return n&&(e+=ue[o],e+="=",n==1&&(e+="=")),e}};function Kv(a,e,n){ci(e,a);const t=e.runtime.bin.makeReadOptions(n),o=Hv(a.getType().runtime.bin.listUnknownFields(a),e.field),[i,r]=ri(e);for(const c of o)e.runtime.bin.readField(i,t.readerFactory(c.data),e.field,c.wireType,t);return r()}function Xv(a,e,n,t){ci(e,a);const o=e.runtime.bin.makeReadOptions(t),i=e.runtime.bin.makeWriteOptions(t);if(mi(a,e)){const l=a.getType().runtime.bin.listUnknownFields(a).filter(k=>k.no!=e.field.no);a.getType().runtime.bin.discardUnknownFields(a);for(const k of l)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 u=o.readerFactory(r.finish());for(;u.pos<u.len;){const[l,k]=u.tag(),R=u.skip(k,l);a.getType().runtime.bin.onUnknownField(a,l,k,R)}}function mi(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 ci(a,e){D(a.extendee.typeName==e.getType().typeName,`extension ${a.typeName} can only be applied to message ${a.extendee.typeName}`)}function di(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:!oi(a.T,e[n]);case"message":return e[n]!==void 0;case"map":return Object.keys(e[n]).length>0}}function li(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?en(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(E.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 ui(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 pi={ignoreUnknownFields:!1},gi={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function Qv(a){return a?Object.assign(Object.assign({},pi),a):pi}function Zv(a){return a?Object.assign(Object.assign({},gi),a):gi}const Ln=Symbol(),Bn=Symbol();function eh(){return{makeReadOptions:Qv,makeWriteOptions:Zv,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 u=a.fields.findJsonName(r);if(u){if(u.oneof){if(c===null&&u.kind=="scalar")continue;const l=o.get(u.oneof);if(l!==void 0)throw new Error(`cannot decode message ${a.typeName} from JSON: multiple keys for oneof "${u.oneof.name}" present: "${l}", "${r}"`);o.set(u.oneof,r)}Ti(t,c,u,n,a)}else{let l=!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){l=!0;const[R,I]=ri(k);Ti(R,c,k.field,n,k),Xv(t,k,I(),n)}}if(!l&&!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(!di(o,a)){if(o.req)throw"required field not set";if(!e.emitDefaultValues||!ah(o))continue}const r=o.oneof?a[o.oneof.localName].value:a[o.localName],c=ki(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&&mi(a,c)){const u=Kv(a,c,e),l=ki(c.field,u,e);l!==void 0&&(t[c.field.jsonName]=l)}}}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 ln(a,e,n??Ge.BIGINT,!0)},writeScalar(a,e,n){if(e!==void 0&&(n||oi(a,e)))return Fn(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 Ti(a,e,n,t,o){let i=n.localName;if(n.repeated){if(D(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 u=Da(n.T,c,t.ignoreUnknownFields,!0);u!==Bn&&r.push(u);break;case"scalar":try{r.push(ln(n.T,c,n.L,!0))}catch(l){let k=`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(c)}`;throw l instanceof Error&&l.message.length>0&&(k+=`: ${l.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,u]of Object.entries(e)){if(u===null)throw new Error(`cannot decode field ${o.typeName}.${n.name} from JSON: map value null`);let l;try{l=nh(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[l]=n.V.T.fromJson(u,t);break;case"enum":const k=Da(n.V.T,u,t.ignoreUnknownFields,!0);k!==Bn&&(r[l]=k);break;case"scalar":try{r[l]=ln(n.V.T,u,Ge.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 u=Da(n.T,e,t.ignoreUnknownFields,!1);switch(u){case Ln:li(n,a);break;case Bn:break;default:a[i]=u;break}break;case"scalar":try{const l=ln(n.T,e,n.L,!1);switch(l){case Ln:li(n,a);break;default:a[i]=l;break}}catch(l){let k=`cannot decode field ${o.typeName}.${n.name} from JSON: ${te(e)}`;throw l instanceof Error&&l.message.length>0&&(k+=`: ${l.message}`),new Error(k)}break}}function nh(a,e){if(a===f.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return ln(a,e,Ge.BIGINT,!0).toString()}function ln(a,e,n,t){if(e===null)return t?en(a,n):Ln;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&&Ho(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?Ca(i):qn(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 Aa.dec(e)}throw new Error}function Da(a,e,n,t){if(e===null)return a.typeName=="google.protobuf.NullValue"?0:t?a.values[0].no:Ln;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 Bn;break}throw new Error(`cannot decode enum ${a.typeName} from JSON: ${te(e)}`)}function ah(a){return a.repeated||a.kind=="map"?!0:!(a.oneof||a.kind=="message"||a.opt||a.req)}function ki(a,e,n){if(a.kind=="map"){D(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()]=Fn(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()]=qa(i,c,n.enumAsInteger);break}return n.emitDefaultValues||o.length>0?t:void 0}if(a.repeated){D(Array.isArray(e));const t=[];switch(a.kind){case"scalar":for(let o=0;o<e.length;o++)t.push(Fn(a.T,e[o]));break;case"enum":for(let o=0;o<e.length;o++)t.push(qa(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 Fn(a.T,e);case"enum":return qa(a.T,e,n.enumAsInteger);case"message":return ui(a.T,e).toJson(n)}}function qa(a,e,n){var t;if(D(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 Fn(a,e){switch(a){case f.INT32:case f.SFIXED32:case f.SINT32:case f.FIXED32:case f.UINT32:return D(typeof e=="number"),e;case f.FLOAT:case f.DOUBLE:return D(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case f.STRING:return D(typeof e=="string"),e;case f.BOOL:return D(typeof e=="boolean"),e;case f.UINT64:case f.FIXED64:case f.INT64:case f.SFIXED64:case f.SINT64:return D(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case f.BYTES:return D(e instanceof Uint8Array),Aa.enc(e)}}const nn=Symbol("@bufbuild/protobuf/unknown-fields"),yi={readUnknownFields:!0,readerFactory:a=>new ii(a)},vi={writeUnknownFields:!0,writerFactory:()=>new Vv};function th(a){return a?Object.assign(Object.assign({},yi),a):yi}function sh(a){return a?Object.assign(Object.assign({},vi),a):vi}function oh(){return{makeReadOptions:th,makeWriteOptions:sh,listUnknownFields(a){var e;return(e=a[nn])!==null&&e!==void 0?e:[]},discardUnknownFields(a){delete a[nn]},writeUnknownFields(a,e){const t=a[nn];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[nn])||(o[nn]=[]),o[nn].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,u;for(;e.pos<r&&([c,u]=e.tag(),!(o===!0&&u==B.EndGroup));){const l=i.fields.find(c);if(!l){const k=e.skip(u,c);t.readUnknownFields&&this.onUnknownField(a,c,u,k);continue}hi(a,e,l,u,t)}if(o&&(u!=B.EndGroup||c!==n))throw new Error("invalid end group tag")},readField:hi,writeMessage(a,e,n){const t=a.getType();for(const o of t.fields.byNumber()){if(!di(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];fi(o,i,e,n)}return n.writeUnknownFields&&this.writeUnknownFields(a,e),e},writeField(a,e,n,t){e!==void 0&&fi(a,e,n,t)}}}function hi(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 u=Jn;if(n.kind=="scalar"&&n.L>0&&(u=rh),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(u(e,c))}else I.push(u(e,c))}else a[r]=u(e,c);break;case"message":const l=n.T;i?a[r].push(xn(e,new l,o,n)):We(a[r])?xn(e,a[r],o,n):(a[r]=xn(e,new l,o,n),l.fieldWrapper&&!n.oneof&&!n.repeated&&(a[r]=l.fieldWrapper.unwrapField(a[r])));break;case"map":let[k,R]=ih(n,e,o);a[r][k]=R;break}}function xn(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 ih(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=Jn(e,a.K);break;case 2:switch(a.V.kind){case"scalar":r=Jn(e,a.V.T);break;case"enum":r=e.int32();break;case"message":r=xn(e,new a.V.T,n,void 0);break}break}}if(i===void 0&&(i=en(a.K,Ge.BIGINT)),typeof i!="string"&&typeof i!="number"&&(i=i.toString()),r===void 0)switch(a.V.kind){case"scalar":r=en(a.V.T,Ge.BIGINT);break;case"enum":r=a.V.T.values[0].no;break;case"message":r=new a.V.T;break}return[i,r]}function rh(a,e){const n=Jn(a,e);return typeof n=="bigint"?n.toString():n}function Jn(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 fi(a,e,n,t){D(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(D(Array.isArray(e)),a.packed)ch(n,i,a.no,e);else for(const r of e)un(n,i,a.no,r);else un(n,i,a.no,e);break;case"message":if(o){D(Array.isArray(e));for(const r of e)Ri(n,t,a,r)}else Ri(n,t,a,e);break;case"map":D(typeof e=="object"&&e!=null);for(const[r,c]of Object.entries(e))mh(n,t,a,r,c);break}}function mh(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:D(t=="true"||t=="false"),i=t=="true";break}switch(un(a,n.K,1,i),n.V.kind){case"scalar":un(a,n.V.T,2,o);break;case"enum":un(a,f.INT32,2,o);break;case"message":D(o!==void 0),a.tag(2,B.LengthDelimited).bytes(o.toBinary(e));break}a.join()}function Ri(a,e,n,t){const o=ui(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 un(a,e,n,t){D(t!==void 0);let[o,i]=_i(e);a.tag(n,o)[i](t)}function ch(a,e,n,t){if(!t.length)return;a.tag(n,B.LengthDelimited).fork();let[,o]=_i(e);for(let i=0;i<t.length;i++)a[o](t[i]);a.join()}function _i(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 dh(){return{setEnumType:Xo,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 u=t.findField(c);let l=r[o].value;u&&u.kind=="message"&&!We(l,u.T)?l=new u.T(l):u&&u.kind==="scalar"&&u.T===f.BYTES&&(l=pn(l)),i[o]={case:c,value:l};break;case"scalar":case"enum":let k=r[o];t.T===f.BYTES&&(k=t.repeated?k.map(pn):pn(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][_]=pn(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]=pn(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)=>Le(t.T,r,i[c]));case"enum":return o.every((r,c)=>Le(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 Le(f.INT32,o,i);case"scalar":return Le(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 Le(f.INT32,o.value,i.value);case"scalar":return Le(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 u=t.V.T;return c.every(k=>u.equals(o[k],i[k]));case"enum":return c.every(k=>Le(f.INT32,o[k],i[k]));case"scalar":const l=t.V.T;return c.every(k=>Le(l,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(zn);else if(o.kind=="map"){r=t[o.localName];for(const[c,u]of Object.entries(i))r[c]=zn(u)}else o.kind=="oneof"?r=o.findField(i.case)?{case:i.case,value:zn(i.value)}:{case:void 0}:r=zn(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 zn(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 pn(a){return a instanceof Uint8Array?a:new Uint8Array(a)}function Si(a,e,n){return{syntax:a,json:eh(),bin:oh(),util:Object.assign(Object.assign({},dh()),{newFieldList:e,initFields:n}),makeMessageType(t,o,i){return Fv(this,t,o,i)},makeEnum:Bv,makeEnumType:Qo,getEnumType:Lv,makeExtension(t,o,i){return Wv(this,t,o,i)}}}class Ii{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 Mi(a,e){const n=bi(a);return e?n:kh(Th(n))}function lh(a){return Mi(a,!1)}const uh=bi;function bi(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 ph=new Set(["constructor","toString","toJSON","valueOf"]),gh=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),wi=a=>`${a}$`,Th=a=>gh.has(a)?wi(a):a,kh=a=>ph.has(a)?wi(a):a;class yh{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=lh(e)}addField(e){D(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 Ei(a,e){var n,t,o,i,r,c;const u=[];let l;for(const k of typeof a=="function"?a():a){const R=k;if(R.localName=Mi(k.name,k.oneof!==void 0),R.jsonName=(n=k.jsonName)!==null&&n!==void 0?n:uh(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:Ge.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;(!l||l.name!=I)&&(l=new yh(I)),R.oneof=l,l.addField(R)}u.push(R)}return u}const s=Si("proto3",a=>new Ii(a,e=>Ei(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]=en(e.T,e.L);break}}}),p=Si("proto2",a=>new Ii(a,e=>Ei(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 Oi;(function(a){a[a.NoSideEffects=1]="NoSideEffects",a[a.Idempotent=2]="Idempotent"})(Oi||(Oi={}));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={})),p.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 E{constructor(e){super(),this.file=[],p.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 p.util.equals(Be,e,n)}}Be.runtime=p,Be.typeName="google.protobuf.FileDescriptorSet",Be.fields=p.util.newFieldList(()=>[{no:1,name:"file",kind:"message",T:se,repeated:!0}]);class se extends E{constructor(e){super(),this.dependency=[],this.publicDependency=[],this.weakDependency=[],this.messageType=[],this.enumType=[],this.service=[],this.extension=[],p.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 p.util.equals(se,e,n)}}se.runtime=p,se.typeName="google.protobuf.FileDescriptorProto",se.fields=p.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:p.getEnumType(Z),opt:!0}]);class oe extends E{constructor(e){super(),this.field=[],this.extension=[],this.nestedType=[],this.enumType=[],this.extensionRange=[],this.oneofDecl=[],this.reservedRange=[],this.reservedName=[],p.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 p.util.equals(oe,e,n)}}oe.runtime=p,oe.typeName="google.protobuf.DescriptorProto",oe.fields=p.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:pe,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 pe extends E{constructor(e){super(),p.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 p.util.equals(pe,e,n)}}pe.runtime=p,pe.typeName="google.protobuf.DescriptorProto.ExtensionRange",pe.fields=p.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 E{constructor(e){super(),p.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 p.util.equals(ge,e,n)}}ge.runtime=p,ge.typeName="google.protobuf.DescriptorProto.ReservedRange",ge.fields=p.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 E{constructor(e){super(),this.uninterpretedOption=[],this.declaration=[],p.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 p.util.equals(Te,e,n)}}Te.runtime=p,Te.typeName="google.protobuf.ExtensionRangeOptions",Te.fields=p.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:p.getEnumType(gn),opt:!0,default:gn.UNVERIFIED}]);var gn;(function(a){a[a.DECLARATION=0]="DECLARATION",a[a.UNVERIFIED=1]="UNVERIFIED"})(gn||(gn={})),p.util.setEnumType(gn,"google.protobuf.ExtensionRangeOptions.VerificationState",[{no:0,name:"DECLARATION"},{no:1,name:"UNVERIFIED"}]);class ke extends E{constructor(e){super(),p.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 p.util.equals(ke,e,n)}}ke.runtime=p,ke.typeName="google.protobuf.ExtensionRangeOptions.Declaration",ke.fields=p.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 E{constructor(e){super(),p.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 p.util.equals(ee,e,n)}}ee.runtime=p,ee.typeName="google.protobuf.FieldDescriptorProto",ee.fields=p.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:p.getEnumType($n),opt:!0},{no:5,name:"type",kind:"enum",T:p.getEnumType(Yn),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 Yn;(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"})(Yn||(Yn={})),p.util.setEnumType(Yn,"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 $n;(function(a){a[a.OPTIONAL=1]="OPTIONAL",a[a.REPEATED=3]="REPEATED",a[a.REQUIRED=2]="REQUIRED"})($n||($n={})),p.util.setEnumType($n,"google.protobuf.FieldDescriptorProto.Label",[{no:1,name:"LABEL_OPTIONAL"},{no:3,name:"LABEL_REPEATED"},{no:2,name:"LABEL_REQUIRED"}]);class ye extends E{constructor(e){super(),p.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 p.util.equals(ye,e,n)}}ye.runtime=p,ye.typeName="google.protobuf.OneofDescriptorProto",ye.fields=p.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 E{constructor(e){super(),this.value=[],this.reservedRange=[],this.reservedName=[],p.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 p.util.equals(ie,e,n)}}ie.runtime=p,ie.typeName="google.protobuf.EnumDescriptorProto",ie.fields=p.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:we,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 E{constructor(e){super(),p.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 p.util.equals(ve,e,n)}}ve.runtime=p,ve.typeName="google.protobuf.EnumDescriptorProto.EnumReservedRange",ve.fields=p.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 E{constructor(e){super(),p.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 p.util.equals(he,e,n)}}he.runtime=p,he.typeName="google.protobuf.EnumValueDescriptorProto",he.fields=p.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:Ee,opt:!0}]);class fe extends E{constructor(e){super(),this.method=[],p.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 p.util.equals(fe,e,n)}}fe.runtime=p,fe.typeName="google.protobuf.ServiceDescriptorProto",fe.fields=p.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 E{constructor(e){super(),p.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 p.util.equals(Re,e,n)}}Re.runtime=p,Re.typeName="google.protobuf.MethodDescriptorProto",Re.fields=p.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 E{constructor(e){super(),this.uninterpretedOption=[],p.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 p.util.equals(_e,e,n)}}_e.runtime=p,_e.typeName="google.protobuf.FileOptions",_e.fields=p.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:p.getEnumType(Tn),opt:!0,default:Tn.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 Tn;(function(a){a[a.SPEED=1]="SPEED",a[a.CODE_SIZE=2]="CODE_SIZE",a[a.LITE_RUNTIME=3]="LITE_RUNTIME"})(Tn||(Tn={})),p.util.setEnumType(Tn,"google.protobuf.FileOptions.OptimizeMode",[{no:1,name:"SPEED"},{no:2,name:"CODE_SIZE"},{no:3,name:"LITE_RUNTIME"}]);class Se extends E{constructor(e){super(),this.uninterpretedOption=[],p.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 p.util.equals(Se,e,n)}}Se.runtime=p,Se.typeName="google.protobuf.MessageOptions",Se.fields=p.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 E{constructor(e){super(),this.targets=[],this.editionDefaults=[],this.uninterpretedOption=[],p.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 p.util.equals(Ie,e,n)}}Ie.runtime=p,Ie.typeName="google.protobuf.FieldOptions",Ie.fields=p.util.newFieldList(()=>[{no:1,name:"ctype",kind:"enum",T:p.getEnumType(kn),opt:!0,default:kn.STRING},{no:2,name:"packed",kind:"scalar",T:8,opt:!0},{no:6,name:"jstype",kind:"enum",T:p.getEnumType(yn),opt:!0,default:yn.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:p.getEnumType(Vn),opt:!0},{no:19,name:"targets",kind:"enum",T:p.getEnumType(Wn),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 kn;(function(a){a[a.STRING=0]="STRING",a[a.CORD=1]="CORD",a[a.STRING_PIECE=2]="STRING_PIECE"})(kn||(kn={})),p.util.setEnumType(kn,"google.protobuf.FieldOptions.CType",[{no:0,name:"STRING"},{no:1,name:"CORD"},{no:2,name:"STRING_PIECE"}]);var yn;(function(a){a[a.JS_NORMAL=0]="JS_NORMAL",a[a.JS_STRING=1]="JS_STRING",a[a.JS_NUMBER=2]="JS_NUMBER"})(yn||(yn={})),p.util.setEnumType(yn,"google.protobuf.FieldOptions.JSType",[{no:0,name:"JS_NORMAL"},{no:1,name:"JS_STRING"},{no:2,name:"JS_NUMBER"}]);var Vn;(function(a){a[a.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",a[a.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",a[a.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(Vn||(Vn={})),p.util.setEnumType(Vn,"google.protobuf.FieldOptions.OptionRetention",[{no:0,name:"RETENTION_UNKNOWN"},{no:1,name:"RETENTION_RUNTIME"},{no:2,name:"RETENTION_SOURCE"}]);var Wn;(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"})(Wn||(Wn={})),p.util.setEnumType(Wn,"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 E{constructor(e){super(),p.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 p.util.equals(Me,e,n)}}Me.runtime=p,Me.typeName="google.protobuf.FieldOptions.EditionDefault",Me.fields=p.util.newFieldList(()=>[{no:3,name:"edition",kind:"enum",T:p.getEnumType(Z),opt:!0},{no:2,name:"value",kind:"scalar",T:9,opt:!0}]);class re extends E{constructor(e){super(),p.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 p.util.equals(re,e,n)}}re.runtime=p,re.typeName="google.protobuf.FieldOptions.FeatureSupport",re.fields=p.util.newFieldList(()=>[{no:1,name:"edition_introduced",kind:"enum",T:p.getEnumType(Z),opt:!0},{no:2,name:"edition_deprecated",kind:"enum",T:p.getEnumType(Z),opt:!0},{no:3,name:"deprecation_warning",kind:"scalar",T:9,opt:!0},{no:4,name:"edition_removed",kind:"enum",T:p.getEnumType(Z),opt:!0}]);class be extends E{constructor(e){super(),this.uninterpretedOption=[],p.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 p.util.equals(be,e,n)}}be.runtime=p,be.typeName="google.protobuf.OneofOptions",be.fields=p.util.newFieldList(()=>[{no:1,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);class we extends E{constructor(e){super(),this.uninterpretedOption=[],p.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 p.util.equals(we,e,n)}}we.runtime=p,we.typeName="google.protobuf.EnumOptions",we.fields=p.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 Ee extends E{constructor(e){super(),this.uninterpretedOption=[],p.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 p.util.equals(Ee,e,n)}}Ee.runtime=p,Ee.typeName="google.protobuf.EnumValueOptions",Ee.fields=p.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 E{constructor(e){super(),this.uninterpretedOption=[],p.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 p.util.equals(Oe,e,n)}}Oe.runtime=p,Oe.typeName="google.protobuf.ServiceOptions",Oe.fields=p.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 E{constructor(e){super(),this.uninterpretedOption=[],p.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 p.util.equals(me,e,n)}}me.runtime=p,me.typeName="google.protobuf.MethodOptions",me.fields=p.util.newFieldList(()=>[{no:33,name:"deprecated",kind:"scalar",T:8,opt:!0,default:!1},{no:34,name:"idempotency_level",kind:"enum",T:p.getEnumType(vn),opt:!0,default:vn.IDEMPOTENCY_UNKNOWN},{no:35,name:"features",kind:"message",T:z,opt:!0},{no:999,name:"uninterpreted_option",kind:"message",T:W,repeated:!0}]);var vn;(function(a){a[a.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",a[a.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",a[a.IDEMPOTENT=2]="IDEMPOTENT"})(vn||(vn={})),p.util.setEnumType(vn,"google.protobuf.MethodOptions.IdempotencyLevel",[{no:0,name:"IDEMPOTENCY_UNKNOWN"},{no:1,name:"NO_SIDE_EFFECTS"},{no:2,name:"IDEMPOTENT"}]);class W extends E{constructor(e){super(),this.name=[],p.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 p.util.equals(W,e,n)}}W.runtime=p,W.typeName="google.protobuf.UninterpretedOption",W.fields=p.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 E{constructor(e){super(),p.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 p.util.equals(Ce,e,n)}}Ce.runtime=p,Ce.typeName="google.protobuf.UninterpretedOption.NamePart",Ce.fields=p.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 E{constructor(e){super(),p.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 p.util.equals(z,e,n)}}z.runtime=p,z.typeName="google.protobuf.FeatureSet",z.fields=p.util.newFieldList(()=>[{no:1,name:"field_presence",kind:"enum",T:p.getEnumType(jn),opt:!0},{no:2,name:"enum_type",kind:"enum",T:p.getEnumType(Hn),opt:!0},{no:3,name:"repeated_field_encoding",kind:"enum",T:p.getEnumType(Kn),opt:!0},{no:4,name:"utf8_validation",kind:"enum",T:p.getEnumType(Xn),opt:!0},{no:5,name:"message_encoding",kind:"enum",T:p.getEnumType(Qn),opt:!0},{no:6,name:"json_format",kind:"enum",T:p.getEnumType(Zn),opt:!0}]);var jn;(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"})(jn||(jn={})),p.util.setEnumType(jn,"google.protobuf.FeatureSet.FieldPresence",[{no:0,name:"FIELD_PRESENCE_UNKNOWN"},{no:1,name:"EXPLICIT"},{no:2,name:"IMPLICIT"},{no:3,name:"LEGACY_REQUIRED"}]);var Hn;(function(a){a[a.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",a[a.OPEN=1]="OPEN",a[a.CLOSED=2]="CLOSED"})(Hn||(Hn={})),p.util.setEnumType(Hn,"google.protobuf.FeatureSet.EnumType",[{no:0,name:"ENUM_TYPE_UNKNOWN"},{no:1,name:"OPEN"},{no:2,name:"CLOSED"}]);var Kn;(function(a){a[a.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",a[a.PACKED=1]="PACKED",a[a.EXPANDED=2]="EXPANDED"})(Kn||(Kn={})),p.util.setEnumType(Kn,"google.protobuf.FeatureSet.RepeatedFieldEncoding",[{no:0,name:"REPEATED_FIELD_ENCODING_UNKNOWN"},{no:1,name:"PACKED"},{no:2,name:"EXPANDED"}]);var Xn;(function(a){a[a.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",a[a.VERIFY=2]="VERIFY",a[a.NONE=3]="NONE"})(Xn||(Xn={})),p.util.setEnumType(Xn,"google.protobuf.FeatureSet.Utf8Validation",[{no:0,name:"UTF8_VALIDATION_UNKNOWN"},{no:2,name:"VERIFY"},{no:3,name:"NONE"}]);var Qn;(function(a){a[a.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",a[a.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",a[a.DELIMITED=2]="DELIMITED"})(Qn||(Qn={})),p.util.setEnumType(Qn,"google.protobuf.FeatureSet.MessageEncoding",[{no:0,name:"MESSAGE_ENCODING_UNKNOWN"},{no:1,name:"LENGTH_PREFIXED"},{no:2,name:"DELIMITED"}]);var Zn;(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"})(Zn||(Zn={})),p.util.setEnumType(Zn,"google.protobuf.FeatureSet.JsonFormat",[{no:0,name:"JSON_FORMAT_UNKNOWN"},{no:1,name:"ALLOW"},{no:2,name:"LEGACY_BEST_EFFORT"}]);class Fe extends E{constructor(e){super(),this.defaults=[],p.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 p.util.equals(Fe,e,n)}}Fe.runtime=p,Fe.typeName="google.protobuf.FeatureSetDefaults",Fe.fields=p.util.newFieldList(()=>[{no:1,name:"defaults",kind:"message",T:Ne,repeated:!0},{no:4,name:"minimum_edition",kind:"enum",T:p.getEnumType(Z),opt:!0},{no:5,name:"maximum_edition",kind:"enum",T:p.getEnumType(Z),opt:!0}]);class Ne extends E{constructor(e){super(),p.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 p.util.equals(Ne,e,n)}}Ne.runtime=p,Ne.typeName="google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault",Ne.fields=p.util.newFieldList(()=>[{no:3,name:"edition",kind:"enum",T:p.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 E{constructor(e){super(),this.location=[],p.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 p.util.equals(Pe,e,n)}}Pe.runtime=p,Pe.typeName="google.protobuf.SourceCodeInfo",Pe.fields=p.util.newFieldList(()=>[{no:1,name:"location",kind:"message",T:Ae,repeated:!0}]);class Ae extends E{constructor(e){super(),this.path=[],this.span=[],this.leadingDetachedComments=[],p.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 p.util.equals(Ae,e,n)}}Ae.runtime=p,Ae.typeName="google.protobuf.SourceCodeInfo.Location",Ae.fields=p.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 E{constructor(e){super(),this.annotation=[],p.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 p.util.equals(xe,e,n)}}xe.runtime=p,xe.typeName="google.protobuf.GeneratedCodeInfo",xe.fields=p.util.newFieldList(()=>[{no:1,name:"annotation",kind:"message",T:De,repeated:!0}]);class De extends E{constructor(e){super(),this.path=[],p.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 p.util.equals(De,e,n)}}De.runtime=p,De.typeName="google.protobuf.GeneratedCodeInfo.Annotation",De.fields=p.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:p.getEnumType(ea),opt:!0}]);var ea;(function(a){a[a.NONE=0]="NONE",a[a.SET=1]="SET",a[a.ALIAS=2]="ALIAS"})(ea||(ea={})),p.util.setEnumType(ea,"google.protobuf.GeneratedCodeInfo.Annotation.Semantic",[{no:0,name:"NONE"},{no:1,name:"SET"},{no:2,name:"ALIAS"}]);class S extends E{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 E{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 E{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 u=Object.assign({},e);delete u["@type"],c=r.fromJson(u,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 hn;(function(a){a[a.NULL_VALUE=0]="NULL_VALUE"})(hn||(hn={})),s.util.setEnumType(hn,"google.protobuf.NullValue",[{no:0,name:"NULL_VALUE"}]);class d extends E{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 d().fromBinary(e,n)}static fromJson(e,n){return new d().fromJson(e,n)}static fromJsonString(e,n){return new d().fromJsonString(e,n)}static equals(e,n){return s.util.equals(d,e,n)}}d.runtime=s,d.typeName="google.protobuf.Struct",d.fields=s.util.newFieldList(()=>[{no:1,name:"fields",kind:"map",K:9,V:{kind:"message",T:X}}]);class X extends E{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:hn.NULL_VALUE}:Array.isArray(e)?this.kind={case:"listValue",value:ce.fromJson(e)}:this.kind={case:"structValue",value:d.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(hn),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:d,oneof:"kind"},{no:6,name:"list_value",kind:"message",T:ce,oneof:"kind"}]);class ce extends E{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 Ci(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(vh(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 vh(a,e){return a.length?`[${Ci(e)}] ${a}`:`[${Ci(e)}]`}function hh(a,e,n){try{const t=Aa.dec(a);return e?e.fromBinary(t,n):t}catch(t){throw C.from(t,T.Code.DataLoss)}}function fh(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 Ni=1;function Pi(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 u=0;for(let l=1;l<5;l++)u=(u<<8)+n[l];i={flags:n[0],length:u}}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 Ai(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 Rh=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,u){r=a[i](r),o(c,u,r.done,r.value)})}}function o(i,r,c,u){Promise.resolve(u).then(function(l){i({value:l,done:c})},r)}},fn=function(a){return this instanceof fn?(this.v=a,this):new fn(a)},_h=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||u(_,O)})},M&&(o[_]=M(o[_])))}function u(_,M){try{l(t[_](M))}catch(O){I(i[0][3],O)}}function l(_){_.value instanceof fn?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){u("next",_)}function R(_){u("throw",_)}function I(_,M){_(M),i.shift(),i.length&&u(i[0][0],i[0][1])}},Sh=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:fn(a[o](r)),done:!1}:i?i(r):r}:i}};function Ih(){const a=[],e=[];let n,t,o,i=new Promise((u,l)=>{t=u,o=l}),r=!1;function c(){for(const u of a.splice(0,a.length))u({done:!0,value:void 0})}return{close(){r=!0,c()},async write(u){if(r)throw n??new Error("cannot write, WritableIterable already closed");const l=a.shift();if(l===void 0)e.push(u);else if(l({done:!1,value:u}),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 u=e.shift();if(u!==void 0)return Promise.resolve({done:!1,value:u});if(r)return Promise.resolve({done:!0,value:void 0});let l;const k=new Promise(R=>l=R);return a.push(l),k},throw(u){return n=u,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 Ua(a){return _h(this,arguments,function*(){yield fn(yield*Sh(Rh(a)))})}var Di=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,u){r=a[i](r),o(c,u,r.done,r.value)})}}function o(i,r,c,u){Promise.resolve(u).then(function(l){i({value:l,done:c})},r)}},an=function(a){return this instanceof an?(this.v=a,this):new an(a)},Mh=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:an(a[o](r)),done:!1}:i?i(r):r}:i}},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||u(_,O)})},M&&(o[_]=M(o[_])))}function u(_,M){try{l(t[_](M))}catch(O){I(i[0][3],O)}}function l(_){_.value instanceof an?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){u("next",_)}function R(_){u("throw",_)}function I(_,M){_(M),i.shift(),i.length&&u(i[0][0],i[0][1])}};function na(a,e){return fh(a,n=>{switch(n.kind){case m.Unary:return wh(e,a,n);case m.ServerStreaming:return Eh(e,a,n);case m.ClientStreaming:return Oh(e,a,n);case m.BiDiStreaming:return Ch(e,a,n);default:return null}})}function N(a,e){return na(a,e)}function wh(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 Eh(a,e,n){return function(t,o){return qi(a.stream(e,n,o?.signal,o?.timeoutMs,o?.headers,Ua([t]),o?.contextValues),o)}}function Oh(a,e,n){return async function(t,o){var i,r,c,u,l,k;const R=await a.stream(e,n,o?.signal,o?.timeoutMs,o?.headers,t,o?.contextValues);(l=o?.onHeader)===null||l===void 0||l.call(o,R.header);let I,_=0;try{for(var M=!0,O=Di(R.message),P;P=await O.next(),i=P.done,!i;M=!0)u=P.value,M=!1,I=u,_++}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 Ch(a,e,n){return function(t,o){return qi(a.stream(e,n,o?.signal,o?.timeoutMs,o?.headers,t,o?.contextValues),o)}}function qi(a,e){const n=function(){return bh(this,arguments,function*(){var t,o;const i=yield an(a);(t=e?.onHeader)===null||t===void 0||t.call(e,i.header),yield an(yield*Mh(Di(i.message))),(o=e?.onTrailer)===null||o===void 0||o.call(e,i.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function Nh(...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(Ui(this));for(const o of n)o.removeEventListener("abort",t)}return e}function Ph(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 Ui(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 aa(){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 Ga=128;function Gi(a){const e=new Headers,n=new TextDecoder().decode(a).split(`\r
3
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 Ah="Content-Type",Dh="Grpc-Timeout",tn="Grpc-Status",Li="Grpc-Message",qh="Grpc-Status-Details-Bin",Uh="X-User-Agent",Gh="X-Grpc-Web",Lh="application/grpc-web+proto",Bh="application/grpc-web+json";let ta=class Dn extends E{constructor(e){super(),this.code=0,this.message="",this.details=[],s.util.initPartial(e,this)}static fromBinary(e,n){return new Dn().fromBinary(e,n)}static fromJson(e,n){return new Dn().fromJson(e,n)}static fromJsonString(e,n){return new Dn().fromJsonString(e,n)}static equals(e,n){return s.util.equals(Dn,e,n)}};ta.runtime=s,ta.typeName="google.rpc.Status",ta.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 Fh="0";function Bi(a){var e;const n=a.get(qh);if(n!=null){const o=hh(n,ta);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(tn);if(t!=null){if(t===Fh)return;const o=parseInt(t,10);return o in T.Code?new C(decodeURIComponent((e=a.get(Li))!==null&&e!==void 0?e:""),o,a):new C(`invalid grpc-status: ${t}`,T.Code.Internal,a)}}function Fi(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 xi(a,e){return e instanceof a?e:new a(e)}function xh(a,e){function n(t){return t.done===!0?t:{done:t.done,value:xi(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 La(a,e,n,t){const o=e?zi(a.I,t):Yi(a.I,n);return{parse:(e?zi(a.O,t):Yi(a.O,n)).parse,serialize:o.serialize}}function zi(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 Yi(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 u=i.decode(c);return a.fromJsonString(u,r)}catch(u){throw C.from(u,T.Code.InvalidArgument)}},serialize(c){try{const u=c.toJsonString(r);return o.encode(u)}catch(u){throw C.from(u,T.Code.Internal)}}}}function $i(a){const e=Ji(a.next,a.interceptors),[n,t,o]=Wi(a),i=Object.assign(Object.assign({},a.req),{message:xi(a.req.method.I,a.req.message),signal:n});return e(i).then(r=>(o(),r),t)}function Vi(a){const e=Ji(a.next,a.interceptors),[n,t,o]=Wi(a),i=Object.assign(Object.assign({},a.req),{message:xh(a.req.method.I,a.req.message),signal:n});let r=!1;return n.addEventListener("abort",function(){var c,u;const l=a.req.message[Symbol.asyncIterator]();r||(c=l.throw)===null||c===void 0||c.call(l,this.reason).catch(()=>{}),(u=l.return)===null||u===void 0||u.call(l).catch(()=>{})}),e(i).then(c=>Object.assign(Object.assign({},c),{message:{[Symbol.asyncIterator](){const u=c.message[Symbol.asyncIterator]();return{next(){return u.next().then(l=>(l.done==!0&&(r=!0,o()),l),t)}}}}}),t)}function Wi(a){const{signal:e,cleanup:n}=Ph(a.timeoutMs),t=Nh(a.signal,e);return[t.signal,function(i){const r=C.from(e.aborted?Ui(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:{},ji={},Ba={},sa=H&&H.__assign||function(){return sa=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},sa.apply(this,arguments)};Object.defineProperty(Ba,"__esModule",{value:!0});var zh={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Yh(a){var e=sa(sa({},zh),a);return e.numOfAttempts<1&&(e.numOfAttempts=1),e}Ba.getSanitizedOptions=Yh;var Fa={},xa={},oa={},Ja={},za={};Object.defineProperty(za,"__esModule",{value:!0});function $h(a){var e=Math.random()*a;return Math.round(e)}za.fullJitter=$h;var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0});function Vh(a){return a}Ya.noJitter=Vh,Object.defineProperty(Ja,"__esModule",{value:!0});var Wh=za,jh=Ya;function Hh(a){switch(a.jitter){case"full":return Wh.fullJitter;case"none":default:return jh.noJitter}}Ja.JitterFactory=Hh,Object.defineProperty(oa,"__esModule",{value:!0});var Kh=Ja,Xh=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=Kh.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}();oa.Delay=Xh;var Qh=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)}}(),Zh=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{l(t.next(k))}catch(R){r(R)}}function u(k){try{l(t.throw(k))}catch(R){r(R)}}function l(k){k.done?i(k.value):o(k.value).then(c,u)}l((t=t.apply(a,e||[])).next())})},ef=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(l){return function(k){return u([l,k])}}function u(l){if(t)throw new TypeError("Generator is already executing.");for(;n;)try{if(t=1,o&&(i=l[0]&2?o.return:l[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,l[1])).done)return i;switch(o=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1],i=l;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(l);break}i[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(a,n)}catch(k){l=[6,k],o=0}finally{t=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(xa,"__esModule",{value:!0});var nf=oa,af=function(a){Qh(e,a);function e(){return a!==null&&a.apply(this,arguments)||this}return e.prototype.apply=function(){return Zh(this,void 0,void 0,function(){return ef(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}(nf.Delay);xa.SkipFirstDelay=af;var $a={},tf=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($a,"__esModule",{value:!0});var sf=oa,of=function(a){tf(e,a);function e(){return a!==null&&a.apply(this,arguments)||this}return e}(sf.Delay);$a.AlwaysDelay=of,Object.defineProperty(Fa,"__esModule",{value:!0});var rf=xa,mf=$a;function cf(a,e){var n=df(a);return n.setAttemptNumber(e),n}Fa.DelayFactory=cf;function df(a){return a.delayFirstAttempt?new mf.AlwaysDelay(a):new rf.SkipFirstDelay(a)}var Va=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{l(t.next(k))}catch(R){r(R)}}function u(k){try{l(t.throw(k))}catch(R){r(R)}}function l(k){k.done?i(k.value):o(k.value).then(c,u)}l((t=t.apply(a,e||[])).next())})},Wa=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(l){return function(k){return u([l,k])}}function u(l){if(t)throw new TypeError("Generator is already executing.");for(;n;)try{if(t=1,o&&(i=l[0]&2?o.return:l[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,l[1])).done)return i;switch(o=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1],i=l;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(l);break}i[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(a,n)}catch(k){l=[6,k],o=0}finally{t=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(ji,"__esModule",{value:!0});var lf=Ba,uf=Fa;function pf(a,e){return e===void 0&&(e={}),Va(this,void 0,void 0,function(){var n,t;return Wa(this,function(o){switch(o.label){case 0:return n=lf.getSanitizedOptions(e),t=new gf(a,n),[4,t.execute()];case 1:return[2,o.sent()]}})})}var ja=ji.backOff=pf,gf=function(){function a(e,n){this.request=e,this.options=n,this.attemptNumber=0}return a.prototype.execute=function(){return Va(this,void 0,void 0,function(){var e,n;return Wa(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 Va(this,void 0,void 0,function(){var e;return Wa(this,function(n){switch(n.label){case 0:return e=uf.DelayFactory(this.options,this.attemptNumber),[4,e.apply()];case 1:return n.sent(),[2]}})})},a}();const Hi=s.makeMessageType("proto.rpc.v1.Credentials",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9}]),Ha=s.makeMessageType("proto.rpc.v1.AuthenticateRequest",()=>[{no:1,name:"entity",kind:"scalar",T:9},{no:2,name:"credentials",kind:"message",T:Hi}]),Tf=s.makeMessageType("proto.rpc.v1.AuthenticateResponse",()=>[{no:1,name:"access_token",kind:"scalar",T:9}]),kf=s.makeMessageType("proto.rpc.v1.AuthenticateToRequest",()=>[{no:1,name:"entity",kind:"scalar",T:9}]),yf=s.makeMessageType("proto.rpc.v1.AuthenticateToResponse",()=>[{no:1,name:"access_token",kind:"scalar",T:9}]),vf={typeName:"proto.rpc.v1.AuthService",methods:{authenticate:{name:"Authenticate",I:Ha,O:Tf,kind:m.Unary}}},hf={typeName:"proto.rpc.v1.ExternalAuthService",methods:{authenticateTo:{name:"AuthenticateTo",I:kf,O:yf,kind:m.Unary}}},sn=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}]),Rn=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}]),Ki=s.makeMessageType("proto.rpc.webrtc.v1.CallRequest",()=>[{no:1,name:"sdp",kind:"scalar",T:9},{no:2,name:"disable_trickle",kind:"scalar",T:8}]),ff=s.makeMessageType("proto.rpc.webrtc.v1.CallResponseInitStage",()=>[{no:1,name:"sdp",kind:"scalar",T:9}]),Rf=s.makeMessageType("proto.rpc.webrtc.v1.CallResponseUpdateStage",()=>[{no:1,name:"candidate",kind:"message",T:Rn}]),_f=s.makeMessageType("proto.rpc.webrtc.v1.CallResponse",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"init",kind:"message",T:ff,oneof:"stage"},{no:3,name:"update",kind:"message",T:Rf,oneof:"stage"}]),ia=s.makeMessageType("proto.rpc.webrtc.v1.CallUpdateRequest",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"candidate",kind:"message",T:Rn,oneof:"update"},{no:3,name:"done",kind:"scalar",T:8,oneof:"update"},{no:4,name:"error",kind:"message",T:sn,oneof:"update"}]),Sf=s.makeMessageType("proto.rpc.webrtc.v1.CallUpdateResponse",[]),If=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}]),ra=s.makeMessageType("proto.rpc.webrtc.v1.WebRTCConfig",()=>[{no:1,name:"additional_ice_servers",kind:"message",T:If,repeated:!0},{no:2,name:"disable_trickle",kind:"scalar",T:8}]),Mf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestInitStage",()=>[{no:1,name:"sdp",kind:"scalar",T:9},{no:2,name:"optional_config",kind:"message",T:ra},{no:3,name:"deadline",kind:"message",T:S,opt:!0}]),bf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestUpdateStage",()=>[{no:1,name:"candidate",kind:"message",T:Rn}]),wf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestDoneStage",[]),Ef=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestErrorStage",()=>[{no:1,name:"status",kind:"message",T:sn}]),Of=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequestHeartbeatStage",[]),Cf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerRequest",()=>[{no:1,name:"uuid",kind:"scalar",T:9},{no:2,name:"init",kind:"message",T:Mf,oneof:"stage"},{no:3,name:"update",kind:"message",T:bf,oneof:"stage"},{no:4,name:"done",kind:"message",T:wf,oneof:"stage"},{no:5,name:"error",kind:"message",T:Ef,oneof:"stage"},{no:6,name:"heartbeat",kind:"message",T:Of,oneof:"stage"}]),Nf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseInitStage",()=>[{no:1,name:"sdp",kind:"scalar",T:9}]),Pf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseUpdateStage",()=>[{no:1,name:"candidate",kind:"message",T:Rn}]),Af=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseDoneStage",[]),Df=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponseErrorStage",()=>[{no:1,name:"status",kind:"message",T:sn}]),qf=s.makeMessageType("proto.rpc.webrtc.v1.AnswerResponse",()=>[{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:Af,oneof:"stage"},{no:5,name:"error",kind:"message",T:Df,oneof:"stage"}]),Uf=s.makeMessageType("proto.rpc.webrtc.v1.OptionalWebRTCConfigRequest",[]),Gf=s.makeMessageType("proto.rpc.webrtc.v1.OptionalWebRTCConfigResponse",()=>[{no:1,name:"config",kind:"message",T:ra}]),Xi={typeName:"proto.rpc.webrtc.v1.SignalingService",methods:{call:{name:"Call",I:Ki,O:_f,kind:m.ServerStreaming},callUpdate:{name:"CallUpdate",I:ia,O:Sf,kind:m.Unary},answer:{name:"Answer",I:qf,O:Cf,kind:m.BiDiStreaming},optionalWebRTCConfig:{name:"OptionalWebRTCConfig",I:Uf,O:Gf,kind:m.Unary}}},Qi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ka=(a="")=>{const e=a;let n="";for(let t=0,o,i=0,r=Qi;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},Zi=(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=Qi.indexOf(i);return n},Xa=(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},Lf=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 u=o.createDataChannel("negotiation",{id:1,negotiated:!0,ordered:!0});u.binaryType="arraybuffer";let l=!1;if(u.addEventListener("open",()=>{l=!0}),u.addEventListener("message",R=>{(async()=>{const I=new RTCSessionDescription(JSON.parse(Zi(R.data)));if(await o.setRemoteDescription(I),I.type==="offer"){await o.setLocalDescription();const _=Xa(o.localDescription,n);u.send(Ka(JSON.stringify(_)))}})().catch(console.error)}),o.addEventListener("negotiationneeded",()=>{(async()=>{if(!l)return;await o.setLocalDescription();const R=Xa(o.localDescription,n);u.send(Ka(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 Bf(){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 er(a,e){const n=Bi(a);if(n)throw e.forEach((t,o)=>{n.metadata.append(o,t)}),n;if(!e.has(tn)&&!a.has(tn))throw new C("protocol error: missing status",T.Code.Internal)}function nr(a,e,n,t){const o=new Headers(n??{});return o.set(Ah,a?Lh:Bh),o.set(Gh,"1"),o.set(Uh,"connect-es/1.6.1"),e!==void 0&&o.set(Dh,`${e}m`),o}function Ff(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 ar(a,e){var n;if(a>=200&&a<300)return{foundStatus:e.has(tn),headerError:Bi(e)};throw new C(decodeURIComponent((n=e.get(Li))!==null&&n!==void 0?n:`HTTP ${a}`),Ff(a),e)}var je=function(a){return this instanceof je?(this.v=a,this):new je(a)},xf=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||u(_,O)})},M&&(o[_]=M(o[_])))}function u(_,M){try{l(t[_](M))}catch(O){I(i[0][3],O)}}function l(_){_.value instanceof je?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){u("next",_)}function R(_){u("throw",_)}function I(_,M){_(M),i.shift(),i.length&&u(i[0][0],i[0][1])}};function Jf(a){var e;Bf();const n=(e=a.useBinaryFormat)!==null&&e!==void 0?e:!0;return{async unary(t,o,i,r,c,u,l){var k;const{serialize:R,parse:I}=La(o,n,a.jsonOptions,a.binaryOptions);return r=r===void 0?a.defaultTimeoutMs:r<=0?void 0:r,await $i({interceptors:a.interceptors,signal:i,timeoutMs:r,req:{stream:!1,service:t,method:o,url:Fi(a.baseUrl,t,o),init:{method:"POST",credentials:(k=a.credentials)!==null&&k!==void 0?k:"same-origin",redirect:"error",mode:"cors"},header:nr(n,r,c),contextValues:l??aa(),message:u},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:Ai(0,R(_.message))})),{headerError:Y}=ar(P.status,P.headers);if(!P.body)throw Y!==void 0?Y:"missing response body";const y=Pi(P.body).getReader();let h,g;for(;;){const v=await y.read();if(v.done)break;const{flags:w,data:b}=v.value;if((w&Ni)===Ni)throw new C("protocol error: received unsupported compressed output",T.Code.Internal);if(w===Ga){if(h!==void 0)throw"extra trailer";h=Gi(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(tn)?T.Code.Unimplemented:T.Code.Unknown);if(er(h,P.headers),g===void 0)throw new C("missing message",h.has(tn)?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,u,l){var k;const{serialize:R,parse:I}=La(o,n,a.jsonOptions,a.binaryOptions);function _(O,P,Y,y,h){return xf(this,arguments,function*(){const v=Pi(O).getReader();if(P){if(!(yield je(v.read())).done)throw"extra data for trailers-only";return yield je(void 0)}let w=!1;for(;;){const b=yield je(v.read());if(b.done)break;const{flags:ae,data:U}=b.value;if((ae&Ga)===Ga){if(w)throw"extra trailer";w=!0;const $=Gi(U);er($,y),$.forEach((Wo,jo)=>Y.set(jo,Wo));continue}if(w)throw"extra message";yield yield je(I(U))}if("throwIfAborted"in h&&h.throwIfAborted(),!w)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 Ai(0,R(P.value))}return r=r===void 0?a.defaultTimeoutMs:r<=0?void 0:r,Vi({interceptors:a.interceptors,signal:i,timeoutMs:r,req:{stream:!0,service:t,method:o,url:Fi(a.baseUrl,t,o),init:{method:"POST",credentials:(k=a.credentials)!==null&&k!==void 0?k:"same-origin",redirect:"error",mode:"cors"},header:nr(n,r,c),contextValues:l??aa(),message:u},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}=ar(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 ma=s.makeMessageType("proto.rpc.webrtc.v1.PacketMessage",()=>[{no:1,name:"data",kind:"scalar",T:12},{no:2,name:"eom",kind:"scalar",T:8}]),Qa=s.makeMessageType("proto.rpc.webrtc.v1.Stream",()=>[{no:1,name:"id",kind:"scalar",T:4}]),Za=s.makeMessageType("proto.rpc.webrtc.v1.Request",()=>[{no:1,name:"stream",kind:"message",T:Qa},{no:2,name:"headers",kind:"message",T:tr,oneof:"type"},{no:3,name:"message",kind:"message",T:et,oneof:"type"},{no:4,name:"rst_stream",kind:"scalar",T:8,oneof:"type"}]),tr=s.makeMessageType("proto.rpc.webrtc.v1.RequestHeaders",()=>[{no:1,name:"method",kind:"scalar",T:9},{no:2,name:"metadata",kind:"message",T:ca},{no:3,name:"timeout",kind:"message",T:F}]),et=s.makeMessageType("proto.rpc.webrtc.v1.RequestMessage",()=>[{no:1,name:"has_message",kind:"scalar",T:8},{no:2,name:"packet_message",kind:"message",T:ma},{no:3,name:"eos",kind:"scalar",T:8}]),zf=s.makeMessageType("proto.rpc.webrtc.v1.Response",()=>[{no:1,name:"stream",kind:"message",T:Qa},{no:2,name:"headers",kind:"message",T:Yf,oneof:"type"},{no:3,name:"message",kind:"message",T:$f,oneof:"type"},{no:4,name:"trailers",kind:"message",T:Vf,oneof:"type"}]),Yf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseHeaders",()=>[{no:1,name:"metadata",kind:"message",T:ca}]),$f=s.makeMessageType("proto.rpc.webrtc.v1.ResponseMessage",()=>[{no:1,name:"packet_message",kind:"message",T:ma}]),Vf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseTrailers",()=>[{no:1,name:"status",kind:"message",T:sn},{no:2,name:"metadata",kind:"message",T:ca}]),sr=s.makeMessageType("proto.rpc.webrtc.v1.Strings",()=>[{no:1,name:"values",kind:"scalar",T:9,repeated:!0}]),ca=s.makeMessageType("proto.rpc.webrtc.v1.Metadata",()=>[{no:1,name:"md",kind:"map",K:9,V:{kind:"message",T:sr}}]);class de extends Error{name="ConnectionClosedError";constructor(e){super(e),Object.setPrototypeOf(this,de.prototype)}static isError(e){return e instanceof de||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 Wf{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 de("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 or=33554432;class jf{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>or){this.packetBuf.length=0,this.packetBufSize=0,console.error(`message size larger than max ${or}; 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 Hf=16373;class ir extends jf{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}=La(i,!0,void 0,void 0);this.parseMessage=c;const u=`/${o.typeName}/${i.name}`;this.requestHeaders=new tr({method:u});const l=Kf(Sn(r));l&&(this.requestHeaders.metadata=l)}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 ma({eom:!0}),i=new et({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,Hf),i=new ma;i.data=t.slice(0,o),t=t.slice(o),t.length===0&&(i.eom=!0);const r=new et({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 Kf=a=>{if(!a)return;const e=new ca({md:Object.fromEntries([...a.entries()].map(([n,t])=>[n,new sr({values:[t]})]))});return Object.keys(e.md).length>0?e:void 0},nt=a=>{const e=Object.entries(a?.md??{}).flatMap(([n,{values:t}])=>t.map(o=>[n,o]));return new Headers(e)};class Xf extends ir{awaitingHeadersResult;gotHeaders=!1;respStream=Ih();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??aa(),message:t},next:async c=>{const l=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:l,trailer:this.trailers,message:this.respStream}}};return e&&(r.signal=e),n!==void 0&&(r.timeoutMs=n),Vi(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(nt(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 Qf extends ir{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??aa(),message:t},next:async c=>new Promise((u,l)=>{this.result={success:u,failure:l},this.startRequest(),this.sendMessage(c.message.toBinary())})};return e&&(r.signal=e),n!==void 0&&(r.timeoutMs=n),$i(r)}onHeaders(e){if(this.headers!==void 0){this.result?.failure(new Error("invariant: received headers more than once"));return}this.headers=nt(e.metadata)}onTrailers(e){const n=nt(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 Zf=256;class eR extends Wf{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 de("data channel closed"));for(const e of this.streams.values())e.cs.closeWithRecvError()}onChannelMessage(e){const n=zf.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 Qa({id:BigInt(e)})}newStream(e,n,t,o,i){if(this.isClosed())throw new de("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>Zf)throw new Error("stream limit hit");const c=new e(this,n,u=>this.removeStreamByID(u),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 Za({stream:e,type:{case:"headers",value:n}}))}writeMessage(e,n){this.write(new Za({stream:e,type:{case:"message",value:n}}))}writeReset(e){this.write(new Za({stream:e,type:{case:"rstStream",value:!0}}))}async unary(e,n,t,o,i,r,c){return this.newStream(Qf,this.nextStreamID(),e,n,i).run(t,o,r,c)}async stream(e,n,t,o,i,r,c){return this.newStream(Xf,this.nextStreamID(),e,n,i).run(t,o,r,c)}}const at="invariant: call uuid unset";class nR{constructor(e,n,t,o,i){this.signalingClient=e,this.callOpts=n,this.pc=t,this.dc=o,this.dialOpts=i,this.clientChannel=new eR(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=Xa(this.pc.localDescription,this.dialOpts?.additionalSdpFields),n=Ka(JSON.stringify(e)),t=new Ki({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 de("failed to dial");if(this.clientChannel.isClosed())throw new de("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(Zi(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=aR(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(at);e.candidate.candidate!==void 0&&console.debug(`gathered local ICE ${e.candidate.candidate}`);const n=tR(e.candidate),t=new ia({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(at);this.sentDoneOrErrorOnce=!0;const n=new ia({uuid:this.callUuid,update:{case:"error",value:new sn({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(at);this.sentDoneOrErrorOnce=!0;const e=new ia({uuid:this.callUuid,update:{case:"done",value:!0}});try{await this.signalingClient.callUpdate(e,this.callOpts)}catch(n){console.error(n)}}}const aR=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},tR=a=>{const e=new Rn;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},_n=async(a,e)=>{mr(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 rr(t,n,o)}return e===void 0||e.credentials===void 0&&e.accessToken===void 0?n(t):sR(a,n,e,t)},tt=/^.*:\/\//u,sR=async(a,e,n,t)=>{const o=new Headers(n.extraHeaders);let i;if(n.accessToken===void 0||n.accessToken===""){const r=new Ha({entity:Mn(n.credentials)&&n.credentials.authEntity?n.credentials.authEntity:a.replace(tt,"")});n.credentials&&(r.credentials=new Hi({type:n.credentials.type,payload:n.credentials.payload}));const c=n.externalAuthAddress??a,u=e({baseUrl:c});i=(await N(vf,u).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 Ha({entity:n.externalAuthToEntity}),u=e({baseUrl:n.externalAuthAddress});i=(await N(hf,u).authenticateTo(c,{headers:r})).accessToken}return o.set("authorization",`Bearer ${i}`),new rr(t,e,o)};class rr{transport;extraHeaders;constructor(e,n,t){this.extraHeaders=t,this.transport=n(e)}async unary(e,n,t,o,i,r,c){const u=Sn(i);for(const[l,k]of this.extraHeaders)u.set(l,k);return this.transport.unary(e,n,t,o,u,r,c)}async stream(e,n,t,o,i,r,c){const u=Sn(i);for(const[l,k]of this.extraHeaders)u.set(l,k);return this.transport.stream(e,n,t,o,u,r,c)}}const Sn=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},oR=async(a,e,n)=>{const t={...n},o=await _n(a,t),i=N(Xi,o);try{return(await i.optionalWebRTCConfig({},e)).config??new ra}catch(r){if(r instanceof C&&r.code===T.Code.Unimplemented)return new ra;throw r}},iR=async(a,e,n)=>{const t=a.replace(/\/$/u,"");mr(n);const o={headers:{"rpc-host":e}},i=await rR(t,o,n),r=mR(t,n),{pc:c,dc:u}=await Lf(i.disableTrickleICE,i.rtcConfig,i.additionalSdpFields);let l=!1,k;try{k=await _n(t,r)}catch(_){throw c.close(),_}const R=N(Xi,k),I=new nR(R,o,c,u,i);try{n?.dialTimeout!==void 0&&setTimeout(()=>{l||I.terminate(new Error("timed out"))},n.dialTimeout);const _=await I.doExchange();return n?.externalAuthAddress!==void 0&&n.externalAuthAddress!==""||n?.credentials?.type,l=!0,{transport:_,peerConnection:c,dataChannel:u}}catch(_){throw console.error("error dialing",_),_}finally{l||c.close()}},rR=async(a,e,n)=>{const t=await oR(a,e,n),o=t.additionalIceServers.map(c=>({urls:c.urls,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},mR=(a,e)=>{let n=e;return n={...e},e.accessToken===void 0&&(Mn(n.credentials)&&!n.credentials.authEntity&&(n.credentials.authEntity=n.externalAuthAddress!==void 0&&n.externalAuthAddress!==""?n.externalAuthAddress.replace(tt,""):a.replace(tt,"")),n.credentials=e.webrtcOptions?.signalingCredentials,n.accessToken=e.webrtcOptions?.signalingAccessToken),n.externalAuthAddress=e.webrtcOptions?.signalingExternalAuthAddress,n.externalAuthToEntity=e.webrtcOptions?.signalingExternalAuthToEntity,n},mr=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")}},cR="v0.1.428",cr=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}]),dr=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}]),on=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}]),lr=s.makeMessageType("viam.common.v1.Sphere",()=>[{no:1,name:"radius_mm",kind:"scalar",T:1}]),ur=s.makeMessageType("viam.common.v1.Capsule",()=>[{no:1,name:"radius_mm",kind:"scalar",T:1},{no:2,name:"length_mm",kind:"scalar",T:1}]),pr=s.makeMessageType("viam.common.v1.RectangularPrism",()=>[{no:1,name:"dims_mm",kind:"message",T:Ue}]),gr=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:lr,oneof:"geometry_type"},{no:3,name:"box",kind:"message",T:pr,oneof:"geometry_type"},{no:5,name:"capsule",kind:"message",T:ur,oneof:"geometry_type"},{no:6,name:"mesh",kind:"message",T:gr,oneof:"geometry_type"},{no:4,name:"label",kind:"scalar",T:9}]),st=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}]),ot=s.makeMessageType("viam.common.v1.PointCloudObject",()=>[{no:1,name:"point_cloud",kind:"scalar",T:12},{no:2,name:"geometries",kind:"message",T:st}]),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}]),rn=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:on},{no:3,name:"physical_object",kind:"message",T:He,opt:!0}]),Tr=s.makeMessageType("viam.common.v1.WorldState",()=>[{no:1,name:"obstacles",kind:"message",T:st,repeated:!0},{no:3,name:"transforms",kind:"message",T:rn,repeated:!0}]),dR=s.makeMessageType("viam.common.v1.ActuatorStatus",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),kr=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:d}]),G=s.makeMessageType("viam.common.v1.DoCommandResponse",()=>[{no:1,name:"result",kind:"message",T:d}]),yr=s.makeMessageType("viam.common.v1.GetKinematicsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),vr=s.makeMessageType("viam.common.v1.GetKinematicsResponse",()=>[{no:1,name:"format",kind:"enum",T:s.getEnumType(cr)},{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:d}]),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:d}]),la=s.makeMessageType("viam.common.v1.GetReadingsResponse",()=>[{no:1,name:"readings",kind:"map",K:9,V:{kind:"message",T:X}}]),In=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:d},{no:7,name:"stack",kind:"scalar",T:9},{no:8,name:"fields",kind:"message",T:d,repeated:!0}]),hr=s.makeExtension("viam.common.v1.safety_heartbeat_monitored",me,{no:84260,kind:"scalar",T:8,opt:!0}),it=Object.freeze(Object.defineProperty({__proto__:null,ActuatorStatus:dR,Capsule:ur,DoCommandRequest:q,DoCommandResponse:G,GeoGeometry:da,GeoPoint:Je,GeometriesInFrame:st,Geometry:He,GetGeometriesRequest:J,GetGeometriesResponse:K,GetKinematicsRequest:yr,GetKinematicsResponse:vr,GetReadingsRequest:Ke,GetReadingsResponse:la,KinematicsFileFormat:cr,LogEntry:In,Mesh:gr,Orientation:dr,PointCloudObject:ot,Pose:qe,PoseInFrame:on,RectangularPrism:pr,ResourceName:x,ResponseMetadata:kr,Sphere:lr,Transform:rn,Vector3:Ue,WorldState:Tr,safety_heartbeat_monitored:hr},Symbol.toStringTag,{value:"Module"})),rt=new Headers({"viam-client":`typescript;v0.40.1;${cR}`}),L=async function(e,n,t,o={},i={}){const r=new q({name:n,command:t});o.requestLogger?.(r);const u=(await e(r,i)).result?.toJson();return u===void 0?{}:u},lR=(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},uR=a=>{if(a.headers){const{_:e,...n}=a.headers;a.headers=n}},pR=(a,e,n)=>{const t=n??{headers:{}};return t.headers[a]=e,t},gR=(a,e)=>{const{[e]:n,...t}=a.headers;a.headers=t},Mn=a=>a!==void 0&&"authEntity"in a,TR=async(a,e)=>e.type==="access-token"?_n(a,{accessToken:e.payload,extraHeaders:rt}):_n(a,{credentials:e,extraHeaders:rt}),mt=5e3;var ne=(a=>(a.CONNECTING="connecting",a.CONNECTED="connected",a.DISCONNECTING="disconnecting",a.DISCONNECTED="disconnected",a))(ne||{});class fr{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 ct=s.makeMessageType("viam.component.arm.v1.GetEndPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Rr=s.makeMessageType("viam.component.arm.v1.GetEndPositionResponse",()=>[{no:1,name:"pose",kind:"message",T:qe}]),mn=s.makeMessageType("viam.component.arm.v1.JointPositions",()=>[{no:1,name:"values",kind:"scalar",T:1,repeated:!0}]),dt=s.makeMessageType("viam.component.arm.v1.GetJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),_r=s.makeMessageType("viam.component.arm.v1.GetJointPositionsResponse",()=>[{no:1,name:"positions",kind:"message",T:mn}]),lt=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:d}]),Sr=s.makeMessageType("viam.component.arm.v1.MoveToPositionResponse",[]),ut=s.makeMessageType("viam.component.arm.v1.MoveToJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions",kind:"message",T:mn},{no:99,name:"extra",kind:"message",T:d}]),Ir=s.makeMessageType("viam.component.arm.v1.MoveToJointPositionsResponse",[]),Mr=s.makeMessageType("viam.component.arm.v1.MoveThroughJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions",kind:"message",T:mn,repeated:!0},{no:3,name:"options",kind:"message",T:Or,opt:!0},{no:99,name:"extra",kind:"message",T:d}]),br=s.makeMessageType("viam.component.arm.v1.MoveThroughJointPositionsResponse",[]),pt=s.makeMessageType("viam.component.arm.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),wr=s.makeMessageType("viam.component.arm.v1.StopResponse",[]),kR=s.makeMessageType("viam.component.arm.v1.Status",()=>[{no:1,name:"end_position",kind:"message",T:qe},{no:2,name:"joint_positions",kind:"message",T:mn},{no:3,name:"is_moving",kind:"scalar",T:8}]),gt=s.makeMessageType("viam.component.arm.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Er=s.makeMessageType("viam.component.arm.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),Or=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}]),Cr=Object.freeze(Object.defineProperty({__proto__:null,GetEndPositionRequest:ct,GetEndPositionResponse:Rr,GetJointPositionsRequest:dt,GetJointPositionsResponse:_r,IsMovingRequest:gt,IsMovingResponse:Er,JointPositions:mn,MoveOptions:Or,MoveThroughJointPositionsRequest:Mr,MoveThroughJointPositionsResponse:br,MoveToJointPositionsRequest:ut,MoveToJointPositionsResponse:Ir,MoveToPositionRequest:lt,MoveToPositionResponse:Sr,Status:kR,StopRequest:pt,StopResponse:wr},Symbol.toStringTag,{value:"Module"})),Nr={typeName:"viam.component.arm.v1.ArmService",methods:{getEndPosition:{name:"GetEndPosition",I:ct,O:Rr,kind:m.Unary},moveToPosition:{name:"MoveToPosition",I:lt,O:Sr,kind:m.Unary},getJointPositions:{name:"GetJointPositions",I:dt,O:_r,kind:m.Unary},moveToJointPositions:{name:"MoveToJointPositions",I:ut,O:Ir,kind:m.Unary},moveThroughJointPositions:{name:"MoveThroughJointPositions",I:Mr,O:br,kind:m.Unary},stop:{name:"Stop",I:pt,O:wr,kind:m.Unary},isMoving:{name:"IsMoving",I:gt,O:Er,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getKinematics:{name:"GetKinematics",I:yr,O:vr,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Tt=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:d}]),Pr=s.makeMessageType("viam.component.base.v1.MoveStraightResponse",[]),kt=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:d}]),Ar=s.makeMessageType("viam.component.base.v1.SpinResponse",[]),yt=s.makeMessageType("viam.component.base.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Dr=s.makeMessageType("viam.component.base.v1.StopResponse",[]),vt=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:d}]),qr=s.makeMessageType("viam.component.base.v1.SetPowerResponse",[]),ht=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:d}]),Ur=s.makeMessageType("viam.component.base.v1.SetVelocityResponse",[]),ft=s.makeMessageType("viam.component.base.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Gr=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:d}]),Lr=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}]),Br=Object.freeze(Object.defineProperty({__proto__:null,GetPropertiesRequest:ua,GetPropertiesResponse:Lr,IsMovingRequest:ft,IsMovingResponse:Gr,MoveStraightRequest:Tt,MoveStraightResponse:Pr,SetPowerRequest:vt,SetPowerResponse:qr,SetVelocityRequest:ht,SetVelocityResponse:Ur,SpinRequest:kt,SpinResponse:Ar,StopRequest:yt,StopResponse:Dr},Symbol.toStringTag,{value:"Module"})),Fr={typeName:"viam.component.base.v1.BaseService",methods:{moveStraight:{name:"MoveStraight",I:Tt,O:Pr,kind:m.Unary},spin:{name:"Spin",I:kt,O:Ar,kind:m.Unary},setPower:{name:"SetPower",I:vt,O:qr,kind:m.Unary},setVelocity:{name:"SetVelocity",I:ht,O:Ur,kind:m.Unary},stop:{name:"Stop",I:yt,O:Dr,kind:m.Unary},isMoving:{name:"IsMoving",I:ft,O:Gr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary},getProperties:{name:"GetProperties",I:ua,O:Lr,kind:m.Unary}}},xr=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"}]),yR=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}}]),Rt=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:d}]),Jr=s.makeMessageType("viam.component.board.v1.SetGPIOResponse",[]),_t=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:d}]),zr=s.makeMessageType("viam.component.board.v1.GetGPIOResponse",()=>[{no:1,name:"high",kind:"scalar",T:8}]),St=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:d}]),Yr=s.makeMessageType("viam.component.board.v1.PWMResponse",()=>[{no:1,name:"duty_cycle_pct",kind:"scalar",T:1}]),It=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:d}]),$r=s.makeMessageType("viam.component.board.v1.SetPWMResponse",[]),Mt=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:d}]),Vr=s.makeMessageType("viam.component.board.v1.PWMFrequencyResponse",()=>[{no:1,name:"frequency_hz",kind:"scalar",T:4}]),bt=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:d}]),Wr=s.makeMessageType("viam.component.board.v1.SetPWMFrequencyResponse",[]),wt=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:d}]),jr=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}]),Et=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:d}]),Hr=s.makeMessageType("viam.component.board.v1.WriteAnalogResponse",[]),Ot=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:d}]),Kr=s.makeMessageType("viam.component.board.v1.GetDigitalInterruptValueResponse",()=>[{no:1,name:"value",kind:"scalar",T:3}]),Ct=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:d}]),Xr=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}]),Nt=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(xr)},{no:3,name:"duration",kind:"message",T:F,opt:!0},{no:99,name:"extra",kind:"message",T:d}]),Qr=s.makeMessageType("viam.component.board.v1.SetPowerModeResponse",[]),Zr=Object.freeze(Object.defineProperty({__proto__:null,GetDigitalInterruptValueRequest:Ot,GetDigitalInterruptValueResponse:Kr,GetGPIORequest:_t,GetGPIOResponse:zr,PWMFrequencyRequest:Mt,PWMFrequencyResponse:Vr,PWMRequest:St,PWMResponse:Yr,PowerMode:xr,ReadAnalogReaderRequest:wt,ReadAnalogReaderResponse:jr,SetGPIORequest:Rt,SetGPIOResponse:Jr,SetPWMFrequencyRequest:bt,SetPWMFrequencyResponse:Wr,SetPWMRequest:It,SetPWMResponse:$r,SetPowerModeRequest:Nt,SetPowerModeResponse:Qr,Status:yR,StreamTicksRequest:Ct,StreamTicksResponse:Xr,WriteAnalogRequest:Et,WriteAnalogResponse:Hr},Symbol.toStringTag,{value:"Module"})),em={typeName:"viam.component.board.v1.BoardService",methods:{setGPIO:{name:"SetGPIO",I:Rt,O:Jr,kind:m.Unary},getGPIO:{name:"GetGPIO",I:_t,O:zr,kind:m.Unary},pWM:{name:"PWM",I:St,O:Yr,kind:m.Unary},setPWM:{name:"SetPWM",I:It,O:$r,kind:m.Unary},pWMFrequency:{name:"PWMFrequency",I:Mt,O:Vr,kind:m.Unary},setPWMFrequency:{name:"SetPWMFrequency",I:bt,O:Wr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},readAnalogReader:{name:"ReadAnalogReader",I:wt,O:jr,kind:m.Unary},writeAnalog:{name:"WriteAnalog",I:Et,O:Hr,kind:m.Unary},getDigitalInterruptValue:{name:"GetDigitalInterruptValue",I:Ot,O:Kr,kind:m.Unary},streamTicks:{name:"StreamTicks",I:Ct,O:Xr,kind:m.ServerStreaming},setPowerMode:{name:"SetPowerMode",I:Nt,O:Qr,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Pt=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"}]),At=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(Pt),opt:!0},{no:99,name:"extra",kind:"message",T:d}]),nm=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(Pt)}]),Dt=s.makeMessageType("viam.component.encoder.v1.ResetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),am=s.makeMessageType("viam.component.encoder.v1.ResetPositionResponse",[]),qt=s.makeMessageType("viam.component.encoder.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),tm=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}]),sm=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:At,GetPositionResponse:nm,GetPropertiesRequest:qt,GetPropertiesResponse:tm,PositionType:Pt,ResetPositionRequest:Dt,ResetPositionResponse:am},Symbol.toStringTag,{value:"Module"})),om={typeName:"viam.component.encoder.v1.EncoderService",methods:{getPosition:{name:"GetPosition",I:At,O:nm,kind:m.Unary},resetPosition:{name:"ResetPosition",I:Dt,O:am,kind:m.Unary},getProperties:{name:"GetProperties",I:qt,O:tm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Ut=s.makeMessageType("viam.component.gantry.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),im=s.makeMessageType("viam.component.gantry.v1.GetPositionResponse",()=>[{no:1,name:"positions_mm",kind:"scalar",T:1,repeated:!0}]),Gt=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:d}]),rm=s.makeMessageType("viam.component.gantry.v1.MoveToPositionResponse",[]),Lt=s.makeMessageType("viam.component.gantry.v1.HomeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),mm=s.makeMessageType("viam.component.gantry.v1.HomeResponse",()=>[{no:1,name:"homed",kind:"scalar",T:8}]),Bt=s.makeMessageType("viam.component.gantry.v1.GetLengthsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),cm=s.makeMessageType("viam.component.gantry.v1.GetLengthsResponse",()=>[{no:1,name:"lengths_mm",kind:"scalar",T:1,repeated:!0}]),Ft=s.makeMessageType("viam.component.gantry.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),dm=s.makeMessageType("viam.component.gantry.v1.StopResponse",[]),vR=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}]),xt=s.makeMessageType("viam.component.gantry.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),lm=s.makeMessageType("viam.component.gantry.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),hR=Object.freeze(Object.defineProperty({__proto__:null,GetLengthsRequest:Bt,GetLengthsResponse:cm,GetPositionRequest:Ut,GetPositionResponse:im,HomeRequest:Lt,HomeResponse:mm,IsMovingRequest:xt,IsMovingResponse:lm,MoveToPositionRequest:Gt,MoveToPositionResponse:rm,Status:vR,StopRequest:Ft,StopResponse:dm},Symbol.toStringTag,{value:"Module"})),um={typeName:"viam.component.gantry.v1.GantryService",methods:{getPosition:{name:"GetPosition",I:Ut,O:im,kind:m.Unary},moveToPosition:{name:"MoveToPosition",I:Gt,O:rm,kind:m.Unary},home:{name:"Home",I:Lt,O:mm,kind:m.Unary},getLengths:{name:"GetLengths",I:Bt,O:cm,kind:m.Unary},stop:{name:"Stop",I:Ft,O:dm,kind:m.Unary},isMoving:{name:"IsMoving",I:xt,O:lm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,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:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},fR=Object.freeze(Object.defineProperty({__proto__:null,GenericService:Jt},Symbol.toStringTag,{value:"Module"})),zt=s.makeMessageType("viam.component.gripper.v1.OpenRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),pm=s.makeMessageType("viam.component.gripper.v1.OpenResponse",[]),Yt=s.makeMessageType("viam.component.gripper.v1.GrabRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),gm=s.makeMessageType("viam.component.gripper.v1.GrabResponse",()=>[{no:1,name:"success",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:d}]),$t=s.makeMessageType("viam.component.gripper.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Tm=s.makeMessageType("viam.component.gripper.v1.StopResponse",[]),Vt=s.makeMessageType("viam.component.gripper.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),km=s.makeMessageType("viam.component.gripper.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),RR=Object.freeze(Object.defineProperty({__proto__:null,GrabRequest:Yt,GrabResponse:gm,IsMovingRequest:Vt,IsMovingResponse:km,OpenRequest:zt,OpenResponse:pm,StopRequest:$t,StopResponse:Tm},Symbol.toStringTag,{value:"Module"})),ym={typeName:"viam.component.gripper.v1.GripperService",methods:{open:{name:"Open",I:zt,O:pm,kind:m.Unary},grab:{name:"Grab",I:Yt,O:gm,kind:m.Unary},stop:{name:"Stop",I:$t,O:Tm,kind:m.Unary},isMoving:{name:"IsMoving",I:Vt,O:km,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},vm=s.makeMessageType("viam.component.inputcontroller.v1.GetControlsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),hm=s.makeMessageType("viam.component.inputcontroller.v1.GetControlsResponse",()=>[{no:1,name:"controls",kind:"scalar",T:9,repeated:!0}]),Wt=s.makeMessageType("viam.component.inputcontroller.v1.GetEventsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),fm=s.makeMessageType("viam.component.inputcontroller.v1.GetEventsResponse",()=>[{no:1,name:"events",kind:"message",T:bn,repeated:!0}]),jt=s.makeMessageType("viam.component.inputcontroller.v1.TriggerEventRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:2,name:"event",kind:"message",T:bn},{no:99,name:"extra",kind:"message",T:d}]),Rm=s.makeMessageType("viam.component.inputcontroller.v1.TriggerEventResponse",[]),bn=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}]),_m=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:2,name:"events",kind:"message",T:Sm,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),Sm=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"}),Im=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsResponse",()=>[{no:1,name:"event",kind:"message",T:bn}]),Mm=Object.freeze(Object.defineProperty({__proto__:null,Event:bn,GetControlsRequest:vm,GetControlsResponse:hm,GetEventsRequest:Wt,GetEventsResponse:fm,Status:s.makeMessageType("viam.component.inputcontroller.v1.Status",()=>[{no:1,name:"events",kind:"message",T:bn,repeated:!0}]),StreamEventsRequest:_m,StreamEventsRequest_Events:Sm,StreamEventsResponse:Im,TriggerEventRequest:jt,TriggerEventResponse:Rm},Symbol.toStringTag,{value:"Module"})),bm={typeName:"viam.component.inputcontroller.v1.InputControllerService",methods:{getControls:{name:"GetControls",I:vm,O:hm,kind:m.Unary},getEvents:{name:"GetEvents",I:Wt,O:fm,kind:m.Unary},streamEvents:{name:"StreamEvents",I:_m,O:Im,kind:m.ServerStreaming},triggerEvent:{name:"TriggerEvent",I:jt,O:Rm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Ht=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:d}]),wm=s.makeMessageType("viam.component.motor.v1.SetPowerResponse",[]),Kt=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:d}]),Em=s.makeMessageType("viam.component.motor.v1.GoForResponse",[]),Xt=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:d}]),Om=s.makeMessageType("viam.component.motor.v1.GoToResponse",[]),Qt=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:d}]),Cm=s.makeMessageType("viam.component.motor.v1.SetRPMResponse",[]),Zt=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:d}]),Nm=s.makeMessageType("viam.component.motor.v1.ResetZeroPositionResponse",[]),es=s.makeMessageType("viam.component.motor.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Pm=s.makeMessageType("viam.component.motor.v1.GetPositionResponse",()=>[{no:1,name:"position",kind:"scalar",T:1}]),ns=s.makeMessageType("viam.component.motor.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Am=s.makeMessageType("viam.component.motor.v1.StopResponse",[]),as=s.makeMessageType("viam.component.motor.v1.IsPoweredRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Dm=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}]),ts=s.makeMessageType("viam.component.motor.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),qm=s.makeMessageType("viam.component.motor.v1.GetPropertiesResponse",()=>[{no:1,name:"position_reporting",kind:"scalar",T:8}]),_R=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}]),ss=s.makeMessageType("viam.component.motor.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Um=s.makeMessageType("viam.component.motor.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),SR=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:es,GetPositionResponse:Pm,GetPropertiesRequest:ts,GetPropertiesResponse:qm,GoForRequest:Kt,GoForResponse:Em,GoToRequest:Xt,GoToResponse:Om,IsMovingRequest:ss,IsMovingResponse:Um,IsPoweredRequest:as,IsPoweredResponse:Dm,ResetZeroPositionRequest:Zt,ResetZeroPositionResponse:Nm,SetPowerRequest:Ht,SetPowerResponse:wm,SetRPMRequest:Qt,SetRPMResponse:Cm,Status:_R,StopRequest:ns,StopResponse:Am},Symbol.toStringTag,{value:"Module"})),Gm={typeName:"viam.component.motor.v1.MotorService",methods:{setPower:{name:"SetPower",I:Ht,O:wm,kind:m.Unary},goFor:{name:"GoFor",I:Kt,O:Em,kind:m.Unary},goTo:{name:"GoTo",I:Xt,O:Om,kind:m.Unary},setRPM:{name:"SetRPM",I:Qt,O:Cm,kind:m.Unary},resetZeroPosition:{name:"ResetZeroPosition",I:Zt,O:Nm,kind:m.Unary},getPosition:{name:"GetPosition",I:es,O:Pm,kind:m.Unary},getProperties:{name:"GetProperties",I:ts,O:qm,kind:m.Unary},stop:{name:"Stop",I:ns,O:Am,kind:m.Unary},isPowered:{name:"IsPowered",I:as,O:Dm,kind:m.Unary},isMoving:{name:"IsMoving",I:ss,O:Um,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},os=s.makeMessageType("viam.component.movementsensor.v1.GetLinearVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Lm=s.makeMessageType("viam.component.movementsensor.v1.GetLinearVelocityResponse",()=>[{no:1,name:"linear_velocity",kind:"message",T:Ue}]),is=s.makeMessageType("viam.component.movementsensor.v1.GetAngularVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Bm=s.makeMessageType("viam.component.movementsensor.v1.GetAngularVelocityResponse",()=>[{no:1,name:"angular_velocity",kind:"message",T:Ue}]),rs=s.makeMessageType("viam.component.movementsensor.v1.GetCompassHeadingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Fm=s.makeMessageType("viam.component.movementsensor.v1.GetCompassHeadingResponse",()=>[{no:1,name:"value",kind:"scalar",T:1}]),ms=s.makeMessageType("viam.component.movementsensor.v1.GetOrientationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),xm=s.makeMessageType("viam.component.movementsensor.v1.GetOrientationResponse",()=>[{no:1,name:"orientation",kind:"message",T:dr}]),cs=s.makeMessageType("viam.component.movementsensor.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Jm=s.makeMessageType("viam.component.movementsensor.v1.GetPositionResponse",()=>[{no:1,name:"coordinate",kind:"message",T:Je},{no:2,name:"altitude_m",kind:"scalar",T:2}]),ds=s.makeMessageType("viam.component.movementsensor.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),zm=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}]),ls=s.makeMessageType("viam.component.movementsensor.v1.GetAccuracyRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Ym=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}]),us=s.makeMessageType("viam.component.movementsensor.v1.GetLinearAccelerationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),$m=s.makeMessageType("viam.component.movementsensor.v1.GetLinearAccelerationResponse",()=>[{no:1,name:"linear_acceleration",kind:"message",T:Ue}]),Vm=Object.freeze(Object.defineProperty({__proto__:null,GetAccuracyRequest:ls,GetAccuracyResponse:Ym,GetAngularVelocityRequest:is,GetAngularVelocityResponse:Bm,GetCompassHeadingRequest:rs,GetCompassHeadingResponse:Fm,GetLinearAccelerationRequest:us,GetLinearAccelerationResponse:$m,GetLinearVelocityRequest:os,GetLinearVelocityResponse:Lm,GetOrientationRequest:ms,GetOrientationResponse:xm,GetPositionRequest:cs,GetPositionResponse:Jm,GetPropertiesRequest:ds,GetPropertiesResponse:zm},Symbol.toStringTag,{value:"Module"})),Wm={typeName:"viam.component.movementsensor.v1.MovementSensorService",methods:{getLinearVelocity:{name:"GetLinearVelocity",I:os,O:Lm,kind:m.Unary},getAngularVelocity:{name:"GetAngularVelocity",I:is,O:Bm,kind:m.Unary},getCompassHeading:{name:"GetCompassHeading",I:rs,O:Fm,kind:m.Unary},getOrientation:{name:"GetOrientation",I:ms,O:xm,kind:m.Unary},getPosition:{name:"GetPosition",I:cs,O:Jm,kind:m.Unary},getProperties:{name:"GetProperties",I:ds,O:zm,kind:m.Unary},getAccuracy:{name:"GetAccuracy",I:ls,O:Ym,kind:m.Unary},getLinearAcceleration:{name:"GetLinearAcceleration",I:us,O:$m,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary},getReadings:{name:"GetReadings",I:Ke,O:la,kind:m.Unary}}},ps=s.makeMessageType("viam.component.powersensor.v1.GetVoltageRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),jm=s.makeMessageType("viam.component.powersensor.v1.GetVoltageResponse",()=>[{no:1,name:"volts",kind:"scalar",T:1},{no:2,name:"is_ac",kind:"scalar",T:8}]),gs=s.makeMessageType("viam.component.powersensor.v1.GetCurrentRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Hm=s.makeMessageType("viam.component.powersensor.v1.GetCurrentResponse",()=>[{no:1,name:"amperes",kind:"scalar",T:1},{no:2,name:"is_ac",kind:"scalar",T:8}]),Ts=s.makeMessageType("viam.component.powersensor.v1.GetPowerRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Km=s.makeMessageType("viam.component.powersensor.v1.GetPowerResponse",()=>[{no:1,name:"watts",kind:"scalar",T:1}]),IR=Object.freeze(Object.defineProperty({__proto__:null,GetCurrentRequest:gs,GetCurrentResponse:Hm,GetPowerRequest:Ts,GetPowerResponse:Km,GetVoltageRequest:ps,GetVoltageResponse:jm},Symbol.toStringTag,{value:"Module"})),Xm={typeName:"viam.component.powersensor.v1.PowerSensorService",methods:{getVoltage:{name:"GetVoltage",I:ps,O:jm,kind:m.Unary},getCurrent:{name:"GetCurrent",I:gs,O:Hm,kind:m.Unary},getPower:{name:"GetPower",I:Ts,O:Km,kind:m.Unary},getReadings:{name:"GetReadings",I:Ke,O:la,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},ks=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:d}]),Qm=s.makeMessageType("viam.component.servo.v1.MoveResponse",[]),ys=s.makeMessageType("viam.component.servo.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Zm=s.makeMessageType("viam.component.servo.v1.GetPositionResponse",()=>[{no:1,name:"position_deg",kind:"scalar",T:13}]),vs=s.makeMessageType("viam.component.servo.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),ec=s.makeMessageType("viam.component.servo.v1.StopResponse",[]),MR=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}]),hs=s.makeMessageType("viam.component.servo.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),nc=s.makeMessageType("viam.component.servo.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),bR=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:ys,GetPositionResponse:Zm,IsMovingRequest:hs,IsMovingResponse:nc,MoveRequest:ks,MoveResponse:Qm,Status:MR,StopRequest:vs,StopResponse:ec},Symbol.toStringTag,{value:"Module"})),ac={typeName:"viam.component.servo.v1.ServoService",methods:{move:{name:"Move",I:ks,O:Qm,kind:m.Unary},getPosition:{name:"GetPosition",I:ys,O:Zm,kind:m.Unary},stop:{name:"Stop",I:vs,O:ec,kind:m.Unary},isMoving:{name:"IsMoving",I:hs,O:nc,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},tc=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"}]),sc=s.makeMessageType("viam.robot.v1.TunnelRequest",()=>[{no:1,name:"destination_port",kind:"scalar",T:13},{no:2,name:"data",kind:"scalar",T:12}]),oc=s.makeMessageType("viam.robot.v1.TunnelResponse",()=>[{no:1,name:"data",kind:"scalar",T:12}]),ic=s.makeMessageType("viam.robot.v1.ListTunnelsRequest",[]),rc=s.makeMessageType("viam.robot.v1.ListTunnelsResponse",()=>[{no:1,name:"tunnels",kind:"message",T:mc,repeated:!0}]),mc=s.makeMessageType("viam.robot.v1.Tunnel",()=>[{no:1,name:"port",kind:"scalar",T:13},{no:2,name:"connection_timeout",kind:"message",T:F}]),cc=s.makeMessageType("viam.robot.v1.FrameSystemConfig",()=>[{no:1,name:"frame",kind:"message",T:rn},{no:2,name:"kinematics",kind:"message",T:d}]),dc=s.makeMessageType("viam.robot.v1.FrameSystemConfigRequest",()=>[{no:1,name:"supplemental_transforms",kind:"message",T:rn,repeated:!0}]),lc=s.makeMessageType("viam.robot.v1.FrameSystemConfigResponse",()=>[{no:1,name:"frame_system_configs",kind:"message",T:cc,repeated:!0}]),fs=s.makeMessageType("viam.robot.v1.TransformPoseRequest",()=>[{no:1,name:"source",kind:"message",T:on},{no:2,name:"destination",kind:"scalar",T:9},{no:3,name:"supplemental_transforms",kind:"message",T:rn,repeated:!0}]),uc=s.makeMessageType("viam.robot.v1.TransformPoseResponse",()=>[{no:1,name:"pose",kind:"message",T:on}]),Rs=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}]),pc=s.makeMessageType("viam.robot.v1.TransformPCDResponse",()=>[{no:1,name:"point_cloud_pcd",kind:"scalar",T:12}]),gc=s.makeMessageType("viam.robot.v1.ResourceNamesRequest",[]),Tc=s.makeMessageType("viam.robot.v1.ResourceNamesResponse",()=>[{no:1,name:"resources",kind:"message",T:x,repeated:!0}]),kc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtype",()=>[{no:1,name:"subtype",kind:"message",T:x},{no:2,name:"proto_service",kind:"scalar",T:9}]),yc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtypesRequest",[]),vc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtypesResponse",()=>[{no:1,name:"resource_rpc_subtypes",kind:"message",T:kc,repeated:!0}]),hc=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:d},{no:4,name:"started",kind:"message",T:S},{no:5,name:"session_id",kind:"scalar",T:9,opt:!0}]),fc=s.makeMessageType("viam.robot.v1.GetOperationsRequest",[]),Rc=s.makeMessageType("viam.robot.v1.GetOperationsResponse",()=>[{no:1,name:"operations",kind:"message",T:hc,repeated:!0}]),_c=s.makeMessageType("viam.robot.v1.CancelOperationRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Sc=s.makeMessageType("viam.robot.v1.CancelOperationResponse",[]),Ic=s.makeMessageType("viam.robot.v1.BlockForOperationRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Mc=s.makeMessageType("viam.robot.v1.BlockForOperationResponse",[]),bc=s.makeMessageType("viam.robot.v1.PeerConnectionInfo",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(tc)},{no:2,name:"remote_address",kind:"scalar",T:9,opt:!0},{no:3,name:"local_address",kind:"scalar",T:9,opt:!0}]),wc=s.makeMessageType("viam.robot.v1.Session",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"peer_connection_info",kind:"message",T:bc,opt:!0}]),Ec=s.makeMessageType("viam.robot.v1.GetSessionsRequest",[]),Oc=s.makeMessageType("viam.robot.v1.GetSessionsResponse",()=>[{no:1,name:"sessions",kind:"message",T:wc,repeated:!0}]),Cc=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}]),_s=s.makeMessageType("viam.robot.v1.GetModelsFromModulesRequest",[]),Nc=s.makeMessageType("viam.robot.v1.GetModelsFromModulesResponse",()=>[{no:1,name:"models",kind:"message",T:Cc,repeated:!0}]),Ss=s.makeMessageType("viam.robot.v1.Status",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"status",kind:"message",T:d},{no:3,name:"last_reconfigured",kind:"message",T:S}]),Pc=s.makeMessageType("viam.robot.v1.GetStatusRequest",()=>[{no:1,name:"resource_names",kind:"message",T:x,repeated:!0}]),Ac=s.makeMessageType("viam.robot.v1.GetStatusResponse",()=>[{no:1,name:"status",kind:"message",T:Ss,repeated:!0}]),Dc=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}]),qc=s.makeMessageType("viam.robot.v1.StreamStatusResponse",()=>[{no:1,name:"status",kind:"message",T:Ss,repeated:!0}]),Uc=s.makeMessageType("viam.robot.v1.StopExtraParameters",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"params",kind:"message",T:d}]),Gc=s.makeMessageType("viam.robot.v1.StopAllRequest",()=>[{no:99,name:"extra",kind:"message",T:Uc,repeated:!0}]),Lc=s.makeMessageType("viam.robot.v1.StopAllResponse",[]),Is=s.makeMessageType("viam.robot.v1.StartSessionRequest",()=>[{no:1,name:"resume",kind:"scalar",T:9}]),Bc=s.makeMessageType("viam.robot.v1.StartSessionResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"heartbeat_window",kind:"message",T:F}]),Ms=s.makeMessageType("viam.robot.v1.SendSessionHeartbeatRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Fc=s.makeMessageType("viam.robot.v1.SendSessionHeartbeatResponse",[]),xc=s.makeMessageType("viam.robot.v1.LogRequest",()=>[{no:1,name:"logs",kind:"message",T:In,repeated:!0}]),Jc=s.makeMessageType("viam.robot.v1.LogResponse",[]),zc=s.makeMessageType("viam.robot.v1.GetCloudMetadataRequest",[]),bs=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}]),ws=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"}]),Yc=s.makeMessageType("viam.robot.v1.RestartModuleResponse",[]),$c=s.makeMessageType("viam.robot.v1.ShutdownRequest",[]),Vc=s.makeMessageType("viam.robot.v1.ShutdownResponse",[]),Wc=s.makeMessageType("viam.robot.v1.GetMachineStatusRequest",[]),jc=s.makeMessageType("viam.robot.v1.GetMachineStatusResponse",()=>[{no:1,name:"resources",kind:"message",T:Kc,repeated:!0},{no:2,name:"config",kind:"message",T:Qc},{no:3,name:"state",kind:"enum",T:s.getEnumType(Hc)}]),Hc=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"}]),Kc=s.makeMessageType("viam.robot.v1.ResourceStatus",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"state",kind:"enum",T:s.getEnumType(Xc)},{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:bs,opt:!0}]),Xc=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"}]),Qc=s.makeMessageType("viam.robot.v1.ConfigStatus",()=>[{no:1,name:"revision",kind:"scalar",T:9},{no:2,name:"last_updated",kind:"message",T:S}]),Zc=s.makeMessageType("viam.robot.v1.GetVersionRequest",[]),ed=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}]),wR=Object.freeze(Object.defineProperty({__proto__:null,BlockForOperationRequest:Ic,BlockForOperationResponse:Mc,CancelOperationRequest:_c,CancelOperationResponse:Sc,ConfigStatus:Qc,FrameSystemConfig:cc,FrameSystemConfigRequest:dc,FrameSystemConfigResponse:lc,GetCloudMetadataRequest:zc,GetCloudMetadataResponse:bs,GetMachineStatusRequest:Wc,GetMachineStatusResponse:jc,GetMachineStatusResponse_State:Hc,GetModelsFromModulesRequest:_s,GetModelsFromModulesResponse:Nc,GetOperationsRequest:fc,GetOperationsResponse:Rc,GetSessionsRequest:Ec,GetSessionsResponse:Oc,GetStatusRequest:Pc,GetStatusResponse:Ac,GetVersionRequest:Zc,GetVersionResponse:ed,ListTunnelsRequest:ic,ListTunnelsResponse:rc,LogRequest:xc,LogResponse:Jc,ModuleModel:Cc,Operation:hc,PeerConnectionInfo:bc,PeerConnectionType:tc,ResourceNamesRequest:gc,ResourceNamesResponse:Tc,ResourceRPCSubtype:kc,ResourceRPCSubtypesRequest:yc,ResourceRPCSubtypesResponse:vc,ResourceStatus:Kc,ResourceStatus_State:Xc,RestartModuleRequest:ws,RestartModuleResponse:Yc,SendSessionHeartbeatRequest:Ms,SendSessionHeartbeatResponse:Fc,Session:wc,ShutdownRequest:$c,ShutdownResponse:Vc,StartSessionRequest:Is,StartSessionResponse:Bc,Status:Ss,StopAllRequest:Gc,StopAllResponse:Lc,StopExtraParameters:Uc,StreamStatusRequest:Dc,StreamStatusResponse:qc,TransformPCDRequest:Rs,TransformPCDResponse:pc,TransformPoseRequest:fs,TransformPoseResponse:uc,Tunnel:mc,TunnelRequest:sc,TunnelResponse:oc},Symbol.toStringTag,{value:"Module"})),Es={typeName:"viam.robot.v1.RobotService",methods:{getOperations:{name:"GetOperations",I:fc,O:Rc,kind:m.Unary},getSessions:{name:"GetSessions",I:Ec,O:Oc,kind:m.Unary},resourceNames:{name:"ResourceNames",I:gc,O:Tc,kind:m.Unary},resourceRPCSubtypes:{name:"ResourceRPCSubtypes",I:yc,O:vc,kind:m.Unary},cancelOperation:{name:"CancelOperation",I:_c,O:Sc,kind:m.Unary},blockForOperation:{name:"BlockForOperation",I:Ic,O:Mc,kind:m.Unary},getModelsFromModules:{name:"GetModelsFromModules",I:_s,O:Nc,kind:m.Unary},frameSystemConfig:{name:"FrameSystemConfig",I:dc,O:lc,kind:m.Unary},transformPose:{name:"TransformPose",I:fs,O:uc,kind:m.Unary},transformPCD:{name:"TransformPCD",I:Rs,O:pc,kind:m.Unary},getStatus:{name:"GetStatus",I:Pc,O:Ac,kind:m.Unary},streamStatus:{name:"StreamStatus",I:Dc,O:qc,kind:m.ServerStreaming},stopAll:{name:"StopAll",I:Gc,O:Lc,kind:m.Unary},startSession:{name:"StartSession",I:Is,O:Bc,kind:m.Unary},sendSessionHeartbeat:{name:"SendSessionHeartbeat",I:Ms,O:Fc,kind:m.Unary},log:{name:"Log",I:xc,O:Jc,kind:m.Unary},getCloudMetadata:{name:"GetCloudMetadata",I:zc,O:bs,kind:m.Unary},restartModule:{name:"RestartModule",I:ws,O:Yc,kind:m.Unary},shutdown:{name:"Shutdown",I:$c,O:Vc,kind:m.Unary},getMachineStatus:{name:"GetMachineStatus",I:Wc,O:jc,kind:m.Unary},getVersion:{name:"GetVersion",I:Zc,O:ed,kind:m.Unary},tunnel:{name:"Tunnel",I:sc,O:oc,kind:m.BiDiStreaming},listTunnels:{name:"ListTunnels",I:ic,O:rc,kind:m.Unary}}},Os=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"}]),nd=s.makeMessageType("viam.app.v1.RobotConfig",()=>[{no:1,name:"cloud",kind:"message",T:sd},{no:2,name:"remotes",kind:"message",T:_d,repeated:!0},{no:3,name:"components",kind:"message",T:Cs,repeated:!0},{no:4,name:"processes",kind:"message",T:od,repeated:!0},{no:5,name:"services",kind:"message",T:id,repeated:!0},{no:6,name:"network",kind:"message",T:rd,opt:!0},{no:7,name:"auth",kind:"message",T:dd,opt:!0},{no:8,name:"debug",kind:"scalar",T:8,opt:!0},{no:9,name:"modules",kind:"message",T:bd,repeated:!0},{no:10,name:"disable_partial_start",kind:"scalar",T:8,opt:!0},{no:11,name:"packages",kind:"message",T:wd,repeated:!0},{no:12,name:"overwrite_fragment_status",kind:"message",T:pa,repeated:!0},{no:13,name:"enable_web_profile",kind:"scalar",T:8},{no:14,name:"log",kind:"message",T:ad,repeated:!0},{no:15,name:"revision",kind:"scalar",T:9},{no:16,name:"maintenance",kind:"message",T:Ed,opt:!0},{no:17,name:"disable_log_deduplication",kind:"scalar",T:8}]),ad=s.makeMessageType("viam.app.v1.LogPatternConfig",()=>[{no:1,name:"pattern",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:9}]),td=s.makeMessageType("viam.app.v1.LocationSecret",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"secret",kind:"scalar",T:9}]),pa=s.makeMessageType("viam.app.v1.AppValidationStatus",()=>[{no:1,name:"error",kind:"scalar",T:9}]),sd=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:td,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}]),Cs=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:Ns},{no:6,name:"depends_on",kind:"scalar",T:9,repeated:!0},{no:7,name:"service_configs",kind:"message",T:ga,repeated:!0},{no:8,name:"attributes",kind:"message",T:d},{no:9,name:"api",kind:"scalar",T:9},{no:10,name:"log_configuration",kind:"message",T:Ps}]),ga=s.makeMessageType("viam.app.v1.ResourceLevelServiceConfig",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"attributes",kind:"message",T:d}]),od=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}]),id=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:d},{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:ga,repeated:!0},{no:11,name:"log_configuration",kind:"message",T:Ps}]),rd=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:md},{no:6,name:"traffic_tunnel_endpoints",kind:"message",T:cd,repeated:!0}]),md=s.makeMessageType("viam.app.v1.SessionsConfig",()=>[{no:1,name:"heartbeat_window",kind:"message",T:F}]),cd=s.makeMessageType("viam.app.v1.TrafficTunnelEndpoint",()=>[{no:1,name:"port",kind:"scalar",T:5},{no:2,name:"connection_timeout",kind:"message",T:F}]),dd=s.makeMessageType("viam.app.v1.AuthConfig",()=>[{no:1,name:"handlers",kind:"message",T:pd,repeated:!0},{no:2,name:"tls_auth_entities",kind:"scalar",T:9,repeated:!0},{no:3,name:"external_auth_config",kind:"message",T:ud,opt:!0}]),ld=s.makeMessageType("viam.app.v1.JWKSFile",()=>[{no:1,name:"json",kind:"message",T:d}]),ud=s.makeMessageType("viam.app.v1.ExternalAuthConfig",()=>[{no:1,name:"jwks",kind:"message",T:ld}]),pd=s.makeMessageType("viam.app.v1.AuthHandlerConfig",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Os)},{no:5,name:"config",kind:"message",T:d}]),Ns=s.makeMessageType("viam.app.v1.Frame",()=>[{no:1,name:"parent",kind:"scalar",T:9},{no:2,name:"translation",kind:"message",T:gd},{no:3,name:"orientation",kind:"message",T:Td},{no:4,name:"geometry",kind:"message",T:He}]),Ps=s.makeMessageType("viam.app.v1.LogConfiguration",()=>[{no:1,name:"level",kind:"scalar",T:9}]),gd=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}]),Td=s.makeMessageType("viam.app.v1.Orientation",()=>[{no:1,name:"no_orientation",kind:"message",T:kd,oneof:"type"},{no:2,name:"vector_radians",kind:"message",T:yd,oneof:"type"},{no:3,name:"vector_degrees",kind:"message",T:vd,oneof:"type"},{no:4,name:"euler_angles",kind:"message",T:hd,oneof:"type"},{no:5,name:"axis_angles",kind:"message",T:fd,oneof:"type"},{no:6,name:"quaternion",kind:"message",T:Rd,oneof:"type"}]),kd=s.makeMessageType("viam.app.v1.Orientation.NoOrientation",[],{localName:"Orientation_NoOrientation"}),yd=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"}),vd=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"}),hd=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"}),fd=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"}),Rd=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"}),_d=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:Ns},{no:4,name:"auth",kind:"message",T:Sd},{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:ga,repeated:!0},{no:10,name:"secret",kind:"scalar",T:9}]),Sd=s.makeMessageType("viam.app.v1.RemoteAuth",()=>[{no:1,name:"credentials",kind:"message",T:Id},{no:2,name:"entity",kind:"scalar",T:9}]),Id=s.makeMessageType("viam.app.v1.RemoteAuth.Credentials",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Os)},{no:2,name:"payload",kind:"scalar",T:9}],{localName:"RemoteAuth_Credentials"}),Md=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}]),ER=s.makeMessageType("viam.app.v1.ConfigRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"agent_info",kind:"message",T:Md,opt:!0}]),OR=s.makeMessageType("viam.app.v1.ConfigResponse",()=>[{no:1,name:"config",kind:"message",T:nd}]),CR=s.makeMessageType("viam.app.v1.CertificateRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),NR=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}]),PR=s.makeMessageType("viam.app.v1.LogRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"logs",kind:"message",T:In,repeated:!0}]),AR=s.makeMessageType("viam.app.v1.LogResponse",[]),DR=s.makeMessageType("viam.app.v1.NeedsRestartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),qR=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}]),bd=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:pa},{no:8,name:"first_run_timeout",kind:"message",T:F}]),wd=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:pa}]),Ed=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}]),UR=Object.freeze(Object.defineProperty({__proto__:null,AgentInfo:Md,AppValidationStatus:pa,AuthConfig:dd,AuthHandlerConfig:pd,CertificateRequest:CR,CertificateResponse:NR,CloudConfig:sd,ComponentConfig:Cs,ConfigRequest:ER,ConfigResponse:OR,CredentialsType:Os,ExternalAuthConfig:ud,Frame:Ns,JWKSFile:ld,LocationSecret:td,LogConfiguration:Ps,LogPatternConfig:ad,LogRequest:PR,LogResponse:AR,MaintenanceConfig:Ed,ModuleConfig:bd,NeedsRestartRequest:DR,NeedsRestartResponse:qR,NetworkConfig:rd,Orientation:Td,Orientation_AxisAngles:fd,Orientation_EulerAngles:hd,Orientation_NoOrientation:kd,Orientation_OrientationVectorDegrees:vd,Orientation_OrientationVectorRadians:yd,Orientation_Quaternion:Rd,PackageConfig:wd,ProcessConfig:od,RemoteAuth:Sd,RemoteAuth_Credentials:Id,RemoteConfig:_d,ResourceLevelServiceConfig:ga,RobotConfig:nd,ServiceConfig:id,SessionsConfig:md,TrafficTunnelEndpoint:cd,Translation:gd},Symbol.toStringTag,{value:"Module"})),As=s.makeMessageType("viam.service.discovery.v1.DiscoverResourcesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Od=s.makeMessageType("viam.service.discovery.v1.DiscoverResourcesResponse",()=>[{no:1,name:"discoveries",kind:"message",T:Cs,repeated:!0}]),GR=Object.freeze(Object.defineProperty({__proto__:null,DiscoverResourcesRequest:As,DiscoverResourcesResponse:Od},Symbol.toStringTag,{value:"Module"})),Cd={typeName:"viam.service.discovery.v1.DiscoveryService",methods:{discoverResources:{name:"DiscoverResources",I:As,O:Od,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},Nd=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"}]),Ds=s.makeMessageType("viam.service.motion.v1.MoveRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"destination",kind:"message",T:on},{no:3,name:"component_name",kind:"message",T:x},{no:4,name:"world_state",kind:"message",T:Tr,opt:!0},{no:5,name:"constraints",kind:"message",T:Fd,opt:!0},{no:99,name:"extra",kind:"message",T:d}]),Pd=s.makeMessageType("viam.service.motion.v1.MoveResponse",()=>[{no:1,name:"success",kind:"scalar",T:8}]),qs=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:Us,opt:!0},{no:6,name:"obstacles",kind:"message",T:He,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),Ad=s.makeMessageType("viam.service.motion.v1.MoveOnMapResponse",()=>[{no:1,name:"execution_id",kind:"scalar",T:9}]),Dd=s.makeMessageType("viam.service.motion.v1.ObstacleDetector",()=>[{no:1,name:"vision_service",kind:"message",T:x},{no:2,name:"camera",kind:"message",T:x}]),Us=s.makeMessageType("viam.service.motion.v1.MotionConfiguration",()=>[{no:1,name:"obstacle_detectors",kind:"message",T:Dd,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}]),Gs=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:Us,opt:!0},{no:8,name:"bounding_regions",kind:"message",T:da,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),qd=s.makeMessageType("viam.service.motion.v1.MoveOnGlobeResponse",()=>[{no:1,name:"execution_id",kind:"scalar",T:9}]),Ls=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:rn,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),Ud=s.makeMessageType("viam.service.motion.v1.GetPoseResponse",()=>[{no:1,name:"pose",kind:"message",T:on}]),Bs=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:d}]),Gd=s.makeMessageType("viam.service.motion.v1.StopPlanResponse",[]),Fs=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:d}]),Ld=s.makeMessageType("viam.service.motion.v1.ListPlanStatusesResponse",()=>[{no:1,name:"plan_statuses_with_ids",kind:"message",T:$d,repeated:!0}]),xs=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:d}]),Bd=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}]),Fd=s.makeMessageType("viam.service.motion.v1.Constraints",()=>[{no:1,name:"linear_constraint",kind:"message",T:xd,repeated:!0},{no:2,name:"orientation_constraint",kind:"message",T:Jd,repeated:!0},{no:3,name:"collision_specification",kind:"message",T:zd,repeated:!0}]),xd=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}]),Jd=s.makeMessageType("viam.service.motion.v1.OrientationConstraint",()=>[{no:1,name:"orientation_tolerance_degs",kind:"scalar",T:2,opt:!0}]),zd=s.makeMessageType("viam.service.motion.v1.CollisionSpecification",()=>[{no:1,name:"allows",kind:"message",T:Yd,repeated:!0}]),Yd=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:Vd},{no:2,name:"status",kind:"message",T:Ta},{no:3,name:"status_history",kind:"message",T:Ta,repeated:!0}]),$d=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:Ta}]),Ta=s.makeMessageType("viam.service.motion.v1.PlanStatus",()=>[{no:1,name:"state",kind:"enum",T:s.getEnumType(Nd)},{no:2,name:"timestamp",kind:"message",T:S},{no:3,name:"reason",kind:"scalar",T:9,opt:!0}]),Vd=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:Wd,repeated:!0}]),Wd=s.makeMessageType("viam.service.motion.v1.PlanStep",()=>[{no:1,name:"step",kind:"map",K:9,V:{kind:"message",T:jd}}]),jd=s.makeMessageType("viam.service.motion.v1.ComponentState",()=>[{no:1,name:"pose",kind:"message",T:qe}]),Hd=Object.freeze(Object.defineProperty({__proto__:null,CollisionSpecification:zd,CollisionSpecification_AllowedFrameCollisions:Yd,ComponentState:jd,Constraints:Fd,GetPlanRequest:xs,GetPlanResponse:Bd,GetPoseRequest:Ls,GetPoseResponse:Ud,LinearConstraint:xd,ListPlanStatusesRequest:Fs,ListPlanStatusesResponse:Ld,MotionConfiguration:Us,MoveOnGlobeRequest:Gs,MoveOnGlobeResponse:qd,MoveOnMapRequest:qs,MoveOnMapResponse:Ad,MoveRequest:Ds,MoveResponse:Pd,ObstacleDetector:Dd,OrientationConstraint:Jd,Plan:Vd,PlanState:Nd,PlanStatus:Ta,PlanStatusWithID:$d,PlanStep:Wd,PlanWithStatus:Js,StopPlanRequest:Bs,StopPlanResponse:Gd},Symbol.toStringTag,{value:"Module"})),Kd={typeName:"viam.service.motion.v1.MotionService",methods:{move:{name:"Move",I:Ds,O:Pd,kind:m.Unary},moveOnMap:{name:"MoveOnMap",I:qs,O:Ad,kind:m.Unary},moveOnGlobe:{name:"MoveOnGlobe",I:Gs,O:qd,kind:m.Unary},getPose:{name:"GetPose",I:Ls,O:Ud,kind:m.Unary},stopPlan:{name:"StopPlan",I:Bs,O:Gd,kind:m.Unary},listPlanStatuses:{name:"ListPlanStatuses",I:Fs,O:Ld,kind:m.Unary},getPlan:{name:"GetPlan",I:xs,O:Bd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},Xd=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"}]),zs=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"}]),Ys=s.makeMessageType("viam.service.navigation.v1.GetModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Qd=s.makeMessageType("viam.service.navigation.v1.GetModeResponse",()=>[{no:1,name:"mode",kind:"enum",T:s.getEnumType(zs)}]),$s=s.makeMessageType("viam.service.navigation.v1.SetModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mode",kind:"enum",T:s.getEnumType(zs)},{no:99,name:"extra",kind:"message",T:d}]),Zd=s.makeMessageType("viam.service.navigation.v1.SetModeResponse",[]),el=s.makeMessageType("viam.service.navigation.v1.Waypoint",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"location",kind:"message",T:Je}]),Vs=s.makeMessageType("viam.service.navigation.v1.GetLocationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),nl=s.makeMessageType("viam.service.navigation.v1.GetLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Je},{no:2,name:"compass_heading",kind:"scalar",T:1}]),Ws=s.makeMessageType("viam.service.navigation.v1.GetWaypointsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),al=s.makeMessageType("viam.service.navigation.v1.GetWaypointsResponse",()=>[{no:1,name:"waypoints",kind:"message",T:el,repeated:!0}]),js=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:d}]),tl=s.makeMessageType("viam.service.navigation.v1.AddWaypointResponse",[]),Hs=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:d}]),sl=s.makeMessageType("viam.service.navigation.v1.RemoveWaypointResponse",[]),Ks=s.makeMessageType("viam.service.navigation.v1.GetObstaclesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),ol=s.makeMessageType("viam.service.navigation.v1.GetObstaclesResponse",()=>[{no:1,name:"obstacles",kind:"message",T:da,repeated:!0}]),il=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}]),Xs=s.makeMessageType("viam.service.navigation.v1.GetPathsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),rl=s.makeMessageType("viam.service.navigation.v1.GetPathsResponse",()=>[{no:1,name:"paths",kind:"message",T:il,repeated:!0}]),Qs=s.makeMessageType("viam.service.navigation.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),ml=s.makeMessageType("viam.service.navigation.v1.GetPropertiesResponse",()=>[{no:1,name:"map_type",kind:"enum",T:s.getEnumType(Xd)}]),cl=Object.freeze(Object.defineProperty({__proto__:null,AddWaypointRequest:js,AddWaypointResponse:tl,GetLocationRequest:Vs,GetLocationResponse:nl,GetModeRequest:Ys,GetModeResponse:Qd,GetObstaclesRequest:Ks,GetObstaclesResponse:ol,GetPathsRequest:Xs,GetPathsResponse:rl,GetPropertiesRequest:Qs,GetPropertiesResponse:ml,GetWaypointsRequest:Ws,GetWaypointsResponse:al,MapType:Xd,Mode:zs,Path:il,RemoveWaypointRequest:Hs,RemoveWaypointResponse:sl,SetModeRequest:$s,SetModeResponse:Zd,Waypoint:el},Symbol.toStringTag,{value:"Module"})),dl={typeName:"viam.service.navigation.v1.NavigationService",methods:{getMode:{name:"GetMode",I:Ys,O:Qd,kind:m.Unary},setMode:{name:"SetMode",I:$s,O:Zd,kind:m.Unary},getLocation:{name:"GetLocation",I:Vs,O:nl,kind:m.Unary},getWaypoints:{name:"GetWaypoints",I:Ws,O:al,kind:m.Unary},addWaypoint:{name:"AddWaypoint",I:js,O:tl,kind:m.Unary},removeWaypoint:{name:"RemoveWaypoint",I:Hs,O:sl,kind:m.Unary},getObstacles:{name:"GetObstacles",I:Ks,O:ol,kind:m.Unary},getPaths:{name:"GetPaths",I:Xs,O:rl,kind:m.Unary},getProperties:{name:"GetProperties",I:Qs,O:ml,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},ll=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"}]),ul=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"}]),Zs=s.makeMessageType("viam.service.slam.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),pl=s.makeMessageType("viam.service.slam.v1.GetPositionResponse",()=>[{no:1,name:"pose",kind:"message",T:qe}]),eo=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}]),gl=s.makeMessageType("viam.service.slam.v1.GetPointCloudMapResponse",()=>[{no:1,name:"point_cloud_pcd_chunk",kind:"scalar",T:12}]),no=s.makeMessageType("viam.service.slam.v1.GetInternalStateRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Tl=s.makeMessageType("viam.service.slam.v1.GetInternalStateResponse",()=>[{no:1,name:"internal_state_chunk",kind:"scalar",T:12}]),ao=s.makeMessageType("viam.service.slam.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),kl=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(ll)},{no:3,name:"internal_state_file_type",kind:"scalar",T:9,opt:!0},{no:4,name:"sensor_info",kind:"message",T:yl,repeated:!0}]),yl=s.makeMessageType("viam.service.slam.v1.SensorInfo",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:s.getEnumType(ul)}]),vl=Object.freeze(Object.defineProperty({__proto__:null,GetInternalStateRequest:no,GetInternalStateResponse:Tl,GetPointCloudMapRequest:eo,GetPointCloudMapResponse:gl,GetPositionRequest:Zs,GetPositionResponse:pl,GetPropertiesRequest:ao,GetPropertiesResponse:kl,MappingMode:ll,SensorInfo:yl,SensorType:ul},Symbol.toStringTag,{value:"Module"})),hl={typeName:"viam.service.slam.v1.SLAMService",methods:{getPosition:{name:"GetPosition",I:Zs,O:pl,kind:m.Unary},getPointCloudMap:{name:"GetPointCloudMap",I:eo,O:gl,kind:m.ServerStreaming},getInternalState:{name:"GetInternalState",I:no,O:Tl,kind:m.ServerStreaming},getProperties:{name:"GetProperties",I:ao,O:kl,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},fl=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"}]),to=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:d}]),Rl=s.makeMessageType("viam.component.camera.v1.GetImageResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:12}]),_l=s.makeMessageType("viam.component.camera.v1.GetImagesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Sl=s.makeMessageType("viam.component.camera.v1.GetImagesResponse",()=>[{no:1,name:"images",kind:"message",T:so,repeated:!0},{no:84260,name:"response_metadata",kind:"message",T:kr}]),so=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(fl)},{no:3,name:"image",kind:"scalar",T:12}]),oo=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:d}]),io=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:d}]),Il=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}]),Ml=s.makeMessageType("viam.component.camera.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),bl=s.makeMessageType("viam.component.camera.v1.GetPropertiesResponse",()=>[{no:1,name:"supports_pcd",kind:"scalar",T:8},{no:2,name:"intrinsic_parameters",kind:"message",T:Ol},{no:3,name:"distortion_parameters",kind:"message",T:Cl},{no:4,name:"mime_types",kind:"scalar",T:9,repeated:!0},{no:5,name:"frame_rate",kind:"scalar",T:2,opt:!0}]),LR=s.makeMessageType("viam.component.camera.v1.Webcams",()=>[{no:1,name:"webcams",kind:"message",T:wl,repeated:!0}]),wl=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:El,repeated:!0},{no:4,name:"name",kind:"scalar",T:9},{no:5,name:"id",kind:"scalar",T:9}]),El=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}]),Ol=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}]),Cl=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}]),BR=Object.freeze(Object.defineProperty({__proto__:null,DistortionParameters:Cl,Format:fl,GetImageRequest:to,GetImageResponse:Rl,GetImagesRequest:_l,GetImagesResponse:Sl,GetPointCloudRequest:io,GetPointCloudResponse:Il,GetPropertiesRequest:Ml,GetPropertiesResponse:bl,Image:so,IntrinsicParameters:Ol,Property:El,RenderFrameRequest:oo,Webcam:wl,Webcams:LR},Symbol.toStringTag,{value:"Module"})),ro=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:d}]),Nl=s.makeMessageType("viam.service.vision.v1.GetDetectionsResponse",()=>[{no:1,name:"detections",kind:"message",T:ka,repeated:!0}]),mo=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:d}]),Pl=s.makeMessageType("viam.service.vision.v1.GetDetectionsFromCameraResponse",()=>[{no:1,name:"detections",kind:"message",T:ka,repeated:!0}]),ka=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}]),co=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:d}]),Al=s.makeMessageType("viam.service.vision.v1.GetClassificationsResponse",()=>[{no:1,name:"classifications",kind:"message",T:ya,repeated:!0}]),lo=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:d}]),Dl=s.makeMessageType("viam.service.vision.v1.GetClassificationsFromCameraResponse",()=>[{no:1,name:"classifications",kind:"message",T:ya,repeated:!0}]),ya=s.makeMessageType("viam.service.vision.v1.Classification",()=>[{no:1,name:"class_name",kind:"scalar",T:9},{no:2,name:"confidence",kind:"scalar",T:1}]),uo=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:d}]),ql=s.makeMessageType("viam.service.vision.v1.GetObjectPointCloudsResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"objects",kind:"message",T:ot,repeated:!0}]),po=s.makeMessageType("viam.service.vision.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),go=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:d}]),Ul=s.makeMessageType("viam.service.vision.v1.CaptureAllFromCameraResponse",()=>[{no:1,name:"image",kind:"message",T:so},{no:2,name:"detections",kind:"message",T:ka,repeated:!0},{no:3,name:"classifications",kind:"message",T:ya,repeated:!0},{no:4,name:"objects",kind:"message",T:ot,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),Gl=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}]),Ll=Object.freeze(Object.defineProperty({__proto__:null,CaptureAllFromCameraRequest:go,CaptureAllFromCameraResponse:Ul,Classification:ya,Detection:ka,GetClassificationsFromCameraRequest:lo,GetClassificationsFromCameraResponse:Dl,GetClassificationsRequest:co,GetClassificationsResponse:Al,GetDetectionsFromCameraRequest:mo,GetDetectionsFromCameraResponse:Pl,GetDetectionsRequest:ro,GetDetectionsResponse:Nl,GetObjectPointCloudsRequest:uo,GetObjectPointCloudsResponse:ql,GetPropertiesRequest:po,GetPropertiesResponse:Gl},Symbol.toStringTag,{value:"Module"})),Bl={typeName:"viam.service.vision.v1.VisionService",methods:{getDetectionsFromCamera:{name:"GetDetectionsFromCamera",I:mo,O:Pl,kind:m.Unary},getDetections:{name:"GetDetections",I:ro,O:Nl,kind:m.Unary},getClassificationsFromCamera:{name:"GetClassificationsFromCamera",I:lo,O:Dl,kind:m.Unary},getClassifications:{name:"GetClassifications",I:co,O:Al,kind:m.Unary},getObjectPointClouds:{name:"GetObjectPointClouds",I:uo,O:ql,kind:m.Unary},getProperties:{name:"GetProperties",I:po,O:Gl,kind:m.Unary},captureAllFromCamera:{name:"CaptureAllFromCamera",I:go,O:Ul,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},FR=new Blob([`self.onmessage = function(e) {
4
+ `].join("");return n},Lf=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 u=o.createDataChannel("negotiation",{id:1,negotiated:!0,ordered:!0});u.binaryType="arraybuffer";let l=!1;if(u.addEventListener("open",()=>{l=!0}),u.addEventListener("message",R=>{(async()=>{const I=new RTCSessionDescription(JSON.parse(Zi(R.data)));if(await o.setRemoteDescription(I),I.type==="offer"){await o.setLocalDescription();const _=Xa(o.localDescription,n);u.send(Ka(JSON.stringify(_)))}})().catch(console.error)}),o.addEventListener("negotiationneeded",()=>{(async()=>{if(!l)return;await o.setLocalDescription();const R=Xa(o.localDescription,n);u.send(Ka(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 Bf(){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 er(a,e){const n=Bi(a);if(n)throw e.forEach((t,o)=>{n.metadata.append(o,t)}),n;if(!e.has(tn)&&!a.has(tn))throw new C("protocol error: missing status",T.Code.Internal)}function nr(a,e,n,t){const o=new Headers(n??{});return o.set(Ah,a?Lh:Bh),o.set(Gh,"1"),o.set(Uh,"connect-es/1.6.1"),e!==void 0&&o.set(Dh,`${e}m`),o}function Ff(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 ar(a,e){var n;if(a>=200&&a<300)return{foundStatus:e.has(tn),headerError:Bi(e)};throw new C(decodeURIComponent((n=e.get(Li))!==null&&n!==void 0?n:`HTTP ${a}`),Ff(a),e)}var je=function(a){return this instanceof je?(this.v=a,this):new je(a)},xf=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||u(_,O)})},M&&(o[_]=M(o[_])))}function u(_,M){try{l(t[_](M))}catch(O){I(i[0][3],O)}}function l(_){_.value instanceof je?Promise.resolve(_.value.v).then(k,R):I(i[0][2],_)}function k(_){u("next",_)}function R(_){u("throw",_)}function I(_,M){_(M),i.shift(),i.length&&u(i[0][0],i[0][1])}};function Jf(a){var e;Bf();const n=(e=a.useBinaryFormat)!==null&&e!==void 0?e:!0;return{async unary(t,o,i,r,c,u,l){var k;const{serialize:R,parse:I}=La(o,n,a.jsonOptions,a.binaryOptions);return r=r===void 0?a.defaultTimeoutMs:r<=0?void 0:r,await $i({interceptors:a.interceptors,signal:i,timeoutMs:r,req:{stream:!1,service:t,method:o,url:Fi(a.baseUrl,t,o),init:{method:"POST",credentials:(k=a.credentials)!==null&&k!==void 0?k:"same-origin",redirect:"error",mode:"cors"},header:nr(n,r,c),contextValues:l??aa(),message:u},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:Ai(0,R(_.message))})),{headerError:Y}=ar(P.status,P.headers);if(!P.body)throw Y!==void 0?Y:"missing response body";const y=Pi(P.body).getReader();let h,g;for(;;){const v=await y.read();if(v.done)break;const{flags:w,data:b}=v.value;if((w&Ni)===Ni)throw new C("protocol error: received unsupported compressed output",T.Code.Internal);if(w===Ga){if(h!==void 0)throw"extra trailer";h=Gi(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(tn)?T.Code.Unimplemented:T.Code.Unknown);if(er(h,P.headers),g===void 0)throw new C("missing message",h.has(tn)?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,u,l){var k;const{serialize:R,parse:I}=La(o,n,a.jsonOptions,a.binaryOptions);function _(O,P,Y,y,h){return xf(this,arguments,function*(){const v=Pi(O).getReader();if(P){if(!(yield je(v.read())).done)throw"extra data for trailers-only";return yield je(void 0)}let w=!1;for(;;){const b=yield je(v.read());if(b.done)break;const{flags:ae,data:U}=b.value;if((ae&Ga)===Ga){if(w)throw"extra trailer";w=!0;const $=Gi(U);er($,y),$.forEach((Wo,jo)=>Y.set(jo,Wo));continue}if(w)throw"extra message";yield yield je(I(U))}if("throwIfAborted"in h&&h.throwIfAborted(),!w)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 Ai(0,R(P.value))}return r=r===void 0?a.defaultTimeoutMs:r<=0?void 0:r,Vi({interceptors:a.interceptors,signal:i,timeoutMs:r,req:{stream:!0,service:t,method:o,url:Fi(a.baseUrl,t,o),init:{method:"POST",credentials:(k=a.credentials)!==null&&k!==void 0?k:"same-origin",redirect:"error",mode:"cors"},header:nr(n,r,c),contextValues:l??aa(),message:u},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}=ar(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 ma=s.makeMessageType("proto.rpc.webrtc.v1.PacketMessage",()=>[{no:1,name:"data",kind:"scalar",T:12},{no:2,name:"eom",kind:"scalar",T:8}]),Qa=s.makeMessageType("proto.rpc.webrtc.v1.Stream",()=>[{no:1,name:"id",kind:"scalar",T:4}]),Za=s.makeMessageType("proto.rpc.webrtc.v1.Request",()=>[{no:1,name:"stream",kind:"message",T:Qa},{no:2,name:"headers",kind:"message",T:tr,oneof:"type"},{no:3,name:"message",kind:"message",T:et,oneof:"type"},{no:4,name:"rst_stream",kind:"scalar",T:8,oneof:"type"}]),tr=s.makeMessageType("proto.rpc.webrtc.v1.RequestHeaders",()=>[{no:1,name:"method",kind:"scalar",T:9},{no:2,name:"metadata",kind:"message",T:ca},{no:3,name:"timeout",kind:"message",T:F}]),et=s.makeMessageType("proto.rpc.webrtc.v1.RequestMessage",()=>[{no:1,name:"has_message",kind:"scalar",T:8},{no:2,name:"packet_message",kind:"message",T:ma},{no:3,name:"eos",kind:"scalar",T:8}]),zf=s.makeMessageType("proto.rpc.webrtc.v1.Response",()=>[{no:1,name:"stream",kind:"message",T:Qa},{no:2,name:"headers",kind:"message",T:Yf,oneof:"type"},{no:3,name:"message",kind:"message",T:$f,oneof:"type"},{no:4,name:"trailers",kind:"message",T:Vf,oneof:"type"}]),Yf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseHeaders",()=>[{no:1,name:"metadata",kind:"message",T:ca}]),$f=s.makeMessageType("proto.rpc.webrtc.v1.ResponseMessage",()=>[{no:1,name:"packet_message",kind:"message",T:ma}]),Vf=s.makeMessageType("proto.rpc.webrtc.v1.ResponseTrailers",()=>[{no:1,name:"status",kind:"message",T:sn},{no:2,name:"metadata",kind:"message",T:ca}]),sr=s.makeMessageType("proto.rpc.webrtc.v1.Strings",()=>[{no:1,name:"values",kind:"scalar",T:9,repeated:!0}]),ca=s.makeMessageType("proto.rpc.webrtc.v1.Metadata",()=>[{no:1,name:"md",kind:"map",K:9,V:{kind:"message",T:sr}}]);class de extends Error{name="ConnectionClosedError";constructor(e){super(e),Object.setPrototypeOf(this,de.prototype)}static isError(e){return e instanceof de||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 Wf{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 de("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 or=33554432;class jf{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>or){this.packetBuf.length=0,this.packetBufSize=0,console.error(`message size larger than max ${or}; 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 Hf=16373;class ir extends jf{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}=La(i,!0,void 0,void 0);this.parseMessage=c;const u=`/${o.typeName}/${i.name}`;this.requestHeaders=new tr({method:u});const l=Kf(Sn(r));l&&(this.requestHeaders.metadata=l)}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 ma({eom:!0}),i=new et({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,Hf),i=new ma;i.data=t.slice(0,o),t=t.slice(o),t.length===0&&(i.eom=!0);const r=new et({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 Kf=a=>{if(!a)return;const e=new ca({md:Object.fromEntries([...a.entries()].map(([n,t])=>[n,new sr({values:[t]})]))});return Object.keys(e.md).length>0?e:void 0},nt=a=>{const e=Object.entries(a?.md??{}).flatMap(([n,{values:t}])=>t.map(o=>[n,o]));return new Headers(e)};class Xf extends ir{awaitingHeadersResult;gotHeaders=!1;respStream=Ih();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??aa(),message:t},next:async c=>{const l=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:l,trailer:this.trailers,message:this.respStream}}};return e&&(r.signal=e),n!==void 0&&(r.timeoutMs=n),Vi(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(nt(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 Qf extends ir{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??aa(),message:t},next:async c=>new Promise((u,l)=>{this.result={success:u,failure:l},this.startRequest(),this.sendMessage(c.message.toBinary())})};return e&&(r.signal=e),n!==void 0&&(r.timeoutMs=n),$i(r)}onHeaders(e){if(this.headers!==void 0){this.result?.failure(new Error("invariant: received headers more than once"));return}this.headers=nt(e.metadata)}onTrailers(e){const n=nt(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 Zf=256;class eR extends Wf{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 de("data channel closed"));for(const e of this.streams.values())e.cs.closeWithRecvError()}onChannelMessage(e){const n=zf.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 Qa({id:BigInt(e)})}newStream(e,n,t,o,i){if(this.isClosed())throw new de("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>Zf)throw new Error("stream limit hit");const c=new e(this,n,u=>this.removeStreamByID(u),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 Za({stream:e,type:{case:"headers",value:n}}))}writeMessage(e,n){this.write(new Za({stream:e,type:{case:"message",value:n}}))}writeReset(e){this.write(new Za({stream:e,type:{case:"rstStream",value:!0}}))}async unary(e,n,t,o,i,r,c){return this.newStream(Qf,this.nextStreamID(),e,n,i).run(t,o,r,c)}async stream(e,n,t,o,i,r,c){return this.newStream(Xf,this.nextStreamID(),e,n,i).run(t,o,r,c)}}const at="invariant: call uuid unset";class nR{constructor(e,n,t,o,i){this.signalingClient=e,this.callOpts=n,this.pc=t,this.dc=o,this.dialOpts=i,this.clientChannel=new eR(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=Xa(this.pc.localDescription,this.dialOpts?.additionalSdpFields),n=Ka(JSON.stringify(e)),t=new Ki({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 de("failed to dial");if(this.clientChannel.isClosed())throw new de("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(Zi(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=aR(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(at);e.candidate.candidate!==void 0&&console.debug(`gathered local ICE ${e.candidate.candidate}`);const n=tR(e.candidate),t=new ia({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(at);this.sentDoneOrErrorOnce=!0;const n=new ia({uuid:this.callUuid,update:{case:"error",value:new sn({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(at);this.sentDoneOrErrorOnce=!0;const e=new ia({uuid:this.callUuid,update:{case:"done",value:!0}});try{await this.signalingClient.callUpdate(e,this.callOpts)}catch(n){console.error(n)}}}const aR=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},tR=a=>{const e=new Rn;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},_n=async(a,e)=>{mr(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 rr(t,n,o)}return e===void 0||e.credentials===void 0&&e.accessToken===void 0?n(t):sR(a,n,e,t)},tt=/^.*:\/\//u,sR=async(a,e,n,t)=>{const o=new Headers(n.extraHeaders);let i;if(n.accessToken===void 0||n.accessToken===""){const r=new Ha({entity:Mn(n.credentials)&&n.credentials.authEntity?n.credentials.authEntity:a.replace(tt,"")});n.credentials&&(r.credentials=new Hi({type:n.credentials.type,payload:n.credentials.payload}));const c=n.externalAuthAddress??a,u=e({baseUrl:c});i=(await N(vf,u).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 Ha({entity:n.externalAuthToEntity}),u=e({baseUrl:n.externalAuthAddress});i=(await N(hf,u).authenticateTo(c,{headers:r})).accessToken}return o.set("authorization",`Bearer ${i}`),new rr(t,e,o)};class rr{transport;extraHeaders;constructor(e,n,t){this.extraHeaders=t,this.transport=n(e)}async unary(e,n,t,o,i,r,c){const u=Sn(i);for(const[l,k]of this.extraHeaders)u.set(l,k);return this.transport.unary(e,n,t,o,u,r,c)}async stream(e,n,t,o,i,r,c){const u=Sn(i);for(const[l,k]of this.extraHeaders)u.set(l,k);return this.transport.stream(e,n,t,o,u,r,c)}}const Sn=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},oR=async(a,e,n)=>{const t={...n},o=await _n(a,t),i=N(Xi,o);try{return(await i.optionalWebRTCConfig({},e)).config??new ra}catch(r){if(r instanceof C&&r.code===T.Code.Unimplemented)return new ra;throw r}},iR=async(a,e,n)=>{const t=a.replace(/\/$/u,"");mr(n);const o={headers:{"rpc-host":e}},i=await rR(t,o,n),r=mR(t,n),{pc:c,dc:u}=await Lf(i.disableTrickleICE,i.rtcConfig,i.additionalSdpFields);let l=!1,k;try{k=await _n(t,r)}catch(_){throw c.close(),_}const R=N(Xi,k),I=new nR(R,o,c,u,i);try{n?.dialTimeout!==void 0&&setTimeout(()=>{l||I.terminate(new Error("timed out"))},n.dialTimeout);const _=await I.doExchange();return n?.externalAuthAddress!==void 0&&n.externalAuthAddress!==""||n?.credentials?.type,l=!0,{transport:_,peerConnection:c,dataChannel:u}}catch(_){throw console.error("error dialing",_),_}finally{l||c.close()}},rR=async(a,e,n)=>{const t=await oR(a,e,n),o=t.additionalIceServers.map(c=>{const u=[];for(const l of c.urls)l.endsWith("udp")&&u.push(`${l.slice(0,-3)}tcp`),u.push(l);return{urls:u,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},mR=(a,e)=>{let n=e;return n={...e},e.accessToken===void 0&&(Mn(n.credentials)&&!n.credentials.authEntity&&(n.credentials.authEntity=n.externalAuthAddress!==void 0&&n.externalAuthAddress!==""?n.externalAuthAddress.replace(tt,""):a.replace(tt,"")),n.credentials=e.webrtcOptions?.signalingCredentials,n.accessToken=e.webrtcOptions?.signalingAccessToken),n.externalAuthAddress=e.webrtcOptions?.signalingExternalAuthAddress,n.externalAuthToEntity=e.webrtcOptions?.signalingExternalAuthToEntity,n},mr=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")}},cR="v0.1.430",cr=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}]),dr=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}]),on=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}]),lr=s.makeMessageType("viam.common.v1.Sphere",()=>[{no:1,name:"radius_mm",kind:"scalar",T:1}]),ur=s.makeMessageType("viam.common.v1.Capsule",()=>[{no:1,name:"radius_mm",kind:"scalar",T:1},{no:2,name:"length_mm",kind:"scalar",T:1}]),pr=s.makeMessageType("viam.common.v1.RectangularPrism",()=>[{no:1,name:"dims_mm",kind:"message",T:Ue}]),gr=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:lr,oneof:"geometry_type"},{no:3,name:"box",kind:"message",T:pr,oneof:"geometry_type"},{no:5,name:"capsule",kind:"message",T:ur,oneof:"geometry_type"},{no:6,name:"mesh",kind:"message",T:gr,oneof:"geometry_type"},{no:4,name:"label",kind:"scalar",T:9}]),st=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}]),ot=s.makeMessageType("viam.common.v1.PointCloudObject",()=>[{no:1,name:"point_cloud",kind:"scalar",T:12},{no:2,name:"geometries",kind:"message",T:st}]),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}]),rn=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:on},{no:3,name:"physical_object",kind:"message",T:He,opt:!0}]),Tr=s.makeMessageType("viam.common.v1.WorldState",()=>[{no:1,name:"obstacles",kind:"message",T:st,repeated:!0},{no:3,name:"transforms",kind:"message",T:rn,repeated:!0}]),dR=s.makeMessageType("viam.common.v1.ActuatorStatus",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),kr=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:d}]),G=s.makeMessageType("viam.common.v1.DoCommandResponse",()=>[{no:1,name:"result",kind:"message",T:d}]),yr=s.makeMessageType("viam.common.v1.GetKinematicsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),vr=s.makeMessageType("viam.common.v1.GetKinematicsResponse",()=>[{no:1,name:"format",kind:"enum",T:s.getEnumType(cr)},{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:d}]),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:d}]),la=s.makeMessageType("viam.common.v1.GetReadingsResponse",()=>[{no:1,name:"readings",kind:"map",K:9,V:{kind:"message",T:X}}]),In=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:d},{no:7,name:"stack",kind:"scalar",T:9},{no:8,name:"fields",kind:"message",T:d,repeated:!0}]),hr=s.makeExtension("viam.common.v1.safety_heartbeat_monitored",me,{no:84260,kind:"scalar",T:8,opt:!0}),it=Object.freeze(Object.defineProperty({__proto__:null,ActuatorStatus:dR,Capsule:ur,DoCommandRequest:q,DoCommandResponse:G,GeoGeometry:da,GeoPoint:Je,GeometriesInFrame:st,Geometry:He,GetGeometriesRequest:J,GetGeometriesResponse:K,GetKinematicsRequest:yr,GetKinematicsResponse:vr,GetReadingsRequest:Ke,GetReadingsResponse:la,KinematicsFileFormat:cr,LogEntry:In,Mesh:gr,Orientation:dr,PointCloudObject:ot,Pose:qe,PoseInFrame:on,RectangularPrism:pr,ResourceName:x,ResponseMetadata:kr,Sphere:lr,Transform:rn,Vector3:Ue,WorldState:Tr,safety_heartbeat_monitored:hr},Symbol.toStringTag,{value:"Module"})),rt=new Headers({"viam-client":`typescript;v0.40.2;${cR}`}),L=async function(e,n,t,o={},i={}){const r=new q({name:n,command:t});o.requestLogger?.(r);const u=(await e(r,i)).result?.toJson();return u===void 0?{}:u},lR=(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},uR=a=>{if(a.headers){const{_:e,...n}=a.headers;a.headers=n}},pR=(a,e,n)=>{const t=n??{headers:{}};return t.headers[a]=e,t},gR=(a,e)=>{const{[e]:n,...t}=a.headers;a.headers=t},Mn=a=>a!==void 0&&"authEntity"in a,TR=async(a,e)=>e.type==="access-token"?_n(a,{accessToken:e.payload,extraHeaders:rt}):_n(a,{credentials:e,extraHeaders:rt}),mt=5e3;var ne=(a=>(a.CONNECTING="connecting",a.CONNECTED="connected",a.DISCONNECTING="disconnecting",a.DISCONNECTED="disconnected",a))(ne||{});class fr{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 ct=s.makeMessageType("viam.component.arm.v1.GetEndPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Rr=s.makeMessageType("viam.component.arm.v1.GetEndPositionResponse",()=>[{no:1,name:"pose",kind:"message",T:qe}]),mn=s.makeMessageType("viam.component.arm.v1.JointPositions",()=>[{no:1,name:"values",kind:"scalar",T:1,repeated:!0}]),dt=s.makeMessageType("viam.component.arm.v1.GetJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),_r=s.makeMessageType("viam.component.arm.v1.GetJointPositionsResponse",()=>[{no:1,name:"positions",kind:"message",T:mn}]),lt=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:d}]),Sr=s.makeMessageType("viam.component.arm.v1.MoveToPositionResponse",[]),ut=s.makeMessageType("viam.component.arm.v1.MoveToJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions",kind:"message",T:mn},{no:99,name:"extra",kind:"message",T:d}]),Ir=s.makeMessageType("viam.component.arm.v1.MoveToJointPositionsResponse",[]),Mr=s.makeMessageType("viam.component.arm.v1.MoveThroughJointPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"positions",kind:"message",T:mn,repeated:!0},{no:3,name:"options",kind:"message",T:Or,opt:!0},{no:99,name:"extra",kind:"message",T:d}]),br=s.makeMessageType("viam.component.arm.v1.MoveThroughJointPositionsResponse",[]),pt=s.makeMessageType("viam.component.arm.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),wr=s.makeMessageType("viam.component.arm.v1.StopResponse",[]),kR=s.makeMessageType("viam.component.arm.v1.Status",()=>[{no:1,name:"end_position",kind:"message",T:qe},{no:2,name:"joint_positions",kind:"message",T:mn},{no:3,name:"is_moving",kind:"scalar",T:8}]),gt=s.makeMessageType("viam.component.arm.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Er=s.makeMessageType("viam.component.arm.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),Or=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}]),Cr=Object.freeze(Object.defineProperty({__proto__:null,GetEndPositionRequest:ct,GetEndPositionResponse:Rr,GetJointPositionsRequest:dt,GetJointPositionsResponse:_r,IsMovingRequest:gt,IsMovingResponse:Er,JointPositions:mn,MoveOptions:Or,MoveThroughJointPositionsRequest:Mr,MoveThroughJointPositionsResponse:br,MoveToJointPositionsRequest:ut,MoveToJointPositionsResponse:Ir,MoveToPositionRequest:lt,MoveToPositionResponse:Sr,Status:kR,StopRequest:pt,StopResponse:wr},Symbol.toStringTag,{value:"Module"})),Nr={typeName:"viam.component.arm.v1.ArmService",methods:{getEndPosition:{name:"GetEndPosition",I:ct,O:Rr,kind:m.Unary},moveToPosition:{name:"MoveToPosition",I:lt,O:Sr,kind:m.Unary},getJointPositions:{name:"GetJointPositions",I:dt,O:_r,kind:m.Unary},moveToJointPositions:{name:"MoveToJointPositions",I:ut,O:Ir,kind:m.Unary},moveThroughJointPositions:{name:"MoveThroughJointPositions",I:Mr,O:br,kind:m.Unary},stop:{name:"Stop",I:pt,O:wr,kind:m.Unary},isMoving:{name:"IsMoving",I:gt,O:Er,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getKinematics:{name:"GetKinematics",I:yr,O:vr,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Tt=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:d}]),Pr=s.makeMessageType("viam.component.base.v1.MoveStraightResponse",[]),kt=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:d}]),Ar=s.makeMessageType("viam.component.base.v1.SpinResponse",[]),yt=s.makeMessageType("viam.component.base.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Dr=s.makeMessageType("viam.component.base.v1.StopResponse",[]),vt=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:d}]),qr=s.makeMessageType("viam.component.base.v1.SetPowerResponse",[]),ht=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:d}]),Ur=s.makeMessageType("viam.component.base.v1.SetVelocityResponse",[]),ft=s.makeMessageType("viam.component.base.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Gr=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:d}]),Lr=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}]),Br=Object.freeze(Object.defineProperty({__proto__:null,GetPropertiesRequest:ua,GetPropertiesResponse:Lr,IsMovingRequest:ft,IsMovingResponse:Gr,MoveStraightRequest:Tt,MoveStraightResponse:Pr,SetPowerRequest:vt,SetPowerResponse:qr,SetVelocityRequest:ht,SetVelocityResponse:Ur,SpinRequest:kt,SpinResponse:Ar,StopRequest:yt,StopResponse:Dr},Symbol.toStringTag,{value:"Module"})),Fr={typeName:"viam.component.base.v1.BaseService",methods:{moveStraight:{name:"MoveStraight",I:Tt,O:Pr,kind:m.Unary},spin:{name:"Spin",I:kt,O:Ar,kind:m.Unary},setPower:{name:"SetPower",I:vt,O:qr,kind:m.Unary},setVelocity:{name:"SetVelocity",I:ht,O:Ur,kind:m.Unary},stop:{name:"Stop",I:yt,O:Dr,kind:m.Unary},isMoving:{name:"IsMoving",I:ft,O:Gr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary},getProperties:{name:"GetProperties",I:ua,O:Lr,kind:m.Unary}}},xr=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"}]),yR=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}}]),Rt=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:d}]),Jr=s.makeMessageType("viam.component.board.v1.SetGPIOResponse",[]),_t=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:d}]),zr=s.makeMessageType("viam.component.board.v1.GetGPIOResponse",()=>[{no:1,name:"high",kind:"scalar",T:8}]),St=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:d}]),Yr=s.makeMessageType("viam.component.board.v1.PWMResponse",()=>[{no:1,name:"duty_cycle_pct",kind:"scalar",T:1}]),It=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:d}]),$r=s.makeMessageType("viam.component.board.v1.SetPWMResponse",[]),Mt=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:d}]),Vr=s.makeMessageType("viam.component.board.v1.PWMFrequencyResponse",()=>[{no:1,name:"frequency_hz",kind:"scalar",T:4}]),bt=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:d}]),Wr=s.makeMessageType("viam.component.board.v1.SetPWMFrequencyResponse",[]),wt=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:d}]),jr=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}]),Et=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:d}]),Hr=s.makeMessageType("viam.component.board.v1.WriteAnalogResponse",[]),Ot=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:d}]),Kr=s.makeMessageType("viam.component.board.v1.GetDigitalInterruptValueResponse",()=>[{no:1,name:"value",kind:"scalar",T:3}]),Ct=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:d}]),Xr=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}]),Nt=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(xr)},{no:3,name:"duration",kind:"message",T:F,opt:!0},{no:99,name:"extra",kind:"message",T:d}]),Qr=s.makeMessageType("viam.component.board.v1.SetPowerModeResponse",[]),Zr=Object.freeze(Object.defineProperty({__proto__:null,GetDigitalInterruptValueRequest:Ot,GetDigitalInterruptValueResponse:Kr,GetGPIORequest:_t,GetGPIOResponse:zr,PWMFrequencyRequest:Mt,PWMFrequencyResponse:Vr,PWMRequest:St,PWMResponse:Yr,PowerMode:xr,ReadAnalogReaderRequest:wt,ReadAnalogReaderResponse:jr,SetGPIORequest:Rt,SetGPIOResponse:Jr,SetPWMFrequencyRequest:bt,SetPWMFrequencyResponse:Wr,SetPWMRequest:It,SetPWMResponse:$r,SetPowerModeRequest:Nt,SetPowerModeResponse:Qr,Status:yR,StreamTicksRequest:Ct,StreamTicksResponse:Xr,WriteAnalogRequest:Et,WriteAnalogResponse:Hr},Symbol.toStringTag,{value:"Module"})),em={typeName:"viam.component.board.v1.BoardService",methods:{setGPIO:{name:"SetGPIO",I:Rt,O:Jr,kind:m.Unary},getGPIO:{name:"GetGPIO",I:_t,O:zr,kind:m.Unary},pWM:{name:"PWM",I:St,O:Yr,kind:m.Unary},setPWM:{name:"SetPWM",I:It,O:$r,kind:m.Unary},pWMFrequency:{name:"PWMFrequency",I:Mt,O:Vr,kind:m.Unary},setPWMFrequency:{name:"SetPWMFrequency",I:bt,O:Wr,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},readAnalogReader:{name:"ReadAnalogReader",I:wt,O:jr,kind:m.Unary},writeAnalog:{name:"WriteAnalog",I:Et,O:Hr,kind:m.Unary},getDigitalInterruptValue:{name:"GetDigitalInterruptValue",I:Ot,O:Kr,kind:m.Unary},streamTicks:{name:"StreamTicks",I:Ct,O:Xr,kind:m.ServerStreaming},setPowerMode:{name:"SetPowerMode",I:Nt,O:Qr,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Pt=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"}]),At=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(Pt),opt:!0},{no:99,name:"extra",kind:"message",T:d}]),nm=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(Pt)}]),Dt=s.makeMessageType("viam.component.encoder.v1.ResetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),am=s.makeMessageType("viam.component.encoder.v1.ResetPositionResponse",[]),qt=s.makeMessageType("viam.component.encoder.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),tm=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}]),sm=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:At,GetPositionResponse:nm,GetPropertiesRequest:qt,GetPropertiesResponse:tm,PositionType:Pt,ResetPositionRequest:Dt,ResetPositionResponse:am},Symbol.toStringTag,{value:"Module"})),om={typeName:"viam.component.encoder.v1.EncoderService",methods:{getPosition:{name:"GetPosition",I:At,O:nm,kind:m.Unary},resetPosition:{name:"ResetPosition",I:Dt,O:am,kind:m.Unary},getProperties:{name:"GetProperties",I:qt,O:tm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Ut=s.makeMessageType("viam.component.gantry.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),im=s.makeMessageType("viam.component.gantry.v1.GetPositionResponse",()=>[{no:1,name:"positions_mm",kind:"scalar",T:1,repeated:!0}]),Gt=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:d}]),rm=s.makeMessageType("viam.component.gantry.v1.MoveToPositionResponse",[]),Lt=s.makeMessageType("viam.component.gantry.v1.HomeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),mm=s.makeMessageType("viam.component.gantry.v1.HomeResponse",()=>[{no:1,name:"homed",kind:"scalar",T:8}]),Bt=s.makeMessageType("viam.component.gantry.v1.GetLengthsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),cm=s.makeMessageType("viam.component.gantry.v1.GetLengthsResponse",()=>[{no:1,name:"lengths_mm",kind:"scalar",T:1,repeated:!0}]),Ft=s.makeMessageType("viam.component.gantry.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),dm=s.makeMessageType("viam.component.gantry.v1.StopResponse",[]),vR=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}]),xt=s.makeMessageType("viam.component.gantry.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),lm=s.makeMessageType("viam.component.gantry.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),hR=Object.freeze(Object.defineProperty({__proto__:null,GetLengthsRequest:Bt,GetLengthsResponse:cm,GetPositionRequest:Ut,GetPositionResponse:im,HomeRequest:Lt,HomeResponse:mm,IsMovingRequest:xt,IsMovingResponse:lm,MoveToPositionRequest:Gt,MoveToPositionResponse:rm,Status:vR,StopRequest:Ft,StopResponse:dm},Symbol.toStringTag,{value:"Module"})),um={typeName:"viam.component.gantry.v1.GantryService",methods:{getPosition:{name:"GetPosition",I:Ut,O:im,kind:m.Unary},moveToPosition:{name:"MoveToPosition",I:Gt,O:rm,kind:m.Unary},home:{name:"Home",I:Lt,O:mm,kind:m.Unary},getLengths:{name:"GetLengths",I:Bt,O:cm,kind:m.Unary},stop:{name:"Stop",I:Ft,O:dm,kind:m.Unary},isMoving:{name:"IsMoving",I:xt,O:lm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,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:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},fR=Object.freeze(Object.defineProperty({__proto__:null,GenericService:Jt},Symbol.toStringTag,{value:"Module"})),zt=s.makeMessageType("viam.component.gripper.v1.OpenRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),pm=s.makeMessageType("viam.component.gripper.v1.OpenResponse",[]),Yt=s.makeMessageType("viam.component.gripper.v1.GrabRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),gm=s.makeMessageType("viam.component.gripper.v1.GrabResponse",()=>[{no:1,name:"success",kind:"scalar",T:8},{no:99,name:"extra",kind:"message",T:d}]),$t=s.makeMessageType("viam.component.gripper.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Tm=s.makeMessageType("viam.component.gripper.v1.StopResponse",[]),Vt=s.makeMessageType("viam.component.gripper.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),km=s.makeMessageType("viam.component.gripper.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),RR=Object.freeze(Object.defineProperty({__proto__:null,GrabRequest:Yt,GrabResponse:gm,IsMovingRequest:Vt,IsMovingResponse:km,OpenRequest:zt,OpenResponse:pm,StopRequest:$t,StopResponse:Tm},Symbol.toStringTag,{value:"Module"})),ym={typeName:"viam.component.gripper.v1.GripperService",methods:{open:{name:"Open",I:zt,O:pm,kind:m.Unary},grab:{name:"Grab",I:Yt,O:gm,kind:m.Unary},stop:{name:"Stop",I:$t,O:Tm,kind:m.Unary},isMoving:{name:"IsMoving",I:Vt,O:km,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},vm=s.makeMessageType("viam.component.inputcontroller.v1.GetControlsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),hm=s.makeMessageType("viam.component.inputcontroller.v1.GetControlsResponse",()=>[{no:1,name:"controls",kind:"scalar",T:9,repeated:!0}]),Wt=s.makeMessageType("viam.component.inputcontroller.v1.GetEventsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),fm=s.makeMessageType("viam.component.inputcontroller.v1.GetEventsResponse",()=>[{no:1,name:"events",kind:"message",T:bn,repeated:!0}]),jt=s.makeMessageType("viam.component.inputcontroller.v1.TriggerEventRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:2,name:"event",kind:"message",T:bn},{no:99,name:"extra",kind:"message",T:d}]),Rm=s.makeMessageType("viam.component.inputcontroller.v1.TriggerEventResponse",[]),bn=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}]),_m=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsRequest",()=>[{no:1,name:"controller",kind:"scalar",T:9},{no:2,name:"events",kind:"message",T:Sm,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),Sm=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"}),Im=s.makeMessageType("viam.component.inputcontroller.v1.StreamEventsResponse",()=>[{no:1,name:"event",kind:"message",T:bn}]),Mm=Object.freeze(Object.defineProperty({__proto__:null,Event:bn,GetControlsRequest:vm,GetControlsResponse:hm,GetEventsRequest:Wt,GetEventsResponse:fm,Status:s.makeMessageType("viam.component.inputcontroller.v1.Status",()=>[{no:1,name:"events",kind:"message",T:bn,repeated:!0}]),StreamEventsRequest:_m,StreamEventsRequest_Events:Sm,StreamEventsResponse:Im,TriggerEventRequest:jt,TriggerEventResponse:Rm},Symbol.toStringTag,{value:"Module"})),bm={typeName:"viam.component.inputcontroller.v1.InputControllerService",methods:{getControls:{name:"GetControls",I:vm,O:hm,kind:m.Unary},getEvents:{name:"GetEvents",I:Wt,O:fm,kind:m.Unary},streamEvents:{name:"StreamEvents",I:_m,O:Im,kind:m.ServerStreaming},triggerEvent:{name:"TriggerEvent",I:jt,O:Rm,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},Ht=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:d}]),wm=s.makeMessageType("viam.component.motor.v1.SetPowerResponse",[]),Kt=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:d}]),Em=s.makeMessageType("viam.component.motor.v1.GoForResponse",[]),Xt=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:d}]),Om=s.makeMessageType("viam.component.motor.v1.GoToResponse",[]),Qt=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:d}]),Cm=s.makeMessageType("viam.component.motor.v1.SetRPMResponse",[]),Zt=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:d}]),Nm=s.makeMessageType("viam.component.motor.v1.ResetZeroPositionResponse",[]),es=s.makeMessageType("viam.component.motor.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Pm=s.makeMessageType("viam.component.motor.v1.GetPositionResponse",()=>[{no:1,name:"position",kind:"scalar",T:1}]),ns=s.makeMessageType("viam.component.motor.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Am=s.makeMessageType("viam.component.motor.v1.StopResponse",[]),as=s.makeMessageType("viam.component.motor.v1.IsPoweredRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Dm=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}]),ts=s.makeMessageType("viam.component.motor.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),qm=s.makeMessageType("viam.component.motor.v1.GetPropertiesResponse",()=>[{no:1,name:"position_reporting",kind:"scalar",T:8}]),_R=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}]),ss=s.makeMessageType("viam.component.motor.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Um=s.makeMessageType("viam.component.motor.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),SR=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:es,GetPositionResponse:Pm,GetPropertiesRequest:ts,GetPropertiesResponse:qm,GoForRequest:Kt,GoForResponse:Em,GoToRequest:Xt,GoToResponse:Om,IsMovingRequest:ss,IsMovingResponse:Um,IsPoweredRequest:as,IsPoweredResponse:Dm,ResetZeroPositionRequest:Zt,ResetZeroPositionResponse:Nm,SetPowerRequest:Ht,SetPowerResponse:wm,SetRPMRequest:Qt,SetRPMResponse:Cm,Status:_R,StopRequest:ns,StopResponse:Am},Symbol.toStringTag,{value:"Module"})),Gm={typeName:"viam.component.motor.v1.MotorService",methods:{setPower:{name:"SetPower",I:Ht,O:wm,kind:m.Unary},goFor:{name:"GoFor",I:Kt,O:Em,kind:m.Unary},goTo:{name:"GoTo",I:Xt,O:Om,kind:m.Unary},setRPM:{name:"SetRPM",I:Qt,O:Cm,kind:m.Unary},resetZeroPosition:{name:"ResetZeroPosition",I:Zt,O:Nm,kind:m.Unary},getPosition:{name:"GetPosition",I:es,O:Pm,kind:m.Unary},getProperties:{name:"GetProperties",I:ts,O:qm,kind:m.Unary},stop:{name:"Stop",I:ns,O:Am,kind:m.Unary},isPowered:{name:"IsPowered",I:as,O:Dm,kind:m.Unary},isMoving:{name:"IsMoving",I:ss,O:Um,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},os=s.makeMessageType("viam.component.movementsensor.v1.GetLinearVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Lm=s.makeMessageType("viam.component.movementsensor.v1.GetLinearVelocityResponse",()=>[{no:1,name:"linear_velocity",kind:"message",T:Ue}]),is=s.makeMessageType("viam.component.movementsensor.v1.GetAngularVelocityRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Bm=s.makeMessageType("viam.component.movementsensor.v1.GetAngularVelocityResponse",()=>[{no:1,name:"angular_velocity",kind:"message",T:Ue}]),rs=s.makeMessageType("viam.component.movementsensor.v1.GetCompassHeadingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Fm=s.makeMessageType("viam.component.movementsensor.v1.GetCompassHeadingResponse",()=>[{no:1,name:"value",kind:"scalar",T:1}]),ms=s.makeMessageType("viam.component.movementsensor.v1.GetOrientationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),xm=s.makeMessageType("viam.component.movementsensor.v1.GetOrientationResponse",()=>[{no:1,name:"orientation",kind:"message",T:dr}]),cs=s.makeMessageType("viam.component.movementsensor.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Jm=s.makeMessageType("viam.component.movementsensor.v1.GetPositionResponse",()=>[{no:1,name:"coordinate",kind:"message",T:Je},{no:2,name:"altitude_m",kind:"scalar",T:2}]),ds=s.makeMessageType("viam.component.movementsensor.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),zm=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}]),ls=s.makeMessageType("viam.component.movementsensor.v1.GetAccuracyRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Ym=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}]),us=s.makeMessageType("viam.component.movementsensor.v1.GetLinearAccelerationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),$m=s.makeMessageType("viam.component.movementsensor.v1.GetLinearAccelerationResponse",()=>[{no:1,name:"linear_acceleration",kind:"message",T:Ue}]),Vm=Object.freeze(Object.defineProperty({__proto__:null,GetAccuracyRequest:ls,GetAccuracyResponse:Ym,GetAngularVelocityRequest:is,GetAngularVelocityResponse:Bm,GetCompassHeadingRequest:rs,GetCompassHeadingResponse:Fm,GetLinearAccelerationRequest:us,GetLinearAccelerationResponse:$m,GetLinearVelocityRequest:os,GetLinearVelocityResponse:Lm,GetOrientationRequest:ms,GetOrientationResponse:xm,GetPositionRequest:cs,GetPositionResponse:Jm,GetPropertiesRequest:ds,GetPropertiesResponse:zm},Symbol.toStringTag,{value:"Module"})),Wm={typeName:"viam.component.movementsensor.v1.MovementSensorService",methods:{getLinearVelocity:{name:"GetLinearVelocity",I:os,O:Lm,kind:m.Unary},getAngularVelocity:{name:"GetAngularVelocity",I:is,O:Bm,kind:m.Unary},getCompassHeading:{name:"GetCompassHeading",I:rs,O:Fm,kind:m.Unary},getOrientation:{name:"GetOrientation",I:ms,O:xm,kind:m.Unary},getPosition:{name:"GetPosition",I:cs,O:Jm,kind:m.Unary},getProperties:{name:"GetProperties",I:ds,O:zm,kind:m.Unary},getAccuracy:{name:"GetAccuracy",I:ls,O:Ym,kind:m.Unary},getLinearAcceleration:{name:"GetLinearAcceleration",I:us,O:$m,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary},getReadings:{name:"GetReadings",I:Ke,O:la,kind:m.Unary}}},ps=s.makeMessageType("viam.component.powersensor.v1.GetVoltageRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),jm=s.makeMessageType("viam.component.powersensor.v1.GetVoltageResponse",()=>[{no:1,name:"volts",kind:"scalar",T:1},{no:2,name:"is_ac",kind:"scalar",T:8}]),gs=s.makeMessageType("viam.component.powersensor.v1.GetCurrentRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Hm=s.makeMessageType("viam.component.powersensor.v1.GetCurrentResponse",()=>[{no:1,name:"amperes",kind:"scalar",T:1},{no:2,name:"is_ac",kind:"scalar",T:8}]),Ts=s.makeMessageType("viam.component.powersensor.v1.GetPowerRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Km=s.makeMessageType("viam.component.powersensor.v1.GetPowerResponse",()=>[{no:1,name:"watts",kind:"scalar",T:1}]),IR=Object.freeze(Object.defineProperty({__proto__:null,GetCurrentRequest:gs,GetCurrentResponse:Hm,GetPowerRequest:Ts,GetPowerResponse:Km,GetVoltageRequest:ps,GetVoltageResponse:jm},Symbol.toStringTag,{value:"Module"})),Xm={typeName:"viam.component.powersensor.v1.PowerSensorService",methods:{getVoltage:{name:"GetVoltage",I:ps,O:jm,kind:m.Unary},getCurrent:{name:"GetCurrent",I:gs,O:Hm,kind:m.Unary},getPower:{name:"GetPower",I:Ts,O:Km,kind:m.Unary},getReadings:{name:"GetReadings",I:Ke,O:la,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},ks=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:d}]),Qm=s.makeMessageType("viam.component.servo.v1.MoveResponse",[]),ys=s.makeMessageType("viam.component.servo.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Zm=s.makeMessageType("viam.component.servo.v1.GetPositionResponse",()=>[{no:1,name:"position_deg",kind:"scalar",T:13}]),vs=s.makeMessageType("viam.component.servo.v1.StopRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),ec=s.makeMessageType("viam.component.servo.v1.StopResponse",[]),MR=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}]),hs=s.makeMessageType("viam.component.servo.v1.IsMovingRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),nc=s.makeMessageType("viam.component.servo.v1.IsMovingResponse",()=>[{no:1,name:"is_moving",kind:"scalar",T:8}]),bR=Object.freeze(Object.defineProperty({__proto__:null,GetPositionRequest:ys,GetPositionResponse:Zm,IsMovingRequest:hs,IsMovingResponse:nc,MoveRequest:ks,MoveResponse:Qm,Status:MR,StopRequest:vs,StopResponse:ec},Symbol.toStringTag,{value:"Module"})),ac={typeName:"viam.component.servo.v1.ServoService",methods:{move:{name:"Move",I:ks,O:Qm,kind:m.Unary},getPosition:{name:"GetPosition",I:ys,O:Zm,kind:m.Unary},stop:{name:"Stop",I:vs,O:ec,kind:m.Unary},isMoving:{name:"IsMoving",I:hs,O:nc,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},tc=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"}]),sc=s.makeMessageType("viam.robot.v1.TunnelRequest",()=>[{no:1,name:"destination_port",kind:"scalar",T:13},{no:2,name:"data",kind:"scalar",T:12}]),oc=s.makeMessageType("viam.robot.v1.TunnelResponse",()=>[{no:1,name:"data",kind:"scalar",T:12}]),ic=s.makeMessageType("viam.robot.v1.ListTunnelsRequest",[]),rc=s.makeMessageType("viam.robot.v1.ListTunnelsResponse",()=>[{no:1,name:"tunnels",kind:"message",T:mc,repeated:!0}]),mc=s.makeMessageType("viam.robot.v1.Tunnel",()=>[{no:1,name:"port",kind:"scalar",T:13},{no:2,name:"connection_timeout",kind:"message",T:F}]),cc=s.makeMessageType("viam.robot.v1.FrameSystemConfig",()=>[{no:1,name:"frame",kind:"message",T:rn},{no:2,name:"kinematics",kind:"message",T:d}]),dc=s.makeMessageType("viam.robot.v1.FrameSystemConfigRequest",()=>[{no:1,name:"supplemental_transforms",kind:"message",T:rn,repeated:!0}]),lc=s.makeMessageType("viam.robot.v1.FrameSystemConfigResponse",()=>[{no:1,name:"frame_system_configs",kind:"message",T:cc,repeated:!0}]),fs=s.makeMessageType("viam.robot.v1.TransformPoseRequest",()=>[{no:1,name:"source",kind:"message",T:on},{no:2,name:"destination",kind:"scalar",T:9},{no:3,name:"supplemental_transforms",kind:"message",T:rn,repeated:!0}]),uc=s.makeMessageType("viam.robot.v1.TransformPoseResponse",()=>[{no:1,name:"pose",kind:"message",T:on}]),Rs=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}]),pc=s.makeMessageType("viam.robot.v1.TransformPCDResponse",()=>[{no:1,name:"point_cloud_pcd",kind:"scalar",T:12}]),gc=s.makeMessageType("viam.robot.v1.ResourceNamesRequest",[]),Tc=s.makeMessageType("viam.robot.v1.ResourceNamesResponse",()=>[{no:1,name:"resources",kind:"message",T:x,repeated:!0}]),kc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtype",()=>[{no:1,name:"subtype",kind:"message",T:x},{no:2,name:"proto_service",kind:"scalar",T:9}]),yc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtypesRequest",[]),vc=s.makeMessageType("viam.robot.v1.ResourceRPCSubtypesResponse",()=>[{no:1,name:"resource_rpc_subtypes",kind:"message",T:kc,repeated:!0}]),hc=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:d},{no:4,name:"started",kind:"message",T:S},{no:5,name:"session_id",kind:"scalar",T:9,opt:!0}]),fc=s.makeMessageType("viam.robot.v1.GetOperationsRequest",[]),Rc=s.makeMessageType("viam.robot.v1.GetOperationsResponse",()=>[{no:1,name:"operations",kind:"message",T:hc,repeated:!0}]),_c=s.makeMessageType("viam.robot.v1.CancelOperationRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Sc=s.makeMessageType("viam.robot.v1.CancelOperationResponse",[]),Ic=s.makeMessageType("viam.robot.v1.BlockForOperationRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Mc=s.makeMessageType("viam.robot.v1.BlockForOperationResponse",[]),bc=s.makeMessageType("viam.robot.v1.PeerConnectionInfo",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(tc)},{no:2,name:"remote_address",kind:"scalar",T:9,opt:!0},{no:3,name:"local_address",kind:"scalar",T:9,opt:!0}]),wc=s.makeMessageType("viam.robot.v1.Session",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"peer_connection_info",kind:"message",T:bc,opt:!0}]),Ec=s.makeMessageType("viam.robot.v1.GetSessionsRequest",[]),Oc=s.makeMessageType("viam.robot.v1.GetSessionsResponse",()=>[{no:1,name:"sessions",kind:"message",T:wc,repeated:!0}]),Cc=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}]),_s=s.makeMessageType("viam.robot.v1.GetModelsFromModulesRequest",[]),Nc=s.makeMessageType("viam.robot.v1.GetModelsFromModulesResponse",()=>[{no:1,name:"models",kind:"message",T:Cc,repeated:!0}]),Ss=s.makeMessageType("viam.robot.v1.Status",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"status",kind:"message",T:d},{no:3,name:"last_reconfigured",kind:"message",T:S}]),Pc=s.makeMessageType("viam.robot.v1.GetStatusRequest",()=>[{no:1,name:"resource_names",kind:"message",T:x,repeated:!0}]),Ac=s.makeMessageType("viam.robot.v1.GetStatusResponse",()=>[{no:1,name:"status",kind:"message",T:Ss,repeated:!0}]),Dc=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}]),qc=s.makeMessageType("viam.robot.v1.StreamStatusResponse",()=>[{no:1,name:"status",kind:"message",T:Ss,repeated:!0}]),Uc=s.makeMessageType("viam.robot.v1.StopExtraParameters",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"params",kind:"message",T:d}]),Gc=s.makeMessageType("viam.robot.v1.StopAllRequest",()=>[{no:99,name:"extra",kind:"message",T:Uc,repeated:!0}]),Lc=s.makeMessageType("viam.robot.v1.StopAllResponse",[]),Is=s.makeMessageType("viam.robot.v1.StartSessionRequest",()=>[{no:1,name:"resume",kind:"scalar",T:9}]),Bc=s.makeMessageType("viam.robot.v1.StartSessionResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"heartbeat_window",kind:"message",T:F}]),Ms=s.makeMessageType("viam.robot.v1.SendSessionHeartbeatRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Fc=s.makeMessageType("viam.robot.v1.SendSessionHeartbeatResponse",[]),xc=s.makeMessageType("viam.robot.v1.LogRequest",()=>[{no:1,name:"logs",kind:"message",T:In,repeated:!0}]),Jc=s.makeMessageType("viam.robot.v1.LogResponse",[]),zc=s.makeMessageType("viam.robot.v1.GetCloudMetadataRequest",[]),bs=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}]),ws=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"}]),Yc=s.makeMessageType("viam.robot.v1.RestartModuleResponse",[]),$c=s.makeMessageType("viam.robot.v1.ShutdownRequest",[]),Vc=s.makeMessageType("viam.robot.v1.ShutdownResponse",[]),Wc=s.makeMessageType("viam.robot.v1.GetMachineStatusRequest",[]),jc=s.makeMessageType("viam.robot.v1.GetMachineStatusResponse",()=>[{no:1,name:"resources",kind:"message",T:Kc,repeated:!0},{no:2,name:"config",kind:"message",T:Qc},{no:3,name:"state",kind:"enum",T:s.getEnumType(Hc)}]),Hc=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"}]),Kc=s.makeMessageType("viam.robot.v1.ResourceStatus",()=>[{no:1,name:"name",kind:"message",T:x},{no:2,name:"state",kind:"enum",T:s.getEnumType(Xc)},{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:bs,opt:!0}]),Xc=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"}]),Qc=s.makeMessageType("viam.robot.v1.ConfigStatus",()=>[{no:1,name:"revision",kind:"scalar",T:9},{no:2,name:"last_updated",kind:"message",T:S}]),Zc=s.makeMessageType("viam.robot.v1.GetVersionRequest",[]),ed=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}]),wR=Object.freeze(Object.defineProperty({__proto__:null,BlockForOperationRequest:Ic,BlockForOperationResponse:Mc,CancelOperationRequest:_c,CancelOperationResponse:Sc,ConfigStatus:Qc,FrameSystemConfig:cc,FrameSystemConfigRequest:dc,FrameSystemConfigResponse:lc,GetCloudMetadataRequest:zc,GetCloudMetadataResponse:bs,GetMachineStatusRequest:Wc,GetMachineStatusResponse:jc,GetMachineStatusResponse_State:Hc,GetModelsFromModulesRequest:_s,GetModelsFromModulesResponse:Nc,GetOperationsRequest:fc,GetOperationsResponse:Rc,GetSessionsRequest:Ec,GetSessionsResponse:Oc,GetStatusRequest:Pc,GetStatusResponse:Ac,GetVersionRequest:Zc,GetVersionResponse:ed,ListTunnelsRequest:ic,ListTunnelsResponse:rc,LogRequest:xc,LogResponse:Jc,ModuleModel:Cc,Operation:hc,PeerConnectionInfo:bc,PeerConnectionType:tc,ResourceNamesRequest:gc,ResourceNamesResponse:Tc,ResourceRPCSubtype:kc,ResourceRPCSubtypesRequest:yc,ResourceRPCSubtypesResponse:vc,ResourceStatus:Kc,ResourceStatus_State:Xc,RestartModuleRequest:ws,RestartModuleResponse:Yc,SendSessionHeartbeatRequest:Ms,SendSessionHeartbeatResponse:Fc,Session:wc,ShutdownRequest:$c,ShutdownResponse:Vc,StartSessionRequest:Is,StartSessionResponse:Bc,Status:Ss,StopAllRequest:Gc,StopAllResponse:Lc,StopExtraParameters:Uc,StreamStatusRequest:Dc,StreamStatusResponse:qc,TransformPCDRequest:Rs,TransformPCDResponse:pc,TransformPoseRequest:fs,TransformPoseResponse:uc,Tunnel:mc,TunnelRequest:sc,TunnelResponse:oc},Symbol.toStringTag,{value:"Module"})),Es={typeName:"viam.robot.v1.RobotService",methods:{getOperations:{name:"GetOperations",I:fc,O:Rc,kind:m.Unary},getSessions:{name:"GetSessions",I:Ec,O:Oc,kind:m.Unary},resourceNames:{name:"ResourceNames",I:gc,O:Tc,kind:m.Unary},resourceRPCSubtypes:{name:"ResourceRPCSubtypes",I:yc,O:vc,kind:m.Unary},cancelOperation:{name:"CancelOperation",I:_c,O:Sc,kind:m.Unary},blockForOperation:{name:"BlockForOperation",I:Ic,O:Mc,kind:m.Unary},getModelsFromModules:{name:"GetModelsFromModules",I:_s,O:Nc,kind:m.Unary},frameSystemConfig:{name:"FrameSystemConfig",I:dc,O:lc,kind:m.Unary},transformPose:{name:"TransformPose",I:fs,O:uc,kind:m.Unary},transformPCD:{name:"TransformPCD",I:Rs,O:pc,kind:m.Unary},getStatus:{name:"GetStatus",I:Pc,O:Ac,kind:m.Unary},streamStatus:{name:"StreamStatus",I:Dc,O:qc,kind:m.ServerStreaming},stopAll:{name:"StopAll",I:Gc,O:Lc,kind:m.Unary},startSession:{name:"StartSession",I:Is,O:Bc,kind:m.Unary},sendSessionHeartbeat:{name:"SendSessionHeartbeat",I:Ms,O:Fc,kind:m.Unary},log:{name:"Log",I:xc,O:Jc,kind:m.Unary},getCloudMetadata:{name:"GetCloudMetadata",I:zc,O:bs,kind:m.Unary},restartModule:{name:"RestartModule",I:ws,O:Yc,kind:m.Unary},shutdown:{name:"Shutdown",I:$c,O:Vc,kind:m.Unary},getMachineStatus:{name:"GetMachineStatus",I:Wc,O:jc,kind:m.Unary},getVersion:{name:"GetVersion",I:Zc,O:ed,kind:m.Unary},tunnel:{name:"Tunnel",I:sc,O:oc,kind:m.BiDiStreaming},listTunnels:{name:"ListTunnels",I:ic,O:rc,kind:m.Unary}}},Os=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"}]),nd=s.makeMessageType("viam.app.v1.RobotConfig",()=>[{no:1,name:"cloud",kind:"message",T:sd},{no:2,name:"remotes",kind:"message",T:_d,repeated:!0},{no:3,name:"components",kind:"message",T:Cs,repeated:!0},{no:4,name:"processes",kind:"message",T:od,repeated:!0},{no:5,name:"services",kind:"message",T:id,repeated:!0},{no:6,name:"network",kind:"message",T:rd,opt:!0},{no:7,name:"auth",kind:"message",T:dd,opt:!0},{no:8,name:"debug",kind:"scalar",T:8,opt:!0},{no:9,name:"modules",kind:"message",T:bd,repeated:!0},{no:10,name:"disable_partial_start",kind:"scalar",T:8,opt:!0},{no:11,name:"packages",kind:"message",T:wd,repeated:!0},{no:12,name:"overwrite_fragment_status",kind:"message",T:pa,repeated:!0},{no:13,name:"enable_web_profile",kind:"scalar",T:8},{no:14,name:"log",kind:"message",T:ad,repeated:!0},{no:15,name:"revision",kind:"scalar",T:9},{no:16,name:"maintenance",kind:"message",T:Ed,opt:!0},{no:17,name:"disable_log_deduplication",kind:"scalar",T:8}]),ad=s.makeMessageType("viam.app.v1.LogPatternConfig",()=>[{no:1,name:"pattern",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:9}]),td=s.makeMessageType("viam.app.v1.LocationSecret",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"secret",kind:"scalar",T:9}]),pa=s.makeMessageType("viam.app.v1.AppValidationStatus",()=>[{no:1,name:"error",kind:"scalar",T:9}]),sd=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:td,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}]),Cs=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:Ns},{no:6,name:"depends_on",kind:"scalar",T:9,repeated:!0},{no:7,name:"service_configs",kind:"message",T:ga,repeated:!0},{no:8,name:"attributes",kind:"message",T:d},{no:9,name:"api",kind:"scalar",T:9},{no:10,name:"log_configuration",kind:"message",T:Ps}]),ga=s.makeMessageType("viam.app.v1.ResourceLevelServiceConfig",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"attributes",kind:"message",T:d}]),od=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}]),id=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:d},{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:ga,repeated:!0},{no:11,name:"log_configuration",kind:"message",T:Ps}]),rd=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:md},{no:6,name:"traffic_tunnel_endpoints",kind:"message",T:cd,repeated:!0},{no:7,name:"no_tls",kind:"scalar",T:8}]),md=s.makeMessageType("viam.app.v1.SessionsConfig",()=>[{no:1,name:"heartbeat_window",kind:"message",T:F}]),cd=s.makeMessageType("viam.app.v1.TrafficTunnelEndpoint",()=>[{no:1,name:"port",kind:"scalar",T:5},{no:2,name:"connection_timeout",kind:"message",T:F}]),dd=s.makeMessageType("viam.app.v1.AuthConfig",()=>[{no:1,name:"handlers",kind:"message",T:pd,repeated:!0},{no:2,name:"tls_auth_entities",kind:"scalar",T:9,repeated:!0},{no:3,name:"external_auth_config",kind:"message",T:ud,opt:!0}]),ld=s.makeMessageType("viam.app.v1.JWKSFile",()=>[{no:1,name:"json",kind:"message",T:d}]),ud=s.makeMessageType("viam.app.v1.ExternalAuthConfig",()=>[{no:1,name:"jwks",kind:"message",T:ld}]),pd=s.makeMessageType("viam.app.v1.AuthHandlerConfig",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Os)},{no:5,name:"config",kind:"message",T:d}]),Ns=s.makeMessageType("viam.app.v1.Frame",()=>[{no:1,name:"parent",kind:"scalar",T:9},{no:2,name:"translation",kind:"message",T:gd},{no:3,name:"orientation",kind:"message",T:Td},{no:4,name:"geometry",kind:"message",T:He}]),Ps=s.makeMessageType("viam.app.v1.LogConfiguration",()=>[{no:1,name:"level",kind:"scalar",T:9}]),gd=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}]),Td=s.makeMessageType("viam.app.v1.Orientation",()=>[{no:1,name:"no_orientation",kind:"message",T:kd,oneof:"type"},{no:2,name:"vector_radians",kind:"message",T:yd,oneof:"type"},{no:3,name:"vector_degrees",kind:"message",T:vd,oneof:"type"},{no:4,name:"euler_angles",kind:"message",T:hd,oneof:"type"},{no:5,name:"axis_angles",kind:"message",T:fd,oneof:"type"},{no:6,name:"quaternion",kind:"message",T:Rd,oneof:"type"}]),kd=s.makeMessageType("viam.app.v1.Orientation.NoOrientation",[],{localName:"Orientation_NoOrientation"}),yd=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"}),vd=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"}),hd=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"}),fd=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"}),Rd=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"}),_d=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:Ns},{no:4,name:"auth",kind:"message",T:Sd},{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:ga,repeated:!0},{no:10,name:"secret",kind:"scalar",T:9}]),Sd=s.makeMessageType("viam.app.v1.RemoteAuth",()=>[{no:1,name:"credentials",kind:"message",T:Id},{no:2,name:"entity",kind:"scalar",T:9}]),Id=s.makeMessageType("viam.app.v1.RemoteAuth.Credentials",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Os)},{no:2,name:"payload",kind:"scalar",T:9}],{localName:"RemoteAuth_Credentials"}),Md=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}]),ER=s.makeMessageType("viam.app.v1.ConfigRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"agent_info",kind:"message",T:Md,opt:!0}]),OR=s.makeMessageType("viam.app.v1.ConfigResponse",()=>[{no:1,name:"config",kind:"message",T:nd}]),CR=s.makeMessageType("viam.app.v1.CertificateRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),NR=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}]),PR=s.makeMessageType("viam.app.v1.LogRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"logs",kind:"message",T:In,repeated:!0}]),AR=s.makeMessageType("viam.app.v1.LogResponse",[]),DR=s.makeMessageType("viam.app.v1.NeedsRestartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),qR=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}]),bd=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:pa},{no:8,name:"first_run_timeout",kind:"message",T:F}]),wd=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:pa}]),Ed=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}]),UR=Object.freeze(Object.defineProperty({__proto__:null,AgentInfo:Md,AppValidationStatus:pa,AuthConfig:dd,AuthHandlerConfig:pd,CertificateRequest:CR,CertificateResponse:NR,CloudConfig:sd,ComponentConfig:Cs,ConfigRequest:ER,ConfigResponse:OR,CredentialsType:Os,ExternalAuthConfig:ud,Frame:Ns,JWKSFile:ld,LocationSecret:td,LogConfiguration:Ps,LogPatternConfig:ad,LogRequest:PR,LogResponse:AR,MaintenanceConfig:Ed,ModuleConfig:bd,NeedsRestartRequest:DR,NeedsRestartResponse:qR,NetworkConfig:rd,Orientation:Td,Orientation_AxisAngles:fd,Orientation_EulerAngles:hd,Orientation_NoOrientation:kd,Orientation_OrientationVectorDegrees:vd,Orientation_OrientationVectorRadians:yd,Orientation_Quaternion:Rd,PackageConfig:wd,ProcessConfig:od,RemoteAuth:Sd,RemoteAuth_Credentials:Id,RemoteConfig:_d,ResourceLevelServiceConfig:ga,RobotConfig:nd,ServiceConfig:id,SessionsConfig:md,TrafficTunnelEndpoint:cd,Translation:gd},Symbol.toStringTag,{value:"Module"})),As=s.makeMessageType("viam.service.discovery.v1.DiscoverResourcesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Od=s.makeMessageType("viam.service.discovery.v1.DiscoverResourcesResponse",()=>[{no:1,name:"discoveries",kind:"message",T:Cs,repeated:!0}]),GR=Object.freeze(Object.defineProperty({__proto__:null,DiscoverResourcesRequest:As,DiscoverResourcesResponse:Od},Symbol.toStringTag,{value:"Module"})),Cd={typeName:"viam.service.discovery.v1.DiscoveryService",methods:{discoverResources:{name:"DiscoverResources",I:As,O:Od,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},Nd=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"}]),Ds=s.makeMessageType("viam.service.motion.v1.MoveRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"destination",kind:"message",T:on},{no:3,name:"component_name",kind:"message",T:x},{no:4,name:"world_state",kind:"message",T:Tr,opt:!0},{no:5,name:"constraints",kind:"message",T:Fd,opt:!0},{no:99,name:"extra",kind:"message",T:d}]),Pd=s.makeMessageType("viam.service.motion.v1.MoveResponse",()=>[{no:1,name:"success",kind:"scalar",T:8}]),qs=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:Us,opt:!0},{no:6,name:"obstacles",kind:"message",T:He,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),Ad=s.makeMessageType("viam.service.motion.v1.MoveOnMapResponse",()=>[{no:1,name:"execution_id",kind:"scalar",T:9}]),Dd=s.makeMessageType("viam.service.motion.v1.ObstacleDetector",()=>[{no:1,name:"vision_service",kind:"message",T:x},{no:2,name:"camera",kind:"message",T:x}]),Us=s.makeMessageType("viam.service.motion.v1.MotionConfiguration",()=>[{no:1,name:"obstacle_detectors",kind:"message",T:Dd,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}]),Gs=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:Us,opt:!0},{no:8,name:"bounding_regions",kind:"message",T:da,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),qd=s.makeMessageType("viam.service.motion.v1.MoveOnGlobeResponse",()=>[{no:1,name:"execution_id",kind:"scalar",T:9}]),Ls=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:rn,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),Ud=s.makeMessageType("viam.service.motion.v1.GetPoseResponse",()=>[{no:1,name:"pose",kind:"message",T:on}]),Bs=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:d}]),Gd=s.makeMessageType("viam.service.motion.v1.StopPlanResponse",[]),Fs=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:d}]),Ld=s.makeMessageType("viam.service.motion.v1.ListPlanStatusesResponse",()=>[{no:1,name:"plan_statuses_with_ids",kind:"message",T:$d,repeated:!0}]),xs=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:d}]),Bd=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}]),Fd=s.makeMessageType("viam.service.motion.v1.Constraints",()=>[{no:1,name:"linear_constraint",kind:"message",T:xd,repeated:!0},{no:2,name:"orientation_constraint",kind:"message",T:Jd,repeated:!0},{no:3,name:"collision_specification",kind:"message",T:zd,repeated:!0}]),xd=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}]),Jd=s.makeMessageType("viam.service.motion.v1.OrientationConstraint",()=>[{no:1,name:"orientation_tolerance_degs",kind:"scalar",T:2,opt:!0}]),zd=s.makeMessageType("viam.service.motion.v1.CollisionSpecification",()=>[{no:1,name:"allows",kind:"message",T:Yd,repeated:!0}]),Yd=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:Vd},{no:2,name:"status",kind:"message",T:Ta},{no:3,name:"status_history",kind:"message",T:Ta,repeated:!0}]),$d=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:Ta}]),Ta=s.makeMessageType("viam.service.motion.v1.PlanStatus",()=>[{no:1,name:"state",kind:"enum",T:s.getEnumType(Nd)},{no:2,name:"timestamp",kind:"message",T:S},{no:3,name:"reason",kind:"scalar",T:9,opt:!0}]),Vd=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:Wd,repeated:!0}]),Wd=s.makeMessageType("viam.service.motion.v1.PlanStep",()=>[{no:1,name:"step",kind:"map",K:9,V:{kind:"message",T:jd}}]),jd=s.makeMessageType("viam.service.motion.v1.ComponentState",()=>[{no:1,name:"pose",kind:"message",T:qe}]),Hd=Object.freeze(Object.defineProperty({__proto__:null,CollisionSpecification:zd,CollisionSpecification_AllowedFrameCollisions:Yd,ComponentState:jd,Constraints:Fd,GetPlanRequest:xs,GetPlanResponse:Bd,GetPoseRequest:Ls,GetPoseResponse:Ud,LinearConstraint:xd,ListPlanStatusesRequest:Fs,ListPlanStatusesResponse:Ld,MotionConfiguration:Us,MoveOnGlobeRequest:Gs,MoveOnGlobeResponse:qd,MoveOnMapRequest:qs,MoveOnMapResponse:Ad,MoveRequest:Ds,MoveResponse:Pd,ObstacleDetector:Dd,OrientationConstraint:Jd,Plan:Vd,PlanState:Nd,PlanStatus:Ta,PlanStatusWithID:$d,PlanStep:Wd,PlanWithStatus:Js,StopPlanRequest:Bs,StopPlanResponse:Gd},Symbol.toStringTag,{value:"Module"})),Kd={typeName:"viam.service.motion.v1.MotionService",methods:{move:{name:"Move",I:Ds,O:Pd,kind:m.Unary},moveOnMap:{name:"MoveOnMap",I:qs,O:Ad,kind:m.Unary},moveOnGlobe:{name:"MoveOnGlobe",I:Gs,O:qd,kind:m.Unary},getPose:{name:"GetPose",I:Ls,O:Ud,kind:m.Unary},stopPlan:{name:"StopPlan",I:Bs,O:Gd,kind:m.Unary},listPlanStatuses:{name:"ListPlanStatuses",I:Fs,O:Ld,kind:m.Unary},getPlan:{name:"GetPlan",I:xs,O:Bd,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},Xd=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"}]),zs=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"}]),Ys=s.makeMessageType("viam.service.navigation.v1.GetModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Qd=s.makeMessageType("viam.service.navigation.v1.GetModeResponse",()=>[{no:1,name:"mode",kind:"enum",T:s.getEnumType(zs)}]),$s=s.makeMessageType("viam.service.navigation.v1.SetModeRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"mode",kind:"enum",T:s.getEnumType(zs)},{no:99,name:"extra",kind:"message",T:d}]),Zd=s.makeMessageType("viam.service.navigation.v1.SetModeResponse",[]),el=s.makeMessageType("viam.service.navigation.v1.Waypoint",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"location",kind:"message",T:Je}]),Vs=s.makeMessageType("viam.service.navigation.v1.GetLocationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),nl=s.makeMessageType("viam.service.navigation.v1.GetLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Je},{no:2,name:"compass_heading",kind:"scalar",T:1}]),Ws=s.makeMessageType("viam.service.navigation.v1.GetWaypointsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),al=s.makeMessageType("viam.service.navigation.v1.GetWaypointsResponse",()=>[{no:1,name:"waypoints",kind:"message",T:el,repeated:!0}]),js=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:d}]),tl=s.makeMessageType("viam.service.navigation.v1.AddWaypointResponse",[]),Hs=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:d}]),sl=s.makeMessageType("viam.service.navigation.v1.RemoveWaypointResponse",[]),Ks=s.makeMessageType("viam.service.navigation.v1.GetObstaclesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),ol=s.makeMessageType("viam.service.navigation.v1.GetObstaclesResponse",()=>[{no:1,name:"obstacles",kind:"message",T:da,repeated:!0}]),il=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}]),Xs=s.makeMessageType("viam.service.navigation.v1.GetPathsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),rl=s.makeMessageType("viam.service.navigation.v1.GetPathsResponse",()=>[{no:1,name:"paths",kind:"message",T:il,repeated:!0}]),Qs=s.makeMessageType("viam.service.navigation.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),ml=s.makeMessageType("viam.service.navigation.v1.GetPropertiesResponse",()=>[{no:1,name:"map_type",kind:"enum",T:s.getEnumType(Xd)}]),cl=Object.freeze(Object.defineProperty({__proto__:null,AddWaypointRequest:js,AddWaypointResponse:tl,GetLocationRequest:Vs,GetLocationResponse:nl,GetModeRequest:Ys,GetModeResponse:Qd,GetObstaclesRequest:Ks,GetObstaclesResponse:ol,GetPathsRequest:Xs,GetPathsResponse:rl,GetPropertiesRequest:Qs,GetPropertiesResponse:ml,GetWaypointsRequest:Ws,GetWaypointsResponse:al,MapType:Xd,Mode:zs,Path:il,RemoveWaypointRequest:Hs,RemoveWaypointResponse:sl,SetModeRequest:$s,SetModeResponse:Zd,Waypoint:el},Symbol.toStringTag,{value:"Module"})),dl={typeName:"viam.service.navigation.v1.NavigationService",methods:{getMode:{name:"GetMode",I:Ys,O:Qd,kind:m.Unary},setMode:{name:"SetMode",I:$s,O:Zd,kind:m.Unary},getLocation:{name:"GetLocation",I:Vs,O:nl,kind:m.Unary},getWaypoints:{name:"GetWaypoints",I:Ws,O:al,kind:m.Unary},addWaypoint:{name:"AddWaypoint",I:js,O:tl,kind:m.Unary},removeWaypoint:{name:"RemoveWaypoint",I:Hs,O:sl,kind:m.Unary},getObstacles:{name:"GetObstacles",I:Ks,O:ol,kind:m.Unary},getPaths:{name:"GetPaths",I:Xs,O:rl,kind:m.Unary},getProperties:{name:"GetProperties",I:Qs,O:ml,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},ll=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"}]),ul=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"}]),Zs=s.makeMessageType("viam.service.slam.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),pl=s.makeMessageType("viam.service.slam.v1.GetPositionResponse",()=>[{no:1,name:"pose",kind:"message",T:qe}]),eo=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}]),gl=s.makeMessageType("viam.service.slam.v1.GetPointCloudMapResponse",()=>[{no:1,name:"point_cloud_pcd_chunk",kind:"scalar",T:12}]),no=s.makeMessageType("viam.service.slam.v1.GetInternalStateRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Tl=s.makeMessageType("viam.service.slam.v1.GetInternalStateResponse",()=>[{no:1,name:"internal_state_chunk",kind:"scalar",T:12}]),ao=s.makeMessageType("viam.service.slam.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),kl=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(ll)},{no:3,name:"internal_state_file_type",kind:"scalar",T:9,opt:!0},{no:4,name:"sensor_info",kind:"message",T:yl,repeated:!0}]),yl=s.makeMessageType("viam.service.slam.v1.SensorInfo",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:s.getEnumType(ul)}]),vl=Object.freeze(Object.defineProperty({__proto__:null,GetInternalStateRequest:no,GetInternalStateResponse:Tl,GetPointCloudMapRequest:eo,GetPointCloudMapResponse:gl,GetPositionRequest:Zs,GetPositionResponse:pl,GetPropertiesRequest:ao,GetPropertiesResponse:kl,MappingMode:ll,SensorInfo:yl,SensorType:ul},Symbol.toStringTag,{value:"Module"})),hl={typeName:"viam.service.slam.v1.SLAMService",methods:{getPosition:{name:"GetPosition",I:Zs,O:pl,kind:m.Unary},getPointCloudMap:{name:"GetPointCloudMap",I:eo,O:gl,kind:m.ServerStreaming},getInternalState:{name:"GetInternalState",I:no,O:Tl,kind:m.ServerStreaming},getProperties:{name:"GetProperties",I:ao,O:kl,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},fl=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"}]),to=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:d}]),Rl=s.makeMessageType("viam.component.camera.v1.GetImageResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"image",kind:"scalar",T:12}]),_l=s.makeMessageType("viam.component.camera.v1.GetImagesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Sl=s.makeMessageType("viam.component.camera.v1.GetImagesResponse",()=>[{no:1,name:"images",kind:"message",T:so,repeated:!0},{no:84260,name:"response_metadata",kind:"message",T:kr}]),so=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(fl)},{no:3,name:"image",kind:"scalar",T:12}]),oo=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:d}]),io=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:d}]),Il=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}]),Ml=s.makeMessageType("viam.component.camera.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),bl=s.makeMessageType("viam.component.camera.v1.GetPropertiesResponse",()=>[{no:1,name:"supports_pcd",kind:"scalar",T:8},{no:2,name:"intrinsic_parameters",kind:"message",T:Ol},{no:3,name:"distortion_parameters",kind:"message",T:Cl},{no:4,name:"mime_types",kind:"scalar",T:9,repeated:!0},{no:5,name:"frame_rate",kind:"scalar",T:2,opt:!0}]),LR=s.makeMessageType("viam.component.camera.v1.Webcams",()=>[{no:1,name:"webcams",kind:"message",T:wl,repeated:!0}]),wl=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:El,repeated:!0},{no:4,name:"name",kind:"scalar",T:9},{no:5,name:"id",kind:"scalar",T:9}]),El=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}]),Ol=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}]),Cl=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}]),BR=Object.freeze(Object.defineProperty({__proto__:null,DistortionParameters:Cl,Format:fl,GetImageRequest:to,GetImageResponse:Rl,GetImagesRequest:_l,GetImagesResponse:Sl,GetPointCloudRequest:io,GetPointCloudResponse:Il,GetPropertiesRequest:Ml,GetPropertiesResponse:bl,Image:so,IntrinsicParameters:Ol,Property:El,RenderFrameRequest:oo,Webcam:wl,Webcams:LR},Symbol.toStringTag,{value:"Module"})),ro=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:d}]),Nl=s.makeMessageType("viam.service.vision.v1.GetDetectionsResponse",()=>[{no:1,name:"detections",kind:"message",T:ka,repeated:!0}]),mo=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:d}]),Pl=s.makeMessageType("viam.service.vision.v1.GetDetectionsFromCameraResponse",()=>[{no:1,name:"detections",kind:"message",T:ka,repeated:!0}]),ka=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}]),co=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:d}]),Al=s.makeMessageType("viam.service.vision.v1.GetClassificationsResponse",()=>[{no:1,name:"classifications",kind:"message",T:ya,repeated:!0}]),lo=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:d}]),Dl=s.makeMessageType("viam.service.vision.v1.GetClassificationsFromCameraResponse",()=>[{no:1,name:"classifications",kind:"message",T:ya,repeated:!0}]),ya=s.makeMessageType("viam.service.vision.v1.Classification",()=>[{no:1,name:"class_name",kind:"scalar",T:9},{no:2,name:"confidence",kind:"scalar",T:1}]),uo=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:d}]),ql=s.makeMessageType("viam.service.vision.v1.GetObjectPointCloudsResponse",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"objects",kind:"message",T:ot,repeated:!0}]),po=s.makeMessageType("viam.service.vision.v1.GetPropertiesRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),go=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:d}]),Ul=s.makeMessageType("viam.service.vision.v1.CaptureAllFromCameraResponse",()=>[{no:1,name:"image",kind:"message",T:so},{no:2,name:"detections",kind:"message",T:ka,repeated:!0},{no:3,name:"classifications",kind:"message",T:ya,repeated:!0},{no:4,name:"objects",kind:"message",T:ot,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),Gl=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}]),Ll=Object.freeze(Object.defineProperty({__proto__:null,CaptureAllFromCameraRequest:go,CaptureAllFromCameraResponse:Ul,Classification:ya,Detection:ka,GetClassificationsFromCameraRequest:lo,GetClassificationsFromCameraResponse:Dl,GetClassificationsRequest:co,GetClassificationsResponse:Al,GetDetectionsFromCameraRequest:mo,GetDetectionsFromCameraResponse:Pl,GetDetectionsRequest:ro,GetDetectionsResponse:Nl,GetObjectPointCloudsRequest:uo,GetObjectPointCloudsResponse:ql,GetPropertiesRequest:po,GetPropertiesResponse:Gl},Symbol.toStringTag,{value:"Module"})),Bl={typeName:"viam.service.vision.v1.VisionService",methods:{getDetectionsFromCamera:{name:"GetDetectionsFromCamera",I:mo,O:Pl,kind:m.Unary},getDetections:{name:"GetDetections",I:ro,O:Nl,kind:m.Unary},getClassificationsFromCamera:{name:"GetClassificationsFromCamera",I:lo,O:Dl,kind:m.Unary},getClassifications:{name:"GetClassifications",I:co,O:Al,kind:m.Unary},getObjectPointClouds:{name:"GetObjectPointClouds",I:uo,O:ql,kind:m.Unary},getProperties:{name:"GetProperties",I:po,O:Gl,kind:m.Unary},captureAllFromCamera:{name:"CaptureAllFromCamera",I:go,O:Ul,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},FR=new Blob([`self.onmessage = function(e) {
5
5
  setTimeout(() => self.postMessage(""), e.data);
6
6
  };`],{type:"text/javascript"});class xR{constructor(e,n,t=1e4){this.deferredTransport=e,this.onDisconnect=n,this.heartbeatIntervalMs=t}connecting;get client(){const e=this.deferredTransport();return N(Es,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(FR);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 va=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}]),zR=s.makeMessageType("grpc.reflection.v1.ServerReflectionResponse",()=>[{no:1,name:"valid_host",kind:"scalar",T:9},{no:2,name:"original_request",kind:"message",T:va},{no:4,name:"file_descriptor_response",kind:"message",T:YR,oneof:"message_response"},{no:5,name:"all_extension_numbers_response",kind:"message",T:$R,oneof:"message_response"},{no:6,name:"list_services_response",kind:"message",T:VR,oneof:"message_response"},{no:7,name:"error_response",kind:"message",T:jR,oneof:"message_response"}]),YR=s.makeMessageType("grpc.reflection.v1.FileDescriptorResponse",()=>[{no:1,name:"file_descriptor_proto",kind:"scalar",T:12,repeated:!0}]),$R=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}]),VR=s.makeMessageType("grpc.reflection.v1.ListServiceResponse",()=>[{no:1,name:"service",kind:"message",T:WR,repeated:!0}]),WR=s.makeMessageType("grpc.reflection.v1.ServiceResponse",()=>[{no:1,name:"name",kind:"scalar",T:9}]),jR=s.makeMessageType("grpc.reflection.v1.ErrorResponse",()=>[{no:1,name:"error_code",kind:"scalar",T:5},{no:2,name:"error_message",kind:"scalar",T:9}]),HR={typeName:"grpc.reflection.v1.ServerReflection",methods:{serverReflectionInfo:{name:"ServerReflectionInfo",I:va,O:zR,kind:m.BiDiStreaming}}};class KR{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 u=Sn(i),l=`/${e.typeName}/${n.name}`;if(Xe.heartbeatMonitoredMethods[l]??!1){const k=await this.getSessionMetadata();for(const[R,I]of k)u.set(R,I)}return this.deferredTransport().unary(e,n,t,o,u,r,c)}async stream(e,n,t,o,i,r,c){const u=Sn(i),l=`/${e.typeName}/${n.name}`;if(Xe.heartbeatMonitoredMethods[l]??!1){const k=await this.getSessionMetadata();for(const[R,I]of k)u.set(R,I)}return this.deferredTransport().stream(e,n,t,o,u,r,c)}}const XR=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 KR(this.deferredTransport,this)}static heartbeatMonitoredMethods={};transport;currentSessionID="";sessionsSupported;heartbeatIntervalMs;host="";starting;get client(){const e=this.deferredTransport();return na(Es,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 Ms({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 de||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(XR);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 Is;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=na(HR,this.transport),n=new va({host:this.host,messageRequest:{case:"listServices",value:""}}),t=e.serverReflectionInfo(Ua([n]),{timeoutMs:1e4});for await(const o of t){const i=o.messageResponse.value.service.map(c=>new va({messageRequest:{case:"fileContainingSymbol",value:c.name}})),r=e.serverReflectionInfo(Ua(i),{timeoutMs:1e4});for await(const c of r)for(const u of c.messageResponse.value.fileDescriptorProto){const l=se.fromBinary(u);for(const k of l.service)for(const R of k.method)Xe.heartbeatMonitoredMethods[`/${l.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 ii(e.toBinary());for(;n.pos<n.len;){const t=n.tag(),[o]=t;if(o===hr.field.no)return!0;n.string()}return!1}}const QR=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"}]),Fl=s.makeMessageType("viam.service.mlmodel.v1.InferRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:3,name:"input_tensors",kind:"message",T:zl},{no:99,name:"extra",kind:"message",T:d}]),ZR=s.makeMessageType("viam.service.mlmodel.v1.InferResponse",()=>[{no:3,name:"output_tensors",kind:"message",T:zl}]),xl=s.makeMessageType("viam.service.mlmodel.v1.MetadataRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),e1=s.makeMessageType("viam.service.mlmodel.v1.MetadataResponse",()=>[{no:1,name:"metadata",kind:"message",T:n1}]),n1=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:Jl,repeated:!0},{no:5,name:"output_info",kind:"message",T:Jl,repeated:!0}]),Jl=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:a1,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),a1=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(QR)}]),t1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt8",()=>[{no:1,name:"data",kind:"scalar",T:12}]),s1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt8",()=>[{no:1,name:"data",kind:"scalar",T:12}]),o1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt16",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),i1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt16",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),r1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt32",()=>[{no:1,name:"data",kind:"scalar",T:15,repeated:!0}]),m1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt32",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),c1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt64",()=>[{no:1,name:"data",kind:"scalar",T:16,repeated:!0}]),d1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt64",()=>[{no:1,name:"data",kind:"scalar",T:6,repeated:!0}]),l1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataFloat",()=>[{no:1,name:"data",kind:"scalar",T:2,repeated:!0}]),u1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataDouble",()=>[{no:1,name:"data",kind:"scalar",T:1,repeated:!0}]),p1=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:t1,oneof:"tensor"},{no:3,name:"uint8_tensor",kind:"message",T:s1,oneof:"tensor"},{no:4,name:"int16_tensor",kind:"message",T:o1,oneof:"tensor"},{no:5,name:"uint16_tensor",kind:"message",T:i1,oneof:"tensor"},{no:6,name:"int32_tensor",kind:"message",T:r1,oneof:"tensor"},{no:7,name:"uint32_tensor",kind:"message",T:m1,oneof:"tensor"},{no:8,name:"int64_tensor",kind:"message",T:c1,oneof:"tensor"},{no:9,name:"uint64_tensor",kind:"message",T:d1,oneof:"tensor"},{no:10,name:"float_tensor",kind:"message",T:l1,oneof:"tensor"},{no:11,name:"double_tensor",kind:"message",T:u1,oneof:"tensor"}]),zl=s.makeMessageType("viam.service.mlmodel.v1.FlatTensors",()=>[{no:1,name:"tensors",kind:"map",K:9,V:{kind:"message",T:p1}}]),Yl={typeName:"viam.service.mlmodel.v1.MLModelService",methods:{infer:{name:"Infer",I:Fl,O:ZR,kind:m.Unary},metadata:{name:"Metadata",I:xl,O:e1,kind:m.Unary}}};class A extends fr{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 xR(()=>{if(!this.transport)throw new Error(A.notConnectedYetStr);return this.transport},()=>{this.onDisconnect()}),this.sessionManager=new Xe(this.serviceHost,()=>{if(!this.transport)throw new Error(A.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),ja(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(A.notConnectedYetStr);return this.robotServiceClient}get armService(){if(!this.armServiceClient)throw new Error(A.notConnectedYetStr);return this.armServiceClient}get baseService(){if(!this.baseServiceClient)throw new Error(A.notConnectedYetStr);return this.baseServiceClient}get boardService(){if(!this.boardServiceClient)throw new Error(A.notConnectedYetStr);return this.boardServiceClient}get encoderService(){if(!this.encoderServiceClient)throw new Error(A.notConnectedYetStr);return this.encoderServiceClient}get gantryService(){if(!this.gantryServiceClient)throw new Error(A.notConnectedYetStr);return this.gantryServiceClient}get genericService(){if(!this.genericServiceClient)throw new Error(A.notConnectedYetStr);return this.genericServiceClient}get gripperService(){if(!this.gripperServiceClient)throw new Error(A.notConnectedYetStr);return this.gripperServiceClient}get mlModelService(){if(!this.mlModelServiceClient)throw new Error(A.notConnectedYetStr);return this.mlModelServiceClient}get movementSensorService(){if(!this.movementSensorServiceClient)throw new Error(A.notConnectedYetStr);return this.movementSensorServiceClient}get powerSensorService(){if(!this.powerSensorServiceClient)throw new Error(A.notConnectedYetStr);return this.powerSensorServiceClient}get inputControllerService(){if(!this.inputControllerServiceClient)throw new Error(A.notConnectedYetStr);return this.inputControllerServiceClient}get motorService(){if(!this.motorServiceClient)throw new Error(A.notConnectedYetStr);return this.motorServiceClient}get navigationService(){if(!this.navigationServiceClient)throw new Error(A.notConnectedYetStr);return this.navigationServiceClient}get discoveryService(){if(!this.discoveryServiceClient)throw new Error(A.notConnectedYetStr);return this.discoveryServiceClient}get motionService(){if(!this.motionServiceClient)throw new Error(A.notConnectedYetStr);return this.motionServiceClient}get visionService(){if(!this.visionServiceClient)throw new Error(A.notConnectedYetStr);return this.visionServiceClient}get servoService(){if(!this.servoServiceClient)throw new Error(A.notConnectedYetStr);return this.servoServiceClient}get slamService(){if(!this.slamServiceClient)throw new Error(A.notConnectedYetStr);return this.slamServiceClient}createServiceClient(e){const n=this.sessionOptions?.disabled?this.transport:this.sessionManager.transport;if(!n)throw new Error(A.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??mt,extraHeaders:rt};if(e&&(Mn(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 iR(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[u]=c.streams;if(!u)throw this.emit("track",c),new Error("expected event stream to exist");const l=u.id.replaceAll("+",":");Object.defineProperty(u,"id",{value:l}),this.emit("track",c)})}else this.transport=await _n(this.serviceHost,o),await this.gRPCConnectionManager.start();const i=this.sessionOptions?.disabled?this.transport:this.sessionManager.transport;this.robotServiceClient=N(Es,i),this.armServiceClient=N(Nr,i),this.baseServiceClient=N(Fr,i),this.boardServiceClient=N(em,i),this.encoderServiceClient=N(om,i),this.gantryServiceClient=N(um,i),this.genericServiceClient=N(Jt,i),this.gripperServiceClient=N(ym,i),this.mlModelServiceClient=N(Yl,i),this.movementSensorServiceClient=N(Wm,i),this.powerSensorServiceClient=N(Xm,i),this.inputControllerServiceClient=N(bm,i),this.motorServiceClient=N(Gm,i),this.navigationServiceClient=N(dl,i),this.motionServiceClient=N(Kd,i),this.visionServiceClient=N(Bl,i),this.servoServiceClient=N(ac,i),this.slamServiceClient=N(hl,i),this.discoveryServiceClient=N(Cd,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 fs({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 Rs({pointCloudPcd:e,source:n,destination:t});return(await this.robotService.transformPCD(o)).pointCloudPcd}async getModelsFromModules(){const e=new _s({});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 ws;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 $l=a=>!!(a>0&&Number.isInteger(a)),g1=a=>a.includes("local"),Vl=async a=>{if(console.debug("dialing via gRPC..."),!g1(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 A(a.host,void 0,n,e);return await t.connect({creds:a.credentials,dialTimeout:a.dialTimeout??mt}),console.debug("connected via gRPC"),t},Wl=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 A(e,i,r);return await c.connect({priority:a.priority,dialTimeout:a.dialTimeout??mt,creds:a.credentials}),console.debug("connected via WebRTC"),c},T1=a=>{const e=a;return typeof e.signalingAddress!="string"?!1:!e.iceServers||Array.isArray(e.iceServers)},jl=async a=>{k1(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),T1(a)&&!a.reconnectAbortSignal?.abort)try{return a.noReconnect?await Wl(a):await ja(async()=>Wl(a),e)}catch{console.debug("Failed to connect via WebRTC")}if(!a.reconnectAbortSignal?.abort)try{return a.noReconnect?await Vl(a):await ja(async()=>Vl(a),e)}catch{console.debug("Failed to connect via gRPC")}throw new Error("Failed to connect to robot")},k1=a=>{if(a.credentials&&Mn(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&&!$l(a.reconnectMaxAttempts))throw new Error(`Value of max reconnect attempts (${a.reconnectMaxAttempts}) should be a positive integer`);if(a.reconnectMaxWait!==void 0&&!$l(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"}]),ha=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"}]),Hl=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}]),Kl=s.makeMessageType("viam.app.mltraining.v1.SubmitTrainingJobResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Xl=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}}]),Ql=s.makeMessageType("viam.app.mltraining.v1.SubmitCustomTrainingJobResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Zl=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),eu=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobResponse",()=>[{no:1,name:"metadata",kind:"message",T:To}]),nu=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(ha)}]),au=s.makeMessageType("viam.app.mltraining.v1.ListTrainingJobsResponse",()=>[{no:1,name:"jobs",kind:"message",T:To,repeated:!0}]),To=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(ha)},{no:8,name:"error_status",kind:"message",T:sn},{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}]),tu=s.makeMessageType("viam.app.mltraining.v1.CancelTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),su=s.makeMessageType("viam.app.mltraining.v1.CancelTrainingJobResponse",[]),ou=s.makeMessageType("viam.app.mltraining.v1.DeleteCompletedTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),iu=s.makeMessageType("viam.app.mltraining.v1.DeleteCompletedTrainingJobResponse",[]),ru=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}]),mu=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}]),cu=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:ru,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),y1=Object.freeze(Object.defineProperty({__proto__:null,CancelTrainingJobRequest:tu,CancelTrainingJobResponse:su,DeleteCompletedTrainingJobRequest:ou,DeleteCompletedTrainingJobResponse:iu,GetTrainingJobLogsRequest:mu,GetTrainingJobLogsResponse:cu,GetTrainingJobRequest:Zl,GetTrainingJobResponse:eu,ListTrainingJobsRequest:nu,ListTrainingJobsResponse:au,ModelFramework:Qe,ModelType:ze,SubmitCustomTrainingJobRequest:Xl,SubmitCustomTrainingJobResponse:Ql,SubmitTrainingJobRequest:Hl,SubmitTrainingJobResponse:Kl,TrainingJobLogEntry:ru,TrainingJobMetadata:To,TrainingStatus:ha},Symbol.toStringTag,{value:"Module"})),fa=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"}]),du=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"}]),wn=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"}]),lu=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"}]),uu=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"}]),cn=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"}]),pu=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"}]),gu=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"}]),Tu=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"}]),ku=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"}]),Ra=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:d},{no:6,name:"last_access",kind:"message",T:S},{no:7,name:"user_supplied_info",kind:"message",T:d},{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:vo,repeated:!0},{no:15,name:"last_updated",kind:"message",T:S}]),yu=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:ko}]),ko=s.makeMessageType("viam.app.v1.AuthenticatorInfo",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(du)},{no:2,name:"value",kind:"scalar",T:9},{no:3,name:"is_deactivated",kind:"scalar",T:8}]),vu=s.makeMessageType("viam.app.v1.ListOrganizationsRequest",[]),En=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}]),hu=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}]),fu=s.makeMessageType("viam.app.v1.ListOrganizationsResponse",()=>[{no:1,name:"organizations",kind:"message",T:En,repeated:!0}]),On=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}]),Ru=s.makeMessageType("viam.app.v1.CreateOrganizationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),_u=s.makeMessageType("viam.app.v1.CreateOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:En}]),Su=s.makeMessageType("viam.app.v1.GetOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Iu=s.makeMessageType("viam.app.v1.GetOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:En}]),Mu=s.makeMessageType("viam.app.v1.GetOrganizationNamespaceAvailabilityRequest",()=>[{no:1,name:"public_namespace",kind:"scalar",T:9}]),bu=s.makeMessageType("viam.app.v1.GetOrganizationNamespaceAvailabilityResponse",()=>[{no:1,name:"available",kind:"scalar",T:8}]),wu=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}]),Eu=s.makeMessageType("viam.app.v1.UpdateOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:En}]),Ou=s.makeMessageType("viam.app.v1.DeleteOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Cu=s.makeMessageType("viam.app.v1.DeleteOrganizationResponse",[]),Nu=s.makeMessageType("viam.app.v1.GetOrganizationMetadataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Pu=s.makeMessageType("viam.app.v1.GetOrganizationMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:d}]),Au=s.makeMessageType("viam.app.v1.UpdateOrganizationMetadataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:d}]),Du=s.makeMessageType("viam.app.v1.UpdateOrganizationMetadataResponse",[]),qu=s.makeMessageType("viam.app.v1.ListOrganizationMembersRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Uu=s.makeMessageType("viam.app.v1.ListOrganizationMembersResponse",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"members",kind:"message",T:hu,repeated:!0},{no:3,name:"invites",kind:"message",T:On,repeated:!0}]),Gu=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}]),Lu=s.makeMessageType("viam.app.v1.CreateOrganizationInviteResponse",()=>[{no:1,name:"invite",kind:"message",T:On}]),Bu=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}]),Fu=s.makeMessageType("viam.app.v1.UpdateOrganizationInviteAuthorizationsResponse",()=>[{no:1,name:"invite",kind:"message",T:On}]),xu=s.makeMessageType("viam.app.v1.DeleteOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),Ju=s.makeMessageType("viam.app.v1.DeleteOrganizationInviteResponse",[]),zu=s.makeMessageType("viam.app.v1.ResendOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),Yu=s.makeMessageType("viam.app.v1.ResendOrganizationInviteResponse",()=>[{no:1,name:"invite",kind:"message",T:On}]),$u=s.makeMessageType("viam.app.v1.DeleteOrganizationMemberRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9}]),Vu=s.makeMessageType("viam.app.v1.DeleteOrganizationMemberResponse",[]),_a=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}]),Wu=s.makeMessageType("viam.app.v1.EnableBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"billing_address",kind:"message",T:_a}]),ju=s.makeMessageType("viam.app.v1.EnableBillingServiceResponse",[]),Hu=s.makeMessageType("viam.app.v1.UpdateBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"billing_address",kind:"message",T:_a}]),Ku=s.makeMessageType("viam.app.v1.UpdateBillingServiceResponse",[]),Xu=s.makeMessageType("viam.app.v1.GetBillingServiceConfigRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Qu=s.makeMessageType("viam.app.v1.GetBillingServiceConfigResponse",()=>[{no:1,name:"billing_address",kind:"message",T:_a},{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}]),Zu=s.makeMessageType("viam.app.v1.DisableBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),ep=s.makeMessageType("viam.app.v1.DisableBillingServiceResponse",[]),np=s.makeMessageType("viam.app.v1.OrganizationSetSupportEmailRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),ap=s.makeMessageType("viam.app.v1.OrganizationSetSupportEmailResponse",[]),tp=s.makeMessageType("viam.app.v1.OrganizationGetSupportEmailRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),sp=s.makeMessageType("viam.app.v1.OrganizationGetSupportEmailResponse",()=>[{no:1,name:"email",kind:"scalar",T:9}]),yo=s.makeMessageType("viam.app.v1.OrganizationIdentity",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),op=s.makeMessageType("viam.app.v1.LocationOrganization",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"primary",kind:"scalar",T:8}]),Sa=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:vo,repeated:!0}]),ip=s.makeMessageType("viam.app.v1.StorageConfig",()=>[{no:1,name:"region",kind:"scalar",T:9}]),Cn=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:Sa},{no:6,name:"organizations",kind:"message",T:op,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:ip},{no:9,name:"primary_org_identity",kind:"message",T:yo,opt:!0}]),vo=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(ho)}]),ho=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"}]),rp=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}]),mp=s.makeMessageType("viam.app.v1.CreateLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Cn}]),cp=s.makeMessageType("viam.app.v1.GetLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),dp=s.makeMessageType("viam.app.v1.GetLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Cn}]),lp=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}]),up=s.makeMessageType("viam.app.v1.UpdateLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Cn}]),pp=s.makeMessageType("viam.app.v1.DeleteLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),gp=s.makeMessageType("viam.app.v1.DeleteLocationResponse",[]),Tp=s.makeMessageType("viam.app.v1.GetLocationMetadataRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),kp=s.makeMessageType("viam.app.v1.GetLocationMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:d}]),yp=s.makeMessageType("viam.app.v1.UpdateLocationMetadataRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:d}]),vp=s.makeMessageType("viam.app.v1.UpdateLocationMetadataResponse",[]),hp=s.makeMessageType("viam.app.v1.GetOrganizationsWithAccessToLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),fp=s.makeMessageType("viam.app.v1.GetOrganizationsWithAccessToLocationResponse",()=>[{no:1,name:"organization_identities",kind:"message",T:yo,repeated:!0}]),Rp=s.makeMessageType("viam.app.v1.ListLocationsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),_p=s.makeMessageType("viam.app.v1.ShareLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),Sp=s.makeMessageType("viam.app.v1.ShareLocationResponse",[]),Ip=s.makeMessageType("viam.app.v1.UnshareLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),Mp=s.makeMessageType("viam.app.v1.UnshareLocationResponse",[]),bp=s.makeMessageType("viam.app.v1.ListLocationsResponse",()=>[{no:1,name:"locations",kind:"message",T:Cn,repeated:!0}]),wp=s.makeMessageType("viam.app.v1.CreateLocationSecretRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Ep=s.makeMessageType("viam.app.v1.CreateLocationSecretResponse",()=>[{no:1,name:"auth",kind:"message",T:Sa}]),Op=s.makeMessageType("viam.app.v1.DeleteLocationSecretRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"secret_id",kind:"scalar",T:9}]),Cp=s.makeMessageType("viam.app.v1.DeleteLocationSecretResponse",[]),Np=s.makeMessageType("viam.app.v1.LocationAuthRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Pp=s.makeMessageType("viam.app.v1.LocationAuthResponse",()=>[{no:1,name:"auth",kind:"message",T:Sa}]),Ap=s.makeMessageType("viam.app.v1.GetRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Dp=s.makeMessageType("viam.app.v1.GetRoverRentalRobotsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),qp=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}]),Up=s.makeMessageType("viam.app.v1.GetRoverRentalRobotsResponse",()=>[{no:1,name:"robots",kind:"message",T:qp,repeated:!0}]),Gp=s.makeMessageType("viam.app.v1.GetRobotResponse",()=>[{no:1,name:"robot",kind:"message",T:Ra}]),Lp=s.makeMessageType("viam.app.v1.GetRobotPartsRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9}]),Bp=s.makeMessageType("viam.app.v1.GetRobotPartsResponse",()=>[{no:1,name:"parts",kind:"message",T:dn,repeated:!0}]),Fp=s.makeMessageType("viam.app.v1.GetRobotPartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),xp=s.makeMessageType("viam.app.v1.GetRobotPartResponse",()=>[{no:1,name:"part",kind:"message",T:dn},{no:2,name:"config_json",kind:"scalar",T:9}]),Jp=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}]),zp=s.makeMessageType("viam.app.v1.GetRobotPartLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:In,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),Yp=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}]),$p=s.makeMessageType("viam.app.v1.TailRobotPartLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:In,repeated:!0}]),Vp=s.makeMessageType("viam.app.v1.GetRobotPartHistoryRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Wp=s.makeMessageType("viam.app.v1.GetRobotPartHistoryResponse",()=>[{no:1,name:"history",kind:"message",T:yu,repeated:!0}]),jp=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:d}]),Hp=s.makeMessageType("viam.app.v1.UpdateRobotPartResponse",()=>[{no:1,name:"part",kind:"message",T:dn}]),Kp=s.makeMessageType("viam.app.v1.NewRobotPartRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9},{no:2,name:"part_name",kind:"scalar",T:9}]),Xp=s.makeMessageType("viam.app.v1.NewRobotPartResponse",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),Qp=s.makeMessageType("viam.app.v1.DeleteRobotPartRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),Zp=s.makeMessageType("viam.app.v1.GetRobotPartMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),eg=s.makeMessageType("viam.app.v1.GetRobotPartMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:d}]),ng=s.makeMessageType("viam.app.v1.UpdateRobotPartMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:d}]),ag=s.makeMessageType("viam.app.v1.UpdateRobotPartMetadataResponse",[]),tg=s.makeMessageType("viam.app.v1.GetRobotAPIKeysRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9}]),sg=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}]),og=s.makeMessageType("viam.app.v1.GetRobotAPIKeysResponse",()=>[{no:1,name:"api_keys",kind:"message",T:bo,repeated:!0}]),ig=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:d},{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(wn)},{no:13,name:"last_updated",kind:"message",T:S},{no:14,name:"revision",kind:"scalar",T:9}]),rg=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:ko},{no:5,name:"revision",kind:"scalar",T:9},{no:6,name:"config",kind:"message",T:d}]),mg=s.makeMessageType("viam.app.v1.FragmentRevision",()=>[{no:1,name:"revision",kind:"scalar",T:9},{no:2,name:"created_at",kind:"message",T:S}]),Ia=s.makeMessageType("viam.app.v1.FragmentTag",()=>[{no:1,name:"tag",kind:"scalar",T:9},{no:2,name:"revision",kind:"scalar",T:9}]),cg=s.makeMessageType("viam.app.v1.FragmentError",()=>[{no:1,name:"error_type",kind:"enum",T:s.getEnumType(lu)},{no:2,name:"fragment_id",kind:"scalar",T:9},{no:3,name:"detail",kind:"scalar",T:9}]),Ma=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}]),fo=s.makeMessageType("viam.app.v1.ResolvedFragment",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"resolved_config",kind:"message",T:d},{no:3,name:"error",kind:"message",T:cg},{no:4,name:"revision",kind:"scalar",T:9}]),dg=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(wn),repeated:!0}]),lg=s.makeMessageType("viam.app.v1.ListFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"fragment_usages",kind:"message",T:Ma,repeated:!0}]),ug=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}]),pg=s.makeMessageType("viam.app.v1.GetFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye},{no:2,name:"fragment_usage",kind:"message",T:Ma},{no:3,name:"revisions",kind:"message",T:mg,repeated:!0},{no:4,name:"tags",kind:"message",T:Ia,repeated:!0}]),gg=s.makeMessageType("viam.app.v1.CreateFragmentRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"config",kind:"message",T:d},{no:3,name:"organization_id",kind:"scalar",T:9},{no:4,name:"visibility",kind:"enum",T:s.getEnumType(wn),opt:!0}]),Tg=s.makeMessageType("viam.app.v1.CreateFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye}]),kg=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:d},{no:4,name:"public",kind:"scalar",T:8,opt:!0},{no:5,name:"visibility",kind:"enum",T:s.getEnumType(wn),opt:!0}]),yg=s.makeMessageType("viam.app.v1.UpdateFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye}]),vg=s.makeMessageType("viam.app.v1.DeleteFragmentRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),hg=s.makeMessageType("viam.app.v1.DeleteFragmentResponse",[]),fg=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}]),Rg=s.makeMessageType("viam.app.v1.GetFragmentHistoryResponse",()=>[{no:1,name:"history",kind:"message",T:rg,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),_g=s.makeMessageType("viam.app.v1.GetFragmentUsageRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9}]),Sg=s.makeMessageType("viam.app.v1.GetFragmentUsageResponse",()=>[{no:1,name:"version_usages",kind:"message",T:Ma,repeated:!0}]),Ig=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}]),Mg=s.makeMessageType("viam.app.v1.SetFragmentTagResponse",()=>[{no:1,name:"tags",kind:"message",T:Ia,repeated:!0}]),bg=s.makeMessageType("viam.app.v1.DeleteFragmentTagRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"tag",kind:"scalar",T:9}]),wg=s.makeMessageType("viam.app.v1.DeleteFragmentTagResponse",()=>[{no:1,name:"tags",kind:"message",T:Ia,repeated:!0}]),Eg=s.makeMessageType("viam.app.v1.ListRobotsRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Ro=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}]),Og=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:Ro,repeated:!0}]),Cg=s.makeMessageType("viam.app.v1.ListNestedFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"resolved_fragments",kind:"message",T:fo,repeated:!0}]),Ng=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:Ro,repeated:!0}]),Pg=s.makeMessageType("viam.app.v1.ListMachineFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"resolved_fragments",kind:"message",T:fo,repeated:!0}]),Ag=s.makeMessageType("viam.app.v1.ListMachineSummariesRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Dg=s.makeMessageType("viam.app.v1.ListMachineSummariesResponse",()=>[{no:1,name:"location_summaries",kind:"message",T:qg,repeated:!0}]),qg=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:Ug,repeated:!0}]),Ug=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:Fg,repeated:!0}]),Gg=s.makeMessageType("viam.app.v1.FragmentSummary",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9}]),Lg=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"}]),Bg=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"}]),Fg=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:Lg,opt:!0},{no:5,name:"viam_agent_version",kind:"message",T:Bg,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:Gg,repeated:!0}]),xg=s.makeMessageType("viam.app.v1.ListRobotsResponse",()=>[{no:1,name:"robots",kind:"message",T:Ra,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}]),zg=s.makeMessageType("viam.app.v1.NewRobotResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Yg=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}]),$g=s.makeMessageType("viam.app.v1.UpdateRobotResponse",()=>[{no:1,name:"robot",kind:"message",T:Ra}]),Vg=s.makeMessageType("viam.app.v1.DeleteRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Wg=s.makeMessageType("viam.app.v1.DeleteRobotResponse",[]),jg=s.makeMessageType("viam.app.v1.GetRobotMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Hg=s.makeMessageType("viam.app.v1.GetRobotMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:d}]),Kg=s.makeMessageType("viam.app.v1.UpdateRobotMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:d}]),Xg=s.makeMessageType("viam.app.v1.UpdateRobotMetadataResponse",[]),Qg=s.makeMessageType("viam.app.v1.MarkPartAsMainRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),Zg=s.makeMessageType("viam.app.v1.MarkPartAsMainResponse",[]),eT=s.makeMessageType("viam.app.v1.MarkPartForRestartRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),nT=s.makeMessageType("viam.app.v1.MarkPartForRestartResponse",[]),aT=s.makeMessageType("viam.app.v1.CreateRobotPartSecretRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),tT=s.makeMessageType("viam.app.v1.CreateRobotPartSecretResponse",()=>[{no:1,name:"part",kind:"message",T:dn}]),sT=s.makeMessageType("viam.app.v1.DeleteRobotPartSecretRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"secret_id",kind:"scalar",T:9}]),oT=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}]),iT=s.makeMessageType("viam.app.v1.AddRoleRequest",()=>[{no:1,name:"authorization",kind:"message",T:Q}]),rT=s.makeMessageType("viam.app.v1.AddRoleResponse",[]),mT=s.makeMessageType("viam.app.v1.RemoveRoleRequest",()=>[{no:1,name:"authorization",kind:"message",T:Q}]),cT=s.makeMessageType("viam.app.v1.RemoveRoleResponse",[]),dT=s.makeMessageType("viam.app.v1.ChangeRoleRequest",()=>[{no:1,name:"old_authorization",kind:"message",T:Q},{no:2,name:"new_authorization",kind:"message",T:Q}]),lT=s.makeMessageType("viam.app.v1.ChangeRoleResponse",[]),uT=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}]),pT=s.makeMessageType("viam.app.v1.ListAuthorizationsResponse",()=>[{no:1,name:"authorizations",kind:"message",T:Q,repeated:!0}]),gT=s.makeMessageType("viam.app.v1.CheckPermissionsRequest",()=>[{no:1,name:"permissions",kind:"message",T:_o,repeated:!0}]),_o=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}]),TT=s.makeMessageType("viam.app.v1.CheckPermissionsResponse",()=>[{no:1,name:"authorized_permissions",kind:"message",T:_o,repeated:!0}]),kT=s.makeMessageType("viam.app.v1.ModuleVersion",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"files",kind:"message",T:Io,repeated:!0},{no:3,name:"models",kind:"message",T:Ze,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}]),yT=s.makeMessageType("viam.app.v1.ModuleMetadata",()=>[{no:1,name:"models",kind:"message",T:Ze,repeated:!0},{no:2,name:"versions",kind:"message",T:kT,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}]),vT=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)}]),hT=s.makeMessageType("viam.app.v1.MLTrainingVersion",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"created_on",kind:"message",T:S}]),fT=s.makeMessageType("viam.app.v1.MLTrainingMetadata",()=>[{no:5,name:"versions",kind:"message",T:hT,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}]),ba=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(fa)},{no:6,name:"visibility",kind:"enum",T:s.getEnumType(cn)},{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:yT,oneof:"metadata"},{no:12,name:"ml_model_metadata",kind:"message",T:vT,oneof:"metadata"},{no:18,name:"ml_training_metadata",kind:"message",T:fT,oneof:"metadata"},{no:15,name:"created_at",kind:"message",T:S},{no:16,name:"updated_at",kind:"message",T:S}]),RT=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}]),_T=s.makeMessageType("viam.app.v1.GetRegistryItemResponse",()=>[{no:1,name:"item",kind:"message",T:ba}]),ST=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(fa)}]),IT=s.makeMessageType("viam.app.v1.CreateRegistryItemResponse",[]),MT=s.makeMessageType("viam.app.v1.UpdateRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:s.getEnumType(fa)},{no:3,name:"description",kind:"scalar",T:9},{no:4,name:"visibility",kind:"enum",T:s.getEnumType(cn)},{no:5,name:"url",kind:"scalar",T:9,opt:!0},{no:6,name:"update_module_metadata",kind:"message",T:FT,oneof:"metadata"},{no:7,name:"update_ml_model_metadata",kind:"message",T:xT,oneof:"metadata"},{no:8,name:"update_ml_training_metadata",kind:"message",T:JT,oneof:"metadata"},{no:9,name:"markdown_description",kind:"scalar",T:9,opt:!0}]),bT=s.makeMessageType("viam.app.v1.UpdateRegistryItemResponse",[]),wT=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(fa),repeated:!0},{no:3,name:"visibilities",kind:"enum",T:s.getEnumType(cn),repeated:!0},{no:4,name:"platforms",kind:"scalar",T:9,repeated:!0},{no:5,name:"statuses",kind:"enum",T:s.getEnumType(uu),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}]),ET=s.makeMessageType("viam.app.v1.ListRegistryItemsResponse",()=>[{no:1,name:"items",kind:"message",T:ba,repeated:!0}]),OT=s.makeMessageType("viam.app.v1.DeleteRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9}]),CT=s.makeMessageType("viam.app.v1.DeleteRegistryItemResponse",[]),NT=s.makeMessageType("viam.app.v1.RenameRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"new_name",kind:"scalar",T:9}]),PT=s.makeMessageType("viam.app.v1.RenameRegistryItemResponse",()=>[{no:1,name:"item",kind:"message",T:ba}]),AT=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}]),DT=s.makeMessageType("viam.app.v1.TransferRegistryItemResponse",[]),qT=s.makeMessageType("viam.app.v1.CreateModuleRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),UT=s.makeMessageType("viam.app.v1.CreateModuleResponse",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9}]),GT=s.makeMessageType("viam.app.v1.UpdateModuleRequest",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"visibility",kind:"enum",T:s.getEnumType(cn)},{no:3,name:"url",kind:"scalar",T:9},{no:4,name:"description",kind:"scalar",T:9},{no:5,name:"models",kind:"message",T:Ze,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:LT,repeated:!0},{no:9,name:"markdown_description",kind:"scalar",T:9,opt:!0}]),LT=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}]),BT=s.makeMessageType("viam.app.v1.UpdateModuleResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),FT=s.makeMessageType("viam.app.v1.UpdateModuleMetadata",()=>[{no:1,name:"models",kind:"message",T:Ze,repeated:!0},{no:2,name:"entrypoint",kind:"scalar",T:9}]),xT=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)}]),JT=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}]),Ze=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}]),zT=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}]),YT=s.makeMessageType("viam.app.v1.UploadModuleFileRequest",()=>[{no:1,name:"module_file_info",kind:"message",T:zT,oneof:"module_file"},{no:2,name:"file",kind:"scalar",T:12,oneof:"module_file"}]),$T=s.makeMessageType("viam.app.v1.UploadModuleFileResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),VT=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}]),WT=s.makeMessageType("viam.app.v1.GetModuleResponse",()=>[{no:1,name:"module",kind:"message",T:So}]),So=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(cn)},{no:4,name:"versions",kind:"message",T:jT,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:Ze,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}]),jT=s.makeMessageType("viam.app.v1.VersionHistory",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"files",kind:"message",T:Io,repeated:!0},{no:3,name:"models",kind:"message",T:Ze,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}]),Io=s.makeMessageType("viam.app.v1.Uploads",()=>[{no:1,name:"platform",kind:"scalar",T:9},{no:2,name:"uploaded_at",kind:"message",T:S}]),HT=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}]),KT=s.makeMessageType("viam.app.v1.ListModulesResponse",()=>[{no:1,name:"modules",kind:"message",T:So,repeated:!0}]),XT=s.makeMessageType("viam.app.v1.GetUserIDByEmailRequest",()=>[{no:1,name:"email",kind:"scalar",T:9}]),QT=s.makeMessageType("viam.app.v1.GetUserIDByEmailResponse",()=>[{no:1,name:"user_id",kind:"scalar",T:9}]),ZT=s.makeMessageType("viam.app.v1.ListOrganizationsByUserRequest",()=>[{no:1,name:"user_id",kind:"scalar",T:9}]),Mo=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}]),ek=s.makeMessageType("viam.app.v1.ListOrganizationsByUserResponse",()=>[{no:1,name:"orgs",kind:"message",T:Mo,repeated:!0}]),nk=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}]),ak=s.makeMessageType("viam.app.v1.SearchOrganizationsResponse",()=>[{no:1,name:"organizations",kind:"message",T:Mo,repeated:!0}]),tk=s.makeMessageType("viam.app.v1.CreateKeyRequest",()=>[{no:1,name:"authorizations",kind:"message",T:Q,repeated:!0},{no:2,name:"name",kind:"scalar",T:9}]),sk=s.makeMessageType("viam.app.v1.CreateKeyResponse",()=>[{no:1,name:"key",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:9}]),ok=s.makeMessageType("viam.app.v1.DeleteKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),ik=s.makeMessageType("viam.app.v1.DeleteKeyResponse",[]),rk=s.makeMessageType("viam.app.v1.RenameKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),mk=s.makeMessageType("viam.app.v1.RenameKeyResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),ck=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}]),bo=s.makeMessageType("viam.app.v1.APIKeyWithAuthorizations",()=>[{no:1,name:"api_key",kind:"message",T:sg},{no:2,name:"authorizations",kind:"message",T:ck,repeated:!0}]),dk=s.makeMessageType("viam.app.v1.ListKeysRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),lk=s.makeMessageType("viam.app.v1.ListKeysResponse",()=>[{no:1,name:"api_keys",kind:"message",T:bo,repeated:!0}]),uk=s.makeMessageType("viam.app.v1.RotateKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),pk=s.makeMessageType("viam.app.v1.RotateKeyResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}]),gk=s.makeMessageType("viam.app.v1.CreateKeyFromExistingKeyAuthorizationsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Tk=s.makeMessageType("viam.app.v1.CreateKeyFromExistingKeyAuthorizationsResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}]),kk=s.makeMessageType("viam.app.v1.GetAppContentRequest",()=>[{no:1,name:"public_namespace",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),yk=s.makeMessageType("viam.app.v1.GetAppContentResponse",()=>[{no:1,name:"blob_path",kind:"scalar",T:9},{no:2,name:"entrypoint",kind:"scalar",T:9}]),vk=s.makeMessageType("viam.app.v1.OrganizationSetLogoRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"logo",kind:"scalar",T:12}]),hk=s.makeMessageType("viam.app.v1.OrganizationSetLogoResponse",[]),fk=s.makeMessageType("viam.app.v1.OrganizationGetLogoRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Rk=s.makeMessageType("viam.app.v1.OrganizationGetLogoResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),_k=s.makeMessageType("viam.app.v1.EnableAuthServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Sk=s.makeMessageType("viam.app.v1.EnableAuthServiceResponse",[]),Ik=s.makeMessageType("viam.app.v1.DisableAuthServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Mk=s.makeMessageType("viam.app.v1.DisableAuthServiceResponse",[]),bk=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}]),wk=s.makeMessageType("viam.app.v1.CreateOAuthAppResponse",()=>[{no:1,name:"client_id",kind:"scalar",T:9},{no:2,name:"client_secret",kind:"scalar",T:9}]),Ek=s.makeMessageType("viam.app.v1.ReadOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9}]),Ok=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}]),Ck=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}]),Nk=s.makeMessageType("viam.app.v1.UpdateOAuthAppResponse",[]),Pk=s.makeMessageType("viam.app.v1.DeleteOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9}]),Ak=s.makeMessageType("viam.app.v1.DeleteOAuthAppResponse",[]),Dk=s.makeMessageType("viam.app.v1.ListOAuthAppsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),qk=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(pu)},{no:2,name:"pkce",kind:"enum",T:s.getEnumType(gu)},{no:3,name:"url_validation",kind:"enum",T:s.getEnumType(Tu)},{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(ku),repeated:!0}]),v1=Object.freeze(Object.defineProperty({__proto__:null,APIKey:sg,APIKeyWithAuthorizations:bo,AddRoleRequest:iT,AddRoleResponse:rT,AdditionalFragment:Ro,App:LT,AuthenticationType:du,AuthenticatorInfo:ko,Authorization:Q,AuthorizationDetails:ck,AuthorizedPermissions:_o,BillingAddress:_a,ChangeRoleRequest:dT,ChangeRoleResponse:lT,CheckPermissionsRequest:gT,CheckPermissionsResponse:TT,ClientAuthentication:pu,CreateFragmentRequest:gg,CreateFragmentResponse:Tg,CreateKeyFromExistingKeyAuthorizationsRequest:gk,CreateKeyFromExistingKeyAuthorizationsResponse:Tk,CreateKeyRequest:tk,CreateKeyResponse:sk,CreateLocationRequest:rp,CreateLocationResponse:mp,CreateLocationSecretRequest:wp,CreateLocationSecretResponse:Ep,CreateModuleRequest:qT,CreateModuleResponse:UT,CreateOAuthAppRequest:bk,CreateOAuthAppResponse:wk,CreateOrganizationInviteRequest:Gu,CreateOrganizationInviteResponse:Lu,CreateOrganizationRequest:Ru,CreateOrganizationResponse:_u,CreateRegistryItemRequest:ST,CreateRegistryItemResponse:IT,CreateRobotPartSecretRequest:aT,CreateRobotPartSecretResponse:tT,DeleteFragmentRequest:vg,DeleteFragmentResponse:hg,DeleteFragmentTagRequest:bg,DeleteFragmentTagResponse:wg,DeleteKeyRequest:ok,DeleteKeyResponse:ik,DeleteLocationRequest:pp,DeleteLocationResponse:gp,DeleteLocationSecretRequest:Op,DeleteLocationSecretResponse:Cp,DeleteOAuthAppRequest:Pk,DeleteOAuthAppResponse:Ak,DeleteOrganizationInviteRequest:xu,DeleteOrganizationInviteResponse:Ju,DeleteOrganizationMemberRequest:$u,DeleteOrganizationMemberResponse:Vu,DeleteOrganizationRequest:Ou,DeleteOrganizationResponse:Cu,DeleteRegistryItemRequest:OT,DeleteRegistryItemResponse:CT,DeleteRobotPartRequest:Qp,DeleteRobotPartResponse:ig,DeleteRobotPartSecretRequest:sT,DeleteRobotPartSecretResponse:oT,DeleteRobotRequest:Vg,DeleteRobotResponse:Wg,DisableAuthServiceRequest:Ik,DisableAuthServiceResponse:Mk,DisableBillingServiceRequest:Zu,DisableBillingServiceResponse:ep,EnableAuthServiceRequest:_k,EnableAuthServiceResponse:Sk,EnableBillingServiceRequest:Wu,EnableBillingServiceResponse:ju,EnabledGrant:ku,Fragment:Ye,FragmentError:cg,FragmentErrorType:lu,FragmentHistoryEntry:rg,FragmentRevision:mg,FragmentSummary:Gg,FragmentTag:Ia,FragmentUsage:Ma,FragmentVisibility:wn,GetAppContentRequest:kk,GetAppContentResponse:yk,GetBillingServiceConfigRequest:Xu,GetBillingServiceConfigResponse:Qu,GetFragmentHistoryRequest:fg,GetFragmentHistoryResponse:Rg,GetFragmentRequest:ug,GetFragmentResponse:pg,GetFragmentUsageRequest:_g,GetFragmentUsageResponse:Sg,GetLocationMetadataRequest:Tp,GetLocationMetadataResponse:kp,GetLocationRequest:cp,GetLocationResponse:dp,GetModuleRequest:VT,GetModuleResponse:WT,GetOrganizationMetadataRequest:Nu,GetOrganizationMetadataResponse:Pu,GetOrganizationNamespaceAvailabilityRequest:Mu,GetOrganizationNamespaceAvailabilityResponse:bu,GetOrganizationRequest:Su,GetOrganizationResponse:Iu,GetOrganizationsWithAccessToLocationRequest:hp,GetOrganizationsWithAccessToLocationResponse:fp,GetRegistryItemRequest:RT,GetRegistryItemResponse:_T,GetRobotAPIKeysRequest:tg,GetRobotAPIKeysResponse:og,GetRobotMetadataRequest:jg,GetRobotMetadataResponse:Hg,GetRobotPartHistoryRequest:Vp,GetRobotPartHistoryResponse:Wp,GetRobotPartLogsRequest:Jp,GetRobotPartLogsResponse:zp,GetRobotPartMetadataRequest:Zp,GetRobotPartMetadataResponse:eg,GetRobotPartRequest:Fp,GetRobotPartResponse:xp,GetRobotPartsRequest:Lp,GetRobotPartsResponse:Bp,GetRobotRequest:Ap,GetRobotResponse:Gp,GetRoverRentalRobotsRequest:Dp,GetRoverRentalRobotsResponse:Up,GetUserIDByEmailRequest:XT,GetUserIDByEmailResponse:QT,ListAuthorizationsRequest:uT,ListAuthorizationsResponse:pT,ListFragmentsRequest:dg,ListFragmentsResponse:lg,ListKeysRequest:dk,ListKeysResponse:lk,ListLocationsRequest:Rp,ListLocationsResponse:bp,ListMachineFragmentsRequest:Ng,ListMachineFragmentsResponse:Pg,ListMachineSummariesRequest:Ag,ListMachineSummariesResponse:Dg,ListModulesRequest:HT,ListModulesResponse:KT,ListNestedFragmentsRequest:Og,ListNestedFragmentsResponse:Cg,ListOAuthAppsRequest:Dk,ListOAuthAppsResponse:qk,ListOrganizationMembersRequest:qu,ListOrganizationMembersResponse:Uu,ListOrganizationsByUserRequest:ZT,ListOrganizationsByUserResponse:ek,ListOrganizationsRequest:vu,ListOrganizationsResponse:fu,ListRegistryItemsRequest:wT,ListRegistryItemsResponse:ET,ListRobotsRequest:Eg,ListRobotsResponse:xg,Location:Cn,LocationAuth:Sa,LocationAuthRequest:Np,LocationAuthResponse:Pp,LocationOrganization:op,LocationSummary:qg,MLModelMetadata:vT,MLTrainingMetadata:fT,MLTrainingVersion:hT,MachineSummary:Ug,MarkPartAsMainRequest:Qg,MarkPartAsMainResponse:Zg,MarkPartForRestartRequest:eT,MarkPartForRestartResponse:nT,Model:Ze,Module:So,ModuleFileInfo:zT,ModuleMetadata:yT,ModuleVersion:kT,NewRobotPartRequest:Kp,NewRobotPartResponse:Xp,NewRobotRequest:Jg,NewRobotResponse:zg,OAuthConfig:wa,OrgDetails:Mo,Organization:En,OrganizationGetLogoRequest:fk,OrganizationGetLogoResponse:Rk,OrganizationGetSupportEmailRequest:tp,OrganizationGetSupportEmailResponse:sp,OrganizationIdentity:yo,OrganizationInvite:On,OrganizationMember:hu,OrganizationSetLogoRequest:vk,OrganizationSetLogoResponse:hk,OrganizationSetSupportEmailRequest:np,OrganizationSetSupportEmailResponse:ap,PKCE:gu,PartSummary:Fg,ReadOAuthAppRequest:Ek,ReadOAuthAppResponse:Ok,RegistryItem:ba,RegistryItemStatus:uu,RemoveRoleRequest:mT,RemoveRoleResponse:cT,RenameKeyRequest:rk,RenameKeyResponse:mk,RenameRegistryItemRequest:NT,RenameRegistryItemResponse:PT,ResendOrganizationInviteRequest:zu,ResendOrganizationInviteResponse:Yu,ResolvedFragment:fo,Robot:Ra,RobotPart:dn,RobotPartHistoryEntry:yu,RotateKeyRequest:uk,RotateKeyResponse:pk,RoverRentalRobot:qp,SearchOrganizationsRequest:nk,SearchOrganizationsResponse:ak,SetFragmentTagRequest:Ig,SetFragmentTagResponse:Mg,ShareLocationRequest:_p,ShareLocationResponse:Sp,SharedSecret:vo,SharedSecret_State:ho,StorageConfig:ip,TailRobotPartLogsRequest:Yp,TailRobotPartLogsResponse:$p,TransferRegistryItemRequest:AT,TransferRegistryItemResponse:DT,URLValidation:Tu,UnshareLocationRequest:Ip,UnshareLocationResponse:Mp,UpdateBillingServiceRequest:Hu,UpdateBillingServiceResponse:Ku,UpdateFragmentRequest:kg,UpdateFragmentResponse:yg,UpdateLocationMetadataRequest:yp,UpdateLocationMetadataResponse:vp,UpdateLocationRequest:lp,UpdateLocationResponse:up,UpdateMLModelMetadata:xT,UpdateMLTrainingMetadata:JT,UpdateModuleMetadata:FT,UpdateModuleRequest:GT,UpdateModuleResponse:BT,UpdateOAuthAppRequest:Ck,UpdateOAuthAppResponse:Nk,UpdateOrganizationInviteAuthorizationsRequest:Bu,UpdateOrganizationInviteAuthorizationsResponse:Fu,UpdateOrganizationMetadataRequest:Au,UpdateOrganizationMetadataResponse:Du,UpdateOrganizationRequest:wu,UpdateOrganizationResponse:Eu,UpdateRegistryItemRequest:MT,UpdateRegistryItemResponse:bT,UpdateRobotMetadataRequest:Kg,UpdateRobotMetadataResponse:Xg,UpdateRobotPartMetadataRequest:ng,UpdateRobotPartMetadataResponse:ag,UpdateRobotPartRequest:jp,UpdateRobotPartResponse:Hp,UpdateRobotRequest:Yg,UpdateRobotResponse:$g,UploadModuleFileRequest:YT,UploadModuleFileResponse:$T,Uploads:Io,VersionHistory:jT,ViamAgentVersion:Bg,ViamServerVersion:Lg,Visibility:cn},Symbol.toStringTag,{value:"Module"})),h1={typeName:"viam.app.v1.AppService",methods:{getUserIDByEmail:{name:"GetUserIDByEmail",I:XT,O:QT,kind:m.Unary},createOrganization:{name:"CreateOrganization",I:Ru,O:_u,kind:m.Unary},listOrganizations:{name:"ListOrganizations",I:vu,O:fu,kind:m.Unary},getOrganizationsWithAccessToLocation:{name:"GetOrganizationsWithAccessToLocation",I:hp,O:fp,kind:m.Unary},listOrganizationsByUser:{name:"ListOrganizationsByUser",I:ZT,O:ek,kind:m.Unary},searchOrganizations:{name:"SearchOrganizations",I:nk,O:ak,kind:m.Unary},getOrganization:{name:"GetOrganization",I:Su,O:Iu,kind:m.Unary},getOrganizationNamespaceAvailability:{name:"GetOrganizationNamespaceAvailability",I:Mu,O:bu,kind:m.Unary},updateOrganization:{name:"UpdateOrganization",I:wu,O:Eu,kind:m.Unary},deleteOrganization:{name:"DeleteOrganization",I:Ou,O:Cu,kind:m.Unary},getOrganizationMetadata:{name:"GetOrganizationMetadata",I:Nu,O:Pu,kind:m.Unary},updateOrganizationMetadata:{name:"UpdateOrganizationMetadata",I:Au,O:Du,kind:m.Unary},listOrganizationMembers:{name:"ListOrganizationMembers",I:qu,O:Uu,kind:m.Unary},createOrganizationInvite:{name:"CreateOrganizationInvite",I:Gu,O:Lu,kind:m.Unary},updateOrganizationInviteAuthorizations:{name:"UpdateOrganizationInviteAuthorizations",I:Bu,O:Fu,kind:m.Unary},deleteOrganizationMember:{name:"DeleteOrganizationMember",I:$u,O:Vu,kind:m.Unary},deleteOrganizationInvite:{name:"DeleteOrganizationInvite",I:xu,O:Ju,kind:m.Unary},resendOrganizationInvite:{name:"ResendOrganizationInvite",I:zu,O:Yu,kind:m.Unary},enableBillingService:{name:"EnableBillingService",I:Wu,O:ju,kind:m.Unary},disableBillingService:{name:"DisableBillingService",I:Zu,O:ep,kind:m.Unary},updateBillingService:{name:"UpdateBillingService",I:Hu,O:Ku,kind:m.Unary},getBillingServiceConfig:{name:"GetBillingServiceConfig",I:Xu,O:Qu,kind:m.Unary},organizationSetSupportEmail:{name:"OrganizationSetSupportEmail",I:np,O:ap,kind:m.Unary},organizationGetSupportEmail:{name:"OrganizationGetSupportEmail",I:tp,O:sp,kind:m.Unary},organizationSetLogo:{name:"OrganizationSetLogo",I:vk,O:hk,kind:m.Unary},organizationGetLogo:{name:"OrganizationGetLogo",I:fk,O:Rk,kind:m.Unary},enableAuthService:{name:"EnableAuthService",I:_k,O:Sk,kind:m.Unary},disableAuthService:{name:"DisableAuthService",I:Ik,O:Mk,kind:m.Unary},createOAuthApp:{name:"CreateOAuthApp",I:bk,O:wk,kind:m.Unary},readOAuthApp:{name:"ReadOAuthApp",I:Ek,O:Ok,kind:m.Unary},updateOAuthApp:{name:"UpdateOAuthApp",I:Ck,O:Nk,kind:m.Unary},deleteOAuthApp:{name:"DeleteOAuthApp",I:Pk,O:Ak,kind:m.Unary},listOAuthApps:{name:"ListOAuthApps",I:Dk,O:qk,kind:m.Unary},createLocation:{name:"CreateLocation",I:rp,O:mp,kind:m.Unary},getLocation:{name:"GetLocation",I:cp,O:dp,kind:m.Unary},updateLocation:{name:"UpdateLocation",I:lp,O:up,kind:m.Unary},deleteLocation:{name:"DeleteLocation",I:pp,O:gp,kind:m.Unary},getLocationMetadata:{name:"GetLocationMetadata",I:Tp,O:kp,kind:m.Unary},updateLocationMetadata:{name:"UpdateLocationMetadata",I:yp,O:vp,kind:m.Unary},listLocations:{name:"ListLocations",I:Rp,O:bp,kind:m.Unary},shareLocation:{name:"ShareLocation",I:_p,O:Sp,kind:m.Unary},unshareLocation:{name:"UnshareLocation",I:Ip,O:Mp,kind:m.Unary},locationAuth:{name:"LocationAuth",I:Np,O:Pp,kind:m.Unary},createLocationSecret:{name:"CreateLocationSecret",I:wp,O:Ep,kind:m.Unary},deleteLocationSecret:{name:"DeleteLocationSecret",I:Op,O:Cp,kind:m.Unary},getRobot:{name:"GetRobot",I:Ap,O:Gp,kind:m.Unary},getRobotMetadata:{name:"GetRobotMetadata",I:jg,O:Hg,kind:m.Unary},updateRobotMetadata:{name:"UpdateRobotMetadata",I:Kg,O:Xg,kind:m.Unary},getRoverRentalRobots:{name:"GetRoverRentalRobots",I:Dp,O:Up,kind:m.Unary},getRobotParts:{name:"GetRobotParts",I:Lp,O:Bp,kind:m.Unary},getRobotPart:{name:"GetRobotPart",I:Fp,O:xp,kind:m.Unary},getRobotPartLogs:{name:"GetRobotPartLogs",I:Jp,O:zp,kind:m.Unary},tailRobotPartLogs:{name:"TailRobotPartLogs",I:Yp,O:$p,kind:m.ServerStreaming},getRobotPartHistory:{name:"GetRobotPartHistory",I:Vp,O:Wp,kind:m.Unary},updateRobotPart:{name:"UpdateRobotPart",I:jp,O:Hp,kind:m.Unary},newRobotPart:{name:"NewRobotPart",I:Kp,O:Xp,kind:m.Unary},deleteRobotPart:{name:"DeleteRobotPart",I:Qp,O:ig,kind:m.Unary},getRobotPartMetadata:{name:"GetRobotPartMetadata",I:Zp,O:eg,kind:m.Unary},updateRobotPartMetadata:{name:"UpdateRobotPartMetadata",I:ng,O:ag,kind:m.Unary},getRobotAPIKeys:{name:"GetRobotAPIKeys",I:tg,O:og,kind:m.Unary},markPartAsMain:{name:"MarkPartAsMain",I:Qg,O:Zg,kind:m.Unary},markPartForRestart:{name:"MarkPartForRestart",I:eT,O:nT,kind:m.Unary},createRobotPartSecret:{name:"CreateRobotPartSecret",I:aT,O:tT,kind:m.Unary},deleteRobotPartSecret:{name:"DeleteRobotPartSecret",I:sT,O:oT,kind:m.Unary},listRobots:{name:"ListRobots",I:Eg,O:xg,kind:m.Unary},newRobot:{name:"NewRobot",I:Jg,O:zg,kind:m.Unary},updateRobot:{name:"UpdateRobot",I:Yg,O:$g,kind:m.Unary},deleteRobot:{name:"DeleteRobot",I:Vg,O:Wg,kind:m.Unary},listFragments:{name:"ListFragments",I:dg,O:lg,kind:m.Unary},getFragment:{name:"GetFragment",I:ug,O:pg,kind:m.Unary},createFragment:{name:"CreateFragment",I:gg,O:Tg,kind:m.Unary},updateFragment:{name:"UpdateFragment",I:kg,O:yg,kind:m.Unary},deleteFragment:{name:"DeleteFragment",I:vg,O:hg,kind:m.Unary},listNestedFragments:{name:"ListNestedFragments",I:Og,O:Cg,kind:m.Unary},listMachineFragments:{name:"ListMachineFragments",I:Ng,O:Pg,kind:m.Unary},listMachineSummaries:{name:"ListMachineSummaries",I:Ag,O:Dg,kind:m.Unary},getFragmentHistory:{name:"GetFragmentHistory",I:fg,O:Rg,kind:m.Unary},getFragmentUsage:{name:"GetFragmentUsage",I:_g,O:Sg,kind:m.Unary},setFragmentTag:{name:"SetFragmentTag",I:Ig,O:Mg,kind:m.Unary},deleteFragmentTag:{name:"DeleteFragmentTag",I:bg,O:wg,kind:m.Unary},addRole:{name:"AddRole",I:iT,O:rT,kind:m.Unary},removeRole:{name:"RemoveRole",I:mT,O:cT,kind:m.Unary},changeRole:{name:"ChangeRole",I:dT,O:lT,kind:m.Unary},listAuthorizations:{name:"ListAuthorizations",I:uT,O:pT,kind:m.Unary},checkPermissions:{name:"CheckPermissions",I:gT,O:TT,kind:m.Unary},getRegistryItem:{name:"GetRegistryItem",I:RT,O:_T,kind:m.Unary},createRegistryItem:{name:"CreateRegistryItem",I:ST,O:IT,kind:m.Unary},updateRegistryItem:{name:"UpdateRegistryItem",I:MT,O:bT,kind:m.Unary},listRegistryItems:{name:"ListRegistryItems",I:wT,O:ET,kind:m.Unary},deleteRegistryItem:{name:"DeleteRegistryItem",I:OT,O:CT,kind:m.Unary},renameRegistryItem:{name:"RenameRegistryItem",I:NT,O:PT,kind:m.Unary},transferRegistryItem:{name:"TransferRegistryItem",I:AT,O:DT,kind:m.Unary},createModule:{name:"CreateModule",I:qT,O:UT,kind:m.Unary},updateModule:{name:"UpdateModule",I:GT,O:BT,kind:m.Unary},uploadModuleFile:{name:"UploadModuleFile",I:YT,O:$T,kind:m.ClientStreaming},getModule:{name:"GetModule",I:VT,O:WT,kind:m.Unary},listModules:{name:"ListModules",I:HT,O:KT,kind:m.Unary},createKey:{name:"CreateKey",I:tk,O:sk,kind:m.Unary},deleteKey:{name:"DeleteKey",I:ok,O:ik,kind:m.Unary},listKeys:{name:"ListKeys",I:dk,O:lk,kind:m.Unary},renameKey:{name:"RenameKey",I:rk,O:mk,kind:m.Unary},rotateKey:{name:"RotateKey",I:uk,O:pk,kind:m.Unary},createKeyFromExistingKeyAuthorizations:{name:"CreateKeyFromExistingKeyAuthorizations",I:gk,O:Tk,kind:m.Unary},getAppContent:{name:"GetAppContent",I:kk,O:yk,kind:m.Unary}}},Uk=(a,e,n,t,o,i)=>new Q({authorizationType:"role",identityId:e,identityType:o,authorizationId:`${t}_${n}`,resourceType:t,organizationId:a,resourceId:i});class f1{client;constructor(e){this.client=na(h1,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:Uk(e,n,t,o,"",i)})}async removeRole(e,n,t,o,i){await this.client.removeRole({authorization:Uk(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 u={organizationId:e,types:n,visibilities:t,platforms:o,statuses:i,searchTerm:r,pageToken:c};return(await this.client.listRegistryItems(u)).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:d.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:d.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:d.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:d.fromJson(n)})}}const Gk=s.makeEnum("viam.app.v1.PaymentMethodType",[{no:0,name:"PAYMENT_METHOD_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PAYMENT_METHOD_TYPE_CARD",localName:"CARD"}]),Lk=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"}]),Bk=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"}]),Fk=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}]),xk=s.makeMessageType("viam.app.v1.PaymentMethodCard",()=>[{no:1,name:"brand",kind:"scalar",T:9},{no:2,name:"last_four_digits",kind:"scalar",T:9}]),Jk=s.makeMessageType("viam.app.v1.GetCurrentMonthUsageRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),zk=s.makeMessageType("viam.app.v1.UsageCost",()=>[{no:1,name:"resource_type",kind:"enum",T:s.getEnumType(Lk)},{no:2,name:"cost",kind:"scalar",T:1}]),Yk=s.makeMessageType("viam.app.v1.ResourceUsageCostsBySource",()=>[{no:1,name:"source_type",kind:"enum",T:s.getEnumType(Bk)},{no:2,name:"resource_usage_costs",kind:"message",T:$k},{no:3,name:"tier_name",kind:"scalar",T:9}]),$k=s.makeMessageType("viam.app.v1.ResourceUsageCosts",()=>[{no:1,name:"usage_costs",kind:"message",T:zk,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}]),Vk=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:Yk,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}]),Wk=s.makeMessageType("viam.app.v1.GetOrgBillingInformationRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),jk=s.makeMessageType("viam.app.v1.GetOrgBillingInformationResponse",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Gk)},{no:2,name:"billing_email",kind:"scalar",T:9},{no:3,name:"method",kind:"message",T:xk,opt:!0},{no:4,name:"billing_tier",kind:"scalar",T:9,opt:!0}]),Hk=s.makeMessageType("viam.app.v1.GetInvoicesSummaryRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Kk=s.makeMessageType("viam.app.v1.GetInvoicesSummaryResponse",()=>[{no:1,name:"outstanding_balance",kind:"scalar",T:1},{no:2,name:"invoices",kind:"message",T:Fk,repeated:!0}]),Xk=s.makeMessageType("viam.app.v1.GetInvoicePdfRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"org_id",kind:"scalar",T:9}]),Qk=s.makeMessageType("viam.app.v1.GetInvoicePdfResponse",()=>[{no:1,name:"chunk",kind:"scalar",T:12}]),Zk=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}]),ey=s.makeMessageType("viam.app.v1.SendPaymentRequiredEmailResponse",[]),ny=s.makeMessageType("viam.app.v1.GetAvailableBillingTiersRequest",[]),ay=s.makeMessageType("viam.app.v1.GetAvailableBillingTiersResponse",()=>[{no:1,name:"tiers",kind:"scalar",T:9,repeated:!0}]),ty=s.makeMessageType("viam.app.v1.UpdateOrganizationBillingTierRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"billing_tier",kind:"scalar",T:9}]),sy=s.makeMessageType("viam.app.v1.UpdateOrganizationBillingTierResponse",[]),R1=Object.freeze(Object.defineProperty({__proto__:null,GetAvailableBillingTiersRequest:ny,GetAvailableBillingTiersResponse:ay,GetCurrentMonthUsageRequest:Jk,GetCurrentMonthUsageResponse:Vk,GetInvoicePdfRequest:Xk,GetInvoicePdfResponse:Qk,GetInvoicesSummaryRequest:Hk,GetInvoicesSummaryResponse:Kk,GetOrgBillingInformationRequest:Wk,GetOrgBillingInformationResponse:jk,InvoiceSummary:Fk,PaymentMethodCard:xk,PaymentMethodType:Gk,ResourceUsageCosts:$k,ResourceUsageCostsBySource:Yk,SendPaymentRequiredEmailRequest:Zk,SendPaymentRequiredEmailResponse:ey,SourceType:Bk,UpdateOrganizationBillingTierRequest:ty,UpdateOrganizationBillingTierResponse:sy,UsageCost:zk,UsageCostType:Lk},Symbol.toStringTag,{value:"Module"})),_1={typeName:"viam.app.v1.BillingService",methods:{getCurrentMonthUsage:{name:"GetCurrentMonthUsage",I:Jk,O:Vk,kind:m.Unary},getOrgBillingInformation:{name:"GetOrgBillingInformation",I:Wk,O:jk,kind:m.Unary},getInvoicesSummary:{name:"GetInvoicesSummary",I:Hk,O:Kk,kind:m.Unary},getInvoicePdf:{name:"GetInvoicePdf",I:Xk,O:Qk,kind:m.ServerStreaming},sendPaymentRequiredEmail:{name:"SendPaymentRequiredEmail",I:Zk,O:ey,kind:m.Unary},getAvailableBillingTiers:{name:"GetAvailableBillingTiers",I:ny,O:ay,kind:m.Unary},updateOrganizationBillingTier:{name:"UpdateOrganizationBillingTier",I:ty,O:sy,kind:m.Unary}}};class S1{client;constructor(e){this.client=N(_1,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 I1(o)}}const I1=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 oy={},iy={};(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 u(y,h),h}e.serialize=c;function u(y,h,g){if(g===void 0&&(g=0),g+=k(h.length,h,g),y.constructor===Array)for(var v=0,w=y.length;v<w;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 l(y,h,g){var v=O(y),w=v.length;return h.set(v,g),h[g+w++]=0,w}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+=l(y,g,v),v;switch(h.constructor){case String:g[v++]=2,v+=l(y,g,v);var w=l(h,g,v+4);return v+=k(w,g,v),v+w;case Number:if(Math.floor(h)===h)h<=2147483647&&h>=-2147483647?(g[v++]=16,v+=l(y,g,v),v+=k(h,g,v)):(g[v++]=18,v+=l(y,g,v),g.set(_(h),v),v+=8);else{g[v++]=1,v+=l(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+=l(y,g,v),g[v++]=h?1:0,v;case Array:case Object:g[v++]=h.constructor===Array?4:3,v+=l(y,g,v);var U=u(h,g,v);return k(U-v,g,v),U;case Int8Array:case Uint8Array:return g[v++]=5,v+=l(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+=l(y,g,v),g.set(_(h.getTime()),v),v+=8,v;case o:return g[v++]=9,v+=l(y,g,v),g.set(h.buffer(),v),v+=8,v;case n:return g[v++]=5,v+=l(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+=l(y,g,v),g.set(h.buffer(),v),v+=12,v;case RegExp:return g[v++]=11,v+=l(y,g,v),v+=l(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 w=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24;if(!(w<5||w>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:w=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24,b[$]=P(y.subarray(g,g+=w-1)),g++;break;case 3:w=y[g]|y[g+1]<<8|y[g+2]<<16|y[g+3]<<24,b[$]=I(y,h,g,!1),g+=w;break;case 4:w=y[g]|y[g+1]<<8|y[g+2]<<16|y[g+3]<<24,b[$]=I(y,h,g,!0),g+=w;break;case 5:if(w=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24,y[g++]===4){if(w!==16)return;b[$]=new n(y.subarray(g,g+=w))}else b[$]=y.slice(g,g+=w);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 Wo=P(y.subarray(g,U));for(g=U;U<y.length&&y[U++]!==0;);if(U>=y.length)return;var jo=P(y.subarray(g,U));g=U,b[$]=new RegExp(Wo,jo);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,w=y/g|0;y<0&&(v=~(-y%g)|0,w=~(-y/g)|0,v=v+1&4294967295,v||w++);var b=0;h[b++]=v&255,h[b++]=v>>>8&255,h[b++]=v>>>16&255,h[b++]=v>>>24&255,h[b++]=w&255,h[b++]=w>>>8&255,h[b++]=w>>>16&255,h[b]=w>>>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,w=y[h++]|y[h++]<<8|y[h++]<<16|y[h]<<24;return w*g+(v>=0?v:g+v)}function O(y){y=y.replace(/\r\n/g,`
9
- `);for(var h=[],g=0,v=0,w=y.length;v<w;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,w,b,ae;v<g;)w=y[v],w<128?(h+=String.fromCharCode(w),v++):w>191&&w<224?(b=y[v+1],h+=String.fromCharCode((w&31)<<6|b&63),v+=2):(b=y[v+1],ae=y[v+2],h+=String.fromCharCode((w&15)<<12|(b&63)<<6|ae&63),v+=3);return h}function Y(y){return encodeURI(y).split(/%..|./).length-1}}(a.BSON||(a.BSON={}))})(iy),Object.defineProperty(oy,"__esModule",{value:!0});var M1=iy,wo=oy.BSON=M1.BSON;const ry=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"}]),my=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"}]),cy=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"}]),Eo=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(ry)}]),$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:Nn},{no:14,name:"tags_filter",kind:"message",T:Oo},{no:15,name:"bbox_labels",kind:"scalar",T:9,repeated:!0},{no:16,name:"dataset_id",kind:"scalar",T:9}]),Oo=s.makeMessageType("viam.app.data.v1.TagsFilter",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(my)},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),Ea=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}]),Nn=s.makeMessageType("viam.app.data.v1.CaptureInterval",()=>[{no:1,name:"start",kind:"message",T:S},{no:2,name:"end",kind:"message",T:S}]),dy=s.makeMessageType("viam.app.data.v1.TabularDataByFilterRequest",()=>[{no:1,name:"data_request",kind:"message",T:Eo},{no:2,name:"count_only",kind:"scalar",T:8},{no:3,name:"include_internal_data",kind:"scalar",T:8}]),ly=s.makeMessageType("viam.app.data.v1.TabularDataByFilterResponse",()=>[{no:1,name:"metadata",kind:"message",T:Ea,repeated:!0},{no:2,name:"data",kind:"message",T:uy,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}]),uy=s.makeMessageType("viam.app.data.v1.TabularData",()=>[{no:1,name:"data",kind:"message",T:d},{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}]),py=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}]),gy=s.makeMessageType("viam.app.data.v1.TabularDataBySQLResponse",()=>[{no:2,name:"raw_data",kind:"scalar",T:12,repeated:!0}]),Ty=s.makeMessageType("viam.app.data.v1.TabularDataSource",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(cy)},{no:2,name:"pipeline_id",kind:"scalar",T:9,opt:!0}]),ky=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:Ty,opt:!0}]),yy=s.makeMessageType("viam.app.data.v1.TabularDataByMQLResponse",()=>[{no:2,name:"raw_data",kind:"scalar",T:12,repeated:!0}]),vy=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:Nn}]),hy=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:d},{no:12,name:"tags",kind:"scalar",T:9,repeated:!0},{no:13,name:"payload",kind:"message",T:d}]),fy=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}]),Ry=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:d}]),Co=s.makeMessageType("viam.app.data.v1.BinaryData",()=>[{no:1,name:"binary",kind:"scalar",T:12},{no:2,name:"metadata",kind:"message",T:Ey}]),_y=s.makeMessageType("viam.app.data.v1.BinaryDataByFilterRequest",()=>[{no:1,name:"data_request",kind:"message",T:Eo},{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}]),Sy=s.makeMessageType("viam.app.data.v1.BinaryDataByFilterResponse",()=>[{no:1,name:"data",kind:"message",T:Co,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}]),le=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}]),Iy=s.makeMessageType("viam.app.data.v1.BinaryDataByIDsRequest",()=>[{no:2,name:"include_binary",kind:"scalar",T:8},{no:3,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0}]),My=s.makeMessageType("viam.app.data.v1.BinaryDataByIDsResponse",()=>[{no:1,name:"data",kind:"message",T:Co,repeated:!0},{no:2,name:"count",kind:"scalar",T:4}]),by=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}]),wy=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}]),No=s.makeMessageType("viam.app.data.v1.Annotations",()=>[{no:1,name:"bboxes",kind:"message",T:by,repeated:!0},{no:2,name:"classifications",kind:"message",T:wy,repeated:!0}]),Ey=s.makeMessageType("viam.app.data.v1.BinaryMetadata",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"capture_metadata",kind:"message",T:Ea},{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:No},{no:9,name:"dataset_ids",kind:"scalar",T:9,repeated:!0},{no:10,name:"binary_data_id",kind:"scalar",T:9}]),Oy=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}]),Cy=s.makeMessageType("viam.app.data.v1.DeleteTabularDataResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Ny=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}]),Py=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByFilterResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Ay=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByIDsRequest",()=>[{no:2,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0}]),Dy=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByIDsResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),qy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByIDsRequest",()=>[{no:3,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),Uy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByIDsResponse",[]),Gy=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}]),Ly=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByFilterResponse",[]),By=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByIDsRequest",()=>[{no:3,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),Fy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByIDsResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),xy=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}]),Jy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByFilterResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),zy=s.makeMessageType("viam.app.data.v1.TagsByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e}]),Yy=s.makeMessageType("viam.app.data.v1.TagsByFilterResponse",()=>[{no:1,name:"tags",kind:"scalar",T:9,repeated:!0}]),$y=s.makeMessageType("viam.app.data.v1.AddBoundingBoxToImageByIDRequest",()=>[{no:7,name:"binary_id",kind:"message",T:le},{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}]),Vy=s.makeMessageType("viam.app.data.v1.AddBoundingBoxToImageByIDResponse",()=>[{no:1,name:"bbox_id",kind:"scalar",T:9}]),Wy=s.makeMessageType("viam.app.data.v1.RemoveBoundingBoxFromImageByIDRequest",()=>[{no:3,name:"binary_id",kind:"message",T:le},{no:4,name:"binary_data_id",kind:"scalar",T:9},{no:2,name:"bbox_id",kind:"scalar",T:9}]),jy=s.makeMessageType("viam.app.data.v1.RemoveBoundingBoxFromImageByIDResponse",[]),Hy=s.makeMessageType("viam.app.data.v1.UpdateBoundingBoxRequest",()=>[{no:1,name:"binary_id",kind:"message",T:le},{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}]),Ky=s.makeMessageType("viam.app.data.v1.UpdateBoundingBoxResponse",[]),Xy=s.makeMessageType("viam.app.data.v1.BoundingBoxLabelsByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e}]),Qy=s.makeMessageType("viam.app.data.v1.BoundingBoxLabelsByFilterResponse",()=>[{no:1,name:"labels",kind:"scalar",T:9,repeated:!0}]),Zy=s.makeMessageType("viam.app.data.v1.ConfigureDatabaseUserRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"password",kind:"scalar",T:9}]),ev=s.makeMessageType("viam.app.data.v1.ConfigureDatabaseUserResponse",[]),nv=s.makeMessageType("viam.app.data.v1.GetDatabaseConnectionRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),av=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}]),tv=s.makeMessageType("viam.app.data.v1.AddBinaryDataToDatasetByIDsRequest",()=>[{no:1,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"dataset_id",kind:"scalar",T:9}]),sv=s.makeMessageType("viam.app.data.v1.AddBinaryDataToDatasetByIDsResponse",[]),ov=s.makeMessageType("viam.app.data.v1.RemoveBinaryDataFromDatasetByIDsRequest",()=>[{no:1,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"dataset_id",kind:"scalar",T:9}]),iv=s.makeMessageType("viam.app.data.v1.RemoveBinaryDataFromDatasetByIDsResponse",[]),b1=Object.freeze(Object.defineProperty({__proto__:null,AddBinaryDataToDatasetByIDsRequest:tv,AddBinaryDataToDatasetByIDsResponse:sv,AddBoundingBoxToImageByIDRequest:$y,AddBoundingBoxToImageByIDResponse:Vy,AddTagsToBinaryDataByFilterRequest:Gy,AddTagsToBinaryDataByFilterResponse:Ly,AddTagsToBinaryDataByIDsRequest:qy,AddTagsToBinaryDataByIDsResponse:Uy,Annotations:No,BinaryData:Co,BinaryDataByFilterRequest:_y,BinaryDataByFilterResponse:Sy,BinaryDataByIDsRequest:Iy,BinaryDataByIDsResponse:My,BinaryID:le,BinaryMetadata:Ey,BoundingBox:by,BoundingBoxLabelsByFilterRequest:Xy,BoundingBoxLabelsByFilterResponse:Qy,CaptureInterval:Nn,CaptureMetadata:Ea,Classification:wy,ConfigureDatabaseUserRequest:Zy,ConfigureDatabaseUserResponse:ev,DataRequest:Eo,DeleteBinaryDataByFilterRequest:Ny,DeleteBinaryDataByFilterResponse:Py,DeleteBinaryDataByIDsRequest:Ay,DeleteBinaryDataByIDsResponse:Dy,DeleteTabularDataRequest:Oy,DeleteTabularDataResponse:Cy,ExportTabularDataRequest:vy,ExportTabularDataResponse:hy,Filter:$e,GetDatabaseConnectionRequest:nv,GetDatabaseConnectionResponse:av,GetLatestTabularDataRequest:fy,GetLatestTabularDataResponse:Ry,Order:ry,RemoveBinaryDataFromDatasetByIDsRequest:ov,RemoveBinaryDataFromDatasetByIDsResponse:iv,RemoveBoundingBoxFromImageByIDRequest:Wy,RemoveBoundingBoxFromImageByIDResponse:jy,RemoveTagsFromBinaryDataByFilterRequest:xy,RemoveTagsFromBinaryDataByFilterResponse:Jy,RemoveTagsFromBinaryDataByIDsRequest:By,RemoveTagsFromBinaryDataByIDsResponse:Fy,TabularData:uy,TabularDataByFilterRequest:dy,TabularDataByFilterResponse:ly,TabularDataByMQLRequest:ky,TabularDataByMQLResponse:yy,TabularDataBySQLRequest:py,TabularDataBySQLResponse:gy,TabularDataSource:Ty,TabularDataSourceType:cy,TagsByFilterRequest:zy,TagsByFilterResponse:Yy,TagsFilter:Oo,TagsFilterType:my,UpdateBoundingBoxRequest:Hy,UpdateBoundingBoxResponse:Ky},Symbol.toStringTag,{value:"Module"})),w1={typeName:"viam.app.data.v1.DataService",methods:{tabularDataByFilter:{name:"TabularDataByFilter",I:dy,O:ly,kind:m.Unary},tabularDataBySQL:{name:"TabularDataBySQL",I:py,O:gy,kind:m.Unary},tabularDataByMQL:{name:"TabularDataByMQL",I:ky,O:yy,kind:m.Unary},exportTabularData:{name:"ExportTabularData",I:vy,O:hy,kind:m.ServerStreaming},getLatestTabularData:{name:"GetLatestTabularData",I:fy,O:Ry,kind:m.Unary},binaryDataByFilter:{name:"BinaryDataByFilter",I:_y,O:Sy,kind:m.Unary},binaryDataByIDs:{name:"BinaryDataByIDs",I:Iy,O:My,kind:m.Unary},deleteTabularData:{name:"DeleteTabularData",I:Oy,O:Cy,kind:m.Unary},deleteBinaryDataByFilter:{name:"DeleteBinaryDataByFilter",I:Ny,O:Py,kind:m.Unary},deleteBinaryDataByIDs:{name:"DeleteBinaryDataByIDs",I:Ay,O:Dy,kind:m.Unary},addTagsToBinaryDataByIDs:{name:"AddTagsToBinaryDataByIDs",I:qy,O:Uy,kind:m.Unary},addTagsToBinaryDataByFilter:{name:"AddTagsToBinaryDataByFilter",I:Gy,O:Ly,kind:m.Unary},removeTagsFromBinaryDataByIDs:{name:"RemoveTagsFromBinaryDataByIDs",I:By,O:Fy,kind:m.Unary},removeTagsFromBinaryDataByFilter:{name:"RemoveTagsFromBinaryDataByFilter",I:xy,O:Jy,kind:m.Unary},tagsByFilter:{name:"TagsByFilter",I:zy,O:Yy,kind:m.Unary},addBoundingBoxToImageByID:{name:"AddBoundingBoxToImageByID",I:$y,O:Vy,kind:m.Unary},removeBoundingBoxFromImageByID:{name:"RemoveBoundingBoxFromImageByID",I:Wy,O:jy,kind:m.Unary},boundingBoxLabelsByFilter:{name:"BoundingBoxLabelsByFilter",I:Xy,O:Qy,kind:m.Unary},updateBoundingBox:{name:"UpdateBoundingBox",I:Hy,O:Ky,kind:m.Unary},getDatabaseConnection:{name:"GetDatabaseConnection",I:nv,O:av,kind:m.Unary},configureDatabaseUser:{name:"ConfigureDatabaseUser",I:Zy,O:ev,kind:m.Unary},addBinaryDataToDatasetByIDs:{name:"AddBinaryDataToDatasetByIDs",I:tv,O:sv,kind:m.Unary},removeBinaryDataFromDatasetByIDs:{name:"RemoveBinaryDataFromDatasetByIDs",I:ov,O:iv,kind:m.Unary}}},rv=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}]),E1=s.makeMessageType("viam.app.dataset.v1.CreateDatasetRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),O1=s.makeMessageType("viam.app.dataset.v1.CreateDatasetResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),C1=s.makeMessageType("viam.app.dataset.v1.DeleteDatasetRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),N1=s.makeMessageType("viam.app.dataset.v1.DeleteDatasetResponse",[]),P1=s.makeMessageType("viam.app.dataset.v1.RenameDatasetRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),A1=s.makeMessageType("viam.app.dataset.v1.RenameDatasetResponse",[]),D1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByOrganizationIDRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),q1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByOrganizationIDResponse",()=>[{no:1,name:"datasets",kind:"message",T:rv,repeated:!0}]),U1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByIDsRequest",()=>[{no:1,name:"ids",kind:"scalar",T:9,repeated:!0}]),G1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByIDsResponse",()=>[{no:1,name:"datasets",kind:"message",T:rv,repeated:!0}]),L1={typeName:"viam.app.dataset.v1.DatasetService",methods:{createDataset:{name:"CreateDataset",I:E1,O:O1,kind:m.Unary},deleteDataset:{name:"DeleteDataset",I:C1,O:N1,kind:m.Unary},renameDataset:{name:"RenameDataset",I:P1,O:A1,kind:m.Unary},listDatasetsByOrganizationID:{name:"ListDatasetsByOrganizationID",I:D1,O:q1,kind:m.Unary},listDatasetsByIDs:{name:"ListDatasetsByIDs",I:U1,O:G1,kind:m.Unary}}},B1=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"}]),Po=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"}]),Ao=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:Pn},{no:2,name:"sensor_contents",kind:"message",T:qo,repeated:!0}]),F1=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}]),x1=s.makeMessageType("viam.app.datasync.v1.FileUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:Pn,oneof:"upload_packet"},{no:2,name:"file_contents",kind:"message",T:$1,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}]),z1=s.makeMessageType("viam.app.datasync.v1.StreamingDataCaptureUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:V1,oneof:"upload_packet"},{no:2,name:"data",kind:"scalar",T:12,oneof:"upload_packet"}]),Y1=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}]),Do=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(B1)},{no:4,name:"annotations",kind:"message",T:No}]),qo=s.makeMessageType("viam.app.datasync.v1.SensorData",()=>[{no:1,name:"metadata",kind:"message",T:Do},{no:2,name:"struct",kind:"message",T:d,oneof:"data"},{no:3,name:"binary",kind:"scalar",T:12,oneof:"data"}]),$1=s.makeMessageType("viam.app.datasync.v1.FileData",()=>[{no:1,name:"data",kind:"scalar",T:12}]),Pn=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(Po)},{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}]),V1=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadMetadata",()=>[{no:1,name:"upload_metadata",kind:"message",T:Pn},{no:2,name:"sensor_metadata",kind:"message",T:Do}]),W1={typeName:"viam.app.datasync.v1.DataSyncService",methods:{dataCaptureUpload:{name:"DataCaptureUpload",I:Ao,O:F1,kind:m.Unary},fileUpload:{name:"FileUpload",I:x1,O:J1,kind:m.ClientStreaming},streamingDataCaptureUpload:{name:"StreamingDataCaptureUpload",I:z1,O:Y1,kind:m.ClientStreaming}}},Ve=()=>{console.warn("The BinaryID type is deprecated and will be removed in a future release. Please migrate to the BinaryDataId field instead.")};class j1{dataClient;datasetClient;dataSyncClient;constructor(e){this.dataClient=N(w1,e),this.datasetClient=N(L1,e),this.dataSyncClient=N(W1,e)}async exportTabularData(e,n,t,o,i,r){const c=new Nn;i&&(c.start=S.fromDate(i)),r&&(c.end=S.fromDate(r));const u={partId:e,resourceName:n,resourceSubtype:t,methodName:o,interval:c},l=this.dataClient.exportTabularData(u),k=[];for await(const R of l)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=>wo.deserialize(o))}async tabularDataByMQL(e,n,t){const o=n[0]instanceof Uint8Array?n:n.map(r=>wo.serialize(r));return(await this.dataClient.tabularDataByMQL({organizationId:e,mqlBinary:o,useRecentData:t})).rawData.map(r=>wo.deserialize(r))}async tabularDataByFilter(e,n,t,o="",i=!1,r=!1){const u={dataRequest:{filter:e,limit:n===void 0?void 0:BigInt(n),sortOrder:t,last:o},countOnly:i,includeInternalData:r},l=await this.dataClient.tabularDataByFilter(u),k=l.metadata.length,R=[];return R.push(...l.data.map(I=>{const _=I.metadataIndex,M=k!==0&&_>=k?new Ea:l.metadata[_];return{data:I.data?.toJson(),metadata:M,timeRequested:I.timeRequested?.toDate(),timeReceived:I.timeRequested?.toDate()}})),{data:R,count:l.count,last:l.last}}async binaryDataByFilter(e,n,t,o="",i=!0,r=!1,c=!1){const l={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(l);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 u=new Pn({partId:n,componentType:t,componentName:o,methodName:i,type:Po.TABULAR_SENSOR,tags:c}),l=[];for(const[I,_]of e.entries()){const M=new Do,O=r[I];O&&(M.timeRequested=S.fromDate(O[0]),M.timeReceived=S.fromDate(O[1])),l.push(new qo({metadata:M,data:{case:"struct",value:d.fromJson(_)}}))}const k=new Ao({metadata:u,sensorContents:l});return(await this.dataSyncClient.dataCaptureUpload(k)).fileId}async binaryDataCaptureUpload(e,n,t,o,i,r,c,u){const l=new Pn({partId:n,componentType:t,componentName:o,methodName:i,type:Po.BINARY_SENSOR,tags:u,fileExtension:r}),k=new qo({metadata:{timeRequested:S.fromDate(c[0]),timeReceived:S.fromDate(c[1])},data:{case:"binary",value:e}}),R=new Ao({metadata:l,sensorContents:[k]});return(await this.dataSyncClient.dataCaptureUpload(R)).binaryDataId}createFilter(e){const n=new $e(e);if(e.startTime??e.endTime){const o=new Nn;e.startTime&&(o.start=S.fromDate(e.startTime)),e.endTime&&(o.end=S.fromDate(e.endTime)),n.interval=o}const t=new Oo;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()]}}const H1={typeName:"viam.app.mltraining.v1.MLTrainingService",methods:{submitTrainingJob:{name:"SubmitTrainingJob",I:Hl,O:Kl,kind:m.Unary},submitCustomTrainingJob:{name:"SubmitCustomTrainingJob",I:Xl,O:Ql,kind:m.Unary},getTrainingJob:{name:"GetTrainingJob",I:Zl,O:eu,kind:m.Unary},listTrainingJobs:{name:"ListTrainingJobs",I:nu,O:au,kind:m.Unary},cancelTrainingJob:{name:"CancelTrainingJob",I:tu,O:su,kind:m.Unary},deleteCompletedTrainingJob:{name:"DeleteCompletedTrainingJob",I:ou,O:iu,kind:m.Unary},getTrainingJobLogs:{name:"GetTrainingJobLogs",I:mu,O:cu,kind:m.Unary}}};class K1{client;constructor(e){this.client=N(H1,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 mv=s.makeMessageType("viam.provisioning.v1.GetSmartMachineStatusRequest",[]),cv=s.makeMessageType("viam.provisioning.v1.GetSmartMachineStatusResponse",()=>[{no:1,name:"provisioning_info",kind:"message",T:kv},{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:Uo},{no:5,name:"errors",kind:"scalar",T:9,repeated:!0}]),dv=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}]),lv=s.makeMessageType("viam.provisioning.v1.SetNetworkCredentialsResponse",[]),uv=s.makeMessageType("viam.provisioning.v1.SetSmartMachineCredentialsRequest",()=>[{no:1,name:"cloud",kind:"message",T:Go}]),pv=s.makeMessageType("viam.provisioning.v1.SetSmartMachineCredentialsResponse",[]),gv=s.makeMessageType("viam.provisioning.v1.GetNetworkListRequest",[]),Tv=s.makeMessageType("viam.provisioning.v1.GetNetworkListResponse",()=>[{no:1,name:"networks",kind:"message",T:Uo,repeated:!0}]),kv=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}]),Uo=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}]),Go=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}]),X1=Object.freeze(Object.defineProperty({__proto__:null,CloudConfig:Go,GetNetworkListRequest:gv,GetNetworkListResponse:Tv,GetSmartMachineStatusRequest:mv,GetSmartMachineStatusResponse:cv,NetworkInfo:Uo,ProvisioningInfo:kv,SetNetworkCredentialsRequest:dv,SetNetworkCredentialsResponse:lv,SetSmartMachineCredentialsRequest:uv,SetSmartMachineCredentialsResponse:pv},Symbol.toStringTag,{value:"Module"})),Q1={typeName:"viam.provisioning.v1.ProvisioningService",methods:{getSmartMachineStatus:{name:"GetSmartMachineStatus",I:mv,O:cv,kind:m.Unary},setNetworkCredentials:{name:"SetNetworkCredentials",I:dv,O:lv,kind:m.Unary},setSmartMachineCredentials:{name:"SetSmartMachineCredentials",I:uv,O:pv,kind:m.Unary},getNetworkList:{name:"GetNetworkList",I:gv,O:Tv,kind:m.Unary}}};class Z1{client;constructor(e){this.client=N(Q1,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 e_=async({serviceHost:a="https://app.viam.com",credentials:e})=>{const n=await TR(a,e);return new n_(n,e)};class n_{transport;credentials;dataClient;appClient;mlTrainingClient;provisioningClient;billingClient;constructor(e,n){this.transport=e,this.credentials=n,this.dataClient=new j1(this.transport),this.appClient=new f1(this.transport),this.mlTrainingClient=new K1(this.transport),this.provisioningClient=new Z1(this.transport),this.billingClient=new S1(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(u=>u.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(!Mn(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(u=>u.state===ho.ENABLED)?.secret,authEntity:t})}return jl({host:t,credentials:i,signalingAddress:"https://app.viam.com:443",reconnectMaxAttempts:1})}}const{JointPositions:a_}=Cr;class t_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Nr),this.name=n,this.options=t}async getEndPosition(e={},n=this.callOptions){const t=new ct({name:this.name,extra:d.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:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async moveToPosition(e,n={},t=this.callOptions){const o=new lt({name:this.name,to:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.moveToPosition(o,t)}async moveToJointPositions(e,n={},t=this.callOptions){const o=new mn({values:e}),i=new ut({name:this.name,positions:o,extra:d.fromJson(n)});this.options.requestLogger?.(i),await this.client.moveToJointPositions(i,t)}async getJointPositions(e={},n=this.callOptions){const t=new dt({name:this.name,extra:d.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 pt({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new gt({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{GetPropertiesResponse:s_}=Br;class o_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Fr),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async moveStraight(e,n,t={},o=this.callOptions){const i=new Tt({name:this.name,mmPerSec:n,distanceMm:e?BigInt(e):void 0,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.moveStraight(i,o)}async spin(e,n,t={},o=this.callOptions){const i=new kt({name:this.name,angleDeg:e,degsPerSec:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.spin(i,o)}async setPower(e,n,t={},o=this.callOptions){const i=new vt({name:this.name,linear:e,angular:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPower(i,o)}async setVelocity(e,n,t={},o=this.callOptions){const i=new ht({name:this.name,linear:e,angular:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setVelocity(i,o)}async stop(e={},n=this.callOptions){const t=new yt({name:this.name,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}async getProperties(e={},n=this.callOptions){const t=new ua({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}}const{ReadAnalogReaderResponse:i_,PowerMode:r_}=Zr;class m_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(em),this.name=n,this.options=t}async setGPIO(e,n,t={},o=this.callOptions){const i=new Rt({name:this.name,pin:e,high:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setGPIO(i,o)}async getGPIO(e,n={},t=this.callOptions){const o=new _t({name:this.name,pin:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getGPIO(o,t)).high}async getPWM(e,n={},t=this.callOptions){const o=new St({name:this.name,pin:e,extra:d.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 It({name:this.name,pin:e,dutyCyclePct:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPWM(i,o)}async getPWMFrequency(e,n={},t=this.callOptions){const o=new Mt({name:this.name,pin:e,extra:d.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 bt({name:this.name,pin:e,frequencyHz:n?BigInt(n):void 0,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPWMFrequency(i,o)}async readAnalogReader(e,n={},t=this.callOptions){const o=new wt({boardName:this.name,analogReaderName:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),this.client.readAnalogReader(o,t)}async writeAnalog(e,n,t={},o=this.callOptions){const i=new Et({name:this.name,pin:e,value:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.writeAnalog(i,o)}async getDigitalInterruptValue(e,n={},t=this.callOptions){const o=new Ot({boardName:this.name,digitalInterruptName:e,extra:d.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 Ct({name:this.name,pinNames:e,extra:d.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 Nt({name:this.name,powerMode:e,duration:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPowerMode(i,o)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const Lo=s.makeMessageType("viam.component.button.v1.PushRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),yv=s.makeMessageType("viam.component.button.v1.PushResponse",[]),c_=Object.freeze(Object.defineProperty({__proto__:null,PushRequest:Lo,PushResponse:yv},Symbol.toStringTag,{value:"Module"})),d_={typeName:"viam.component.button.v1.ButtonService",methods:{push:{name:"Push",I:Lo,O:yv,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}};class l_{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 Lo({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.push(t,n)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const u_=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}]),p_={typeName:"viam.component.camera.v1.CameraService",methods:{getImage:{name:"GetImage",I:to,O:Rl,kind:m.Unary},getImages:{name:"GetImages",I:_l,O:Sl,kind:m.Unary},renderFrame:{name:"RenderFrame",I:oo,O:u_,kind:m.Unary},getPointCloud:{name:"GetPointCloud",I:io,O:Il,kind:m.Unary},getProperties:{name:"GetProperties",I:Ml,O:bl,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},g_="pointcloud/pcd";class T_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(p_),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async getImage(e="",n={},t=this.callOptions){const o=new to({name:this.name,mimeType:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getImage(o,t)).image}async renderFrame(e="",n={},t=this.callOptions){const o=new oo({name:this.name,mimeType:e,extra:d.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 io({name:this.name,mimeType:g_,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}class k_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Cd),this.name=n,this.options=t}async discoverResources(e={},n=this.callOptions){const t=new As({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.discoverResources(t,n)).discoveries}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{GetPropertiesResponse:y_,PositionType:vv}=sm;class v_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(om),this.name=n,this.options=t}async resetPosition(e={},n=this.callOptions){const t=new Dt({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.resetPosition(t,n)}async getProperties(e={},n=this.callOptions){const t=new qt({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}async getPosition(e=vv.UNSPECIFIED,n={},t=this.callOptions){const o=new At({name:this.name,positionType:e,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}class h_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(um),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async getPosition(e={},n=this.callOptions){const t=new Ut({name:this.name,extra:d.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 Gt({name:this.name,positionsMm:e,speedsMmPerSec:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.moveToPosition(i,o)}async home(e={},n=this.callOptions){const t=new Lt({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.home(t,n)).homed}async getLengths(e={},n=this.callOptions){const t=new Bt({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getLengths(t,n)).lengthsMm}async stop(e={},n=this.callOptions){const t=new Ft({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new xt({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{Capsule:f_,GeoGeometry:R_,GeoPoint:__,GeometriesInFrame:S_,Geometry:I_,Orientation:M_,Pose:b_,PoseInFrame:w_,RectangularPrism:E_,ResourceName:O_,Sphere:C_,Transform:N_,Vector3:P_,WorldState:A_}=it,hv=a=>{const{latitude:e,longitude:n}=a;return!(typeof e!="number"||typeof n!="number"||Number.isNaN(e)||Number.isNaN(n))};class D_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Yl),this.name=n,this.options=t}async metadata(e={},n=this.callOptions){const t=new xl({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.metadata(t,n)}async infer(e,n={},t=this.callOptions){const o=new Fl({name:this.name,inputTensors:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),this.client.infer(o,t)}}class q_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Gm),this.name=n,this.options=t}async setPower(e,n={},t=this.callOptions){const o=new Ht({name:this.name,powerPct:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.setPower(o,t)}async goFor(e,n,t={},o=this.callOptions){const i=new Kt({name:this.name,rpm:e,revolutions:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.goFor(i,o)}async goTo(e,n,t={},o=this.callOptions){const i=new Xt({name:this.name,rpm:e,positionRevolutions:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.goTo(i,o)}async setRPM(e,n={},t=this.callOptions){const o=new Qt({name:this.name,rpm:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.setRPM(o,t)}async resetZeroPosition(e,n={},t=this.callOptions){const o=new Zt({name:this.name,offset:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.resetZeroPosition(o,t)}async stop(e={},n=this.callOptions){const t=new ns({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async getProperties(e={},n=this.callOptions){const t=new ts({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),{positionReporting:(await this.client.getProperties(t,n)).positionReporting}}async getPosition(e={},n=this.callOptions){const t=new es({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).position}async isPowered(e={},n=this.callOptions){const t=new as({name:this.name,extra:d.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 ss({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}class U_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Wm),this.name=n,this.options=t}async getLinearVelocity(e={},n=this.callOptions){const t=new os({name:this.name,extra:d.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 is({name:this.name,extra:d.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 rs({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getCompassHeading(t,n)).value}async getOrientation(e={},n=this.callOptions){const t=new ms({name:this.name,extra:d.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 cs({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getPosition(t,n)}async getProperties(e={},n=this.callOptions){const t=new ds({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}async getAccuracy(e={},n=this.callOptions){const t=new ls({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getAccuracy(t,n)}async getLinearAcceleration(e={},n=this.callOptions){const t=new us({name:this.name,extra:d.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:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}const{GetAccuracyResponse:G_,GetPositionResponse:L_,GetPropertiesResponse:B_}=Vm;class F_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Xm),this.name=n,this.options=t}async getVoltage(e={},n=this.callOptions){const t=new ps({name:this.name,extra:d.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 gs({name:this.name,extra:d.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 Ts({name:this.name,extra:d.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:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}const fv={typeName:"viam.component.sensor.v1.SensorService",methods:{getReadings:{name:"GetReadings",I:Ke,O:la,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},x_=Object.freeze(Object.defineProperty({__proto__:null,SensorService:fv},Symbol.toStringTag,{value:"Module"}));class J_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(fv),this.name=n,this.options=t}async getReadings(e={},n=this.callOptions){const t=new Ke({name:this.name,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}const Rv=s.makeMessageType("proto.stream.v1.ListStreamsRequest",[]),_v=s.makeMessageType("proto.stream.v1.ListStreamsResponse",()=>[{no:1,name:"names",kind:"scalar",T:9,repeated:!0}]),Bo=s.makeMessageType("proto.stream.v1.AddStreamRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Sv=s.makeMessageType("proto.stream.v1.AddStreamResponse",[]),Fo=s.makeMessageType("proto.stream.v1.RemoveStreamRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Iv=s.makeMessageType("proto.stream.v1.RemoveStreamResponse",[]),xo=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}]),Mv=s.makeMessageType("proto.stream.v1.GetStreamOptionsResponse",()=>[{no:1,name:"resolutions",kind:"message",T:xo,repeated:!0}]),Oa=s.makeMessageType("proto.stream.v1.SetStreamOptionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"resolution",kind:"message",T:xo}]),bv=s.makeMessageType("proto.stream.v1.SetStreamOptionsResponse",[]),z_=Object.freeze(Object.defineProperty({__proto__:null,AddStreamRequest:Bo,AddStreamResponse:Sv,GetStreamOptionsRequest:Jo,GetStreamOptionsResponse:Mv,ListStreamsRequest:Rv,ListStreamsResponse:_v,RemoveStreamRequest:Fo,RemoveStreamResponse:Iv,Resolution:xo,SetStreamOptionsRequest:Oa,SetStreamOptionsResponse:bv},Symbol.toStringTag,{value:"Module"})),Y_={typeName:"proto.stream.v1.StreamService",methods:{listStreams:{name:"ListStreams",I:Rv,O:_v,kind:m.Unary},addStream:{name:"AddStream",I:Bo,O:Sv,kind:m.Unary},getStreamOptions:{name:"GetStreamOptions",I:Jo,O:Mv,kind:m.Unary},setStreamOptions:{name:"SetStreamOptions",I:Oa,O:bv,kind:m.Unary},removeStream:{name:"RemoveStream",I:Fo,O:Iv,kind:m.Unary}}},An=a=>a.replaceAll(":","+");class $_ extends fr{client;options;streams;constructor(e,n={}){super(),this.client=e.createServiceClient(Y_),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 Bo({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 Fo({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 Oa({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 Oa({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 zo=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:d}]),wv=s.makeMessageType("viam.component.switch.v1.SetPositionResponse",[]),Yo=s.makeMessageType("viam.component.switch.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Ev=s.makeMessageType("viam.component.switch.v1.GetPositionResponse",()=>[{no:1,name:"position",kind:"scalar",T:13}]),$o=s.makeMessageType("viam.component.switch.v1.GetNumberOfPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Ov=s.makeMessageType("viam.component.switch.v1.GetNumberOfPositionsResponse",()=>[{no:1,name:"number_of_positions",kind:"scalar",T:13}]),V_=Object.freeze(Object.defineProperty({__proto__:null,GetNumberOfPositionsRequest:$o,GetNumberOfPositionsResponse:Ov,GetPositionRequest:Yo,GetPositionResponse:Ev,SetPositionRequest:zo,SetPositionResponse:wv},Symbol.toStringTag,{value:"Module"})),W_={typeName:"viam.component.switch.v1.SwitchService",methods:{setPosition:{name:"SetPosition",I:zo,O:wv,kind:m.Unary},getPosition:{name:"GetPosition",I:Yo,O:Ev,kind:m.Unary},getNumberOfPositions:{name:"GetNumberOfPositions",I:$o,O:Ov,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}};class j_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(W_),this.name=n,this.options=t}async setPosition(e,n={},t=this.callOptions){const o=new zo({name:this.name,position:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.setPosition(o,t)}async getPosition(e={},n=this.callOptions){const t=new Yo({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).position}async getNumberOfPositions(e={},n=this.callOptions){const t=new $o({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getNumberOfPositions(t,n)).numberOfPositions}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}let H_=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:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}};class K_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(ym),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async open(e={},n=this.callOptions){const t=new zt({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.open(t,n)}async grab(e={},n=this.callOptions){const t=new Yt({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.grab(t,n)}async stop(e={},n=this.callOptions){const t=new $t({name:this.name,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}class X_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(bm),this.name=n,this.options=t}async getEvents(e={},n=this.callOptions){const t=new Wt({controller:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getEvents(t,n)).events}async triggerEvent(e,n={},t=this.callOptions){const o=new jt({controller:this.name,event:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.triggerEvent(o,t)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{Event:Q_}=Mm,{CollisionSpecification:Z_,Constraints:eS,GetPlanResponse:wS,LinearConstraint:nS,ListPlanStatusesResponse:aS,MotionConfiguration:tS,ObstacleDetector:sS,OrientationConstraint:oS,PlanState:ES}=Hd;class iS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Kd),this.name=n,this.options=t}async move(e,n,t,o,i={},r=this.callOptions){const c=new Ds({name:this.name,destination:e,componentName:n,worldState:t,constraints:o,extra:d.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 u=new qs({name:this.name,destination:e,componentName:n,slamServiceName:t,motionConfiguration:o,obstacles:i,extra:d.fromJson(r)});return this.options.requestLogger?.(u),(await this.client.moveOnMap(u,c)).executionId}async moveOnGlobe(e,n,t,o,i,r,c,u={},l=this.callOptions){const k=new Gs({name:this.name,destination:e,componentName:n,movementSensorName:t,heading:o,obstacles:i,boundingRegions:c,motionConfiguration:r,extra:d.fromJson(u)});return this.options.requestLogger?.(k),(await this.client.moveOnGlobe(k,l)).executionId}async stopPlan(e,n={},t=this.callOptions){const o=new Bs({name:this.name,componentName:e,extra:d.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 xs({name:this.name,componentName:e,lastPlanOnly:n,executionId:t,extra:d.fromJson(o)});return this.options.requestLogger?.(r),this.client.getPlan(r,i)}async listPlanStatuses(e,n={},t=this.callOptions){const o=new Fs({name:this.name,onlyActivePlans:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),this.client.listPlanStatuses(o,t)}async getPose(e,n,t,o={},i=this.callOptions){const r=new Ls({name:this.name,componentName:e,destinationFrame:n,supplementalTransforms:t,extra:d.fromJson(o)});this.options.requestLogger?.(r);const u=(await this.client.getPose(r,i)).pose;if(!u)throw new Error("no pose");return u}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const Vo=s.makeMessageType("viam.service.datamanager.v1.SyncRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Cv=s.makeMessageType("viam.service.datamanager.v1.SyncResponse",[]),rS=Object.freeze(Object.defineProperty({__proto__:null,SyncRequest:Vo,SyncResponse:Cv},Symbol.toStringTag,{value:"Module"})),mS={typeName:"viam.service.datamanager.v1.DataManagerService",methods:{sync:{name:"Sync",I:Vo,O:Cv,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}};class cS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(mS),this.name=n,this.options=t}async sync(e={},n=this.callOptions){const t=new Vo({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.sync(t,n)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}class dS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(dl),this.name=n,this.options=t}async getMode(e={},n=this.callOptions){const t=new Ys({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getMode(t,n)).mode}async setMode(e,n={},t=this.callOptions){const o=new $s({name:this.name,mode:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.setMode(o,t)}async getLocation(e={},n=this.callOptions){const t=new Vs({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getLocation(t,n);if(!o.location)throw new Error("no location");if(!hv(o.location))throw new Error("invalid location");return o}async getWayPoints(e={},n=this.callOptions){const t=new Ws({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getWaypoints(t,n)).waypoints}async addWayPoint(e,n={},t=this.callOptions){const o=new js({name:this.name,location:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.addWaypoint(o,t)}async removeWayPoint(e,n={},t=this.callOptions){const o=new Hs({name:this.name,id:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.removeWaypoint(o,t)}async getObstacles(e={},n=this.callOptions){const t=new Ks({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getObstacles(t,n)).obstacles}async getPaths(e={},n=this.callOptions){const t=new Xs({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPaths(t,n)).paths}async getProperties(e=this.callOptions){const n=new Qs({name:this.name});return this.options.requestLogger?.(n),this.client.getProperties(n,e)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{GetLocationResponse:lS,GetPropertiesResponse:uS,Mode:OS,Path:pS,Waypoint:gS}=cl;class TS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(ac),this.name=n,this.options=t}async move(e,n={},t=this.callOptions){const o=new ks({name:this.name,angleDeg:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.move(o,t)}async getPosition(e={},n=this.callOptions){const t=new ys({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).positionDeg}async stop(e={},n=this.callOptions){const t=new vs({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new hs({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}class kS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(hl),this.name=n,this.options=t}async getPosition(e=this.callOptions){const n=new Zs({name:this.name});return this.options.requestLogger?.(n),this.client.getPosition(n,e)}getPointCloudMap=async(e,n=this.callOptions)=>{const t=new eo({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 Nv(o)};getInternalState=async(e=this.callOptions)=>{const n=new no({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 Nv(t)};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 L(this.client.doCommand,this.name,e,this.options,n)}}const Nv=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:yS,GetPropertiesResponse:vS}=vl;class hS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Bl),this.name=n,this.options=t}async getDetectionsFromCamera(e,n={},t=this.callOptions){const o=new mo({name:this.name,cameraName:e,extra:d.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 ro({name:this.name,image:e,width:n?BigInt(n):void 0,height:t?BigInt(t):void 0,mimeType:o,extra:d.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 lo({name:this.name,cameraName:e,n,extra:d.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 u=new co({name:this.name,image:e,width:n,height:t,mimeType:o,n:i,extra:d.fromJson(r)});return this.options.requestLogger?.(u),(await this.client.getClassifications(u,c)).classifications}async getObjectPointClouds(e,n={},t=this.callOptions){const o=new uo({name:this.name,cameraName:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getObjectPointClouds(o,t)).objects}async getProperties(e={},n=this.callOptions){const t=new po({name:this.name,extra:d.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 u=new go({name:this.name,cameraName:e,returnImage:n,returnClassifications:t,returnDetections:o,returnObjectPointClouds:i,extra:d.fromJson(r)});this.options.requestLogger?.(u);const l=await this.client.captureAllFromCamera(u,c);return{image:l.image,classifications:l.classifications,detections:l.detections,objectPointClouds:l.objects,extra:l.extra}}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{Classification:fS,Detection:RS}=Ll,{PointCloudObject:_S}=it,Pv={typeName:"viam.service.generic.v1.GenericService",methods:{doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},SS=Object.freeze(Object.defineProperty({__proto__:null,GenericService:Pv},Symbol.toStringTag,{value:"Module"}));class IS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Pv),this.name=n,this.options=t}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const MS="0.40.1";T.AnalogValue=i_,T.ArmClient=t_,T.ArmJointPositions=a_,T.BaseClient=o_,T.BaseProperties=s_,T.BoardClient=m_,T.ButtonClient=l_,T.CameraClient=T_,T.Capsule=f_,T.Classification=fS,T.Client=A,T.CloudConfig=Go,T.CollisionSpecification=Z_,T.ConnectError=C,T.ConnectionClosedError=de,T.Constraints=eS,T.DataManagerClient=cS,T.Detection=RS,T.DiscoveryClient=k_,T.Duration=F,T.EncoderClient=v_,T.EncoderPositionType=vv,T.EncoderProperties=y_,T.GantryClient=h_,T.GenericComponentClient=H_,T.GenericServiceClient=IS,T.GeoGeometry=R_,T.GeoPoint=__,T.GeometriesInFrame=S_,T.Geometry=I_,T.GripperClient=K_,T.InputControllerClient=X_,T.InputControllerEvent=Q_,T.LinearConstraint=nS,T.ListPlanStatusesResponse=aS,T.MLModelClient=D_,T.MachineConnectionEvent=ne,T.ModelType=ze,T.MotionClient=iS,T.MotionConfiguration=tS,T.MotorClient=q_,T.MovementSensorAccuracy=G_,T.MovementSensorClient=U_,T.MovementSensorPosition=L_,T.MovementSensorProperties=B_,T.NavigationClient=dS,T.NavigationPosition=lS,T.NavigationProperties=uS,T.ObstacleDetector=sS,T.Orientation=M_,T.OrientationConstraint=oS,T.Path=pS,T.PointCloudObject=_S,T.Pose=b_,T.PoseInFrame=w_,T.PowerMode=r_,T.PowerSensorClient=F_,T.RectangularPrism=E_,T.ResourceName=O_,T.RobotClient=A,T.SensorClient=J_,T.ServoClient=TS,T.SlamClient=kS,T.SlamPosition=yS,T.SlamProperties=vS,T.Sphere=C_,T.StreamClient=$_,T.Struct=d,T.SwitchClient=j_,T.Timestamp=S,T.TrainingStatus=ha,T.Transform=N_,T.Vector3=P_,T.VisionClient=hS,T.Waypoint=gS,T.WorldState=A_,T.addMetadata=pR,T.appApi=v1,T.appRobotApi=UR,T.armApi=Cr,T.baseApi=Br,T.billingApi=R1,T.boardApi=Zr,T.buttonApi=c_,T.cameraApi=BR,T.commonApi=it,T.createRobotClient=jl,T.createViamClient=e_,T.dataApi=b1,T.dataManagerApi=rS,T.deleteMetadata=gR,T.disableDebugLogging=uR,T.discoveryApi=GR,T.doCommandFromClient=L,T.enableDebugLogging=lR,T.encoderApi=sm,T.gantryApi=hR,T.genericComponentApi=fR,T.genericServiceApi=SS,T.gripperApi=RR,T.inputControllerApi=Mm,T.isValidGeoPoint=hv,T.mlTrainingApi=y1,T.motionApi=Hd,T.motorApi=SR,T.movementSensorApi=Vm,T.navigationApi=cl,T.powerSensorApi=IR,T.provisioningApi=X1,T.robotApi=wR,T.sensorApi=x_,T.servoApi=bR,T.slamApi=vl,T.streamApi=z_,T.switchApi=V_,T.version=MS,T.visionApi=Ll,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 KR(this.deferredTransport,this)}static heartbeatMonitoredMethods={};transport;currentSessionID="";sessionsSupported;heartbeatIntervalMs;host="";starting;get client(){const e=this.deferredTransport();return na(Es,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 Ms({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 de||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(XR);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 Is;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=na(HR,this.transport),n=new va({host:this.host,messageRequest:{case:"listServices",value:""}}),t=e.serverReflectionInfo(Ua([n]),{timeoutMs:1e4});for await(const o of t){const i=o.messageResponse.value.service.map(c=>new va({messageRequest:{case:"fileContainingSymbol",value:c.name}})),r=e.serverReflectionInfo(Ua(i),{timeoutMs:1e4});for await(const c of r)for(const u of c.messageResponse.value.fileDescriptorProto){const l=se.fromBinary(u);for(const k of l.service)for(const R of k.method)Xe.heartbeatMonitoredMethods[`/${l.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 ii(e.toBinary());for(;n.pos<n.len;){const t=n.tag(),[o]=t;if(o===hr.field.no)return!0;n.string()}return!1}}const QR=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"}]),Fl=s.makeMessageType("viam.service.mlmodel.v1.InferRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:3,name:"input_tensors",kind:"message",T:zl},{no:99,name:"extra",kind:"message",T:d}]),ZR=s.makeMessageType("viam.service.mlmodel.v1.InferResponse",()=>[{no:3,name:"output_tensors",kind:"message",T:zl}]),xl=s.makeMessageType("viam.service.mlmodel.v1.MetadataRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),e1=s.makeMessageType("viam.service.mlmodel.v1.MetadataResponse",()=>[{no:1,name:"metadata",kind:"message",T:n1}]),n1=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:Jl,repeated:!0},{no:5,name:"output_info",kind:"message",T:Jl,repeated:!0}]),Jl=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:a1,repeated:!0},{no:99,name:"extra",kind:"message",T:d}]),a1=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(QR)}]),t1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt8",()=>[{no:1,name:"data",kind:"scalar",T:12}]),s1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt8",()=>[{no:1,name:"data",kind:"scalar",T:12}]),o1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt16",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),i1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt16",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),r1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt32",()=>[{no:1,name:"data",kind:"scalar",T:15,repeated:!0}]),m1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt32",()=>[{no:1,name:"data",kind:"scalar",T:7,repeated:!0}]),c1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataInt64",()=>[{no:1,name:"data",kind:"scalar",T:16,repeated:!0}]),d1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataUInt64",()=>[{no:1,name:"data",kind:"scalar",T:6,repeated:!0}]),l1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataFloat",()=>[{no:1,name:"data",kind:"scalar",T:2,repeated:!0}]),u1=s.makeMessageType("viam.service.mlmodel.v1.FlatTensorDataDouble",()=>[{no:1,name:"data",kind:"scalar",T:1,repeated:!0}]),p1=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:t1,oneof:"tensor"},{no:3,name:"uint8_tensor",kind:"message",T:s1,oneof:"tensor"},{no:4,name:"int16_tensor",kind:"message",T:o1,oneof:"tensor"},{no:5,name:"uint16_tensor",kind:"message",T:i1,oneof:"tensor"},{no:6,name:"int32_tensor",kind:"message",T:r1,oneof:"tensor"},{no:7,name:"uint32_tensor",kind:"message",T:m1,oneof:"tensor"},{no:8,name:"int64_tensor",kind:"message",T:c1,oneof:"tensor"},{no:9,name:"uint64_tensor",kind:"message",T:d1,oneof:"tensor"},{no:10,name:"float_tensor",kind:"message",T:l1,oneof:"tensor"},{no:11,name:"double_tensor",kind:"message",T:u1,oneof:"tensor"}]),zl=s.makeMessageType("viam.service.mlmodel.v1.FlatTensors",()=>[{no:1,name:"tensors",kind:"map",K:9,V:{kind:"message",T:p1}}]),Yl={typeName:"viam.service.mlmodel.v1.MLModelService",methods:{infer:{name:"Infer",I:Fl,O:ZR,kind:m.Unary},metadata:{name:"Metadata",I:xl,O:e1,kind:m.Unary}}};class A extends fr{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 xR(()=>{if(!this.transport)throw new Error(A.notConnectedYetStr);return this.transport},()=>{this.onDisconnect()}),this.sessionManager=new Xe(this.serviceHost,()=>{if(!this.transport)throw new Error(A.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),ja(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(A.notConnectedYetStr);return this.robotServiceClient}get armService(){if(!this.armServiceClient)throw new Error(A.notConnectedYetStr);return this.armServiceClient}get baseService(){if(!this.baseServiceClient)throw new Error(A.notConnectedYetStr);return this.baseServiceClient}get boardService(){if(!this.boardServiceClient)throw new Error(A.notConnectedYetStr);return this.boardServiceClient}get encoderService(){if(!this.encoderServiceClient)throw new Error(A.notConnectedYetStr);return this.encoderServiceClient}get gantryService(){if(!this.gantryServiceClient)throw new Error(A.notConnectedYetStr);return this.gantryServiceClient}get genericService(){if(!this.genericServiceClient)throw new Error(A.notConnectedYetStr);return this.genericServiceClient}get gripperService(){if(!this.gripperServiceClient)throw new Error(A.notConnectedYetStr);return this.gripperServiceClient}get mlModelService(){if(!this.mlModelServiceClient)throw new Error(A.notConnectedYetStr);return this.mlModelServiceClient}get movementSensorService(){if(!this.movementSensorServiceClient)throw new Error(A.notConnectedYetStr);return this.movementSensorServiceClient}get powerSensorService(){if(!this.powerSensorServiceClient)throw new Error(A.notConnectedYetStr);return this.powerSensorServiceClient}get inputControllerService(){if(!this.inputControllerServiceClient)throw new Error(A.notConnectedYetStr);return this.inputControllerServiceClient}get motorService(){if(!this.motorServiceClient)throw new Error(A.notConnectedYetStr);return this.motorServiceClient}get navigationService(){if(!this.navigationServiceClient)throw new Error(A.notConnectedYetStr);return this.navigationServiceClient}get discoveryService(){if(!this.discoveryServiceClient)throw new Error(A.notConnectedYetStr);return this.discoveryServiceClient}get motionService(){if(!this.motionServiceClient)throw new Error(A.notConnectedYetStr);return this.motionServiceClient}get visionService(){if(!this.visionServiceClient)throw new Error(A.notConnectedYetStr);return this.visionServiceClient}get servoService(){if(!this.servoServiceClient)throw new Error(A.notConnectedYetStr);return this.servoServiceClient}get slamService(){if(!this.slamServiceClient)throw new Error(A.notConnectedYetStr);return this.slamServiceClient}createServiceClient(e){const n=this.sessionOptions?.disabled?this.transport:this.sessionManager.transport;if(!n)throw new Error(A.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??mt,extraHeaders:rt};if(e&&(Mn(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 iR(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[u]=c.streams;if(!u)throw this.emit("track",c),new Error("expected event stream to exist");const l=u.id.replaceAll("+",":");Object.defineProperty(u,"id",{value:l}),this.emit("track",c)})}else this.transport=await _n(this.serviceHost,o),await this.gRPCConnectionManager.start();const i=this.sessionOptions?.disabled?this.transport:this.sessionManager.transport;this.robotServiceClient=N(Es,i),this.armServiceClient=N(Nr,i),this.baseServiceClient=N(Fr,i),this.boardServiceClient=N(em,i),this.encoderServiceClient=N(om,i),this.gantryServiceClient=N(um,i),this.genericServiceClient=N(Jt,i),this.gripperServiceClient=N(ym,i),this.mlModelServiceClient=N(Yl,i),this.movementSensorServiceClient=N(Wm,i),this.powerSensorServiceClient=N(Xm,i),this.inputControllerServiceClient=N(bm,i),this.motorServiceClient=N(Gm,i),this.navigationServiceClient=N(dl,i),this.motionServiceClient=N(Kd,i),this.visionServiceClient=N(Bl,i),this.servoServiceClient=N(ac,i),this.slamServiceClient=N(hl,i),this.discoveryServiceClient=N(Cd,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 fs({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 Rs({pointCloudPcd:e,source:n,destination:t});return(await this.robotService.transformPCD(o)).pointCloudPcd}async getModelsFromModules(){const e=new _s({});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 ws;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 $l=a=>!!(a>0&&Number.isInteger(a)),g1=a=>a.includes("local"),Vl=async a=>{if(console.debug("dialing via gRPC..."),!g1(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 A(a.host,void 0,n,e);return await t.connect({creds:a.credentials,dialTimeout:a.dialTimeout??mt}),console.debug("connected via gRPC"),t},Wl=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 A(e,i,r);return await c.connect({priority:a.priority,dialTimeout:a.dialTimeout??mt,creds:a.credentials}),console.debug("connected via WebRTC"),c},T1=a=>{const e=a;return typeof e.signalingAddress!="string"?!1:!e.iceServers||Array.isArray(e.iceServers)},jl=async a=>{k1(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),T1(a)&&!a.reconnectAbortSignal?.abort)try{return a.noReconnect?await Wl(a):await ja(async()=>Wl(a),e)}catch{console.debug("Failed to connect via WebRTC")}if(!a.reconnectAbortSignal?.abort)try{return a.noReconnect?await Vl(a):await ja(async()=>Vl(a),e)}catch{console.debug("Failed to connect via gRPC")}throw new Error("Failed to connect to robot")},k1=a=>{if(a.credentials&&Mn(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&&!$l(a.reconnectMaxAttempts))throw new Error(`Value of max reconnect attempts (${a.reconnectMaxAttempts}) should be a positive integer`);if(a.reconnectMaxWait!==void 0&&!$l(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"}]),ha=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"}]),Hl=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}]),Kl=s.makeMessageType("viam.app.mltraining.v1.SubmitTrainingJobResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Xl=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}}]),Ql=s.makeMessageType("viam.app.mltraining.v1.SubmitCustomTrainingJobResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Zl=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),eu=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobResponse",()=>[{no:1,name:"metadata",kind:"message",T:To}]),nu=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(ha)}]),au=s.makeMessageType("viam.app.mltraining.v1.ListTrainingJobsResponse",()=>[{no:1,name:"jobs",kind:"message",T:To,repeated:!0}]),To=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(ha)},{no:8,name:"error_status",kind:"message",T:sn},{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}]),tu=s.makeMessageType("viam.app.mltraining.v1.CancelTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),su=s.makeMessageType("viam.app.mltraining.v1.CancelTrainingJobResponse",[]),ou=s.makeMessageType("viam.app.mltraining.v1.DeleteCompletedTrainingJobRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),iu=s.makeMessageType("viam.app.mltraining.v1.DeleteCompletedTrainingJobResponse",[]),ru=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}]),mu=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}]),cu=s.makeMessageType("viam.app.mltraining.v1.GetTrainingJobLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:ru,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),y1=Object.freeze(Object.defineProperty({__proto__:null,CancelTrainingJobRequest:tu,CancelTrainingJobResponse:su,DeleteCompletedTrainingJobRequest:ou,DeleteCompletedTrainingJobResponse:iu,GetTrainingJobLogsRequest:mu,GetTrainingJobLogsResponse:cu,GetTrainingJobRequest:Zl,GetTrainingJobResponse:eu,ListTrainingJobsRequest:nu,ListTrainingJobsResponse:au,ModelFramework:Qe,ModelType:ze,SubmitCustomTrainingJobRequest:Xl,SubmitCustomTrainingJobResponse:Ql,SubmitTrainingJobRequest:Hl,SubmitTrainingJobResponse:Kl,TrainingJobLogEntry:ru,TrainingJobMetadata:To,TrainingStatus:ha},Symbol.toStringTag,{value:"Module"})),fa=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"}]),du=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"}]),wn=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"}]),lu=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"}]),uu=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"}]),cn=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"}]),pu=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"}]),gu=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"}]),Tu=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"}]),ku=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"}]),Ra=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:d},{no:6,name:"last_access",kind:"message",T:S},{no:7,name:"user_supplied_info",kind:"message",T:d},{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:vo,repeated:!0},{no:15,name:"last_updated",kind:"message",T:S}]),yu=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:ko}]),ko=s.makeMessageType("viam.app.v1.AuthenticatorInfo",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(du)},{no:2,name:"value",kind:"scalar",T:9},{no:3,name:"is_deactivated",kind:"scalar",T:8}]),vu=s.makeMessageType("viam.app.v1.ListOrganizationsRequest",[]),En=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}]),hu=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}]),fu=s.makeMessageType("viam.app.v1.ListOrganizationsResponse",()=>[{no:1,name:"organizations",kind:"message",T:En,repeated:!0}]),On=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}]),Ru=s.makeMessageType("viam.app.v1.CreateOrganizationRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),_u=s.makeMessageType("viam.app.v1.CreateOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:En}]),Su=s.makeMessageType("viam.app.v1.GetOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Iu=s.makeMessageType("viam.app.v1.GetOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:En}]),Mu=s.makeMessageType("viam.app.v1.GetOrganizationNamespaceAvailabilityRequest",()=>[{no:1,name:"public_namespace",kind:"scalar",T:9}]),bu=s.makeMessageType("viam.app.v1.GetOrganizationNamespaceAvailabilityResponse",()=>[{no:1,name:"available",kind:"scalar",T:8}]),wu=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}]),Eu=s.makeMessageType("viam.app.v1.UpdateOrganizationResponse",()=>[{no:1,name:"organization",kind:"message",T:En}]),Ou=s.makeMessageType("viam.app.v1.DeleteOrganizationRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Cu=s.makeMessageType("viam.app.v1.DeleteOrganizationResponse",[]),Nu=s.makeMessageType("viam.app.v1.GetOrganizationMetadataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Pu=s.makeMessageType("viam.app.v1.GetOrganizationMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:d}]),Au=s.makeMessageType("viam.app.v1.UpdateOrganizationMetadataRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:d}]),Du=s.makeMessageType("viam.app.v1.UpdateOrganizationMetadataResponse",[]),qu=s.makeMessageType("viam.app.v1.ListOrganizationMembersRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Uu=s.makeMessageType("viam.app.v1.ListOrganizationMembersResponse",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"members",kind:"message",T:hu,repeated:!0},{no:3,name:"invites",kind:"message",T:On,repeated:!0}]),Gu=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}]),Lu=s.makeMessageType("viam.app.v1.CreateOrganizationInviteResponse",()=>[{no:1,name:"invite",kind:"message",T:On}]),Bu=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}]),Fu=s.makeMessageType("viam.app.v1.UpdateOrganizationInviteAuthorizationsResponse",()=>[{no:1,name:"invite",kind:"message",T:On}]),xu=s.makeMessageType("viam.app.v1.DeleteOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),Ju=s.makeMessageType("viam.app.v1.DeleteOrganizationInviteResponse",[]),zu=s.makeMessageType("viam.app.v1.ResendOrganizationInviteRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),Yu=s.makeMessageType("viam.app.v1.ResendOrganizationInviteResponse",()=>[{no:1,name:"invite",kind:"message",T:On}]),$u=s.makeMessageType("viam.app.v1.DeleteOrganizationMemberRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9}]),Vu=s.makeMessageType("viam.app.v1.DeleteOrganizationMemberResponse",[]),_a=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}]),Wu=s.makeMessageType("viam.app.v1.EnableBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"billing_address",kind:"message",T:_a}]),ju=s.makeMessageType("viam.app.v1.EnableBillingServiceResponse",[]),Hu=s.makeMessageType("viam.app.v1.UpdateBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"billing_address",kind:"message",T:_a}]),Ku=s.makeMessageType("viam.app.v1.UpdateBillingServiceResponse",[]),Xu=s.makeMessageType("viam.app.v1.GetBillingServiceConfigRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Qu=s.makeMessageType("viam.app.v1.GetBillingServiceConfigResponse",()=>[{no:1,name:"billing_address",kind:"message",T:_a},{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}]),Zu=s.makeMessageType("viam.app.v1.DisableBillingServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),ep=s.makeMessageType("viam.app.v1.DisableBillingServiceResponse",[]),np=s.makeMessageType("viam.app.v1.OrganizationSetSupportEmailRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"email",kind:"scalar",T:9}]),ap=s.makeMessageType("viam.app.v1.OrganizationSetSupportEmailResponse",[]),tp=s.makeMessageType("viam.app.v1.OrganizationGetSupportEmailRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),sp=s.makeMessageType("viam.app.v1.OrganizationGetSupportEmailResponse",()=>[{no:1,name:"email",kind:"scalar",T:9}]),yo=s.makeMessageType("viam.app.v1.OrganizationIdentity",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),op=s.makeMessageType("viam.app.v1.LocationOrganization",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"primary",kind:"scalar",T:8}]),Sa=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:vo,repeated:!0}]),ip=s.makeMessageType("viam.app.v1.StorageConfig",()=>[{no:1,name:"region",kind:"scalar",T:9}]),Cn=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:Sa},{no:6,name:"organizations",kind:"message",T:op,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:ip},{no:9,name:"primary_org_identity",kind:"message",T:yo,opt:!0}]),vo=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(ho)}]),ho=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"}]),rp=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}]),mp=s.makeMessageType("viam.app.v1.CreateLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Cn}]),cp=s.makeMessageType("viam.app.v1.GetLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),dp=s.makeMessageType("viam.app.v1.GetLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Cn}]),lp=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}]),up=s.makeMessageType("viam.app.v1.UpdateLocationResponse",()=>[{no:1,name:"location",kind:"message",T:Cn}]),pp=s.makeMessageType("viam.app.v1.DeleteLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),gp=s.makeMessageType("viam.app.v1.DeleteLocationResponse",[]),Tp=s.makeMessageType("viam.app.v1.GetLocationMetadataRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),kp=s.makeMessageType("viam.app.v1.GetLocationMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:d}]),yp=s.makeMessageType("viam.app.v1.UpdateLocationMetadataRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:d}]),vp=s.makeMessageType("viam.app.v1.UpdateLocationMetadataResponse",[]),hp=s.makeMessageType("viam.app.v1.GetOrganizationsWithAccessToLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),fp=s.makeMessageType("viam.app.v1.GetOrganizationsWithAccessToLocationResponse",()=>[{no:1,name:"organization_identities",kind:"message",T:yo,repeated:!0}]),Rp=s.makeMessageType("viam.app.v1.ListLocationsRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),_p=s.makeMessageType("viam.app.v1.ShareLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),Sp=s.makeMessageType("viam.app.v1.ShareLocationResponse",[]),Ip=s.makeMessageType("viam.app.v1.UnshareLocationRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),Mp=s.makeMessageType("viam.app.v1.UnshareLocationResponse",[]),bp=s.makeMessageType("viam.app.v1.ListLocationsResponse",()=>[{no:1,name:"locations",kind:"message",T:Cn,repeated:!0}]),wp=s.makeMessageType("viam.app.v1.CreateLocationSecretRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Ep=s.makeMessageType("viam.app.v1.CreateLocationSecretResponse",()=>[{no:1,name:"auth",kind:"message",T:Sa}]),Op=s.makeMessageType("viam.app.v1.DeleteLocationSecretRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9},{no:2,name:"secret_id",kind:"scalar",T:9}]),Cp=s.makeMessageType("viam.app.v1.DeleteLocationSecretResponse",[]),Np=s.makeMessageType("viam.app.v1.LocationAuthRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Pp=s.makeMessageType("viam.app.v1.LocationAuthResponse",()=>[{no:1,name:"auth",kind:"message",T:Sa}]),Ap=s.makeMessageType("viam.app.v1.GetRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Dp=s.makeMessageType("viam.app.v1.GetRoverRentalRobotsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),qp=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}]),Up=s.makeMessageType("viam.app.v1.GetRoverRentalRobotsResponse",()=>[{no:1,name:"robots",kind:"message",T:qp,repeated:!0}]),Gp=s.makeMessageType("viam.app.v1.GetRobotResponse",()=>[{no:1,name:"robot",kind:"message",T:Ra}]),Lp=s.makeMessageType("viam.app.v1.GetRobotPartsRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9}]),Bp=s.makeMessageType("viam.app.v1.GetRobotPartsResponse",()=>[{no:1,name:"parts",kind:"message",T:dn,repeated:!0}]),Fp=s.makeMessageType("viam.app.v1.GetRobotPartRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),xp=s.makeMessageType("viam.app.v1.GetRobotPartResponse",()=>[{no:1,name:"part",kind:"message",T:dn},{no:2,name:"config_json",kind:"scalar",T:9}]),Jp=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}]),zp=s.makeMessageType("viam.app.v1.GetRobotPartLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:In,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),Yp=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}]),$p=s.makeMessageType("viam.app.v1.TailRobotPartLogsResponse",()=>[{no:1,name:"logs",kind:"message",T:In,repeated:!0}]),Vp=s.makeMessageType("viam.app.v1.GetRobotPartHistoryRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Wp=s.makeMessageType("viam.app.v1.GetRobotPartHistoryResponse",()=>[{no:1,name:"history",kind:"message",T:yu,repeated:!0}]),jp=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:d},{no:4,name:"last_known_update",kind:"message",T:S,opt:!0}]),Hp=s.makeMessageType("viam.app.v1.UpdateRobotPartResponse",()=>[{no:1,name:"part",kind:"message",T:dn}]),Kp=s.makeMessageType("viam.app.v1.NewRobotPartRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9},{no:2,name:"part_name",kind:"scalar",T:9}]),Xp=s.makeMessageType("viam.app.v1.NewRobotPartResponse",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),Qp=s.makeMessageType("viam.app.v1.DeleteRobotPartRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),Zp=s.makeMessageType("viam.app.v1.GetRobotPartMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),eg=s.makeMessageType("viam.app.v1.GetRobotPartMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:d}]),ng=s.makeMessageType("viam.app.v1.UpdateRobotPartMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:d}]),ag=s.makeMessageType("viam.app.v1.UpdateRobotPartMetadataResponse",[]),tg=s.makeMessageType("viam.app.v1.GetRobotAPIKeysRequest",()=>[{no:1,name:"robot_id",kind:"scalar",T:9}]),sg=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}]),og=s.makeMessageType("viam.app.v1.GetRobotAPIKeysResponse",()=>[{no:1,name:"api_keys",kind:"message",T:bo,repeated:!0}]),ig=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:d},{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(wn)},{no:13,name:"last_updated",kind:"message",T:S},{no:14,name:"revision",kind:"scalar",T:9}]),rg=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:ko},{no:5,name:"revision",kind:"scalar",T:9},{no:6,name:"config",kind:"message",T:d}]),mg=s.makeMessageType("viam.app.v1.FragmentRevision",()=>[{no:1,name:"revision",kind:"scalar",T:9},{no:2,name:"created_at",kind:"message",T:S}]),Ia=s.makeMessageType("viam.app.v1.FragmentTag",()=>[{no:1,name:"tag",kind:"scalar",T:9},{no:2,name:"revision",kind:"scalar",T:9}]),cg=s.makeMessageType("viam.app.v1.FragmentError",()=>[{no:1,name:"error_type",kind:"enum",T:s.getEnumType(lu)},{no:2,name:"fragment_id",kind:"scalar",T:9},{no:3,name:"detail",kind:"scalar",T:9}]),Ma=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}]),fo=s.makeMessageType("viam.app.v1.ResolvedFragment",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"resolved_config",kind:"message",T:d},{no:3,name:"error",kind:"message",T:cg},{no:4,name:"revision",kind:"scalar",T:9}]),dg=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(wn),repeated:!0}]),lg=s.makeMessageType("viam.app.v1.ListFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"fragment_usages",kind:"message",T:Ma,repeated:!0}]),ug=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}]),pg=s.makeMessageType("viam.app.v1.GetFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye},{no:2,name:"fragment_usage",kind:"message",T:Ma},{no:3,name:"revisions",kind:"message",T:mg,repeated:!0},{no:4,name:"tags",kind:"message",T:Ia,repeated:!0}]),gg=s.makeMessageType("viam.app.v1.CreateFragmentRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"config",kind:"message",T:d},{no:3,name:"organization_id",kind:"scalar",T:9},{no:4,name:"visibility",kind:"enum",T:s.getEnumType(wn),opt:!0}]),Tg=s.makeMessageType("viam.app.v1.CreateFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye}]),kg=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:d},{no:4,name:"public",kind:"scalar",T:8,opt:!0},{no:5,name:"visibility",kind:"enum",T:s.getEnumType(wn),opt:!0},{no:6,name:"last_known_update",kind:"message",T:S,opt:!0}]),yg=s.makeMessageType("viam.app.v1.UpdateFragmentResponse",()=>[{no:1,name:"fragment",kind:"message",T:Ye}]),vg=s.makeMessageType("viam.app.v1.DeleteFragmentRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),hg=s.makeMessageType("viam.app.v1.DeleteFragmentResponse",[]),fg=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}]),Rg=s.makeMessageType("viam.app.v1.GetFragmentHistoryResponse",()=>[{no:1,name:"history",kind:"message",T:rg,repeated:!0},{no:2,name:"next_page_token",kind:"scalar",T:9}]),_g=s.makeMessageType("viam.app.v1.GetFragmentUsageRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9}]),Sg=s.makeMessageType("viam.app.v1.GetFragmentUsageResponse",()=>[{no:1,name:"version_usages",kind:"message",T:Ma,repeated:!0}]),Ig=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}]),Mg=s.makeMessageType("viam.app.v1.SetFragmentTagResponse",()=>[{no:1,name:"tags",kind:"message",T:Ia,repeated:!0}]),bg=s.makeMessageType("viam.app.v1.DeleteFragmentTagRequest",()=>[{no:1,name:"fragment_id",kind:"scalar",T:9},{no:2,name:"tag",kind:"scalar",T:9}]),wg=s.makeMessageType("viam.app.v1.DeleteFragmentTagResponse",()=>[{no:1,name:"tags",kind:"message",T:Ia,repeated:!0}]),Eg=s.makeMessageType("viam.app.v1.ListRobotsRequest",()=>[{no:1,name:"location_id",kind:"scalar",T:9}]),Ro=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}]),Og=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:Ro,repeated:!0}]),Cg=s.makeMessageType("viam.app.v1.ListNestedFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"resolved_fragments",kind:"message",T:fo,repeated:!0}]),Ng=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:Ro,repeated:!0}]),Pg=s.makeMessageType("viam.app.v1.ListMachineFragmentsResponse",()=>[{no:1,name:"fragments",kind:"message",T:Ye,repeated:!0},{no:2,name:"resolved_fragments",kind:"message",T:fo,repeated:!0}]),Ag=s.makeMessageType("viam.app.v1.ListMachineSummariesRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),Dg=s.makeMessageType("viam.app.v1.ListMachineSummariesResponse",()=>[{no:1,name:"location_summaries",kind:"message",T:qg,repeated:!0}]),qg=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:Ug,repeated:!0}]),Ug=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:Fg,repeated:!0}]),Gg=s.makeMessageType("viam.app.v1.FragmentSummary",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9}]),Lg=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"}]),Bg=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"}]),Fg=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:Lg,opt:!0},{no:5,name:"viam_agent_version",kind:"message",T:Bg,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:Gg,repeated:!0}]),xg=s.makeMessageType("viam.app.v1.ListRobotsResponse",()=>[{no:1,name:"robots",kind:"message",T:Ra,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}]),zg=s.makeMessageType("viam.app.v1.NewRobotResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Yg=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}]),$g=s.makeMessageType("viam.app.v1.UpdateRobotResponse",()=>[{no:1,name:"robot",kind:"message",T:Ra}]),Vg=s.makeMessageType("viam.app.v1.DeleteRobotRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Wg=s.makeMessageType("viam.app.v1.DeleteRobotResponse",[]),jg=s.makeMessageType("viam.app.v1.GetRobotMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Hg=s.makeMessageType("viam.app.v1.GetRobotMetadataResponse",()=>[{no:1,name:"data",kind:"message",T:d}]),Kg=s.makeMessageType("viam.app.v1.UpdateRobotMetadataRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"data",kind:"message",T:d}]),Xg=s.makeMessageType("viam.app.v1.UpdateRobotMetadataResponse",[]),Qg=s.makeMessageType("viam.app.v1.MarkPartAsMainRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),Zg=s.makeMessageType("viam.app.v1.MarkPartAsMainResponse",[]),eT=s.makeMessageType("viam.app.v1.MarkPartForRestartRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),nT=s.makeMessageType("viam.app.v1.MarkPartForRestartResponse",[]),aT=s.makeMessageType("viam.app.v1.CreateRobotPartSecretRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9}]),tT=s.makeMessageType("viam.app.v1.CreateRobotPartSecretResponse",()=>[{no:1,name:"part",kind:"message",T:dn}]),sT=s.makeMessageType("viam.app.v1.DeleteRobotPartSecretRequest",()=>[{no:1,name:"part_id",kind:"scalar",T:9},{no:2,name:"secret_id",kind:"scalar",T:9}]),oT=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}]),iT=s.makeMessageType("viam.app.v1.AddRoleRequest",()=>[{no:1,name:"authorization",kind:"message",T:Q}]),rT=s.makeMessageType("viam.app.v1.AddRoleResponse",[]),mT=s.makeMessageType("viam.app.v1.RemoveRoleRequest",()=>[{no:1,name:"authorization",kind:"message",T:Q}]),cT=s.makeMessageType("viam.app.v1.RemoveRoleResponse",[]),dT=s.makeMessageType("viam.app.v1.ChangeRoleRequest",()=>[{no:1,name:"old_authorization",kind:"message",T:Q},{no:2,name:"new_authorization",kind:"message",T:Q}]),lT=s.makeMessageType("viam.app.v1.ChangeRoleResponse",[]),uT=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}]),pT=s.makeMessageType("viam.app.v1.ListAuthorizationsResponse",()=>[{no:1,name:"authorizations",kind:"message",T:Q,repeated:!0}]),gT=s.makeMessageType("viam.app.v1.CheckPermissionsRequest",()=>[{no:1,name:"permissions",kind:"message",T:_o,repeated:!0}]),_o=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}]),TT=s.makeMessageType("viam.app.v1.CheckPermissionsResponse",()=>[{no:1,name:"authorized_permissions",kind:"message",T:_o,repeated:!0}]),kT=s.makeMessageType("viam.app.v1.ModuleVersion",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"files",kind:"message",T:Io,repeated:!0},{no:3,name:"models",kind:"message",T:Ze,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}]),yT=s.makeMessageType("viam.app.v1.ModuleMetadata",()=>[{no:1,name:"models",kind:"message",T:Ze,repeated:!0},{no:2,name:"versions",kind:"message",T:kT,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}]),vT=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)}]),hT=s.makeMessageType("viam.app.v1.MLTrainingVersion",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"created_on",kind:"message",T:S}]),fT=s.makeMessageType("viam.app.v1.MLTrainingMetadata",()=>[{no:5,name:"versions",kind:"message",T:hT,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}]),ba=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(fa)},{no:6,name:"visibility",kind:"enum",T:s.getEnumType(cn)},{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:yT,oneof:"metadata"},{no:12,name:"ml_model_metadata",kind:"message",T:vT,oneof:"metadata"},{no:18,name:"ml_training_metadata",kind:"message",T:fT,oneof:"metadata"},{no:15,name:"created_at",kind:"message",T:S},{no:16,name:"updated_at",kind:"message",T:S}]),RT=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}]),_T=s.makeMessageType("viam.app.v1.GetRegistryItemResponse",()=>[{no:1,name:"item",kind:"message",T:ba}]),ST=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(fa)}]),IT=s.makeMessageType("viam.app.v1.CreateRegistryItemResponse",[]),MT=s.makeMessageType("viam.app.v1.UpdateRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:s.getEnumType(fa)},{no:3,name:"description",kind:"scalar",T:9},{no:4,name:"visibility",kind:"enum",T:s.getEnumType(cn)},{no:5,name:"url",kind:"scalar",T:9,opt:!0},{no:6,name:"update_module_metadata",kind:"message",T:FT,oneof:"metadata"},{no:7,name:"update_ml_model_metadata",kind:"message",T:xT,oneof:"metadata"},{no:8,name:"update_ml_training_metadata",kind:"message",T:JT,oneof:"metadata"},{no:9,name:"markdown_description",kind:"scalar",T:9,opt:!0}]),bT=s.makeMessageType("viam.app.v1.UpdateRegistryItemResponse",[]),wT=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(fa),repeated:!0},{no:3,name:"visibilities",kind:"enum",T:s.getEnumType(cn),repeated:!0},{no:4,name:"platforms",kind:"scalar",T:9,repeated:!0},{no:5,name:"statuses",kind:"enum",T:s.getEnumType(uu),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}]),ET=s.makeMessageType("viam.app.v1.ListRegistryItemsResponse",()=>[{no:1,name:"items",kind:"message",T:ba,repeated:!0}]),OT=s.makeMessageType("viam.app.v1.DeleteRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9}]),CT=s.makeMessageType("viam.app.v1.DeleteRegistryItemResponse",[]),NT=s.makeMessageType("viam.app.v1.RenameRegistryItemRequest",()=>[{no:1,name:"item_id",kind:"scalar",T:9},{no:2,name:"new_name",kind:"scalar",T:9}]),PT=s.makeMessageType("viam.app.v1.RenameRegistryItemResponse",()=>[{no:1,name:"item",kind:"message",T:ba}]),AT=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}]),DT=s.makeMessageType("viam.app.v1.TransferRegistryItemResponse",[]),qT=s.makeMessageType("viam.app.v1.CreateModuleRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),UT=s.makeMessageType("viam.app.v1.CreateModuleResponse",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9}]),GT=s.makeMessageType("viam.app.v1.UpdateModuleRequest",()=>[{no:1,name:"module_id",kind:"scalar",T:9},{no:2,name:"visibility",kind:"enum",T:s.getEnumType(cn)},{no:3,name:"url",kind:"scalar",T:9},{no:4,name:"description",kind:"scalar",T:9},{no:5,name:"models",kind:"message",T:Ze,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:LT,repeated:!0},{no:9,name:"markdown_description",kind:"scalar",T:9,opt:!0}]),LT=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}]),BT=s.makeMessageType("viam.app.v1.UpdateModuleResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),FT=s.makeMessageType("viam.app.v1.UpdateModuleMetadata",()=>[{no:1,name:"models",kind:"message",T:Ze,repeated:!0},{no:2,name:"entrypoint",kind:"scalar",T:9}]),xT=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)}]),JT=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}]),Ze=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}]),zT=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}]),YT=s.makeMessageType("viam.app.v1.UploadModuleFileRequest",()=>[{no:1,name:"module_file_info",kind:"message",T:zT,oneof:"module_file"},{no:2,name:"file",kind:"scalar",T:12,oneof:"module_file"}]),$T=s.makeMessageType("viam.app.v1.UploadModuleFileResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),VT=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}]),WT=s.makeMessageType("viam.app.v1.GetModuleResponse",()=>[{no:1,name:"module",kind:"message",T:So}]),So=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(cn)},{no:4,name:"versions",kind:"message",T:jT,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:Ze,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}]),jT=s.makeMessageType("viam.app.v1.VersionHistory",()=>[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"files",kind:"message",T:Io,repeated:!0},{no:3,name:"models",kind:"message",T:Ze,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}]),Io=s.makeMessageType("viam.app.v1.Uploads",()=>[{no:1,name:"platform",kind:"scalar",T:9},{no:2,name:"uploaded_at",kind:"message",T:S}]),HT=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}]),KT=s.makeMessageType("viam.app.v1.ListModulesResponse",()=>[{no:1,name:"modules",kind:"message",T:So,repeated:!0}]),XT=s.makeMessageType("viam.app.v1.GetUserIDByEmailRequest",()=>[{no:1,name:"email",kind:"scalar",T:9}]),QT=s.makeMessageType("viam.app.v1.GetUserIDByEmailResponse",()=>[{no:1,name:"user_id",kind:"scalar",T:9}]),ZT=s.makeMessageType("viam.app.v1.ListOrganizationsByUserRequest",()=>[{no:1,name:"user_id",kind:"scalar",T:9}]),Mo=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}]),ek=s.makeMessageType("viam.app.v1.ListOrganizationsByUserResponse",()=>[{no:1,name:"orgs",kind:"message",T:Mo,repeated:!0}]),nk=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}]),ak=s.makeMessageType("viam.app.v1.SearchOrganizationsResponse",()=>[{no:1,name:"organizations",kind:"message",T:Mo,repeated:!0}]),tk=s.makeMessageType("viam.app.v1.CreateKeyRequest",()=>[{no:1,name:"authorizations",kind:"message",T:Q,repeated:!0},{no:2,name:"name",kind:"scalar",T:9}]),sk=s.makeMessageType("viam.app.v1.CreateKeyResponse",()=>[{no:1,name:"key",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:9}]),ok=s.makeMessageType("viam.app.v1.DeleteKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),ik=s.makeMessageType("viam.app.v1.DeleteKeyResponse",[]),rk=s.makeMessageType("viam.app.v1.RenameKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),mk=s.makeMessageType("viam.app.v1.RenameKeyResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),ck=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}]),bo=s.makeMessageType("viam.app.v1.APIKeyWithAuthorizations",()=>[{no:1,name:"api_key",kind:"message",T:sg},{no:2,name:"authorizations",kind:"message",T:ck,repeated:!0}]),dk=s.makeMessageType("viam.app.v1.ListKeysRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),lk=s.makeMessageType("viam.app.v1.ListKeysResponse",()=>[{no:1,name:"api_keys",kind:"message",T:bo,repeated:!0}]),uk=s.makeMessageType("viam.app.v1.RotateKeyRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),pk=s.makeMessageType("viam.app.v1.RotateKeyResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}]),gk=s.makeMessageType("viam.app.v1.CreateKeyFromExistingKeyAuthorizationsRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),Tk=s.makeMessageType("viam.app.v1.CreateKeyFromExistingKeyAuthorizationsResponse",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"key",kind:"scalar",T:9}]),kk=s.makeMessageType("viam.app.v1.GetAppContentRequest",()=>[{no:1,name:"public_namespace",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),yk=s.makeMessageType("viam.app.v1.GetAppContentResponse",()=>[{no:1,name:"blob_path",kind:"scalar",T:9},{no:2,name:"entrypoint",kind:"scalar",T:9}]),vk=s.makeMessageType("viam.app.v1.OrganizationSetLogoRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"logo",kind:"scalar",T:12}]),hk=s.makeMessageType("viam.app.v1.OrganizationSetLogoResponse",[]),fk=s.makeMessageType("viam.app.v1.OrganizationGetLogoRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Rk=s.makeMessageType("viam.app.v1.OrganizationGetLogoResponse",()=>[{no:1,name:"url",kind:"scalar",T:9}]),_k=s.makeMessageType("viam.app.v1.EnableAuthServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Sk=s.makeMessageType("viam.app.v1.EnableAuthServiceResponse",[]),Ik=s.makeMessageType("viam.app.v1.DisableAuthServiceRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Mk=s.makeMessageType("viam.app.v1.DisableAuthServiceResponse",[]),bk=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}]),wk=s.makeMessageType("viam.app.v1.CreateOAuthAppResponse",()=>[{no:1,name:"client_id",kind:"scalar",T:9},{no:2,name:"client_secret",kind:"scalar",T:9}]),Ek=s.makeMessageType("viam.app.v1.ReadOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9}]),Ok=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}]),Ck=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}]),Nk=s.makeMessageType("viam.app.v1.UpdateOAuthAppResponse",[]),Pk=s.makeMessageType("viam.app.v1.DeleteOAuthAppRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9},{no:2,name:"client_id",kind:"scalar",T:9}]),Ak=s.makeMessageType("viam.app.v1.DeleteOAuthAppResponse",[]),Dk=s.makeMessageType("viam.app.v1.ListOAuthAppsRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),qk=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(pu)},{no:2,name:"pkce",kind:"enum",T:s.getEnumType(gu)},{no:3,name:"url_validation",kind:"enum",T:s.getEnumType(Tu)},{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(ku),repeated:!0}]),v1=Object.freeze(Object.defineProperty({__proto__:null,APIKey:sg,APIKeyWithAuthorizations:bo,AddRoleRequest:iT,AddRoleResponse:rT,AdditionalFragment:Ro,App:LT,AuthenticationType:du,AuthenticatorInfo:ko,Authorization:Q,AuthorizationDetails:ck,AuthorizedPermissions:_o,BillingAddress:_a,ChangeRoleRequest:dT,ChangeRoleResponse:lT,CheckPermissionsRequest:gT,CheckPermissionsResponse:TT,ClientAuthentication:pu,CreateFragmentRequest:gg,CreateFragmentResponse:Tg,CreateKeyFromExistingKeyAuthorizationsRequest:gk,CreateKeyFromExistingKeyAuthorizationsResponse:Tk,CreateKeyRequest:tk,CreateKeyResponse:sk,CreateLocationRequest:rp,CreateLocationResponse:mp,CreateLocationSecretRequest:wp,CreateLocationSecretResponse:Ep,CreateModuleRequest:qT,CreateModuleResponse:UT,CreateOAuthAppRequest:bk,CreateOAuthAppResponse:wk,CreateOrganizationInviteRequest:Gu,CreateOrganizationInviteResponse:Lu,CreateOrganizationRequest:Ru,CreateOrganizationResponse:_u,CreateRegistryItemRequest:ST,CreateRegistryItemResponse:IT,CreateRobotPartSecretRequest:aT,CreateRobotPartSecretResponse:tT,DeleteFragmentRequest:vg,DeleteFragmentResponse:hg,DeleteFragmentTagRequest:bg,DeleteFragmentTagResponse:wg,DeleteKeyRequest:ok,DeleteKeyResponse:ik,DeleteLocationRequest:pp,DeleteLocationResponse:gp,DeleteLocationSecretRequest:Op,DeleteLocationSecretResponse:Cp,DeleteOAuthAppRequest:Pk,DeleteOAuthAppResponse:Ak,DeleteOrganizationInviteRequest:xu,DeleteOrganizationInviteResponse:Ju,DeleteOrganizationMemberRequest:$u,DeleteOrganizationMemberResponse:Vu,DeleteOrganizationRequest:Ou,DeleteOrganizationResponse:Cu,DeleteRegistryItemRequest:OT,DeleteRegistryItemResponse:CT,DeleteRobotPartRequest:Qp,DeleteRobotPartResponse:ig,DeleteRobotPartSecretRequest:sT,DeleteRobotPartSecretResponse:oT,DeleteRobotRequest:Vg,DeleteRobotResponse:Wg,DisableAuthServiceRequest:Ik,DisableAuthServiceResponse:Mk,DisableBillingServiceRequest:Zu,DisableBillingServiceResponse:ep,EnableAuthServiceRequest:_k,EnableAuthServiceResponse:Sk,EnableBillingServiceRequest:Wu,EnableBillingServiceResponse:ju,EnabledGrant:ku,Fragment:Ye,FragmentError:cg,FragmentErrorType:lu,FragmentHistoryEntry:rg,FragmentRevision:mg,FragmentSummary:Gg,FragmentTag:Ia,FragmentUsage:Ma,FragmentVisibility:wn,GetAppContentRequest:kk,GetAppContentResponse:yk,GetBillingServiceConfigRequest:Xu,GetBillingServiceConfigResponse:Qu,GetFragmentHistoryRequest:fg,GetFragmentHistoryResponse:Rg,GetFragmentRequest:ug,GetFragmentResponse:pg,GetFragmentUsageRequest:_g,GetFragmentUsageResponse:Sg,GetLocationMetadataRequest:Tp,GetLocationMetadataResponse:kp,GetLocationRequest:cp,GetLocationResponse:dp,GetModuleRequest:VT,GetModuleResponse:WT,GetOrganizationMetadataRequest:Nu,GetOrganizationMetadataResponse:Pu,GetOrganizationNamespaceAvailabilityRequest:Mu,GetOrganizationNamespaceAvailabilityResponse:bu,GetOrganizationRequest:Su,GetOrganizationResponse:Iu,GetOrganizationsWithAccessToLocationRequest:hp,GetOrganizationsWithAccessToLocationResponse:fp,GetRegistryItemRequest:RT,GetRegistryItemResponse:_T,GetRobotAPIKeysRequest:tg,GetRobotAPIKeysResponse:og,GetRobotMetadataRequest:jg,GetRobotMetadataResponse:Hg,GetRobotPartHistoryRequest:Vp,GetRobotPartHistoryResponse:Wp,GetRobotPartLogsRequest:Jp,GetRobotPartLogsResponse:zp,GetRobotPartMetadataRequest:Zp,GetRobotPartMetadataResponse:eg,GetRobotPartRequest:Fp,GetRobotPartResponse:xp,GetRobotPartsRequest:Lp,GetRobotPartsResponse:Bp,GetRobotRequest:Ap,GetRobotResponse:Gp,GetRoverRentalRobotsRequest:Dp,GetRoverRentalRobotsResponse:Up,GetUserIDByEmailRequest:XT,GetUserIDByEmailResponse:QT,ListAuthorizationsRequest:uT,ListAuthorizationsResponse:pT,ListFragmentsRequest:dg,ListFragmentsResponse:lg,ListKeysRequest:dk,ListKeysResponse:lk,ListLocationsRequest:Rp,ListLocationsResponse:bp,ListMachineFragmentsRequest:Ng,ListMachineFragmentsResponse:Pg,ListMachineSummariesRequest:Ag,ListMachineSummariesResponse:Dg,ListModulesRequest:HT,ListModulesResponse:KT,ListNestedFragmentsRequest:Og,ListNestedFragmentsResponse:Cg,ListOAuthAppsRequest:Dk,ListOAuthAppsResponse:qk,ListOrganizationMembersRequest:qu,ListOrganizationMembersResponse:Uu,ListOrganizationsByUserRequest:ZT,ListOrganizationsByUserResponse:ek,ListOrganizationsRequest:vu,ListOrganizationsResponse:fu,ListRegistryItemsRequest:wT,ListRegistryItemsResponse:ET,ListRobotsRequest:Eg,ListRobotsResponse:xg,Location:Cn,LocationAuth:Sa,LocationAuthRequest:Np,LocationAuthResponse:Pp,LocationOrganization:op,LocationSummary:qg,MLModelMetadata:vT,MLTrainingMetadata:fT,MLTrainingVersion:hT,MachineSummary:Ug,MarkPartAsMainRequest:Qg,MarkPartAsMainResponse:Zg,MarkPartForRestartRequest:eT,MarkPartForRestartResponse:nT,Model:Ze,Module:So,ModuleFileInfo:zT,ModuleMetadata:yT,ModuleVersion:kT,NewRobotPartRequest:Kp,NewRobotPartResponse:Xp,NewRobotRequest:Jg,NewRobotResponse:zg,OAuthConfig:wa,OrgDetails:Mo,Organization:En,OrganizationGetLogoRequest:fk,OrganizationGetLogoResponse:Rk,OrganizationGetSupportEmailRequest:tp,OrganizationGetSupportEmailResponse:sp,OrganizationIdentity:yo,OrganizationInvite:On,OrganizationMember:hu,OrganizationSetLogoRequest:vk,OrganizationSetLogoResponse:hk,OrganizationSetSupportEmailRequest:np,OrganizationSetSupportEmailResponse:ap,PKCE:gu,PartSummary:Fg,ReadOAuthAppRequest:Ek,ReadOAuthAppResponse:Ok,RegistryItem:ba,RegistryItemStatus:uu,RemoveRoleRequest:mT,RemoveRoleResponse:cT,RenameKeyRequest:rk,RenameKeyResponse:mk,RenameRegistryItemRequest:NT,RenameRegistryItemResponse:PT,ResendOrganizationInviteRequest:zu,ResendOrganizationInviteResponse:Yu,ResolvedFragment:fo,Robot:Ra,RobotPart:dn,RobotPartHistoryEntry:yu,RotateKeyRequest:uk,RotateKeyResponse:pk,RoverRentalRobot:qp,SearchOrganizationsRequest:nk,SearchOrganizationsResponse:ak,SetFragmentTagRequest:Ig,SetFragmentTagResponse:Mg,ShareLocationRequest:_p,ShareLocationResponse:Sp,SharedSecret:vo,SharedSecret_State:ho,StorageConfig:ip,TailRobotPartLogsRequest:Yp,TailRobotPartLogsResponse:$p,TransferRegistryItemRequest:AT,TransferRegistryItemResponse:DT,URLValidation:Tu,UnshareLocationRequest:Ip,UnshareLocationResponse:Mp,UpdateBillingServiceRequest:Hu,UpdateBillingServiceResponse:Ku,UpdateFragmentRequest:kg,UpdateFragmentResponse:yg,UpdateLocationMetadataRequest:yp,UpdateLocationMetadataResponse:vp,UpdateLocationRequest:lp,UpdateLocationResponse:up,UpdateMLModelMetadata:xT,UpdateMLTrainingMetadata:JT,UpdateModuleMetadata:FT,UpdateModuleRequest:GT,UpdateModuleResponse:BT,UpdateOAuthAppRequest:Ck,UpdateOAuthAppResponse:Nk,UpdateOrganizationInviteAuthorizationsRequest:Bu,UpdateOrganizationInviteAuthorizationsResponse:Fu,UpdateOrganizationMetadataRequest:Au,UpdateOrganizationMetadataResponse:Du,UpdateOrganizationRequest:wu,UpdateOrganizationResponse:Eu,UpdateRegistryItemRequest:MT,UpdateRegistryItemResponse:bT,UpdateRobotMetadataRequest:Kg,UpdateRobotMetadataResponse:Xg,UpdateRobotPartMetadataRequest:ng,UpdateRobotPartMetadataResponse:ag,UpdateRobotPartRequest:jp,UpdateRobotPartResponse:Hp,UpdateRobotRequest:Yg,UpdateRobotResponse:$g,UploadModuleFileRequest:YT,UploadModuleFileResponse:$T,Uploads:Io,VersionHistory:jT,ViamAgentVersion:Bg,ViamServerVersion:Lg,Visibility:cn},Symbol.toStringTag,{value:"Module"})),h1={typeName:"viam.app.v1.AppService",methods:{getUserIDByEmail:{name:"GetUserIDByEmail",I:XT,O:QT,kind:m.Unary},createOrganization:{name:"CreateOrganization",I:Ru,O:_u,kind:m.Unary},listOrganizations:{name:"ListOrganizations",I:vu,O:fu,kind:m.Unary},getOrganizationsWithAccessToLocation:{name:"GetOrganizationsWithAccessToLocation",I:hp,O:fp,kind:m.Unary},listOrganizationsByUser:{name:"ListOrganizationsByUser",I:ZT,O:ek,kind:m.Unary},searchOrganizations:{name:"SearchOrganizations",I:nk,O:ak,kind:m.Unary},getOrganization:{name:"GetOrganization",I:Su,O:Iu,kind:m.Unary},getOrganizationNamespaceAvailability:{name:"GetOrganizationNamespaceAvailability",I:Mu,O:bu,kind:m.Unary},updateOrganization:{name:"UpdateOrganization",I:wu,O:Eu,kind:m.Unary},deleteOrganization:{name:"DeleteOrganization",I:Ou,O:Cu,kind:m.Unary},getOrganizationMetadata:{name:"GetOrganizationMetadata",I:Nu,O:Pu,kind:m.Unary},updateOrganizationMetadata:{name:"UpdateOrganizationMetadata",I:Au,O:Du,kind:m.Unary},listOrganizationMembers:{name:"ListOrganizationMembers",I:qu,O:Uu,kind:m.Unary},createOrganizationInvite:{name:"CreateOrganizationInvite",I:Gu,O:Lu,kind:m.Unary},updateOrganizationInviteAuthorizations:{name:"UpdateOrganizationInviteAuthorizations",I:Bu,O:Fu,kind:m.Unary},deleteOrganizationMember:{name:"DeleteOrganizationMember",I:$u,O:Vu,kind:m.Unary},deleteOrganizationInvite:{name:"DeleteOrganizationInvite",I:xu,O:Ju,kind:m.Unary},resendOrganizationInvite:{name:"ResendOrganizationInvite",I:zu,O:Yu,kind:m.Unary},enableBillingService:{name:"EnableBillingService",I:Wu,O:ju,kind:m.Unary},disableBillingService:{name:"DisableBillingService",I:Zu,O:ep,kind:m.Unary},updateBillingService:{name:"UpdateBillingService",I:Hu,O:Ku,kind:m.Unary},getBillingServiceConfig:{name:"GetBillingServiceConfig",I:Xu,O:Qu,kind:m.Unary},organizationSetSupportEmail:{name:"OrganizationSetSupportEmail",I:np,O:ap,kind:m.Unary},organizationGetSupportEmail:{name:"OrganizationGetSupportEmail",I:tp,O:sp,kind:m.Unary},organizationSetLogo:{name:"OrganizationSetLogo",I:vk,O:hk,kind:m.Unary},organizationGetLogo:{name:"OrganizationGetLogo",I:fk,O:Rk,kind:m.Unary},enableAuthService:{name:"EnableAuthService",I:_k,O:Sk,kind:m.Unary},disableAuthService:{name:"DisableAuthService",I:Ik,O:Mk,kind:m.Unary},createOAuthApp:{name:"CreateOAuthApp",I:bk,O:wk,kind:m.Unary},readOAuthApp:{name:"ReadOAuthApp",I:Ek,O:Ok,kind:m.Unary},updateOAuthApp:{name:"UpdateOAuthApp",I:Ck,O:Nk,kind:m.Unary},deleteOAuthApp:{name:"DeleteOAuthApp",I:Pk,O:Ak,kind:m.Unary},listOAuthApps:{name:"ListOAuthApps",I:Dk,O:qk,kind:m.Unary},createLocation:{name:"CreateLocation",I:rp,O:mp,kind:m.Unary},getLocation:{name:"GetLocation",I:cp,O:dp,kind:m.Unary},updateLocation:{name:"UpdateLocation",I:lp,O:up,kind:m.Unary},deleteLocation:{name:"DeleteLocation",I:pp,O:gp,kind:m.Unary},getLocationMetadata:{name:"GetLocationMetadata",I:Tp,O:kp,kind:m.Unary},updateLocationMetadata:{name:"UpdateLocationMetadata",I:yp,O:vp,kind:m.Unary},listLocations:{name:"ListLocations",I:Rp,O:bp,kind:m.Unary},shareLocation:{name:"ShareLocation",I:_p,O:Sp,kind:m.Unary},unshareLocation:{name:"UnshareLocation",I:Ip,O:Mp,kind:m.Unary},locationAuth:{name:"LocationAuth",I:Np,O:Pp,kind:m.Unary},createLocationSecret:{name:"CreateLocationSecret",I:wp,O:Ep,kind:m.Unary},deleteLocationSecret:{name:"DeleteLocationSecret",I:Op,O:Cp,kind:m.Unary},getRobot:{name:"GetRobot",I:Ap,O:Gp,kind:m.Unary},getRobotMetadata:{name:"GetRobotMetadata",I:jg,O:Hg,kind:m.Unary},updateRobotMetadata:{name:"UpdateRobotMetadata",I:Kg,O:Xg,kind:m.Unary},getRoverRentalRobots:{name:"GetRoverRentalRobots",I:Dp,O:Up,kind:m.Unary},getRobotParts:{name:"GetRobotParts",I:Lp,O:Bp,kind:m.Unary},getRobotPart:{name:"GetRobotPart",I:Fp,O:xp,kind:m.Unary},getRobotPartLogs:{name:"GetRobotPartLogs",I:Jp,O:zp,kind:m.Unary},tailRobotPartLogs:{name:"TailRobotPartLogs",I:Yp,O:$p,kind:m.ServerStreaming},getRobotPartHistory:{name:"GetRobotPartHistory",I:Vp,O:Wp,kind:m.Unary},updateRobotPart:{name:"UpdateRobotPart",I:jp,O:Hp,kind:m.Unary},newRobotPart:{name:"NewRobotPart",I:Kp,O:Xp,kind:m.Unary},deleteRobotPart:{name:"DeleteRobotPart",I:Qp,O:ig,kind:m.Unary},getRobotPartMetadata:{name:"GetRobotPartMetadata",I:Zp,O:eg,kind:m.Unary},updateRobotPartMetadata:{name:"UpdateRobotPartMetadata",I:ng,O:ag,kind:m.Unary},getRobotAPIKeys:{name:"GetRobotAPIKeys",I:tg,O:og,kind:m.Unary},markPartAsMain:{name:"MarkPartAsMain",I:Qg,O:Zg,kind:m.Unary},markPartForRestart:{name:"MarkPartForRestart",I:eT,O:nT,kind:m.Unary},createRobotPartSecret:{name:"CreateRobotPartSecret",I:aT,O:tT,kind:m.Unary},deleteRobotPartSecret:{name:"DeleteRobotPartSecret",I:sT,O:oT,kind:m.Unary},listRobots:{name:"ListRobots",I:Eg,O:xg,kind:m.Unary},newRobot:{name:"NewRobot",I:Jg,O:zg,kind:m.Unary},updateRobot:{name:"UpdateRobot",I:Yg,O:$g,kind:m.Unary},deleteRobot:{name:"DeleteRobot",I:Vg,O:Wg,kind:m.Unary},listFragments:{name:"ListFragments",I:dg,O:lg,kind:m.Unary},getFragment:{name:"GetFragment",I:ug,O:pg,kind:m.Unary},createFragment:{name:"CreateFragment",I:gg,O:Tg,kind:m.Unary},updateFragment:{name:"UpdateFragment",I:kg,O:yg,kind:m.Unary},deleteFragment:{name:"DeleteFragment",I:vg,O:hg,kind:m.Unary},listNestedFragments:{name:"ListNestedFragments",I:Og,O:Cg,kind:m.Unary},listMachineFragments:{name:"ListMachineFragments",I:Ng,O:Pg,kind:m.Unary},listMachineSummaries:{name:"ListMachineSummaries",I:Ag,O:Dg,kind:m.Unary},getFragmentHistory:{name:"GetFragmentHistory",I:fg,O:Rg,kind:m.Unary},getFragmentUsage:{name:"GetFragmentUsage",I:_g,O:Sg,kind:m.Unary},setFragmentTag:{name:"SetFragmentTag",I:Ig,O:Mg,kind:m.Unary},deleteFragmentTag:{name:"DeleteFragmentTag",I:bg,O:wg,kind:m.Unary},addRole:{name:"AddRole",I:iT,O:rT,kind:m.Unary},removeRole:{name:"RemoveRole",I:mT,O:cT,kind:m.Unary},changeRole:{name:"ChangeRole",I:dT,O:lT,kind:m.Unary},listAuthorizations:{name:"ListAuthorizations",I:uT,O:pT,kind:m.Unary},checkPermissions:{name:"CheckPermissions",I:gT,O:TT,kind:m.Unary},getRegistryItem:{name:"GetRegistryItem",I:RT,O:_T,kind:m.Unary},createRegistryItem:{name:"CreateRegistryItem",I:ST,O:IT,kind:m.Unary},updateRegistryItem:{name:"UpdateRegistryItem",I:MT,O:bT,kind:m.Unary},listRegistryItems:{name:"ListRegistryItems",I:wT,O:ET,kind:m.Unary},deleteRegistryItem:{name:"DeleteRegistryItem",I:OT,O:CT,kind:m.Unary},renameRegistryItem:{name:"RenameRegistryItem",I:NT,O:PT,kind:m.Unary},transferRegistryItem:{name:"TransferRegistryItem",I:AT,O:DT,kind:m.Unary},createModule:{name:"CreateModule",I:qT,O:UT,kind:m.Unary},updateModule:{name:"UpdateModule",I:GT,O:BT,kind:m.Unary},uploadModuleFile:{name:"UploadModuleFile",I:YT,O:$T,kind:m.ClientStreaming},getModule:{name:"GetModule",I:VT,O:WT,kind:m.Unary},listModules:{name:"ListModules",I:HT,O:KT,kind:m.Unary},createKey:{name:"CreateKey",I:tk,O:sk,kind:m.Unary},deleteKey:{name:"DeleteKey",I:ok,O:ik,kind:m.Unary},listKeys:{name:"ListKeys",I:dk,O:lk,kind:m.Unary},renameKey:{name:"RenameKey",I:rk,O:mk,kind:m.Unary},rotateKey:{name:"RotateKey",I:uk,O:pk,kind:m.Unary},createKeyFromExistingKeyAuthorizations:{name:"CreateKeyFromExistingKeyAuthorizations",I:gk,O:Tk,kind:m.Unary},getAppContent:{name:"GetAppContent",I:kk,O:yk,kind:m.Unary}}},Uk=(a,e,n,t,o,i)=>new Q({authorizationType:"role",identityId:e,identityType:o,authorizationId:`${t}_${n}`,resourceType:t,organizationId:a,resourceId:i});class f1{client;constructor(e){this.client=na(h1,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:Uk(e,n,t,o,"",i)})}async removeRole(e,n,t,o,i){await this.client.removeRole({authorization:Uk(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 u={organizationId:e,types:n,visibilities:t,platforms:o,statuses:i,searchTerm:r,pageToken:c};return(await this.client.listRegistryItems(u)).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:d.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:d.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:d.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:d.fromJson(n)})}}const Gk=s.makeEnum("viam.app.v1.PaymentMethodType",[{no:0,name:"PAYMENT_METHOD_TYPE_UNSPECIFIED",localName:"UNSPECIFIED"},{no:1,name:"PAYMENT_METHOD_TYPE_CARD",localName:"CARD"}]),Lk=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"}]),Bk=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"}]),Fk=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}]),xk=s.makeMessageType("viam.app.v1.PaymentMethodCard",()=>[{no:1,name:"brand",kind:"scalar",T:9},{no:2,name:"last_four_digits",kind:"scalar",T:9}]),Jk=s.makeMessageType("viam.app.v1.GetCurrentMonthUsageRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),zk=s.makeMessageType("viam.app.v1.UsageCost",()=>[{no:1,name:"resource_type",kind:"enum",T:s.getEnumType(Lk)},{no:2,name:"cost",kind:"scalar",T:1}]),Yk=s.makeMessageType("viam.app.v1.ResourceUsageCostsBySource",()=>[{no:1,name:"source_type",kind:"enum",T:s.getEnumType(Bk)},{no:2,name:"resource_usage_costs",kind:"message",T:$k},{no:3,name:"tier_name",kind:"scalar",T:9}]),$k=s.makeMessageType("viam.app.v1.ResourceUsageCosts",()=>[{no:1,name:"usage_costs",kind:"message",T:zk,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}]),Vk=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:Yk,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}]),Wk=s.makeMessageType("viam.app.v1.GetOrgBillingInformationRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),jk=s.makeMessageType("viam.app.v1.GetOrgBillingInformationResponse",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(Gk)},{no:2,name:"billing_email",kind:"scalar",T:9},{no:3,name:"method",kind:"message",T:xk,opt:!0},{no:4,name:"billing_tier",kind:"scalar",T:9,opt:!0}]),Hk=s.makeMessageType("viam.app.v1.GetInvoicesSummaryRequest",()=>[{no:1,name:"org_id",kind:"scalar",T:9}]),Kk=s.makeMessageType("viam.app.v1.GetInvoicesSummaryResponse",()=>[{no:1,name:"outstanding_balance",kind:"scalar",T:1},{no:2,name:"invoices",kind:"message",T:Fk,repeated:!0}]),Xk=s.makeMessageType("viam.app.v1.GetInvoicePdfRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"org_id",kind:"scalar",T:9}]),Qk=s.makeMessageType("viam.app.v1.GetInvoicePdfResponse",()=>[{no:1,name:"chunk",kind:"scalar",T:12}]),Zk=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}]),ey=s.makeMessageType("viam.app.v1.SendPaymentRequiredEmailResponse",[]),ny=s.makeMessageType("viam.app.v1.GetAvailableBillingTiersRequest",[]),ay=s.makeMessageType("viam.app.v1.GetAvailableBillingTiersResponse",()=>[{no:1,name:"tiers",kind:"scalar",T:9,repeated:!0}]),ty=s.makeMessageType("viam.app.v1.UpdateOrganizationBillingTierRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"billing_tier",kind:"scalar",T:9}]),sy=s.makeMessageType("viam.app.v1.UpdateOrganizationBillingTierResponse",[]),R1=Object.freeze(Object.defineProperty({__proto__:null,GetAvailableBillingTiersRequest:ny,GetAvailableBillingTiersResponse:ay,GetCurrentMonthUsageRequest:Jk,GetCurrentMonthUsageResponse:Vk,GetInvoicePdfRequest:Xk,GetInvoicePdfResponse:Qk,GetInvoicesSummaryRequest:Hk,GetInvoicesSummaryResponse:Kk,GetOrgBillingInformationRequest:Wk,GetOrgBillingInformationResponse:jk,InvoiceSummary:Fk,PaymentMethodCard:xk,PaymentMethodType:Gk,ResourceUsageCosts:$k,ResourceUsageCostsBySource:Yk,SendPaymentRequiredEmailRequest:Zk,SendPaymentRequiredEmailResponse:ey,SourceType:Bk,UpdateOrganizationBillingTierRequest:ty,UpdateOrganizationBillingTierResponse:sy,UsageCost:zk,UsageCostType:Lk},Symbol.toStringTag,{value:"Module"})),_1={typeName:"viam.app.v1.BillingService",methods:{getCurrentMonthUsage:{name:"GetCurrentMonthUsage",I:Jk,O:Vk,kind:m.Unary},getOrgBillingInformation:{name:"GetOrgBillingInformation",I:Wk,O:jk,kind:m.Unary},getInvoicesSummary:{name:"GetInvoicesSummary",I:Hk,O:Kk,kind:m.Unary},getInvoicePdf:{name:"GetInvoicePdf",I:Xk,O:Qk,kind:m.ServerStreaming},sendPaymentRequiredEmail:{name:"SendPaymentRequiredEmail",I:Zk,O:ey,kind:m.Unary},getAvailableBillingTiers:{name:"GetAvailableBillingTiers",I:ny,O:ay,kind:m.Unary},updateOrganizationBillingTier:{name:"UpdateOrganizationBillingTier",I:ty,O:sy,kind:m.Unary}}};class S1{client;constructor(e){this.client=N(_1,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 I1(o)}}const I1=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 oy={},iy={};(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 u(y,h),h}e.serialize=c;function u(y,h,g){if(g===void 0&&(g=0),g+=k(h.length,h,g),y.constructor===Array)for(var v=0,w=y.length;v<w;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 l(y,h,g){var v=O(y),w=v.length;return h.set(v,g),h[g+w++]=0,w}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+=l(y,g,v),v;switch(h.constructor){case String:g[v++]=2,v+=l(y,g,v);var w=l(h,g,v+4);return v+=k(w,g,v),v+w;case Number:if(Math.floor(h)===h)h<=2147483647&&h>=-2147483647?(g[v++]=16,v+=l(y,g,v),v+=k(h,g,v)):(g[v++]=18,v+=l(y,g,v),g.set(_(h),v),v+=8);else{g[v++]=1,v+=l(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+=l(y,g,v),g[v++]=h?1:0,v;case Array:case Object:g[v++]=h.constructor===Array?4:3,v+=l(y,g,v);var U=u(h,g,v);return k(U-v,g,v),U;case Int8Array:case Uint8Array:return g[v++]=5,v+=l(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+=l(y,g,v),g.set(_(h.getTime()),v),v+=8,v;case o:return g[v++]=9,v+=l(y,g,v),g.set(h.buffer(),v),v+=8,v;case n:return g[v++]=5,v+=l(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+=l(y,g,v),g.set(h.buffer(),v),v+=12,v;case RegExp:return g[v++]=11,v+=l(y,g,v),v+=l(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 w=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24;if(!(w<5||w>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:w=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24,b[$]=P(y.subarray(g,g+=w-1)),g++;break;case 3:w=y[g]|y[g+1]<<8|y[g+2]<<16|y[g+3]<<24,b[$]=I(y,h,g,!1),g+=w;break;case 4:w=y[g]|y[g+1]<<8|y[g+2]<<16|y[g+3]<<24,b[$]=I(y,h,g,!0),g+=w;break;case 5:if(w=y[g++]|y[g++]<<8|y[g++]<<16|y[g++]<<24,y[g++]===4){if(w!==16)return;b[$]=new n(y.subarray(g,g+=w))}else b[$]=y.slice(g,g+=w);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 Wo=P(y.subarray(g,U));for(g=U;U<y.length&&y[U++]!==0;);if(U>=y.length)return;var jo=P(y.subarray(g,U));g=U,b[$]=new RegExp(Wo,jo);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,w=y/g|0;y<0&&(v=~(-y%g)|0,w=~(-y/g)|0,v=v+1&4294967295,v||w++);var b=0;h[b++]=v&255,h[b++]=v>>>8&255,h[b++]=v>>>16&255,h[b++]=v>>>24&255,h[b++]=w&255,h[b++]=w>>>8&255,h[b++]=w>>>16&255,h[b]=w>>>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,w=y[h++]|y[h++]<<8|y[h++]<<16|y[h]<<24;return w*g+(v>=0?v:g+v)}function O(y){y=y.replace(/\r\n/g,`
9
+ `);for(var h=[],g=0,v=0,w=y.length;v<w;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,w,b,ae;v<g;)w=y[v],w<128?(h+=String.fromCharCode(w),v++):w>191&&w<224?(b=y[v+1],h+=String.fromCharCode((w&31)<<6|b&63),v+=2):(b=y[v+1],ae=y[v+2],h+=String.fromCharCode((w&15)<<12|(b&63)<<6|ae&63),v+=3);return h}function Y(y){return encodeURI(y).split(/%..|./).length-1}}(a.BSON||(a.BSON={}))})(iy),Object.defineProperty(oy,"__esModule",{value:!0});var M1=iy,wo=oy.BSON=M1.BSON;const ry=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"}]),my=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"}]),cy=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"}]),Eo=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(ry)}]),$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:Nn},{no:14,name:"tags_filter",kind:"message",T:Oo},{no:15,name:"bbox_labels",kind:"scalar",T:9,repeated:!0},{no:16,name:"dataset_id",kind:"scalar",T:9}]),Oo=s.makeMessageType("viam.app.data.v1.TagsFilter",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(my)},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),Ea=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}]),Nn=s.makeMessageType("viam.app.data.v1.CaptureInterval",()=>[{no:1,name:"start",kind:"message",T:S},{no:2,name:"end",kind:"message",T:S}]),dy=s.makeMessageType("viam.app.data.v1.TabularDataByFilterRequest",()=>[{no:1,name:"data_request",kind:"message",T:Eo},{no:2,name:"count_only",kind:"scalar",T:8},{no:3,name:"include_internal_data",kind:"scalar",T:8}]),ly=s.makeMessageType("viam.app.data.v1.TabularDataByFilterResponse",()=>[{no:1,name:"metadata",kind:"message",T:Ea,repeated:!0},{no:2,name:"data",kind:"message",T:uy,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}]),uy=s.makeMessageType("viam.app.data.v1.TabularData",()=>[{no:1,name:"data",kind:"message",T:d},{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}]),py=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}]),gy=s.makeMessageType("viam.app.data.v1.TabularDataBySQLResponse",()=>[{no:2,name:"raw_data",kind:"scalar",T:12,repeated:!0}]),Ty=s.makeMessageType("viam.app.data.v1.TabularDataSource",()=>[{no:1,name:"type",kind:"enum",T:s.getEnumType(cy)},{no:2,name:"pipeline_id",kind:"scalar",T:9,opt:!0}]),ky=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:Ty,opt:!0}]),yy=s.makeMessageType("viam.app.data.v1.TabularDataByMQLResponse",()=>[{no:2,name:"raw_data",kind:"scalar",T:12,repeated:!0}]),vy=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:Nn}]),hy=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:d},{no:12,name:"tags",kind:"scalar",T:9,repeated:!0},{no:13,name:"payload",kind:"message",T:d}]),fy=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}]),Ry=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:d}]),Co=s.makeMessageType("viam.app.data.v1.BinaryData",()=>[{no:1,name:"binary",kind:"scalar",T:12},{no:2,name:"metadata",kind:"message",T:Ey}]),_y=s.makeMessageType("viam.app.data.v1.BinaryDataByFilterRequest",()=>[{no:1,name:"data_request",kind:"message",T:Eo},{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}]),Sy=s.makeMessageType("viam.app.data.v1.BinaryDataByFilterResponse",()=>[{no:1,name:"data",kind:"message",T:Co,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}]),le=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}]),Iy=s.makeMessageType("viam.app.data.v1.BinaryDataByIDsRequest",()=>[{no:2,name:"include_binary",kind:"scalar",T:8},{no:3,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0}]),My=s.makeMessageType("viam.app.data.v1.BinaryDataByIDsResponse",()=>[{no:1,name:"data",kind:"message",T:Co,repeated:!0},{no:2,name:"count",kind:"scalar",T:4}]),by=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}]),wy=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}]),No=s.makeMessageType("viam.app.data.v1.Annotations",()=>[{no:1,name:"bboxes",kind:"message",T:by,repeated:!0},{no:2,name:"classifications",kind:"message",T:wy,repeated:!0}]),Ey=s.makeMessageType("viam.app.data.v1.BinaryMetadata",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"capture_metadata",kind:"message",T:Ea},{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:No},{no:9,name:"dataset_ids",kind:"scalar",T:9,repeated:!0},{no:10,name:"binary_data_id",kind:"scalar",T:9}]),Oy=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}]),Cy=s.makeMessageType("viam.app.data.v1.DeleteTabularDataResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Ny=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}]),Py=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByFilterResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),Ay=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByIDsRequest",()=>[{no:2,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0}]),Dy=s.makeMessageType("viam.app.data.v1.DeleteBinaryDataByIDsResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),qy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByIDsRequest",()=>[{no:3,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),Uy=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByIDsResponse",[]),Gy=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}]),Ly=s.makeMessageType("viam.app.data.v1.AddTagsToBinaryDataByFilterResponse",[]),By=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByIDsRequest",()=>[{no:3,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:4,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"tags",kind:"scalar",T:9,repeated:!0}]),Fy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByIDsResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),xy=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}]),Jy=s.makeMessageType("viam.app.data.v1.RemoveTagsFromBinaryDataByFilterResponse",()=>[{no:1,name:"deleted_count",kind:"scalar",T:4}]),zy=s.makeMessageType("viam.app.data.v1.TagsByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e}]),Yy=s.makeMessageType("viam.app.data.v1.TagsByFilterResponse",()=>[{no:1,name:"tags",kind:"scalar",T:9,repeated:!0}]),$y=s.makeMessageType("viam.app.data.v1.AddBoundingBoxToImageByIDRequest",()=>[{no:7,name:"binary_id",kind:"message",T:le},{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}]),Vy=s.makeMessageType("viam.app.data.v1.AddBoundingBoxToImageByIDResponse",()=>[{no:1,name:"bbox_id",kind:"scalar",T:9}]),Wy=s.makeMessageType("viam.app.data.v1.RemoveBoundingBoxFromImageByIDRequest",()=>[{no:3,name:"binary_id",kind:"message",T:le},{no:4,name:"binary_data_id",kind:"scalar",T:9},{no:2,name:"bbox_id",kind:"scalar",T:9}]),jy=s.makeMessageType("viam.app.data.v1.RemoveBoundingBoxFromImageByIDResponse",[]),Hy=s.makeMessageType("viam.app.data.v1.UpdateBoundingBoxRequest",()=>[{no:1,name:"binary_id",kind:"message",T:le},{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}]),Ky=s.makeMessageType("viam.app.data.v1.UpdateBoundingBoxResponse",[]),Xy=s.makeMessageType("viam.app.data.v1.BoundingBoxLabelsByFilterRequest",()=>[{no:1,name:"filter",kind:"message",T:$e}]),Qy=s.makeMessageType("viam.app.data.v1.BoundingBoxLabelsByFilterResponse",()=>[{no:1,name:"labels",kind:"scalar",T:9,repeated:!0}]),Zy=s.makeMessageType("viam.app.data.v1.ConfigureDatabaseUserRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9},{no:2,name:"password",kind:"scalar",T:9}]),ev=s.makeMessageType("viam.app.data.v1.ConfigureDatabaseUserResponse",[]),nv=s.makeMessageType("viam.app.data.v1.GetDatabaseConnectionRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),av=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}]),tv=s.makeMessageType("viam.app.data.v1.AddBinaryDataToDatasetByIDsRequest",()=>[{no:1,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"dataset_id",kind:"scalar",T:9}]),sv=s.makeMessageType("viam.app.data.v1.AddBinaryDataToDatasetByIDsResponse",[]),ov=s.makeMessageType("viam.app.data.v1.RemoveBinaryDataFromDatasetByIDsRequest",()=>[{no:1,name:"binary_ids",kind:"message",T:le,repeated:!0},{no:3,name:"binary_data_ids",kind:"scalar",T:9,repeated:!0},{no:2,name:"dataset_id",kind:"scalar",T:9}]),iv=s.makeMessageType("viam.app.data.v1.RemoveBinaryDataFromDatasetByIDsResponse",[]),b1=Object.freeze(Object.defineProperty({__proto__:null,AddBinaryDataToDatasetByIDsRequest:tv,AddBinaryDataToDatasetByIDsResponse:sv,AddBoundingBoxToImageByIDRequest:$y,AddBoundingBoxToImageByIDResponse:Vy,AddTagsToBinaryDataByFilterRequest:Gy,AddTagsToBinaryDataByFilterResponse:Ly,AddTagsToBinaryDataByIDsRequest:qy,AddTagsToBinaryDataByIDsResponse:Uy,Annotations:No,BinaryData:Co,BinaryDataByFilterRequest:_y,BinaryDataByFilterResponse:Sy,BinaryDataByIDsRequest:Iy,BinaryDataByIDsResponse:My,BinaryID:le,BinaryMetadata:Ey,BoundingBox:by,BoundingBoxLabelsByFilterRequest:Xy,BoundingBoxLabelsByFilterResponse:Qy,CaptureInterval:Nn,CaptureMetadata:Ea,Classification:wy,ConfigureDatabaseUserRequest:Zy,ConfigureDatabaseUserResponse:ev,DataRequest:Eo,DeleteBinaryDataByFilterRequest:Ny,DeleteBinaryDataByFilterResponse:Py,DeleteBinaryDataByIDsRequest:Ay,DeleteBinaryDataByIDsResponse:Dy,DeleteTabularDataRequest:Oy,DeleteTabularDataResponse:Cy,ExportTabularDataRequest:vy,ExportTabularDataResponse:hy,Filter:$e,GetDatabaseConnectionRequest:nv,GetDatabaseConnectionResponse:av,GetLatestTabularDataRequest:fy,GetLatestTabularDataResponse:Ry,Order:ry,RemoveBinaryDataFromDatasetByIDsRequest:ov,RemoveBinaryDataFromDatasetByIDsResponse:iv,RemoveBoundingBoxFromImageByIDRequest:Wy,RemoveBoundingBoxFromImageByIDResponse:jy,RemoveTagsFromBinaryDataByFilterRequest:xy,RemoveTagsFromBinaryDataByFilterResponse:Jy,RemoveTagsFromBinaryDataByIDsRequest:By,RemoveTagsFromBinaryDataByIDsResponse:Fy,TabularData:uy,TabularDataByFilterRequest:dy,TabularDataByFilterResponse:ly,TabularDataByMQLRequest:ky,TabularDataByMQLResponse:yy,TabularDataBySQLRequest:py,TabularDataBySQLResponse:gy,TabularDataSource:Ty,TabularDataSourceType:cy,TagsByFilterRequest:zy,TagsByFilterResponse:Yy,TagsFilter:Oo,TagsFilterType:my,UpdateBoundingBoxRequest:Hy,UpdateBoundingBoxResponse:Ky},Symbol.toStringTag,{value:"Module"})),w1={typeName:"viam.app.data.v1.DataService",methods:{tabularDataByFilter:{name:"TabularDataByFilter",I:dy,O:ly,kind:m.Unary},tabularDataBySQL:{name:"TabularDataBySQL",I:py,O:gy,kind:m.Unary},tabularDataByMQL:{name:"TabularDataByMQL",I:ky,O:yy,kind:m.Unary},exportTabularData:{name:"ExportTabularData",I:vy,O:hy,kind:m.ServerStreaming},getLatestTabularData:{name:"GetLatestTabularData",I:fy,O:Ry,kind:m.Unary},binaryDataByFilter:{name:"BinaryDataByFilter",I:_y,O:Sy,kind:m.Unary},binaryDataByIDs:{name:"BinaryDataByIDs",I:Iy,O:My,kind:m.Unary},deleteTabularData:{name:"DeleteTabularData",I:Oy,O:Cy,kind:m.Unary},deleteBinaryDataByFilter:{name:"DeleteBinaryDataByFilter",I:Ny,O:Py,kind:m.Unary},deleteBinaryDataByIDs:{name:"DeleteBinaryDataByIDs",I:Ay,O:Dy,kind:m.Unary},addTagsToBinaryDataByIDs:{name:"AddTagsToBinaryDataByIDs",I:qy,O:Uy,kind:m.Unary},addTagsToBinaryDataByFilter:{name:"AddTagsToBinaryDataByFilter",I:Gy,O:Ly,kind:m.Unary},removeTagsFromBinaryDataByIDs:{name:"RemoveTagsFromBinaryDataByIDs",I:By,O:Fy,kind:m.Unary},removeTagsFromBinaryDataByFilter:{name:"RemoveTagsFromBinaryDataByFilter",I:xy,O:Jy,kind:m.Unary},tagsByFilter:{name:"TagsByFilter",I:zy,O:Yy,kind:m.Unary},addBoundingBoxToImageByID:{name:"AddBoundingBoxToImageByID",I:$y,O:Vy,kind:m.Unary},removeBoundingBoxFromImageByID:{name:"RemoveBoundingBoxFromImageByID",I:Wy,O:jy,kind:m.Unary},boundingBoxLabelsByFilter:{name:"BoundingBoxLabelsByFilter",I:Xy,O:Qy,kind:m.Unary},updateBoundingBox:{name:"UpdateBoundingBox",I:Hy,O:Ky,kind:m.Unary},getDatabaseConnection:{name:"GetDatabaseConnection",I:nv,O:av,kind:m.Unary},configureDatabaseUser:{name:"ConfigureDatabaseUser",I:Zy,O:ev,kind:m.Unary},addBinaryDataToDatasetByIDs:{name:"AddBinaryDataToDatasetByIDs",I:tv,O:sv,kind:m.Unary},removeBinaryDataFromDatasetByIDs:{name:"RemoveBinaryDataFromDatasetByIDs",I:ov,O:iv,kind:m.Unary}}},rv=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}]),E1=s.makeMessageType("viam.app.dataset.v1.CreateDatasetRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"organization_id",kind:"scalar",T:9}]),O1=s.makeMessageType("viam.app.dataset.v1.CreateDatasetResponse",()=>[{no:1,name:"id",kind:"scalar",T:9}]),C1=s.makeMessageType("viam.app.dataset.v1.DeleteDatasetRequest",()=>[{no:1,name:"id",kind:"scalar",T:9}]),N1=s.makeMessageType("viam.app.dataset.v1.DeleteDatasetResponse",[]),P1=s.makeMessageType("viam.app.dataset.v1.RenameDatasetRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}]),A1=s.makeMessageType("viam.app.dataset.v1.RenameDatasetResponse",[]),D1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByOrganizationIDRequest",()=>[{no:1,name:"organization_id",kind:"scalar",T:9}]),q1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByOrganizationIDResponse",()=>[{no:1,name:"datasets",kind:"message",T:rv,repeated:!0}]),U1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByIDsRequest",()=>[{no:1,name:"ids",kind:"scalar",T:9,repeated:!0}]),G1=s.makeMessageType("viam.app.dataset.v1.ListDatasetsByIDsResponse",()=>[{no:1,name:"datasets",kind:"message",T:rv,repeated:!0}]),L1={typeName:"viam.app.dataset.v1.DatasetService",methods:{createDataset:{name:"CreateDataset",I:E1,O:O1,kind:m.Unary},deleteDataset:{name:"DeleteDataset",I:C1,O:N1,kind:m.Unary},renameDataset:{name:"RenameDataset",I:P1,O:A1,kind:m.Unary},listDatasetsByOrganizationID:{name:"ListDatasetsByOrganizationID",I:D1,O:q1,kind:m.Unary},listDatasetsByIDs:{name:"ListDatasetsByIDs",I:U1,O:G1,kind:m.Unary}}},B1=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"}]),Po=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"}]),Ao=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:Pn},{no:2,name:"sensor_contents",kind:"message",T:qo,repeated:!0}]),F1=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}]),x1=s.makeMessageType("viam.app.datasync.v1.FileUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:Pn,oneof:"upload_packet"},{no:2,name:"file_contents",kind:"message",T:$1,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}]),z1=s.makeMessageType("viam.app.datasync.v1.StreamingDataCaptureUploadRequest",()=>[{no:1,name:"metadata",kind:"message",T:V1,oneof:"upload_packet"},{no:2,name:"data",kind:"scalar",T:12,oneof:"upload_packet"}]),Y1=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}]),Do=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(B1)},{no:4,name:"annotations",kind:"message",T:No}]),qo=s.makeMessageType("viam.app.datasync.v1.SensorData",()=>[{no:1,name:"metadata",kind:"message",T:Do},{no:2,name:"struct",kind:"message",T:d,oneof:"data"},{no:3,name:"binary",kind:"scalar",T:12,oneof:"data"}]),$1=s.makeMessageType("viam.app.datasync.v1.FileData",()=>[{no:1,name:"data",kind:"scalar",T:12}]),Pn=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(Po)},{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}]),V1=s.makeMessageType("viam.app.datasync.v1.DataCaptureUploadMetadata",()=>[{no:1,name:"upload_metadata",kind:"message",T:Pn},{no:2,name:"sensor_metadata",kind:"message",T:Do}]),W1={typeName:"viam.app.datasync.v1.DataSyncService",methods:{dataCaptureUpload:{name:"DataCaptureUpload",I:Ao,O:F1,kind:m.Unary},fileUpload:{name:"FileUpload",I:x1,O:J1,kind:m.ClientStreaming},streamingDataCaptureUpload:{name:"StreamingDataCaptureUpload",I:z1,O:Y1,kind:m.ClientStreaming}}},Ve=()=>{console.warn("The BinaryID type is deprecated and will be removed in a future release. Please migrate to the BinaryDataId field instead.")};class j1{dataClient;datasetClient;dataSyncClient;constructor(e){this.dataClient=N(w1,e),this.datasetClient=N(L1,e),this.dataSyncClient=N(W1,e)}async exportTabularData(e,n,t,o,i,r){const c=new Nn;i&&(c.start=S.fromDate(i)),r&&(c.end=S.fromDate(r));const u={partId:e,resourceName:n,resourceSubtype:t,methodName:o,interval:c},l=this.dataClient.exportTabularData(u),k=[];for await(const R of l)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=>wo.deserialize(o))}async tabularDataByMQL(e,n,t){const o=n[0]instanceof Uint8Array?n:n.map(r=>wo.serialize(r));return(await this.dataClient.tabularDataByMQL({organizationId:e,mqlBinary:o,useRecentData:t})).rawData.map(r=>wo.deserialize(r))}async tabularDataByFilter(e,n,t,o="",i=!1,r=!1){const u={dataRequest:{filter:e,limit:n===void 0?void 0:BigInt(n),sortOrder:t,last:o},countOnly:i,includeInternalData:r},l=await this.dataClient.tabularDataByFilter(u),k=l.metadata.length,R=[];return R.push(...l.data.map(I=>{const _=I.metadataIndex,M=k!==0&&_>=k?new Ea:l.metadata[_];return{data:I.data?.toJson(),metadata:M,timeRequested:I.timeRequested?.toDate(),timeReceived:I.timeRequested?.toDate()}})),{data:R,count:l.count,last:l.last}}async binaryDataByFilter(e,n,t,o="",i=!0,r=!1,c=!1){const l={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(l);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 u=new Pn({partId:n,componentType:t,componentName:o,methodName:i,type:Po.TABULAR_SENSOR,tags:c}),l=[];for(const[I,_]of e.entries()){const M=new Do,O=r[I];O&&(M.timeRequested=S.fromDate(O[0]),M.timeReceived=S.fromDate(O[1])),l.push(new qo({metadata:M,data:{case:"struct",value:d.fromJson(_)}}))}const k=new Ao({metadata:u,sensorContents:l});return(await this.dataSyncClient.dataCaptureUpload(k)).fileId}async binaryDataCaptureUpload(e,n,t,o,i,r,c,u){const l=new Pn({partId:n,componentType:t,componentName:o,methodName:i,type:Po.BINARY_SENSOR,tags:u,fileExtension:r}),k=new qo({metadata:{timeRequested:S.fromDate(c[0]),timeReceived:S.fromDate(c[1])},data:{case:"binary",value:e}}),R=new Ao({metadata:l,sensorContents:[k]});return(await this.dataSyncClient.dataCaptureUpload(R)).binaryDataId}createFilter(e){const n=new $e(e);if(e.startTime??e.endTime){const o=new Nn;e.startTime&&(o.start=S.fromDate(e.startTime)),e.endTime&&(o.end=S.fromDate(e.endTime)),n.interval=o}const t=new Oo;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()]}}const H1={typeName:"viam.app.mltraining.v1.MLTrainingService",methods:{submitTrainingJob:{name:"SubmitTrainingJob",I:Hl,O:Kl,kind:m.Unary},submitCustomTrainingJob:{name:"SubmitCustomTrainingJob",I:Xl,O:Ql,kind:m.Unary},getTrainingJob:{name:"GetTrainingJob",I:Zl,O:eu,kind:m.Unary},listTrainingJobs:{name:"ListTrainingJobs",I:nu,O:au,kind:m.Unary},cancelTrainingJob:{name:"CancelTrainingJob",I:tu,O:su,kind:m.Unary},deleteCompletedTrainingJob:{name:"DeleteCompletedTrainingJob",I:ou,O:iu,kind:m.Unary},getTrainingJobLogs:{name:"GetTrainingJobLogs",I:mu,O:cu,kind:m.Unary}}};class K1{client;constructor(e){this.client=N(H1,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 mv=s.makeMessageType("viam.provisioning.v1.GetSmartMachineStatusRequest",[]),cv=s.makeMessageType("viam.provisioning.v1.GetSmartMachineStatusResponse",()=>[{no:1,name:"provisioning_info",kind:"message",T:kv},{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:Uo},{no:5,name:"errors",kind:"scalar",T:9,repeated:!0}]),dv=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}]),lv=s.makeMessageType("viam.provisioning.v1.SetNetworkCredentialsResponse",[]),uv=s.makeMessageType("viam.provisioning.v1.SetSmartMachineCredentialsRequest",()=>[{no:1,name:"cloud",kind:"message",T:Go}]),pv=s.makeMessageType("viam.provisioning.v1.SetSmartMachineCredentialsResponse",[]),gv=s.makeMessageType("viam.provisioning.v1.GetNetworkListRequest",[]),Tv=s.makeMessageType("viam.provisioning.v1.GetNetworkListResponse",()=>[{no:1,name:"networks",kind:"message",T:Uo,repeated:!0}]),kv=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}]),Uo=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}]),Go=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}]),X1=Object.freeze(Object.defineProperty({__proto__:null,CloudConfig:Go,GetNetworkListRequest:gv,GetNetworkListResponse:Tv,GetSmartMachineStatusRequest:mv,GetSmartMachineStatusResponse:cv,NetworkInfo:Uo,ProvisioningInfo:kv,SetNetworkCredentialsRequest:dv,SetNetworkCredentialsResponse:lv,SetSmartMachineCredentialsRequest:uv,SetSmartMachineCredentialsResponse:pv},Symbol.toStringTag,{value:"Module"})),Q1={typeName:"viam.provisioning.v1.ProvisioningService",methods:{getSmartMachineStatus:{name:"GetSmartMachineStatus",I:mv,O:cv,kind:m.Unary},setNetworkCredentials:{name:"SetNetworkCredentials",I:dv,O:lv,kind:m.Unary},setSmartMachineCredentials:{name:"SetSmartMachineCredentials",I:uv,O:pv,kind:m.Unary},getNetworkList:{name:"GetNetworkList",I:gv,O:Tv,kind:m.Unary}}};class Z1{client;constructor(e){this.client=N(Q1,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 e_=async({serviceHost:a="https://app.viam.com",credentials:e})=>{const n=await TR(a,e);return new n_(n,e)};class n_{transport;credentials;dataClient;appClient;mlTrainingClient;provisioningClient;billingClient;constructor(e,n){this.transport=e,this.credentials=n,this.dataClient=new j1(this.transport),this.appClient=new f1(this.transport),this.mlTrainingClient=new K1(this.transport),this.provisioningClient=new Z1(this.transport),this.billingClient=new S1(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(u=>u.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(!Mn(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(u=>u.state===ho.ENABLED)?.secret,authEntity:t})}return jl({host:t,credentials:i,signalingAddress:"https://app.viam.com:443",reconnectMaxAttempts:1})}}const{JointPositions:a_}=Cr;class t_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Nr),this.name=n,this.options=t}async getEndPosition(e={},n=this.callOptions){const t=new ct({name:this.name,extra:d.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:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async moveToPosition(e,n={},t=this.callOptions){const o=new lt({name:this.name,to:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.moveToPosition(o,t)}async moveToJointPositions(e,n={},t=this.callOptions){const o=new mn({values:e}),i=new ut({name:this.name,positions:o,extra:d.fromJson(n)});this.options.requestLogger?.(i),await this.client.moveToJointPositions(i,t)}async getJointPositions(e={},n=this.callOptions){const t=new dt({name:this.name,extra:d.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 pt({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new gt({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{GetPropertiesResponse:s_}=Br;class o_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Fr),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async moveStraight(e,n,t={},o=this.callOptions){const i=new Tt({name:this.name,mmPerSec:n,distanceMm:e?BigInt(e):void 0,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.moveStraight(i,o)}async spin(e,n,t={},o=this.callOptions){const i=new kt({name:this.name,angleDeg:e,degsPerSec:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.spin(i,o)}async setPower(e,n,t={},o=this.callOptions){const i=new vt({name:this.name,linear:e,angular:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPower(i,o)}async setVelocity(e,n,t={},o=this.callOptions){const i=new ht({name:this.name,linear:e,angular:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setVelocity(i,o)}async stop(e={},n=this.callOptions){const t=new yt({name:this.name,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}async getProperties(e={},n=this.callOptions){const t=new ua({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}}const{ReadAnalogReaderResponse:i_,PowerMode:r_}=Zr;class m_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(em),this.name=n,this.options=t}async setGPIO(e,n,t={},o=this.callOptions){const i=new Rt({name:this.name,pin:e,high:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setGPIO(i,o)}async getGPIO(e,n={},t=this.callOptions){const o=new _t({name:this.name,pin:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getGPIO(o,t)).high}async getPWM(e,n={},t=this.callOptions){const o=new St({name:this.name,pin:e,extra:d.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 It({name:this.name,pin:e,dutyCyclePct:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPWM(i,o)}async getPWMFrequency(e,n={},t=this.callOptions){const o=new Mt({name:this.name,pin:e,extra:d.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 bt({name:this.name,pin:e,frequencyHz:n?BigInt(n):void 0,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPWMFrequency(i,o)}async readAnalogReader(e,n={},t=this.callOptions){const o=new wt({boardName:this.name,analogReaderName:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),this.client.readAnalogReader(o,t)}async writeAnalog(e,n,t={},o=this.callOptions){const i=new Et({name:this.name,pin:e,value:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.writeAnalog(i,o)}async getDigitalInterruptValue(e,n={},t=this.callOptions){const o=new Ot({boardName:this.name,digitalInterruptName:e,extra:d.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 Ct({name:this.name,pinNames:e,extra:d.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 Nt({name:this.name,powerMode:e,duration:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.setPowerMode(i,o)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const Lo=s.makeMessageType("viam.component.button.v1.PushRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),yv=s.makeMessageType("viam.component.button.v1.PushResponse",[]),c_=Object.freeze(Object.defineProperty({__proto__:null,PushRequest:Lo,PushResponse:yv},Symbol.toStringTag,{value:"Module"})),d_={typeName:"viam.component.button.v1.ButtonService",methods:{push:{name:"Push",I:Lo,O:yv,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}};class l_{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 Lo({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.push(t,n)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const u_=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}]),p_={typeName:"viam.component.camera.v1.CameraService",methods:{getImage:{name:"GetImage",I:to,O:Rl,kind:m.Unary},getImages:{name:"GetImages",I:_l,O:Sl,kind:m.Unary},renderFrame:{name:"RenderFrame",I:oo,O:u_,kind:m.Unary},getPointCloud:{name:"GetPointCloud",I:io,O:Il,kind:m.Unary},getProperties:{name:"GetProperties",I:Ml,O:bl,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},g_="pointcloud/pcd";class T_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(p_),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async getImage(e="",n={},t=this.callOptions){const o=new to({name:this.name,mimeType:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getImage(o,t)).image}async renderFrame(e="",n={},t=this.callOptions){const o=new oo({name:this.name,mimeType:e,extra:d.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 io({name:this.name,mimeType:g_,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}class k_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Cd),this.name=n,this.options=t}async discoverResources(e={},n=this.callOptions){const t=new As({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.discoverResources(t,n)).discoveries}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{GetPropertiesResponse:y_,PositionType:vv}=sm;class v_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(om),this.name=n,this.options=t}async resetPosition(e={},n=this.callOptions){const t=new Dt({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.resetPosition(t,n)}async getProperties(e={},n=this.callOptions){const t=new qt({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}async getPosition(e=vv.UNSPECIFIED,n={},t=this.callOptions){const o=new At({name:this.name,positionType:e,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}class h_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(um),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async getPosition(e={},n=this.callOptions){const t=new Ut({name:this.name,extra:d.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 Gt({name:this.name,positionsMm:e,speedsMmPerSec:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.moveToPosition(i,o)}async home(e={},n=this.callOptions){const t=new Lt({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.home(t,n)).homed}async getLengths(e={},n=this.callOptions){const t=new Bt({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getLengths(t,n)).lengthsMm}async stop(e={},n=this.callOptions){const t=new Ft({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new xt({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{Capsule:f_,GeoGeometry:R_,GeoPoint:__,GeometriesInFrame:S_,Geometry:I_,Orientation:M_,Pose:b_,PoseInFrame:w_,RectangularPrism:E_,ResourceName:O_,Sphere:C_,Transform:N_,Vector3:P_,WorldState:A_}=it,hv=a=>{const{latitude:e,longitude:n}=a;return!(typeof e!="number"||typeof n!="number"||Number.isNaN(e)||Number.isNaN(n))};class D_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Yl),this.name=n,this.options=t}async metadata(e={},n=this.callOptions){const t=new xl({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.metadata(t,n)}async infer(e,n={},t=this.callOptions){const o=new Fl({name:this.name,inputTensors:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),this.client.infer(o,t)}}class q_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Gm),this.name=n,this.options=t}async setPower(e,n={},t=this.callOptions){const o=new Ht({name:this.name,powerPct:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.setPower(o,t)}async goFor(e,n,t={},o=this.callOptions){const i=new Kt({name:this.name,rpm:e,revolutions:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.goFor(i,o)}async goTo(e,n,t={},o=this.callOptions){const i=new Xt({name:this.name,rpm:e,positionRevolutions:n,extra:d.fromJson(t)});this.options.requestLogger?.(i),await this.client.goTo(i,o)}async setRPM(e,n={},t=this.callOptions){const o=new Qt({name:this.name,rpm:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.setRPM(o,t)}async resetZeroPosition(e,n={},t=this.callOptions){const o=new Zt({name:this.name,offset:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.resetZeroPosition(o,t)}async stop(e={},n=this.callOptions){const t=new ns({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async getProperties(e={},n=this.callOptions){const t=new ts({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),{positionReporting:(await this.client.getProperties(t,n)).positionReporting}}async getPosition(e={},n=this.callOptions){const t=new es({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).position}async isPowered(e={},n=this.callOptions){const t=new as({name:this.name,extra:d.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 ss({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}class U_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Wm),this.name=n,this.options=t}async getLinearVelocity(e={},n=this.callOptions){const t=new os({name:this.name,extra:d.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 is({name:this.name,extra:d.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 rs({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getCompassHeading(t,n)).value}async getOrientation(e={},n=this.callOptions){const t=new ms({name:this.name,extra:d.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 cs({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getPosition(t,n)}async getProperties(e={},n=this.callOptions){const t=new ds({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getProperties(t,n)}async getAccuracy(e={},n=this.callOptions){const t=new ls({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),this.client.getAccuracy(t,n)}async getLinearAcceleration(e={},n=this.callOptions){const t=new us({name:this.name,extra:d.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:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}const{GetAccuracyResponse:G_,GetPositionResponse:L_,GetPropertiesResponse:B_}=Vm;class F_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Xm),this.name=n,this.options=t}async getVoltage(e={},n=this.callOptions){const t=new ps({name:this.name,extra:d.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 gs({name:this.name,extra:d.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 Ts({name:this.name,extra:d.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:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}const fv={typeName:"viam.component.sensor.v1.SensorService",methods:{getReadings:{name:"GetReadings",I:Ke,O:la,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary},getGeometries:{name:"GetGeometries",I:J,O:K,kind:m.Unary}}},x_=Object.freeze(Object.defineProperty({__proto__:null,SensorService:fv},Symbol.toStringTag,{value:"Module"}));class J_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(fv),this.name=n,this.options=t}async getReadings(e={},n=this.callOptions){const t=new Ke({name:this.name,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}const Rv=s.makeMessageType("proto.stream.v1.ListStreamsRequest",[]),_v=s.makeMessageType("proto.stream.v1.ListStreamsResponse",()=>[{no:1,name:"names",kind:"scalar",T:9,repeated:!0}]),Bo=s.makeMessageType("proto.stream.v1.AddStreamRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Sv=s.makeMessageType("proto.stream.v1.AddStreamResponse",[]),Fo=s.makeMessageType("proto.stream.v1.RemoveStreamRequest",()=>[{no:1,name:"name",kind:"scalar",T:9}]),Iv=s.makeMessageType("proto.stream.v1.RemoveStreamResponse",[]),xo=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}]),Mv=s.makeMessageType("proto.stream.v1.GetStreamOptionsResponse",()=>[{no:1,name:"resolutions",kind:"message",T:xo,repeated:!0}]),Oa=s.makeMessageType("proto.stream.v1.SetStreamOptionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"resolution",kind:"message",T:xo}]),bv=s.makeMessageType("proto.stream.v1.SetStreamOptionsResponse",[]),z_=Object.freeze(Object.defineProperty({__proto__:null,AddStreamRequest:Bo,AddStreamResponse:Sv,GetStreamOptionsRequest:Jo,GetStreamOptionsResponse:Mv,ListStreamsRequest:Rv,ListStreamsResponse:_v,RemoveStreamRequest:Fo,RemoveStreamResponse:Iv,Resolution:xo,SetStreamOptionsRequest:Oa,SetStreamOptionsResponse:bv},Symbol.toStringTag,{value:"Module"})),Y_={typeName:"proto.stream.v1.StreamService",methods:{listStreams:{name:"ListStreams",I:Rv,O:_v,kind:m.Unary},addStream:{name:"AddStream",I:Bo,O:Sv,kind:m.Unary},getStreamOptions:{name:"GetStreamOptions",I:Jo,O:Mv,kind:m.Unary},setStreamOptions:{name:"SetStreamOptions",I:Oa,O:bv,kind:m.Unary},removeStream:{name:"RemoveStream",I:Fo,O:Iv,kind:m.Unary}}},An=a=>a.replaceAll(":","+");class $_ extends fr{client;options;streams;constructor(e,n={}){super(),this.client=e.createServiceClient(Y_),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 Bo({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 Fo({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 Oa({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 Oa({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 zo=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:d}]),wv=s.makeMessageType("viam.component.switch.v1.SetPositionResponse",[]),Yo=s.makeMessageType("viam.component.switch.v1.GetPositionRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Ev=s.makeMessageType("viam.component.switch.v1.GetPositionResponse",()=>[{no:1,name:"position",kind:"scalar",T:13}]),$o=s.makeMessageType("viam.component.switch.v1.GetNumberOfPositionsRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Ov=s.makeMessageType("viam.component.switch.v1.GetNumberOfPositionsResponse",()=>[{no:1,name:"number_of_positions",kind:"scalar",T:13}]),V_=Object.freeze(Object.defineProperty({__proto__:null,GetNumberOfPositionsRequest:$o,GetNumberOfPositionsResponse:Ov,GetPositionRequest:Yo,GetPositionResponse:Ev,SetPositionRequest:zo,SetPositionResponse:wv},Symbol.toStringTag,{value:"Module"})),W_={typeName:"viam.component.switch.v1.SwitchService",methods:{setPosition:{name:"SetPosition",I:zo,O:wv,kind:m.Unary},getPosition:{name:"GetPosition",I:Yo,O:Ev,kind:m.Unary},getNumberOfPositions:{name:"GetNumberOfPositions",I:$o,O:Ov,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}};class j_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(W_),this.name=n,this.options=t}async setPosition(e,n={},t=this.callOptions){const o=new zo({name:this.name,position:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.setPosition(o,t)}async getPosition(e={},n=this.callOptions){const t=new Yo({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).position}async getNumberOfPositions(e={},n=this.callOptions){const t=new $o({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getNumberOfPositions(t,n)).numberOfPositions}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}let H_=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:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}};class K_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(ym),this.name=n,this.options=t}async getGeometries(e={},n=this.callOptions){const t=new J({name:this.name,extra:d.fromJson(e)});return(await this.client.getGeometries(t,n)).geometries}async open(e={},n=this.callOptions){const t=new zt({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.open(t,n)}async grab(e={},n=this.callOptions){const t=new Yt({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.grab(t,n)}async stop(e={},n=this.callOptions){const t=new $t({name:this.name,extra:d.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 L(this.client.doCommand,this.name,e,this.options,n)}}class X_{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(bm),this.name=n,this.options=t}async getEvents(e={},n=this.callOptions){const t=new Wt({controller:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getEvents(t,n)).events}async triggerEvent(e,n={},t=this.callOptions){const o=new jt({controller:this.name,event:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.triggerEvent(o,t)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{Event:Q_}=Mm,{CollisionSpecification:Z_,Constraints:eS,GetPlanResponse:wS,LinearConstraint:nS,ListPlanStatusesResponse:aS,MotionConfiguration:tS,ObstacleDetector:sS,OrientationConstraint:oS,PlanState:ES}=Hd;class iS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Kd),this.name=n,this.options=t}async move(e,n,t,o,i={},r=this.callOptions){const c=new Ds({name:this.name,destination:e,componentName:n,worldState:t,constraints:o,extra:d.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 u=new qs({name:this.name,destination:e,componentName:n,slamServiceName:t,motionConfiguration:o,obstacles:i,extra:d.fromJson(r)});return this.options.requestLogger?.(u),(await this.client.moveOnMap(u,c)).executionId}async moveOnGlobe(e,n,t,o,i,r,c,u={},l=this.callOptions){const k=new Gs({name:this.name,destination:e,componentName:n,movementSensorName:t,heading:o,obstacles:i,boundingRegions:c,motionConfiguration:r,extra:d.fromJson(u)});return this.options.requestLogger?.(k),(await this.client.moveOnGlobe(k,l)).executionId}async stopPlan(e,n={},t=this.callOptions){const o=new Bs({name:this.name,componentName:e,extra:d.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 xs({name:this.name,componentName:e,lastPlanOnly:n,executionId:t,extra:d.fromJson(o)});return this.options.requestLogger?.(r),this.client.getPlan(r,i)}async listPlanStatuses(e,n={},t=this.callOptions){const o=new Fs({name:this.name,onlyActivePlans:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),this.client.listPlanStatuses(o,t)}async getPose(e,n,t,o={},i=this.callOptions){const r=new Ls({name:this.name,componentName:e,destinationFrame:n,supplementalTransforms:t,extra:d.fromJson(o)});this.options.requestLogger?.(r);const u=(await this.client.getPose(r,i)).pose;if(!u)throw new Error("no pose");return u}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const Vo=s.makeMessageType("viam.service.datamanager.v1.SyncRequest",()=>[{no:1,name:"name",kind:"scalar",T:9},{no:99,name:"extra",kind:"message",T:d}]),Cv=s.makeMessageType("viam.service.datamanager.v1.SyncResponse",[]),rS=Object.freeze(Object.defineProperty({__proto__:null,SyncRequest:Vo,SyncResponse:Cv},Symbol.toStringTag,{value:"Module"})),mS={typeName:"viam.service.datamanager.v1.DataManagerService",methods:{sync:{name:"Sync",I:Vo,O:Cv,kind:m.Unary},doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}};class cS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(mS),this.name=n,this.options=t}async sync(e={},n=this.callOptions){const t=new Vo({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.sync(t,n)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}class dS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(dl),this.name=n,this.options=t}async getMode(e={},n=this.callOptions){const t=new Ys({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getMode(t,n)).mode}async setMode(e,n={},t=this.callOptions){const o=new $s({name:this.name,mode:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.setMode(o,t)}async getLocation(e={},n=this.callOptions){const t=new Vs({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t);const o=await this.client.getLocation(t,n);if(!o.location)throw new Error("no location");if(!hv(o.location))throw new Error("invalid location");return o}async getWayPoints(e={},n=this.callOptions){const t=new Ws({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getWaypoints(t,n)).waypoints}async addWayPoint(e,n={},t=this.callOptions){const o=new js({name:this.name,location:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.addWaypoint(o,t)}async removeWayPoint(e,n={},t=this.callOptions){const o=new Hs({name:this.name,id:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.removeWaypoint(o,t)}async getObstacles(e={},n=this.callOptions){const t=new Ks({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getObstacles(t,n)).obstacles}async getPaths(e={},n=this.callOptions){const t=new Xs({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPaths(t,n)).paths}async getProperties(e=this.callOptions){const n=new Qs({name:this.name});return this.options.requestLogger?.(n),this.client.getProperties(n,e)}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{GetLocationResponse:lS,GetPropertiesResponse:uS,Mode:OS,Path:pS,Waypoint:gS}=cl;class TS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(ac),this.name=n,this.options=t}async move(e,n={},t=this.callOptions){const o=new ks({name:this.name,angleDeg:e,extra:d.fromJson(n)});this.options.requestLogger?.(o),await this.client.move(o,t)}async getPosition(e={},n=this.callOptions){const t=new ys({name:this.name,extra:d.fromJson(e)});return this.options.requestLogger?.(t),(await this.client.getPosition(t,n)).positionDeg}async stop(e={},n=this.callOptions){const t=new vs({name:this.name,extra:d.fromJson(e)});this.options.requestLogger?.(t),await this.client.stop(t,n)}async isMoving(e=this.callOptions){const n=new hs({name:this.name});return this.options.requestLogger?.(n),(await this.client.isMoving(n,e)).isMoving}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}class kS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(hl),this.name=n,this.options=t}async getPosition(e=this.callOptions){const n=new Zs({name:this.name});return this.options.requestLogger?.(n),this.client.getPosition(n,e)}getPointCloudMap=async(e,n=this.callOptions)=>{const t=new eo({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 Nv(o)};getInternalState=async(e=this.callOptions)=>{const n=new no({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 Nv(t)};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 L(this.client.doCommand,this.name,e,this.options,n)}}const Nv=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:yS,GetPropertiesResponse:vS}=vl;class hS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Bl),this.name=n,this.options=t}async getDetectionsFromCamera(e,n={},t=this.callOptions){const o=new mo({name:this.name,cameraName:e,extra:d.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 ro({name:this.name,image:e,width:n?BigInt(n):void 0,height:t?BigInt(t):void 0,mimeType:o,extra:d.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 lo({name:this.name,cameraName:e,n,extra:d.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 u=new co({name:this.name,image:e,width:n,height:t,mimeType:o,n:i,extra:d.fromJson(r)});return this.options.requestLogger?.(u),(await this.client.getClassifications(u,c)).classifications}async getObjectPointClouds(e,n={},t=this.callOptions){const o=new uo({name:this.name,cameraName:e,extra:d.fromJson(n)});return this.options.requestLogger?.(o),(await this.client.getObjectPointClouds(o,t)).objects}async getProperties(e={},n=this.callOptions){const t=new po({name:this.name,extra:d.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 u=new go({name:this.name,cameraName:e,returnImage:n,returnClassifications:t,returnDetections:o,returnObjectPointClouds:i,extra:d.fromJson(r)});this.options.requestLogger?.(u);const l=await this.client.captureAllFromCamera(u,c);return{image:l.image,classifications:l.classifications,detections:l.detections,objectPointClouds:l.objects,extra:l.extra}}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const{Classification:fS,Detection:RS}=Ll,{PointCloudObject:_S}=it,Pv={typeName:"viam.service.generic.v1.GenericService",methods:{doCommand:{name:"DoCommand",I:q,O:G,kind:m.Unary}}},SS=Object.freeze(Object.defineProperty({__proto__:null,GenericService:Pv},Symbol.toStringTag,{value:"Module"}));class IS{client;name;options;callOptions={headers:{}};constructor(e,n,t={}){this.client=e.createServiceClient(Pv),this.name=n,this.options=t}async doCommand(e,n=this.callOptions){return L(this.client.doCommand,this.name,e,this.options,n)}}const MS="0.40.2";T.AnalogValue=i_,T.ArmClient=t_,T.ArmJointPositions=a_,T.BaseClient=o_,T.BaseProperties=s_,T.BoardClient=m_,T.ButtonClient=l_,T.CameraClient=T_,T.Capsule=f_,T.Classification=fS,T.Client=A,T.CloudConfig=Go,T.CollisionSpecification=Z_,T.ConnectError=C,T.ConnectionClosedError=de,T.Constraints=eS,T.DataManagerClient=cS,T.Detection=RS,T.DiscoveryClient=k_,T.Duration=F,T.EncoderClient=v_,T.EncoderPositionType=vv,T.EncoderProperties=y_,T.GantryClient=h_,T.GenericComponentClient=H_,T.GenericServiceClient=IS,T.GeoGeometry=R_,T.GeoPoint=__,T.GeometriesInFrame=S_,T.Geometry=I_,T.GripperClient=K_,T.InputControllerClient=X_,T.InputControllerEvent=Q_,T.LinearConstraint=nS,T.ListPlanStatusesResponse=aS,T.MLModelClient=D_,T.MachineConnectionEvent=ne,T.ModelType=ze,T.MotionClient=iS,T.MotionConfiguration=tS,T.MotorClient=q_,T.MovementSensorAccuracy=G_,T.MovementSensorClient=U_,T.MovementSensorPosition=L_,T.MovementSensorProperties=B_,T.NavigationClient=dS,T.NavigationPosition=lS,T.NavigationProperties=uS,T.ObstacleDetector=sS,T.Orientation=M_,T.OrientationConstraint=oS,T.Path=pS,T.PointCloudObject=_S,T.Pose=b_,T.PoseInFrame=w_,T.PowerMode=r_,T.PowerSensorClient=F_,T.RectangularPrism=E_,T.ResourceName=O_,T.RobotClient=A,T.SensorClient=J_,T.ServoClient=TS,T.SlamClient=kS,T.SlamPosition=yS,T.SlamProperties=vS,T.Sphere=C_,T.StreamClient=$_,T.Struct=d,T.SwitchClient=j_,T.Timestamp=S,T.TrainingStatus=ha,T.Transform=N_,T.Vector3=P_,T.VisionClient=hS,T.Waypoint=gS,T.WorldState=A_,T.addMetadata=pR,T.appApi=v1,T.appRobotApi=UR,T.armApi=Cr,T.baseApi=Br,T.billingApi=R1,T.boardApi=Zr,T.buttonApi=c_,T.cameraApi=BR,T.commonApi=it,T.createRobotClient=jl,T.createViamClient=e_,T.dataApi=b1,T.dataManagerApi=rS,T.deleteMetadata=gR,T.disableDebugLogging=uR,T.discoveryApi=GR,T.doCommandFromClient=L,T.enableDebugLogging=lR,T.encoderApi=sm,T.gantryApi=hR,T.genericComponentApi=fR,T.genericServiceApi=SS,T.gripperApi=RR,T.inputControllerApi=Mm,T.isValidGeoPoint=hv,T.mlTrainingApi=y1,T.motionApi=Hd,T.motorApi=SR,T.movementSensorApi=Vm,T.navigationApi=cl,T.powerSensorApi=IR,T.provisioningApi=X1,T.robotApi=wR,T.sensorApi=x_,T.servoApi=bR,T.slamApi=vl,T.streamApi=z_,T.switchApi=V_,T.version=MS,T.visionApi=Ll,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});