imio-sdk-lite 0.1.2 → 0.1.3

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.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see main.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["imio-sdk-lite"]=t():e["imio-sdk-lite"]=t()}(self,()=>(()=>{var e={33:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestChannelResponderStream=t.RequestChannelRequesterStream=void 0;var a=r(766),l=r(438),u=r(799),d=s(r(76)),h=function(){function e(e,t,r,i,n,s){this.payload=e,this.isComplete=t,this.receiver=r,this.fragmentSize=i,this.initialRequestN=n,this.leaseManager=s,this.streamType=u.FrameTypes.REQUEST_CHANNEL}return e.prototype.handleReady=function(e,t){var r,i;if(this.outboundDone)return!1;this.streamId=e,this.stream=t,t.connect(this);var n=this.isComplete;if(n&&(this.outboundDone=n),(0,l.isFragmentable)(this.payload,this.fragmentSize,u.FrameTypes.REQUEST_CHANNEL))try{for(var s=o((0,l.fragmentWithRequestN)(e,this.payload,this.fragmentSize,u.FrameTypes.REQUEST_CHANNEL,this.initialRequestN,n)),a=s.next();!a.done;a=s.next()){var d=a.value;this.stream.send(d)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.REQUEST_CHANNEL,data:this.payload.data,metadata:this.payload.metadata,requestN:this.initialRequestN,flags:(void 0!==this.payload.metadata?u.Flags.METADATA:u.Flags.NONE)|(n?u.Flags.COMPLETE:u.Flags.NONE),streamId:e});return this.hasExtension&&this.stream.send({type:u.FrameTypes.EXT,streamId:e,extendedContent:this.extendedContent,extendedType:this.extendedType,flags:this.flags}),!0},e.prototype.handleReject=function(e){this.inboundDone||(this.inboundDone=!0,this.outboundDone=!0,this.receiver.onError(e))},e.prototype.handle=function(e){var t,r=e.type;switch(r){case u.FrameTypes.PAYLOAD:var i=u.Flags.hasComplete(e.flags),n=u.Flags.hasNext(e.flags);if(i||!u.Flags.hasFollows(e.flags)){if(i&&(this.inboundDone=!0,this.outboundDone&&this.stream.disconnect(this),!n))return void this.receiver.onComplete();var s=this.hasFragments?d.reassemble(this,e.data,e.metadata):{data:e.data,metadata:e.metadata};return void this.receiver.onNext(s,i)}if(d.add(this,e.data,e.metadata))return;t="Unexpected frame size";break;case u.FrameTypes.CANCEL:if(this.outboundDone)return;return this.outboundDone=!0,this.inboundDone&&this.stream.disconnect(this),void this.receiver.cancel();case u.FrameTypes.REQUEST_N:if(this.outboundDone)return;if(this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.request(e.requestN);case u.FrameTypes.ERROR:var o=this.outboundDone;return this.inboundDone=!0,this.outboundDone=!0,this.stream.disconnect(this),d.cancel(this),o||this.receiver.cancel(),void this.receiver.onError(new a.RSocketError(e.code,e.message));case u.FrameTypes.EXT:return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));default:t="Unexpected frame type [".concat(r,"]")}this.close(new a.RSocketError(a.ErrorCodes.CANCELED,t)),this.stream.send({type:u.FrameTypes.CANCEL,streamId:this.streamId,flags:u.Flags.NONE}),this.stream.disconnect(this)},e.prototype.request=function(e){this.inboundDone||(this.streamId?this.stream.send({type:u.FrameTypes.REQUEST_N,flags:u.Flags.NONE,requestN:e,streamId:this.streamId}):this.initialRequestN+=e)},e.prototype.cancel=function(){var e,t=this.inboundDone,r=this.outboundDone;t&&r||(this.inboundDone=!0,this.outboundDone=!0,r||this.receiver.cancel(),this.streamId?(this.stream.send({type:t?u.FrameTypes.ERROR:u.FrameTypes.CANCEL,flags:u.Flags.NONE,streamId:this.streamId,code:a.ErrorCodes.CANCELED,message:"Cancelled"}),this.stream.disconnect(this),d.cancel(this)):null===(e=this.leaseManager)||void 0===e||e.cancelRequest(this))},e.prototype.onNext=function(e,t){var r,i;if(!this.outboundDone)if(t&&(this.outboundDone=!0,this.inboundDone&&this.stream.disconnect(this)),(0,l.isFragmentable)(e,this.fragmentSize,u.FrameTypes.PAYLOAD))try{for(var n=o((0,l.fragment)(this.streamId,e,this.fragmentSize,u.FrameTypes.PAYLOAD,t)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.PAYLOAD,streamId:this.streamId,flags:u.Flags.NEXT|(e.metadata?u.Flags.METADATA:u.Flags.NONE)|(t?u.Flags.COMPLETE:u.Flags.NONE),data:e.data,metadata:e.metadata})},e.prototype.onComplete=function(){this.streamId?this.outboundDone||(this.outboundDone=!0,this.stream.send({type:u.FrameTypes.PAYLOAD,streamId:this.streamId,flags:u.Flags.COMPLETE,data:null,metadata:null}),this.inboundDone&&this.stream.disconnect(this)):this.isComplete=!0},e.prototype.onError=function(e){if(!this.outboundDone){var t=this.inboundDone;this.outboundDone=!0,this.inboundDone=!0,this.stream.send({type:u.FrameTypes.ERROR,streamId:this.streamId,flags:u.Flags.NONE,code:e instanceof a.RSocketError?e.code:a.ErrorCodes.APPLICATION_ERROR,message:e.message}),this.stream.disconnect(this),t||this.receiver.onError(e)}},e.prototype.onExtension=function(e,t,r){if(!this.outboundDone)return this.streamId?void this.stream.send({streamId:this.streamId,type:u.FrameTypes.EXT,extendedType:e,extendedContent:t,flags:r?u.Flags.IGNORE:u.Flags.NONE}):(this.hasExtension=!0,this.extendedType=e,this.extendedContent=t,void(this.flags=r?u.Flags.IGNORE:u.Flags.NONE))},e.prototype.close=function(e){if(!this.inboundDone||!this.outboundDone){var t=this.inboundDone,r=this.outboundDone;this.inboundDone=!0,this.outboundDone=!0,d.cancel(this),r||this.receiver.cancel(),t||(e?this.receiver.onError(e):this.receiver.onComplete())}},e}();t.RequestChannelRequesterStream=h;var c=function(){function e(e,t,r,i,n){if(this.streamId=e,this.stream=t,this.fragmentSize=r,this.handler=i,this.streamType=u.FrameTypes.REQUEST_CHANNEL,t.connect(this),u.Flags.hasFollows(n.flags))return d.add(this,n.data,n.metadata),this.initialRequestN=n.requestN,void(this.isComplete=u.Flags.hasComplete(n.flags));var s={data:n.data,metadata:n.metadata},o=u.Flags.hasComplete(n.flags);this.inboundDone=o;try{this.receiver=i(s,n.requestN,o,this),this.outboundDone&&this.defferedError&&this.receiver.onError(this.defferedError)}catch(e){this.outboundDone&&!this.inboundDone?this.cancel():this.inboundDone=!0,this.onError(e)}}return e.prototype.handle=function(e){var t,r=e.type;switch(r){case u.FrameTypes.PAYLOAD:if(u.Flags.hasFollows(e.flags)){if(d.add(this,e.data,e.metadata))return;t="Unexpected frame size";break}var i=this.hasFragments?d.reassemble(this,e.data,e.metadata):{data:e.data,metadata:e.metadata},n=u.Flags.hasComplete(e.flags);if(this.receiver){if(n&&(this.inboundDone=!0,this.outboundDone&&this.stream.disconnect(this),!u.Flags.hasNext(e.flags)))return void this.receiver.onComplete();this.receiver.onNext(i,n)}else{(s=this.isComplete||n)&&(this.inboundDone=!0,this.outboundDone&&this.stream.disconnect(this));try{this.receiver=this.handler(i,this.initialRequestN,s,this),this.outboundDone&&this.defferedError}catch(l){this.outboundDone&&!this.inboundDone?this.cancel():this.inboundDone=!0,this.onError(l)}}return;case u.FrameTypes.REQUEST_N:if(!this.receiver||this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.request(e.requestN);case u.FrameTypes.ERROR:case u.FrameTypes.CANCEL:var s=this.inboundDone,o=this.outboundDone;if(this.inboundDone=!0,this.outboundDone=!0,this.stream.disconnect(this),d.cancel(this),!this.receiver)return;if(o||this.receiver.cancel(),!s){var l=r===u.FrameTypes.CANCEL?new a.RSocketError(a.ErrorCodes.CANCELED,"Cancelled"):new a.RSocketError(e.code,e.message);this.receiver.onError(l)}return;case u.FrameTypes.EXT:if(!this.receiver||this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));default:t="Unexpected frame type [".concat(r,"]")}this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:a.ErrorCodes.CANCELED,message:t,streamId:this.streamId}),this.stream.disconnect(this),this.close(new a.RSocketError(a.ErrorCodes.CANCELED,t))},e.prototype.onError=function(e){if(this.outboundDone)console.warn("Trying to error for the second time. ".concat(e?"Dropping error [".concat(e,"]."):""));else{var t=this.inboundDone;this.outboundDone=!0,this.inboundDone=!0,this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:e instanceof a.RSocketError?e.code:a.ErrorCodes.APPLICATION_ERROR,message:e.message,streamId:this.streamId}),this.stream.disconnect(this),t||(this.receiver?this.receiver.onError(e):this.defferedError=e)}},e.prototype.onNext=function(e,t){var r,i;if(!this.outboundDone){if(t&&(this.outboundDone=!0),(0,l.isFragmentable)(e,this.fragmentSize,u.FrameTypes.PAYLOAD))try{for(var n=o((0,l.fragment)(this.streamId,e,this.fragmentSize,u.FrameTypes.PAYLOAD,t)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.NEXT|(t?u.Flags.COMPLETE:u.Flags.NONE)|(e.metadata?u.Flags.METADATA:u.Flags.NONE),data:e.data,metadata:e.metadata,streamId:this.streamId});t&&this.inboundDone&&this.stream.disconnect(this)}},e.prototype.onComplete=function(){this.outboundDone||(this.outboundDone=!0,this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.COMPLETE,streamId:this.streamId,data:null,metadata:null}),this.inboundDone&&this.stream.disconnect(this))},e.prototype.onExtension=function(e,t,r){this.outboundDone&&this.inboundDone||this.stream.send({type:u.FrameTypes.EXT,streamId:this.streamId,flags:r?u.Flags.IGNORE:u.Flags.NONE,extendedType:e,extendedContent:t})},e.prototype.request=function(e){this.inboundDone||this.stream.send({type:u.FrameTypes.REQUEST_N,flags:u.Flags.NONE,streamId:this.streamId,requestN:e})},e.prototype.cancel=function(){this.inboundDone||(this.inboundDone=!0,this.stream.send({type:u.FrameTypes.CANCEL,flags:u.Flags.NONE,streamId:this.streamId}),this.outboundDone&&this.stream.disconnect(this))},e.prototype.close=function(e){if(this.inboundDone&&this.outboundDone)console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):""));else{var t=this.inboundDone,r=this.outboundDone;this.inboundDone=!0,this.outboundDone=!0,d.cancel(this);var i=this.receiver;i&&(r||i.cancel(),t||(e?i.onError(e):i.onComplete()))}},e}();t.RequestChannelResponderStream=c},34:function(e,t){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.WellKnownMimeType=void 0;var i=function(){function e(e,t){this.string=e,this.identifier=t}return e.fromIdentifier=function(t){return t<0||t>127?e.UNPARSEABLE_MIME_TYPE:e.TYPES_BY_MIME_ID[t]},e.fromString=function(t){if(!t)throw new Error("type must be non-null");return t===e.UNKNOWN_RESERVED_MIME_TYPE.string?e.UNPARSEABLE_MIME_TYPE:e.TYPES_BY_MIME_STRING.get(t)||e.UNPARSEABLE_MIME_TYPE},e.prototype.toString=function(){return this.string},e}();t.WellKnownMimeType=i,function(e){var t,i;e.UNPARSEABLE_MIME_TYPE=new e("UNPARSEABLE_MIME_TYPE_DO_NOT_USE",-2),e.UNKNOWN_RESERVED_MIME_TYPE=new e("UNKNOWN_YET_RESERVED_DO_NOT_USE",-1),e.APPLICATION_AVRO=new e("application/avro",0),e.APPLICATION_CBOR=new e("application/cbor",1),e.APPLICATION_GRAPHQL=new e("application/graphql",2),e.APPLICATION_GZIP=new e("application/gzip",3),e.APPLICATION_JAVASCRIPT=new e("application/javascript",4),e.APPLICATION_JSON=new e("application/json",5),e.APPLICATION_OCTET_STREAM=new e("application/octet-stream",6),e.APPLICATION_PDF=new e("application/pdf",7),e.APPLICATION_THRIFT=new e("application/vnd.apache.thrift.binary",8),e.APPLICATION_PROTOBUF=new e("application/vnd.google.protobuf",9),e.APPLICATION_XML=new e("application/xml",10),e.APPLICATION_ZIP=new e("application/zip",11),e.AUDIO_AAC=new e("audio/aac",12),e.AUDIO_MP3=new e("audio/mp3",13),e.AUDIO_MP4=new e("audio/mp4",14),e.AUDIO_MPEG3=new e("audio/mpeg3",15),e.AUDIO_MPEG=new e("audio/mpeg",16),e.AUDIO_OGG=new e("audio/ogg",17),e.AUDIO_OPUS=new e("audio/opus",18),e.AUDIO_VORBIS=new e("audio/vorbis",19),e.IMAGE_BMP=new e("image/bmp",20),e.IMAGE_GIG=new e("image/gif",21),e.IMAGE_HEIC_SEQUENCE=new e("image/heic-sequence",22),e.IMAGE_HEIC=new e("image/heic",23),e.IMAGE_HEIF_SEQUENCE=new e("image/heif-sequence",24),e.IMAGE_HEIF=new e("image/heif",25),e.IMAGE_JPEG=new e("image/jpeg",26),e.IMAGE_PNG=new e("image/png",27),e.IMAGE_TIFF=new e("image/tiff",28),e.MULTIPART_MIXED=new e("multipart/mixed",29),e.TEXT_CSS=new e("text/css",30),e.TEXT_CSV=new e("text/csv",31),e.TEXT_HTML=new e("text/html",32),e.TEXT_PLAIN=new e("text/plain",33),e.TEXT_XML=new e("text/xml",34),e.VIDEO_H264=new e("video/H264",35),e.VIDEO_H265=new e("video/H265",36),e.VIDEO_VP8=new e("video/VP8",37),e.APPLICATION_HESSIAN=new e("application/x-hessian",38),e.APPLICATION_JAVA_OBJECT=new e("application/x-java-object",39),e.APPLICATION_CLOUDEVENTS_JSON=new e("application/cloudevents+json",40),e.MESSAGE_RSOCKET_MIMETYPE=new e("message/x.rsocket.mime-type.v0",122),e.MESSAGE_RSOCKET_ACCEPT_MIMETYPES=new e("message/x.rsocket.accept-mime-types.v0",123),e.MESSAGE_RSOCKET_AUTHENTICATION=new e("message/x.rsocket.authentication.v0",124),e.MESSAGE_RSOCKET_TRACING_ZIPKIN=new e("message/x.rsocket.tracing-zipkin.v0",125),e.MESSAGE_RSOCKET_ROUTING=new e("message/x.rsocket.routing.v0",126),e.MESSAGE_RSOCKET_COMPOSITE_METADATA=new e("message/x.rsocket.composite-metadata.v0",127),e.TYPES_BY_MIME_ID=new Array(128),e.TYPES_BY_MIME_STRING=new Map;var n=[e.UNPARSEABLE_MIME_TYPE,e.UNKNOWN_RESERVED_MIME_TYPE,e.APPLICATION_AVRO,e.APPLICATION_CBOR,e.APPLICATION_GRAPHQL,e.APPLICATION_GZIP,e.APPLICATION_JAVASCRIPT,e.APPLICATION_JSON,e.APPLICATION_OCTET_STREAM,e.APPLICATION_PDF,e.APPLICATION_THRIFT,e.APPLICATION_PROTOBUF,e.APPLICATION_XML,e.APPLICATION_ZIP,e.AUDIO_AAC,e.AUDIO_MP3,e.AUDIO_MP4,e.AUDIO_MPEG3,e.AUDIO_MPEG,e.AUDIO_OGG,e.AUDIO_OPUS,e.AUDIO_VORBIS,e.IMAGE_BMP,e.IMAGE_GIG,e.IMAGE_HEIC_SEQUENCE,e.IMAGE_HEIC,e.IMAGE_HEIF_SEQUENCE,e.IMAGE_HEIF,e.IMAGE_JPEG,e.IMAGE_PNG,e.IMAGE_TIFF,e.MULTIPART_MIXED,e.TEXT_CSS,e.TEXT_CSV,e.TEXT_HTML,e.TEXT_PLAIN,e.TEXT_XML,e.VIDEO_H264,e.VIDEO_H265,e.VIDEO_VP8,e.APPLICATION_HESSIAN,e.APPLICATION_JAVA_OBJECT,e.APPLICATION_CLOUDEVENTS_JSON,e.MESSAGE_RSOCKET_MIMETYPE,e.MESSAGE_RSOCKET_ACCEPT_MIMETYPES,e.MESSAGE_RSOCKET_AUTHENTICATION,e.MESSAGE_RSOCKET_TRACING_ZIPKIN,e.MESSAGE_RSOCKET_ROUTING,e.MESSAGE_RSOCKET_COMPOSITE_METADATA];e.TYPES_BY_MIME_ID.fill(e.UNKNOWN_RESERVED_MIME_TYPE);try{for(var s=r(n),o=s.next();!o.done;o=s.next()){var a=o.value;a.identifier>=0&&(e.TYPES_BY_MIME_ID[a.identifier]=a,e.TYPES_BY_MIME_STRING.set(a.string,a))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}Object.seal&&Object.seal(e.TYPES_BY_MIME_ID)}(i=t.WellKnownMimeType||(t.WellKnownMimeType={})),t.WellKnownMimeType=i},76:(e,t,r)=>{"use strict";var i=r(287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.cancel=t.reassemble=t.add=void 0,t.add=function(e,t,r){return e.hasFragments?(e.data=e.data?i.concat([e.data,t]):t,e.metadata&&r&&(e.metadata=i.concat([e.metadata,r])),!0):(e.hasFragments=!0,e.data=t,r&&(e.metadata=r),!0)},t.reassemble=function(e,t,r){e.hasFragments=!1;var n=e.data?i.concat([e.data,t]):t;if(e.data=void 0,e.metadata){var s=r?i.concat([e.metadata,r]):e.metadata;return e.metadata=void 0,{data:n,metadata:s}}return{data:n}},t.cancel=function(e){e.hasFragments=!1,e.data=void 0,e.metadata=void 0}},92:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},147:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((i=i.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RSocketConnector=void 0;var s=r(698),o=r(799),a=r(923),l=r(366),u=function(){function e(e){this.config=e}return e.prototype.connect=function(){var e,t,r,u,d,h,c,p,f,m,g,y,v,b,I,E,w,S,M,k;return i(this,void 0,void 0,function(){var F,T,R,A,C,O,N,x,_,D=this;return n(this,function(L){switch(L.label){case 0:return F=this.config,T={type:o.FrameTypes.SETUP,dataMimeType:null!==(t=null===(e=F.setup)||void 0===e?void 0:e.dataMimeType)&&void 0!==t?t:"application/octet-stream",metadataMimeType:null!==(u=null===(r=F.setup)||void 0===r?void 0:r.metadataMimeType)&&void 0!==u?u:"application/octet-stream",keepAlive:null!==(h=null===(d=F.setup)||void 0===d?void 0:d.keepAlive)&&void 0!==h?h:6e4,lifetime:null!==(p=null===(c=F.setup)||void 0===c?void 0:c.lifetime)&&void 0!==p?p:3e5,metadata:null===(m=null===(f=F.setup)||void 0===f?void 0:f.payload)||void 0===m?void 0:m.metadata,data:null===(y=null===(g=F.setup)||void 0===g?void 0:g.payload)||void 0===y?void 0:y.data,resumeToken:null!==(b=null===(v=F.resume)||void 0===v?void 0:v.tokenGenerator())&&void 0!==b?b:null,streamId:0,majorVersion:1,minorVersion:0,flags:((null===(E=null===(I=F.setup)||void 0===I?void 0:I.payload)||void 0===E?void 0:E.metadata)?o.Flags.METADATA:o.Flags.NONE)|(F.lease?o.Flags.LEASE:o.Flags.NONE)|(F.resume?o.Flags.RESUME_ENABLE:o.Flags.NONE)},[4,F.transport.connect(function(e){return F.resume?new s.ResumableClientServerInputMultiplexerDemultiplexer(s.StreamIdGenerator.create(-1),e,e,new l.FrameStore,T.resumeToken.toString(),function(e,t){return i(D,void 0,void 0,function(){var r,i,a;return n(this,function(n){switch(n.label){case 0:return r=function(r){return r.send({type:o.FrameTypes.RESUME,streamId:0,flags:o.Flags.NONE,clientPosition:t.firstAvailableFramePosition,serverPosition:t.lastReceivedFramePosition,majorVersion:T.minorVersion,minorVersion:T.majorVersion,resumeToken:T.resumeToken}),new s.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer(r,r,e)},i=-1,[4,(a=function(){return i++,F.resume.reconnectFunction(i).then(function(){return F.transport.connect(r).catch(a)})})()];case 1:return n.sent(),[2]}})})}):new s.ClientServerInputMultiplexerDemultiplexer(s.StreamIdGenerator.create(-1),e,e)})];case 1:return R=L.sent(),A=new a.KeepAliveSender(R.multiplexerDemultiplexer.connectionOutbound,T.keepAlive),C=new a.KeepAliveHandler(R,T.lifetime),O=F.lease?new a.LeaseHandler(null!==(w=F.lease.maxPendingRequests)&&void 0!==w?w:256,R.multiplexerDemultiplexer):void 0,N=null!==(S=F.responder)&&void 0!==S?S:{},x=new a.DefaultConnectionFrameHandler(R,C,A,O,N),_=new a.DefaultStreamRequestHandler(N,0),R.onClose(function(e){A.close(),C.close(),x.close(e)}),R.multiplexerDemultiplexer.connectionInbound(x),R.multiplexerDemultiplexer.handleRequestStream(_),R.multiplexerDemultiplexer.connectionOutbound.send(T),C.start(),A.start(),[2,new a.RSocketRequester(R,null!==(k=null===(M=F.fragmentation)||void 0===M?void 0:M.maxOutboundFragmentSize)&&void 0!==k?k:0,O)]}})})},e}();t.RSocketConnector=u},170:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},225:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(974),t),n(r(288),t),n(r(546),t),n(r(766),t),n(r(799),t),n(r(170),t),n(r(147),t),n(r(777),t),n(r(92),t)},251:(e,t)=>{t.read=function(e,t,r,i,n){var s,o,a=8*n-i-1,l=(1<<a)-1,u=l>>1,d=-7,h=r?n-1:0,c=r?-1:1,p=e[t+h];for(h+=c,s=p&(1<<-d)-1,p>>=-d,d+=a;d>0;s=256*s+e[t+h],h+=c,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=i;d>0;o=256*o+e[t+h],h+=c,d-=8);if(0===s)s=1-u;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=u}return(p?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,r,i,n,s){var o,a,l,u=8*s-n-1,d=(1<<u)-1,h=d>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=d):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?c/l:c*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=d?(a=0,o=d):o+h>=1?(a=(t*l-1)*Math.pow(2,n),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;e[r+p]=255&a,p+=f,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;e[r+p]=255&o,p+=f,o/=256,u-=8);e[r+p-f]|=128*m}},279:function(e,t,r){"use strict";var i=r(287).hp,n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.WellKnownMimeTypeEntry=t.ReservedMimeTypeEntry=t.ExplicitMimeTimeEntry=t.decodeCompositeMetadata=t.encodeWellKnownMetadataHeader=t.encodeCustomMetadataHeader=t.decodeMimeTypeFromMimeBuffer=t.decodeMimeAndContentBuffersSlices=t.encodeAndAddWellKnownMetadata=t.encodeAndAddCustomMetadata=t.encodeCompositeMetadata=t.CompositeMetadata=void 0;var a=r(225),l=r(34),u=function(){function e(e){this._buffer=e}return e.prototype.iterator=function(){return g(this._buffer)},e.prototype[Symbol.iterator]=function(){return g(this._buffer)},e}();function d(e,t,r){return i.concat([e,f(t,r.byteLength),r])}function h(e,t,r){var n;return n=Number.isInteger(t)?t:t.identifier,i.concat([e,m(n,r.byteLength),r])}function c(e,t){var r,i=e.readInt8(t),n=t;if((i&E)===E)r=e.slice(n,n+1),n+=1;else{var s=1+(255&i);if(!(e.byteLength>n+s))throw new Error("Metadata is malformed. Inappropriately formed Mime Length");r=e.slice(n,n+s+1),n+=s+1}if(e.byteLength>=n+3){var o=(0,a.readUInt24BE)(e,n);if(n+=3,e.byteLength>=o+n)return[r,e.slice(n,n+o)];throw new Error("Metadata is malformed. Inappropriately formed Metadata Length or malformed content")}throw new Error("Metadata is malformed. Metadata Length is absent or malformed")}function p(e){if(e.length<2)throw new Error("Unable to decode explicit MIME type");return e.toString("ascii",1)}function f(e,t){var r=i.allocUnsafe(4+e.length);r.fill(0);var n=r.write(e,1);if(!function(e){for(var t=!0,r=1,i=e.length;r<i;r++)if(e[r]>127){t=!1;break}return t}(r))throw new Error("Custom mime type must be US_ASCII characters only");if(n<1||n>128)throw new Error("Custom mime type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128");return r.writeUInt8(n-1),(0,a.writeUInt24BE)(r,t,n+1),r}function m(e,t){var r=i.allocUnsafe(4);return r.writeUInt8(e|E),(0,a.writeUInt24BE)(r,t,1),r}function g(e){var t,r,i,s,o,a,u,d;return n(this,function(n){switch(n.label){case 0:t=e.byteLength,r=0,n.label=1;case 1:if(!(r<t))return[3,7];if(i=c(e,r),s=i[0],f=o=i[1],r=r+s.byteLength+3+f.byteLength,I(s))return[3,3];if(!(a=p(s)))throw new Error("MIME type cannot be null");return[4,new y(o,a)];case 2:return n.sent(),[3,1];case 3:return u=I(h=s)?h.readInt8()&w:l.WellKnownMimeType.UNPARSEABLE_MIME_TYPE.identifier,d=l.WellKnownMimeType.fromIdentifier(u),l.WellKnownMimeType.UNKNOWN_RESERVED_MIME_TYPE!==d?[3,5]:[4,new v(o,u)];case 4:return n.sent(),[3,1];case 5:return[4,new b(o,d)];case 6:return n.sent(),[3,1];case 7:return[2]}var h,f})}t.CompositeMetadata=u,t.encodeCompositeMetadata=function(e){var t,r,n=i.allocUnsafe(0);try{for(var a=s(e),u=a.next();!u.done;u=a.next()){var c=o(u.value,2),p=c[0],f=c[1],m="function"==typeof f?f():f;n=p instanceof l.WellKnownMimeType||"number"==typeof p||"WellKnownMimeType"===p.constructor.name?h(n,p,m):d(n,p,m)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return n},t.encodeAndAddCustomMetadata=d,t.encodeAndAddWellKnownMetadata=h,t.decodeMimeAndContentBuffersSlices=c,t.decodeMimeTypeFromMimeBuffer=p,t.encodeCustomMetadataHeader=f,t.encodeWellKnownMetadataHeader=m,t.decodeCompositeMetadata=g;var y=function(e,t){this.content=e,this.type=t};t.ExplicitMimeTimeEntry=y;var v=function(){function e(e,t){this.content=e,this.type=t}return Object.defineProperty(e.prototype,"mimeType",{get:function(){},enumerable:!1,configurable:!0}),e}();t.ReservedMimeTypeEntry=v;var b=function(){function e(e,t){this.content=e,this.type=t}return Object.defineProperty(e.prototype,"mimeType",{get:function(){return this.type.string},enumerable:!1,configurable:!0}),e}();function I(e){return 1===e.byteLength}t.WellKnownMimeTypeEntry=b;var E=128,w=127},287:(e,t,r)=>{"use strict";const i=r(526),n=r(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=l,t.IS=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let i=a(r);const n=i.write(e,t);return n!==r&&(i=i.slice(0,n)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,r);const n=function(e){if(l.isBuffer(e)){const t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?a(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return d(e),a(e<0?0:0|f(e))}function c(e){const t=e.length<0?0:0|f(e.length),r=a(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(i,l.prototype),i}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return i?-1:K(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return F(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function y(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,i,n){let s,o=1,a=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){let i=-1;for(s=r;s<a;s++)if(u(e,s)===u(t,-1===i?0:s-i)){if(-1===i&&(i=s),s-i+1===l)return i*o}else-1!==i&&(s-=s-i),i=-1}else for(r+l>a&&(r=a-l),s=r;s>=0;s--){let r=!0;for(let i=0;i<l;i++)if(u(e,s+i)!==u(t,i)){r=!1;break}if(r)return s}return-1}function I(e,t,r,i){r=Number(r)||0;const n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;const s=t.length;let o;for(i>s/2&&(i=s/2),o=0;o<i;++o){const i=parseInt(t.substr(2*o,2),16);if(J(i))return o;e[r+o]=i}return o}function E(e,t,r,i){return Y(K(t,e.length-r),e,r,i)}function w(e,t,r,i){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function S(e,t,r,i){return Y(H(t),e,r,i)}function M(e,t,r,i){return Y(function(e,t){let r,i,n;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}(t,e.length-r),e,r,i)}function k(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function F(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n<r;){const t=e[n];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(n+o<=r){let r,i,a,l;switch(o){case 1:t<128&&(s=t);break;case 2:r=e[n+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(s=l));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(l=(15&t)<<12|(63&r)<<6|63&i,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:r=e[n+1],i=e[n+2],a=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&a,l>65535&&l<1114112&&(s=l))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),n+=o}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=T));return r}(i)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return d(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(X(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,s=Math.min(r,i);n<s;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const i=l.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if(X(t,Uint8Array))n+t.length>i.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(i,n)):Uint8Array.prototype.set.call(i,t,n);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?F(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(e,t,r,i,n){if(X(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0);const a=Math.min(s,o),u=this.slice(i,n),d=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==d[e]){s=u[e],o=d[e];break}return s<o?-1:o<s?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},l.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return I(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function R(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function A(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function C(e,t,r){const i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=Z[e[i]];return n}function O(e,t,r){const i=e.slice(t,r);let n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,i,n,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function _(e,t,r,i,n){z(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function D(e,t,r,i,n){z(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function L(e,t,r,i,n,s){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(e,t,r,i,s){return t=+t,r>>>=0,s||L(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function U(e,t,r,i,s){return t=+t,r>>>=0,s||L(e,0,r,8),n.write(e,t,r,i,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,l.prototype),i},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return i},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Q(function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))}),l.prototype.readBigUInt64BE=Q(function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=t,n=1,s=this[e+--i];for(;i>0&&(n*=256);)s+=this[e+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*t)),s},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Q(function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),l.prototype.readBigInt64BE=Q(function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||x(this,e,t,r,Math.pow(2,8*r)-1,0);let n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||x(this,e,t,r,Math.pow(2,8*r)-1,0);let n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Q(function(e,t=0){return _(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Q(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=0,s=1,o=0;for(this[t]=255&e;++n<r&&(s*=256);)e<0&&0===o&&0!==this[t+n-1]&&(o=1),this[t+n]=(e/s|0)-o&255;return t+r},l.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[t+n]=255&e;--n>=0&&(s*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/s|0)-o&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Q(function(e,t=0){return _(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Q(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,r){return P(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return P(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,i){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);const n=i-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,i):Uint8Array.prototype.set.call(e,this.subarray(r,i),t),n},l.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const s=l.isBuffer(e)?e:l.from(e,i),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=s[n%o]}return this};const j={};function B(e,t,r){j[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function z(e,t,r,i,n,s){if(e>r||e<t){const i="bigint"==typeof t?"n":"";let n;throw n=s>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new j.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(i,n,s)}function G(e,t){if("number"!=typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw G(e,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),B("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),B("ERR_OUT_OF_RANGE",function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=W(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=W(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i},RangeError);const q=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const i=e.length;let n=null;const s=[];for(let o=0;o<i;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function H(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function Q(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},318:function(e,t,r){"use strict";var i,n=r(287).hp,s=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketDuplexConnection=void 0;var o=r(225),a=function(e){function t(t,r,i){var s=e.call(this)||this;return s.websocket=t,s.deserializer=r,s.handleClosed=function(e){s.close(new Error(e.reason||"WebsocketDuplexConnection: Socket closed unexpectedly."))},s.handleError=function(e){s.close(e.error)},s.handleMessage=function(e){try{var t=n.from(e.data),r=s.deserializer.deserializeFrame(t);s.multiplexerDemultiplexer.handle(r)}catch(e){s.close(e)}},t.addEventListener("close",s.handleClosed),t.addEventListener("error",s.handleError),t.addEventListener("message",s.handleMessage),s.multiplexerDemultiplexer=i(s),s}return s(t,e),Object.defineProperty(t.prototype,"availability",{get:function(){return this.done?0:1},enumerable:!1,configurable:!0}),t.prototype.close=function(t){this.done||(this.websocket.removeEventListener("close",this.handleClosed),this.websocket.removeEventListener("error",this.handleError),this.websocket.removeEventListener("message",this.handleMessage),this.websocket.close(),delete this.websocket),e.prototype.close.call(this,t)},t.prototype.send=function(e){if(!this.done){var t=(0,o.serializeFrame)(e);this.websocket.send(t)}},t}(o.Deferred);t.WebsocketDuplexConnection=a},320:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestFnfResponderStream=t.RequestFnFRequesterStream=void 0;var a=r(766),l=r(438),u=r(799),d=s(r(76)),h=function(){function e(e,t,r,i){this.payload=e,this.receiver=t,this.fragmentSize=r,this.leaseManager=i,this.streamType=u.FrameTypes.REQUEST_FNF}return e.prototype.handleReady=function(e,t){var r,i;if(this.done)return!1;if(this.streamId=e,(0,l.isFragmentable)(this.payload,this.fragmentSize,u.FrameTypes.REQUEST_FNF))try{for(var n=o((0,l.fragment)(e,this.payload,this.fragmentSize,u.FrameTypes.REQUEST_FNF)),s=n.next();!s.done;s=n.next()){var a=s.value;t.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else t.send({type:u.FrameTypes.REQUEST_FNF,data:this.payload.data,metadata:this.payload.metadata,flags:this.payload.metadata?u.Flags.METADATA:0,streamId:e});return this.done=!0,this.receiver.onComplete(),!0},e.prototype.handleReject=function(e){this.done||(this.done=!0,this.receiver.onError(e))},e.prototype.cancel=function(){var e;this.done||(this.done=!0,null===(e=this.leaseManager)||void 0===e||e.cancelRequest(this))},e.prototype.handle=function(e){e.type!=u.FrameTypes.ERROR?this.close(new a.RSocketError(a.ErrorCodes.CANCELED,"Received invalid frame")):this.close(new a.RSocketError(e.code,e.message))},e.prototype.close=function(e){this.done?console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):e?this.receiver.onError(e):this.receiver.onComplete()},e}();t.RequestFnFRequesterStream=h;var c=function(){function e(e,t,r,i){if(this.streamId=e,this.stream=t,this.handler=r,this.streamType=u.FrameTypes.REQUEST_FNF,u.Flags.hasFollows(i.flags))return d.add(this,i.data,i.metadata),void t.connect(this);var n={data:i.data,metadata:i.metadata};try{this.cancellable=r(n,this)}catch(e){}}return e.prototype.handle=function(e){var t;if(e.type==u.FrameTypes.PAYLOAD){if(!u.Flags.hasFollows(e.flags)){this.stream.disconnect(this);var r=d.reassemble(this,e.data,e.metadata);try{this.cancellable=this.handler(r,this)}catch(e){}return}if(d.add(this,e.data,e.metadata))return;t="Unexpected fragment size"}else t="Unexpected frame type [".concat(e.type,"]");this.done=!0,e.type!=u.FrameTypes.CANCEL&&e.type!=u.FrameTypes.ERROR&&this.stream.send({type:u.FrameTypes.ERROR,streamId:this.streamId,flags:u.Flags.NONE,code:a.ErrorCodes.CANCELED,message:t}),this.stream.disconnect(this),d.cancel(this)},e.prototype.close=function(e){var t;this.done?console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(this.done=!0,d.cancel(this),null===(t=this.cancellable)||void 0===t||t.cancel())},e.prototype.onError=function(e){},e.prototype.onComplete=function(){},e}();t.RequestFnfResponderStream=c},339:function(e,t,r){var i="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){e!=Array.prototype&&e!=Object.prototype&&(e[t]=r.value)},n="undefined"!=typeof window&&window===this?this:void 0!==r.g&&null!=r.g?r.g:this;function s(){s=function(){},n.Symbol||(n.Symbol=l)}function o(e,t){this.a=e,i(this,"description",{configurable:!0,writable:!0,value:t})}o.prototype.toString=function(){return this.a};var a,l=(a=0,function e(t){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new o("jscomp_symbol_"+(t||"")+"_"+a++,t)});function u(){s();var e=n.Symbol.iterator;e||(e=n.Symbol.iterator=n.Symbol("Symbol.iterator")),"function"!=typeof Array.prototype[e]&&i(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return function(e){return u(),(e={next:e})[n.Symbol.iterator]=function(){return this},e}(function(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}(this))}}),u=function(){}}!function(e,t){if(t){var r=n;e=e.split(".");for(var s=0;s<e.length-1;s++){var o=e[s];o in r||(r[o]={}),r=r[o]}(t=t(s=r[e=e[e.length-1]]))!=s&&null!=t&&i(r,e,{configurable:!0,writable:!0,value:t})}}("Array.prototype.entries",function(e){return e||function(){return function(e,t){u(),e instanceof String&&(e+="");var r=0,i={next:function(){if(r<e.length){var n=r++;return{value:t(n,e[n]),done:!1}}return i.next=function(){return{done:!0,value:void 0}},i.next()}};return i[Symbol.iterator]=function(){return i},i}(this,function(e,t){return[e,t]})}});var d=this||self;function h(e,t,r){e=e.split("."),r=r||d,e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(var i;e.length&&(i=e.shift());)e.length||void 0===t?r=r[i]&&r[i]!==Object.prototype[i]?r[i]:r[i]={}:r[i]=t}function c(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var r=Object.prototype.toString.call(e);if("[object Window]"==r)return"object";if("[object Array]"==r||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==r||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t}function p(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var f="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),m=Array.prototype.forEach?function(e,t){Array.prototype.forEach.call(e,t,void 0)}:function(e,t){for(var r=e.length,i="string"==typeof e?e.split(""):e,n=0;n<r;n++)n in i&&t.call(void 0,i[n],n,e)},g=Array.prototype.map?function(e,t){return Array.prototype.map.call(e,t,void 0)}:function(e,t){for(var r=e.length,i=Array(r),n="string"==typeof e?e.split(""):e,s=0;s<r;s++)s in n&&(i[s]=t.call(void 0,n[s],s,e));return i};function y(e,t,r){return 2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,r)}function v(e,t,r,i){var n="Assertion failed";if(r){n+=": "+r;var s=i}else e&&(n+=": "+e,s=t);throw Error(n,s||[])}function b(e,t,r){for(var i=[],n=2;n<arguments.length;++n)i[n-2]=arguments[n];return e||v("",null,t,i),e}function I(e,t){for(var r=[],i=1;i<arguments.length;++i)r[i-1]=arguments[i];throw Error("Failure"+(e?": "+e:""),r)}function E(e,t,r,i){for(var n=[],s=3;s<arguments.length;++s)n[s-3]=arguments[s];e instanceof t||v("Expected instanceof %s but got %s.",[w(t),w(e)],r,n)}function w(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):null===e?"null":typeof e}function S(e,t){if(this.c=e,this.b=t,this.a={},this.arrClean=!0,0<this.c.length){for(e=0;e<this.c.length;e++){var r=(t=this.c[e])[0];this.a[r.toString()]=new T(r,t[1])}this.arrClean=!0}}function M(e){this.a=0,this.b=e}function k(e,t){return e.b?(t.a||(t.a=new e.b(t.value)),t.a):t.value}function F(e){e=e.a;var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}function T(e,t){this.key=e,this.value=t,this.a=void 0}function R(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",r=0;r<e.length;r+=8192)t+=String.fromCharCode.apply(null,y(e,r,r+8192));return t}h("jspb.Map",S,void 0),S.prototype.g=function(){if(this.arrClean){if(this.b){var e,t=this.a;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e].a;r&&r.g()}}}else{for(this.c.length=0,(t=F(this)).sort(),e=0;e<t.length;e++){var i=this.a[t[e]];(r=i.a)&&r.g(),this.c.push([i.key,i.value])}this.arrClean=!0}return this.c},S.prototype.toArray=S.prototype.g,S.prototype.Mc=function(e,t){for(var r=this.g(),i=[],n=0;n<r.length;n++){var s=this.a[r[n][0].toString()];k(this,s);var o=s.a;o?(b(t),i.push([s.key,t(e,o)])):i.push([s.key,s.value])}return i},S.prototype.toObject=S.prototype.Mc,S.fromObject=function(e,t,r){t=new S([],t);for(var i=0;i<e.length;i++){var n=e[i][0],s=r(e[i][1]);t.set(n,s)}return t},M.prototype.next=function(){return this.a<this.b.length?{done:!1,value:this.b[this.a++]}:{done:!0,value:void 0}},"undefined"!=typeof Symbol&&(M.prototype[Symbol.iterator]=function(){return this}),S.prototype.Jb=function(){return F(this).length},S.prototype.getLength=S.prototype.Jb,S.prototype.clear=function(){this.a={},this.arrClean=!1},S.prototype.clear=S.prototype.clear,S.prototype.Cb=function(e){e=e.toString();var t=this.a.hasOwnProperty(e);return delete this.a[e],this.arrClean=!1,t},S.prototype.del=S.prototype.Cb,S.prototype.Eb=function(){var e=[],t=F(this);t.sort();for(var r=0;r<t.length;r++){var i=this.a[t[r]];e.push([i.key,i.value])}return e},S.prototype.getEntryList=S.prototype.Eb,S.prototype.entries=function(){var e=[],t=F(this);t.sort();for(var r=0;r<t.length;r++){var i=this.a[t[r]];e.push([i.key,k(this,i)])}return new M(e)},S.prototype.entries=S.prototype.entries,S.prototype.keys=function(){var e=[],t=F(this);t.sort();for(var r=0;r<t.length;r++)e.push(this.a[t[r]].key);return new M(e)},S.prototype.keys=S.prototype.keys,S.prototype.values=function(){var e=[],t=F(this);t.sort();for(var r=0;r<t.length;r++)e.push(k(this,this.a[t[r]]));return new M(e)},S.prototype.values=S.prototype.values,S.prototype.forEach=function(e,t){var r=F(this);r.sort();for(var i=0;i<r.length;i++){var n=this.a[r[i]];e.call(t,k(this,n),n.key,this)}},S.prototype.forEach=S.prototype.forEach,S.prototype.set=function(e,t){var r=new T(e);return this.b?(r.a=t,r.value=t.g()):r.value=t,this.a[e.toString()]=r,this.arrClean=!1,this},S.prototype.set=S.prototype.set,S.prototype.get=function(e){if(e=this.a[e.toString()])return k(this,e)},S.prototype.get=S.prototype.get,S.prototype.has=function(e){return e.toString()in this.a},S.prototype.has=S.prototype.has,S.prototype.Jc=function(e,t,r,i,n){var s=F(this);s.sort();for(var o=0;o<s.length;o++){var a=this.a[s[o]];t.Va(e),r.call(t,1,a.key),this.b?i.call(t,2,k(this,a),n):i.call(t,2,a.value),t.Ya()}},S.prototype.serializeBinary=S.prototype.Jc,S.deserializeBinary=function(e,t,r,i,n,s,o){for(;t.oa()&&!t.bb();){var a=t.c;1==a?s=r.call(t):2==a&&(e.b?(b(n),o||(o=new e.b),i.call(t,o,n)):o=i.call(t))}b(null!=s),b(null!=o),e.set(s,o)};var A={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},C={"'":"\\'"},O={},N=null;function x(e,t){void 0===t&&(t=0),D(),t=O[t];for(var r=[],i=0;i<e.length;i+=3){var n=e[i],s=i+1<e.length,o=s?e[i+1]:0,a=i+2<e.length,l=a?e[i+2]:0,u=n>>2;n=(3&n)<<4|o>>4,o=(15&o)<<2|l>>6,l&=63,a||(l=64,s||(o=64)),r.push(t[u],t[n],t[o]||"",t[l]||"")}return r.join("")}function _(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):-1!="=.".indexOf(e[t-1])&&(r=-1!="=.".indexOf(e[t-2])?r-2:r-1);var i=new Uint8Array(r),n=0;return function(e,t){function r(t){for(;i<e.length;){var r=e.charAt(i++),n=N[r];if(null!=n)return n;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return t}D();for(var i=0;;){var n=r(-1),s=r(0),o=r(64),a=r(64);if(64===a&&-1===n)break;t(n<<2|s>>4),64!=o&&(t(s<<4&240|o>>2),64!=a&&t(o<<6&192|a))}}(e,function(e){i[n++]=e}),i.subarray(0,n)}function D(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var i=e.concat(t[r].split(""));O[r]=i;for(var n=0;n<i.length;n++){var s=i[n];void 0===N[s]&&(N[s]=n)}}}}h("jspb.ConstBinaryMessage",function(){},void 0),h("jspb.BinaryMessage",function(){},void 0),h("jspb.BinaryConstants.FieldType",{yb:-1,ee:1,FLOAT:2,ke:3,te:4,je:5,xb:6,wb:7,BOOL:8,re:9,ie:10,le:11,ce:12,se:13,ge:14,me:15,ne:16,oe:17,pe:18,he:30,ve:31},void 0),h("jspb.BinaryConstants.WireType",{yb:-1,ue:0,xb:1,de:2,qe:3,fe:4,wb:5},void 0),h("jspb.BinaryConstants.FieldTypeToWireType",function(e){switch(e){case 5:case 3:case 13:case 4:case 17:case 18:case 8:case 14:case 31:return 0;case 1:case 6:case 16:case 30:return 1;case 9:case 11:case 12:return 2;case 2:case 7:case 15:return 5;default:return-1}},void 0),h("jspb.BinaryConstants.INVALID_FIELD_NUMBER",-1,void 0),h("jspb.BinaryConstants.FLOAT32_EPS",1401298464324817e-60,void 0),h("jspb.BinaryConstants.FLOAT32_MIN",11754943508222875e-54,void 0),h("jspb.BinaryConstants.FLOAT32_MAX",34028234663852886e22,void 0),h("jspb.BinaryConstants.FLOAT64_EPS",5e-324,void 0),h("jspb.BinaryConstants.FLOAT64_MIN",22250738585072014e-324,void 0),h("jspb.BinaryConstants.FLOAT64_MAX",17976931348623157e292,void 0),h("jspb.BinaryConstants.TWO_TO_20",1048576,void 0),h("jspb.BinaryConstants.TWO_TO_23",8388608,void 0),h("jspb.BinaryConstants.TWO_TO_31",2147483648,void 0),h("jspb.BinaryConstants.TWO_TO_32",4294967296,void 0),h("jspb.BinaryConstants.TWO_TO_52",4503599627370496,void 0),h("jspb.BinaryConstants.TWO_TO_63",0x8000000000000000,void 0),h("jspb.BinaryConstants.TWO_TO_64",0x10000000000000000,void 0),h("jspb.BinaryConstants.ZERO_HASH","\0\0\0\0\0\0\0\0",void 0);var L=0,P=0;function U(e){var t=e>>>0;e=Math.floor((e-t)/4294967296)>>>0,L=t,P=e}function j(e){var t=0>e,r=(e=Math.abs(e))>>>0;e=Math.floor((e-r)/4294967296),e>>>=0,t&&(e=~e>>>0,4294967295<(r=(~r>>>0)+1)&&(r=0,4294967295<++e&&(e=0))),L=r,P=e}function B(e){var t=0>e;U(e=2*Math.abs(e)),e=L;var r=P;t&&(0==e?0==r?r=e=4294967295:(r--,e=4294967295):e--),L=e,P=r}function W(e){var t=0>e?1:0;if(0===(e=t?-e:e))0<1/e?L=P=0:(P=0,L=2147483648);else if(isNaN(e))P=0,L=2147483647;else if(34028234663852886e22<e)P=0,L=(t<<31|2139095040)>>>0;else if(11754943508222875e-54>e)e=Math.round(e/Math.pow(2,-149)),P=0,L=(t<<31|e)>>>0;else{var r=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-r),16777216<=(e=Math.round(8388608*e))&&++r,P=0,L=(t<<31|r+127<<23|8388607&e)>>>0}}function z(e){var t=0>e?1:0;if(0===(e=t?-e:e))P=0<1/e?0:2147483648,L=0;else if(isNaN(e))P=2147483647,L=4294967295;else if(17976931348623157e292<e)P=(t<<31|2146435072)>>>0,L=0;else if(22250738585072014e-324>e)e/=Math.pow(2,-1074),P=(t<<31|e/4294967296)>>>0,L=e>>>0;else{var r=e,i=0;if(2<=r)for(;2<=r&&1023>i;)i++,r/=2;else for(;1>r&&-1022<i;)r*=2,i--;e*=Math.pow(2,-i),P=(t<<31|i+1023<<20|1048576*e&1048575)>>>0,L=4503599627370496*e>>>0}}function G(e){var t=e.charCodeAt(4),r=e.charCodeAt(5),i=e.charCodeAt(6),n=e.charCodeAt(7);L=e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)>>>0,P=t+(r<<8)+(i<<16)+(n<<24)>>>0}function V(e,t){return 4294967296*t+(e>>>0)}function q(e,t){var r=2147483648&t;return r&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=V(e,t),r?-e:e}function K(e,t,r){var i=t>>31;return r(e<<1^i,(t<<1|e>>>31)^i)}function H(e,t){return Y(e,t,q)}function Y(e,t,r){var i=-(1&e);return r((e>>>1|t<<31)^i,t>>>1^i)}function X(e){var t=2*(e>>31)+1,r=e>>>23&255;return e&=8388607,255==r?e?NaN:1/0*t:0==r?t*Math.pow(2,-149)*e:t*Math.pow(2,r-150)*(e+Math.pow(2,23))}function J(e,t){var r=2*(t>>31)+1,i=t>>>20&2047;return e=4294967296*(1048575&t)+e,2047==i?e?NaN:1/0*r:0==i?r*Math.pow(2,-1074)*e:r*Math.pow(2,i-1075)*(e+4503599627370496)}function Z(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)}function Q(e,t){function r(e,t){return e=e?String(e):"",t?"0000000".slice(e.length)+e:e}if(2097151>=t)return""+V(e,t);var i=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*i+6710656*(t=t>>16&65535),i+=8147497*t,t*=2,1e7<=e&&(i+=Math.floor(e/1e7),e%=1e7),1e7<=i&&(t+=Math.floor(i/1e7),i%=1e7),r(t,0)+r(i,t)+r(e,1)}function $(e,t){var r=2147483648&t;return r&&(t=~t+(0==(e=1+~e>>>0)?1:0)>>>0),e=Q(e,t),r?"-"+e:e}function ee(e,t){G(e),e=L;var r=P;return t?$(e,r):Q(e,r)}function te(e){function t(e,t){for(var r=0;8>r&&(1!==e||0<t);r++)t=e*i[r]+t,i[r]=255&t,t>>>=8}b(0<e.length);var r=!1;"-"===e[0]&&(r=!0,e=e.slice(1));for(var i=[0,0,0,0,0,0,0,0],n=0;n<e.length;n++)t(10,e.charCodeAt(n)-48);return r&&(function(){for(var e=0;8>e;e++)i[e]=255&~i[e]}(),t(1,1)),R(i)}function re(e){return String.fromCharCode(10>e?48+e:87+e)}function ie(e){return 97<=e?e-97+10:e-48}function ne(e,t,r,i,n){var s=0;if(128>i)for(;t<r&&e[t++]==i;)s++,t+=n;else for(;t<r;){for(var o=i;128<o;){if(e[t++]!=(127&o|128))return s;o>>=7}if(e[t++]!=o)break;s++,t+=n}return s}function se(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?_(e):e instanceof Uint8Array?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):(I("Type not convertible to Uint8Array."),new Uint8Array(0))}function oe(e,t,r){this.b=null,this.a=this.c=this.h=0,this.v=!1,e&&this.H(e,t,r)}h("jspb.utils.getSplit64Low",function(){return L},void 0),h("jspb.utils.getSplit64High",function(){return P},void 0),h("jspb.utils.splitUint64",U,void 0),h("jspb.utils.splitInt64",j,void 0),h("jspb.utils.splitZigzag64",B,void 0),h("jspb.utils.splitFloat32",W,void 0),h("jspb.utils.splitFloat64",z,void 0),h("jspb.utils.splitHash64",G,void 0),h("jspb.utils.joinUint64",V,void 0),h("jspb.utils.joinInt64",q,void 0),h("jspb.utils.toZigzag64",K,void 0),h("jspb.utils.joinZigzag64",H,void 0),h("jspb.utils.fromZigzag64",Y,void 0),h("jspb.utils.joinFloat32",X,void 0),h("jspb.utils.joinFloat64",J,void 0),h("jspb.utils.joinHash64",Z,void 0),h("jspb.utils.DIGITS","0123456789abcdef".split(""),void 0),h("jspb.utils.joinUnsignedDecimalString",Q,void 0),h("jspb.utils.joinSignedDecimalString",$,void 0),h("jspb.utils.hash64ToDecimalString",ee,void 0),h("jspb.utils.hash64ArrayToDecimalStrings",function(e,t){for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=ee(e[i],t);return r},void 0),h("jspb.utils.decimalStringToHash64",te,void 0),h("jspb.utils.splitDecimalString",function(e){G(te(e))},void 0),h("jspb.utils.hash64ToHexString",function(e){var t=Array(18);t[0]="0",t[1]="x";for(var r=0;8>r;r++){var i=e.charCodeAt(7-r);t[2*r+2]=re(i>>4),t[2*r+3]=re(15&i)}return t.join("")},void 0),h("jspb.utils.hexStringToHash64",function(e){b(18==(e=e.toLowerCase()).length),b("0"==e[0]),b("x"==e[1]);for(var t="",r=0;8>r;r++)t=String.fromCharCode(16*ie(e.charCodeAt(2*r+2))+ie(e.charCodeAt(2*r+3)))+t;return t},void 0),h("jspb.utils.hash64ToNumber",function(e,t){G(e),e=L;var r=P;return t?q(e,r):V(e,r)},void 0),h("jspb.utils.numberToHash64",function(e){return j(e),Z(L,P)},void 0),h("jspb.utils.countVarints",function(e,t,r){for(var i=0,n=t;n<r;n++)i+=e[n]>>7;return r-t-i},void 0),h("jspb.utils.countVarintFields",function(e,t,r,i){var n=0;if(128>(i*=8))for(;t<r&&e[t++]==i;)for(n++;;){var s=e[t++];if(!(128&s))break}else for(;t<r;){for(s=i;128<s;){if(e[t]!=(127&s|128))return n;t++,s>>=7}if(e[t++]!=s)break;for(n++;128&(s=e[t++]););}return n},void 0),h("jspb.utils.countFixed32Fields",function(e,t,r,i){return ne(e,t,r,8*i+5,4)},void 0),h("jspb.utils.countFixed64Fields",function(e,t,r,i){return ne(e,t,r,8*i+1,8)},void 0),h("jspb.utils.countDelimitedFields",function(e,t,r,i){var n=0;for(i=8*i+2;t<r;){for(var s=i;128<s;){if(e[t++]!=(127&s|128))return n;s>>=7}if(e[t++]!=s)break;n++;for(var o=0,a=1;o+=(127&(s=e[t++]))*a,a*=128,128&s;);t+=o}return n},void 0),h("jspb.utils.debugBytesToTextFormat",function(e){var t='"';if(e){e=se(e);for(var r=0;r<e.length;r++)t+="\\x",16>e[r]&&(t+="0"),t+=e[r].toString(16)}return t+'"'},void 0),h("jspb.utils.debugScalarToTextFormat",function(e){if("string"==typeof e){e=String(e);for(var t=['"'],r=0;r<e.length;r++){var i,n=e.charAt(r),s=n.charCodeAt(0),o=r+1;(i=A[n])||(31<s&&127>s||((s=n)in C?n=C[s]:s in A?n=C[s]=A[s]:(31<(i=s.charCodeAt(0))&&127>i?n=s:(256>i?(n="\\x",(16>i||256<i)&&(n+="0")):(n="\\u",4096>i&&(n+="0")),n+=i.toString(16).toUpperCase()),n=C[s]=n)),i=n),t[o]=i}t.push('"'),e=t.join("")}else e=e.toString();return e},void 0),h("jspb.utils.stringToByteArray",function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++){var i=e.charCodeAt(r);if(255<i)throw Error("Conversion error: string contains codepoint outside of byte range");t[r]=i}return t},void 0),h("jspb.utils.byteSourceToUint8Array",se,void 0),h("jspb.BinaryDecoder",oe,void 0);var ae=[];function le(e,t,r){if(ae.length){var i=ae.pop();return e&&i.H(e,t,r),i}return new oe(e,t,r)}function ue(e,t,r){this.a=le(e,t,r),this.O=this.a.B(),this.b=this.c=-1,this.h=!1,this.v=null}oe.getInstanceCacheLength=function(){return ae.length},oe.alloc=le,oe.prototype.Ca=function(){this.clear(),100>ae.length&&ae.push(this)},oe.prototype.free=oe.prototype.Ca,oe.prototype.clone=function(){return le(this.b,this.h,this.c-this.h)},oe.prototype.clone=oe.prototype.clone,oe.prototype.clear=function(){this.b=null,this.a=this.c=this.h=0,this.v=!1},oe.prototype.clear=oe.prototype.clear,oe.prototype.Y=function(){return this.b},oe.prototype.getBuffer=oe.prototype.Y,oe.prototype.H=function(e,t,r){this.b=se(e),this.h=void 0!==t?t:0,this.c=void 0!==r?this.h+r:this.b.length,this.a=this.h},oe.prototype.setBlock=oe.prototype.H,oe.prototype.Db=function(){return this.c},oe.prototype.getEnd=oe.prototype.Db,oe.prototype.setEnd=function(e){this.c=e},oe.prototype.setEnd=oe.prototype.setEnd,oe.prototype.reset=function(){this.a=this.h},oe.prototype.reset=oe.prototype.reset,oe.prototype.B=function(){return this.a},oe.prototype.getCursor=oe.prototype.B,oe.prototype.Ma=function(e){this.a=e},oe.prototype.setCursor=oe.prototype.Ma,oe.prototype.advance=function(e){this.a+=e,b(this.a<=this.c)},oe.prototype.advance=oe.prototype.advance,oe.prototype.ya=function(){return this.a==this.c},oe.prototype.atEnd=oe.prototype.ya,oe.prototype.Qb=function(){return this.a>this.c},oe.prototype.pastEnd=oe.prototype.Qb,oe.prototype.getError=function(){return this.v||0>this.a||this.a>this.c},oe.prototype.getError=oe.prototype.getError,oe.prototype.w=function(e){for(var t=128,r=0,i=0,n=0;4>n&&128<=t;n++)r|=(127&(t=this.b[this.a++]))<<7*n;if(128<=t&&(r|=(127&(t=this.b[this.a++]))<<28,i|=(127&t)>>4),128<=t)for(n=0;5>n&&128<=t;n++)i|=(127&(t=this.b[this.a++]))<<7*n+3;if(128>t)return e(r>>>0,i>>>0);I("Failed to read varint, encoding is invalid."),this.v=!0},oe.prototype.readSplitVarint64=oe.prototype.w,oe.prototype.ea=function(e){return this.w(function(t,r){return Y(t,r,e)})},oe.prototype.readSplitZigzagVarint64=oe.prototype.ea,oe.prototype.ta=function(e){var t=this.b,r=this.a;this.a+=8;for(var i=0,n=0,s=r+7;s>=r;s--)i=i<<8|t[s],n=n<<8|t[s+4];return e(i,n)},oe.prototype.readSplitFixed64=oe.prototype.ta,oe.prototype.kb=function(){for(;128&this.b[this.a];)this.a++;this.a++},oe.prototype.skipVarint=oe.prototype.kb,oe.prototype.mb=function(e){for(;128<e;)this.a--,e>>>=7;this.a--},oe.prototype.unskipVarint=oe.prototype.mb,oe.prototype.o=function(){var e=this.b,t=e[this.a],r=127&t;return 128>t?(this.a+=1,b(this.a<=this.c),r):(r|=(127&(t=e[this.a+1]))<<7,128>t?(this.a+=2,b(this.a<=this.c),r):(r|=(127&(t=e[this.a+2]))<<14,128>t?(this.a+=3,b(this.a<=this.c),r):(r|=(127&(t=e[this.a+3]))<<21,128>t?(this.a+=4,b(this.a<=this.c),r):(r|=(15&(t=e[this.a+4]))<<28,128>t?(this.a+=5,b(this.a<=this.c),r>>>0):(this.a+=5,128<=e[this.a++]&&128<=e[this.a++]&&128<=e[this.a++]&&128<=e[this.a++]&&128<=e[this.a++]&&b(!1),b(this.a<=this.c),r)))))},oe.prototype.readUnsignedVarint32=oe.prototype.o,oe.prototype.da=function(){return~~this.o()},oe.prototype.readSignedVarint32=oe.prototype.da,oe.prototype.O=function(){return this.o().toString()},oe.prototype.Ea=function(){return this.da().toString()},oe.prototype.readSignedVarint32String=oe.prototype.Ea,oe.prototype.Ia=function(){var e=this.o();return e>>>1^-(1&e)},oe.prototype.readZigzagVarint32=oe.prototype.Ia,oe.prototype.Ga=function(){return this.w(V)},oe.prototype.readUnsignedVarint64=oe.prototype.Ga,oe.prototype.Ha=function(){return this.w(Q)},oe.prototype.readUnsignedVarint64String=oe.prototype.Ha,oe.prototype.sa=function(){return this.w(q)},oe.prototype.readSignedVarint64=oe.prototype.sa,oe.prototype.Fa=function(){return this.w($)},oe.prototype.readSignedVarint64String=oe.prototype.Fa,oe.prototype.Ja=function(){return this.w(H)},oe.prototype.readZigzagVarint64=oe.prototype.Ja,oe.prototype.fb=function(){return this.ea(Z)},oe.prototype.readZigzagVarintHash64=oe.prototype.fb,oe.prototype.Ka=function(){return this.ea($)},oe.prototype.readZigzagVarint64String=oe.prototype.Ka,oe.prototype.Gc=function(){var e=this.b[this.a];return this.a+=1,b(this.a<=this.c),e},oe.prototype.readUint8=oe.prototype.Gc,oe.prototype.Ec=function(){var e=this.b[this.a],t=this.b[this.a+1];return this.a+=2,b(this.a<=this.c),e|t<<8},oe.prototype.readUint16=oe.prototype.Ec,oe.prototype.m=function(){var e=this.b[this.a],t=this.b[this.a+1],r=this.b[this.a+2],i=this.b[this.a+3];return this.a+=4,b(this.a<=this.c),(e|t<<8|r<<16|i<<24)>>>0},oe.prototype.readUint32=oe.prototype.m,oe.prototype.ga=function(){return V(this.m(),this.m())},oe.prototype.readUint64=oe.prototype.ga,oe.prototype.ha=function(){return Q(this.m(),this.m())},oe.prototype.readUint64String=oe.prototype.ha,oe.prototype.Xb=function(){var e=this.b[this.a];return this.a+=1,b(this.a<=this.c),e<<24>>24},oe.prototype.readInt8=oe.prototype.Xb,oe.prototype.Vb=function(){var e=this.b[this.a],t=this.b[this.a+1];return this.a+=2,b(this.a<=this.c),(e|t<<8)<<16>>16},oe.prototype.readInt16=oe.prototype.Vb,oe.prototype.P=function(){var e=this.b[this.a],t=this.b[this.a+1],r=this.b[this.a+2],i=this.b[this.a+3];return this.a+=4,b(this.a<=this.c),e|t<<8|r<<16|i<<24},oe.prototype.readInt32=oe.prototype.P,oe.prototype.ba=function(){return q(this.m(),this.m())},oe.prototype.readInt64=oe.prototype.ba,oe.prototype.ca=function(){return $(this.m(),this.m())},oe.prototype.readInt64String=oe.prototype.ca,oe.prototype.aa=function(){return X(this.m())},oe.prototype.readFloat=oe.prototype.aa,oe.prototype.Z=function(){return J(this.m(),this.m())},oe.prototype.readDouble=oe.prototype.Z,oe.prototype.pa=function(){return!!this.b[this.a++]},oe.prototype.readBool=oe.prototype.pa,oe.prototype.ra=function(){return this.da()},oe.prototype.readEnum=oe.prototype.ra,oe.prototype.fa=function(e){var t=this.b,r=this.a;e=r+e;for(var i=[],n="";r<e;){var s=t[r++];if(128>s)i.push(s);else{if(192>s)continue;if(224>s){var o=t[r++];i.push((31&s)<<6|63&o)}else if(240>s){o=t[r++];var a=t[r++];i.push((15&s)<<12|(63&o)<<6|63&a)}else 248>s&&(s=(7&s)<<18|(63&(o=t[r++]))<<12|(63&(a=t[r++]))<<6|63&t[r++],s-=65536,i.push(55296+(s>>10&1023),56320+(1023&s)))}8192<=i.length&&(n+=String.fromCharCode.apply(null,i),i.length=0)}return n+=R(i),this.a=r,n},oe.prototype.readString=oe.prototype.fa,oe.prototype.Dc=function(){var e=this.o();return this.fa(e)},oe.prototype.readStringWithLength=oe.prototype.Dc,oe.prototype.qa=function(e){if(0>e||this.a+e>this.b.length)return this.v=!0,I("Invalid byte length!"),new Uint8Array(0);var t=this.b.subarray(this.a,this.a+e);return this.a+=e,b(this.a<=this.c),t},oe.prototype.readBytes=oe.prototype.qa,oe.prototype.ia=function(){return this.w(Z)},oe.prototype.readVarintHash64=oe.prototype.ia,oe.prototype.$=function(){var e=this.b,t=this.a,r=e[t],i=e[t+1],n=e[t+2],s=e[t+3],o=e[t+4],a=e[t+5],l=e[t+6];return e=e[t+7],this.a+=8,String.fromCharCode(r,i,n,s,o,a,l,e)},oe.prototype.readFixedHash64=oe.prototype.$,h("jspb.BinaryReader",ue,void 0);var de=[];function he(e,t,r){if(de.length){var i=de.pop();return e&&i.a.H(e,t,r),i}return new ue(e,t,r)}function ce(e,t){b(2==e.b);var r=e.a.o();r=e.a.B()+r;for(var i=[];e.a.B()<r;)i.push(t.call(e.a));return i}function pe(e,t,r,i,n){this.ma=e,this.Ba=t,this.la=r,this.Na=i,this.na=n}function fe(e,t,r,i,n,s){this.Za=e,this.za=t,this.Aa=r,this.Wa=i,this.Ab=n,this.Nb=s}function me(){}ue.clearInstanceCache=function(){de=[]},ue.getInstanceCacheLength=function(){return de.length},ue.alloc=he,ue.prototype.zb=he,ue.prototype.alloc=ue.prototype.zb,ue.prototype.Ca=function(){this.a.clear(),this.b=this.c=-1,this.h=!1,this.v=null,100>de.length&&de.push(this)},ue.prototype.free=ue.prototype.Ca,ue.prototype.Fb=function(){return this.O},ue.prototype.getFieldCursor=ue.prototype.Fb,ue.prototype.B=function(){return this.a.B()},ue.prototype.getCursor=ue.prototype.B,ue.prototype.Y=function(){return this.a.Y()},ue.prototype.getBuffer=ue.prototype.Y,ue.prototype.Hb=function(){return this.c},ue.prototype.getFieldNumber=ue.prototype.Hb,ue.prototype.Lb=function(){return this.b},ue.prototype.getWireType=ue.prototype.Lb,ue.prototype.Mb=function(){return 2==this.b},ue.prototype.isDelimited=ue.prototype.Mb,ue.prototype.bb=function(){return 4==this.b},ue.prototype.isEndGroup=ue.prototype.bb,ue.prototype.getError=function(){return this.h||this.a.getError()},ue.prototype.getError=ue.prototype.getError,ue.prototype.H=function(e,t,r){this.a.H(e,t,r),this.b=this.c=-1},ue.prototype.setBlock=ue.prototype.H,ue.prototype.reset=function(){this.a.reset(),this.b=this.c=-1},ue.prototype.reset=ue.prototype.reset,ue.prototype.advance=function(e){this.a.advance(e)},ue.prototype.advance=ue.prototype.advance,ue.prototype.oa=function(){if(this.a.ya())return!1;if(this.getError())return I("Decoder hit an error"),!1;this.O=this.a.B();var e=this.a.o(),t=e>>>3;return 0!=(e&=7)&&5!=e&&1!=e&&2!=e&&3!=e&&4!=e?(I("Invalid wire type: %s (at position %s)",e,this.O),this.h=!0,!1):(this.c=t,this.b=e,!0)},ue.prototype.nextField=ue.prototype.oa,ue.prototype.Oa=function(){this.a.mb(this.c<<3|this.b)},ue.prototype.unskipHeader=ue.prototype.Oa,ue.prototype.Lc=function(){var e=this.c;for(this.Oa();this.oa()&&this.c==e;)this.C();this.a.ya()||this.Oa()},ue.prototype.skipMatchingFields=ue.prototype.Lc,ue.prototype.lb=function(){0!=this.b?(I("Invalid wire type for skipVarintField"),this.C()):this.a.kb()},ue.prototype.skipVarintField=ue.prototype.lb,ue.prototype.gb=function(){if(2!=this.b)I("Invalid wire type for skipDelimitedField"),this.C();else{var e=this.a.o();this.a.advance(e)}},ue.prototype.skipDelimitedField=ue.prototype.gb,ue.prototype.hb=function(){5!=this.b?(I("Invalid wire type for skipFixed32Field"),this.C()):this.a.advance(4)},ue.prototype.skipFixed32Field=ue.prototype.hb,ue.prototype.ib=function(){1!=this.b?(I("Invalid wire type for skipFixed64Field"),this.C()):this.a.advance(8)},ue.prototype.skipFixed64Field=ue.prototype.ib,ue.prototype.jb=function(){for(var e=this.c;;){if(!this.oa()){I("Unmatched start-group tag: stream EOF"),this.h=!0;break}if(4==this.b){this.c!=e&&(I("Unmatched end-group tag"),this.h=!0);break}this.C()}},ue.prototype.skipGroup=ue.prototype.jb,ue.prototype.C=function(){switch(this.b){case 0:this.lb();break;case 1:this.ib();break;case 2:this.gb();break;case 5:this.hb();break;case 3:this.jb();break;default:I("Invalid wire encoding for field.")}},ue.prototype.skipField=ue.prototype.C,ue.prototype.Hc=function(e,t){null===this.v&&(this.v={}),b(!this.v[e]),this.v[e]=t},ue.prototype.registerReadCallback=ue.prototype.Hc,ue.prototype.Ic=function(e){return b(null!==this.v),b(e=this.v[e]),e(this)},ue.prototype.runReadCallback=ue.prototype.Ic,ue.prototype.Yb=function(e,t){b(2==this.b);var r=this.a.c,i=this.a.o();i=this.a.B()+i,this.a.setEnd(i),t(e,this),this.a.Ma(i),this.a.setEnd(r)},ue.prototype.readMessage=ue.prototype.Yb,ue.prototype.Ub=function(e,t,r){b(3==this.b),b(this.c==e),r(t,this),this.h||4==this.b||(I("Group submessage did not end with an END_GROUP tag"),this.h=!0)},ue.prototype.readGroup=ue.prototype.Ub,ue.prototype.Gb=function(){b(2==this.b);var e=this.a.o(),t=this.a.B(),r=t+e;return e=le(this.a.Y(),t,e),this.a.Ma(r),e},ue.prototype.getFieldDecoder=ue.prototype.Gb,ue.prototype.P=function(){return b(0==this.b),this.a.da()},ue.prototype.readInt32=ue.prototype.P,ue.prototype.Wb=function(){return b(0==this.b),this.a.Ea()},ue.prototype.readInt32String=ue.prototype.Wb,ue.prototype.ba=function(){return b(0==this.b),this.a.sa()},ue.prototype.readInt64=ue.prototype.ba,ue.prototype.ca=function(){return b(0==this.b),this.a.Fa()},ue.prototype.readInt64String=ue.prototype.ca,ue.prototype.m=function(){return b(0==this.b),this.a.o()},ue.prototype.readUint32=ue.prototype.m,ue.prototype.Fc=function(){return b(0==this.b),this.a.O()},ue.prototype.readUint32String=ue.prototype.Fc,ue.prototype.ga=function(){return b(0==this.b),this.a.Ga()},ue.prototype.readUint64=ue.prototype.ga,ue.prototype.ha=function(){return b(0==this.b),this.a.Ha()},ue.prototype.readUint64String=ue.prototype.ha,ue.prototype.zc=function(){return b(0==this.b),this.a.Ia()},ue.prototype.readSint32=ue.prototype.zc,ue.prototype.Ac=function(){return b(0==this.b),this.a.Ja()},ue.prototype.readSint64=ue.prototype.Ac,ue.prototype.Bc=function(){return b(0==this.b),this.a.Ka()},ue.prototype.readSint64String=ue.prototype.Bc,ue.prototype.Rb=function(){return b(5==this.b),this.a.m()},ue.prototype.readFixed32=ue.prototype.Rb,ue.prototype.Sb=function(){return b(1==this.b),this.a.ga()},ue.prototype.readFixed64=ue.prototype.Sb,ue.prototype.Tb=function(){return b(1==this.b),this.a.ha()},ue.prototype.readFixed64String=ue.prototype.Tb,ue.prototype.vc=function(){return b(5==this.b),this.a.P()},ue.prototype.readSfixed32=ue.prototype.vc,ue.prototype.wc=function(){return b(5==this.b),this.a.P().toString()},ue.prototype.readSfixed32String=ue.prototype.wc,ue.prototype.xc=function(){return b(1==this.b),this.a.ba()},ue.prototype.readSfixed64=ue.prototype.xc,ue.prototype.yc=function(){return b(1==this.b),this.a.ca()},ue.prototype.readSfixed64String=ue.prototype.yc,ue.prototype.aa=function(){return b(5==this.b),this.a.aa()},ue.prototype.readFloat=ue.prototype.aa,ue.prototype.Z=function(){return b(1==this.b),this.a.Z()},ue.prototype.readDouble=ue.prototype.Z,ue.prototype.pa=function(){return b(0==this.b),!!this.a.o()},ue.prototype.readBool=ue.prototype.pa,ue.prototype.ra=function(){return b(0==this.b),this.a.sa()},ue.prototype.readEnum=ue.prototype.ra,ue.prototype.fa=function(){b(2==this.b);var e=this.a.o();return this.a.fa(e)},ue.prototype.readString=ue.prototype.fa,ue.prototype.qa=function(){b(2==this.b);var e=this.a.o();return this.a.qa(e)},ue.prototype.readBytes=ue.prototype.qa,ue.prototype.ia=function(){return b(0==this.b),this.a.ia()},ue.prototype.readVarintHash64=ue.prototype.ia,ue.prototype.Cc=function(){return b(0==this.b),this.a.fb()},ue.prototype.readSintHash64=ue.prototype.Cc,ue.prototype.w=function(e){return b(0==this.b),this.a.w(e)},ue.prototype.readSplitVarint64=ue.prototype.w,ue.prototype.ea=function(e){return b(0==this.b),this.a.w(function(t,r){return Y(t,r,e)})},ue.prototype.readSplitZigzagVarint64=ue.prototype.ea,ue.prototype.$=function(){return b(1==this.b),this.a.$()},ue.prototype.readFixedHash64=ue.prototype.$,ue.prototype.ta=function(e){return b(1==this.b),this.a.ta(e)},ue.prototype.readSplitFixed64=ue.prototype.ta,ue.prototype.gc=function(){return ce(this,this.a.da)},ue.prototype.readPackedInt32=ue.prototype.gc,ue.prototype.hc=function(){return ce(this,this.a.Ea)},ue.prototype.readPackedInt32String=ue.prototype.hc,ue.prototype.ic=function(){return ce(this,this.a.sa)},ue.prototype.readPackedInt64=ue.prototype.ic,ue.prototype.jc=function(){return ce(this,this.a.Fa)},ue.prototype.readPackedInt64String=ue.prototype.jc,ue.prototype.qc=function(){return ce(this,this.a.o)},ue.prototype.readPackedUint32=ue.prototype.qc,ue.prototype.rc=function(){return ce(this,this.a.O)},ue.prototype.readPackedUint32String=ue.prototype.rc,ue.prototype.sc=function(){return ce(this,this.a.Ga)},ue.prototype.readPackedUint64=ue.prototype.sc,ue.prototype.tc=function(){return ce(this,this.a.Ha)},ue.prototype.readPackedUint64String=ue.prototype.tc,ue.prototype.nc=function(){return ce(this,this.a.Ia)},ue.prototype.readPackedSint32=ue.prototype.nc,ue.prototype.oc=function(){return ce(this,this.a.Ja)},ue.prototype.readPackedSint64=ue.prototype.oc,ue.prototype.pc=function(){return ce(this,this.a.Ka)},ue.prototype.readPackedSint64String=ue.prototype.pc,ue.prototype.bc=function(){return ce(this,this.a.m)},ue.prototype.readPackedFixed32=ue.prototype.bc,ue.prototype.cc=function(){return ce(this,this.a.ga)},ue.prototype.readPackedFixed64=ue.prototype.cc,ue.prototype.dc=function(){return ce(this,this.a.ha)},ue.prototype.readPackedFixed64String=ue.prototype.dc,ue.prototype.kc=function(){return ce(this,this.a.P)},ue.prototype.readPackedSfixed32=ue.prototype.kc,ue.prototype.lc=function(){return ce(this,this.a.ba)},ue.prototype.readPackedSfixed64=ue.prototype.lc,ue.prototype.mc=function(){return ce(this,this.a.ca)},ue.prototype.readPackedSfixed64String=ue.prototype.mc,ue.prototype.fc=function(){return ce(this,this.a.aa)},ue.prototype.readPackedFloat=ue.prototype.fc,ue.prototype.$b=function(){return ce(this,this.a.Z)},ue.prototype.readPackedDouble=ue.prototype.$b,ue.prototype.Zb=function(){return ce(this,this.a.pa)},ue.prototype.readPackedBool=ue.prototype.Zb,ue.prototype.ac=function(){return ce(this,this.a.ra)},ue.prototype.readPackedEnum=ue.prototype.ac,ue.prototype.uc=function(){return ce(this,this.a.ia)},ue.prototype.readPackedVarintHash64=ue.prototype.uc,ue.prototype.ec=function(){return ce(this,this.a.$)},ue.prototype.readPackedFixedHash64=ue.prototype.ec,h("jspb.ExtensionFieldInfo",pe,void 0),h("jspb.ExtensionFieldBinaryInfo",fe,void 0),pe.prototype.F=function(){return!!this.la},pe.prototype.isMessageType=pe.prototype.F,h("jspb.Message",me,void 0),me.GENERATE_TO_OBJECT=!0,me.GENERATE_FROM_OBJECT=!0;var ge="function"==typeof Uint8Array;me.prototype.Ib=function(){return this.b},me.prototype.getJsPbMessageId=me.prototype.Ib,me.initialize=function(e,t,r,i,n,s){if(e.f=null,t||(t=r?[r]:[]),e.b=r?String(r):void 0,e.D=0===r?-1:0,e.u=t,t=-1,!(r=e.u.length)||(t=r-1,null===(r=e.u[t])||"object"!=typeof r||Array.isArray(r)||ge&&r instanceof Uint8Array)?-1<i?(e.G=Math.max(i,t+1-e.D),e.i=null):e.G=Number.MAX_VALUE:(e.G=t-e.D,e.i=r),e.a={},n)for(i=0;i<n.length;i++)(t=n[i])<e.G?(t+=e.D,e.u[t]=e.u[t]||ye):(ve(e),e.i[t]=e.i[t]||ye);if(s&&s.length)for(i=0;i<s.length;i++)Ce(e,s[i])};var ye=Object.freeze?Object.freeze([]):[];function ve(e){var t=e.G+e.D;e.u[t]||(e.i=e.u[t]={})}function be(e,t,r){for(var i=[],n=0;n<e.length;n++)i[n]=t.call(e[n],r,e[n]);return i}function Ie(e,t){if(t<e.G){t+=e.D;var r=e.u[t];return r===ye?e.u[t]=[]:r}if(e.i)return(r=e.i[t])===ye?e.i[t]=[]:r}function Ee(e,t){return null==(e=Ie(e,t))?e:+e}function we(e,t){return null==(e=Ie(e,t))?e:!!e}function Se(e){return null==e||"string"==typeof e?e:ge&&e instanceof Uint8Array?x(e):(I("Cannot coerce to b64 string: "+c(e)),null)}function Me(e){return null==e||e instanceof Uint8Array?e:"string"==typeof e?_(e):(I("Cannot coerce to Uint8Array: "+c(e)),null)}function ke(e){if(e&&1<e.length){var t=c(e[0]);m(e,function(e){c(e)!=t&&I("Inconsistent type in JSPB repeated field array. Got "+c(e)+" expected "+t)})}}function Fe(e,t,r){return null==(e=Ie(e,t))?r:e}function Te(e,t,r){return E(e,me),t<e.G?e.u[t+e.D]=r:(ve(e),e.i[t]=r),e}function Re(e,t,r,i){return E(e,me),r!==i?Te(e,t,r):t<e.G?e.u[t+e.D]=null:(ve(e),delete e.i[t]),e}function Ae(e,t,r,i){return E(e,me),(r=Ce(e,r))&&r!==t&&void 0!==i&&(e.f&&r in e.f&&(e.f[r]=void 0),Te(e,r,void 0)),Te(e,t,i)}function Ce(e,t){for(var r,i,n=0;n<t.length;n++){var s=t[n],o=Ie(e,s);null!=o&&(r=s,i=o,Te(e,s,void 0))}return r?(Te(e,r,i),r):0}function Oe(e,t,r){if(e.f||(e.f={}),!e.f[r]){for(var i=Ie(e,r),n=[],s=0;s<i.length;s++)n[s]=new t(i[s]);e.f[r]=n}}function Ne(e){if(e.f)for(var t in e.f){var r=e.f[t];if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]&&r[i].g();else r&&r.g()}}function xe(e,t){e=e||{},t=t||{};var r,i={};for(r in e)i[r]=0;for(r in t)i[r]=0;for(r in i)if(!_e(e[r],t[r]))return!1;return!0}function _e(e,t){if(e==t)return!0;if(!p(e)||!p(t))return!!("number"==typeof e&&isNaN(e)||"number"==typeof t&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(ge&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}if(e.constructor===Array){var i=void 0,n=void 0,s=Math.max(e.length,t.length);for(r=0;r<s;r++){var o=e[r],a=t[r];if(o&&o.constructor==Object&&(b(void 0===i),b(r===e.length-1),i=o,o=void 0),a&&a.constructor==Object&&(b(void 0===n),b(r===t.length-1),n=a,a=void 0),!_e(o,a))return!1}return!i&&!n||xe(i=i||{},n=n||{})}if(e.constructor===Object)return xe(e,t);throw Error("Invalid type in JSPB array")}function De(e){return new e.constructor(Le(e.g()))}function Le(e){if(Array.isArray(e)){for(var t=Array(e.length),r=0;r<e.length;r++){var i=e[r];null!=i&&(t[r]="object"==typeof i?Le(b(i)):i)}return t}if(ge&&e instanceof Uint8Array)return new Uint8Array(e);for(r in t={},e)null!=(i=e[r])&&(t[r]="object"==typeof i?Le(b(i)):i);return t}me.toObjectList=be,me.toObjectExtension=function(e,t,r,i,n){for(var s in r){var o=r[s],a=i.call(e,o);if(null!=a){for(var l in o.Ba)if(o.Ba.hasOwnProperty(l))break;t[l]=o.Na?o.na?be(a,o.Na,n):o.Na(n,a):a}}},me.serializeBinaryExtensions=function(e,t,r,i){for(var n in r){var s=r[n],o=s.Za;if(!s.Aa)throw Error("Message extension present that was generated without binary serialization support");var a=i.call(e,o);if(null!=a)if(o.F()){if(!s.Wa)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");s.Aa.call(t,o.ma,a,s.Wa)}else s.Aa.call(t,o.ma,a)}},me.readBinaryExtension=function(e,t,r,i,n){var s=r[t.c];if(s){if(r=s.Za,!s.za)throw Error("Deserializing extension whose generated code does not support binary format");if(r.F()){var o=new r.la;s.za.call(t,o,s.Ab)}else o=s.za.call(t);r.na&&!s.Nb?(t=i.call(e,r))?t.push(o):n.call(e,r,[o]):n.call(e,r,o)}else t.C()},me.getField=Ie,me.getRepeatedField=function(e,t){return Ie(e,t)},me.getOptionalFloatingPointField=Ee,me.getBooleanField=we,me.getRepeatedFloatingPointField=function(e,t){var r=Ie(e,t);if(e.a||(e.a={}),!e.a[t]){for(var i=0;i<r.length;i++)r[i]=+r[i];e.a[t]=!0}return r},me.getRepeatedBooleanField=function(e,t){var r=Ie(e,t);if(e.a||(e.a={}),!e.a[t]){for(var i=0;i<r.length;i++)r[i]=!!r[i];e.a[t]=!0}return r},me.bytesAsB64=Se,me.bytesAsU8=Me,me.bytesListAsB64=function(e){return ke(e),e.length&&"string"!=typeof e[0]?g(e,Se):e},me.bytesListAsU8=function(e){return ke(e),!e.length||e[0]instanceof Uint8Array?e:g(e,Me)},me.getFieldWithDefault=Fe,me.getBooleanFieldWithDefault=function(e,t,r){return null==(e=we(e,t))?r:e},me.getFloatingPointFieldWithDefault=function(e,t,r){return null==(e=Ee(e,t))?r:e},me.getFieldProto3=Fe,me.getMapField=function(e,t,r,i){if(e.f||(e.f={}),t in e.f)return e.f[t];var n=Ie(e,t);if(!n){if(r)return;Te(e,t,n=[])}return e.f[t]=new S(n,i)},me.setField=Te,me.setProto3IntField=function(e,t,r){return Re(e,t,r,0)},me.setProto3FloatField=function(e,t,r){return Re(e,t,r,0)},me.setProto3BooleanField=function(e,t,r){return Re(e,t,r,!1)},me.setProto3StringField=function(e,t,r){return Re(e,t,r,"")},me.setProto3BytesField=function(e,t,r){return Re(e,t,r,"")},me.setProto3EnumField=function(e,t,r){return Re(e,t,r,0)},me.setProto3StringIntField=function(e,t,r){return Re(e,t,r,"0")},me.addToRepeatedField=function(e,t,r,i){return E(e,me),t=Ie(e,t),null!=i?t.splice(i,0,r):t.push(r),e},me.setOneofField=Ae,me.computeOneofCase=Ce,me.getWrapperField=function(e,t,r,i){if(e.f||(e.f={}),!e.f[r]){var n=Ie(e,r);(i||n)&&(e.f[r]=new t(n))}return e.f[r]},me.getRepeatedWrapperField=function(e,t,r){return Oe(e,t,r),(t=e.f[r])==ye&&(t=e.f[r]=[]),t},me.setWrapperField=function(e,t,r){E(e,me),e.f||(e.f={});var i=r?r.g():r;return e.f[t]=r,Te(e,t,i)},me.setOneofWrapperField=function(e,t,r,i){E(e,me),e.f||(e.f={});var n=i?i.g():i;return e.f[t]=i,Ae(e,t,r,n)},me.setRepeatedWrapperField=function(e,t,r){E(e,me),e.f||(e.f={}),r=r||[];for(var i=[],n=0;n<r.length;n++)i[n]=r[n].g();return e.f[t]=r,Te(e,t,i)},me.addToRepeatedWrapperField=function(e,t,r,i,n){Oe(e,i,t);var s=e.f[t];return s||(s=e.f[t]=[]),r=r||new i,e=Ie(e,t),null!=n?(s.splice(n,0,r),e.splice(n,0,r.g())):(s.push(r),e.push(r.g())),r},me.toMap=function(e,t,r,i){for(var n={},s=0;s<e.length;s++)n[t.call(e[s])]=r?r.call(e[s],i,e[s]):e[s];return n},me.prototype.g=function(){return Ne(this),this.u},me.prototype.toArray=me.prototype.g,me.prototype.toString=function(){return Ne(this),this.u.toString()},me.prototype.getExtension=function(e){if(this.i){this.f||(this.f={});var t=e.ma;if(e.na){if(e.F())return this.f[t]||(this.f[t]=g(this.i[t]||[],function(t){return new e.la(t)})),this.f[t]}else if(e.F())return!this.f[t]&&this.i[t]&&(this.f[t]=new e.la(this.i[t])),this.f[t];return this.i[t]}},me.prototype.getExtension=me.prototype.getExtension,me.prototype.Kc=function(e,t){this.f||(this.f={}),ve(this);var r=e.ma;return e.na?(t=t||[],e.F()?(this.f[r]=t,this.i[r]=g(t,function(e){return e.g()})):this.i[r]=t):e.F()?(this.f[r]=t,this.i[r]=t?t.g():t):this.i[r]=t,this},me.prototype.setExtension=me.prototype.Kc,me.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var r=e.g();t=t.g();var i=[],n=0,s=r.length>t.length?r.length:t.length;for(e.b&&(i[0]=e.b,n=1);n<s;n++)_e(r[n],t[n])||(i[n]=t[n]);return new e.constructor(i)},me.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&_e(e.g(),t.g())},me.compareExtensions=xe,me.compareFields=_e,me.prototype.Bb=function(){return De(this)},me.prototype.cloneMessage=me.prototype.Bb,me.prototype.clone=function(){return De(this)},me.prototype.clone=me.prototype.clone,me.clone=function(e){return De(e)},me.copyInto=function(e,t){E(e,me),E(t,me),b(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=De(e);for(var r=t.g(),i=e.g(),n=r.length=0;n<i.length;n++)r[n]=i[n];t.f=e.f,t.i=e.i},me.registerMessageType=function(e,t){t.we=e};var Pe={dump:function(e){return E(e,me,"jspb.Message instance expected"),b(e.getExtension,"Only unobfuscated and unoptimized compilation modes supported."),Pe.X(e)}};function Ue(){this.a=[]}function je(e,t){this.lo=e,this.hi=t}function Be(e,t){var r=65535&e,i=65535&t,n=t>>>16;for(t=r*i+65536*(r*n&65535)+65536*((e>>>=16)*i&65535),r=e*n+(r*n>>>16)+(e*i>>>16);4294967296<=t;)t-=4294967296,r+=1;return new je(t>>>0,r>>>0)}function We(e){for(var t=new je(0,0),r=new je(0,0),i=0;i<e.length;i++){if("0">e[i]||"9"<e[i])return null;r.lo=parseInt(e[i],10),t=t.eb(10).add(r)}return t}function ze(e,t){this.lo=e,this.hi=t}function Ge(e){var t=0<e.length&&"-"==e[0];return t&&(e=e.substring(1)),null===(e=We(e))?null:(t&&(e=new je(0,0).sub(e)),new ze(e.lo,e.hi))}function Ve(){this.c=[],this.b=0,this.a=new Ue,this.h=[]}function qe(e,t){var r=e.a.end();e.c.push(r),e.c.push(t),e.b+=r.length+t.length}function Ke(e,t){return Ye(e,t,2),t=e.a.end(),e.c.push(t),e.b+=t.length,t.push(e.b),t}function He(e,t){var r=t.pop();for(b(0<=(r=e.b+e.a.length()-r));127<r;)t.push(127&r|128),r>>>=7,e.b++;t.push(r),e.b++}function Ye(e,t,r){b(1<=t&&t==Math.floor(t)),e.a.j(8*t+r)}function Xe(e,t,r){null!=r&&(Ye(e,t,0),e.a.j(r))}function Je(e,t,r){null!=r&&(Ye(e,t,0),e.a.M(r))}h("jspb.debug.dump",Pe.dump,void 0),Pe.X=function(e){var t=c(e);if("number"==t||"string"==t||"boolean"==t||"null"==t||"undefined"==t||"undefined"!=typeof Uint8Array&&e instanceof Uint8Array)return e;if("array"==t)return function(e,t,r){for(var i=[],n=2;n<arguments.length;++n)i[n-2]=arguments[n];Array.isArray(e)||v("Expected array but got %s: %s.",[c(e),e],t,i)}(e),g(e,Pe.X);if(e instanceof S){for(var r={},i=(e=e.entries()).next();!i.done;i=e.next())r[i.value[0]]=Pe.X(i.value[1]);return r}E(e,me,"Only messages expected: "+e);var n={$name:(t=e.constructor).name||t.displayName};for(a in t.prototype){var s=/^get([A-Z]\w*)/.exec(a);if(s&&"getExtension"!=a&&"getJsPbMessageId"!=a){var o="has"+s[1];e[o]&&!e[o]()||(o=e[a](),n[Pe.$a(s[1])]=Pe.X(o))}}if(e.extensionObject_)return n.$extensions="Recursive dumping of extensions not supported in compiled code. Switch to uncompiled or dump extension object directly",n;for(i in t.extensions)if(/^\d+$/.test(i)){o=t.extensions[i];var a=e.getExtension(o);s=void 0,o=o.Ba;var l=[],u=0;for(s in o)l[u++]=s;s=l[0],null!=a&&(r||(r=n.$extensions={}),r[Pe.$a(s)]=Pe.X(a))}return n},Pe.$a=function(e){return e.replace(/^[A-Z]/,function(e){return e.toLowerCase()})},h("jspb.BinaryEncoder",Ue,void 0),Ue.prototype.length=function(){return this.a.length},Ue.prototype.length=Ue.prototype.length,Ue.prototype.end=function(){var e=this.a;return this.a=[],e},Ue.prototype.end=Ue.prototype.end,Ue.prototype.l=function(e,t){for(b(e==Math.floor(e)),b(t==Math.floor(t)),b(0<=e&&4294967296>e),b(0<=t&&4294967296>t);0<t||127<e;)this.a.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.a.push(e)},Ue.prototype.writeSplitVarint64=Ue.prototype.l,Ue.prototype.A=function(e,t){b(e==Math.floor(e)),b(t==Math.floor(t)),b(0<=e&&4294967296>e),b(0<=t&&4294967296>t),this.s(e),this.s(t)},Ue.prototype.writeSplitFixed64=Ue.prototype.A,Ue.prototype.j=function(e){for(b(e==Math.floor(e)),b(0<=e&&4294967296>e);127<e;)this.a.push(127&e|128),e>>>=7;this.a.push(e)},Ue.prototype.writeUnsignedVarint32=Ue.prototype.j,Ue.prototype.M=function(e){if(b(e==Math.floor(e)),b(-2147483648<=e&&2147483648>e),0<=e)this.j(e);else{for(var t=0;9>t;t++)this.a.push(127&e|128),e>>=7;this.a.push(1)}},Ue.prototype.writeSignedVarint32=Ue.prototype.M,Ue.prototype.va=function(e){b(e==Math.floor(e)),b(0<=e&&0x10000000000000000>e),j(e),this.l(L,P)},Ue.prototype.writeUnsignedVarint64=Ue.prototype.va,Ue.prototype.ua=function(e){b(e==Math.floor(e)),b(-0x8000000000000000<=e&&0x8000000000000000>e),j(e),this.l(L,P)},Ue.prototype.writeSignedVarint64=Ue.prototype.ua,Ue.prototype.wa=function(e){b(e==Math.floor(e)),b(-2147483648<=e&&2147483648>e),this.j((e<<1^e>>31)>>>0)},Ue.prototype.writeZigzagVarint32=Ue.prototype.wa,Ue.prototype.xa=function(e){b(e==Math.floor(e)),b(-0x8000000000000000<=e&&0x8000000000000000>e),B(e),this.l(L,P)},Ue.prototype.writeZigzagVarint64=Ue.prototype.xa,Ue.prototype.Ta=function(e){this.W(te(e))},Ue.prototype.writeZigzagVarint64String=Ue.prototype.Ta,Ue.prototype.W=function(e){var t=this;G(e),K(L,P,function(e,r){t.l(e>>>0,r>>>0)})},Ue.prototype.writeZigzagVarintHash64=Ue.prototype.W,Ue.prototype.be=function(e){b(e==Math.floor(e)),b(0<=e&&256>e),this.a.push(e>>>0&255)},Ue.prototype.writeUint8=Ue.prototype.be,Ue.prototype.ae=function(e){b(e==Math.floor(e)),b(0<=e&&65536>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255)},Ue.prototype.writeUint16=Ue.prototype.ae,Ue.prototype.s=function(e){b(e==Math.floor(e)),b(0<=e&&4294967296>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255),this.a.push(e>>>16&255),this.a.push(e>>>24&255)},Ue.prototype.writeUint32=Ue.prototype.s,Ue.prototype.V=function(e){b(e==Math.floor(e)),b(0<=e&&0x10000000000000000>e),U(e),this.s(L),this.s(P)},Ue.prototype.writeUint64=Ue.prototype.V,Ue.prototype.Qc=function(e){b(e==Math.floor(e)),b(-128<=e&&128>e),this.a.push(e>>>0&255)},Ue.prototype.writeInt8=Ue.prototype.Qc,Ue.prototype.Pc=function(e){b(e==Math.floor(e)),b(-32768<=e&&32768>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255)},Ue.prototype.writeInt16=Ue.prototype.Pc,Ue.prototype.S=function(e){b(e==Math.floor(e)),b(-2147483648<=e&&2147483648>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255),this.a.push(e>>>16&255),this.a.push(e>>>24&255)},Ue.prototype.writeInt32=Ue.prototype.S,Ue.prototype.T=function(e){b(e==Math.floor(e)),b(-0x8000000000000000<=e&&0x8000000000000000>e),j(e),this.A(L,P)},Ue.prototype.writeInt64=Ue.prototype.T,Ue.prototype.ka=function(e){b(e==Math.floor(e)),b(-0x8000000000000000<=+e&&0x8000000000000000>+e),G(te(e)),this.A(L,P)},Ue.prototype.writeInt64String=Ue.prototype.ka,Ue.prototype.L=function(e){b(1/0===e||-1/0===e||isNaN(e)||-34028234663852886e22<=e&&34028234663852886e22>=e),W(e),this.s(L)},Ue.prototype.writeFloat=Ue.prototype.L,Ue.prototype.J=function(e){b(1/0===e||-1/0===e||isNaN(e)||-17976931348623157e292<=e&&17976931348623157e292>=e),z(e),this.s(L),this.s(P)},Ue.prototype.writeDouble=Ue.prototype.J,Ue.prototype.I=function(e){b("boolean"==typeof e||"number"==typeof e),this.a.push(e?1:0)},Ue.prototype.writeBool=Ue.prototype.I,Ue.prototype.R=function(e){b(e==Math.floor(e)),b(-2147483648<=e&&2147483648>e),this.M(e)},Ue.prototype.writeEnum=Ue.prototype.R,Ue.prototype.ja=function(e){this.a.push.apply(this.a,e)},Ue.prototype.writeBytes=Ue.prototype.ja,Ue.prototype.N=function(e){G(e),this.l(L,P)},Ue.prototype.writeVarintHash64=Ue.prototype.N,Ue.prototype.K=function(e){G(e),this.s(L),this.s(P)},Ue.prototype.writeFixedHash64=Ue.prototype.K,Ue.prototype.U=function(e){var t=this.a.length;!function(e,t,r){for(var i=[],n=2;n<arguments.length;++n)i[n-2]=arguments[n];"string"!=typeof e&&v("Expected string but got %s: %s.",[c(e),e],t,i)}(e);for(var r=0;r<e.length;r++){var i=e.charCodeAt(r);if(128>i)this.a.push(i);else if(2048>i)this.a.push(i>>6|192),this.a.push(63&i|128);else if(65536>i)if(55296<=i&&56319>=i&&r+1<e.length){var n=e.charCodeAt(r+1);56320<=n&&57343>=n&&(i=1024*(i-55296)+n-56320+65536,this.a.push(i>>18|240),this.a.push(i>>12&63|128),this.a.push(i>>6&63|128),this.a.push(63&i|128),r++)}else this.a.push(i>>12|224),this.a.push(i>>6&63|128),this.a.push(63&i|128)}return this.a.length-t},Ue.prototype.writeString=Ue.prototype.U,h("jspb.arith.UInt64",je,void 0),je.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},je.prototype.cmp=je.prototype.cmp,je.prototype.La=function(){return new je((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},je.prototype.rightShift=je.prototype.La,je.prototype.Da=function(){return new je(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},je.prototype.leftShift=je.prototype.Da,je.prototype.cb=function(){return!!(2147483648&this.hi)},je.prototype.msb=je.prototype.cb,je.prototype.Ob=function(){return!!(1&this.lo)},je.prototype.lsb=je.prototype.Ob,je.prototype.Ua=function(){return 0==this.lo&&0==this.hi},je.prototype.zero=je.prototype.Ua,je.prototype.add=function(e){return new je((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},je.prototype.add=je.prototype.add,je.prototype.sub=function(e){return new je((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},je.prototype.sub=je.prototype.sub,je.mul32x32=Be,je.prototype.eb=function(e){var t=Be(this.lo,e);return(e=Be(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},je.prototype.mul=je.prototype.eb,je.prototype.Xa=function(e){if(0==e)return[];var t=new je(0,0),r=new je(this.lo,this.hi);e=new je(e,0);for(var i=new je(1,0);!e.cb();)e=e.Da(),i=i.Da();for(;!i.Ua();)0>=e.cmp(r)&&(t=t.add(i),r=r.sub(e)),e=e.La(),i=i.La();return[t,r]},je.prototype.div=je.prototype.Xa,je.prototype.toString=function(){for(var e="",t=this;!t.Ua();){var r=(t=t.Xa(10))[0];e=t[1].lo+e,t=r}return""==e&&(e="0"),e},je.prototype.toString=je.prototype.toString,je.fromString=We,je.prototype.clone=function(){return new je(this.lo,this.hi)},je.prototype.clone=je.prototype.clone,h("jspb.arith.Int64",ze,void 0),ze.prototype.add=function(e){return new ze((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},ze.prototype.add=ze.prototype.add,ze.prototype.sub=function(e){return new ze((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},ze.prototype.sub=ze.prototype.sub,ze.prototype.clone=function(){return new ze(this.lo,this.hi)},ze.prototype.clone=ze.prototype.clone,ze.prototype.toString=function(){var e=!!(2147483648&this.hi),t=new je(this.lo,this.hi);return e&&(t=new je(0,0).sub(t)),(e?"-":"")+t.toString()},ze.prototype.toString=ze.prototype.toString,ze.fromString=Ge,h("jspb.BinaryWriter",Ve,void 0),Ve.prototype.pb=function(e,t,r){qe(this,e.subarray(t,r))},Ve.prototype.writeSerializedMessage=Ve.prototype.pb,Ve.prototype.Pb=function(e,t,r){null!=e&&null!=t&&null!=r&&this.pb(e,t,r)},Ve.prototype.maybeWriteSerializedMessage=Ve.prototype.Pb,Ve.prototype.reset=function(){this.c=[],this.a.end(),this.b=0,this.h=[]},Ve.prototype.reset=Ve.prototype.reset,Ve.prototype.ab=function(){b(0==this.h.length);for(var e=new Uint8Array(this.b+this.a.length()),t=this.c,r=t.length,i=0,n=0;n<r;n++){var s=t[n];e.set(s,i),i+=s.length}return t=this.a.end(),e.set(t,i),b((i+=t.length)==e.length),this.c=[e],e},Ve.prototype.getResultBuffer=Ve.prototype.ab,Ve.prototype.Kb=function(e){return x(this.ab(),e)},Ve.prototype.getResultBase64String=Ve.prototype.Kb,Ve.prototype.Va=function(e){this.h.push(Ke(this,e))},Ve.prototype.beginSubMessage=Ve.prototype.Va,Ve.prototype.Ya=function(){b(0<=this.h.length),He(this,this.h.pop())},Ve.prototype.endSubMessage=Ve.prototype.Ya,Ve.prototype.Nc=function(e,t,r){switch(e){case 1:this.J(t,r);break;case 2:this.L(t,r);break;case 3:this.T(t,r);break;case 4:this.V(t,r);break;case 5:this.S(t,r);break;case 6:this.Qa(t,r);break;case 7:this.Pa(t,r);break;case 8:this.I(t,r);break;case 9:this.U(t,r);break;case 10:I("Group field type not supported in writeAny()");break;case 11:I("Message field type not supported in writeAny()");break;case 12:this.ja(t,r);break;case 13:this.s(t,r);break;case 14:this.R(t,r);break;case 15:this.Ra(t,r);break;case 16:this.Sa(t,r);break;case 17:this.rb(t,r);break;case 18:this.sb(t,r);break;case 30:this.K(t,r);break;case 31:this.N(t,r);break;default:I("Invalid field type in writeAny()")}},Ve.prototype.writeAny=Ve.prototype.Nc,Ve.prototype.S=function(e,t){null!=t&&(b(-2147483648<=t&&2147483648>t),Je(this,e,t))},Ve.prototype.writeInt32=Ve.prototype.S,Ve.prototype.ob=function(e,t){null!=t&&(b(-2147483648<=(t=parseInt(t,10))&&2147483648>t),Je(this,e,t))},Ve.prototype.writeInt32String=Ve.prototype.ob,Ve.prototype.T=function(e,t){null!=t&&(b(-0x8000000000000000<=t&&0x8000000000000000>t),null!=t&&(Ye(this,e,0),this.a.ua(t)))},Ve.prototype.writeInt64=Ve.prototype.T,Ve.prototype.ka=function(e,t){null!=t&&(t=Ge(t),Ye(this,e,0),this.a.l(t.lo,t.hi))},Ve.prototype.writeInt64String=Ve.prototype.ka,Ve.prototype.s=function(e,t){null!=t&&(b(0<=t&&4294967296>t),Xe(this,e,t))},Ve.prototype.writeUint32=Ve.prototype.s,Ve.prototype.ub=function(e,t){null!=t&&(b(0<=(t=parseInt(t,10))&&4294967296>t),Xe(this,e,t))},Ve.prototype.writeUint32String=Ve.prototype.ub,Ve.prototype.V=function(e,t){null!=t&&(b(0<=t&&0x10000000000000000>t),null!=t&&(Ye(this,e,0),this.a.va(t)))},Ve.prototype.writeUint64=Ve.prototype.V,Ve.prototype.vb=function(e,t){null!=t&&(t=We(t),Ye(this,e,0),this.a.l(t.lo,t.hi))},Ve.prototype.writeUint64String=Ve.prototype.vb,Ve.prototype.rb=function(e,t){null!=t&&(b(-2147483648<=t&&2147483648>t),null!=t&&(Ye(this,e,0),this.a.wa(t)))},Ve.prototype.writeSint32=Ve.prototype.rb,Ve.prototype.sb=function(e,t){null!=t&&(b(-0x8000000000000000<=t&&0x8000000000000000>t),null!=t&&(Ye(this,e,0),this.a.xa(t)))},Ve.prototype.writeSint64=Ve.prototype.sb,Ve.prototype.$d=function(e,t){null!=t&&null!=t&&(Ye(this,e,0),this.a.W(t))},Ve.prototype.writeSintHash64=Ve.prototype.$d,Ve.prototype.Zd=function(e,t){null!=t&&null!=t&&(Ye(this,e,0),this.a.Ta(t))},Ve.prototype.writeSint64String=Ve.prototype.Zd,Ve.prototype.Pa=function(e,t){null!=t&&(b(0<=t&&4294967296>t),Ye(this,e,5),this.a.s(t))},Ve.prototype.writeFixed32=Ve.prototype.Pa,Ve.prototype.Qa=function(e,t){null!=t&&(b(0<=t&&0x10000000000000000>t),Ye(this,e,1),this.a.V(t))},Ve.prototype.writeFixed64=Ve.prototype.Qa,Ve.prototype.nb=function(e,t){null!=t&&(t=We(t),Ye(this,e,1),this.a.A(t.lo,t.hi))},Ve.prototype.writeFixed64String=Ve.prototype.nb,Ve.prototype.Ra=function(e,t){null!=t&&(b(-2147483648<=t&&2147483648>t),Ye(this,e,5),this.a.S(t))},Ve.prototype.writeSfixed32=Ve.prototype.Ra,Ve.prototype.Sa=function(e,t){null!=t&&(b(-0x8000000000000000<=t&&0x8000000000000000>t),Ye(this,e,1),this.a.T(t))},Ve.prototype.writeSfixed64=Ve.prototype.Sa,Ve.prototype.qb=function(e,t){null!=t&&(t=Ge(t),Ye(this,e,1),this.a.A(t.lo,t.hi))},Ve.prototype.writeSfixed64String=Ve.prototype.qb,Ve.prototype.L=function(e,t){null!=t&&(Ye(this,e,5),this.a.L(t))},Ve.prototype.writeFloat=Ve.prototype.L,Ve.prototype.J=function(e,t){null!=t&&(Ye(this,e,1),this.a.J(t))},Ve.prototype.writeDouble=Ve.prototype.J,Ve.prototype.I=function(e,t){null!=t&&(b("boolean"==typeof t||"number"==typeof t),Ye(this,e,0),this.a.I(t))},Ve.prototype.writeBool=Ve.prototype.I,Ve.prototype.R=function(e,t){null!=t&&(b(-2147483648<=t&&2147483648>t),Ye(this,e,0),this.a.M(t))},Ve.prototype.writeEnum=Ve.prototype.R,Ve.prototype.U=function(e,t){null!=t&&(e=Ke(this,e),this.a.U(t),He(this,e))},Ve.prototype.writeString=Ve.prototype.U,Ve.prototype.ja=function(e,t){null!=t&&(t=se(t),Ye(this,e,2),this.a.j(t.length),qe(this,t))},Ve.prototype.writeBytes=Ve.prototype.ja,Ve.prototype.Rc=function(e,t,r){null!=t&&(e=Ke(this,e),r(t,this),He(this,e))},Ve.prototype.writeMessage=Ve.prototype.Rc,Ve.prototype.Sc=function(e,t,r){null!=t&&(Ye(this,1,3),Ye(this,2,0),this.a.M(e),e=Ke(this,3),r(t,this),He(this,e),Ye(this,1,4))},Ve.prototype.writeMessageSet=Ve.prototype.Sc,Ve.prototype.Oc=function(e,t,r){null!=t&&(Ye(this,e,3),r(t,this),Ye(this,e,4))},Ve.prototype.writeGroup=Ve.prototype.Oc,Ve.prototype.K=function(e,t){null!=t&&(b(8==t.length),Ye(this,e,1),this.a.K(t))},Ve.prototype.writeFixedHash64=Ve.prototype.K,Ve.prototype.N=function(e,t){null!=t&&(b(8==t.length),Ye(this,e,0),this.a.N(t))},Ve.prototype.writeVarintHash64=Ve.prototype.N,Ve.prototype.A=function(e,t,r){Ye(this,e,1),this.a.A(t,r)},Ve.prototype.writeSplitFixed64=Ve.prototype.A,Ve.prototype.l=function(e,t,r){Ye(this,e,0),this.a.l(t,r)},Ve.prototype.writeSplitVarint64=Ve.prototype.l,Ve.prototype.tb=function(e,t,r){Ye(this,e,0);var i=this.a;K(t,r,function(e,t){i.l(e>>>0,t>>>0)})},Ve.prototype.writeSplitZigzagVarint64=Ve.prototype.tb,Ve.prototype.Ed=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)Je(this,e,t[r])},Ve.prototype.writeRepeatedInt32=Ve.prototype.Ed,Ve.prototype.Fd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ob(e,t[r])},Ve.prototype.writeRepeatedInt32String=Ve.prototype.Fd,Ve.prototype.Gd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.ua(i))}},Ve.prototype.writeRepeatedInt64=Ve.prototype.Gd,Ve.prototype.Qd=function(e,t,r,i){if(null!=t)for(var n=0;n<t.length;n++)this.A(e,r(t[n]),i(t[n]))},Ve.prototype.writeRepeatedSplitFixed64=Ve.prototype.Qd,Ve.prototype.Rd=function(e,t,r,i){if(null!=t)for(var n=0;n<t.length;n++)this.l(e,r(t[n]),i(t[n]))},Ve.prototype.writeRepeatedSplitVarint64=Ve.prototype.Rd,Ve.prototype.Sd=function(e,t,r,i){if(null!=t)for(var n=0;n<t.length;n++)this.tb(e,r(t[n]),i(t[n]))},Ve.prototype.writeRepeatedSplitZigzagVarint64=Ve.prototype.Sd,Ve.prototype.Hd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ka(e,t[r])},Ve.prototype.writeRepeatedInt64String=Ve.prototype.Hd,Ve.prototype.Ud=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)Xe(this,e,t[r])},Ve.prototype.writeRepeatedUint32=Ve.prototype.Ud,Ve.prototype.Vd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ub(e,t[r])},Ve.prototype.writeRepeatedUint32String=Ve.prototype.Vd,Ve.prototype.Wd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.va(i))}},Ve.prototype.writeRepeatedUint64=Ve.prototype.Wd,Ve.prototype.Xd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.vb(e,t[r])},Ve.prototype.writeRepeatedUint64String=Ve.prototype.Xd,Ve.prototype.Md=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.wa(i))}},Ve.prototype.writeRepeatedSint32=Ve.prototype.Md,Ve.prototype.Nd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.xa(i))}},Ve.prototype.writeRepeatedSint64=Ve.prototype.Nd,Ve.prototype.Od=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.Ta(i))}},Ve.prototype.writeRepeatedSint64String=Ve.prototype.Od,Ve.prototype.Pd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.W(i))}},Ve.prototype.writeRepeatedSintHash64=Ve.prototype.Pd,Ve.prototype.yd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Pa(e,t[r])},Ve.prototype.writeRepeatedFixed32=Ve.prototype.yd,Ve.prototype.zd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Qa(e,t[r])},Ve.prototype.writeRepeatedFixed64=Ve.prototype.zd,Ve.prototype.Ad=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.nb(e,t[r])},Ve.prototype.writeRepeatedFixed64String=Ve.prototype.Ad,Ve.prototype.Jd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Ra(e,t[r])},Ve.prototype.writeRepeatedSfixed32=Ve.prototype.Jd,Ve.prototype.Kd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Sa(e,t[r])},Ve.prototype.writeRepeatedSfixed64=Ve.prototype.Kd,Ve.prototype.Ld=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.qb(e,t[r])},Ve.prototype.writeRepeatedSfixed64String=Ve.prototype.Ld,Ve.prototype.Cd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.L(e,t[r])},Ve.prototype.writeRepeatedFloat=Ve.prototype.Cd,Ve.prototype.wd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.J(e,t[r])},Ve.prototype.writeRepeatedDouble=Ve.prototype.wd,Ve.prototype.ud=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.I(e,t[r])},Ve.prototype.writeRepeatedBool=Ve.prototype.ud,Ve.prototype.xd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.R(e,t[r])},Ve.prototype.writeRepeatedEnum=Ve.prototype.xd,Ve.prototype.Td=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.U(e,t[r])},Ve.prototype.writeRepeatedString=Ve.prototype.Td,Ve.prototype.vd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ja(e,t[r])},Ve.prototype.writeRepeatedBytes=Ve.prototype.vd,Ve.prototype.Id=function(e,t,r){if(null!=t)for(var i=0;i<t.length;i++){var n=Ke(this,e);r(t[i],this),He(this,n)}},Ve.prototype.writeRepeatedMessage=Ve.prototype.Id,Ve.prototype.Dd=function(e,t,r){if(null!=t)for(var i=0;i<t.length;i++)Ye(this,e,3),r(t[i],this),Ye(this,e,4)},Ve.prototype.writeRepeatedGroup=Ve.prototype.Dd,Ve.prototype.Bd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.K(e,t[r])},Ve.prototype.writeRepeatedFixedHash64=Ve.prototype.Bd,Ve.prototype.Yd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.N(e,t[r])},Ve.prototype.writeRepeatedVarintHash64=Ve.prototype.Yd,Ve.prototype.ad=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.M(t[r]);He(this,e)}},Ve.prototype.writePackedInt32=Ve.prototype.ad,Ve.prototype.bd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.M(parseInt(t[r],10));He(this,e)}},Ve.prototype.writePackedInt32String=Ve.prototype.bd,Ve.prototype.cd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.ua(t[r]);He(this,e)}},Ve.prototype.writePackedInt64=Ve.prototype.cd,Ve.prototype.md=function(e,t,r,i){if(null!=t){e=Ke(this,e);for(var n=0;n<t.length;n++)this.a.A(r(t[n]),i(t[n]));He(this,e)}},Ve.prototype.writePackedSplitFixed64=Ve.prototype.md,Ve.prototype.nd=function(e,t,r,i){if(null!=t){e=Ke(this,e);for(var n=0;n<t.length;n++)this.a.l(r(t[n]),i(t[n]));He(this,e)}},Ve.prototype.writePackedSplitVarint64=Ve.prototype.nd,Ve.prototype.od=function(e,t,r,i){if(null!=t){e=Ke(this,e);for(var n=this.a,s=0;s<t.length;s++)K(r(t[s]),i(t[s]),function(e,t){n.l(e>>>0,t>>>0)});He(this,e)}},Ve.prototype.writePackedSplitZigzagVarint64=Ve.prototype.od,Ve.prototype.dd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++){var i=Ge(t[r]);this.a.l(i.lo,i.hi)}He(this,e)}},Ve.prototype.writePackedInt64String=Ve.prototype.dd,Ve.prototype.pd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.j(t[r]);He(this,e)}},Ve.prototype.writePackedUint32=Ve.prototype.pd,Ve.prototype.qd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.j(parseInt(t[r],10));He(this,e)}},Ve.prototype.writePackedUint32String=Ve.prototype.qd,Ve.prototype.rd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.va(t[r]);He(this,e)}},Ve.prototype.writePackedUint64=Ve.prototype.rd,Ve.prototype.sd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++){var i=We(t[r]);this.a.l(i.lo,i.hi)}He(this,e)}},Ve.prototype.writePackedUint64String=Ve.prototype.sd,Ve.prototype.hd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.wa(t[r]);He(this,e)}},Ve.prototype.writePackedSint32=Ve.prototype.hd,Ve.prototype.jd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.xa(t[r]);He(this,e)}},Ve.prototype.writePackedSint64=Ve.prototype.jd,Ve.prototype.kd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.W(te(t[r]));He(this,e)}},Ve.prototype.writePackedSint64String=Ve.prototype.kd,Ve.prototype.ld=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.W(t[r]);He(this,e)}},Ve.prototype.writePackedSintHash64=Ve.prototype.ld,Ve.prototype.Wc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(4*t.length),e=0;e<t.length;e++)this.a.s(t[e])},Ve.prototype.writePackedFixed32=Ve.prototype.Wc,Ve.prototype.Xc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.V(t[e])},Ve.prototype.writePackedFixed64=Ve.prototype.Xc,Ve.prototype.Yc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++){var r=We(t[e]);this.a.A(r.lo,r.hi)}},Ve.prototype.writePackedFixed64String=Ve.prototype.Yc,Ve.prototype.ed=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(4*t.length),e=0;e<t.length;e++)this.a.S(t[e])},Ve.prototype.writePackedSfixed32=Ve.prototype.ed,Ve.prototype.fd=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.T(t[e])},Ve.prototype.writePackedSfixed64=Ve.prototype.fd,Ve.prototype.gd=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.ka(t[e])},Ve.prototype.writePackedSfixed64String=Ve.prototype.gd,Ve.prototype.$c=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(4*t.length),e=0;e<t.length;e++)this.a.L(t[e])},Ve.prototype.writePackedFloat=Ve.prototype.$c,Ve.prototype.Uc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.J(t[e])},Ve.prototype.writePackedDouble=Ve.prototype.Uc,Ve.prototype.Tc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(t.length),e=0;e<t.length;e++)this.a.I(t[e])},Ve.prototype.writePackedBool=Ve.prototype.Tc,Ve.prototype.Vc=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.R(t[r]);He(this,e)}},Ve.prototype.writePackedEnum=Ve.prototype.Vc,Ve.prototype.Zc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.K(t[e])},Ve.prototype.writePackedFixedHash64=Ve.prototype.Zc,Ve.prototype.td=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.N(t[r]);He(this,e)}},Ve.prototype.writePackedVarintHash64=Ve.prototype.td,t.debug=Pe,t.Map=S,t.Message=me,t.BinaryReader=ue,t.BinaryWriter=Ve,t.ExtensionFieldInfo=pe,t.ExtensionFieldBinaryInfo=fe,t.exportSymbol=function(e,t,r){h(e,t,r)},t.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},t.object={extend:function(e,t){for(var r,i,n=1;n<arguments.length;n++){for(r in i=arguments[n])e[r]=i[r];for(var s=0;s<f.length;s++)r=f[s],Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}}},t.typeOf=c},366:function(e,t,r){"use strict";var i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.FrameStore=void 0;var n=r(225),s=r(974),o=function(){function e(){this.storedFrames=[],this._lastReceivedFramePosition=0,this._firstAvailableFramePosition=0,this._lastSentFramePosition=0}return Object.defineProperty(e.prototype,"lastReceivedFramePosition",{get:function(){return this._lastReceivedFramePosition},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstAvailableFramePosition",{get:function(){return this._firstAvailableFramePosition},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSentFramePosition",{get:function(){return this._lastSentFramePosition},enumerable:!1,configurable:!0}),e.prototype.store=function(e){this._lastSentFramePosition+=(0,s.sizeOfFrame)(e),this.storedFrames.push(e)},e.prototype.record=function(e){this._lastReceivedFramePosition+=(0,s.sizeOfFrame)(e)},e.prototype.dropTo=function(e){for(var t=e-this._firstAvailableFramePosition;t>0&&this.storedFrames.length>0;){var r=this.storedFrames.shift();t-=(0,s.sizeOfFrame)(r)}if(0!==t)throw new n.RSocketError(n.ErrorCodes.CONNECTION_ERROR,"State inconsistency. Expected bytes to drop ".concat(e-this._firstAvailableFramePosition," but actual ").concat(t));this._firstAvailableFramePosition=e},e.prototype.drain=function(e){var t,r;try{for(var n=i(this.storedFrames),s=n.next();!s.done;s=n.next())e(s.value)}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e}();t.FrameStore=o},438:function(e,t,r){"use strict";var i=r(287).hp,n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.fragmentWithRequestN=t.fragment=t.isFragmentable=void 0;var s=r(799);t.isFragmentable=function(e,t,r){return 0!==t&&e.data.byteLength+(e.metadata?e.metadata.byteLength+s.Lengths.METADATA:0)+(r==s.FrameTypes.REQUEST_STREAM||r==s.FrameTypes.REQUEST_CHANNEL?s.Lengths.REQUEST:0)>t},t.fragment=function(e,t,r,o,a){var l,u,d,h,c,p,f,m,g,y,v,b;return void 0===a&&(a=!1),n(this,function(n){switch(n.label){case 0:return l=null!==(b=null===(v=t.data)||void 0===v?void 0:v.byteLength)&&void 0!==b?b:0,u=o!==s.FrameTypes.PAYLOAD,d=r,t.metadata?0!==(c=t.metadata.byteLength)?[3,1]:(d-=s.Lengths.METADATA,h=i.allocUnsafe(0),[3,6]):[3,6];case 1:return p=0,u?(d-=s.Lengths.METADATA,f=Math.min(c,p+d),h=t.metadata.slice(p,f),d-=h.byteLength,p=f,0!==d?[3,3]:(u=!1,[4,{type:o,flags:s.Flags.FOLLOWS|s.Flags.METADATA,data:void 0,metadata:h,streamId:e}])):[3,3];case 2:n.sent(),h=void 0,d=r,n.label=3;case 3:return p<c?(d-=s.Lengths.METADATA,f=Math.min(c,p+d),h=t.metadata.slice(p,f),d-=h.byteLength,p=f,0!==d&&0!==l?[3,5]:[4,{type:s.FrameTypes.PAYLOAD,flags:s.Flags.NEXT|s.Flags.METADATA|(p===c&&a&&0===l?s.Flags.COMPLETE:s.Flags.FOLLOWS),data:void 0,metadata:h,streamId:e}]):[3,6];case 4:n.sent(),h=void 0,d=r,n.label=5;case 5:return[3,3];case 6:return m=0,u?(y=Math.min(l,m+d),g=t.data.slice(m,y),d-=g.byteLength,m=y,[4,{type:o,flags:s.Flags.FOLLOWS|(h?s.Flags.METADATA:s.Flags.NONE),data:g,metadata:h,streamId:e}]):[3,8];case 7:n.sent(),h=void 0,g=void 0,d=r,n.label=8;case 8:return m<l?(y=Math.min(l,m+d),g=t.data.slice(m,y),d-=g.byteLength,m=y,[4,{type:s.FrameTypes.PAYLOAD,flags:m===l?(a?s.Flags.COMPLETE:s.Flags.NONE)|s.Flags.NEXT|(h?s.Flags.METADATA:0):s.Flags.FOLLOWS|s.Flags.NEXT|(h?s.Flags.METADATA:0),data:g,metadata:h,streamId:e}]):[3,10];case 9:return n.sent(),h=void 0,g=void 0,d=r,[3,8];case 10:return[2]}})},t.fragmentWithRequestN=function(e,t,r,o,a,l){var u,d,h,c,p,f,m,g,y,v,b,I;return void 0===l&&(l=!1),n(this,function(n){switch(n.label){case 0:return u=null!==(I=null===(b=t.data)||void 0===b?void 0:b.byteLength)&&void 0!==I?I:0,d=!0,h=r,t.metadata?0!==(p=t.metadata.byteLength)?[3,1]:(h-=s.Lengths.METADATA,c=i.allocUnsafe(0),[3,6]):[3,6];case 1:return f=0,d?(h-=s.Lengths.METADATA+s.Lengths.REQUEST,m=Math.min(p,f+h),c=t.metadata.slice(f,m),h-=c.byteLength,f=m,0!==h?[3,3]:(d=!1,[4,{type:o,flags:s.Flags.FOLLOWS|s.Flags.METADATA,data:void 0,requestN:a,metadata:c,streamId:e}])):[3,3];case 2:n.sent(),c=void 0,h=r,n.label=3;case 3:return f<p?(h-=s.Lengths.METADATA,m=Math.min(p,f+h),c=t.metadata.slice(f,m),h-=c.byteLength,f=m,0!==h&&0!==u?[3,5]:[4,{type:s.FrameTypes.PAYLOAD,flags:s.Flags.NEXT|s.Flags.METADATA|(f===p&&l&&0===u?s.Flags.COMPLETE:s.Flags.FOLLOWS),data:void 0,metadata:c,streamId:e}]):[3,6];case 4:n.sent(),c=void 0,h=r,n.label=5;case 5:return[3,3];case 6:return g=0,d?(h-=s.Lengths.REQUEST,v=Math.min(u,g+h),y=t.data.slice(g,v),h-=y.byteLength,g=v,[4,{type:o,flags:s.Flags.FOLLOWS|(c?s.Flags.METADATA:s.Flags.NONE),data:y,requestN:a,metadata:c,streamId:e}]):[3,8];case 7:n.sent(),c=void 0,y=void 0,h=r,n.label=8;case 8:return g<u?(v=Math.min(u,g+h),y=t.data.slice(g,v),h-=y.byteLength,g=v,[4,{type:s.FrameTypes.PAYLOAD,flags:g===u?(l?s.Flags.COMPLETE:s.Flags.NONE)|s.Flags.NEXT|(c?s.Flags.METADATA:0):s.Flags.FOLLOWS|s.Flags.NEXT|(c?s.Flags.METADATA:0),data:y,metadata:c,streamId:e}]):[3,10];case 9:return n.sent(),c=void 0,y=void 0,h=r,[3,8];case 10:return[2]}})}},526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],i=t[1];return 3*(r+i)/4-i},t.toByteArray=function(e){var t,r,s=a(e),o=s[0],l=s[1],u=new n(function(e,t,r){return 3*(t+r)/4-r}(0,o,l)),d=0,h=l>0?o-4:o;for(r=0;r<h;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[d++]=t>>16&255,u[d++]=t>>8&255,u[d++]=255&t;return 2===l&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[d++]=255&t),1===l&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[d++]=t>>8&255,u[d++]=255&t),u},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],o=16383,a=0,l=i-n;a<l;a+=o)s.push(u(e,a,a+o>l?l:a+o));return 1===n?(t=e[i-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function u(e,t,r){for(var i,n=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),n.push(l(i));return n.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},546:function(e,t){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0;var i=function(){function e(){this._done=!1,this.onCloseCallbacks=[]}return Object.defineProperty(e.prototype,"done",{get:function(){return this._done},enumerable:!1,configurable:!0}),e.prototype.close=function(e){var t,i,n,s;if(this.done)console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):""));else if(this._done=!0,this._error=e,e)try{for(var o=r(this.onCloseCallbacks),a=o.next();!a.done;a=o.next())(0,a.value)(e)}catch(e){t={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}else try{for(var l=r(this.onCloseCallbacks),u=l.next();!u.done;u=l.next())(0,u.value)()}catch(e){n={error:e}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(n)throw n.error}}},e.prototype.onClose=function(e){this._done?e(this._error):this.onCloseCallbacks.push(e)},e}();t.Deferred=i},632:function(e,t){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.WellKnownAuthType=void 0;var i=function(){function e(e,t){this.string=e,this.identifier=t}return e.fromIdentifier=function(t){return t<0||t>127?e.UNPARSEABLE_AUTH_TYPE:e.TYPES_BY_AUTH_ID[t]},e.fromString=function(t){if(!t)throw new Error("type must be non-null");return t===e.UNKNOWN_RESERVED_AUTH_TYPE.string?e.UNPARSEABLE_AUTH_TYPE:e.TYPES_BY_AUTH_STRING.get(t)||e.UNPARSEABLE_AUTH_TYPE},e.prototype.toString=function(){return this.string},e}();t.WellKnownAuthType=i,function(e){var t,i;e.UNPARSEABLE_AUTH_TYPE=new e("UNPARSEABLE_AUTH_TYPE_DO_NOT_USE",-2),e.UNKNOWN_RESERVED_AUTH_TYPE=new e("UNKNOWN_YET_RESERVED_DO_NOT_USE",-1),e.SIMPLE=new e("simple",0),e.BEARER=new e("bearer",1),e.TYPES_BY_AUTH_ID=new Array(128),e.TYPES_BY_AUTH_STRING=new Map;var n=[e.UNPARSEABLE_AUTH_TYPE,e.UNKNOWN_RESERVED_AUTH_TYPE,e.SIMPLE,e.BEARER];e.TYPES_BY_AUTH_ID.fill(e.UNKNOWN_RESERVED_AUTH_TYPE);try{for(var s=r(n),o=s.next();!o.done;o=s.next()){var a=o.value;a.identifier>=0&&(e.TYPES_BY_AUTH_ID[a.identifier]=a,e.TYPES_BY_AUTH_STRING.set(a.string,a))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}Object.seal&&Object.seal(e.TYPES_BY_AUTH_ID)}(i=t.WellKnownAuthType||(t.WellKnownAuthType={})),t.WellKnownAuthType=i},698:function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer=t.ResumableClientServerInputMultiplexerDemultiplexer=t.ClientServerInputMultiplexerDemultiplexer=t.StreamIdGenerator=void 0;var a=r(225),l=r(546),u=r(766),d=r(799);!function(e){e.create=function(e){return new t(e)};var t=function(){function e(e){this.currentId=e}return e.prototype.next=function(e){var t=this.currentId+2;e(t)&&(this.currentId=t)},e}()}(t.StreamIdGenerator||(t.StreamIdGenerator={}));var h=function(e){function t(t,r,i){var n=e.call(this)||this;return n.streamIdSupplier=t,n.outbound=r,n.closeable=i,n.registry={},i.onClose(n.close.bind(n)),n}return n(t,e),t.prototype.handle=function(e){if(d.Frame.isConnection(e)){if(e.type===a.FrameTypes.RESERVED)return;this.connectionFramesHandler.handle(e)}else if(d.Frame.isRequest(e)){if(this.registry[e.streamId])return;this.requestFramesHandler.handle(e,this)}else{var t=this.registry[e.streamId];if(!t)return;t.handle(e)}},t.prototype.connectionInbound=function(e){if(this.connectionFramesHandler)throw new Error("Connection frame handler has already been installed");this.connectionFramesHandler=e},t.prototype.handleRequestStream=function(e){if(this.requestFramesHandler)throw new Error("Stream handler has already been installed");this.requestFramesHandler=e},t.prototype.send=function(e){this.outbound.send(e)},Object.defineProperty(t.prototype,"connectionOutbound",{get:function(){return this},enumerable:!1,configurable:!0}),t.prototype.createRequestStream=function(e){var t=this;if(this.done)e.handleReject(new Error("Already closed"));else{var r=this.registry;this.streamIdSupplier.next(function(r){return e.handleReady(r,t)},Object.keys(r))}},t.prototype.connect=function(e){this.registry[e.streamId]=e},t.prototype.disconnect=function(e){delete this.registry[e.streamId]},t.prototype.close=function(t){if(this.done)e.prototype.close.call(this,t);else{for(var r in this.registry)this.registry[r].close(new Error("Closed. ".concat(t?"Original cause [".concat(t,"]."):"")));e.prototype.close.call(this,t)}},t}(l.Deferred);t.ClientServerInputMultiplexerDemultiplexer=h;var c=function(e){function t(t,r,i,n,s,o,a){var u=e.call(this,t,r,new l.Deferred)||this;return u.frameStore=n,u.token=s,u.sessionTimeout=a,o instanceof Function?u.reconnector=o:u.sessionStore=o,i.onClose(u.handleConnectionClose.bind(u)),u}return n(t,e),t.prototype.send=function(t){if(d.Frame.isConnection(t)){if(t.type===a.FrameTypes.KEEPALIVE)t.lastReceivedPosition=this.frameStore.lastReceivedFramePosition;else if(t.type===a.FrameTypes.ERROR)return this.outbound.send(t),this.sessionStore&&delete this.sessionStore[this.token],void e.prototype.close.call(this,new u.RSocketError(t.code,t.message))}else this.frameStore.store(t);this.outbound.send(t)},t.prototype.handle=function(t){if(d.Frame.isConnection(t)){if(t.type===a.FrameTypes.KEEPALIVE)try{this.frameStore.dropTo(t.lastReceivedPosition)}catch(e){this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),this.close(e)}else if(t.type===a.FrameTypes.ERROR)return e.prototype.handle.call(this,t),this.sessionStore&&delete this.sessionStore[this.token],void e.prototype.close.call(this,new u.RSocketError(t.code,t.message))}else this.frameStore.record(t);e.prototype.handle.call(this,t)},t.prototype.resume=function(e,t,r){switch(this.outbound=t,e.type){case a.FrameTypes.RESUME:if(clearTimeout(this.timeoutId),this.frameStore.lastReceivedFramePosition<e.clientPosition){var i=new u.RSocketError(a.ErrorCodes.REJECTED_RESUME,"Impossible to resume since first available client frame position is greater than last received server frame position");return this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:i.code,message:i.message}),void this.close(i)}try{this.frameStore.dropTo(e.serverPosition)}catch(e){return this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),void this.close(e)}this.outbound.send({type:a.FrameTypes.RESUME_OK,streamId:0,flags:a.Flags.NONE,clientPosition:this.frameStore.lastReceivedFramePosition});break;case a.FrameTypes.RESUME_OK:try{this.frameStore.dropTo(e.clientPosition)}catch(e){this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),this.close(e)}}this.frameStore.drain(this.outbound.send.bind(this.outbound)),r.onClose(this.handleConnectionClose.bind(this)),this.connectionFramesHandler.resume()},t.prototype.handleConnectionClose=function(e){return s(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:if(this.connectionFramesHandler.pause(),!this.reconnector)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.reconnector(this,this.frameStore)];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),this.close(e),[3,4];case 4:return[3,6];case 5:this.timeoutId=setTimeout(this.close.bind(this),this.sessionTimeout),t.label=6;case 6:return[2]}})})},t}(h);t.ResumableClientServerInputMultiplexerDemultiplexer=c;var p=function(){function e(e,t,r){this.outbound=e,this.closeable=t,this.delegate=r,this.resumed=!1}return e.prototype.close=function(){this.delegate.close()},e.prototype.onClose=function(e){this.delegate.onClose(e)},Object.defineProperty(e.prototype,"connectionOutbound",{get:function(){return this.delegate.connectionOutbound},enumerable:!1,configurable:!0}),e.prototype.createRequestStream=function(e){this.delegate.createRequestStream(e)},e.prototype.connectionInbound=function(e){this.delegate.connectionInbound(e)},e.prototype.handleRequestStream=function(e){this.delegate.handleRequestStream(e)},e.prototype.handle=function(e){var t=this;if(!this.resumed)return e.type===a.FrameTypes.RESUME_OK?(this.resumed=!0,void this.delegate.resume(e,this.outbound,this.closeable)):(this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,code:a.ErrorCodes.CONNECTION_ERROR,message:"Incomplete RESUME handshake. Unexpected frame ".concat(e.type," received"),flags:a.Flags.NONE}),this.closeable.close(),void this.closeable.onClose(function(){return t.delegate.close(new u.RSocketError(a.ErrorCodes.CONNECTION_ERROR,"Incomplete RESUME handshake. Unexpected frame ".concat(e.type," received")))}));this.delegate.handle(e)},e}();t.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer=p},706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketClientTransport=void 0;var i=r(225),n=r(318),s=function(){function e(e){var t;this.url=e.url,this.factory=null!==(t=e.wsCreator)&&void 0!==t?t:function(e){return new WebSocket(e)}}return e.prototype.connect=function(e){var t=this;return new Promise(function(r,s){var o=t.factory(t.url);o.binaryType="arraybuffer";var a=function(){o.removeEventListener("open",a),o.removeEventListener("error",l),r(new n.WebsocketDuplexConnection(o,new i.Deserializer,e))},l=function(e){o.removeEventListener("open",a),o.removeEventListener("error",l),s(e.error)};o.addEventListener("open",a),o.addEventListener("error",l)})},e}();t.WebsocketClientTransport=s},766:function(e,t){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCodes=t.RSocketError=void 0;var n,s=function(e){function t(t,r){var i=e.call(this,r)||this;return i.code=t,i}return i(t,e),t}(Error);t.RSocketError=s,(n=t.ErrorCodes||(t.ErrorCodes={}))[n.RESERVED=0]="RESERVED",n[n.INVALID_SETUP=1]="INVALID_SETUP",n[n.UNSUPPORTED_SETUP=2]="UNSUPPORTED_SETUP",n[n.REJECTED_SETUP=3]="REJECTED_SETUP",n[n.REJECTED_RESUME=4]="REJECTED_RESUME",n[n.CONNECTION_CLOSE=258]="CONNECTION_CLOSE",n[n.CONNECTION_ERROR=257]="CONNECTION_ERROR",n[n.APPLICATION_ERROR=513]="APPLICATION_ERROR",n[n.REJECTED=514]="REJECTED",n[n.CANCELED=515]="CANCELED",n[n.INVALID=516]="INVALID",n[n.RESERVED_EXTENSION=4294967295]="RESERVED_EXTENSION"},777:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((i=i.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RSocketServer=void 0;var s=r(698),o=r(766),a=r(799),l=r(923),u=r(366),d=function(){function e(e){var t,r;this.acceptor=e.acceptor,this.transport=e.transport,this.lease=e.lease,this.serverSideKeepAlive=e.serverSideKeepAlive,this.sessionStore=e.resume?{}:void 0,this.sessionTimeout=null!==(r=null===(t=e.resume)||void 0===t?void 0:t.sessionTimeout)&&void 0!==r?r:void 0}return e.prototype.bind=function(){return i(this,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this.transport.bind(function(t,r){return i(e,void 0,void 0,function(){var e,i,s,u,d,h,c,p,f,m,g,y,v;return n(this,function(n){switch(n.label){case 0:switch(t.type){case a.FrameTypes.SETUP:return[3,1];case a.FrameTypes.RESUME:return[3,5]}return[3,6];case 1:return n.trys.push([1,3,,4]),this.lease&&!a.Flags.hasLease(t.flags)?(e=new o.RSocketError(o.ErrorCodes.REJECTED_SETUP,"Lease has to be enabled"),r.multiplexerDemultiplexer.connectionOutbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),r.close(e),[2]):a.Flags.hasLease(t.flags)&&!this.lease?(e=new o.RSocketError(o.ErrorCodes.REJECTED_SETUP,"Lease has to be disabled"),r.multiplexerDemultiplexer.connectionOutbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),r.close(e),[2]):(i=a.Flags.hasLease(t.flags)?new l.LeaseHandler(null!==(m=this.lease.maxPendingRequests)&&void 0!==m?m:256,r.multiplexerDemultiplexer):void 0,s=new l.RSocketRequester(r,null!==(y=null===(g=this.fragmentation)||void 0===g?void 0:g.maxOutboundFragmentSize)&&void 0!==y?y:0,i),[4,this.acceptor.accept({data:t.data,dataMimeType:t.dataMimeType,metadata:t.metadata,metadataMimeType:t.metadataMimeType,flags:t.flags,keepAliveMaxLifetime:t.lifetime,keepAliveInterval:t.keepAlive,resumeToken:t.resumeToken},s)]);case 2:return u=n.sent(),d=new l.KeepAliveHandler(r,t.lifetime),h=this.serverSideKeepAlive?new l.KeepAliveSender(r.multiplexerDemultiplexer.connectionOutbound,t.keepAlive):void 0,c=new l.DefaultConnectionFrameHandler(r,d,h,i,u),p=new l.DefaultStreamRequestHandler(u,0),r.onClose(function(e){null==h||h.close(),d.close(),c.close(e)}),r.multiplexerDemultiplexer.connectionInbound(c),r.multiplexerDemultiplexer.handleRequestStream(p),d.start(),null==h||h.start(),[3,4];case 3:return f=n.sent(),r.multiplexerDemultiplexer.connectionOutbound.send({type:a.FrameTypes.ERROR,streamId:0,code:o.ErrorCodes.REJECTED_SETUP,message:null!==(v=f.message)&&void 0!==v?v:"",flags:a.Flags.NONE}),r.close(f instanceof o.RSocketError?f:new o.RSocketError(o.ErrorCodes.REJECTED_SETUP,f.message)),[3,4];case 4:case 5:return[2];case 6:r.multiplexerDemultiplexer.connectionOutbound.send({type:a.FrameTypes.ERROR,streamId:0,code:o.ErrorCodes.UNSUPPORTED_SETUP,message:"Unsupported setup",flags:a.Flags.NONE}),r.close(new o.RSocketError(o.ErrorCodes.UNSUPPORTED_SETUP)),n.label=7;case 7:return[2]}})})},function(t,r){if(t.type===a.FrameTypes.RESUME){if(e.sessionStore){var i=e.sessionStore[t.resumeToken.toString()];return i?(i.resume(t,r,r),i):(r.send({type:a.FrameTypes.ERROR,streamId:0,code:o.ErrorCodes.REJECTED_RESUME,message:"No session found for the given resume token",flags:a.Flags.NONE}),void r.close())}return r.send({type:a.FrameTypes.ERROR,streamId:0,code:o.ErrorCodes.REJECTED_RESUME,message:"Resume is not enabled",flags:a.Flags.NONE}),void r.close()}if(t.type===a.FrameTypes.SETUP&&a.Flags.hasResume(t.flags)){if(!e.sessionStore){var n=new o.RSocketError(o.ErrorCodes.REJECTED_SETUP,"No resume support");return r.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:n.code,message:n.message}),void r.close(n)}var l=new s.ResumableClientServerInputMultiplexerDemultiplexer(s.StreamIdGenerator.create(0),r,r,new u.FrameStore,t.resumeToken.toString(),e.sessionStore,e.sessionTimeout);return e.sessionStore[t.resumeToken.toString()]=l,l}return new s.ClientServerInputMultiplexerDemultiplexer(s.StreamIdGenerator.create(0),r,r)})];case 1:return[2,t.sent()]}})})},e}();t.RSocketServer=d},796:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestStreamResponderStream=t.RequestStreamRequesterStream=void 0;var a=r(766),l=r(438),u=r(799),d=s(r(76)),h=function(){function e(e,t,r,i,n){this.payload=e,this.receiver=t,this.fragmentSize=r,this.initialRequestN=i,this.leaseManager=n,this.streamType=u.FrameTypes.REQUEST_STREAM}return e.prototype.handleReady=function(e,t){var r,i;if(this.done)return!1;if(this.streamId=e,this.stream=t,t.connect(this),(0,l.isFragmentable)(this.payload,this.fragmentSize,u.FrameTypes.REQUEST_STREAM))try{for(var n=o((0,l.fragmentWithRequestN)(e,this.payload,this.fragmentSize,u.FrameTypes.REQUEST_STREAM,this.initialRequestN)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.REQUEST_STREAM,data:this.payload.data,metadata:this.payload.metadata,requestN:this.initialRequestN,flags:void 0!==this.payload.metadata?u.Flags.METADATA:0,streamId:e});return this.hasExtension&&this.stream.send({type:u.FrameTypes.EXT,streamId:e,extendedContent:this.extendedContent,extendedType:this.extendedType,flags:this.flags}),!0},e.prototype.handleReject=function(e){this.done||(this.done=!0,this.receiver.onError(e))},e.prototype.handle=function(e){var t,r=e.type;switch(r){case u.FrameTypes.PAYLOAD:var i=u.Flags.hasComplete(e.flags),n=u.Flags.hasNext(e.flags);if(i||!u.Flags.hasFollows(e.flags)){if(i&&(this.done=!0,this.stream.disconnect(this),!n))return void this.receiver.onComplete();var s=this.hasFragments?d.reassemble(this,e.data,e.metadata):{data:e.data,metadata:e.metadata};return void this.receiver.onNext(s,i)}if(!d.add(this,e.data,e.metadata)){t="Unexpected fragment size";break}return;case u.FrameTypes.ERROR:return this.done=!0,this.stream.disconnect(this),d.cancel(this),void this.receiver.onError(new a.RSocketError(e.code,e.message));case u.FrameTypes.EXT:if(this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));default:t="Unexpected frame type [".concat(r,"]")}this.close(new a.RSocketError(a.ErrorCodes.CANCELED,t)),this.stream.send({type:u.FrameTypes.CANCEL,streamId:this.streamId,flags:u.Flags.NONE}),this.stream.disconnect(this)},e.prototype.request=function(e){this.done||(this.streamId?this.stream.send({type:u.FrameTypes.REQUEST_N,flags:u.Flags.NONE,requestN:e,streamId:this.streamId}):this.initialRequestN+=e)},e.prototype.cancel=function(){var e;this.done||(this.done=!0,this.streamId?(this.stream.send({type:u.FrameTypes.CANCEL,flags:u.Flags.NONE,streamId:this.streamId}),this.stream.disconnect(this),d.cancel(this)):null===(e=this.leaseManager)||void 0===e||e.cancelRequest(this))},e.prototype.onExtension=function(e,t,r){if(!this.done)return this.streamId?void this.stream.send({streamId:this.streamId,type:u.FrameTypes.EXT,extendedType:e,extendedContent:t,flags:r?u.Flags.IGNORE:u.Flags.NONE}):(this.hasExtension=!0,this.extendedType=e,this.extendedContent=t,void(this.flags=r?u.Flags.IGNORE:u.Flags.NONE))},e.prototype.close=function(e){this.done||(this.done=!0,d.cancel(this),e?this.receiver.onError(e):this.receiver.onComplete())},e}();t.RequestStreamRequesterStream=h;var c=function(){function e(e,t,r,i,n){if(this.streamId=e,this.stream=t,this.fragmentSize=r,this.handler=i,this.streamType=u.FrameTypes.REQUEST_STREAM,t.connect(this),u.Flags.hasFollows(n.flags))return this.initialRequestN=n.requestN,void d.add(this,n.data,n.metadata);var s={data:n.data,metadata:n.metadata};try{this.receiver=i(s,n.requestN,this)}catch(e){this.onError(e)}}return e.prototype.handle=function(e){var t,r;if(!this.receiver||this.hasFragments)if(e.type===u.FrameTypes.PAYLOAD){if(!u.Flags.hasFollows(e.flags)){var i=d.reassemble(this,e.data,e.metadata);try{this.receiver=this.handler(i,this.initialRequestN,this)}catch(e){this.onError(e)}return}if(d.add(this,e.data,e.metadata))return;r="Unexpected frame size"}else r="Unexpected frame type [".concat(e.type,"] during reassembly");else{if(e.type===u.FrameTypes.REQUEST_N)return void this.receiver.request(e.requestN);if(e.type===u.FrameTypes.EXT)return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));r="Unexpected frame type [".concat(e.type,"]")}this.done=!0,d.cancel(this),null===(t=this.receiver)||void 0===t||t.cancel(),e.type!==u.FrameTypes.CANCEL&&e.type!==u.FrameTypes.ERROR&&this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:a.ErrorCodes.CANCELED,message:r,streamId:this.streamId}),this.stream.disconnect(this)},e.prototype.onError=function(e){this.done?console.warn("Trying to error for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(this.done=!0,this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:e instanceof a.RSocketError?e.code:a.ErrorCodes.APPLICATION_ERROR,message:e.message,streamId:this.streamId}),this.stream.disconnect(this))},e.prototype.onNext=function(e,t){var r,i;if(!this.done){if(t&&(this.done=!0),(0,l.isFragmentable)(e,this.fragmentSize,u.FrameTypes.PAYLOAD))try{for(var n=o((0,l.fragment)(this.streamId,e,this.fragmentSize,u.FrameTypes.PAYLOAD,t)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.NEXT|(t?u.Flags.COMPLETE:u.Flags.NONE)|(e.metadata?u.Flags.METADATA:u.Flags.NONE),data:e.data,metadata:e.metadata,streamId:this.streamId});t&&this.stream.disconnect(this)}},e.prototype.onComplete=function(){this.done||(this.done=!0,this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.COMPLETE,streamId:this.streamId,data:null,metadata:null}),this.stream.disconnect(this))},e.prototype.onExtension=function(e,t,r){this.done||this.stream.send({type:u.FrameTypes.EXT,streamId:this.streamId,flags:r?u.Flags.IGNORE:u.Flags.NONE,extendedType:e,extendedContent:t})},e.prototype.close=function(e){var t;this.done?console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(d.cancel(this),null===(t=this.receiver)||void 0===t||t.cancel())},e}();t.RequestStreamResponderStream=c},799:(e,t)=>{"use strict";var r,i,n,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Frame=t.Lengths=t.Flags=t.FrameTypes=void 0,function(e){e[e.RESERVED=0]="RESERVED",e[e.SETUP=1]="SETUP",e[e.LEASE=2]="LEASE",e[e.KEEPALIVE=3]="KEEPALIVE",e[e.REQUEST_RESPONSE=4]="REQUEST_RESPONSE",e[e.REQUEST_FNF=5]="REQUEST_FNF",e[e.REQUEST_STREAM=6]="REQUEST_STREAM",e[e.REQUEST_CHANNEL=7]="REQUEST_CHANNEL",e[e.REQUEST_N=8]="REQUEST_N",e[e.CANCEL=9]="CANCEL",e[e.PAYLOAD=10]="PAYLOAD",e[e.ERROR=11]="ERROR",e[e.METADATA_PUSH=12]="METADATA_PUSH",e[e.RESUME=13]="RESUME",e[e.RESUME_OK=14]="RESUME_OK",e[e.EXT=63]="EXT"}(r=t.FrameTypes||(t.FrameTypes={})),(s=t.Flags||(t.Flags={}))[s.NONE=0]="NONE",s[s.COMPLETE=64]="COMPLETE",s[s.FOLLOWS=128]="FOLLOWS",s[s.IGNORE=512]="IGNORE",s[s.LEASE=64]="LEASE",s[s.METADATA=256]="METADATA",s[s.NEXT=32]="NEXT",s[s.RESPOND=128]="RESPOND",s[s.RESUME_ENABLE=128]="RESUME_ENABLE",function(e){e.hasMetadata=function(t){return(t&e.METADATA)===e.METADATA},e.hasComplete=function(t){return(t&e.COMPLETE)===e.COMPLETE},e.hasNext=function(t){return(t&e.NEXT)===e.NEXT},e.hasFollows=function(t){return(t&e.FOLLOWS)===e.FOLLOWS},e.hasIgnore=function(t){return(t&e.IGNORE)===e.IGNORE},e.hasRespond=function(t){return(t&e.RESPOND)===e.RESPOND},e.hasLease=function(t){return(t&e.LEASE)===e.LEASE},e.hasResume=function(t){return(t&e.RESUME_ENABLE)===e.RESUME_ENABLE}}(t.Flags||(t.Flags={})),(n=t.Lengths||(t.Lengths={}))[n.FRAME=3]="FRAME",n[n.HEADER=6]="HEADER",n[n.METADATA=3]="METADATA",n[n.REQUEST=3]="REQUEST",(i=t.Frame||(t.Frame={})).isConnection=function(e){return 0===e.streamId},i.isRequest=function(e){return r.REQUEST_RESPONSE<=e.type&&e.type<=r.REQUEST_CHANNEL}},814:function(e,t,r){"use strict";var i=r(287).hp,n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeRoutes=t.encodeRoute=t.encodeRoutes=t.RoutingMetadata=void 0;var s=function(){function e(e){this._buffer=e}return e.prototype.iterator=function(){return a(this._buffer)},e.prototype[Symbol.iterator]=function(){return a(this._buffer)},e}();function o(e){var t=i.from(e,"utf8");if(t.length>255)throw new Error("route length should fit into unsigned byte length but the given one is ".concat(t.length));var r=i.allocUnsafe(1);return r.writeUInt8(t.length),i.concat([r,t])}function a(e){var t,r,i,s;return n(this,function(n){switch(n.label){case 0:t=e.byteLength,r=0,n.label=1;case 1:if(!(r<t))return[3,3];if(i=e.readUInt8(r++),r+i>t)throw new Error("Malformed RouteMetadata. Offset(".concat(r,") + RouteLength(").concat(i,") is greater than TotalLength"));return s=e.toString("utf8",r,r+i),r+=i,[4,s];case 2:return n.sent(),[3,1];case 3:return[2]}})}t.RoutingMetadata=s,t.encodeRoutes=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length<1)throw new Error("routes should be non empty array");return i.concat(e.map(function(e){return o(e)}))},t.encodeRoute=o,t.decodeRoutes=a},837:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(279),t),n(r(34),t),n(r(890),t),n(r(814),t),n(r(632),t)},890:(e,t,r)=>{"use strict";var i=r(287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSimpleAuthPayload=t.decodeAuthMetadata=t.encodeBearerAuthMetadata=t.encodeSimpleAuthMetadata=t.encodeCustomAuthMetadata=t.encodeWellKnownAuthMetadata=void 0;var n=r(632);t.encodeWellKnownAuthMetadata=function(e,t){if(e===n.WellKnownAuthType.UNPARSEABLE_AUTH_TYPE||e===n.WellKnownAuthType.UNKNOWN_RESERVED_AUTH_TYPE)throw new Error("Illegal WellKnownAuthType[".concat(e.toString(),"]. Only allowed AuthType should be used"));var r=i.allocUnsafe(1);return r.writeUInt8(128|e.identifier),i.concat([r,t])},t.encodeCustomAuthMetadata=function(e,t){var r=i.from(e);if(r.byteLength!==e.length)throw new Error("Custom auth type must be US_ASCII characters only");if(r.byteLength<1||r.byteLength>128)throw new Error("Custom auth type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128");var n=i.allocUnsafe(1+r.byteLength);return n.writeUInt8(r.byteLength-1),n.write(e,1),i.concat([n,t])},t.encodeSimpleAuthMetadata=function(e,t){var r=i.from(e),s=i.from(t),o=r.byteLength;if(o>65535)throw new Error("Username should be shorter than or equal to 65535 bytes length in UTF-8 encoding but the given was ".concat(o));var a=i.allocUnsafe(3);return a.writeUInt8(128|n.WellKnownAuthType.SIMPLE.identifier),a.writeUInt16BE(o,1),i.concat([a,r,s])},t.encodeBearerAuthMetadata=function(e){var t=i.from(e),r=i.allocUnsafe(1);return r.writeUInt8(128|n.WellKnownAuthType.BEARER.identifier),i.concat([r,t])},t.decodeAuthMetadata=function(e){if(e.byteLength<1)throw new Error("Unable to decode Auth metadata. Not enough readable bytes");var t=e.readUInt8(),r=127&t;if(r!==t){var i=n.WellKnownAuthType.fromIdentifier(r);return{payload:e.slice(1),type:{identifier:i.identifier,string:i.string}}}var s=t+1;if(e.byteLength<s+1)throw new Error("Unable to decode custom Auth type. Malformed length or auth type string");var o=e.toString("utf8",1,1+s);return{payload:e.slice(s+1),type:{identifier:n.WellKnownAuthType.UNPARSEABLE_AUTH_TYPE.identifier,string:o}}},t.decodeSimpleAuthPayload=function(e){if(e.byteLength<2)throw new Error("Unable to decode Simple Auth Payload. Not enough readable bytes");var t=e.readUInt16BE();if(e.byteLength<t+2)throw new Error("Unable to decode Simple Auth Payload. Not enough readable bytes");var r=e.slice(2,2+t);return{password:e.slice(2+t),username:r}}},923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeepAliveSender=t.KeepAliveHandler=t.DefaultConnectionFrameHandler=t.DefaultStreamRequestHandler=t.LeaseHandler=t.RSocketRequester=void 0;var i=r(766),n=r(799),s=r(33),o=r(320),a=r(947),l=r(796),u=function(){function e(e,t,r){this.connection=e,this.fragmentSize=t,this.leaseManager=r}return e.prototype.fireAndForget=function(e,t){var r=new o.RequestFnFRequesterStream(e,t,this.fragmentSize,this.leaseManager);return this.leaseManager?this.leaseManager.requestLease(r):this.connection.multiplexerDemultiplexer.createRequestStream(r),r},e.prototype.requestResponse=function(e,t){var r=new a.RequestResponseRequesterStream(e,t,this.fragmentSize,this.leaseManager);return this.leaseManager?this.leaseManager.requestLease(r):this.connection.multiplexerDemultiplexer.createRequestStream(r),r},e.prototype.requestStream=function(e,t,r){var i=new l.RequestStreamRequesterStream(e,r,this.fragmentSize,t,this.leaseManager);return this.leaseManager?this.leaseManager.requestLease(i):this.connection.multiplexerDemultiplexer.createRequestStream(i),i},e.prototype.requestChannel=function(e,t,r,i){var n=new s.RequestChannelRequesterStream(e,r,i,this.fragmentSize,t,this.leaseManager);return this.leaseManager?this.leaseManager.requestLease(n):this.connection.multiplexerDemultiplexer.createRequestStream(n),n},e.prototype.metadataPush=function(e,t){throw new Error("Method not implemented.")},e.prototype.close=function(e){this.connection.close(e)},e.prototype.onClose=function(e){this.connection.onClose(e)},e}();t.RSocketRequester=u;var d=function(){function e(e,t){this.maxPendingRequests=e,this.multiplexer=t,this.pendingRequests=[],this.expirationTime=0,this.availableLease=0}return e.prototype.handle=function(e){for(this.expirationTime=e.ttl+Date.now(),this.availableLease=e.requestCount;this.availableLease>0&&this.pendingRequests.length>0;){var t=this.pendingRequests.shift();this.availableLease--,this.multiplexer.createRequestStream(t)}},e.prototype.requestLease=function(e){var t=this.availableLease;if(t>0&&Date.now()<this.expirationTime)return this.availableLease=t-1,void this.multiplexer.createRequestStream(e);this.pendingRequests.length>=this.maxPendingRequests?e.handleReject(new i.RSocketError(i.ErrorCodes.REJECTED,"No available lease given")):this.pendingRequests.push(e)},e.prototype.cancelRequest=function(e){var t=this.pendingRequests.indexOf(e);t>-1&&this.pendingRequests.splice(t,1)},e}();t.LeaseHandler=d;var h=function(){function e(e,t){this.rsocket=e,this.fragmentSize=t}return e.prototype.handle=function(e,t){switch(e.type){case n.FrameTypes.REQUEST_FNF:return void(this.rsocket.fireAndForget&&new o.RequestFnfResponderStream(e.streamId,t,this.rsocket.fireAndForget.bind(this.rsocket),e));case n.FrameTypes.REQUEST_RESPONSE:return this.rsocket.requestResponse?void new a.RequestResponseResponderStream(e.streamId,t,this.fragmentSize,this.rsocket.requestResponse.bind(this.rsocket),e):void this.rejectRequest(e.streamId,t);case n.FrameTypes.REQUEST_STREAM:return this.rsocket.requestStream?void new l.RequestStreamResponderStream(e.streamId,t,this.fragmentSize,this.rsocket.requestStream.bind(this.rsocket),e):void this.rejectRequest(e.streamId,t);case n.FrameTypes.REQUEST_CHANNEL:return this.rsocket.requestChannel?void new s.RequestChannelResponderStream(e.streamId,t,this.fragmentSize,this.rsocket.requestChannel.bind(this.rsocket),e):void this.rejectRequest(e.streamId,t)}},e.prototype.rejectRequest=function(e,t){t.send({type:n.FrameTypes.ERROR,streamId:e,flags:n.Flags.NONE,code:i.ErrorCodes.REJECTED,message:"No available handler found"})},e.prototype.close=function(){},e}();t.DefaultStreamRequestHandler=h;var c,p=function(){function e(e,t,r,i,n){this.connection=e,this.keepAliveHandler=t,this.keepAliveSender=r,this.leaseHandler=i,this.rsocket=n}return e.prototype.handle=function(e){switch(e.type){case n.FrameTypes.KEEPALIVE:return void this.keepAliveHandler.handle(e);case n.FrameTypes.LEASE:return this.leaseHandler?void this.leaseHandler.handle(e):void 0;case n.FrameTypes.ERROR:return void this.connection.close(new i.RSocketError(e.code,e.message));case n.FrameTypes.METADATA_PUSH:return void this.rsocket.metadataPush;default:this.connection.multiplexerDemultiplexer.connectionOutbound.send({type:n.FrameTypes.ERROR,streamId:0,flags:n.Flags.NONE,message:"Received unknown frame type",code:i.ErrorCodes.CONNECTION_ERROR})}},e.prototype.pause=function(){var e;this.keepAliveHandler.pause(),null===(e=this.keepAliveSender)||void 0===e||e.pause()},e.prototype.resume=function(){var e;this.keepAliveHandler.start(),null===(e=this.keepAliveSender)||void 0===e||e.start()},e.prototype.close=function(e){var t;this.keepAliveHandler.close(),null===(t=this.rsocket.close)||void 0===t||t.call(this.rsocket,e)},e}();t.DefaultConnectionFrameHandler=p,function(e){e[e.Paused=0]="Paused",e[e.Running=1]="Running",e[e.Closed=2]="Closed"}(c||(c={}));var f,m=function(){function e(e,t){this.connection=e,this.keepAliveTimeoutDuration=t,this.state=c.Paused,this.outbound=e.multiplexerDemultiplexer.connectionOutbound}return e.prototype.handle=function(e){this.keepAliveLastReceivedMillis=Date.now(),n.Flags.hasRespond(e.flags)&&this.outbound.send({type:n.FrameTypes.KEEPALIVE,streamId:0,data:e.data,flags:e.flags^n.Flags.RESPOND,lastReceivedPosition:0})},e.prototype.start=function(){this.state===c.Paused&&(this.keepAliveLastReceivedMillis=Date.now(),this.state=c.Running,this.activeTimeout=setTimeout(this.timeoutCheck.bind(this),this.keepAliveTimeoutDuration))},e.prototype.pause=function(){this.state===c.Running&&(this.state=c.Paused,clearTimeout(this.activeTimeout))},e.prototype.close=function(){this.state=c.Closed,clearTimeout(this.activeTimeout)},e.prototype.timeoutCheck=function(){var e=Date.now()-this.keepAliveLastReceivedMillis;e>=this.keepAliveTimeoutDuration?this.connection.close(new Error("No keep-alive acks for ".concat(this.keepAliveTimeoutDuration," millis"))):this.activeTimeout=setTimeout(this.timeoutCheck.bind(this),Math.max(100,this.keepAliveTimeoutDuration-e))},e}();t.KeepAliveHandler=m,function(e){e[e.Paused=0]="Paused",e[e.Running=1]="Running",e[e.Closed=2]="Closed"}(f||(f={}));var g=function(){function e(e,t){this.outbound=e,this.keepAlivePeriodDuration=t,this.state=f.Paused}return e.prototype.sendKeepAlive=function(){this.outbound.send({type:n.FrameTypes.KEEPALIVE,streamId:0,data:void 0,flags:n.Flags.RESPOND,lastReceivedPosition:0})},e.prototype.start=function(){this.state===f.Paused&&(this.state=f.Running,this.activeInterval=setInterval(this.sendKeepAlive.bind(this),this.keepAlivePeriodDuration))},e.prototype.pause=function(){this.state===f.Running&&(this.state=f.Paused,clearInterval(this.activeInterval))},e.prototype.close=function(){this.state=f.Closed,clearInterval(this.activeInterval)},e}();t.KeepAliveSender=g},927:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(706),t)},947:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestResponseResponderStream=t.RequestResponseRequesterStream=void 0;var a=r(766),l=r(438),u=r(799),d=s(r(76)),h=function(){function e(e,t,r,i){this.payload=e,this.receiver=t,this.fragmentSize=r,this.leaseManager=i,this.streamType=u.FrameTypes.REQUEST_RESPONSE}return e.prototype.handleReady=function(e,t){var r,i;if(this.done)return!1;if(this.streamId=e,this.stream=t,t.connect(this),(0,l.isFragmentable)(this.payload,this.fragmentSize,u.FrameTypes.REQUEST_RESPONSE))try{for(var n=o((0,l.fragment)(e,this.payload,this.fragmentSize,u.FrameTypes.REQUEST_RESPONSE)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.REQUEST_RESPONSE,data:this.payload.data,metadata:this.payload.metadata,flags:this.payload.metadata?u.Flags.METADATA:0,streamId:e});return this.hasExtension&&this.stream.send({type:u.FrameTypes.EXT,streamId:e,extendedContent:this.extendedContent,extendedType:this.extendedType,flags:this.flags}),!0},e.prototype.handleReject=function(e){this.done||(this.done=!0,this.receiver.onError(e))},e.prototype.handle=function(e){var t,r=e.type;switch(r){case u.FrameTypes.PAYLOAD:var i=u.Flags.hasComplete(e.flags),n=u.Flags.hasNext(e.flags);if(i||!u.Flags.hasFollows(e.flags)){if(this.done=!0,this.stream.disconnect(this),!n)return void this.receiver.onComplete();var s=this.hasFragments?d.reassemble(this,e.data,e.metadata):{data:e.data,metadata:e.metadata};return void this.receiver.onNext(s,!0)}if(!d.add(this,e.data,e.metadata)){t="Unexpected fragment size";break}return;case u.FrameTypes.ERROR:return this.done=!0,this.stream.disconnect(this),d.cancel(this),void this.receiver.onError(new a.RSocketError(e.code,e.message));case u.FrameTypes.EXT:if(this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));default:t="Unexpected frame type [".concat(r,"]")}this.close(new a.RSocketError(a.ErrorCodes.CANCELED,t)),this.stream.send({type:u.FrameTypes.CANCEL,streamId:this.streamId,flags:u.Flags.NONE}),this.stream.disconnect(this)},e.prototype.cancel=function(){var e;this.done||(this.done=!0,this.streamId?(this.stream.send({type:u.FrameTypes.CANCEL,flags:u.Flags.NONE,streamId:this.streamId}),this.stream.disconnect(this),d.cancel(this)):null===(e=this.leaseManager)||void 0===e||e.cancelRequest(this))},e.prototype.onExtension=function(e,t,r){if(!this.done)return this.streamId?void this.stream.send({streamId:this.streamId,type:u.FrameTypes.EXT,extendedType:e,extendedContent:t,flags:r?u.Flags.IGNORE:u.Flags.NONE}):(this.hasExtension=!0,this.extendedType=e,this.extendedContent=t,void(this.flags=r?u.Flags.IGNORE:u.Flags.NONE))},e.prototype.close=function(e){this.done||(this.done=!0,d.cancel(this),e?this.receiver.onError(e):this.receiver.onComplete())},e}();t.RequestResponseRequesterStream=h;var c=function(){function e(e,t,r,i,n){if(this.streamId=e,this.stream=t,this.fragmentSize=r,this.handler=i,this.streamType=u.FrameTypes.REQUEST_RESPONSE,t.connect(this),u.Flags.hasFollows(n.flags))d.add(this,n.data,n.metadata);else{var s={data:n.data,metadata:n.metadata};try{this.receiver=i(s,this)}catch(e){this.onError(e)}}}return e.prototype.handle=function(e){var t,r;if(!this.receiver||this.hasFragments)if(e.type===u.FrameTypes.PAYLOAD){if(!u.Flags.hasFollows(e.flags)){var i=d.reassemble(this,e.data,e.metadata);try{this.receiver=this.handler(i,this)}catch(e){this.onError(e)}return}if(d.add(this,e.data,e.metadata))return;r="Unexpected fragment size"}else r="Unexpected frame type [".concat(e.type,"] during reassembly");else{if(e.type===u.FrameTypes.EXT)return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));r="Unexpected frame type [".concat(e.type,"]")}this.done=!0,null===(t=this.receiver)||void 0===t||t.cancel(),e.type!==u.FrameTypes.CANCEL&&e.type!==u.FrameTypes.ERROR&&this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:a.ErrorCodes.CANCELED,message:r,streamId:this.streamId}),this.stream.disconnect(this),d.cancel(this)},e.prototype.onError=function(e){this.done?console.warn("Trying to error for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(this.done=!0,this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:e instanceof a.RSocketError?e.code:a.ErrorCodes.APPLICATION_ERROR,message:e.message,streamId:this.streamId}),this.stream.disconnect(this))},e.prototype.onNext=function(e,t){var r,i;if(!this.done){if(this.done=!0,(0,l.isFragmentable)(e,this.fragmentSize,u.FrameTypes.PAYLOAD))try{for(var n=o((0,l.fragment)(this.streamId,e,this.fragmentSize,u.FrameTypes.PAYLOAD,!0)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.NEXT|u.Flags.COMPLETE|(e.metadata?u.Flags.METADATA:0),data:e.data,metadata:e.metadata,streamId:this.streamId});this.stream.disconnect(this)}},e.prototype.onComplete=function(){this.done||(this.done=!0,this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.COMPLETE,streamId:this.streamId,data:null,metadata:null}),this.stream.disconnect(this))},e.prototype.onExtension=function(e,t,r){this.done||this.stream.send({type:u.FrameTypes.EXT,streamId:this.streamId,flags:r?u.Flags.IGNORE:u.Flags.NONE,extendedType:e,extendedContent:t})},e.prototype.close=function(e){var t;this.done?console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(d.cancel(this),null===(t=this.receiver)||void 0===t||t.cancel())},e}();t.RequestResponseResponderStream=c},974:function(e,t,r){"use strict";var i=r(287).hp,n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Deserializer=t.sizeOfFrame=t.serializeFrame=t.deserializeFrame=t.serializeFrameWithLength=t.deserializeFrames=t.deserializeFrameWithLength=t.writeUInt64BE=t.readUInt64BE=t.writeUInt24BE=t.readUInt24BE=t.MAX_VERSION=t.MAX_TTL=t.MAX_STREAM_ID=t.MAX_RESUME_LENGTH=t.MAX_REQUEST_N=t.MAX_REQUEST_COUNT=t.MAX_MIME_LENGTH=t.MAX_METADATA_LENGTH=t.MAX_LIFETIME=t.MAX_KEEPALIVE=t.MAX_CODE=t.FRAME_TYPE_OFFFSET=t.FLAGS_MASK=void 0;var s=r(799);t.FLAGS_MASK=1023,t.FRAME_TYPE_OFFFSET=10,t.MAX_CODE=2147483647,t.MAX_KEEPALIVE=2147483647,t.MAX_LIFETIME=2147483647,t.MAX_METADATA_LENGTH=16777215,t.MAX_MIME_LENGTH=255,t.MAX_REQUEST_COUNT=2147483647,t.MAX_REQUEST_N=2147483647,t.MAX_RESUME_LENGTH=65535,t.MAX_STREAM_ID=2147483647,t.MAX_TTL=2147483647,t.MAX_VERSION=65535;var o=4294967296;function a(e,t){return e.readUInt8(t)<<16|e.readUInt8(t+1)<<8|e.readUInt8(t+2)}function l(e,t,r){return r=e.writeUInt8(t>>>16,r),r=e.writeUInt8(t>>>8&255,r),e.writeUInt8(255&t,r)}function u(e,t){var r=e.readUInt32BE(t),i=e.readUInt32BE(t+4);return r*o+i}function d(e,t,r){var i=t/o|0,n=t%o;return r=e.writeUInt32BE(i,r),e.writeUInt32BE(n,r)}function h(e){var t=a(e,0);return p(e.slice(3,3+t))}function c(e){var t,r,i,s;return n(this,function(n){switch(n.label){case 0:t=0,n.label=1;case 1:return t+3<e.length?(r=a(e,t),(s=(i=t+3)+r)>e.length?[3,3]:[4,[p(e.slice(i,s)),t=s]]):[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}})}function p(e){var r=0,i=e.readInt32BE(r);r+=4;var n=e.readUInt16BE(r);r+=2;var o=n>>>t.FRAME_TYPE_OFFFSET,a=n&t.FLAGS_MASK;switch(o){case s.FrameTypes.SETUP:return function(e,t,r){e.length;var i=6,n=e.readUInt16BE(i);i+=2;var o=e.readUInt16BE(i);i+=2;var a=e.readInt32BE(i);i+=4;var l=e.readInt32BE(i);i+=4;var u=null;if(r&s.Flags.RESUME_ENABLE){var d=e.readInt16BE(i);i+=2,u=e.slice(i,i+d),i+=d}var h=e.readUInt8(i);i+=1;var c=e.toString("ascii",i,i+h);i+=h;var p=e.readUInt8(i);i+=1;var f=e.toString("ascii",i,i+p);i+=p;var m={data:null,dataMimeType:f,flags:r,keepAlive:a,lifetime:l,majorVersion:n,metadata:null,metadataMimeType:c,minorVersion:o,resumeToken:u,streamId:0,type:s.FrameTypes.SETUP};return T(e,m,i),m}(e,0,a);case s.FrameTypes.PAYLOAD:return function(e,t,r){e.length;var i={data:null,flags:r,metadata:null,streamId:t,type:s.FrameTypes.PAYLOAD};return T(e,i,6),i}(e,i,a);case s.FrameTypes.ERROR:return function(e,t,r){e.length;var i=6,n=e.readInt32BE(i);i+=4;var o=e.length-i,a="";return o>0&&(a=e.toString("utf8",i,i+o),i+=o),{code:n,flags:r,message:a,streamId:t,type:s.FrameTypes.ERROR}}(e,i,a);case s.FrameTypes.KEEPALIVE:return function(e,t,r){e.length;var i=6,n=u(e,i),o=null;return(i+=8)<e.length&&(o=e.slice(i,e.length)),{data:o,flags:r,lastReceivedPosition:n,streamId:0,type:s.FrameTypes.KEEPALIVE}}(e,0,a);case s.FrameTypes.REQUEST_FNF:return function(e,t,r){e.length;var i={data:null,flags:r,metadata:null,streamId:t,type:s.FrameTypes.REQUEST_FNF};return T(e,i,6),i}(e,i,a);case s.FrameTypes.REQUEST_RESPONSE:return function(e,t,r){var i={data:null,flags:r,metadata:null,streamId:t,type:s.FrameTypes.REQUEST_RESPONSE};return T(e,i,6),i}(e,i,a);case s.FrameTypes.REQUEST_STREAM:return function(e,t,r){e.length;var i=6,n=e.readInt32BE(i);i+=4;var o={data:null,flags:r,metadata:null,requestN:n,streamId:t,type:s.FrameTypes.REQUEST_STREAM};return T(e,o,i),o}(e,i,a);case s.FrameTypes.REQUEST_CHANNEL:return function(e,t,r){e.length;var i=6,n=e.readInt32BE(i);i+=4;var o={data:null,flags:r,metadata:null,requestN:n,streamId:t,type:s.FrameTypes.REQUEST_CHANNEL};return T(e,o,i),o}(e,i,a);case s.FrameTypes.METADATA_PUSH:return function(e,t,r){return{flags:r,metadata:6===length?null:e.slice(6,length),streamId:0,type:s.FrameTypes.METADATA_PUSH}}(e,0,a);case s.FrameTypes.REQUEST_N:return function(e,t,r){return e.length,{flags:r,requestN:e.readInt32BE(6),streamId:t,type:s.FrameTypes.REQUEST_N}}(e,i,a);case s.FrameTypes.RESUME:return function(e,t,r){e.length;var i=6,n=e.readUInt16BE(i);i+=2;var o=e.readUInt16BE(i);i+=2;var a=e.readInt16BE(i);i+=2;var l=e.slice(i,i+a),d=u(e,i+=a),h=u(e,i+=8);return i+=8,{clientPosition:h,flags:r,majorVersion:n,minorVersion:o,resumeToken:l,serverPosition:d,streamId:0,type:s.FrameTypes.RESUME}}(e,0,a);case s.FrameTypes.RESUME_OK:return function(e,t,r){return e.length,{clientPosition:u(e,6),flags:r,streamId:0,type:s.FrameTypes.RESUME_OK}}(e,0,a);case s.FrameTypes.CANCEL:return function(e,t,r){return e.length,{flags:r,streamId:t,type:s.FrameTypes.CANCEL}}(e,i,a);case s.FrameTypes.LEASE:return function(e,t,r){var i=6,n=e.readUInt32BE(i);i+=4;var o=e.readUInt32BE(i),a=null;return(i+=4)<e.length&&(a=e.slice(i,e.length)),{flags:r,metadata:a,requestCount:o,streamId:0,ttl:n,type:s.FrameTypes.LEASE}}(e,0,a)}}function f(e){switch(e.type){case s.FrameTypes.SETUP:return function(e){var t=null!=e.resumeToken?e.resumeToken.byteLength:0,r=null!=e.metadataMimeType?i.byteLength(e.metadataMimeType,"ascii"):0,n=null!=e.dataMimeType?i.byteLength(e.dataMimeType,"ascii"):0,o=k(e),a=i.allocUnsafe(6+m+(t?g+t:0)+r+n+o),l=M(e,a);return l=a.writeUInt16BE(e.majorVersion,l),l=a.writeUInt16BE(e.minorVersion,l),l=a.writeUInt32BE(e.keepAlive,l),l=a.writeUInt32BE(e.lifetime,l),e.flags&s.Flags.RESUME_ENABLE&&(l=a.writeUInt16BE(t,l),null!=e.resumeToken&&(l+=e.resumeToken.copy(a,l))),l=a.writeUInt8(r,l),null!=e.metadataMimeType&&(l+=a.write(e.metadataMimeType,l,l+r,"ascii")),l=a.writeUInt8(n,l),null!=e.dataMimeType&&(l+=a.write(e.dataMimeType,l,l+n,"ascii")),F(e,a,l),a}(e);case s.FrameTypes.PAYLOAD:return function(e){var t=k(e),r=i.allocUnsafe(6+t);return F(e,r,M(e,r)),r}(e);case s.FrameTypes.ERROR:return function(e){var t=null!=e.message?i.byteLength(e.message,"utf8"):0,r=i.allocUnsafe(6+y+t),n=M(e,r);return n=r.writeUInt32BE(e.code,n),null!=e.message&&r.write(e.message,n,n+t,"utf8"),r}(e);case s.FrameTypes.KEEPALIVE:return function(e){var t=null!=e.data?e.data.byteLength:0,r=i.allocUnsafe(6+v+t),n=M(e,r);return n=d(r,e.lastReceivedPosition,n),null!=e.data&&e.data.copy(r,n),r}(e);case s.FrameTypes.REQUEST_FNF:case s.FrameTypes.REQUEST_RESPONSE:return function(e){var t=k(e),r=i.allocUnsafe(6+t);return F(e,r,M(e,r)),r}(e);case s.FrameTypes.REQUEST_STREAM:case s.FrameTypes.REQUEST_CHANNEL:return function(e){var t=k(e),r=i.allocUnsafe(6+I+t),n=M(e,r);return n=r.writeUInt32BE(e.requestN,n),F(e,r,n),r}(e);case s.FrameTypes.METADATA_PUSH:return function(e){var t,r=e.metadata;if(null!=r){var n=M(e,t=i.allocUnsafe(6+r.byteLength));return r.copy(t,n),t}return M(e,t=i.allocUnsafe(6)),t}(e);case s.FrameTypes.REQUEST_N:return function(e){var t=i.allocUnsafe(6+E),r=M(e,t);return t.writeUInt32BE(e.requestN,r),t}(e);case s.FrameTypes.RESUME:return function(e){var t=e.resumeToken.byteLength,r=i.allocUnsafe(6+w+t),n=M(e,r);return n=r.writeUInt16BE(e.majorVersion,n),n=r.writeUInt16BE(e.minorVersion,n),n=r.writeUInt16BE(t,n),n+=e.resumeToken.copy(r,n),n=d(r,e.serverPosition,n),d(r,e.clientPosition,n),r}(e);case s.FrameTypes.RESUME_OK:return function(e){var t=i.allocUnsafe(6+S),r=M(e,t);return d(t,e.clientPosition,r),t}(e);case s.FrameTypes.CANCEL:return function(e){var t=i.allocUnsafe(6);return M(e,t),t}(e);case s.FrameTypes.LEASE:return function(e){var t=null!=e.metadata?e.metadata.byteLength:0,r=i.allocUnsafe(6+b+t),n=M(e,r);return n=r.writeUInt32BE(e.ttl,n),n=r.writeUInt32BE(e.requestCount,n),null!=e.metadata&&e.metadata.copy(r,n),r}(e)}}t.readUInt24BE=a,t.writeUInt24BE=l,t.readUInt64BE=u,t.writeUInt64BE=d,t.deserializeFrameWithLength=h,t.deserializeFrames=c,t.serializeFrameWithLength=function(e){var t=f(e),r=i.allocUnsafe(t.length+3);return l(r,t.length,0),t.copy(r,3),r},t.deserializeFrame=p,t.serializeFrame=f,t.sizeOfFrame=function(e){switch(e.type){case s.FrameTypes.SETUP:return function(e){var t=null!=e.resumeToken?e.resumeToken.byteLength:0,r=null!=e.metadataMimeType?i.byteLength(e.metadataMimeType,"ascii"):0,n=null!=e.dataMimeType?i.byteLength(e.dataMimeType,"ascii"):0,s=k(e);return 6+m+(t?g+t:0)+r+n+s}(e);case s.FrameTypes.PAYLOAD:return function(e){return 6+k(e)}(e);case s.FrameTypes.ERROR:return function(e){var t=null!=e.message?i.byteLength(e.message,"utf8"):0;return 6+y+t}(e);case s.FrameTypes.KEEPALIVE:return function(e){var t=null!=e.data?e.data.byteLength:0;return 6+v+t}(e);case s.FrameTypes.REQUEST_FNF:case s.FrameTypes.REQUEST_RESPONSE:return function(e){return 6+k(e)}(e);case s.FrameTypes.REQUEST_STREAM:case s.FrameTypes.REQUEST_CHANNEL:return function(e){var t=k(e);return 6+I+t}(e);case s.FrameTypes.METADATA_PUSH:return function(e){return 6+(null!=e.metadata?e.metadata.byteLength:0)}(e);case s.FrameTypes.REQUEST_N:return 6+E;case s.FrameTypes.RESUME:return function(e){var t=e.resumeToken.byteLength;return 6+w+t}(e);case s.FrameTypes.RESUME_OK:return 6+S;case s.FrameTypes.CANCEL:return 6;case s.FrameTypes.LEASE:return function(e){var t=null!=e.metadata?e.metadata.byteLength:0;return 6+b+t}(e)}};var m=14,g=2,y=4,v=8,b=8,I=4,E=4,w=22,S=8;function M(e,r){var i=r.writeInt32BE(e.streamId,0);return r.writeUInt16BE(e.type<<t.FRAME_TYPE_OFFFSET|e.flags&t.FLAGS_MASK,i)}function k(e){var t=0;return null!=e.data&&(t+=e.data.byteLength),s.Flags.hasMetadata(e.flags)&&(t+=3,null!=e.metadata&&(t+=e.metadata.byteLength)),t}function F(e,t,r){s.Flags.hasMetadata(e.flags)&&(null!=e.metadata?(r=l(t,e.metadata.byteLength,r),r+=e.metadata.copy(t,r)):r=l(t,0,r)),null!=e.data&&e.data.copy(t,r)}function T(e,t,r){if(s.Flags.hasMetadata(t.flags)){var i=a(e,r);r+=3,i>0&&(t.metadata=e.slice(r,r+i),r+=i)}r<e.length&&(t.data=e.slice(r,e.length))}var R=function(){function e(){}return e.prototype.deserializeFrame=function(e){return p(e)},e.prototype.deserializeFrameWithLength=function(e){return h(e)},e.prototype.deserializeFrames=function(e){return c(e)},e}();t.Deserializer=R}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,r),s.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.d(i,{default:()=>Ai});var e={};r.r(e),r.d(e,{hasBrowserEnv:()=>Te,hasStandardBrowserEnv:()=>Ae,hasStandardBrowserWebWorkerEnv:()=>Ce,navigator:()=>Re,origin:()=>Oe});var t,n,s,o,a,l=r(225),u=r(927),d=r(837);class h{messageId="";joinId=0;fromId="";fromName="";destId="";destName="";cite="";type="";title="";subtitle="";text="";secret="";thumb="";host="";url="";lng="";lat="";size=0;length=0;label=null;tag="";sent="";revoke=!1;talk=n.default;citeData=null;sentDate=null;hintList=null;notifyList=null;quietlyList=null}!function(e){e.tip="tip",e.notice="notice",e.action="action",e.notify="notify",e.quietly="quietly"}(t||(t={})),function(e){e[e.default=1]="default",e[e.group=2]="group",e[e.team=3]="team"}(n||(n={}));class c{contactId=0;userId="";joinId=0;nickname="";username="";avatar="";subgroup="";status=o.done;isGroup=!1;joinTime="";isMuted=!1;noise=1;sort=0}!function(e){e[e.normal=1]="normal",e[e.not_notify=2]="not_notify",e[e.reject=0]="reject"}(s||(s={})),function(e){e.done="",e.offline="offline",e.online="online",e.online_busy="online-busy",e.online_leave="online-leave"}(o||(o={}));class p{memberId=0;joinId=0;userId="";nickname="";username="";avatar="";role="";status="";joinTime="";isMuted=!1}class f{name="";region="";host="";port="";max=0;type=!0;current=0}class m{deviceId="";deviceKey="";deviceTag="";userId="";joinId=0;status="";region="";gateway=""}class g{groupId=0;joinId=0;userId="";groupName="";groupNumber="";avatar="";members=void 0;depict="";isGroup=!1;isTalk=!1;isMute=!1;isApproval=!0;isInviteApply=!0;isInvite=!0;isRevoke=!0;maxMember=200;ask="";remark="";type=a.protected;isLive=!1}function y(e,t){return function(){return e.apply(t,arguments)}}!function(e){e[e.public=1]="public",e[e.protected=2]="protected",e[e.private=3]="private"}(a||(a={}));const{toString:v}=Object.prototype,{getPrototypeOf:b}=Object,{iterator:I,toStringTag:E}=Symbol,w=(S=Object.create(null),e=>{const t=v.call(e);return S[t]||(S[t]=t.slice(8,-1).toLowerCase())});var S;const M=e=>(e=e.toLowerCase(),t=>w(t)===e),k=e=>t=>typeof t===e,{isArray:F}=Array,T=k("undefined");function R(e){return null!==e&&!T(e)&&null!==e.constructor&&!T(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const A=M("ArrayBuffer"),C=k("string"),O=k("function"),N=k("number"),x=e=>null!==e&&"object"==typeof e,_=e=>{if("object"!==w(e))return!1;const t=b(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||E in e||I in e)},D=M("Date"),L=M("File"),P=M("Blob"),U=M("FileList"),j=M("URLSearchParams"),[B,W,z,G]=["ReadableStream","Request","Response","Headers"].map(M);function V(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let i,n;if("object"!=typeof e&&(e=[e]),F(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{if(R(e))return;const n=r?Object.getOwnPropertyNames(e):Object.keys(e),s=n.length;let o;for(i=0;i<s;i++)o=n[i],t.call(null,e[o],o,e)}}function q(e,t){if(R(e))return null;t=t.toLowerCase();const r=Object.keys(e);let i,n=r.length;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,H=e=>!T(e)&&e!==K,Y=(X="undefined"!=typeof Uint8Array&&b(Uint8Array),e=>X&&e instanceof X);var X;const J=M("HTMLFormElement"),Z=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Q=M("RegExp"),$=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),i={};V(r,(r,n)=>{let s;!1!==(s=t(r,n,e))&&(i[n]=s||r)}),Object.defineProperties(e,i)},ee=M("AsyncFunction"),te=(re="function"==typeof setImmediate,ie=O(K.postMessage),re?setImmediate:ie?(ne=`axios@${Math.random()}`,se=[],K.addEventListener("message",({source:e,data:t})=>{e===K&&t===ne&&se.length&&se.shift()()},!1),e=>{se.push(e),K.postMessage(ne,"*")}):e=>setTimeout(e));var re,ie,ne,se;const oe="undefined"!=typeof queueMicrotask?queueMicrotask.bind(K):"undefined"!=typeof process&&process.nextTick||te,ae={isArray:F,isArrayBuffer:A,isBuffer:R,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||O(e.append)&&("formdata"===(t=w(e))||"object"===t&&O(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&A(e.buffer),t},isString:C,isNumber:N,isBoolean:e=>!0===e||!1===e,isObject:x,isPlainObject:_,isEmptyObject:e=>{if(!x(e)||R(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:B,isRequest:W,isResponse:z,isHeaders:G,isUndefined:T,isDate:D,isFile:L,isBlob:P,isRegExp:Q,isFunction:O,isStream:e=>x(e)&&O(e.pipe),isURLSearchParams:j,isTypedArray:Y,isFileList:U,forEach:V,merge:function e(){const{caseless:t,skipUndefined:r}=H(this)&&this||{},i={},n=(n,s)=>{const o=t&&q(i,s)||s;_(i[o])&&_(n)?i[o]=e(i[o],n):_(n)?i[o]=e({},n):F(n)?i[o]=n.slice():r&&T(n)||(i[o]=n)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&V(arguments[e],n);return i},extend:(e,t,r,{allOwnKeys:i}={})=>(V(t,(t,i)=>{r&&O(t)?e[i]=y(t,r):e[i]=t},{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,i)=>{let n,s,o;const a={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)o=n[s],i&&!i(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==r&&b(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:w,kindOfTest:M,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const i=e.indexOf(t,r);return-1!==i&&i===r},toArray:e=>{if(!e)return null;if(F(e))return e;let t=e.length;if(!N(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[I]).call(e);let i;for(;(i=r.next())&&!i.done;){const r=i.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const i=[];for(;null!==(r=e.exec(t));)i.push(r);return i},isHTMLForm:J,hasOwnProperty:Z,hasOwnProp:Z,reduceDescriptors:$,freezeMethods:e=>{$(e,(t,r)=>{if(O(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const i=e[r];O(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},i=e=>{e.forEach(e=>{r[e]=!0})};return F(e)?i(e):i(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:q,global:K,isContextDefined:H,isSpecCompliantForm:function(e){return!!(e&&O(e.append)&&"FormData"===e[E]&&e[I])},toJSONObject:e=>{const t=new Array(10),r=(e,i)=>{if(x(e)){if(t.indexOf(e)>=0)return;if(R(e))return e;if(!("toJSON"in e)){t[i]=e;const n=F(e)?[]:{};return V(e,(e,t)=>{const s=r(e,i+1);!T(s)&&(n[t]=s)}),t[i]=void 0,n}}return e};return r(e,0)},isAsyncFn:ee,isThenable:e=>e&&(x(e)||O(e))&&O(e.then)&&O(e.catch),setImmediate:te,asap:oe,isIterable:e=>null!=e&&O(e[I])};function le(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}ae.inherits(le,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ae.toJSONObject(this.config),code:this.code,status:this.status}}});const ue=le.prototype,de={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{de[e]={value:e}}),Object.defineProperties(le,de),Object.defineProperty(ue,"isAxiosError",{value:!0}),le.from=(e,t,r,i,n,s)=>{const o=Object.create(ue);ae.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return le.call(o,a,l,r,i,n),e&&null==o.cause&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",s&&Object.assign(o,s),o};const he=le;var ce=r(287).hp;function pe(e){return ae.isPlainObject(e)||ae.isArray(e)}function fe(e){return ae.endsWith(e,"[]")?e.slice(0,-2):e}function me(e,t,r){return e?e.concat(t).map(function(e,t){return e=fe(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const ge=ae.toFlatObject(ae,{},null,function(e){return/^is[A-Z]/.test(e)}),ye=function(e,t,r){if(!ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(r=ae.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!ae.isUndefined(t[e])})).metaTokens,n=r.visitor||u,s=r.dots,o=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&ae.isSpecCompliantForm(t);if(!ae.isFunction(n))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(ae.isDate(e))return e.toISOString();if(ae.isBoolean(e))return e.toString();if(!a&&ae.isBlob(e))throw new he("Blob is not supported. Use a Buffer instead.");return ae.isArrayBuffer(e)||ae.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):ce.from(e):e}function u(e,r,n){let a=e;if(e&&!n&&"object"==typeof e)if(ae.endsWith(r,"{}"))r=i?r:r.slice(0,-2),e=JSON.stringify(e);else if(ae.isArray(e)&&function(e){return ae.isArray(e)&&!e.some(pe)}(e)||(ae.isFileList(e)||ae.endsWith(r,"[]"))&&(a=ae.toArray(e)))return r=fe(r),a.forEach(function(e,i){!ae.isUndefined(e)&&null!==e&&t.append(!0===o?me([r],i,s):null===o?r:r+"[]",l(e))}),!1;return!!pe(e)||(t.append(me(n,r,s),l(e)),!1)}const d=[],h=Object.assign(ge,{defaultVisitor:u,convertValue:l,isVisitable:pe});if(!ae.isObject(e))throw new TypeError("data must be an object");return function e(r,i){if(!ae.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+i.join("."));d.push(r),ae.forEach(r,function(r,s){!0===(!(ae.isUndefined(r)||null===r)&&n.call(t,r,ae.isString(s)?s.trim():s,i,h))&&e(r,i?i.concat(s):[s])}),d.pop()}}(e),t};function ve(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function be(e,t){this._pairs=[],e&&ye(e,this,t)}const Ie=be.prototype;Ie.append=function(e,t){this._pairs.push([e,t])},Ie.toString=function(e){const t=e?function(t){return e.call(this,t,ve)}:ve;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Ee=be;function we(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Se(e,t,r){if(!t)return e;const i=r&&r.encode||we;ae.isFunction(r)&&(r={serialize:r});const n=r&&r.serialize;let s;if(s=n?n(t,r):ae.isURLSearchParams(t)?t.toString():new Ee(t,r).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Me=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ae.forEach(this.handlers,function(t){null!==t&&e(t)})}},ke={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ee,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Te="undefined"!=typeof window&&"undefined"!=typeof document,Re="object"==typeof navigator&&navigator||void 0,Ae=Te&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),Ce="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Oe=Te&&window.location.href||"http://localhost",Ne={...e,...Fe},xe=function(e){function t(e,r,i,n){let s=e[n++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=n>=e.length;return s=!s&&ae.isArray(i)?i.length:s,a?(ae.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!o):(i[s]&&ae.isObject(i[s])||(i[s]=[]),t(e,r,i[s],n)&&ae.isArray(i[s])&&(i[s]=function(e){const t={},r=Object.keys(e);let i;const n=r.length;let s;for(i=0;i<n;i++)s=r[i],t[s]=e[s];return t}(i[s])),!o)}if(ae.isFormData(e)&&ae.isFunction(e.entries)){const r={};return ae.forEachEntry(e,(e,i)=>{t(function(e){return ae.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),i,r,0)}),r}return null},_e={transitional:ke,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",i=r.indexOf("application/json")>-1,n=ae.isObject(e);if(n&&ae.isHTMLForm(e)&&(e=new FormData(e)),ae.isFormData(e))return i?JSON.stringify(xe(e)):e;if(ae.isArrayBuffer(e)||ae.isBuffer(e)||ae.isStream(e)||ae.isFile(e)||ae.isBlob(e)||ae.isReadableStream(e))return e;if(ae.isArrayBufferView(e))return e.buffer;if(ae.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(n){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ye(e,new Ne.classes.URLSearchParams,{visitor:function(e,t,r,i){return Ne.isNode&&ae.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=ae.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ye(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),function(e){if(ae.isString(e))try{return(0,JSON.parse)(e),ae.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||_e.transitional,r=t&&t.forcedJSONParsing,i="json"===this.responseType;if(ae.isResponse(e)||ae.isReadableStream(e))return e;if(e&&ae.isString(e)&&(r&&!this.responseType||i)){const r=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw he.from(e,he.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ne.classes.FormData,Blob:Ne.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ae.forEach(["delete","get","head","post","put","patch"],e=>{_e.headers[e]={}});const De=_e,Le=ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Pe=Symbol("internals");function Ue(e){return e&&String(e).trim().toLowerCase()}function je(e){return!1===e||null==e?e:ae.isArray(e)?e.map(je):String(e)}function Be(e,t,r,i,n){return ae.isFunction(i)?i.call(this,t,r):(n&&(t=r),ae.isString(t)?ae.isString(i)?-1!==t.indexOf(i):ae.isRegExp(i)?i.test(t):void 0:void 0)}class We{constructor(e){e&&this.set(e)}set(e,t,r){const i=this;function n(e,t,r){const n=Ue(t);if(!n)throw new Error("header name must be a non-empty string");const s=ae.findKey(i,n);(!s||void 0===i[s]||!0===r||void 0===r&&!1!==i[s])&&(i[s||t]=je(e))}const s=(e,t)=>ae.forEach(e,(e,r)=>n(e,r,t));if(ae.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(ae.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let r,i,n;return e&&e.split("\n").forEach(function(e){n=e.indexOf(":"),r=e.substring(0,n).trim().toLowerCase(),i=e.substring(n+1).trim(),!r||t[r]&&Le[r]||("set-cookie"===r?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t})(e),t);else if(ae.isObject(e)&&ae.isIterable(e)){let r,i,n={};for(const t of e){if(!ae.isArray(t))throw TypeError("Object iterator must return a key-value pair");n[i=t[0]]=(r=n[i])?ae.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}s(n,t)}else null!=e&&n(t,e,r);return this}get(e,t){if(e=Ue(e)){const r=ae.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}(e);if(ae.isFunction(t))return t.call(this,e,r);if(ae.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ue(e)){const r=ae.findKey(this,e);return!(!r||void 0===this[r]||t&&!Be(0,this[r],r,t))}return!1}delete(e,t){const r=this;let i=!1;function n(e){if(e=Ue(e)){const n=ae.findKey(r,e);!n||t&&!Be(0,r[n],n,t)||(delete r[n],i=!0)}}return ae.isArray(e)?e.forEach(n):n(e),i}clear(e){const t=Object.keys(this);let r=t.length,i=!1;for(;r--;){const n=t[r];e&&!Be(0,this[n],n,e,!0)||(delete this[n],i=!0)}return i}normalize(e){const t=this,r={};return ae.forEach(this,(i,n)=>{const s=ae.findKey(r,n);if(s)return t[s]=je(i),void delete t[n];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(n):String(n).trim();o!==n&&delete t[n],t[o]=je(i),r[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ae.forEach(this,(r,i)=>{null!=r&&!1!==r&&(t[i]=e&&ae.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Pe]=this[Pe]={accessors:{}}).accessors,r=this.prototype;function i(e){const i=Ue(e);t[i]||(function(e,t){const r=ae.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(e,r,n){return this[i].call(this,t,e,r,n)},configurable:!0})})}(r,e),t[i]=!0)}return ae.isArray(e)?e.forEach(i):i(e),this}}We.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ae.reduceDescriptors(We.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),ae.freezeMethods(We);const ze=We;function Ge(e,t){const r=this||De,i=t||r,n=ze.from(i.headers);let s=i.data;return ae.forEach(e,function(e){s=e.call(r,s,n.normalize(),t?t.status:void 0)}),n.normalize(),s}function Ve(e){return!(!e||!e.__CANCEL__)}function qe(e,t,r){he.call(this,null==e?"canceled":e,he.ERR_CANCELED,t,r),this.name="CanceledError"}ae.inherits(qe,he,{__CANCEL__:!0});const Ke=qe;function He(e,t,r){const i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new he("Request failed with status code "+r.status,[he.ERR_BAD_REQUEST,he.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const Ye=(e,t,r=3)=>{let i=0;const n=function(e,t){e=e||10;const r=new Array(e),i=new Array(e);let n,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),u=i[o];n||(n=l),r[s]=a,i[s]=l;let d=o,h=0;for(;d!==s;)h+=r[d++],d%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-n<t)return;const c=u&&l-u;return c?Math.round(1e3*h/c):void 0}}(50,250);return function(e,t){let r,i,n=0,s=1e3/t;const o=(t,s=Date.now())=>{n=s,r=null,i&&(clearTimeout(i),i=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-n;a>=s?o(e,t):(r=e,i||(i=setTimeout(()=>{i=null,o(r)},s-a)))},()=>r&&o(r)]}(r=>{const s=r.loaded,o=r.lengthComputable?r.total:void 0,a=s-i,l=n(a);i=s,e({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:r,lengthComputable:null!=o,[t?"download":"upload"]:!0})},r)},Xe=(e,t)=>{const r=null!=e;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},Je=e=>(...t)=>ae.asap(()=>e(...t)),Ze=Ne.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ne.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ne.origin),Ne.navigator&&/(msie|trident)/i.test(Ne.navigator.userAgent)):()=>!0,Qe=Ne.hasStandardBrowserEnv?{write(e,t,r,i,n,s){const o=[e+"="+encodeURIComponent(t)];ae.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),ae.isString(i)&&o.push("path="+i),ae.isString(n)&&o.push("domain="+n),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function $e(e,t,r){let i=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(i||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const et=e=>e instanceof ze?{...e}:e;function tt(e,t){t=t||{};const r={};function i(e,t,r,i){return ae.isPlainObject(e)&&ae.isPlainObject(t)?ae.merge.call({caseless:i},e,t):ae.isPlainObject(t)?ae.merge({},t):ae.isArray(t)?t.slice():t}function n(e,t,r,n){return ae.isUndefined(t)?ae.isUndefined(e)?void 0:i(void 0,e,0,n):i(e,t,0,n)}function s(e,t){if(!ae.isUndefined(t))return i(void 0,t)}function o(e,t){return ae.isUndefined(t)?ae.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function a(r,n,s){return s in t?i(r,n):s in e?i(void 0,r):void 0}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t,r)=>n(et(e),et(t),0,!0)};return ae.forEach(Object.keys({...e,...t}),function(i){const s=l[i]||n,o=s(e[i],t[i],i);ae.isUndefined(o)&&s!==a||(r[i]=o)}),r}const rt=e=>{const t=tt({},e);let{data:r,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:s,headers:o,auth:a}=t;if(t.headers=o=ze.from(o),t.url=Se($e(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),ae.isFormData(r))if(Ne.hasStandardBrowserEnv||Ne.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(ae.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&o.set(e,r)})}if(Ne.hasStandardBrowserEnv&&(i&&ae.isFunction(i)&&(i=i(t)),i||!1!==i&&Ze(t.url))){const e=n&&s&&Qe.read(s);e&&o.set(n,e)}return t},it="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const i=rt(e);let n=i.data;const s=ze.from(i.headers).normalize();let o,a,l,u,d,{responseType:h,onUploadProgress:c,onDownloadProgress:p}=i;function f(){u&&u(),d&&d(),i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const i=ze.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());He(function(e){t(e),f()},function(e){r(e),f()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:i,config:e,request:m}),m=null}m.open(i.method.toUpperCase(),i.url,!0),m.timeout=i.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(r(new he("Request aborted",he.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const i=t&&t.message?t.message:"Network Error",n=new he(i,he.ERR_NETWORK,e,m);n.event=t||null,r(n),m=null},m.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const n=i.transitional||ke;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),r(new he(t,n.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,m)),m=null},void 0===n&&s.setContentType(null),"setRequestHeader"in m&&ae.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),ae.isUndefined(i.withCredentials)||(m.withCredentials=!!i.withCredentials),h&&"json"!==h&&(m.responseType=i.responseType),p&&([l,d]=Ye(p,!0),m.addEventListener("progress",l)),c&&m.upload&&([a,u]=Ye(c),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(i.cancelToken||i.signal)&&(o=t=>{m&&(r(!t||t.type?new Ke(null,e,m):t),m.abort(),m=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);y&&-1===Ne.protocols.indexOf(y)?r(new he("Unsupported protocol "+y+":",he.ERR_BAD_REQUEST,e)):m.send(n||null)})},nt=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,i=new AbortController;const n=function(e){if(!r){r=!0,o();const t=e instanceof Error?e:this.reason;i.abort(t instanceof he?t:new Ke(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,n(new he(`timeout ${t} of ms exceeded`,he.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(n):e.removeEventListener("abort",n)}),e=null)};e.forEach(e=>e.addEventListener("abort",n));const{signal:a}=i;return a.unsubscribe=()=>ae.asap(o),a}},st=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let i,n=0;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},ot=(e,t,r,i)=>{const n=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*st(r,t)}(e,t);let s,o=0,a=e=>{s||(s=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await n.next();if(t)return a(),void e.close();let s=i.byteLength;if(r){let e=o+=s;r(e)}e.enqueue(new Uint8Array(i))}catch(e){throw a(e),e}},cancel:e=>(a(e),n.return())},{highWaterMark:2})},{isFunction:at}=ae,lt=(({Request:e,Response:t})=>({Request:e,Response:t}))(ae.global),{ReadableStream:ut,TextEncoder:dt}=ae.global,ht=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ct=e=>{e=ae.merge.call({skipUndefined:!0},lt,e);const{fetch:t,Request:r,Response:i}=e,n=t?at(t):"function"==typeof fetch,s=at(r),o=at(i);if(!n)return!1;const a=n&&at(ut),l=n&&("function"==typeof dt?(u=new dt,e=>u.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var u;const d=s&&a&&ht(()=>{let e=!1;const t=new r(Ne.origin,{body:new ut,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=o&&a&&ht(()=>ae.isReadableStream(new i("").body)),c={stream:h&&(e=>e.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!c[e]&&(c[e]=(t,r)=>{let i=t&&t[e];if(i)return i.call(t);throw new he(`Response type '${e}' is not supported`,he.ERR_NOT_SUPPORT,r)})});return async e=>{let{url:n,method:o,data:a,signal:u,cancelToken:p,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:v,withCredentials:b="same-origin",fetchOptions:I}=rt(e),E=t||fetch;y=y?(y+"").toLowerCase():"text";let w=nt([u,p&&p.toAbortSignal()],f),S=null;const M=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let k;try{if(g&&d&&"get"!==o&&"head"!==o&&0!==(k=await(async(e,t)=>{const i=ae.toFiniteNumber(e.getContentLength());return null==i?(async e=>{if(null==e)return 0;if(ae.isBlob(e))return e.size;if(ae.isSpecCompliantForm(e)){const t=new r(Ne.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ae.isArrayBufferView(e)||ae.isArrayBuffer(e)?e.byteLength:(ae.isURLSearchParams(e)&&(e+=""),ae.isString(e)?(await l(e)).byteLength:void 0)})(t):i})(v,a))){let e,t=new r(n,{method:"POST",body:a,duplex:"half"});if(ae.isFormData(a)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,r]=Xe(k,Ye(Je(g)));a=ot(t.body,65536,e,r)}}ae.isString(b)||(b=b?"include":"omit");const t=s&&"credentials"in r.prototype,u={...I,signal:w,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};S=s&&new r(n,u);let p=await(s?E(S,I):E(n,u));const f=h&&("stream"===y||"response"===y);if(h&&(m||f&&M)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});const t=ae.toFiniteNumber(p.headers.get("content-length")),[r,n]=m&&Xe(t,Ye(Je(m),!0))||[];p=new i(ot(p.body,65536,r,()=>{n&&n(),M&&M()}),e)}y=y||"text";let F=await c[ae.findKey(c,y)||"text"](p,e);return!f&&M&&M(),await new Promise((t,r)=>{He(t,r,{data:F,headers:ze.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:S})})}catch(t){if(M&&M(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new he("Network Error",he.ERR_NETWORK,e,S),{cause:t.cause||t});throw he.from(t,t&&t.code,e,S)}}},pt=new Map,ft=e=>{let t=e?e.env:{};const{fetch:r,Request:i,Response:n}=t,s=[i,n,r];let o,a,l=s.length,u=pt;for(;l--;)o=s[l],a=u.get(o),void 0===a&&u.set(o,a=l?new Map:ct(t)),u=a;return a},mt=(ft(),{http:null,xhr:it,fetch:{get:ft}});ae.forEach(mt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const gt=e=>`- ${e}`,yt=e=>ae.isFunction(e)||null===e||!1===e,vt=(e,t)=>{e=ae.isArray(e)?e:[e];const{length:r}=e;let i,n;const s={};for(let o=0;o<r;o++){let r;if(i=e[o],n=i,!yt(i)&&(n=mt[(r=String(i)).toLowerCase()],void 0===n))throw new he(`Unknown adapter '${r}'`);if(n&&(ae.isFunction(n)||(n=n.get(t))))break;s[r||"#"+o]=n}if(!n){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=r?e.length>1?"since :\n"+e.map(gt).join("\n"):" "+gt(e[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return n};function bt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ke(null,e)}function It(e){return bt(e),e.headers=ze.from(e.headers),e.data=Ge.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vt(e.adapter||De.adapter,e)(e).then(function(t){return bt(e),t.data=Ge.call(e,e.transformResponse,t),t.headers=ze.from(t.headers),t},function(t){return Ve(t)||(bt(e),t&&t.response&&(t.response.data=Ge.call(e,e.transformResponse,t.response),t.response.headers=ze.from(t.response.headers))),Promise.reject(t)})}const Et="1.12.2",wt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const St={};wt.transitional=function(e,t,r){function i(e,t){return"[Axios v"+Et+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,n,s)=>{if(!1===e)throw new he(i(n," has been removed"+(t?" in "+t:"")),he.ERR_DEPRECATED);return t&&!St[n]&&(St[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},wt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Mt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let n=i.length;for(;n-- >0;){const s=i[n],o=t[s];if(o){const t=e[s],r=void 0===t||o(t,s,e);if(!0!==r)throw new he("option "+s+" must be "+r,he.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new he("Unknown option "+s,he.ERR_BAD_OPTION)}},validators:wt},kt=Mt.validators;class Ft{constructor(e){this.defaults=e||{},this.interceptors={request:new Me,response:new Me}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=tt(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:n}=t;void 0!==r&&Mt.assertOptions(r,{silentJSONParsing:kt.transitional(kt.boolean),forcedJSONParsing:kt.transitional(kt.boolean),clarifyTimeoutError:kt.transitional(kt.boolean)},!1),null!=i&&(ae.isFunction(i)?t.paramsSerializer={serialize:i}:Mt.assertOptions(i,{encode:kt.function,serialize:kt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Mt.assertOptions(t,{baseUrl:kt.spelling("baseURL"),withXsrfToken:kt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=n&&ae.merge(n.common,n[t.method]);n&&ae.forEach(["delete","get","head","post","put","patch","common"],e=>{delete n[e]}),t.headers=ze.concat(s,n);const o=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))});const l=[];let u;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let d,h=0;if(!a){const e=[It.bind(this),void 0];for(e.unshift(...o),e.push(...l),d=e.length,u=Promise.resolve(t);h<d;)u=u.then(e[h++],e[h++]);return u}d=o.length;let c=t;for(;h<d;){const e=o[h++],t=o[h++];try{c=e(c)}catch(e){t.call(this,e);break}}try{u=It.call(this,c)}catch(e){return Promise.reject(e)}for(h=0,d=l.length;h<d;)u=u.then(l[h++],l[h++]);return u}getUri(e){return Se($e((e=tt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}ae.forEach(["delete","get","head","options"],function(e){Ft.prototype[e]=function(t,r){return this.request(tt(r||{},{method:e,url:t,data:(r||{}).data}))}}),ae.forEach(["post","put","patch"],function(e){function t(t){return function(r,i,n){return this.request(tt(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}Ft.prototype[e]=t(),Ft.prototype[e+"Form"]=t(!0)});const Tt=Ft;class Rt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const i=new Promise(e=>{r.subscribe(e),t=e}).then(e);return i.cancel=function(){r.unsubscribe(t)},i},e(function(e,i,n){r.reason||(r.reason=new Ke(e,i,n),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Rt(function(t){e=t}),cancel:e}}}const At=Rt,Ct={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ct).forEach(([e,t])=>{Ct[t]=e});const Ot=Ct,Nt=function e(t){const r=new Tt(t),i=y(Tt.prototype.request,r);return ae.extend(i,Tt.prototype,r,{allOwnKeys:!0}),ae.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(tt(t,r))},i}(De);Nt.Axios=Tt,Nt.CanceledError=Ke,Nt.CancelToken=At,Nt.isCancel=Ve,Nt.VERSION=Et,Nt.toFormData=ye,Nt.AxiosError=he,Nt.Cancel=Nt.CanceledError,Nt.all=function(e){return Promise.all(e)},Nt.spread=function(e){return function(t){return e.apply(null,t)}},Nt.isAxiosError=function(e){return ae.isObject(e)&&!0===e.isAxiosError},Nt.mergeConfig=tt,Nt.AxiosHeaders=ze,Nt.formToJSON=e=>xe(ae.isHTMLForm(e)?new FormData(e):e),Nt.getAdapter=vt,Nt.HttpStatusCode=Ot,Nt.default=Nt;const xt=Nt;var _t,Dt,Lt,Pt,Ut,jt,Bt=r(339);!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[8,10,11,12,13],this.#e),Array.isArray(e)||"object"!=typeof e||("deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"userId"in e&&null!=e.userId&&(this.userId=e.userId),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"teamId"in e&&null!=e.teamId&&(this.teamId=e.teamId),"startTime"in e&&null!=e.startTime&&(this.startTime=e.startTime),"endTime"in e&&null!=e.endTime&&(this.endTime=e.endTime),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"token"in e&&null!=e.token&&(this.token=e.token),"roomIds"in e&&null!=e.roomIds&&(this.roomIds=e.roomIds),"userIds"in e&&null!=e.userIds&&(this.userIds=e.userIds),"teamIds"in e&&null!=e.teamIds&&(this.teamIds=e.teamIds),"keys"in e&&null!=e.keys&&(this.keys=e.keys),"page"in e&&null!=e.page&&(this.page=e.page),"pageSize"in e&&null!=e.pageSize&&(this.pageSize=e.pageSize),"version"in e&&null!=e.version&&(this.version=e.version),"v"in e&&null!=e.v&&(this.v=e.v),"talkMode"in e&&null!=e.talkMode&&(this.talkMode=e.talkMode),"proto"in e&&null!=e.proto&&(this.proto=e.proto),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"protocol"in e&&null!=e.protocol&&(this.protocol=e.protocol),"deviceTag"in e&&null!=e.deviceTag&&(this.deviceTag=e.deviceTag),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar))}get deviceKey(){return Bt.Message.getFieldWithDefault(this,1,"")}set deviceKey(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get userId(){return Bt.Message.getFieldWithDefault(this,3,"")}set userId(e){Bt.Message.setField(this,3,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,4,0)}set roomId(e){Bt.Message.setField(this,4,e)}get teamId(){return Bt.Message.getFieldWithDefault(this,5,0)}set teamId(e){Bt.Message.setField(this,5,e)}get startTime(){return Bt.Message.getFieldWithDefault(this,6,"")}set startTime(e){Bt.Message.setField(this,6,e)}get endTime(){return Bt.Message.getFieldWithDefault(this,7,"")}set endTime(e){Bt.Message.setField(this,7,e)}get ids(){return Bt.Message.getFieldWithDefault(this,8,[])}set ids(e){Bt.Message.setField(this,8,e)}get token(){return Bt.Message.getFieldWithDefault(this,9,"")}set token(e){Bt.Message.setField(this,9,e)}get roomIds(){return Bt.Message.getFieldWithDefault(this,10,[])}set roomIds(e){Bt.Message.setField(this,10,e)}get userIds(){return Bt.Message.getFieldWithDefault(this,11,[])}set userIds(e){Bt.Message.setField(this,11,e)}get teamIds(){return Bt.Message.getFieldWithDefault(this,12,[])}set teamIds(e){Bt.Message.setField(this,12,e)}get keys(){return Bt.Message.getFieldWithDefault(this,13,[])}set keys(e){Bt.Message.setField(this,13,e)}get page(){return Bt.Message.getFieldWithDefault(this,14,0)}set page(e){Bt.Message.setField(this,14,e)}get pageSize(){return Bt.Message.getFieldWithDefault(this,15,0)}set pageSize(e){Bt.Message.setField(this,15,e)}get version(){return Bt.Message.getFieldWithDefault(this,16,"")}set version(e){Bt.Message.setField(this,16,e)}get v(){return Bt.Message.getFieldWithDefault(this,17,0)}set v(e){Bt.Message.setField(this,17,e)}get talkMode(){return Bt.Message.getFieldWithDefault(this,18,0)}set talkMode(e){Bt.Message.setField(this,18,e)}get proto(){return Bt.Message.getFieldWithDefault(this,19,"")}set proto(e){Bt.Message.setField(this,19,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,20,"")}set nickname(e){Bt.Message.setField(this,20,e)}get protocol(){return Bt.Message.getFieldWithDefault(this,21,new Uint8Array(0))}set protocol(e){Bt.Message.setField(this,21,e)}get deviceTag(){return Bt.Message.getFieldWithDefault(this,22,"")}set deviceTag(e){Bt.Message.setField(this,22,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,23,"")}set avatar(e){Bt.Message.setField(this,23,e)}static fromObject(e){const r=new t({});return null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.appId&&(r.appId=e.appId),null!=e.userId&&(r.userId=e.userId),null!=e.roomId&&(r.roomId=e.roomId),null!=e.teamId&&(r.teamId=e.teamId),null!=e.startTime&&(r.startTime=e.startTime),null!=e.endTime&&(r.endTime=e.endTime),null!=e.ids&&(r.ids=e.ids),null!=e.token&&(r.token=e.token),null!=e.roomIds&&(r.roomIds=e.roomIds),null!=e.userIds&&(r.userIds=e.userIds),null!=e.teamIds&&(r.teamIds=e.teamIds),null!=e.keys&&(r.keys=e.keys),null!=e.page&&(r.page=e.page),null!=e.pageSize&&(r.pageSize=e.pageSize),null!=e.version&&(r.version=e.version),null!=e.v&&(r.v=e.v),null!=e.talkMode&&(r.talkMode=e.talkMode),null!=e.proto&&(r.proto=e.proto),null!=e.nickname&&(r.nickname=e.nickname),null!=e.protocol&&(r.protocol=e.protocol),null!=e.deviceTag&&(r.deviceTag=e.deviceTag),null!=e.avatar&&(r.avatar=e.avatar),r}toObject(){const e={};return null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.appId&&(e.appId=this.appId),null!=this.userId&&(e.userId=this.userId),null!=this.roomId&&(e.roomId=this.roomId),null!=this.teamId&&(e.teamId=this.teamId),null!=this.startTime&&(e.startTime=this.startTime),null!=this.endTime&&(e.endTime=this.endTime),null!=this.ids&&(e.ids=this.ids),null!=this.token&&(e.token=this.token),null!=this.roomIds&&(e.roomIds=this.roomIds),null!=this.userIds&&(e.userIds=this.userIds),null!=this.teamIds&&(e.teamIds=this.teamIds),null!=this.keys&&(e.keys=this.keys),null!=this.page&&(e.page=this.page),null!=this.pageSize&&(e.pageSize=this.pageSize),null!=this.version&&(e.version=this.version),null!=this.v&&(e.v=this.v),null!=this.talkMode&&(e.talkMode=this.talkMode),null!=this.proto&&(e.proto=this.proto),null!=this.nickname&&(e.nickname=this.nickname),null!=this.protocol&&(e.protocol=this.protocol),null!=this.deviceTag&&(e.deviceTag=this.deviceTag),null!=this.avatar&&(e.avatar=this.avatar),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.deviceKey.length&&t.writeString(1,this.deviceKey),0!=this.appId&&t.writeInt64(2,this.appId),this.userId.length&&t.writeString(3,this.userId),0!=this.roomId&&t.writeInt64(4,this.roomId),0!=this.teamId&&t.writeInt64(5,this.teamId),this.startTime.length&&t.writeString(6,this.startTime),this.endTime.length&&t.writeString(7,this.endTime),this.ids.length&&t.writeRepeatedString(8,this.ids),this.token.length&&t.writeString(9,this.token),this.roomIds.length&&t.writePackedInt64(10,this.roomIds),this.userIds.length&&t.writeRepeatedString(11,this.userIds),this.teamIds.length&&t.writePackedInt64(12,this.teamIds),this.keys.length&&t.writePackedInt64(13,this.keys),0!=this.page&&t.writeInt32(14,this.page),0!=this.pageSize&&t.writeInt32(15,this.pageSize),this.version.length&&t.writeString(16,this.version),0!=this.v&&t.writeDouble(17,this.v),0!=this.talkMode&&t.writeInt32(18,this.talkMode),this.proto.length&&t.writeString(19,this.proto),this.nickname.length&&t.writeString(20,this.nickname),this.protocol.length&&t.writeBytes(21,this.protocol),this.deviceTag.length&&t.writeString(22,this.deviceTag),this.avatar.length&&t.writeString(23,this.avatar),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.deviceKey=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.userId=r.readString();break;case 4:i.roomId=r.readInt64();break;case 5:i.teamId=r.readInt64();break;case 6:i.startTime=r.readString();break;case 7:i.endTime=r.readString();break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.token=r.readString();break;case 10:i.roomIds=r.readPackedInt64();break;case 11:Bt.Message.addToRepeatedField(i,11,r.readString());break;case 12:i.teamIds=r.readPackedInt64();break;case 13:i.keys=r.readPackedInt64();break;case 14:i.page=r.readInt32();break;case 15:i.pageSize=r.readInt32();break;case 16:i.version=r.readString();break;case 17:i.v=r.readDouble();break;case 18:i.talkMode=r.readInt32();break;case 19:i.proto=r.readString();break;case 20:i.nickname=r.readString();break;case 21:i.protocol=r.readBytes();break;case 22:i.deviceTag=r.readString();break;case 23:i.avatar=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Meta=t}(e.imio||(e.imio={}))}(_t||(_t={}));class Wt{static _version=1;token="";tokenAppId=0;pageSize=300;account=null;deviceId="";deviceName="";deviceModel="";ip="";country="";city="";getTokenAppId(){return this.tokenAppId}meta=new _t.imio.Meta({v:Wt._version,deviceTag:"h5",page:0,pageSize:30});axios=xt.create({timeout:5e3});socket;contactList=[];getIP1(){xt.get("https://api.ipbase.com/v1/json/").then(e=>{let t=e.data;200==e.status&&t.ip?(this.ip=t?.ip,this.country=t?.country_name,this.city=t?.region_name+"-"+t?.city):this.getIP2()}).catch(e=>{this.getIP2()})}getIP3(){xt.get("https://ipinfo.io/json").then(e=>{let t=e.data;200==e.status&&t.ip&&(this.ip=t?.ip,this.country=t?.country,this.city=t?.region+"-"+t?.city)}).catch(e=>{})}getIP2(){xt.get("http://ip-api.com/json/").then(e=>{let t=e.data;200==e.status&&t.status&&"success"==t.status?(this.ip=t?.query,this.country=t?.country,this.city=t?.regionName+"-"+t?.city):this.getIP3()}).catch(e=>{this.getIP3()})}getJwtPayload(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}decodeMetadata(e){const t=new Map;try{const r=(0,d.decodeCompositeMetadata)(e);for(let e of r)if(e){const r=e;r.type==d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING.toString()&&t.set("route",r.content.toString()),e.mimeType==d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING.toString()&&t.set("route",r.content.toString())}}catch(e){}return t}buildRoute(e){let t=(0,d.encodeRoute)(e);return(0,d.encodeCompositeMetadata)([[d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING,t]])}buildDeviceStatus(e){let t=new m;return t.deviceTag=e.deviceTag,t.deviceId=e.device,t.deviceKey=e.deviceKey,t.status=e.status,t.region=e.region,t.gateway=e.gateway,t.joinId=e.roomId,t.userId=e.userId,t}buildGateway(e){let t=new f;return 4==e.ip?(t.type=!0,t.host=`${e.one}.${e.two}.${e.three}.${e.four}`):(t.type=!1,t.host=e.host),t.max=e.max,t.port=e.port,t.region=e.remark,t.current=e.sort,t}buildContact(e){let t=new c;return t.contactId=e.id,t.joinId=e.joinRoomId,t.userId=e.userId,t.nickname=e.nickname,t.username=e.username,t.subgroup=e.subgroup,t.avatar=e.avatar,t.isGroup=2==e.talkMode,t.joinTime=e.joinTime,t.isMuted=1==e.muted,t.noise=e.noise,t.sort=e.sort,e.status==o.offline&&(t.status=o.offline),e.status==o.online&&(t.status=o.online),e.status==o.online_busy&&(t.status=o.online_busy),e.status==o.online_leave&&(t.status=o.online_leave),t}buildMember(e){let t=new p;return t.memberId=e.id,t.joinId=e.joinRoomId,t.userId=e.userId,t.nickname=e.nickname,t.username=e.username,t.avatar=e.avatar,t.status=e.status,t.joinTime=e.joinTime,t.isMuted=1==e.muted,t.role=e.role,t}buildGroup(e){let t=new g;switch(t.groupId=e.id,t.joinId=e.id,t.groupName=e.roomname,t.groupNumber=e.account,t.userId=e.userId,t.avatar=e.avatar,t.depict=e.depict,t.isTalk=1==e.groupToOne,t.isApproval=1==e.applyJoin,t.isInviteApply=1==e.applyNeed,t.isInvite=1==e.invite,t.maxMember=e.roomMax,t.isGroup=2==e.talkMode,t.isMute=1==e.muted,t.isRevoke=1==e.revoke,t.ask=e.ask,e.type){case"protected":t.type=a.protected;break;case"public":t.type=a.public;break;case"private":t.type=a.private}return t}buildMessage(e){let r=new h;switch(r.messageId=e.messageId,r.joinId=e.roomId,r.tag=e.tag,r.fromId=e.fromId,r.fromName=e.fromName,r.destId=e.destId,r.destName=e.destName,r.cite=e.cite,r.type=this.subtype(e.subtype),r.title=e.title,r.subtitle=e.subtitle,r.text=e.text,r.secret=e.secret,r.thumb=e.thumb,r.host=e.host,r.url=e.url,r.lng=e.lng,r.lat=e.lat,r.size=e.size,r.length=e.length,r.sent=e.sent,r.sentDate=new Date(e.sent),r.revoke=0!=e.revoke.length,e.talkMode){case 1:r.talk=n.default;break;case 2:r.talk=n.group;break;case 3:r.talk=n.team}switch(e.label){case"tip":r.label=t.tip;break;case"notice":r.label=t.notice;break;case"action":r.label=t.action;break;case"cc":r.label=t.notify;break;case"bcc":r.label=t.quietly}if(e.citeData&&(r.citeData=this.buildMessage(e.citeData)),e.remind&&e.remind.length){r.hintList=[];for(let t of e.remind){let e=new h;e.fromId=t.fromId,e.destId=t.destId,e.destName=t.nickname,e.joinId=t.roomId,r.hintList.push(e)}}if(e.cc&&e.cc.length){r.notifyList=[],r.quietlyList=[];for(let t of e.cc){let e=new h;e.fromId=t.fromId,e.destId=t.destId,e.destName=t.nickname,e.joinId=t.roomId,0==t.sort?r.notifyList.push(e):r.quietlyList.push(e)}}return r}subtype(e){switch(e){case 1:return"txt";case 2:return"img";case 3:return"audio";case 4:return"video";case 5:return"file";case 6:return"loc";case 7:return"custom";case 9:return"wallet"}return""}}!function(e){e[e.DONE=0]="DONE",e[e.ERROR=-1]="ERROR",e[e.CONNECTING=1]="CONNECTING",e[e.SUCCESS_PULL=2]="SUCCESS_PULL",e[e.SUCCESS=3]="SUCCESS",e[e.RETRY_CONNECTING=4]="RETRY_CONNECTING",e[e.TOKEN_EXPIRED=5]="TOKEN_EXPIRED"}(Dt||(Dt={})),function(e){e[e.ERROR=0]="ERROR",e[e.CONNECT=1]="CONNECT",e[e.PULL=2]="PULL",e[e.SUCCESS=3]="SUCCESS",e[e.OFFLINE=4]="OFFLINE"}(Lt||(Lt={})),function(e){e[e.APPLY=1]="APPLY",e[e.APPLY_RESOLVE=2]="APPLY_RESOLVE",e[e.APPLY_AGREE=3]="APPLY_AGREE",e[e.APPLY_REJECT=4]="APPLY_REJECT",e[e.ROOM_EXIT=5]="ROOM_EXIT",e[e.ROOM_DISSOLVE=6]="ROOM_DISSOLVE"}(Pt||(Pt={}));class zt{accountId="";account="";nickname="";email="";phone=0;avatar="";roomId=0;apply=0;muted=0;need=0;lurk=0;status=""}class Gt extends Wt{buildRoute(e,t=""){let r=(0,d.encodeRoute)(e);return t.length>100?(0,d.encodeCompositeMetadata)([[d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING,r],[d.WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION,(0,d.encodeBearerAuthMetadata)(t)]]):(0,d.encodeCompositeMetadata)([[d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING,r]])}}!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8,32,33,34],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"userId"in e&&null!=e.userId&&(this.userId=e.userId),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"fromRoomId"in e&&null!=e.fromRoomId&&(this.fromRoomId=e.fromRoomId),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"username"in e&&null!=e.username&&(this.username=e.username),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar),"fromUserId"in e&&null!=e.fromUserId&&(this.fromUserId=e.fromUserId),"subgroup"in e&&null!=e.subgroup&&(this.subgroup=e.subgroup),"account"in e&&null!=e.account&&(this.account=e.account),"role"in e&&null!=e.role&&(this.role=e.role),"lastTime"in e&&null!=e.lastTime&&(this.lastTime=e.lastTime),"talkMode"in e&&null!=e.talkMode&&(this.talkMode=e.talkMode),"muted"in e&&null!=e.muted&&(this.muted=e.muted),"apply"in e&&null!=e.apply&&(this.apply=e.apply),"upload"in e&&null!=e.upload&&(this.upload=e.upload),"downed"in e&&null!=e.downed&&(this.downed=e.downed),"black"in e&&null!=e.black&&(this.black=e.black),"noise"in e&&null!=e.noise&&(this.noise=e.noise),"joinTeamId"in e&&null!=e.joinTeamId&&(this.joinTeamId=e.joinTeamId),"joinTime"in e&&null!=e.joinTime&&(this.joinTime=e.joinTime),"joinRoomId"in e&&null!=e.joinRoomId&&(this.joinRoomId=e.joinRoomId),"roomIds"in e&&null!=e.roomIds&&(this.roomIds=e.roomIds),"userIds"in e&&null!=e.userIds&&(this.userIds=e.userIds),"teamIds"in e&&null!=e.teamIds&&(this.teamIds=e.teamIds),"unique"in e&&null!=e.unique&&(this.unique=e.unique),"status"in e&&null!=e.status&&(this.status=e.status))}get id(){return Bt.Message.getFieldWithDefault(this,1,0)}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get userId(){return Bt.Message.getFieldWithDefault(this,11,"")}set userId(e){Bt.Message.setField(this,11,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,12,0)}set roomId(e){Bt.Message.setField(this,12,e)}get fromRoomId(){return Bt.Message.getFieldWithDefault(this,13,0)}set fromRoomId(e){Bt.Message.setField(this,13,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,14,"")}set nickname(e){Bt.Message.setField(this,14,e)}get username(){return Bt.Message.getFieldWithDefault(this,15,"")}set username(e){Bt.Message.setField(this,15,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,16,"")}set avatar(e){Bt.Message.setField(this,16,e)}get fromUserId(){return Bt.Message.getFieldWithDefault(this,17,"")}set fromUserId(e){Bt.Message.setField(this,17,e)}get subgroup(){return Bt.Message.getFieldWithDefault(this,18,"")}set subgroup(e){Bt.Message.setField(this,18,e)}get account(){return Bt.Message.getFieldWithDefault(this,19,"")}set account(e){Bt.Message.setField(this,19,e)}get role(){return Bt.Message.getFieldWithDefault(this,20,"")}set role(e){Bt.Message.setField(this,20,e)}get lastTime(){return Bt.Message.getFieldWithDefault(this,21,"")}set lastTime(e){Bt.Message.setField(this,21,e)}get talkMode(){return Bt.Message.getFieldWithDefault(this,22,0)}set talkMode(e){Bt.Message.setField(this,22,e)}get muted(){return Bt.Message.getFieldWithDefault(this,23,0)}set muted(e){Bt.Message.setField(this,23,e)}get apply(){return Bt.Message.getFieldWithDefault(this,24,0)}set apply(e){Bt.Message.setField(this,24,e)}get upload(){return Bt.Message.getFieldWithDefault(this,25,0)}set upload(e){Bt.Message.setField(this,25,e)}get downed(){return Bt.Message.getFieldWithDefault(this,26,0)}set downed(e){Bt.Message.setField(this,26,e)}get black(){return Bt.Message.getFieldWithDefault(this,27,0)}set black(e){Bt.Message.setField(this,27,e)}get noise(){return Bt.Message.getFieldWithDefault(this,28,0)}set noise(e){Bt.Message.setField(this,28,e)}get joinTeamId(){return Bt.Message.getFieldWithDefault(this,29,0)}set joinTeamId(e){Bt.Message.setField(this,29,e)}get joinTime(){return Bt.Message.getFieldWithDefault(this,30,"")}set joinTime(e){Bt.Message.setField(this,30,e)}get joinRoomId(){return Bt.Message.getFieldWithDefault(this,31,0)}set joinRoomId(e){Bt.Message.setField(this,31,e)}get roomIds(){return Bt.Message.getFieldWithDefault(this,32,[])}set roomIds(e){Bt.Message.setField(this,32,e)}get userIds(){return Bt.Message.getFieldWithDefault(this,33,[])}set userIds(e){Bt.Message.setField(this,33,e)}get teamIds(){return Bt.Message.getFieldWithDefault(this,34,[])}set teamIds(e){Bt.Message.setField(this,34,e)}get unique(){return Bt.Message.getFieldWithDefault(this,36,"")}set unique(e){Bt.Message.setField(this,36,e)}get status(){return Bt.Message.getFieldWithDefault(this,37,"")}set status(e){Bt.Message.setField(this,37,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.userId&&(r.userId=e.userId),null!=e.roomId&&(r.roomId=e.roomId),null!=e.fromRoomId&&(r.fromRoomId=e.fromRoomId),null!=e.nickname&&(r.nickname=e.nickname),null!=e.username&&(r.username=e.username),null!=e.avatar&&(r.avatar=e.avatar),null!=e.fromUserId&&(r.fromUserId=e.fromUserId),null!=e.subgroup&&(r.subgroup=e.subgroup),null!=e.account&&(r.account=e.account),null!=e.role&&(r.role=e.role),null!=e.lastTime&&(r.lastTime=e.lastTime),null!=e.talkMode&&(r.talkMode=e.talkMode),null!=e.muted&&(r.muted=e.muted),null!=e.apply&&(r.apply=e.apply),null!=e.upload&&(r.upload=e.upload),null!=e.downed&&(r.downed=e.downed),null!=e.black&&(r.black=e.black),null!=e.noise&&(r.noise=e.noise),null!=e.joinTeamId&&(r.joinTeamId=e.joinTeamId),null!=e.joinTime&&(r.joinTime=e.joinTime),null!=e.joinRoomId&&(r.joinRoomId=e.joinRoomId),null!=e.roomIds&&(r.roomIds=e.roomIds),null!=e.userIds&&(r.userIds=e.userIds),null!=e.teamIds&&(r.teamIds=e.teamIds),null!=e.unique&&(r.unique=e.unique),null!=e.status&&(r.status=e.status),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.userId&&(e.userId=this.userId),null!=this.roomId&&(e.roomId=this.roomId),null!=this.fromRoomId&&(e.fromRoomId=this.fromRoomId),null!=this.nickname&&(e.nickname=this.nickname),null!=this.username&&(e.username=this.username),null!=this.avatar&&(e.avatar=this.avatar),null!=this.fromUserId&&(e.fromUserId=this.fromUserId),null!=this.subgroup&&(e.subgroup=this.subgroup),null!=this.account&&(e.account=this.account),null!=this.role&&(e.role=this.role),null!=this.lastTime&&(e.lastTime=this.lastTime),null!=this.talkMode&&(e.talkMode=this.talkMode),null!=this.muted&&(e.muted=this.muted),null!=this.apply&&(e.apply=this.apply),null!=this.upload&&(e.upload=this.upload),null!=this.downed&&(e.downed=this.downed),null!=this.black&&(e.black=this.black),null!=this.noise&&(e.noise=this.noise),null!=this.joinTeamId&&(e.joinTeamId=this.joinTeamId),null!=this.joinTime&&(e.joinTime=this.joinTime),null!=this.joinRoomId&&(e.joinRoomId=this.joinRoomId),null!=this.roomIds&&(e.roomIds=this.roomIds),null!=this.userIds&&(e.userIds=this.userIds),null!=this.teamIds&&(e.teamIds=this.teamIds),null!=this.unique&&(e.unique=this.unique),null!=this.status&&(e.status=this.status),e}serialize(e){const t=e||new Bt.BinaryWriter;if(0!=this.id&&t.writeInt64(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),this.userId.length&&t.writeString(11,this.userId),0!=this.roomId&&t.writeInt64(12,this.roomId),0!=this.fromRoomId&&t.writeInt64(13,this.fromRoomId),this.nickname.length&&t.writeString(14,this.nickname),this.username.length&&t.writeString(15,this.username),this.avatar.length&&t.writeString(16,this.avatar),this.fromUserId.length&&t.writeString(17,this.fromUserId),this.subgroup.length&&t.writeString(18,this.subgroup),this.account.length&&t.writeString(19,this.account),this.role.length&&t.writeString(20,this.role),this.lastTime.length&&t.writeString(21,this.lastTime),0!=this.talkMode&&t.writeInt32(22,this.talkMode),0!=this.muted&&t.writeInt32(23,this.muted),0!=this.apply&&t.writeInt32(24,this.apply),0!=this.upload&&t.writeInt32(25,this.upload),0!=this.downed&&t.writeInt32(26,this.downed),0!=this.black&&t.writeInt32(27,this.black),0!=this.noise&&t.writeInt32(28,this.noise),0!=this.joinTeamId&&t.writeInt64(29,this.joinTeamId),this.joinTime.length&&t.writeString(30,this.joinTime),0!=this.joinRoomId&&t.writeInt64(31,this.joinRoomId),this.roomIds.length&&t.writePackedInt64(32,this.roomIds),this.userIds.length&&t.writeRepeatedString(33,this.userIds),this.teamIds.length&&t.writePackedInt64(34,this.teamIds),this.unique.length&&t.writeString(36,this.unique),this.status.length&&t.writeString(37,this.status),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readInt64();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.userId=r.readString();break;case 12:i.roomId=r.readInt64();break;case 13:i.fromRoomId=r.readInt64();break;case 14:i.nickname=r.readString();break;case 15:i.username=r.readString();break;case 16:i.avatar=r.readString();break;case 17:i.fromUserId=r.readString();break;case 18:i.subgroup=r.readString();break;case 19:i.account=r.readString();break;case 20:i.role=r.readString();break;case 21:i.lastTime=r.readString();break;case 22:i.talkMode=r.readInt32();break;case 23:i.muted=r.readInt32();break;case 24:i.apply=r.readInt32();break;case 25:i.upload=r.readInt32();break;case 26:i.downed=r.readInt32();break;case 27:i.black=r.readInt32();break;case 28:i.noise=r.readInt32();break;case 29:i.joinTeamId=r.readInt64();break;case 30:i.joinTime=r.readString();break;case 31:i.joinRoomId=r.readInt64();break;case 32:i.roomIds=r.readPackedInt64();break;case 33:Bt.Message.addToRepeatedField(i,33,r.readString());break;case 34:i.teamIds=r.readPackedInt64();break;case 36:i.unique=r.readString();break;case 37:i.status=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Contacts=t}(e.imio||(e.imio={}))}(Ut||(Ut={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8,28,29,37],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"userId"in e&&null!=e.userId&&(this.userId=e.userId),"roomname"in e&&null!=e.roomname&&(this.roomname=e.roomname),"level"in e&&null!=e.level&&(this.level=e.level),"describe"in e&&null!=e.describe&&(this.describe=e.describe),"type"in e&&null!=e.type&&(this.type=e.type),"joinKey"in e&&null!=e.joinKey&&(this.joinKey=e.joinKey),"talkMode"in e&&null!=e.talkMode&&(this.talkMode=e.talkMode),"userCount"in e&&null!=e.userCount&&(this.userCount=e.userCount),"lurk"in e&&null!=e.lurk&&(this.lurk=e.lurk),"depict"in e&&null!=e.depict&&(this.depict=e.depict),"muted"in e&&null!=e.muted&&(this.muted=e.muted),"applyJoin"in e&&null!=e.applyJoin&&(this.applyJoin=e.applyJoin),"applyNeed"in e&&null!=e.applyNeed&&(this.applyNeed=e.applyNeed),"invite"in e&&null!=e.invite&&(this.invite=e.invite),"uped"in e&&null!=e.uped&&(this.uped=e.uped),"downed"in e&&null!=e.downed&&(this.downed=e.downed),"revoke"in e&&null!=e.revoke&&(this.revoke=e.revoke),"tags"in e&&null!=e.tags&&(this.tags=e.tags),"users"in e&&null!=e.users&&(this.users=e.users),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar),"groupToOne"in e&&null!=e.groupToOne&&(this.groupToOne=e.groupToOne),"roomCount"in e&&null!=e.roomCount&&(this.roomCount=e.roomCount),"group"in e&&null!=e.group&&(this.group=e.group),"teamCount"in e&&null!=e.teamCount&&(this.teamCount=e.teamCount),"ask"in e&&null!=e.ask&&(this.ask=e.ask),"answer"in e&&null!=e.answer&&(this.answer=e.answer),"roomIds"in e&&null!=e.roomIds&&(this.roomIds=e.roomIds),"account"in e&&null!=e.account&&(this.account=e.account),"roomMax"in e&&null!=e.roomMax&&(this.roomMax=e.roomMax),"teamMax"in e&&null!=e.teamMax&&(this.teamMax=e.teamMax))}get id(){return Bt.Message.getFieldWithDefault(this,1,0)}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get userId(){return Bt.Message.getFieldWithDefault(this,11,"")}set userId(e){Bt.Message.setField(this,11,e)}get roomname(){return Bt.Message.getFieldWithDefault(this,12,"")}set roomname(e){Bt.Message.setField(this,12,e)}get level(){return Bt.Message.getFieldWithDefault(this,13,"")}set level(e){Bt.Message.setField(this,13,e)}get describe(){return Bt.Message.getFieldWithDefault(this,14,"")}set describe(e){Bt.Message.setField(this,14,e)}get type(){return Bt.Message.getFieldWithDefault(this,15,"")}set type(e){Bt.Message.setField(this,15,e)}get joinKey(){return Bt.Message.getFieldWithDefault(this,16,"")}set joinKey(e){Bt.Message.setField(this,16,e)}get talkMode(){return Bt.Message.getFieldWithDefault(this,17,0)}set talkMode(e){Bt.Message.setField(this,17,e)}get userCount(){return Bt.Message.getFieldWithDefault(this,18,0)}set userCount(e){Bt.Message.setField(this,18,e)}get lurk(){return Bt.Message.getFieldWithDefault(this,19,0)}set lurk(e){Bt.Message.setField(this,19,e)}get depict(){return Bt.Message.getFieldWithDefault(this,20,"")}set depict(e){Bt.Message.setField(this,20,e)}get muted(){return Bt.Message.getFieldWithDefault(this,21,0)}set muted(e){Bt.Message.setField(this,21,e)}get applyJoin(){return Bt.Message.getFieldWithDefault(this,22,0)}set applyJoin(e){Bt.Message.setField(this,22,e)}get applyNeed(){return Bt.Message.getFieldWithDefault(this,23,0)}set applyNeed(e){Bt.Message.setField(this,23,e)}get invite(){return Bt.Message.getFieldWithDefault(this,24,0)}set invite(e){Bt.Message.setField(this,24,e)}get uped(){return Bt.Message.getFieldWithDefault(this,25,0)}set uped(e){Bt.Message.setField(this,25,e)}get downed(){return Bt.Message.getFieldWithDefault(this,26,0)}set downed(e){Bt.Message.setField(this,26,e)}get revoke(){return Bt.Message.getFieldWithDefault(this,27,0)}set revoke(e){Bt.Message.setField(this,27,e)}get tags(){return Bt.Message.getFieldWithDefault(this,28,[])}set tags(e){Bt.Message.setField(this,28,e)}get users(){return Bt.Message.getRepeatedWrapperField(this,Ut.imio.Contacts,29)}set users(e){Bt.Message.setRepeatedWrapperField(this,29,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,30,"")}set avatar(e){Bt.Message.setField(this,30,e)}get groupToOne(){return Bt.Message.getFieldWithDefault(this,31,0)}set groupToOne(e){Bt.Message.setField(this,31,e)}get roomCount(){return Bt.Message.getFieldWithDefault(this,32,0)}set roomCount(e){Bt.Message.setField(this,32,e)}get group(){return Bt.Message.getFieldWithDefault(this,33,0)}set group(e){Bt.Message.setField(this,33,e)}get teamCount(){return Bt.Message.getFieldWithDefault(this,34,0)}set teamCount(e){Bt.Message.setField(this,34,e)}get ask(){return Bt.Message.getFieldWithDefault(this,35,"")}set ask(e){Bt.Message.setField(this,35,e)}get answer(){return Bt.Message.getFieldWithDefault(this,36,"")}set answer(e){Bt.Message.setField(this,36,e)}get roomIds(){return Bt.Message.getFieldWithDefault(this,37,[])}set roomIds(e){Bt.Message.setField(this,37,e)}get account(){return Bt.Message.getFieldWithDefault(this,38,"")}set account(e){Bt.Message.setField(this,38,e)}get roomMax(){return Bt.Message.getFieldWithDefault(this,39,0)}set roomMax(e){Bt.Message.setField(this,39,e)}get teamMax(){return Bt.Message.getFieldWithDefault(this,40,0)}set teamMax(e){Bt.Message.setField(this,40,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.userId&&(r.userId=e.userId),null!=e.roomname&&(r.roomname=e.roomname),null!=e.level&&(r.level=e.level),null!=e.describe&&(r.describe=e.describe),null!=e.type&&(r.type=e.type),null!=e.joinKey&&(r.joinKey=e.joinKey),null!=e.talkMode&&(r.talkMode=e.talkMode),null!=e.userCount&&(r.userCount=e.userCount),null!=e.lurk&&(r.lurk=e.lurk),null!=e.depict&&(r.depict=e.depict),null!=e.muted&&(r.muted=e.muted),null!=e.applyJoin&&(r.applyJoin=e.applyJoin),null!=e.applyNeed&&(r.applyNeed=e.applyNeed),null!=e.invite&&(r.invite=e.invite),null!=e.uped&&(r.uped=e.uped),null!=e.downed&&(r.downed=e.downed),null!=e.revoke&&(r.revoke=e.revoke),null!=e.tags&&(r.tags=e.tags),null!=e.users&&(r.users=e.users.map(e=>Ut.imio.Contacts.fromObject(e))),null!=e.avatar&&(r.avatar=e.avatar),null!=e.groupToOne&&(r.groupToOne=e.groupToOne),null!=e.roomCount&&(r.roomCount=e.roomCount),null!=e.group&&(r.group=e.group),null!=e.teamCount&&(r.teamCount=e.teamCount),null!=e.ask&&(r.ask=e.ask),null!=e.answer&&(r.answer=e.answer),null!=e.roomIds&&(r.roomIds=e.roomIds),null!=e.account&&(r.account=e.account),null!=e.roomMax&&(r.roomMax=e.roomMax),null!=e.teamMax&&(r.teamMax=e.teamMax),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.userId&&(e.userId=this.userId),null!=this.roomname&&(e.roomname=this.roomname),null!=this.level&&(e.level=this.level),null!=this.describe&&(e.describe=this.describe),null!=this.type&&(e.type=this.type),null!=this.joinKey&&(e.joinKey=this.joinKey),null!=this.talkMode&&(e.talkMode=this.talkMode),null!=this.userCount&&(e.userCount=this.userCount),null!=this.lurk&&(e.lurk=this.lurk),null!=this.depict&&(e.depict=this.depict),null!=this.muted&&(e.muted=this.muted),null!=this.applyJoin&&(e.applyJoin=this.applyJoin),null!=this.applyNeed&&(e.applyNeed=this.applyNeed),null!=this.invite&&(e.invite=this.invite),null!=this.uped&&(e.uped=this.uped),null!=this.downed&&(e.downed=this.downed),null!=this.revoke&&(e.revoke=this.revoke),null!=this.tags&&(e.tags=this.tags),null!=this.users&&(e.users=this.users.map(e=>e.toObject())),null!=this.avatar&&(e.avatar=this.avatar),null!=this.groupToOne&&(e.groupToOne=this.groupToOne),null!=this.roomCount&&(e.roomCount=this.roomCount),null!=this.group&&(e.group=this.group),null!=this.teamCount&&(e.teamCount=this.teamCount),null!=this.ask&&(e.ask=this.ask),null!=this.answer&&(e.answer=this.answer),null!=this.roomIds&&(e.roomIds=this.roomIds),null!=this.account&&(e.account=this.account),null!=this.roomMax&&(e.roomMax=this.roomMax),null!=this.teamMax&&(e.teamMax=this.teamMax),e}serialize(e){const t=e||new Bt.BinaryWriter;if(0!=this.id&&t.writeInt64(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),this.userId.length&&t.writeString(11,this.userId),this.roomname.length&&t.writeString(12,this.roomname),this.level.length&&t.writeString(13,this.level),this.describe.length&&t.writeString(14,this.describe),this.type.length&&t.writeString(15,this.type),this.joinKey.length&&t.writeString(16,this.joinKey),0!=this.talkMode&&t.writeInt32(17,this.talkMode),0!=this.userCount&&t.writeInt32(18,this.userCount),0!=this.lurk&&t.writeInt32(19,this.lurk),this.depict.length&&t.writeString(20,this.depict),0!=this.muted&&t.writeInt32(21,this.muted),0!=this.applyJoin&&t.writeInt32(22,this.applyJoin),0!=this.applyNeed&&t.writeInt32(23,this.applyNeed),0!=this.invite&&t.writeInt32(24,this.invite),0!=this.uped&&t.writeInt32(25,this.uped),0!=this.downed&&t.writeInt32(26,this.downed),0!=this.revoke&&t.writeInt32(27,this.revoke),this.tags.length&&t.writeRepeatedString(28,this.tags),this.users.length&&t.writeRepeatedMessage(29,this.users,e=>e.serialize(t)),this.avatar.length&&t.writeString(30,this.avatar),0!=this.groupToOne&&t.writeInt32(31,this.groupToOne),0!=this.roomCount&&t.writeInt32(32,this.roomCount),0!=this.group&&t.writeInt32(33,this.group),0!=this.teamCount&&t.writeInt32(34,this.teamCount),this.ask.length&&t.writeString(35,this.ask),this.answer.length&&t.writeString(36,this.answer),this.roomIds.length&&t.writeRepeatedString(37,this.roomIds),this.account.length&&t.writeString(38,this.account),0!=this.roomMax&&t.writeInt32(39,this.roomMax),0!=this.teamMax&&t.writeInt32(40,this.teamMax),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readInt64();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.userId=r.readString();break;case 12:i.roomname=r.readString();break;case 13:i.level=r.readString();break;case 14:i.describe=r.readString();break;case 15:i.type=r.readString();break;case 16:i.joinKey=r.readString();break;case 17:i.talkMode=r.readInt32();break;case 18:i.userCount=r.readInt32();break;case 19:i.lurk=r.readInt32();break;case 20:i.depict=r.readString();break;case 21:i.muted=r.readInt32();break;case 22:i.applyJoin=r.readInt32();break;case 23:i.applyNeed=r.readInt32();break;case 24:i.invite=r.readInt32();break;case 25:i.uped=r.readInt32();break;case 26:i.downed=r.readInt32();break;case 27:i.revoke=r.readInt32();break;case 28:Bt.Message.addToRepeatedField(i,28,r.readString());break;case 29:r.readMessage(i.users,()=>Bt.Message.addToRepeatedWrapperField(i,29,Ut.imio.Contacts.deserialize(r),Ut.imio.Contacts));break;case 30:i.avatar=r.readString();break;case 31:i.groupToOne=r.readInt32();break;case 32:i.roomCount=r.readInt32();break;case 33:i.group=r.readInt32();break;case 34:i.teamCount=r.readInt32();break;case 35:i.ask=r.readString();break;case 36:i.answer=r.readString();break;case 37:Bt.Message.addToRepeatedField(i,37,r.readString());break;case 38:i.account=r.readString();break;case 39:i.roomMax=r.readInt32();break;case 40:i.teamMax=r.readInt32();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Rooms=t}(e.imio||(e.imio={}))}(jt||(jt={}));var Vt,qt,Kt,Ht=r(287).hp,Yt=Ut.imio.Contacts,Xt=jt.imio.Rooms;class Jt extends Gt{static instance;imioClient=null;constructor(){super()}static getInstance(){return Jt.instance||(Jt.instance=new Jt),Jt.instance}setClient(e){return this.imioClient=e,this}getContactList(e=1,t=50){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));this.imioClient.meta.page=e,this.imioClient.meta.pageSize=t;const n=new Yt({meta:this.imioClient.meta,joinRoomId:this.imioClient.meta.roomId});let s=[];this.imioClient.socket?.requestStream({data:Ht.from(n.serializeBinary().buffer),metadata:this.buildRoute("contact.list")},3e3,{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let t=Yt.deserialize(e.data),r=this.buildContact(t);if(s.push(r),this.imioClient){let e=this.imioClient.contactList.findIndex(e=>e.contactId==r.contactId);-1==e?this.imioClient.contactList.push(r):this.imioClient.contactList.splice(e,1,r)}}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}getContactBlackList(e=1){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));this.imioClient.meta.page=e;const i=new Yt({meta:this.imioClient.meta,joinRoomId:this.imioClient.meta.roomId});let n=[];this.imioClient.socket?.requestStream({data:Ht.from(i.serializeBinary().buffer),metadata:this.buildRoute("contact.black.list")},3e3,{onComplete:()=>{t(n)},onNext:(e,t)=>{try{if(e.data){let t=Yt.deserialize(e.data),r=this.buildContact(t);n.push(r)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}getContactByUserId(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new Yt({meta:this.imioClient.meta,userId:e});let n=[];this.imioClient.socket?.requestStream({data:Ht.from(i.serializeBinary().buffer),metadata:this.buildRoute("contact.byUserId")},3e3,{onComplete:()=>{t(n)},onNext:(e,t)=>{try{if(e.data){let t=Yt.deserialize(e.data),r=this.buildContact(t);n.push(r)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}getContactByJoinId(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new Yt({meta:this.imioClient.meta,joinRoomId:e});let n=null;this.imioClient.socket?.requestResponse({data:Ht.from(i.serializeBinary().buffer),metadata:this.buildRoute("contact.byJoinId")},{onComplete:()=>{t(n)},onNext:(e,i)=>{try{if(e.data){let r=Yt.deserialize(e.data),s=this.buildContact(r);n=s,i&&t(n)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}addContact(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new Yt({meta:this.imioClient.meta,joinRoomId:e,remark:t});let s=null;this.imioClient.socket?.requestResponse({data:Ht.from(n.serializeBinary().buffer),metadata:this.buildRoute("contact.add")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Xt.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}handleApply(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));console.log("meta :",this.imioClient.meta.toObject());const s=new Yt({meta:this.imioClient.meta,account:e,apply:t?1:0,remark:r});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("handle.apply")},{onComplete:()=>{i(o)},onNext:(e,t)=>{try{if(e.data){let r=Xt.deserialize(e.data),n=this.buildGroup(r);o=n,t&&i(o)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}setRemarkName(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));const s=new Yt({meta:this.imioClient.meta,id:n.contactId,username:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.username")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setNoticeLevel(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));const s=new Yt({meta:this.imioClient.meta,id:n.contactId,noise:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.noise")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setBlack(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));if(n.isGroup)return void i(new Error("群禁止设置"));const s=new Yt({meta:this.imioClient.meta,userId:n.userId,black:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.black")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setSubgroup(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));const s=new Yt({meta:this.imioClient.meta,userId:n.userId,subgroup:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.subgroup")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setSort(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));const s=new Yt({meta:this.imioClient.meta,userId:n.userId,sort:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.sort")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}onError(e){if(e.indexOf("Jwt")>-1){try{this.imioClient.clientListener?.onTokenExpired()}catch(e){}return"IMIO Token 已过期"}return e.indexOf("SQL")>-1||e.indexOf("connect")>-1?"IMIO System Error":e.indexOf("terminal")>-1||e.indexOf("signal")>-1?"请求超时":""}checkSocket(){return this.imioClient?this.imioClient.socket?0==this.imioClient.getTokenAppId()||this.imioClient.getTokenAppId()!=this.imioClient.meta.appId?"token中的AppId 与 IMIOClientOption不一致":"":"IMIO Client 尚未建立连接":"IMIO Client 不存在"}}!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"messageId"in e&&null!=e.messageId&&(this.messageId=e.messageId),"destId"in e&&null!=e.destId&&(this.destId=e.destId),"fromId"in e&&null!=e.fromId&&(this.fromId=e.fromId),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"confirm"in e&&null!=e.confirm&&(this.confirm=e.confirm),"read"in e&&null!=e.read&&(this.read=e.read),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"type"in e&&null!=e.type&&(this.type=e.type))}get id(){return Bt.Message.getFieldWithDefault(this,1,"")}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get messageId(){return Bt.Message.getFieldWithDefault(this,11,"")}set messageId(e){Bt.Message.setField(this,11,e)}get destId(){return Bt.Message.getFieldWithDefault(this,12,"")}set destId(e){Bt.Message.setField(this,12,e)}get fromId(){return Bt.Message.getFieldWithDefault(this,13,"")}set fromId(e){Bt.Message.setField(this,13,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,14,"")}set nickname(e){Bt.Message.setField(this,14,e)}get confirm(){return Bt.Message.getFieldWithDefault(this,15,"")}set confirm(e){Bt.Message.setField(this,15,e)}get read(){return Bt.Message.getFieldWithDefault(this,16,"")}set read(e){Bt.Message.setField(this,16,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,17,0)}set roomId(e){Bt.Message.setField(this,17,e)}get type(){return Bt.Message.getFieldWithDefault(this,18,0)}set type(e){Bt.Message.setField(this,18,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.messageId&&(r.messageId=e.messageId),null!=e.destId&&(r.destId=e.destId),null!=e.fromId&&(r.fromId=e.fromId),null!=e.nickname&&(r.nickname=e.nickname),null!=e.confirm&&(r.confirm=e.confirm),null!=e.read&&(r.read=e.read),null!=e.roomId&&(r.roomId=e.roomId),null!=e.type&&(r.type=e.type),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.messageId&&(e.messageId=this.messageId),null!=this.destId&&(e.destId=this.destId),null!=this.fromId&&(e.fromId=this.fromId),null!=this.nickname&&(e.nickname=this.nickname),null!=this.confirm&&(e.confirm=this.confirm),null!=this.read&&(e.read=this.read),null!=this.roomId&&(e.roomId=this.roomId),null!=this.type&&(e.type=this.type),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.id.length&&t.writeString(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),this.messageId.length&&t.writeString(11,this.messageId),this.destId.length&&t.writeString(12,this.destId),this.fromId.length&&t.writeString(13,this.fromId),this.nickname.length&&t.writeString(14,this.nickname),this.confirm.length&&t.writeString(15,this.confirm),this.read.length&&t.writeString(16,this.read),0!=this.roomId&&t.writeInt64(17,this.roomId),0!=this.type&&t.writeInt32(18,this.type),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.messageId=r.readString();break;case 12:i.destId=r.readString();break;case 13:i.fromId=r.readString();break;case 14:i.nickname=r.readString();break;case 15:i.confirm=r.readString();break;case 16:i.read=r.readString();break;case 17:i.roomId=r.readInt64();break;case 18:i.type=r.readInt32();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.MessageRemind=t}(e.imio||(e.imio={}))}(Vt||(Vt={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8,33,39],this.#e),Array.isArray(e)||"object"!=typeof e||("messageId"in e&&null!=e.messageId&&(this.messageId=e.messageId),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"fromName"in e&&null!=e.fromName&&(this.fromName=e.fromName),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"fromId"in e&&null!=e.fromId&&(this.fromId=e.fromId),"destId"in e&&null!=e.destId&&(this.destId=e.destId),"mimeType"in e&&null!=e.mimeType&&(this.mimeType=e.mimeType),"subtype"in e&&null!=e.subtype&&(this.subtype=e.subtype),"title"in e&&null!=e.title&&(this.title=e.title),"subtitle"in e&&null!=e.subtitle&&(this.subtitle=e.subtitle),"cite"in e&&null!=e.cite&&(this.cite=e.cite),"text"in e&&null!=e.text&&(this.text=e.text),"filename"in e&&null!=e.filename&&(this.filename=e.filename),"secret"in e&&null!=e.secret&&(this.secret=e.secret),"thumb"in e&&null!=e.thumb&&(this.thumb=e.thumb),"url"in e&&null!=e.url&&(this.url=e.url),"lat"in e&&null!=e.lat&&(this.lat=e.lat),"lng"in e&&null!=e.lng&&(this.lng=e.lng),"command"in e&&null!=e.command&&(this.command=e.command),"size"in e&&null!=e.size&&(this.size=e.size),"length"in e&&null!=e.length&&(this.length=e.length),"sent"in e&&null!=e.sent&&(this.sent=e.sent),"host"in e&&null!=e.host&&(this.host=e.host),"params"in e&&null!=e.params&&(this.params=e.params),"citeData"in e&&null!=e.citeData&&(this.citeData=e.citeData),"cc"in e&&null!=e.cc&&(this.cc=e.cc),"destName"in e&&null!=e.destName&&(this.destName=e.destName),"talkMode"in e&&null!=e.talkMode&&(this.talkMode=e.talkMode),"tag"in e&&null!=e.tag&&(this.tag=e.tag),"deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"label"in e&&null!=e.label&&(this.label=e.label),"remind"in e&&null!=e.remind&&(this.remind=e.remind),"fromAccount"in e&&null!=e.fromAccount&&(this.fromAccount=e.fromAccount),"destAccount"in e&&null!=e.destAccount&&(this.destAccount=e.destAccount),"revoke"in e&&null!=e.revoke&&(this.revoke=e.revoke))}get messageId(){return Bt.Message.getFieldWithDefault(this,1,"")}set messageId(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get fromName(){return Bt.Message.getFieldWithDefault(this,9,"")}set fromName(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get roomId(){return Bt.Message.getFieldWithDefault(this,11,0)}set roomId(e){Bt.Message.setField(this,11,e)}get fromId(){return Bt.Message.getFieldWithDefault(this,12,"")}set fromId(e){Bt.Message.setField(this,12,e)}get destId(){return Bt.Message.getFieldWithDefault(this,13,"")}set destId(e){Bt.Message.setField(this,13,e)}get mimeType(){return Bt.Message.getFieldWithDefault(this,14,"")}set mimeType(e){Bt.Message.setField(this,14,e)}get subtype(){return Bt.Message.getFieldWithDefault(this,15,0)}set subtype(e){Bt.Message.setField(this,15,e)}get title(){return Bt.Message.getFieldWithDefault(this,16,"")}set title(e){Bt.Message.setField(this,16,e)}get subtitle(){return Bt.Message.getFieldWithDefault(this,17,"")}set subtitle(e){Bt.Message.setField(this,17,e)}get cite(){return Bt.Message.getFieldWithDefault(this,18,"")}set cite(e){Bt.Message.setField(this,18,e)}get text(){return Bt.Message.getFieldWithDefault(this,19,"")}set text(e){Bt.Message.setField(this,19,e)}get filename(){return Bt.Message.getFieldWithDefault(this,20,"")}set filename(e){Bt.Message.setField(this,20,e)}get secret(){return Bt.Message.getFieldWithDefault(this,21,"")}set secret(e){Bt.Message.setField(this,21,e)}get thumb(){return Bt.Message.getFieldWithDefault(this,22,"")}set thumb(e){Bt.Message.setField(this,22,e)}get url(){return Bt.Message.getFieldWithDefault(this,23,"")}set url(e){Bt.Message.setField(this,23,e)}get lat(){return Bt.Message.getFieldWithDefault(this,24,"")}set lat(e){Bt.Message.setField(this,24,e)}get lng(){return Bt.Message.getFieldWithDefault(this,25,"")}set lng(e){Bt.Message.setField(this,25,e)}get command(){return Bt.Message.getFieldWithDefault(this,26,"")}set command(e){Bt.Message.setField(this,26,e)}get size(){return Bt.Message.getFieldWithDefault(this,27,0)}set size(e){Bt.Message.setField(this,27,e)}get length(){return Bt.Message.getFieldWithDefault(this,28,0)}set length(e){Bt.Message.setField(this,28,e)}get sent(){return Bt.Message.getFieldWithDefault(this,29,"")}set sent(e){Bt.Message.setField(this,29,e)}get host(){return Bt.Message.getFieldWithDefault(this,30,"")}set host(e){Bt.Message.setField(this,30,e)}get params(){return Bt.Message.getFieldWithDefault(this,31,"")}set params(e){Bt.Message.setField(this,31,e)}get citeData(){return Bt.Message.getWrapperField(this,t,32)}set citeData(e){Bt.Message.setWrapperField(this,32,e)}get has_citeData(){return null!=Bt.Message.getField(this,32)}get cc(){return Bt.Message.getRepeatedWrapperField(this,Vt.imio.MessageRemind,33)}set cc(e){Bt.Message.setRepeatedWrapperField(this,33,e)}get destName(){return Bt.Message.getFieldWithDefault(this,34,"")}set destName(e){Bt.Message.setField(this,34,e)}get talkMode(){return Bt.Message.getFieldWithDefault(this,35,0)}set talkMode(e){Bt.Message.setField(this,35,e)}get tag(){return Bt.Message.getFieldWithDefault(this,36,"")}set tag(e){Bt.Message.setField(this,36,e)}get deviceKey(){return Bt.Message.getFieldWithDefault(this,37,"")}set deviceKey(e){Bt.Message.setField(this,37,e)}get label(){return Bt.Message.getFieldWithDefault(this,38,"")}set label(e){Bt.Message.setField(this,38,e)}get remind(){return Bt.Message.getRepeatedWrapperField(this,Vt.imio.MessageRemind,39)}set remind(e){Bt.Message.setRepeatedWrapperField(this,39,e)}get fromAccount(){return Bt.Message.getFieldWithDefault(this,40,"")}set fromAccount(e){Bt.Message.setField(this,40,e)}get destAccount(){return Bt.Message.getFieldWithDefault(this,41,"")}set destAccount(e){Bt.Message.setField(this,41,e)}get revoke(){return Bt.Message.getFieldWithDefault(this,42,"")}set revoke(e){Bt.Message.setField(this,42,e)}static fromObject(e){const r=new t({});return null!=e.messageId&&(r.messageId=e.messageId),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.fromName&&(r.fromName=e.fromName),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.roomId&&(r.roomId=e.roomId),null!=e.fromId&&(r.fromId=e.fromId),null!=e.destId&&(r.destId=e.destId),null!=e.mimeType&&(r.mimeType=e.mimeType),null!=e.subtype&&(r.subtype=e.subtype),null!=e.title&&(r.title=e.title),null!=e.subtitle&&(r.subtitle=e.subtitle),null!=e.cite&&(r.cite=e.cite),null!=e.text&&(r.text=e.text),null!=e.filename&&(r.filename=e.filename),null!=e.secret&&(r.secret=e.secret),null!=e.thumb&&(r.thumb=e.thumb),null!=e.url&&(r.url=e.url),null!=e.lat&&(r.lat=e.lat),null!=e.lng&&(r.lng=e.lng),null!=e.command&&(r.command=e.command),null!=e.size&&(r.size=e.size),null!=e.length&&(r.length=e.length),null!=e.sent&&(r.sent=e.sent),null!=e.host&&(r.host=e.host),null!=e.params&&(r.params=e.params),null!=e.citeData&&(r.citeData=t.fromObject(e.citeData)),null!=e.cc&&(r.cc=e.cc.map(e=>Vt.imio.MessageRemind.fromObject(e))),null!=e.destName&&(r.destName=e.destName),null!=e.talkMode&&(r.talkMode=e.talkMode),null!=e.tag&&(r.tag=e.tag),null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.label&&(r.label=e.label),null!=e.remind&&(r.remind=e.remind.map(e=>Vt.imio.MessageRemind.fromObject(e))),null!=e.fromAccount&&(r.fromAccount=e.fromAccount),null!=e.destAccount&&(r.destAccount=e.destAccount),null!=e.revoke&&(r.revoke=e.revoke),r}toObject(){const e={};return null!=this.messageId&&(e.messageId=this.messageId),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.fromName&&(e.fromName=this.fromName),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.roomId&&(e.roomId=this.roomId),null!=this.fromId&&(e.fromId=this.fromId),null!=this.destId&&(e.destId=this.destId),null!=this.mimeType&&(e.mimeType=this.mimeType),null!=this.subtype&&(e.subtype=this.subtype),null!=this.title&&(e.title=this.title),null!=this.subtitle&&(e.subtitle=this.subtitle),null!=this.cite&&(e.cite=this.cite),null!=this.text&&(e.text=this.text),null!=this.filename&&(e.filename=this.filename),null!=this.secret&&(e.secret=this.secret),null!=this.thumb&&(e.thumb=this.thumb),null!=this.url&&(e.url=this.url),null!=this.lat&&(e.lat=this.lat),null!=this.lng&&(e.lng=this.lng),null!=this.command&&(e.command=this.command),null!=this.size&&(e.size=this.size),null!=this.length&&(e.length=this.length),null!=this.sent&&(e.sent=this.sent),null!=this.host&&(e.host=this.host),null!=this.params&&(e.params=this.params),null!=this.citeData&&(e.citeData=this.citeData.toObject()),null!=this.cc&&(e.cc=this.cc.map(e=>e.toObject())),null!=this.destName&&(e.destName=this.destName),null!=this.talkMode&&(e.talkMode=this.talkMode),null!=this.tag&&(e.tag=this.tag),null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.label&&(e.label=this.label),null!=this.remind&&(e.remind=this.remind.map(e=>e.toObject())),null!=this.fromAccount&&(e.fromAccount=this.fromAccount),null!=this.destAccount&&(e.destAccount=this.destAccount),null!=this.revoke&&(e.revoke=this.revoke),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.messageId.length&&t.writeString(1,this.messageId),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.fromName.length&&t.writeString(9,this.fromName),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),0!=this.roomId&&t.writeInt64(11,this.roomId),this.fromId.length&&t.writeString(12,this.fromId),this.destId.length&&t.writeString(13,this.destId),this.mimeType.length&&t.writeString(14,this.mimeType),0!=this.subtype&&t.writeInt32(15,this.subtype),this.title.length&&t.writeString(16,this.title),this.subtitle.length&&t.writeString(17,this.subtitle),this.cite.length&&t.writeString(18,this.cite),this.text.length&&t.writeString(19,this.text),this.filename.length&&t.writeString(20,this.filename),this.secret.length&&t.writeString(21,this.secret),this.thumb.length&&t.writeString(22,this.thumb),this.url.length&&t.writeString(23,this.url),this.lat.length&&t.writeString(24,this.lat),this.lng.length&&t.writeString(25,this.lng),this.command.length&&t.writeString(26,this.command),0!=this.size&&t.writeDouble(27,this.size),0!=this.length&&t.writeDouble(28,this.length),this.sent.length&&t.writeString(29,this.sent),this.host.length&&t.writeString(30,this.host),this.params.length&&t.writeString(31,this.params),this.has_citeData&&t.writeMessage(32,this.citeData,()=>this.citeData.serialize(t)),this.cc.length&&t.writeRepeatedMessage(33,this.cc,e=>e.serialize(t)),this.destName.length&&t.writeString(34,this.destName),0!=this.talkMode&&t.writeInt32(35,this.talkMode),this.tag.length&&t.writeString(36,this.tag),this.deviceKey.length&&t.writeString(37,this.deviceKey),this.label.length&&t.writeString(38,this.label),this.remind.length&&t.writeRepeatedMessage(39,this.remind,e=>e.serialize(t)),this.fromAccount.length&&t.writeString(40,this.fromAccount),this.destAccount.length&&t.writeString(41,this.destAccount),this.revoke.length&&t.writeString(42,this.revoke),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.messageId=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.fromName=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.roomId=r.readInt64();break;case 12:i.fromId=r.readString();break;case 13:i.destId=r.readString();break;case 14:i.mimeType=r.readString();break;case 15:i.subtype=r.readInt32();break;case 16:i.title=r.readString();break;case 17:i.subtitle=r.readString();break;case 18:i.cite=r.readString();break;case 19:i.text=r.readString();break;case 20:i.filename=r.readString();break;case 21:i.secret=r.readString();break;case 22:i.thumb=r.readString();break;case 23:i.url=r.readString();break;case 24:i.lat=r.readString();break;case 25:i.lng=r.readString();break;case 26:i.command=r.readString();break;case 27:i.size=r.readDouble();break;case 28:i.length=r.readDouble();break;case 29:i.sent=r.readString();break;case 30:i.host=r.readString();break;case 31:i.params=r.readString();break;case 32:r.readMessage(i.citeData,()=>i.citeData=t.deserialize(r));break;case 33:r.readMessage(i.cc,()=>Bt.Message.addToRepeatedWrapperField(i,33,Vt.imio.MessageRemind.deserialize(r),Vt.imio.MessageRemind));break;case 34:i.destName=r.readString();break;case 35:i.talkMode=r.readInt32();break;case 36:i.tag=r.readString();break;case 37:i.deviceKey=r.readString();break;case 38:i.label=r.readString();break;case 39:r.readMessage(i.remind,()=>Bt.Message.addToRepeatedWrapperField(i,39,Vt.imio.MessageRemind.deserialize(r),Vt.imio.MessageRemind));break;case 40:i.fromAccount=r.readString();break;case 41:i.destAccount=r.readString();break;case 42:i.revoke=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Message=t}(e.imio||(e.imio={}))}(qt||(qt={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8,29,30],this.#e),Array.isArray(e)||"object"!=typeof e||("messageId"in e&&null!=e.messageId&&(this.messageId=e.messageId),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"fromId"in e&&null!=e.fromId&&(this.fromId=e.fromId),"fromName"in e&&null!=e.fromName&&(this.fromName=e.fromName),"destId"in e&&null!=e.destId&&(this.destId=e.destId),"destName"in e&&null!=e.destName&&(this.destName=e.destName),"device"in e&&null!=e.device&&(this.device=e.device),"level"in e&&null!=e.level&&(this.level=e.level),"deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"message"in e&&null!=e.message&&(this.message=e.message),"sent"in e&&null!=e.sent&&(this.sent=e.sent),"succeed"in e&&null!=e.succeed&&(this.succeed=e.succeed),"read"in e&&null!=e.read&&(this.read=e.read),"revoke"in e&&null!=e.revoke&&(this.revoke=e.revoke),"readBy"in e&&null!=e.readBy&&(this.readBy=e.readBy),"deviceTag"in e&&null!=e.deviceTag&&(this.deviceTag=e.deviceTag),"signId"in e&&null!=e.signId&&(this.signId=e.signId),"tag"in e&&null!=e.tag&&(this.tag=e.tag),"fromIds"in e&&null!=e.fromIds&&(this.fromIds=e.fromIds),"destIds"in e&&null!=e.destIds&&(this.destIds=e.destIds),"end"in e&&null!=e.end&&(this.end=e.end),"label"in e&&null!=e.label&&(this.label=e.label),"destAccount"in e&&null!=e.destAccount&&(this.destAccount=e.destAccount),"fromAccount"in e&&null!=e.fromAccount&&(this.fromAccount=e.fromAccount))}get messageId(){return Bt.Message.getFieldWithDefault(this,1,"")}set messageId(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get roomId(){return Bt.Message.getFieldWithDefault(this,11,0)}set roomId(e){Bt.Message.setField(this,11,e)}get fromId(){return Bt.Message.getFieldWithDefault(this,12,"")}set fromId(e){Bt.Message.setField(this,12,e)}get fromName(){return Bt.Message.getFieldWithDefault(this,13,"")}set fromName(e){Bt.Message.setField(this,13,e)}get destId(){return Bt.Message.getFieldWithDefault(this,14,"")}set destId(e){Bt.Message.setField(this,14,e)}get destName(){return Bt.Message.getFieldWithDefault(this,15,"")}set destName(e){Bt.Message.setField(this,15,e)}get device(){return Bt.Message.getFieldWithDefault(this,16,"")}set device(e){Bt.Message.setField(this,16,e)}get level(){return Bt.Message.getFieldWithDefault(this,17,0)}set level(e){Bt.Message.setField(this,17,e)}get deviceKey(){return Bt.Message.getFieldWithDefault(this,18,"")}set deviceKey(e){Bt.Message.setField(this,18,e)}get message(){return Bt.Message.getWrapperField(this,qt.imio.Message,19)}set message(e){Bt.Message.setWrapperField(this,19,e)}get has_message(){return null!=Bt.Message.getField(this,19)}get sent(){return Bt.Message.getFieldWithDefault(this,20,"")}set sent(e){Bt.Message.setField(this,20,e)}get succeed(){return Bt.Message.getFieldWithDefault(this,21,"")}set succeed(e){Bt.Message.setField(this,21,e)}get read(){return Bt.Message.getFieldWithDefault(this,22,"")}set read(e){Bt.Message.setField(this,22,e)}get revoke(){return Bt.Message.getFieldWithDefault(this,23,"")}set revoke(e){Bt.Message.setField(this,23,e)}get readBy(){return Bt.Message.getFieldWithDefault(this,24,0)}set readBy(e){Bt.Message.setField(this,24,e)}get deviceTag(){return Bt.Message.getFieldWithDefault(this,25,"")}set deviceTag(e){Bt.Message.setField(this,25,e)}get signId(){return Bt.Message.getFieldWithDefault(this,27,"")}set signId(e){Bt.Message.setField(this,27,e)}get tag(){return Bt.Message.getFieldWithDefault(this,28,"")}set tag(e){Bt.Message.setField(this,28,e)}get fromIds(){return Bt.Message.getFieldWithDefault(this,29,[])}set fromIds(e){Bt.Message.setField(this,29,e)}get destIds(){return Bt.Message.getFieldWithDefault(this,30,[])}set destIds(e){Bt.Message.setField(this,30,e)}get end(){return Bt.Message.getFieldWithDefault(this,37,"")}set end(e){Bt.Message.setField(this,37,e)}get label(){return Bt.Message.getFieldWithDefault(this,38,"")}set label(e){Bt.Message.setField(this,38,e)}get destAccount(){return Bt.Message.getFieldWithDefault(this,39,"")}set destAccount(e){Bt.Message.setField(this,39,e)}get fromAccount(){return Bt.Message.getFieldWithDefault(this,40,"")}set fromAccount(e){Bt.Message.setField(this,40,e)}static fromObject(e){const r=new t({});return null!=e.messageId&&(r.messageId=e.messageId),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.roomId&&(r.roomId=e.roomId),null!=e.fromId&&(r.fromId=e.fromId),null!=e.fromName&&(r.fromName=e.fromName),null!=e.destId&&(r.destId=e.destId),null!=e.destName&&(r.destName=e.destName),null!=e.device&&(r.device=e.device),null!=e.level&&(r.level=e.level),null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.message&&(r.message=qt.imio.Message.fromObject(e.message)),null!=e.sent&&(r.sent=e.sent),null!=e.succeed&&(r.succeed=e.succeed),null!=e.read&&(r.read=e.read),null!=e.revoke&&(r.revoke=e.revoke),null!=e.readBy&&(r.readBy=e.readBy),null!=e.deviceTag&&(r.deviceTag=e.deviceTag),null!=e.signId&&(r.signId=e.signId),null!=e.tag&&(r.tag=e.tag),null!=e.fromIds&&(r.fromIds=e.fromIds),null!=e.destIds&&(r.destIds=e.destIds),null!=e.end&&(r.end=e.end),null!=e.label&&(r.label=e.label),null!=e.destAccount&&(r.destAccount=e.destAccount),null!=e.fromAccount&&(r.fromAccount=e.fromAccount),r}toObject(){const e={};return null!=this.messageId&&(e.messageId=this.messageId),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.roomId&&(e.roomId=this.roomId),null!=this.fromId&&(e.fromId=this.fromId),null!=this.fromName&&(e.fromName=this.fromName),null!=this.destId&&(e.destId=this.destId),null!=this.destName&&(e.destName=this.destName),null!=this.device&&(e.device=this.device),null!=this.level&&(e.level=this.level),null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.message&&(e.message=this.message.toObject()),null!=this.sent&&(e.sent=this.sent),null!=this.succeed&&(e.succeed=this.succeed),null!=this.read&&(e.read=this.read),null!=this.revoke&&(e.revoke=this.revoke),null!=this.readBy&&(e.readBy=this.readBy),null!=this.deviceTag&&(e.deviceTag=this.deviceTag),null!=this.signId&&(e.signId=this.signId),null!=this.tag&&(e.tag=this.tag),null!=this.fromIds&&(e.fromIds=this.fromIds),null!=this.destIds&&(e.destIds=this.destIds),null!=this.end&&(e.end=this.end),null!=this.label&&(e.label=this.label),null!=this.destAccount&&(e.destAccount=this.destAccount),null!=this.fromAccount&&(e.fromAccount=this.fromAccount),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.messageId.length&&t.writeString(1,this.messageId),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),0!=this.roomId&&t.writeInt64(11,this.roomId),this.fromId.length&&t.writeString(12,this.fromId),this.fromName.length&&t.writeString(13,this.fromName),this.destId.length&&t.writeString(14,this.destId),this.destName.length&&t.writeString(15,this.destName),this.device.length&&t.writeString(16,this.device),0!=this.level&&t.writeInt32(17,this.level),this.deviceKey.length&&t.writeString(18,this.deviceKey),this.has_message&&t.writeMessage(19,this.message,()=>this.message.serialize(t)),this.sent.length&&t.writeString(20,this.sent),this.succeed.length&&t.writeString(21,this.succeed),this.read.length&&t.writeString(22,this.read),this.revoke.length&&t.writeString(23,this.revoke),0!=this.readBy&&t.writeInt32(24,this.readBy),this.deviceTag.length&&t.writeString(25,this.deviceTag),this.signId.length&&t.writeString(27,this.signId),this.tag.length&&t.writeString(28,this.tag),this.fromIds.length&&t.writeRepeatedString(29,this.fromIds),this.destIds.length&&t.writeRepeatedString(30,this.destIds),this.end.length&&t.writeString(37,this.end),this.label.length&&t.writeString(38,this.label),this.destAccount.length&&t.writeString(39,this.destAccount),this.fromAccount.length&&t.writeString(40,this.fromAccount),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.messageId=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.roomId=r.readInt64();break;case 12:i.fromId=r.readString();break;case 13:i.fromName=r.readString();break;case 14:i.destId=r.readString();break;case 15:i.destName=r.readString();break;case 16:i.device=r.readString();break;case 17:i.level=r.readInt32();break;case 18:i.deviceKey=r.readString();break;case 19:r.readMessage(i.message,()=>i.message=qt.imio.Message.deserialize(r));break;case 20:i.sent=r.readString();break;case 21:i.succeed=r.readString();break;case 22:i.read=r.readString();break;case 23:i.revoke=r.readString();break;case 24:i.readBy=r.readInt32();break;case 25:i.deviceTag=r.readString();break;case 27:i.signId=r.readString();break;case 28:i.tag=r.readString();break;case 29:Bt.Message.addToRepeatedField(i,29,r.readString());break;case 30:Bt.Message.addToRepeatedField(i,30,r.readString());break;case 37:i.end=r.readString();break;case 38:i.label=r.readString();break;case 39:i.destAccount=r.readString();break;case 40:i.fromAccount=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.MessageSign=t}(e.imio||(e.imio={}))}(Kt||(Kt={}));var Zt=r(287).hp,Qt=Ut.imio.Contacts,$t=jt.imio.Rooms,er=qt.imio.Message,tr=Kt.imio.MessageSign,rr=Vt.imio.MessageRemind;class ir extends Gt{static instance;imioClient=null;constructor(){super()}static getInstance(){return ir.instance||(ir.instance=new ir),ir.instance}setClient(e){return this.imioClient=e,this}dialogue(e,t,r){return new Promise(async(i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));let s=this.buildMessageProto(t,r);s.appId=e;let o=null;this.imioClient.socket?.requestResponse({data:Zt.from(s.serializeBinary().buffer),metadata:this.buildRoute("dialogue")},{onComplete:()=>{i(o)},onNext:(e,t)=>{try{if(e.data){let r=er.deserialize(e.data),n=this.buildMessage(r);o=n,t&&i(o)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}oneToOne(e){return new Promise(async(t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));let i=Jt.getInstance(),n=await i.getContactByJoinId(e.joinId);if(!n)return void r(new Error("联系人不存在"));if(n.isGroup)return void r(new Error("联系人是群组"));let s=this.buildMessageProto(n.userId,e),o=null;this.imioClient.socket?.requestResponse({data:Zt.from(s.serializeBinary().buffer),metadata:this.buildRoute("oneToOne")},{onComplete:()=>{t(o)},onNext:(e,i)=>{try{if(e.data){let r=er.deserialize(e.data),n=this.buildMessage(r);o=n,i&&t(o)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}oneToMany(e){return new Promise(async(t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));let i=Jt.getInstance(),n=await i.getContactByJoinId(e.joinId);if(!n)return void r(new Error("联系人不存在"));if(!n.isGroup)return void r(new Error("联系人不是群组"));let s=this.buildMessageProto("",e),o=null;this.imioClient.socket?.requestResponse({data:Zt.from(s.serializeBinary().buffer),metadata:this.buildRoute("oneToMany")},{onComplete:()=>{t(o)},onNext:(e,i)=>{try{if(e.data){let r=er.deserialize(e.data),n=this.buildMessage(r);o=n,i&&t(o)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}signMessage(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=new tr({meta:this.imioClient.meta,messageId:e,roomId:t,destId:this.imioClient.meta.userId,deviceTag:"h5",deviceKey:this.imioClient?.getDeviceKey()});this.imioClient.socket?.requestResponse({data:Zt.from(n.serializeBinary().buffer),metadata:this.buildRoute("message.sign")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}readMessage(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=new tr({meta:this.imioClient.meta,messageId:e,roomId:t,destId:this.imioClient.meta.userId});this.imioClient.socket?.requestResponse({data:Zt.from(n.serializeBinary().buffer),metadata:this.buildRoute("message.read")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}deleteMessage(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=new tr({meta:this.imioClient.meta,messageId:e,roomId:t});this.imioClient.socket?.requestResponse({data:Zt.from(n.serializeBinary().buffer),metadata:this.buildRoute("message.revoke")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}getMessageList(e,t=1,r=40){return new Promise(async(i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));let s=Jt.getInstance(),o=await s.getContactByJoinId(e);if(!o)return void n(new Error("联系人不存在"));console.warn(o),this.imioClient.meta.page=t,this.imioClient.meta.pageSize=r;const a=new er({meta:this.imioClient.meta,roomId:o.joinId});let l=[];this.imioClient.socket?.requestStream({data:Zt.from(a.serializeBinary().buffer),metadata:this.buildRoute("message.page")},500,{onComplete:()=>{i(l)},onNext:(e,t)=>{try{if(e.data){let t=er.deserialize(e.data),r=this.buildMessage(t);l.push(r)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}createDialogue(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new Qt({meta:this.imioClient.meta,userId:e,joinRoomId:t});let s=null;this.imioClient.socket?.requestResponse({data:Zt.from(n.serializeBinary().buffer),metadata:this.buildRoute("dialogue.create")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=$t.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}senderBuildMessage(e){let t=new h;if(t.messageId=e.messageId,t.joinId=e.joinId,t.cite=e.cite,t.type=e.type,t.title=e.title,t.subtitle=e.subtitle,t.text=e.text,t.secret=e.secret,t.thumb=e.thumb,t.host=e.host,t.url=e.url,t.lng=e.lng,t.lat=e.lat,t.size=e.size,t.length=e.length,e.hintList&&e.hintList.length){t.hintList=[];for(let r of e.hintList){let e=new h;e.destId=r.targetId,e.destName=r.targetName,t.hintList.push(e)}}if(e.notifyList&&e.notifyList.length){t.notifyList=[];for(let r of e.notifyList){let e=new h;e.destId=r.targetId,e.destName=r.targetName,t.notifyList.push(e)}}if(e.quietlyList&&e.quietlyList.length){t.quietlyList=[];for(let r of e.quietlyList){let e=new h;e.destId=r.targetId,e.destName=r.targetName,t.quietlyList.push(e)}}return t}buildMessageProto(e,t){let r=[],i=[];if(t.notifyList&&t.notifyList.length)for(let e of t.notifyList){let t=new rr({sort:1,destId:e.targetId,nickname:e.targetName});r.push(t)}if(t.quietlyList&&t.quietlyList.length)for(let e of t.quietlyList){let t=new rr({sort:2,destId:e.targetId,nickname:e.targetName});r.push(t)}if(t.hintList&&t.hintList.length)for(let e of t.hintList){let t=new rr({sort:0,destId:e.targetId,nickname:e.targetName});i.push(t)}return new er({meta:this.imioClient?.meta,messageId:t.messageId,roomId:t.joinId,fromId:this.imioClient?.meta?.userId,fromName:this.imioClient?.meta?.nickname,destId:e,subtype:this.messageType(t.type),title:t.title,subtitle:t.subtitle,text:t.text,secret:t.secret,thumb:t.thumb,host:t.host,url:t.url,lng:t.lng,lat:t.lat,size:t.size,length:t.length,cc:r,remind:i})}messageType(e){switch(e){case"txt":return 1;case"img":return 2;case"audio":return 3;case"video":return 4;case"file":return 5;case"loc":return 6;case"wallet":return 9;case"custom":return 7}return 1}onError(e){if(e.indexOf("Jwt")>-1){try{this.imioClient.clientListener?.onTokenExpired()}catch(e){}return"IMIO Token 已过期"}return e.indexOf("SQL")>-1||e.indexOf("connect")>-1?"IMIO System Error":e.indexOf("terminal")>-1||e.indexOf("signal")>-1?"请求超时":""}checkSocket(){return this.imioClient?this.imioClient.socket?0==this.imioClient.getTokenAppId()||this.imioClient.getTokenAppId()!=this.imioClient.meta.appId?"token中的AppId 与 IMIOClientOption不一致":"":"IMIO Client 尚未建立连接":"IMIO Client 不存在"}}var nr=function(){return nr=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},nr.apply(this,arguments)};function sr(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((i=i.apply(e,t||[])).next())})}function or(e,t){var r,i,n,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function ar(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var lr="3.4.2";function ur(e,t){return new Promise(function(r){return setTimeout(r,e,t)})}function dr(e){return!!e&&"function"==typeof e.then}function hr(e,t){try{var r=e();dr(r)?r.then(function(e){return t(!0,e)},function(e){return t(!1,e)}):t(!0,r)}catch(e){t(!1,e)}}function cr(e,t,r){return void 0===r&&(r=16),sr(this,void 0,void 0,function(){var i,n,s,o;return or(this,function(a){switch(a.label){case 0:i=Array(e.length),n=Date.now(),s=0,a.label=1;case 1:return s<e.length?(i[s]=t(e[s],s),(o=Date.now())>=n+r?(n=o,[4,ur(0)]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++s,[3,1];case 4:return[2,i]}})})}function pr(e){e.then(void 0,function(){})}function fr(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]+t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function mr(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]*t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function gr(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function yr(e,t){return 0==(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function vr(e,t){return[e[0]^t[0],e[1]^t[1]]}function br(e){return e=vr(e,[0,e[0]>>>1]),e=vr(e=mr(e,[4283543511,3981806797]),[0,e[0]>>>1]),vr(e=mr(e,[3301882366,444984403]),[0,e[0]>>>1])}function Ir(e){return parseInt(e)}function Er(e){return parseFloat(e)}function wr(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Sr(e){return e.reduce(function(e,t){return e+(t?1:0)},0)}function Mr(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var r=1/t;return Math.round(e*r)/r}function kr(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function Fr(e,t,r){var i=Object.keys(e).filter(function(e){return!function(e,t){for(var r=0,i=e.length;r<i;++r)if(e[r]===t)return!0;return!1}(r,e)}),n=cr(i,function(r){return function(e,t){var r=new Promise(function(r){var i=Date.now();hr(e.bind(null,t),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Date.now()-i;if(!e[0])return r(function(){return{error:kr(e[1]),duration:n}});var s=e[1];if(function(e){return"function"!=typeof e}(s))return r(function(){return{value:s,duration:n}});r(function(){return new Promise(function(e){var t=Date.now();hr(s,function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=n+Date.now()-t;if(!r[0])return e({error:kr(r[1]),duration:s});e({value:r[1],duration:s})})})})})});return pr(r),function(){return r.then(function(e){return e()})}}(e[r],t)});return pr(n),function(){return sr(this,void 0,void 0,function(){var e,t,r,s;return or(this,function(o){switch(o.label){case 0:return[4,n];case 1:return[4,cr(o.sent(),function(e){var t=e();return pr(t),t})];case 2:return e=o.sent(),[4,Promise.all(e)];case 3:for(t=o.sent(),r={},s=0;s<i.length;++s)r[i[s]]=t[s];return[2,r]}})})}}function Tr(){var e=window,t=navigator;return Sr(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Rr(){var e=window,t=navigator;return Sr(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Ar(){var e=window,t=navigator;return Sr(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function Cr(){var e=window;return Sr(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function Or(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Nr(){var e=Rr(),t=function(){var e,t,r=window;return Sr(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}();if(!e&&!t)return!1;var r=window;return Sr(["onorientationchange"in r,"orientation"in r,e&&!("SharedWorker"in r),t&&/android/i.test(navigator.appVersion)])>=2}function xr(e){var t=new Error(e);return t.name=e,t}function _r(e,t,r){var i,n,s;return void 0===r&&(r=50),sr(this,void 0,void 0,function(){var o,a;return or(this,function(l){switch(l.label){case 0:o=document,l.label=1;case 1:return o.body?[3,3]:[4,ur(r)];case 2:return l.sent(),[3,1];case 3:a=o.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise(function(e,r){var i=!1,n=function(){i=!0,e()};a.onload=n,a.onerror=function(e){i=!0,r(e)};var s=a.style;s.setProperty("display","block","important"),s.position="absolute",s.top="0",s.left="0",s.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",o.body.appendChild(a);var l=function(){var e,t;i||("complete"===(null===(t=null===(e=a.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?n():setTimeout(l,10))};l()})];case 5:l.sent(),l.label=6;case 6:return(null===(n=null===(i=a.contentWindow)||void 0===i?void 0:i.document)||void 0===n?void 0:n.body)?[3,8]:[4,ur(r)];case 7:return l.sent(),[3,6];case 8:return[4,e(a,a.contentWindow)];case 9:return[2,l.sent()];case 10:return null===(s=a.parentNode)||void 0===s||s.removeChild(a),[7];case 11:return[2]}})})}function Dr(e){for(var t=function(e){for(var t,r,i="Unexpected syntax '".concat(e,"'"),n=/^\s*([a-z-]*)(.*)$/i.exec(e),s=n[1]||void 0,o={},a=/([.:#][\w-]+|\[.+?\])/gi,l=function(e,t){o[e]=o[e]||[],o[e].push(t)};;){var u=a.exec(n[2]);if(!u)break;var d=u[0];switch(d[0]){case".":l("class",d.slice(1));break;case"#":l("id",d.slice(1));break;case"[":var h=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(d);if(!h)throw new Error(i);l(h[1],null!==(r=null!==(t=h[4])&&void 0!==t?t:h[5])&&void 0!==r?r:"");break;default:throw new Error(i)}}return[s,o]}(e),r=t[0],i=t[1],n=document.createElement(null!=r?r:"div"),s=0,o=Object.keys(i);s<o.length;s++){var a=o[s],l=i[a].join(" ");"style"===a?Lr(n.style,l):n.setAttribute(a,l)}return n}function Lr(e,t){for(var r=0,i=t.split(";");r<i.length;r++){var n=i[r],s=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(s){var o=s[1],a=s[2],l=s[4];e.setProperty(o,a,l||"")}}}var Pr,Ur,jr=["monospace","sans-serif","serif"],Br=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Wr(e){return e.toDataURL()}function zr(){var e=screen;return[wr(Er(e.availTop),null),wr(Er(e.width)-Er(e.availWidth)-wr(Er(e.availLeft),0),null),wr(Er(e.height)-Er(e.availHeight)-wr(Er(e.availTop),0),null),wr(Er(e.availLeft),null)]}function Gr(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Vr(e){var t;return sr(this,void 0,void 0,function(){var r,i,n,s,o,a,l;return or(this,function(u){switch(u.label){case 0:for(r=document,i=r.createElement("div"),n=new Array(e.length),s={},qr(i),l=0;l<e.length;++l)"DIALOG"===(o=Dr(e[l])).tagName&&o.show(),qr(a=r.createElement("div")),a.appendChild(o),i.appendChild(a),n[l]=o;u.label=1;case 1:return r.body?[3,3]:[4,ur(50)];case 2:return u.sent(),[3,1];case 3:r.body.appendChild(i);try{for(l=0;l<e.length;++l)n[l].offsetParent||(s[e[l]]=!0)}finally{null===(t=i.parentNode)||void 0===t||t.removeChild(i)}return[2,s]}})})}function qr(e){e.style.setProperty("display","block","important")}function Kr(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function Hr(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}function Yr(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function Xr(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function Jr(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var Zr=Math,Qr=function(){return 0},$r={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]},ei={fonts:function(){return _r(function(e,t){var r=t.document,i=r.body;i.style.fontSize="48px";var n=r.createElement("div"),s={},o={},a=function(e){var t=r.createElement("span"),i=t.style;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,t.textContent="mmMwWLliI0O&1",n.appendChild(t),t},l=jr.map(a),u=function(){for(var e={},t=function(t){e[t]=jr.map(function(e){return function(e,t){return a("'".concat(e,"',").concat(t))}(t,e)})},r=0,i=Br;r<i.length;r++)t(i[r]);return e}();i.appendChild(n);for(var d=0;d<jr.length;d++)s[jr[d]]=l[d].offsetWidth,o[jr[d]]=l[d].offsetHeight;return Br.filter(function(e){return t=u[e],jr.some(function(e,r){return t[r].offsetWidth!==s[e]||t[r].offsetHeight!==o[e]});var t})})},domBlockers:function(e){var t=(void 0===e?{}:e).debug;return sr(this,void 0,void 0,function(){var e,r,i,n,s;return or(this,function(o){switch(o.label){case 0:return Ar()||Nr()?(a=atob,e={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',a("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",a("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",a("LnNwb25zb3JpdA=="),".ylamainos",a("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",a("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",a("LmhlYWRlci1ibG9ja2VkLWFk"),a("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",a("I2FkXzMwMFgyNTA="),a("I2Jhbm5lcmZsb2F0MjI="),a("I2NhbXBhaWduLWJhbm5lcg=="),a("I0FkLUNvbnRlbnQ=")],adGuardChinese:[a("LlppX2FkX2FfSA=="),a("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",a("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),a("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",a("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",a("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",a("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),a("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),a("LmFkZ29vZ2xl"),a("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[a("YW1wLWF1dG8tYWRz"),a("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",a("I2FkX2ludmlld19hcmVh")],adGuardRussian:[a("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),a("LnJlY2xhbWE="),'div[id^="smi2adblock"]',a("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[a("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),a("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",a("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),a("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),a("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",a("I3Jla2xhbWk="),a("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),a("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),a("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[a("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",a("LndpZGdldF9wb19hZHNfd2lkZ2V0"),a("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",a("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[a("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),a("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",a("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",a("I3Jla2xhbW5pLWJveA=="),a("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",a("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[a("I2FkdmVydGVudGll"),a("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",a("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",a("LnNwb25zb3JsaW5rZ3J1ZW4="),a("I3dlcmJ1bmdza3k="),a("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),a("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[a("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",a("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[a("LnJla2xhbW9zX3RhcnBhcw=="),a("LnJla2xhbW9zX251b3JvZG9z"),a("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),a("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),a("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[a("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[a("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),a("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",a("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[a("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),a("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),a("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",a("LmFkX19tYWlu"),a("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[a("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[a("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),a("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[a("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),a("I2xpdmVyZUFkV3JhcHBlcg=="),a("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),a("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[a("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",a("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),a("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),a("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[a("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),a("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),a("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",a("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),a("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),a("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),a("ZGl2I3NrYXBpZWNfYWQ=")],ro:[a("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),a("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),a("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[a("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),a("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),a("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",a("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),a("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",a("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]},r=Object.keys(e),[4,Vr((s=[]).concat.apply(s,r.map(function(t){return e[t]})))]):[2,void 0];case 1:return i=o.sent(),t&&function(e,t){for(var r="DOM blockers debug:\n```",i=0,n=Object.keys(e);i<n.length;i++){var s=n[i];r+="\n".concat(s,":");for(var o=0,a=e[s];o<a.length;o++){var l=a[o];r+="\n ".concat(t[l]?"🚫":"➡️"," ").concat(l)}}console.log("".concat(r,"\n```"))}(e,i),(n=r.filter(function(t){var r=e[t];return Sr(r.map(function(e){return i[e]}))>.6*r.length})).sort(),[2,n]}var a})})},fontPreferences:function(){return void 0===e&&(e=4e3),_r(function(t,r){var i=r.document,n=i.body,s=n.style;s.width="".concat(e,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",Rr()?n.style.zoom="".concat(1/r.devicePixelRatio):Ar()&&(n.style.zoom="reset");var o=i.createElement("div");return o.textContent=ar([],Array(e/20|0),!0).map(function(){return"word"}).join(" "),n.appendChild(o),function(e,t){for(var r={},i={},n=0,s=Object.keys($r);n<s.length;n++){var o=s[n],a=$r[o],l=a[0],u=void 0===l?{}:l,d=a[1],h=void 0===d?"mmMwWLliI0fiflO&1":d,c=e.createElement("span");c.textContent=h,c.style.whiteSpace="nowrap";for(var p=0,f=Object.keys(u);p<f.length;p++){var m=f[p],g=u[m];void 0!==g&&(c.style[m]=g)}r[o]=c,t.appendChild(e.createElement("br")),t.appendChild(c)}for(var y=0,v=Object.keys($r);y<v.length;y++)i[o=v[y]]=r[o].getBoundingClientRect().width;return i}(i,n)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">');var e},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Ar()&&!Cr()&&!function(){var e=window;return Sr(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var r=new t(1,5e3,44100),i=r.createOscillator();i.type="triangle",i.frequency.value=1e4;var n=r.createDynamicsCompressor();n.threshold.value=-50,n.knee.value=40,n.ratio.value=12,n.attack.value=0,n.release.value=.25,i.connect(n),n.connect(r.destination),i.start(0);var s=function(e){var t=function(){};return[new Promise(function(r,i){var n=!1,s=0,o=0;e.oncomplete=function(e){return r(e.renderedBuffer)};var a=function(){setTimeout(function(){return i(xr("timeout"))},Math.min(500,o+5e3-Date.now()))},l=function(){try{var t=e.startRendering();switch(dr(t)&&pr(t),e.state){case"running":o=Date.now(),n&&a();break;case"suspended":document.hidden||s++,n&&s>=3?i(xr("suspended")):setTimeout(l,500)}}catch(e){i(e)}};l(),t=function(){n||(n=!0,o>0&&a())}}),t]}(r),o=s[0],a=s[1],l=o.then(function(e){return function(e){for(var t=0,r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}(e.getChannelData(0).subarray(4500))},function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e});return pr(l),function(){return a(),l}},screenFrame:function(){var e=this,t=function(){var e=this;return function(){if(void 0===Ur){var e=function(){var t=zr();Gr(t)?Ur=setTimeout(e,2500):(Pr=t,Ur=void 0)};e()}}(),function(){return sr(e,void 0,void 0,function(){var e;return or(this,function(t){switch(t.label){case 0:return Gr(e=zr())?Pr?[2,ar([],Pr,!0)]:(r=document).fullscreenElement||r.msFullscreenElement||r.mozFullScreenElement||r.webkitFullscreenElement?[4,Or()]:[3,2]:[3,2];case 1:t.sent(),e=zr(),t.label=2;case 2:return Gr(e)||(Pr=e),[2,e]}var r})})}}();return function(){return sr(e,void 0,void 0,function(){var e,r;return or(this,function(i){switch(i.label){case 0:return[4,t()];case 1:return e=i.sent(),[2,[(r=function(e){return null===e?null:Mr(e,10)})(e[0]),r(e[1]),r(e[2]),r(e[3])]]}})})}},osCpu:function(){return navigator.oscpu},languages:function(){var e,t=navigator,r=[],i=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(void 0!==i&&r.push([i]),Array.isArray(t.languages))Rr()&&Sr([!("MediaSettingsRange"in(e=window)),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3||r.push(t.languages);else if("string"==typeof t.languages){var n=t.languages;n&&r.push(n.split(","))}return r},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return wr(Er(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return wr(Ir(e),null)},r=[t(e.width),t(e.height)];return r.sort().reverse(),r},hardwareConcurrency:function(){return wr(Ir(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var r=(new t).resolvedOptions().timeZone;if(r)return r}var i,n=(i=(new Date).getFullYear(),-Math.max(Er(new Date(i,0,1).getTimezoneOffset()),Er(new Date(i,6,1).getTimezoneOffset())));return"UTC".concat(n>=0?"+":"").concat(Math.abs(n))},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){var e,t;if(!(Tr()||(e=window,t=navigator,Sr(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Tr())))try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&Ar()&&!Cr()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return Sr(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],r=0;r<e.length;++r){var i=e[r];if(i){for(var n=[],s=0;s<i.length;++s){var o=i[s];n.push({type:o.type,suffixes:o.suffixes})}t.push({name:i.name,description:i.description,mimeTypes:n})}}return t}},canvas:function(){var e,t,r=!1,i=function(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}(),n=i[0],s=i[1];if(function(e,t){return!(!t||!e.toDataURL)}(n,s)){r=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(s),function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var r="Cwm fjordbank gly ".concat(String.fromCharCode(55357,56835));t.fillText(r,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(r,4,45)}(n,s);var o=Wr(n);o!==Wr(n)?e=t="unstable":(t=o,function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var r=0,i=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];r<i.length;r++){var n=i[r],s=n[0],o=n[1],a=n[2];t.fillStyle=s,t.beginPath(),t.arc(o,a,40,0,2*Math.PI,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(n,s),e=Wr(n))}else e=t="";return{winding:r,geometry:e,text:t}},touchSupport:function(){var e,t=navigator,r=0;void 0!==t.maxTouchPoints?r=Ir(t.maxTouchPoints):void 0!==t.msMaxTouchPoints&&(r=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){e=!1}return{maxTouchPoints:r,touchEvent:e,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var e=[],t=0,r=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<r.length;t++){var i=r[t],n=window[i];n&&"object"==typeof n&&e.push(i)}return e.sort()},cookiesEnabled:function(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(e){return!1}},colorGamut:function(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var r=t[e];if(matchMedia("(color-gamut: ".concat(r,")")).matches)return r}},invertedColors:function(){return!!Kr("inverted")||!Kr("none")&&void 0},forcedColors:function(){return!!Hr("active")||!Hr("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=100;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}},contrast:function(){return Yr("no-preference")?0:Yr("high")||Yr("more")?1:Yr("low")||Yr("less")?-1:Yr("forced")?10:void 0},reducedMotion:function(){return!!Xr("reduce")||!Xr("no-preference")&&void 0},hdr:function(){return!!Jr("high")||!Jr("standard")&&void 0},math:function(){var e,t=Zr.acos||Qr,r=Zr.acosh||Qr,i=Zr.asin||Qr,n=Zr.asinh||Qr,s=Zr.atanh||Qr,o=Zr.atan||Qr,a=Zr.sin||Qr,l=Zr.sinh||Qr,u=Zr.cos||Qr,d=Zr.cosh||Qr,h=Zr.tan||Qr,c=Zr.tanh||Qr,p=Zr.exp||Qr,f=Zr.expm1||Qr,m=Zr.log1p||Qr;return{acos:t(.12312423423423424),acosh:r(1e308),acoshPf:(e=1e154,Zr.log(e+Zr.sqrt(e*e-1))),asin:i(.12312423423423424),asinh:n(1),asinhPf:Zr.log(1+Zr.sqrt(2)),atanh:s(.5),atanhPf:Zr.log(3)/2,atan:o(.5),sin:a(-1e300),sinh:l(1),sinhPf:Zr.exp(1)-1/Zr.exp(1)/2,cos:u(10.000000000123),cosh:d(1),coshPf:(Zr.exp(1)+1/Zr.exp(1))/2,tan:h(-1e300),tanh:c(1),tanhPf:(Zr.exp(2)-1)/(Zr.exp(2)+1),exp:p(1),expm1:f(1),expm1Pf:Zr.exp(1)-1,log1p:m(10),log1pPf:Zr.log(11),powPI:Zr.pow(Zr.PI,-100)}},videoCard:function(){var e,t=document.createElement("canvas"),r=null!==(e=t.getContext("webgl"))&&void 0!==e?e:t.getContext("experimental-webgl");if(r&&"getExtension"in r){var i=r.getExtension("WEBGL_debug_renderer_info");if(i)return{vendor:(r.getParameter(i.UNMASKED_VENDOR_WEBGL)||"").toString(),renderer:(r.getParameter(i.UNMASKED_RENDERER_WEBGL)||"").toString()}}},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}};function ti(e){return JSON.stringify(e,function(e,t){return t instanceof Error?nr({name:(r=t).name,message:r.message,stack:null===(i=r.stack)||void 0===i?void 0:i.split("\n")},r):t;var r,i},2)}function ri(e){return function(e,t){t=t||0;var r,i=(e=e||"").length%16,n=e.length-i,s=[0,t],o=[0,t],a=[0,0],l=[0,0],u=[2277735313,289559509],d=[1291169091,658871167];for(r=0;r<n;r+=16)a=[255&e.charCodeAt(r+4)|(255&e.charCodeAt(r+5))<<8|(255&e.charCodeAt(r+6))<<16|(255&e.charCodeAt(r+7))<<24,255&e.charCodeAt(r)|(255&e.charCodeAt(r+1))<<8|(255&e.charCodeAt(r+2))<<16|(255&e.charCodeAt(r+3))<<24],l=[255&e.charCodeAt(r+12)|(255&e.charCodeAt(r+13))<<8|(255&e.charCodeAt(r+14))<<16|(255&e.charCodeAt(r+15))<<24,255&e.charCodeAt(r+8)|(255&e.charCodeAt(r+9))<<8|(255&e.charCodeAt(r+10))<<16|(255&e.charCodeAt(r+11))<<24],a=gr(a=mr(a,u),31),s=fr(s=gr(s=vr(s,a=mr(a,d)),27),o),s=fr(mr(s,[0,5]),[0,1390208809]),l=gr(l=mr(l,d),33),o=fr(o=gr(o=vr(o,l=mr(l,u)),31),s),o=fr(mr(o,[0,5]),[0,944331445]);switch(a=[0,0],l=[0,0],i){case 15:l=vr(l,yr([0,e.charCodeAt(r+14)],48));case 14:l=vr(l,yr([0,e.charCodeAt(r+13)],40));case 13:l=vr(l,yr([0,e.charCodeAt(r+12)],32));case 12:l=vr(l,yr([0,e.charCodeAt(r+11)],24));case 11:l=vr(l,yr([0,e.charCodeAt(r+10)],16));case 10:l=vr(l,yr([0,e.charCodeAt(r+9)],8));case 9:l=mr(l=vr(l,[0,e.charCodeAt(r+8)]),d),o=vr(o,l=mr(l=gr(l,33),u));case 8:a=vr(a,yr([0,e.charCodeAt(r+7)],56));case 7:a=vr(a,yr([0,e.charCodeAt(r+6)],48));case 6:a=vr(a,yr([0,e.charCodeAt(r+5)],40));case 5:a=vr(a,yr([0,e.charCodeAt(r+4)],32));case 4:a=vr(a,yr([0,e.charCodeAt(r+3)],24));case 3:a=vr(a,yr([0,e.charCodeAt(r+2)],16));case 2:a=vr(a,yr([0,e.charCodeAt(r+1)],8));case 1:a=mr(a=vr(a,[0,e.charCodeAt(r)]),u),s=vr(s,a=mr(a=gr(a,31),d))}return s=fr(s=vr(s,[0,e.length]),o=vr(o,[0,e.length])),o=fr(o,s),s=fr(s=br(s),o=br(o)),o=fr(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}(function(e){for(var t="",r=0,i=Object.keys(e).sort();r<i.length;r++){var n=i[r],s=e[n],o=s.error?"error":JSON.stringify(s.value);t+="".concat(t?"|":"").concat(n.replace(/([:|\\])/g,"\\$1"),":").concat(o)}return t}(e))}function ii(e){return void 0===e&&(e=50),function(e,t){void 0===t&&(t=1/0);var r=window.requestIdleCallback;return r?new Promise(function(e){return r.call(window,function(){return e()},{timeout:t})}):ur(Math.min(e,t))}(e,2*e)}function ni(e,t){var r=Date.now();return{get:function(i){return sr(this,void 0,void 0,function(){var n,s,o;return or(this,function(a){switch(a.label){case 0:return n=Date.now(),[4,e()];case 1:return s=a.sent(),o=function(e){var t,r=function(e){var t=function(e){if(Nr())return.4;if(Ar())return Cr()?.5:.3;var t=e.platform.value||"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}(e),r=function(e){return Mr(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,"".concat(r))}}(e);return{get visitorId(){return void 0===t&&(t=ri(this.components)),t},set visitorId(e){t=e},confidence:r,components:e,version:lr}}(s),(t||(null==i?void 0:i.debug))&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(o.version,"\nuserAgent: ").concat(navigator.userAgent,"\ntimeBetweenLoadAndGet: ").concat(n-r,"\nvisitorId: ").concat(o.visitorId,"\ncomponents: ").concat(ti(s),"\n```")),[2,o]}})})}}}var si,oi,ai={load:function(e){var t=void 0===e?{}:e,r=t.delayFallback,i=t.debug,n=t.monitoring,s=void 0===n||n;return sr(this,void 0,void 0,function(){return or(this,function(e){switch(e.label){case 0:return s&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(lr,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),[4,ii(r)];case 1:return e.sent(),[2,ni(Fr(ei,{debug:i},[]),i)]}})})},hashComponents:ri,componentsToDebugString:ti};!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[11],this.#e),Array.isArray(e)||"object"!=typeof e||("userId"in e&&null!=e.userId&&(this.userId=e.userId),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"account"in e&&null!=e.account&&(this.account=e.account),"prefix"in e&&null!=e.prefix&&(this.prefix=e.prefix),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"host"in e&&null!=e.host&&(this.host=e.host),"max"in e&&null!=e.max&&(this.max=e.max),"deviceModel"in e&&null!=e.deviceModel&&(this.deviceModel=e.deviceModel),"hosts"in e&&null!=e.hosts&&(this.hosts=e.hosts),"region"in e&&null!=e.region&&(this.region=e.region),"phone"in e&&null!=e.phone&&(this.phone=e.phone),"email"in e&&null!=e.email&&(this.email=e.email),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar),"getaway"in e&&null!=e.getaway&&(this.getaway=e.getaway),"deviceName"in e&&null!=e.deviceName&&(this.deviceName=e.deviceName),"ip"in e&&null!=e.ip&&(this.ip=e.ip),"country"in e&&null!=e.country&&(this.country=e.country),"city"in e&&null!=e.city&&(this.city=e.city))}get userId(){return Bt.Message.getFieldWithDefault(this,1,"")}set userId(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get deviceKey(){return Bt.Message.getFieldWithDefault(this,3,"")}set deviceKey(e){Bt.Message.setField(this,3,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,4,0)}set roomId(e){Bt.Message.setField(this,4,e)}get account(){return Bt.Message.getFieldWithDefault(this,5,"")}set account(e){Bt.Message.setField(this,5,e)}get prefix(){return Bt.Message.getFieldWithDefault(this,6,"")}set prefix(e){Bt.Message.setField(this,6,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,7,"")}set nickname(e){Bt.Message.setField(this,7,e)}get host(){return Bt.Message.getFieldWithDefault(this,8,"")}set host(e){Bt.Message.setField(this,8,e)}get max(){return Bt.Message.getFieldWithDefault(this,9,0)}set max(e){Bt.Message.setField(this,9,e)}get deviceModel(){return Bt.Message.getFieldWithDefault(this,10,"")}set deviceModel(e){Bt.Message.setField(this,10,e)}get hosts(){return Bt.Message.getFieldWithDefault(this,11,[])}set hosts(e){Bt.Message.setField(this,11,e)}get region(){return Bt.Message.getFieldWithDefault(this,12,"")}set region(e){Bt.Message.setField(this,12,e)}get phone(){return Bt.Message.getFieldWithDefault(this,13,"")}set phone(e){Bt.Message.setField(this,13,e)}get email(){return Bt.Message.getFieldWithDefault(this,14,"")}set email(e){Bt.Message.setField(this,14,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,15,"")}set avatar(e){Bt.Message.setField(this,15,e)}get getaway(){return Bt.Message.getFieldWithDefault(this,16,"")}set getaway(e){Bt.Message.setField(this,16,e)}get deviceName(){return Bt.Message.getFieldWithDefault(this,17,"")}set deviceName(e){Bt.Message.setField(this,17,e)}get ip(){return Bt.Message.getFieldWithDefault(this,18,"")}set ip(e){Bt.Message.setField(this,18,e)}get country(){return Bt.Message.getFieldWithDefault(this,19,"")}set country(e){Bt.Message.setField(this,19,e)}get city(){return Bt.Message.getFieldWithDefault(this,20,"")}set city(e){Bt.Message.setField(this,20,e)}static fromObject(e){const r=new t({});return null!=e.userId&&(r.userId=e.userId),null!=e.appId&&(r.appId=e.appId),null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.roomId&&(r.roomId=e.roomId),null!=e.account&&(r.account=e.account),null!=e.prefix&&(r.prefix=e.prefix),null!=e.nickname&&(r.nickname=e.nickname),null!=e.host&&(r.host=e.host),null!=e.max&&(r.max=e.max),null!=e.deviceModel&&(r.deviceModel=e.deviceModel),null!=e.hosts&&(r.hosts=e.hosts),null!=e.region&&(r.region=e.region),null!=e.phone&&(r.phone=e.phone),null!=e.email&&(r.email=e.email),null!=e.avatar&&(r.avatar=e.avatar),null!=e.getaway&&(r.getaway=e.getaway),null!=e.deviceName&&(r.deviceName=e.deviceName),null!=e.ip&&(r.ip=e.ip),null!=e.country&&(r.country=e.country),null!=e.city&&(r.city=e.city),r}toObject(){const e={};return null!=this.userId&&(e.userId=this.userId),null!=this.appId&&(e.appId=this.appId),null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.roomId&&(e.roomId=this.roomId),null!=this.account&&(e.account=this.account),null!=this.prefix&&(e.prefix=this.prefix),null!=this.nickname&&(e.nickname=this.nickname),null!=this.host&&(e.host=this.host),null!=this.max&&(e.max=this.max),null!=this.deviceModel&&(e.deviceModel=this.deviceModel),null!=this.hosts&&(e.hosts=this.hosts),null!=this.region&&(e.region=this.region),null!=this.phone&&(e.phone=this.phone),null!=this.email&&(e.email=this.email),null!=this.avatar&&(e.avatar=this.avatar),null!=this.getaway&&(e.getaway=this.getaway),null!=this.deviceName&&(e.deviceName=this.deviceName),null!=this.ip&&(e.ip=this.ip),null!=this.country&&(e.country=this.country),null!=this.city&&(e.city=this.city),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.userId.length&&t.writeString(1,this.userId),0!=this.appId&&t.writeInt64(2,this.appId),this.deviceKey.length&&t.writeString(3,this.deviceKey),0!=this.roomId&&t.writeInt64(4,this.roomId),this.account.length&&t.writeString(5,this.account),this.prefix.length&&t.writeString(6,this.prefix),this.nickname.length&&t.writeString(7,this.nickname),this.host.length&&t.writeString(8,this.host),0!=this.max&&t.writeInt32(9,this.max),this.deviceModel.length&&t.writeString(10,this.deviceModel),this.hosts.length&&t.writeRepeatedString(11,this.hosts),this.region.length&&t.writeString(12,this.region),this.phone.length&&t.writeString(13,this.phone),this.email.length&&t.writeString(14,this.email),this.avatar.length&&t.writeString(15,this.avatar),this.getaway.length&&t.writeString(16,this.getaway),this.deviceName.length&&t.writeString(17,this.deviceName),this.ip.length&&t.writeString(18,this.ip),this.country.length&&t.writeString(19,this.country),this.city.length&&t.writeString(20,this.city),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.userId=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.deviceKey=r.readString();break;case 4:i.roomId=r.readInt64();break;case 5:i.account=r.readString();break;case 6:i.prefix=r.readString();break;case 7:i.nickname=r.readString();break;case 8:i.host=r.readString();break;case 9:i.max=r.readInt32();break;case 10:i.deviceModel=r.readString();break;case 11:Bt.Message.addToRepeatedField(i,11,r.readString());break;case 12:i.region=r.readString();break;case 13:i.phone=r.readString();break;case 14:i.email=r.readString();break;case 15:i.avatar=r.readString();break;case 16:i.getaway=r.readString();break;case 17:i.deviceName=r.readString();break;case 18:i.ip=r.readString();break;case 19:i.country=r.readString();break;case 20:i.city=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Connect=t}(e.imio||(e.imio={}))}(si||(si={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"name"in e&&null!=e.name&&(this.name=e.name),"host"in e&&null!=e.host&&(this.host=e.host),"max"in e&&null!=e.max&&(this.max=e.max),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"ip"in e&&null!=e.ip&&(this.ip=e.ip),"one"in e&&null!=e.one&&(this.one=e.one),"two"in e&&null!=e.two&&(this.two=e.two),"three"in e&&null!=e.three&&(this.three=e.three),"four"in e&&null!=e.four&&(this.four=e.four),"five"in e&&null!=e.five&&(this.five=e.five),"port"in e&&null!=e.port&&(this.port=e.port))}get id(){return Bt.Message.getFieldWithDefault(this,1,0)}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get name(){return Bt.Message.getFieldWithDefault(this,7,"")}set name(e){Bt.Message.setField(this,7,e)}get host(){return Bt.Message.getFieldWithDefault(this,8,"")}set host(e){Bt.Message.setField(this,8,e)}get max(){return Bt.Message.getFieldWithDefault(this,9,0)}set max(e){Bt.Message.setField(this,9,e)}get remark(){return Bt.Message.getFieldWithDefault(this,10,"")}set remark(e){Bt.Message.setField(this,10,e)}get ip(){return Bt.Message.getFieldWithDefault(this,11,0)}set ip(e){Bt.Message.setField(this,11,e)}get one(){return Bt.Message.getFieldWithDefault(this,12,0)}set one(e){Bt.Message.setField(this,12,e)}get two(){return Bt.Message.getFieldWithDefault(this,13,0)}set two(e){Bt.Message.setField(this,13,e)}get three(){return Bt.Message.getFieldWithDefault(this,14,0)}set three(e){Bt.Message.setField(this,14,e)}get four(){return Bt.Message.getFieldWithDefault(this,15,0)}set four(e){Bt.Message.setField(this,15,e)}get five(){return Bt.Message.getFieldWithDefault(this,16,0)}set five(e){Bt.Message.setField(this,16,e)}get port(){return Bt.Message.getFieldWithDefault(this,17,"")}set port(e){Bt.Message.setField(this,17,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.name&&(r.name=e.name),null!=e.host&&(r.host=e.host),null!=e.max&&(r.max=e.max),null!=e.remark&&(r.remark=e.remark),null!=e.ip&&(r.ip=e.ip),null!=e.one&&(r.one=e.one),null!=e.two&&(r.two=e.two),null!=e.three&&(r.three=e.three),null!=e.four&&(r.four=e.four),null!=e.five&&(r.five=e.five),null!=e.port&&(r.port=e.port),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.name&&(e.name=this.name),null!=this.host&&(e.host=this.host),null!=this.max&&(e.max=this.max),null!=this.remark&&(e.remark=this.remark),null!=this.ip&&(e.ip=this.ip),null!=this.one&&(e.one=this.one),null!=this.two&&(e.two=this.two),null!=this.three&&(e.three=this.three),null!=this.four&&(e.four=this.four),null!=this.five&&(e.five=this.five),null!=this.port&&(e.port=this.port),e}serialize(e){const t=e||new Bt.BinaryWriter;if(0!=this.id&&t.writeInt64(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.name.length&&t.writeString(7,this.name),this.host.length&&t.writeString(8,this.host),0!=this.max&&t.writeInt64(9,this.max),this.remark.length&&t.writeString(10,this.remark),0!=this.ip&&t.writeInt32(11,this.ip),0!=this.one&&t.writeInt32(12,this.one),0!=this.two&&t.writeInt32(13,this.two),0!=this.three&&t.writeInt32(14,this.three),0!=this.four&&t.writeInt32(15,this.four),0!=this.five&&t.writeInt64(16,this.five),this.port.length&&t.writeString(17,this.port),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readInt64();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:i.name=r.readString();break;case 8:i.host=r.readString();break;case 9:i.max=r.readInt64();break;case 10:i.remark=r.readString();break;case 11:i.ip=r.readInt32();break;case 12:i.one=r.readInt32();break;case 13:i.two=r.readInt32();break;case 14:i.three=r.readInt32();break;case 15:i.four=r.readInt32();break;case 16:i.five=r.readInt64();break;case 17:i.port=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Gateway=t}(e.imio||(e.imio={}))}(oi||(oi={}));var li=r(287).hp,ui=si.imio.Connect,di=Ut.imio.Contacts,hi=qt.imio.Message,ci=oi.imio.Gateway;class pi extends Wt{static instance;constructor(){super(),this.getIP1()}static getInstance(){if(!pi.instance){pi.instance=new pi,ai.load().then(e=>e.get()).then(e=>{pi.instance.deviceId=e.visitorId});try{const e=li.from("Buffer 支持度测试文本").toString();console.log("Buffer Text:",e)}catch(e){console.error("浏览器环境不支持 Buffer")}}return pi.instance}whitOption(e){if(!e)throw new Error("初始化失败");if(!e.appId.length)throw new Error("初始化失败 appId");if(!e.host.length&&!e.hosts.length)throw new Error("接入点比选其一");this.option=e,e.protocol&&(this.protocol="wss"),this.userAgent=window.navigator.userAgent;let t=window.navigator.userAgent.indexOf("("),r=window.navigator.userAgent.indexOf(")");this.deviceName=window.navigator.userAgent.substring(t+1,r);let i=window.navigator.userAgent.lastIndexOf(")");return this.deviceModel=window.navigator.userAgent.substring(i+1),this.deviceModel.length>200&&(this.deviceModel=this.deviceModel.substring(0,200)),this.deviceName.length>150&&(this.deviceName=this.deviceModel.substring(0,150)),this.meta.appId=Number(e.appId),ai.load().then(e=>e.get()).then(t=>{this.deviceId=t.visitorId,this.meta.deviceKey=t.visitorId,e?.debug&&console.warn("Client init... "+t.visitorId)}),this}userAgent="";protocol="ws";hostAddress="";hostNodeList=[];option;clientListener;connectStatus=Dt.DONE;retryTimer=-2;connectStatusTimer=-2;retryConnectNum=0;unexpectedly=0;messageListener=[];contactListener=[];setToken(e){this.token=e;try{let t=this.getJwtPayload(e);this.tokenAppId=Number(t.aud),this.tokenAppId+""!=this.option?.appId&&console.warn("IMIO:token中的AppId 与 IMIOClientOption不一致")}catch(e){this.tokenAppId=0,console.warn("IMIO: token中的AppId 解析错误")}return this}isClose(){return!this.socket}getDeviceKey(){return this.deviceId}getUserInfo(){return this.account}addMessageListener(e){-1==this.messageListener.findIndex(t=>t===e)&&this.messageListener.push(e)}removeMessageListener(e){let t=this.messageListener.filter(t=>t===e).map((e,t)=>t);if(t.length>0)for(let e of t)this.messageListener.splice(e,1)}addContactListener(e){-1==this.contactListener.findIndex(t=>t===e)&&this.contactListener.push(e)}removeContactListener(e){let t=this.contactListener.filter(t=>t===e).map((e,t)=>t);if(t.length>0)for(let e of t)this.contactListener.splice(e,1)}disconnect(){return this.account=null,clearInterval(this.retryTimer),this.unexpectedly=0,this.connectStatus=Dt.DONE,this.socket&&(this.socket.close(new Error("主动关闭")),this.socket=null,this.option&&this.option.appId.length&&(this.meta.pageSize=this.pageSize,this.meta.page=0,this.meta.appId=Number(this.option?.appId))),this}connect(e,t,r,i){if(!t||t.length<50)throw new Error("IMIO 连接 token 必须");if(i&&(this.clientListener=i),this.token=t,!this.option)throw new Error("IMIOClientOption 缺失");try{let e=this.getJwtPayload(t);this.tokenAppId=Number(e.aud)}catch(e){this.tokenAppId=0}if(0==this.tokenAppId||this.tokenAppId+""!=this.option?.appId)throw new Error("token中的AppId 与 IMIOClientOption不一致");return this.option?.debug&&(console.warn("connect deviceId",this.deviceId),this.meta.deviceKey.length||(this.meta.deviceKey=this.deviceId)),this.isClose()&&this.disconnect(),this.account=new zt,this.account.nickname=r,e&&(this.account.accountId=e.toString(),this.meta.userId=this.account.accountId),this.deviceId.length?this.callSocket(e):setTimeout(()=>{this.callSocket(e)},2e3),this}callSocket(e=0){if(!this.option)throw new Error("客户端配置项不存在");if(this.hostAddress=this.hostAddressProvider(),!this.hostAddress.length)throw new Error("主机地址不存在");let t="",r="",i="";e||(this.account&&this.account.nickname&&(t=this.account.nickname.toString()),this.account&&this.account.phone&&(r=this.account.phone.toString()),this.account&&this.account.email&&(i=this.account.email.toString()));try{this.ip.length<=6&&this.getIP1()}catch(e){}const n=new ui({appId:parseInt(this.option.appId),deviceKey:this.deviceId,prefix:"h5",userId:e>0?e.toString():"",nickname:e>0?t:"",email:e>0?i:"",phone:e>0?r:"",deviceModel:this.deviceModel,deviceName:this.deviceName,ip:this.ip+"",country:this.country+"",city:this.city+""});let s=null;try{s=(0,d.encodeBearerAuthMetadata)(this.token)}catch(e){return void(this.option?.debug&&console.error("Buffer Error",e))}if(!s)return;this.option?.debug&&console.warn("IMIO host",this.hostAddress);let a=new l.RSocketConnector({setup:{keepAlive:5e3,dataMimeType:d.WellKnownMimeType.APPLICATION_CBOR.string,metadataMimeType:d.WellKnownMimeType.MESSAGE_RSOCKET_COMPOSITE_METADATA.string,payload:{data:li.from(n.serializeBinary().buffer),metadata:(0,d.encodeCompositeMetadata)([[d.WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION,(0,d.encodeBearerAuthMetadata)(this.token)]])}},transport:new u.WebsocketClientTransport({debug:!0,url:`${this.protocol}://${this.hostAddress}`}),responder:{fireAndForget:(e,t)=>{const r=e.metadata,i=e.data;t.onComplete();let n="";return r&&(n=this.decodeMetadata(r).get("route")),this.option?.debug&&console.warn("IMIO fireAndForget...",n),this.routerParse(n,i),{cancel(){}}},requestResponse:(e,t)=>{const r=e.metadata,i=e.data;t.onNext({data:li.from("OK")},!0);let n="";return r&&(n=this.decodeMetadata(r).get("route")),this.option?.debug&&console.warn("IMIO requestResponse...",n),this.routerParse(n,i),{cancel(){},onExtension(e,t,r){}}}}});this.connectStatus=Dt.CONNECTING,this.connectStatusTimer=setInterval(()=>{try{this.clientListener&&this.clientListener.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}try{this.connectStatus!=Dt.SUCCESS&&this.connectStatus!=Dt.SUCCESS_PULL||this.ping()}catch(e){}},2e3),a.connect().then(e=>{this.option?.debug&&console.warn("IMIO connect success..."),this.account&&(this.account.status=o.online);try{this.connectStatus=Dt.SUCCESS_PULL,this.clientListener?.onConnected()}catch(e){}this.retryConnectNum=0,this.unexpectedly=0,this.socket=e,clearInterval(this.retryTimer),this.retryTimer=-2,e.onClose(e=>{let t=e?.message+"";this.option?.debug&&console.error("IMIOServer connect onClose",t),this.account&&(this.account.status=o.done),this.connectErrorEvent(t)})}).catch(e=>{if(this.option?.debug&&console.error("IMIOServer Connect Error",e),e){let t=e?.message+"";this.connectErrorEvent(t)}else{if(this.account&&(this.account.status=o.done),this.unexpectedly>6){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.socket=null,this.connectStatus=Dt.ERROR,this.retryTimer=-2;try{this.clientListener?.onDisconnected()}catch(e){}return}clearInterval(this.connectStatusTimer),this.connectStatusTimer=-2,this.unexpectedly++,this.retryConnTimer()}}).finally(()=>{this.option?.debug&&console.warn("IMIO connect finally")})}ping(){if(!this.option)return;if(!this.option.appId.length)return;if(!this.socket)return;const e=new ui({appId:parseInt(this.option.appId),deviceKey:this.deviceId,prefix:"h5",userId:this.account?this.account.accountId.toString():"",deviceModel:this.deviceModel,deviceName:this.deviceName});this.socket?.requestResponse({data:li.from(e.serializeBinary().buffer),metadata:this.buildRoute("ping")},{onComplete:()=>{},onNext:(e,t)=>{},onError:e=>{},onExtension(e,t,r){}})}connectErrorEvent(e){if(this.socket=null,this.account&&(this.account.status=o.done),clearInterval(this.connectStatusTimer),this.connectStatusTimer=-2,e.indexOf("主动关闭")>-1){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.connectStatus=Dt.DONE,this.retryTimer=-2,this.connectStatusTimer=-2,this.retryConnectNum=0;try{this.clientListener?.onDisconnected()}catch(e){}}else{if(e.indexOf("keep-alive")>-1){if(this.unexpectedly=0,this.unexpectedly>6){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.connectStatus=Dt.ERROR,this.connectStatusTimer=-2,this.retryTimer=-2;try{this.clientListener?.onDisconnected()}catch(e){}return}return this.unexpectedly++,void this.retryConnTimer()}if(e.indexOf("unexpectedly")>-1){if(this.unexpectedly>6){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.connectStatus=Dt.ERROR,this.connectStatusTimer=-2,this.retryTimer=-2;try{this.clientListener?.onDisconnected()}catch(e){}return}return this.unexpectedly++,void this.retryConnTimer()}if(e.indexOf("Jwt")>-1){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.connectStatusTimer=-2,this.retryTimer=-2;try{this.connectStatus=Dt.TOKEN_EXPIRED,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}try{this.clientListener?.onTokenExpired()}catch(e){}}else{if(e.indexOf("SQL")>-1||e.indexOf("connect")>-1){try{this.connectStatus=Dt.ERROR,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}return this.unexpectedly++,void this.retryConnTimer()}if(e.indexOf("token")>-1)try{this.connectStatus=Dt.TOKEN_EXPIRED,this.clientListener?.onTokenExpired(),this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}}}}retryConnTimer(){clearInterval(this.retryTimer),this.retryTimer=setInterval(()=>{if(this.retryConnectNum>8){clearInterval(this.retryTimer),this.retryConnectNum=0;try{this.connectStatus=Dt.ERROR,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum),this.clientListener?.onDisconnected()}catch(e){}}else if(!this.socket){this.retryConnectNum++,this.connectStatus=Dt.RETRY_CONNECTING;try{this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}if(this.account)try{let e=Number(this.account.accountId);this.callSocket(e)}catch(e){}else this.callSocket()}},8e3)}hostAddressProvider(){return this.option&&this.option?.host?this.option.host.toString():""}routerParse(e,t){switch(e){case"link-to-many":this.handleToMany(t);break;case"gateway":this.handleGateway(t);break;case"pong":clearInterval(this.connectStatusTimer),this.connectStatusTimer=-2;try{this.connectStatus=Dt.SUCCESS,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}this.handelPong(t);break;case"contact":this.handleContact(t);break;case"contact-status":this.handleContactStatus(t);break;case"contact-change":this.handleContactChange(t);break;case"notice":this.handleNotice(t);break;case"message":this.handleMessage(t)}}handleGateway(e){if(e)try{let t=ci.deserialize(e),r=this.buildGateway(t),i=this.hostNodeList.find(e=>e.host==e.host);i?i.current=r.current:this.hostNodeList.push(r)}catch(e){}}handleToMany(e){if(!e)return;clearInterval(this.retryTimer),this.retryTimer=-2;try{this.connectStatus=Dt.RETRY_CONNECTING,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}const t=ui.deserialize(e);this.hostAddress=t.ip;try{let e=t.ip.split(":"),r=new f;r.max=t.appId,r.current=t.roomId,r.name=t.nickname,r.host=e[0],r.port=e[1];let i=this.hostNodeList.find(e=>e.name==r.name);i?(i.max=r.max,i.current=r.current,i.host=r.host,i.port=r.port):this.hostNodeList.push(r)}catch(e){}this.option?.whitHost(t.ip),this.socket&&(this.socket?.close(new Error("主动关闭")),this.account&&this.callSocket(Number(this.account.accountId)))}handelPong(e){if(e)try{const t=ui.deserialize(e);this.account&&(this.account.accountId=t.userId,this.account.account=t.account,this.account.roomId=t.roomId,this.account.nickname=t.nickname,this.account.avatar=t.avatar),this.meta&&(this.meta.roomId=t.roomId,this.meta.userId=t.userId,this.meta.nickname=t.nickname,this.meta.avatar=t.avatar),this.option?.debug&&(console.warn("IMIO meta",this.meta.toObject()),console.warn("IMIO userinfo",this.account))}catch(e){}}handleContact(e){if(e)try{let t=di.deserialize(e),r=this.buildContact(t),i=this.contactList.findIndex(e=>e.contactId==r.contactId);i>-1?this.contactList[i]=r:this.contactList.push(r)}catch(e){}}handleContactStatus(e){if(e)try{let t=hi.deserialize(e),r=this.contactList.findIndex(e=>!e.isGroup&&e.userId==t.fromId);if(r>-1){let e=o.done;t.command==o.offline&&(e=o.offline),t.command==o.online&&(e=o.online),t.command==o.online_busy&&(e=o.online_busy),t.command==o.online_leave&&(e=o.online_leave),this.contactList[r].status=e,this.account&&this.account.accountId.length>0&&t.fromId==this.account.accountId&&(this.account.status=t.command);for(const e of this.contactListener)try{e.onContactChange?.(!1,this.contactList[r])}catch(e){}}}catch(e){}}handleContactChange(e){if(e)try{let t=hi.deserialize(e);t.text.length&&Jt.getInstance().getContactByUserId(t.text).then(e=>{let t=this.contactList.findIndex(t=>!t.isGroup&&t.userId==e.userId);if(t>-1){this.contactList.splice(t,1,e);for(const t of this.contactListener)try{t.onContactChange?.(!1,e)}catch(e){}}})}catch(e){}}handleNotice(e){if(e)try{let t=hi.deserialize(e),r=this.buildMessage(t);for(const e of this.messageListener)try{e.onNotice?.(r)}catch(e){}}catch(e){}}handleMessage(e){if(e)try{let t=hi.deserialize(e),r=this.buildMessage(t);try{ir.getInstance().setClient(this).signMessage(r.messageId,r.joinId).then()}catch(e){}for(const e of this.messageListener)try{e.onMessage?.(r)}catch(e){}}catch(e){}}}class fi{_appId="";_issuer="";_host="";_hosts=[];_debug=!1;_protocol=!1;constructor(){}static newBuilder(){return new fi}whitAppId(e){return this._appId=e,this}whitIssuer(e){return this._issuer=e,this}whitHost(e){return this._host=e,this._hosts.push(e),this}whitHosts(e){return this._hosts=e,this}whitDebug(e){return this._debug=e,this}whitProtocol(e){return this._protocol=e,this}build(){return this}get appId(){return this._appId}get issuer(){return this._issuer}get host(){return this._host}set host(e){this._host=e}get hosts(){return this._hosts}get debug(){return this._debug}get protocol(){return this._protocol}}class mi{static instance;imioClient=null;constructor(){}static getInstance(){return mi.instance||(mi.instance=new mi),mi.instance}setIMIOClient(e){return this.imioClient=e,this}}var gi,yi,vi=r(287).hp,bi=Ut.imio.Contacts,Ii=jt.imio.Rooms;class Ei extends Gt{static instance;imioClient=null;constructor(){super()}static getInstance(){return Ei.instance||(Ei.instance=new Ei),Ei.instance}setClient(e){return this.imioClient=e,this}search(e,t,r=1,i=50){return new Promise((n,s)=>{if(this.checkSocket().length)return void s(new Error(this.checkSocket()));this.imioClient.meta.page=r,this.imioClient.meta.pageSize=i;const o=new Ii({meta:this.imioClient.meta,talkMode:e,type:"protected",roomname:1==e?"":t,account:1==e?t:""});let a=[];this.imioClient.socket?.requestStream({data:vi.from(o.serializeBinary().buffer),metadata:this.buildRoute("group.search")},this.imioClient.pageSize,{onComplete:()=>{n(a)},onNext:(e,t)=>{try{if(e.data){let t=Ii.deserialize(e.data),r=this.buildGroup(t);a.push(r)}}catch(e){s(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?s(new Error(r)):s(new Error(t))},onExtension(e,t,r){}})})}getMembers(e,t=1){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));this.imioClient.meta.page=t;const n=new bi({meta:this.imioClient.meta,joinRoomId:e});let s=[];this.imioClient.socket?.requestStream({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.members")},this.imioClient.pageSize,{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let t=bi.deserialize(e.data),r=this.buildMember(t);s.push(r)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}getGroupById(e){return new Promise(async(t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new bi({meta:this.imioClient.meta,joinRoomId:e});let n=null;this.imioClient.socket?.requestResponse({data:vi.from(i.serializeBinary().buffer),metadata:this.buildRoute("group.byId")},{onComplete:()=>{t(n)},onNext:(e,i)=>{try{if(e.data){let r=Ii.deserialize(e.data),s=this.buildGroup(r);n=s,i&&t(n)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}createGroup(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await Jt.getInstance().setClient(this.imioClient).getContactList();if(n.length<=0)return void i(new Error("联系人获取失败"));let s=n.filter(e=>!e.isGroup&&-1!=t.findIndex(t=>t==e.userId));if(s.length<=0)return void i(new Error("您设置的群成员不正确"));let o=s.map(e=>new bi({userId:e.userId}));const a=new Ii({meta:this.imioClient.meta,roomname:e,users:o});let l=null;this.imioClient.socket?.requestResponse({data:vi.from(a.serializeBinary().buffer),metadata:this.buildRoute("group.create")},{onComplete:()=>{r(l)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);l=n,t&&r(l)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}joinGroup(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,remark:t});let s=[];this.imioClient.socket?.requestStream({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.join")},this.imioClient.pageSize,{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let t=bi.deserialize(e.data),r=this.buildMember(t);s.push(r)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}groupInvite(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,fromUserId:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.invite")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}exit(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new bi({meta:this.imioClient.meta,joinRoomId:e});this.imioClient.socket?.requestStream({data:vi.from(i.serializeBinary().buffer),metadata:this.buildRoute("group.exit")},30,{onComplete:()=>{t("")},onNext:(e,t)=>{},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}removeMember(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,fromUserId:t});this.imioClient.socket?.requestStream({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.remove")},30,{onComplete:()=>{r("")},onNext:(e,t)=>{},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}changeOwner(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.change.owner")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=bi.deserialize(e.data),n=this.buildContact(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setManager(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t});this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.manager")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}addBlack(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));const s=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t,black:r?1:0});let o=null;this.imioClient.socket?.requestResponse({data:vi.from(s.serializeBinary().buffer),metadata:this.buildRoute("group.add.black")},{onComplete:()=>{i(o)},onNext:(e,t)=>{try{if(e.data){let r=bi.deserialize(e.data),n=this.buildContact(r);o=n,t&&i(o)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}memberMuted(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));const s=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t,apply:r?1:0});let o=null;this.imioClient.socket?.requestResponse({data:vi.from(s.serializeBinary().buffer),metadata:this.buildRoute("group.member.muted")},{onComplete:()=>{i(o)},onNext:(e,t)=>{try{if(e.data){let r=bi.deserialize(e.data),n=this.buildContact(r);o=n,t&&i(o)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}groupMuted(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.muted")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setGroupQuestion(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));const s=new bi({meta:this.imioClient.meta,joinRoomId:e,username:t,remark:r});this.imioClient.socket?.requestResponse({data:vi.from(s.serializeBinary().buffer),metadata:this.buildRoute("group.set.answer")},{onComplete:()=>{i("")},onNext:(e,t)=>{try{t&&i("")}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}setGroupName(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,username:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.groupname")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setGroupAvatar(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,avatar:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.avatar")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setGroupDepict(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,remark:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.depict")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setGroupMemberName(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));const s=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t,username:r});this.imioClient.socket?.requestResponse({data:vi.from(s.serializeBinary().buffer),metadata:this.buildRoute("group.set.username")},{onComplete:()=>{i("")},onNext:(e,t)=>{try{t&&i("")}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}setGroupType(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t});this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.type")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isPrivateChat(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.privateChat")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isApply(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.apply")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isInviteApply(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.need")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isInvite(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?0:1});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.invite")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isRevokeMessage(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.revoke")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}onError(e){if(e.indexOf("Jwt")>-1){try{this.imioClient.clientListener?.onTokenExpired()}catch(e){}return"IMIO Token 已过期"}return e.indexOf("SQL")>-1||e.indexOf("connect")>-1?"IMIO System Error":e.indexOf("terminal")>-1||e.indexOf("signal")>-1?"请求超时":""}checkSocket(){return this.imioClient?this.imioClient.socket?0==this.imioClient.getTokenAppId()||this.imioClient.getTokenAppId()!=this.imioClient.meta.appId?"token中的AppId 与 IMIOClientOption不一致":"":"IMIO Client 尚未建立连接":"IMIO Client 不存在"}}!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"username"in e&&null!=e.username&&(this.username=e.username),"account"in e&&null!=e.account&&(this.account=e.account),"mobile"in e&&null!=e.mobile&&(this.mobile=e.mobile),"email"in e&&null!=e.email&&(this.email=e.email),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar),"gender"in e&&null!=e.gender&&(this.gender=e.gender),"birth"in e&&null!=e.birth&&(this.birth=e.birth))}get id(){return Bt.Message.getFieldWithDefault(this,1,"")}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get roomId(){return Bt.Message.getFieldWithDefault(this,11,0)}set roomId(e){Bt.Message.setField(this,11,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,12,"")}set nickname(e){Bt.Message.setField(this,12,e)}get username(){return Bt.Message.getFieldWithDefault(this,13,"")}set username(e){Bt.Message.setField(this,13,e)}get account(){return Bt.Message.getFieldWithDefault(this,14,"")}set account(e){Bt.Message.setField(this,14,e)}get mobile(){return Bt.Message.getFieldWithDefault(this,15,"")}set mobile(e){Bt.Message.setField(this,15,e)}get email(){return Bt.Message.getFieldWithDefault(this,16,"")}set email(e){Bt.Message.setField(this,16,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,17,"")}set avatar(e){Bt.Message.setField(this,17,e)}get gender(){return Bt.Message.getFieldWithDefault(this,18,0)}set gender(e){Bt.Message.setField(this,18,e)}get birth(){return Bt.Message.getFieldWithDefault(this,19,"")}set birth(e){Bt.Message.setField(this,19,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.roomId&&(r.roomId=e.roomId),null!=e.nickname&&(r.nickname=e.nickname),null!=e.username&&(r.username=e.username),null!=e.account&&(r.account=e.account),null!=e.mobile&&(r.mobile=e.mobile),null!=e.email&&(r.email=e.email),null!=e.avatar&&(r.avatar=e.avatar),null!=e.gender&&(r.gender=e.gender),null!=e.birth&&(r.birth=e.birth),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.roomId&&(e.roomId=this.roomId),null!=this.nickname&&(e.nickname=this.nickname),null!=this.username&&(e.username=this.username),null!=this.account&&(e.account=this.account),null!=this.mobile&&(e.mobile=this.mobile),null!=this.email&&(e.email=this.email),null!=this.avatar&&(e.avatar=this.avatar),null!=this.gender&&(e.gender=this.gender),null!=this.birth&&(e.birth=this.birth),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.id.length&&t.writeString(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),0!=this.roomId&&t.writeInt64(11,this.roomId),this.nickname.length&&t.writeString(12,this.nickname),this.username.length&&t.writeString(13,this.username),this.account.length&&t.writeString(14,this.account),this.mobile.length&&t.writeString(15,this.mobile),this.email.length&&t.writeString(16,this.email),this.avatar.length&&t.writeString(17,this.avatar),0!=this.gender&&t.writeInt32(18,this.gender),this.birth.length&&t.writeString(19,this.birth),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.roomId=r.readInt64();break;case 12:i.nickname=r.readString();break;case 13:i.username=r.readString();break;case 14:i.account=r.readString();break;case 15:i.mobile=r.readString();break;case 16:i.email=r.readString();break;case 17:i.avatar=r.readString();break;case 18:i.gender=r.readInt32();break;case 19:i.birth=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Users=t}(e.imio||(e.imio={}))}(gi||(gi={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"userId"in e&&null!=e.userId&&(this.userId=e.userId),"device"in e&&null!=e.device&&(this.device=e.device),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"status"in e&&null!=e.status&&(this.status=e.status),"state"in e&&null!=e.state&&(this.state=e.state),"gateway"in e&&null!=e.gateway&&(this.gateway=e.gateway),"deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"deviceTag"in e&&null!=e.deviceTag&&(this.deviceTag=e.deviceTag),"region"in e&&null!=e.region&&(this.region=e.region))}get id(){return Bt.Message.getFieldWithDefault(this,1,0)}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get userId(){return Bt.Message.getFieldWithDefault(this,11,"")}set userId(e){Bt.Message.setField(this,11,e)}get device(){return Bt.Message.getFieldWithDefault(this,12,"")}set device(e){Bt.Message.setField(this,12,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,13,0)}set roomId(e){Bt.Message.setField(this,13,e)}get status(){return Bt.Message.getFieldWithDefault(this,14,"")}set status(e){Bt.Message.setField(this,14,e)}get state(){return Bt.Message.getFieldWithDefault(this,15,"")}set state(e){Bt.Message.setField(this,15,e)}get gateway(){return Bt.Message.getFieldWithDefault(this,16,"")}set gateway(e){Bt.Message.setField(this,16,e)}get deviceKey(){return Bt.Message.getFieldWithDefault(this,17,"")}set deviceKey(e){Bt.Message.setField(this,17,e)}get deviceTag(){return Bt.Message.getFieldWithDefault(this,18,"")}set deviceTag(e){Bt.Message.setField(this,18,e)}get region(){return Bt.Message.getFieldWithDefault(this,19,"")}set region(e){Bt.Message.setField(this,19,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.userId&&(r.userId=e.userId),null!=e.device&&(r.device=e.device),null!=e.roomId&&(r.roomId=e.roomId),null!=e.status&&(r.status=e.status),null!=e.state&&(r.state=e.state),null!=e.gateway&&(r.gateway=e.gateway),null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.deviceTag&&(r.deviceTag=e.deviceTag),null!=e.region&&(r.region=e.region),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.userId&&(e.userId=this.userId),null!=this.device&&(e.device=this.device),null!=this.roomId&&(e.roomId=this.roomId),null!=this.status&&(e.status=this.status),null!=this.state&&(e.state=this.state),null!=this.gateway&&(e.gateway=this.gateway),null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.deviceTag&&(e.deviceTag=this.deviceTag),null!=this.region&&(e.region=this.region),e}serialize(e){const t=e||new Bt.BinaryWriter;if(0!=this.id&&t.writeInt64(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),this.userId.length&&t.writeString(11,this.userId),this.device.length&&t.writeString(12,this.device),0!=this.roomId&&t.writeInt64(13,this.roomId),this.status.length&&t.writeString(14,this.status),this.state.length&&t.writeString(15,this.state),this.gateway.length&&t.writeString(16,this.gateway),this.deviceKey.length&&t.writeString(17,this.deviceKey),this.deviceTag.length&&t.writeString(18,this.deviceTag),this.region.length&&t.writeString(19,this.region),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readInt64();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.userId=r.readString();break;case 12:i.device=r.readString();break;case 13:i.roomId=r.readInt64();break;case 14:i.status=r.readString();break;case 15:i.state=r.readString();break;case 16:i.gateway=r.readString();break;case 17:i.deviceKey=r.readString();break;case 18:i.deviceTag=r.readString();break;case 19:i.region=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.UserStatus=t}(e.imio||(e.imio={}))}(yi||(yi={}));var wi,Si=r(287).hp,Mi=gi.imio.Users,ki=qt.imio.Message,Fi=yi.imio.UserStatus;class Ti extends Gt{static instance;imioClient=null;constructor(){super()}static getInstance(){return Ti.instance||(Ti.instance=new Ti),Ti.instance}setClient(e){return this.imioClient=e,this}getUserDeviceStatus(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new Fi({meta:this.imioClient.meta,userId:e});let n=[];this.imioClient.socket?.requestStream({data:Si.from(i.serializeBinary().buffer),metadata:this.buildRoute("device.status.byUserid")},100,{onComplete:()=>{t(n)},onNext:(e,t)=>{try{if(e.data){let t=Fi.deserialize(e.data),r=this.buildDeviceStatus(t);n.push(r)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}updateDeviceStatus(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new Fi({meta:this.imioClient.meta,status:e.toString()});let n=[];this.imioClient.socket?.requestStream({data:Si.from(i.serializeBinary().buffer),metadata:this.buildRoute("device.status.update")},100,{onComplete:()=>{t(n)},onNext:(e,t)=>{try{if(e.data){let t=Fi.deserialize(e.data),r=this.buildDeviceStatus(t);n.push(r)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}getNoticeMessage(e,t=1,r=40){return new Promise(async(i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));this.imioClient.meta.page=t,this.imioClient.meta.pageSize=r;let s=e.toString();"notify"==e&&(s="cc"),"quietly"==e&&(s="bcc");const o=new ki({meta:this.imioClient.meta,roomId:this.imioClient.meta.roomId,label:s});let a=[];this.imioClient.socket?.requestStream({data:Si.from(o.serializeBinary().buffer),metadata:this.buildRoute("message.notice.page")},500,{onComplete:()=>{i(a)},onNext:(e,t)=>{try{if(e.data){let t=ki.deserialize(e.data),r=this.buildMessage(t);a.push(r)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}updateUserInfo(e="",t="",r="",i=""){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new Mi({meta:this.imioClient.meta,nickname:e,avatar:t});this.imioClient.socket?.requestResponse({data:Si.from(n.serializeBinary().buffer),metadata:this.buildRoute("user.update.info")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}onError(e){if(e.indexOf("Jwt")>-1){try{this.imioClient.clientListener?.onTokenExpired()}catch(e){}return"IMIO Token 已过期"}return e.indexOf("SQL")>-1||e.indexOf("connect")>-1?"IMIO System Error":e.indexOf("terminal")>-1||e.indexOf("signal")>-1?"请求超时":""}checkSocket(){return this.imioClient?this.imioClient.socket?0==this.imioClient.getTokenAppId()||this.imioClient.getTokenAppId()!=this.imioClient.meta.appId?"token中的AppId 与 IMIOClientOption不一致":"":"IMIO Client 尚未建立连接":"IMIO Client 不存在"}}class Ri{messageId="";joinId=0;cite="";type="";title="";subtitle="";text="";secret="";thumb="";host="";url="";lng="";lat="";size=0;length=0;hintList=null;notifyList=null;quietlyList=null;constructor(e){this.type=e}static buildSimpleText(e,t){let r=new Ri(wi.TEXT);return r.joinId=e,r.text=t,r}static buildImage(e,t,r,i=""){let n=new Ri(wi.IMG);return n.joinId=e,n.host=t,n.url=r,n.secret=i,n}static buildFile(e,t,r,i,n=""){let s=new Ri(wi.FILE);return s.joinId=e,s.host=t,s.url=r,s.text=i,s.secret=n,s}static buildVideo(e,t,r,i,n=""){let s=new Ri(wi.VIDEO);return s.joinId=e,s.host=t,s.url=r,s.secret=n,s.size=i,s}static buildAudio(e,t,r,i,n=""){let s=new Ri(wi.AUDIO);return s.joinId=e,s.host=t,s.url=r,s.length=i,s.secret=n,s}withCite(e){return this.cite=e,this}withTitle(e){return this.title=e,this}withSubtitle(e){return this.subtitle=e,this}withSecret(e){if(this.type==wi.TEXT)throw new Error("Secret 属性与消息类型不匹配");if(e.length>500)throw new Error("Secret 长度太长");return this.secret=e,this}withThumb(e){if(this.type==wi.TEXT)throw new Error("Thumb 属性与消息类型不匹配");return this.thumb=e,this}withHost(e){if(this.type==wi.TEXT)throw new Error("Host 属性与消息类型不匹配");if(e.length>250)throw new Error("Host 长度太长");return this.host=e,this}withUrl(e){if(this.type==wi.TEXT)throw new Error("Url 属性与消息类型不匹配");return this.url=e,this}withSize(e){if(this.type!=wi.IMG&&this.type!=wi.AUDIO&&this.type!=wi.VIDEO&&this.type!=wi.FILE)throw new Error("Size 属性与消息类型不匹配");return this.size=e,this}withLength(e){if(this.type!=wi.AUDIO)throw new Error("Length 属性与消息类型不匹配");return this.length=e,this}}!function(e){e.TEXT="txt",e.IMG="img",e.AUDIO="audio",e.VIDEO="video",e.FILE="file",e.LOC="loc",e.WALLET="wallet",e.CUSTOM="custom"}(wi||(wi={}));const Ai={IMIOClient:pi,IMIOClientOption:fi,IMIOGroupManager:Ei,IMIOContactManager:Jt,IMIOClientConnectStatus:Dt,IMIORoomManager:mi,IMIOMessageSender:Ri,IMIOMessageSenderHint:class{targetId="";targetName="";avatar=""},IMIOMessageType:wi,IMIOUserInfoManager:Ti,IMIOMessageLabel:t,IMIOMessage:h,IMIOMessageTalk:n,IMIOContact:c,IMIOContactStatus:o,IMIOGroup:g,IMIOGroupType:a,IMIOChatManager:ir,IMIOMember:p,IMIODeviceStatus:m,IMIOContactNotice:s}})(),i.default})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["imio-sdk-lite"]=t():e["imio-sdk-lite"]=t()}(self,()=>(()=>{var e={33:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestChannelResponderStream=t.RequestChannelRequesterStream=void 0;var a=r(766),l=r(438),u=r(799),d=s(r(76)),h=function(){function e(e,t,r,i,n,s){this.payload=e,this.isComplete=t,this.receiver=r,this.fragmentSize=i,this.initialRequestN=n,this.leaseManager=s,this.streamType=u.FrameTypes.REQUEST_CHANNEL}return e.prototype.handleReady=function(e,t){var r,i;if(this.outboundDone)return!1;this.streamId=e,this.stream=t,t.connect(this);var n=this.isComplete;if(n&&(this.outboundDone=n),(0,l.isFragmentable)(this.payload,this.fragmentSize,u.FrameTypes.REQUEST_CHANNEL))try{for(var s=o((0,l.fragmentWithRequestN)(e,this.payload,this.fragmentSize,u.FrameTypes.REQUEST_CHANNEL,this.initialRequestN,n)),a=s.next();!a.done;a=s.next()){var d=a.value;this.stream.send(d)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.REQUEST_CHANNEL,data:this.payload.data,metadata:this.payload.metadata,requestN:this.initialRequestN,flags:(void 0!==this.payload.metadata?u.Flags.METADATA:u.Flags.NONE)|(n?u.Flags.COMPLETE:u.Flags.NONE),streamId:e});return this.hasExtension&&this.stream.send({type:u.FrameTypes.EXT,streamId:e,extendedContent:this.extendedContent,extendedType:this.extendedType,flags:this.flags}),!0},e.prototype.handleReject=function(e){this.inboundDone||(this.inboundDone=!0,this.outboundDone=!0,this.receiver.onError(e))},e.prototype.handle=function(e){var t,r=e.type;switch(r){case u.FrameTypes.PAYLOAD:var i=u.Flags.hasComplete(e.flags),n=u.Flags.hasNext(e.flags);if(i||!u.Flags.hasFollows(e.flags)){if(i&&(this.inboundDone=!0,this.outboundDone&&this.stream.disconnect(this),!n))return void this.receiver.onComplete();var s=this.hasFragments?d.reassemble(this,e.data,e.metadata):{data:e.data,metadata:e.metadata};return void this.receiver.onNext(s,i)}if(d.add(this,e.data,e.metadata))return;t="Unexpected frame size";break;case u.FrameTypes.CANCEL:if(this.outboundDone)return;return this.outboundDone=!0,this.inboundDone&&this.stream.disconnect(this),void this.receiver.cancel();case u.FrameTypes.REQUEST_N:if(this.outboundDone)return;if(this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.request(e.requestN);case u.FrameTypes.ERROR:var o=this.outboundDone;return this.inboundDone=!0,this.outboundDone=!0,this.stream.disconnect(this),d.cancel(this),o||this.receiver.cancel(),void this.receiver.onError(new a.RSocketError(e.code,e.message));case u.FrameTypes.EXT:return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));default:t="Unexpected frame type [".concat(r,"]")}this.close(new a.RSocketError(a.ErrorCodes.CANCELED,t)),this.stream.send({type:u.FrameTypes.CANCEL,streamId:this.streamId,flags:u.Flags.NONE}),this.stream.disconnect(this)},e.prototype.request=function(e){this.inboundDone||(this.streamId?this.stream.send({type:u.FrameTypes.REQUEST_N,flags:u.Flags.NONE,requestN:e,streamId:this.streamId}):this.initialRequestN+=e)},e.prototype.cancel=function(){var e,t=this.inboundDone,r=this.outboundDone;t&&r||(this.inboundDone=!0,this.outboundDone=!0,r||this.receiver.cancel(),this.streamId?(this.stream.send({type:t?u.FrameTypes.ERROR:u.FrameTypes.CANCEL,flags:u.Flags.NONE,streamId:this.streamId,code:a.ErrorCodes.CANCELED,message:"Cancelled"}),this.stream.disconnect(this),d.cancel(this)):null===(e=this.leaseManager)||void 0===e||e.cancelRequest(this))},e.prototype.onNext=function(e,t){var r,i;if(!this.outboundDone)if(t&&(this.outboundDone=!0,this.inboundDone&&this.stream.disconnect(this)),(0,l.isFragmentable)(e,this.fragmentSize,u.FrameTypes.PAYLOAD))try{for(var n=o((0,l.fragment)(this.streamId,e,this.fragmentSize,u.FrameTypes.PAYLOAD,t)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.PAYLOAD,streamId:this.streamId,flags:u.Flags.NEXT|(e.metadata?u.Flags.METADATA:u.Flags.NONE)|(t?u.Flags.COMPLETE:u.Flags.NONE),data:e.data,metadata:e.metadata})},e.prototype.onComplete=function(){this.streamId?this.outboundDone||(this.outboundDone=!0,this.stream.send({type:u.FrameTypes.PAYLOAD,streamId:this.streamId,flags:u.Flags.COMPLETE,data:null,metadata:null}),this.inboundDone&&this.stream.disconnect(this)):this.isComplete=!0},e.prototype.onError=function(e){if(!this.outboundDone){var t=this.inboundDone;this.outboundDone=!0,this.inboundDone=!0,this.stream.send({type:u.FrameTypes.ERROR,streamId:this.streamId,flags:u.Flags.NONE,code:e instanceof a.RSocketError?e.code:a.ErrorCodes.APPLICATION_ERROR,message:e.message}),this.stream.disconnect(this),t||this.receiver.onError(e)}},e.prototype.onExtension=function(e,t,r){if(!this.outboundDone)return this.streamId?void this.stream.send({streamId:this.streamId,type:u.FrameTypes.EXT,extendedType:e,extendedContent:t,flags:r?u.Flags.IGNORE:u.Flags.NONE}):(this.hasExtension=!0,this.extendedType=e,this.extendedContent=t,void(this.flags=r?u.Flags.IGNORE:u.Flags.NONE))},e.prototype.close=function(e){if(!this.inboundDone||!this.outboundDone){var t=this.inboundDone,r=this.outboundDone;this.inboundDone=!0,this.outboundDone=!0,d.cancel(this),r||this.receiver.cancel(),t||(e?this.receiver.onError(e):this.receiver.onComplete())}},e}();t.RequestChannelRequesterStream=h;var c=function(){function e(e,t,r,i,n){if(this.streamId=e,this.stream=t,this.fragmentSize=r,this.handler=i,this.streamType=u.FrameTypes.REQUEST_CHANNEL,t.connect(this),u.Flags.hasFollows(n.flags))return d.add(this,n.data,n.metadata),this.initialRequestN=n.requestN,void(this.isComplete=u.Flags.hasComplete(n.flags));var s={data:n.data,metadata:n.metadata},o=u.Flags.hasComplete(n.flags);this.inboundDone=o;try{this.receiver=i(s,n.requestN,o,this),this.outboundDone&&this.defferedError&&this.receiver.onError(this.defferedError)}catch(e){this.outboundDone&&!this.inboundDone?this.cancel():this.inboundDone=!0,this.onError(e)}}return e.prototype.handle=function(e){var t,r=e.type;switch(r){case u.FrameTypes.PAYLOAD:if(u.Flags.hasFollows(e.flags)){if(d.add(this,e.data,e.metadata))return;t="Unexpected frame size";break}var i=this.hasFragments?d.reassemble(this,e.data,e.metadata):{data:e.data,metadata:e.metadata},n=u.Flags.hasComplete(e.flags);if(this.receiver){if(n&&(this.inboundDone=!0,this.outboundDone&&this.stream.disconnect(this),!u.Flags.hasNext(e.flags)))return void this.receiver.onComplete();this.receiver.onNext(i,n)}else{(s=this.isComplete||n)&&(this.inboundDone=!0,this.outboundDone&&this.stream.disconnect(this));try{this.receiver=this.handler(i,this.initialRequestN,s,this),this.outboundDone&&this.defferedError}catch(l){this.outboundDone&&!this.inboundDone?this.cancel():this.inboundDone=!0,this.onError(l)}}return;case u.FrameTypes.REQUEST_N:if(!this.receiver||this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.request(e.requestN);case u.FrameTypes.ERROR:case u.FrameTypes.CANCEL:var s=this.inboundDone,o=this.outboundDone;if(this.inboundDone=!0,this.outboundDone=!0,this.stream.disconnect(this),d.cancel(this),!this.receiver)return;if(o||this.receiver.cancel(),!s){var l=r===u.FrameTypes.CANCEL?new a.RSocketError(a.ErrorCodes.CANCELED,"Cancelled"):new a.RSocketError(e.code,e.message);this.receiver.onError(l)}return;case u.FrameTypes.EXT:if(!this.receiver||this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));default:t="Unexpected frame type [".concat(r,"]")}this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:a.ErrorCodes.CANCELED,message:t,streamId:this.streamId}),this.stream.disconnect(this),this.close(new a.RSocketError(a.ErrorCodes.CANCELED,t))},e.prototype.onError=function(e){if(this.outboundDone)console.warn("Trying to error for the second time. ".concat(e?"Dropping error [".concat(e,"]."):""));else{var t=this.inboundDone;this.outboundDone=!0,this.inboundDone=!0,this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:e instanceof a.RSocketError?e.code:a.ErrorCodes.APPLICATION_ERROR,message:e.message,streamId:this.streamId}),this.stream.disconnect(this),t||(this.receiver?this.receiver.onError(e):this.defferedError=e)}},e.prototype.onNext=function(e,t){var r,i;if(!this.outboundDone){if(t&&(this.outboundDone=!0),(0,l.isFragmentable)(e,this.fragmentSize,u.FrameTypes.PAYLOAD))try{for(var n=o((0,l.fragment)(this.streamId,e,this.fragmentSize,u.FrameTypes.PAYLOAD,t)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.NEXT|(t?u.Flags.COMPLETE:u.Flags.NONE)|(e.metadata?u.Flags.METADATA:u.Flags.NONE),data:e.data,metadata:e.metadata,streamId:this.streamId});t&&this.inboundDone&&this.stream.disconnect(this)}},e.prototype.onComplete=function(){this.outboundDone||(this.outboundDone=!0,this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.COMPLETE,streamId:this.streamId,data:null,metadata:null}),this.inboundDone&&this.stream.disconnect(this))},e.prototype.onExtension=function(e,t,r){this.outboundDone&&this.inboundDone||this.stream.send({type:u.FrameTypes.EXT,streamId:this.streamId,flags:r?u.Flags.IGNORE:u.Flags.NONE,extendedType:e,extendedContent:t})},e.prototype.request=function(e){this.inboundDone||this.stream.send({type:u.FrameTypes.REQUEST_N,flags:u.Flags.NONE,streamId:this.streamId,requestN:e})},e.prototype.cancel=function(){this.inboundDone||(this.inboundDone=!0,this.stream.send({type:u.FrameTypes.CANCEL,flags:u.Flags.NONE,streamId:this.streamId}),this.outboundDone&&this.stream.disconnect(this))},e.prototype.close=function(e){if(this.inboundDone&&this.outboundDone)console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):""));else{var t=this.inboundDone,r=this.outboundDone;this.inboundDone=!0,this.outboundDone=!0,d.cancel(this);var i=this.receiver;i&&(r||i.cancel(),t||(e?i.onError(e):i.onComplete()))}},e}();t.RequestChannelResponderStream=c},34:function(e,t){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.WellKnownMimeType=void 0;var i=function(){function e(e,t){this.string=e,this.identifier=t}return e.fromIdentifier=function(t){return t<0||t>127?e.UNPARSEABLE_MIME_TYPE:e.TYPES_BY_MIME_ID[t]},e.fromString=function(t){if(!t)throw new Error("type must be non-null");return t===e.UNKNOWN_RESERVED_MIME_TYPE.string?e.UNPARSEABLE_MIME_TYPE:e.TYPES_BY_MIME_STRING.get(t)||e.UNPARSEABLE_MIME_TYPE},e.prototype.toString=function(){return this.string},e}();t.WellKnownMimeType=i,function(e){var t,i;e.UNPARSEABLE_MIME_TYPE=new e("UNPARSEABLE_MIME_TYPE_DO_NOT_USE",-2),e.UNKNOWN_RESERVED_MIME_TYPE=new e("UNKNOWN_YET_RESERVED_DO_NOT_USE",-1),e.APPLICATION_AVRO=new e("application/avro",0),e.APPLICATION_CBOR=new e("application/cbor",1),e.APPLICATION_GRAPHQL=new e("application/graphql",2),e.APPLICATION_GZIP=new e("application/gzip",3),e.APPLICATION_JAVASCRIPT=new e("application/javascript",4),e.APPLICATION_JSON=new e("application/json",5),e.APPLICATION_OCTET_STREAM=new e("application/octet-stream",6),e.APPLICATION_PDF=new e("application/pdf",7),e.APPLICATION_THRIFT=new e("application/vnd.apache.thrift.binary",8),e.APPLICATION_PROTOBUF=new e("application/vnd.google.protobuf",9),e.APPLICATION_XML=new e("application/xml",10),e.APPLICATION_ZIP=new e("application/zip",11),e.AUDIO_AAC=new e("audio/aac",12),e.AUDIO_MP3=new e("audio/mp3",13),e.AUDIO_MP4=new e("audio/mp4",14),e.AUDIO_MPEG3=new e("audio/mpeg3",15),e.AUDIO_MPEG=new e("audio/mpeg",16),e.AUDIO_OGG=new e("audio/ogg",17),e.AUDIO_OPUS=new e("audio/opus",18),e.AUDIO_VORBIS=new e("audio/vorbis",19),e.IMAGE_BMP=new e("image/bmp",20),e.IMAGE_GIG=new e("image/gif",21),e.IMAGE_HEIC_SEQUENCE=new e("image/heic-sequence",22),e.IMAGE_HEIC=new e("image/heic",23),e.IMAGE_HEIF_SEQUENCE=new e("image/heif-sequence",24),e.IMAGE_HEIF=new e("image/heif",25),e.IMAGE_JPEG=new e("image/jpeg",26),e.IMAGE_PNG=new e("image/png",27),e.IMAGE_TIFF=new e("image/tiff",28),e.MULTIPART_MIXED=new e("multipart/mixed",29),e.TEXT_CSS=new e("text/css",30),e.TEXT_CSV=new e("text/csv",31),e.TEXT_HTML=new e("text/html",32),e.TEXT_PLAIN=new e("text/plain",33),e.TEXT_XML=new e("text/xml",34),e.VIDEO_H264=new e("video/H264",35),e.VIDEO_H265=new e("video/H265",36),e.VIDEO_VP8=new e("video/VP8",37),e.APPLICATION_HESSIAN=new e("application/x-hessian",38),e.APPLICATION_JAVA_OBJECT=new e("application/x-java-object",39),e.APPLICATION_CLOUDEVENTS_JSON=new e("application/cloudevents+json",40),e.MESSAGE_RSOCKET_MIMETYPE=new e("message/x.rsocket.mime-type.v0",122),e.MESSAGE_RSOCKET_ACCEPT_MIMETYPES=new e("message/x.rsocket.accept-mime-types.v0",123),e.MESSAGE_RSOCKET_AUTHENTICATION=new e("message/x.rsocket.authentication.v0",124),e.MESSAGE_RSOCKET_TRACING_ZIPKIN=new e("message/x.rsocket.tracing-zipkin.v0",125),e.MESSAGE_RSOCKET_ROUTING=new e("message/x.rsocket.routing.v0",126),e.MESSAGE_RSOCKET_COMPOSITE_METADATA=new e("message/x.rsocket.composite-metadata.v0",127),e.TYPES_BY_MIME_ID=new Array(128),e.TYPES_BY_MIME_STRING=new Map;var n=[e.UNPARSEABLE_MIME_TYPE,e.UNKNOWN_RESERVED_MIME_TYPE,e.APPLICATION_AVRO,e.APPLICATION_CBOR,e.APPLICATION_GRAPHQL,e.APPLICATION_GZIP,e.APPLICATION_JAVASCRIPT,e.APPLICATION_JSON,e.APPLICATION_OCTET_STREAM,e.APPLICATION_PDF,e.APPLICATION_THRIFT,e.APPLICATION_PROTOBUF,e.APPLICATION_XML,e.APPLICATION_ZIP,e.AUDIO_AAC,e.AUDIO_MP3,e.AUDIO_MP4,e.AUDIO_MPEG3,e.AUDIO_MPEG,e.AUDIO_OGG,e.AUDIO_OPUS,e.AUDIO_VORBIS,e.IMAGE_BMP,e.IMAGE_GIG,e.IMAGE_HEIC_SEQUENCE,e.IMAGE_HEIC,e.IMAGE_HEIF_SEQUENCE,e.IMAGE_HEIF,e.IMAGE_JPEG,e.IMAGE_PNG,e.IMAGE_TIFF,e.MULTIPART_MIXED,e.TEXT_CSS,e.TEXT_CSV,e.TEXT_HTML,e.TEXT_PLAIN,e.TEXT_XML,e.VIDEO_H264,e.VIDEO_H265,e.VIDEO_VP8,e.APPLICATION_HESSIAN,e.APPLICATION_JAVA_OBJECT,e.APPLICATION_CLOUDEVENTS_JSON,e.MESSAGE_RSOCKET_MIMETYPE,e.MESSAGE_RSOCKET_ACCEPT_MIMETYPES,e.MESSAGE_RSOCKET_AUTHENTICATION,e.MESSAGE_RSOCKET_TRACING_ZIPKIN,e.MESSAGE_RSOCKET_ROUTING,e.MESSAGE_RSOCKET_COMPOSITE_METADATA];e.TYPES_BY_MIME_ID.fill(e.UNKNOWN_RESERVED_MIME_TYPE);try{for(var s=r(n),o=s.next();!o.done;o=s.next()){var a=o.value;a.identifier>=0&&(e.TYPES_BY_MIME_ID[a.identifier]=a,e.TYPES_BY_MIME_STRING.set(a.string,a))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}Object.seal&&Object.seal(e.TYPES_BY_MIME_ID)}(i=t.WellKnownMimeType||(t.WellKnownMimeType={})),t.WellKnownMimeType=i},76:(e,t,r)=>{"use strict";var i=r(287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.cancel=t.reassemble=t.add=void 0,t.add=function(e,t,r){return e.hasFragments?(e.data=e.data?i.concat([e.data,t]):t,e.metadata&&r&&(e.metadata=i.concat([e.metadata,r])),!0):(e.hasFragments=!0,e.data=t,r&&(e.metadata=r),!0)},t.reassemble=function(e,t,r){e.hasFragments=!1;var n=e.data?i.concat([e.data,t]):t;if(e.data=void 0,e.metadata){var s=r?i.concat([e.metadata,r]):e.metadata;return e.metadata=void 0,{data:n,metadata:s}}return{data:n}},t.cancel=function(e){e.hasFragments=!1,e.data=void 0,e.metadata=void 0}},92:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},147:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((i=i.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RSocketConnector=void 0;var s=r(698),o=r(799),a=r(923),l=r(366),u=function(){function e(e){this.config=e}return e.prototype.connect=function(){var e,t,r,u,d,h,c,p,f,m,g,y,v,b,I,E,w,S,M,k;return i(this,void 0,void 0,function(){var F,T,R,A,C,O,N,x,_,D=this;return n(this,function(L){switch(L.label){case 0:return F=this.config,T={type:o.FrameTypes.SETUP,dataMimeType:null!==(t=null===(e=F.setup)||void 0===e?void 0:e.dataMimeType)&&void 0!==t?t:"application/octet-stream",metadataMimeType:null!==(u=null===(r=F.setup)||void 0===r?void 0:r.metadataMimeType)&&void 0!==u?u:"application/octet-stream",keepAlive:null!==(h=null===(d=F.setup)||void 0===d?void 0:d.keepAlive)&&void 0!==h?h:6e4,lifetime:null!==(p=null===(c=F.setup)||void 0===c?void 0:c.lifetime)&&void 0!==p?p:3e5,metadata:null===(m=null===(f=F.setup)||void 0===f?void 0:f.payload)||void 0===m?void 0:m.metadata,data:null===(y=null===(g=F.setup)||void 0===g?void 0:g.payload)||void 0===y?void 0:y.data,resumeToken:null!==(b=null===(v=F.resume)||void 0===v?void 0:v.tokenGenerator())&&void 0!==b?b:null,streamId:0,majorVersion:1,minorVersion:0,flags:((null===(E=null===(I=F.setup)||void 0===I?void 0:I.payload)||void 0===E?void 0:E.metadata)?o.Flags.METADATA:o.Flags.NONE)|(F.lease?o.Flags.LEASE:o.Flags.NONE)|(F.resume?o.Flags.RESUME_ENABLE:o.Flags.NONE)},[4,F.transport.connect(function(e){return F.resume?new s.ResumableClientServerInputMultiplexerDemultiplexer(s.StreamIdGenerator.create(-1),e,e,new l.FrameStore,T.resumeToken.toString(),function(e,t){return i(D,void 0,void 0,function(){var r,i,a;return n(this,function(n){switch(n.label){case 0:return r=function(r){return r.send({type:o.FrameTypes.RESUME,streamId:0,flags:o.Flags.NONE,clientPosition:t.firstAvailableFramePosition,serverPosition:t.lastReceivedFramePosition,majorVersion:T.minorVersion,minorVersion:T.majorVersion,resumeToken:T.resumeToken}),new s.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer(r,r,e)},i=-1,[4,(a=function(){return i++,F.resume.reconnectFunction(i).then(function(){return F.transport.connect(r).catch(a)})})()];case 1:return n.sent(),[2]}})})}):new s.ClientServerInputMultiplexerDemultiplexer(s.StreamIdGenerator.create(-1),e,e)})];case 1:return R=L.sent(),A=new a.KeepAliveSender(R.multiplexerDemultiplexer.connectionOutbound,T.keepAlive),C=new a.KeepAliveHandler(R,T.lifetime),O=F.lease?new a.LeaseHandler(null!==(w=F.lease.maxPendingRequests)&&void 0!==w?w:256,R.multiplexerDemultiplexer):void 0,N=null!==(S=F.responder)&&void 0!==S?S:{},x=new a.DefaultConnectionFrameHandler(R,C,A,O,N),_=new a.DefaultStreamRequestHandler(N,0),R.onClose(function(e){A.close(),C.close(),x.close(e)}),R.multiplexerDemultiplexer.connectionInbound(x),R.multiplexerDemultiplexer.handleRequestStream(_),R.multiplexerDemultiplexer.connectionOutbound.send(T),C.start(),A.start(),[2,new a.RSocketRequester(R,null!==(k=null===(M=F.fragmentation)||void 0===M?void 0:M.maxOutboundFragmentSize)&&void 0!==k?k:0,O)]}})})},e}();t.RSocketConnector=u},170:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},225:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(974),t),n(r(288),t),n(r(546),t),n(r(766),t),n(r(799),t),n(r(170),t),n(r(147),t),n(r(777),t),n(r(92),t)},251:(e,t)=>{t.read=function(e,t,r,i,n){var s,o,a=8*n-i-1,l=(1<<a)-1,u=l>>1,d=-7,h=r?n-1:0,c=r?-1:1,p=e[t+h];for(h+=c,s=p&(1<<-d)-1,p>>=-d,d+=a;d>0;s=256*s+e[t+h],h+=c,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=i;d>0;o=256*o+e[t+h],h+=c,d-=8);if(0===s)s=1-u;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=u}return(p?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,r,i,n,s){var o,a,l,u=8*s-n-1,d=(1<<u)-1,h=d>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=d):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?c/l:c*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=d?(a=0,o=d):o+h>=1?(a=(t*l-1)*Math.pow(2,n),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;e[r+p]=255&a,p+=f,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;e[r+p]=255&o,p+=f,o/=256,u-=8);e[r+p-f]|=128*m}},279:function(e,t,r){"use strict";var i=r(287).hp,n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.WellKnownMimeTypeEntry=t.ReservedMimeTypeEntry=t.ExplicitMimeTimeEntry=t.decodeCompositeMetadata=t.encodeWellKnownMetadataHeader=t.encodeCustomMetadataHeader=t.decodeMimeTypeFromMimeBuffer=t.decodeMimeAndContentBuffersSlices=t.encodeAndAddWellKnownMetadata=t.encodeAndAddCustomMetadata=t.encodeCompositeMetadata=t.CompositeMetadata=void 0;var a=r(225),l=r(34),u=function(){function e(e){this._buffer=e}return e.prototype.iterator=function(){return g(this._buffer)},e.prototype[Symbol.iterator]=function(){return g(this._buffer)},e}();function d(e,t,r){return i.concat([e,f(t,r.byteLength),r])}function h(e,t,r){var n;return n=Number.isInteger(t)?t:t.identifier,i.concat([e,m(n,r.byteLength),r])}function c(e,t){var r,i=e.readInt8(t),n=t;if((i&E)===E)r=e.slice(n,n+1),n+=1;else{var s=1+(255&i);if(!(e.byteLength>n+s))throw new Error("Metadata is malformed. Inappropriately formed Mime Length");r=e.slice(n,n+s+1),n+=s+1}if(e.byteLength>=n+3){var o=(0,a.readUInt24BE)(e,n);if(n+=3,e.byteLength>=o+n)return[r,e.slice(n,n+o)];throw new Error("Metadata is malformed. Inappropriately formed Metadata Length or malformed content")}throw new Error("Metadata is malformed. Metadata Length is absent or malformed")}function p(e){if(e.length<2)throw new Error("Unable to decode explicit MIME type");return e.toString("ascii",1)}function f(e,t){var r=i.allocUnsafe(4+e.length);r.fill(0);var n=r.write(e,1);if(!function(e){for(var t=!0,r=1,i=e.length;r<i;r++)if(e[r]>127){t=!1;break}return t}(r))throw new Error("Custom mime type must be US_ASCII characters only");if(n<1||n>128)throw new Error("Custom mime type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128");return r.writeUInt8(n-1),(0,a.writeUInt24BE)(r,t,n+1),r}function m(e,t){var r=i.allocUnsafe(4);return r.writeUInt8(e|E),(0,a.writeUInt24BE)(r,t,1),r}function g(e){var t,r,i,s,o,a,u,d;return n(this,function(n){switch(n.label){case 0:t=e.byteLength,r=0,n.label=1;case 1:if(!(r<t))return[3,7];if(i=c(e,r),s=i[0],f=o=i[1],r=r+s.byteLength+3+f.byteLength,I(s))return[3,3];if(!(a=p(s)))throw new Error("MIME type cannot be null");return[4,new y(o,a)];case 2:return n.sent(),[3,1];case 3:return u=I(h=s)?h.readInt8()&w:l.WellKnownMimeType.UNPARSEABLE_MIME_TYPE.identifier,d=l.WellKnownMimeType.fromIdentifier(u),l.WellKnownMimeType.UNKNOWN_RESERVED_MIME_TYPE!==d?[3,5]:[4,new v(o,u)];case 4:return n.sent(),[3,1];case 5:return[4,new b(o,d)];case 6:return n.sent(),[3,1];case 7:return[2]}var h,f})}t.CompositeMetadata=u,t.encodeCompositeMetadata=function(e){var t,r,n=i.allocUnsafe(0);try{for(var a=s(e),u=a.next();!u.done;u=a.next()){var c=o(u.value,2),p=c[0],f=c[1],m="function"==typeof f?f():f;n=p instanceof l.WellKnownMimeType||"number"==typeof p||"WellKnownMimeType"===p.constructor.name?h(n,p,m):d(n,p,m)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return n},t.encodeAndAddCustomMetadata=d,t.encodeAndAddWellKnownMetadata=h,t.decodeMimeAndContentBuffersSlices=c,t.decodeMimeTypeFromMimeBuffer=p,t.encodeCustomMetadataHeader=f,t.encodeWellKnownMetadataHeader=m,t.decodeCompositeMetadata=g;var y=function(e,t){this.content=e,this.type=t};t.ExplicitMimeTimeEntry=y;var v=function(){function e(e,t){this.content=e,this.type=t}return Object.defineProperty(e.prototype,"mimeType",{get:function(){},enumerable:!1,configurable:!0}),e}();t.ReservedMimeTypeEntry=v;var b=function(){function e(e,t){this.content=e,this.type=t}return Object.defineProperty(e.prototype,"mimeType",{get:function(){return this.type.string},enumerable:!1,configurable:!0}),e}();function I(e){return 1===e.byteLength}t.WellKnownMimeTypeEntry=b;var E=128,w=127},287:(e,t,r)=>{"use strict";const i=r(526),n=r(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=l,t.IS=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let i=a(r);const n=i.write(e,t);return n!==r&&(i=i.slice(0,n)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,r);const n=function(e){if(l.isBuffer(e)){const t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?a(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return d(e),a(e<0?0:0|f(e))}function c(e){const t=e.length<0?0:0|f(e.length),r=a(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(i,l.prototype),i}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return i?-1:K(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return F(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function y(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,i,n){let s,o=1,a=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){let i=-1;for(s=r;s<a;s++)if(u(e,s)===u(t,-1===i?0:s-i)){if(-1===i&&(i=s),s-i+1===l)return i*o}else-1!==i&&(s-=s-i),i=-1}else for(r+l>a&&(r=a-l),s=r;s>=0;s--){let r=!0;for(let i=0;i<l;i++)if(u(e,s+i)!==u(t,i)){r=!1;break}if(r)return s}return-1}function I(e,t,r,i){r=Number(r)||0;const n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;const s=t.length;let o;for(i>s/2&&(i=s/2),o=0;o<i;++o){const i=parseInt(t.substr(2*o,2),16);if(J(i))return o;e[r+o]=i}return o}function E(e,t,r,i){return Y(K(t,e.length-r),e,r,i)}function w(e,t,r,i){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function S(e,t,r,i){return Y(H(t),e,r,i)}function M(e,t,r,i){return Y(function(e,t){let r,i,n;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}(t,e.length-r),e,r,i)}function k(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function F(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n<r;){const t=e[n];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(n+o<=r){let r,i,a,l;switch(o){case 1:t<128&&(s=t);break;case 2:r=e[n+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(s=l));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(l=(15&t)<<12|(63&r)<<6|63&i,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:r=e[n+1],i=e[n+2],a=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&a,l>65535&&l<1114112&&(s=l))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),n+=o}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=T));return r}(i)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return d(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(X(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,s=Math.min(r,i);n<s;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const i=l.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if(X(t,Uint8Array))n+t.length>i.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(i,n)):Uint8Array.prototype.set.call(i,t,n);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?F(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(e,t,r,i,n){if(X(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0);const a=Math.min(s,o),u=this.slice(i,n),d=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==d[e]){s=u[e],o=d[e];break}return s<o?-1:o<s?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},l.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return I(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function R(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function A(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function C(e,t,r){const i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=Z[e[i]];return n}function O(e,t,r){const i=e.slice(t,r);let n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,i,n,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function _(e,t,r,i,n){z(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function D(e,t,r,i,n){z(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function L(e,t,r,i,n,s){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(e,t,r,i,s){return t=+t,r>>>=0,s||L(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function U(e,t,r,i,s){return t=+t,r>>>=0,s||L(e,0,r,8),n.write(e,t,r,i,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,l.prototype),i},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return i},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Q(function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))}),l.prototype.readBigUInt64BE=Q(function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=t,n=1,s=this[e+--i];for(;i>0&&(n*=256);)s+=this[e+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*t)),s},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Q(function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),l.prototype.readBigInt64BE=Q(function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||x(this,e,t,r,Math.pow(2,8*r)-1,0);let n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||x(this,e,t,r,Math.pow(2,8*r)-1,0);let n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Q(function(e,t=0){return _(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Q(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=0,s=1,o=0;for(this[t]=255&e;++n<r&&(s*=256);)e<0&&0===o&&0!==this[t+n-1]&&(o=1),this[t+n]=(e/s|0)-o&255;return t+r},l.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[t+n]=255&e;--n>=0&&(s*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/s|0)-o&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Q(function(e,t=0){return _(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Q(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,r){return P(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return P(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,i){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);const n=i-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,i):Uint8Array.prototype.set.call(e,this.subarray(r,i),t),n},l.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const s=l.isBuffer(e)?e:l.from(e,i),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=s[n%o]}return this};const j={};function B(e,t,r){j[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function z(e,t,r,i,n,s){if(e>r||e<t){const i="bigint"==typeof t?"n":"";let n;throw n=s>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new j.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(i,n,s)}function G(e,t){if("number"!=typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw G(e,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),B("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),B("ERR_OUT_OF_RANGE",function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=W(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=W(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i},RangeError);const q=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const i=e.length;let n=null;const s=[];for(let o=0;o<i;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function H(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function Q(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},318:function(e,t,r){"use strict";var i,n=r(287).hp,s=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketDuplexConnection=void 0;var o=r(225),a=function(e){function t(t,r,i){var s=e.call(this)||this;return s.websocket=t,s.deserializer=r,s.handleClosed=function(e){s.close(new Error(e.reason||"WebsocketDuplexConnection: Socket closed unexpectedly."))},s.handleError=function(e){s.close(e.error)},s.handleMessage=function(e){try{var t=n.from(e.data),r=s.deserializer.deserializeFrame(t);s.multiplexerDemultiplexer.handle(r)}catch(e){s.close(e)}},t.addEventListener("close",s.handleClosed),t.addEventListener("error",s.handleError),t.addEventListener("message",s.handleMessage),s.multiplexerDemultiplexer=i(s),s}return s(t,e),Object.defineProperty(t.prototype,"availability",{get:function(){return this.done?0:1},enumerable:!1,configurable:!0}),t.prototype.close=function(t){this.done||(this.websocket.removeEventListener("close",this.handleClosed),this.websocket.removeEventListener("error",this.handleError),this.websocket.removeEventListener("message",this.handleMessage),this.websocket.close(),delete this.websocket),e.prototype.close.call(this,t)},t.prototype.send=function(e){if(!this.done){var t=(0,o.serializeFrame)(e);this.websocket.send(t)}},t}(o.Deferred);t.WebsocketDuplexConnection=a},320:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestFnfResponderStream=t.RequestFnFRequesterStream=void 0;var a=r(766),l=r(438),u=r(799),d=s(r(76)),h=function(){function e(e,t,r,i){this.payload=e,this.receiver=t,this.fragmentSize=r,this.leaseManager=i,this.streamType=u.FrameTypes.REQUEST_FNF}return e.prototype.handleReady=function(e,t){var r,i;if(this.done)return!1;if(this.streamId=e,(0,l.isFragmentable)(this.payload,this.fragmentSize,u.FrameTypes.REQUEST_FNF))try{for(var n=o((0,l.fragment)(e,this.payload,this.fragmentSize,u.FrameTypes.REQUEST_FNF)),s=n.next();!s.done;s=n.next()){var a=s.value;t.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else t.send({type:u.FrameTypes.REQUEST_FNF,data:this.payload.data,metadata:this.payload.metadata,flags:this.payload.metadata?u.Flags.METADATA:0,streamId:e});return this.done=!0,this.receiver.onComplete(),!0},e.prototype.handleReject=function(e){this.done||(this.done=!0,this.receiver.onError(e))},e.prototype.cancel=function(){var e;this.done||(this.done=!0,null===(e=this.leaseManager)||void 0===e||e.cancelRequest(this))},e.prototype.handle=function(e){e.type!=u.FrameTypes.ERROR?this.close(new a.RSocketError(a.ErrorCodes.CANCELED,"Received invalid frame")):this.close(new a.RSocketError(e.code,e.message))},e.prototype.close=function(e){this.done?console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):e?this.receiver.onError(e):this.receiver.onComplete()},e}();t.RequestFnFRequesterStream=h;var c=function(){function e(e,t,r,i){if(this.streamId=e,this.stream=t,this.handler=r,this.streamType=u.FrameTypes.REQUEST_FNF,u.Flags.hasFollows(i.flags))return d.add(this,i.data,i.metadata),void t.connect(this);var n={data:i.data,metadata:i.metadata};try{this.cancellable=r(n,this)}catch(e){}}return e.prototype.handle=function(e){var t;if(e.type==u.FrameTypes.PAYLOAD){if(!u.Flags.hasFollows(e.flags)){this.stream.disconnect(this);var r=d.reassemble(this,e.data,e.metadata);try{this.cancellable=this.handler(r,this)}catch(e){}return}if(d.add(this,e.data,e.metadata))return;t="Unexpected fragment size"}else t="Unexpected frame type [".concat(e.type,"]");this.done=!0,e.type!=u.FrameTypes.CANCEL&&e.type!=u.FrameTypes.ERROR&&this.stream.send({type:u.FrameTypes.ERROR,streamId:this.streamId,flags:u.Flags.NONE,code:a.ErrorCodes.CANCELED,message:t}),this.stream.disconnect(this),d.cancel(this)},e.prototype.close=function(e){var t;this.done?console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(this.done=!0,d.cancel(this),null===(t=this.cancellable)||void 0===t||t.cancel())},e.prototype.onError=function(e){},e.prototype.onComplete=function(){},e}();t.RequestFnfResponderStream=c},339:function(e,t,r){var i="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){e!=Array.prototype&&e!=Object.prototype&&(e[t]=r.value)},n="undefined"!=typeof window&&window===this?this:void 0!==r.g&&null!=r.g?r.g:this;function s(){s=function(){},n.Symbol||(n.Symbol=l)}function o(e,t){this.a=e,i(this,"description",{configurable:!0,writable:!0,value:t})}o.prototype.toString=function(){return this.a};var a,l=(a=0,function e(t){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new o("jscomp_symbol_"+(t||"")+"_"+a++,t)});function u(){s();var e=n.Symbol.iterator;e||(e=n.Symbol.iterator=n.Symbol("Symbol.iterator")),"function"!=typeof Array.prototype[e]&&i(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return function(e){return u(),(e={next:e})[n.Symbol.iterator]=function(){return this},e}(function(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}(this))}}),u=function(){}}!function(e,t){if(t){var r=n;e=e.split(".");for(var s=0;s<e.length-1;s++){var o=e[s];o in r||(r[o]={}),r=r[o]}(t=t(s=r[e=e[e.length-1]]))!=s&&null!=t&&i(r,e,{configurable:!0,writable:!0,value:t})}}("Array.prototype.entries",function(e){return e||function(){return function(e,t){u(),e instanceof String&&(e+="");var r=0,i={next:function(){if(r<e.length){var n=r++;return{value:t(n,e[n]),done:!1}}return i.next=function(){return{done:!0,value:void 0}},i.next()}};return i[Symbol.iterator]=function(){return i},i}(this,function(e,t){return[e,t]})}});var d=this||self;function h(e,t,r){e=e.split("."),r=r||d,e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(var i;e.length&&(i=e.shift());)e.length||void 0===t?r=r[i]&&r[i]!==Object.prototype[i]?r[i]:r[i]={}:r[i]=t}function c(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var r=Object.prototype.toString.call(e);if("[object Window]"==r)return"object";if("[object Array]"==r||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==r||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t}function p(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var f="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),m=Array.prototype.forEach?function(e,t){Array.prototype.forEach.call(e,t,void 0)}:function(e,t){for(var r=e.length,i="string"==typeof e?e.split(""):e,n=0;n<r;n++)n in i&&t.call(void 0,i[n],n,e)},g=Array.prototype.map?function(e,t){return Array.prototype.map.call(e,t,void 0)}:function(e,t){for(var r=e.length,i=Array(r),n="string"==typeof e?e.split(""):e,s=0;s<r;s++)s in n&&(i[s]=t.call(void 0,n[s],s,e));return i};function y(e,t,r){return 2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,r)}function v(e,t,r,i){var n="Assertion failed";if(r){n+=": "+r;var s=i}else e&&(n+=": "+e,s=t);throw Error(n,s||[])}function b(e,t,r){for(var i=[],n=2;n<arguments.length;++n)i[n-2]=arguments[n];return e||v("",null,t,i),e}function I(e,t){for(var r=[],i=1;i<arguments.length;++i)r[i-1]=arguments[i];throw Error("Failure"+(e?": "+e:""),r)}function E(e,t,r,i){for(var n=[],s=3;s<arguments.length;++s)n[s-3]=arguments[s];e instanceof t||v("Expected instanceof %s but got %s.",[w(t),w(e)],r,n)}function w(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):null===e?"null":typeof e}function S(e,t){if(this.c=e,this.b=t,this.a={},this.arrClean=!0,0<this.c.length){for(e=0;e<this.c.length;e++){var r=(t=this.c[e])[0];this.a[r.toString()]=new T(r,t[1])}this.arrClean=!0}}function M(e){this.a=0,this.b=e}function k(e,t){return e.b?(t.a||(t.a=new e.b(t.value)),t.a):t.value}function F(e){e=e.a;var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r}function T(e,t){this.key=e,this.value=t,this.a=void 0}function R(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",r=0;r<e.length;r+=8192)t+=String.fromCharCode.apply(null,y(e,r,r+8192));return t}h("jspb.Map",S,void 0),S.prototype.g=function(){if(this.arrClean){if(this.b){var e,t=this.a;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e].a;r&&r.g()}}}else{for(this.c.length=0,(t=F(this)).sort(),e=0;e<t.length;e++){var i=this.a[t[e]];(r=i.a)&&r.g(),this.c.push([i.key,i.value])}this.arrClean=!0}return this.c},S.prototype.toArray=S.prototype.g,S.prototype.Mc=function(e,t){for(var r=this.g(),i=[],n=0;n<r.length;n++){var s=this.a[r[n][0].toString()];k(this,s);var o=s.a;o?(b(t),i.push([s.key,t(e,o)])):i.push([s.key,s.value])}return i},S.prototype.toObject=S.prototype.Mc,S.fromObject=function(e,t,r){t=new S([],t);for(var i=0;i<e.length;i++){var n=e[i][0],s=r(e[i][1]);t.set(n,s)}return t},M.prototype.next=function(){return this.a<this.b.length?{done:!1,value:this.b[this.a++]}:{done:!0,value:void 0}},"undefined"!=typeof Symbol&&(M.prototype[Symbol.iterator]=function(){return this}),S.prototype.Jb=function(){return F(this).length},S.prototype.getLength=S.prototype.Jb,S.prototype.clear=function(){this.a={},this.arrClean=!1},S.prototype.clear=S.prototype.clear,S.prototype.Cb=function(e){e=e.toString();var t=this.a.hasOwnProperty(e);return delete this.a[e],this.arrClean=!1,t},S.prototype.del=S.prototype.Cb,S.prototype.Eb=function(){var e=[],t=F(this);t.sort();for(var r=0;r<t.length;r++){var i=this.a[t[r]];e.push([i.key,i.value])}return e},S.prototype.getEntryList=S.prototype.Eb,S.prototype.entries=function(){var e=[],t=F(this);t.sort();for(var r=0;r<t.length;r++){var i=this.a[t[r]];e.push([i.key,k(this,i)])}return new M(e)},S.prototype.entries=S.prototype.entries,S.prototype.keys=function(){var e=[],t=F(this);t.sort();for(var r=0;r<t.length;r++)e.push(this.a[t[r]].key);return new M(e)},S.prototype.keys=S.prototype.keys,S.prototype.values=function(){var e=[],t=F(this);t.sort();for(var r=0;r<t.length;r++)e.push(k(this,this.a[t[r]]));return new M(e)},S.prototype.values=S.prototype.values,S.prototype.forEach=function(e,t){var r=F(this);r.sort();for(var i=0;i<r.length;i++){var n=this.a[r[i]];e.call(t,k(this,n),n.key,this)}},S.prototype.forEach=S.prototype.forEach,S.prototype.set=function(e,t){var r=new T(e);return this.b?(r.a=t,r.value=t.g()):r.value=t,this.a[e.toString()]=r,this.arrClean=!1,this},S.prototype.set=S.prototype.set,S.prototype.get=function(e){if(e=this.a[e.toString()])return k(this,e)},S.prototype.get=S.prototype.get,S.prototype.has=function(e){return e.toString()in this.a},S.prototype.has=S.prototype.has,S.prototype.Jc=function(e,t,r,i,n){var s=F(this);s.sort();for(var o=0;o<s.length;o++){var a=this.a[s[o]];t.Va(e),r.call(t,1,a.key),this.b?i.call(t,2,k(this,a),n):i.call(t,2,a.value),t.Ya()}},S.prototype.serializeBinary=S.prototype.Jc,S.deserializeBinary=function(e,t,r,i,n,s,o){for(;t.oa()&&!t.bb();){var a=t.c;1==a?s=r.call(t):2==a&&(e.b?(b(n),o||(o=new e.b),i.call(t,o,n)):o=i.call(t))}b(null!=s),b(null!=o),e.set(s,o)};var A={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},C={"'":"\\'"},O={},N=null;function x(e,t){void 0===t&&(t=0),D(),t=O[t];for(var r=[],i=0;i<e.length;i+=3){var n=e[i],s=i+1<e.length,o=s?e[i+1]:0,a=i+2<e.length,l=a?e[i+2]:0,u=n>>2;n=(3&n)<<4|o>>4,o=(15&o)<<2|l>>6,l&=63,a||(l=64,s||(o=64)),r.push(t[u],t[n],t[o]||"",t[l]||"")}return r.join("")}function _(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):-1!="=.".indexOf(e[t-1])&&(r=-1!="=.".indexOf(e[t-2])?r-2:r-1);var i=new Uint8Array(r),n=0;return function(e,t){function r(t){for(;i<e.length;){var r=e.charAt(i++),n=N[r];if(null!=n)return n;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return t}D();for(var i=0;;){var n=r(-1),s=r(0),o=r(64),a=r(64);if(64===a&&-1===n)break;t(n<<2|s>>4),64!=o&&(t(s<<4&240|o>>2),64!=a&&t(o<<6&192|a))}}(e,function(e){i[n++]=e}),i.subarray(0,n)}function D(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var i=e.concat(t[r].split(""));O[r]=i;for(var n=0;n<i.length;n++){var s=i[n];void 0===N[s]&&(N[s]=n)}}}}h("jspb.ConstBinaryMessage",function(){},void 0),h("jspb.BinaryMessage",function(){},void 0),h("jspb.BinaryConstants.FieldType",{yb:-1,ee:1,FLOAT:2,ke:3,te:4,je:5,xb:6,wb:7,BOOL:8,re:9,ie:10,le:11,ce:12,se:13,ge:14,me:15,ne:16,oe:17,pe:18,he:30,ve:31},void 0),h("jspb.BinaryConstants.WireType",{yb:-1,ue:0,xb:1,de:2,qe:3,fe:4,wb:5},void 0),h("jspb.BinaryConstants.FieldTypeToWireType",function(e){switch(e){case 5:case 3:case 13:case 4:case 17:case 18:case 8:case 14:case 31:return 0;case 1:case 6:case 16:case 30:return 1;case 9:case 11:case 12:return 2;case 2:case 7:case 15:return 5;default:return-1}},void 0),h("jspb.BinaryConstants.INVALID_FIELD_NUMBER",-1,void 0),h("jspb.BinaryConstants.FLOAT32_EPS",1401298464324817e-60,void 0),h("jspb.BinaryConstants.FLOAT32_MIN",11754943508222875e-54,void 0),h("jspb.BinaryConstants.FLOAT32_MAX",34028234663852886e22,void 0),h("jspb.BinaryConstants.FLOAT64_EPS",5e-324,void 0),h("jspb.BinaryConstants.FLOAT64_MIN",22250738585072014e-324,void 0),h("jspb.BinaryConstants.FLOAT64_MAX",17976931348623157e292,void 0),h("jspb.BinaryConstants.TWO_TO_20",1048576,void 0),h("jspb.BinaryConstants.TWO_TO_23",8388608,void 0),h("jspb.BinaryConstants.TWO_TO_31",2147483648,void 0),h("jspb.BinaryConstants.TWO_TO_32",4294967296,void 0),h("jspb.BinaryConstants.TWO_TO_52",4503599627370496,void 0),h("jspb.BinaryConstants.TWO_TO_63",0x8000000000000000,void 0),h("jspb.BinaryConstants.TWO_TO_64",0x10000000000000000,void 0),h("jspb.BinaryConstants.ZERO_HASH","\0\0\0\0\0\0\0\0",void 0);var L=0,P=0;function U(e){var t=e>>>0;e=Math.floor((e-t)/4294967296)>>>0,L=t,P=e}function j(e){var t=0>e,r=(e=Math.abs(e))>>>0;e=Math.floor((e-r)/4294967296),e>>>=0,t&&(e=~e>>>0,4294967295<(r=(~r>>>0)+1)&&(r=0,4294967295<++e&&(e=0))),L=r,P=e}function B(e){var t=0>e;U(e=2*Math.abs(e)),e=L;var r=P;t&&(0==e?0==r?r=e=4294967295:(r--,e=4294967295):e--),L=e,P=r}function W(e){var t=0>e?1:0;if(0===(e=t?-e:e))0<1/e?L=P=0:(P=0,L=2147483648);else if(isNaN(e))P=0,L=2147483647;else if(34028234663852886e22<e)P=0,L=(t<<31|2139095040)>>>0;else if(11754943508222875e-54>e)e=Math.round(e/Math.pow(2,-149)),P=0,L=(t<<31|e)>>>0;else{var r=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-r),16777216<=(e=Math.round(8388608*e))&&++r,P=0,L=(t<<31|r+127<<23|8388607&e)>>>0}}function z(e){var t=0>e?1:0;if(0===(e=t?-e:e))P=0<1/e?0:2147483648,L=0;else if(isNaN(e))P=2147483647,L=4294967295;else if(17976931348623157e292<e)P=(t<<31|2146435072)>>>0,L=0;else if(22250738585072014e-324>e)e/=Math.pow(2,-1074),P=(t<<31|e/4294967296)>>>0,L=e>>>0;else{var r=e,i=0;if(2<=r)for(;2<=r&&1023>i;)i++,r/=2;else for(;1>r&&-1022<i;)r*=2,i--;e*=Math.pow(2,-i),P=(t<<31|i+1023<<20|1048576*e&1048575)>>>0,L=4503599627370496*e>>>0}}function G(e){var t=e.charCodeAt(4),r=e.charCodeAt(5),i=e.charCodeAt(6),n=e.charCodeAt(7);L=e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)>>>0,P=t+(r<<8)+(i<<16)+(n<<24)>>>0}function V(e,t){return 4294967296*t+(e>>>0)}function q(e,t){var r=2147483648&t;return r&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=V(e,t),r?-e:e}function K(e,t,r){var i=t>>31;return r(e<<1^i,(t<<1|e>>>31)^i)}function H(e,t){return Y(e,t,q)}function Y(e,t,r){var i=-(1&e);return r((e>>>1|t<<31)^i,t>>>1^i)}function X(e){var t=2*(e>>31)+1,r=e>>>23&255;return e&=8388607,255==r?e?NaN:1/0*t:0==r?t*Math.pow(2,-149)*e:t*Math.pow(2,r-150)*(e+Math.pow(2,23))}function J(e,t){var r=2*(t>>31)+1,i=t>>>20&2047;return e=4294967296*(1048575&t)+e,2047==i?e?NaN:1/0*r:0==i?r*Math.pow(2,-1074)*e:r*Math.pow(2,i-1075)*(e+4503599627370496)}function Z(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)}function Q(e,t){function r(e,t){return e=e?String(e):"",t?"0000000".slice(e.length)+e:e}if(2097151>=t)return""+V(e,t);var i=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*i+6710656*(t=t>>16&65535),i+=8147497*t,t*=2,1e7<=e&&(i+=Math.floor(e/1e7),e%=1e7),1e7<=i&&(t+=Math.floor(i/1e7),i%=1e7),r(t,0)+r(i,t)+r(e,1)}function $(e,t){var r=2147483648&t;return r&&(t=~t+(0==(e=1+~e>>>0)?1:0)>>>0),e=Q(e,t),r?"-"+e:e}function ee(e,t){G(e),e=L;var r=P;return t?$(e,r):Q(e,r)}function te(e){function t(e,t){for(var r=0;8>r&&(1!==e||0<t);r++)t=e*i[r]+t,i[r]=255&t,t>>>=8}b(0<e.length);var r=!1;"-"===e[0]&&(r=!0,e=e.slice(1));for(var i=[0,0,0,0,0,0,0,0],n=0;n<e.length;n++)t(10,e.charCodeAt(n)-48);return r&&(function(){for(var e=0;8>e;e++)i[e]=255&~i[e]}(),t(1,1)),R(i)}function re(e){return String.fromCharCode(10>e?48+e:87+e)}function ie(e){return 97<=e?e-97+10:e-48}function ne(e,t,r,i,n){var s=0;if(128>i)for(;t<r&&e[t++]==i;)s++,t+=n;else for(;t<r;){for(var o=i;128<o;){if(e[t++]!=(127&o|128))return s;o>>=7}if(e[t++]!=o)break;s++,t+=n}return s}function se(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?_(e):e instanceof Uint8Array?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):(I("Type not convertible to Uint8Array."),new Uint8Array(0))}function oe(e,t,r){this.b=null,this.a=this.c=this.h=0,this.v=!1,e&&this.H(e,t,r)}h("jspb.utils.getSplit64Low",function(){return L},void 0),h("jspb.utils.getSplit64High",function(){return P},void 0),h("jspb.utils.splitUint64",U,void 0),h("jspb.utils.splitInt64",j,void 0),h("jspb.utils.splitZigzag64",B,void 0),h("jspb.utils.splitFloat32",W,void 0),h("jspb.utils.splitFloat64",z,void 0),h("jspb.utils.splitHash64",G,void 0),h("jspb.utils.joinUint64",V,void 0),h("jspb.utils.joinInt64",q,void 0),h("jspb.utils.toZigzag64",K,void 0),h("jspb.utils.joinZigzag64",H,void 0),h("jspb.utils.fromZigzag64",Y,void 0),h("jspb.utils.joinFloat32",X,void 0),h("jspb.utils.joinFloat64",J,void 0),h("jspb.utils.joinHash64",Z,void 0),h("jspb.utils.DIGITS","0123456789abcdef".split(""),void 0),h("jspb.utils.joinUnsignedDecimalString",Q,void 0),h("jspb.utils.joinSignedDecimalString",$,void 0),h("jspb.utils.hash64ToDecimalString",ee,void 0),h("jspb.utils.hash64ArrayToDecimalStrings",function(e,t){for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=ee(e[i],t);return r},void 0),h("jspb.utils.decimalStringToHash64",te,void 0),h("jspb.utils.splitDecimalString",function(e){G(te(e))},void 0),h("jspb.utils.hash64ToHexString",function(e){var t=Array(18);t[0]="0",t[1]="x";for(var r=0;8>r;r++){var i=e.charCodeAt(7-r);t[2*r+2]=re(i>>4),t[2*r+3]=re(15&i)}return t.join("")},void 0),h("jspb.utils.hexStringToHash64",function(e){b(18==(e=e.toLowerCase()).length),b("0"==e[0]),b("x"==e[1]);for(var t="",r=0;8>r;r++)t=String.fromCharCode(16*ie(e.charCodeAt(2*r+2))+ie(e.charCodeAt(2*r+3)))+t;return t},void 0),h("jspb.utils.hash64ToNumber",function(e,t){G(e),e=L;var r=P;return t?q(e,r):V(e,r)},void 0),h("jspb.utils.numberToHash64",function(e){return j(e),Z(L,P)},void 0),h("jspb.utils.countVarints",function(e,t,r){for(var i=0,n=t;n<r;n++)i+=e[n]>>7;return r-t-i},void 0),h("jspb.utils.countVarintFields",function(e,t,r,i){var n=0;if(128>(i*=8))for(;t<r&&e[t++]==i;)for(n++;;){var s=e[t++];if(!(128&s))break}else for(;t<r;){for(s=i;128<s;){if(e[t]!=(127&s|128))return n;t++,s>>=7}if(e[t++]!=s)break;for(n++;128&(s=e[t++]););}return n},void 0),h("jspb.utils.countFixed32Fields",function(e,t,r,i){return ne(e,t,r,8*i+5,4)},void 0),h("jspb.utils.countFixed64Fields",function(e,t,r,i){return ne(e,t,r,8*i+1,8)},void 0),h("jspb.utils.countDelimitedFields",function(e,t,r,i){var n=0;for(i=8*i+2;t<r;){for(var s=i;128<s;){if(e[t++]!=(127&s|128))return n;s>>=7}if(e[t++]!=s)break;n++;for(var o=0,a=1;o+=(127&(s=e[t++]))*a,a*=128,128&s;);t+=o}return n},void 0),h("jspb.utils.debugBytesToTextFormat",function(e){var t='"';if(e){e=se(e);for(var r=0;r<e.length;r++)t+="\\x",16>e[r]&&(t+="0"),t+=e[r].toString(16)}return t+'"'},void 0),h("jspb.utils.debugScalarToTextFormat",function(e){if("string"==typeof e){e=String(e);for(var t=['"'],r=0;r<e.length;r++){var i,n=e.charAt(r),s=n.charCodeAt(0),o=r+1;(i=A[n])||(31<s&&127>s||((s=n)in C?n=C[s]:s in A?n=C[s]=A[s]:(31<(i=s.charCodeAt(0))&&127>i?n=s:(256>i?(n="\\x",(16>i||256<i)&&(n+="0")):(n="\\u",4096>i&&(n+="0")),n+=i.toString(16).toUpperCase()),n=C[s]=n)),i=n),t[o]=i}t.push('"'),e=t.join("")}else e=e.toString();return e},void 0),h("jspb.utils.stringToByteArray",function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++){var i=e.charCodeAt(r);if(255<i)throw Error("Conversion error: string contains codepoint outside of byte range");t[r]=i}return t},void 0),h("jspb.utils.byteSourceToUint8Array",se,void 0),h("jspb.BinaryDecoder",oe,void 0);var ae=[];function le(e,t,r){if(ae.length){var i=ae.pop();return e&&i.H(e,t,r),i}return new oe(e,t,r)}function ue(e,t,r){this.a=le(e,t,r),this.O=this.a.B(),this.b=this.c=-1,this.h=!1,this.v=null}oe.getInstanceCacheLength=function(){return ae.length},oe.alloc=le,oe.prototype.Ca=function(){this.clear(),100>ae.length&&ae.push(this)},oe.prototype.free=oe.prototype.Ca,oe.prototype.clone=function(){return le(this.b,this.h,this.c-this.h)},oe.prototype.clone=oe.prototype.clone,oe.prototype.clear=function(){this.b=null,this.a=this.c=this.h=0,this.v=!1},oe.prototype.clear=oe.prototype.clear,oe.prototype.Y=function(){return this.b},oe.prototype.getBuffer=oe.prototype.Y,oe.prototype.H=function(e,t,r){this.b=se(e),this.h=void 0!==t?t:0,this.c=void 0!==r?this.h+r:this.b.length,this.a=this.h},oe.prototype.setBlock=oe.prototype.H,oe.prototype.Db=function(){return this.c},oe.prototype.getEnd=oe.prototype.Db,oe.prototype.setEnd=function(e){this.c=e},oe.prototype.setEnd=oe.prototype.setEnd,oe.prototype.reset=function(){this.a=this.h},oe.prototype.reset=oe.prototype.reset,oe.prototype.B=function(){return this.a},oe.prototype.getCursor=oe.prototype.B,oe.prototype.Ma=function(e){this.a=e},oe.prototype.setCursor=oe.prototype.Ma,oe.prototype.advance=function(e){this.a+=e,b(this.a<=this.c)},oe.prototype.advance=oe.prototype.advance,oe.prototype.ya=function(){return this.a==this.c},oe.prototype.atEnd=oe.prototype.ya,oe.prototype.Qb=function(){return this.a>this.c},oe.prototype.pastEnd=oe.prototype.Qb,oe.prototype.getError=function(){return this.v||0>this.a||this.a>this.c},oe.prototype.getError=oe.prototype.getError,oe.prototype.w=function(e){for(var t=128,r=0,i=0,n=0;4>n&&128<=t;n++)r|=(127&(t=this.b[this.a++]))<<7*n;if(128<=t&&(r|=(127&(t=this.b[this.a++]))<<28,i|=(127&t)>>4),128<=t)for(n=0;5>n&&128<=t;n++)i|=(127&(t=this.b[this.a++]))<<7*n+3;if(128>t)return e(r>>>0,i>>>0);I("Failed to read varint, encoding is invalid."),this.v=!0},oe.prototype.readSplitVarint64=oe.prototype.w,oe.prototype.ea=function(e){return this.w(function(t,r){return Y(t,r,e)})},oe.prototype.readSplitZigzagVarint64=oe.prototype.ea,oe.prototype.ta=function(e){var t=this.b,r=this.a;this.a+=8;for(var i=0,n=0,s=r+7;s>=r;s--)i=i<<8|t[s],n=n<<8|t[s+4];return e(i,n)},oe.prototype.readSplitFixed64=oe.prototype.ta,oe.prototype.kb=function(){for(;128&this.b[this.a];)this.a++;this.a++},oe.prototype.skipVarint=oe.prototype.kb,oe.prototype.mb=function(e){for(;128<e;)this.a--,e>>>=7;this.a--},oe.prototype.unskipVarint=oe.prototype.mb,oe.prototype.o=function(){var e=this.b,t=e[this.a],r=127&t;return 128>t?(this.a+=1,b(this.a<=this.c),r):(r|=(127&(t=e[this.a+1]))<<7,128>t?(this.a+=2,b(this.a<=this.c),r):(r|=(127&(t=e[this.a+2]))<<14,128>t?(this.a+=3,b(this.a<=this.c),r):(r|=(127&(t=e[this.a+3]))<<21,128>t?(this.a+=4,b(this.a<=this.c),r):(r|=(15&(t=e[this.a+4]))<<28,128>t?(this.a+=5,b(this.a<=this.c),r>>>0):(this.a+=5,128<=e[this.a++]&&128<=e[this.a++]&&128<=e[this.a++]&&128<=e[this.a++]&&128<=e[this.a++]&&b(!1),b(this.a<=this.c),r)))))},oe.prototype.readUnsignedVarint32=oe.prototype.o,oe.prototype.da=function(){return~~this.o()},oe.prototype.readSignedVarint32=oe.prototype.da,oe.prototype.O=function(){return this.o().toString()},oe.prototype.Ea=function(){return this.da().toString()},oe.prototype.readSignedVarint32String=oe.prototype.Ea,oe.prototype.Ia=function(){var e=this.o();return e>>>1^-(1&e)},oe.prototype.readZigzagVarint32=oe.prototype.Ia,oe.prototype.Ga=function(){return this.w(V)},oe.prototype.readUnsignedVarint64=oe.prototype.Ga,oe.prototype.Ha=function(){return this.w(Q)},oe.prototype.readUnsignedVarint64String=oe.prototype.Ha,oe.prototype.sa=function(){return this.w(q)},oe.prototype.readSignedVarint64=oe.prototype.sa,oe.prototype.Fa=function(){return this.w($)},oe.prototype.readSignedVarint64String=oe.prototype.Fa,oe.prototype.Ja=function(){return this.w(H)},oe.prototype.readZigzagVarint64=oe.prototype.Ja,oe.prototype.fb=function(){return this.ea(Z)},oe.prototype.readZigzagVarintHash64=oe.prototype.fb,oe.prototype.Ka=function(){return this.ea($)},oe.prototype.readZigzagVarint64String=oe.prototype.Ka,oe.prototype.Gc=function(){var e=this.b[this.a];return this.a+=1,b(this.a<=this.c),e},oe.prototype.readUint8=oe.prototype.Gc,oe.prototype.Ec=function(){var e=this.b[this.a],t=this.b[this.a+1];return this.a+=2,b(this.a<=this.c),e|t<<8},oe.prototype.readUint16=oe.prototype.Ec,oe.prototype.m=function(){var e=this.b[this.a],t=this.b[this.a+1],r=this.b[this.a+2],i=this.b[this.a+3];return this.a+=4,b(this.a<=this.c),(e|t<<8|r<<16|i<<24)>>>0},oe.prototype.readUint32=oe.prototype.m,oe.prototype.ga=function(){return V(this.m(),this.m())},oe.prototype.readUint64=oe.prototype.ga,oe.prototype.ha=function(){return Q(this.m(),this.m())},oe.prototype.readUint64String=oe.prototype.ha,oe.prototype.Xb=function(){var e=this.b[this.a];return this.a+=1,b(this.a<=this.c),e<<24>>24},oe.prototype.readInt8=oe.prototype.Xb,oe.prototype.Vb=function(){var e=this.b[this.a],t=this.b[this.a+1];return this.a+=2,b(this.a<=this.c),(e|t<<8)<<16>>16},oe.prototype.readInt16=oe.prototype.Vb,oe.prototype.P=function(){var e=this.b[this.a],t=this.b[this.a+1],r=this.b[this.a+2],i=this.b[this.a+3];return this.a+=4,b(this.a<=this.c),e|t<<8|r<<16|i<<24},oe.prototype.readInt32=oe.prototype.P,oe.prototype.ba=function(){return q(this.m(),this.m())},oe.prototype.readInt64=oe.prototype.ba,oe.prototype.ca=function(){return $(this.m(),this.m())},oe.prototype.readInt64String=oe.prototype.ca,oe.prototype.aa=function(){return X(this.m())},oe.prototype.readFloat=oe.prototype.aa,oe.prototype.Z=function(){return J(this.m(),this.m())},oe.prototype.readDouble=oe.prototype.Z,oe.prototype.pa=function(){return!!this.b[this.a++]},oe.prototype.readBool=oe.prototype.pa,oe.prototype.ra=function(){return this.da()},oe.prototype.readEnum=oe.prototype.ra,oe.prototype.fa=function(e){var t=this.b,r=this.a;e=r+e;for(var i=[],n="";r<e;){var s=t[r++];if(128>s)i.push(s);else{if(192>s)continue;if(224>s){var o=t[r++];i.push((31&s)<<6|63&o)}else if(240>s){o=t[r++];var a=t[r++];i.push((15&s)<<12|(63&o)<<6|63&a)}else 248>s&&(s=(7&s)<<18|(63&(o=t[r++]))<<12|(63&(a=t[r++]))<<6|63&t[r++],s-=65536,i.push(55296+(s>>10&1023),56320+(1023&s)))}8192<=i.length&&(n+=String.fromCharCode.apply(null,i),i.length=0)}return n+=R(i),this.a=r,n},oe.prototype.readString=oe.prototype.fa,oe.prototype.Dc=function(){var e=this.o();return this.fa(e)},oe.prototype.readStringWithLength=oe.prototype.Dc,oe.prototype.qa=function(e){if(0>e||this.a+e>this.b.length)return this.v=!0,I("Invalid byte length!"),new Uint8Array(0);var t=this.b.subarray(this.a,this.a+e);return this.a+=e,b(this.a<=this.c),t},oe.prototype.readBytes=oe.prototype.qa,oe.prototype.ia=function(){return this.w(Z)},oe.prototype.readVarintHash64=oe.prototype.ia,oe.prototype.$=function(){var e=this.b,t=this.a,r=e[t],i=e[t+1],n=e[t+2],s=e[t+3],o=e[t+4],a=e[t+5],l=e[t+6];return e=e[t+7],this.a+=8,String.fromCharCode(r,i,n,s,o,a,l,e)},oe.prototype.readFixedHash64=oe.prototype.$,h("jspb.BinaryReader",ue,void 0);var de=[];function he(e,t,r){if(de.length){var i=de.pop();return e&&i.a.H(e,t,r),i}return new ue(e,t,r)}function ce(e,t){b(2==e.b);var r=e.a.o();r=e.a.B()+r;for(var i=[];e.a.B()<r;)i.push(t.call(e.a));return i}function pe(e,t,r,i,n){this.ma=e,this.Ba=t,this.la=r,this.Na=i,this.na=n}function fe(e,t,r,i,n,s){this.Za=e,this.za=t,this.Aa=r,this.Wa=i,this.Ab=n,this.Nb=s}function me(){}ue.clearInstanceCache=function(){de=[]},ue.getInstanceCacheLength=function(){return de.length},ue.alloc=he,ue.prototype.zb=he,ue.prototype.alloc=ue.prototype.zb,ue.prototype.Ca=function(){this.a.clear(),this.b=this.c=-1,this.h=!1,this.v=null,100>de.length&&de.push(this)},ue.prototype.free=ue.prototype.Ca,ue.prototype.Fb=function(){return this.O},ue.prototype.getFieldCursor=ue.prototype.Fb,ue.prototype.B=function(){return this.a.B()},ue.prototype.getCursor=ue.prototype.B,ue.prototype.Y=function(){return this.a.Y()},ue.prototype.getBuffer=ue.prototype.Y,ue.prototype.Hb=function(){return this.c},ue.prototype.getFieldNumber=ue.prototype.Hb,ue.prototype.Lb=function(){return this.b},ue.prototype.getWireType=ue.prototype.Lb,ue.prototype.Mb=function(){return 2==this.b},ue.prototype.isDelimited=ue.prototype.Mb,ue.prototype.bb=function(){return 4==this.b},ue.prototype.isEndGroup=ue.prototype.bb,ue.prototype.getError=function(){return this.h||this.a.getError()},ue.prototype.getError=ue.prototype.getError,ue.prototype.H=function(e,t,r){this.a.H(e,t,r),this.b=this.c=-1},ue.prototype.setBlock=ue.prototype.H,ue.prototype.reset=function(){this.a.reset(),this.b=this.c=-1},ue.prototype.reset=ue.prototype.reset,ue.prototype.advance=function(e){this.a.advance(e)},ue.prototype.advance=ue.prototype.advance,ue.prototype.oa=function(){if(this.a.ya())return!1;if(this.getError())return I("Decoder hit an error"),!1;this.O=this.a.B();var e=this.a.o(),t=e>>>3;return 0!=(e&=7)&&5!=e&&1!=e&&2!=e&&3!=e&&4!=e?(I("Invalid wire type: %s (at position %s)",e,this.O),this.h=!0,!1):(this.c=t,this.b=e,!0)},ue.prototype.nextField=ue.prototype.oa,ue.prototype.Oa=function(){this.a.mb(this.c<<3|this.b)},ue.prototype.unskipHeader=ue.prototype.Oa,ue.prototype.Lc=function(){var e=this.c;for(this.Oa();this.oa()&&this.c==e;)this.C();this.a.ya()||this.Oa()},ue.prototype.skipMatchingFields=ue.prototype.Lc,ue.prototype.lb=function(){0!=this.b?(I("Invalid wire type for skipVarintField"),this.C()):this.a.kb()},ue.prototype.skipVarintField=ue.prototype.lb,ue.prototype.gb=function(){if(2!=this.b)I("Invalid wire type for skipDelimitedField"),this.C();else{var e=this.a.o();this.a.advance(e)}},ue.prototype.skipDelimitedField=ue.prototype.gb,ue.prototype.hb=function(){5!=this.b?(I("Invalid wire type for skipFixed32Field"),this.C()):this.a.advance(4)},ue.prototype.skipFixed32Field=ue.prototype.hb,ue.prototype.ib=function(){1!=this.b?(I("Invalid wire type for skipFixed64Field"),this.C()):this.a.advance(8)},ue.prototype.skipFixed64Field=ue.prototype.ib,ue.prototype.jb=function(){for(var e=this.c;;){if(!this.oa()){I("Unmatched start-group tag: stream EOF"),this.h=!0;break}if(4==this.b){this.c!=e&&(I("Unmatched end-group tag"),this.h=!0);break}this.C()}},ue.prototype.skipGroup=ue.prototype.jb,ue.prototype.C=function(){switch(this.b){case 0:this.lb();break;case 1:this.ib();break;case 2:this.gb();break;case 5:this.hb();break;case 3:this.jb();break;default:I("Invalid wire encoding for field.")}},ue.prototype.skipField=ue.prototype.C,ue.prototype.Hc=function(e,t){null===this.v&&(this.v={}),b(!this.v[e]),this.v[e]=t},ue.prototype.registerReadCallback=ue.prototype.Hc,ue.prototype.Ic=function(e){return b(null!==this.v),b(e=this.v[e]),e(this)},ue.prototype.runReadCallback=ue.prototype.Ic,ue.prototype.Yb=function(e,t){b(2==this.b);var r=this.a.c,i=this.a.o();i=this.a.B()+i,this.a.setEnd(i),t(e,this),this.a.Ma(i),this.a.setEnd(r)},ue.prototype.readMessage=ue.prototype.Yb,ue.prototype.Ub=function(e,t,r){b(3==this.b),b(this.c==e),r(t,this),this.h||4==this.b||(I("Group submessage did not end with an END_GROUP tag"),this.h=!0)},ue.prototype.readGroup=ue.prototype.Ub,ue.prototype.Gb=function(){b(2==this.b);var e=this.a.o(),t=this.a.B(),r=t+e;return e=le(this.a.Y(),t,e),this.a.Ma(r),e},ue.prototype.getFieldDecoder=ue.prototype.Gb,ue.prototype.P=function(){return b(0==this.b),this.a.da()},ue.prototype.readInt32=ue.prototype.P,ue.prototype.Wb=function(){return b(0==this.b),this.a.Ea()},ue.prototype.readInt32String=ue.prototype.Wb,ue.prototype.ba=function(){return b(0==this.b),this.a.sa()},ue.prototype.readInt64=ue.prototype.ba,ue.prototype.ca=function(){return b(0==this.b),this.a.Fa()},ue.prototype.readInt64String=ue.prototype.ca,ue.prototype.m=function(){return b(0==this.b),this.a.o()},ue.prototype.readUint32=ue.prototype.m,ue.prototype.Fc=function(){return b(0==this.b),this.a.O()},ue.prototype.readUint32String=ue.prototype.Fc,ue.prototype.ga=function(){return b(0==this.b),this.a.Ga()},ue.prototype.readUint64=ue.prototype.ga,ue.prototype.ha=function(){return b(0==this.b),this.a.Ha()},ue.prototype.readUint64String=ue.prototype.ha,ue.prototype.zc=function(){return b(0==this.b),this.a.Ia()},ue.prototype.readSint32=ue.prototype.zc,ue.prototype.Ac=function(){return b(0==this.b),this.a.Ja()},ue.prototype.readSint64=ue.prototype.Ac,ue.prototype.Bc=function(){return b(0==this.b),this.a.Ka()},ue.prototype.readSint64String=ue.prototype.Bc,ue.prototype.Rb=function(){return b(5==this.b),this.a.m()},ue.prototype.readFixed32=ue.prototype.Rb,ue.prototype.Sb=function(){return b(1==this.b),this.a.ga()},ue.prototype.readFixed64=ue.prototype.Sb,ue.prototype.Tb=function(){return b(1==this.b),this.a.ha()},ue.prototype.readFixed64String=ue.prototype.Tb,ue.prototype.vc=function(){return b(5==this.b),this.a.P()},ue.prototype.readSfixed32=ue.prototype.vc,ue.prototype.wc=function(){return b(5==this.b),this.a.P().toString()},ue.prototype.readSfixed32String=ue.prototype.wc,ue.prototype.xc=function(){return b(1==this.b),this.a.ba()},ue.prototype.readSfixed64=ue.prototype.xc,ue.prototype.yc=function(){return b(1==this.b),this.a.ca()},ue.prototype.readSfixed64String=ue.prototype.yc,ue.prototype.aa=function(){return b(5==this.b),this.a.aa()},ue.prototype.readFloat=ue.prototype.aa,ue.prototype.Z=function(){return b(1==this.b),this.a.Z()},ue.prototype.readDouble=ue.prototype.Z,ue.prototype.pa=function(){return b(0==this.b),!!this.a.o()},ue.prototype.readBool=ue.prototype.pa,ue.prototype.ra=function(){return b(0==this.b),this.a.sa()},ue.prototype.readEnum=ue.prototype.ra,ue.prototype.fa=function(){b(2==this.b);var e=this.a.o();return this.a.fa(e)},ue.prototype.readString=ue.prototype.fa,ue.prototype.qa=function(){b(2==this.b);var e=this.a.o();return this.a.qa(e)},ue.prototype.readBytes=ue.prototype.qa,ue.prototype.ia=function(){return b(0==this.b),this.a.ia()},ue.prototype.readVarintHash64=ue.prototype.ia,ue.prototype.Cc=function(){return b(0==this.b),this.a.fb()},ue.prototype.readSintHash64=ue.prototype.Cc,ue.prototype.w=function(e){return b(0==this.b),this.a.w(e)},ue.prototype.readSplitVarint64=ue.prototype.w,ue.prototype.ea=function(e){return b(0==this.b),this.a.w(function(t,r){return Y(t,r,e)})},ue.prototype.readSplitZigzagVarint64=ue.prototype.ea,ue.prototype.$=function(){return b(1==this.b),this.a.$()},ue.prototype.readFixedHash64=ue.prototype.$,ue.prototype.ta=function(e){return b(1==this.b),this.a.ta(e)},ue.prototype.readSplitFixed64=ue.prototype.ta,ue.prototype.gc=function(){return ce(this,this.a.da)},ue.prototype.readPackedInt32=ue.prototype.gc,ue.prototype.hc=function(){return ce(this,this.a.Ea)},ue.prototype.readPackedInt32String=ue.prototype.hc,ue.prototype.ic=function(){return ce(this,this.a.sa)},ue.prototype.readPackedInt64=ue.prototype.ic,ue.prototype.jc=function(){return ce(this,this.a.Fa)},ue.prototype.readPackedInt64String=ue.prototype.jc,ue.prototype.qc=function(){return ce(this,this.a.o)},ue.prototype.readPackedUint32=ue.prototype.qc,ue.prototype.rc=function(){return ce(this,this.a.O)},ue.prototype.readPackedUint32String=ue.prototype.rc,ue.prototype.sc=function(){return ce(this,this.a.Ga)},ue.prototype.readPackedUint64=ue.prototype.sc,ue.prototype.tc=function(){return ce(this,this.a.Ha)},ue.prototype.readPackedUint64String=ue.prototype.tc,ue.prototype.nc=function(){return ce(this,this.a.Ia)},ue.prototype.readPackedSint32=ue.prototype.nc,ue.prototype.oc=function(){return ce(this,this.a.Ja)},ue.prototype.readPackedSint64=ue.prototype.oc,ue.prototype.pc=function(){return ce(this,this.a.Ka)},ue.prototype.readPackedSint64String=ue.prototype.pc,ue.prototype.bc=function(){return ce(this,this.a.m)},ue.prototype.readPackedFixed32=ue.prototype.bc,ue.prototype.cc=function(){return ce(this,this.a.ga)},ue.prototype.readPackedFixed64=ue.prototype.cc,ue.prototype.dc=function(){return ce(this,this.a.ha)},ue.prototype.readPackedFixed64String=ue.prototype.dc,ue.prototype.kc=function(){return ce(this,this.a.P)},ue.prototype.readPackedSfixed32=ue.prototype.kc,ue.prototype.lc=function(){return ce(this,this.a.ba)},ue.prototype.readPackedSfixed64=ue.prototype.lc,ue.prototype.mc=function(){return ce(this,this.a.ca)},ue.prototype.readPackedSfixed64String=ue.prototype.mc,ue.prototype.fc=function(){return ce(this,this.a.aa)},ue.prototype.readPackedFloat=ue.prototype.fc,ue.prototype.$b=function(){return ce(this,this.a.Z)},ue.prototype.readPackedDouble=ue.prototype.$b,ue.prototype.Zb=function(){return ce(this,this.a.pa)},ue.prototype.readPackedBool=ue.prototype.Zb,ue.prototype.ac=function(){return ce(this,this.a.ra)},ue.prototype.readPackedEnum=ue.prototype.ac,ue.prototype.uc=function(){return ce(this,this.a.ia)},ue.prototype.readPackedVarintHash64=ue.prototype.uc,ue.prototype.ec=function(){return ce(this,this.a.$)},ue.prototype.readPackedFixedHash64=ue.prototype.ec,h("jspb.ExtensionFieldInfo",pe,void 0),h("jspb.ExtensionFieldBinaryInfo",fe,void 0),pe.prototype.F=function(){return!!this.la},pe.prototype.isMessageType=pe.prototype.F,h("jspb.Message",me,void 0),me.GENERATE_TO_OBJECT=!0,me.GENERATE_FROM_OBJECT=!0;var ge="function"==typeof Uint8Array;me.prototype.Ib=function(){return this.b},me.prototype.getJsPbMessageId=me.prototype.Ib,me.initialize=function(e,t,r,i,n,s){if(e.f=null,t||(t=r?[r]:[]),e.b=r?String(r):void 0,e.D=0===r?-1:0,e.u=t,t=-1,!(r=e.u.length)||(t=r-1,null===(r=e.u[t])||"object"!=typeof r||Array.isArray(r)||ge&&r instanceof Uint8Array)?-1<i?(e.G=Math.max(i,t+1-e.D),e.i=null):e.G=Number.MAX_VALUE:(e.G=t-e.D,e.i=r),e.a={},n)for(i=0;i<n.length;i++)(t=n[i])<e.G?(t+=e.D,e.u[t]=e.u[t]||ye):(ve(e),e.i[t]=e.i[t]||ye);if(s&&s.length)for(i=0;i<s.length;i++)Ce(e,s[i])};var ye=Object.freeze?Object.freeze([]):[];function ve(e){var t=e.G+e.D;e.u[t]||(e.i=e.u[t]={})}function be(e,t,r){for(var i=[],n=0;n<e.length;n++)i[n]=t.call(e[n],r,e[n]);return i}function Ie(e,t){if(t<e.G){t+=e.D;var r=e.u[t];return r===ye?e.u[t]=[]:r}if(e.i)return(r=e.i[t])===ye?e.i[t]=[]:r}function Ee(e,t){return null==(e=Ie(e,t))?e:+e}function we(e,t){return null==(e=Ie(e,t))?e:!!e}function Se(e){return null==e||"string"==typeof e?e:ge&&e instanceof Uint8Array?x(e):(I("Cannot coerce to b64 string: "+c(e)),null)}function Me(e){return null==e||e instanceof Uint8Array?e:"string"==typeof e?_(e):(I("Cannot coerce to Uint8Array: "+c(e)),null)}function ke(e){if(e&&1<e.length){var t=c(e[0]);m(e,function(e){c(e)!=t&&I("Inconsistent type in JSPB repeated field array. Got "+c(e)+" expected "+t)})}}function Fe(e,t,r){return null==(e=Ie(e,t))?r:e}function Te(e,t,r){return E(e,me),t<e.G?e.u[t+e.D]=r:(ve(e),e.i[t]=r),e}function Re(e,t,r,i){return E(e,me),r!==i?Te(e,t,r):t<e.G?e.u[t+e.D]=null:(ve(e),delete e.i[t]),e}function Ae(e,t,r,i){return E(e,me),(r=Ce(e,r))&&r!==t&&void 0!==i&&(e.f&&r in e.f&&(e.f[r]=void 0),Te(e,r,void 0)),Te(e,t,i)}function Ce(e,t){for(var r,i,n=0;n<t.length;n++){var s=t[n],o=Ie(e,s);null!=o&&(r=s,i=o,Te(e,s,void 0))}return r?(Te(e,r,i),r):0}function Oe(e,t,r){if(e.f||(e.f={}),!e.f[r]){for(var i=Ie(e,r),n=[],s=0;s<i.length;s++)n[s]=new t(i[s]);e.f[r]=n}}function Ne(e){if(e.f)for(var t in e.f){var r=e.f[t];if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]&&r[i].g();else r&&r.g()}}function xe(e,t){e=e||{},t=t||{};var r,i={};for(r in e)i[r]=0;for(r in t)i[r]=0;for(r in i)if(!_e(e[r],t[r]))return!1;return!0}function _e(e,t){if(e==t)return!0;if(!p(e)||!p(t))return!!("number"==typeof e&&isNaN(e)||"number"==typeof t&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(ge&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}if(e.constructor===Array){var i=void 0,n=void 0,s=Math.max(e.length,t.length);for(r=0;r<s;r++){var o=e[r],a=t[r];if(o&&o.constructor==Object&&(b(void 0===i),b(r===e.length-1),i=o,o=void 0),a&&a.constructor==Object&&(b(void 0===n),b(r===t.length-1),n=a,a=void 0),!_e(o,a))return!1}return!i&&!n||xe(i=i||{},n=n||{})}if(e.constructor===Object)return xe(e,t);throw Error("Invalid type in JSPB array")}function De(e){return new e.constructor(Le(e.g()))}function Le(e){if(Array.isArray(e)){for(var t=Array(e.length),r=0;r<e.length;r++){var i=e[r];null!=i&&(t[r]="object"==typeof i?Le(b(i)):i)}return t}if(ge&&e instanceof Uint8Array)return new Uint8Array(e);for(r in t={},e)null!=(i=e[r])&&(t[r]="object"==typeof i?Le(b(i)):i);return t}me.toObjectList=be,me.toObjectExtension=function(e,t,r,i,n){for(var s in r){var o=r[s],a=i.call(e,o);if(null!=a){for(var l in o.Ba)if(o.Ba.hasOwnProperty(l))break;t[l]=o.Na?o.na?be(a,o.Na,n):o.Na(n,a):a}}},me.serializeBinaryExtensions=function(e,t,r,i){for(var n in r){var s=r[n],o=s.Za;if(!s.Aa)throw Error("Message extension present that was generated without binary serialization support");var a=i.call(e,o);if(null!=a)if(o.F()){if(!s.Wa)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");s.Aa.call(t,o.ma,a,s.Wa)}else s.Aa.call(t,o.ma,a)}},me.readBinaryExtension=function(e,t,r,i,n){var s=r[t.c];if(s){if(r=s.Za,!s.za)throw Error("Deserializing extension whose generated code does not support binary format");if(r.F()){var o=new r.la;s.za.call(t,o,s.Ab)}else o=s.za.call(t);r.na&&!s.Nb?(t=i.call(e,r))?t.push(o):n.call(e,r,[o]):n.call(e,r,o)}else t.C()},me.getField=Ie,me.getRepeatedField=function(e,t){return Ie(e,t)},me.getOptionalFloatingPointField=Ee,me.getBooleanField=we,me.getRepeatedFloatingPointField=function(e,t){var r=Ie(e,t);if(e.a||(e.a={}),!e.a[t]){for(var i=0;i<r.length;i++)r[i]=+r[i];e.a[t]=!0}return r},me.getRepeatedBooleanField=function(e,t){var r=Ie(e,t);if(e.a||(e.a={}),!e.a[t]){for(var i=0;i<r.length;i++)r[i]=!!r[i];e.a[t]=!0}return r},me.bytesAsB64=Se,me.bytesAsU8=Me,me.bytesListAsB64=function(e){return ke(e),e.length&&"string"!=typeof e[0]?g(e,Se):e},me.bytesListAsU8=function(e){return ke(e),!e.length||e[0]instanceof Uint8Array?e:g(e,Me)},me.getFieldWithDefault=Fe,me.getBooleanFieldWithDefault=function(e,t,r){return null==(e=we(e,t))?r:e},me.getFloatingPointFieldWithDefault=function(e,t,r){return null==(e=Ee(e,t))?r:e},me.getFieldProto3=Fe,me.getMapField=function(e,t,r,i){if(e.f||(e.f={}),t in e.f)return e.f[t];var n=Ie(e,t);if(!n){if(r)return;Te(e,t,n=[])}return e.f[t]=new S(n,i)},me.setField=Te,me.setProto3IntField=function(e,t,r){return Re(e,t,r,0)},me.setProto3FloatField=function(e,t,r){return Re(e,t,r,0)},me.setProto3BooleanField=function(e,t,r){return Re(e,t,r,!1)},me.setProto3StringField=function(e,t,r){return Re(e,t,r,"")},me.setProto3BytesField=function(e,t,r){return Re(e,t,r,"")},me.setProto3EnumField=function(e,t,r){return Re(e,t,r,0)},me.setProto3StringIntField=function(e,t,r){return Re(e,t,r,"0")},me.addToRepeatedField=function(e,t,r,i){return E(e,me),t=Ie(e,t),null!=i?t.splice(i,0,r):t.push(r),e},me.setOneofField=Ae,me.computeOneofCase=Ce,me.getWrapperField=function(e,t,r,i){if(e.f||(e.f={}),!e.f[r]){var n=Ie(e,r);(i||n)&&(e.f[r]=new t(n))}return e.f[r]},me.getRepeatedWrapperField=function(e,t,r){return Oe(e,t,r),(t=e.f[r])==ye&&(t=e.f[r]=[]),t},me.setWrapperField=function(e,t,r){E(e,me),e.f||(e.f={});var i=r?r.g():r;return e.f[t]=r,Te(e,t,i)},me.setOneofWrapperField=function(e,t,r,i){E(e,me),e.f||(e.f={});var n=i?i.g():i;return e.f[t]=i,Ae(e,t,r,n)},me.setRepeatedWrapperField=function(e,t,r){E(e,me),e.f||(e.f={}),r=r||[];for(var i=[],n=0;n<r.length;n++)i[n]=r[n].g();return e.f[t]=r,Te(e,t,i)},me.addToRepeatedWrapperField=function(e,t,r,i,n){Oe(e,i,t);var s=e.f[t];return s||(s=e.f[t]=[]),r=r||new i,e=Ie(e,t),null!=n?(s.splice(n,0,r),e.splice(n,0,r.g())):(s.push(r),e.push(r.g())),r},me.toMap=function(e,t,r,i){for(var n={},s=0;s<e.length;s++)n[t.call(e[s])]=r?r.call(e[s],i,e[s]):e[s];return n},me.prototype.g=function(){return Ne(this),this.u},me.prototype.toArray=me.prototype.g,me.prototype.toString=function(){return Ne(this),this.u.toString()},me.prototype.getExtension=function(e){if(this.i){this.f||(this.f={});var t=e.ma;if(e.na){if(e.F())return this.f[t]||(this.f[t]=g(this.i[t]||[],function(t){return new e.la(t)})),this.f[t]}else if(e.F())return!this.f[t]&&this.i[t]&&(this.f[t]=new e.la(this.i[t])),this.f[t];return this.i[t]}},me.prototype.getExtension=me.prototype.getExtension,me.prototype.Kc=function(e,t){this.f||(this.f={}),ve(this);var r=e.ma;return e.na?(t=t||[],e.F()?(this.f[r]=t,this.i[r]=g(t,function(e){return e.g()})):this.i[r]=t):e.F()?(this.f[r]=t,this.i[r]=t?t.g():t):this.i[r]=t,this},me.prototype.setExtension=me.prototype.Kc,me.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var r=e.g();t=t.g();var i=[],n=0,s=r.length>t.length?r.length:t.length;for(e.b&&(i[0]=e.b,n=1);n<s;n++)_e(r[n],t[n])||(i[n]=t[n]);return new e.constructor(i)},me.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&_e(e.g(),t.g())},me.compareExtensions=xe,me.compareFields=_e,me.prototype.Bb=function(){return De(this)},me.prototype.cloneMessage=me.prototype.Bb,me.prototype.clone=function(){return De(this)},me.prototype.clone=me.prototype.clone,me.clone=function(e){return De(e)},me.copyInto=function(e,t){E(e,me),E(t,me),b(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=De(e);for(var r=t.g(),i=e.g(),n=r.length=0;n<i.length;n++)r[n]=i[n];t.f=e.f,t.i=e.i},me.registerMessageType=function(e,t){t.we=e};var Pe={dump:function(e){return E(e,me,"jspb.Message instance expected"),b(e.getExtension,"Only unobfuscated and unoptimized compilation modes supported."),Pe.X(e)}};function Ue(){this.a=[]}function je(e,t){this.lo=e,this.hi=t}function Be(e,t){var r=65535&e,i=65535&t,n=t>>>16;for(t=r*i+65536*(r*n&65535)+65536*((e>>>=16)*i&65535),r=e*n+(r*n>>>16)+(e*i>>>16);4294967296<=t;)t-=4294967296,r+=1;return new je(t>>>0,r>>>0)}function We(e){for(var t=new je(0,0),r=new je(0,0),i=0;i<e.length;i++){if("0">e[i]||"9"<e[i])return null;r.lo=parseInt(e[i],10),t=t.eb(10).add(r)}return t}function ze(e,t){this.lo=e,this.hi=t}function Ge(e){var t=0<e.length&&"-"==e[0];return t&&(e=e.substring(1)),null===(e=We(e))?null:(t&&(e=new je(0,0).sub(e)),new ze(e.lo,e.hi))}function Ve(){this.c=[],this.b=0,this.a=new Ue,this.h=[]}function qe(e,t){var r=e.a.end();e.c.push(r),e.c.push(t),e.b+=r.length+t.length}function Ke(e,t){return Ye(e,t,2),t=e.a.end(),e.c.push(t),e.b+=t.length,t.push(e.b),t}function He(e,t){var r=t.pop();for(b(0<=(r=e.b+e.a.length()-r));127<r;)t.push(127&r|128),r>>>=7,e.b++;t.push(r),e.b++}function Ye(e,t,r){b(1<=t&&t==Math.floor(t)),e.a.j(8*t+r)}function Xe(e,t,r){null!=r&&(Ye(e,t,0),e.a.j(r))}function Je(e,t,r){null!=r&&(Ye(e,t,0),e.a.M(r))}h("jspb.debug.dump",Pe.dump,void 0),Pe.X=function(e){var t=c(e);if("number"==t||"string"==t||"boolean"==t||"null"==t||"undefined"==t||"undefined"!=typeof Uint8Array&&e instanceof Uint8Array)return e;if("array"==t)return function(e,t,r){for(var i=[],n=2;n<arguments.length;++n)i[n-2]=arguments[n];Array.isArray(e)||v("Expected array but got %s: %s.",[c(e),e],t,i)}(e),g(e,Pe.X);if(e instanceof S){for(var r={},i=(e=e.entries()).next();!i.done;i=e.next())r[i.value[0]]=Pe.X(i.value[1]);return r}E(e,me,"Only messages expected: "+e);var n={$name:(t=e.constructor).name||t.displayName};for(a in t.prototype){var s=/^get([A-Z]\w*)/.exec(a);if(s&&"getExtension"!=a&&"getJsPbMessageId"!=a){var o="has"+s[1];e[o]&&!e[o]()||(o=e[a](),n[Pe.$a(s[1])]=Pe.X(o))}}if(e.extensionObject_)return n.$extensions="Recursive dumping of extensions not supported in compiled code. Switch to uncompiled or dump extension object directly",n;for(i in t.extensions)if(/^\d+$/.test(i)){o=t.extensions[i];var a=e.getExtension(o);s=void 0,o=o.Ba;var l=[],u=0;for(s in o)l[u++]=s;s=l[0],null!=a&&(r||(r=n.$extensions={}),r[Pe.$a(s)]=Pe.X(a))}return n},Pe.$a=function(e){return e.replace(/^[A-Z]/,function(e){return e.toLowerCase()})},h("jspb.BinaryEncoder",Ue,void 0),Ue.prototype.length=function(){return this.a.length},Ue.prototype.length=Ue.prototype.length,Ue.prototype.end=function(){var e=this.a;return this.a=[],e},Ue.prototype.end=Ue.prototype.end,Ue.prototype.l=function(e,t){for(b(e==Math.floor(e)),b(t==Math.floor(t)),b(0<=e&&4294967296>e),b(0<=t&&4294967296>t);0<t||127<e;)this.a.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.a.push(e)},Ue.prototype.writeSplitVarint64=Ue.prototype.l,Ue.prototype.A=function(e,t){b(e==Math.floor(e)),b(t==Math.floor(t)),b(0<=e&&4294967296>e),b(0<=t&&4294967296>t),this.s(e),this.s(t)},Ue.prototype.writeSplitFixed64=Ue.prototype.A,Ue.prototype.j=function(e){for(b(e==Math.floor(e)),b(0<=e&&4294967296>e);127<e;)this.a.push(127&e|128),e>>>=7;this.a.push(e)},Ue.prototype.writeUnsignedVarint32=Ue.prototype.j,Ue.prototype.M=function(e){if(b(e==Math.floor(e)),b(-2147483648<=e&&2147483648>e),0<=e)this.j(e);else{for(var t=0;9>t;t++)this.a.push(127&e|128),e>>=7;this.a.push(1)}},Ue.prototype.writeSignedVarint32=Ue.prototype.M,Ue.prototype.va=function(e){b(e==Math.floor(e)),b(0<=e&&0x10000000000000000>e),j(e),this.l(L,P)},Ue.prototype.writeUnsignedVarint64=Ue.prototype.va,Ue.prototype.ua=function(e){b(e==Math.floor(e)),b(-0x8000000000000000<=e&&0x8000000000000000>e),j(e),this.l(L,P)},Ue.prototype.writeSignedVarint64=Ue.prototype.ua,Ue.prototype.wa=function(e){b(e==Math.floor(e)),b(-2147483648<=e&&2147483648>e),this.j((e<<1^e>>31)>>>0)},Ue.prototype.writeZigzagVarint32=Ue.prototype.wa,Ue.prototype.xa=function(e){b(e==Math.floor(e)),b(-0x8000000000000000<=e&&0x8000000000000000>e),B(e),this.l(L,P)},Ue.prototype.writeZigzagVarint64=Ue.prototype.xa,Ue.prototype.Ta=function(e){this.W(te(e))},Ue.prototype.writeZigzagVarint64String=Ue.prototype.Ta,Ue.prototype.W=function(e){var t=this;G(e),K(L,P,function(e,r){t.l(e>>>0,r>>>0)})},Ue.prototype.writeZigzagVarintHash64=Ue.prototype.W,Ue.prototype.be=function(e){b(e==Math.floor(e)),b(0<=e&&256>e),this.a.push(e>>>0&255)},Ue.prototype.writeUint8=Ue.prototype.be,Ue.prototype.ae=function(e){b(e==Math.floor(e)),b(0<=e&&65536>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255)},Ue.prototype.writeUint16=Ue.prototype.ae,Ue.prototype.s=function(e){b(e==Math.floor(e)),b(0<=e&&4294967296>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255),this.a.push(e>>>16&255),this.a.push(e>>>24&255)},Ue.prototype.writeUint32=Ue.prototype.s,Ue.prototype.V=function(e){b(e==Math.floor(e)),b(0<=e&&0x10000000000000000>e),U(e),this.s(L),this.s(P)},Ue.prototype.writeUint64=Ue.prototype.V,Ue.prototype.Qc=function(e){b(e==Math.floor(e)),b(-128<=e&&128>e),this.a.push(e>>>0&255)},Ue.prototype.writeInt8=Ue.prototype.Qc,Ue.prototype.Pc=function(e){b(e==Math.floor(e)),b(-32768<=e&&32768>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255)},Ue.prototype.writeInt16=Ue.prototype.Pc,Ue.prototype.S=function(e){b(e==Math.floor(e)),b(-2147483648<=e&&2147483648>e),this.a.push(e>>>0&255),this.a.push(e>>>8&255),this.a.push(e>>>16&255),this.a.push(e>>>24&255)},Ue.prototype.writeInt32=Ue.prototype.S,Ue.prototype.T=function(e){b(e==Math.floor(e)),b(-0x8000000000000000<=e&&0x8000000000000000>e),j(e),this.A(L,P)},Ue.prototype.writeInt64=Ue.prototype.T,Ue.prototype.ka=function(e){b(e==Math.floor(e)),b(-0x8000000000000000<=+e&&0x8000000000000000>+e),G(te(e)),this.A(L,P)},Ue.prototype.writeInt64String=Ue.prototype.ka,Ue.prototype.L=function(e){b(1/0===e||-1/0===e||isNaN(e)||-34028234663852886e22<=e&&34028234663852886e22>=e),W(e),this.s(L)},Ue.prototype.writeFloat=Ue.prototype.L,Ue.prototype.J=function(e){b(1/0===e||-1/0===e||isNaN(e)||-17976931348623157e292<=e&&17976931348623157e292>=e),z(e),this.s(L),this.s(P)},Ue.prototype.writeDouble=Ue.prototype.J,Ue.prototype.I=function(e){b("boolean"==typeof e||"number"==typeof e),this.a.push(e?1:0)},Ue.prototype.writeBool=Ue.prototype.I,Ue.prototype.R=function(e){b(e==Math.floor(e)),b(-2147483648<=e&&2147483648>e),this.M(e)},Ue.prototype.writeEnum=Ue.prototype.R,Ue.prototype.ja=function(e){this.a.push.apply(this.a,e)},Ue.prototype.writeBytes=Ue.prototype.ja,Ue.prototype.N=function(e){G(e),this.l(L,P)},Ue.prototype.writeVarintHash64=Ue.prototype.N,Ue.prototype.K=function(e){G(e),this.s(L),this.s(P)},Ue.prototype.writeFixedHash64=Ue.prototype.K,Ue.prototype.U=function(e){var t=this.a.length;!function(e,t,r){for(var i=[],n=2;n<arguments.length;++n)i[n-2]=arguments[n];"string"!=typeof e&&v("Expected string but got %s: %s.",[c(e),e],t,i)}(e);for(var r=0;r<e.length;r++){var i=e.charCodeAt(r);if(128>i)this.a.push(i);else if(2048>i)this.a.push(i>>6|192),this.a.push(63&i|128);else if(65536>i)if(55296<=i&&56319>=i&&r+1<e.length){var n=e.charCodeAt(r+1);56320<=n&&57343>=n&&(i=1024*(i-55296)+n-56320+65536,this.a.push(i>>18|240),this.a.push(i>>12&63|128),this.a.push(i>>6&63|128),this.a.push(63&i|128),r++)}else this.a.push(i>>12|224),this.a.push(i>>6&63|128),this.a.push(63&i|128)}return this.a.length-t},Ue.prototype.writeString=Ue.prototype.U,h("jspb.arith.UInt64",je,void 0),je.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},je.prototype.cmp=je.prototype.cmp,je.prototype.La=function(){return new je((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},je.prototype.rightShift=je.prototype.La,je.prototype.Da=function(){return new je(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},je.prototype.leftShift=je.prototype.Da,je.prototype.cb=function(){return!!(2147483648&this.hi)},je.prototype.msb=je.prototype.cb,je.prototype.Ob=function(){return!!(1&this.lo)},je.prototype.lsb=je.prototype.Ob,je.prototype.Ua=function(){return 0==this.lo&&0==this.hi},je.prototype.zero=je.prototype.Ua,je.prototype.add=function(e){return new je((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},je.prototype.add=je.prototype.add,je.prototype.sub=function(e){return new je((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},je.prototype.sub=je.prototype.sub,je.mul32x32=Be,je.prototype.eb=function(e){var t=Be(this.lo,e);return(e=Be(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},je.prototype.mul=je.prototype.eb,je.prototype.Xa=function(e){if(0==e)return[];var t=new je(0,0),r=new je(this.lo,this.hi);e=new je(e,0);for(var i=new je(1,0);!e.cb();)e=e.Da(),i=i.Da();for(;!i.Ua();)0>=e.cmp(r)&&(t=t.add(i),r=r.sub(e)),e=e.La(),i=i.La();return[t,r]},je.prototype.div=je.prototype.Xa,je.prototype.toString=function(){for(var e="",t=this;!t.Ua();){var r=(t=t.Xa(10))[0];e=t[1].lo+e,t=r}return""==e&&(e="0"),e},je.prototype.toString=je.prototype.toString,je.fromString=We,je.prototype.clone=function(){return new je(this.lo,this.hi)},je.prototype.clone=je.prototype.clone,h("jspb.arith.Int64",ze,void 0),ze.prototype.add=function(e){return new ze((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},ze.prototype.add=ze.prototype.add,ze.prototype.sub=function(e){return new ze((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},ze.prototype.sub=ze.prototype.sub,ze.prototype.clone=function(){return new ze(this.lo,this.hi)},ze.prototype.clone=ze.prototype.clone,ze.prototype.toString=function(){var e=!!(2147483648&this.hi),t=new je(this.lo,this.hi);return e&&(t=new je(0,0).sub(t)),(e?"-":"")+t.toString()},ze.prototype.toString=ze.prototype.toString,ze.fromString=Ge,h("jspb.BinaryWriter",Ve,void 0),Ve.prototype.pb=function(e,t,r){qe(this,e.subarray(t,r))},Ve.prototype.writeSerializedMessage=Ve.prototype.pb,Ve.prototype.Pb=function(e,t,r){null!=e&&null!=t&&null!=r&&this.pb(e,t,r)},Ve.prototype.maybeWriteSerializedMessage=Ve.prototype.Pb,Ve.prototype.reset=function(){this.c=[],this.a.end(),this.b=0,this.h=[]},Ve.prototype.reset=Ve.prototype.reset,Ve.prototype.ab=function(){b(0==this.h.length);for(var e=new Uint8Array(this.b+this.a.length()),t=this.c,r=t.length,i=0,n=0;n<r;n++){var s=t[n];e.set(s,i),i+=s.length}return t=this.a.end(),e.set(t,i),b((i+=t.length)==e.length),this.c=[e],e},Ve.prototype.getResultBuffer=Ve.prototype.ab,Ve.prototype.Kb=function(e){return x(this.ab(),e)},Ve.prototype.getResultBase64String=Ve.prototype.Kb,Ve.prototype.Va=function(e){this.h.push(Ke(this,e))},Ve.prototype.beginSubMessage=Ve.prototype.Va,Ve.prototype.Ya=function(){b(0<=this.h.length),He(this,this.h.pop())},Ve.prototype.endSubMessage=Ve.prototype.Ya,Ve.prototype.Nc=function(e,t,r){switch(e){case 1:this.J(t,r);break;case 2:this.L(t,r);break;case 3:this.T(t,r);break;case 4:this.V(t,r);break;case 5:this.S(t,r);break;case 6:this.Qa(t,r);break;case 7:this.Pa(t,r);break;case 8:this.I(t,r);break;case 9:this.U(t,r);break;case 10:I("Group field type not supported in writeAny()");break;case 11:I("Message field type not supported in writeAny()");break;case 12:this.ja(t,r);break;case 13:this.s(t,r);break;case 14:this.R(t,r);break;case 15:this.Ra(t,r);break;case 16:this.Sa(t,r);break;case 17:this.rb(t,r);break;case 18:this.sb(t,r);break;case 30:this.K(t,r);break;case 31:this.N(t,r);break;default:I("Invalid field type in writeAny()")}},Ve.prototype.writeAny=Ve.prototype.Nc,Ve.prototype.S=function(e,t){null!=t&&(b(-2147483648<=t&&2147483648>t),Je(this,e,t))},Ve.prototype.writeInt32=Ve.prototype.S,Ve.prototype.ob=function(e,t){null!=t&&(b(-2147483648<=(t=parseInt(t,10))&&2147483648>t),Je(this,e,t))},Ve.prototype.writeInt32String=Ve.prototype.ob,Ve.prototype.T=function(e,t){null!=t&&(b(-0x8000000000000000<=t&&0x8000000000000000>t),null!=t&&(Ye(this,e,0),this.a.ua(t)))},Ve.prototype.writeInt64=Ve.prototype.T,Ve.prototype.ka=function(e,t){null!=t&&(t=Ge(t),Ye(this,e,0),this.a.l(t.lo,t.hi))},Ve.prototype.writeInt64String=Ve.prototype.ka,Ve.prototype.s=function(e,t){null!=t&&(b(0<=t&&4294967296>t),Xe(this,e,t))},Ve.prototype.writeUint32=Ve.prototype.s,Ve.prototype.ub=function(e,t){null!=t&&(b(0<=(t=parseInt(t,10))&&4294967296>t),Xe(this,e,t))},Ve.prototype.writeUint32String=Ve.prototype.ub,Ve.prototype.V=function(e,t){null!=t&&(b(0<=t&&0x10000000000000000>t),null!=t&&(Ye(this,e,0),this.a.va(t)))},Ve.prototype.writeUint64=Ve.prototype.V,Ve.prototype.vb=function(e,t){null!=t&&(t=We(t),Ye(this,e,0),this.a.l(t.lo,t.hi))},Ve.prototype.writeUint64String=Ve.prototype.vb,Ve.prototype.rb=function(e,t){null!=t&&(b(-2147483648<=t&&2147483648>t),null!=t&&(Ye(this,e,0),this.a.wa(t)))},Ve.prototype.writeSint32=Ve.prototype.rb,Ve.prototype.sb=function(e,t){null!=t&&(b(-0x8000000000000000<=t&&0x8000000000000000>t),null!=t&&(Ye(this,e,0),this.a.xa(t)))},Ve.prototype.writeSint64=Ve.prototype.sb,Ve.prototype.$d=function(e,t){null!=t&&null!=t&&(Ye(this,e,0),this.a.W(t))},Ve.prototype.writeSintHash64=Ve.prototype.$d,Ve.prototype.Zd=function(e,t){null!=t&&null!=t&&(Ye(this,e,0),this.a.Ta(t))},Ve.prototype.writeSint64String=Ve.prototype.Zd,Ve.prototype.Pa=function(e,t){null!=t&&(b(0<=t&&4294967296>t),Ye(this,e,5),this.a.s(t))},Ve.prototype.writeFixed32=Ve.prototype.Pa,Ve.prototype.Qa=function(e,t){null!=t&&(b(0<=t&&0x10000000000000000>t),Ye(this,e,1),this.a.V(t))},Ve.prototype.writeFixed64=Ve.prototype.Qa,Ve.prototype.nb=function(e,t){null!=t&&(t=We(t),Ye(this,e,1),this.a.A(t.lo,t.hi))},Ve.prototype.writeFixed64String=Ve.prototype.nb,Ve.prototype.Ra=function(e,t){null!=t&&(b(-2147483648<=t&&2147483648>t),Ye(this,e,5),this.a.S(t))},Ve.prototype.writeSfixed32=Ve.prototype.Ra,Ve.prototype.Sa=function(e,t){null!=t&&(b(-0x8000000000000000<=t&&0x8000000000000000>t),Ye(this,e,1),this.a.T(t))},Ve.prototype.writeSfixed64=Ve.prototype.Sa,Ve.prototype.qb=function(e,t){null!=t&&(t=Ge(t),Ye(this,e,1),this.a.A(t.lo,t.hi))},Ve.prototype.writeSfixed64String=Ve.prototype.qb,Ve.prototype.L=function(e,t){null!=t&&(Ye(this,e,5),this.a.L(t))},Ve.prototype.writeFloat=Ve.prototype.L,Ve.prototype.J=function(e,t){null!=t&&(Ye(this,e,1),this.a.J(t))},Ve.prototype.writeDouble=Ve.prototype.J,Ve.prototype.I=function(e,t){null!=t&&(b("boolean"==typeof t||"number"==typeof t),Ye(this,e,0),this.a.I(t))},Ve.prototype.writeBool=Ve.prototype.I,Ve.prototype.R=function(e,t){null!=t&&(b(-2147483648<=t&&2147483648>t),Ye(this,e,0),this.a.M(t))},Ve.prototype.writeEnum=Ve.prototype.R,Ve.prototype.U=function(e,t){null!=t&&(e=Ke(this,e),this.a.U(t),He(this,e))},Ve.prototype.writeString=Ve.prototype.U,Ve.prototype.ja=function(e,t){null!=t&&(t=se(t),Ye(this,e,2),this.a.j(t.length),qe(this,t))},Ve.prototype.writeBytes=Ve.prototype.ja,Ve.prototype.Rc=function(e,t,r){null!=t&&(e=Ke(this,e),r(t,this),He(this,e))},Ve.prototype.writeMessage=Ve.prototype.Rc,Ve.prototype.Sc=function(e,t,r){null!=t&&(Ye(this,1,3),Ye(this,2,0),this.a.M(e),e=Ke(this,3),r(t,this),He(this,e),Ye(this,1,4))},Ve.prototype.writeMessageSet=Ve.prototype.Sc,Ve.prototype.Oc=function(e,t,r){null!=t&&(Ye(this,e,3),r(t,this),Ye(this,e,4))},Ve.prototype.writeGroup=Ve.prototype.Oc,Ve.prototype.K=function(e,t){null!=t&&(b(8==t.length),Ye(this,e,1),this.a.K(t))},Ve.prototype.writeFixedHash64=Ve.prototype.K,Ve.prototype.N=function(e,t){null!=t&&(b(8==t.length),Ye(this,e,0),this.a.N(t))},Ve.prototype.writeVarintHash64=Ve.prototype.N,Ve.prototype.A=function(e,t,r){Ye(this,e,1),this.a.A(t,r)},Ve.prototype.writeSplitFixed64=Ve.prototype.A,Ve.prototype.l=function(e,t,r){Ye(this,e,0),this.a.l(t,r)},Ve.prototype.writeSplitVarint64=Ve.prototype.l,Ve.prototype.tb=function(e,t,r){Ye(this,e,0);var i=this.a;K(t,r,function(e,t){i.l(e>>>0,t>>>0)})},Ve.prototype.writeSplitZigzagVarint64=Ve.prototype.tb,Ve.prototype.Ed=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)Je(this,e,t[r])},Ve.prototype.writeRepeatedInt32=Ve.prototype.Ed,Ve.prototype.Fd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ob(e,t[r])},Ve.prototype.writeRepeatedInt32String=Ve.prototype.Fd,Ve.prototype.Gd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.ua(i))}},Ve.prototype.writeRepeatedInt64=Ve.prototype.Gd,Ve.prototype.Qd=function(e,t,r,i){if(null!=t)for(var n=0;n<t.length;n++)this.A(e,r(t[n]),i(t[n]))},Ve.prototype.writeRepeatedSplitFixed64=Ve.prototype.Qd,Ve.prototype.Rd=function(e,t,r,i){if(null!=t)for(var n=0;n<t.length;n++)this.l(e,r(t[n]),i(t[n]))},Ve.prototype.writeRepeatedSplitVarint64=Ve.prototype.Rd,Ve.prototype.Sd=function(e,t,r,i){if(null!=t)for(var n=0;n<t.length;n++)this.tb(e,r(t[n]),i(t[n]))},Ve.prototype.writeRepeatedSplitZigzagVarint64=Ve.prototype.Sd,Ve.prototype.Hd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ka(e,t[r])},Ve.prototype.writeRepeatedInt64String=Ve.prototype.Hd,Ve.prototype.Ud=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)Xe(this,e,t[r])},Ve.prototype.writeRepeatedUint32=Ve.prototype.Ud,Ve.prototype.Vd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ub(e,t[r])},Ve.prototype.writeRepeatedUint32String=Ve.prototype.Vd,Ve.prototype.Wd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.va(i))}},Ve.prototype.writeRepeatedUint64=Ve.prototype.Wd,Ve.prototype.Xd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.vb(e,t[r])},Ve.prototype.writeRepeatedUint64String=Ve.prototype.Xd,Ve.prototype.Md=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.wa(i))}},Ve.prototype.writeRepeatedSint32=Ve.prototype.Md,Ve.prototype.Nd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.xa(i))}},Ve.prototype.writeRepeatedSint64=Ve.prototype.Nd,Ve.prototype.Od=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.Ta(i))}},Ve.prototype.writeRepeatedSint64String=Ve.prototype.Od,Ve.prototype.Pd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++){var i=t[r];null!=i&&(Ye(this,e,0),this.a.W(i))}},Ve.prototype.writeRepeatedSintHash64=Ve.prototype.Pd,Ve.prototype.yd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Pa(e,t[r])},Ve.prototype.writeRepeatedFixed32=Ve.prototype.yd,Ve.prototype.zd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Qa(e,t[r])},Ve.prototype.writeRepeatedFixed64=Ve.prototype.zd,Ve.prototype.Ad=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.nb(e,t[r])},Ve.prototype.writeRepeatedFixed64String=Ve.prototype.Ad,Ve.prototype.Jd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Ra(e,t[r])},Ve.prototype.writeRepeatedSfixed32=Ve.prototype.Jd,Ve.prototype.Kd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.Sa(e,t[r])},Ve.prototype.writeRepeatedSfixed64=Ve.prototype.Kd,Ve.prototype.Ld=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.qb(e,t[r])},Ve.prototype.writeRepeatedSfixed64String=Ve.prototype.Ld,Ve.prototype.Cd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.L(e,t[r])},Ve.prototype.writeRepeatedFloat=Ve.prototype.Cd,Ve.prototype.wd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.J(e,t[r])},Ve.prototype.writeRepeatedDouble=Ve.prototype.wd,Ve.prototype.ud=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.I(e,t[r])},Ve.prototype.writeRepeatedBool=Ve.prototype.ud,Ve.prototype.xd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.R(e,t[r])},Ve.prototype.writeRepeatedEnum=Ve.prototype.xd,Ve.prototype.Td=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.U(e,t[r])},Ve.prototype.writeRepeatedString=Ve.prototype.Td,Ve.prototype.vd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.ja(e,t[r])},Ve.prototype.writeRepeatedBytes=Ve.prototype.vd,Ve.prototype.Id=function(e,t,r){if(null!=t)for(var i=0;i<t.length;i++){var n=Ke(this,e);r(t[i],this),He(this,n)}},Ve.prototype.writeRepeatedMessage=Ve.prototype.Id,Ve.prototype.Dd=function(e,t,r){if(null!=t)for(var i=0;i<t.length;i++)Ye(this,e,3),r(t[i],this),Ye(this,e,4)},Ve.prototype.writeRepeatedGroup=Ve.prototype.Dd,Ve.prototype.Bd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.K(e,t[r])},Ve.prototype.writeRepeatedFixedHash64=Ve.prototype.Bd,Ve.prototype.Yd=function(e,t){if(null!=t)for(var r=0;r<t.length;r++)this.N(e,t[r])},Ve.prototype.writeRepeatedVarintHash64=Ve.prototype.Yd,Ve.prototype.ad=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.M(t[r]);He(this,e)}},Ve.prototype.writePackedInt32=Ve.prototype.ad,Ve.prototype.bd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.M(parseInt(t[r],10));He(this,e)}},Ve.prototype.writePackedInt32String=Ve.prototype.bd,Ve.prototype.cd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.ua(t[r]);He(this,e)}},Ve.prototype.writePackedInt64=Ve.prototype.cd,Ve.prototype.md=function(e,t,r,i){if(null!=t){e=Ke(this,e);for(var n=0;n<t.length;n++)this.a.A(r(t[n]),i(t[n]));He(this,e)}},Ve.prototype.writePackedSplitFixed64=Ve.prototype.md,Ve.prototype.nd=function(e,t,r,i){if(null!=t){e=Ke(this,e);for(var n=0;n<t.length;n++)this.a.l(r(t[n]),i(t[n]));He(this,e)}},Ve.prototype.writePackedSplitVarint64=Ve.prototype.nd,Ve.prototype.od=function(e,t,r,i){if(null!=t){e=Ke(this,e);for(var n=this.a,s=0;s<t.length;s++)K(r(t[s]),i(t[s]),function(e,t){n.l(e>>>0,t>>>0)});He(this,e)}},Ve.prototype.writePackedSplitZigzagVarint64=Ve.prototype.od,Ve.prototype.dd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++){var i=Ge(t[r]);this.a.l(i.lo,i.hi)}He(this,e)}},Ve.prototype.writePackedInt64String=Ve.prototype.dd,Ve.prototype.pd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.j(t[r]);He(this,e)}},Ve.prototype.writePackedUint32=Ve.prototype.pd,Ve.prototype.qd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.j(parseInt(t[r],10));He(this,e)}},Ve.prototype.writePackedUint32String=Ve.prototype.qd,Ve.prototype.rd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.va(t[r]);He(this,e)}},Ve.prototype.writePackedUint64=Ve.prototype.rd,Ve.prototype.sd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++){var i=We(t[r]);this.a.l(i.lo,i.hi)}He(this,e)}},Ve.prototype.writePackedUint64String=Ve.prototype.sd,Ve.prototype.hd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.wa(t[r]);He(this,e)}},Ve.prototype.writePackedSint32=Ve.prototype.hd,Ve.prototype.jd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.xa(t[r]);He(this,e)}},Ve.prototype.writePackedSint64=Ve.prototype.jd,Ve.prototype.kd=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.W(te(t[r]));He(this,e)}},Ve.prototype.writePackedSint64String=Ve.prototype.kd,Ve.prototype.ld=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.W(t[r]);He(this,e)}},Ve.prototype.writePackedSintHash64=Ve.prototype.ld,Ve.prototype.Wc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(4*t.length),e=0;e<t.length;e++)this.a.s(t[e])},Ve.prototype.writePackedFixed32=Ve.prototype.Wc,Ve.prototype.Xc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.V(t[e])},Ve.prototype.writePackedFixed64=Ve.prototype.Xc,Ve.prototype.Yc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++){var r=We(t[e]);this.a.A(r.lo,r.hi)}},Ve.prototype.writePackedFixed64String=Ve.prototype.Yc,Ve.prototype.ed=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(4*t.length),e=0;e<t.length;e++)this.a.S(t[e])},Ve.prototype.writePackedSfixed32=Ve.prototype.ed,Ve.prototype.fd=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.T(t[e])},Ve.prototype.writePackedSfixed64=Ve.prototype.fd,Ve.prototype.gd=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.ka(t[e])},Ve.prototype.writePackedSfixed64String=Ve.prototype.gd,Ve.prototype.$c=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(4*t.length),e=0;e<t.length;e++)this.a.L(t[e])},Ve.prototype.writePackedFloat=Ve.prototype.$c,Ve.prototype.Uc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.J(t[e])},Ve.prototype.writePackedDouble=Ve.prototype.Uc,Ve.prototype.Tc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(t.length),e=0;e<t.length;e++)this.a.I(t[e])},Ve.prototype.writePackedBool=Ve.prototype.Tc,Ve.prototype.Vc=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.R(t[r]);He(this,e)}},Ve.prototype.writePackedEnum=Ve.prototype.Vc,Ve.prototype.Zc=function(e,t){if(null!=t&&t.length)for(Ye(this,e,2),this.a.j(8*t.length),e=0;e<t.length;e++)this.a.K(t[e])},Ve.prototype.writePackedFixedHash64=Ve.prototype.Zc,Ve.prototype.td=function(e,t){if(null!=t&&t.length){e=Ke(this,e);for(var r=0;r<t.length;r++)this.a.N(t[r]);He(this,e)}},Ve.prototype.writePackedVarintHash64=Ve.prototype.td,t.debug=Pe,t.Map=S,t.Message=me,t.BinaryReader=ue,t.BinaryWriter=Ve,t.ExtensionFieldInfo=pe,t.ExtensionFieldBinaryInfo=fe,t.exportSymbol=function(e,t,r){h(e,t,r)},t.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},t.object={extend:function(e,t){for(var r,i,n=1;n<arguments.length;n++){for(r in i=arguments[n])e[r]=i[r];for(var s=0;s<f.length;s++)r=f[s],Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}}},t.typeOf=c},366:function(e,t,r){"use strict";var i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.FrameStore=void 0;var n=r(225),s=r(974),o=function(){function e(){this.storedFrames=[],this._lastReceivedFramePosition=0,this._firstAvailableFramePosition=0,this._lastSentFramePosition=0}return Object.defineProperty(e.prototype,"lastReceivedFramePosition",{get:function(){return this._lastReceivedFramePosition},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstAvailableFramePosition",{get:function(){return this._firstAvailableFramePosition},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSentFramePosition",{get:function(){return this._lastSentFramePosition},enumerable:!1,configurable:!0}),e.prototype.store=function(e){this._lastSentFramePosition+=(0,s.sizeOfFrame)(e),this.storedFrames.push(e)},e.prototype.record=function(e){this._lastReceivedFramePosition+=(0,s.sizeOfFrame)(e)},e.prototype.dropTo=function(e){for(var t=e-this._firstAvailableFramePosition;t>0&&this.storedFrames.length>0;){var r=this.storedFrames.shift();t-=(0,s.sizeOfFrame)(r)}if(0!==t)throw new n.RSocketError(n.ErrorCodes.CONNECTION_ERROR,"State inconsistency. Expected bytes to drop ".concat(e-this._firstAvailableFramePosition," but actual ").concat(t));this._firstAvailableFramePosition=e},e.prototype.drain=function(e){var t,r;try{for(var n=i(this.storedFrames),s=n.next();!s.done;s=n.next())e(s.value)}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e}();t.FrameStore=o},438:function(e,t,r){"use strict";var i=r(287).hp,n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.fragmentWithRequestN=t.fragment=t.isFragmentable=void 0;var s=r(799);t.isFragmentable=function(e,t,r){return 0!==t&&e.data.byteLength+(e.metadata?e.metadata.byteLength+s.Lengths.METADATA:0)+(r==s.FrameTypes.REQUEST_STREAM||r==s.FrameTypes.REQUEST_CHANNEL?s.Lengths.REQUEST:0)>t},t.fragment=function(e,t,r,o,a){var l,u,d,h,c,p,f,m,g,y,v,b;return void 0===a&&(a=!1),n(this,function(n){switch(n.label){case 0:return l=null!==(b=null===(v=t.data)||void 0===v?void 0:v.byteLength)&&void 0!==b?b:0,u=o!==s.FrameTypes.PAYLOAD,d=r,t.metadata?0!==(c=t.metadata.byteLength)?[3,1]:(d-=s.Lengths.METADATA,h=i.allocUnsafe(0),[3,6]):[3,6];case 1:return p=0,u?(d-=s.Lengths.METADATA,f=Math.min(c,p+d),h=t.metadata.slice(p,f),d-=h.byteLength,p=f,0!==d?[3,3]:(u=!1,[4,{type:o,flags:s.Flags.FOLLOWS|s.Flags.METADATA,data:void 0,metadata:h,streamId:e}])):[3,3];case 2:n.sent(),h=void 0,d=r,n.label=3;case 3:return p<c?(d-=s.Lengths.METADATA,f=Math.min(c,p+d),h=t.metadata.slice(p,f),d-=h.byteLength,p=f,0!==d&&0!==l?[3,5]:[4,{type:s.FrameTypes.PAYLOAD,flags:s.Flags.NEXT|s.Flags.METADATA|(p===c&&a&&0===l?s.Flags.COMPLETE:s.Flags.FOLLOWS),data:void 0,metadata:h,streamId:e}]):[3,6];case 4:n.sent(),h=void 0,d=r,n.label=5;case 5:return[3,3];case 6:return m=0,u?(y=Math.min(l,m+d),g=t.data.slice(m,y),d-=g.byteLength,m=y,[4,{type:o,flags:s.Flags.FOLLOWS|(h?s.Flags.METADATA:s.Flags.NONE),data:g,metadata:h,streamId:e}]):[3,8];case 7:n.sent(),h=void 0,g=void 0,d=r,n.label=8;case 8:return m<l?(y=Math.min(l,m+d),g=t.data.slice(m,y),d-=g.byteLength,m=y,[4,{type:s.FrameTypes.PAYLOAD,flags:m===l?(a?s.Flags.COMPLETE:s.Flags.NONE)|s.Flags.NEXT|(h?s.Flags.METADATA:0):s.Flags.FOLLOWS|s.Flags.NEXT|(h?s.Flags.METADATA:0),data:g,metadata:h,streamId:e}]):[3,10];case 9:return n.sent(),h=void 0,g=void 0,d=r,[3,8];case 10:return[2]}})},t.fragmentWithRequestN=function(e,t,r,o,a,l){var u,d,h,c,p,f,m,g,y,v,b,I;return void 0===l&&(l=!1),n(this,function(n){switch(n.label){case 0:return u=null!==(I=null===(b=t.data)||void 0===b?void 0:b.byteLength)&&void 0!==I?I:0,d=!0,h=r,t.metadata?0!==(p=t.metadata.byteLength)?[3,1]:(h-=s.Lengths.METADATA,c=i.allocUnsafe(0),[3,6]):[3,6];case 1:return f=0,d?(h-=s.Lengths.METADATA+s.Lengths.REQUEST,m=Math.min(p,f+h),c=t.metadata.slice(f,m),h-=c.byteLength,f=m,0!==h?[3,3]:(d=!1,[4,{type:o,flags:s.Flags.FOLLOWS|s.Flags.METADATA,data:void 0,requestN:a,metadata:c,streamId:e}])):[3,3];case 2:n.sent(),c=void 0,h=r,n.label=3;case 3:return f<p?(h-=s.Lengths.METADATA,m=Math.min(p,f+h),c=t.metadata.slice(f,m),h-=c.byteLength,f=m,0!==h&&0!==u?[3,5]:[4,{type:s.FrameTypes.PAYLOAD,flags:s.Flags.NEXT|s.Flags.METADATA|(f===p&&l&&0===u?s.Flags.COMPLETE:s.Flags.FOLLOWS),data:void 0,metadata:c,streamId:e}]):[3,6];case 4:n.sent(),c=void 0,h=r,n.label=5;case 5:return[3,3];case 6:return g=0,d?(h-=s.Lengths.REQUEST,v=Math.min(u,g+h),y=t.data.slice(g,v),h-=y.byteLength,g=v,[4,{type:o,flags:s.Flags.FOLLOWS|(c?s.Flags.METADATA:s.Flags.NONE),data:y,requestN:a,metadata:c,streamId:e}]):[3,8];case 7:n.sent(),c=void 0,y=void 0,h=r,n.label=8;case 8:return g<u?(v=Math.min(u,g+h),y=t.data.slice(g,v),h-=y.byteLength,g=v,[4,{type:s.FrameTypes.PAYLOAD,flags:g===u?(l?s.Flags.COMPLETE:s.Flags.NONE)|s.Flags.NEXT|(c?s.Flags.METADATA:0):s.Flags.FOLLOWS|s.Flags.NEXT|(c?s.Flags.METADATA:0),data:y,metadata:c,streamId:e}]):[3,10];case 9:return n.sent(),c=void 0,y=void 0,h=r,[3,8];case 10:return[2]}})}},526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],i=t[1];return 3*(r+i)/4-i},t.toByteArray=function(e){var t,r,s=a(e),o=s[0],l=s[1],u=new n(function(e,t,r){return 3*(t+r)/4-r}(0,o,l)),d=0,h=l>0?o-4:o;for(r=0;r<h;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[d++]=t>>16&255,u[d++]=t>>8&255,u[d++]=255&t;return 2===l&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[d++]=255&t),1===l&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[d++]=t>>8&255,u[d++]=255&t),u},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],o=16383,a=0,l=i-n;a<l;a+=o)s.push(u(e,a,a+o>l?l:a+o));return 1===n?(t=e[i-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function u(e,t,r){for(var i,n=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),n.push(l(i));return n.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},546:function(e,t){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0;var i=function(){function e(){this._done=!1,this.onCloseCallbacks=[]}return Object.defineProperty(e.prototype,"done",{get:function(){return this._done},enumerable:!1,configurable:!0}),e.prototype.close=function(e){var t,i,n,s;if(this.done)console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):""));else if(this._done=!0,this._error=e,e)try{for(var o=r(this.onCloseCallbacks),a=o.next();!a.done;a=o.next())(0,a.value)(e)}catch(e){t={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}else try{for(var l=r(this.onCloseCallbacks),u=l.next();!u.done;u=l.next())(0,u.value)()}catch(e){n={error:e}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(n)throw n.error}}},e.prototype.onClose=function(e){this._done?e(this._error):this.onCloseCallbacks.push(e)},e}();t.Deferred=i},632:function(e,t){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.WellKnownAuthType=void 0;var i=function(){function e(e,t){this.string=e,this.identifier=t}return e.fromIdentifier=function(t){return t<0||t>127?e.UNPARSEABLE_AUTH_TYPE:e.TYPES_BY_AUTH_ID[t]},e.fromString=function(t){if(!t)throw new Error("type must be non-null");return t===e.UNKNOWN_RESERVED_AUTH_TYPE.string?e.UNPARSEABLE_AUTH_TYPE:e.TYPES_BY_AUTH_STRING.get(t)||e.UNPARSEABLE_AUTH_TYPE},e.prototype.toString=function(){return this.string},e}();t.WellKnownAuthType=i,function(e){var t,i;e.UNPARSEABLE_AUTH_TYPE=new e("UNPARSEABLE_AUTH_TYPE_DO_NOT_USE",-2),e.UNKNOWN_RESERVED_AUTH_TYPE=new e("UNKNOWN_YET_RESERVED_DO_NOT_USE",-1),e.SIMPLE=new e("simple",0),e.BEARER=new e("bearer",1),e.TYPES_BY_AUTH_ID=new Array(128),e.TYPES_BY_AUTH_STRING=new Map;var n=[e.UNPARSEABLE_AUTH_TYPE,e.UNKNOWN_RESERVED_AUTH_TYPE,e.SIMPLE,e.BEARER];e.TYPES_BY_AUTH_ID.fill(e.UNKNOWN_RESERVED_AUTH_TYPE);try{for(var s=r(n),o=s.next();!o.done;o=s.next()){var a=o.value;a.identifier>=0&&(e.TYPES_BY_AUTH_ID[a.identifier]=a,e.TYPES_BY_AUTH_STRING.set(a.string,a))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}Object.seal&&Object.seal(e.TYPES_BY_AUTH_ID)}(i=t.WellKnownAuthType||(t.WellKnownAuthType={})),t.WellKnownAuthType=i},698:function(e,t,r){"use strict";var i,n=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer=t.ResumableClientServerInputMultiplexerDemultiplexer=t.ClientServerInputMultiplexerDemultiplexer=t.StreamIdGenerator=void 0;var a=r(225),l=r(546),u=r(766),d=r(799);!function(e){e.create=function(e){return new t(e)};var t=function(){function e(e){this.currentId=e}return e.prototype.next=function(e){var t=this.currentId+2;e(t)&&(this.currentId=t)},e}()}(t.StreamIdGenerator||(t.StreamIdGenerator={}));var h=function(e){function t(t,r,i){var n=e.call(this)||this;return n.streamIdSupplier=t,n.outbound=r,n.closeable=i,n.registry={},i.onClose(n.close.bind(n)),n}return n(t,e),t.prototype.handle=function(e){if(d.Frame.isConnection(e)){if(e.type===a.FrameTypes.RESERVED)return;this.connectionFramesHandler.handle(e)}else if(d.Frame.isRequest(e)){if(this.registry[e.streamId])return;this.requestFramesHandler.handle(e,this)}else{var t=this.registry[e.streamId];if(!t)return;t.handle(e)}},t.prototype.connectionInbound=function(e){if(this.connectionFramesHandler)throw new Error("Connection frame handler has already been installed");this.connectionFramesHandler=e},t.prototype.handleRequestStream=function(e){if(this.requestFramesHandler)throw new Error("Stream handler has already been installed");this.requestFramesHandler=e},t.prototype.send=function(e){this.outbound.send(e)},Object.defineProperty(t.prototype,"connectionOutbound",{get:function(){return this},enumerable:!1,configurable:!0}),t.prototype.createRequestStream=function(e){var t=this;if(this.done)e.handleReject(new Error("Already closed"));else{var r=this.registry;this.streamIdSupplier.next(function(r){return e.handleReady(r,t)},Object.keys(r))}},t.prototype.connect=function(e){this.registry[e.streamId]=e},t.prototype.disconnect=function(e){delete this.registry[e.streamId]},t.prototype.close=function(t){if(this.done)e.prototype.close.call(this,t);else{for(var r in this.registry)this.registry[r].close(new Error("Closed. ".concat(t?"Original cause [".concat(t,"]."):"")));e.prototype.close.call(this,t)}},t}(l.Deferred);t.ClientServerInputMultiplexerDemultiplexer=h;var c=function(e){function t(t,r,i,n,s,o,a){var u=e.call(this,t,r,new l.Deferred)||this;return u.frameStore=n,u.token=s,u.sessionTimeout=a,o instanceof Function?u.reconnector=o:u.sessionStore=o,i.onClose(u.handleConnectionClose.bind(u)),u}return n(t,e),t.prototype.send=function(t){if(d.Frame.isConnection(t)){if(t.type===a.FrameTypes.KEEPALIVE)t.lastReceivedPosition=this.frameStore.lastReceivedFramePosition;else if(t.type===a.FrameTypes.ERROR)return this.outbound.send(t),this.sessionStore&&delete this.sessionStore[this.token],void e.prototype.close.call(this,new u.RSocketError(t.code,t.message))}else this.frameStore.store(t);this.outbound.send(t)},t.prototype.handle=function(t){if(d.Frame.isConnection(t)){if(t.type===a.FrameTypes.KEEPALIVE)try{this.frameStore.dropTo(t.lastReceivedPosition)}catch(e){this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),this.close(e)}else if(t.type===a.FrameTypes.ERROR)return e.prototype.handle.call(this,t),this.sessionStore&&delete this.sessionStore[this.token],void e.prototype.close.call(this,new u.RSocketError(t.code,t.message))}else this.frameStore.record(t);e.prototype.handle.call(this,t)},t.prototype.resume=function(e,t,r){switch(this.outbound=t,e.type){case a.FrameTypes.RESUME:if(clearTimeout(this.timeoutId),this.frameStore.lastReceivedFramePosition<e.clientPosition){var i=new u.RSocketError(a.ErrorCodes.REJECTED_RESUME,"Impossible to resume since first available client frame position is greater than last received server frame position");return this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:i.code,message:i.message}),void this.close(i)}try{this.frameStore.dropTo(e.serverPosition)}catch(e){return this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),void this.close(e)}this.outbound.send({type:a.FrameTypes.RESUME_OK,streamId:0,flags:a.Flags.NONE,clientPosition:this.frameStore.lastReceivedFramePosition});break;case a.FrameTypes.RESUME_OK:try{this.frameStore.dropTo(e.clientPosition)}catch(e){this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),this.close(e)}}this.frameStore.drain(this.outbound.send.bind(this.outbound)),r.onClose(this.handleConnectionClose.bind(this)),this.connectionFramesHandler.resume()},t.prototype.handleConnectionClose=function(e){return s(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:if(this.connectionFramesHandler.pause(),!this.reconnector)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.reconnector(this,this.frameStore)];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),this.close(e),[3,4];case 4:return[3,6];case 5:this.timeoutId=setTimeout(this.close.bind(this),this.sessionTimeout),t.label=6;case 6:return[2]}})})},t}(h);t.ResumableClientServerInputMultiplexerDemultiplexer=c;var p=function(){function e(e,t,r){this.outbound=e,this.closeable=t,this.delegate=r,this.resumed=!1}return e.prototype.close=function(){this.delegate.close()},e.prototype.onClose=function(e){this.delegate.onClose(e)},Object.defineProperty(e.prototype,"connectionOutbound",{get:function(){return this.delegate.connectionOutbound},enumerable:!1,configurable:!0}),e.prototype.createRequestStream=function(e){this.delegate.createRequestStream(e)},e.prototype.connectionInbound=function(e){this.delegate.connectionInbound(e)},e.prototype.handleRequestStream=function(e){this.delegate.handleRequestStream(e)},e.prototype.handle=function(e){var t=this;if(!this.resumed)return e.type===a.FrameTypes.RESUME_OK?(this.resumed=!0,void this.delegate.resume(e,this.outbound,this.closeable)):(this.outbound.send({type:a.FrameTypes.ERROR,streamId:0,code:a.ErrorCodes.CONNECTION_ERROR,message:"Incomplete RESUME handshake. Unexpected frame ".concat(e.type," received"),flags:a.Flags.NONE}),this.closeable.close(),void this.closeable.onClose(function(){return t.delegate.close(new u.RSocketError(a.ErrorCodes.CONNECTION_ERROR,"Incomplete RESUME handshake. Unexpected frame ".concat(e.type," received")))}));this.delegate.handle(e)},e}();t.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer=p},706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketClientTransport=void 0;var i=r(225),n=r(318),s=function(){function e(e){var t;this.url=e.url,this.factory=null!==(t=e.wsCreator)&&void 0!==t?t:function(e){return new WebSocket(e)}}return e.prototype.connect=function(e){var t=this;return new Promise(function(r,s){var o=t.factory(t.url);o.binaryType="arraybuffer";var a=function(){o.removeEventListener("open",a),o.removeEventListener("error",l),r(new n.WebsocketDuplexConnection(o,new i.Deserializer,e))},l=function(e){o.removeEventListener("open",a),o.removeEventListener("error",l),s(e.error)};o.addEventListener("open",a),o.addEventListener("error",l)})},e}();t.WebsocketClientTransport=s},766:function(e,t){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCodes=t.RSocketError=void 0;var n,s=function(e){function t(t,r){var i=e.call(this,r)||this;return i.code=t,i}return i(t,e),t}(Error);t.RSocketError=s,(n=t.ErrorCodes||(t.ErrorCodes={}))[n.RESERVED=0]="RESERVED",n[n.INVALID_SETUP=1]="INVALID_SETUP",n[n.UNSUPPORTED_SETUP=2]="UNSUPPORTED_SETUP",n[n.REJECTED_SETUP=3]="REJECTED_SETUP",n[n.REJECTED_RESUME=4]="REJECTED_RESUME",n[n.CONNECTION_CLOSE=258]="CONNECTION_CLOSE",n[n.CONNECTION_ERROR=257]="CONNECTION_ERROR",n[n.APPLICATION_ERROR=513]="APPLICATION_ERROR",n[n.REJECTED=514]="REJECTED",n[n.CANCELED=515]="CANCELED",n[n.INVALID=516]="INVALID",n[n.RESERVED_EXTENSION=4294967295]="RESERVED_EXTENSION"},777:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((i=i.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RSocketServer=void 0;var s=r(698),o=r(766),a=r(799),l=r(923),u=r(366),d=function(){function e(e){var t,r;this.acceptor=e.acceptor,this.transport=e.transport,this.lease=e.lease,this.serverSideKeepAlive=e.serverSideKeepAlive,this.sessionStore=e.resume?{}:void 0,this.sessionTimeout=null!==(r=null===(t=e.resume)||void 0===t?void 0:t.sessionTimeout)&&void 0!==r?r:void 0}return e.prototype.bind=function(){return i(this,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this.transport.bind(function(t,r){return i(e,void 0,void 0,function(){var e,i,s,u,d,h,c,p,f,m,g,y,v;return n(this,function(n){switch(n.label){case 0:switch(t.type){case a.FrameTypes.SETUP:return[3,1];case a.FrameTypes.RESUME:return[3,5]}return[3,6];case 1:return n.trys.push([1,3,,4]),this.lease&&!a.Flags.hasLease(t.flags)?(e=new o.RSocketError(o.ErrorCodes.REJECTED_SETUP,"Lease has to be enabled"),r.multiplexerDemultiplexer.connectionOutbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),r.close(e),[2]):a.Flags.hasLease(t.flags)&&!this.lease?(e=new o.RSocketError(o.ErrorCodes.REJECTED_SETUP,"Lease has to be disabled"),r.multiplexerDemultiplexer.connectionOutbound.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:e.code,message:e.message}),r.close(e),[2]):(i=a.Flags.hasLease(t.flags)?new l.LeaseHandler(null!==(m=this.lease.maxPendingRequests)&&void 0!==m?m:256,r.multiplexerDemultiplexer):void 0,s=new l.RSocketRequester(r,null!==(y=null===(g=this.fragmentation)||void 0===g?void 0:g.maxOutboundFragmentSize)&&void 0!==y?y:0,i),[4,this.acceptor.accept({data:t.data,dataMimeType:t.dataMimeType,metadata:t.metadata,metadataMimeType:t.metadataMimeType,flags:t.flags,keepAliveMaxLifetime:t.lifetime,keepAliveInterval:t.keepAlive,resumeToken:t.resumeToken},s)]);case 2:return u=n.sent(),d=new l.KeepAliveHandler(r,t.lifetime),h=this.serverSideKeepAlive?new l.KeepAliveSender(r.multiplexerDemultiplexer.connectionOutbound,t.keepAlive):void 0,c=new l.DefaultConnectionFrameHandler(r,d,h,i,u),p=new l.DefaultStreamRequestHandler(u,0),r.onClose(function(e){null==h||h.close(),d.close(),c.close(e)}),r.multiplexerDemultiplexer.connectionInbound(c),r.multiplexerDemultiplexer.handleRequestStream(p),d.start(),null==h||h.start(),[3,4];case 3:return f=n.sent(),r.multiplexerDemultiplexer.connectionOutbound.send({type:a.FrameTypes.ERROR,streamId:0,code:o.ErrorCodes.REJECTED_SETUP,message:null!==(v=f.message)&&void 0!==v?v:"",flags:a.Flags.NONE}),r.close(f instanceof o.RSocketError?f:new o.RSocketError(o.ErrorCodes.REJECTED_SETUP,f.message)),[3,4];case 4:case 5:return[2];case 6:r.multiplexerDemultiplexer.connectionOutbound.send({type:a.FrameTypes.ERROR,streamId:0,code:o.ErrorCodes.UNSUPPORTED_SETUP,message:"Unsupported setup",flags:a.Flags.NONE}),r.close(new o.RSocketError(o.ErrorCodes.UNSUPPORTED_SETUP)),n.label=7;case 7:return[2]}})})},function(t,r){if(t.type===a.FrameTypes.RESUME){if(e.sessionStore){var i=e.sessionStore[t.resumeToken.toString()];return i?(i.resume(t,r,r),i):(r.send({type:a.FrameTypes.ERROR,streamId:0,code:o.ErrorCodes.REJECTED_RESUME,message:"No session found for the given resume token",flags:a.Flags.NONE}),void r.close())}return r.send({type:a.FrameTypes.ERROR,streamId:0,code:o.ErrorCodes.REJECTED_RESUME,message:"Resume is not enabled",flags:a.Flags.NONE}),void r.close()}if(t.type===a.FrameTypes.SETUP&&a.Flags.hasResume(t.flags)){if(!e.sessionStore){var n=new o.RSocketError(o.ErrorCodes.REJECTED_SETUP,"No resume support");return r.send({type:a.FrameTypes.ERROR,streamId:0,flags:a.Flags.NONE,code:n.code,message:n.message}),void r.close(n)}var l=new s.ResumableClientServerInputMultiplexerDemultiplexer(s.StreamIdGenerator.create(0),r,r,new u.FrameStore,t.resumeToken.toString(),e.sessionStore,e.sessionTimeout);return e.sessionStore[t.resumeToken.toString()]=l,l}return new s.ClientServerInputMultiplexerDemultiplexer(s.StreamIdGenerator.create(0),r,r)})];case 1:return[2,t.sent()]}})})},e}();t.RSocketServer=d},796:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestStreamResponderStream=t.RequestStreamRequesterStream=void 0;var a=r(766),l=r(438),u=r(799),d=s(r(76)),h=function(){function e(e,t,r,i,n){this.payload=e,this.receiver=t,this.fragmentSize=r,this.initialRequestN=i,this.leaseManager=n,this.streamType=u.FrameTypes.REQUEST_STREAM}return e.prototype.handleReady=function(e,t){var r,i;if(this.done)return!1;if(this.streamId=e,this.stream=t,t.connect(this),(0,l.isFragmentable)(this.payload,this.fragmentSize,u.FrameTypes.REQUEST_STREAM))try{for(var n=o((0,l.fragmentWithRequestN)(e,this.payload,this.fragmentSize,u.FrameTypes.REQUEST_STREAM,this.initialRequestN)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.REQUEST_STREAM,data:this.payload.data,metadata:this.payload.metadata,requestN:this.initialRequestN,flags:void 0!==this.payload.metadata?u.Flags.METADATA:0,streamId:e});return this.hasExtension&&this.stream.send({type:u.FrameTypes.EXT,streamId:e,extendedContent:this.extendedContent,extendedType:this.extendedType,flags:this.flags}),!0},e.prototype.handleReject=function(e){this.done||(this.done=!0,this.receiver.onError(e))},e.prototype.handle=function(e){var t,r=e.type;switch(r){case u.FrameTypes.PAYLOAD:var i=u.Flags.hasComplete(e.flags),n=u.Flags.hasNext(e.flags);if(i||!u.Flags.hasFollows(e.flags)){if(i&&(this.done=!0,this.stream.disconnect(this),!n))return void this.receiver.onComplete();var s=this.hasFragments?d.reassemble(this,e.data,e.metadata):{data:e.data,metadata:e.metadata};return void this.receiver.onNext(s,i)}if(!d.add(this,e.data,e.metadata)){t="Unexpected fragment size";break}return;case u.FrameTypes.ERROR:return this.done=!0,this.stream.disconnect(this),d.cancel(this),void this.receiver.onError(new a.RSocketError(e.code,e.message));case u.FrameTypes.EXT:if(this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));default:t="Unexpected frame type [".concat(r,"]")}this.close(new a.RSocketError(a.ErrorCodes.CANCELED,t)),this.stream.send({type:u.FrameTypes.CANCEL,streamId:this.streamId,flags:u.Flags.NONE}),this.stream.disconnect(this)},e.prototype.request=function(e){this.done||(this.streamId?this.stream.send({type:u.FrameTypes.REQUEST_N,flags:u.Flags.NONE,requestN:e,streamId:this.streamId}):this.initialRequestN+=e)},e.prototype.cancel=function(){var e;this.done||(this.done=!0,this.streamId?(this.stream.send({type:u.FrameTypes.CANCEL,flags:u.Flags.NONE,streamId:this.streamId}),this.stream.disconnect(this),d.cancel(this)):null===(e=this.leaseManager)||void 0===e||e.cancelRequest(this))},e.prototype.onExtension=function(e,t,r){if(!this.done)return this.streamId?void this.stream.send({streamId:this.streamId,type:u.FrameTypes.EXT,extendedType:e,extendedContent:t,flags:r?u.Flags.IGNORE:u.Flags.NONE}):(this.hasExtension=!0,this.extendedType=e,this.extendedContent=t,void(this.flags=r?u.Flags.IGNORE:u.Flags.NONE))},e.prototype.close=function(e){this.done||(this.done=!0,d.cancel(this),e?this.receiver.onError(e):this.receiver.onComplete())},e}();t.RequestStreamRequesterStream=h;var c=function(){function e(e,t,r,i,n){if(this.streamId=e,this.stream=t,this.fragmentSize=r,this.handler=i,this.streamType=u.FrameTypes.REQUEST_STREAM,t.connect(this),u.Flags.hasFollows(n.flags))return this.initialRequestN=n.requestN,void d.add(this,n.data,n.metadata);var s={data:n.data,metadata:n.metadata};try{this.receiver=i(s,n.requestN,this)}catch(e){this.onError(e)}}return e.prototype.handle=function(e){var t,r;if(!this.receiver||this.hasFragments)if(e.type===u.FrameTypes.PAYLOAD){if(!u.Flags.hasFollows(e.flags)){var i=d.reassemble(this,e.data,e.metadata);try{this.receiver=this.handler(i,this.initialRequestN,this)}catch(e){this.onError(e)}return}if(d.add(this,e.data,e.metadata))return;r="Unexpected frame size"}else r="Unexpected frame type [".concat(e.type,"] during reassembly");else{if(e.type===u.FrameTypes.REQUEST_N)return void this.receiver.request(e.requestN);if(e.type===u.FrameTypes.EXT)return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));r="Unexpected frame type [".concat(e.type,"]")}this.done=!0,d.cancel(this),null===(t=this.receiver)||void 0===t||t.cancel(),e.type!==u.FrameTypes.CANCEL&&e.type!==u.FrameTypes.ERROR&&this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:a.ErrorCodes.CANCELED,message:r,streamId:this.streamId}),this.stream.disconnect(this)},e.prototype.onError=function(e){this.done?console.warn("Trying to error for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(this.done=!0,this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:e instanceof a.RSocketError?e.code:a.ErrorCodes.APPLICATION_ERROR,message:e.message,streamId:this.streamId}),this.stream.disconnect(this))},e.prototype.onNext=function(e,t){var r,i;if(!this.done){if(t&&(this.done=!0),(0,l.isFragmentable)(e,this.fragmentSize,u.FrameTypes.PAYLOAD))try{for(var n=o((0,l.fragment)(this.streamId,e,this.fragmentSize,u.FrameTypes.PAYLOAD,t)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.NEXT|(t?u.Flags.COMPLETE:u.Flags.NONE)|(e.metadata?u.Flags.METADATA:u.Flags.NONE),data:e.data,metadata:e.metadata,streamId:this.streamId});t&&this.stream.disconnect(this)}},e.prototype.onComplete=function(){this.done||(this.done=!0,this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.COMPLETE,streamId:this.streamId,data:null,metadata:null}),this.stream.disconnect(this))},e.prototype.onExtension=function(e,t,r){this.done||this.stream.send({type:u.FrameTypes.EXT,streamId:this.streamId,flags:r?u.Flags.IGNORE:u.Flags.NONE,extendedType:e,extendedContent:t})},e.prototype.close=function(e){var t;this.done?console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(d.cancel(this),null===(t=this.receiver)||void 0===t||t.cancel())},e}();t.RequestStreamResponderStream=c},799:(e,t)=>{"use strict";var r,i,n,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Frame=t.Lengths=t.Flags=t.FrameTypes=void 0,function(e){e[e.RESERVED=0]="RESERVED",e[e.SETUP=1]="SETUP",e[e.LEASE=2]="LEASE",e[e.KEEPALIVE=3]="KEEPALIVE",e[e.REQUEST_RESPONSE=4]="REQUEST_RESPONSE",e[e.REQUEST_FNF=5]="REQUEST_FNF",e[e.REQUEST_STREAM=6]="REQUEST_STREAM",e[e.REQUEST_CHANNEL=7]="REQUEST_CHANNEL",e[e.REQUEST_N=8]="REQUEST_N",e[e.CANCEL=9]="CANCEL",e[e.PAYLOAD=10]="PAYLOAD",e[e.ERROR=11]="ERROR",e[e.METADATA_PUSH=12]="METADATA_PUSH",e[e.RESUME=13]="RESUME",e[e.RESUME_OK=14]="RESUME_OK",e[e.EXT=63]="EXT"}(r=t.FrameTypes||(t.FrameTypes={})),(s=t.Flags||(t.Flags={}))[s.NONE=0]="NONE",s[s.COMPLETE=64]="COMPLETE",s[s.FOLLOWS=128]="FOLLOWS",s[s.IGNORE=512]="IGNORE",s[s.LEASE=64]="LEASE",s[s.METADATA=256]="METADATA",s[s.NEXT=32]="NEXT",s[s.RESPOND=128]="RESPOND",s[s.RESUME_ENABLE=128]="RESUME_ENABLE",function(e){e.hasMetadata=function(t){return(t&e.METADATA)===e.METADATA},e.hasComplete=function(t){return(t&e.COMPLETE)===e.COMPLETE},e.hasNext=function(t){return(t&e.NEXT)===e.NEXT},e.hasFollows=function(t){return(t&e.FOLLOWS)===e.FOLLOWS},e.hasIgnore=function(t){return(t&e.IGNORE)===e.IGNORE},e.hasRespond=function(t){return(t&e.RESPOND)===e.RESPOND},e.hasLease=function(t){return(t&e.LEASE)===e.LEASE},e.hasResume=function(t){return(t&e.RESUME_ENABLE)===e.RESUME_ENABLE}}(t.Flags||(t.Flags={})),(n=t.Lengths||(t.Lengths={}))[n.FRAME=3]="FRAME",n[n.HEADER=6]="HEADER",n[n.METADATA=3]="METADATA",n[n.REQUEST=3]="REQUEST",(i=t.Frame||(t.Frame={})).isConnection=function(e){return 0===e.streamId},i.isRequest=function(e){return r.REQUEST_RESPONSE<=e.type&&e.type<=r.REQUEST_CHANNEL}},814:function(e,t,r){"use strict";var i=r(287).hp,n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeRoutes=t.encodeRoute=t.encodeRoutes=t.RoutingMetadata=void 0;var s=function(){function e(e){this._buffer=e}return e.prototype.iterator=function(){return a(this._buffer)},e.prototype[Symbol.iterator]=function(){return a(this._buffer)},e}();function o(e){var t=i.from(e,"utf8");if(t.length>255)throw new Error("route length should fit into unsigned byte length but the given one is ".concat(t.length));var r=i.allocUnsafe(1);return r.writeUInt8(t.length),i.concat([r,t])}function a(e){var t,r,i,s;return n(this,function(n){switch(n.label){case 0:t=e.byteLength,r=0,n.label=1;case 1:if(!(r<t))return[3,3];if(i=e.readUInt8(r++),r+i>t)throw new Error("Malformed RouteMetadata. Offset(".concat(r,") + RouteLength(").concat(i,") is greater than TotalLength"));return s=e.toString("utf8",r,r+i),r+=i,[4,s];case 2:return n.sent(),[3,1];case 3:return[2]}})}t.RoutingMetadata=s,t.encodeRoutes=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length<1)throw new Error("routes should be non empty array");return i.concat(e.map(function(e){return o(e)}))},t.encodeRoute=o,t.decodeRoutes=a},837:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(279),t),n(r(34),t),n(r(890),t),n(r(814),t),n(r(632),t)},890:(e,t,r)=>{"use strict";var i=r(287).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSimpleAuthPayload=t.decodeAuthMetadata=t.encodeBearerAuthMetadata=t.encodeSimpleAuthMetadata=t.encodeCustomAuthMetadata=t.encodeWellKnownAuthMetadata=void 0;var n=r(632);t.encodeWellKnownAuthMetadata=function(e,t){if(e===n.WellKnownAuthType.UNPARSEABLE_AUTH_TYPE||e===n.WellKnownAuthType.UNKNOWN_RESERVED_AUTH_TYPE)throw new Error("Illegal WellKnownAuthType[".concat(e.toString(),"]. Only allowed AuthType should be used"));var r=i.allocUnsafe(1);return r.writeUInt8(128|e.identifier),i.concat([r,t])},t.encodeCustomAuthMetadata=function(e,t){var r=i.from(e);if(r.byteLength!==e.length)throw new Error("Custom auth type must be US_ASCII characters only");if(r.byteLength<1||r.byteLength>128)throw new Error("Custom auth type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128");var n=i.allocUnsafe(1+r.byteLength);return n.writeUInt8(r.byteLength-1),n.write(e,1),i.concat([n,t])},t.encodeSimpleAuthMetadata=function(e,t){var r=i.from(e),s=i.from(t),o=r.byteLength;if(o>65535)throw new Error("Username should be shorter than or equal to 65535 bytes length in UTF-8 encoding but the given was ".concat(o));var a=i.allocUnsafe(3);return a.writeUInt8(128|n.WellKnownAuthType.SIMPLE.identifier),a.writeUInt16BE(o,1),i.concat([a,r,s])},t.encodeBearerAuthMetadata=function(e){var t=i.from(e),r=i.allocUnsafe(1);return r.writeUInt8(128|n.WellKnownAuthType.BEARER.identifier),i.concat([r,t])},t.decodeAuthMetadata=function(e){if(e.byteLength<1)throw new Error("Unable to decode Auth metadata. Not enough readable bytes");var t=e.readUInt8(),r=127&t;if(r!==t){var i=n.WellKnownAuthType.fromIdentifier(r);return{payload:e.slice(1),type:{identifier:i.identifier,string:i.string}}}var s=t+1;if(e.byteLength<s+1)throw new Error("Unable to decode custom Auth type. Malformed length or auth type string");var o=e.toString("utf8",1,1+s);return{payload:e.slice(s+1),type:{identifier:n.WellKnownAuthType.UNPARSEABLE_AUTH_TYPE.identifier,string:o}}},t.decodeSimpleAuthPayload=function(e){if(e.byteLength<2)throw new Error("Unable to decode Simple Auth Payload. Not enough readable bytes");var t=e.readUInt16BE();if(e.byteLength<t+2)throw new Error("Unable to decode Simple Auth Payload. Not enough readable bytes");var r=e.slice(2,2+t);return{password:e.slice(2+t),username:r}}},923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeepAliveSender=t.KeepAliveHandler=t.DefaultConnectionFrameHandler=t.DefaultStreamRequestHandler=t.LeaseHandler=t.RSocketRequester=void 0;var i=r(766),n=r(799),s=r(33),o=r(320),a=r(947),l=r(796),u=function(){function e(e,t,r){this.connection=e,this.fragmentSize=t,this.leaseManager=r}return e.prototype.fireAndForget=function(e,t){var r=new o.RequestFnFRequesterStream(e,t,this.fragmentSize,this.leaseManager);return this.leaseManager?this.leaseManager.requestLease(r):this.connection.multiplexerDemultiplexer.createRequestStream(r),r},e.prototype.requestResponse=function(e,t){var r=new a.RequestResponseRequesterStream(e,t,this.fragmentSize,this.leaseManager);return this.leaseManager?this.leaseManager.requestLease(r):this.connection.multiplexerDemultiplexer.createRequestStream(r),r},e.prototype.requestStream=function(e,t,r){var i=new l.RequestStreamRequesterStream(e,r,this.fragmentSize,t,this.leaseManager);return this.leaseManager?this.leaseManager.requestLease(i):this.connection.multiplexerDemultiplexer.createRequestStream(i),i},e.prototype.requestChannel=function(e,t,r,i){var n=new s.RequestChannelRequesterStream(e,r,i,this.fragmentSize,t,this.leaseManager);return this.leaseManager?this.leaseManager.requestLease(n):this.connection.multiplexerDemultiplexer.createRequestStream(n),n},e.prototype.metadataPush=function(e,t){throw new Error("Method not implemented.")},e.prototype.close=function(e){this.connection.close(e)},e.prototype.onClose=function(e){this.connection.onClose(e)},e}();t.RSocketRequester=u;var d=function(){function e(e,t){this.maxPendingRequests=e,this.multiplexer=t,this.pendingRequests=[],this.expirationTime=0,this.availableLease=0}return e.prototype.handle=function(e){for(this.expirationTime=e.ttl+Date.now(),this.availableLease=e.requestCount;this.availableLease>0&&this.pendingRequests.length>0;){var t=this.pendingRequests.shift();this.availableLease--,this.multiplexer.createRequestStream(t)}},e.prototype.requestLease=function(e){var t=this.availableLease;if(t>0&&Date.now()<this.expirationTime)return this.availableLease=t-1,void this.multiplexer.createRequestStream(e);this.pendingRequests.length>=this.maxPendingRequests?e.handleReject(new i.RSocketError(i.ErrorCodes.REJECTED,"No available lease given")):this.pendingRequests.push(e)},e.prototype.cancelRequest=function(e){var t=this.pendingRequests.indexOf(e);t>-1&&this.pendingRequests.splice(t,1)},e}();t.LeaseHandler=d;var h=function(){function e(e,t){this.rsocket=e,this.fragmentSize=t}return e.prototype.handle=function(e,t){switch(e.type){case n.FrameTypes.REQUEST_FNF:return void(this.rsocket.fireAndForget&&new o.RequestFnfResponderStream(e.streamId,t,this.rsocket.fireAndForget.bind(this.rsocket),e));case n.FrameTypes.REQUEST_RESPONSE:return this.rsocket.requestResponse?void new a.RequestResponseResponderStream(e.streamId,t,this.fragmentSize,this.rsocket.requestResponse.bind(this.rsocket),e):void this.rejectRequest(e.streamId,t);case n.FrameTypes.REQUEST_STREAM:return this.rsocket.requestStream?void new l.RequestStreamResponderStream(e.streamId,t,this.fragmentSize,this.rsocket.requestStream.bind(this.rsocket),e):void this.rejectRequest(e.streamId,t);case n.FrameTypes.REQUEST_CHANNEL:return this.rsocket.requestChannel?void new s.RequestChannelResponderStream(e.streamId,t,this.fragmentSize,this.rsocket.requestChannel.bind(this.rsocket),e):void this.rejectRequest(e.streamId,t)}},e.prototype.rejectRequest=function(e,t){t.send({type:n.FrameTypes.ERROR,streamId:e,flags:n.Flags.NONE,code:i.ErrorCodes.REJECTED,message:"No available handler found"})},e.prototype.close=function(){},e}();t.DefaultStreamRequestHandler=h;var c,p=function(){function e(e,t,r,i,n){this.connection=e,this.keepAliveHandler=t,this.keepAliveSender=r,this.leaseHandler=i,this.rsocket=n}return e.prototype.handle=function(e){switch(e.type){case n.FrameTypes.KEEPALIVE:return void this.keepAliveHandler.handle(e);case n.FrameTypes.LEASE:return this.leaseHandler?void this.leaseHandler.handle(e):void 0;case n.FrameTypes.ERROR:return void this.connection.close(new i.RSocketError(e.code,e.message));case n.FrameTypes.METADATA_PUSH:return void this.rsocket.metadataPush;default:this.connection.multiplexerDemultiplexer.connectionOutbound.send({type:n.FrameTypes.ERROR,streamId:0,flags:n.Flags.NONE,message:"Received unknown frame type",code:i.ErrorCodes.CONNECTION_ERROR})}},e.prototype.pause=function(){var e;this.keepAliveHandler.pause(),null===(e=this.keepAliveSender)||void 0===e||e.pause()},e.prototype.resume=function(){var e;this.keepAliveHandler.start(),null===(e=this.keepAliveSender)||void 0===e||e.start()},e.prototype.close=function(e){var t;this.keepAliveHandler.close(),null===(t=this.rsocket.close)||void 0===t||t.call(this.rsocket,e)},e}();t.DefaultConnectionFrameHandler=p,function(e){e[e.Paused=0]="Paused",e[e.Running=1]="Running",e[e.Closed=2]="Closed"}(c||(c={}));var f,m=function(){function e(e,t){this.connection=e,this.keepAliveTimeoutDuration=t,this.state=c.Paused,this.outbound=e.multiplexerDemultiplexer.connectionOutbound}return e.prototype.handle=function(e){this.keepAliveLastReceivedMillis=Date.now(),n.Flags.hasRespond(e.flags)&&this.outbound.send({type:n.FrameTypes.KEEPALIVE,streamId:0,data:e.data,flags:e.flags^n.Flags.RESPOND,lastReceivedPosition:0})},e.prototype.start=function(){this.state===c.Paused&&(this.keepAliveLastReceivedMillis=Date.now(),this.state=c.Running,this.activeTimeout=setTimeout(this.timeoutCheck.bind(this),this.keepAliveTimeoutDuration))},e.prototype.pause=function(){this.state===c.Running&&(this.state=c.Paused,clearTimeout(this.activeTimeout))},e.prototype.close=function(){this.state=c.Closed,clearTimeout(this.activeTimeout)},e.prototype.timeoutCheck=function(){var e=Date.now()-this.keepAliveLastReceivedMillis;e>=this.keepAliveTimeoutDuration?this.connection.close(new Error("No keep-alive acks for ".concat(this.keepAliveTimeoutDuration," millis"))):this.activeTimeout=setTimeout(this.timeoutCheck.bind(this),Math.max(100,this.keepAliveTimeoutDuration-e))},e}();t.KeepAliveHandler=m,function(e){e[e.Paused=0]="Paused",e[e.Running=1]="Running",e[e.Closed=2]="Closed"}(f||(f={}));var g=function(){function e(e,t){this.outbound=e,this.keepAlivePeriodDuration=t,this.state=f.Paused}return e.prototype.sendKeepAlive=function(){this.outbound.send({type:n.FrameTypes.KEEPALIVE,streamId:0,data:void 0,flags:n.Flags.RESPOND,lastReceivedPosition:0})},e.prototype.start=function(){this.state===f.Paused&&(this.state=f.Running,this.activeInterval=setInterval(this.sendKeepAlive.bind(this),this.keepAlivePeriodDuration))},e.prototype.pause=function(){this.state===f.Running&&(this.state=f.Paused,clearInterval(this.activeInterval))},e.prototype.close=function(){this.state=f.Closed,clearInterval(this.activeInterval)},e}();t.KeepAliveSender=g},927:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(706),t)},947:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestResponseResponderStream=t.RequestResponseRequesterStream=void 0;var a=r(766),l=r(438),u=r(799),d=s(r(76)),h=function(){function e(e,t,r,i){this.payload=e,this.receiver=t,this.fragmentSize=r,this.leaseManager=i,this.streamType=u.FrameTypes.REQUEST_RESPONSE}return e.prototype.handleReady=function(e,t){var r,i;if(this.done)return!1;if(this.streamId=e,this.stream=t,t.connect(this),(0,l.isFragmentable)(this.payload,this.fragmentSize,u.FrameTypes.REQUEST_RESPONSE))try{for(var n=o((0,l.fragment)(e,this.payload,this.fragmentSize,u.FrameTypes.REQUEST_RESPONSE)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.REQUEST_RESPONSE,data:this.payload.data,metadata:this.payload.metadata,flags:this.payload.metadata?u.Flags.METADATA:0,streamId:e});return this.hasExtension&&this.stream.send({type:u.FrameTypes.EXT,streamId:e,extendedContent:this.extendedContent,extendedType:this.extendedType,flags:this.flags}),!0},e.prototype.handleReject=function(e){this.done||(this.done=!0,this.receiver.onError(e))},e.prototype.handle=function(e){var t,r=e.type;switch(r){case u.FrameTypes.PAYLOAD:var i=u.Flags.hasComplete(e.flags),n=u.Flags.hasNext(e.flags);if(i||!u.Flags.hasFollows(e.flags)){if(this.done=!0,this.stream.disconnect(this),!n)return void this.receiver.onComplete();var s=this.hasFragments?d.reassemble(this,e.data,e.metadata):{data:e.data,metadata:e.metadata};return void this.receiver.onNext(s,!0)}if(!d.add(this,e.data,e.metadata)){t="Unexpected fragment size";break}return;case u.FrameTypes.ERROR:return this.done=!0,this.stream.disconnect(this),d.cancel(this),void this.receiver.onError(new a.RSocketError(e.code,e.message));case u.FrameTypes.EXT:if(this.hasFragments){t="Unexpected frame type [".concat(r,"] during reassembly");break}return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));default:t="Unexpected frame type [".concat(r,"]")}this.close(new a.RSocketError(a.ErrorCodes.CANCELED,t)),this.stream.send({type:u.FrameTypes.CANCEL,streamId:this.streamId,flags:u.Flags.NONE}),this.stream.disconnect(this)},e.prototype.cancel=function(){var e;this.done||(this.done=!0,this.streamId?(this.stream.send({type:u.FrameTypes.CANCEL,flags:u.Flags.NONE,streamId:this.streamId}),this.stream.disconnect(this),d.cancel(this)):null===(e=this.leaseManager)||void 0===e||e.cancelRequest(this))},e.prototype.onExtension=function(e,t,r){if(!this.done)return this.streamId?void this.stream.send({streamId:this.streamId,type:u.FrameTypes.EXT,extendedType:e,extendedContent:t,flags:r?u.Flags.IGNORE:u.Flags.NONE}):(this.hasExtension=!0,this.extendedType=e,this.extendedContent=t,void(this.flags=r?u.Flags.IGNORE:u.Flags.NONE))},e.prototype.close=function(e){this.done||(this.done=!0,d.cancel(this),e?this.receiver.onError(e):this.receiver.onComplete())},e}();t.RequestResponseRequesterStream=h;var c=function(){function e(e,t,r,i,n){if(this.streamId=e,this.stream=t,this.fragmentSize=r,this.handler=i,this.streamType=u.FrameTypes.REQUEST_RESPONSE,t.connect(this),u.Flags.hasFollows(n.flags))d.add(this,n.data,n.metadata);else{var s={data:n.data,metadata:n.metadata};try{this.receiver=i(s,this)}catch(e){this.onError(e)}}}return e.prototype.handle=function(e){var t,r;if(!this.receiver||this.hasFragments)if(e.type===u.FrameTypes.PAYLOAD){if(!u.Flags.hasFollows(e.flags)){var i=d.reassemble(this,e.data,e.metadata);try{this.receiver=this.handler(i,this)}catch(e){this.onError(e)}return}if(d.add(this,e.data,e.metadata))return;r="Unexpected fragment size"}else r="Unexpected frame type [".concat(e.type,"] during reassembly");else{if(e.type===u.FrameTypes.EXT)return void this.receiver.onExtension(e.extendedType,e.extendedContent,u.Flags.hasIgnore(e.flags));r="Unexpected frame type [".concat(e.type,"]")}this.done=!0,null===(t=this.receiver)||void 0===t||t.cancel(),e.type!==u.FrameTypes.CANCEL&&e.type!==u.FrameTypes.ERROR&&this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:a.ErrorCodes.CANCELED,message:r,streamId:this.streamId}),this.stream.disconnect(this),d.cancel(this)},e.prototype.onError=function(e){this.done?console.warn("Trying to error for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(this.done=!0,this.stream.send({type:u.FrameTypes.ERROR,flags:u.Flags.NONE,code:e instanceof a.RSocketError?e.code:a.ErrorCodes.APPLICATION_ERROR,message:e.message,streamId:this.streamId}),this.stream.disconnect(this))},e.prototype.onNext=function(e,t){var r,i;if(!this.done){if(this.done=!0,(0,l.isFragmentable)(e,this.fragmentSize,u.FrameTypes.PAYLOAD))try{for(var n=o((0,l.fragment)(this.streamId,e,this.fragmentSize,u.FrameTypes.PAYLOAD,!0)),s=n.next();!s.done;s=n.next()){var a=s.value;this.stream.send(a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}else this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.NEXT|u.Flags.COMPLETE|(e.metadata?u.Flags.METADATA:0),data:e.data,metadata:e.metadata,streamId:this.streamId});this.stream.disconnect(this)}},e.prototype.onComplete=function(){this.done||(this.done=!0,this.stream.send({type:u.FrameTypes.PAYLOAD,flags:u.Flags.COMPLETE,streamId:this.streamId,data:null,metadata:null}),this.stream.disconnect(this))},e.prototype.onExtension=function(e,t,r){this.done||this.stream.send({type:u.FrameTypes.EXT,streamId:this.streamId,flags:r?u.Flags.IGNORE:u.Flags.NONE,extendedType:e,extendedContent:t})},e.prototype.close=function(e){var t;this.done?console.warn("Trying to close for the second time. ".concat(e?"Dropping error [".concat(e,"]."):"")):(d.cancel(this),null===(t=this.receiver)||void 0===t||t.cancel())},e}();t.RequestResponseResponderStream=c},974:function(e,t,r){"use strict";var i=r(287).hp,n=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Deserializer=t.sizeOfFrame=t.serializeFrame=t.deserializeFrame=t.serializeFrameWithLength=t.deserializeFrames=t.deserializeFrameWithLength=t.writeUInt64BE=t.readUInt64BE=t.writeUInt24BE=t.readUInt24BE=t.MAX_VERSION=t.MAX_TTL=t.MAX_STREAM_ID=t.MAX_RESUME_LENGTH=t.MAX_REQUEST_N=t.MAX_REQUEST_COUNT=t.MAX_MIME_LENGTH=t.MAX_METADATA_LENGTH=t.MAX_LIFETIME=t.MAX_KEEPALIVE=t.MAX_CODE=t.FRAME_TYPE_OFFFSET=t.FLAGS_MASK=void 0;var s=r(799);t.FLAGS_MASK=1023,t.FRAME_TYPE_OFFFSET=10,t.MAX_CODE=2147483647,t.MAX_KEEPALIVE=2147483647,t.MAX_LIFETIME=2147483647,t.MAX_METADATA_LENGTH=16777215,t.MAX_MIME_LENGTH=255,t.MAX_REQUEST_COUNT=2147483647,t.MAX_REQUEST_N=2147483647,t.MAX_RESUME_LENGTH=65535,t.MAX_STREAM_ID=2147483647,t.MAX_TTL=2147483647,t.MAX_VERSION=65535;var o=4294967296;function a(e,t){return e.readUInt8(t)<<16|e.readUInt8(t+1)<<8|e.readUInt8(t+2)}function l(e,t,r){return r=e.writeUInt8(t>>>16,r),r=e.writeUInt8(t>>>8&255,r),e.writeUInt8(255&t,r)}function u(e,t){var r=e.readUInt32BE(t),i=e.readUInt32BE(t+4);return r*o+i}function d(e,t,r){var i=t/o|0,n=t%o;return r=e.writeUInt32BE(i,r),e.writeUInt32BE(n,r)}function h(e){var t=a(e,0);return p(e.slice(3,3+t))}function c(e){var t,r,i,s;return n(this,function(n){switch(n.label){case 0:t=0,n.label=1;case 1:return t+3<e.length?(r=a(e,t),(s=(i=t+3)+r)>e.length?[3,3]:[4,[p(e.slice(i,s)),t=s]]):[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}})}function p(e){var r=0,i=e.readInt32BE(r);r+=4;var n=e.readUInt16BE(r);r+=2;var o=n>>>t.FRAME_TYPE_OFFFSET,a=n&t.FLAGS_MASK;switch(o){case s.FrameTypes.SETUP:return function(e,t,r){e.length;var i=6,n=e.readUInt16BE(i);i+=2;var o=e.readUInt16BE(i);i+=2;var a=e.readInt32BE(i);i+=4;var l=e.readInt32BE(i);i+=4;var u=null;if(r&s.Flags.RESUME_ENABLE){var d=e.readInt16BE(i);i+=2,u=e.slice(i,i+d),i+=d}var h=e.readUInt8(i);i+=1;var c=e.toString("ascii",i,i+h);i+=h;var p=e.readUInt8(i);i+=1;var f=e.toString("ascii",i,i+p);i+=p;var m={data:null,dataMimeType:f,flags:r,keepAlive:a,lifetime:l,majorVersion:n,metadata:null,metadataMimeType:c,minorVersion:o,resumeToken:u,streamId:0,type:s.FrameTypes.SETUP};return T(e,m,i),m}(e,0,a);case s.FrameTypes.PAYLOAD:return function(e,t,r){e.length;var i={data:null,flags:r,metadata:null,streamId:t,type:s.FrameTypes.PAYLOAD};return T(e,i,6),i}(e,i,a);case s.FrameTypes.ERROR:return function(e,t,r){e.length;var i=6,n=e.readInt32BE(i);i+=4;var o=e.length-i,a="";return o>0&&(a=e.toString("utf8",i,i+o),i+=o),{code:n,flags:r,message:a,streamId:t,type:s.FrameTypes.ERROR}}(e,i,a);case s.FrameTypes.KEEPALIVE:return function(e,t,r){e.length;var i=6,n=u(e,i),o=null;return(i+=8)<e.length&&(o=e.slice(i,e.length)),{data:o,flags:r,lastReceivedPosition:n,streamId:0,type:s.FrameTypes.KEEPALIVE}}(e,0,a);case s.FrameTypes.REQUEST_FNF:return function(e,t,r){e.length;var i={data:null,flags:r,metadata:null,streamId:t,type:s.FrameTypes.REQUEST_FNF};return T(e,i,6),i}(e,i,a);case s.FrameTypes.REQUEST_RESPONSE:return function(e,t,r){var i={data:null,flags:r,metadata:null,streamId:t,type:s.FrameTypes.REQUEST_RESPONSE};return T(e,i,6),i}(e,i,a);case s.FrameTypes.REQUEST_STREAM:return function(e,t,r){e.length;var i=6,n=e.readInt32BE(i);i+=4;var o={data:null,flags:r,metadata:null,requestN:n,streamId:t,type:s.FrameTypes.REQUEST_STREAM};return T(e,o,i),o}(e,i,a);case s.FrameTypes.REQUEST_CHANNEL:return function(e,t,r){e.length;var i=6,n=e.readInt32BE(i);i+=4;var o={data:null,flags:r,metadata:null,requestN:n,streamId:t,type:s.FrameTypes.REQUEST_CHANNEL};return T(e,o,i),o}(e,i,a);case s.FrameTypes.METADATA_PUSH:return function(e,t,r){return{flags:r,metadata:6===length?null:e.slice(6,length),streamId:0,type:s.FrameTypes.METADATA_PUSH}}(e,0,a);case s.FrameTypes.REQUEST_N:return function(e,t,r){return e.length,{flags:r,requestN:e.readInt32BE(6),streamId:t,type:s.FrameTypes.REQUEST_N}}(e,i,a);case s.FrameTypes.RESUME:return function(e,t,r){e.length;var i=6,n=e.readUInt16BE(i);i+=2;var o=e.readUInt16BE(i);i+=2;var a=e.readInt16BE(i);i+=2;var l=e.slice(i,i+a),d=u(e,i+=a),h=u(e,i+=8);return i+=8,{clientPosition:h,flags:r,majorVersion:n,minorVersion:o,resumeToken:l,serverPosition:d,streamId:0,type:s.FrameTypes.RESUME}}(e,0,a);case s.FrameTypes.RESUME_OK:return function(e,t,r){return e.length,{clientPosition:u(e,6),flags:r,streamId:0,type:s.FrameTypes.RESUME_OK}}(e,0,a);case s.FrameTypes.CANCEL:return function(e,t,r){return e.length,{flags:r,streamId:t,type:s.FrameTypes.CANCEL}}(e,i,a);case s.FrameTypes.LEASE:return function(e,t,r){var i=6,n=e.readUInt32BE(i);i+=4;var o=e.readUInt32BE(i),a=null;return(i+=4)<e.length&&(a=e.slice(i,e.length)),{flags:r,metadata:a,requestCount:o,streamId:0,ttl:n,type:s.FrameTypes.LEASE}}(e,0,a)}}function f(e){switch(e.type){case s.FrameTypes.SETUP:return function(e){var t=null!=e.resumeToken?e.resumeToken.byteLength:0,r=null!=e.metadataMimeType?i.byteLength(e.metadataMimeType,"ascii"):0,n=null!=e.dataMimeType?i.byteLength(e.dataMimeType,"ascii"):0,o=k(e),a=i.allocUnsafe(6+m+(t?g+t:0)+r+n+o),l=M(e,a);return l=a.writeUInt16BE(e.majorVersion,l),l=a.writeUInt16BE(e.minorVersion,l),l=a.writeUInt32BE(e.keepAlive,l),l=a.writeUInt32BE(e.lifetime,l),e.flags&s.Flags.RESUME_ENABLE&&(l=a.writeUInt16BE(t,l),null!=e.resumeToken&&(l+=e.resumeToken.copy(a,l))),l=a.writeUInt8(r,l),null!=e.metadataMimeType&&(l+=a.write(e.metadataMimeType,l,l+r,"ascii")),l=a.writeUInt8(n,l),null!=e.dataMimeType&&(l+=a.write(e.dataMimeType,l,l+n,"ascii")),F(e,a,l),a}(e);case s.FrameTypes.PAYLOAD:return function(e){var t=k(e),r=i.allocUnsafe(6+t);return F(e,r,M(e,r)),r}(e);case s.FrameTypes.ERROR:return function(e){var t=null!=e.message?i.byteLength(e.message,"utf8"):0,r=i.allocUnsafe(6+y+t),n=M(e,r);return n=r.writeUInt32BE(e.code,n),null!=e.message&&r.write(e.message,n,n+t,"utf8"),r}(e);case s.FrameTypes.KEEPALIVE:return function(e){var t=null!=e.data?e.data.byteLength:0,r=i.allocUnsafe(6+v+t),n=M(e,r);return n=d(r,e.lastReceivedPosition,n),null!=e.data&&e.data.copy(r,n),r}(e);case s.FrameTypes.REQUEST_FNF:case s.FrameTypes.REQUEST_RESPONSE:return function(e){var t=k(e),r=i.allocUnsafe(6+t);return F(e,r,M(e,r)),r}(e);case s.FrameTypes.REQUEST_STREAM:case s.FrameTypes.REQUEST_CHANNEL:return function(e){var t=k(e),r=i.allocUnsafe(6+I+t),n=M(e,r);return n=r.writeUInt32BE(e.requestN,n),F(e,r,n),r}(e);case s.FrameTypes.METADATA_PUSH:return function(e){var t,r=e.metadata;if(null!=r){var n=M(e,t=i.allocUnsafe(6+r.byteLength));return r.copy(t,n),t}return M(e,t=i.allocUnsafe(6)),t}(e);case s.FrameTypes.REQUEST_N:return function(e){var t=i.allocUnsafe(6+E),r=M(e,t);return t.writeUInt32BE(e.requestN,r),t}(e);case s.FrameTypes.RESUME:return function(e){var t=e.resumeToken.byteLength,r=i.allocUnsafe(6+w+t),n=M(e,r);return n=r.writeUInt16BE(e.majorVersion,n),n=r.writeUInt16BE(e.minorVersion,n),n=r.writeUInt16BE(t,n),n+=e.resumeToken.copy(r,n),n=d(r,e.serverPosition,n),d(r,e.clientPosition,n),r}(e);case s.FrameTypes.RESUME_OK:return function(e){var t=i.allocUnsafe(6+S),r=M(e,t);return d(t,e.clientPosition,r),t}(e);case s.FrameTypes.CANCEL:return function(e){var t=i.allocUnsafe(6);return M(e,t),t}(e);case s.FrameTypes.LEASE:return function(e){var t=null!=e.metadata?e.metadata.byteLength:0,r=i.allocUnsafe(6+b+t),n=M(e,r);return n=r.writeUInt32BE(e.ttl,n),n=r.writeUInt32BE(e.requestCount,n),null!=e.metadata&&e.metadata.copy(r,n),r}(e)}}t.readUInt24BE=a,t.writeUInt24BE=l,t.readUInt64BE=u,t.writeUInt64BE=d,t.deserializeFrameWithLength=h,t.deserializeFrames=c,t.serializeFrameWithLength=function(e){var t=f(e),r=i.allocUnsafe(t.length+3);return l(r,t.length,0),t.copy(r,3),r},t.deserializeFrame=p,t.serializeFrame=f,t.sizeOfFrame=function(e){switch(e.type){case s.FrameTypes.SETUP:return function(e){var t=null!=e.resumeToken?e.resumeToken.byteLength:0,r=null!=e.metadataMimeType?i.byteLength(e.metadataMimeType,"ascii"):0,n=null!=e.dataMimeType?i.byteLength(e.dataMimeType,"ascii"):0,s=k(e);return 6+m+(t?g+t:0)+r+n+s}(e);case s.FrameTypes.PAYLOAD:return function(e){return 6+k(e)}(e);case s.FrameTypes.ERROR:return function(e){var t=null!=e.message?i.byteLength(e.message,"utf8"):0;return 6+y+t}(e);case s.FrameTypes.KEEPALIVE:return function(e){var t=null!=e.data?e.data.byteLength:0;return 6+v+t}(e);case s.FrameTypes.REQUEST_FNF:case s.FrameTypes.REQUEST_RESPONSE:return function(e){return 6+k(e)}(e);case s.FrameTypes.REQUEST_STREAM:case s.FrameTypes.REQUEST_CHANNEL:return function(e){var t=k(e);return 6+I+t}(e);case s.FrameTypes.METADATA_PUSH:return function(e){return 6+(null!=e.metadata?e.metadata.byteLength:0)}(e);case s.FrameTypes.REQUEST_N:return 6+E;case s.FrameTypes.RESUME:return function(e){var t=e.resumeToken.byteLength;return 6+w+t}(e);case s.FrameTypes.RESUME_OK:return 6+S;case s.FrameTypes.CANCEL:return 6;case s.FrameTypes.LEASE:return function(e){var t=null!=e.metadata?e.metadata.byteLength:0;return 6+b+t}(e)}};var m=14,g=2,y=4,v=8,b=8,I=4,E=4,w=22,S=8;function M(e,r){var i=r.writeInt32BE(e.streamId,0);return r.writeUInt16BE(e.type<<t.FRAME_TYPE_OFFFSET|e.flags&t.FLAGS_MASK,i)}function k(e){var t=0;return null!=e.data&&(t+=e.data.byteLength),s.Flags.hasMetadata(e.flags)&&(t+=3,null!=e.metadata&&(t+=e.metadata.byteLength)),t}function F(e,t,r){s.Flags.hasMetadata(e.flags)&&(null!=e.metadata?(r=l(t,e.metadata.byteLength,r),r+=e.metadata.copy(t,r)):r=l(t,0,r)),null!=e.data&&e.data.copy(t,r)}function T(e,t,r){if(s.Flags.hasMetadata(t.flags)){var i=a(e,r);r+=3,i>0&&(t.metadata=e.slice(r,r+i),r+=i)}r<e.length&&(t.data=e.slice(r,e.length))}var R=function(){function e(){}return e.prototype.deserializeFrame=function(e){return p(e)},e.prototype.deserializeFrameWithLength=function(e){return h(e)},e.prototype.deserializeFrames=function(e){return c(e)},e}();t.Deserializer=R}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,r),s.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.d(i,{default:()=>Ai});var e={};r.r(e),r.d(e,{hasBrowserEnv:()=>Te,hasStandardBrowserEnv:()=>Ae,hasStandardBrowserWebWorkerEnv:()=>Ce,navigator:()=>Re,origin:()=>Oe});var t,n,s,o,a,l=r(225),u=r(927),d=r(837);class h{messageId="";joinId=0;fromId="";fromName="";destId="";destName="";cite="";type="";title="";subtitle="";text="";secret="";thumb="";host="";url="";lng="";lat="";size=0;length=0;label=null;tag="";sent="";revoke=!1;talk=n.default;citeData=null;sentDate=null;hintList=null;notifyList=null;quietlyList=null}!function(e){e.tip="tip",e.notice="notice",e.action="action",e.notify="notify",e.quietly="quietly"}(t||(t={})),function(e){e[e.default=1]="default",e[e.group=2]="group",e[e.team=3]="team"}(n||(n={}));class c{contactId=0;userId="";joinId=0;nickname="";username="";avatar="";subgroup="";status=o.done;isGroup=!1;joinTime="";isMuted=!1;noise=1;sort=0}!function(e){e[e.normal=1]="normal",e[e.not_notify=2]="not_notify",e[e.reject=0]="reject"}(s||(s={})),function(e){e.done="",e.offline="offline",e.online="online",e.online_busy="online-busy",e.online_leave="online-leave"}(o||(o={}));class p{memberId=0;joinId=0;userId="";nickname="";username="";avatar="";role="";status="";joinTime="";isMuted=!1}class f{name="";region="";host="";port="";max=0;type=!0;current=0}class m{deviceId="";deviceKey="";deviceTag="";userId="";joinId=0;status="";region="";gateway=""}class g{groupId=0;joinId=0;userId="";groupName="";groupNumber="";avatar="";members=void 0;depict="";isGroup=!1;isTalk=!1;isMute=!1;isApproval=!0;isInviteApply=!0;isInvite=!0;isRevoke=!0;maxMember=200;ask="";remark="";type=a.protected;isLive=!1}function y(e,t){return function(){return e.apply(t,arguments)}}!function(e){e[e.public=1]="public",e[e.protected=2]="protected",e[e.private=3]="private"}(a||(a={}));const{toString:v}=Object.prototype,{getPrototypeOf:b}=Object,{iterator:I,toStringTag:E}=Symbol,w=(S=Object.create(null),e=>{const t=v.call(e);return S[t]||(S[t]=t.slice(8,-1).toLowerCase())});var S;const M=e=>(e=e.toLowerCase(),t=>w(t)===e),k=e=>t=>typeof t===e,{isArray:F}=Array,T=k("undefined");function R(e){return null!==e&&!T(e)&&null!==e.constructor&&!T(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const A=M("ArrayBuffer"),C=k("string"),O=k("function"),N=k("number"),x=e=>null!==e&&"object"==typeof e,_=e=>{if("object"!==w(e))return!1;const t=b(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||E in e||I in e)},D=M("Date"),L=M("File"),P=M("Blob"),U=M("FileList"),j=M("URLSearchParams"),[B,W,z,G]=["ReadableStream","Request","Response","Headers"].map(M);function V(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let i,n;if("object"!=typeof e&&(e=[e]),F(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{if(R(e))return;const n=r?Object.getOwnPropertyNames(e):Object.keys(e),s=n.length;let o;for(i=0;i<s;i++)o=n[i],t.call(null,e[o],o,e)}}function q(e,t){if(R(e))return null;t=t.toLowerCase();const r=Object.keys(e);let i,n=r.length;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,H=e=>!T(e)&&e!==K,Y=(X="undefined"!=typeof Uint8Array&&b(Uint8Array),e=>X&&e instanceof X);var X;const J=M("HTMLFormElement"),Z=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Q=M("RegExp"),$=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),i={};V(r,(r,n)=>{let s;!1!==(s=t(r,n,e))&&(i[n]=s||r)}),Object.defineProperties(e,i)},ee=M("AsyncFunction"),te=(re="function"==typeof setImmediate,ie=O(K.postMessage),re?setImmediate:ie?(ne=`axios@${Math.random()}`,se=[],K.addEventListener("message",({source:e,data:t})=>{e===K&&t===ne&&se.length&&se.shift()()},!1),e=>{se.push(e),K.postMessage(ne,"*")}):e=>setTimeout(e));var re,ie,ne,se;const oe="undefined"!=typeof queueMicrotask?queueMicrotask.bind(K):"undefined"!=typeof process&&process.nextTick||te,ae={isArray:F,isArrayBuffer:A,isBuffer:R,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||O(e.append)&&("formdata"===(t=w(e))||"object"===t&&O(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&A(e.buffer),t},isString:C,isNumber:N,isBoolean:e=>!0===e||!1===e,isObject:x,isPlainObject:_,isEmptyObject:e=>{if(!x(e)||R(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:B,isRequest:W,isResponse:z,isHeaders:G,isUndefined:T,isDate:D,isFile:L,isBlob:P,isRegExp:Q,isFunction:O,isStream:e=>x(e)&&O(e.pipe),isURLSearchParams:j,isTypedArray:Y,isFileList:U,forEach:V,merge:function e(){const{caseless:t,skipUndefined:r}=H(this)&&this||{},i={},n=(n,s)=>{const o=t&&q(i,s)||s;_(i[o])&&_(n)?i[o]=e(i[o],n):_(n)?i[o]=e({},n):F(n)?i[o]=n.slice():r&&T(n)||(i[o]=n)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&V(arguments[e],n);return i},extend:(e,t,r,{allOwnKeys:i}={})=>(V(t,(t,i)=>{r&&O(t)?e[i]=y(t,r):e[i]=t},{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,i)=>{let n,s,o;const a={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)o=n[s],i&&!i(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==r&&b(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:w,kindOfTest:M,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const i=e.indexOf(t,r);return-1!==i&&i===r},toArray:e=>{if(!e)return null;if(F(e))return e;let t=e.length;if(!N(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[I]).call(e);let i;for(;(i=r.next())&&!i.done;){const r=i.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const i=[];for(;null!==(r=e.exec(t));)i.push(r);return i},isHTMLForm:J,hasOwnProperty:Z,hasOwnProp:Z,reduceDescriptors:$,freezeMethods:e=>{$(e,(t,r)=>{if(O(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const i=e[r];O(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},i=e=>{e.forEach(e=>{r[e]=!0})};return F(e)?i(e):i(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:q,global:K,isContextDefined:H,isSpecCompliantForm:function(e){return!!(e&&O(e.append)&&"FormData"===e[E]&&e[I])},toJSONObject:e=>{const t=new Array(10),r=(e,i)=>{if(x(e)){if(t.indexOf(e)>=0)return;if(R(e))return e;if(!("toJSON"in e)){t[i]=e;const n=F(e)?[]:{};return V(e,(e,t)=>{const s=r(e,i+1);!T(s)&&(n[t]=s)}),t[i]=void 0,n}}return e};return r(e,0)},isAsyncFn:ee,isThenable:e=>e&&(x(e)||O(e))&&O(e.then)&&O(e.catch),setImmediate:te,asap:oe,isIterable:e=>null!=e&&O(e[I])};function le(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}ae.inherits(le,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ae.toJSONObject(this.config),code:this.code,status:this.status}}});const ue=le.prototype,de={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{de[e]={value:e}}),Object.defineProperties(le,de),Object.defineProperty(ue,"isAxiosError",{value:!0}),le.from=(e,t,r,i,n,s)=>{const o=Object.create(ue);ae.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return le.call(o,a,l,r,i,n),e&&null==o.cause&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",s&&Object.assign(o,s),o};const he=le;var ce=r(287).hp;function pe(e){return ae.isPlainObject(e)||ae.isArray(e)}function fe(e){return ae.endsWith(e,"[]")?e.slice(0,-2):e}function me(e,t,r){return e?e.concat(t).map(function(e,t){return e=fe(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const ge=ae.toFlatObject(ae,{},null,function(e){return/^is[A-Z]/.test(e)}),ye=function(e,t,r){if(!ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(r=ae.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!ae.isUndefined(t[e])})).metaTokens,n=r.visitor||u,s=r.dots,o=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&ae.isSpecCompliantForm(t);if(!ae.isFunction(n))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(ae.isDate(e))return e.toISOString();if(ae.isBoolean(e))return e.toString();if(!a&&ae.isBlob(e))throw new he("Blob is not supported. Use a Buffer instead.");return ae.isArrayBuffer(e)||ae.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):ce.from(e):e}function u(e,r,n){let a=e;if(e&&!n&&"object"==typeof e)if(ae.endsWith(r,"{}"))r=i?r:r.slice(0,-2),e=JSON.stringify(e);else if(ae.isArray(e)&&function(e){return ae.isArray(e)&&!e.some(pe)}(e)||(ae.isFileList(e)||ae.endsWith(r,"[]"))&&(a=ae.toArray(e)))return r=fe(r),a.forEach(function(e,i){!ae.isUndefined(e)&&null!==e&&t.append(!0===o?me([r],i,s):null===o?r:r+"[]",l(e))}),!1;return!!pe(e)||(t.append(me(n,r,s),l(e)),!1)}const d=[],h=Object.assign(ge,{defaultVisitor:u,convertValue:l,isVisitable:pe});if(!ae.isObject(e))throw new TypeError("data must be an object");return function e(r,i){if(!ae.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+i.join("."));d.push(r),ae.forEach(r,function(r,s){!0===(!(ae.isUndefined(r)||null===r)&&n.call(t,r,ae.isString(s)?s.trim():s,i,h))&&e(r,i?i.concat(s):[s])}),d.pop()}}(e),t};function ve(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function be(e,t){this._pairs=[],e&&ye(e,this,t)}const Ie=be.prototype;Ie.append=function(e,t){this._pairs.push([e,t])},Ie.toString=function(e){const t=e?function(t){return e.call(this,t,ve)}:ve;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Ee=be;function we(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Se(e,t,r){if(!t)return e;const i=r&&r.encode||we;ae.isFunction(r)&&(r={serialize:r});const n=r&&r.serialize;let s;if(s=n?n(t,r):ae.isURLSearchParams(t)?t.toString():new Ee(t,r).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Me=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ae.forEach(this.handlers,function(t){null!==t&&e(t)})}},ke={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ee,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Te="undefined"!=typeof window&&"undefined"!=typeof document,Re="object"==typeof navigator&&navigator||void 0,Ae=Te&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),Ce="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Oe=Te&&window.location.href||"http://localhost",Ne={...e,...Fe},xe=function(e){function t(e,r,i,n){let s=e[n++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=n>=e.length;return s=!s&&ae.isArray(i)?i.length:s,a?(ae.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!o):(i[s]&&ae.isObject(i[s])||(i[s]=[]),t(e,r,i[s],n)&&ae.isArray(i[s])&&(i[s]=function(e){const t={},r=Object.keys(e);let i;const n=r.length;let s;for(i=0;i<n;i++)s=r[i],t[s]=e[s];return t}(i[s])),!o)}if(ae.isFormData(e)&&ae.isFunction(e.entries)){const r={};return ae.forEachEntry(e,(e,i)=>{t(function(e){return ae.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),i,r,0)}),r}return null},_e={transitional:ke,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",i=r.indexOf("application/json")>-1,n=ae.isObject(e);if(n&&ae.isHTMLForm(e)&&(e=new FormData(e)),ae.isFormData(e))return i?JSON.stringify(xe(e)):e;if(ae.isArrayBuffer(e)||ae.isBuffer(e)||ae.isStream(e)||ae.isFile(e)||ae.isBlob(e)||ae.isReadableStream(e))return e;if(ae.isArrayBufferView(e))return e.buffer;if(ae.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(n){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ye(e,new Ne.classes.URLSearchParams,{visitor:function(e,t,r,i){return Ne.isNode&&ae.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=ae.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ye(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),function(e){if(ae.isString(e))try{return(0,JSON.parse)(e),ae.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||_e.transitional,r=t&&t.forcedJSONParsing,i="json"===this.responseType;if(ae.isResponse(e)||ae.isReadableStream(e))return e;if(e&&ae.isString(e)&&(r&&!this.responseType||i)){const r=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw he.from(e,he.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ne.classes.FormData,Blob:Ne.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ae.forEach(["delete","get","head","post","put","patch"],e=>{_e.headers[e]={}});const De=_e,Le=ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Pe=Symbol("internals");function Ue(e){return e&&String(e).trim().toLowerCase()}function je(e){return!1===e||null==e?e:ae.isArray(e)?e.map(je):String(e)}function Be(e,t,r,i,n){return ae.isFunction(i)?i.call(this,t,r):(n&&(t=r),ae.isString(t)?ae.isString(i)?-1!==t.indexOf(i):ae.isRegExp(i)?i.test(t):void 0:void 0)}class We{constructor(e){e&&this.set(e)}set(e,t,r){const i=this;function n(e,t,r){const n=Ue(t);if(!n)throw new Error("header name must be a non-empty string");const s=ae.findKey(i,n);(!s||void 0===i[s]||!0===r||void 0===r&&!1!==i[s])&&(i[s||t]=je(e))}const s=(e,t)=>ae.forEach(e,(e,r)=>n(e,r,t));if(ae.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(ae.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let r,i,n;return e&&e.split("\n").forEach(function(e){n=e.indexOf(":"),r=e.substring(0,n).trim().toLowerCase(),i=e.substring(n+1).trim(),!r||t[r]&&Le[r]||("set-cookie"===r?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t})(e),t);else if(ae.isObject(e)&&ae.isIterable(e)){let r,i,n={};for(const t of e){if(!ae.isArray(t))throw TypeError("Object iterator must return a key-value pair");n[i=t[0]]=(r=n[i])?ae.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}s(n,t)}else null!=e&&n(t,e,r);return this}get(e,t){if(e=Ue(e)){const r=ae.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}(e);if(ae.isFunction(t))return t.call(this,e,r);if(ae.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ue(e)){const r=ae.findKey(this,e);return!(!r||void 0===this[r]||t&&!Be(0,this[r],r,t))}return!1}delete(e,t){const r=this;let i=!1;function n(e){if(e=Ue(e)){const n=ae.findKey(r,e);!n||t&&!Be(0,r[n],n,t)||(delete r[n],i=!0)}}return ae.isArray(e)?e.forEach(n):n(e),i}clear(e){const t=Object.keys(this);let r=t.length,i=!1;for(;r--;){const n=t[r];e&&!Be(0,this[n],n,e,!0)||(delete this[n],i=!0)}return i}normalize(e){const t=this,r={};return ae.forEach(this,(i,n)=>{const s=ae.findKey(r,n);if(s)return t[s]=je(i),void delete t[n];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(n):String(n).trim();o!==n&&delete t[n],t[o]=je(i),r[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ae.forEach(this,(r,i)=>{null!=r&&!1!==r&&(t[i]=e&&ae.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Pe]=this[Pe]={accessors:{}}).accessors,r=this.prototype;function i(e){const i=Ue(e);t[i]||(function(e,t){const r=ae.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(e,r,n){return this[i].call(this,t,e,r,n)},configurable:!0})})}(r,e),t[i]=!0)}return ae.isArray(e)?e.forEach(i):i(e),this}}We.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ae.reduceDescriptors(We.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),ae.freezeMethods(We);const ze=We;function Ge(e,t){const r=this||De,i=t||r,n=ze.from(i.headers);let s=i.data;return ae.forEach(e,function(e){s=e.call(r,s,n.normalize(),t?t.status:void 0)}),n.normalize(),s}function Ve(e){return!(!e||!e.__CANCEL__)}function qe(e,t,r){he.call(this,null==e?"canceled":e,he.ERR_CANCELED,t,r),this.name="CanceledError"}ae.inherits(qe,he,{__CANCEL__:!0});const Ke=qe;function He(e,t,r){const i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new he("Request failed with status code "+r.status,[he.ERR_BAD_REQUEST,he.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const Ye=(e,t,r=3)=>{let i=0;const n=function(e,t){e=e||10;const r=new Array(e),i=new Array(e);let n,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),u=i[o];n||(n=l),r[s]=a,i[s]=l;let d=o,h=0;for(;d!==s;)h+=r[d++],d%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-n<t)return;const c=u&&l-u;return c?Math.round(1e3*h/c):void 0}}(50,250);return function(e,t){let r,i,n=0,s=1e3/t;const o=(t,s=Date.now())=>{n=s,r=null,i&&(clearTimeout(i),i=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-n;a>=s?o(e,t):(r=e,i||(i=setTimeout(()=>{i=null,o(r)},s-a)))},()=>r&&o(r)]}(r=>{const s=r.loaded,o=r.lengthComputable?r.total:void 0,a=s-i,l=n(a);i=s,e({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:r,lengthComputable:null!=o,[t?"download":"upload"]:!0})},r)},Xe=(e,t)=>{const r=null!=e;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},Je=e=>(...t)=>ae.asap(()=>e(...t)),Ze=Ne.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ne.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ne.origin),Ne.navigator&&/(msie|trident)/i.test(Ne.navigator.userAgent)):()=>!0,Qe=Ne.hasStandardBrowserEnv?{write(e,t,r,i,n,s){const o=[e+"="+encodeURIComponent(t)];ae.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),ae.isString(i)&&o.push("path="+i),ae.isString(n)&&o.push("domain="+n),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function $e(e,t,r){let i=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(i||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const et=e=>e instanceof ze?{...e}:e;function tt(e,t){t=t||{};const r={};function i(e,t,r,i){return ae.isPlainObject(e)&&ae.isPlainObject(t)?ae.merge.call({caseless:i},e,t):ae.isPlainObject(t)?ae.merge({},t):ae.isArray(t)?t.slice():t}function n(e,t,r,n){return ae.isUndefined(t)?ae.isUndefined(e)?void 0:i(void 0,e,0,n):i(e,t,0,n)}function s(e,t){if(!ae.isUndefined(t))return i(void 0,t)}function o(e,t){return ae.isUndefined(t)?ae.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function a(r,n,s){return s in t?i(r,n):s in e?i(void 0,r):void 0}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t,r)=>n(et(e),et(t),0,!0)};return ae.forEach(Object.keys({...e,...t}),function(i){const s=l[i]||n,o=s(e[i],t[i],i);ae.isUndefined(o)&&s!==a||(r[i]=o)}),r}const rt=e=>{const t=tt({},e);let{data:r,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:s,headers:o,auth:a}=t;if(t.headers=o=ze.from(o),t.url=Se($e(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),ae.isFormData(r))if(Ne.hasStandardBrowserEnv||Ne.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(ae.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&o.set(e,r)})}if(Ne.hasStandardBrowserEnv&&(i&&ae.isFunction(i)&&(i=i(t)),i||!1!==i&&Ze(t.url))){const e=n&&s&&Qe.read(s);e&&o.set(n,e)}return t},it="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const i=rt(e);let n=i.data;const s=ze.from(i.headers).normalize();let o,a,l,u,d,{responseType:h,onUploadProgress:c,onDownloadProgress:p}=i;function f(){u&&u(),d&&d(),i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const i=ze.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());He(function(e){t(e),f()},function(e){r(e),f()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:i,config:e,request:m}),m=null}m.open(i.method.toUpperCase(),i.url,!0),m.timeout=i.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(r(new he("Request aborted",he.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const i=t&&t.message?t.message:"Network Error",n=new he(i,he.ERR_NETWORK,e,m);n.event=t||null,r(n),m=null},m.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const n=i.transitional||ke;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),r(new he(t,n.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,m)),m=null},void 0===n&&s.setContentType(null),"setRequestHeader"in m&&ae.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),ae.isUndefined(i.withCredentials)||(m.withCredentials=!!i.withCredentials),h&&"json"!==h&&(m.responseType=i.responseType),p&&([l,d]=Ye(p,!0),m.addEventListener("progress",l)),c&&m.upload&&([a,u]=Ye(c),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(i.cancelToken||i.signal)&&(o=t=>{m&&(r(!t||t.type?new Ke(null,e,m):t),m.abort(),m=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);y&&-1===Ne.protocols.indexOf(y)?r(new he("Unsupported protocol "+y+":",he.ERR_BAD_REQUEST,e)):m.send(n||null)})},nt=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,i=new AbortController;const n=function(e){if(!r){r=!0,o();const t=e instanceof Error?e:this.reason;i.abort(t instanceof he?t:new Ke(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,n(new he(`timeout ${t} of ms exceeded`,he.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(n):e.removeEventListener("abort",n)}),e=null)};e.forEach(e=>e.addEventListener("abort",n));const{signal:a}=i;return a.unsubscribe=()=>ae.asap(o),a}},st=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let i,n=0;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},ot=(e,t,r,i)=>{const n=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*st(r,t)}(e,t);let s,o=0,a=e=>{s||(s=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await n.next();if(t)return a(),void e.close();let s=i.byteLength;if(r){let e=o+=s;r(e)}e.enqueue(new Uint8Array(i))}catch(e){throw a(e),e}},cancel:e=>(a(e),n.return())},{highWaterMark:2})},{isFunction:at}=ae,lt=(({Request:e,Response:t})=>({Request:e,Response:t}))(ae.global),{ReadableStream:ut,TextEncoder:dt}=ae.global,ht=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ct=e=>{e=ae.merge.call({skipUndefined:!0},lt,e);const{fetch:t,Request:r,Response:i}=e,n=t?at(t):"function"==typeof fetch,s=at(r),o=at(i);if(!n)return!1;const a=n&&at(ut),l=n&&("function"==typeof dt?(u=new dt,e=>u.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var u;const d=s&&a&&ht(()=>{let e=!1;const t=new r(Ne.origin,{body:new ut,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=o&&a&&ht(()=>ae.isReadableStream(new i("").body)),c={stream:h&&(e=>e.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!c[e]&&(c[e]=(t,r)=>{let i=t&&t[e];if(i)return i.call(t);throw new he(`Response type '${e}' is not supported`,he.ERR_NOT_SUPPORT,r)})});return async e=>{let{url:n,method:o,data:a,signal:u,cancelToken:p,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:v,withCredentials:b="same-origin",fetchOptions:I}=rt(e),E=t||fetch;y=y?(y+"").toLowerCase():"text";let w=nt([u,p&&p.toAbortSignal()],f),S=null;const M=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let k;try{if(g&&d&&"get"!==o&&"head"!==o&&0!==(k=await(async(e,t)=>{const i=ae.toFiniteNumber(e.getContentLength());return null==i?(async e=>{if(null==e)return 0;if(ae.isBlob(e))return e.size;if(ae.isSpecCompliantForm(e)){const t=new r(Ne.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ae.isArrayBufferView(e)||ae.isArrayBuffer(e)?e.byteLength:(ae.isURLSearchParams(e)&&(e+=""),ae.isString(e)?(await l(e)).byteLength:void 0)})(t):i})(v,a))){let e,t=new r(n,{method:"POST",body:a,duplex:"half"});if(ae.isFormData(a)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,r]=Xe(k,Ye(Je(g)));a=ot(t.body,65536,e,r)}}ae.isString(b)||(b=b?"include":"omit");const t=s&&"credentials"in r.prototype,u={...I,signal:w,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};S=s&&new r(n,u);let p=await(s?E(S,I):E(n,u));const f=h&&("stream"===y||"response"===y);if(h&&(m||f&&M)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});const t=ae.toFiniteNumber(p.headers.get("content-length")),[r,n]=m&&Xe(t,Ye(Je(m),!0))||[];p=new i(ot(p.body,65536,r,()=>{n&&n(),M&&M()}),e)}y=y||"text";let F=await c[ae.findKey(c,y)||"text"](p,e);return!f&&M&&M(),await new Promise((t,r)=>{He(t,r,{data:F,headers:ze.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:S})})}catch(t){if(M&&M(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new he("Network Error",he.ERR_NETWORK,e,S),{cause:t.cause||t});throw he.from(t,t&&t.code,e,S)}}},pt=new Map,ft=e=>{let t=e?e.env:{};const{fetch:r,Request:i,Response:n}=t,s=[i,n,r];let o,a,l=s.length,u=pt;for(;l--;)o=s[l],a=u.get(o),void 0===a&&u.set(o,a=l?new Map:ct(t)),u=a;return a},mt=(ft(),{http:null,xhr:it,fetch:{get:ft}});ae.forEach(mt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const gt=e=>`- ${e}`,yt=e=>ae.isFunction(e)||null===e||!1===e,vt=(e,t)=>{e=ae.isArray(e)?e:[e];const{length:r}=e;let i,n;const s={};for(let o=0;o<r;o++){let r;if(i=e[o],n=i,!yt(i)&&(n=mt[(r=String(i)).toLowerCase()],void 0===n))throw new he(`Unknown adapter '${r}'`);if(n&&(ae.isFunction(n)||(n=n.get(t))))break;s[r||"#"+o]=n}if(!n){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=r?e.length>1?"since :\n"+e.map(gt).join("\n"):" "+gt(e[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return n};function bt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ke(null,e)}function It(e){return bt(e),e.headers=ze.from(e.headers),e.data=Ge.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vt(e.adapter||De.adapter,e)(e).then(function(t){return bt(e),t.data=Ge.call(e,e.transformResponse,t),t.headers=ze.from(t.headers),t},function(t){return Ve(t)||(bt(e),t&&t.response&&(t.response.data=Ge.call(e,e.transformResponse,t.response),t.response.headers=ze.from(t.response.headers))),Promise.reject(t)})}const Et="1.12.2",wt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const St={};wt.transitional=function(e,t,r){function i(e,t){return"[Axios v"+Et+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,n,s)=>{if(!1===e)throw new he(i(n," has been removed"+(t?" in "+t:"")),he.ERR_DEPRECATED);return t&&!St[n]&&(St[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},wt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Mt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let n=i.length;for(;n-- >0;){const s=i[n],o=t[s];if(o){const t=e[s],r=void 0===t||o(t,s,e);if(!0!==r)throw new he("option "+s+" must be "+r,he.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new he("Unknown option "+s,he.ERR_BAD_OPTION)}},validators:wt},kt=Mt.validators;class Ft{constructor(e){this.defaults=e||{},this.interceptors={request:new Me,response:new Me}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=tt(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:n}=t;void 0!==r&&Mt.assertOptions(r,{silentJSONParsing:kt.transitional(kt.boolean),forcedJSONParsing:kt.transitional(kt.boolean),clarifyTimeoutError:kt.transitional(kt.boolean)},!1),null!=i&&(ae.isFunction(i)?t.paramsSerializer={serialize:i}:Mt.assertOptions(i,{encode:kt.function,serialize:kt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Mt.assertOptions(t,{baseUrl:kt.spelling("baseURL"),withXsrfToken:kt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=n&&ae.merge(n.common,n[t.method]);n&&ae.forEach(["delete","get","head","post","put","patch","common"],e=>{delete n[e]}),t.headers=ze.concat(s,n);const o=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))});const l=[];let u;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let d,h=0;if(!a){const e=[It.bind(this),void 0];for(e.unshift(...o),e.push(...l),d=e.length,u=Promise.resolve(t);h<d;)u=u.then(e[h++],e[h++]);return u}d=o.length;let c=t;for(;h<d;){const e=o[h++],t=o[h++];try{c=e(c)}catch(e){t.call(this,e);break}}try{u=It.call(this,c)}catch(e){return Promise.reject(e)}for(h=0,d=l.length;h<d;)u=u.then(l[h++],l[h++]);return u}getUri(e){return Se($e((e=tt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}ae.forEach(["delete","get","head","options"],function(e){Ft.prototype[e]=function(t,r){return this.request(tt(r||{},{method:e,url:t,data:(r||{}).data}))}}),ae.forEach(["post","put","patch"],function(e){function t(t){return function(r,i,n){return this.request(tt(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}Ft.prototype[e]=t(),Ft.prototype[e+"Form"]=t(!0)});const Tt=Ft;class Rt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const i=new Promise(e=>{r.subscribe(e),t=e}).then(e);return i.cancel=function(){r.unsubscribe(t)},i},e(function(e,i,n){r.reason||(r.reason=new Ke(e,i,n),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Rt(function(t){e=t}),cancel:e}}}const At=Rt,Ct={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ct).forEach(([e,t])=>{Ct[t]=e});const Ot=Ct,Nt=function e(t){const r=new Tt(t),i=y(Tt.prototype.request,r);return ae.extend(i,Tt.prototype,r,{allOwnKeys:!0}),ae.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(tt(t,r))},i}(De);Nt.Axios=Tt,Nt.CanceledError=Ke,Nt.CancelToken=At,Nt.isCancel=Ve,Nt.VERSION=Et,Nt.toFormData=ye,Nt.AxiosError=he,Nt.Cancel=Nt.CanceledError,Nt.all=function(e){return Promise.all(e)},Nt.spread=function(e){return function(t){return e.apply(null,t)}},Nt.isAxiosError=function(e){return ae.isObject(e)&&!0===e.isAxiosError},Nt.mergeConfig=tt,Nt.AxiosHeaders=ze,Nt.formToJSON=e=>xe(ae.isHTMLForm(e)?new FormData(e):e),Nt.getAdapter=vt,Nt.HttpStatusCode=Ot,Nt.default=Nt;const xt=Nt;var _t,Dt,Lt,Pt,Ut,jt,Bt=r(339);!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[8,10,11,12,13],this.#e),Array.isArray(e)||"object"!=typeof e||("deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"userId"in e&&null!=e.userId&&(this.userId=e.userId),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"teamId"in e&&null!=e.teamId&&(this.teamId=e.teamId),"startTime"in e&&null!=e.startTime&&(this.startTime=e.startTime),"endTime"in e&&null!=e.endTime&&(this.endTime=e.endTime),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"token"in e&&null!=e.token&&(this.token=e.token),"roomIds"in e&&null!=e.roomIds&&(this.roomIds=e.roomIds),"userIds"in e&&null!=e.userIds&&(this.userIds=e.userIds),"teamIds"in e&&null!=e.teamIds&&(this.teamIds=e.teamIds),"keys"in e&&null!=e.keys&&(this.keys=e.keys),"page"in e&&null!=e.page&&(this.page=e.page),"pageSize"in e&&null!=e.pageSize&&(this.pageSize=e.pageSize),"version"in e&&null!=e.version&&(this.version=e.version),"v"in e&&null!=e.v&&(this.v=e.v),"talkMode"in e&&null!=e.talkMode&&(this.talkMode=e.talkMode),"proto"in e&&null!=e.proto&&(this.proto=e.proto),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"protocol"in e&&null!=e.protocol&&(this.protocol=e.protocol),"deviceTag"in e&&null!=e.deviceTag&&(this.deviceTag=e.deviceTag),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar))}get deviceKey(){return Bt.Message.getFieldWithDefault(this,1,"")}set deviceKey(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get userId(){return Bt.Message.getFieldWithDefault(this,3,"")}set userId(e){Bt.Message.setField(this,3,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,4,0)}set roomId(e){Bt.Message.setField(this,4,e)}get teamId(){return Bt.Message.getFieldWithDefault(this,5,0)}set teamId(e){Bt.Message.setField(this,5,e)}get startTime(){return Bt.Message.getFieldWithDefault(this,6,"")}set startTime(e){Bt.Message.setField(this,6,e)}get endTime(){return Bt.Message.getFieldWithDefault(this,7,"")}set endTime(e){Bt.Message.setField(this,7,e)}get ids(){return Bt.Message.getFieldWithDefault(this,8,[])}set ids(e){Bt.Message.setField(this,8,e)}get token(){return Bt.Message.getFieldWithDefault(this,9,"")}set token(e){Bt.Message.setField(this,9,e)}get roomIds(){return Bt.Message.getFieldWithDefault(this,10,[])}set roomIds(e){Bt.Message.setField(this,10,e)}get userIds(){return Bt.Message.getFieldWithDefault(this,11,[])}set userIds(e){Bt.Message.setField(this,11,e)}get teamIds(){return Bt.Message.getFieldWithDefault(this,12,[])}set teamIds(e){Bt.Message.setField(this,12,e)}get keys(){return Bt.Message.getFieldWithDefault(this,13,[])}set keys(e){Bt.Message.setField(this,13,e)}get page(){return Bt.Message.getFieldWithDefault(this,14,0)}set page(e){Bt.Message.setField(this,14,e)}get pageSize(){return Bt.Message.getFieldWithDefault(this,15,0)}set pageSize(e){Bt.Message.setField(this,15,e)}get version(){return Bt.Message.getFieldWithDefault(this,16,"")}set version(e){Bt.Message.setField(this,16,e)}get v(){return Bt.Message.getFieldWithDefault(this,17,0)}set v(e){Bt.Message.setField(this,17,e)}get talkMode(){return Bt.Message.getFieldWithDefault(this,18,0)}set talkMode(e){Bt.Message.setField(this,18,e)}get proto(){return Bt.Message.getFieldWithDefault(this,19,"")}set proto(e){Bt.Message.setField(this,19,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,20,"")}set nickname(e){Bt.Message.setField(this,20,e)}get protocol(){return Bt.Message.getFieldWithDefault(this,21,new Uint8Array(0))}set protocol(e){Bt.Message.setField(this,21,e)}get deviceTag(){return Bt.Message.getFieldWithDefault(this,22,"")}set deviceTag(e){Bt.Message.setField(this,22,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,23,"")}set avatar(e){Bt.Message.setField(this,23,e)}static fromObject(e){const r=new t({});return null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.appId&&(r.appId=e.appId),null!=e.userId&&(r.userId=e.userId),null!=e.roomId&&(r.roomId=e.roomId),null!=e.teamId&&(r.teamId=e.teamId),null!=e.startTime&&(r.startTime=e.startTime),null!=e.endTime&&(r.endTime=e.endTime),null!=e.ids&&(r.ids=e.ids),null!=e.token&&(r.token=e.token),null!=e.roomIds&&(r.roomIds=e.roomIds),null!=e.userIds&&(r.userIds=e.userIds),null!=e.teamIds&&(r.teamIds=e.teamIds),null!=e.keys&&(r.keys=e.keys),null!=e.page&&(r.page=e.page),null!=e.pageSize&&(r.pageSize=e.pageSize),null!=e.version&&(r.version=e.version),null!=e.v&&(r.v=e.v),null!=e.talkMode&&(r.talkMode=e.talkMode),null!=e.proto&&(r.proto=e.proto),null!=e.nickname&&(r.nickname=e.nickname),null!=e.protocol&&(r.protocol=e.protocol),null!=e.deviceTag&&(r.deviceTag=e.deviceTag),null!=e.avatar&&(r.avatar=e.avatar),r}toObject(){const e={};return null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.appId&&(e.appId=this.appId),null!=this.userId&&(e.userId=this.userId),null!=this.roomId&&(e.roomId=this.roomId),null!=this.teamId&&(e.teamId=this.teamId),null!=this.startTime&&(e.startTime=this.startTime),null!=this.endTime&&(e.endTime=this.endTime),null!=this.ids&&(e.ids=this.ids),null!=this.token&&(e.token=this.token),null!=this.roomIds&&(e.roomIds=this.roomIds),null!=this.userIds&&(e.userIds=this.userIds),null!=this.teamIds&&(e.teamIds=this.teamIds),null!=this.keys&&(e.keys=this.keys),null!=this.page&&(e.page=this.page),null!=this.pageSize&&(e.pageSize=this.pageSize),null!=this.version&&(e.version=this.version),null!=this.v&&(e.v=this.v),null!=this.talkMode&&(e.talkMode=this.talkMode),null!=this.proto&&(e.proto=this.proto),null!=this.nickname&&(e.nickname=this.nickname),null!=this.protocol&&(e.protocol=this.protocol),null!=this.deviceTag&&(e.deviceTag=this.deviceTag),null!=this.avatar&&(e.avatar=this.avatar),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.deviceKey.length&&t.writeString(1,this.deviceKey),0!=this.appId&&t.writeInt64(2,this.appId),this.userId.length&&t.writeString(3,this.userId),0!=this.roomId&&t.writeInt64(4,this.roomId),0!=this.teamId&&t.writeInt64(5,this.teamId),this.startTime.length&&t.writeString(6,this.startTime),this.endTime.length&&t.writeString(7,this.endTime),this.ids.length&&t.writeRepeatedString(8,this.ids),this.token.length&&t.writeString(9,this.token),this.roomIds.length&&t.writePackedInt64(10,this.roomIds),this.userIds.length&&t.writeRepeatedString(11,this.userIds),this.teamIds.length&&t.writePackedInt64(12,this.teamIds),this.keys.length&&t.writePackedInt64(13,this.keys),0!=this.page&&t.writeInt32(14,this.page),0!=this.pageSize&&t.writeInt32(15,this.pageSize),this.version.length&&t.writeString(16,this.version),0!=this.v&&t.writeDouble(17,this.v),0!=this.talkMode&&t.writeInt32(18,this.talkMode),this.proto.length&&t.writeString(19,this.proto),this.nickname.length&&t.writeString(20,this.nickname),this.protocol.length&&t.writeBytes(21,this.protocol),this.deviceTag.length&&t.writeString(22,this.deviceTag),this.avatar.length&&t.writeString(23,this.avatar),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.deviceKey=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.userId=r.readString();break;case 4:i.roomId=r.readInt64();break;case 5:i.teamId=r.readInt64();break;case 6:i.startTime=r.readString();break;case 7:i.endTime=r.readString();break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.token=r.readString();break;case 10:i.roomIds=r.readPackedInt64();break;case 11:Bt.Message.addToRepeatedField(i,11,r.readString());break;case 12:i.teamIds=r.readPackedInt64();break;case 13:i.keys=r.readPackedInt64();break;case 14:i.page=r.readInt32();break;case 15:i.pageSize=r.readInt32();break;case 16:i.version=r.readString();break;case 17:i.v=r.readDouble();break;case 18:i.talkMode=r.readInt32();break;case 19:i.proto=r.readString();break;case 20:i.nickname=r.readString();break;case 21:i.protocol=r.readBytes();break;case 22:i.deviceTag=r.readString();break;case 23:i.avatar=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Meta=t}(e.imio||(e.imio={}))}(_t||(_t={}));class Wt{static _version=1;token="";tokenAppId=0;pageSize=300;account=null;deviceId="";deviceName="";deviceModel="";ip="";country="";city="";getTokenAppId(){return this.tokenAppId}meta=new _t.imio.Meta({v:Wt._version,deviceTag:"h5",page:0,pageSize:30});axios=xt.create({timeout:5e3});socket;contactList=[];getIP1(){xt.get("https://api.ipbase.com/v1/json/").then(e=>{let t=e.data;200==e.status&&t.ip?(this.ip=t?.ip,this.country=t?.country_name,this.city=t?.region_name+"-"+t?.city):this.getIP2()}).catch(e=>{this.getIP2()})}getIP3(){xt.get("https://ipinfo.io/json").then(e=>{let t=e.data;200==e.status&&t.ip&&(this.ip=t?.ip,this.country=t?.country,this.city=t?.region+"-"+t?.city)}).catch(e=>{})}getIP2(){xt.get("http://ip-api.com/json/").then(e=>{let t=e.data;200==e.status&&t.status&&"success"==t.status?(this.ip=t?.query,this.country=t?.country,this.city=t?.regionName+"-"+t?.city):this.getIP3()}).catch(e=>{this.getIP3()})}getJwtPayload(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}decodeMetadata(e){const t=new Map;try{const r=(0,d.decodeCompositeMetadata)(e);for(let e of r)if(e){const r=e;r.type==d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING.toString()&&t.set("route",r.content.toString()),e.mimeType==d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING.toString()&&t.set("route",r.content.toString())}}catch(e){}return t}buildRoute(e){let t=(0,d.encodeRoute)(e);return(0,d.encodeCompositeMetadata)([[d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING,t]])}buildDeviceStatus(e){let t=new m;return t.deviceTag=e.deviceTag,t.deviceId=e.device,t.deviceKey=e.deviceKey,t.status=e.status,t.region=e.region,t.gateway=e.gateway,t.joinId=e.roomId,t.userId=e.userId,t}buildGateway(e){let t=new f;return 4==e.ip?(t.type=!0,t.host=`${e.one}.${e.two}.${e.three}.${e.four}`):(t.type=!1,t.host=e.host),t.max=e.max,t.port=e.port,t.region=e.remark,t.current=e.sort,t}buildContact(e){let t=new c;return t.contactId=e.id,t.joinId=e.joinRoomId,t.userId=e.userId,t.nickname=e.nickname,t.username=e.username,t.subgroup=e.subgroup,t.avatar=e.avatar,t.isGroup=2==e.talkMode,t.joinTime=e.joinTime,t.isMuted=1==e.muted,t.noise=e.noise,t.sort=e.sort,e.status==o.offline&&(t.status=o.offline),e.status==o.online&&(t.status=o.online),e.status==o.online_busy&&(t.status=o.online_busy),e.status==o.online_leave&&(t.status=o.online_leave),t}buildMember(e){let t=new p;return t.memberId=e.id,t.joinId=e.joinRoomId,t.userId=e.userId,t.nickname=e.nickname,t.username=e.username,t.avatar=e.avatar,t.status=e.status,t.joinTime=e.joinTime,t.isMuted=1==e.muted,t.role=e.role,t}buildGroup(e){let t=new g;switch(t.groupId=e.id,t.joinId=e.id,t.groupName=e.roomname,t.groupNumber=e.account,t.userId=e.userId,t.avatar=e.avatar,t.depict=e.depict,t.isTalk=1==e.groupToOne,t.isApproval=1==e.applyJoin,t.isInviteApply=1==e.applyNeed,t.isInvite=1==e.invite,t.maxMember=e.roomMax,t.isGroup=2==e.talkMode,t.isMute=1==e.muted,t.isRevoke=1==e.revoke,t.ask=e.ask,e.type){case"protected":t.type=a.protected;break;case"public":t.type=a.public;break;case"private":t.type=a.private}return t}buildMessage(e){let r=new h;switch(r.messageId=e.messageId,r.joinId=e.roomId,r.tag=e.tag,r.fromId=e.fromId,r.fromName=e.fromName,r.destId=e.destId,r.destName=e.destName,r.cite=e.cite,r.type=this.subtype(e.subtype),r.title=e.title,r.subtitle=e.subtitle,r.text=e.text,r.secret=e.secret,r.thumb=e.thumb,r.host=e.host,r.url=e.url,r.lng=e.lng,r.lat=e.lat,r.size=e.size,r.length=e.length,r.sent=e.sent,r.sentDate=new Date(e.sent),r.revoke=0!=e.revoke.length,e.talkMode){case 1:r.talk=n.default;break;case 2:r.talk=n.group;break;case 3:r.talk=n.team}switch(e.label){case"tip":r.label=t.tip;break;case"notice":r.label=t.notice;break;case"action":r.label=t.action;break;case"cc":r.label=t.notify;break;case"bcc":r.label=t.quietly}if(e.citeData&&(r.citeData=this.buildMessage(e.citeData)),e.remind&&e.remind.length){r.hintList=[];for(let t of e.remind){let e=new h;e.fromId=t.fromId,e.destId=t.destId,e.destName=t.nickname,e.joinId=t.roomId,r.hintList.push(e)}}if(e.cc&&e.cc.length){r.notifyList=[],r.quietlyList=[];for(let t of e.cc){let e=new h;e.fromId=t.fromId,e.destId=t.destId,e.destName=t.nickname,e.joinId=t.roomId,0==t.sort?r.notifyList.push(e):r.quietlyList.push(e)}}return r}subtype(e){switch(e){case 1:return"txt";case 2:return"img";case 3:return"audio";case 4:return"video";case 5:return"file";case 6:return"loc";case 7:return"custom";case 9:return"wallet"}return""}}!function(e){e[e.DONE=0]="DONE",e[e.ERROR=-1]="ERROR",e[e.CONNECTING=1]="CONNECTING",e[e.SUCCESS_PULL=2]="SUCCESS_PULL",e[e.SUCCESS=3]="SUCCESS",e[e.RETRY_CONNECTING=4]="RETRY_CONNECTING",e[e.TOKEN_EXPIRED=5]="TOKEN_EXPIRED"}(Dt||(Dt={})),function(e){e[e.ERROR=0]="ERROR",e[e.CONNECT=1]="CONNECT",e[e.PULL=2]="PULL",e[e.SUCCESS=3]="SUCCESS",e[e.OFFLINE=4]="OFFLINE"}(Lt||(Lt={})),function(e){e[e.APPLY=1]="APPLY",e[e.APPLY_RESOLVE=2]="APPLY_RESOLVE",e[e.APPLY_AGREE=3]="APPLY_AGREE",e[e.APPLY_REJECT=4]="APPLY_REJECT",e[e.ROOM_EXIT=5]="ROOM_EXIT",e[e.ROOM_DISSOLVE=6]="ROOM_DISSOLVE"}(Pt||(Pt={}));class zt{accountId="";account="";nickname="";email="";phone=0;avatar="";roomId=0;apply=0;muted=0;need=0;lurk=0;status=""}class Gt extends Wt{buildRoute(e,t=""){let r=(0,d.encodeRoute)(e);return t.length>100?(0,d.encodeCompositeMetadata)([[d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING,r],[d.WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION,(0,d.encodeBearerAuthMetadata)(t)]]):(0,d.encodeCompositeMetadata)([[d.WellKnownMimeType.MESSAGE_RSOCKET_ROUTING,r]])}}!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8,32,33,34],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"userId"in e&&null!=e.userId&&(this.userId=e.userId),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"fromRoomId"in e&&null!=e.fromRoomId&&(this.fromRoomId=e.fromRoomId),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"username"in e&&null!=e.username&&(this.username=e.username),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar),"fromUserId"in e&&null!=e.fromUserId&&(this.fromUserId=e.fromUserId),"subgroup"in e&&null!=e.subgroup&&(this.subgroup=e.subgroup),"account"in e&&null!=e.account&&(this.account=e.account),"role"in e&&null!=e.role&&(this.role=e.role),"lastTime"in e&&null!=e.lastTime&&(this.lastTime=e.lastTime),"talkMode"in e&&null!=e.talkMode&&(this.talkMode=e.talkMode),"muted"in e&&null!=e.muted&&(this.muted=e.muted),"apply"in e&&null!=e.apply&&(this.apply=e.apply),"upload"in e&&null!=e.upload&&(this.upload=e.upload),"downed"in e&&null!=e.downed&&(this.downed=e.downed),"black"in e&&null!=e.black&&(this.black=e.black),"noise"in e&&null!=e.noise&&(this.noise=e.noise),"joinTeamId"in e&&null!=e.joinTeamId&&(this.joinTeamId=e.joinTeamId),"joinTime"in e&&null!=e.joinTime&&(this.joinTime=e.joinTime),"joinRoomId"in e&&null!=e.joinRoomId&&(this.joinRoomId=e.joinRoomId),"roomIds"in e&&null!=e.roomIds&&(this.roomIds=e.roomIds),"userIds"in e&&null!=e.userIds&&(this.userIds=e.userIds),"teamIds"in e&&null!=e.teamIds&&(this.teamIds=e.teamIds),"unique"in e&&null!=e.unique&&(this.unique=e.unique),"status"in e&&null!=e.status&&(this.status=e.status))}get id(){return Bt.Message.getFieldWithDefault(this,1,0)}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get userId(){return Bt.Message.getFieldWithDefault(this,11,"")}set userId(e){Bt.Message.setField(this,11,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,12,0)}set roomId(e){Bt.Message.setField(this,12,e)}get fromRoomId(){return Bt.Message.getFieldWithDefault(this,13,0)}set fromRoomId(e){Bt.Message.setField(this,13,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,14,"")}set nickname(e){Bt.Message.setField(this,14,e)}get username(){return Bt.Message.getFieldWithDefault(this,15,"")}set username(e){Bt.Message.setField(this,15,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,16,"")}set avatar(e){Bt.Message.setField(this,16,e)}get fromUserId(){return Bt.Message.getFieldWithDefault(this,17,"")}set fromUserId(e){Bt.Message.setField(this,17,e)}get subgroup(){return Bt.Message.getFieldWithDefault(this,18,"")}set subgroup(e){Bt.Message.setField(this,18,e)}get account(){return Bt.Message.getFieldWithDefault(this,19,"")}set account(e){Bt.Message.setField(this,19,e)}get role(){return Bt.Message.getFieldWithDefault(this,20,"")}set role(e){Bt.Message.setField(this,20,e)}get lastTime(){return Bt.Message.getFieldWithDefault(this,21,"")}set lastTime(e){Bt.Message.setField(this,21,e)}get talkMode(){return Bt.Message.getFieldWithDefault(this,22,0)}set talkMode(e){Bt.Message.setField(this,22,e)}get muted(){return Bt.Message.getFieldWithDefault(this,23,0)}set muted(e){Bt.Message.setField(this,23,e)}get apply(){return Bt.Message.getFieldWithDefault(this,24,0)}set apply(e){Bt.Message.setField(this,24,e)}get upload(){return Bt.Message.getFieldWithDefault(this,25,0)}set upload(e){Bt.Message.setField(this,25,e)}get downed(){return Bt.Message.getFieldWithDefault(this,26,0)}set downed(e){Bt.Message.setField(this,26,e)}get black(){return Bt.Message.getFieldWithDefault(this,27,0)}set black(e){Bt.Message.setField(this,27,e)}get noise(){return Bt.Message.getFieldWithDefault(this,28,0)}set noise(e){Bt.Message.setField(this,28,e)}get joinTeamId(){return Bt.Message.getFieldWithDefault(this,29,0)}set joinTeamId(e){Bt.Message.setField(this,29,e)}get joinTime(){return Bt.Message.getFieldWithDefault(this,30,"")}set joinTime(e){Bt.Message.setField(this,30,e)}get joinRoomId(){return Bt.Message.getFieldWithDefault(this,31,0)}set joinRoomId(e){Bt.Message.setField(this,31,e)}get roomIds(){return Bt.Message.getFieldWithDefault(this,32,[])}set roomIds(e){Bt.Message.setField(this,32,e)}get userIds(){return Bt.Message.getFieldWithDefault(this,33,[])}set userIds(e){Bt.Message.setField(this,33,e)}get teamIds(){return Bt.Message.getFieldWithDefault(this,34,[])}set teamIds(e){Bt.Message.setField(this,34,e)}get unique(){return Bt.Message.getFieldWithDefault(this,36,"")}set unique(e){Bt.Message.setField(this,36,e)}get status(){return Bt.Message.getFieldWithDefault(this,37,"")}set status(e){Bt.Message.setField(this,37,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.userId&&(r.userId=e.userId),null!=e.roomId&&(r.roomId=e.roomId),null!=e.fromRoomId&&(r.fromRoomId=e.fromRoomId),null!=e.nickname&&(r.nickname=e.nickname),null!=e.username&&(r.username=e.username),null!=e.avatar&&(r.avatar=e.avatar),null!=e.fromUserId&&(r.fromUserId=e.fromUserId),null!=e.subgroup&&(r.subgroup=e.subgroup),null!=e.account&&(r.account=e.account),null!=e.role&&(r.role=e.role),null!=e.lastTime&&(r.lastTime=e.lastTime),null!=e.talkMode&&(r.talkMode=e.talkMode),null!=e.muted&&(r.muted=e.muted),null!=e.apply&&(r.apply=e.apply),null!=e.upload&&(r.upload=e.upload),null!=e.downed&&(r.downed=e.downed),null!=e.black&&(r.black=e.black),null!=e.noise&&(r.noise=e.noise),null!=e.joinTeamId&&(r.joinTeamId=e.joinTeamId),null!=e.joinTime&&(r.joinTime=e.joinTime),null!=e.joinRoomId&&(r.joinRoomId=e.joinRoomId),null!=e.roomIds&&(r.roomIds=e.roomIds),null!=e.userIds&&(r.userIds=e.userIds),null!=e.teamIds&&(r.teamIds=e.teamIds),null!=e.unique&&(r.unique=e.unique),null!=e.status&&(r.status=e.status),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.userId&&(e.userId=this.userId),null!=this.roomId&&(e.roomId=this.roomId),null!=this.fromRoomId&&(e.fromRoomId=this.fromRoomId),null!=this.nickname&&(e.nickname=this.nickname),null!=this.username&&(e.username=this.username),null!=this.avatar&&(e.avatar=this.avatar),null!=this.fromUserId&&(e.fromUserId=this.fromUserId),null!=this.subgroup&&(e.subgroup=this.subgroup),null!=this.account&&(e.account=this.account),null!=this.role&&(e.role=this.role),null!=this.lastTime&&(e.lastTime=this.lastTime),null!=this.talkMode&&(e.talkMode=this.talkMode),null!=this.muted&&(e.muted=this.muted),null!=this.apply&&(e.apply=this.apply),null!=this.upload&&(e.upload=this.upload),null!=this.downed&&(e.downed=this.downed),null!=this.black&&(e.black=this.black),null!=this.noise&&(e.noise=this.noise),null!=this.joinTeamId&&(e.joinTeamId=this.joinTeamId),null!=this.joinTime&&(e.joinTime=this.joinTime),null!=this.joinRoomId&&(e.joinRoomId=this.joinRoomId),null!=this.roomIds&&(e.roomIds=this.roomIds),null!=this.userIds&&(e.userIds=this.userIds),null!=this.teamIds&&(e.teamIds=this.teamIds),null!=this.unique&&(e.unique=this.unique),null!=this.status&&(e.status=this.status),e}serialize(e){const t=e||new Bt.BinaryWriter;if(0!=this.id&&t.writeInt64(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),this.userId.length&&t.writeString(11,this.userId),0!=this.roomId&&t.writeInt64(12,this.roomId),0!=this.fromRoomId&&t.writeInt64(13,this.fromRoomId),this.nickname.length&&t.writeString(14,this.nickname),this.username.length&&t.writeString(15,this.username),this.avatar.length&&t.writeString(16,this.avatar),this.fromUserId.length&&t.writeString(17,this.fromUserId),this.subgroup.length&&t.writeString(18,this.subgroup),this.account.length&&t.writeString(19,this.account),this.role.length&&t.writeString(20,this.role),this.lastTime.length&&t.writeString(21,this.lastTime),0!=this.talkMode&&t.writeInt32(22,this.talkMode),0!=this.muted&&t.writeInt32(23,this.muted),0!=this.apply&&t.writeInt32(24,this.apply),0!=this.upload&&t.writeInt32(25,this.upload),0!=this.downed&&t.writeInt32(26,this.downed),0!=this.black&&t.writeInt32(27,this.black),0!=this.noise&&t.writeInt32(28,this.noise),0!=this.joinTeamId&&t.writeInt64(29,this.joinTeamId),this.joinTime.length&&t.writeString(30,this.joinTime),0!=this.joinRoomId&&t.writeInt64(31,this.joinRoomId),this.roomIds.length&&t.writePackedInt64(32,this.roomIds),this.userIds.length&&t.writeRepeatedString(33,this.userIds),this.teamIds.length&&t.writePackedInt64(34,this.teamIds),this.unique.length&&t.writeString(36,this.unique),this.status.length&&t.writeString(37,this.status),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readInt64();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.userId=r.readString();break;case 12:i.roomId=r.readInt64();break;case 13:i.fromRoomId=r.readInt64();break;case 14:i.nickname=r.readString();break;case 15:i.username=r.readString();break;case 16:i.avatar=r.readString();break;case 17:i.fromUserId=r.readString();break;case 18:i.subgroup=r.readString();break;case 19:i.account=r.readString();break;case 20:i.role=r.readString();break;case 21:i.lastTime=r.readString();break;case 22:i.talkMode=r.readInt32();break;case 23:i.muted=r.readInt32();break;case 24:i.apply=r.readInt32();break;case 25:i.upload=r.readInt32();break;case 26:i.downed=r.readInt32();break;case 27:i.black=r.readInt32();break;case 28:i.noise=r.readInt32();break;case 29:i.joinTeamId=r.readInt64();break;case 30:i.joinTime=r.readString();break;case 31:i.joinRoomId=r.readInt64();break;case 32:i.roomIds=r.readPackedInt64();break;case 33:Bt.Message.addToRepeatedField(i,33,r.readString());break;case 34:i.teamIds=r.readPackedInt64();break;case 36:i.unique=r.readString();break;case 37:i.status=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Contacts=t}(e.imio||(e.imio={}))}(Ut||(Ut={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8,28,29,37],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"userId"in e&&null!=e.userId&&(this.userId=e.userId),"roomname"in e&&null!=e.roomname&&(this.roomname=e.roomname),"level"in e&&null!=e.level&&(this.level=e.level),"describe"in e&&null!=e.describe&&(this.describe=e.describe),"type"in e&&null!=e.type&&(this.type=e.type),"joinKey"in e&&null!=e.joinKey&&(this.joinKey=e.joinKey),"talkMode"in e&&null!=e.talkMode&&(this.talkMode=e.talkMode),"userCount"in e&&null!=e.userCount&&(this.userCount=e.userCount),"lurk"in e&&null!=e.lurk&&(this.lurk=e.lurk),"depict"in e&&null!=e.depict&&(this.depict=e.depict),"muted"in e&&null!=e.muted&&(this.muted=e.muted),"applyJoin"in e&&null!=e.applyJoin&&(this.applyJoin=e.applyJoin),"applyNeed"in e&&null!=e.applyNeed&&(this.applyNeed=e.applyNeed),"invite"in e&&null!=e.invite&&(this.invite=e.invite),"uped"in e&&null!=e.uped&&(this.uped=e.uped),"downed"in e&&null!=e.downed&&(this.downed=e.downed),"revoke"in e&&null!=e.revoke&&(this.revoke=e.revoke),"tags"in e&&null!=e.tags&&(this.tags=e.tags),"users"in e&&null!=e.users&&(this.users=e.users),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar),"groupToOne"in e&&null!=e.groupToOne&&(this.groupToOne=e.groupToOne),"roomCount"in e&&null!=e.roomCount&&(this.roomCount=e.roomCount),"group"in e&&null!=e.group&&(this.group=e.group),"teamCount"in e&&null!=e.teamCount&&(this.teamCount=e.teamCount),"ask"in e&&null!=e.ask&&(this.ask=e.ask),"answer"in e&&null!=e.answer&&(this.answer=e.answer),"roomIds"in e&&null!=e.roomIds&&(this.roomIds=e.roomIds),"account"in e&&null!=e.account&&(this.account=e.account),"roomMax"in e&&null!=e.roomMax&&(this.roomMax=e.roomMax),"teamMax"in e&&null!=e.teamMax&&(this.teamMax=e.teamMax))}get id(){return Bt.Message.getFieldWithDefault(this,1,0)}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get userId(){return Bt.Message.getFieldWithDefault(this,11,"")}set userId(e){Bt.Message.setField(this,11,e)}get roomname(){return Bt.Message.getFieldWithDefault(this,12,"")}set roomname(e){Bt.Message.setField(this,12,e)}get level(){return Bt.Message.getFieldWithDefault(this,13,"")}set level(e){Bt.Message.setField(this,13,e)}get describe(){return Bt.Message.getFieldWithDefault(this,14,"")}set describe(e){Bt.Message.setField(this,14,e)}get type(){return Bt.Message.getFieldWithDefault(this,15,"")}set type(e){Bt.Message.setField(this,15,e)}get joinKey(){return Bt.Message.getFieldWithDefault(this,16,"")}set joinKey(e){Bt.Message.setField(this,16,e)}get talkMode(){return Bt.Message.getFieldWithDefault(this,17,0)}set talkMode(e){Bt.Message.setField(this,17,e)}get userCount(){return Bt.Message.getFieldWithDefault(this,18,0)}set userCount(e){Bt.Message.setField(this,18,e)}get lurk(){return Bt.Message.getFieldWithDefault(this,19,0)}set lurk(e){Bt.Message.setField(this,19,e)}get depict(){return Bt.Message.getFieldWithDefault(this,20,"")}set depict(e){Bt.Message.setField(this,20,e)}get muted(){return Bt.Message.getFieldWithDefault(this,21,0)}set muted(e){Bt.Message.setField(this,21,e)}get applyJoin(){return Bt.Message.getFieldWithDefault(this,22,0)}set applyJoin(e){Bt.Message.setField(this,22,e)}get applyNeed(){return Bt.Message.getFieldWithDefault(this,23,0)}set applyNeed(e){Bt.Message.setField(this,23,e)}get invite(){return Bt.Message.getFieldWithDefault(this,24,0)}set invite(e){Bt.Message.setField(this,24,e)}get uped(){return Bt.Message.getFieldWithDefault(this,25,0)}set uped(e){Bt.Message.setField(this,25,e)}get downed(){return Bt.Message.getFieldWithDefault(this,26,0)}set downed(e){Bt.Message.setField(this,26,e)}get revoke(){return Bt.Message.getFieldWithDefault(this,27,0)}set revoke(e){Bt.Message.setField(this,27,e)}get tags(){return Bt.Message.getFieldWithDefault(this,28,[])}set tags(e){Bt.Message.setField(this,28,e)}get users(){return Bt.Message.getRepeatedWrapperField(this,Ut.imio.Contacts,29)}set users(e){Bt.Message.setRepeatedWrapperField(this,29,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,30,"")}set avatar(e){Bt.Message.setField(this,30,e)}get groupToOne(){return Bt.Message.getFieldWithDefault(this,31,0)}set groupToOne(e){Bt.Message.setField(this,31,e)}get roomCount(){return Bt.Message.getFieldWithDefault(this,32,0)}set roomCount(e){Bt.Message.setField(this,32,e)}get group(){return Bt.Message.getFieldWithDefault(this,33,0)}set group(e){Bt.Message.setField(this,33,e)}get teamCount(){return Bt.Message.getFieldWithDefault(this,34,0)}set teamCount(e){Bt.Message.setField(this,34,e)}get ask(){return Bt.Message.getFieldWithDefault(this,35,"")}set ask(e){Bt.Message.setField(this,35,e)}get answer(){return Bt.Message.getFieldWithDefault(this,36,"")}set answer(e){Bt.Message.setField(this,36,e)}get roomIds(){return Bt.Message.getFieldWithDefault(this,37,[])}set roomIds(e){Bt.Message.setField(this,37,e)}get account(){return Bt.Message.getFieldWithDefault(this,38,"")}set account(e){Bt.Message.setField(this,38,e)}get roomMax(){return Bt.Message.getFieldWithDefault(this,39,0)}set roomMax(e){Bt.Message.setField(this,39,e)}get teamMax(){return Bt.Message.getFieldWithDefault(this,40,0)}set teamMax(e){Bt.Message.setField(this,40,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.userId&&(r.userId=e.userId),null!=e.roomname&&(r.roomname=e.roomname),null!=e.level&&(r.level=e.level),null!=e.describe&&(r.describe=e.describe),null!=e.type&&(r.type=e.type),null!=e.joinKey&&(r.joinKey=e.joinKey),null!=e.talkMode&&(r.talkMode=e.talkMode),null!=e.userCount&&(r.userCount=e.userCount),null!=e.lurk&&(r.lurk=e.lurk),null!=e.depict&&(r.depict=e.depict),null!=e.muted&&(r.muted=e.muted),null!=e.applyJoin&&(r.applyJoin=e.applyJoin),null!=e.applyNeed&&(r.applyNeed=e.applyNeed),null!=e.invite&&(r.invite=e.invite),null!=e.uped&&(r.uped=e.uped),null!=e.downed&&(r.downed=e.downed),null!=e.revoke&&(r.revoke=e.revoke),null!=e.tags&&(r.tags=e.tags),null!=e.users&&(r.users=e.users.map(e=>Ut.imio.Contacts.fromObject(e))),null!=e.avatar&&(r.avatar=e.avatar),null!=e.groupToOne&&(r.groupToOne=e.groupToOne),null!=e.roomCount&&(r.roomCount=e.roomCount),null!=e.group&&(r.group=e.group),null!=e.teamCount&&(r.teamCount=e.teamCount),null!=e.ask&&(r.ask=e.ask),null!=e.answer&&(r.answer=e.answer),null!=e.roomIds&&(r.roomIds=e.roomIds),null!=e.account&&(r.account=e.account),null!=e.roomMax&&(r.roomMax=e.roomMax),null!=e.teamMax&&(r.teamMax=e.teamMax),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.userId&&(e.userId=this.userId),null!=this.roomname&&(e.roomname=this.roomname),null!=this.level&&(e.level=this.level),null!=this.describe&&(e.describe=this.describe),null!=this.type&&(e.type=this.type),null!=this.joinKey&&(e.joinKey=this.joinKey),null!=this.talkMode&&(e.talkMode=this.talkMode),null!=this.userCount&&(e.userCount=this.userCount),null!=this.lurk&&(e.lurk=this.lurk),null!=this.depict&&(e.depict=this.depict),null!=this.muted&&(e.muted=this.muted),null!=this.applyJoin&&(e.applyJoin=this.applyJoin),null!=this.applyNeed&&(e.applyNeed=this.applyNeed),null!=this.invite&&(e.invite=this.invite),null!=this.uped&&(e.uped=this.uped),null!=this.downed&&(e.downed=this.downed),null!=this.revoke&&(e.revoke=this.revoke),null!=this.tags&&(e.tags=this.tags),null!=this.users&&(e.users=this.users.map(e=>e.toObject())),null!=this.avatar&&(e.avatar=this.avatar),null!=this.groupToOne&&(e.groupToOne=this.groupToOne),null!=this.roomCount&&(e.roomCount=this.roomCount),null!=this.group&&(e.group=this.group),null!=this.teamCount&&(e.teamCount=this.teamCount),null!=this.ask&&(e.ask=this.ask),null!=this.answer&&(e.answer=this.answer),null!=this.roomIds&&(e.roomIds=this.roomIds),null!=this.account&&(e.account=this.account),null!=this.roomMax&&(e.roomMax=this.roomMax),null!=this.teamMax&&(e.teamMax=this.teamMax),e}serialize(e){const t=e||new Bt.BinaryWriter;if(0!=this.id&&t.writeInt64(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),this.userId.length&&t.writeString(11,this.userId),this.roomname.length&&t.writeString(12,this.roomname),this.level.length&&t.writeString(13,this.level),this.describe.length&&t.writeString(14,this.describe),this.type.length&&t.writeString(15,this.type),this.joinKey.length&&t.writeString(16,this.joinKey),0!=this.talkMode&&t.writeInt32(17,this.talkMode),0!=this.userCount&&t.writeInt32(18,this.userCount),0!=this.lurk&&t.writeInt32(19,this.lurk),this.depict.length&&t.writeString(20,this.depict),0!=this.muted&&t.writeInt32(21,this.muted),0!=this.applyJoin&&t.writeInt32(22,this.applyJoin),0!=this.applyNeed&&t.writeInt32(23,this.applyNeed),0!=this.invite&&t.writeInt32(24,this.invite),0!=this.uped&&t.writeInt32(25,this.uped),0!=this.downed&&t.writeInt32(26,this.downed),0!=this.revoke&&t.writeInt32(27,this.revoke),this.tags.length&&t.writeRepeatedString(28,this.tags),this.users.length&&t.writeRepeatedMessage(29,this.users,e=>e.serialize(t)),this.avatar.length&&t.writeString(30,this.avatar),0!=this.groupToOne&&t.writeInt32(31,this.groupToOne),0!=this.roomCount&&t.writeInt32(32,this.roomCount),0!=this.group&&t.writeInt32(33,this.group),0!=this.teamCount&&t.writeInt32(34,this.teamCount),this.ask.length&&t.writeString(35,this.ask),this.answer.length&&t.writeString(36,this.answer),this.roomIds.length&&t.writeRepeatedString(37,this.roomIds),this.account.length&&t.writeString(38,this.account),0!=this.roomMax&&t.writeInt32(39,this.roomMax),0!=this.teamMax&&t.writeInt32(40,this.teamMax),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readInt64();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.userId=r.readString();break;case 12:i.roomname=r.readString();break;case 13:i.level=r.readString();break;case 14:i.describe=r.readString();break;case 15:i.type=r.readString();break;case 16:i.joinKey=r.readString();break;case 17:i.talkMode=r.readInt32();break;case 18:i.userCount=r.readInt32();break;case 19:i.lurk=r.readInt32();break;case 20:i.depict=r.readString();break;case 21:i.muted=r.readInt32();break;case 22:i.applyJoin=r.readInt32();break;case 23:i.applyNeed=r.readInt32();break;case 24:i.invite=r.readInt32();break;case 25:i.uped=r.readInt32();break;case 26:i.downed=r.readInt32();break;case 27:i.revoke=r.readInt32();break;case 28:Bt.Message.addToRepeatedField(i,28,r.readString());break;case 29:r.readMessage(i.users,()=>Bt.Message.addToRepeatedWrapperField(i,29,Ut.imio.Contacts.deserialize(r),Ut.imio.Contacts));break;case 30:i.avatar=r.readString();break;case 31:i.groupToOne=r.readInt32();break;case 32:i.roomCount=r.readInt32();break;case 33:i.group=r.readInt32();break;case 34:i.teamCount=r.readInt32();break;case 35:i.ask=r.readString();break;case 36:i.answer=r.readString();break;case 37:Bt.Message.addToRepeatedField(i,37,r.readString());break;case 38:i.account=r.readString();break;case 39:i.roomMax=r.readInt32();break;case 40:i.teamMax=r.readInt32();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Rooms=t}(e.imio||(e.imio={}))}(jt||(jt={}));var Vt,qt,Kt,Ht=r(287).hp,Yt=Ut.imio.Contacts,Xt=jt.imio.Rooms;class Jt extends Gt{static instance;imioClient=null;constructor(){super()}static getInstance(){return Jt.instance||(Jt.instance=new Jt),Jt.instance}setClient(e){return this.imioClient=e,this}getContactList(e=1,t=50){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));this.imioClient.meta.page=e,this.imioClient.meta.pageSize=t;const n=new Yt({meta:this.imioClient.meta,joinRoomId:this.imioClient.meta.roomId});let s=[];this.imioClient.socket?.requestStream({data:Ht.from(n.serializeBinary().buffer),metadata:this.buildRoute("contact.list")},3e3,{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let t=Yt.deserialize(e.data),r=this.buildContact(t);if(s.push(r),this.imioClient){let e=this.imioClient.contactList.findIndex(e=>e.contactId==r.contactId);-1==e?this.imioClient.contactList.push(r):this.imioClient.contactList.splice(e,1,r)}}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}getContactBlackList(e=1){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));this.imioClient.meta.page=e;const i=new Yt({meta:this.imioClient.meta,joinRoomId:this.imioClient.meta.roomId});let n=[];this.imioClient.socket?.requestStream({data:Ht.from(i.serializeBinary().buffer),metadata:this.buildRoute("contact.black.list")},3e3,{onComplete:()=>{t(n)},onNext:(e,t)=>{try{if(e.data){let t=Yt.deserialize(e.data),r=this.buildContact(t);n.push(r)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}getContactByUserId(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new Yt({meta:this.imioClient.meta,userId:e});let n=[];this.imioClient.socket?.requestStream({data:Ht.from(i.serializeBinary().buffer),metadata:this.buildRoute("contact.byUserId")},3e3,{onComplete:()=>{t(n)},onNext:(e,t)=>{try{if(e.data){let t=Yt.deserialize(e.data),r=this.buildContact(t);n.push(r)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}getContactByJoinId(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new Yt({meta:this.imioClient.meta,joinRoomId:e});let n=null;this.imioClient.socket?.requestResponse({data:Ht.from(i.serializeBinary().buffer),metadata:this.buildRoute("contact.byJoinId")},{onComplete:()=>{t(n)},onNext:(e,i)=>{try{if(e.data){let r=Yt.deserialize(e.data),s=this.buildContact(r);n=s,i&&t(n)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}addContact(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new Yt({meta:this.imioClient.meta,joinRoomId:e,remark:t});let s=null;this.imioClient.socket?.requestResponse({data:Ht.from(n.serializeBinary().buffer),metadata:this.buildRoute("contact.add")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Xt.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}handleApply(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));const s=new Yt({meta:this.imioClient.meta,account:e,apply:t?1:0,remark:r});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("handle.apply")},{onComplete:()=>{i(o)},onNext:(e,t)=>{try{if(e.data){let r=Xt.deserialize(e.data),n=this.buildGroup(r);o=n,t&&i(o)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}setRemarkName(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));const s=new Yt({meta:this.imioClient.meta,id:n.contactId,username:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.username")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setNoticeLevel(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));const s=new Yt({meta:this.imioClient.meta,id:n.contactId,noise:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.noise")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setBlack(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));if(n.isGroup)return void i(new Error("群禁止设置"));const s=new Yt({meta:this.imioClient.meta,userId:n.userId,black:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.black")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setSubgroup(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));const s=new Yt({meta:this.imioClient.meta,userId:n.userId,subgroup:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.subgroup")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setSort(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await this.getContactByJoinId(e);if(!n)return void i(new Error("联系人获取失败"));const s=new Yt({meta:this.imioClient.meta,userId:n.userId,sort:t});let o=null;this.imioClient.socket?.requestResponse({data:Ht.from(s.serializeBinary().buffer),metadata:this.buildRoute("contact.sort")},{onComplete:()=>{r(o)},onNext:(e,t)=>{try{if(e.data){let i=Yt.deserialize(e.data),n=this.buildContact(i);o=n,t&&r(o)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}onError(e){if(e.indexOf("Jwt")>-1){try{this.imioClient.clientListener?.onTokenExpired()}catch(e){}return"IMIO Token 已过期"}return e.indexOf("SQL")>-1||e.indexOf("connect")>-1?"IMIO System Error":e.indexOf("terminal")>-1||e.indexOf("signal")>-1?"请求超时":""}checkSocket(){return this.imioClient?this.imioClient.socket?0==this.imioClient.getTokenAppId()||this.imioClient.getTokenAppId()!=this.imioClient.meta.appId?"token中的AppId 与 IMIOClientOption不一致":"":"IMIO Client 尚未建立连接":"IMIO Client 不存在"}}!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"messageId"in e&&null!=e.messageId&&(this.messageId=e.messageId),"destId"in e&&null!=e.destId&&(this.destId=e.destId),"fromId"in e&&null!=e.fromId&&(this.fromId=e.fromId),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"confirm"in e&&null!=e.confirm&&(this.confirm=e.confirm),"read"in e&&null!=e.read&&(this.read=e.read),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"type"in e&&null!=e.type&&(this.type=e.type))}get id(){return Bt.Message.getFieldWithDefault(this,1,"")}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get messageId(){return Bt.Message.getFieldWithDefault(this,11,"")}set messageId(e){Bt.Message.setField(this,11,e)}get destId(){return Bt.Message.getFieldWithDefault(this,12,"")}set destId(e){Bt.Message.setField(this,12,e)}get fromId(){return Bt.Message.getFieldWithDefault(this,13,"")}set fromId(e){Bt.Message.setField(this,13,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,14,"")}set nickname(e){Bt.Message.setField(this,14,e)}get confirm(){return Bt.Message.getFieldWithDefault(this,15,"")}set confirm(e){Bt.Message.setField(this,15,e)}get read(){return Bt.Message.getFieldWithDefault(this,16,"")}set read(e){Bt.Message.setField(this,16,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,17,0)}set roomId(e){Bt.Message.setField(this,17,e)}get type(){return Bt.Message.getFieldWithDefault(this,18,0)}set type(e){Bt.Message.setField(this,18,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.messageId&&(r.messageId=e.messageId),null!=e.destId&&(r.destId=e.destId),null!=e.fromId&&(r.fromId=e.fromId),null!=e.nickname&&(r.nickname=e.nickname),null!=e.confirm&&(r.confirm=e.confirm),null!=e.read&&(r.read=e.read),null!=e.roomId&&(r.roomId=e.roomId),null!=e.type&&(r.type=e.type),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.messageId&&(e.messageId=this.messageId),null!=this.destId&&(e.destId=this.destId),null!=this.fromId&&(e.fromId=this.fromId),null!=this.nickname&&(e.nickname=this.nickname),null!=this.confirm&&(e.confirm=this.confirm),null!=this.read&&(e.read=this.read),null!=this.roomId&&(e.roomId=this.roomId),null!=this.type&&(e.type=this.type),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.id.length&&t.writeString(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),this.messageId.length&&t.writeString(11,this.messageId),this.destId.length&&t.writeString(12,this.destId),this.fromId.length&&t.writeString(13,this.fromId),this.nickname.length&&t.writeString(14,this.nickname),this.confirm.length&&t.writeString(15,this.confirm),this.read.length&&t.writeString(16,this.read),0!=this.roomId&&t.writeInt64(17,this.roomId),0!=this.type&&t.writeInt32(18,this.type),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.messageId=r.readString();break;case 12:i.destId=r.readString();break;case 13:i.fromId=r.readString();break;case 14:i.nickname=r.readString();break;case 15:i.confirm=r.readString();break;case 16:i.read=r.readString();break;case 17:i.roomId=r.readInt64();break;case 18:i.type=r.readInt32();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.MessageRemind=t}(e.imio||(e.imio={}))}(Vt||(Vt={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8,33,39],this.#e),Array.isArray(e)||"object"!=typeof e||("messageId"in e&&null!=e.messageId&&(this.messageId=e.messageId),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"fromName"in e&&null!=e.fromName&&(this.fromName=e.fromName),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"fromId"in e&&null!=e.fromId&&(this.fromId=e.fromId),"destId"in e&&null!=e.destId&&(this.destId=e.destId),"mimeType"in e&&null!=e.mimeType&&(this.mimeType=e.mimeType),"subtype"in e&&null!=e.subtype&&(this.subtype=e.subtype),"title"in e&&null!=e.title&&(this.title=e.title),"subtitle"in e&&null!=e.subtitle&&(this.subtitle=e.subtitle),"cite"in e&&null!=e.cite&&(this.cite=e.cite),"text"in e&&null!=e.text&&(this.text=e.text),"filename"in e&&null!=e.filename&&(this.filename=e.filename),"secret"in e&&null!=e.secret&&(this.secret=e.secret),"thumb"in e&&null!=e.thumb&&(this.thumb=e.thumb),"url"in e&&null!=e.url&&(this.url=e.url),"lat"in e&&null!=e.lat&&(this.lat=e.lat),"lng"in e&&null!=e.lng&&(this.lng=e.lng),"command"in e&&null!=e.command&&(this.command=e.command),"size"in e&&null!=e.size&&(this.size=e.size),"length"in e&&null!=e.length&&(this.length=e.length),"sent"in e&&null!=e.sent&&(this.sent=e.sent),"host"in e&&null!=e.host&&(this.host=e.host),"params"in e&&null!=e.params&&(this.params=e.params),"citeData"in e&&null!=e.citeData&&(this.citeData=e.citeData),"cc"in e&&null!=e.cc&&(this.cc=e.cc),"destName"in e&&null!=e.destName&&(this.destName=e.destName),"talkMode"in e&&null!=e.talkMode&&(this.talkMode=e.talkMode),"tag"in e&&null!=e.tag&&(this.tag=e.tag),"deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"label"in e&&null!=e.label&&(this.label=e.label),"remind"in e&&null!=e.remind&&(this.remind=e.remind),"fromAccount"in e&&null!=e.fromAccount&&(this.fromAccount=e.fromAccount),"destAccount"in e&&null!=e.destAccount&&(this.destAccount=e.destAccount),"revoke"in e&&null!=e.revoke&&(this.revoke=e.revoke))}get messageId(){return Bt.Message.getFieldWithDefault(this,1,"")}set messageId(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get fromName(){return Bt.Message.getFieldWithDefault(this,9,"")}set fromName(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get roomId(){return Bt.Message.getFieldWithDefault(this,11,0)}set roomId(e){Bt.Message.setField(this,11,e)}get fromId(){return Bt.Message.getFieldWithDefault(this,12,"")}set fromId(e){Bt.Message.setField(this,12,e)}get destId(){return Bt.Message.getFieldWithDefault(this,13,"")}set destId(e){Bt.Message.setField(this,13,e)}get mimeType(){return Bt.Message.getFieldWithDefault(this,14,"")}set mimeType(e){Bt.Message.setField(this,14,e)}get subtype(){return Bt.Message.getFieldWithDefault(this,15,0)}set subtype(e){Bt.Message.setField(this,15,e)}get title(){return Bt.Message.getFieldWithDefault(this,16,"")}set title(e){Bt.Message.setField(this,16,e)}get subtitle(){return Bt.Message.getFieldWithDefault(this,17,"")}set subtitle(e){Bt.Message.setField(this,17,e)}get cite(){return Bt.Message.getFieldWithDefault(this,18,"")}set cite(e){Bt.Message.setField(this,18,e)}get text(){return Bt.Message.getFieldWithDefault(this,19,"")}set text(e){Bt.Message.setField(this,19,e)}get filename(){return Bt.Message.getFieldWithDefault(this,20,"")}set filename(e){Bt.Message.setField(this,20,e)}get secret(){return Bt.Message.getFieldWithDefault(this,21,"")}set secret(e){Bt.Message.setField(this,21,e)}get thumb(){return Bt.Message.getFieldWithDefault(this,22,"")}set thumb(e){Bt.Message.setField(this,22,e)}get url(){return Bt.Message.getFieldWithDefault(this,23,"")}set url(e){Bt.Message.setField(this,23,e)}get lat(){return Bt.Message.getFieldWithDefault(this,24,"")}set lat(e){Bt.Message.setField(this,24,e)}get lng(){return Bt.Message.getFieldWithDefault(this,25,"")}set lng(e){Bt.Message.setField(this,25,e)}get command(){return Bt.Message.getFieldWithDefault(this,26,"")}set command(e){Bt.Message.setField(this,26,e)}get size(){return Bt.Message.getFieldWithDefault(this,27,0)}set size(e){Bt.Message.setField(this,27,e)}get length(){return Bt.Message.getFieldWithDefault(this,28,0)}set length(e){Bt.Message.setField(this,28,e)}get sent(){return Bt.Message.getFieldWithDefault(this,29,"")}set sent(e){Bt.Message.setField(this,29,e)}get host(){return Bt.Message.getFieldWithDefault(this,30,"")}set host(e){Bt.Message.setField(this,30,e)}get params(){return Bt.Message.getFieldWithDefault(this,31,"")}set params(e){Bt.Message.setField(this,31,e)}get citeData(){return Bt.Message.getWrapperField(this,t,32)}set citeData(e){Bt.Message.setWrapperField(this,32,e)}get has_citeData(){return null!=Bt.Message.getField(this,32)}get cc(){return Bt.Message.getRepeatedWrapperField(this,Vt.imio.MessageRemind,33)}set cc(e){Bt.Message.setRepeatedWrapperField(this,33,e)}get destName(){return Bt.Message.getFieldWithDefault(this,34,"")}set destName(e){Bt.Message.setField(this,34,e)}get talkMode(){return Bt.Message.getFieldWithDefault(this,35,0)}set talkMode(e){Bt.Message.setField(this,35,e)}get tag(){return Bt.Message.getFieldWithDefault(this,36,"")}set tag(e){Bt.Message.setField(this,36,e)}get deviceKey(){return Bt.Message.getFieldWithDefault(this,37,"")}set deviceKey(e){Bt.Message.setField(this,37,e)}get label(){return Bt.Message.getFieldWithDefault(this,38,"")}set label(e){Bt.Message.setField(this,38,e)}get remind(){return Bt.Message.getRepeatedWrapperField(this,Vt.imio.MessageRemind,39)}set remind(e){Bt.Message.setRepeatedWrapperField(this,39,e)}get fromAccount(){return Bt.Message.getFieldWithDefault(this,40,"")}set fromAccount(e){Bt.Message.setField(this,40,e)}get destAccount(){return Bt.Message.getFieldWithDefault(this,41,"")}set destAccount(e){Bt.Message.setField(this,41,e)}get revoke(){return Bt.Message.getFieldWithDefault(this,42,"")}set revoke(e){Bt.Message.setField(this,42,e)}static fromObject(e){const r=new t({});return null!=e.messageId&&(r.messageId=e.messageId),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.fromName&&(r.fromName=e.fromName),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.roomId&&(r.roomId=e.roomId),null!=e.fromId&&(r.fromId=e.fromId),null!=e.destId&&(r.destId=e.destId),null!=e.mimeType&&(r.mimeType=e.mimeType),null!=e.subtype&&(r.subtype=e.subtype),null!=e.title&&(r.title=e.title),null!=e.subtitle&&(r.subtitle=e.subtitle),null!=e.cite&&(r.cite=e.cite),null!=e.text&&(r.text=e.text),null!=e.filename&&(r.filename=e.filename),null!=e.secret&&(r.secret=e.secret),null!=e.thumb&&(r.thumb=e.thumb),null!=e.url&&(r.url=e.url),null!=e.lat&&(r.lat=e.lat),null!=e.lng&&(r.lng=e.lng),null!=e.command&&(r.command=e.command),null!=e.size&&(r.size=e.size),null!=e.length&&(r.length=e.length),null!=e.sent&&(r.sent=e.sent),null!=e.host&&(r.host=e.host),null!=e.params&&(r.params=e.params),null!=e.citeData&&(r.citeData=t.fromObject(e.citeData)),null!=e.cc&&(r.cc=e.cc.map(e=>Vt.imio.MessageRemind.fromObject(e))),null!=e.destName&&(r.destName=e.destName),null!=e.talkMode&&(r.talkMode=e.talkMode),null!=e.tag&&(r.tag=e.tag),null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.label&&(r.label=e.label),null!=e.remind&&(r.remind=e.remind.map(e=>Vt.imio.MessageRemind.fromObject(e))),null!=e.fromAccount&&(r.fromAccount=e.fromAccount),null!=e.destAccount&&(r.destAccount=e.destAccount),null!=e.revoke&&(r.revoke=e.revoke),r}toObject(){const e={};return null!=this.messageId&&(e.messageId=this.messageId),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.fromName&&(e.fromName=this.fromName),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.roomId&&(e.roomId=this.roomId),null!=this.fromId&&(e.fromId=this.fromId),null!=this.destId&&(e.destId=this.destId),null!=this.mimeType&&(e.mimeType=this.mimeType),null!=this.subtype&&(e.subtype=this.subtype),null!=this.title&&(e.title=this.title),null!=this.subtitle&&(e.subtitle=this.subtitle),null!=this.cite&&(e.cite=this.cite),null!=this.text&&(e.text=this.text),null!=this.filename&&(e.filename=this.filename),null!=this.secret&&(e.secret=this.secret),null!=this.thumb&&(e.thumb=this.thumb),null!=this.url&&(e.url=this.url),null!=this.lat&&(e.lat=this.lat),null!=this.lng&&(e.lng=this.lng),null!=this.command&&(e.command=this.command),null!=this.size&&(e.size=this.size),null!=this.length&&(e.length=this.length),null!=this.sent&&(e.sent=this.sent),null!=this.host&&(e.host=this.host),null!=this.params&&(e.params=this.params),null!=this.citeData&&(e.citeData=this.citeData.toObject()),null!=this.cc&&(e.cc=this.cc.map(e=>e.toObject())),null!=this.destName&&(e.destName=this.destName),null!=this.talkMode&&(e.talkMode=this.talkMode),null!=this.tag&&(e.tag=this.tag),null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.label&&(e.label=this.label),null!=this.remind&&(e.remind=this.remind.map(e=>e.toObject())),null!=this.fromAccount&&(e.fromAccount=this.fromAccount),null!=this.destAccount&&(e.destAccount=this.destAccount),null!=this.revoke&&(e.revoke=this.revoke),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.messageId.length&&t.writeString(1,this.messageId),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.fromName.length&&t.writeString(9,this.fromName),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),0!=this.roomId&&t.writeInt64(11,this.roomId),this.fromId.length&&t.writeString(12,this.fromId),this.destId.length&&t.writeString(13,this.destId),this.mimeType.length&&t.writeString(14,this.mimeType),0!=this.subtype&&t.writeInt32(15,this.subtype),this.title.length&&t.writeString(16,this.title),this.subtitle.length&&t.writeString(17,this.subtitle),this.cite.length&&t.writeString(18,this.cite),this.text.length&&t.writeString(19,this.text),this.filename.length&&t.writeString(20,this.filename),this.secret.length&&t.writeString(21,this.secret),this.thumb.length&&t.writeString(22,this.thumb),this.url.length&&t.writeString(23,this.url),this.lat.length&&t.writeString(24,this.lat),this.lng.length&&t.writeString(25,this.lng),this.command.length&&t.writeString(26,this.command),0!=this.size&&t.writeDouble(27,this.size),0!=this.length&&t.writeDouble(28,this.length),this.sent.length&&t.writeString(29,this.sent),this.host.length&&t.writeString(30,this.host),this.params.length&&t.writeString(31,this.params),this.has_citeData&&t.writeMessage(32,this.citeData,()=>this.citeData.serialize(t)),this.cc.length&&t.writeRepeatedMessage(33,this.cc,e=>e.serialize(t)),this.destName.length&&t.writeString(34,this.destName),0!=this.talkMode&&t.writeInt32(35,this.talkMode),this.tag.length&&t.writeString(36,this.tag),this.deviceKey.length&&t.writeString(37,this.deviceKey),this.label.length&&t.writeString(38,this.label),this.remind.length&&t.writeRepeatedMessage(39,this.remind,e=>e.serialize(t)),this.fromAccount.length&&t.writeString(40,this.fromAccount),this.destAccount.length&&t.writeString(41,this.destAccount),this.revoke.length&&t.writeString(42,this.revoke),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.messageId=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.fromName=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.roomId=r.readInt64();break;case 12:i.fromId=r.readString();break;case 13:i.destId=r.readString();break;case 14:i.mimeType=r.readString();break;case 15:i.subtype=r.readInt32();break;case 16:i.title=r.readString();break;case 17:i.subtitle=r.readString();break;case 18:i.cite=r.readString();break;case 19:i.text=r.readString();break;case 20:i.filename=r.readString();break;case 21:i.secret=r.readString();break;case 22:i.thumb=r.readString();break;case 23:i.url=r.readString();break;case 24:i.lat=r.readString();break;case 25:i.lng=r.readString();break;case 26:i.command=r.readString();break;case 27:i.size=r.readDouble();break;case 28:i.length=r.readDouble();break;case 29:i.sent=r.readString();break;case 30:i.host=r.readString();break;case 31:i.params=r.readString();break;case 32:r.readMessage(i.citeData,()=>i.citeData=t.deserialize(r));break;case 33:r.readMessage(i.cc,()=>Bt.Message.addToRepeatedWrapperField(i,33,Vt.imio.MessageRemind.deserialize(r),Vt.imio.MessageRemind));break;case 34:i.destName=r.readString();break;case 35:i.talkMode=r.readInt32();break;case 36:i.tag=r.readString();break;case 37:i.deviceKey=r.readString();break;case 38:i.label=r.readString();break;case 39:r.readMessage(i.remind,()=>Bt.Message.addToRepeatedWrapperField(i,39,Vt.imio.MessageRemind.deserialize(r),Vt.imio.MessageRemind));break;case 40:i.fromAccount=r.readString();break;case 41:i.destAccount=r.readString();break;case 42:i.revoke=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Message=t}(e.imio||(e.imio={}))}(qt||(qt={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8,29,30],this.#e),Array.isArray(e)||"object"!=typeof e||("messageId"in e&&null!=e.messageId&&(this.messageId=e.messageId),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"fromId"in e&&null!=e.fromId&&(this.fromId=e.fromId),"fromName"in e&&null!=e.fromName&&(this.fromName=e.fromName),"destId"in e&&null!=e.destId&&(this.destId=e.destId),"destName"in e&&null!=e.destName&&(this.destName=e.destName),"device"in e&&null!=e.device&&(this.device=e.device),"level"in e&&null!=e.level&&(this.level=e.level),"deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"message"in e&&null!=e.message&&(this.message=e.message),"sent"in e&&null!=e.sent&&(this.sent=e.sent),"succeed"in e&&null!=e.succeed&&(this.succeed=e.succeed),"read"in e&&null!=e.read&&(this.read=e.read),"revoke"in e&&null!=e.revoke&&(this.revoke=e.revoke),"readBy"in e&&null!=e.readBy&&(this.readBy=e.readBy),"deviceTag"in e&&null!=e.deviceTag&&(this.deviceTag=e.deviceTag),"signId"in e&&null!=e.signId&&(this.signId=e.signId),"tag"in e&&null!=e.tag&&(this.tag=e.tag),"fromIds"in e&&null!=e.fromIds&&(this.fromIds=e.fromIds),"destIds"in e&&null!=e.destIds&&(this.destIds=e.destIds),"end"in e&&null!=e.end&&(this.end=e.end),"label"in e&&null!=e.label&&(this.label=e.label),"destAccount"in e&&null!=e.destAccount&&(this.destAccount=e.destAccount),"fromAccount"in e&&null!=e.fromAccount&&(this.fromAccount=e.fromAccount))}get messageId(){return Bt.Message.getFieldWithDefault(this,1,"")}set messageId(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get roomId(){return Bt.Message.getFieldWithDefault(this,11,0)}set roomId(e){Bt.Message.setField(this,11,e)}get fromId(){return Bt.Message.getFieldWithDefault(this,12,"")}set fromId(e){Bt.Message.setField(this,12,e)}get fromName(){return Bt.Message.getFieldWithDefault(this,13,"")}set fromName(e){Bt.Message.setField(this,13,e)}get destId(){return Bt.Message.getFieldWithDefault(this,14,"")}set destId(e){Bt.Message.setField(this,14,e)}get destName(){return Bt.Message.getFieldWithDefault(this,15,"")}set destName(e){Bt.Message.setField(this,15,e)}get device(){return Bt.Message.getFieldWithDefault(this,16,"")}set device(e){Bt.Message.setField(this,16,e)}get level(){return Bt.Message.getFieldWithDefault(this,17,0)}set level(e){Bt.Message.setField(this,17,e)}get deviceKey(){return Bt.Message.getFieldWithDefault(this,18,"")}set deviceKey(e){Bt.Message.setField(this,18,e)}get message(){return Bt.Message.getWrapperField(this,qt.imio.Message,19)}set message(e){Bt.Message.setWrapperField(this,19,e)}get has_message(){return null!=Bt.Message.getField(this,19)}get sent(){return Bt.Message.getFieldWithDefault(this,20,"")}set sent(e){Bt.Message.setField(this,20,e)}get succeed(){return Bt.Message.getFieldWithDefault(this,21,"")}set succeed(e){Bt.Message.setField(this,21,e)}get read(){return Bt.Message.getFieldWithDefault(this,22,"")}set read(e){Bt.Message.setField(this,22,e)}get revoke(){return Bt.Message.getFieldWithDefault(this,23,"")}set revoke(e){Bt.Message.setField(this,23,e)}get readBy(){return Bt.Message.getFieldWithDefault(this,24,0)}set readBy(e){Bt.Message.setField(this,24,e)}get deviceTag(){return Bt.Message.getFieldWithDefault(this,25,"")}set deviceTag(e){Bt.Message.setField(this,25,e)}get signId(){return Bt.Message.getFieldWithDefault(this,27,"")}set signId(e){Bt.Message.setField(this,27,e)}get tag(){return Bt.Message.getFieldWithDefault(this,28,"")}set tag(e){Bt.Message.setField(this,28,e)}get fromIds(){return Bt.Message.getFieldWithDefault(this,29,[])}set fromIds(e){Bt.Message.setField(this,29,e)}get destIds(){return Bt.Message.getFieldWithDefault(this,30,[])}set destIds(e){Bt.Message.setField(this,30,e)}get end(){return Bt.Message.getFieldWithDefault(this,37,"")}set end(e){Bt.Message.setField(this,37,e)}get label(){return Bt.Message.getFieldWithDefault(this,38,"")}set label(e){Bt.Message.setField(this,38,e)}get destAccount(){return Bt.Message.getFieldWithDefault(this,39,"")}set destAccount(e){Bt.Message.setField(this,39,e)}get fromAccount(){return Bt.Message.getFieldWithDefault(this,40,"")}set fromAccount(e){Bt.Message.setField(this,40,e)}static fromObject(e){const r=new t({});return null!=e.messageId&&(r.messageId=e.messageId),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.roomId&&(r.roomId=e.roomId),null!=e.fromId&&(r.fromId=e.fromId),null!=e.fromName&&(r.fromName=e.fromName),null!=e.destId&&(r.destId=e.destId),null!=e.destName&&(r.destName=e.destName),null!=e.device&&(r.device=e.device),null!=e.level&&(r.level=e.level),null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.message&&(r.message=qt.imio.Message.fromObject(e.message)),null!=e.sent&&(r.sent=e.sent),null!=e.succeed&&(r.succeed=e.succeed),null!=e.read&&(r.read=e.read),null!=e.revoke&&(r.revoke=e.revoke),null!=e.readBy&&(r.readBy=e.readBy),null!=e.deviceTag&&(r.deviceTag=e.deviceTag),null!=e.signId&&(r.signId=e.signId),null!=e.tag&&(r.tag=e.tag),null!=e.fromIds&&(r.fromIds=e.fromIds),null!=e.destIds&&(r.destIds=e.destIds),null!=e.end&&(r.end=e.end),null!=e.label&&(r.label=e.label),null!=e.destAccount&&(r.destAccount=e.destAccount),null!=e.fromAccount&&(r.fromAccount=e.fromAccount),r}toObject(){const e={};return null!=this.messageId&&(e.messageId=this.messageId),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.roomId&&(e.roomId=this.roomId),null!=this.fromId&&(e.fromId=this.fromId),null!=this.fromName&&(e.fromName=this.fromName),null!=this.destId&&(e.destId=this.destId),null!=this.destName&&(e.destName=this.destName),null!=this.device&&(e.device=this.device),null!=this.level&&(e.level=this.level),null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.message&&(e.message=this.message.toObject()),null!=this.sent&&(e.sent=this.sent),null!=this.succeed&&(e.succeed=this.succeed),null!=this.read&&(e.read=this.read),null!=this.revoke&&(e.revoke=this.revoke),null!=this.readBy&&(e.readBy=this.readBy),null!=this.deviceTag&&(e.deviceTag=this.deviceTag),null!=this.signId&&(e.signId=this.signId),null!=this.tag&&(e.tag=this.tag),null!=this.fromIds&&(e.fromIds=this.fromIds),null!=this.destIds&&(e.destIds=this.destIds),null!=this.end&&(e.end=this.end),null!=this.label&&(e.label=this.label),null!=this.destAccount&&(e.destAccount=this.destAccount),null!=this.fromAccount&&(e.fromAccount=this.fromAccount),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.messageId.length&&t.writeString(1,this.messageId),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),0!=this.roomId&&t.writeInt64(11,this.roomId),this.fromId.length&&t.writeString(12,this.fromId),this.fromName.length&&t.writeString(13,this.fromName),this.destId.length&&t.writeString(14,this.destId),this.destName.length&&t.writeString(15,this.destName),this.device.length&&t.writeString(16,this.device),0!=this.level&&t.writeInt32(17,this.level),this.deviceKey.length&&t.writeString(18,this.deviceKey),this.has_message&&t.writeMessage(19,this.message,()=>this.message.serialize(t)),this.sent.length&&t.writeString(20,this.sent),this.succeed.length&&t.writeString(21,this.succeed),this.read.length&&t.writeString(22,this.read),this.revoke.length&&t.writeString(23,this.revoke),0!=this.readBy&&t.writeInt32(24,this.readBy),this.deviceTag.length&&t.writeString(25,this.deviceTag),this.signId.length&&t.writeString(27,this.signId),this.tag.length&&t.writeString(28,this.tag),this.fromIds.length&&t.writeRepeatedString(29,this.fromIds),this.destIds.length&&t.writeRepeatedString(30,this.destIds),this.end.length&&t.writeString(37,this.end),this.label.length&&t.writeString(38,this.label),this.destAccount.length&&t.writeString(39,this.destAccount),this.fromAccount.length&&t.writeString(40,this.fromAccount),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.messageId=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.roomId=r.readInt64();break;case 12:i.fromId=r.readString();break;case 13:i.fromName=r.readString();break;case 14:i.destId=r.readString();break;case 15:i.destName=r.readString();break;case 16:i.device=r.readString();break;case 17:i.level=r.readInt32();break;case 18:i.deviceKey=r.readString();break;case 19:r.readMessage(i.message,()=>i.message=qt.imio.Message.deserialize(r));break;case 20:i.sent=r.readString();break;case 21:i.succeed=r.readString();break;case 22:i.read=r.readString();break;case 23:i.revoke=r.readString();break;case 24:i.readBy=r.readInt32();break;case 25:i.deviceTag=r.readString();break;case 27:i.signId=r.readString();break;case 28:i.tag=r.readString();break;case 29:Bt.Message.addToRepeatedField(i,29,r.readString());break;case 30:Bt.Message.addToRepeatedField(i,30,r.readString());break;case 37:i.end=r.readString();break;case 38:i.label=r.readString();break;case 39:i.destAccount=r.readString();break;case 40:i.fromAccount=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.MessageSign=t}(e.imio||(e.imio={}))}(Kt||(Kt={}));var Zt=r(287).hp,Qt=Ut.imio.Contacts,$t=jt.imio.Rooms,er=qt.imio.Message,tr=Kt.imio.MessageSign,rr=Vt.imio.MessageRemind;class ir extends Gt{static instance;imioClient=null;constructor(){super()}static getInstance(){return ir.instance||(ir.instance=new ir),ir.instance}setClient(e){return this.imioClient=e,this}dialogue(e,t,r){return new Promise(async(i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));let s=this.buildMessageProto(t,r);s.appId=e;let o=null;this.imioClient.socket?.requestResponse({data:Zt.from(s.serializeBinary().buffer),metadata:this.buildRoute("dialogue")},{onComplete:()=>{i(o)},onNext:(e,t)=>{try{if(e.data){let r=er.deserialize(e.data),n=this.buildMessage(r);o=n,t&&i(o)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}oneToOne(e){return new Promise(async(t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));let i=Jt.getInstance(),n=await i.getContactByJoinId(e.joinId);if(!n)return void r(new Error("联系人不存在"));if(n.isGroup)return void r(new Error("联系人是群组"));let s=this.buildMessageProto(n.userId,e),o=null;this.imioClient.socket?.requestResponse({data:Zt.from(s.serializeBinary().buffer),metadata:this.buildRoute("oneToOne")},{onComplete:()=>{t(o)},onNext:(e,i)=>{try{if(e.data){let r=er.deserialize(e.data),n=this.buildMessage(r);o=n,i&&t(o)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}oneToMany(e){return new Promise(async(t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));let i=Jt.getInstance(),n=await i.getContactByJoinId(e.joinId);if(!n)return void r(new Error("联系人不存在"));if(!n.isGroup)return void r(new Error("联系人不是群组"));let s=this.buildMessageProto("",e),o=null;this.imioClient.socket?.requestResponse({data:Zt.from(s.serializeBinary().buffer),metadata:this.buildRoute("oneToMany")},{onComplete:()=>{t(o)},onNext:(e,i)=>{try{if(e.data){let r=er.deserialize(e.data),n=this.buildMessage(r);o=n,i&&t(o)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}signMessage(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=new tr({meta:this.imioClient.meta,messageId:e,roomId:t,destId:this.imioClient.meta.userId,deviceTag:"h5",deviceKey:this.imioClient?.getDeviceKey()});this.imioClient.socket?.requestResponse({data:Zt.from(n.serializeBinary().buffer),metadata:this.buildRoute("message.sign")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}readMessage(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=new tr({meta:this.imioClient.meta,messageId:e,roomId:t,destId:this.imioClient.meta.userId});this.imioClient.socket?.requestResponse({data:Zt.from(n.serializeBinary().buffer),metadata:this.buildRoute("message.read")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}deleteMessage(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=new tr({meta:this.imioClient.meta,messageId:e,roomId:t});this.imioClient.socket?.requestResponse({data:Zt.from(n.serializeBinary().buffer),metadata:this.buildRoute("message.revoke")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}getMessageList(e,t=1,r=40){return new Promise(async(i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));let s=Jt.getInstance(),o=await s.getContactByJoinId(e);if(!o)return void n(new Error("联系人不存在"));this.imioClient.meta.page=t,this.imioClient.meta.pageSize=r;const a=new er({meta:this.imioClient.meta,roomId:o.joinId});let l=[];this.imioClient.socket?.requestStream({data:Zt.from(a.serializeBinary().buffer),metadata:this.buildRoute("message.page")},500,{onComplete:()=>{i(l)},onNext:(e,t)=>{try{if(e.data){let t=er.deserialize(e.data),r=this.buildMessage(t);l.push(r)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}createDialogue(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new Qt({meta:this.imioClient.meta,userId:e,joinRoomId:t});let s=null;this.imioClient.socket?.requestResponse({data:Zt.from(n.serializeBinary().buffer),metadata:this.buildRoute("dialogue.create")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=$t.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}senderBuildMessage(e){let t=new h;if(t.messageId=e.messageId,t.joinId=e.joinId,t.cite=e.cite,t.type=e.type,t.title=e.title,t.subtitle=e.subtitle,t.text=e.text,t.secret=e.secret,t.thumb=e.thumb,t.host=e.host,t.url=e.url,t.lng=e.lng,t.lat=e.lat,t.size=e.size,t.length=e.length,e.hintList&&e.hintList.length){t.hintList=[];for(let r of e.hintList){let e=new h;e.destId=r.targetId,e.destName=r.targetName,t.hintList.push(e)}}if(e.notifyList&&e.notifyList.length){t.notifyList=[];for(let r of e.notifyList){let e=new h;e.destId=r.targetId,e.destName=r.targetName,t.notifyList.push(e)}}if(e.quietlyList&&e.quietlyList.length){t.quietlyList=[];for(let r of e.quietlyList){let e=new h;e.destId=r.targetId,e.destName=r.targetName,t.quietlyList.push(e)}}return t}buildMessageProto(e,t){let r=[],i=[];if(t.notifyList&&t.notifyList.length)for(let e of t.notifyList){let t=new rr({sort:1,destId:e.targetId,nickname:e.targetName});r.push(t)}if(t.quietlyList&&t.quietlyList.length)for(let e of t.quietlyList){let t=new rr({sort:2,destId:e.targetId,nickname:e.targetName});r.push(t)}if(t.hintList&&t.hintList.length)for(let e of t.hintList){let t=new rr({sort:0,destId:e.targetId,nickname:e.targetName});i.push(t)}return new er({meta:this.imioClient?.meta,messageId:t.messageId,roomId:t.joinId,fromId:this.imioClient?.meta?.userId,fromName:this.imioClient?.meta?.nickname,destId:e,subtype:this.messageType(t.type),title:t.title,subtitle:t.subtitle,text:t.text,secret:t.secret,thumb:t.thumb,host:t.host,url:t.url,lng:t.lng,lat:t.lat,size:t.size,length:t.length,cc:r,remind:i})}messageType(e){switch(e){case"txt":return 1;case"img":return 2;case"audio":return 3;case"video":return 4;case"file":return 5;case"loc":return 6;case"wallet":return 9;case"custom":return 7}return 1}onError(e){if(e.indexOf("Jwt")>-1){try{this.imioClient.clientListener?.onTokenExpired()}catch(e){}return"IMIO Token 已过期"}return e.indexOf("SQL")>-1||e.indexOf("connect")>-1?"IMIO System Error":e.indexOf("terminal")>-1||e.indexOf("signal")>-1?"请求超时":""}checkSocket(){return this.imioClient?this.imioClient.socket?0==this.imioClient.getTokenAppId()||this.imioClient.getTokenAppId()!=this.imioClient.meta.appId?"token中的AppId 与 IMIOClientOption不一致":"":"IMIO Client 尚未建立连接":"IMIO Client 不存在"}}var nr=function(){return nr=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},nr.apply(this,arguments)};function sr(e,t,r,i){return new(r||(r=Promise))(function(n,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((i=i.apply(e,t||[])).next())})}function or(e,t){var r,i,n,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function ar(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var lr="3.4.2";function ur(e,t){return new Promise(function(r){return setTimeout(r,e,t)})}function dr(e){return!!e&&"function"==typeof e.then}function hr(e,t){try{var r=e();dr(r)?r.then(function(e){return t(!0,e)},function(e){return t(!1,e)}):t(!0,r)}catch(e){t(!1,e)}}function cr(e,t,r){return void 0===r&&(r=16),sr(this,void 0,void 0,function(){var i,n,s,o;return or(this,function(a){switch(a.label){case 0:i=Array(e.length),n=Date.now(),s=0,a.label=1;case 1:return s<e.length?(i[s]=t(e[s],s),(o=Date.now())>=n+r?(n=o,[4,ur(0)]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++s,[3,1];case 4:return[2,i]}})})}function pr(e){e.then(void 0,function(){})}function fr(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]+t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function mr(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var r=[0,0,0,0];return r[3]+=e[3]*t[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function gr(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function yr(e,t){return 0==(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function vr(e,t){return[e[0]^t[0],e[1]^t[1]]}function br(e){return e=vr(e,[0,e[0]>>>1]),e=vr(e=mr(e,[4283543511,3981806797]),[0,e[0]>>>1]),vr(e=mr(e,[3301882366,444984403]),[0,e[0]>>>1])}function Ir(e){return parseInt(e)}function Er(e){return parseFloat(e)}function wr(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Sr(e){return e.reduce(function(e,t){return e+(t?1:0)},0)}function Mr(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var r=1/t;return Math.round(e*r)/r}function kr(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function Fr(e,t,r){var i=Object.keys(e).filter(function(e){return!function(e,t){for(var r=0,i=e.length;r<i;++r)if(e[r]===t)return!0;return!1}(r,e)}),n=cr(i,function(r){return function(e,t){var r=new Promise(function(r){var i=Date.now();hr(e.bind(null,t),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Date.now()-i;if(!e[0])return r(function(){return{error:kr(e[1]),duration:n}});var s=e[1];if(function(e){return"function"!=typeof e}(s))return r(function(){return{value:s,duration:n}});r(function(){return new Promise(function(e){var t=Date.now();hr(s,function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=n+Date.now()-t;if(!r[0])return e({error:kr(r[1]),duration:s});e({value:r[1],duration:s})})})})})});return pr(r),function(){return r.then(function(e){return e()})}}(e[r],t)});return pr(n),function(){return sr(this,void 0,void 0,function(){var e,t,r,s;return or(this,function(o){switch(o.label){case 0:return[4,n];case 1:return[4,cr(o.sent(),function(e){var t=e();return pr(t),t})];case 2:return e=o.sent(),[4,Promise.all(e)];case 3:for(t=o.sent(),r={},s=0;s<i.length;++s)r[i[s]]=t[s];return[2,r]}})})}}function Tr(){var e=window,t=navigator;return Sr(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Rr(){var e=window,t=navigator;return Sr(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Ar(){var e=window,t=navigator;return Sr(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function Cr(){var e=window;return Sr(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function Or(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Nr(){var e=Rr(),t=function(){var e,t,r=window;return Sr(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}();if(!e&&!t)return!1;var r=window;return Sr(["onorientationchange"in r,"orientation"in r,e&&!("SharedWorker"in r),t&&/android/i.test(navigator.appVersion)])>=2}function xr(e){var t=new Error(e);return t.name=e,t}function _r(e,t,r){var i,n,s;return void 0===r&&(r=50),sr(this,void 0,void 0,function(){var o,a;return or(this,function(l){switch(l.label){case 0:o=document,l.label=1;case 1:return o.body?[3,3]:[4,ur(r)];case 2:return l.sent(),[3,1];case 3:a=o.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise(function(e,r){var i=!1,n=function(){i=!0,e()};a.onload=n,a.onerror=function(e){i=!0,r(e)};var s=a.style;s.setProperty("display","block","important"),s.position="absolute",s.top="0",s.left="0",s.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",o.body.appendChild(a);var l=function(){var e,t;i||("complete"===(null===(t=null===(e=a.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?n():setTimeout(l,10))};l()})];case 5:l.sent(),l.label=6;case 6:return(null===(n=null===(i=a.contentWindow)||void 0===i?void 0:i.document)||void 0===n?void 0:n.body)?[3,8]:[4,ur(r)];case 7:return l.sent(),[3,6];case 8:return[4,e(a,a.contentWindow)];case 9:return[2,l.sent()];case 10:return null===(s=a.parentNode)||void 0===s||s.removeChild(a),[7];case 11:return[2]}})})}function Dr(e){for(var t=function(e){for(var t,r,i="Unexpected syntax '".concat(e,"'"),n=/^\s*([a-z-]*)(.*)$/i.exec(e),s=n[1]||void 0,o={},a=/([.:#][\w-]+|\[.+?\])/gi,l=function(e,t){o[e]=o[e]||[],o[e].push(t)};;){var u=a.exec(n[2]);if(!u)break;var d=u[0];switch(d[0]){case".":l("class",d.slice(1));break;case"#":l("id",d.slice(1));break;case"[":var h=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(d);if(!h)throw new Error(i);l(h[1],null!==(r=null!==(t=h[4])&&void 0!==t?t:h[5])&&void 0!==r?r:"");break;default:throw new Error(i)}}return[s,o]}(e),r=t[0],i=t[1],n=document.createElement(null!=r?r:"div"),s=0,o=Object.keys(i);s<o.length;s++){var a=o[s],l=i[a].join(" ");"style"===a?Lr(n.style,l):n.setAttribute(a,l)}return n}function Lr(e,t){for(var r=0,i=t.split(";");r<i.length;r++){var n=i[r],s=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(s){var o=s[1],a=s[2],l=s[4];e.setProperty(o,a,l||"")}}}var Pr,Ur,jr=["monospace","sans-serif","serif"],Br=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Wr(e){return e.toDataURL()}function zr(){var e=screen;return[wr(Er(e.availTop),null),wr(Er(e.width)-Er(e.availWidth)-wr(Er(e.availLeft),0),null),wr(Er(e.height)-Er(e.availHeight)-wr(Er(e.availTop),0),null),wr(Er(e.availLeft),null)]}function Gr(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Vr(e){var t;return sr(this,void 0,void 0,function(){var r,i,n,s,o,a,l;return or(this,function(u){switch(u.label){case 0:for(r=document,i=r.createElement("div"),n=new Array(e.length),s={},qr(i),l=0;l<e.length;++l)"DIALOG"===(o=Dr(e[l])).tagName&&o.show(),qr(a=r.createElement("div")),a.appendChild(o),i.appendChild(a),n[l]=o;u.label=1;case 1:return r.body?[3,3]:[4,ur(50)];case 2:return u.sent(),[3,1];case 3:r.body.appendChild(i);try{for(l=0;l<e.length;++l)n[l].offsetParent||(s[e[l]]=!0)}finally{null===(t=i.parentNode)||void 0===t||t.removeChild(i)}return[2,s]}})})}function qr(e){e.style.setProperty("display","block","important")}function Kr(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function Hr(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}function Yr(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function Xr(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function Jr(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var Zr=Math,Qr=function(){return 0},$r={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]},ei={fonts:function(){return _r(function(e,t){var r=t.document,i=r.body;i.style.fontSize="48px";var n=r.createElement("div"),s={},o={},a=function(e){var t=r.createElement("span"),i=t.style;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,t.textContent="mmMwWLliI0O&1",n.appendChild(t),t},l=jr.map(a),u=function(){for(var e={},t=function(t){e[t]=jr.map(function(e){return function(e,t){return a("'".concat(e,"',").concat(t))}(t,e)})},r=0,i=Br;r<i.length;r++)t(i[r]);return e}();i.appendChild(n);for(var d=0;d<jr.length;d++)s[jr[d]]=l[d].offsetWidth,o[jr[d]]=l[d].offsetHeight;return Br.filter(function(e){return t=u[e],jr.some(function(e,r){return t[r].offsetWidth!==s[e]||t[r].offsetHeight!==o[e]});var t})})},domBlockers:function(e){var t=(void 0===e?{}:e).debug;return sr(this,void 0,void 0,function(){var e,r,i,n,s;return or(this,function(o){switch(o.label){case 0:return Ar()||Nr()?(a=atob,e={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',a("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",a("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",a("LnNwb25zb3JpdA=="),".ylamainos",a("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",a("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",a("LmhlYWRlci1ibG9ja2VkLWFk"),a("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",a("I2FkXzMwMFgyNTA="),a("I2Jhbm5lcmZsb2F0MjI="),a("I2NhbXBhaWduLWJhbm5lcg=="),a("I0FkLUNvbnRlbnQ=")],adGuardChinese:[a("LlppX2FkX2FfSA=="),a("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",a("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),a("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",a("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",a("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",a("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),a("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),a("LmFkZ29vZ2xl"),a("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[a("YW1wLWF1dG8tYWRz"),a("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",a("I2FkX2ludmlld19hcmVh")],adGuardRussian:[a("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),a("LnJlY2xhbWE="),'div[id^="smi2adblock"]',a("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[a("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),a("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",a("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),a("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),a("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",a("I3Jla2xhbWk="),a("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),a("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),a("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[a("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",a("LndpZGdldF9wb19hZHNfd2lkZ2V0"),a("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",a("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[a("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),a("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",a("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",a("I3Jla2xhbW5pLWJveA=="),a("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",a("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[a("I2FkdmVydGVudGll"),a("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",a("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",a("LnNwb25zb3JsaW5rZ3J1ZW4="),a("I3dlcmJ1bmdza3k="),a("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),a("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[a("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",a("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[a("LnJla2xhbW9zX3RhcnBhcw=="),a("LnJla2xhbW9zX251b3JvZG9z"),a("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),a("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),a("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[a("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[a("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),a("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",a("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[a("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),a("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),a("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",a("LmFkX19tYWlu"),a("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[a("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[a("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),a("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[a("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),a("I2xpdmVyZUFkV3JhcHBlcg=="),a("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),a("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[a("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",a("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),a("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),a("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[a("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),a("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),a("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",a("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),a("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),a("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),a("ZGl2I3NrYXBpZWNfYWQ=")],ro:[a("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),a("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),a("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),a("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[a("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),a("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),a("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",a("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),a("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",a("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]},r=Object.keys(e),[4,Vr((s=[]).concat.apply(s,r.map(function(t){return e[t]})))]):[2,void 0];case 1:return i=o.sent(),t&&function(e,t){for(var r="DOM blockers debug:\n```",i=0,n=Object.keys(e);i<n.length;i++){var s=n[i];r+="\n".concat(s,":");for(var o=0,a=e[s];o<a.length;o++){var l=a[o];r+="\n ".concat(t[l]?"🚫":"➡️"," ").concat(l)}}console.log("".concat(r,"\n```"))}(e,i),(n=r.filter(function(t){var r=e[t];return Sr(r.map(function(e){return i[e]}))>.6*r.length})).sort(),[2,n]}var a})})},fontPreferences:function(){return void 0===e&&(e=4e3),_r(function(t,r){var i=r.document,n=i.body,s=n.style;s.width="".concat(e,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",Rr()?n.style.zoom="".concat(1/r.devicePixelRatio):Ar()&&(n.style.zoom="reset");var o=i.createElement("div");return o.textContent=ar([],Array(e/20|0),!0).map(function(){return"word"}).join(" "),n.appendChild(o),function(e,t){for(var r={},i={},n=0,s=Object.keys($r);n<s.length;n++){var o=s[n],a=$r[o],l=a[0],u=void 0===l?{}:l,d=a[1],h=void 0===d?"mmMwWLliI0fiflO&1":d,c=e.createElement("span");c.textContent=h,c.style.whiteSpace="nowrap";for(var p=0,f=Object.keys(u);p<f.length;p++){var m=f[p],g=u[m];void 0!==g&&(c.style[m]=g)}r[o]=c,t.appendChild(e.createElement("br")),t.appendChild(c)}for(var y=0,v=Object.keys($r);y<v.length;y++)i[o=v[y]]=r[o].getBoundingClientRect().width;return i}(i,n)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">');var e},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Ar()&&!Cr()&&!function(){var e=window;return Sr(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var r=new t(1,5e3,44100),i=r.createOscillator();i.type="triangle",i.frequency.value=1e4;var n=r.createDynamicsCompressor();n.threshold.value=-50,n.knee.value=40,n.ratio.value=12,n.attack.value=0,n.release.value=.25,i.connect(n),n.connect(r.destination),i.start(0);var s=function(e){var t=function(){};return[new Promise(function(r,i){var n=!1,s=0,o=0;e.oncomplete=function(e){return r(e.renderedBuffer)};var a=function(){setTimeout(function(){return i(xr("timeout"))},Math.min(500,o+5e3-Date.now()))},l=function(){try{var t=e.startRendering();switch(dr(t)&&pr(t),e.state){case"running":o=Date.now(),n&&a();break;case"suspended":document.hidden||s++,n&&s>=3?i(xr("suspended")):setTimeout(l,500)}}catch(e){i(e)}};l(),t=function(){n||(n=!0,o>0&&a())}}),t]}(r),o=s[0],a=s[1],l=o.then(function(e){return function(e){for(var t=0,r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}(e.getChannelData(0).subarray(4500))},function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e});return pr(l),function(){return a(),l}},screenFrame:function(){var e=this,t=function(){var e=this;return function(){if(void 0===Ur){var e=function(){var t=zr();Gr(t)?Ur=setTimeout(e,2500):(Pr=t,Ur=void 0)};e()}}(),function(){return sr(e,void 0,void 0,function(){var e;return or(this,function(t){switch(t.label){case 0:return Gr(e=zr())?Pr?[2,ar([],Pr,!0)]:(r=document).fullscreenElement||r.msFullscreenElement||r.mozFullScreenElement||r.webkitFullscreenElement?[4,Or()]:[3,2]:[3,2];case 1:t.sent(),e=zr(),t.label=2;case 2:return Gr(e)||(Pr=e),[2,e]}var r})})}}();return function(){return sr(e,void 0,void 0,function(){var e,r;return or(this,function(i){switch(i.label){case 0:return[4,t()];case 1:return e=i.sent(),[2,[(r=function(e){return null===e?null:Mr(e,10)})(e[0]),r(e[1]),r(e[2]),r(e[3])]]}})})}},osCpu:function(){return navigator.oscpu},languages:function(){var e,t=navigator,r=[],i=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(void 0!==i&&r.push([i]),Array.isArray(t.languages))Rr()&&Sr([!("MediaSettingsRange"in(e=window)),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3||r.push(t.languages);else if("string"==typeof t.languages){var n=t.languages;n&&r.push(n.split(","))}return r},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return wr(Er(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return wr(Ir(e),null)},r=[t(e.width),t(e.height)];return r.sort().reverse(),r},hardwareConcurrency:function(){return wr(Ir(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var r=(new t).resolvedOptions().timeZone;if(r)return r}var i,n=(i=(new Date).getFullYear(),-Math.max(Er(new Date(i,0,1).getTimezoneOffset()),Er(new Date(i,6,1).getTimezoneOffset())));return"UTC".concat(n>=0?"+":"").concat(Math.abs(n))},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){var e,t;if(!(Tr()||(e=window,t=navigator,Sr(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Tr())))try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&Ar()&&!Cr()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return Sr(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],r=0;r<e.length;++r){var i=e[r];if(i){for(var n=[],s=0;s<i.length;++s){var o=i[s];n.push({type:o.type,suffixes:o.suffixes})}t.push({name:i.name,description:i.description,mimeTypes:n})}}return t}},canvas:function(){var e,t,r=!1,i=function(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}(),n=i[0],s=i[1];if(function(e,t){return!(!t||!e.toDataURL)}(n,s)){r=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(s),function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var r="Cwm fjordbank gly ".concat(String.fromCharCode(55357,56835));t.fillText(r,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(r,4,45)}(n,s);var o=Wr(n);o!==Wr(n)?e=t="unstable":(t=o,function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var r=0,i=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];r<i.length;r++){var n=i[r],s=n[0],o=n[1],a=n[2];t.fillStyle=s,t.beginPath(),t.arc(o,a,40,0,2*Math.PI,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(n,s),e=Wr(n))}else e=t="";return{winding:r,geometry:e,text:t}},touchSupport:function(){var e,t=navigator,r=0;void 0!==t.maxTouchPoints?r=Ir(t.maxTouchPoints):void 0!==t.msMaxTouchPoints&&(r=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){e=!1}return{maxTouchPoints:r,touchEvent:e,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var e=[],t=0,r=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<r.length;t++){var i=r[t],n=window[i];n&&"object"==typeof n&&e.push(i)}return e.sort()},cookiesEnabled:function(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(e){return!1}},colorGamut:function(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var r=t[e];if(matchMedia("(color-gamut: ".concat(r,")")).matches)return r}},invertedColors:function(){return!!Kr("inverted")||!Kr("none")&&void 0},forcedColors:function(){return!!Hr("active")||!Hr("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=100;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}},contrast:function(){return Yr("no-preference")?0:Yr("high")||Yr("more")?1:Yr("low")||Yr("less")?-1:Yr("forced")?10:void 0},reducedMotion:function(){return!!Xr("reduce")||!Xr("no-preference")&&void 0},hdr:function(){return!!Jr("high")||!Jr("standard")&&void 0},math:function(){var e,t=Zr.acos||Qr,r=Zr.acosh||Qr,i=Zr.asin||Qr,n=Zr.asinh||Qr,s=Zr.atanh||Qr,o=Zr.atan||Qr,a=Zr.sin||Qr,l=Zr.sinh||Qr,u=Zr.cos||Qr,d=Zr.cosh||Qr,h=Zr.tan||Qr,c=Zr.tanh||Qr,p=Zr.exp||Qr,f=Zr.expm1||Qr,m=Zr.log1p||Qr;return{acos:t(.12312423423423424),acosh:r(1e308),acoshPf:(e=1e154,Zr.log(e+Zr.sqrt(e*e-1))),asin:i(.12312423423423424),asinh:n(1),asinhPf:Zr.log(1+Zr.sqrt(2)),atanh:s(.5),atanhPf:Zr.log(3)/2,atan:o(.5),sin:a(-1e300),sinh:l(1),sinhPf:Zr.exp(1)-1/Zr.exp(1)/2,cos:u(10.000000000123),cosh:d(1),coshPf:(Zr.exp(1)+1/Zr.exp(1))/2,tan:h(-1e300),tanh:c(1),tanhPf:(Zr.exp(2)-1)/(Zr.exp(2)+1),exp:p(1),expm1:f(1),expm1Pf:Zr.exp(1)-1,log1p:m(10),log1pPf:Zr.log(11),powPI:Zr.pow(Zr.PI,-100)}},videoCard:function(){var e,t=document.createElement("canvas"),r=null!==(e=t.getContext("webgl"))&&void 0!==e?e:t.getContext("experimental-webgl");if(r&&"getExtension"in r){var i=r.getExtension("WEBGL_debug_renderer_info");if(i)return{vendor:(r.getParameter(i.UNMASKED_VENDOR_WEBGL)||"").toString(),renderer:(r.getParameter(i.UNMASKED_RENDERER_WEBGL)||"").toString()}}},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}};function ti(e){return JSON.stringify(e,function(e,t){return t instanceof Error?nr({name:(r=t).name,message:r.message,stack:null===(i=r.stack)||void 0===i?void 0:i.split("\n")},r):t;var r,i},2)}function ri(e){return function(e,t){t=t||0;var r,i=(e=e||"").length%16,n=e.length-i,s=[0,t],o=[0,t],a=[0,0],l=[0,0],u=[2277735313,289559509],d=[1291169091,658871167];for(r=0;r<n;r+=16)a=[255&e.charCodeAt(r+4)|(255&e.charCodeAt(r+5))<<8|(255&e.charCodeAt(r+6))<<16|(255&e.charCodeAt(r+7))<<24,255&e.charCodeAt(r)|(255&e.charCodeAt(r+1))<<8|(255&e.charCodeAt(r+2))<<16|(255&e.charCodeAt(r+3))<<24],l=[255&e.charCodeAt(r+12)|(255&e.charCodeAt(r+13))<<8|(255&e.charCodeAt(r+14))<<16|(255&e.charCodeAt(r+15))<<24,255&e.charCodeAt(r+8)|(255&e.charCodeAt(r+9))<<8|(255&e.charCodeAt(r+10))<<16|(255&e.charCodeAt(r+11))<<24],a=gr(a=mr(a,u),31),s=fr(s=gr(s=vr(s,a=mr(a,d)),27),o),s=fr(mr(s,[0,5]),[0,1390208809]),l=gr(l=mr(l,d),33),o=fr(o=gr(o=vr(o,l=mr(l,u)),31),s),o=fr(mr(o,[0,5]),[0,944331445]);switch(a=[0,0],l=[0,0],i){case 15:l=vr(l,yr([0,e.charCodeAt(r+14)],48));case 14:l=vr(l,yr([0,e.charCodeAt(r+13)],40));case 13:l=vr(l,yr([0,e.charCodeAt(r+12)],32));case 12:l=vr(l,yr([0,e.charCodeAt(r+11)],24));case 11:l=vr(l,yr([0,e.charCodeAt(r+10)],16));case 10:l=vr(l,yr([0,e.charCodeAt(r+9)],8));case 9:l=mr(l=vr(l,[0,e.charCodeAt(r+8)]),d),o=vr(o,l=mr(l=gr(l,33),u));case 8:a=vr(a,yr([0,e.charCodeAt(r+7)],56));case 7:a=vr(a,yr([0,e.charCodeAt(r+6)],48));case 6:a=vr(a,yr([0,e.charCodeAt(r+5)],40));case 5:a=vr(a,yr([0,e.charCodeAt(r+4)],32));case 4:a=vr(a,yr([0,e.charCodeAt(r+3)],24));case 3:a=vr(a,yr([0,e.charCodeAt(r+2)],16));case 2:a=vr(a,yr([0,e.charCodeAt(r+1)],8));case 1:a=mr(a=vr(a,[0,e.charCodeAt(r)]),u),s=vr(s,a=mr(a=gr(a,31),d))}return s=fr(s=vr(s,[0,e.length]),o=vr(o,[0,e.length])),o=fr(o,s),s=fr(s=br(s),o=br(o)),o=fr(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}(function(e){for(var t="",r=0,i=Object.keys(e).sort();r<i.length;r++){var n=i[r],s=e[n],o=s.error?"error":JSON.stringify(s.value);t+="".concat(t?"|":"").concat(n.replace(/([:|\\])/g,"\\$1"),":").concat(o)}return t}(e))}function ii(e){return void 0===e&&(e=50),function(e,t){void 0===t&&(t=1/0);var r=window.requestIdleCallback;return r?new Promise(function(e){return r.call(window,function(){return e()},{timeout:t})}):ur(Math.min(e,t))}(e,2*e)}function ni(e,t){var r=Date.now();return{get:function(i){return sr(this,void 0,void 0,function(){var n,s,o;return or(this,function(a){switch(a.label){case 0:return n=Date.now(),[4,e()];case 1:return s=a.sent(),o=function(e){var t,r=function(e){var t=function(e){if(Nr())return.4;if(Ar())return Cr()?.5:.3;var t=e.platform.value||"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}(e),r=function(e){return Mr(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,"".concat(r))}}(e);return{get visitorId(){return void 0===t&&(t=ri(this.components)),t},set visitorId(e){t=e},confidence:r,components:e,version:lr}}(s),(t||(null==i?void 0:i.debug))&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(o.version,"\nuserAgent: ").concat(navigator.userAgent,"\ntimeBetweenLoadAndGet: ").concat(n-r,"\nvisitorId: ").concat(o.visitorId,"\ncomponents: ").concat(ti(s),"\n```")),[2,o]}})})}}}var si,oi,ai={load:function(e){var t=void 0===e?{}:e,r=t.delayFallback,i=t.debug,n=t.monitoring,s=void 0===n||n;return sr(this,void 0,void 0,function(){return or(this,function(e){switch(e.label){case 0:return s&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(lr,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),[4,ii(r)];case 1:return e.sent(),[2,ni(Fr(ei,{debug:i},[]),i)]}})})},hashComponents:ri,componentsToDebugString:ti};!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[11],this.#e),Array.isArray(e)||"object"!=typeof e||("userId"in e&&null!=e.userId&&(this.userId=e.userId),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"account"in e&&null!=e.account&&(this.account=e.account),"prefix"in e&&null!=e.prefix&&(this.prefix=e.prefix),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"host"in e&&null!=e.host&&(this.host=e.host),"max"in e&&null!=e.max&&(this.max=e.max),"deviceModel"in e&&null!=e.deviceModel&&(this.deviceModel=e.deviceModel),"hosts"in e&&null!=e.hosts&&(this.hosts=e.hosts),"region"in e&&null!=e.region&&(this.region=e.region),"phone"in e&&null!=e.phone&&(this.phone=e.phone),"email"in e&&null!=e.email&&(this.email=e.email),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar),"getaway"in e&&null!=e.getaway&&(this.getaway=e.getaway),"deviceName"in e&&null!=e.deviceName&&(this.deviceName=e.deviceName),"ip"in e&&null!=e.ip&&(this.ip=e.ip),"country"in e&&null!=e.country&&(this.country=e.country),"city"in e&&null!=e.city&&(this.city=e.city))}get userId(){return Bt.Message.getFieldWithDefault(this,1,"")}set userId(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get deviceKey(){return Bt.Message.getFieldWithDefault(this,3,"")}set deviceKey(e){Bt.Message.setField(this,3,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,4,0)}set roomId(e){Bt.Message.setField(this,4,e)}get account(){return Bt.Message.getFieldWithDefault(this,5,"")}set account(e){Bt.Message.setField(this,5,e)}get prefix(){return Bt.Message.getFieldWithDefault(this,6,"")}set prefix(e){Bt.Message.setField(this,6,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,7,"")}set nickname(e){Bt.Message.setField(this,7,e)}get host(){return Bt.Message.getFieldWithDefault(this,8,"")}set host(e){Bt.Message.setField(this,8,e)}get max(){return Bt.Message.getFieldWithDefault(this,9,0)}set max(e){Bt.Message.setField(this,9,e)}get deviceModel(){return Bt.Message.getFieldWithDefault(this,10,"")}set deviceModel(e){Bt.Message.setField(this,10,e)}get hosts(){return Bt.Message.getFieldWithDefault(this,11,[])}set hosts(e){Bt.Message.setField(this,11,e)}get region(){return Bt.Message.getFieldWithDefault(this,12,"")}set region(e){Bt.Message.setField(this,12,e)}get phone(){return Bt.Message.getFieldWithDefault(this,13,"")}set phone(e){Bt.Message.setField(this,13,e)}get email(){return Bt.Message.getFieldWithDefault(this,14,"")}set email(e){Bt.Message.setField(this,14,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,15,"")}set avatar(e){Bt.Message.setField(this,15,e)}get getaway(){return Bt.Message.getFieldWithDefault(this,16,"")}set getaway(e){Bt.Message.setField(this,16,e)}get deviceName(){return Bt.Message.getFieldWithDefault(this,17,"")}set deviceName(e){Bt.Message.setField(this,17,e)}get ip(){return Bt.Message.getFieldWithDefault(this,18,"")}set ip(e){Bt.Message.setField(this,18,e)}get country(){return Bt.Message.getFieldWithDefault(this,19,"")}set country(e){Bt.Message.setField(this,19,e)}get city(){return Bt.Message.getFieldWithDefault(this,20,"")}set city(e){Bt.Message.setField(this,20,e)}static fromObject(e){const r=new t({});return null!=e.userId&&(r.userId=e.userId),null!=e.appId&&(r.appId=e.appId),null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.roomId&&(r.roomId=e.roomId),null!=e.account&&(r.account=e.account),null!=e.prefix&&(r.prefix=e.prefix),null!=e.nickname&&(r.nickname=e.nickname),null!=e.host&&(r.host=e.host),null!=e.max&&(r.max=e.max),null!=e.deviceModel&&(r.deviceModel=e.deviceModel),null!=e.hosts&&(r.hosts=e.hosts),null!=e.region&&(r.region=e.region),null!=e.phone&&(r.phone=e.phone),null!=e.email&&(r.email=e.email),null!=e.avatar&&(r.avatar=e.avatar),null!=e.getaway&&(r.getaway=e.getaway),null!=e.deviceName&&(r.deviceName=e.deviceName),null!=e.ip&&(r.ip=e.ip),null!=e.country&&(r.country=e.country),null!=e.city&&(r.city=e.city),r}toObject(){const e={};return null!=this.userId&&(e.userId=this.userId),null!=this.appId&&(e.appId=this.appId),null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.roomId&&(e.roomId=this.roomId),null!=this.account&&(e.account=this.account),null!=this.prefix&&(e.prefix=this.prefix),null!=this.nickname&&(e.nickname=this.nickname),null!=this.host&&(e.host=this.host),null!=this.max&&(e.max=this.max),null!=this.deviceModel&&(e.deviceModel=this.deviceModel),null!=this.hosts&&(e.hosts=this.hosts),null!=this.region&&(e.region=this.region),null!=this.phone&&(e.phone=this.phone),null!=this.email&&(e.email=this.email),null!=this.avatar&&(e.avatar=this.avatar),null!=this.getaway&&(e.getaway=this.getaway),null!=this.deviceName&&(e.deviceName=this.deviceName),null!=this.ip&&(e.ip=this.ip),null!=this.country&&(e.country=this.country),null!=this.city&&(e.city=this.city),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.userId.length&&t.writeString(1,this.userId),0!=this.appId&&t.writeInt64(2,this.appId),this.deviceKey.length&&t.writeString(3,this.deviceKey),0!=this.roomId&&t.writeInt64(4,this.roomId),this.account.length&&t.writeString(5,this.account),this.prefix.length&&t.writeString(6,this.prefix),this.nickname.length&&t.writeString(7,this.nickname),this.host.length&&t.writeString(8,this.host),0!=this.max&&t.writeInt32(9,this.max),this.deviceModel.length&&t.writeString(10,this.deviceModel),this.hosts.length&&t.writeRepeatedString(11,this.hosts),this.region.length&&t.writeString(12,this.region),this.phone.length&&t.writeString(13,this.phone),this.email.length&&t.writeString(14,this.email),this.avatar.length&&t.writeString(15,this.avatar),this.getaway.length&&t.writeString(16,this.getaway),this.deviceName.length&&t.writeString(17,this.deviceName),this.ip.length&&t.writeString(18,this.ip),this.country.length&&t.writeString(19,this.country),this.city.length&&t.writeString(20,this.city),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.userId=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.deviceKey=r.readString();break;case 4:i.roomId=r.readInt64();break;case 5:i.account=r.readString();break;case 6:i.prefix=r.readString();break;case 7:i.nickname=r.readString();break;case 8:i.host=r.readString();break;case 9:i.max=r.readInt32();break;case 10:i.deviceModel=r.readString();break;case 11:Bt.Message.addToRepeatedField(i,11,r.readString());break;case 12:i.region=r.readString();break;case 13:i.phone=r.readString();break;case 14:i.email=r.readString();break;case 15:i.avatar=r.readString();break;case 16:i.getaway=r.readString();break;case 17:i.deviceName=r.readString();break;case 18:i.ip=r.readString();break;case 19:i.country=r.readString();break;case 20:i.city=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Connect=t}(e.imio||(e.imio={}))}(si||(si={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"name"in e&&null!=e.name&&(this.name=e.name),"host"in e&&null!=e.host&&(this.host=e.host),"max"in e&&null!=e.max&&(this.max=e.max),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"ip"in e&&null!=e.ip&&(this.ip=e.ip),"one"in e&&null!=e.one&&(this.one=e.one),"two"in e&&null!=e.two&&(this.two=e.two),"three"in e&&null!=e.three&&(this.three=e.three),"four"in e&&null!=e.four&&(this.four=e.four),"five"in e&&null!=e.five&&(this.five=e.five),"port"in e&&null!=e.port&&(this.port=e.port))}get id(){return Bt.Message.getFieldWithDefault(this,1,0)}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get name(){return Bt.Message.getFieldWithDefault(this,7,"")}set name(e){Bt.Message.setField(this,7,e)}get host(){return Bt.Message.getFieldWithDefault(this,8,"")}set host(e){Bt.Message.setField(this,8,e)}get max(){return Bt.Message.getFieldWithDefault(this,9,0)}set max(e){Bt.Message.setField(this,9,e)}get remark(){return Bt.Message.getFieldWithDefault(this,10,"")}set remark(e){Bt.Message.setField(this,10,e)}get ip(){return Bt.Message.getFieldWithDefault(this,11,0)}set ip(e){Bt.Message.setField(this,11,e)}get one(){return Bt.Message.getFieldWithDefault(this,12,0)}set one(e){Bt.Message.setField(this,12,e)}get two(){return Bt.Message.getFieldWithDefault(this,13,0)}set two(e){Bt.Message.setField(this,13,e)}get three(){return Bt.Message.getFieldWithDefault(this,14,0)}set three(e){Bt.Message.setField(this,14,e)}get four(){return Bt.Message.getFieldWithDefault(this,15,0)}set four(e){Bt.Message.setField(this,15,e)}get five(){return Bt.Message.getFieldWithDefault(this,16,0)}set five(e){Bt.Message.setField(this,16,e)}get port(){return Bt.Message.getFieldWithDefault(this,17,"")}set port(e){Bt.Message.setField(this,17,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.name&&(r.name=e.name),null!=e.host&&(r.host=e.host),null!=e.max&&(r.max=e.max),null!=e.remark&&(r.remark=e.remark),null!=e.ip&&(r.ip=e.ip),null!=e.one&&(r.one=e.one),null!=e.two&&(r.two=e.two),null!=e.three&&(r.three=e.three),null!=e.four&&(r.four=e.four),null!=e.five&&(r.five=e.five),null!=e.port&&(r.port=e.port),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.name&&(e.name=this.name),null!=this.host&&(e.host=this.host),null!=this.max&&(e.max=this.max),null!=this.remark&&(e.remark=this.remark),null!=this.ip&&(e.ip=this.ip),null!=this.one&&(e.one=this.one),null!=this.two&&(e.two=this.two),null!=this.three&&(e.three=this.three),null!=this.four&&(e.four=this.four),null!=this.five&&(e.five=this.five),null!=this.port&&(e.port=this.port),e}serialize(e){const t=e||new Bt.BinaryWriter;if(0!=this.id&&t.writeInt64(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.name.length&&t.writeString(7,this.name),this.host.length&&t.writeString(8,this.host),0!=this.max&&t.writeInt64(9,this.max),this.remark.length&&t.writeString(10,this.remark),0!=this.ip&&t.writeInt32(11,this.ip),0!=this.one&&t.writeInt32(12,this.one),0!=this.two&&t.writeInt32(13,this.two),0!=this.three&&t.writeInt32(14,this.three),0!=this.four&&t.writeInt32(15,this.four),0!=this.five&&t.writeInt64(16,this.five),this.port.length&&t.writeString(17,this.port),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readInt64();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:i.name=r.readString();break;case 8:i.host=r.readString();break;case 9:i.max=r.readInt64();break;case 10:i.remark=r.readString();break;case 11:i.ip=r.readInt32();break;case 12:i.one=r.readInt32();break;case 13:i.two=r.readInt32();break;case 14:i.three=r.readInt32();break;case 15:i.four=r.readInt32();break;case 16:i.five=r.readInt64();break;case 17:i.port=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Gateway=t}(e.imio||(e.imio={}))}(oi||(oi={}));var li=r(287).hp,ui=si.imio.Connect,di=Ut.imio.Contacts,hi=qt.imio.Message,ci=oi.imio.Gateway;class pi extends Wt{static instance;constructor(){super(),this.getIP1()}static getInstance(){if(!pi.instance){pi.instance=new pi,ai.load().then(e=>e.get()).then(e=>{pi.instance.deviceId=e.visitorId});try{li.from("Buffer 支持度测试文本").toString()}catch(e){}}return pi.instance}whitOption(e){if(!e)throw new Error("初始化失败");if(!e.appId.length)throw new Error("初始化失败 appId");if(!e.host.length&&!e.hosts.length)throw new Error("接入点比选其一");this.option=e,e.protocol&&(this.protocol="wss"),this.userAgent=window.navigator.userAgent;let t=window.navigator.userAgent.indexOf("("),r=window.navigator.userAgent.indexOf(")");this.deviceName=window.navigator.userAgent.substring(t+1,r);let i=window.navigator.userAgent.lastIndexOf(")");return this.deviceModel=window.navigator.userAgent.substring(i+1),this.deviceModel.length>200&&(this.deviceModel=this.deviceModel.substring(0,200)),this.deviceName.length>150&&(this.deviceName=this.deviceModel.substring(0,150)),this.meta.appId=Number(e.appId),ai.load().then(e=>e.get()).then(t=>{this.deviceId=t.visitorId,this.meta.deviceKey=t.visitorId,e?.debug&&console.warn("Client init... "+t.visitorId)}),this}userAgent="";protocol="ws";hostAddress="";hostNodeList=[];option;clientListener;connectStatus=Dt.DONE;retryTimer=-2;connectStatusTimer=-2;retryConnectNum=0;unexpectedly=0;messageListener=[];contactListener=[];setToken(e){this.token=e;try{let t=this.getJwtPayload(e);this.tokenAppId=Number(t.aud),this.tokenAppId+""!=this.option?.appId&&this.option?.debug&&console.warn("IMIO:token中的AppId 与 IMIOClientOption不一致")}catch(e){this.tokenAppId=0,this.option?.debug&&console.warn("IMIO: token中的AppId 解析错误")}return this}isClose(){return!this.socket}getDeviceKey(){return this.deviceId}getUserInfo(){return this.account}addMessageListener(e){-1==this.messageListener.findIndex(t=>t===e)&&this.messageListener.push(e)}removeMessageListener(e){let t=this.messageListener.filter(t=>t===e).map((e,t)=>t);if(t.length>0)for(let e of t)this.messageListener.splice(e,1)}addContactListener(e){-1==this.contactListener.findIndex(t=>t===e)&&this.contactListener.push(e)}removeContactListener(e){let t=this.contactListener.filter(t=>t===e).map((e,t)=>t);if(t.length>0)for(let e of t)this.contactListener.splice(e,1)}disconnect(){return this.account=null,clearInterval(this.retryTimer),this.unexpectedly=0,this.connectStatus=Dt.DONE,this.socket&&(this.socket.close(new Error("主动关闭")),this.socket=null,this.option&&this.option.appId.length&&(this.meta.pageSize=this.pageSize,this.meta.page=0,this.meta.appId=Number(this.option?.appId))),this}connect(e,t,r,i){if(!t||t.length<50)throw new Error("IMIO 连接 token 必须");if(i&&(this.clientListener=i),this.token=t,!this.option)throw new Error("IMIOClientOption 缺失");try{let e=this.getJwtPayload(t);this.tokenAppId=Number(e.aud)}catch(e){this.tokenAppId=0}if(0==this.tokenAppId||this.tokenAppId+""!=this.option?.appId)throw new Error("token中的AppId 与 IMIOClientOption不一致");return this.option?.debug&&(console.warn("connect deviceId",this.deviceId),this.meta.deviceKey.length||(this.meta.deviceKey=this.deviceId)),this.isClose()&&this.disconnect(),this.account=new zt,this.account.nickname=r,e&&(this.account.accountId=e.toString(),this.meta.userId=this.account.accountId),this.deviceId.length?this.callSocket(e):setTimeout(()=>{this.callSocket(e)},2e3),this}callSocket(e=0){if(!this.option)throw new Error("客户端配置项不存在");if(this.hostAddress=this.hostAddressProvider(),!this.hostAddress.length)throw new Error("主机地址不存在");let t="",r="",i="";e||(this.account&&this.account.nickname&&(t=this.account.nickname.toString()),this.account&&this.account.phone&&(r=this.account.phone.toString()),this.account&&this.account.email&&(i=this.account.email.toString()));try{this.ip.length<=6&&this.getIP1()}catch(e){}const n=new ui({appId:parseInt(this.option.appId),deviceKey:this.deviceId,prefix:"h5",userId:e>0?e.toString():"",nickname:e>0?t:"",email:e>0?i:"",phone:e>0?r:"",deviceModel:this.deviceModel,deviceName:this.deviceName,ip:this.ip+"",country:this.country+"",city:this.city+""});let s=null;try{s=(0,d.encodeBearerAuthMetadata)(this.token)}catch(e){return void(this.option?.debug&&console.error("Buffer Error",e))}if(!s)return;this.option?.debug&&console.warn("IMIO host",this.hostAddress);let a=new l.RSocketConnector({setup:{keepAlive:5e3,dataMimeType:d.WellKnownMimeType.APPLICATION_CBOR.string,metadataMimeType:d.WellKnownMimeType.MESSAGE_RSOCKET_COMPOSITE_METADATA.string,payload:{data:li.from(n.serializeBinary().buffer),metadata:(0,d.encodeCompositeMetadata)([[d.WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION,(0,d.encodeBearerAuthMetadata)(this.token)]])}},transport:new u.WebsocketClientTransport({debug:!0,url:`${this.protocol}://${this.hostAddress}`}),responder:{fireAndForget:(e,t)=>{const r=e.metadata,i=e.data;t.onComplete();let n="";return r&&(n=this.decodeMetadata(r).get("route")),this.option?.debug&&console.warn("IMIO fireAndForget...",n),this.routerParse(n,i),{cancel(){}}},requestResponse:(e,t)=>{const r=e.metadata,i=e.data;t.onNext({data:li.from("OK")},!0);let n="";return r&&(n=this.decodeMetadata(r).get("route")),this.option?.debug&&console.warn("IMIO requestResponse...",n),this.routerParse(n,i),{cancel(){},onExtension(e,t,r){}}}}});this.connectStatus=Dt.CONNECTING,this.connectStatusTimer=setInterval(()=>{try{this.clientListener&&this.clientListener.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}try{this.connectStatus!=Dt.SUCCESS&&this.connectStatus!=Dt.SUCCESS_PULL||this.ping()}catch(e){}},2e3),a.connect().then(e=>{this.option?.debug&&console.warn("IMIO connect success..."),this.account&&(this.account.status=o.online);try{this.connectStatus=Dt.SUCCESS_PULL,this.clientListener?.onConnected()}catch(e){}this.retryConnectNum=0,this.unexpectedly=0,this.socket=e,clearInterval(this.retryTimer),this.retryTimer=-2,e.onClose(e=>{let t=e?.message+"";this.option?.debug&&console.error("IMIOServer connect onClose",t),this.account&&(this.account.status=o.done),this.connectErrorEvent(t)})}).catch(e=>{if(this.option?.debug&&console.error("IMIOServer Connect Error",e),e){let t=e?.message+"";this.connectErrorEvent(t)}else{if(this.account&&(this.account.status=o.done),this.unexpectedly>6){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.socket=null,this.connectStatus=Dt.ERROR,this.retryTimer=-2;try{this.clientListener?.onDisconnected()}catch(e){}return}clearInterval(this.connectStatusTimer),this.connectStatusTimer=-2,this.unexpectedly++,this.retryConnTimer()}}).finally(()=>{this.option?.debug&&console.warn("IMIO connect finally")})}ping(){if(!this.option)return;if(!this.option.appId.length)return;if(!this.socket)return;const e=new ui({appId:parseInt(this.option.appId),deviceKey:this.deviceId,prefix:"h5",userId:this.account?this.account.accountId.toString():"",deviceModel:this.deviceModel,deviceName:this.deviceName});this.socket?.requestResponse({data:li.from(e.serializeBinary().buffer),metadata:this.buildRoute("ping")},{onComplete:()=>{},onNext:(e,t)=>{},onError:e=>{},onExtension(e,t,r){}})}connectErrorEvent(e){if(this.socket=null,this.account&&(this.account.status=o.done),clearInterval(this.connectStatusTimer),this.connectStatusTimer=-2,e.indexOf("主动关闭")>-1){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.connectStatus=Dt.DONE,this.retryTimer=-2,this.connectStatusTimer=-2,this.retryConnectNum=0;try{this.clientListener?.onDisconnected()}catch(e){}}else{if(e.indexOf("keep-alive")>-1){if(this.unexpectedly=0,this.unexpectedly>6){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.connectStatus=Dt.ERROR,this.connectStatusTimer=-2,this.retryTimer=-2;try{this.clientListener?.onDisconnected()}catch(e){}return}return this.unexpectedly++,void this.retryConnTimer()}if(e.indexOf("unexpectedly")>-1){if(this.unexpectedly>6){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.connectStatus=Dt.ERROR,this.connectStatusTimer=-2,this.retryTimer=-2;try{this.clientListener?.onDisconnected()}catch(e){}return}return this.unexpectedly++,void this.retryConnTimer()}if(e.indexOf("Jwt")>-1){clearInterval(this.retryTimer),clearInterval(this.connectStatusTimer),this.connectStatusTimer=-2,this.retryTimer=-2;try{this.connectStatus=Dt.TOKEN_EXPIRED,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}try{this.clientListener?.onTokenExpired()}catch(e){}}else{if(e.indexOf("SQL")>-1||e.indexOf("connect")>-1){try{this.connectStatus=Dt.ERROR,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}return this.unexpectedly++,void this.retryConnTimer()}if(e.indexOf("token")>-1)try{this.connectStatus=Dt.TOKEN_EXPIRED,this.clientListener?.onTokenExpired(),this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}}}}retryConnTimer(){clearInterval(this.retryTimer),this.retryTimer=setInterval(()=>{if(this.retryConnectNum>8){clearInterval(this.retryTimer),this.retryConnectNum=0;try{this.connectStatus=Dt.ERROR,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum),this.clientListener?.onDisconnected()}catch(e){}}else if(!this.socket){this.retryConnectNum++,this.connectStatus=Dt.RETRY_CONNECTING;try{this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}if(this.account)try{let e=Number(this.account.accountId);this.callSocket(e)}catch(e){}else this.callSocket()}},8e3)}hostAddressProvider(){return this.option&&this.option?.host?this.option.host.toString():""}routerParse(e,t){switch(e){case"link-to-many":this.handleToMany(t);break;case"gateway":this.handleGateway(t);break;case"pong":clearInterval(this.connectStatusTimer),this.connectStatusTimer=-2;try{this.connectStatus=Dt.SUCCESS,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}this.handelPong(t);break;case"contact":this.handleContact(t);break;case"contact-status":this.handleContactStatus(t);break;case"contact-change":this.handleContactChange(t);break;case"notice":this.handleNotice(t);break;case"message":this.handleMessage(t)}}handleGateway(e){if(e)try{let t=ci.deserialize(e),r=this.buildGateway(t),i=this.hostNodeList.find(e=>e.host==e.host);i?i.current=r.current:this.hostNodeList.push(r)}catch(e){}}handleToMany(e){if(!e)return;clearInterval(this.retryTimer),this.retryTimer=-2;try{this.connectStatus=Dt.RETRY_CONNECTING,this.clientListener?.onConnectStatus(this.connectStatus,this.retryConnectNum)}catch(e){}const t=ui.deserialize(e);this.hostAddress=t.ip;try{let e=t.ip.split(":"),r=new f;r.max=t.appId,r.current=t.roomId,r.name=t.nickname,r.host=e[0],r.port=e[1];let i=this.hostNodeList.find(e=>e.name==r.name);i?(i.max=r.max,i.current=r.current,i.host=r.host,i.port=r.port):this.hostNodeList.push(r)}catch(e){}this.option?.whitHost(t.ip),this.socket&&(this.socket?.close(new Error("主动关闭")),this.account&&this.callSocket(Number(this.account.accountId)))}handelPong(e){if(e)try{const t=ui.deserialize(e);this.account&&(this.account.accountId=t.userId,this.account.account=t.account,this.account.roomId=t.roomId,this.account.nickname=t.nickname,this.account.avatar=t.avatar),this.meta&&(this.meta.roomId=t.roomId,this.meta.userId=t.userId,this.meta.nickname=t.nickname,this.meta.avatar=t.avatar),this.option?.debug&&(console.warn("IMIO meta",this.meta.toObject()),console.warn("IMIO userinfo",this.account))}catch(e){}}handleContact(e){if(e)try{let t=di.deserialize(e),r=this.buildContact(t),i=this.contactList.findIndex(e=>e.contactId==r.contactId);i>-1?this.contactList[i]=r:this.contactList.push(r)}catch(e){}}handleContactStatus(e){if(e)try{let t=hi.deserialize(e),r=this.contactList.findIndex(e=>!e.isGroup&&e.userId==t.fromId);if(r>-1){let e=o.done;t.command==o.offline&&(e=o.offline),t.command==o.online&&(e=o.online),t.command==o.online_busy&&(e=o.online_busy),t.command==o.online_leave&&(e=o.online_leave),this.contactList[r].status=e,this.account&&this.account.accountId.length>0&&t.fromId==this.account.accountId&&(this.account.status=t.command);for(const e of this.contactListener)try{e.onContactChange?.(!1,this.contactList[r])}catch(e){}}}catch(e){}}handleContactChange(e){if(e)try{let t=hi.deserialize(e);t.text.length&&Jt.getInstance().getContactByUserId(t.text).then(e=>{let t=this.contactList.findIndex(t=>!t.isGroup&&t.userId==e.userId);if(t>-1){this.contactList.splice(t,1,e);for(const t of this.contactListener)try{t.onContactChange?.(!1,e)}catch(e){}}})}catch(e){}}handleNotice(e){if(e)try{let t=hi.deserialize(e),r=this.buildMessage(t);for(const e of this.messageListener)try{e.onNotice?.(r)}catch(e){}}catch(e){}}handleMessage(e){if(e)try{let t=hi.deserialize(e),r=this.buildMessage(t);try{ir.getInstance().setClient(this).signMessage(r.messageId,r.joinId).then()}catch(e){}for(const e of this.messageListener)try{e.onMessage?.(r)}catch(e){}}catch(e){}}}class fi{_appId="";_issuer="";_host="";_hosts=[];_debug=!1;_protocol=!1;constructor(){}static newBuilder(){return new fi}whitAppId(e){return this._appId=e,this}whitIssuer(e){return this._issuer=e,this}whitHost(e){return this._host=e,this._hosts.push(e),this}whitHosts(e){return this._hosts=e,this}whitDebug(e){return this._debug=e,this}whitProtocol(e){return this._protocol=e,this}build(){return this}get appId(){return this._appId}get issuer(){return this._issuer}get host(){return this._host}set host(e){this._host=e}get hosts(){return this._hosts}get debug(){return this._debug}get protocol(){return this._protocol}}class mi{static instance;imioClient=null;constructor(){}static getInstance(){return mi.instance||(mi.instance=new mi),mi.instance}setIMIOClient(e){return this.imioClient=e,this}}var gi,yi,vi=r(287).hp,bi=Ut.imio.Contacts,Ii=jt.imio.Rooms;class Ei extends Gt{static instance;imioClient=null;constructor(){super()}static getInstance(){return Ei.instance||(Ei.instance=new Ei),Ei.instance}setClient(e){return this.imioClient=e,this}search(e,t,r=1,i=50){return new Promise((n,s)=>{if(this.checkSocket().length)return void s(new Error(this.checkSocket()));this.imioClient.meta.page=r,this.imioClient.meta.pageSize=i;const o=new Ii({meta:this.imioClient.meta,talkMode:e,type:"protected",roomname:1==e?"":t,account:1==e?t:""});let a=[];this.imioClient.socket?.requestStream({data:vi.from(o.serializeBinary().buffer),metadata:this.buildRoute("group.search")},this.imioClient.pageSize,{onComplete:()=>{n(a)},onNext:(e,t)=>{try{if(e.data){let t=Ii.deserialize(e.data),r=this.buildGroup(t);a.push(r)}}catch(e){s(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?s(new Error(r)):s(new Error(t))},onExtension(e,t,r){}})})}getMembers(e,t=1){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));this.imioClient.meta.page=t;const n=new bi({meta:this.imioClient.meta,joinRoomId:e});let s=[];this.imioClient.socket?.requestStream({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.members")},this.imioClient.pageSize,{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let t=bi.deserialize(e.data),r=this.buildMember(t);s.push(r)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}getGroupById(e){return new Promise(async(t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new bi({meta:this.imioClient.meta,joinRoomId:e});let n=null;this.imioClient.socket?.requestResponse({data:vi.from(i.serializeBinary().buffer),metadata:this.buildRoute("group.byId")},{onComplete:()=>{t(n)},onNext:(e,i)=>{try{if(e.data){let r=Ii.deserialize(e.data),s=this.buildGroup(r);n=s,i&&t(n)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}createGroup(e,t){return new Promise(async(r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));let n=await Jt.getInstance().setClient(this.imioClient).getContactList();if(n.length<=0)return void i(new Error("联系人获取失败"));let s=n.filter(e=>!e.isGroup&&-1!=t.findIndex(t=>t==e.userId));if(s.length<=0)return void i(new Error("您设置的群成员不正确"));let o=s.map(e=>new bi({userId:e.userId}));const a=new Ii({meta:this.imioClient.meta,roomname:e,users:o});let l=null;this.imioClient.socket?.requestResponse({data:vi.from(a.serializeBinary().buffer),metadata:this.buildRoute("group.create")},{onComplete:()=>{r(l)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);l=n,t&&r(l)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}joinGroup(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,remark:t});let s=[];this.imioClient.socket?.requestStream({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.join")},this.imioClient.pageSize,{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let t=bi.deserialize(e.data),r=this.buildMember(t);s.push(r)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}groupInvite(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,fromUserId:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.invite")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}exit(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new bi({meta:this.imioClient.meta,joinRoomId:e});this.imioClient.socket?.requestStream({data:vi.from(i.serializeBinary().buffer),metadata:this.buildRoute("group.exit")},30,{onComplete:()=>{t("")},onNext:(e,t)=>{},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}removeMember(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,fromUserId:t});this.imioClient.socket?.requestStream({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.remove")},30,{onComplete:()=>{r("")},onNext:(e,t)=>{},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}changeOwner(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.change.owner")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=bi.deserialize(e.data),n=this.buildContact(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setManager(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t});this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.manager")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}addBlack(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));const s=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t,black:r?1:0});let o=null;this.imioClient.socket?.requestResponse({data:vi.from(s.serializeBinary().buffer),metadata:this.buildRoute("group.add.black")},{onComplete:()=>{i(o)},onNext:(e,t)=>{try{if(e.data){let r=bi.deserialize(e.data),n=this.buildContact(r);o=n,t&&i(o)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}memberMuted(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));const s=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t,apply:r?1:0});let o=null;this.imioClient.socket?.requestResponse({data:vi.from(s.serializeBinary().buffer),metadata:this.buildRoute("group.member.muted")},{onComplete:()=>{i(o)},onNext:(e,t)=>{try{if(e.data){let r=bi.deserialize(e.data),n=this.buildContact(r);o=n,t&&i(o)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}groupMuted(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.muted")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setGroupQuestion(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));const s=new bi({meta:this.imioClient.meta,joinRoomId:e,username:t,remark:r});this.imioClient.socket?.requestResponse({data:vi.from(s.serializeBinary().buffer),metadata:this.buildRoute("group.set.answer")},{onComplete:()=>{i("")},onNext:(e,t)=>{try{t&&i("")}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}setGroupName(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,username:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.groupname")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setGroupAvatar(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,avatar:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.avatar")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setGroupDepict(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,remark:t});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.depict")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}setGroupMemberName(e,t,r){return new Promise((i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));const s=new bi({meta:this.imioClient.meta,joinRoomId:e,userId:t,username:r});this.imioClient.socket?.requestResponse({data:vi.from(s.serializeBinary().buffer),metadata:this.buildRoute("group.set.username")},{onComplete:()=>{i("")},onNext:(e,t)=>{try{t&&i("")}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}setGroupType(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t});this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.type")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isPrivateChat(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.privateChat")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isApply(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.apply")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isInviteApply(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.need")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isInvite(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?0:1});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.invite")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}isRevokeMessage(e,t){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new bi({meta:this.imioClient.meta,joinRoomId:e,apply:t?1:0});let s=null;this.imioClient.socket?.requestResponse({data:vi.from(n.serializeBinary().buffer),metadata:this.buildRoute("group.set.revoke")},{onComplete:()=>{r(s)},onNext:(e,t)=>{try{if(e.data){let i=Ii.deserialize(e.data),n=this.buildGroup(i);s=n,t&&r(s)}}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}onError(e){if(e.indexOf("Jwt")>-1){try{this.imioClient.clientListener?.onTokenExpired()}catch(e){}return"IMIO Token 已过期"}return e.indexOf("SQL")>-1||e.indexOf("connect")>-1?"IMIO System Error":e.indexOf("terminal")>-1||e.indexOf("signal")>-1?"请求超时":""}checkSocket(){return this.imioClient?this.imioClient.socket?0==this.imioClient.getTokenAppId()||this.imioClient.getTokenAppId()!=this.imioClient.meta.appId?"token中的AppId 与 IMIOClientOption不一致":"":"IMIO Client 尚未建立连接":"IMIO Client 不存在"}}!function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"nickname"in e&&null!=e.nickname&&(this.nickname=e.nickname),"username"in e&&null!=e.username&&(this.username=e.username),"account"in e&&null!=e.account&&(this.account=e.account),"mobile"in e&&null!=e.mobile&&(this.mobile=e.mobile),"email"in e&&null!=e.email&&(this.email=e.email),"avatar"in e&&null!=e.avatar&&(this.avatar=e.avatar),"gender"in e&&null!=e.gender&&(this.gender=e.gender),"birth"in e&&null!=e.birth&&(this.birth=e.birth))}get id(){return Bt.Message.getFieldWithDefault(this,1,"")}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get roomId(){return Bt.Message.getFieldWithDefault(this,11,0)}set roomId(e){Bt.Message.setField(this,11,e)}get nickname(){return Bt.Message.getFieldWithDefault(this,12,"")}set nickname(e){Bt.Message.setField(this,12,e)}get username(){return Bt.Message.getFieldWithDefault(this,13,"")}set username(e){Bt.Message.setField(this,13,e)}get account(){return Bt.Message.getFieldWithDefault(this,14,"")}set account(e){Bt.Message.setField(this,14,e)}get mobile(){return Bt.Message.getFieldWithDefault(this,15,"")}set mobile(e){Bt.Message.setField(this,15,e)}get email(){return Bt.Message.getFieldWithDefault(this,16,"")}set email(e){Bt.Message.setField(this,16,e)}get avatar(){return Bt.Message.getFieldWithDefault(this,17,"")}set avatar(e){Bt.Message.setField(this,17,e)}get gender(){return Bt.Message.getFieldWithDefault(this,18,0)}set gender(e){Bt.Message.setField(this,18,e)}get birth(){return Bt.Message.getFieldWithDefault(this,19,"")}set birth(e){Bt.Message.setField(this,19,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.roomId&&(r.roomId=e.roomId),null!=e.nickname&&(r.nickname=e.nickname),null!=e.username&&(r.username=e.username),null!=e.account&&(r.account=e.account),null!=e.mobile&&(r.mobile=e.mobile),null!=e.email&&(r.email=e.email),null!=e.avatar&&(r.avatar=e.avatar),null!=e.gender&&(r.gender=e.gender),null!=e.birth&&(r.birth=e.birth),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.roomId&&(e.roomId=this.roomId),null!=this.nickname&&(e.nickname=this.nickname),null!=this.username&&(e.username=this.username),null!=this.account&&(e.account=this.account),null!=this.mobile&&(e.mobile=this.mobile),null!=this.email&&(e.email=this.email),null!=this.avatar&&(e.avatar=this.avatar),null!=this.gender&&(e.gender=this.gender),null!=this.birth&&(e.birth=this.birth),e}serialize(e){const t=e||new Bt.BinaryWriter;if(this.id.length&&t.writeString(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),0!=this.roomId&&t.writeInt64(11,this.roomId),this.nickname.length&&t.writeString(12,this.nickname),this.username.length&&t.writeString(13,this.username),this.account.length&&t.writeString(14,this.account),this.mobile.length&&t.writeString(15,this.mobile),this.email.length&&t.writeString(16,this.email),this.avatar.length&&t.writeString(17,this.avatar),0!=this.gender&&t.writeInt32(18,this.gender),this.birth.length&&t.writeString(19,this.birth),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readString();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.roomId=r.readInt64();break;case 12:i.nickname=r.readString();break;case 13:i.username=r.readString();break;case 14:i.account=r.readString();break;case 15:i.mobile=r.readString();break;case 16:i.email=r.readString();break;case 17:i.avatar=r.readString();break;case 18:i.gender=r.readInt32();break;case 19:i.birth=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.Users=t}(e.imio||(e.imio={}))}(gi||(gi={})),function(e){!function(e){class t extends Bt.Message{#e=[];constructor(e){super(),Bt.Message.initialize(this,Array.isArray(e)?e:[],0,-1,[7,8],this.#e),Array.isArray(e)||"object"!=typeof e||("id"in e&&null!=e.id&&(this.id=e.id),"appId"in e&&null!=e.appId&&(this.appId=e.appId),"v"in e&&null!=e.v&&(this.v=e.v),"sort"in e&&null!=e.sort&&(this.sort=e.sort),"created"in e&&null!=e.created&&(this.created=e.created),"modified"in e&&null!=e.modified&&(this.modified=e.modified),"ids"in e&&null!=e.ids&&(this.ids=e.ids),"appIds"in e&&null!=e.appIds&&(this.appIds=e.appIds),"remark"in e&&null!=e.remark&&(this.remark=e.remark),"meta"in e&&null!=e.meta&&(this.meta=e.meta),"userId"in e&&null!=e.userId&&(this.userId=e.userId),"device"in e&&null!=e.device&&(this.device=e.device),"roomId"in e&&null!=e.roomId&&(this.roomId=e.roomId),"status"in e&&null!=e.status&&(this.status=e.status),"state"in e&&null!=e.state&&(this.state=e.state),"gateway"in e&&null!=e.gateway&&(this.gateway=e.gateway),"deviceKey"in e&&null!=e.deviceKey&&(this.deviceKey=e.deviceKey),"deviceTag"in e&&null!=e.deviceTag&&(this.deviceTag=e.deviceTag),"region"in e&&null!=e.region&&(this.region=e.region))}get id(){return Bt.Message.getFieldWithDefault(this,1,0)}set id(e){Bt.Message.setField(this,1,e)}get appId(){return Bt.Message.getFieldWithDefault(this,2,0)}set appId(e){Bt.Message.setField(this,2,e)}get v(){return Bt.Message.getFieldWithDefault(this,3,0)}set v(e){Bt.Message.setField(this,3,e)}get sort(){return Bt.Message.getFieldWithDefault(this,4,0)}set sort(e){Bt.Message.setField(this,4,e)}get created(){return Bt.Message.getFieldWithDefault(this,5,"")}set created(e){Bt.Message.setField(this,5,e)}get modified(){return Bt.Message.getFieldWithDefault(this,6,"")}set modified(e){Bt.Message.setField(this,6,e)}get ids(){return Bt.Message.getFieldWithDefault(this,7,[])}set ids(e){Bt.Message.setField(this,7,e)}get appIds(){return Bt.Message.getFieldWithDefault(this,8,[])}set appIds(e){Bt.Message.setField(this,8,e)}get remark(){return Bt.Message.getFieldWithDefault(this,9,"")}set remark(e){Bt.Message.setField(this,9,e)}get meta(){return Bt.Message.getWrapperField(this,_t.imio.Meta,10)}set meta(e){Bt.Message.setWrapperField(this,10,e)}get has_meta(){return null!=Bt.Message.getField(this,10)}get userId(){return Bt.Message.getFieldWithDefault(this,11,"")}set userId(e){Bt.Message.setField(this,11,e)}get device(){return Bt.Message.getFieldWithDefault(this,12,"")}set device(e){Bt.Message.setField(this,12,e)}get roomId(){return Bt.Message.getFieldWithDefault(this,13,0)}set roomId(e){Bt.Message.setField(this,13,e)}get status(){return Bt.Message.getFieldWithDefault(this,14,"")}set status(e){Bt.Message.setField(this,14,e)}get state(){return Bt.Message.getFieldWithDefault(this,15,"")}set state(e){Bt.Message.setField(this,15,e)}get gateway(){return Bt.Message.getFieldWithDefault(this,16,"")}set gateway(e){Bt.Message.setField(this,16,e)}get deviceKey(){return Bt.Message.getFieldWithDefault(this,17,"")}set deviceKey(e){Bt.Message.setField(this,17,e)}get deviceTag(){return Bt.Message.getFieldWithDefault(this,18,"")}set deviceTag(e){Bt.Message.setField(this,18,e)}get region(){return Bt.Message.getFieldWithDefault(this,19,"")}set region(e){Bt.Message.setField(this,19,e)}static fromObject(e){const r=new t({});return null!=e.id&&(r.id=e.id),null!=e.appId&&(r.appId=e.appId),null!=e.v&&(r.v=e.v),null!=e.sort&&(r.sort=e.sort),null!=e.created&&(r.created=e.created),null!=e.modified&&(r.modified=e.modified),null!=e.ids&&(r.ids=e.ids),null!=e.appIds&&(r.appIds=e.appIds),null!=e.remark&&(r.remark=e.remark),null!=e.meta&&(r.meta=_t.imio.Meta.fromObject(e.meta)),null!=e.userId&&(r.userId=e.userId),null!=e.device&&(r.device=e.device),null!=e.roomId&&(r.roomId=e.roomId),null!=e.status&&(r.status=e.status),null!=e.state&&(r.state=e.state),null!=e.gateway&&(r.gateway=e.gateway),null!=e.deviceKey&&(r.deviceKey=e.deviceKey),null!=e.deviceTag&&(r.deviceTag=e.deviceTag),null!=e.region&&(r.region=e.region),r}toObject(){const e={};return null!=this.id&&(e.id=this.id),null!=this.appId&&(e.appId=this.appId),null!=this.v&&(e.v=this.v),null!=this.sort&&(e.sort=this.sort),null!=this.created&&(e.created=this.created),null!=this.modified&&(e.modified=this.modified),null!=this.ids&&(e.ids=this.ids),null!=this.appIds&&(e.appIds=this.appIds),null!=this.remark&&(e.remark=this.remark),null!=this.meta&&(e.meta=this.meta.toObject()),null!=this.userId&&(e.userId=this.userId),null!=this.device&&(e.device=this.device),null!=this.roomId&&(e.roomId=this.roomId),null!=this.status&&(e.status=this.status),null!=this.state&&(e.state=this.state),null!=this.gateway&&(e.gateway=this.gateway),null!=this.deviceKey&&(e.deviceKey=this.deviceKey),null!=this.deviceTag&&(e.deviceTag=this.deviceTag),null!=this.region&&(e.region=this.region),e}serialize(e){const t=e||new Bt.BinaryWriter;if(0!=this.id&&t.writeInt64(1,this.id),0!=this.appId&&t.writeInt64(2,this.appId),0!=this.v&&t.writeDouble(3,this.v),0!=this.sort&&t.writeInt32(4,this.sort),this.created.length&&t.writeString(5,this.created),this.modified.length&&t.writeString(6,this.modified),this.ids.length&&t.writeRepeatedString(7,this.ids),this.appIds.length&&t.writeRepeatedString(8,this.appIds),this.remark.length&&t.writeString(9,this.remark),this.has_meta&&t.writeMessage(10,this.meta,()=>this.meta.serialize(t)),this.userId.length&&t.writeString(11,this.userId),this.device.length&&t.writeString(12,this.device),0!=this.roomId&&t.writeInt64(13,this.roomId),this.status.length&&t.writeString(14,this.status),this.state.length&&t.writeString(15,this.state),this.gateway.length&&t.writeString(16,this.gateway),this.deviceKey.length&&t.writeString(17,this.deviceKey),this.deviceTag.length&&t.writeString(18,this.deviceTag),this.region.length&&t.writeString(19,this.region),!e)return t.getResultBuffer()}static deserialize(e){const r=e instanceof Bt.BinaryReader?e:new Bt.BinaryReader(e),i=new t;for(;r.nextField()&&!r.isEndGroup();)switch(r.getFieldNumber()){case 1:i.id=r.readInt64();break;case 2:i.appId=r.readInt64();break;case 3:i.v=r.readDouble();break;case 4:i.sort=r.readInt32();break;case 5:i.created=r.readString();break;case 6:i.modified=r.readString();break;case 7:Bt.Message.addToRepeatedField(i,7,r.readString());break;case 8:Bt.Message.addToRepeatedField(i,8,r.readString());break;case 9:i.remark=r.readString();break;case 10:r.readMessage(i.meta,()=>i.meta=_t.imio.Meta.deserialize(r));break;case 11:i.userId=r.readString();break;case 12:i.device=r.readString();break;case 13:i.roomId=r.readInt64();break;case 14:i.status=r.readString();break;case 15:i.state=r.readString();break;case 16:i.gateway=r.readString();break;case 17:i.deviceKey=r.readString();break;case 18:i.deviceTag=r.readString();break;case 19:i.region=r.readString();break;default:r.skipField()}return i}serializeBinary(){return this.serialize()}static deserializeBinary(e){return t.deserialize(e)}}e.UserStatus=t}(e.imio||(e.imio={}))}(yi||(yi={}));var wi,Si=r(287).hp,Mi=gi.imio.Users,ki=qt.imio.Message,Fi=yi.imio.UserStatus;class Ti extends Gt{static instance;imioClient=null;constructor(){super()}static getInstance(){return Ti.instance||(Ti.instance=new Ti),Ti.instance}setClient(e){return this.imioClient=e,this}getUserDeviceStatus(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new Fi({meta:this.imioClient.meta,userId:e});let n=[];this.imioClient.socket?.requestStream({data:Si.from(i.serializeBinary().buffer),metadata:this.buildRoute("device.status.byUserid")},100,{onComplete:()=>{t(n)},onNext:(e,t)=>{try{if(e.data){let t=Fi.deserialize(e.data),r=this.buildDeviceStatus(t);n.push(r)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}updateDeviceStatus(e){return new Promise((t,r)=>{if(this.checkSocket().length)return void r(new Error(this.checkSocket()));const i=new Fi({meta:this.imioClient.meta,status:e.toString()});let n=[];this.imioClient.socket?.requestStream({data:Si.from(i.serializeBinary().buffer),metadata:this.buildRoute("device.status.update")},100,{onComplete:()=>{t(n)},onNext:(e,t)=>{try{if(e.data){let t=Fi.deserialize(e.data),r=this.buildDeviceStatus(t);n.push(r)}}catch(e){r(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",i=this.onError(t);i.length>0?r(new Error(i)):r(new Error(t))},onExtension(e,t,r){}})})}getNoticeMessage(e,t=1,r=40){return new Promise(async(i,n)=>{if(this.checkSocket().length)return void n(new Error(this.checkSocket()));this.imioClient.meta.page=t,this.imioClient.meta.pageSize=r;let s=e.toString();"notify"==e&&(s="cc"),"quietly"==e&&(s="bcc");const o=new ki({meta:this.imioClient.meta,roomId:this.imioClient.meta.roomId,label:s});let a=[];this.imioClient.socket?.requestStream({data:Si.from(o.serializeBinary().buffer),metadata:this.buildRoute("message.notice.page")},500,{onComplete:()=>{i(a)},onNext:(e,t)=>{try{if(e.data){let t=ki.deserialize(e.data),r=this.buildMessage(t);a.push(r)}}catch(e){n(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?n(new Error(r)):n(new Error(t))},onExtension(e,t,r){}})})}updateUserInfo(e="",t="",r="",i=""){return new Promise((r,i)=>{if(this.checkSocket().length)return void i(new Error(this.checkSocket()));const n=new Mi({meta:this.imioClient.meta,nickname:e,avatar:t});this.imioClient.socket?.requestResponse({data:Si.from(n.serializeBinary().buffer),metadata:this.buildRoute("user.update.info")},{onComplete:()=>{r("")},onNext:(e,t)=>{try{t&&r("")}catch(e){i(new Error("IMIO Client Error"))}},onError:e=>{let t=e?.message+"",r=this.onError(t);r.length>0?i(new Error(r)):i(new Error(t))},onExtension(e,t,r){}})})}onError(e){if(e.indexOf("Jwt")>-1){try{this.imioClient.clientListener?.onTokenExpired()}catch(e){}return"IMIO Token 已过期"}return e.indexOf("SQL")>-1||e.indexOf("connect")>-1?"IMIO System Error":e.indexOf("terminal")>-1||e.indexOf("signal")>-1?"请求超时":""}checkSocket(){return this.imioClient?this.imioClient.socket?0==this.imioClient.getTokenAppId()||this.imioClient.getTokenAppId()!=this.imioClient.meta.appId?"token中的AppId 与 IMIOClientOption不一致":"":"IMIO Client 尚未建立连接":"IMIO Client 不存在"}}class Ri{messageId="";joinId=0;cite="";type="";title="";subtitle="";text="";secret="";thumb="";host="";url="";lng="";lat="";size=0;length=0;hintList=null;notifyList=null;quietlyList=null;constructor(e){this.type=e}static buildSimpleText(e,t){let r=new Ri(wi.TEXT);return r.joinId=e,r.text=t,r}static buildImage(e,t,r,i=""){let n=new Ri(wi.IMG);return n.joinId=e,n.host=t,n.url=r,n.secret=i,n}static buildFile(e,t,r,i,n=""){let s=new Ri(wi.FILE);return s.joinId=e,s.host=t,s.url=r,s.text=i,s.secret=n,s}static buildVideo(e,t,r,i,n=""){let s=new Ri(wi.VIDEO);return s.joinId=e,s.host=t,s.url=r,s.secret=n,s.size=i,s}static buildAudio(e,t,r,i,n=""){let s=new Ri(wi.AUDIO);return s.joinId=e,s.host=t,s.url=r,s.length=i,s.secret=n,s}withCite(e){return this.cite=e,this}withTitle(e){return this.title=e,this}withSubtitle(e){return this.subtitle=e,this}withSecret(e){if(this.type==wi.TEXT)throw new Error("Secret 属性与消息类型不匹配");if(e.length>500)throw new Error("Secret 长度太长");return this.secret=e,this}withThumb(e){if(this.type==wi.TEXT)throw new Error("Thumb 属性与消息类型不匹配");return this.thumb=e,this}withHost(e){if(this.type==wi.TEXT)throw new Error("Host 属性与消息类型不匹配");if(e.length>250)throw new Error("Host 长度太长");return this.host=e,this}withUrl(e){if(this.type==wi.TEXT)throw new Error("Url 属性与消息类型不匹配");return this.url=e,this}withSize(e){if(this.type!=wi.IMG&&this.type!=wi.AUDIO&&this.type!=wi.VIDEO&&this.type!=wi.FILE)throw new Error("Size 属性与消息类型不匹配");return this.size=e,this}withLength(e){if(this.type!=wi.AUDIO)throw new Error("Length 属性与消息类型不匹配");return this.length=e,this}}!function(e){e.TEXT="txt",e.IMG="img",e.AUDIO="audio",e.VIDEO="video",e.FILE="file",e.LOC="loc",e.WALLET="wallet",e.CUSTOM="custom"}(wi||(wi={}));const Ai={IMIOClient:pi,IMIOClientOption:fi,IMIOGroupManager:Ei,IMIOContactManager:Jt,IMIOClientConnectStatus:Dt,IMIORoomManager:mi,IMIOMessageSender:Ri,IMIOMessageSenderHint:class{targetId="";targetName="";avatar=""},IMIOMessageType:wi,IMIOUserInfoManager:Ti,IMIOMessageLabel:t,IMIOMessage:h,IMIOMessageTalk:n,IMIOContact:c,IMIOContactStatus:o,IMIOGroup:g,IMIOGroupType:a,IMIOChatManager:ir,IMIOMember:p,IMIODeviceStatus:m,IMIOContactNotice:s}})(),i.default})());
3
3
  //# sourceMappingURL=main.js.map