@ckeditor/ckeditor5-real-time-collaboration 38.1.1 → 38.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/package.json +7 -6
  3. package/src/augmentation.d.ts +61 -61
  4. package/src/common-translations.d.ts +5 -5
  5. package/src/common-translations.js +1 -1
  6. package/src/config.d.ts +33 -33
  7. package/src/index.d.ts +10 -10
  8. package/src/index.js +1 -1
  9. package/src/presencelist/presencelistui.d.ts +39 -39
  10. package/src/presencelist/presencelistui.js +1 -1
  11. package/src/presencelist/view/presencecounterview.d.ts +7 -7
  12. package/src/presencelist/view/presencecounterview.js +1 -1
  13. package/src/presencelist/view/presencedropdownlistitemview.d.ts +7 -7
  14. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  15. package/src/presencelist/view/presencedropdownlistview.d.ts +6 -6
  16. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  17. package/src/presencelist/view/presenceinlinelistitemview.d.ts +14 -14
  18. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  19. package/src/presencelist/view/presenceinlinelistview.d.ts +7 -7
  20. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  21. package/src/presencelist/view/presencelistview.d.ts +11 -11
  22. package/src/presencelist/view/presencelistview.js +1 -1
  23. package/src/presencelist.d.ts +24 -24
  24. package/src/presencelist.js +1 -1
  25. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +44 -44
  26. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
  27. package/src/realtimecollaborativecomments.d.ts +32 -32
  28. package/src/realtimecollaborativecomments.js +1 -1
  29. package/src/realtimecollaborativeediting/realtimecollaborationclient.d.ts +123 -123
  30. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
  31. package/src/realtimecollaborativeediting/sessions.d.ts +114 -114
  32. package/src/realtimecollaborativeediting/sessions.js +1 -1
  33. package/src/realtimecollaborativeediting/usermarkers.d.ts +32 -32
  34. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  35. package/src/realtimecollaborativeediting/websocketgateway.d.ts +51 -51
  36. package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
  37. package/src/realtimecollaborativeediting.d.ts +22 -22
  38. package/src/realtimecollaborativeediting.js +1 -1
  39. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +41 -41
  40. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
  41. package/src/realtimecollaborativerevisionhistory.d.ts +25 -25
  42. package/src/realtimecollaborativerevisionhistory.js +1 -1
  43. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +35 -35
  44. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
  45. package/src/realtimecollaborativetrackchanges.d.ts +23 -23
  46. package/src/realtimecollaborativetrackchanges.js +1 -1
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var __webpack_modules__={357:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e,t,n=null,r={}){super(`cloud-services-internal-error: ${e}`),this.context=t,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new n(function(e){let t=`cloud-services-error: ${e.message}`;e.explanation&&(t+=`\nExplanation: ${e.explanation}`);e.action&&(t+=`\nAction: ${e.action}`);e.traceId&&(t+=`\nTraceId: ${e.traceId}`);e.code&&(t+=`\nCode: ${e.code}`);return t}(e),e)}}t.default=n},8801:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new n(function(e){let t=`cloud-services-server-error: ${e.message}`;e.explanation&&(t+=`\nExplanation: ${e.explanation}`);e.action&&(t+=`\nAction: ${e.action}`);e.traceId&&(t+=`\nTraceId: ${e.traceId}`);e.code&&(t+=`\nCode: ${e.code}`);return t}(e),e)}}t.default=n},7622:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const o=n(5003),s=n(2209),i=r(n(3596)),a=r(n(7026)),c=r(n(7839)),d=r(n(5132)),u=r(n(4148)),l=r(n(223)),p=r(n(2968)),h=r(n(7158)),f=r(n(357)),m=r(n(6314)),y=r(n(6148)),g=r(n(961));t._SERVICE=1;class b extends((0,s.EmitterMixin)()){constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:(0,o.v4)(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new c.default(this.getId(),t.buffers,t.types,this._bundleVersion,n);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new f.default("Cannot reconnect to already connected service.",e);return this._connect(e,new u.default(this.getId(),t,this._bundleVersion))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async getDocumentDetails(){const e=new g.default(this.getId());if(!this._wsGateway)throw new m.default("Collaborative Editing",this);const n=await this._wsGateway._sendRequest(t._SERVICE,g.default.TYPE,i.default.encode(e));return i.default.decode(n,y.default)}async sendOperations(e,n,r){if(!e||!e.types||!e.types.length)throw new f.default("Cannot send empty update.",this._wsGateway);const o="number"==typeof n?n:parseInt(n);if(!Number.isInteger(o)||o<0)throw new f.default("Base version not provided.",this._wsGateway);const s=new d.default(this.getId(),e.buffers,e.types,o,[],r);if(!this._wsGateway||!this._isConnected)throw new m.default("Collaborative Editing",this);const a=await this._wsGateway._sendRequest(t._SERVICE,d.default.TYPE,i.default.encode(s));return i.default.decode(a,l.default)}async getConnectedSessions(){if(!this._isConnected)throw new m.default("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await a.default.getConnectedSessions(this._wsGateway,this._id,t._SERVICE)),this._connectedSessions}static getConnectedSessions(e,n){return a.default.getConnectedSessions(e,n,t._SERVICE)}async _connect(e,n){if(this.isConnected())return;if(e.state!==h.default.STATE_CONNECTED)throw new f.default("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,n.constructor.TYPE,i.default.encode(n)),o=i.default.decode(r,p.default);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:h.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o.channel),this._isConnected=!0,this.fire("connected"),o}_connectToChannel(e,n){this._channel=e._getChannel(t._SERVICE,n),this.listenTo(this._channel,this._channel.getEventName(d.default.TYPE),((e,t)=>{const n=i.default.decode(t,d.default);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(e){e===h.default.STATE_DISCONNECTED&&this.disconnect()}}b._SERVICE=t._SERVICE,t.default=b},8677:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static toJSON({createdAt:e,...t}){const n={...t};return(null==e?void 0:e.toISOString)&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}t.default=s,s.DESCRIPTOR_NAME="OperationMetadataDescriptor",s.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}}},6685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];let r=0;for(const o of e)if(0!==o){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r])}return n}}},7839:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r,o=""){super(),this.id=e,this.buffers=t,this.types=n,this.bundleVersion=r,this.lastOperationId=o}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,bundleVersion:this.bundleVersion,lastOperationId:this.lastOperationId}}static fromJSON(e){return new s(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}t.default=s,s.TYPE="11",s.READABLE_TYPE_NAME="connectToDocument",s.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},lastOperationId:{type:"string",id:5}}}},4148:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.id=e,this.lastKnowVersion=t,this.bundleVersion=n}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(e){return new s(e.id,e.lastKnowVersion,e.bundleVersion)}}t.default=s,s.TYPE="12",s.READABLE_TYPE_NAME="reconnectToDocument",s.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}}},5132:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(6685)),i=r(n(8677));class a extends o.default{constructor(e,t,n,r,o=[],s=""){super(),this.id=e,this.buffers=t,this.types=n,this.baseVersion=r,this.metadata=o,this.lastOperationId=s}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,lastOperationId:this.lastOperationId}}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,metadata:s.default.removeUnnecessaryMetadata(this.types,this.metadata).map(i.default.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new a(e.id,e.buffers,e.types,e.baseVersion,s.default.prepareMetadataForOperations(e.types,e.metadata).map(i.default.fromJSON),e.lastOperationId)}}t.default=a,a.TYPE="13",a.READABLE_TYPE_NAME="updateDocument",a.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",a.DESCRIPTOR={fields:{id:{type:"string",id:1},baseVersion:{type:"uint32",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:6},lastOperationId:{type:"string",id:7}}}},961:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="14",s.READABLE_TYPE_NAME="getDocumentDetails",s.DESCRIPTOR_NAME="GetDocumentDetailsMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}}},2968:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(6685)),i=r(n(8677));class a extends o.default{constructor(e,t,n=[],r=[],o=0,s=[],i=null,a="",c="",d=null){super(),this.channel=e,this.version=t,this.buffers=n,this.types=r,this.offset=o,this.metadata=s,this.initData=i,this.sessionId=a,this.lastOperationId=c,this.sessionCreatedAt=d}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:s.default.removeUnnecessaryMetadata(this.types,this.metadata).map(i.default.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new a(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let n=null;return!0===e.isInitialized?n=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(n=e.initData),a.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:s.default.prepareMetadataForOperations(e.types,e.metadata).map(i.default.fromJSON),initData:n,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}t.default=a,a.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",a.DESCRIPTOR={fields:{channel:{type:"string",id:1},offset:{type:"uint32",id:2},version:{type:"uint32",id:3},buffers:{rule:"repeated",type:"bytes",id:4},types:{rule:"repeated",type:"uint32",id:5},metadata:{rule:"repeated",type:i.default.DESCRIPTOR_NAME,id:7},initData:{type:"string",id:8},isInitialized:{type:"bool",id:9},sessionId:{type:"string",id:10},lastOperationId:{type:"string",id:11},sessionCreatedAt:{type:"string",id:12}}}},223:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(6685)),i=r(n(8677));class a extends o.default{constructor(e,t=[],n=[],r=[],o="",s=null){super(),this.version=e,this.buffers=t,this.types=n,this.metadata=r,this.lastOperationId=o,this.lastOperationAcceptedAt=s}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:s.default.removeUnnecessaryMetadata(this.types,this.metadata).map(i.default.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new a(e.version,e.buffers,e.types,s.default.prepareMetadataForOperations(e.types,e.metadata).map(i.default.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new a(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}t.default=a,a.DESCRIPTOR_NAME="CollaborativeEditingResponse",a.DESCRIPTOR={fields:{version:{type:"uint32",id:1},buffers:{rule:"repeated",type:"bytes",id:2},types:{rule:"repeated",type:"uint32",id:3},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:5},lastOperationId:{type:"string",id:6},lastOperationAcceptedAt:{type:"string",id:7}}}},6148:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,n,r,o;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(o=this.currentDocumentSession)||void 0===o?void 0:o.lastOperationId}}toJSON(){var e,t,n,r,o;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(o=this.currentDocumentSession)||void 0===o?void 0:o.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,n=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new s(t,n)}}t.default=s,s.DESCRIPTOR_NAME="GetDocumentDetailsResponse",s.DESCRIPTOR={fields:{lastDocumentSessionId:{type:"string",id:1},lastDocumentSessionOperationId:{type:"string",id:2},currentDocumentSessionId:{type:"string",id:3},currentDocumentSessionVersion:{type:"uint32",id:4},currentDocumentSessionOperationId:{type:"string",id:5}}}},6042:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=n(2209),c=i(n(3596)),d=i(n(5420)),u=i(n(2280)),l=i(n(6376)),p=i(n(7608)),h=i(n(6178)),f=i(n(5711)),m=i(n(7955)),y=i(n(939)),g=i(n(6523)),b=i(n(1926)),O=i(n(7952)),v=s(n(7158)),w=i(n(357)),x=i(n(7026)),_=i(n(6314)),I=i(n(8801)),S=i(n(5373)),P=i(n(7073)),T=i(n(3118)),A=i(n(8742)),C=i(n(4396)),k=i(n(2282));t._SERVICE=9;class E extends((0,a.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==v.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new w.default("WebSocket Gateway is not connected.",e);const n=new l.default(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,l.default.TYPE,c.default.encode(n)),{channel:o,threads:s}=c.default.decode(r,p.default);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:v.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o),this._isConnected=!0,this.fire("connected"),s}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async addComment(e,t,n,r){const o=new d.default(this._documentId,e,n,t,void 0,void 0,r),s=await this._sendRequest(d.default.TYPE,o);return c.default.decode(s,u.default)}async updateComment(e,t,n,r){const o=void 0!==r,s=new m.default(this._documentId,e,t,n,r,o);await this._sendRequest(m.default.TYPE,s)}async removeComment(e,t){const n=new h.default(this._documentId,e,t);await this._sendRequest(h.default.TYPE,n)}async removeCommentThread(e){const t=new f.default(this._documentId,e);await this._sendRequest(f.default.TYPE,t)}async addCommentThread(e){var t;const n=new P.default(this._documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),r=await this._sendRequest(P.default.TYPE,n);return c.default.decode(r,S.default)}async resolveCommentThread(e){const t=new T.default(e,this._documentId),n=await this._sendRequest(T.default.TYPE,t);return c.default.decode(n,k.default)}async reopenCommentThread(e){const t=new A.default(e,this._documentId);await this._sendRequest(A.default.TYPE,t)}async updateCommentThread(e){const t=new C.default(e.commentThreadId,this._documentId,e.context,e.attributes);await this._sendRequest(C.default.TYPE,t)}async getCommentThread(e,t=1){const n=new y.default(e,this._documentId);try{const e=await this._sendRequest(y.default.TYPE,n),t=c.default.decode(e,g.default);return{commentThreadId:t.commentThreadId,comments:t.comments,attributes:t.attributes,context:t.context,resolvedAt:t.resolvedAt,resolvedBy:t.resolvedBy,deletedAt:t.deletedAt}}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.getCommentThread(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw I.default.fromPublicError(n)}var r}async getDocumentThreads(){const e=new b.default(this._documentId),t=await this._sendRequest(b.default.TYPE,e),{threads:n}=c.default.decode(t,O.default);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new _.default("Comments",this);return this._connectedSessions||(this._connectedSessions=await x.default.getConnectedSessions(this._wsGateway,this._documentId,t._SERVICE)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(E._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(d.default.TYPE),((e,t)=>{const n=c.default.decode(t,d.default);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(h.default.TYPE),((e,t)=>{const n=c.default.decode(t,h.default);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(m.default.TYPE),((e,t)=>{const n=c.default.decode(t,m.default);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(f.default.TYPE),((e,t)=>{const n=c.default.decode(t,f.default);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(P.default.TYPE),((e,t)=>{const n=c.default.decode(t,P.default);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(C.default.TYPE),((e,t)=>{const n=c.default.decode(t,C.default);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(T.default.TYPE),((e,t)=>{const n=c.default.decode(t,T.default);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(A.default.TYPE),((e,t)=>{const n=c.default.decode(t,A.default);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(e){e===v.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,n){if(!this._wsGateway||!this._isConnected)throw new _.default("Comments",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(n))}}E._SERVICE=t._SERVICE,t.default=E},2529:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}t.default=s,s.DESCRIPTOR_NAME="CommentDescriptor",s.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},commentThreadId:{id:2,type:"string"},userId:{id:3,type:"string"},content:{id:4,type:"string"},documentId:{id:5,type:"string"},createdAt:{id:6,type:"string"},attributes:{id:7,type:"string"}}}},1578:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945)),s=r(n(2529));class i extends o.default{static toJSON(e){var t,n,r,o;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(n=e.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:null===(o=e.comments)||void 0===o?void 0:o.map(s.default.toJSON)}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,context:e.context?JSON.parse(e.context):void 0,comments:null===(t=e.comments)||void 0===t?void 0:t.map(s.default.fromJSON)}}}t.default=i,i.DESCRIPTOR_NAME="CommentsThreadDescriptor",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"CommentDescriptor",rule:"repeated",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4},context:{type:"string",id:5},createdAt:{type:"string",id:6},deletedAt:{type:"string",id:7},attributes:{type:"string",id:8}}}},309:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static toJSON(e){var t;return{commentId:e.commentId,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}t.default=s,s.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",s.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}}},5420:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1578));class i extends o.default{constructor(e,t,n,r="",o,s="",i=null,a){super(),this.documentId=e,this.commentThreadId=t,this.content=n,this.commentId=r,this.userId=s,this.attributes=i,this.commentThread=a,this.createdAt=o?new Date(o):""}toJSON(){return{commentThreadId:this.commentThreadId,content:this.content,documentId:this.documentId,commentId:this.commentId,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,userId:this.userId,attributes:JSON.stringify(this.attributes),commentThread:this.commentThread?s.default.toJSON(this.commentThread):void 0}}static fromJSON(e){return new i(e.documentId,e.commentThreadId,e.content,e.commentId?e.commentId:void 0,e.createdAt?new Date(e.createdAt):void 0,e.userId?e.userId:void 0,e.attributes?JSON.parse(e.attributes):{},e.commentThread?s.default.fromJSON(e.commentThread):void 0)}}t.default=i,i.TYPE="91",i.READABLE_TYPE_NAME="addComment",i.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},content:{type:"string",id:2},documentId:{type:"string",id:3},commentId:{type:"string",id:4},createdAt:{type:"string",id:5},userId:{type:"string",id:6},attributes:{type:"string",id:7},commentThread:{type:"CommentsThreadDescriptor",id:8}}}},7073:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(2529));class i extends o.default{constructor(e,t,n=[],r,o=null,s=null,i=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,this.comments=n,this.context=r,this.resolvedBy=o,this.attributes=c,this.createdAt=s?new Date(s):"",this.resolvedAt=i?new Date(i):"",this.deletedAt=a?new Date(a):""}toJSON(){var e;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(e=this.comments)||void 0===e?void 0:e.map((e=>s.default.toJSON(e)))}}static fromJSON(e){var t;return new i(e.documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>s.default.fromJSON({...t,documentId:e.documentId,commentThreadId:e.commentThreadId}))),e.context?JSON.parse(e.context):e.context,e.resolvedBy,e.createdAt?new Date(e.createdAt):void 0,e.resolvedAt?new Date(e.resolvedAt):void 0,e.deletedAt?new Date(e.deletedAt):void 0,e.attributes?JSON.parse(e.attributes):e.attributes)}}t.default=i,i.TYPE="140",i.READABLE_TYPE_NAME="addCommentThread",i.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1},commentThreadId:{type:"string",id:2},context:{type:"string",id:3},createdAt:{type:"string",id:4},resolvedAt:{type:"string",id:5},resolvedBy:{type:"string",id:6},attributes:{type:"string",id:7},deletedAt:{type:"string",id:8},comments:{type:"CommentDescriptor",rule:"repeated",id:9}}}},8742:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new s(e.commentThreadId,e.documentId)}}t.default=s,s.TYPE="141",s.READABLE_TYPE_NAME="reopenCommentThread",s.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},3118:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var e;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(e=this.resolvedAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(e){return new s(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}t.default=s,s.TYPE="142",s.READABLE_TYPE_NAME="resolveCommentThread",s.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}}},4396:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r=null){super(),this.commentThreadId=e,this.documentId=t,this.context=n,this.attributes=r}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,attributes:this.attributes?JSON.stringify(this.attributes):null}}static fromJSON(e){return new s(e.commentThreadId,e.documentId,e.context?JSON.parse(e.context):e.context,e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.TYPE="143",s.READABLE_TYPE_NAME="updateCommentThread",s.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},context:{type:"string",id:3},attributes:{type:"string",id:4}}}},6376:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="92",s.READABLE_TYPE_NAME="connectToComment",s.DESCRIPTOR_NAME="CommentsV2ConnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},939:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new s(e.commentThreadId,e.documentId)}}t.default=s,s.TYPE="93",s.READABLE_TYPE_NAME="getComment",s.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},1926:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="94",s.READABLE_TYPE_NAME="getDocumentThreads",s.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},6178:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(e){return new s(e.documentId,e.commentThreadId,e.commentId)}}t.default=s,s.TYPE="95",s.READABLE_TYPE_NAME="removeComment",s.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}}},5711:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new s(e.documentId,e.commentThreadId)}}t.default=s,s.TYPE="97",s.READABLE_TYPE_NAME="removeCommentThread",s.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},7955:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1578));class i extends o.default{constructor(e,t,n,r,o=null,s=!1,i){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n,this.content=r,this.attributes=o,this.isAttributesUpdated=s,this.commentThread=i}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId,content:this.content,attributes:this.attributes?JSON.stringify(this.attributes):null,isAttributesUpdated:this.isAttributesUpdated,commentThread:this.commentThread?s.default.toJSON(this.commentThread):void 0}}static fromJSON(e){return new i(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?s.default.fromJSON(e.commentThread):void 0)}}t.default=i,i.TYPE="96",i.READABLE_TYPE_NAME="updateComment",i.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},content:{type:"string",id:3},documentId:{type:"string",id:4},attributes:{type:"string",id:5},isAttributesUpdated:{type:"bool",id:6},commentThread:{type:"CommentsThreadDescriptor",id:7}}}},2280:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.commentThreadId=e,this.commentId=t,this.createdAt=new Date(n)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(e){return new s(e.commentThreadId,e.commentId,e.createdAt)}}t.default=s,s.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}}},5373:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(309));class i extends o.default{constructor(e,t,n=[]){super(),this.commentThreadId=e,this.comments=n,this.createdAt=new Date(t)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString(),comments:this.comments.map((e=>s.default.toJSON(e)))}}static fromJSON(e){return new i(e.commentThreadId,e.createdAt,e.comments.map((e=>s.default.fromJSON(e))))}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}}},2282:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=new Date(r)}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt.toISOString()}}static fromJSON(e){return new s(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}t.default=s,s.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}}},7608:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1578));class i extends o.default{constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2ConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}}},6523:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(2529));class i extends o.default{constructor(e,t,n,r,o,s,i,a,c){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=n,this.resolvedBy=o,this.comments=(null==n?void 0:n.length)?n:t,this.createdAt=i?new Date(i):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c,this.attributes="string"==typeof r?JSON.parse(r):r,this.context="string"==typeof s?JSON.parse(s):s}toJSON(){var e,t,n,r,o;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(s.default.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:null===(n=this.createdAt)||void 0===n?void 0:n.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(o=this.resolvedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t,n;return new i(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(n=e.commentsV2)||void 0===n?void 0:n.map(s.default.fromJSON),e.attributes?JSON.parse(e.attributes):e.attributes,e.resolvedBy,e.context?JSON.parse(e.context):e.context,e.createdAt,e.deletedAt,e.resolvedAt)}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"string",rule:"repeated",id:2},commentsV2:{type:"CommentDescriptor",rule:"repeated",id:3},resolvedAt:{type:"string",id:4},resolvedBy:{type:"string",id:5},context:{type:"string",id:6},createdAt:{type:"string",id:7},deletedAt:{type:"string",id:8},attributes:{type:"string",id:9}}}},7952:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1578));class i extends o.default{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const n=JSON.parse(e),r={...n};n.comments&&(r.comments=null===(t=n.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)}))));return r}(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",i.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}}},6398:function(e,t,n){var r,o,s;o=[n(6386)],void 0===(s="function"==typeof(r=function(e){"use strict";var t=e.Reader,n=e.Writer,r=e.util,o=e.roots.default||(e.roots.default={});return o.OperationMetadataDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.userId="",s.prototype.type="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(18).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.OperationMetadataDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.userId=e.string();break;case 2:s.type=e.string();break;case 3:s.createdAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId)?"userId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof o.OperationMetadataDescriptor)return e;var t=new o.OperationMetadataDescriptor;return null!=e.userId&&(t.userId=String(e.userId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.userId="",n.type="",n.createdAt=""),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OperationMetadataDescriptor"},s}(),o.CollaborativeEditingConnectMessage=function(){function s(e){if(this.buffers=[],this.types=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(26).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(34).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(42).string(e.lastOperationId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingConnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.bundleVersion=e.string();break;case 3:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 4:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 5:s.lastOperationId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id))return"id: string expected";if(null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!r.isString(e.bundleVersion))return"bundleVersion: string expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingConnectMessage)return e;var t=new o.CollaborativeEditingConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectMessage.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[]),t.defaults&&(n.id="",n.bundleVersion="",n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),e.buffers&&e.buffers.length){n.buffers=[];for(var o=0;o<e.buffers.length;++o)n.buffers[o]=t.bytes===String?r.base64.encode(e.buffers[o],0,e.buffers[o].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[o]):e.buffers[o]}if(e.types&&e.types.length)for(n.types=[],o=0;o<e.types.length;++o)n.types[o]=e.types[o];return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectMessage"},s}(),o.CollaborativeEditingReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.lastKnowVersion=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.lastKnowVersion&&Object.hasOwnProperty.call(e,"lastKnowVersion")&&t.uint32(24).uint32(e.lastKnowVersion),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingReconnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.bundleVersion=e.string();break;case 3:s.lastKnowVersion=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!r.isString(e.bundleVersion)?"bundleVersion: string expected":null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&!r.isInteger(e.lastKnowVersion)?"lastKnowVersion: integer expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingReconnectMessage)return e;var t=new o.CollaborativeEditingReconnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),null!=e.lastKnowVersion&&(t.lastKnowVersion=e.lastKnowVersion>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.bundleVersion="",n.lastKnowVersion=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&(n.lastKnowVersion=e.lastKnowVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingReconnectMessage"},s}(),o.CollaborativeEditingUpdateMessage=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.baseVersion=0,s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.metadata=r.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.baseVersion&&Object.hasOwnProperty.call(e,"baseVersion")&&t.uint32(16).uint32(e.baseVersion),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(26).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(34).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(r=0;r<e.metadata.length;++r)o.OperationMetadataDescriptor.encode(e.metadata[r],t.uint32(50).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(58).string(e.lastOperationId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingUpdateMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.baseVersion=e.uint32();break;case 3:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 4:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 6:s.metadata&&s.metadata.length||(s.metadata=[]),s.metadata.push(o.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:s.lastOperationId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id))return"id: string expected";if(null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&!r.isInteger(e.baseVersion))return"baseVersion: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(t=0;t<e.metadata.length;++t){var n=o.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingUpdateMessage)return e;var t=new o.CollaborativeEditingUpdateMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.baseVersion&&(t.baseVersion=e.baseVersion>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingUpdateMessage.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");for(t.metadata=[],n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");t.metadata[n]=o.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.id="",n.baseVersion=0,n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&(n.baseVersion=e.baseVersion),e.buffers&&e.buffers.length){n.buffers=[];for(var s=0;s<e.buffers.length;++s)n.buffers[s]=t.bytes===String?r.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(n.types=[],s=0;s<e.types.length;++s)n.types[s]=e.types[s];if(e.metadata&&e.metadata.length)for(n.metadata=[],s=0;s<e.metadata.length;++s)n.metadata[s]=o.OperationMetadataDescriptor.toObject(e.metadata[s],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingUpdateMessage"},s}(),o.GetDocumentDetailsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.environmentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.environmentId&&Object.hasOwnProperty.call(e,"environmentId")&&t.uint32(18).string(e.environmentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetDocumentDetailsMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.environmentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.environmentId&&e.hasOwnProperty("environmentId")&&!r.isString(e.environmentId)?"environmentId: string expected":null},s.fromObject=function(e){if(e instanceof o.GetDocumentDetailsMessage)return e;var t=new o.GetDocumentDetailsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.environmentId&&(t.environmentId=String(e.environmentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId="",n.environmentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.environmentId&&e.hasOwnProperty("environmentId")&&(n.environmentId=e.environmentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsMessage"},s}(),o.CollaborativeEditingConnectResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.offset=0,s.prototype.version=0,s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.metadata=r.emptyArray,s.prototype.initData="",s.prototype.isInitialized=!1,s.prototype.sessionId="",s.prototype.lastOperationId="",s.prototype.sessionCreatedAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&t.uint32(16).uint32(e.offset),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(24).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(34).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(42).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(r=0;r<e.metadata.length;++r)o.OperationMetadataDescriptor.encode(e.metadata[r],t.uint32(58).fork()).ldelim();return null!=e.initData&&Object.hasOwnProperty.call(e,"initData")&&t.uint32(66).string(e.initData),null!=e.isInitialized&&Object.hasOwnProperty.call(e,"isInitialized")&&t.uint32(72).bool(e.isInitialized),null!=e.sessionId&&Object.hasOwnProperty.call(e,"sessionId")&&t.uint32(82).string(e.sessionId),null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(90).string(e.lastOperationId),null!=e.sessionCreatedAt&&Object.hasOwnProperty.call(e,"sessionCreatedAt")&&t.uint32(98).string(e.sessionCreatedAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.offset=e.uint32();break;case 3:s.version=e.uint32();break;case 4:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 5:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 7:s.metadata&&s.metadata.length||(s.metadata=[]),s.metadata.push(o.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:s.initData=e.string();break;case 9:s.isInitialized=e.bool();break;case 10:s.sessionId=e.string();break;case 11:s.lastOperationId=e.string();break;case 12:s.sessionCreatedAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.offset&&e.hasOwnProperty("offset")&&!r.isInteger(e.offset))return"offset: integer expected";if(null!=e.version&&e.hasOwnProperty("version")&&!r.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(t=0;t<e.metadata.length;++t){var n=o.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.initData&&e.hasOwnProperty("initData")&&!r.isString(e.initData)?"initData: string expected":null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&"boolean"!=typeof e.isInitialized?"isInitialized: boolean expected":null!=e.sessionId&&e.hasOwnProperty("sessionId")&&!r.isString(e.sessionId)?"sessionId: string expected":null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&!r.isString(e.sessionCreatedAt)?"sessionCreatedAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingConnectResponse)return e;var t=new o.CollaborativeEditingConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.offset&&(t.offset=e.offset>>>0),null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectResponse.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");for(t.metadata=[],n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");t.metadata[n]=o.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.initData&&(t.initData=String(e.initData)),null!=e.isInitialized&&(t.isInitialized=Boolean(e.isInitialized)),null!=e.sessionId&&(t.sessionId=String(e.sessionId)),null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.sessionCreatedAt&&(t.sessionCreatedAt=String(e.sessionCreatedAt)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.channel="",n.offset=0,n.version=0,n.initData="",n.isInitialized=!1,n.sessionId="",n.lastOperationId="",n.sessionCreatedAt=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.offset&&e.hasOwnProperty("offset")&&(n.offset=e.offset),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(var s=0;s<e.buffers.length;++s)n.buffers[s]=t.bytes===String?r.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(n.types=[],s=0;s<e.types.length;++s)n.types[s]=e.types[s];if(e.metadata&&e.metadata.length)for(n.metadata=[],s=0;s<e.metadata.length;++s)n.metadata[s]=o.OperationMetadataDescriptor.toObject(e.metadata[s],t);return null!=e.initData&&e.hasOwnProperty("initData")&&(n.initData=e.initData),null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&(n.isInitialized=e.isInitialized),null!=e.sessionId&&e.hasOwnProperty("sessionId")&&(n.sessionId=e.sessionId),null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&(n.sessionCreatedAt=e.sessionCreatedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectResponse"},s}(),o.CollaborativeEditingResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.version=0,s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.metadata=r.emptyArray,s.prototype.lastOperationId="",s.prototype.lastOperationAcceptedAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(8).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(18).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(26).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(r=0;r<e.metadata.length;++r)o.OperationMetadataDescriptor.encode(e.metadata[r],t.uint32(42).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(50).string(e.lastOperationId),null!=e.lastOperationAcceptedAt&&Object.hasOwnProperty.call(e,"lastOperationAcceptedAt")&&t.uint32(58).string(e.lastOperationAcceptedAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.version=e.uint32();break;case 2:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 3:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 5:s.metadata&&s.metadata.length||(s.metadata=[]),s.metadata.push(o.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:s.lastOperationId=e.string();break;case 7:s.lastOperationAcceptedAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.version&&e.hasOwnProperty("version")&&!r.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(t=0;t<e.metadata.length;++t){var n=o.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&!r.isString(e.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingResponse)return e;var t=new o.CollaborativeEditingResponse;if(null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingResponse.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");for(t.metadata=[],n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");t.metadata[n]=o.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.lastOperationAcceptedAt&&(t.lastOperationAcceptedAt=String(e.lastOperationAcceptedAt)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.version=0,n.lastOperationId="",n.lastOperationAcceptedAt=""),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(var s=0;s<e.buffers.length;++s)n.buffers[s]=t.bytes===String?r.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(n.types=[],s=0;s<e.types.length;++s)n.types[s]=e.types[s];if(e.metadata&&e.metadata.length)for(n.metadata=[],s=0;s<e.metadata.length;++s)n.metadata[s]=o.OperationMetadataDescriptor.toObject(e.metadata[s],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&(n.lastOperationAcceptedAt=e.lastOperationAcceptedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingResponse"},s}(),o.GetDocumentDetailsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.lastDocumentSessionId="",s.prototype.lastDocumentSessionOperationId="",s.prototype.currentDocumentSessionId="",s.prototype.currentDocumentSessionVersion=0,s.prototype.currentDocumentSessionOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.lastDocumentSessionId&&Object.hasOwnProperty.call(e,"lastDocumentSessionId")&&t.uint32(10).string(e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"lastDocumentSessionOperationId")&&t.uint32(18).string(e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&Object.hasOwnProperty.call(e,"currentDocumentSessionId")&&t.uint32(26).string(e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&Object.hasOwnProperty.call(e,"currentDocumentSessionVersion")&&t.uint32(32).uint32(e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"currentDocumentSessionOperationId")&&t.uint32(42).string(e.currentDocumentSessionOperationId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetDocumentDetailsResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.lastDocumentSessionId=e.string();break;case 2:s.lastDocumentSessionOperationId=e.string();break;case 3:s.currentDocumentSessionId=e.string();break;case 4:s.currentDocumentSessionVersion=e.uint32();break;case 5:s.currentDocumentSessionOperationId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&!r.isString(e.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&!r.isString(e.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&!r.isString(e.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&!r.isInteger(e.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&!r.isString(e.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},s.fromObject=function(e){if(e instanceof o.GetDocumentDetailsResponse)return e;var t=new o.GetDocumentDetailsResponse;return null!=e.lastDocumentSessionId&&(t.lastDocumentSessionId=String(e.lastDocumentSessionId)),null!=e.lastDocumentSessionOperationId&&(t.lastDocumentSessionOperationId=String(e.lastDocumentSessionOperationId)),null!=e.currentDocumentSessionId&&(t.currentDocumentSessionId=String(e.currentDocumentSessionId)),null!=e.currentDocumentSessionVersion&&(t.currentDocumentSessionVersion=e.currentDocumentSessionVersion>>>0),null!=e.currentDocumentSessionOperationId&&(t.currentDocumentSessionOperationId=String(e.currentDocumentSessionOperationId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.lastDocumentSessionId="",n.lastDocumentSessionOperationId="",n.currentDocumentSessionId="",n.currentDocumentSessionVersion=0,n.currentDocumentSessionOperationId=""),null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&(n.lastDocumentSessionId=e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&(n.lastDocumentSessionOperationId=e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&(n.currentDocumentSessionId=e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&(n.currentDocumentSessionVersion=e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&(n.currentDocumentSessionOperationId=e.currentDocumentSessionOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsResponse"},s}(),o.CommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.commentThreadId="",s.prototype.userId="",s.prototype.content="",s.prototype.documentId="",s.prototype.createdAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(26).string(e.userId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(34).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(42).string(e.documentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentId=e.string();break;case 2:s.commentThreadId=e.string();break;case 3:s.userId=e.string();break;case 4:s.content=e.string();break;case 5:s.documentId=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId)?"userId: string expected":null!=e.content&&e.hasOwnProperty("content")&&!r.isString(e.content)?"content: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentDescriptor)return e;var t=new o.CommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentId="",n.commentThreadId="",n.userId="",n.content="",n.documentId="",n.createdAt="",n.attributes=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentDescriptor"},s}(),o.CommentsThreadDescriptor=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=r.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)o.CommentDescriptor.encode(e.comments[r],t.uint32(18).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(42).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(58).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsThreadDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(o.CommentDescriptor.decode(e,e.uint32()));break;case 3:s.resolvedAt=e.string();break;case 4:s.resolvedBy=e.string();break;case 5:s.context=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.deletedAt=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var n=o.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!r.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsThreadDescriptor)return e;var t=new o.CommentsThreadDescriptor;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsThreadDescriptor.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");t.comments[n]=o.CommentDescriptor.fromObject(e.comments[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=o.CommentDescriptor.toObject(e.comments[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsThreadDescriptor"},s}(),o.CommentThreadAddedCommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentThreadAddedCommentDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentId=e.string();break;case 2:s.createdAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentThreadAddedCommentDescriptor)return e;var t=new o.CommentThreadAddedCommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentId="",n.createdAt=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentThreadAddedCommentDescriptor"},s}(),o.CommentsV2AddCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.content="",s.prototype.documentId="",s.prototype.commentId="",s.prototype.createdAt="",s.prototype.userId="",s.prototype.attributes="",s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(34).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(42).string(e.createdAt),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(50).string(e.userId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&o.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(66).fork()).ldelim(),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.content=e.string();break;case 3:s.documentId=e.string();break;case 4:s.commentId=e.string();break;case 5:s.createdAt=e.string();break;case 6:s.userId=e.string();break;case 7:s.attributes=e.string();break;case 8:s.commentThread=o.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!r.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId))return"commentId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt))return"createdAt: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId))return"userId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes))return"attributes: string expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){var t=o.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentMessage)return e;var t=new o.CommentsV2AddCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2AddCommentMessage.commentThread: object expected");t.commentThread=o.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.content="",n.documentId="",n.commentId="",n.createdAt="",n.userId="",n.attributes="",n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=o.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentMessage"},s}(),o.CommentsV2AddCommentThreadMessage=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.commentThreadId="",s.prototype.context="",s.prototype.createdAt="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.attributes="",s.prototype.deletedAt="",s.prototype.comments=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(42).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(50).string(e.resolvedBy),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)o.CommentDescriptor.encode(e.comments[r],t.uint32(74).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.commentThreadId=e.string();break;case 3:s.context=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.resolvedAt=e.string();break;case 6:s.resolvedBy=e.string();break;case 7:s.attributes=e.string();break;case 8:s.deletedAt=e.string();break;case 9:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(o.CommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context))return"context: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt))return"createdAt: string expected";if(null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt))return"resolvedAt: string expected";if(null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy))return"resolvedBy: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes))return"attributes: string expected";if(null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!r.isString(e.deletedAt))return"deletedAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var n=o.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentThreadMessage)return e;var t=new o.CommentsV2AddCommentThreadMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadMessage.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");t.comments[n]=o.CommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.documentId="",n.commentThreadId="",n.context="",n.createdAt="",n.resolvedAt="",n.resolvedBy="",n.attributes="",n.deletedAt=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=o.CommentDescriptor.toObject(e.comments[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadMessage"},s}(),o.CommentsV2ReopenCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ReopenCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ReopenCommentThreadMessage)return e;var t=new o.CommentsV2ReopenCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ReopenCommentThreadMessage"},s}(),o.CommentsV2ResolveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedBy="",s.prototype.resolvedAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(26).string(e.resolvedBy),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ResolveCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;case 3:s.resolvedBy=e.string();break;case 4:s.resolvedAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ResolveCommentThreadMessage)return e;var t=new o.CommentsV2ResolveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedBy="",n.resolvedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadMessage"},s}(),o.CommentsV2UpdateCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.context="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(34).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2UpdateCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;case 3:s.context=e.string();break;case 4:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context)?"context: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2UpdateCommentThreadMessage)return e;var t=new o.CommentsV2UpdateCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.context&&(t.context=String(e.context)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.context="",n.attributes=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentThreadMessage"},s}(),o.CommentsV2ConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ConnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ConnectMessage)return e;var t=new o.CommentsV2ConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectMessage"},s}(),o.CommentsV2GetCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetCommentThreadMessage)return e;var t=new o.CommentsV2GetCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadMessage"},s}(),o.CommentsV2GetDocumentThreadsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetDocumentThreadsMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetDocumentThreadsMessage)return e;var t=new o.CommentsV2GetDocumentThreadsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsMessage"},s}(),o.CommentsV2RemoveCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2RemoveCommentMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.commentId=e.string();break;case 3:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2RemoveCommentMessage)return e;var t=new o.CommentsV2RemoveCommentMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentMessage"},s}(),o.CommentsV2RemoveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2RemoveCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2RemoveCommentThreadMessage)return e;var t=new o.CommentsV2RemoveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentThreadMessage"},s}(),o.CommentsV2UpdateCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.content="",s.prototype.documentId="",s.prototype.attributes="",s.prototype.isAttributesUpdated=!1,s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(26).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(34).string(e.documentId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(42).string(e.attributes),null!=e.isAttributesUpdated&&Object.hasOwnProperty.call(e,"isAttributesUpdated")&&t.uint32(48).bool(e.isAttributesUpdated),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&o.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(58).fork()).ldelim(),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2UpdateCommentMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.commentId=e.string();break;case 3:s.content=e.string();break;case 4:s.documentId=e.string();break;case 5:s.attributes=e.string();break;case 6:s.isAttributesUpdated=e.bool();break;case 7:s.commentThread=o.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId))return"commentId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!r.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes))return"attributes: string expected";if(null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&"boolean"!=typeof e.isAttributesUpdated)return"isAttributesUpdated: boolean expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){var t=o.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2UpdateCommentMessage)return e;var t=new o.CommentsV2UpdateCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.isAttributesUpdated&&(t.isAttributesUpdated=Boolean(e.isAttributesUpdated)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2UpdateCommentMessage.commentThread: object expected");t.commentThread=o.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.content="",n.documentId="",n.attributes="",n.isAttributesUpdated=!1,n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&(n.isAttributesUpdated=e.isAttributesUpdated),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=o.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentMessage"},s}(),o.CommentsV2AddCommentResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.commentId=e.string();break;case 3:s.createdAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentResponse)return e;var t=new o.CommentsV2AddCommentResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentResponse"},s}(),o.CommentsV2AddCommentThreadResponse=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.createdAt="",s.prototype.comments=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)o.CommentThreadAddedCommentDescriptor.encode(e.comments[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentThreadResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.createdAt=e.string();break;case 3:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(o.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt))return"createdAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var n=o.CommentThreadAddedCommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentThreadResponse)return e;var t=new o.CommentsV2AddCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadResponse.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");t.comments[n]=o.CommentThreadAddedCommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=o.CommentThreadAddedCommentDescriptor.toObject(e.comments[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadResponse"},s}(),o.CommentsV2ResolveCommentThreadResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ResolveCommentThreadResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;case 3:s.resolvedAt=e.string();break;case 4:s.resolvedBy=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ResolveCommentThreadResponse)return e;var t=new o.CommentsV2ResolveCommentThreadResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedAt="",n.resolvedBy=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadResponse"},s}(),o.CommentsV2ConnectResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.threads=r.emptyArray,s.prototype.threadsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.threads&&e.threads.length)for(var r=0;r<e.threads.length;++r)t.uint32(18).string(e.threads[r]);if(null!=e.threadsV2&&e.threadsV2.length)for(r=0;r<e.threadsV2.length;++r)o.CommentsThreadDescriptor.encode(e.threadsV2[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.threads&&s.threads.length||(s.threads=[]),s.threads.push(e.string());break;case 3:s.threadsV2&&s.threadsV2.length||(s.threadsV2=[]),s.threadsV2.push(o.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(var t=0;t<e.threads.length;++t)if(!r.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(t=0;t<e.threadsV2.length;++t){var n=o.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2ConnectResponse)return e;var t=new o.CommentsV2ConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2ConnectResponse.threads: array expected");t.threads=[];for(var n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2ConnectResponse.threadsV2: array expected");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");t.threadsV2[n]=o.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.threads&&e.threads.length){n.threads=[];for(var r=0;r<e.threads.length;++r)n.threads[r]=e.threads[r]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=o.CommentsThreadDescriptor.toObject(e.threadsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectResponse"},s}(),o.CommentsV2GetCommentThreadResponse=function(){function s(e){if(this.comments=[],this.commentsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=r.emptyArray,s.prototype.commentsV2=r.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)t.uint32(18).string(e.comments[r]);if(null!=e.commentsV2&&e.commentsV2.length)for(r=0;r<e.commentsV2.length;++r)o.CommentDescriptor.encode(e.commentsV2[r],t.uint32(26).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(42).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(50).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(58).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(74).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetCommentThreadResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(e.string());break;case 3:s.commentsV2&&s.commentsV2.length||(s.commentsV2=[]),s.commentsV2.push(o.CommentDescriptor.decode(e,e.uint32()));break;case 4:s.resolvedAt=e.string();break;case 5:s.resolvedBy=e.string();break;case 6:s.context=e.string();break;case 7:s.createdAt=e.string();break;case 8:s.deletedAt=e.string();break;case 9:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t)if(!r.isString(e.comments[t]))return"comments: string[] expected"}if(null!=e.commentsV2&&e.hasOwnProperty("commentsV2")){if(!Array.isArray(e.commentsV2))return"commentsV2: array expected";for(t=0;t<e.commentsV2.length;++t){var n=o.CommentDescriptor.verify(e.commentsV2[t]);if(n)return"commentsV2."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!r.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetCommentThreadResponse)return e;var t=new o.CommentsV2GetCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2GetCommentThreadResponse.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n)t.comments[n]=String(e.comments[n])}if(e.commentsV2){if(!Array.isArray(e.commentsV2))throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: array expected");for(t.commentsV2=[],n=0;n<e.commentsV2.length;++n){if("object"!=typeof e.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");t.commentsV2[n]=o.CommentDescriptor.fromObject(e.commentsV2[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[],n.commentsV2=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=e.comments[r]}if(e.commentsV2&&e.commentsV2.length)for(n.commentsV2=[],r=0;r<e.commentsV2.length;++r)n.commentsV2[r]=o.CommentDescriptor.toObject(e.commentsV2[r],t);return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadResponse"},s}(),o.CommentsV2GetDocumentThreadsResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.threads=r.emptyArray,s.prototype.threadsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.threads&&e.threads.length)for(var r=0;r<e.threads.length;++r)t.uint32(10).string(e.threads[r]);if(null!=e.threadsV2&&e.threadsV2.length)for(r=0;r<e.threadsV2.length;++r)o.CommentsThreadDescriptor.encode(e.threadsV2[r],t.uint32(18).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetDocumentThreadsResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.threads&&s.threads.length||(s.threads=[]),s.threads.push(e.string());break;case 2:s.threadsV2&&s.threadsV2.length||(s.threadsV2=[]),s.threadsV2.push(o.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(var t=0;t<e.threads.length;++t)if(!r.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(t=0;t<e.threadsV2.length;++t){var n=o.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetDocumentThreadsResponse)return e;var t=new o.CommentsV2GetDocumentThreadsResponse;if(e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");t.threads=[];for(var n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: array expected");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");t.threadsV2[n]=o.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),e.threads&&e.threads.length){n.threads=[];for(var r=0;r<e.threads.length;++r)n.threads[r]=e.threads[r]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=o.CommentsThreadDescriptor.toObject(e.threadsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsResponse"},s}(),o.KeyValueDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.key="",s.prototype.value="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.KeyValueDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.key=e.string();break;case 2:s.value=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!r.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!r.isString(e.value)?"value: string expected":null},s.fromObject=function(e){if(e instanceof o.KeyValueDescriptor)return e;var t=new o.KeyValueDescriptor;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/KeyValueDescriptor"},s}(),o.IsEditorBundleUploadedMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.bundleVersion="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(10).string(e.bundleVersion),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.IsEditorBundleUploadedMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.bundleVersion=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!r.isString(e.bundleVersion)?"bundleVersion: string expected":null},s.fromObject=function(e){if(e instanceof o.IsEditorBundleUploadedMessage)return e;var t=new o.IsEditorBundleUploadedMessage;return null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.bundleVersion=""),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedMessage"},s}(),o.IsEditorBundleUploadedResponse=function(){function r(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return r.prototype.isUploaded=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=n.create()),null!=e.isUploaded&&Object.hasOwnProperty.call(e,"isUploaded")&&t.uint32(8).bool(e.isUploaded),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.IsEditorBundleUploadedResponse;e.pos<r;){var i=e.uint32();i>>>3==1?s.isUploaded=e.bool():e.skipType(7&i)}return s},r.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&"boolean"!=typeof e.isUploaded?"isUploaded: boolean expected":null},r.fromObject=function(e){if(e instanceof o.IsEditorBundleUploadedResponse)return e;var t=new o.IsEditorBundleUploadedResponse;return null!=e.isUploaded&&(t.isUploaded=Boolean(e.isUploaded)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.isUploaded=!1),null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&(n.isUploaded=e.isUploaded),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedResponse"},r}(),o.RevisionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.revisionId=e.string();break;case 2:s.name=e.string();break;case 3:s.creatorId=e.string();break;case 4:s.authorsIds=e.string();break;case 5:s.diffData=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.attributes=e.string();break;case 8:s.toVersion=e.uint32();break;case 9:s.fromVersion=e.uint32();break;case 10:s.isEmptyCurrent=e.bool();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!r.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!r.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!r.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!r.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!r.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!r.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!r.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof o.RevisionDescriptor)return e;var t=new o.RevisionDescriptor;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionDescriptor"},s}(),o.RevisionHistoryConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryConnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryConnectMessage)return e;var t=new o.RevisionHistoryConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectMessage"},s}(),o.RevisionHistoryGetRevisionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.revisionId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(18).string(e.revisionId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryGetRevisionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.revisionId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!r.isString(e.revisionId)?"revisionId: string expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryGetRevisionMessage)return e;var t=new o.RevisionHistoryGetRevisionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.revisionId&&(t.revisionId=String(e.revisionId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId="",n.revisionId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionMessage"},s}(),o.RevisionHistoryReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryReconnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.requestId=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryReconnectMessage)return e;var t=new o.RevisionHistoryReconnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryReconnectMessage"},s}(),o.RevisionHistoryUpdateRevisionsMessage=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.prototype.revisions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var r=0;r<e.revisions.length;++r)o.RevisionDescriptor.encode(e.revisions[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryUpdateRevisionsMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.requestId=e.uint32();break;case 3:s.revisions&&s.revisions.length||(s.revisions=[]),s.revisions.push(o.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var n=o.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryUpdateRevisionsMessage)return e;var t=new o.RevisionHistoryUpdateRevisionsMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: array expected");t.revisions=[];for(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");t.revisions[n]=o.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(var r=0;r<e.revisions.length;++r)n.revisions[r]=o.RevisionDescriptor.toObject(e.revisions[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsMessage"},s}(),o.RevisionHistoryConnectResponse=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.requestId=0,s.prototype.revisions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var r=0;r<e.revisions.length;++r)o.RevisionDescriptor.encode(e.revisions[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.requestId=e.uint32();break;case 3:s.revisions&&s.revisions.length||(s.revisions=[]),s.revisions.push(o.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var n=o.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryConnectResponse)return e;var t=new o.RevisionHistoryConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryConnectResponse.revisions: array expected");t.revisions=[];for(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");t.revisions[n]=o.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.channel="",n.requestId=0),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(var r=0;r<e.revisions.length;++r)n.revisions[r]=o.RevisionDescriptor.toObject(e.revisions[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectResponse"},s}(),o.RevisionHistoryGetRevisionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryGetRevisionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.revisionId=e.string();break;case 2:s.name=e.string();break;case 3:s.creatorId=e.string();break;case 4:s.authorsIds=e.string();break;case 5:s.diffData=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.attributes=e.string();break;case 8:s.toVersion=e.uint32();break;case 9:s.fromVersion=e.uint32();break;case 10:s.isEmptyCurrent=e.bool();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!r.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!r.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!r.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!r.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!r.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!r.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!r.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryGetRevisionResponse)return e;var t=new o.RevisionHistoryGetRevisionResponse;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionResponse"},s}(),o.RevisionHistoryUpdateRevisionsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(8).uint32(e.requestId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryUpdateRevisionsResponse;e.pos<r;){var i=e.uint32();i>>>3==1?s.requestId=e.uint32():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryUpdateRevisionsResponse)return e;var t=new o.RevisionHistoryUpdateRevisionsResponse;return null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.requestId=0),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsResponse"},s}(),o.SessionsSocketDescriptor=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.session="",s.prototype.user="",s.prototype.role="",s.prototype.permissions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.session&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(18).string(e.user),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)t.uint32(34).string(e.permissions[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SessionsSocketDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.session=e.string();break;case 2:s.user=e.string();break;case 3:s.role=e.string();break;case 4:s.permissions&&s.permissions.length||(s.permissions=[]),s.permissions.push(e.string());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.session&&e.hasOwnProperty("session")&&!r.isString(e.session))return"session: string expected";if(null!=e.user&&e.hasOwnProperty("user")&&!r.isString(e.user))return"user: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!r.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!r.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.SessionsSocketDescriptor)return e;var t=new o.SessionsSocketDescriptor;if(null!=e.session&&(t.session=String(e.session)),null!=e.user&&(t.user=String(e.user)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SessionsSocketDescriptor.permissions: array expected");t.permissions=[];for(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.session="",n.user="",n.role=""),null!=e.session&&e.hasOwnProperty("session")&&(n.session=e.session),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsSocketDescriptor"},s}(),o.SessionsConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.sessionType=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.sessionType&&Object.hasOwnProperty.call(e,"sessionType")&&t.uint32(16).uint32(e.sessionType),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SessionsConnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.sessionType=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.sessionType&&e.hasOwnProperty("sessionType")&&!r.isInteger(e.sessionType)?"sessionType: integer expected":null},s.fromObject=function(e){if(e instanceof o.SessionsConnectMessage)return e;var t=new o.SessionsConnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.sessionType&&(t.sessionType=e.sessionType>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.sessionType=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.sessionType&&e.hasOwnProperty("sessionType")&&(n.sessionType=e.sessionType),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectMessage"},s}(),o.SocketConnectMessage=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.userId="",s.prototype.role="",s.prototype.permissions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)t.uint32(34).string(e.permissions[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SocketConnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.userId=e.string();break;case 3:s.role=e.string();break;case 4:s.permissions&&s.permissions.length||(s.permissions=[]),s.permissions.push(e.string());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id))return"id: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId))return"userId: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!r.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!r.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.SocketConnectMessage)return e;var t=new o.SocketConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SocketConnectMessage.permissions: array expected");t.permissions=[];for(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.id="",n.userId="",n.role=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketConnectMessage"},s}(),o.SocketDisconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SocketDisconnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.id=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof o.SocketDisconnectMessage)return e;var t=new o.SocketDisconnectMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketDisconnectMessage"},s}(),o.SessionsConnectResponse=function(){function s(e){if(this.sockets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.sockets=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.sockets&&e.sockets.length)for(var r=0;r<e.sockets.length;++r)o.SessionsSocketDescriptor.encode(e.sockets[r],t.uint32(18).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SessionsConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.sockets&&s.sockets.length||(s.sockets=[]),s.sockets.push(o.SessionsSocketDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.sockets&&e.hasOwnProperty("sockets")){if(!Array.isArray(e.sockets))return"sockets: array expected";for(var t=0;t<e.sockets.length;++t){var n=o.SessionsSocketDescriptor.verify(e.sockets[t]);if(n)return"sockets."+n}}return null},s.fromObject=function(e){if(e instanceof o.SessionsConnectResponse)return e;var t=new o.SessionsConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.sockets){if(!Array.isArray(e.sockets))throw TypeError(".SessionsConnectResponse.sockets: array expected");t.sockets=[];for(var n=0;n<e.sockets.length;++n){if("object"!=typeof e.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");t.sockets[n]=o.SessionsSocketDescriptor.fromObject(e.sockets[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.sockets=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.sockets&&e.sockets.length){n.sockets=[];for(var r=0;r<e.sockets.length;++r)n.sockets[r]=o.SessionsSocketDescriptor.toObject(e.sockets[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectResponse"},s}(),o.SuggestionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SuggestionDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.authorId=e.string();break;case 3:s.type=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.data=e.string();break;case 6:s.hasComments=e.bool();break;case 7:s.state=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!r.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.SuggestionDescriptor)return e;var t=new o.SuggestionDescriptor;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SuggestionDescriptor"},s}(),o.TrackChangesAddSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.type="",s.prototype.data="",s.prototype.originalSuggestionId="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).string(e.data),null!=e.originalSuggestionId&&Object.hasOwnProperty.call(e,"originalSuggestionId")&&t.uint32(42).string(e.originalSuggestionId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesAddSuggestionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.documentId=e.string();break;case 3:s.type=e.string();break;case 4:s.data=e.string();break;case 5:s.originalSuggestionId=e.string();break;case 6:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&!r.isString(e.originalSuggestionId)?"originalSuggestionId: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesAddSuggestionMessage)return e;var t=new o.TrackChangesAddSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.type&&(t.type=String(e.type)),null!=e.data&&(t.data=String(e.data)),null!=e.originalSuggestionId&&(t.originalSuggestionId=String(e.originalSuggestionId)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.documentId="",n.type="",n.data="",n.originalSuggestionId="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&(n.originalSuggestionId=e.originalSuggestionId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionMessage"},s}(),o.TrackChangesBatchUpdateSuggestionsStateMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=r.emptyArray,s.prototype.documentId="",s.prototype.state="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)t.uint32(10).string(e.ids[r]);return null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(26).string(e.state),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesBatchUpdateSuggestionsStateMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.ids&&s.ids.length||(s.ids=[]),s.ids.push(e.string());break;case 2:s.documentId=e.string();break;case 3:s.state=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(var t=0;t<e.ids.length;++t)if(!r.isString(e.ids[t]))return"ids: string[] expected"}return null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesBatchUpdateSuggestionsStateMessage)return e;var t=new o.TrackChangesBatchUpdateSuggestionsStateMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.state&&(t.state=String(e.state)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.documentId="",n.state=""),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesBatchUpdateSuggestionsStateMessage"},s}(),o.TrackChangesConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesConnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesConnectMessage)return e;var t=new o.TrackChangesConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectMessage"},s}(),o.TrackChangesGetAllSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetAllSuggestionMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetAllSuggestionMessage)return e;var t=new o.TrackChangesGetAllSuggestionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionMessage"},s}(),o.TrackChangesGetSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetSuggestionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetSuggestionMessage)return e;var t=new o.TrackChangesGetSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.documentId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionMessage"},s}(),o.TrackChangesUpdateSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.hasComments=!1,s.prototype.isHasCommentsModified=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(24).bool(e.hasComments),null!=e.isHasCommentsModified&&Object.hasOwnProperty.call(e,"isHasCommentsModified")&&t.uint32(32).bool(e.isHasCommentsModified),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(42).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesUpdateSuggestionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.documentId=e.string();break;case 3:s.hasComments=e.bool();break;case 4:s.isHasCommentsModified=e.bool();break;case 5:s.state=e.string();break;case 6:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&"boolean"!=typeof e.isHasCommentsModified?"isHasCommentsModified: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesUpdateSuggestionMessage)return e;var t=new o.TrackChangesUpdateSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.isHasCommentsModified&&(t.isHasCommentsModified=Boolean(e.isHasCommentsModified)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.documentId="",n.hasComments=!1,n.isHasCommentsModified=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&(n.isHasCommentsModified=e.isHasCommentsModified),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesUpdateSuggestionMessage"},s}(),o.TrackChangesAddSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesAddSuggestionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.authorId=e.string();break;case 3:s.type=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.data=e.string();break;case 6:s.hasComments=e.bool();break;case 7:s.state=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!r.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesAddSuggestionResponse)return e;var t=new o.TrackChangesAddSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionResponse"},s}(),o.TrackChangesConnectResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.suggestions=r.emptyArray,s.prototype.suggestionsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.suggestions&&e.suggestions.length)for(var r=0;r<e.suggestions.length;++r)t.uint32(18).string(e.suggestions[r]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(r=0;r<e.suggestionsV2.length;++r)o.SuggestionDescriptor.encode(e.suggestionsV2[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.suggestions&&s.suggestions.length||(s.suggestions=[]),s.suggestions.push(e.string());break;case 3:s.suggestionsV2&&s.suggestionsV2.length||(s.suggestionsV2=[]),s.suggestionsV2.push(o.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(var t=0;t<e.suggestions.length;++t)if(!r.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(t=0;t<e.suggestionsV2.length;++t){var n=o.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.TrackChangesConnectResponse)return e;var t=new o.TrackChangesConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesConnectResponse.suggestions: array expected");t.suggestions=[];for(var n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesConnectResponse.suggestionsV2: array expected");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");t.suggestionsV2[n]=o.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.suggestions&&e.suggestions.length){n.suggestions=[];for(var r=0;r<e.suggestions.length;++r)n.suggestions[r]=e.suggestions[r]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=o.SuggestionDescriptor.toObject(e.suggestionsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectResponse"},s}(),o.TrackChangesGetAllSuggestionsResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.suggestions=r.emptyArray,s.prototype.suggestionsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.suggestions&&e.suggestions.length)for(var r=0;r<e.suggestions.length;++r)t.uint32(10).string(e.suggestions[r]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(r=0;r<e.suggestionsV2.length;++r)o.SuggestionDescriptor.encode(e.suggestionsV2[r],t.uint32(18).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetAllSuggestionsResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.suggestions&&s.suggestions.length||(s.suggestions=[]),s.suggestions.push(e.string());break;case 2:s.suggestionsV2&&s.suggestionsV2.length||(s.suggestionsV2=[]),s.suggestionsV2.push(o.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(var t=0;t<e.suggestions.length;++t)if(!r.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(t=0;t<e.suggestionsV2.length;++t){var n=o.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetAllSuggestionsResponse)return e;var t=new o.TrackChangesGetAllSuggestionsResponse;if(e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");t.suggestions=[];for(var n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: array expected");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");t.suggestionsV2[n]=o.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.suggestions&&e.suggestions.length){n.suggestions=[];for(var r=0;r<e.suggestions.length;++r)n.suggestions[r]=e.suggestions[r]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=o.SuggestionDescriptor.toObject(e.suggestionsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionsResponse"},s}(),o.TrackChangesGetSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetSuggestionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.authorId=e.string();break;case 3:s.type=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.data=e.string();break;case 6:s.hasComments=e.bool();break;case 7:s.state=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!r.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetSuggestionResponse)return e;var t=new o.TrackChangesGetSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionResponse"},s}(),o.UserDescriptor=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.attributes&&e.attributes.length)for(var r=0;r<e.attributes.length;++r)o.KeyValueDescriptor.encode(e.attributes[r],t.uint32(10).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.UserDescriptor;e.pos<r;){var i=e.uint32();i>>>3==1?(s.attributes&&s.attributes.length||(s.attributes=[]),s.attributes.push(o.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(var t=0;t<e.attributes.length;++t){var n=o.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof o.UserDescriptor)return e;var t=new o.UserDescriptor;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".UserDescriptor.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");t.attributes[n]=o.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var r=0;r<e.attributes.length;++r)n.attributes[r]=o.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserDescriptor"},s}(),o.GetManyUsersMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)t.uint32(10).string(e.ids[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetManyUsersMessage;e.pos<r;){var i=e.uint32();i>>>3==1?(s.ids&&s.ids.length||(s.ids=[]),s.ids.push(e.string())):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(var t=0;t<e.ids.length;++t)if(!r.isString(e.ids[t]))return"ids: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.GetManyUsersMessage)return e;var t=new o.GetManyUsersMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersMessage"},s}(),o.GetUserMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetUserMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.id=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof o.GetUserMessage)return e;var t=new o.GetUserMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserMessage"},s}(),o.GetManyUsersResponse=function(){function s(e){if(this.users=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.users=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.users&&e.users.length)for(var r=0;r<e.users.length;++r)o.UserDescriptor.encode(e.users[r],t.uint32(10).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetManyUsersResponse;e.pos<r;){var i=e.uint32();i>>>3==1?(s.users&&s.users.length||(s.users=[]),s.users.push(o.UserDescriptor.decode(e,e.uint32()))):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.users&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(var t=0;t<e.users.length;++t){var n=o.UserDescriptor.verify(e.users[t]);if(n)return"users."+n}}return null},s.fromObject=function(e){if(e instanceof o.GetManyUsersResponse)return e;var t=new o.GetManyUsersResponse;if(e.users){if(!Array.isArray(e.users))throw TypeError(".GetManyUsersResponse.users: array expected");t.users=[];for(var n=0;n<e.users.length;++n){if("object"!=typeof e.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");t.users[n]=o.UserDescriptor.fromObject(e.users[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.users=[]),e.users&&e.users.length){n.users=[];for(var r=0;r<e.users.length;++r)n.users[r]=o.UserDescriptor.toObject(e.users[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersResponse"},s}(),o.GetUserResponse=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.attributes&&e.attributes.length)for(var r=0;r<e.attributes.length;++r)o.KeyValueDescriptor.encode(e.attributes[r],t.uint32(10).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetUserResponse;e.pos<r;){var i=e.uint32();i>>>3==1?(s.attributes&&s.attributes.length||(s.attributes=[]),s.attributes.push(o.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(var t=0;t<e.attributes.length;++t){var n=o.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof o.GetUserResponse)return e;var t=new o.GetUserResponse;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".GetUserResponse.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");t.attributes[n]=o.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var r=0;r<e.attributes.length;++r)n.attributes[r]=o.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserResponse"},s}(),o.ChannelMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.socketId="",s.prototype.data=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.socketId&&Object.hasOwnProperty.call(e,"socketId")&&t.uint32(18).string(e.socketId),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.ChannelMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.type=e.uint32();break;case 2:s.socketId=e.string();break;case 3:s.data=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isInteger(e.type)?"type: integer expected":null!=e.socketId&&e.hasOwnProperty("socketId")&&!r.isString(e.socketId)?"socketId: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||r.isString(e.data))?"data: buffer expected":null},s.fromObject=function(e){if(e instanceof o.ChannelMessage)return e;var t=new o.ChannelMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.socketId&&(t.socketId=String(e.socketId)),null!=e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.type=0,n.socketId="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=r.newBuffer(n.data)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.socketId&&e.hasOwnProperty("socketId")&&(n.socketId=e.socketId),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?r.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ChannelMessage"},s}(),o.BytesBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=r.newBuffer([]),s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).bytes(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.BytesBytesPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.bytes();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||r.isString(e.data))?"data: buffer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.BytesBytesPacketDataMessage)return e;var t=new o.BytesBytesPacketDataMessage;return null!=e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=r.newBuffer(n.data))),t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?r.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/BytesBytesPacketDataMessage"},s}(),o.NumberBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberBytesPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.NumberBytesPacketDataMessage)return e;var t=new o.NumberBytesPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberBytesPacketDataMessage"},s}(),o.NumberNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberNumberPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof o.NumberNumberPacketDataMessage)return e;var t=new o.NumberNumberPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberNumberPacketDataMessage"},s}(),o.NumberObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberObjectPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.NumberObjectPacketDataMessage)return e;var t=new o.NumberObjectPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberObjectPacketDataMessage"},s}(),o.NumberStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberStringPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.NumberStringPacketDataMessage)return e;var t=new o.NumberStringPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberStringPacketDataMessage"},s}(),o.ObjectBufferPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.ObjectBufferPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.ObjectBufferPacketDataMessage)return e;var t=new o.ObjectBufferPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectBufferPacketDataMessage"},s}(),o.ObjectObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.ObjectObjectPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.ObjectObjectPacketDataMessage)return e;var t=new o.ObjectObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectObjectPacketDataMessage"},s}(),o.PacketMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.id=0,s.prototype.nsp="",s.prototype.data=r.newBuffer([]),s.prototype.options=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(16).uint32(e.id),null!=e.nsp&&Object.hasOwnProperty.call(e,"nsp")&&t.uint32(26).string(e.nsp),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&t.uint32(42).bytes(e.options),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.PacketMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.type=e.uint32();break;case 2:s.id=e.uint32();break;case 3:s.nsp=e.string();break;case 4:s.data=e.bytes();break;case 5:s.options=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isInteger(e.type)?"type: integer expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isInteger(e.id)?"id: integer expected":null!=e.nsp&&e.hasOwnProperty("nsp")&&!r.isString(e.nsp)?"nsp: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||r.isString(e.data))?"data: buffer expected":null!=e.options&&e.hasOwnProperty("options")&&!(e.options&&"number"==typeof e.options.length||r.isString(e.options))?"options: buffer expected":null},s.fromObject=function(e){if(e instanceof o.PacketMessage)return e;var t=new o.PacketMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.id&&(t.id=e.id>>>0),null!=e.nsp&&(t.nsp=String(e.nsp)),null!=e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.options&&("string"==typeof e.options?r.base64.decode(e.options,t.options=r.newBuffer(r.base64.length(e.options)),0):e.options.length>=0&&(t.options=e.options)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.type=0,n.id=0,n.nsp="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=r.newBuffer(n.data))),t.bytes===String?n.options="":(n.options=[],t.bytes!==Array&&(n.options=r.newBuffer(n.options)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.nsp&&e.hasOwnProperty("nsp")&&(n.nsp=e.nsp),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?r.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.options&&e.hasOwnProperty("options")&&(n.options=t.bytes===String?r.base64.encode(e.options,0,e.options.length):t.bytes===Array?Array.prototype.slice.call(e.options):e.options),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketMessage"},s}(),o.PacketOptionsMessage=function(){function s(e){if(this.rooms=[],this.except=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.flags="",s.prototype.rooms=r.emptyArray,s.prototype.except=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.flags&&Object.hasOwnProperty.call(e,"flags")&&t.uint32(10).string(e.flags),null!=e.rooms&&e.rooms.length)for(var r=0;r<e.rooms.length;++r)t.uint32(18).string(e.rooms[r]);if(null!=e.except&&e.except.length)for(r=0;r<e.except.length;++r)t.uint32(26).string(e.except[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.PacketOptionsMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.flags=e.string();break;case 2:s.rooms&&s.rooms.length||(s.rooms=[]),s.rooms.push(e.string());break;case 3:s.except&&s.except.length||(s.except=[]),s.except.push(e.string());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.flags&&e.hasOwnProperty("flags")&&!r.isString(e.flags))return"flags: string expected";if(null!=e.rooms&&e.hasOwnProperty("rooms")){if(!Array.isArray(e.rooms))return"rooms: array expected";for(var t=0;t<e.rooms.length;++t)if(!r.isString(e.rooms[t]))return"rooms: string[] expected"}if(null!=e.except&&e.hasOwnProperty("except")){if(!Array.isArray(e.except))return"except: array expected";for(t=0;t<e.except.length;++t)if(!r.isString(e.except[t]))return"except: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.PacketOptionsMessage)return e;var t=new o.PacketOptionsMessage;if(null!=e.flags&&(t.flags=String(e.flags)),e.rooms){if(!Array.isArray(e.rooms))throw TypeError(".PacketOptionsMessage.rooms: array expected");t.rooms=[];for(var n=0;n<e.rooms.length;++n)t.rooms[n]=String(e.rooms[n])}if(e.except){if(!Array.isArray(e.except))throw TypeError(".PacketOptionsMessage.except: array expected");for(t.except=[],n=0;n<e.except.length;++n)t.except[n]=String(e.except[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.rooms=[],n.except=[]),t.defaults&&(n.flags=""),null!=e.flags&&e.hasOwnProperty("flags")&&(n.flags=e.flags),e.rooms&&e.rooms.length){n.rooms=[];for(var r=0;r<e.rooms.length;++r)n.rooms[r]=e.rooms[r]}if(e.except&&e.except.length)for(n.except=[],r=0;r<e.except.length;++r)n.except[r]=e.except[r];return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketOptionsMessage"},s}(),o.StringBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringBytesPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.StringBytesPacketDataMessage)return e;var t=new o.StringBytesPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringBytesPacketDataMessage"},s}(),o.StringNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringNumberPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof o.StringNumberPacketDataMessage)return e;var t=new o.StringNumberPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringNumberPacketDataMessage"},s}(),o.StringObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringObjectPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.StringObjectPacketDataMessage)return e;var t=new o.StringObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringObjectPacketDataMessage"},s}(),o.StringStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringStringPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.StringStringPacketDataMessage)return e;var t=new o.StringStringPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},s}(),o})?r.apply(t,o):r)||(e.exports=s)},5945:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(...e){}}},8689:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const o=n(2209),s=r(n(3596)),i=n(7158),a=r(n(6052)),c=r(n(4910)),d=r(n(357));t._SERVICE=13;class u extends((0,o.EmitterMixin)()){static async isBundleUploaded(e,t){const n=new a.default(t);if(e.state!==i.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new d.default("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(u._SERVICE,a.default.TYPE,s.default.encode(n));return s.default.decode(r,c.default).isUploaded}}u._SERVICE=t._SERVICE,t.default=u},6052:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new s(e.bundleVersion)}}t.default=s,s.TYPE="131",s.READABLE_TYPE_NAME="isEditorBundleUploaded",s.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",s.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}}},4910:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new s(e.isUploaded)}}t.default=s,s.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",s.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}}},6314:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(357));class s extends o.default{constructor(e,t){super(`${e} Service is not connected.`,t)}}t.default=s},9823:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddCommentThreadMessage=t.IsEditorBundleUploadedResponse=t.IsEditorBundleUploadedMessage=t.GetDocumentDetailsResponse=t.GetDocumentDetailsMessage=t.ChannelMessage=t.RevisionHistoryUpdateRevisionsResponse=t.RevisionHistoryGetRevisionResponse=t.RevisionHistoryConnectResponse=t.RevisionHistoryUpdateRevisionsMessage=t.RevisionHistoryGetRevisionMessage=t.RevisionHistoryReconnectMessage=t.RevisionHistoryConnectMessage=t.User=t.GetManyUsersResponse=t.GetUserResponse=t.GetManyUsersMessage=t.GetUserMessage=t.BatchUpdateSuggestionsStateMessage=t.UpdateSuggestionMessage=t.GetSuggestionMessage=t.GetAllSuggestionsMessage=t.ConnectTrackChangesMessage=t.GetSuggestionResponse=t.GetAllSuggestionsResponse=t.ConnectTrackChangesResponse=t.AddSuggestionResponse=t.AddSuggestionMessage=t.SocketDisconnectMessage=t.SocketConnectMessage=t.SessionsConnectResponse=t.SessionsConnectMessage=t.GetCommentThreadResponse=t.ConnectCommentsResponse=t.AddCommentResponse=t.UpdateCommentMessage=t.RemoveCommentThreadMessage=t.GetDocumentThreadsResponse=t.RemoveCommentMessage=t.GetDocumentThreadsMessage=t.GetCommentThreadMessage=t.ConnectCommentsMessage=t.AddCommentMessage=t.CollaborativeEditingResponse=t.CollaborativeEditingConnectResponse=t.CollaborativeEditingUpdateMessage=t.CollaborativeEditingReconnectMessage=t.CollaborativeEditingConnectMessage=t.MessagesMapper=t.MessagesCompressor=void 0,t.Parser=t.PacketParser=t.Decoder=t.Encoder=t.ResolveCommentThreadResponse=t.AddCommentThreadResponse=t.UpdateCommentThreadMessage=t.ResolveCommentThreadMessage=t.ReopenCommentThreadMessage=void 0;const a=i(n(3596));t.MessagesCompressor=a.default;const c=i(n(3140));t.MessagesMapper=c.default;const d=i(n(7839));t.CollaborativeEditingConnectMessage=d.default;const u=i(n(4148));t.CollaborativeEditingReconnectMessage=u.default;const l=i(n(5132));t.CollaborativeEditingUpdateMessage=l.default;const p=i(n(2968));t.CollaborativeEditingConnectResponse=p.default;const h=i(n(223));t.CollaborativeEditingResponse=h.default;const f=i(n(961));t.GetDocumentDetailsMessage=f.default;const m=i(n(6148));t.GetDocumentDetailsResponse=m.default;const y=i(n(7204));t.GetManyUsersMessage=y.default;const g=i(n(624));t.GetManyUsersResponse=g.default;const b=i(n(1779));t.GetUserMessage=b.default;const O=i(n(2184));t.GetUserResponse=O.default;const v=i(n(7530));t.User=v.default;const w=i(n(5420));t.AddCommentMessage=w.default;const x=i(n(2280));t.AddCommentResponse=x.default;const _=i(n(6376));t.ConnectCommentsMessage=_.default;const I=i(n(939));t.GetCommentThreadMessage=I.default;const S=i(n(1926));t.GetDocumentThreadsMessage=S.default;const P=i(n(7952));t.GetDocumentThreadsResponse=P.default;const T=i(n(6178));t.RemoveCommentMessage=T.default;const A=i(n(5711));t.RemoveCommentThreadMessage=A.default;const C=i(n(7955));t.UpdateCommentMessage=C.default;const k=i(n(7608));t.ConnectCommentsResponse=k.default;const E=i(n(6523));t.GetCommentThreadResponse=E.default;const j=i(n(4396));t.UpdateCommentThreadMessage=j.default;const R=i(n(3118));t.ResolveCommentThreadMessage=R.default;const D=i(n(8742));t.ReopenCommentThreadMessage=D.default;const M=i(n(7073));t.AddCommentThreadMessage=M.default;const N=i(n(5373));t.AddCommentThreadResponse=N.default;const V=i(n(2282));t.ResolveCommentThreadResponse=V.default;const B=i(n(2366));t.SessionsConnectMessage=B.default;const U=i(n(6145));t.SessionsConnectResponse=U.default;const J=i(n(2414));t.SocketConnectMessage=J.default;const q=i(n(4194));t.SocketDisconnectMessage=q.default;const G=i(n(597));t.AddSuggestionMessage=G.default;const Y=i(n(3111));t.AddSuggestionResponse=Y.default;const L=i(n(3390));t.GetAllSuggestionsResponse=L.default;const F=i(n(5930));t.GetSuggestionResponse=F.default;const H=i(n(1659));t.GetSuggestionMessage=H.default;const z=i(n(2679));t.GetAllSuggestionsMessage=z.default;const K=i(n(598));t.UpdateSuggestionMessage=K.default;const W=i(n(144));t.ConnectTrackChangesMessage=W.default;const $=i(n(701));t.ConnectTrackChangesResponse=$.default;const Q=i(n(3268));t.BatchUpdateSuggestionsStateMessage=Q.default;const Z=i(n(801));t.RevisionHistoryConnectMessage=Z.default;const X=i(n(8702));t.RevisionHistoryReconnectMessage=X.default;const ee=i(n(3667));t.RevisionHistoryGetRevisionMessage=ee.default;const te=i(n(6120));t.RevisionHistoryUpdateRevisionsMessage=te.default;const ne=i(n(5218));t.RevisionHistoryConnectResponse=ne.default;const re=i(n(6311));t.RevisionHistoryGetRevisionResponse=re.default;const oe=i(n(1655));t.RevisionHistoryUpdateRevisionsResponse=oe.default;const se=i(n(4910));t.IsEditorBundleUploadedResponse=se.default;const ie=i(n(6052));t.IsEditorBundleUploadedMessage=ie.default;const ae=s(n(2069));t.Parser=ae;const ce=i(n(8735));t.PacketParser=ce.default;const de=i(n(3554));t.ChannelMessage=de.default;const{Encoder:ue,Decoder:le}=ae;t.Encoder=ue,t.Decoder=le},3545:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}t.default=s,s.TYPE="1000"},3596:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(6398));function s(e){return o.default[e.DESCRIPTOR_NAME]}t.default=class{static decode(e,t){const n=s(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=s(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}},3140:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(7839)),s=r(n(4148)),i=r(n(5132)),a=r(n(961)),c=r(n(5420)),d=r(n(6376)),u=r(n(939)),l=r(n(1926)),p=r(n(6178)),h=r(n(5711)),f=r(n(7955)),m=r(n(2366)),y=r(n(2414)),g=r(n(4194)),b=r(n(597)),O=r(n(2679)),v=r(n(1659)),w=r(n(598)),x=r(n(144)),_=r(n(3268)),I=r(n(1779)),S=r(n(7204)),P=r(n(801)),T=r(n(8702)),A=r(n(3667)),C=r(n(6120)),k=r(n(6052)),E=r(n(3118)),j=r(n(8742)),R=r(n(4396)),D=r(n(7073)),M=new Map([[o.default.TYPE,o.default.READABLE_TYPE_NAME],[s.default.TYPE,s.default.READABLE_TYPE_NAME],[i.default.TYPE,i.default.READABLE_TYPE_NAME],[a.default.TYPE,a.default.READABLE_TYPE_NAME],[c.default.TYPE,c.default.READABLE_TYPE_NAME],[d.default.TYPE,d.default.READABLE_TYPE_NAME],[u.default.TYPE,u.default.READABLE_TYPE_NAME],[l.default.TYPE,l.default.READABLE_TYPE_NAME],[p.default.TYPE,p.default.READABLE_TYPE_NAME],[h.default.TYPE,h.default.READABLE_TYPE_NAME],[f.default.TYPE,f.default.READABLE_TYPE_NAME],[m.default.TYPE,m.default.READABLE_TYPE_NAME],[y.default.TYPE,y.default.READABLE_TYPE_NAME],[g.default.TYPE,g.default.READABLE_TYPE_NAME],[b.default.TYPE,b.default.READABLE_TYPE_NAME],[v.default.TYPE,v.default.READABLE_TYPE_NAME],[w.default.TYPE,w.default.READABLE_TYPE_NAME],[O.default.TYPE,O.default.READABLE_TYPE_NAME],[x.default.TYPE,x.default.READABLE_TYPE_NAME],[_.default.TYPE,_.default.READABLE_TYPE_NAME],[I.default.TYPE,I.default.READABLE_TYPE_NAME],[S.default.TYPE,S.default.READABLE_TYPE_NAME],[P.default.TYPE,P.default.READABLE_TYPE_NAME],[T.default.TYPE,T.default.READABLE_TYPE_NAME],[A.default.TYPE,A.default.READABLE_TYPE_NAME],[C.default.TYPE,C.default.READABLE_TYPE_NAME],[k.default.TYPE,k.default.READABLE_TYPE_NAME],[E.default.TYPE,E.default.READABLE_TYPE_NAME],[j.default.TYPE,j.default.READABLE_TYPE_NAME],[R.default.TYPE,R.default.READABLE_TYPE_NAME],[D.default.TYPE,D.default.READABLE_TYPE_NAME]]);t.default=class{static typeToStringName(e){var t;return null!==(t=M.get(String(e)))&&void 0!==t?t:e}}},9883:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,n]of Object.entries(e))void 0===n&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}t.default=s,s.DESCRIPTOR_NAME="RevisionDescriptor",s.DESCRIPTOR={fields:{revisionId:{type:"string",id:1},name:{type:"string",id:2},creatorId:{type:"string",id:3},authorsIds:{type:"string",id:4},diffData:{type:"string",id:5},createdAt:{type:"string",id:6},attributes:{type:"string",id:7},toVersion:{type:"uint32",id:8},fromVersion:{type:"uint32",id:9},isEmptyCurrent:{type:"bool",id:10}}}},801:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="121",s.READABLE_TYPE_NAME="connectToRevisionHistory",s.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},3667:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new s(e.documentId,e.revisionId)}}t.default=s,s.TYPE="123",s.READABLE_TYPE_NAME="getRevision",s.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}}},8702:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new s(e.documentId,e.requestId)}}t.default=s,s.TYPE="122",s.READABLE_TYPE_NAME="reconnectToRevisionHistory",s.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}}},6120:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(9883));class i extends o.default{constructor(e,t,n){super(),this.documentId=e,this.requestId=t,this.revisions=n}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(s.default.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(s.default.toObject)}}static create(e){return new i(e.documentId,e.requestId,e.revisions.map(s.default.create))}static fromJSON(e){return new i(e.documentId,e.requestId,e.revisions.map(s.default.fromJSON))}}t.default=i,i.TYPE="124",i.READABLE_TYPE_NAME="updateRevisions",i.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}}},5218:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(9883));class i extends o.default{constructor(e,t,n){super(),this.channel=e,this.requestId=t,this.revisions=n}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(s.default.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(s.default.toObject)}}static fromJSON(e){return new i(e.channel,e.requestId,e.revisions.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}}},6311:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(9883));class i extends o.default{constructor(e,t,n,r,o,s,i,a,c,d){super(),this.revisionId=e,this.name=t,this.creatorId=n,this.authorsIds=r,this.createdAt=o,this.diffData=s,this.attributes=i,this.fromVersion=a,this.toVersion=c,this.isEmptyCurrent=d}toJSON(){return s.default.toJSON(this)}toObject(){return s.default.toObject(this)}static create(e){return new i(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new i(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}t.default=i,i.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",i.DESCRIPTOR=s.default.DESCRIPTOR},1655:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new s(e.requestId)}}t.default=s,s.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",s.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}}},8811:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=n(2209),c=i(n(3596)),d=i(n(3667)),u=i(n(6311)),l=i(n(6120)),p=i(n(1655)),h=i(n(801)),f=i(n(5218)),m=i(n(8702)),y=i(n(357)),g=s(n(7158)),b=i(n(6314));t._SERVICE=12;class O extends((0,a.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new h.default(this._documentId))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}reconnect(e,t){if(this.isConnected)throw new y.default("Cannot reconnect to already connected service.",e);return this._connect(e,new m.default(this._documentId,t))}async updateRevisions(e,t){const n=l.default.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(l.default.TYPE,n),{requestId:o}=c.default.decode(r,p.default);return o}async getRevision(e){const t=new d.default(this._documentId,e),n=await this._sendRequest(d.default.TYPE,t);return c.default.decode(n,u.default).toObject()}async _connect(e,n){if(e.state!==g.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new y.default("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,n.constructor.TYPE,c.default.encode(n)),{channel:o,requestId:s,revisions:i}=c.default.decode(r,f.default).toObject();return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:g.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o),this._isConnected=!0,this.fire("connected"),{revisions:i,requestId:s}}_connectToChannel(e,t){this._channel=e._getChannel(O._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(l.default.TYPE),((e,t)=>{const{documentId:n,requestId:r,revisions:o}=c.default.decode(t,l.default).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:o})}))}_onWsGatewayStateChange(e){e===g.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,n){if(!this._wsGateway||!this._isConnected)throw new b.default("Revision History",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(n))}}O._SERVICE=t._SERVICE,t.default=O},3007:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WEB_SOCKET_GATEWAY_STATES=t.CommentsService=t.SessionCollection=t.TrackChangesService=t.WebSocketGateway=t.EditorService=t.RevisionHistoryService=t.CollaborativeEditingService=void 0;const a=s(n(7158));t.WebSocketGateway=a.default,Object.defineProperty(t,"WEB_SOCKET_GATEWAY_STATES",{enumerable:!0,get:function(){return a.WEB_SOCKET_GATEWAY_STATES}});const c=i(n(8689));t.EditorService=c.default;const d=i(n(8811));t.RevisionHistoryService=d.default;const u=i(n(125));t.TrackChangesService=u.default;const l=i(n(2690));t.SessionCollection=l.default;const p=i(n(7622));t.CollaborativeEditingService=p.default;const h=i(n(6042));t.CommentsService=h.default},2366:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new s(e.id,e.sessionType)}}t.default=s,s.TYPE="31",s.READABLE_TYPE_NAME="getConnectedSockets",s.DESCRIPTOR_NAME="SessionsConnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}}},2414:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){var e,t,n;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(e){return new s(e.id,e.userId,e.role,e.permissions)}}t.default=s,s.TYPE="32",s.READABLE_TYPE_NAME="connectSocket",s.DESCRIPTOR_NAME="SocketConnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}}},4194:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new s(e.id)}}t.default=s,s.TYPE="33",s.READABLE_TYPE_NAME="disconnectSocket",s.DESCRIPTOR_NAME="SocketDisconnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1}}}},6145:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t=[]){super(),this.channel=e,this.sockets=t}toJSON(){return{channel:this.channel,sockets:this.sockets.map((e=>({user:e.userId,session:e.id,role:e.role,permissions:e.permissions})))}}static fromJSON(e){return new s(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}t.default=s,s.DESCRIPTOR_NAME="SessionsConnectResponse",s.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}}},2690:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(2209),s=n(7026),i=r(n(7530)),a=r(n(7158)),c=r(n(6145)),d=r(n(2366)),u=r(n(2414)),l=r(n(4194)),p=r(n(3596));class h extends o.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new d.default(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(s._SERVICE,d.default.TYPE,p.default.encode(t));n=p.default.decode(e,c.default)}catch(e){n=new c.default(this._id,[])}this._connectToChannel(this._wsGateway,n.channel,this._sessionType);const r=await async function(e,t){const n=t.map((e=>e.userId)),r=n.length?await i.default.getMany(e,n):[];return t.map((e=>{const t={id:e.id,role:e.role,permissions:e.permissions};return t.user=e.userId&&r.find((t=>t.id===e.userId))||new i.default,t}))}(this._wsGateway,n.sockets);for(const e of r)super.add(e);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:a.default._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(e=!0){if(this._connected){for(this._connected=!1,this._eventsQueue=[];this.length;)super.remove(0);this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._wsGateway&&e&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),e&&this.stopListening()}}add(e,t){throw new TypeError("The collection is read-only.")}remove(e){throw new TypeError("The collection is read-only.")}_connectToChannel(e,t,n){this._channel=e._getChannel(n,t),this._channel&&(this._addHandler(this._channel,u.default.TYPE,(async t=>{const n=p.default.decode(t,u.default);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await i.default.get(e,n.userId)),super.add(t)}})),this._addHandler(this._channel,l.default.TYPE,(e=>{const t=p.default.decode(e,l.default);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===a.default.STATE_DISCONNECTED&&this.disconnect(!1),e===a.default.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let e;for(this._isRunning=!0;e=this._eventsQueue.shift();){const t=this._handlers.get(e.eventName);t&&await t(e.data)}this._isRunning=!1}_addHandler(e,t,n){const r=e.getEventName(t,!0);this.listenTo(e,r,(async(e,t)=>{const n=e.name;this._eventsQueue.push({eventName:n,data:t}),await this._runQueue()})),this._handlers.set(r,n)}}t.default=h},7026:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const o=r(n(2690));t._SERVICE=3;t.default=class{static async getConnectedSessions(e,t,n){const r=new o.default(t,n);return await r.connect(e),r}}},1706:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5945));class s extends o.default{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}t.default=s,s.DESCRIPTOR_NAME="SuggestionDescriptor",s.DESCRIPTOR={fields:{id:{id:1,type:"string"},authorId:{id:2,type:"string"},type:{id:3,type:"string"},createdAt:{id:4,type:"string"},data:{id:5,type:"string"},hasComments:{id:6,type:"bool"},state:{id:7,type:"string"},attributes:{id:8,type:"string"}}}},597:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r={},o=null,s=null){super(),this.id=e,this.documentId=t,this.type=n,this.data=r,this.originalSuggestionId=o,this.attributes=s}toJSON(){return{id:this.id,documentId:this.documentId,type:this.type,data:JSON.stringify(this.data),originalSuggestionId:this.originalSuggestionId,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){var t;return new s(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.TYPE="101",s.READABLE_TYPE_NAME="addSuggestion",s.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},type:{type:"string",id:3},data:{type:"string",id:4},originalSuggestionId:{type:"string",id:5},attributes:{type:"string",id:6}}}},3268:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.ids=e,this.documentId=t,this.state=n}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(e){return new s(e.ids,e.documentId,e.state)}}t.default=s,s.TYPE="106",s.READABLE_TYPE_NAME="batchUpdateSuggestionsState",s.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",s.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}}},144:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="105",s.READABLE_TYPE_NAME="connectToSuggestions",s.DESCRIPTOR_NAME="TrackChangesConnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},2679:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="102",s.READABLE_TYPE_NAME="getAllSuggestions",s.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},1659:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new s(e.id,e.documentId)}}t.default=s,s.TYPE="103",s.READABLE_TYPE_NAME="getSuggestion",s.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}}},598:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r,o,s=null){super(),this.id=e,this.documentId=t,this.hasComments=n,this.isHasCommentsModified=r,this.state=o,this.attributes=s}toJSON(){return{id:this.id,documentId:this.documentId,hasComments:this.hasComments,isHasCommentsModified:this.isHasCommentsModified,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new s(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.TYPE="104",s.READABLE_TYPE_NAME="updateSuggestion",s.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},hasComments:{type:"bool",id:3},isHasCommentsModified:{type:"bool",id:4},state:{type:"string",id:5},attributes:{type:"string",id:6}}}},3111:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r,o,s,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=o,this.state=s,this.data=i,this.attributes=a,this.createdAt=r?new Date(r):void 0}toJSON(){var e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new s(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",s.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}}},701:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1706));class i extends o.default{constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="TrackChangesConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}}},3390:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545)),s=r(n(1706));class i extends o.default{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(null===(t=e.suggestions)||void 0===t?void 0:t.map(a),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}function a(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}t.default=i,i.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",i.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}}},5930:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n,r,o,s,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=o,this.state=s,this.data=i,this.attributes=a,this.createdAt=new Date(r)}toJSON(){return{id:this.id,authorId:this.authorId,type:this.type,createdAt:this.createdAt.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new s(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",s.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}}},125:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=n(2209),c=i(n(3596)),d=i(n(597)),u=i(n(3111)),l=i(n(1659)),p=i(n(5930)),h=i(n(2679)),f=i(n(3390)),m=i(n(598)),y=i(n(144)),g=i(n(701)),b=i(n(357)),O=s(n(7158)),v=i(n(6314)),w=i(n(8801)),x=i(n(3268));t._SERVICE=10;class _ extends((0,a.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==O.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new b.default("WebSocket Gateway is not connected.",e);const n=new y.default(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,y.default.TYPE,c.default.encode(n)),o=c.default.decode(r,g.default);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:O.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o.channel),this._isConnected=!0,this.fire("connected"),o.suggestions}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}async add(e,t,n,r=null,o){const s=new d.default(e,this._documentId,t,n,r,o),i=await this._sendRequest(d.default.TYPE,s);return c.default.decode(i,u.default)}async get(e,t=1){const n=new l.default(e,this._documentId);try{const e=await this._sendRequest(l.default.TYPE,n);return c.default.decode(e,p.default)}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.get(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw w.default.fromPublicError(n)}var r}async getAll(){const e=new h.default(this._documentId),t=await this._sendRequest(h.default.TYPE,e),{suggestions:n}=c.default.decode(t,f.default);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:o}=t,s=void 0!==n,i=new m.default(e,this._documentId,n,s,r,o);await this._sendRequest(m.default.TYPE,i)}async batchUpdateState(e){const t=new x.default(e.ids,this._documentId,e.state);await this._sendRequest(x.default.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(_._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(m.default.TYPE),((e,t)=>{const n=c.default.decode(t,m.default);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(e){e===O.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,n){if(!this._wsGateway||!this._isConnected)throw new v.default("Track Changes",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(n))}}_._SERVICE=t._SERVICE,t.default=_},7204:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new s(e.ids)}}t.default=s,s.TYPE="22",s.READABLE_TYPE_NAME="getManyUsers",s.DESCRIPTOR_NAME="GetManyUsersMessage",s.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}}},1779:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new s(e.id)}}t.default=s,s.TYPE="21",s.READABLE_TYPE_NAME="getUser",s.DESCRIPTOR_NAME="GetUserMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1}}}},624:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(i)}}static fromJSON(e){return new s(e.users.map(a))}}function i(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function a(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}t.default=s,s.DESCRIPTOR_NAME="GetManyUsersResponse",s.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}}},2184:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e){super(),this.attributes=e}toJSON(){return{attributes:Object.keys(this.attributes).map((e=>({key:e,value:JSON.stringify(this.attributes[e])})))}}static fromJSON(e){const t=e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{});return new s(t)}}t.default=s,s.DESCRIPTOR_NAME="GetUserResponse",s.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}}},7530:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(1779)),s=r(n(2184)),i=r(n(3596)),a=r(n(7204)),c=r(n(624));class d{constructor(e={}){this._attributes=new Map;for(const t of Object.keys(e))"id"!==t?(this._attributes.set(t,e[t]),Object.defineProperty(this,t,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(t)})):this.id=e.id}static fromData(e){return new d(e)}static async get(e,t){const n=new o.default(t);try{const t=await e._sendRequest(d._SERVICE,o.default.TYPE,i.default.encode(n)),r=i.default.decode(t,s.default);return new d(r.attributes)}catch(e){return new d({id:t})}}static async getMany(e,t){const n=new a.default(t);try{const t=await e._sendRequest(d._SERVICE,a.default.TYPE,i.default.encode(n));return i.default.decode(t,c.default).users.map((e=>new d(e)))}catch(e){return t.map((e=>new d({id:e})))}}}d._SERVICE=2,t.default=d},6754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="50.0.0"},1573:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(2209),s=r(n(3554)),i=r(n(3596));class a extends((0,o.EmitterMixin)()){constructor(e,t,n){super(),this._channelName=e,this._wsGateway=t,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let n="";return t&&(n+="all:"),n+="event",e&&(n+=`:${e}`),n}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=i.default.decode(e,s.default);this.fire(this.getEventName(t.type,!0),t.data,t.socketId),t.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(t.type),t.data,t.socketId)}))}}t.default=a},3554:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t,n){super(),this.type=e,this.socketId=t,this.data=n}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(e){return new s(e.type,e.socketId,e.data)}}t.default=s,s.DESCRIPTOR_NAME="ChannelMessage",s.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}}},8735:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4990)),s=r(n(3596));t.default=class{encode(e,t,n,r="/",i={}){if(t.length>2)throw new Error("PacketParser supports only 2 elements in data");const a={type:e,data:t,id:n,nsp:r};return s.default.encode(o.default.create(a,i))}decode(e){const t=s.default.decode(e,o.default);return{packet:{id:t.id,type:t.type,data:t.packetData,nsp:t.nsp},options:{flags:t.options.flags,rooms:t.options.rooms,except:t.options.except}}}}},2854:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new d(e.data,e.data1)}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.BUFFER,c.MessageDataTypes.BUFFER),d.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}}},4253:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new d(e.data,e.data1)}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.BUFFER),d.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}}},1433:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new d(e.data,e.data1)}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.NUMBER),d.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}}},2272:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new d(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.OBJECT),d.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}}},1692:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new d(e.data,e.data1)}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.STRING),d.DESCRIPTOR_NAME="NumberStringPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}}},7239:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new d(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.OBJECT,c.MessageDataTypes.BUFFER),d.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}}},9075:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new d(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.OBJECT,c.MessageDataTypes.OBJECT),d.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},799:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}t.default=s,e.exports=s},4990:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3596)),s=r(n(3545)),i=r(n(338)),a=r(n(817)),c=r(n(4253)),d=r(n(6335)),u=r(n(2854)),l=r(n(9769)),p=r(n(2272)),h=r(n(9075)),f=r(n(7239)),m=r(n(1797)),y=r(n(1694)),g=r(n(1433)),b=r(n(1692)),O=[c.default,d.default,u.default,l.default,p.default,h.default,f.default,m.default,y.default,g.default,b.default].reduce(((e,t)=>(e[t.TYPE]=t,e)),{});class v extends s.default{constructor(e,t,n,r="/",o=new i.default){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=o}get packetData(){return void 0===this.data.data&&void 0===this.data.data1?[]:this.data.data&&void 0===this.data.data1?[this.data.data]:[this.data.data,this.data.data1]}toJSON(){const e=o.default.encode(this.options),t=o.default.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:t,options:e}}static fromJSON(e){const t=Math.floor(e.type/10);return new v(e.type-10*t,o.default.decode(e.data,O[t]),e.id,e.nsp,e.options?o.default.decode(e.options,i.default):new i.default)}static create(e,t={}){var n;const r=a.default.getPacketType(a.default.getType(e.data[0]),a.default.getType(null!==(n=e.data[1])&&void 0!==n?n:e.data[0]));return new v(e.type,O[r].create(e.data[0],e.data[1]),e.id,e.nsp,new i.default(t.flags,t.rooms,t.except))}}t.default=v,v.TYPE=10,v.DESCRIPTOR_NAME="PacketMessage",v.DESCRIPTOR={fields:{type:{type:"uint32",id:1},id:{type:"uint32",id:2},nsp:{type:"string",id:3},data:{type:"bytes",id:4},options:{type:"bytes",id:5}}}},338:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3545));class s extends o.default{constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new s(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}t.default=s,s.TYPE=11,s.DESCRIPTOR_NAME="PacketOptionsMessage",s.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}}},6335:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new d(e.data,e.data1)}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.BUFFER),d.DESCRIPTOR_NAME="StringBytesPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}}},1694:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new d(e.data,e.data1)}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.NUMBER),d.DESCRIPTOR_NAME="StringNumberPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}}},9769:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new d(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.OBJECT),d.DESCRIPTOR_NAME="StringObjectPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},1797:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(799)),c=s(n(817));class d extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new d(e.data,e.data1)}static create(e,t){return new d(e,t)}}t.default=d,d.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.STRING),d.DESCRIPTOR_NAME="StringStringPacketDataMessage",d.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},2069:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.ENCODED_TYPES=void 0;const o=n(9881),s=r(n(8735)),i=r(n(817));t.ENCODED_TYPES=[o.PacketType.EVENT,o.PacketType.ACK,o.PacketType.BINARY_ACK,o.PacketType.BINARY_EVENT];class a extends o.Encoder{constructor(e=new s.default){super(),this._packetParser=e}encode(e){if(t.ENCODED_TYPES.includes(e.type))try{return[this._packetParser.encode(e.type,e.data,e.id,e.nsp)]}catch(e){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:e.message}})}return super.encode(e)}}t.Encoder=a;class c extends o.Decoder{constructor(e=new s.default){super(),this._packetParser=e}add(e){if(!i.default.isBuffer(e))return super.add(e);let t;try{t=this._packetParser.decode(e).packet}catch(t){return super.add(e)}super.emitReserved("decoded",t)}}t.Decoder=c},817:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDataTypes=void 0;const n=!("undefined"==typeof process||!process.versions||!process.versions.node);var r;!function(e){e[e.BUFFER=1]="BUFFER",e[e.STRING=2]="STRING",e[e.NUMBER=3]="NUMBER",e[e.OBJECT=4]="OBJECT"}(r=t.MessageDataTypes||(t.MessageDataTypes={}));class o{static getPacketType(...e){let t=0;for(let n=0;n<e.length;n++){t+=e[n]*Math.pow(10,e.length-n-1)}return t}static getType(e){if(o.isBuffer(e))return r.BUFFER;const t=typeof e;return"string"===t?r.STRING:"number"===t?r.NUMBER:r.OBJECT}static isBuffer(e){return n&&Buffer.isBuffer(e)||e instanceof ArrayBuffer||e instanceof Uint8Array||this._isBufferView(e)}static _isBufferView(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}t.default=o},1113:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(357));class s{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}(),this.timeout=setTimeout((()=>this.error(new o.default("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}t.default=class{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const n=this._createRequest(t);try{return e(n),await n.promise}finally{this._finishRequest(n)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new s(this._context,e);return this._requests.add(t),t}_finishRequest(e){this._requests.delete(e),clearTimeout(e.timeout)}async _waitForRequests(e=5e3,t=0){return!this._requests.size||t>=e/500?Promise.resolve():(await new Promise((e=>{setTimeout(e,500)})),this._waitForRequests(e,t++))}}},7158:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WEB_SOCKET_GATEWAY_STATES=void 0;const o=n(8623),s=r(n(9655)),i=n(2209),a=r(n(1573)),c=r(n(7530)),d=r(n(6754)),u=r(n(357)),l=r(n(8801)),p=n(2069),h=r(n(1113));var f;!function(e){e.DISCONNECTED="disconnected",e.CONNECTING="connecting",e.CONNECTED="connected"}(f=t.WEB_SOCKET_GATEWAY_STATES||(t.WEB_SOCKET_GATEWAY_STATES={}));class m extends((0,i.ObservableMixin)()){constructor(e,t,n={},r=o.io,i=c.default.get){if(super(),this._token=t,this._options=n,this._connectionProvider=r,this._userFactory=i,this._requestsManager=new h.default(this),this._channels=new Map,this._connectionAttempt=0,!e)throw new TypeError("Api address must be provided.");if(!this._token)throw new TypeError("Token must be provided.");this._options.requestTimeout||(this._options.requestTimeout=2e4),this._url=(0,s.default)(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",f.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==m.STATE_CONNECTED){if(n===m.STATE_DISCONNECTED)return this._requestsManager.errorAll(new u.default("Not connected.",this))}else try{this.me=await this._userFactory.call(c.default,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:m._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==f.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=f.DISCONNECTED)}async reconnect(){this._socket||this.state!==f.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=o.io,s=c.default.get){const i=new m(t,e,n,r,s);return await i._connect(),i}_sendRequest(e,t,n){if(!e)throw new u.default("`serviceName` must be provided.",this);if(this.state!==m.STATE_CONNECTED)throw new u.default("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new u.default("Not authenticated.",this);const r=new ArrayBuffer(n.length+2),o=new Uint8Array(r);return o[0]=e,o[1]=parseInt(t),o.set(n,2),this._emit(1,o)}_getChannel(e,t){const n=`${e}${t}`;return!this._channels.has(n)&&this._socket&&this._channels.set(n,new a.default(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise(((e,t)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),n.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),n.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),n=`${this._url.protocol||"https:"}//${this._url.hostname}:${t}`,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",o=this._connectionProvider(n,{parser:{Encoder:p.Encoder,Decoder:p.Decoder},path:r+"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:d.default},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=f.CONNECTING,o.on("connect",(()=>{this._debugEvent("connect"),this.socketId=o.id})),o.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),o.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),o.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),o.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=f.CONNECTING,this._connectionAttempt=e})),o.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),o.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=o,o}_emit(e,t){const n=this._socket;return this._requestsManager.send((r=>{n.emit(e,t,((e,t)=>{if(e)return r.error(l.default.fromPublicError(e));r.response(t)}))}),this._options.requestTimeout)}_addAuthData(e,t){this._socketAuth={environmentId:e,userId:t,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=f.CONNECTED;const e=async(e,t,n)=>{this._debugEvent("token:value:change");try{await this._authenticate(n)}catch(e){}};this._token.on("change:value",e),this._socket.io.off("reconnect_error"),this.on("disconnect",(()=>{this._token.off("change:value",e)}))}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=f.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const e of this._channels.values())e.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(e,t){if(!this._isDebugModeEnabled())return;const n=void 0!==t?`, data: ${t}`:"";console.info(`${(new Date).toLocaleString()} ${e}${n}`)}_reconnectionAttemptError(e){this._connectionAttempt>=2&&(this.disconnect(),e(u.default.fromPublicError({message:"The number of initial connection attempts exceeded.",explanation:"Three initial connection attempts failed. It can be caused by a missing or blocked Internet connection.",action:"Please verify the stability of your Internet connection and ensure that no antivirus or firewall software blocks the Web Socket protocol connections."})))}_onUnauthorized({error:e}){this._removeAuthData(),this.fire("error",l.default.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success",`envId: ${t.environmentId}, userId: ${t.userId}`),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;if(!i.global.window.localStorage)return!1;return"true"===(null!==(e=i.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}m.STATE_DISCONNECTED=f.DISCONNECTED,m.STATE_CONNECTING=f.CONNECTING,m.STATE_CONNECTED=f.CONNECTED,m._CHANGE_STATE_EVENT_PRIORITY=i.priorities.get("highest")+999999,t.default=m},537:e=>{"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),r=0,o=2,s=!0;for(;o<arguments.length;)n[r++]=arguments[o++];return new Promise((function(o,i){n[r]=function(e){if(s)if(s=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,i(e))}}))}},9745:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),s=0;s<64;)o[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;n.encode=function(e,t,n){for(var o,s=null,i=[],a=0,c=0;t<n;){var d=e[t++];switch(c){case 0:i[a++]=r[d>>2],o=(3&d)<<4,c=1;break;case 1:i[a++]=r[o|d>>4],o=(15&d)<<2,c=2;break;case 2:i[a++]=r[o|d>>6],i[a++]=r[63&d],c=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,i)),a=0)}return c&&(i[a++]=r[o],i[a++]=61,1===c&&(i[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,i.slice(0,a))),s.join("")):String.fromCharCode.apply(String,i.slice(0,a))};var i="invalid encoding";n.decode=function(e,t,n){for(var r,s=n,a=0,c=0;c<e.length;){var d=e.charCodeAt(c++);if(61===d&&a>1)break;if(void 0===(d=o[d]))throw Error(i);switch(a){case 0:r=d,a=1;break;case 1:t[n++]=r<<2|(48&d)>>4,r=d,a=2;break;case 2:t[n++]=(15&r)<<4|(60&d)>>2,r=d,a=3;break;case 3:t[n++]=(3&r)<<6|d,a=0}}if(1===a)throw Error(i);return n-s},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},4459:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},897:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function s(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:s,e.writeFloatBE=r?s:o,e.readFloatLE=r?i:a,e.readFloatBE=r?a:i}():function(){function t(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2);e((o<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,n),o=2*(r>>31)+1,s=r>>>23&255,i=8388607&r;return 255===s?i?NaN:o*(1/0):0===s?1401298464324817e-60*o*i:o*Math.pow(2,s-150)*(i+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,o),e.readFloatBE=i.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function s(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:s,e.writeDoubleBE=r?s:o,e.readDoubleLE=r?i:a,e.readDoubleBE=r?a:i}():function(){function t(e,t,n,r,o,s){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,o,s+t),e(1/r>0?0:2147483648,o,s+n);else if(isNaN(r))e(0,o,s+t),e(2146959360,o,s+n);else if(r>17976931348623157e292)e(0,o,s+t),e((i<<31|2146435072)>>>0,o,s+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,o,s+t),e((i<<31|a/4294967296)>>>0,o,s+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,o,s+t),e((i<<31|c+1023<<20|1048576*a&1048575)>>>0,o,s+n)}}}function i(e,t,n,r,o){var s=e(r,o+t),i=e(r,o+n),a=2*(i>>31)+1,c=i>>>20&2047,d=4294967296*(1048575&i)+s;return 2047===c?d?NaN:a*(1/0):0===c?5e-324*a*d:a*Math.pow(2,c-1075)*(d+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,o,0,4),e.readDoubleBE=i.bind(null,s,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},3229:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},7986:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,o=r>>>1,s=null,i=r;return function(n){if(n<1||n>o)return e(n);i+n>r&&(s=e(r),i=0);var a=t.call(s,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},113:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,s=[],i=0;t<n;)(r=e[t++])<128?s[i++]=r:r>191&&r<224?s[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[i++]=55296+(r>>10),s[i++]=56320+(1023&r)):s[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join("")):String.fromCharCode.apply(String,s.slice(0,i))},n.write=function(e,t,n){for(var r,o,s=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&o),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-s}},8236:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck.ck-balloon-panel.ck-tooltip{pointer-events:none;z-index:calc(var(--ck-z-modal) + 100)}:root{--ck-color-presence-list-dropdown-background:#fff;--ck-color-presence-list-dropdown-arrow-border:#ebebeb;--ck-presence-list-dropdown-list-max-width:250px;--ck-presence-list-dropdown-list-min-width:180px;--ck-presence-list-users-tooltip-max-width:120px;--ck-presence-list-users-tooltip-min-width:25px}.ck.ck-presence-list{align-items:center;display:flex;font-size:var(--ck-font-size-base);margin-right:var(--ck-spacing-standard);transition:margin-right .2s ease-in-out}.ck.ck-presence-list *{box-sizing:border-box}.ck.ck-presence-list__list{display:flex;justify-content:flex-end}.ck.ck-presence-list__counter{color:var(--ck-color-base-text)}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:0;color:inherit;font:inherit;margin-left:var(--ck-spacing-standard);outline:none;padding:0;position:relative}.ck.ck-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck.ck-presence-list--collapsed .ck-presence-list__list{margin-left:var(--ck-spacing-standard);min-width:calc(var(--ck-user-avatar-size)*1.5)}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{margin-left:calc(var(--ck-user-avatar-size)*-1 + 5px)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(2){opacity:.75}.ck.ck-presence-list__balloon{--ck-color-panel-border:var(--ck-color-presence-list-dropdown-arrow-border);--ck-color-panel-background:var(--ck-color-presence-list-dropdown-background);animation:fadeIn .3s ease-in-out;background-color:var(--ck-color-presence-list-dropdown-background);border:0;opacity:1}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-height:80vh;max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width);overflow-x:hidden;overflow-y:auto}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item{align-items:center;background:none;border:0;color:inherit;display:flex;font:inherit;outline:none;padding:0;padding:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:first-of-type .ck-presence-list__marker{border-top-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:last-of-type .ck-presence-list__marker{border-bottom-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck-user__full-name{color:var(--ck-color-base-text);margin-left:var(--ck-spacing-standard);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck.ck-presence-list__marker{height:100%;left:0;margin:0;position:absolute;width:3px}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const s=o},2521:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck .ck-user__marker{cursor:default;display:inline;position:relative}.ck .ck-user__marker:after{color:#fff;content:attr(data-name);display:none;font-family:Georgia,sans-serif;font-size:var(--ck-font-size-base);font-style:normal;font-weight:400;left:0;line-height:1;opacity:0;padding:var(--ck-spacing-small);position:absolute;top:-20px;transition:opacity .2s linear,transform .3s ease-in-out;white-space:nowrap;z-index:99999}.ck .ck-user__marker:hover .ck-user__marker-dot{width:0}.ck .ck-user__marker:hover:after{animation:fadeInLeft .3s ease-in-out;display:block;opacity:1}.ck .ck-user__marker-line{bottom:0;height:100%;position:absolute;width:0}.ck .ck-user__marker-dot{border-radius:50%;cursor:default;display:block;height:var(--ck-user-dot-size);left:50%;position:absolute;top:calc((var(--ck-user-dot-size)/2)*-1);transform:translate(-50%,-50%);width:var(--ck-user-dot-size)}.ck .ck-placeholder .ck-user__marker{display:none}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const s=o},7758:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var s=0;s<this.length;s++){var i=this[s][0];null!=i&&(o[i]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},7154:e=>{var t=1e3,n=60*t,r=60*n,o=24*r,s=7*o,i=365.25*o;function a(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,c){c=c||{};var d=typeof e;if("string"===d&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===d&&isFinite(e))return c.long?function(e){var s=Math.abs(e);if(s>=o)return a(e,s,o,"day");if(s>=r)return a(e,s,r,"hour");if(s>=n)return a(e,s,n,"minute");if(s>=t)return a(e,s,t,"second");return e+" ms"}(e):function(e){var s=Math.abs(e);if(s>=o)return Math.round(e/o)+"d";if(s>=r)return Math.round(e/r)+"h";if(s>=n)return Math.round(e/n)+"m";if(s>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},5579:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(3847)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},3847:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,s,i=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),s=o-(n||o);r.diff=s,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";i++;const s=t.formatters[o];if("function"==typeof s){const t=e[i];n=s.call(r,t),e.splice(i,1),i--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(7154),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},6386:(e,t,n)=>{"use strict";e.exports=n(3278)},3278:(e,t,n)=>{"use strict";var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(2944),r.BufferWriter=n(2178),r.Reader=n(9867),r.BufferReader=n(2676),r.util=n(4155),r.rpc=n(3290),r.roots=n(284),r.configure=o,o()},9867:(e,t,n)=>{"use strict";e.exports=c;var r,o=n(4155),s=o.LongBits,i=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var d,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};function p(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(d=4294967295,function(){if(d=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return d;if(d=(d|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return d;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return d}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},2676:(e,t,n)=>{"use strict";e.exports=s;var r=n(9867);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(4155);function s(e){r.call(this,e)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},284:e=>{"use strict";e.exports={}},3290:(e,t,n)=>{"use strict";t.Service=n(979)},979:(e,t,n)=>{"use strict";e.exports=o;var r=n(4155);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,s,i){if(!s)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(e,a,t,n,o,s);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof o))try{n=o[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},8950:(e,t,n)=>{"use strict";e.exports=o;var r=n(4155);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var i=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):s},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;o.fromHash=function(e){return e===i?s:new o((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},4155:function(e,t,n){"use strict";var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(537),r.base64=n(9745),r.EventEmitter=n(4459),r.float=n(897),r.inquire=n(3229),r.utf8=n(113),r.pool=n(7986),r.LongBits=n(8950),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},2944:(e,t,n)=>{"use strict";e.exports=l;var r,o=n(4155),s=o.LongBits,i=o.base64,a=o.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function d(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=p(),l.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(l.alloc=o.pool(l.alloc,o.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,s.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=s.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=s.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var g=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var n=l.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(d,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=p(),r._configure()}},2178:(e,t,n)=>{"use strict";e.exports=s;var r=n(2944);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(4155);function s(){r.call(this)}function i(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=o._Buffer_allocUnsafe,s.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},s.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},s._configure()},1829:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,s,i=[];for(s in"string"!=typeof t&&(t="?"),e)if(n.call(e,s)){if((r=e[s])||null!=r&&!isNaN(r)||(r=""),s=o(s),r=o(r),null===s||null===r)continue;i.push(s+"="+r)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,o={};t=n.exec(e);){var s=r(t[1]),i=r(t[2]);null===s||null===i||s in o||(o[s]=i)}return o}},3722:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},7594:(e,t,n)=>{"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},s=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],o=0;o<e.length;o++){var s=e[o],c=t.base?s[0]+t.base:s[0],d=n[c]||0,u="".concat(c," ").concat(d);n[c]=d+1;var l=a(u),p={css:s[1],media:s[2],sourceMap:s[3]};-1!==l?(i[l].references++,i[l].updater(p)):i.push({identifier:u,updater:y(p,t),references:1}),r.push(u)}return r}function d(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=s(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,l=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function p(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,o);else{var s=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(s,i[t]):e.appendChild(s)}}function h(e,t,n){var r=n.css,o=n.media,s=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,m=0;function y(e,t){var n,r,o;if(t.singleton){var s=m++;n=f||(f=d(t)),r=p.bind(null,n,s,!1),o=p.bind(null,n,s,!0)}else n=d(t),r=h.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=a(n[r]);i[o].references--}for(var s=c(e,t),d=0;d<n.length;d++){var u=a(n[d]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=s}}}},9655:(e,t,n)=>{"use strict";var r=n(3722),o=n(1829),s=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,d=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function l(e){return(e||"").toString().replace(s,"")}var p=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function f(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},o={},s=typeof(e=e||r);if("blob:"===e.protocol)o=new g(unescape(e.pathname),{});else if("string"===s)for(t in o=new g(e,{}),h)delete o[t];else if("object"===s){for(t in e)t in h||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=a.test(e.href))}return o}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function y(e,t){e=(e=l(e)).replace(i,""),t=t||{};var n,r=d.exec(e),o=r[1]?r[1].toLowerCase():"",s=!!r[2],a=!!r[3],c=0;return s?a?(n=r[2]+r[3]+r[4],c=r[2].length+r[3].length):(n=r[2]+r[4],c=r[2].length):a?(n=r[3]+r[4],c=r[3].length):n=r[4],"file:"===o?c>=2&&(n=n.slice(2)):m(o)?n=r[4]:o?s&&(n=n.slice(2)):c>=2&&m(t.protocol)&&(n=r[4]),{protocol:o,slashes:s||m(o),slashesCount:c,rest:n}}function g(e,t,n){if(e=(e=l(e)).replace(i,""),!(this instanceof g))return new g(e,t,n);var s,a,c,d,h,b,O=p.slice(),v=typeof t,w=this,x=0;for("object"!==v&&"string"!==v&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),s=!(a=y(e||"",t=f(t))).protocol&&!a.slashes,w.slashes=a.slashes||s&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(w.protocol)))&&(O[3]=[/(.*)/,"pathname"]);x<O.length;x++)"function"!=typeof(d=O[x])?(c=d[0],b=d[1],c!=c?w[b]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof d[2]?(w[b]=e.slice(0,h),e=e.slice(h+d[2])):(w[b]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(w[b]=h[1],e=e.slice(0,h.index)),w[b]=w[b]||s&&d[3]&&t[b]||"",d[4]&&(w[b]=w[b].toLowerCase())):e=d(e,w);n&&(w.query=n(w.query)),s&&t.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==t.pathname)&&(w.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],s=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(s=!0),n.splice(r,1),i--);return s&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(w.pathname,t.pathname)),"/"!==w.pathname.charAt(0)&&m(w.protocol)&&(w.pathname="/"+w.pathname),r(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(h=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,h),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(h+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&m(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}g.prototype={set:function(e,t,n){var s=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),s[e]=t;break;case"port":s[e]=t,r(t,s.protocol)?t&&(s.host=s.hostname+":"+t):(s.host=s.hostname,s[e]="");break;case"hostname":s[e]=t,s.port&&(t+=":"+s.port),s.host=t;break;case"host":s[e]=t,c.test(t)?(t=t.split(":"),s.port=t.pop(),s.hostname=t.join(":")):(s.hostname=t,s.port="");break;case"protocol":s.protocol=t.toLowerCase(),s.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";s[e]=t.charAt(0)!==i?i+t:t}else s[e]=t;break;case"username":case"password":s[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(s.username=t.slice(0,a),s.username=encodeURIComponent(decodeURIComponent(s.username)),s.password=t.slice(a+1),s.password=encodeURIComponent(decodeURIComponent(s.password))):s.username=encodeURIComponent(decodeURIComponent(t))}for(var d=0;d<p.length;d++){var u=p[d];u[4]&&(s[u[1]]=s[u[1]].toLowerCase())}return s.auth=s.password?s.username+":"+s.password:s.username,s.origin="file:"!==s.protocol&&m(s.protocol)&&s.host?s.protocol+"//"+s.host:"null",s.href=s.toString(),s},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.host,s=n.protocol;s&&":"!==s.charAt(s.length-1)&&(s+=":");var i=s+(n.protocol&&n.slashes||m(n.protocol)?"//":"");return n.username?(i+=n.username,n.password&&(i+=":"+n.password),i+="@"):n.password?(i+=":"+n.password,i+="@"):"file:"!==n.protocol&&m(n.protocol)&&!r&&"/"!==n.pathname&&(i+="@"),(":"===r[r.length-1]||c.test(n.hostname)&&!n.port)&&(r+=":"),i+=r+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},g.extractProtocol=y,g.location=f,g.trimLeft=l,g.qs=o,e.exports=g},5003:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{NIL:()=>j,parse:()=>y,stringify:()=>u,v1:()=>m,v3:()=>P,v4:()=>T,v5:()=>E,validate:()=>a,version:()=>R});var o=new Uint8Array(16);function s(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}const i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function(e){return"string"==typeof e&&i.test(e)};for(var c=[],d=0;d<256;++d)c.push((d+256).toString(16).substr(1));const u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n};var l,p,h=0,f=0;const m=function(e,t,n){var r=t&&n||0,o=t||new Array(16),i=(e=e||{}).node||l,a=void 0!==e.clockseq?e.clockseq:p;if(null==i||null==a){var c=e.random||(e.rng||s)();null==i&&(i=l=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==a&&(a=p=16383&(c[6]<<8|c[7]))}var d=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:f+1,y=d-h+(m-f)/1e4;if(y<0&&void 0===e.clockseq&&(a=a+1&16383),(y<0||d>h)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=d,f=m,p=a;var g=(1e4*(268435455&(d+=122192928e5))+m)%4294967296;o[r++]=g>>>24&255,o[r++]=g>>>16&255,o[r++]=g>>>8&255,o[r++]=255&g;var b=d/4294967296*1e4&268435455;o[r++]=b>>>8&255,o[r++]=255&b,o[r++]=b>>>24&15|16,o[r++]=b>>>16&255,o[r++]=a>>>8|128,o[r++]=255&a;for(var O=0;O<6;++O)o[r+O]=i[O];return t||u(o)};const y=function(e){if(!a(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function g(e,t,n){function r(e,r,o,s){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=y(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(r),i.set(e,r.length),(i=n(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){s=s||0;for(var a=0;a<16;++a)o[s+a]=i[a];return o}return u(i)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function b(e){return 14+(e+64>>>9<<4)+1}function O(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function v(e,t,n,r,o,s){return O((i=O(O(t,e),O(r,s)))<<(a=o)|i>>>32-a,n);var i,a}function w(e,t,n,r,o,s,i){return v(t&n|~t&r,e,t,o,s,i)}function x(e,t,n,r,o,s,i){return v(t&r|n&~r,e,t,o,s,i)}function _(e,t,n,r,o,s,i){return v(t^n^r,e,t,o,s,i)}function I(e,t,n,r,o,s,i){return v(n^(t|~r),e,t,o,s,i)}const S=function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,r="0123456789abcdef",o=0;o<n;o+=8){var s=e[o>>5]>>>o%32&255,i=parseInt(r.charAt(s>>>4&15)+r.charAt(15&s),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[b(t)-1]=t;for(var n=1732584193,r=-271733879,o=-1732584194,s=271733878,i=0;i<e.length;i+=16){var a=n,c=r,d=o,u=s;n=w(n,r,o,s,e[i],7,-680876936),s=w(s,n,r,o,e[i+1],12,-389564586),o=w(o,s,n,r,e[i+2],17,606105819),r=w(r,o,s,n,e[i+3],22,-1044525330),n=w(n,r,o,s,e[i+4],7,-176418897),s=w(s,n,r,o,e[i+5],12,1200080426),o=w(o,s,n,r,e[i+6],17,-1473231341),r=w(r,o,s,n,e[i+7],22,-45705983),n=w(n,r,o,s,e[i+8],7,1770035416),s=w(s,n,r,o,e[i+9],12,-1958414417),o=w(o,s,n,r,e[i+10],17,-42063),r=w(r,o,s,n,e[i+11],22,-1990404162),n=w(n,r,o,s,e[i+12],7,1804603682),s=w(s,n,r,o,e[i+13],12,-40341101),o=w(o,s,n,r,e[i+14],17,-1502002290),n=x(n,r=w(r,o,s,n,e[i+15],22,1236535329),o,s,e[i+1],5,-165796510),s=x(s,n,r,o,e[i+6],9,-1069501632),o=x(o,s,n,r,e[i+11],14,643717713),r=x(r,o,s,n,e[i],20,-373897302),n=x(n,r,o,s,e[i+5],5,-701558691),s=x(s,n,r,o,e[i+10],9,38016083),o=x(o,s,n,r,e[i+15],14,-660478335),r=x(r,o,s,n,e[i+4],20,-405537848),n=x(n,r,o,s,e[i+9],5,568446438),s=x(s,n,r,o,e[i+14],9,-1019803690),o=x(o,s,n,r,e[i+3],14,-187363961),r=x(r,o,s,n,e[i+8],20,1163531501),n=x(n,r,o,s,e[i+13],5,-1444681467),s=x(s,n,r,o,e[i+2],9,-51403784),o=x(o,s,n,r,e[i+7],14,1735328473),n=_(n,r=x(r,o,s,n,e[i+12],20,-1926607734),o,s,e[i+5],4,-378558),s=_(s,n,r,o,e[i+8],11,-2022574463),o=_(o,s,n,r,e[i+11],16,1839030562),r=_(r,o,s,n,e[i+14],23,-35309556),n=_(n,r,o,s,e[i+1],4,-1530992060),s=_(s,n,r,o,e[i+4],11,1272893353),o=_(o,s,n,r,e[i+7],16,-155497632),r=_(r,o,s,n,e[i+10],23,-1094730640),n=_(n,r,o,s,e[i+13],4,681279174),s=_(s,n,r,o,e[i],11,-358537222),o=_(o,s,n,r,e[i+3],16,-722521979),r=_(r,o,s,n,e[i+6],23,76029189),n=_(n,r,o,s,e[i+9],4,-640364487),s=_(s,n,r,o,e[i+12],11,-421815835),o=_(o,s,n,r,e[i+15],16,530742520),n=I(n,r=_(r,o,s,n,e[i+2],23,-995338651),o,s,e[i],6,-198630844),s=I(s,n,r,o,e[i+7],10,1126891415),o=I(o,s,n,r,e[i+14],15,-1416354905),r=I(r,o,s,n,e[i+5],21,-57434055),n=I(n,r,o,s,e[i+12],6,1700485571),s=I(s,n,r,o,e[i+3],10,-1894986606),o=I(o,s,n,r,e[i+10],15,-1051523),r=I(r,o,s,n,e[i+1],21,-2054922799),n=I(n,r,o,s,e[i+8],6,1873313359),s=I(s,n,r,o,e[i+15],10,-30611744),o=I(o,s,n,r,e[i+6],15,-1560198380),r=I(r,o,s,n,e[i+13],21,1309151649),n=I(n,r,o,s,e[i+4],6,-145523070),s=I(s,n,r,o,e[i+11],10,-1120210379),o=I(o,s,n,r,e[i+2],15,718787259),r=I(r,o,s,n,e[i+9],21,-343485551),n=O(n,a),r=O(r,c),o=O(o,d),s=O(s,u)}return[n,r,o,s]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(b(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))};const P=g("v3",48,S);const T=function(e,t,n){var r=(e=e||{}).random||(e.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return u(r)};function A(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function C(e,t){return e<<t|e>>>32-t}const k=function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var o=0;o<r.length;++o)e.push(r.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var s=e.length/4+2,i=Math.ceil(s/16),a=new Array(i),c=0;c<i;++c){for(var d=new Uint32Array(16),u=0;u<16;++u)d[u]=e[64*c+4*u]<<24|e[64*c+4*u+1]<<16|e[64*c+4*u+2]<<8|e[64*c+4*u+3];a[c]=d}a[i-1][14]=8*(e.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(e.length-1)&4294967295;for(var l=0;l<i;++l){for(var p=new Uint32Array(80),h=0;h<16;++h)p[h]=a[l][h];for(var f=16;f<80;++f)p[f]=C(p[f-3]^p[f-8]^p[f-14]^p[f-16],1);for(var m=n[0],y=n[1],g=n[2],b=n[3],O=n[4],v=0;v<80;++v){var w=Math.floor(v/20),x=C(m,5)+A(w,y,g,b)+O+t[w]+p[v]>>>0;O=b,b=g,g=C(y,30)>>>0,y=m,m=x}n[0]=n[0]+m>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+O>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]};const E=g("v5",80,k),j="00000000-0000-0000-0000-000000000000";const R=function(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},2417:(e,t,n)=>{e.exports=n(7720)("./src/collaboration-core.js")},2704:(e,t,n)=>{e.exports=n(7079)("./src/core.js")},1492:(e,t,n)=>{e.exports=n(7079)("./src/engine.js")},9273:(e,t,n)=>{e.exports=n(7079)("./src/ui.js")},2209:(e,t,n)=>{e.exports=n(7079)("./src/utils.js")},7720:e=>{"use strict";e.exports=CKEditor5.collaborationDll},7079:e=>{"use strict";e.exports=CKEditor5.dll},1053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const r=n(1669);function o(e,t){if(!e)return e;if((0,r.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=o(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r],t));return n}return e}function s(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=s(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=s(e[n],t));return e}t.deconstructPacket=function(e){const t=[],n=e.data,r=e;return r.data=o(n,t),r.attachments=t.length,{packet:r,buffers:t}},t.reconstructPacket=function(e,t){return e.data=s(e.data,t),delete e.attachments,e}},9881:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const r=n(5867),o=n(1053),s=n(1669),i=(0,n(5579).default)("socket.io-parser");var a;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(a=t.PacketType||(t.PacketType={}));t.Encoder=class{constructor(e){this.replacer=e}encode(e){return i("encoding packet %j",e),e.type!==a.EVENT&&e.type!==a.ACK||!(0,s.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==a.BINARY_EVENT&&e.type!==a.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),i("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,o.deconstructPacket)(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};class c extends r.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===a.BINARY_EVENT;n||t.type===a.BINARY_ACK?(t.type=n?a.EVENT:a.ACK,this.reconstructor=new d(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,s.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===a[n.type])throw new Error("unknown packet type "+n.type);if(n.type===a.BINARY_EVENT||n.type===a.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!c.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return i("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return"object"==typeof t;case a.DISCONNECT:return void 0===t;case a.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&("string"==typeof t[0]||"number"==typeof t[0]);case a.ACK:case a.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}t.Decoder=c;class d{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,o.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},1669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const n="function"==typeof ArrayBuffer,r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,o=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),i="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);function a(e){return n&&(e instanceof ArrayBuffer||r(e))||s&&e instanceof Blob||i&&e instanceof File}t.isBinary=a,t.hasBinary=function e(t,n){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if(a(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0;return!1}},6051:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCORS=void 0;let n=!1;try{n="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}t.hasCORS=n},8573:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0,t.encode=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},t.decode=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}},8736:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const n=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parse=function(e){const t=e,o=e.indexOf("["),s=e.indexOf("]");-1!=o&&-1!=s&&(e=e.substring(0,o)+e.substring(o,s).replace(/:/g,";")+e.substring(s,e.length));let i=n.exec(e||""),a={},c=14;for(;c--;)a[r[c]]=i[c]||"";return-1!=o&&-1!=s&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,a.path),a.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,a.query),a}},7058:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.yeast=t.decode=t.encode=void 0;const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),r=64,o={};let s,i=0,a=0;function c(e){let t="";do{t=n[e%r]+t,e=Math.floor(e/r)}while(e>0);return t}for(t.encode=c,t.decode=function(e){let t=0;for(a=0;a<e.length;a++)t=t*r+o[e.charAt(a)];return t},t.yeast=function(){const e=c(+new Date);return e!==s?(i=0,s=e):e+"."+c(i++)};a<r;a++)o[n[a]]=a},66:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalThisShim=void 0,t.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},5769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=t.parse=t.installTimerFunctions=t.transports=t.Transport=t.protocol=t.Socket=void 0;const r=n(1187);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return r.Socket}}),t.protocol=r.Socket.protocol;var o=n(4291);Object.defineProperty(t,"Transport",{enumerable:!0,get:function(){return o.Transport}});var s=n(6449);Object.defineProperty(t,"transports",{enumerable:!0,get:function(){return s.transports}});var i=n(102);Object.defineProperty(t,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var a=n(8736);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.parse}});var c=n(9233);Object.defineProperty(t,"nextTick",{enumerable:!0,get:function(){return c.nextTick}})},1187:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const o=n(6449),s=n(102),i=n(8573),a=n(8736),c=r(n(5579)),d=n(5867),u=n(4755),l=(0,c.default)("engine.io-client:socket");class p extends d.Emitter{constructor(e,t={}){super(),this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=(0,a.parse)(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=(0,a.parse)(t.host).host),(0,s.installTimerFunctions)(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=(0,i.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){l('creating transport "%s"',e);const t=Object.assign({},this.opts.query);t.EIO=u.protocol,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return l("options: %j",n),new o.transports[e](n)}open(){let e;if(this.opts.rememberUpgrade&&p.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return l("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){l("setting transport %s",e.name),this.transport&&(l("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){l('probing transport "%s"',e);let t=this.createTransport(e),n=!1;p.priorWebsocketSuccess=!1;const r=()=>{n||(l('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(r=>{if(!n)if("pong"===r.type&&"probe"===r.data){if(l('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;p.priorWebsocketSuccess="websocket"===t.name,l('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{n||"closed"!==this.readyState&&(l("changing transport and sending upgrade packet"),d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{l('probe transport "%s" failed',e);const n=new Error("probe error");n.transport=t.name,this.emitReserved("upgradeError",n)}})))};function o(){n||(n=!0,d(),t.close(),t=null)}const s=n=>{const r=new Error("probe error: "+n);r.transport=t.name,o(),l('probe transport "%s" failed because of error: %s',e,n),this.emitReserved("upgradeError",r)};function i(){s("transport closed")}function a(){s("socket closed")}function c(e){t&&e.name!==t.name&&(l('"%s" works - aborting "%s"',e.name,t.name),o())}const d=()=>{t.removeListener("open",r),t.removeListener("error",s),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",s),t.once("close",i),this.once("close",a),this.once("upgrading",c),t.open()}onOpen(){if(l("socket open"),this.readyState="open",p.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){l("starting upgrade probes");let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(l('socket receive: type "%s", data "%s"',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}else l('packet received with socket readyState "%s"',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();l("flushing %d packets in socket",e.length),this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=(0,s.byteLength)(n)),t>0&&e>this.maxPayload)return l("only send %d out of %d packets",t,this.writeBuffer.length),this.writeBuffer.slice(0,t);e+=2}return l("payload size is %d (max: %d)",e,this.maxPayload),this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),l("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){l("socket error %j",e),p.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(l('socket close with reason: "%s"',e),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}t.Socket=p,p.protocol=u.protocol},4291:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=void 0;const o=n(4755),s=n(5867),i=n(102),a=(0,r(n(5579)).default)("engine.io-client:transport");class c extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class d extends s.Emitter{constructor(e){super(),this.writable=!1,(0,i.installTimerFunctions)(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new c(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState?this.write(e):a("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=(0,o.decodePacket)(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}}t.Transport=d},6449:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transports=void 0;const r=n(3737),o=n(4199);t.transports={websocket:o.WS,polling:r.Polling}},3737:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=t.Polling=void 0;const o=n(4291),s=r(n(5579)),i=n(7058),a=n(8573),c=n(4755),d=n(4582),u=n(5867),l=n(102),p=n(66),h=(0,s.default)("engine.io-client:polling");function f(){}const m=null!=new d.XHR({xdomain:!1}).responseType;class y extends o.Transport{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=m&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{h("paused"),this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(h("we are currently polling - waiting to pause"),e++,this.once("pollComplete",(function(){h("pre-pause polling complete"),--e||t()}))),this.writable||(h("we are currently writing - waiting to pause"),e++,this.once("drain",(function(){h("pre-pause writing complete"),--e||t()})))}else t()}poll(){h("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){h("polling got data %s",e);(0,c.decodePayload)(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this.poll():h('ignoring poll - transport state "%s"',this.readyState))}doClose(){const e=()=>{h("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(h("transport open - closing"),e()):(h("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,(0,c.encodePayload)(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,i.yeast)()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=(0,a.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new g(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){h("xhr poll");const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}t.Polling=y;class g extends u.Emitter{constructor(e,t){super(),(0,l.installTimerFunctions)(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=(0,l.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new d.XHR(e);try{h("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},h("xhr data %s",this.data),t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=g.requestsCount++,g.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=f,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete g.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(t.Request=g,g.requestsCount=0,g.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",b);else if("function"==typeof addEventListener){const e="onpagehide"in p.globalThisShim?"pagehide":"unload";addEventListener(e,b,!1)}function b(){for(let e in g.requests)g.requests.hasOwnProperty(e)&&g.requests[e].abort()}},9233:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBinaryType=t.usingBrowserWebSocket=t.WebSocket=t.nextTick=void 0;const r=n(66);t.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),t.WebSocket=r.globalThisShim.WebSocket||r.globalThisShim.MozWebSocket,t.usingBrowserWebSocket=!0,t.defaultBinaryType="arraybuffer"},4199:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WS=void 0;const o=n(4291),s=n(8573),i=n(7058),a=n(102),c=n(9233),d=r(n(5579)),u=n(4755),l=(0,d.default)("engine.io-client:websocket"),p="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class h extends o.Transport{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=p?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=c.usingBrowserWebSocket&&!p?t?new c.WebSocket(e,t):new c.WebSocket(e):new c.WebSocket(e,t,n)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||c.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;(0,u.encodePacket)(n,this.supportsBinary,(e=>{const t={};if(!c.usingBrowserWebSocket&&(n.options&&(t.compress=n.options.compress),this.opts.perMessageDeflate)){("string"==typeof e?Buffer.byteLength(e):e.length)<this.opts.perMessageDeflate.threshold&&(t.compress=!1)}try{c.usingBrowserWebSocket?this.ws.send(e):this.ws.send(e,t)}catch(e){l("websocket closed before onclose event")}r&&(0,c.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,i.yeast)()),this.supportsBinary||(e.b64=1);const r=(0,s.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!c.WebSocket}}t.WS=h},4582:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHR=void 0;const r=n(6051),o=n(66);t.XHR=function(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||r.hasCORS))return new XMLHttpRequest}catch(e){}if(!t)try{return new(o.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}},102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.byteLength=t.installTimerFunctions=t.pick=void 0;const r=n(66);t.pick=function(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})};const o=r.globalThisShim.setTimeout,s=r.globalThisShim.clearTimeout;t.installTimerFunctions=function(e,t){t.useNativeTimers?(e.setTimeoutFn=o.bind(r.globalThisShim),e.clearTimeoutFn=s.bind(r.globalThisShim)):(e.setTimeoutFn=r.globalThisShim.setTimeout.bind(r.globalThisShim),e.clearTimeoutFn=r.globalThisShim.clearTimeout.bind(r.globalThisShim))};t.byteLength=function(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}},9782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_PACKET=t.PACKET_TYPES_REVERSE=t.PACKET_TYPES=void 0;const n=Object.create(null);t.PACKET_TYPES=n,n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";const r=Object.create(null);t.PACKET_TYPES_REVERSE=r,Object.keys(n).forEach((e=>{r[n[e]]=e}));t.ERROR_PACKET={type:"error",data:"parser error"}},6502:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)r[n.charCodeAt(e)]=e;t.encode=e=>{let t,r=new Uint8Array(e),o=r.length,s="";for(t=0;t<o;t+=3)s+=n[r[t]>>2],s+=n[(3&r[t])<<4|r[t+1]>>4],s+=n[(15&r[t+1])<<2|r[t+2]>>6],s+=n[63&r[t+2]];return o%3==2?s=s.substring(0,s.length-1)+"=":o%3==1&&(s=s.substring(0,s.length-2)+"=="),s};t.decode=e=>{let t,n,o,s,i,a=.75*e.length,c=e.length,d=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const u=new ArrayBuffer(a),l=new Uint8Array(u);for(t=0;t<c;t+=4)n=r[e.charCodeAt(t)],o=r[e.charCodeAt(t+1)],s=r[e.charCodeAt(t+2)],i=r[e.charCodeAt(t+3)],l[d++]=n<<2|o>>4,l[d++]=(15&o)<<4|s>>2,l[d++]=(3&s)<<6|63&i;return u}},3108:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9782),o=n(6502),s="function"==typeof ArrayBuffer,i=(e,t)=>{if(s){const n=(0,o.decode)(e);return a(n,t)}return{base64:!0,data:e}},a=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e;t.default=(e,t)=>{if("string"!=typeof e)return{type:"message",data:a(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:i(e.substring(1),t)};return r.PACKET_TYPES_REVERSE[n]?e.length>1?{type:r.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:r.PACKET_TYPES_REVERSE[n]}:r.ERROR_PACKET}},4895:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9782),o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),s="function"==typeof ArrayBuffer,i=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};t.default=({type:e,data:t},n,a)=>{return o&&t instanceof Blob?n?a(t):i(t,a):s&&(t instanceof ArrayBuffer||(c=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(c):c&&c.buffer instanceof ArrayBuffer))?n?a(t):i(new Blob([t]),a):a(r.PACKET_TYPES[e]+(t||""));var c}},4755:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePayload=t.decodePacket=t.encodePayload=t.encodePacket=t.protocol=void 0;const r=n(4895);t.encodePacket=r.default;const o=n(3108);t.decodePacket=o.default;const s=String.fromCharCode(30);t.encodePayload=(e,t)=>{const n=e.length,o=new Array(n);let i=0;e.forEach(((e,a)=>{(0,r.default)(e,!1,(e=>{o[a]=e,++i===n&&t(o.join(s))}))}))};t.decodePayload=(e,t)=>{const n=e.split(s),r=[];for(let e=0;e<n.length;e++){const s=(0,o.default)(n[e],t);if(r.push(s),"error"===s.type)break}return r},t.protocol=4},1067:(e,t)=>{"use strict";function n(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Object.defineProperty(t,"__esModule",{value:!0}),t.Backoff=void 0,t.Backoff=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},8623:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const o=n(4197),s=n(3288);Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return s.Manager}});const i=n(3232);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return i.Socket}});const a=r(n(5579)).default("socket.io-client"),c={};function d(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};const n=o.url(e,t.path||"/socket.io"),r=n.source,i=n.id,d=n.path,u=c[i]&&d in c[i].nsps;let l;return t.forceNew||t["force new connection"]||!1===t.multiplex||u?(a("ignoring socket cache for %s",r),l=new s.Manager(r,t)):(c[i]||(a("new io instance for %s",r),c[i]=new s.Manager(r,t)),l=c[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}t.io=d,t.connect=d,t.default=d,Object.assign(d,{Manager:s.Manager,Socket:i.Socket,io:d,connect:d});var u=n(170);Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return u.protocol}}),e.exports=d},3288:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Manager=void 0;const a=n(5769),c=n(3232),d=s(n(170)),u=n(6263),l=n(1067),p=n(5867),h=i(n(5579)).default("socket.io-client:manager");class f extends p.Emitter{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,a.installTimerFunctions(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new l.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||d;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(h("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;h("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=u.on(t,"open",(function(){n.onopen(),e&&e()})),o=u.on(t,"error",(t=>{h("error"),n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;h("connect attempt will timeout after %d",e),0===e&&r();const n=this.setTimeoutFn((()=>{h("connect attempt timed out after %d",e),r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){h("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(u.on(e,"ping",this.onping.bind(this)),u.on(e,"data",this.ondata.bind(this)),u.on(e,"error",this.onerror.bind(this)),u.on(e,"close",this.onclose.bind(this)),u.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){a.nextTick((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){h("error",e),this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new c.Socket(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return void h("socket %s is still active, skipping close",e)}this._close()}_packet(e){h("writing packet %j",e);const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){h("cleanup"),this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){h("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){h("closed due to %s",e),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)h("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();h("will wait %dms before reconnect attempt",t),this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(h("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(h("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):(h("reconnect success"),e.onreconnect())})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}t.Manager=f},6263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.on=void 0,t.on=function(e,t,n){return e.on(t,n),function(){e.off(t,n)}}},3232:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const o=n(170),s=n(6263),i=n(5867),a=r(n(5579)).default("socket.io-client:socket"),c=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class d extends i.Emitter{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[s.on(e,"open",this.onopen.bind(this)),s.on(e,"packet",this.onpacket.bind(this)),s.on(e,"error",this.onerror.bind(this)),s.on(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(c.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:o.PacketType.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++;a("emitting packet with ack id %d",e);const r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)?a("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const o=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&(a("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(t,1));a("event with ack id %d has timed out after %d ms",e,r),t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,o)=>{t.push(((e,t)=>n?e?o(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(a("packet [%d] is discarded after %d tries",n.id,n.tryCount),this._queue.shift(),t&&t(e)):(a("packet [%d] was successfully sent",n.id),this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(a("draining queue"),!this.connected||0===this._queue.length)return;const t=this._queue[0];!t.pending||e?(t.pending=!0,t.tryCount++,a("sending packet [%d] (try n°%d)",t.id,t.tryCount),this.flags=t.flags,this.emit.apply(this,t.args)):a("packet [%d] has already been sent and is waiting for an ack",t.id)}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:o.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){a("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case o.PacketType.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case o.PacketType.EVENT:case o.PacketType.BINARY_EVENT:this.onevent(e);break;case o.PacketType.ACK:case o.PacketType.BINARY_ACK:this.onack(e);break;case o.PacketType.DISCONNECT:this.ondisconnect();break;case o.PacketType.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,a("sending ack %j",r),t.packet({type:o.PacketType.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t?(a("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):a("bad ack %s",e.id)}onconnect(e,t){a("socket connected with id %s",e),this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:o.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}t.Socket=d},4197:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.url=void 0;const o=n(5769),s=r(n(5579)).default("socket.io-client:url");t.url=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(s("protocol-less url %s",e),e=void 0!==n?n.protocol+"//"+e:"https://"+e),s("parse %s",e),r=o.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}},2830:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const r=n(3980);function o(e,t){if(!e)return e;if((0,r.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=o(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r],t));return n}return e}function s(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=s(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=s(e[n],t));return e}t.deconstructPacket=function(e){const t=[],n=e.data,r=e;return r.data=o(n,t),r.attachments=t.length,{packet:r,buffers:t}},t.reconstructPacket=function(e,t){return e.data=s(e.data,t),delete e.attachments,e}},170:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const r=n(5867),o=n(2830),s=n(3980),i=(0,n(5579).default)("socket.io-parser"),a=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var c;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(c=t.PacketType||(t.PacketType={}));function d(e){return"[object Object]"===Object.prototype.toString.call(e)}t.Encoder=class{constructor(e){this.replacer=e}encode(e){return i("encoding packet %j",e),e.type!==c.EVENT&&e.type!==c.ACK||!(0,s.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==c.BINARY_EVENT&&e.type!==c.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),i("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,o.deconstructPacket)(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};class u extends r.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===c.BINARY_EVENT;n||t.type===c.BINARY_ACK?(t.type=n?c.EVENT:c.ACK,this.reconstructor=new l(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,s.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===c[n.type])throw new Error("unknown packet type "+n.type);if(n.type===c.BINARY_EVENT||n.type===c.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!u.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return i("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case c.CONNECT:return d(t);case c.DISCONNECT:return void 0===t;case c.CONNECT_ERROR:return"string"==typeof t||d(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===a.indexOf(t[0]));case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}t.Decoder=u;class l{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,o.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},3980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const n="function"==typeof ArrayBuffer,r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,o=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),i="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);function a(e){return n&&(e instanceof ArrayBuffer||r(e))||s&&e instanceof Blob||i&&e instanceof File}t.isBinary=a,t.hasBinary=function e(t,n){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if(a(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0;return!1}},5867:(e,t,n)=>{"use strict";function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}n.r(t),n.d(t,{Emitter:()=>r}),r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},r.prototype.emitReserved=r.prototype.emit,r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>po,CloudServicesRevisionHistoryAdapter:()=>Vo,CloudServicesTrackChangesAdapter:()=>vo,PresenceList:()=>Us,RealTimeCollaborationClient:()=>Zr,RealTimeCollaborativeComments:()=>To,RealTimeCollaborativeEditing:()=>io,RealTimeCollaborativeRevisionHistory:()=>Yo,RealTimeCollaborativeTrackChanges:()=>jo});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{AttributeOperation:()=>R,Element:()=>L,InsertOperation:()=>D,MarkerOperation:()=>M,MergeOperation:()=>N,MoveOperation:()=>V,Position:()=>G,Range:()=>Y,RenameOperation:()=>B,RootAttributeOperation:()=>U,RootOperation:()=>J,SplitOperation:()=>q,default:()=>j});var t=__webpack_require__(2704),n=__webpack_require__(2209),r=__webpack_require__(9273),o=__webpack_require__(1492),s=__webpack_require__(3007);const i=["addToReconnectionStack","requires","get","CONNECTING","plugins","stopListening","CloudServices","config","connection","offline","pluginName","real-time-collaboration","state","online","from","websocketgateway-missing-token","_isBrowserOffline","isInReconnectionStack","all","reconnect","function","websocketgateway-invalid-plugin-interface","cloudservices-init","create","Connected users limit exceeded","The limit of maximum concurrent connections that the collaboration server can handle has been reached. Try opening the document again in a few minutes. Please contact your system administrator if the problem persists.","context","catch","_reconnectionStack","listenTo","disconnect","_domEmitter","init","define","cloudServices.connectionTimeout","then","CONNECTED","_reconnect","websocketgateway-plugin-already-registered","bind","DISCONNECTED","WebSocketGateway","error","add","initialReconnectionInterval","set","connected","delete","limitExceeded","token","_shouldPluginsReconnect","destroy","change:me","cloudservices-reconnection-error","webSocketUrl","code","showWarning"];var a,c;a=i,c=393,function(e){for(;--e;)a.push(a.shift())}(++c);const d=function(e,t){return i[e-=0]};class u extends t.ContextPlugin{static get[d("0x7")](){return[d("0xc"),r.Notification]}static get[d("0x10")](){return d("0x2f")}constructor(e){super(e),this.set("state",s.WEB_SOCKET_GATEWAY_STATES[d("0x2a")]),this[d("0x33")]("_isBrowserOffline",!1),this[d("0x22")]=new Set,this[d("0x38")]=!1,this._domEmitter=Object[d("0x1d")](n.DomEmitterMixin)}[d("0x26")](){const e=this[d("0x20")],t=e[d("0xa")][d("0x8")](d("0xc")),o=e.plugins[d("0x8")](r.Notification);if(!t.token)throw new n.CKEditorError(d("0x15"),this);if(!t.webSocketUrl)throw new n.CKEditorError("websocketgateway-missing-websocket-url",this);return this[d("0x25")][d("0x23")](window,d("0xf"),(()=>this._isBrowserOffline=!0)),this[d("0x25")][d("0x23")](window,d("0x13"),(()=>this[d("0x16")]=!1)),this.context[d("0xd")].define(d("0x28"),10),this[d("0x20")][d("0xd")][d("0x27")]("cloudServices.requestTimeout",20),u[d("0x2f")].connect(t[d("0x37")],t[d("0x3")],{timeout:1e3*this[d("0x20")].config[d("0x8")](d("0x28")),requestTimeout:1e3*this[d("0x20")][d("0xd")][d("0x8")]("cloudServices.requestTimeout")})[d("0x29")]((e=>{if(this[d("0xe")]=e,this[d("0x2d")](d("0x12")).to(e,"state",this,d("0x16"),((e,t)=>(d("0x34")!==e&&(this[d("0x38")]=!0),t||e!==s.WEB_SOCKET_GATEWAY_STATES[d("0x2a")]?s.WEB_SOCKET_GATEWAY_STATES[d("0x2e")]:this[d("0x12")]==s.WEB_SOCKET_GATEWAY_STATES[d("0x2e")]&&this[d("0x38")]?(this._shouldPluginsReconnect=!1,this[d("0x2b")](),s.WEB_SOCKET_GATEWAY_STATES[d("0x9")]):s.WEB_SOCKET_GATEWAY_STATES[d("0x2a")]))),this[d("0xe")].on(d("0x30"),((e,t)=>{if(d("0x36")!==t[d("0x4")])throw console[d("0x30")](t),new n.CKEditorError(d("0x1c"),null,{originalError:t});o[d("0x5")](d("0x1f"),{title:d("0x1e"),namespace:d("0x11")})})),!e.me)return new Promise((t=>e.on(d("0x1"),t)))})).catch((e=>{throw console[d("0x30")](e),new n.CKEditorError("cloudservices-init",null,{originalError:e})}))}[d("0x6")](e){if(d("0x1a")!=typeof e[d("0x19")])throw new n.CKEditorError(d("0x1b"),this);if(this[d("0x17")](e))throw new n.CKEditorError(d("0x2c"),this,{name:e.constructor.pluginName});this._reconnectionStack[d("0x31")](e)}removeFromReconnectionStack(e){this[d("0x22")][d("0x35")](e)}[d("0x17")](e){return this[d("0x22")].has(e)}[d("0x2b")](){return this.connection.reconnect()[d("0x29")]((()=>Promise[d("0x18")](Array[d("0x14")](this[d("0x22")],(e=>e.reconnect())))))[d("0x29")]((()=>this.state=s.WEB_SOCKET_GATEWAY_STATES.CONNECTED))[d("0x21")]((e=>{throw console[d("0x30")](e),new n.CKEditorError(d("0x2"),this[d("0x20")])}))}[d("0x0")](){this.connection&&this.connection[d("0x24")](),this[d("0x12")]=s.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED,this[d("0x25")][d("0xb")](),super.destroy()}}u.WebSocketGateway=s.WebSocketGateway,u[d("0x32")]=1e3;var l=__webpack_require__(2417);const p=["mySessionId","user","context","getUserSessions","listenTo","_handleSessionRemove","pluginName","sessionId","channelSessions","values","getUserRole","has","add","_registeredSessions","_users","getUserBySessionId","set","allConnectedUsers","connected","register","state","get","remove","delete","sessionAdd:","plugins","getUser","requires","Sessions","sessions-unregister-not-exist","connection","init","defineMe","size","stopListening","channelConnectedUsers","change:state","_handleSessionAdd","addUser","forEach","_uniqueUsersCount","clear"];var h,f;h=p,f=448,function(e){for(;--e;)h.push(h.shift())}(++f);const m=function(e,t){return p[e-=0]};class y extends t.ContextPlugin{static get[m("0x14")](){return m("0x0")}static get[m("0x29")](){return[u,l.Users]}constructor(e){super(e),this[m("0x16")]=new Map,this[m("0x7")]=new Map,this[m("0x1f")]=new n.Collection,this[m("0x1b")]=new Map,this[m("0xc")]=0,this._users=this[m("0x10")][m("0x27")][m("0x23")](l.Users)}[m("0x3")](){const e=this[m("0x10")].plugins[m("0x23")](u);this[m("0x12")](e,m("0x8"),((e,t,n)=>{if(m("0x20")!==n)this.channelSessions[m("0xb")]((e=>e.clear())),this.channelConnectedUsers[m("0xb")]((e=>e[m("0xd")]())),this.allConnectedUsers[m("0xd")]();else for(const[e,t]of this[m("0x1b")])for(const n of t)this._handleSessionAdd(e,n)})),this._createUser(e[m("0x2")].me,!0)}[m("0x21")](e,t){if(this[m("0x1b")][m("0x19")](e))throw new n.CKEditorError("sessions-register-already-registered",null,{channelId:e});this[m("0x1b")].set(e,t),this.channelSessions[m("0x1e")](e,new n.Collection),this.channelConnectedUsers[m("0x1e")](e,new n.Collection),this[m("0x12")](t,m("0x1a"),((t,n)=>this[m("0x9")](e,n))),this[m("0x12")](t,m("0x24"),((t,n)=>this[m("0x13")](e,n)));for(const n of t)this[m("0x9")](e,n)}unregister(e){if(!this[m("0x1b")].has(e))throw new n.CKEditorError(m("0x1"),null,{channelId:e});const t=this._registeredSessions.get(e);this[m("0x6")](t);for(const n of t)m("0x20")===this[m("0x10")][m("0x27")][m("0x23")](u).state&&this[m("0x13")](e,n);this[m("0x1b")][m("0x25")](e),this[m("0x16")][m("0x25")](e),this[m("0x7")].delete(e)}get[m("0xe")](){return this[m("0x10")][m("0x27")][m("0x23")](u).connection[m("0x15")]}[m("0x1d")](e){for(const t of this[m("0x16")][m("0x17")]())for(const n of t)if(n.id===e)return n[m("0xf")]}getUserSessions(e,t){const n=t?[this[m("0x16")][m("0x23")](t)]:this.channelSessions[m("0x17")](),r=new Set;for(const t of n)for(const n of t)n.user.id===e.id&&r[m("0x1a")](n.id);return r}[m("0x18")](e){for(const t of this[m("0x16")][m("0x17")]())for(const n of t)if(n[m("0xf")]===e)return n.role}[m("0x9")](e,t){if(m("0x20")!==this[m("0x10")][m("0x27")].get(u)[m("0x22")])return;const n=t[m("0xf")],r=this[m("0x1c")][m("0x28")](n.id)||this._createUser(n),o=Object.assign({},t,{user:r});this.channelSessions[m("0x23")](e)[m("0x1a")](o);const s=this[m("0x7")][m("0x23")](e);s.has(r.id)||s[m("0x1a")](r),this[m("0x1f")][m("0x19")](r.id)||this.allConnectedUsers[m("0x1a")](r),this.fire(m("0x26")+e,{channelId:e,session:o})}[m("0x13")](e,t){if(m("0x20")!==this.context[m("0x27")][m("0x23")](u)[m("0x22")])return;const n=this[m("0x7")][m("0x23")](e),r=t[m("0xf")];r.id&&(this[m("0x16")].get(e)[m("0x24")](t.id),n.has(r.id)&&!this[m("0x11")](r,e)[m("0x5")]&&n[m("0x24")](r.id),this[m("0x1f")].get(r.id)&&!this[m("0x11")](r)[m("0x5")]&&this[m("0x1f")].remove(r.id))}_createUser(e,t){const n=this._users[m("0xa")](e);return t&&this._users[m("0x4")](e.id),n.orderNumber=this[m("0xc")]++,n}}var g=__webpack_require__(7594),b=__webpack_require__.n(g),O=__webpack_require__(2521),v={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};b()(O.Z,v);O.Z.locals;const w=["startsWith","delete","tableCell","nodeAfter","data-session-id","userPositionMarker","commands","for","hasDomSelection","init","hasContent","getNearestSelectionRange","user:range:","isLimit","editingDowncast","element","has","setCustomProperty","model","name","highest","removeMarker","checkChild","updateMarker","isInline","reconvertMarker","conversion","$graveyard","parent","markers","isObject","getRange","markerName","type","getStart","span","schema","get","split","isSimilar","oldRange","getPositions","user:position:","$text","size","requires","getUserBySessionId","editor","mySessionId","createUIElement","change:range","user:range","markerToHighlight","createRange","batch","orderNumber","afterInit","getCustomProperty","clear","editing","plugins","getAttribute","deletionPosition","_createdBatches","enqueueChange","root","change","getSelectionClass","document","addMarker","end","undo","start","innerHTML","applyOperation","rootName","detach","user:"];var x,_;x=w,_=242,function(e){for(;--e;)x.push(x.shift())}(++_);const I=function(e,t){return w[e-=0]};class S extends t.Plugin{static get[I("0x25")](){return[y]}static get pluginName(){return"UserMarkers"}[I("0x1")](){const e=this[I("0x27")],t=e[I("0x34")].get(y);e[I("0x12")][I("0x4d")](I("0x6")).markerToElement({model:"user:position",view:(n,{writer:r})=>function(e,t,n,r){const o=e[I("0x18")].split(":")[2],s=n[I("0x26")](o);if(!s||o===n.mySessionId)return;if(!r.model[I("0x1c")][I("0xe")](e.markerRange[I("0x40")],"$text"))return;const i={class:"ck-user__marker "+s.color.getMarkerClass(),"data-name":s[I("0xb")],"data-session-id":o},a=r[I("0xa")][I("0x15")].get(e[I("0x18")])[I("0x1a")](),c=a[I("0x49")],d=r[I("0xa")].schema;if(c&&d[I("0x16")](c)&&d[I("0x10")](c)&&!r[I("0xa")][I("0x15")][I("0x1d")](I("0x4")+o)[I("0x17")]().isCollapsed)return;const u=a[I("0x14")];return r[I("0xa")][I("0x1c")][I("0x5")](u)&&!r[I("0xa")][I("0x2")](u)&&(i.contenteditable=!1),function(e,t){const n=e[I("0x29")](I("0x1b"),t);return e[I("0x9")](I("0x4b"),!0,n),n.render=function(e){const t=this.toDomElement(e);return t[I("0x41")]='⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>⁠',t},n[I("0x1f")]=function(e){return!(!this[I("0x31")]("userPositionMarker")||!e.getCustomProperty(I("0x4b"))||this.getAttribute("data-session-id")!=e[I("0x35")](I("0x4a")))},n}(t,i)}(n,r,t,e)}),e[I("0x12")].for(I("0x6"))[I("0x2c")]({model:I("0x2b"),view:e=>function(e,t){const n=e[I("0x18")][I("0x1e")](":")[2];if(n===t[I("0x28")])return null;const r=t[I("0x26")](n);return r?{id:n,classes:["ck-user__selection",r.color[I("0x3b")]()],attributes:{"data-session-id":n},priority:2e3+r[I("0x2f")]}:{id:n,classes:[]}}(e,t)}),function(e){const t=e.model,n=new Map,r=e[I("0x34")][I("0x1d")](y);t[I("0x15")].on("update:user:range",((s,i,a,c)=>{if(!c&&n[I("0x1d")](i[I("0xb")]))return n[I("0x1d")](i[I("0xb")])[I("0x44")](),void n.delete(i[I("0xb")]);const d=i.name[I("0x1e")](":")[2];if(d===r[I("0x28")])return;const u=I("0x22")+d;t[I("0x15")].has(u)&&e[I("0x33")][I("0x11")](u),i.on(I("0x2a"),((e,r,s)=>{if("$graveyard"!=r[I("0x39")][I("0x43")]&&I("0x13")==i[I("0x17")]()[I("0x39")][I("0x43")]&&!n.has(i[I("0xb")])){const e=t[I("0x1c")].getNearestSelectionRange(s[I("0x36")]);if(e){const r=o.LiveRange.fromRange(e);n.set(i[I("0xb")],r),r.on("change:range",((e,o,s)=>{if(I("0x13")==r.root[I("0x43")]){const e=t.schema[I("0x3")](s[I("0x36")]);e?(r[I("0x40")]=e[I("0x40")],r.end=e.end):(n[I("0x47")](i[I("0xb")]),r[I("0x44")]())}}))}}}))})),t[I("0x3c")].on(I("0x3a"),(()=>{n[I("0x24")]>0&&t[I("0x38")]({isUndoable:!1},(e=>{for(const[r,o]of n)"$graveyard"==t[I("0x15")][I("0x1d")](r).getRange()[I("0x39")][I("0x43")]&&(P(r[I("0x1e")](":")[2],o.toRange(),t,e),o[I("0x44")]());n[I("0x32")]()}))}))}(e)}[I("0x30")](){const e=this.editor,t=e[I("0x4c")][I("0x1d")](I("0x3f"));t&&e[I("0xa")].on(I("0x42"),((n,r)=>{const o=r[0];if("marker"!=o[I("0x19")]||!o[I("0xb")][I("0x46")](I("0x45")))return;const s=o[I("0x2e")];t[I("0x37")][I("0x8")](s)&&(o.newRange=o[I("0x20")]?e.model.createRange(o[I("0x20")][I("0x40")],o[I("0x20")][I("0x3e")]):null)}),{priority:I("0xc")})}createUserMarkerOperations(){const e=this.editor,t=e.model[I("0x3c")],n=e[I("0x34")][I("0x1d")](y);e[I("0xa")][I("0x38")]({isUndoable:!1},(r=>{const o=I("0x4")+n[I("0x28")],s=I("0x22")+n.mySessionId,i=e[I("0xa")].markers.has(o);e[I("0x33")].view[I("0x0")]?P(n[I("0x28")],t.selection.getFirstRange(),e.model,r):i&&(r[I("0xd")](o),r[I("0xd")](s))}))}}function P(e,t,n,r){const o=I("0x4")+e,s=I("0x22")+e,i=t.getContainedElement();let a=t[I("0x40")];i&&i.is(I("0x7"),I("0x48"))&&(a=function(e,t){for(const n of e[I("0x21")]())if(t.schema.checkChild(n,I("0x23")))return n}(t,n),t=r[I("0x2d")](a));const c=r.createRange(a);n[I("0x15")][I("0x8")](o)?(r[I("0xf")](o,{range:t}),r[I("0xf")](s,{range:c})):(r[I("0x3d")](o,{range:t,usingOperation:!0}),r[I("0x3d")](s,{range:c,usingOperation:!0}))}function T(e,t,n){const r=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return r({string:"Sending data to the server.",id:"PENDING_ACTION_SENDING_DATA"});case"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.":return r("The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.");case"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.":return r("The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");case"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.":return r("The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");case"The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.":return r("The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.");case"Synchronization issue":return r("Synchronization issue");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return r({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}var A=__webpack_require__(6386);const C=A.Reader,k=A.Writer,E=A.util,j=A.roots.default||(A.roots.default={}),R=j.AttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.range=null,e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=k.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&j.Range.encode(e.range,t.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.AttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.range=j.Range.decode(e,e.uint32());break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.range&&e.hasOwnProperty("range")){let t=j.Range.verify(e.range);if(t)return"range."+t}return null!=e.key&&e.hasOwnProperty("key")&&!E.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!E.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!E.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof j.AttributeOperation)return e;let t=new j.AttributeOperation;if(null!=e.range){if("object"!=typeof e.range)throw TypeError(".AttributeOperation.range: object expected");t.range=j.Range.fromObject(e.range)}return null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.range=null,n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.range&&e.hasOwnProperty("range")&&(n.range=j.Range.toObject(e.range,t)),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/AttributeOperation"},e})(),D=j.InsertOperation=(()=>{function e(e){if(this.nodes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.nodes=E.emptyArray,e.prototype.shouldReceiveAttributes=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=k.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&j.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.nodes&&e.nodes.length)for(let n=0;n<e.nodes.length;++n)j.Element.encode(e.nodes[n],t.uint32(18).fork()).ldelim();return null!=e.shouldReceiveAttributes&&Object.hasOwnProperty.call(e,"shouldReceiveAttributes")&&t.uint32(24).bool(e.shouldReceiveAttributes),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.InsertOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=j.Position.decode(e,e.uint32());break;case 2:r.nodes&&r.nodes.length||(r.nodes=[]),r.nodes.push(j.Element.decode(e,e.uint32()));break;case 3:r.shouldReceiveAttributes=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=j.Position.verify(e.position);if(t)return"position."+t}if(null!=e.nodes&&e.hasOwnProperty("nodes")){if(!Array.isArray(e.nodes))return"nodes: array expected";for(let t=0;t<e.nodes.length;++t){let n=j.Element.verify(e.nodes[t]);if(n)return"nodes."+n}}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&"boolean"!=typeof e.shouldReceiveAttributes?"shouldReceiveAttributes: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof j.InsertOperation)return e;let t=new j.InsertOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".InsertOperation.position: object expected");t.position=j.Position.fromObject(e.position)}if(e.nodes){if(!Array.isArray(e.nodes))throw TypeError(".InsertOperation.nodes: array expected");t.nodes=[];for(let n=0;n<e.nodes.length;++n){if("object"!=typeof e.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");t.nodes[n]=j.Element.fromObject(e.nodes[n])}}return null!=e.shouldReceiveAttributes&&(t.shouldReceiveAttributes=Boolean(e.shouldReceiveAttributes)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.nodes=[]),t.defaults&&(n.position=null,n.shouldReceiveAttributes=!1,n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=j.Position.toObject(e.position,t)),e.nodes&&e.nodes.length){n.nodes=[];for(let r=0;r<e.nodes.length;++r)n.nodes[r]=j.Element.toObject(e.nodes[r],t)}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=e.shouldReceiveAttributes),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/InsertOperation"},e})(),M=j.MarkerOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.oldRange=null,e.prototype.newRange=null,e.prototype.affectsData=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=k.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.oldRange&&Object.hasOwnProperty.call(e,"oldRange")&&j.Range.encode(e.oldRange,t.uint32(18).fork()).ldelim(),null!=e.newRange&&Object.hasOwnProperty.call(e,"newRange")&&j.Range.encode(e.newRange,t.uint32(26).fork()).ldelim(),null!=e.affectsData&&Object.hasOwnProperty.call(e,"affectsData")&&t.uint32(32).bool(e.affectsData),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.MarkerOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.name=e.string();break;case 2:r.oldRange=j.Range.decode(e,e.uint32());break;case 3:r.newRange=j.Range.decode(e,e.uint32());break;case 4:r.affectsData=e.bool();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!E.isString(e.name))return"name: string expected";if(null!=e.oldRange&&e.hasOwnProperty("oldRange")){let t=j.Range.verify(e.oldRange);if(t)return"oldRange."+t}if(null!=e.newRange&&e.hasOwnProperty("newRange")){let t=j.Range.verify(e.newRange);if(t)return"newRange."+t}return null!=e.affectsData&&e.hasOwnProperty("affectsData")&&"boolean"!=typeof e.affectsData?"affectsData: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof j.MarkerOperation)return e;let t=new j.MarkerOperation;if(null!=e.name&&(t.name=String(e.name)),null!=e.oldRange){if("object"!=typeof e.oldRange)throw TypeError(".MarkerOperation.oldRange: object expected");t.oldRange=j.Range.fromObject(e.oldRange)}if(null!=e.newRange){if("object"!=typeof e.newRange)throw TypeError(".MarkerOperation.newRange: object expected");t.newRange=j.Range.fromObject(e.newRange)}return null!=e.affectsData&&(t.affectsData=Boolean(e.affectsData)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.name="",n.oldRange=null,n.newRange=null,n.affectsData=!1,n.wasUndone=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.oldRange&&e.hasOwnProperty("oldRange")&&(n.oldRange=j.Range.toObject(e.oldRange,t)),null!=e.newRange&&e.hasOwnProperty("newRange")&&(n.newRange=j.Range.toObject(e.newRange,t)),null!=e.affectsData&&e.hasOwnProperty("affectsData")&&(n.affectsData=e.affectsData),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MarkerOperation"},e})(),N=j.MergeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.targetPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=k.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&j.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&j.Position.encode(e.targetPosition,t.uint32(18).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&j.Position.encode(e.graveyardPosition,t.uint32(26).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(32).uint32(e.howMany),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.MergeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=j.Position.decode(e,e.uint32());break;case 2:r.targetPosition=j.Position.decode(e,e.uint32());break;case 3:r.graveyardPosition=j.Position.decode(e,e.uint32());break;case 4:r.howMany=e.uint32();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=j.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=j.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=j.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}return null!=e.howMany&&e.hasOwnProperty("howMany")&&!E.isInteger(e.howMany)?"howMany: integer expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof j.MergeOperation)return e;let t=new j.MergeOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");t.sourcePosition=j.Position.fromObject(e.sourcePosition)}if(null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");t.targetPosition=j.Position.fromObject(e.targetPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");t.graveyardPosition=j.Position.fromObject(e.graveyardPosition)}return null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.targetPosition=null,n.graveyardPosition=null,n.howMany=0,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=j.Position.toObject(e.sourcePosition,t)),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=j.Position.toObject(e.targetPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=j.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MergeOperation"},e})(),V=j.MoveOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.howMany=0,e.prototype.targetPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=k.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&j.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(16).uint32(e.howMany),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&j.Position.encode(e.targetPosition,t.uint32(26).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.MoveOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=j.Position.decode(e,e.uint32());break;case 2:r.howMany=e.uint32();break;case 3:r.targetPosition=j.Position.decode(e,e.uint32());break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=j.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!E.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=j.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof j.MoveOperation)return e;let t=new j.MoveOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");t.sourcePosition=j.Position.fromObject(e.sourcePosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MoveOperation.targetPosition: object expected");t.targetPosition=j.Position.fromObject(e.targetPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=j.Position.toObject(e.sourcePosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=j.Position.toObject(e.targetPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MoveOperation"},e})(),B=j.RenameOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.oldName="",e.prototype.newName="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=k.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&j.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.oldName&&Object.hasOwnProperty.call(e,"oldName")&&t.uint32(18).string(e.oldName),null!=e.newName&&Object.hasOwnProperty.call(e,"newName")&&t.uint32(26).string(e.newName),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.RenameOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=j.Position.decode(e,e.uint32());break;case 2:r.oldName=e.string();break;case 3:r.newName=e.string();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=j.Position.verify(e.position);if(t)return"position."+t}return null!=e.oldName&&e.hasOwnProperty("oldName")&&!E.isString(e.oldName)?"oldName: string expected":null!=e.newName&&e.hasOwnProperty("newName")&&!E.isString(e.newName)?"newName: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof j.RenameOperation)return e;let t=new j.RenameOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".RenameOperation.position: object expected");t.position=j.Position.fromObject(e.position)}return null!=e.oldName&&(t.oldName=String(e.oldName)),null!=e.newName&&(t.newName=String(e.newName)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=j.Position.toObject(e.position,t)),null!=e.oldName&&e.hasOwnProperty("oldName")&&(n.oldName=e.oldName),null!=e.newName&&e.hasOwnProperty("newName")&&(n.newName=e.newName),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RenameOperation"},e})(),U=j.RootAttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=k.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.RootAttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.root&&e.hasOwnProperty("root")&&!E.isString(e.root)?"root: string expected":null!=e.key&&e.hasOwnProperty("key")&&!E.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!E.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!E.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof j.RootAttributeOperation)return e;let t=new j.RootAttributeOperation;return null!=e.root&&(t.root=String(e.root)),null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.root="",n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootAttributeOperation"},e})(),J=j.RootOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rootName="",e.prototype.elementName="",e.prototype.isAdd=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=k.create()),null!=e.rootName&&Object.hasOwnProperty.call(e,"rootName")&&t.uint32(10).string(e.rootName),null!=e.elementName&&Object.hasOwnProperty.call(e,"elementName")&&t.uint32(18).string(e.elementName),null!=e.isAdd&&Object.hasOwnProperty.call(e,"isAdd")&&t.uint32(24).bool(e.isAdd),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.RootOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.rootName=e.string();break;case 2:r.elementName=e.string();break;case 3:r.isAdd=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.rootName&&e.hasOwnProperty("rootName")&&!E.isString(e.rootName)?"rootName: string expected":null!=e.elementName&&e.hasOwnProperty("elementName")&&!E.isString(e.elementName)?"elementName: string expected":null!=e.isAdd&&e.hasOwnProperty("isAdd")&&"boolean"!=typeof e.isAdd?"isAdd: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof j.RootOperation)return e;let t=new j.RootOperation;return null!=e.rootName&&(t.rootName=String(e.rootName)),null!=e.elementName&&(t.elementName=String(e.elementName)),null!=e.isAdd&&(t.isAdd=Boolean(e.isAdd)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.rootName="",n.elementName="",n.isAdd=!1,n.wasUndone=!1),null!=e.rootName&&e.hasOwnProperty("rootName")&&(n.rootName=e.rootName),null!=e.elementName&&e.hasOwnProperty("elementName")&&(n.elementName=e.elementName),null!=e.isAdd&&e.hasOwnProperty("isAdd")&&(n.isAdd=e.isAdd),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootOperation"},e})(),q=j.SplitOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.splitPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.insertionPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=k.create()),null!=e.splitPosition&&Object.hasOwnProperty.call(e,"splitPosition")&&j.Position.encode(e.splitPosition,t.uint32(10).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&j.Position.encode(e.graveyardPosition,t.uint32(18).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(24).uint32(e.howMany),null!=e.insertionPosition&&Object.hasOwnProperty.call(e,"insertionPosition")&&j.Position.encode(e.insertionPosition,t.uint32(34).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.SplitOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.splitPosition=j.Position.decode(e,e.uint32());break;case 2:r.graveyardPosition=j.Position.decode(e,e.uint32());break;case 3:r.howMany=e.uint32();break;case 4:r.insertionPosition=j.Position.decode(e,e.uint32());break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.splitPosition&&e.hasOwnProperty("splitPosition")){let t=j.Position.verify(e.splitPosition);if(t)return"splitPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=j.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!E.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")){let t=j.Position.verify(e.insertionPosition);if(t)return"insertionPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof j.SplitOperation)return e;let t=new j.SplitOperation;if(null!=e.splitPosition){if("object"!=typeof e.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");t.splitPosition=j.Position.fromObject(e.splitPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");t.graveyardPosition=j.Position.fromObject(e.graveyardPosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.insertionPosition){if("object"!=typeof e.insertionPosition)throw TypeError(".SplitOperation.insertionPosition: object expected");t.insertionPosition=j.Position.fromObject(e.insertionPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.splitPosition=null,n.graveyardPosition=null,n.howMany=0,n.insertionPosition=null,n.wasUndone=!1),null!=e.splitPosition&&e.hasOwnProperty("splitPosition")&&(n.splitPosition=j.Position.toObject(e.splitPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=j.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(n.insertionPosition=j.Position.toObject(e.insertionPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SplitOperation"},e})(),G=j.Position=(()=>{function e(e){if(this.path=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.rootMain=!1,e.prototype.rootGraveyard=!1,e.prototype.path=E.emptyArray,e.prototype.stickiness="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=k.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.rootMain&&Object.hasOwnProperty.call(e,"rootMain")&&t.uint32(16).bool(e.rootMain),null!=e.rootGraveyard&&Object.hasOwnProperty.call(e,"rootGraveyard")&&t.uint32(24).bool(e.rootGraveyard),null!=e.path&&e.path.length){t.uint32(34).fork();for(let n=0;n<e.path.length;++n)t.uint32(e.path[n]);t.ldelim()}return null!=e.stickiness&&Object.hasOwnProperty.call(e,"stickiness")&&t.uint32(42).string(e.stickiness),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.Position;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.rootMain=e.bool();break;case 3:r.rootGraveyard=e.bool();break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.path.push(e.uint32())}else r.path.push(e.uint32());break;case 5:r.stickiness=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.root&&e.hasOwnProperty("root")&&!E.isString(e.root))return"root: string expected";if(null!=e.rootMain&&e.hasOwnProperty("rootMain")&&"boolean"!=typeof e.rootMain)return"rootMain: boolean expected";if(null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&"boolean"!=typeof e.rootGraveyard)return"rootGraveyard: boolean expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(let t=0;t<e.path.length;++t)if(!E.isInteger(e.path[t]))return"path: integer[] expected"}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&!E.isString(e.stickiness)?"stickiness: string expected":null},e.fromObject=function(e){if(e instanceof j.Position)return e;let t=new j.Position;if(null!=e.root&&(t.root=String(e.root)),null!=e.rootMain&&(t.rootMain=Boolean(e.rootMain)),null!=e.rootGraveyard&&(t.rootGraveyard=Boolean(e.rootGraveyard)),e.path){if(!Array.isArray(e.path))throw TypeError(".Position.path: array expected");t.path=[];for(let n=0;n<e.path.length;++n)t.path[n]=e.path[n]>>>0}return null!=e.stickiness&&(t.stickiness=String(e.stickiness)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.path=[]),t.defaults&&(n.root="",n.rootMain=!1,n.rootGraveyard=!1,n.stickiness=""),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.rootMain&&e.hasOwnProperty("rootMain")&&(n.rootMain=e.rootMain),null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&(n.rootGraveyard=e.rootGraveyard),e.path&&e.path.length){n.path=[];for(let t=0;t<e.path.length;++t)n.path[t]=e.path[t]}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&(n.stickiness=e.stickiness),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Position"},e})(),Y=j.Range=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.start=null,e.prototype.end=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=k.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&j.Position.encode(e.start,t.uint32(10).fork()).ldelim(),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&j.Position.encode(e.end,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n=void 0===t?e.len:e.pos+t,r=new j.Range;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.start=j.Position.decode(e,e.uint32());break;case 2:r.end=j.Position.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.start&&e.hasOwnProperty("start")){let t=j.Position.verify(e.start);if(t)return"start."+t}if(null!=e.end&&e.hasOwnProperty("end")){let t=j.Position.verify(e.end);if(t)return"end."+t}return null},e.fromObject=function(e){if(e instanceof j.Range)return e;let t=new j.Range;if(null!=e.start){if("object"!=typeof e.start)throw TypeError(".Range.start: object expected");t.start=j.Position.fromObject(e.start)}if(null!=e.end){if("object"!=typeof e.end)throw TypeError(".Range.end: object expected");t.end=j.Position.fromObject(e.end)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.start=null,n.end=null),null!=e.start&&e.hasOwnProperty("start")&&(n.start=j.Position.toObject(e.start,t)),null!=e.end&&e.hasOwnProperty("end")&&(n.end=j.Position.toObject(e.end,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Range"},e})(),L=j.Element=(()=>{function e(e){if(this.children=[],this.attributesBoolean={},e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.children=E.emptyArray,e.prototype.data="",e.prototype.attributesBoolean=E.emptyObject,e.prototype.attributesJson="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=k.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.children&&e.children.length)for(let n=0;n<e.children.length;++n)j.Element.encode(e.children[n],t.uint32(18).fork()).ldelim();if(null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).string(e.data),null!=e.attributesBoolean&&Object.hasOwnProperty.call(e,"attributesBoolean"))for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(16).bool(e.attributesBoolean[n[r]]).ldelim();return null!=e.attributesJson&&Object.hasOwnProperty.call(e,"attributesJson")&&t.uint32(42).string(e.attributesJson),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof C||(e=C.create(e));let n,r,o=void 0===t?e.len:e.pos+t,s=new j.Element;for(;e.pos<o;){let t=e.uint32();switch(t>>>3){case 1:s.name=e.string();break;case 2:s.children&&s.children.length||(s.children=[]),s.children.push(j.Element.decode(e,e.uint32()));break;case 3:s.data=e.string();break;case 4:{s.attributesBoolean===E.emptyObject&&(s.attributesBoolean={});let t=e.uint32()+e.pos;for(n="",r=!1;e.pos<t;){let t=e.uint32();switch(t>>>3){case 1:n=e.string();break;case 2:r=e.bool();break;default:e.skipType(7&t)}}s.attributesBoolean[n]=r;break}case 5:s.attributesJson=e.string();break;default:e.skipType(7&t)}}return s},e.decodeDelimited=function(e){return e instanceof C||(e=new C(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!E.isString(e.name))return"name: string expected";if(null!=e.children&&e.hasOwnProperty("children")){if(!Array.isArray(e.children))return"children: array expected";for(let t=0;t<e.children.length;++t){let n=j.Element.verify(e.children[t]);if(n)return"children."+n}}if(null!=e.data&&e.hasOwnProperty("data")&&!E.isString(e.data))return"data: string expected";if(null!=e.attributesBoolean&&e.hasOwnProperty("attributesBoolean")){if(!E.isObject(e.attributesBoolean))return"attributesBoolean: object expected";let t=Object.keys(e.attributesBoolean);for(let n=0;n<t.length;++n)if("boolean"!=typeof e.attributesBoolean[t[n]])return"attributesBoolean: boolean{k:string} expected"}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&!E.isString(e.attributesJson)?"attributesJson: string expected":null},e.fromObject=function(e){if(e instanceof j.Element)return e;let t=new j.Element;if(null!=e.name&&(t.name=String(e.name)),e.children){if(!Array.isArray(e.children))throw TypeError(".Element.children: array expected");t.children=[];for(let n=0;n<e.children.length;++n){if("object"!=typeof e.children[n])throw TypeError(".Element.children: object expected");t.children[n]=j.Element.fromObject(e.children[n])}}if(null!=e.data&&(t.data=String(e.data)),e.attributesBoolean){if("object"!=typeof e.attributesBoolean)throw TypeError(".Element.attributesBoolean: object expected");t.attributesBoolean={};for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.attributesBoolean[n[r]]=Boolean(e.attributesBoolean[n[r]])}return null!=e.attributesJson&&(t.attributesJson=String(e.attributesJson)),t},e.toObject=function(e,t){t||(t={});let n,r={};if((t.arrays||t.defaults)&&(r.children=[]),(t.objects||t.defaults)&&(r.attributesBoolean={}),t.defaults&&(r.name="",r.data="",r.attributesJson=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),e.children&&e.children.length){r.children=[];for(let n=0;n<e.children.length;++n)r.children[n]=j.Element.toObject(e.children[n],t)}if(null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),e.attributesBoolean&&(n=Object.keys(e.attributesBoolean)).length){r.attributesBoolean={};for(let t=0;t<n.length;++t)r.attributesBoolean[n[t]]=e.attributesBoolean[n[t]]}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&(r.attributesJson=e.attributesJson),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,A.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},e})();class F{constructor(){this._protobufRoot=e}getDescriptor(e){return new H(this._protobufRoot[e])}}class H{constructor(e){this._protobuf=e}compress(e){const t=this._protobuf.verify(e);if(t)throw Error(t);return this._protobuf.encode(this._protobuf.create(e)).finish()}decompress(e){return this._protobuf.toObject(this._protobuf.decode(e),{oneofs:!0})}}const z=function(){this.__data__=[],this.size=0};const K=function(e,t){return e===t||e!=e&&t!=t};const W=function(e,t){for(var n=e.length;n--;)if(K(e[n][0],t))return n;return-1};var $=Array.prototype.splice;const Q=function(e){var t=this.__data__,n=W(t,e);return!(n<0)&&(n==t.length-1?t.pop():$.call(t,n,1),--this.size,!0)};const Z=function(e){var t=this.__data__,n=W(t,e);return n<0?void 0:t[n][1]};const X=function(e){return W(this.__data__,e)>-1};const ee=function(e,t){var n=this.__data__,r=W(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}te.prototype.clear=z,te.prototype.delete=Q,te.prototype.get=Z,te.prototype.has=X,te.prototype.set=ee;const ne=te;const re=function(){this.__data__=new ne,this.size=0};const oe=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const se=function(e){return this.__data__.get(e)};const ie=function(e){return this.__data__.has(e)};const ae="object"==typeof global&&global&&global.Object===Object&&global;var ce="object"==typeof self&&self&&self.Object===Object&&self;const de=ae||ce||Function("return this")();const ue=de.Symbol;var le=Object.prototype,pe=le.hasOwnProperty,he=le.toString,fe=ue?ue.toStringTag:void 0;const me=function(e){var t=pe.call(e,fe),n=e[fe];try{e[fe]=void 0;var r=!0}catch(e){}var o=he.call(e);return r&&(t?e[fe]=n:delete e[fe]),o};var ye=Object.prototype.toString;const ge=function(e){return ye.call(e)};var be=ue?ue.toStringTag:void 0;const Oe=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":be&&be in Object(e)?me(e):ge(e)};const ve=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const we=function(e){if(!ve(e))return!1;var t=Oe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const xe=de["__core-js_shared__"];var _e,Ie=(_e=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||""))?"Symbol(src)_1."+_e:"";const Se=function(e){return!!Ie&&Ie in e};var Pe=Function.prototype.toString;const Te=function(e){if(null!=e){try{return Pe.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Ae=/^\[object .+?Constructor\]$/,Ce=Function.prototype,ke=Object.prototype,Ee=Ce.toString,je=ke.hasOwnProperty,Re=RegExp("^"+Ee.call(je).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const De=function(e){return!(!ve(e)||Se(e))&&(we(e)?Re:Ae).test(Te(e))};const Me=function(e,t){return null==e?void 0:e[t]};const Ne=function(e,t){var n=Me(e,t);return De(n)?n:void 0};const Ve=Ne(de,"Map");const Be=Ne(Object,"create");const Ue=function(){this.__data__=Be?Be(null):{},this.size=0};const Je=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var qe=Object.prototype.hasOwnProperty;const Ge=function(e){var t=this.__data__;if(Be){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return qe.call(t,e)?t[e]:void 0};var Ye=Object.prototype.hasOwnProperty;const Le=function(e){var t=this.__data__;return Be?void 0!==t[e]:Ye.call(t,e)};const Fe=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Be&&void 0===t?"__lodash_hash_undefined__":t,this};function He(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}He.prototype.clear=Ue,He.prototype.delete=Je,He.prototype.get=Ge,He.prototype.has=Le,He.prototype.set=Fe;const ze=He;const Ke=function(){this.size=0,this.__data__={hash:new ze,map:new(Ve||ne),string:new ze}};const We=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const $e=function(e,t){var n=e.__data__;return We(t)?n["string"==typeof t?"string":"hash"]:n.map};const Qe=function(e){var t=$e(this,e).delete(e);return this.size-=t?1:0,t};const Ze=function(e){return $e(this,e).get(e)};const Xe=function(e){return $e(this,e).has(e)};const et=function(e,t){var n=$e(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function tt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tt.prototype.clear=Ke,tt.prototype.delete=Qe,tt.prototype.get=Ze,tt.prototype.has=Xe,tt.prototype.set=et;const nt=tt;const rt=function(e,t){var n=this.__data__;if(n instanceof ne){var r=n.__data__;if(!Ve||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new nt(r)}return n.set(e,t),this.size=n.size,this};function ot(e){var t=this.__data__=new ne(e);this.size=t.size}ot.prototype.clear=re,ot.prototype.delete=oe,ot.prototype.get=se,ot.prototype.has=ie,ot.prototype.set=rt;const st=ot;const it=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const at=function(){try{var e=Ne(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const ct=function(e,t,n){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var dt=Object.prototype.hasOwnProperty;const ut=function(e,t,n){var r=e[t];dt.call(e,t)&&K(r,n)&&(void 0!==n||t in e)||ct(e,t,n)};const lt=function(e,t,n,r){var o=!n;n||(n={});for(var s=-1,i=t.length;++s<i;){var a=t[s],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),o?ct(n,a,c):ut(n,a,c)}return n};const pt=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const ht=function(e){return null!=e&&"object"==typeof e};const ft=function(e){return ht(e)&&"[object Arguments]"==Oe(e)};var mt=Object.prototype,yt=mt.hasOwnProperty,gt=mt.propertyIsEnumerable;const bt=ft(function(){return arguments}())?ft:function(e){return ht(e)&&yt.call(e,"callee")&&!gt.call(e,"callee")};const Ot=Array.isArray;const vt=function(){return!1};var wt="object"==typeof exports&&exports&&!exports.nodeType&&exports,xt=wt&&"object"==typeof module&&module&&!module.nodeType&&module,_t=xt&&xt.exports===wt?de.Buffer:void 0;const It=(_t?_t.isBuffer:void 0)||vt;var St=/^(?:0|[1-9]\d*)$/;const Pt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&St.test(e))&&e>-1&&e%1==0&&e<t};const Tt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var At={};At["[object Float32Array]"]=At["[object Float64Array]"]=At["[object Int8Array]"]=At["[object Int16Array]"]=At["[object Int32Array]"]=At["[object Uint8Array]"]=At["[object Uint8ClampedArray]"]=At["[object Uint16Array]"]=At["[object Uint32Array]"]=!0,At["[object Arguments]"]=At["[object Array]"]=At["[object ArrayBuffer]"]=At["[object Boolean]"]=At["[object DataView]"]=At["[object Date]"]=At["[object Error]"]=At["[object Function]"]=At["[object Map]"]=At["[object Number]"]=At["[object Object]"]=At["[object RegExp]"]=At["[object Set]"]=At["[object String]"]=At["[object WeakMap]"]=!1;const Ct=function(e){return ht(e)&&Tt(e.length)&&!!At[Oe(e)]};const kt=function(e){return function(t){return e(t)}};var Et="object"==typeof exports&&exports&&!exports.nodeType&&exports,jt=Et&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=jt&&jt.exports===Et&&ae.process;const Dt=function(){try{var e=jt&&jt.require&&jt.require("util").types;return e||Rt&&Rt.binding&&Rt.binding("util")}catch(e){}}();var Mt=Dt&&Dt.isTypedArray;const Nt=Mt?kt(Mt):Ct;var Vt=Object.prototype.hasOwnProperty;const Bt=function(e,t){var n=Ot(e),r=!n&&bt(e),o=!n&&!r&&It(e),s=!n&&!r&&!o&&Nt(e),i=n||r||o||s,a=i?pt(e.length,String):[],c=a.length;for(var d in e)!t&&!Vt.call(e,d)||i&&("length"==d||o&&("offset"==d||"parent"==d)||s&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Pt(d,c))||a.push(d);return a};var Ut=Object.prototype;const Jt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ut)};const qt=function(e,t){return function(n){return e(t(n))}};const Gt=qt(Object.keys,Object);var Yt=Object.prototype.hasOwnProperty;const Lt=function(e){if(!Jt(e))return Gt(e);var t=[];for(var n in Object(e))Yt.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Ft=function(e){return null!=e&&Tt(e.length)&&!we(e)};const Ht=function(e){return Ft(e)?Bt(e):Lt(e)};const zt=function(e,t){return e&&lt(t,Ht(t),e)};const Kt=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var Wt=Object.prototype.hasOwnProperty;const $t=function(e){if(!ve(e))return Kt(e);var t=Jt(e),n=[];for(var r in e)("constructor"!=r||!t&&Wt.call(e,r))&&n.push(r);return n};const Qt=function(e){return Ft(e)?Bt(e,!0):$t(e)};const Zt=function(e,t){return e&&lt(t,Qt(t),e)};var Xt="object"==typeof exports&&exports&&!exports.nodeType&&exports,en=Xt&&"object"==typeof module&&module&&!module.nodeType&&module,tn=en&&en.exports===Xt?de.Buffer:void 0,nn=tn?tn.allocUnsafe:void 0;const rn=function(e,t){if(t)return e.slice();var n=e.length,r=nn?nn(n):new e.constructor(n);return e.copy(r),r};const on=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};const sn=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,s=[];++n<r;){var i=e[n];t(i,n,e)&&(s[o++]=i)}return s};const an=function(){return[]};var cn=Object.prototype.propertyIsEnumerable,dn=Object.getOwnPropertySymbols;const un=dn?function(e){return null==e?[]:(e=Object(e),sn(dn(e),(function(t){return cn.call(e,t)})))}:an;const ln=function(e,t){return lt(e,un(e),t)};const pn=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e};const hn=qt(Object.getPrototypeOf,Object);const fn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)pn(t,un(e)),e=hn(e);return t}:an;const mn=function(e,t){return lt(e,fn(e),t)};const yn=function(e,t,n){var r=t(e);return Ot(e)?r:pn(r,n(e))};const gn=function(e){return yn(e,Ht,un)};const bn=function(e){return yn(e,Qt,fn)};const On=Ne(de,"DataView");const vn=Ne(de,"Promise");const wn=Ne(de,"Set");const xn=Ne(de,"WeakMap");var _n="[object Map]",In="[object Promise]",Sn="[object Set]",Pn="[object WeakMap]",Tn="[object DataView]",An=Te(On),Cn=Te(Ve),kn=Te(vn),En=Te(wn),jn=Te(xn),Rn=Oe;(On&&Rn(new On(new ArrayBuffer(1)))!=Tn||Ve&&Rn(new Ve)!=_n||vn&&Rn(vn.resolve())!=In||wn&&Rn(new wn)!=Sn||xn&&Rn(new xn)!=Pn)&&(Rn=function(e){var t=Oe(e),n="[object Object]"==t?e.constructor:void 0,r=n?Te(n):"";if(r)switch(r){case An:return Tn;case Cn:return _n;case kn:return In;case En:return Sn;case jn:return Pn}return t});const Dn=Rn;var Mn=Object.prototype.hasOwnProperty;const Nn=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Mn.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const Vn=de.Uint8Array;const Bn=function(e){var t=new e.constructor(e.byteLength);return new Vn(t).set(new Vn(e)),t};const Un=function(e,t){var n=t?Bn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var Jn=/\w*$/;const qn=function(e){var t=new e.constructor(e.source,Jn.exec(e));return t.lastIndex=e.lastIndex,t};var Gn=ue?ue.prototype:void 0,Yn=Gn?Gn.valueOf:void 0;const Ln=function(e){return Yn?Object(Yn.call(e)):{}};const Fn=function(e,t){var n=t?Bn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Hn=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Bn(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Un(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Fn(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return qn(e);case"[object Symbol]":return Ln(e)}};var zn=Object.create;const Kn=function(){function e(){}return function(t){if(!ve(t))return{};if(zn)return zn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Wn=function(e){return"function"!=typeof e.constructor||Jt(e)?{}:Kn(hn(e))};const $n=function(e){return ht(e)&&"[object Map]"==Dn(e)};var Qn=Dt&&Dt.isMap;const Zn=Qn?kt(Qn):$n;const Xn=function(e){return ht(e)&&"[object Set]"==Dn(e)};var er=Dt&&Dt.isSet;const tr=er?kt(er):Xn;var nr="[object Arguments]",rr="[object Function]",or="[object Object]",sr={};sr[nr]=sr["[object Array]"]=sr["[object ArrayBuffer]"]=sr["[object DataView]"]=sr["[object Boolean]"]=sr["[object Date]"]=sr["[object Float32Array]"]=sr["[object Float64Array]"]=sr["[object Int8Array]"]=sr["[object Int16Array]"]=sr["[object Int32Array]"]=sr["[object Map]"]=sr["[object Number]"]=sr[or]=sr["[object RegExp]"]=sr["[object Set]"]=sr["[object String]"]=sr["[object Symbol]"]=sr["[object Uint8Array]"]=sr["[object Uint8ClampedArray]"]=sr["[object Uint16Array]"]=sr["[object Uint32Array]"]=!0,sr["[object Error]"]=sr[rr]=sr["[object WeakMap]"]=!1;const ir=function e(t,n,r,o,s,i){var a,c=1&n,d=2&n,u=4&n;if(r&&(a=s?r(t,o,s,i):r(t)),void 0!==a)return a;if(!ve(t))return t;var l=Ot(t);if(l){if(a=Nn(t),!c)return on(t,a)}else{var p=Dn(t),h=p==rr||"[object GeneratorFunction]"==p;if(It(t))return rn(t,c);if(p==or||p==nr||h&&!s){if(a=d||h?{}:Wn(t),!c)return d?mn(t,Zt(a,t)):ln(t,zt(a,t))}else{if(!sr[p])return s?t:{};a=Hn(t,p,c)}}i||(i=new st);var f=i.get(t);if(f)return f;i.set(t,a),tr(t)?t.forEach((function(o){a.add(e(o,n,r,o,t,i))})):Zn(t)&&t.forEach((function(o,s){a.set(s,e(o,n,r,s,t,i))}));var m=l?void 0:(u?d?bn:gn:d?Qt:Ht)(t);return it(m||t,(function(o,s){m&&(o=t[s=o]),ut(a,s,e(o,n,r,s,t,i))})),a};const ar=function(e){return ir(e,5)};const cr=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const dr=function(e){return this.__data__.has(e)};function ur(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new nt;++t<n;)this.add(e[t])}ur.prototype.add=ur.prototype.push=cr,ur.prototype.has=dr;const lr=ur;const pr=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const hr=function(e,t){return e.has(t)};const fr=function(e,t,n,r,o,s){var i=1&n,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var d=s.get(e),u=s.get(t);if(d&&u)return d==t&&u==e;var l=-1,p=!0,h=2&n?new lr:void 0;for(s.set(e,t),s.set(t,e);++l<a;){var f=e[l],m=t[l];if(r)var y=i?r(m,f,l,t,e,s):r(f,m,l,e,t,s);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!pr(t,(function(e,t){if(!hr(h,t)&&(f===e||o(f,e,n,r,s)))return h.push(t)}))){p=!1;break}}else if(f!==m&&!o(f,m,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p};const mr=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const yr=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var gr=ue?ue.prototype:void 0,br=gr?gr.valueOf:void 0;const Or=function(e,t,n,r,o,s,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Vn(e),new Vn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return K(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=mr;case"[object Set]":var c=1&r;if(a||(a=yr),e.size!=t.size&&!c)return!1;var d=i.get(e);if(d)return d==t;r|=2,i.set(e,t);var u=fr(a(e),a(t),r,o,s,i);return i.delete(e),u;case"[object Symbol]":if(br)return br.call(e)==br.call(t)}return!1};var vr=Object.prototype.hasOwnProperty;const wr=function(e,t,n,r,o,s){var i=1&n,a=gn(e),c=a.length;if(c!=gn(t).length&&!i)return!1;for(var d=c;d--;){var u=a[d];if(!(i?u in t:vr.call(t,u)))return!1}var l=s.get(e),p=s.get(t);if(l&&p)return l==t&&p==e;var h=!0;s.set(e,t),s.set(t,e);for(var f=i;++d<c;){var m=e[u=a[d]],y=t[u];if(r)var g=i?r(y,m,u,t,e,s):r(m,y,u,e,t,s);if(!(void 0===g?m===y||o(m,y,n,r,s):g)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var b=e.constructor,O=t.constructor;b==O||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return s.delete(e),s.delete(t),h};var xr="[object Arguments]",_r="[object Array]",Ir="[object Object]",Sr=Object.prototype.hasOwnProperty;const Pr=function(e,t,n,r,o,s){var i=Ot(e),a=Ot(t),c=i?_r:Dn(e),d=a?_r:Dn(t),u=(c=c==xr?Ir:c)==Ir,l=(d=d==xr?Ir:d)==Ir,p=c==d;if(p&&It(e)){if(!It(t))return!1;i=!0,u=!1}if(p&&!u)return s||(s=new st),i||Nt(e)?fr(e,t,n,r,o,s):Or(e,t,c,n,r,o,s);if(!(1&n)){var h=u&&Sr.call(e,"__wrapped__"),f=l&&Sr.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,y=f?t.value():t;return s||(s=new st),o(m,y,n,r,s)}}return!!p&&(s||(s=new st),wr(e,t,n,r,o,s))};const Tr=function e(t,n,r,o,s){return t===n||(null==t||null==n||!ht(t)&&!ht(n)?t!=t&&n!=n:Pr(t,n,r,o,e,s))};const Ar=function(e,t){return Tr(e,t)};function Cr(e,t){const n=ar(e);return n.path[n.path.length-1]+=t,n}function kr(e,t){return e.root===t.root&&Ar(e.path,t.path)}function Er(e){Rr(e,(e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e)))}function jr(e){Rr(e,(e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e)))}function Rr(e,t){for(const n in e){const r=e[n];"nodes"!==n&&ve(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):Rr(r,t))}return e}class Dr{constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return Er(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){t.types.shift();const n=this._protobufDescriptor.decompress(t.buffers.shift());jr(n),n.__className=this._operationName,e.push(n)}}class Mr extends Dr{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),Er(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,o=this._protobufDescriptor.decompress(r.shift());n.shift(),this._deserializeOneOf("oldValue",o),this._deserializeOneOf("newValue",o),jr(o),o.__className=this._operationName,e.push(o)}_serializeOneOf(e,t){const n=t[e];"boolean"==typeof n?t[`${e}Boolean`]=n:t[`${e}Json`]=JSON.stringify(n)}_deserializeOneOf(e,t){const n=`${e}Json`;t[n]?(t[e]=JSON.parse(t[n]),delete t[n]):(t[e]=t[`${e}Boolean`],delete t[`${e}Boolean`])}}class Nr extends Dr{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),Er(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,o=this._protobufDescriptor.decompress(r.shift());n.shift(),o.nodes||(o.nodes=[]),this._deserializeNodesAttributes(o.nodes),jr(o),o.__className=this._operationName,e.push(o)}_serializeNodesAttributes(e){for(const t of e){if(t.attributes){const e=t.attributes;this._areValuesBoolean(e)?t.attributesBoolean=e:t.attributesJson=JSON.stringify(e)}t.children&&this._serializeNodesAttributes(t.children)}}_deserializeNodesAttributes(e){for(const t of e)(t.attributesBoolean||t.attributesJson)&&(t.attributesBoolean?(t.attributes=t.attributesBoolean,delete t.attributesBoolean):(t.attributes=JSON.parse(t.attributesJson),delete t.attributesJson)),t.children&&this._deserializeNodesAttributes(t.children)}_areValuesBoolean(e){return Object.keys(e).every((t=>"boolean"==typeof e[t]))}}class Vr extends Dr{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class Br extends Dr{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class Ur extends Vr{constructor(e,t,n,r){super(e,t,n),this._omittedNamespace=r+":"}compress(e,t){return!("MarkerOperation"!=t[0].__className||!t[0].name.startsWith(this._omittedNamespace))&&(t[0].name=t[0].name.replace(new RegExp("^"+this._omittedNamespace),""),super.compress(e,t),!0)}decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.name=this._omittedNamespace+n.name}}class Jr{constructor(e,t){this._id=e,this._context=t}compress(e,t){let n;for(;t.length>1&&this._compareOperations(t[0],t[1]);)n?(n=this._combineNext(t.shift(),n),e.types.push(0)):(n=ar(t.shift()),e.types.push(this._id));return!!n&&(n=this._combineNext(t.shift(),n),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0)}decompress(e,t){const n=this._decompressSingleOperation(t);for(;0==t.types[0];)t.types.shift(),e.push(this._splitCurrent(n));e.push(n)}}class qr extends Jr{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=ar(e),n=t.nodes[0],r=e.nodes[0],o=r.data[Symbol.iterator]().next().value,s=o.length;return n.data=o,r.data=r.data.substr(s),e.position=Cr(e.position,s),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=kr(Cr(e.position,n),t.position),o=e.nodes[0],s=t.nodes[0];return r&&this._compareAttributes(o,s)}return!1}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("InsertOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("InsertOperation").decompress(t,e),t[0]}_checkOperation(e){return"InsertOperation"==e.__className&&1==e.nodes.length&&e.nodes[0].data&&!e.wasUndone&&1==Array.from(e.nodes[0].data).length}_compareAttributes(e,t){const n=Object.keys(e.attributes||{}),r=Object.keys(t.attributes||{});return n.length===r.length&&n.every((n=>t.attributes[n]&&t.attributes[n]===e.attributes[n]))}}class Gr extends Jr{_combineNext(e,t){return t.howMany++,t.sourcePosition=ar(e.sourcePosition),t}_splitCurrent(e){const t=ar(e);return e.howMany--,t.howMany=1,t.sourcePosition=Cr(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(kr(Cr(e.sourcePosition,-1),t.sourcePosition)&&kr(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class Yr extends Jr{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=ar(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(kr(e.sourcePosition,t.sourcePosition)&&kr(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class Lr extends Jr{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&kr(n.newRange.start,n.newRange.end)&&(n.newRange.end=null),t.shift(),e.types.push(this._id),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0}decompress(e,t){const n=this._decompressSingleOperation(t);n.newRange&&!n.newRange.end&&(n.newRange.end=ar(n.newRange.start));const r=ar(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=ar(r.newRange.start)),r.name="user:position:"+r.name.split(":")[2],t.types.shift(),e.push(n),e.push(r)}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MarkerOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MarkerOperation").decompress(t,e),t[0]}_compareOperations(e,t){return!(!e||!t)&&("MarkerOperation"==e.__className&&"MarkerOperation"==t.__className&&!(!e.name.startsWith("user:")||!t.name.startsWith("user:")||e.name==t.name))}}class Fr{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new F;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new Br(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",Mr),this._registerOperationCompressor(11,"InsertOperation",Nr),this._registerOperationCompressor(12,"MarkerOperation",Vr),this._registerOperationCompressor(13,"MergeOperation",Dr),this._registerOperationCompressor(14,"MoveOperation",Dr),this._registerOperationCompressor(15,"RenameOperation",Dr),this._registerOperationCompressor(16,"RootAttributeOperation",Mr),this._registerOperationCompressor(17,"SplitOperation",Dr),this._registerCompressor(18,"CommentMarkerOperation",new Ur(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Ur(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",Dr),this._registerActionCompressor(100,"TypingAction",qr),this._registerActionCompressor(101,"DeletingAction",Gr),this._registerActionCompressor(102,"ForwardDeletingAction",Yr),this._registerActionCompressor(103,"UserSelectionAction",Lr)}compress(e){if(!e||!e[0])throw new n.CKEditorError("no-operations-provided",this);const t={types:[],buffers:[],baseVersion:e[0].baseVersion};for(;e.length;)this._getCompressorByName("UserSelectionAction").compress(t,e)||this._getCompressorByName("TypingAction").compress(t,e)||this._getCompressorByName("DeletingAction").compress(t,e)||this._getCompressorByName("ForwardDeletingAction").compress(t,e)||this._getCompressorByName("CommentMarkerOperation").compress(t,e)||this._getCompressorByName("SuggestionMarkerOperation").compress(t,e)||this._getCompressorByName(e[0].__className).compress(t,e);return t}decompress(e){const t=[];for(;e.types.length;){this._compressorById.get(e.types[0]).decompress(t,e)}return t.forEach(((t,n)=>t.baseVersion=e.baseVersion+n)),t}_getCompressorByName(e){return this._compressorByName.get(e)}_registerOperationCompressor(e,t,n){const r=new n(e,t,this._protobufFactory.getDescriptor(t));this._registerCompressor(e,t,r)}_registerActionCompressor(e,t,n){const r=new n(e,this);this._registerCompressor(e,t,r)}_registerCompressor(e,t,n){this._compressorById.set(e,n),this._compressorByName.set(t,n)}}var Hr=__webpack_require__(9823);const zr=["collaboration","createdAt","_updateServerHistory","bind","set","_hasSelectionChanged","_handleSendingSelectionMarkers","realtimecollaborationclient-sendbufferedoperations","ready","_isConnected","change:hasDomSelection","string","_offset","cloudDocumentVersion","clone","RealTimeCollaborationClient","$root","_isInit","history","lastOperationAcceptedAt","_document","enableReadOnlyMode","directChange","editing","_bufferedOperations","InsertOperation","Permissions","cloud-services-internal-error: Request timeout.","stopListening","start","channelSessions","_pendingAction","_applyOperationsSet","getUser","add","baseVersion","_isAttached","rtc-offline","_operationToId","_setPendingAction","locale","userId","wereChangesApplied","return","realtimecollaborationclient-initservice-incorrect-server-operation","_initThrowingOnDataSet","_sendBufferedOperations","marker","offset","connection","sessionCreatedAt","realtimecollaborationclient-init-non-existent-root","_isEditingAllowed","_handleReconnectionResponse","error","_saveOperationInBuffer","_baseBufferDelay","_hasSynchronizationProblem","fire","CommentsOnly","_handleServerResponse","cloud-services-internal-error: Collaborative Editing Service is not connected.","_compressOperations","_lastServerVersion","_fetchMissingUsers","_operationIdentifier","cloudServices.bundleVersion","_disconnectService","_isDisconnection","high","_shouldSendSelectionUpdate","sendOperations","addUser","isEnabled","has","_lastSyncedOperationId","__className","get","getDocumentDetails","state","entries","_initSessionsHandling","rtc-destroyed","createUserMarkerOperations","getMany","code","connected","_shouldSendUpdate","_compressor","bufferOperation","_setUpDataInit","lastSyncVersion","_handleReconnectionError","reset","pluginName","_crash","fromJSON","_connectAfterSessionHasBeenFlushed","CollaborativeEditingService","_authorId","disableReadOnlyMode","_decompressOperations","length","permissions","addOperation","finally","filter","requires","409","document","_handleReceivedOperations","applyOperation","forEach","metadata","_connectService","serverHistory","destroy","slice","Notification","mySessionId","includes","position","getIdOfTheLastOperation","_isPendingUpdate","_sendBufferedOperationsDelayed","selection","startsWith","root","model","catch","sessionAdd:","message","_disconnectionOperations","markers","push","differ","real-time-collaboration","disconnected","realtimecollaborationclient-handleserverresponse","_ignoredOperations","_clearPendingAction","sessionId","Synchronization issue","_getOperationsFromInitData","getOperations","initData","isAttached","createPositionFromPath","operationsReceived","showWarning","getReversed","listenTo","then","collaboration.channelId","wasUndone","off","keys","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","_service","removeFromReconnectionStack","data","suppressErrorInCollaboration","round","_refreshUserSelectionMarkers","_channelId","toJSON","reconnect","stop","end","map","disconnect","parse","setIdForTheLastOperation","type","init","compress","The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.","editor","_sendBufferedOperationsDelayId","multi-root-editor-root-attributes-no-root","version","_handleExternalOperations","currentDocumentSession","enqueueChange","size","detachRoot","_knownOperations","config","change:_isEditingAllowed","lastOperationId","roots","plugins","PENDING_ACTION_SENDING_DATA","reconnection: flushed session","_currentBufferDelay","realtimecollaborationclient-init-session-connection-error","setPermissions","rootName","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","realtimecollaborationclient-initservice-internal-error","getConnectedSessions","isReadOnly","batch"];var Kr,Wr;Kr=zr,Wr=126,function(e){for(;--e;)Kr.push(Kr.shift())}(++Wr);const $r=function(e,t){return zr[e-=0]};let Qr=1;class Zr extends t.Plugin{static get[$r("0xb8")](){return[u,y,S,t.PendingActions,l.Users,r.Notification]}static get[$r("0xab")](){return $r("0x5c")}get[$r("0x5a")](){return this[$r("0x8c")]+this[$r("0x59")]}get _lastServerVersion(){return this.serverHistory.version-this._offset}get[$r("0xa8")](){const e=this[$r("0xc0")].getOperations();for(let t=e[$r("0xb3")]-1;t>=0;t--){const n=e[t];if(!this[$r("0x6")].has(n))return n[$r("0x70")]+1-this[$r("0x59")]}return 0}constructor(e){if(super(e),this[$r("0x59")]=0,this[$r("0xf")]=null,this.serverHistory=new o.History,this[$r("0x33")][$r("0x3d")].define($r("0x4d"),{}),this._channelId=this[$r("0x33")][$r("0x3d")].get($r("0x1b")),!this[$r("0x26")])throw new n.CKEditorError("collaboration-missing-channelid",this);const t=e[$r("0x3d")][$r("0x9a")]($r("0x8f"))||n.version;this[$r("0x20")]=new(Zr[$r("0xaf")])(t,this[$r("0x26")]),this[$r("0x61")]=this.editor.model.document,this[$r("0xa5")]=new Fr,this[$r("0x65")]=[],this._knownOperations=new WeakSet,this[$r("0x51")]($r("0xc8"),!1),this.set($r("0x86"),!1),this[$r("0x6c")]=null,this._hasSelectionChanged=!1,this[$r("0x34")]=null,this._baseBufferDelay=300,this[$r("0x44")]=this._baseBufferDelay,this[$r("0x98")]=null,this[$r("0x6")]=new WeakSet,this[$r("0x8e")]=new to(this._disconnectionOperations)}[$r("0x30")](){const e=this[$r("0x33")],t=e.plugins[$r("0x9a")](l.Users),n=e[$r("0x41")][$r("0x9a")](u);this.listenTo(t,"getOperationAuthor",((e,n)=>{const r=n[0];r._authorId&&(e[$r("0x78")]=t[$r("0x6e")](r[$r("0xb0")]),e[$r("0x29")]()),null===r._authorId&&(e[$r("0x78")]=null,e.stop())}),{priority:$r("0x92")}),this[$r("0x19")](e.model.document[$r("0xca")],"change:range",((e,t)=>{t[$r("0x63")]&&this[$r("0x25")]()})),this[$r("0x19")](e[$r("0x64")].view,$r("0x57"),(()=>{this._refreshUserSelectionMarkers()})),this[$r("0x7a")](),e[$r("0x2")].on($r("0xbc"),((e,t)=>{const n=t[0];n.isDocumentOperation&&(this[$r("0x84")](n),this[$r("0xa4")]()&&this[$r("0xc9")]())})),this[$r("0xa7")](),this[$r("0x50")]("_isEditingAllowed").to(n,$r("0x9c"),this,"_hasSynchronizationProblem",((e,t)=>$r("0xa3")===e&&!t)),this.on($r("0x3e"),(()=>{this[$r("0x81")]?e[$r("0xb1")]($r("0x72")):e.enableReadOnlyMode($r("0x72"))})),this[$r("0x81")]?e[$r("0xb1")]($r("0x72")):e.enableReadOnlyMode($r("0x72")),this[$r("0x51")]($r("0x56"),!1)}async[$r("0x28")](){const e=this[$r("0x33")][$r("0x41")][$r("0x9a")](y),t=this.editor[$r("0x41")][$r("0x9a")](u);try{this[$r("0xc8")]=!0,e.unregister(this[$r("0x26")]);const n=await this[$r("0x20")][$r("0x28")](t[$r("0x7e")],this[$r("0xa8")]);await this._handleReconnectionResponse(n)&&(this[$r("0xc8")]=!1,this._clearPendingAction());const r=await this[$r("0x20")].getConnectedSessions();e.register(this[$r("0x26")],r),this[$r("0x53")](),this._isConnected=!0}catch(e){if("404"===e[$r("0xa2")]&&this.sessionId)await this[$r("0xae")]();else if(n=e,$r("0xb9")===n[$r("0xa2")]){const e=T(this[$r("0x33")][$r("0x75")],$r("0x48"));this[$r("0xa9")](e)}else{if(!(e instanceof Xr))throw e;this._handleReconnectionError()}}var n}[$r("0xc1")](){const e=this[$r("0x33")][$r("0x41")][$r("0x9a")](u),t=this[$r("0x33")][$r("0x41")].get(y);this.editor[$r("0x62")]($r("0x9f")),t[$r("0x6b")][$r("0x97")](this._channelId)&&t.unregister(this[$r("0x26")]),e[$r("0x21")](this),this._disconnectService(),super.destroy()}async[$r("0x82")](e){if(this[$r("0xf")]!==e.sessionId&&this[$r("0x98")]!==e[$r("0x3f")])throw new Xr;return this.sessionId=e[$r("0xf")],this[$r("0x89")]([],{...e,wereChangesApplied:!1,data:e.data},$r("0x28"))}async[$r("0xbf")](e,t=!1){const{connection:n}=this.editor.plugins.get(u);Zr[$r("0xaf")][$r("0x4a")](n,this._channelId).then((e=>this[$r("0x9e")](e)))[$r("0x3")]((e=>{this[$r("0xac")]($r("0x45"),e)})),this[$r("0x19")](this._service,$r("0x16"),this._handleReceivedOperations.bind(this)),this.listenTo(this[$r("0x20")],$r("0x83"),((e,t)=>{this._crash($r("0x49"),t)})),this[$r("0x19")](this[$r("0x20")],$r("0xb"),(()=>{this[$r("0x56")]=!1}));const r=this[$r("0x8e")][$r("0xc7")](e),o=await this[$r("0x20")].connect(n,this[$r("0x8b")](e),r);if(this.sessionId=o[$r("0xf")],o.wereChangesApplied&&(this[$r("0xc8")]=!1,this[$r("0xe")]()),t){if(!o[$r("0x77")])return void this[$r("0xa9")]();this[$r("0xc0")][$r("0xaa")](),this[$r("0x59")]=o[$r("0x7d")],this[$r("0xc0")].version=this[$r("0x59")],await this[$r("0x89")](e,o,$r("0x43"))}else await this._handleInitialConnectionData(o,e);this[$r("0x53")](),this[$r("0x56")]=!0}[$r("0x53")](){const e=this[$r("0x33")].plugins[$r("0x9a")](y),t=this.editor.plugins.get(S),n=e[$r("0x6b")][$r("0x9a")](this[$r("0x26")]);n&&n[$r("0xb3")]>1?t.createUserMarkerOperations():this[$r("0x19")](e,$r("0x4")+this[$r("0x26")],(()=>{2===e.channelSessions[$r("0x9a")](this[$r("0x26")])[$r("0xb3")]&&t[$r("0xa0")]()}))}async[$r("0xbb")](e,t,n,r){if(!this._isPendingUpdate&&this._document[$r("0x36")]==t){const e=this._decompressOperations(n,r);await this[$r("0x8d")](e),this[$r("0x37")](e,t,n[$r("0x3f")])||this[$r("0xac")]($r("0x79"))}}async[$r("0xae")](){this[$r("0x90")]();const{locale:e}=this[$r("0x33")];let t;try{t=await this[$r("0x20")][$r("0x9b")]()}catch(t){const n=T(e,"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");return void this._handleReconnectionError(n)}const n=t[$r("0x38")]||t.lastDocumentSession;if(this[$r("0x98")]===n[$r("0x3f")])await this[$r("0xbf")](this[$r("0x33")][$r("0x2")][$r("0xba")][$r("0x5f")][$r("0x12")](),!0);else{const t=T(e,$r("0x32"));this[$r("0xa9")](t)}}[$r("0x90")](){this[$r("0x20")][$r("0x2c")](),this[$r("0x65")]=[],clearTimeout(this[$r("0x34")]),this[$r("0x69")](this[$r("0x20")])}[$r("0x9e")](e){const t=this[$r("0x33")][$r("0x41")][$r("0x9a")](y);this.listenTo(t,"sessionAdd:"+this[$r("0x26")],((e,{session:n})=>{if(n.id===t[$r("0xc4")]){e[$r("0x1d")]();const t=this.editor[$r("0x41")][$r("0x97")]($r("0x88"))&&this[$r("0x33")][$r("0x41")][$r("0x9a")]($r("0x88"));let r=n[$r("0xb4")];t&&t[$r("0x96")]&&(r=r[$r("0xb7")]((e=>"document:write"!==e))),this[$r("0x33")][$r("0x41")][$r("0x9a")]($r("0x67"))[$r("0x46")](r,this[$r("0x26")])}})),t.register(this[$r("0x26")],e)}_initThrowingOnDataSet(){const e=this[$r("0x33")][$r("0x22")][$r("0x51")];this[$r("0x33")][$r("0x22")][$r("0x51")]=(...t)=>{if(!t[t.length-1][$r("0x23")])throw new n.CKEditorError($r("0x1f"),this);e.apply(this[$r("0x33")].data,t)}}[$r("0xa7")](){this[$r("0x33")].data.on($r("0x30"),((e,[t])=>{if(this[$r("0x61")].version)throw new n.CKEditorError("realtimecollaborationclient-init-document-already-initialized",this);e[$r("0x29")](),this[$r("0x74")]();const r=this[$r("0x33")][$r("0x3d")][$r("0x9a")]("rootsAttributes"),o=this[$r("0x11")](t,r);e[$r("0x78")]=this[$r("0xbf")](o)[$r("0x1a")]((()=>{this[$r("0x33")][$r("0x41")][$r("0x9a")](u).addToReconnectionStack(this),this[$r("0x33")].data[$r("0x87")]($r("0x55"))}))[$r("0x3")]((e=>this._crash("realtimecollaborationclient-init-connection-failed",e)))[$r("0xb6")]((()=>this._clearPendingAction()))}),{priority:$r("0x92")})}async _fetchMissingUsers(e){const t=this[$r("0x33")][$r("0x41")][$r("0x9a")](l.Users),{connection:n}=this[$r("0x33")][$r("0x41")].get(u),r=new Set;for(const n of e){const e=n[$r("0xb0")];e&&!t[$r("0x6e")](e)&&r[$r("0x6f")](e)}if(0===r[$r("0x3a")])return;const o=await Hr.User[$r("0xa1")](n,Array.from(r));for(const e of o)t.getUser(e.id)||t[$r("0x95")](e)}[$r("0x11")](e,t={}){const r=this.editor[$r("0x2")],s=[];let i=0;const a=$r("0x58")==typeof e?{main:e}:e;for(const e of Object[$r("0x1e")](a)){if(!this[$r("0x61")][$r("0x40")][$r("0x97")](e))throw new n.CKEditorError($r("0x80"),this);const t=this[$r("0x33")][$r("0x22")][$r("0x2d")](a[e]),c=this._document.getRoot(e),d=new o.InsertOperation(r.createPositionAt(c,0),t,i++);s.push(d);for(const[e,n]of t[$r("0x7")]){const t=r.createRange(r[$r("0x15")](c,n[$r("0x6a")].path[$r("0xc2")]()),r[$r("0x15")](c,n[$r("0x2a")].path[$r("0xc2")]())),a=new o.MarkerOperation(e,null,t,r[$r("0x7")],!0,i++);s[$r("0x8")](a)}}if(t)for(const[e,a]of Object[$r("0x9d")](t)){const t=r[$r("0xba")].getRoot(e);if(!t)throw new n.CKEditorError($r("0x35"),null);for(const[e,n]of Object[$r("0x9d")](a))if(null!==n){const r=new o.RootAttributeOperation(t,e,null,n,i++);s[$r("0x8")](r)}}return s}async _handleInitialConnectionData(e,t){let n;this[$r("0x59")]=e[$r("0x7d")];const r=e[$r("0x77")]&&!e[$r("0x13")],o=r?0:e[$r("0x22")][$r("0x70")];if(r)n=t,n[$r("0xbd")]((t=>{t[$r("0x4e")]=e[$r("0x7f")],t[$r("0x5e")]=!0,t[$r("0xb0")]=null})),this._applyOperationsSet(n,r);else{if(e.initData){const t=this[$r("0x11")](e[$r("0x13")]);this[$r("0x61")][$r("0x5f")][$r("0x36")]=-t[$r("0xb3")],t[$r("0xbd")]((n=>{n[$r("0x70")]-=t[$r("0xb3")],n.createdAt=e.sessionCreatedAt,n[$r("0x5e")]=!0,n[$r("0xb0")]=null})),this[$r("0x6d")](t,!0),this[$r("0xc0")][$r("0x36")]=-t[$r("0xb3")]+this[$r("0x59")],this[$r("0x4f")](t)}this[$r("0x61")][$r("0x5f")][$r("0x36")]=o,n=this[$r("0xb2")](e[$r("0x22")],e[$r("0xbe")]),await this._fetchMissingUsers(n),this._applyOperationsSet(n,r)}e.lastOperationId&&(this[$r("0x8e")].setIdForTheLastOperation(n,e[$r("0x3f")]),this._lastSyncedOperationId=e[$r("0x3f")]),this[$r("0xc0")].version=o+this._offset,this[$r("0x4f")](n)}[$r("0xac")](e,t){throw this[$r("0xc8")]=!0,t&&console.error(t),new n.CKEditorError(e,this[$r("0x33")])}[$r("0x84")](e){this._knownOperations.has(e)||(this._knownOperations.add(e),this[$r("0x65")].push(e),this[$r("0x6c")]||$r("0x7c")==e[$r("0x2f")]&&!e.affectsData||this[$r("0x74")]())}[$r("0xc9")](e=!1){!e&&this[$r("0xc8")]||(this._isPendingUpdate=!0,clearTimeout(this[$r("0x34")]),this[$r("0x34")]=setTimeout((()=>{this[$r("0x7b")]()[$r("0x1a")]((e=>{e&&(this[$r("0xe")](),this[$r("0xc8")]=!1)}))[$r("0x3")]((e=>{if(this[$r("0xe")](),this._isPendingUpdate=!1,!((t=e)[$r("0x5")].startsWith("cloud-services-internal-error: Not connected.")||t[$r("0x5")][$r("0x0")]($r("0x8a"))||t.message[$r("0x0")]($r("0x68"))))throw e;var t}))}),this._currentBufferDelay))}async[$r("0x7b")](){const e=this[$r("0x33")][$r("0x41")][$r("0x9a")](S);if(this[$r("0x93")]()&&(e[$r("0xa0")](),this[$r("0x52")]=!1),!this[$r("0xa4")]())return!0;const t=[...this[$r("0x65")]];for(const e of t)e[$r("0x1c")]=this._document[$r("0x5f")].isUndoneOperation(e);const n=this[$r("0x8e")][$r("0xc7")](t),r=Qr++,o=this[$r("0x8b")](t),s=await this._service[$r("0x94")](o,o[$r("0x70")],n);try{return await this[$r("0x89")](t,s,r)}catch(e){return this[$r("0xac")]($r("0x54"),e)}}async[$r("0x89")](e,t,n){if($r("0x83")in t)throw t[$r("0x83")];let r=!1;if(t.wereChangesApplied){t[$r("0x3f")]&&(this[$r("0x98")]=t[$r("0x3f")]),this._bufferedOperations=this[$r("0x65")][$r("0xb7")]((t=>!e[$r("0xc5")](t)));for(const n of e)n[$r("0x4e")]=$r("0x60")in t&&t[$r("0x60")]||void 0;this[$r("0x4f")](e),r=!0,this._currentBufferDelay=this[$r("0x85")]}else{const e=this[$r("0xb2")](t.data,t[$r("0xbe")])[$r("0xb7")]((e=>e.baseVersion>=this[$r("0x8c")]));await this[$r("0x8d")](e),r=this._handleExternalOperations(e,t[$r("0x36")],t.lastOperationId),this[$r("0x44")]=Math[$r("0x24")](this[$r("0x44")]/2)}return r?!this[$r("0xa4")]()||(this[$r("0xc9")](!0),!1):this[$r("0xac")]($r("0xc"))}_handleExternalOperations(e,t,n){try{const r={document:this[$r("0x61")],useRelations:!1,padWithNoOps:!0},{operationsA:s,operationsB:i,originalOperations:a}=(0,o.transformSets)(e,this[$r("0x65")],r);eo(s,this[$r("0x61")][$r("0x36")]),eo(i,t);for(const e of s){const t=a[$r("0x9a")](e);e[$r("0xb0")]=t?t._authorId:null}n&&(this[$r("0x8e")].setIdForTheLastOperation(e,n),this[$r("0x98")]=n),this[$r("0x65")]=[...i],this[$r("0x6d")](s),this[$r("0x4f")](e)}catch(e){return console[$r("0x83")](e),!1}return!0}[$r("0x6d")](e,t=!1){this[$r("0x33")].model[$r("0x39")]({isUndoable:!1,isLocal:!1},(t=>{for(const n of e)this[$r("0x3c")][$r("0x6f")](n),t[$r("0x4c")][$r("0xb5")](n),this.editor.model[$r("0xbc")](n)}))}[$r("0x4f")](e){e.forEach((e=>{const t=e[$r("0x5b")]();t._authorId=e._authorId,t[$r("0x5e")]=!!e._isInit,t[$r("0x4e")]=e[$r("0x4e")],t[$r("0x70")]+=this._offset,e._isDisconnection&&this[$r("0x6")][$r("0x6f")](t),this[$r("0xc0")][$r("0xb5")](t)}))}_handleReconnectionError(e){const t=this[$r("0x33")][$r("0x41")][$r("0x9a")]($r("0xc3")),n=this[$r("0x33")][$r("0x75")];e||(e=T(n,"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.")),t[$r("0x17")](e,{title:T(n,$r("0x10")),namespace:$r("0xa")}),this[$r("0x86")]=!0,clearTimeout(this._sendBufferedOperationsDelayId),this[$r("0x65")]=[],this[$r("0x33")][$r("0x41")].get(u)[$r("0xc1")]()}_setPendingAction(){this[$r("0x6c")]||(this[$r("0x6c")]=this[$r("0x33")][$r("0x41")].get(t.PendingActions)[$r("0x6f")](T(this[$r("0x33")][$r("0x75")],$r("0x42"))))}[$r("0xe")](){this._pendingAction&&(this[$r("0x33")][$r("0x41")][$r("0x9a")](t.PendingActions).remove(this[$r("0x6c")]),this._pendingAction=null)}[$r("0x8b")](e){const t=e[$r("0x2b")]((e=>e[$r("0x27")]()));return this._compressor[$r("0x31")](t)}[$r("0xb2")](e,t){const n=new Set;return this[$r("0xa5")].decompress(e)[$r("0x2b")](((e,r)=>{const s="init"==t[r][$r("0x2f")];if(s&&$r("0x66")==e[$r("0x99")]){const t=e[$r("0xc6")][$r("0x1")];if(!this[$r("0x61")].getRoot(t)){const e=new o.RootOperation(t,$r("0x5d"),!0,this[$r("0x61")],null);this[$r("0x61")].getRoot(t)[$r("0x71")]=!0,this[$r("0x61")].differ.bufferOperation(e)}}const i=o.OperationFactory[$r("0xad")](e,this[$r("0x61")]);if($r("0x3b")==i[$r("0x2f")])n[$r("0x6f")](e.rootName);else if("addRoot"==i[$r("0x2f")]){const t=this._document.getRoot(e[$r("0x47")]);t&&t[$r("0x14")]()&&!n[$r("0x97")](e[$r("0x47")])&&(t[$r("0x71")]=!1,this[$r("0x61")][$r("0x9")][$r("0xa6")](i[$r("0x18")]()))}return i[$r("0x1c")]=e[$r("0x1c")],i[$r("0x5e")]=s,i[$r("0xb0")]=s?null:t[r][$r("0x76")],i[$r("0x91")]="cs:removeUser"===t[r].type,i[$r("0x4e")]=t[r][$r("0x4e")],i}))}[$r("0x25")](){this._hasSelectionChanged=!0,this[$r("0x93")]()?this._sendBufferedOperationsDelayed():this[$r("0x52")]=!1}[$r("0x93")](){const e=this.editor[$r("0x41")].get(y).channelSessions[$r("0x9a")](this._channelId);return!this[$r("0x33")][$r("0x4b")]&&!!e&&e.length>1&&this[$r("0x52")]}[$r("0xa4")](){return this[$r("0x65")].length>0||this[$r("0x93")]()}}Zr[$r("0xaf")]=s.CollaborativeEditingService;class Xr extends Error{}function eo(e,t){for(const n of e)n[$r("0x70")]=t++}class to{constructor(e){this._ignoredOperations=e,this[$r("0x73")]=new WeakMap}[$r("0xc7")](e){let t=e[$r("0xb3")];for(;t--;){const r=e[t];if(!this[$r("0xd")][$r("0x97")](r)){if(!this[$r("0x73")][$r("0x97")](r)){const e=(0,n.uid)().slice(1,18);this[$r("0x73")][$r("0x51")](r,e)}return this[$r("0x73")][$r("0x9a")](r)}}}[$r("0x2e")](e,t){if(!t)return;let n=e[$r("0xb3")];for(;n--;){const r=e[n];this[$r("0xd")][$r("0x97")](r)||this[$r("0x73")][$r("0x51")](r,t)}}}var no,ro,oo=["RealTimeCollaborativeEditing","pluginName","requires"];no=oo,ro=477,function(e){for(;--e;)no.push(no.shift())}(++ro);var so=function(e,t){return oo[e-=0]};class io extends t.Plugin{static get[so("0x2")](){return[Zr]}static get[so("0x1")](){return so("0x0")}}const ao=["commentThreadResolved","_services","context","commentThreadId","keys","init","commentThreadReopened","mySessionId","unregister","Permissions","delete","commentThreadAdded","getComment","userId","comments","_terminateService","has","cloudservicescommentsadapter-disconnect-not-exist","startsWith","commentAdded","collaboration.channelId","_fetchMissingUsersForThreads","resolvedAt","addUser","plugins","get","reconnect","addComment","updateCommentThread","catch","reopen","cloudservicescommentsadapter-connect-already-connected","resolvedBy","set","createdAt","_setUpService","commentRemoved","config","CommentsService","addCommentThread","getMany","update","cloudservicescommentsadapter-service-not-exist","sessionAdd:","attributes","getCommentThread","disconnect","map","destroy","getUser","commentId","listenTo","_getService","from","message","content","removeComment","commentThreadUpdated","cloud-services-internal-error: Not connected.","_connectService","add","remove","assign","getCommentThreads","authorId","code","addToReconnectionStack","getConnectedSessions","resolve","CommentsRepository","reopenCommentThread","adapter","register","updateComment"];var co,uo;co=ao,uo=432,function(e){for(;--e;)co.push(co.shift())}(++uo);const lo=function(e,t){return ao[e-=0]};class po extends t.ContextPlugin{static get requires(){return[u,lo("0x7"),y,l.Users]}constructor(e){super(e),this[lo("0xd")]=new Map}async[lo("0x11")](){const e=this[lo("0xe")],n=e.plugins[lo("0x25")](lo("0x7"));if(e[lo("0x24")][lo("0x25")](u)[lo("0x4")](this),n[lo("0x9")]={addCommentThread:async({channelId:e,threadId:t,comments:n,resolvedAt:r,resolvedBy:o,context:s,attributes:i})=>{const a=await this[lo("0x40")](e)[lo("0x33")]({commentThreadId:t,comments:n[lo("0x3b")]((n=>{return o=e,{commentThreadId:t,commentId:(r=n)[lo("0x3e")],userId:r[lo("0x2")],content:r[lo("0x43")],documentId:o,createdAt:r.createdAt,attributes:r[lo("0x38")]||{}};var r,o})),resolvedAt:r,resolvedBy:o,context:s,attributes:i})[lo("0x29")](fo);return{threadId:a[lo("0xf")],comments:a[lo("0x1a")]}},getCommentThread:async({channelId:e,threadId:t})=>{const n=await this[lo("0x40")](e)[lo("0x39")](t).catch(fo);return await this._fetchMissingUsersForThreads([n]),{threadId:n[lo("0xf")],comments:n.comments.map(mo),context:n[lo("0xe")],resolvedAt:n.resolvedAt,resolvedBy:n[lo("0x2c")],attributes:n[lo("0x38")]||{}}},updateCommentThread:async({channelId:e,threadId:t,context:n,attributes:r})=>this[lo("0x40")](e)[lo("0x28")]({commentThreadId:t,context:n,attributes:r})[lo("0x29")](ho).catch(fo),resolveCommentThread:async({channelId:e,threadId:t})=>{const n=await this[lo("0x40")](e).resolveCommentThread(t)[lo("0x29")](ho)[lo("0x29")](fo);return{threadId:n.commentThreadId,resolvedAt:n[lo("0x22")],resolvedBy:n[lo("0x2c")]}},reopenCommentThread:async({channelId:e,threadId:t})=>this[lo("0x40")](e)[lo("0x8")](t)[lo("0x29")](ho)[lo("0x29")](fo),removeCommentThread:({channelId:e,threadId:t})=>this[lo("0x40")](e).removeCommentThread(t)[lo("0x29")](ho).catch(fo),addComment:({channelId:e,threadId:t,commentId:n,content:r,attributes:o})=>this[lo("0x40")](e)[lo("0x27")](t,n,r,o)[lo("0x29")](fo),updateComment:({channelId:e,threadId:t,commentId:n,content:r,attributes:o})=>this[lo("0x40")](e)[lo("0xb")](t,n,r,o)[lo("0x29")](ho)[lo("0x29")](fo),removeComment:({channelId:e,threadId:t,commentId:n})=>this[lo("0x40")](e)[lo("0x44")](t,n).catch(ho).catch(fo)},e instanceof t.Context){const t=e[lo("0x31")][lo("0x25")](lo("0x20")),n=e.plugins[lo("0x25")](y);await this._setUpService(t);const r=await this._services.get(t)[lo("0x5")]();this[lo("0x3f")](n,lo("0x37")+t,((e,{session:r})=>{r.id===n[lo("0x13")]&&(e.off(),this[lo("0xe")].plugins.get(lo("0x15")).setPermissions(r.permissions,t))})),n.register(t,r)}}async[lo("0x2f")](e){if(this[lo("0xd")].has(e))throw new n.CKEditorError(lo("0x2b"),null,{channelId:e});const t=this.context[lo("0x24")][lo("0x25")](lo("0x7")),r=new po.CommentsService(e);this[lo("0xd")][lo("0x2d")](e,r),this[lo("0x3f")](r,lo("0x17"),((e,n)=>{const{commentThreadId:r,documentId:o,context:s,attributes:i,resolvedAt:a,resolvedBy:c,comments:d}=n;t.getCommentThread(r)||t[lo("0x33")]({threadId:r,channelId:o,comments:d?d[lo("0x3b")](mo):[],context:s,attributes:i,resolvedAt:a,resolvedBy:c,isFromAdapter:!0})})),this.listenTo(r,lo("0x45"),((e,{commentThreadId:n,documentId:r,context:o,attributes:s})=>{t[lo("0x39")](n)&&t[lo("0x28")]({threadId:n,channelId:r,context:o,attributes:s,isFromAdapter:!0})})),this.listenTo(r,lo("0xc"),((e,{commentThreadId:n,resolvedBy:r,resolvedAt:o})=>{const s=t[lo("0x39")](n);s&&s[lo("0x6")]({resolvedBy:r,resolvedAt:o,isFromAdapter:!0})})),this[lo("0x3f")](r,lo("0x12"),((e,{commentThreadId:n})=>{const r=t[lo("0x39")](n);r&&r[lo("0x2a")]({isFromAdapter:!0})})),this.listenTo(r,"commentThreadRemoved",((e,{commentThreadId:n})=>{const r=t[lo("0x39")](n);r&&r[lo("0x49")]({isFromAdapter:!0})})),this[lo("0x3f")](r,lo("0x1f"),((e,n)=>{const r=n[lo("0xf")],o=t[lo("0x39")](r);o&&o.addComment({...mo(n),isFromAdapter:!0})})),this[lo("0x3f")](r,"commentUpdated",((e,{commentThreadId:n,commentId:r,content:o,attributes:s})=>{const i=t[lo("0x39")](n);if(i){const e=i.getComment(r);e&&e[lo("0x35")]({content:o,attributes:s,isFromAdapter:!0})}})),this[lo("0x3f")](r,lo("0x30"),((e,{commentThreadId:n,commentId:r})=>{const o=t[lo("0x39")](n);if(o){const e=o[lo("0x18")](r);e&&e[lo("0x49")]({isFromAdapter:!0})}})),await this[lo("0x47")](e)}[lo("0x3c")](){if(this[lo("0xe")]instanceof t.Context){const e=this[lo("0xe")][lo("0x31")][lo("0x25")](lo("0x20"));this[lo("0x1b")](e)}}[lo("0x1b")](e){if(!this[lo("0xd")][lo("0x1c")](e))throw new n.CKEditorError(lo("0x1d"),null,{channelId:e});this._getService(e)[lo("0x3a")](),this[lo("0xd")].delete(e)}async[lo("0x26")](){for(const e of this._services[lo("0x10")]())await this[lo("0x47")](e);if(this[lo("0xe")]instanceof t.Context){const e=this.context[lo("0x31")][lo("0x25")](lo("0x20")),t=this[lo("0xe")][lo("0x24")][lo("0x25")](y);t[lo("0x14")](e);const n=await this[lo("0xd")][lo("0x25")](e).getConnectedSessions();t[lo("0xa")](e,n)}}async[lo("0x47")](e){const{connection:t}=this.context.plugins[lo("0x25")](u),n=this.context[lo("0x24")].get(lo("0x7")),r=this[lo("0xd")][lo("0x25")](e),o=await r.connect(t);await this[lo("0x21")](o);const s=new Set(Array[lo("0x41")](n[lo("0x1")]({channelId:e}),(e=>e.id)));for(const e of o)s[lo("0x16")](e[lo("0xf")]);for(const e of s)n.getCommentThread(e)[lo("0x49")]({isFromAdapter:!0});for(const t of o){let r=n[lo("0x39")](t[lo("0xf")]);const{commentThreadId:o,context:s,attributes:i,resolvedBy:a,resolvedAt:c,deletedAt:d}=t;r||(r=n[lo("0x33")]({channelId:e,threadId:o,context:s,attributes:i||{},resolvedBy:a,resolvedAt:c,deletedAt:d,isFromAdapter:!0}));const u=new Set(Array.from(r[lo("0x1a")],(e=>e.id)));for(const e of t.comments)u.delete(e[lo("0x3e")]);for(const e of u)r[lo("0x18")](e).remove({isFromAdapter:!0});for(const e of t[lo("0x1a")]){const t=r[lo("0x18")](e[lo("0x3e")]);t?t[lo("0x43")]!==e.content&&t[lo("0x35")]({content:e[lo("0x43")],isFromAdapter:!0}):r[lo("0x27")](Object[lo("0x0")](mo(e),{isFromAdapter:!0}))}}}[lo("0x40")](e){if(!this[lo("0xd")][lo("0x1c")](e))throw new n.CKEditorError(lo("0x36"),null,{channelId:e});return this._services.get(e)}async[lo("0x21")](e){const t=this[lo("0xe")][lo("0x24")][lo("0x25")](l.Users),{connection:n}=this[lo("0xe")][lo("0x24")].get(u),r=new Set;for(const{resolvedBy:n,comments:o}of e){n&&!t[lo("0x3d")](n)&&r[lo("0x48")](n);for(const{userId:e}of o)t[lo("0x3d")](e)||r.add(e)}if(0===r.size)return;const o=await Hr.User[lo("0x34")](n,Array.from(r));for(const e of o)t[lo("0x3d")](e.id)||t[lo("0x23")](e)}}async function ho(e){if("404"!==e[lo("0x3")])throw e}function fo(e){if((t=e)[lo("0x42")][lo("0x1e")]("cloud-services-internal-error: Comments Service is not connected.")||t[lo("0x42")][lo("0x1e")](lo("0x46"))||t[lo("0x42")][lo("0x1e")]("cloud-services-internal-error: Request timeout."))return new Promise((()=>{}));var t;throw e}function mo(e){return{threadId:e[lo("0xf")],commentId:e.commentId,content:e[lo("0x43")],createdAt:e[lo("0x2e")],authorId:e[lo("0x19")],attributes:e[lo("0x38")]||{}}}po[lo("0x32")]=s.CommentsService;const yo=["then","_fetchMissingUsersForThreads","startsWith","off","find","size","getUser","connection","state","TrackChangesEditing","get","catch","listenTo","collaboration.channelId","plugins","adapter","attributes","connected","_bufferedRequests","delete","type","add","from","reconnect","connect","addToReconnectionStack","originalSuggestionId","hasSuggestion","editor","set","message","addSuggestionData","_waitForServiceReady","open","data","TrackChangesService","getMany","suggestionUpdated","_trackChangesService","values"];var go,bo;go=yo,bo=388,function(e){for(;--e;)go.push(go.shift())}(++bo);const Oo=function(e,t){return yo[e-=0]};class vo extends t.Plugin{static get requires(){return[po,Oo("0x15"),u]}constructor(e){super(e);const t=this[Oo("0x0")].config[Oo("0x16")](Oo("0x19"));this[Oo("0x1e")]=new Map,this._trackChangesService=new(vo[Oo("0x7")])(t)}init(){const e=this[Oo("0x0")][Oo("0x1a")][Oo("0x16")](u),t=this[Oo("0x0")][Oo("0x1a")][Oo("0x16")](Oo("0x15"));return t[Oo("0x1b")]={getSuggestion:async e=>{await this[Oo("0x4")]();const t=await this[Oo("0xa")][Oo("0x16")](e)[Oo("0x17")](wo);return await this._fetchMissingUsersForThreads([t]),t},addSuggestion:async({id:e,type:t,data:n,originalSuggestionId:r,attributes:o})=>{await this[Oo("0x4")]();const s={id:e,type:t,data:n,originalSuggestionId:r,attributes:o},i=await this._trackChangesService[Oo("0x21")](e,t,n,r,o)[Oo("0x17")]((t=>{if(xo(t))return new Promise((t=>{this._bufferedRequests[Oo("0x1")](e,{resolve:t,suggestionData:s})}));throw t}));return this._bufferedRequests[Oo("0x1f")](e),i},updateSuggestion:async(e,t)=>{if(await this[Oo("0x4")](),Oo("0x5")!==t[Oo("0x14")])return this[Oo("0xa")].update(e,t)[Oo("0x17")](wo)}},this[Oo("0x18")](this[Oo("0xa")],Oo("0x9"),((e,n)=>{t[Oo("0x27")](n.id)&&(t.getSuggestion(n.id).attributes=n[Oo("0x1c")])})),this._trackChangesService[Oo("0x24")](e[Oo("0x13")])[Oo("0xc")]((n=>(e[Oo("0x25")](this),this._fetchMissingUsersForThreads(n).then((()=>{for(const e of n)t[Oo("0x3")](e)._saved=!0})))))}async[Oo("0x23")](){const e=this[Oo("0x0")][Oo("0x1a")][Oo("0x16")](Oo("0x15")),{connection:t}=this[Oo("0x0")][Oo("0x1a")][Oo("0x16")](u),n=await this[Oo("0xa")][Oo("0x24")](t);await this._fetchMissingUsersForThreads(n);for(const{suggestionData:e,resolve:t}of this[Oo("0x1e")][Oo("0xb")]()){let r=n[Oo("0x10")]((t=>t.id===e.id));r||(r=await this[Oo("0xa")].add(e.id,e[Oo("0x20")],e[Oo("0x6")],e[Oo("0x26")])),t(r)}for(const t of n)e[Oo("0x27")](t.id)||e.addSuggestionData(t)}async[Oo("0x4")](){this[Oo("0xa")].isConnected||await new Promise((e=>{this[Oo("0x18")](this[Oo("0xa")],Oo("0x1d"),(t=>{t[Oo("0xf")](),e()}))}))}async[Oo("0xd")](e){const t=this[Oo("0x0")].plugins[Oo("0x16")](l.Users),{connection:n}=this.editor.plugins[Oo("0x16")](u),r=new Set;for(const{authorId:n}of e)t[Oo("0x12")](n)||r.add(n);if(0===r[Oo("0x11")])return;const o=await Hr.User[Oo("0x8")](n,Array[Oo("0x22")](r));for(const e of o)t.getUser(e.id)||t.addUser(e)}}function wo(e){if(xo(e))return new Promise((()=>{}));throw e}function xo(e){return e[Oo("0x2")][Oo("0xe")]("cloud-services-internal-error: Not connected.")||e[Oo("0x2")][Oo("0xe")]("cloud-services-internal-error: Request timeout.")}vo[Oo("0x7")]=s.TrackChangesService;const _o=["get","connected","_terminateService","isThreadsLoadingPaused","CommentsRepository","RealTimeCollaborativeComments","change:state","plugins","_setUpService","ready","pluginName","listenTo","data","init","collaboration.channelId","CommentsEditing","editor","switchReadOnly","Comments","config"];var Io,So;Io=_o,So=359,function(e){for(;--e;)Io.push(Io.shift())}(++So);const Po=function(e,t){return _o[e-=0]};class To extends t.Plugin{static get requires(){return[Po("0x13"),po,io,u]}static get[Po("0xb")](){return Po("0x6")}[Po("0xe")](){const e=this[Po("0x11")][Po("0x8")][Po("0x1")](u),t=this.editor[Po("0x8")][Po("0x1")](Po("0x10")),n=this[Po("0x11")][Po("0x8")][Po("0x1")](po);return this[Po("0x11")][Po("0xd")].once(Po("0xa"),(()=>{this[Po("0xc")](e,Po("0x7"),((e,n,r)=>{t[Po("0x4")]="connected"!==r}))})),this[Po("0xc")](e,"change:state",((e,t,n)=>{this[Po("0x11")][Po("0x8")][Po("0x1")](Po("0x5"))[Po("0x12")](Po("0x2")!==n)})),n[Po("0x9")](this.editor[Po("0x0")][Po("0x1")](Po("0xf")))}destroy(){this[Po("0x11")].plugins[Po("0x1")](po)[Po("0x3")](this[Po("0x11")][Po("0x0")][Po("0x1")](Po("0xf"))),super.destroy()}}var Ao,Co,ko=["requires","pluginName","TrackChanges","RealTimeCollaborativeTrackChanges"];Ao=ko,Co=229,function(e){for(;--e;)Ao.push(Ao.shift())}(++Co);var Eo=function(e,t){return ko[e-=0]};class jo extends t.Plugin{static get[Eo("0x3")](){return[To,vo,Eo("0x1")]}static get[Eo("0x0")](){return Eo("0x2")}}const Ro=["_revisionTracker","config","connection","isEnabled","_isConnected","remove","_oldOffset","_fetchMissingUsers","getOperations","_revisionDataBuilder","_getLatestVersionFromServerOperations","init","get","addUser","data","isBundleUploaded","cloud-services-internal-error: Revision History Service is not connected.","fromVersion","baseVersion","destroy","startsWith","affectsData","change:_isConnected","_offset","_getLatestVersion","length","currentRevision","RevisionHistoryService","_fixRevision","then","plugins","_lastRequestId","_bufferUpdate","has","wrongRequestId","map","authorsIds","bind","state","isConnected","updateRevisions","_revisionHistoryService","cloud-services-internal-error: Request timeout.","addToReconnectionStack","creatorId","revisionsUpdated","serverHistory","once","RevisionTracker","keys","_bufferedUpdates","_handleReconnectionError","isEmptyCurrent","reverse","_handleRevisionsUpdate","reconnect","code","authors","getMany","catch","_revisions","repository","_waitForServiceReady","editor","getUser","_createCurrentRevision","marker","message","collaboration.channelId","sessionId","_update","off","max","adapter","toVersion","from","_isPendingUpdate","buildRevisionData","diffData","reInit","_preventResendingRevisionData","requires","CONNECTED","_startingVersion"];var Do,Mo;Do=Ro,Mo=150,function(e){for(;--e;)Do.push(Do.shift())}(++Mo);const No=function(e,t){return Ro[e-=0]};class Vo extends t.Plugin{static get[No("0xf")](){return[u,Zr,No("0x42"),y,l.Users]}constructor(e){super(e);const t=this.editor[No("0x13")][No("0x1e")](No("0x2"));this._lastRequestId=null,this[No("0x12")]=this[No("0x51")][No("0x30")][No("0x1e")](No("0x42")),this[No("0x3b")]=new(Vo[No("0x2d")])(t)}async[No("0x1d")](){const e=this[No("0x51")][No("0x30")][No("0x1e")](Zr),t=e[No("0x40")],r=this[No("0x51")].plugins[No("0x1e")](u);this[No("0x12")].setSource({history:t,getLatestVersion:()=>this[No("0x2a")](),getCurrentRevisionId:()=>e[No("0x3")]});const o=this[No("0x51")][No("0x13")][No("0x1e")]("cloudServices.bundleVersion")||n.version,i=await s.EditorService[No("0x21")](r.connection,o);this._revisionTracker[No("0x7")]={getRevision:async({revisionId:e})=>(await this[No("0x50")](),await this._revisionHistoryService.getRevision(e)),updateRevisions:async e=>{await this[No("0x50")]();const t=this[No("0x12")][No("0x2c")];if(i&&1===e.length&&e[0].id===t.id)return e;for(const n of e)n.id===t.id&&(n[No("0x46")]=n.fromVersion===n[No("0x8")]);return this[No("0x3b")][No("0x3a")](e,this[No("0x31")])[No("0x2f")]((t=>(this[No("0x31")]=t,e)))[No("0x4d")]((t=>{if(Bo(t)||"400"===t[No("0x4a")]&&void 0!==t[No("0x20")][No("0x34")]){for(const t of e)!this[No("0x12")][No("0x4f")].getRevision(t.id)||this._revisionTracker[No("0x32")](t.id,t,!1);if(Bo(t))throw t;return e}throw t}))}},this.listenTo(this._revisionHistoryService,No("0x3f"),((e,{revisionsData:t,requestId:n})=>{Math.max(...t[No("0x35")]((e=>e.toVersion)))>this[No("0x1c")]()-1?this._getLatestVersion()[No("0x2f")]((()=>{this[No("0x48")](t,n)})):this[No("0x48")](t,n)}));const{revisions:a,requestId:c}=await this[No("0x3b")].connect(r[No("0x14")]);r[No("0x3d")](this),this[No("0x31")]=c,await this[No("0x19")](a);for(const e of a)this[No("0x12")].addRevisionData(e);this.listenTo(e,No("0x28"),((t,n,r)=>{r&&(this[No("0x18")]=e[No("0x29")],t[No("0x5")]())})),this[No("0x12")][No("0x37")](No("0x15")).to(r,No("0x38"),(e=>e===s.WEB_SOCKET_GATEWAY_STATES[No("0x10")]))}async reconnect(){const e=this[No("0x51")][No("0x30")].get(u),t=this[No("0x51")][No("0x30")][No("0x1e")](Zr),n=async()=>{const n=this[No("0x12")][No("0x2c")],r=n.id,o=r!==t[No("0x3")];if(o){const e=t[No("0x29")]-this._oldOffset,o=this[No("0x1c")]();if(this[No("0x12")][No("0x1b")][No("0xd")](),n.toVersion+e!==o){const t=n[No("0x23")]+e,r=this[No("0x51")].plugins[No("0x1e")](l.Users),s=this[No("0x12")][No("0xb")]({revision:n,from:t,to:o});s.id=n.id;const i=s[No("0x36")].map((e=>r[No("0x52")](e)));n[No("0x4")]({...s,authors:i},!0),this[No("0x12")][No("0x32")](n.id,s,!0)}this[No("0x12")][No("0x11")]=o,n[No("0x8")]===n[No("0x23")]&&!this._revisionTracker[No("0x44")][No("0x33")](r)&&this[No("0x12")][No("0x4f")][No("0x4e")][No("0x17")](r),this[No("0x12")][No("0x53")](o)}const{revisions:s,requestId:i}=await this[No("0x3b")][No("0x49")](e[No("0x14")],this[No("0x31")]);o&&s[No("0x2b")]>0?t[No("0x45")]():(await this[No("0x19")](s),this[No("0x48")](s,i),this[No("0x12")].sendBufferedUpdates())};return t[No("0x16")]?n():new Promise(((e,r)=>{t[No("0x41")](No("0x28"),(()=>{n()[No("0x2f")](e)[No("0x4d")](r)}))}))}[No("0x25")](){super[No("0x25")]()}async[No("0x50")](){this._revisionHistoryService[No("0x39")]||await new Promise((e=>{this.listenTo(this[No("0x3b")],"connected",(t=>{t.off(),e()}))}))}[No("0x1c")](){const e=this[No("0x51")].plugins[No("0x1e")](Zr).serverHistory[No("0x1a")]()[No("0x47")]();for(const t of e)if(No("0x0")!==t.type||t[No("0x27")])return t[No("0x24")]+1}[No("0x2a")](){const e=this[No("0x51")][No("0x30")][No("0x1e")](Zr);return new Promise((t=>{e[No("0xa")]?e[No("0x41")]("change:_isPendingUpdate",(()=>{t(this[No("0x1c")]())})):t(this[No("0x1c")]())}))}[No("0x48")](e,t){const n=this[No("0x12")].repository;this._lastRequestId=t;for(const t of e){const e=n.getRevision(t.id);if(e){if((t[No("0x23")]||t.toVersion)&&(t[No("0xc")]=null),e===this[No("0x12")].currentRevision){const n=Math[No("0x6")](e[No("0x8")],t.toVersion),r=Math.max(e[No("0x23")],t[No("0x23")]);let o;e[No("0x8")]===t[No("0x8")]&&e.fromVersion===t[No("0x23")]?(o=!0,this._preventResendingRevisionData(t)):t[No("0x8")]===n&&t.fromVersion===r?o=!1:(e[No("0x8")]===n&&e[No("0x23")]===r||this[No("0x2e")]({revision:e,from:r,to:n}),o=!0),o&&(delete t[No("0x23")],delete t[No("0x8")],delete t[No("0xc")],delete t.createdAt,delete t.authorsIds)}this[No("0x12")].setRevisionData(t),this._preventResendingRevisionData(t)}else this._revisionTracker.addRevisionData(t)}const r=n.getRevisions();r[No("0x47")]();for(let e=0;e<r.length-1;e++){const t=r[e],n=r[e+1];if(t[No("0x23")]<n[No("0x8")]){const e=n[No("0x8")],r=Math[No("0x6")](e,t[No("0x8")]);this[No("0x2e")]({revision:t,from:e,to:r})}}}[No("0x2e")]({revision:e,from:t,to:n}={}){const r=this.editor[No("0x30")].get(l.Users),o=this[No("0x12")][No("0xb")]({revision:e,from:t,to:n});o[No("0x4b")]=o[No("0x36")].map((e=>r[No("0x52")](e))),e[No("0x4")](o)}[No("0xe")](e){const t={};t.id=e.id;for(const n of Object[No("0x43")](e))"id"!==n&&(t[n]=void 0);this._revisionTracker[No("0x32")](t.id,t,!0)}async[No("0x19")](e){const t=this.editor[No("0x30")][No("0x1e")](l.Users),{connection:n}=this[No("0x51")].plugins[No("0x1e")](u),r=new Set;for(const t of e){for(const e of t.authorsIds)s(e);t[No("0x3e")]&&s(t[No("0x3e")])}if(0===r.size)return;const o=await Hr.User[No("0x4c")](n,Array[No("0x9")](r));for(const e of o)t.getUser(e.id)||t[No("0x1f")](e);function s(e){t[No("0x52")](e)||r.add(e)}}}function Bo(e){return e[No("0x1")].startsWith(No("0x22"))||e[No("0x1")].startsWith("cloud-services-internal-error: Not connected.")||e.message[No("0x26")](No("0x3c"))}Vo[No("0x2d")]=s.RevisionHistoryService;var Uo,Jo,qo=["requires","RealTimeCollaborativeRevisionHistory","RevisionHistory","pluginName"];Uo=qo,Jo=263,function(e){for(;--e;)Uo.push(Uo.shift())}(++Jo);var Go=function(e,t){return qo[e-=0]};class Yo extends t.Plugin{static get[Go("0x1")](){return[Go("0x3"),Vo,io]}static get[Go("0x0")](){return Go("0x2")}}var Lo=Function.prototype,Fo=Object.prototype,Ho=Lo.toString,zo=Fo.hasOwnProperty,Ko=Ho.call(Object);const Wo=function(e){if(!ht(e)||"[object Object]"!=Oe(e))return!1;var t=hn(e);if(null===t)return!0;var n=zo.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ho.call(n)==Ko};const $o=function(e){return ht(e)&&1===e.nodeType&&!Wo(e)},Qo=["setTemplate","bindTemplate","ck-presence-list__counter","ck-presence-list__counter--hidden","CONNECTED_USERS","div","isHidden","usersCount","set"];var Zo,Xo;Zo=Qo,Xo=173,function(e){for(;--e;)Zo.push(Zo.shift())}(++Xo);const es=function(e,t){return Qo[e-=0]};class ts extends r.View{constructor(e){super(e);const t=this[es("0x8")];this[es("0x6")]("usersCount",0),this.set(es("0x4"),!0),this[es("0x7")]({tag:es("0x3"),attributes:{class:["ck",es("0x0"),t.if(es("0x4"),es("0x1"))]},children:[{text:t.to(es("0x5"),(t=>T(e,es("0x2"),t)))}]})}}const ns=["ck-presence-list__list","fire","div","createCollection","bindTemplate","setTemplate","items"];var rs,os;rs=ns,os=146,function(e){for(;--e;)rs.push(rs.shift())}(++os);const ss=function(e,t){return ns[e-=0]};class is extends r.View{constructor(e){super(e),this[ss("0x0")]=this[ss("0x4")]();const t=this[ss("0x5")];this[ss("0x6")]({tag:ss("0x3"),attributes:{class:["ck",ss("0x1")]},children:this.items,on:{click:t.to((()=>this[ss("0x2")]("execute")))}})}}var as=__webpack_require__(8236),cs={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};b()(as.Z,cs);as.Z.locals;const ds=["ck-rounded-corners","counterView","listenTo","inlineListView","tooltipPosition","set","first","locale","ck-presence-list--collapsed","items","setTemplate","ck-reset","bindTemplate","isCollapsed"];var us,ls;us=ds,ls=384,function(e){for(;--e;)us.push(us.shift())}(++ls);const ps=function(e,t){return ds[e-=0]};class hs extends r.View{constructor(e){super(e);const t=this[ps("0x6")];this[ps("0xd")](ps("0x7"),!0),this[ps("0x9")]=new ts(this[ps("0x1")]),this[ps("0xb")]=new is(e),this[ps("0xa")](this[ps("0xb")][ps("0x3")],"change",(()=>{for(const e of this[ps("0xb")].items)e.tooltipPosition="s";this[ps("0xb")][ps("0x3")].first&&(this[ps("0xb")][ps("0x3")][ps("0x0")][ps("0xc")]="se")})),this[ps("0x4")]({tag:"div",attributes:{class:["ck","ck-presence-list",ps("0x5"),ps("0x8"),t.if(ps("0x7"),ps("0x2"))]},children:[this[ps("0x9")],this[ps("0xb")]]})}}var fs,ms,ys=["setTemplate","ck-presence-list__dropdown-list","items","createCollection","div"];fs=ys,ms=432,function(e){for(;--e;)fs.push(fs.shift())}(++ms);var gs=function(e,t){return ys[e-=0]};class bs extends r.View{constructor(e){super(e),this[gs("0x0")]=this[gs("0x1")](),this[gs("0x3")]({tag:gs("0x2"),attributes:{class:["ck",gs("0x4")]},children:[{tag:gs("0x2"),attributes:{class:["ck","ck-presence-list__dropdown-list-wrapper"]},children:this[gs("0x0")]}]})}}const Os=["name","true","tag","bindTemplate","execute","ck-presence-list__marker","getBackgroundColorClass","div","userView","button","span"];var vs,ws;vs=Os,ws=395,function(e){for(;--e;)vs.push(vs.shift())}(++ws);const xs=function(e,t){return Os[e-=0]};class _s extends r.View{constructor(e,t,n){super(e);const r=this[xs("0x4")];this[xs("0x9")]=new l.UserView(e,t);const o={tag:xs("0x8"),attributes:{class:["ck","ck-presence-list__dropdown-list-item"]},children:[this[xs("0x9")],{tag:xs("0x0"),attributes:{class:["ck","ck-user__full-name"]},children:[{text:t[xs("0x1")]}]},{tag:xs("0x0"),attributes:{class:["ck",xs("0x6"),t.color[xs("0x7")]()],"aria-hidden":xs("0x2")}}]};n&&(o[xs("0x3")]=xs("0xa"),o.on={click:r.to((()=>this.fire(xs("0x5"))))}),this.setTemplate(o)}}const Is=["userView","hasTooltip","bindTemplate","set","tooltipPosition","setTemplate","ck-presence-list__list-item__tooltip","ck-presence-list__list-item","ck-presence-list__marker","div","tag","color","getBackgroundColorClass","fire","name","span","markerView"];var Ss,Ps;Ss=Is,Ps=111,function(e){for(;--e;)Ss.push(Ss.shift())}(++Ps);const Ts=function(e,t){return Is[e-=0]};class As extends r.View{constructor(e,t,n){super(e);const r=this[Ts("0xa")];this[Ts("0xb")](Ts("0x9"),!0),this.set(Ts("0xc"),""),this[Ts("0x8")]=new l.UserView(e,t),this[Ts("0x7")]=new Cs(e,t);const o={tag:Ts("0x0"),attributes:{class:["ck",Ts("0xf")],"data-cke-tooltip-text":this[Ts("0x8")][Ts("0x5")],"data-cke-tooltip-position":r.to(Ts("0xc")),"data-cke-tooltip-disabled":r.to(Ts("0x9"),(e=>!e)),"data-cke-tooltip-class":Ts("0xe")},children:[this.userView,this[Ts("0x7")]]};n&&(o[Ts("0x1")]="button",o.on={click:r.to((()=>this[Ts("0x4")]("execute")))}),this.setTemplate(o)}}class Cs extends r.View{constructor(e,t){super(e),this[Ts("0xd")]({tag:Ts("0x6"),attributes:{class:["ck",Ts("0x10"),t[Ts("0x2")][Ts("0x3")]()],"aria-hidden":"true"}})}}const ks=["presenceDropdownView","lastConnectedUsers","define","presenceList","plugins","content","allConnectedUsers","presencelist-collapseat-invalid-format","_allConnectedUsers","bodyCollection","_handleUserRemove","listenTo","bind","set","add","class","_handleUserAdd","get","bindTo","remove","isVisible","balloonPanelView","context","counterView","view","hasTooltip","usersCount","presenceList.container","appendChild","presenceList.collapseAt","items","length","using","isCollapsed","_createView","destroy","from","render","element","showDropdown","onClick","inlineListView","unpin","config","detachFromDom","locale","hideDropdown","isRendered","ck ck-presence-list__balloon","execute"];var Es,js;Es=ks,js=290,function(e){for(;--e;)Es.push(Es.shift())}(++js);const Rs=function(e,t){return ks[e-=0]};class Ds extends t.ContextPlugin{constructor(e){super(e),this[Rs("0x20")].config[Rs("0xc")](Rs("0xd"),{collapseAt:6});const t=e[Rs("0x3")][Rs("0x1b")](Rs("0x27"));if("number"!=typeof t)throw new n.CKEditorError(Rs("0x11"),this);if(t<1)throw new n.CKEditorError(Rs("0x11"),this);this[Rs("0x12")]=this[Rs("0x20")][Rs("0xe")][Rs("0x1b")](y)[Rs("0x10")],this[Rs("0x17")](Rs("0x24"),0),this[Rs("0xb")]=new n.Collection,this.balloonPanelView=new r.BalloonPanelView,this[Rs("0x1f")][Rs("0x19")]=Rs("0x8"),this.view=this[Rs("0x2c")](),this[Rs("0xa")]=void 0}static get requires(){return[y]}init(){for(const e of this[Rs("0x12")])this[Rs("0x1a")](e);this[Rs("0x15")](this._allConnectedUsers,Rs("0x18"),((e,t)=>{this[Rs("0x1a")](t)})),this[Rs("0x15")](this[Rs("0x12")],"remove",((e,t)=>{this[Rs("0x14")](t)}))}[Rs("0x2c")](){const e=this.context,t=new hs(this[Rs("0x20")][Rs("0x5")]),o=this[Rs("0x1f")];if(!$o(e[Rs("0x3")][Rs("0x1b")](Rs("0x25"))))throw new n.CKEditorError("presencelist-missing-container",this);return t[Rs("0x21")][Rs("0x16")](Rs("0x24")).to(this),t[Rs("0x16")](Rs("0x2b")).to(this,Rs("0x24"),(n=>{const r=n>=e[Rs("0x3")].get(Rs("0x27"));return t[Rs("0x21")].isHidden=!(1==n||r),r||this[Rs("0x6")](),r})),t[Rs("0x1")].items[Rs("0x1c")](this[Rs("0xb")]).using((n=>{const r=e[Rs("0x3")][Rs("0x1b")](Rs("0xd")),o=new As(e[Rs("0x5")],n,!!r[Rs("0x0")]);return o.bind(Rs("0x23")).to(t,Rs("0x2b"),(e=>!e)),r[Rs("0x0")]&&this[Rs("0x15")](o,Rs("0x9"),(()=>{this[Rs("0x22")][Rs("0x2b")]||r[Rs("0x0")](n,o[Rs("0x30")])})),o})),this.listenTo(t[Rs("0x1")],Rs("0x9"),(()=>{this[Rs("0xa")]?this[Rs("0x6")]():this[Rs("0x22")][Rs("0x2b")]&&this[Rs("0x31")]()})),t[Rs("0x2f")](),o[Rs("0x2f")](),(0,r.clickOutsideHandler)({emitter:t,activator:()=>o[Rs("0x1e")],contextElements:[o[Rs("0x30")],t[Rs("0x1")].element],callback:()=>this.hideDropdown()}),e[Rs("0x3")][Rs("0x1b")]("presenceList.container")[Rs("0x26")](t[Rs("0x30")]),this.bodyCollection=new r.BodyCollection(this.context[Rs("0x5")]),this[Rs("0x13")].attachToDom(),this[Rs("0x13")].add(o),t}[Rs("0x1a")](e){this.usersCount++,5==this[Rs("0xb")].length&&this[Rs("0xb")][Rs("0x1d")](0),this[Rs("0xb")][Rs("0x18")](e)}[Rs("0x14")](e){if(this.usersCount--,this.lastConnectedUsers[Rs("0x1b")](e.id)&&(this[Rs("0xb")][Rs("0x1d")](e.id),this[Rs("0xb")][Rs("0x29")]<this[Rs("0x24")]))for(const e of Array[Rs("0x2e")](this[Rs("0x12")]).reverse())if(!this[Rs("0xb")][Rs("0x1b")](e.id))return void this[Rs("0xb")][Rs("0x18")](e,0)}[Rs("0x31")](){if(this[Rs("0xa")])return;this[Rs("0xa")]=new bs(this[Rs("0x20")].locale);const e=this.context[Rs("0x3")].get(Rs("0xd"));this[Rs("0xa")][Rs("0x28")].bindTo(this._allConnectedUsers)[Rs("0x2a")]((t=>{const n=new _s(this[Rs("0x20")][Rs("0x5")],t,!!e[Rs("0x0")]);return e[Rs("0x0")]&&this[Rs("0x15")](n,Rs("0x9"),(()=>{e[Rs("0x0")](t,n[Rs("0x30")])})),n})),this[Rs("0x1f")].content[Rs("0x18")](this.presenceDropdownView),this[Rs("0x1f")].pin({target:this[Rs("0x22")].inlineListView.element})}[Rs("0x6")](){this.presenceDropdownView&&(this[Rs("0x1f")][Rs("0x2")](),this[Rs("0x1f")][Rs("0xf")][Rs("0x1d")](this.presenceDropdownView),this.presenceDropdownView.destroy(),this[Rs("0xa")]=void 0)}destroy(){super[Rs("0x2d")](),this[Rs("0x22")]&&this[Rs("0x22")][Rs("0x7")]&&this[Rs("0x22")].destroy(),this[Rs("0x13")]&&this.bodyCollection[Rs("0x4")]()}}var Ms,Ns,Vs=["pluginName","PresenceList"];Ms=Vs,Ns=457,function(e){for(;--e;)Ms.push(Ms.shift())}(++Ns);var Bs=function(e,t){return Vs[e-=0]};class Us extends t.ContextPlugin{static get requires(){return[y,Ds]}static get[Bs("0x1")](){return Bs("0x0")}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;(0,n.ObservableMixin)();(0,n.EmitterMixin)()})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();
5
+ */(()=>{var __webpack_modules__={6732:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e,t,n=null,r={}){super("cloud-services-internal-error: "+e),this.context=t,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new n(function(e){let t="cloud-services-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}t.default=n},9073:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new n(function(e){let t="cloud-services-server-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}t.default=n},247:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const o=n(5003),s=n(2209),i=r(n(822)),a=r(n(3825)),c=r(n(5834)),u=r(n(4721)),d=r(n(4053)),l=r(n(5184)),p=r(n(3297)),h=r(n(3136)),f=r(n(6732)),m=r(n(6315)),g=r(n(2663)),y=r(n(3510));t._SERVICE=1;class b extends((0,s.EmitterMixin)()){constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:(0,o.v4)(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new c.default(this.getId(),t.buffers,t.types,this._bundleVersion,n);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new f.default("Cannot reconnect to already connected service.",e);return this._connect(e,new d.default(this.getId(),t,this._bundleVersion))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async getDocumentDetails(){const e=new y.default(this.getId());if(!this._wsGateway)throw new m.default("Collaborative Editing",this);const n=await this._wsGateway._sendRequest(t._SERVICE,y.default.TYPE,i.default.encode(e));return i.default.decode(n,g.default)}async sendOperations(e,n,r){if(!e||!e.types||!e.types.length)throw new f.default("Cannot send empty update.",this._wsGateway);const o="number"==typeof n?n:parseInt(n);if(!Number.isInteger(o)||o<0)throw new f.default("Base version not provided.",this._wsGateway);const s=new u.default(this.getId(),e.buffers,e.types,o,[],r);if(!this._wsGateway||!this._isConnected)throw new m.default("Collaborative Editing",this);const a=await this._wsGateway._sendRequest(t._SERVICE,u.default.TYPE,i.default.encode(s));return i.default.decode(a,l.default)}async getConnectedSessions(){if(!this._isConnected)throw new m.default("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await a.default.getConnectedSessions(this._wsGateway,this._id,t._SERVICE)),this._connectedSessions}static getConnectedSessions(e,n){return a.default.getConnectedSessions(e,n,t._SERVICE)}async _connect(e,n){if(this.isConnected())return;if(e.state!==h.default.STATE_CONNECTED)throw new f.default("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,n.constructor.TYPE,i.default.encode(n)),o=i.default.decode(r,p.default);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:h.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o.channel),this._isConnected=!0,this.fire("connected"),o}_connectToChannel(e,n){this._channel=e._getChannel(t._SERVICE,n),this.listenTo(this._channel,this._channel.getEventName(u.default.TYPE),((e,t)=>{const n=i.default.decode(t,u.default);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(e){e===h.default.STATE_DISCONNECTED&&this.disconnect()}}b._SERVICE=t._SERVICE,t.default=b},260:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4229));class s extends o.default{static toJSON({createdAt:e,...t}){const n={...t};return(null==e?void 0:e.toISOString)&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}t.default=s,s.DESCRIPTOR_NAME="OperationMetadataDescriptor",s.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}}},2421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];let r=0;for(const o of e)if(0!==o){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r])}return n}}},5834:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n,r,o=""){super(),this.id=e,this.buffers=t,this.types=n,this.bundleVersion=r,this.lastOperationId=o}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,bundleVersion:this.bundleVersion,lastOperationId:this.lastOperationId}}static fromJSON(e){return new s(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}t.default=s,s.TYPE="11",s.READABLE_TYPE_NAME="connectToDocument",s.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},lastOperationId:{type:"string",id:5}}}},4053:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n){super(),this.id=e,this.lastKnowVersion=t,this.bundleVersion=n}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(e){return new s(e.id,e.lastKnowVersion,e.bundleVersion)}}t.default=s,s.TYPE="12",s.READABLE_TYPE_NAME="reconnectToDocument",s.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}}},4721:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(2421)),i=r(n(260));class a extends o.default{constructor(e,t,n,r,o=[],s=""){super(),this.id=e,this.buffers=t,this.types=n,this.baseVersion=r,this.metadata=o,this.lastOperationId=s}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,lastOperationId:this.lastOperationId}}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,baseVersion:this.baseVersion,metadata:s.default.removeUnnecessaryMetadata(this.types,this.metadata).map(i.default.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new a(e.id,e.buffers,e.types,e.baseVersion,s.default.prepareMetadataForOperations(e.types,e.metadata).map(i.default.fromJSON),e.lastOperationId)}}t.default=a,a.TYPE="13",a.READABLE_TYPE_NAME="updateDocument",a.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",a.DESCRIPTOR={fields:{id:{type:"string",id:1},baseVersion:{type:"uint32",id:2},buffers:{rule:"repeated",type:"bytes",id:3},types:{rule:"repeated",type:"uint32",id:4},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:6},lastOperationId:{type:"string",id:7}}}},3510:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="14",s.READABLE_TYPE_NAME="getDocumentDetails",s.DESCRIPTOR_NAME="GetDocumentDetailsMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}}},3297:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(2421)),i=r(n(260));class a extends o.default{constructor(e,t,n=[],r=[],o=0,s=[],i=null,a="",c="",u=null){super(),this.channel=e,this.version=t,this.buffers=n,this.types=r,this.offset=o,this.metadata=s,this.initData=i,this.sessionId=a,this.lastOperationId=c,this.sessionCreatedAt=u}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:s.default.removeUnnecessaryMetadata(this.types,this.metadata).map(i.default.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new a(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let n=null;return!0===e.isInitialized?n=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(n=e.initData),a.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:s.default.prepareMetadataForOperations(e.types,e.metadata).map(i.default.fromJSON),initData:n,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}t.default=a,a.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",a.DESCRIPTOR={fields:{channel:{type:"string",id:1},offset:{type:"uint32",id:2},version:{type:"uint32",id:3},buffers:{rule:"repeated",type:"bytes",id:4},types:{rule:"repeated",type:"uint32",id:5},metadata:{rule:"repeated",type:i.default.DESCRIPTOR_NAME,id:7},initData:{type:"string",id:8},isInitialized:{type:"bool",id:9},sessionId:{type:"string",id:10},lastOperationId:{type:"string",id:11},sessionCreatedAt:{type:"string",id:12}}}},5184:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(2421)),i=r(n(260));class a extends o.default{constructor(e,t=[],n=[],r=[],o="",s=null){super(),this.version=e,this.buffers=t,this.types=n,this.metadata=r,this.lastOperationId=o,this.lastOperationAcceptedAt=s}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){var e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:s.default.removeUnnecessaryMetadata(this.types,this.metadata).map(i.default.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new a(e.version,e.buffers,e.types,s.default.prepareMetadataForOperations(e.types,e.metadata).map(i.default.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new a(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}t.default=a,a.DESCRIPTOR_NAME="CollaborativeEditingResponse",a.DESCRIPTOR={fields:{version:{type:"uint32",id:1},buffers:{rule:"repeated",type:"bytes",id:2},types:{rule:"repeated",type:"uint32",id:3},metadata:{rule:"repeated",type:"OperationMetadataDescriptor",id:5},lastOperationId:{type:"string",id:6},lastOperationAcceptedAt:{type:"string",id:7}}}},2663:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,n,r,o;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(o=this.currentDocumentSession)||void 0===o?void 0:o.lastOperationId}}toJSON(){var e,t,n,r,o;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(o=this.currentDocumentSession)||void 0===o?void 0:o.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,n=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new s(t,n)}}t.default=s,s.DESCRIPTOR_NAME="GetDocumentDetailsResponse",s.DESCRIPTOR={fields:{lastDocumentSessionId:{type:"string",id:1},lastDocumentSessionOperationId:{type:"string",id:2},currentDocumentSessionId:{type:"string",id:3},currentDocumentSessionVersion:{type:"uint32",id:4},currentDocumentSessionOperationId:{type:"string",id:5}}}},1740:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=n(2209),c=i(n(822)),u=i(n(8262)),d=i(n(6689)),l=i(n(7566)),p=i(n(1376)),h=i(n(7848)),f=i(n(5785)),m=i(n(5456)),g=i(n(673)),y=i(n(9725)),b=i(n(5254)),v=i(n(5049)),O=s(n(3136)),w=i(n(6732)),_=i(n(3825)),k=i(n(6315)),x=i(n(9073)),I=i(n(8576)),S=i(n(7228)),P=i(n(3822)),T=i(n(5516)),A=i(n(1663)),C=i(n(773));t._SERVICE=9;class E extends((0,a.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==O.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new w.default("WebSocket Gateway is not connected.",e);const n=new l.default(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,l.default.TYPE,c.default.encode(n)),{channel:o,threads:s}=c.default.decode(r,p.default);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:O.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o),this._isConnected=!0,this.fire("connected"),s}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async addComment(e,t,n,r){const o=new u.default(this._documentId,e,n,t,void 0,void 0,r),s=await this._sendRequest(u.default.TYPE,o);return c.default.decode(s,d.default)}async updateComment(e,t,n,r){const o=void 0!==r,s=new m.default(this._documentId,e,t,n,r,o);await this._sendRequest(m.default.TYPE,s)}async removeComment(e,t){const n=new h.default(this._documentId,e,t);await this._sendRequest(h.default.TYPE,n)}async removeCommentThread(e){const t=new f.default(this._documentId,e);await this._sendRequest(f.default.TYPE,t)}async addCommentThread(e){var t;const n=new S.default(this._documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),r=await this._sendRequest(S.default.TYPE,n);return c.default.decode(r,I.default)}async resolveCommentThread(e){const t=new P.default(e,this._documentId),n=await this._sendRequest(P.default.TYPE,t);return c.default.decode(n,C.default)}async reopenCommentThread(e){const t=new T.default(e,this._documentId);await this._sendRequest(T.default.TYPE,t)}async updateCommentThread(e){const t=new A.default(e.commentThreadId,this._documentId,e.context,e.attributes);await this._sendRequest(A.default.TYPE,t)}async getCommentThread(e,t=1){const n=new g.default(e,this._documentId);try{const e=await this._sendRequest(g.default.TYPE,n),t=c.default.decode(e,y.default);return{commentThreadId:t.commentThreadId,comments:t.comments,attributes:t.attributes,context:t.context,resolvedAt:t.resolvedAt,resolvedBy:t.resolvedBy,deletedAt:t.deletedAt}}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.getCommentThread(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw x.default.fromPublicError(n)}var r}async getDocumentThreads(){const e=new b.default(this._documentId),t=await this._sendRequest(b.default.TYPE,e),{threads:n}=c.default.decode(t,v.default);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new k.default("Comments",this);return this._connectedSessions||(this._connectedSessions=await _.default.getConnectedSessions(this._wsGateway,this._documentId,t._SERVICE)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(E._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(u.default.TYPE),((e,t)=>{const n=c.default.decode(t,u.default);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(h.default.TYPE),((e,t)=>{const n=c.default.decode(t,h.default);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(m.default.TYPE),((e,t)=>{const n=c.default.decode(t,m.default);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(f.default.TYPE),((e,t)=>{const n=c.default.decode(t,f.default);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(S.default.TYPE),((e,t)=>{const n=c.default.decode(t,S.default);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(A.default.TYPE),((e,t)=>{const n=c.default.decode(t,A.default);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(P.default.TYPE),((e,t)=>{const n=c.default.decode(t,P.default);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(T.default.TYPE),((e,t)=>{const n=c.default.decode(t,T.default);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(e){e===O.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,n){if(!this._wsGateway||!this._isConnected)throw new k.default("Comments",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(n))}}E._SERVICE=t._SERVICE,t.default=E},3650:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4229));class s extends o.default{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}t.default=s,s.DESCRIPTOR_NAME="CommentDescriptor",s.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},commentThreadId:{id:2,type:"string"},userId:{id:3,type:"string"},content:{id:4,type:"string"},documentId:{id:5,type:"string"},createdAt:{id:6,type:"string"},attributes:{id:7,type:"string"}}}},6627:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4229)),s=r(n(3650));class i extends o.default{static toJSON(e){var t,n,r,o;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(n=e.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:null===(o=e.comments)||void 0===o?void 0:o.map(s.default.toJSON)}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,context:e.context?JSON.parse(e.context):void 0,comments:null===(t=e.comments)||void 0===t?void 0:t.map(s.default.fromJSON)}}}t.default=i,i.DESCRIPTOR_NAME="CommentsThreadDescriptor",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"CommentDescriptor",rule:"repeated",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4},context:{type:"string",id:5},createdAt:{type:"string",id:6},deletedAt:{type:"string",id:7},attributes:{type:"string",id:8}}}},8481:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4229));class s extends o.default{static toJSON(e){var t;return{commentId:e.commentId,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}t.default=s,s.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",s.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}}},8262:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(6627));class i extends o.default{constructor(e,t,n,r="",o,s="",i=null,a){super(),this.documentId=e,this.commentThreadId=t,this.content=n,this.commentId=r,this.userId=s,this.attributes=i,this.commentThread=a,this.createdAt=o?new Date(o):""}toJSON(){return{commentThreadId:this.commentThreadId,content:this.content,documentId:this.documentId,commentId:this.commentId,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,userId:this.userId,attributes:JSON.stringify(this.attributes),commentThread:this.commentThread?s.default.toJSON(this.commentThread):void 0}}static fromJSON(e){return new i(e.documentId,e.commentThreadId,e.content,e.commentId?e.commentId:void 0,e.createdAt?new Date(e.createdAt):void 0,e.userId?e.userId:void 0,e.attributes?JSON.parse(e.attributes):{},e.commentThread?s.default.fromJSON(e.commentThread):void 0)}}t.default=i,i.TYPE="91",i.READABLE_TYPE_NAME="addComment",i.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},content:{type:"string",id:2},documentId:{type:"string",id:3},commentId:{type:"string",id:4},createdAt:{type:"string",id:5},userId:{type:"string",id:6},attributes:{type:"string",id:7},commentThread:{type:"CommentsThreadDescriptor",id:8}}}},7228:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(3650));class i extends o.default{constructor(e,t,n=[],r,o=null,s=null,i=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,this.comments=n,this.context=r,this.resolvedBy=o,this.attributes=c,this.createdAt=s?new Date(s):"",this.resolvedAt=i?new Date(i):"",this.deletedAt=a?new Date(a):""}toJSON(){var e;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(e=this.comments)||void 0===e?void 0:e.map((e=>s.default.toJSON(e)))}}static fromJSON(e){var t;return new i(e.documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>s.default.fromJSON({...t,documentId:e.documentId,commentThreadId:e.commentThreadId}))),e.context?JSON.parse(e.context):e.context,e.resolvedBy,e.createdAt?new Date(e.createdAt):void 0,e.resolvedAt?new Date(e.resolvedAt):void 0,e.deletedAt?new Date(e.deletedAt):void 0,e.attributes?JSON.parse(e.attributes):e.attributes)}}t.default=i,i.TYPE="140",i.READABLE_TYPE_NAME="addCommentThread",i.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1},commentThreadId:{type:"string",id:2},context:{type:"string",id:3},createdAt:{type:"string",id:4},resolvedAt:{type:"string",id:5},resolvedBy:{type:"string",id:6},attributes:{type:"string",id:7},deletedAt:{type:"string",id:8},comments:{type:"CommentDescriptor",rule:"repeated",id:9}}}},5516:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new s(e.commentThreadId,e.documentId)}}t.default=s,s.TYPE="141",s.READABLE_TYPE_NAME="reopenCommentThread",s.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},3822:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var e;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(e=this.resolvedAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(e){return new s(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}t.default=s,s.TYPE="142",s.READABLE_TYPE_NAME="resolveCommentThread",s.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}}},1663:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n,r=null){super(),this.commentThreadId=e,this.documentId=t,this.context=n,this.attributes=r}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,attributes:this.attributes?JSON.stringify(this.attributes):null}}static fromJSON(e){return new s(e.commentThreadId,e.documentId,e.context?JSON.parse(e.context):e.context,e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.TYPE="143",s.READABLE_TYPE_NAME="updateCommentThread",s.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},context:{type:"string",id:3},attributes:{type:"string",id:4}}}},7566:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="92",s.READABLE_TYPE_NAME="connectToComment",s.DESCRIPTOR_NAME="CommentsV2ConnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},673:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new s(e.commentThreadId,e.documentId)}}t.default=s,s.TYPE="93",s.READABLE_TYPE_NAME="getComment",s.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},5254:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="94",s.READABLE_TYPE_NAME="getDocumentThreads",s.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},7848:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(e){return new s(e.documentId,e.commentThreadId,e.commentId)}}t.default=s,s.TYPE="95",s.READABLE_TYPE_NAME="removeComment",s.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}}},5785:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new s(e.documentId,e.commentThreadId)}}t.default=s,s.TYPE="97",s.READABLE_TYPE_NAME="removeCommentThread",s.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}}},5456:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(6627));class i extends o.default{constructor(e,t,n,r,o=null,s=!1,i){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n,this.content=r,this.attributes=o,this.isAttributesUpdated=s,this.commentThread=i}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId,content:this.content,attributes:this.attributes?JSON.stringify(this.attributes):null,isAttributesUpdated:this.isAttributesUpdated,commentThread:this.commentThread?s.default.toJSON(this.commentThread):void 0}}static fromJSON(e){return new i(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?s.default.fromJSON(e.commentThread):void 0)}}t.default=i,i.TYPE="96",i.READABLE_TYPE_NAME="updateComment",i.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},content:{type:"string",id:3},documentId:{type:"string",id:4},attributes:{type:"string",id:5},isAttributesUpdated:{type:"bool",id:6},commentThread:{type:"CommentsThreadDescriptor",id:7}}}},6689:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n){super(),this.commentThreadId=e,this.commentId=t,this.createdAt=new Date(n)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(e){return new s(e.commentThreadId,e.commentId,e.createdAt)}}t.default=s,s.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}}},8576:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(8481));class i extends o.default{constructor(e,t,n=[]){super(),this.commentThreadId=e,this.comments=n,this.createdAt=new Date(t)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString(),comments:this.comments.map((e=>s.default.toJSON(e)))}}static fromJSON(e){return new i(e.commentThreadId,e.createdAt,e.comments.map((e=>s.default.fromJSON(e))))}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}}},773:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=new Date(r)}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt.toISOString()}}static fromJSON(e){return new s(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}t.default=s,s.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",s.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}}},1376:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(6627));class i extends o.default{constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2ConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}}},9725:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(3650));class i extends o.default{constructor(e,t,n,r,o,s,i,a,c){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=n,this.resolvedBy=o,this.comments=(null==n?void 0:n.length)?n:t,this.createdAt=i?new Date(i):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c,this.attributes="string"==typeof r?JSON.parse(r):r,this.context="string"==typeof s?JSON.parse(s):s}toJSON(){var e,t,n,r,o;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(s.default.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:null===(n=this.createdAt)||void 0===n?void 0:n.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(o=this.resolvedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t,n;return new i(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(n=e.commentsV2)||void 0===n?void 0:n.map(s.default.fromJSON),e.attributes?JSON.parse(e.attributes):e.attributes,e.resolvedBy,e.context?JSON.parse(e.context):e.context,e.createdAt,e.deletedAt,e.resolvedAt)}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",i.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},comments:{type:"string",rule:"repeated",id:2},commentsV2:{type:"CommentDescriptor",rule:"repeated",id:3},resolvedAt:{type:"string",id:4},resolvedBy:{type:"string",id:5},context:{type:"string",id:6},createdAt:{type:"string",id:7},deletedAt:{type:"string",id:8},attributes:{type:"string",id:9}}}},5049:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(6627));class i extends o.default{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const n=JSON.parse(e),r={...n};return n.comments&&(r.comments=null===(t=n.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)})))),r}(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",i.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}}},6981:(e,t,n)=>{var r,o,s,i;i=function(e){"use strict";var t=e.Reader,n=e.Writer,r=e.util,o=e.roots.default||(e.roots.default={});return o.OperationMetadataDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.userId="",s.prototype.type="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(18).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.OperationMetadataDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.userId=e.string();break;case 2:s.type=e.string();break;case 3:s.createdAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId)?"userId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof o.OperationMetadataDescriptor)return e;var t=new o.OperationMetadataDescriptor;return null!=e.userId&&(t.userId=String(e.userId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.userId="",n.type="",n.createdAt=""),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OperationMetadataDescriptor"},s}(),o.CollaborativeEditingConnectMessage=function(){function s(e){if(this.buffers=[],this.types=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(26).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(34).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(42).string(e.lastOperationId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingConnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.bundleVersion=e.string();break;case 3:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 4:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 5:s.lastOperationId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id))return"id: string expected";if(null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!r.isString(e.bundleVersion))return"bundleVersion: string expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingConnectMessage)return e;var t=new o.CollaborativeEditingConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectMessage.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[]),t.defaults&&(n.id="",n.bundleVersion="",n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),e.buffers&&e.buffers.length){n.buffers=[];for(var o=0;o<e.buffers.length;++o)n.buffers[o]=t.bytes===String?r.base64.encode(e.buffers[o],0,e.buffers[o].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[o]):e.buffers[o]}if(e.types&&e.types.length)for(n.types=[],o=0;o<e.types.length;++o)n.types[o]=e.types[o];return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectMessage"},s}(),o.CollaborativeEditingReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.lastKnowVersion=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.lastKnowVersion&&Object.hasOwnProperty.call(e,"lastKnowVersion")&&t.uint32(24).uint32(e.lastKnowVersion),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingReconnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.bundleVersion=e.string();break;case 3:s.lastKnowVersion=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!r.isString(e.bundleVersion)?"bundleVersion: string expected":null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&!r.isInteger(e.lastKnowVersion)?"lastKnowVersion: integer expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingReconnectMessage)return e;var t=new o.CollaborativeEditingReconnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),null!=e.lastKnowVersion&&(t.lastKnowVersion=e.lastKnowVersion>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.bundleVersion="",n.lastKnowVersion=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&(n.lastKnowVersion=e.lastKnowVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingReconnectMessage"},s}(),o.CollaborativeEditingUpdateMessage=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.baseVersion=0,s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.metadata=r.emptyArray,s.prototype.lastOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.baseVersion&&Object.hasOwnProperty.call(e,"baseVersion")&&t.uint32(16).uint32(e.baseVersion),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(26).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(34).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(r=0;r<e.metadata.length;++r)o.OperationMetadataDescriptor.encode(e.metadata[r],t.uint32(50).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(58).string(e.lastOperationId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingUpdateMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.baseVersion=e.uint32();break;case 3:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 4:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 6:s.metadata&&s.metadata.length||(s.metadata=[]),s.metadata.push(o.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:s.lastOperationId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id))return"id: string expected";if(null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&!r.isInteger(e.baseVersion))return"baseVersion: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(t=0;t<e.metadata.length;++t){var n=o.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingUpdateMessage)return e;var t=new o.CollaborativeEditingUpdateMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.baseVersion&&(t.baseVersion=e.baseVersion>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingUpdateMessage.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");for(t.metadata=[],n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");t.metadata[n]=o.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.id="",n.baseVersion=0,n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&(n.baseVersion=e.baseVersion),e.buffers&&e.buffers.length){n.buffers=[];for(var s=0;s<e.buffers.length;++s)n.buffers[s]=t.bytes===String?r.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(n.types=[],s=0;s<e.types.length;++s)n.types[s]=e.types[s];if(e.metadata&&e.metadata.length)for(n.metadata=[],s=0;s<e.metadata.length;++s)n.metadata[s]=o.OperationMetadataDescriptor.toObject(e.metadata[s],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingUpdateMessage"},s}(),o.GetDocumentDetailsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.environmentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.environmentId&&Object.hasOwnProperty.call(e,"environmentId")&&t.uint32(18).string(e.environmentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetDocumentDetailsMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.environmentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.environmentId&&e.hasOwnProperty("environmentId")&&!r.isString(e.environmentId)?"environmentId: string expected":null},s.fromObject=function(e){if(e instanceof o.GetDocumentDetailsMessage)return e;var t=new o.GetDocumentDetailsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.environmentId&&(t.environmentId=String(e.environmentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId="",n.environmentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.environmentId&&e.hasOwnProperty("environmentId")&&(n.environmentId=e.environmentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsMessage"},s}(),o.CollaborativeEditingConnectResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.offset=0,s.prototype.version=0,s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.metadata=r.emptyArray,s.prototype.initData="",s.prototype.isInitialized=!1,s.prototype.sessionId="",s.prototype.lastOperationId="",s.prototype.sessionCreatedAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&t.uint32(16).uint32(e.offset),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(24).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(34).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(42).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(r=0;r<e.metadata.length;++r)o.OperationMetadataDescriptor.encode(e.metadata[r],t.uint32(58).fork()).ldelim();return null!=e.initData&&Object.hasOwnProperty.call(e,"initData")&&t.uint32(66).string(e.initData),null!=e.isInitialized&&Object.hasOwnProperty.call(e,"isInitialized")&&t.uint32(72).bool(e.isInitialized),null!=e.sessionId&&Object.hasOwnProperty.call(e,"sessionId")&&t.uint32(82).string(e.sessionId),null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(90).string(e.lastOperationId),null!=e.sessionCreatedAt&&Object.hasOwnProperty.call(e,"sessionCreatedAt")&&t.uint32(98).string(e.sessionCreatedAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.offset=e.uint32();break;case 3:s.version=e.uint32();break;case 4:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 5:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 7:s.metadata&&s.metadata.length||(s.metadata=[]),s.metadata.push(o.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:s.initData=e.string();break;case 9:s.isInitialized=e.bool();break;case 10:s.sessionId=e.string();break;case 11:s.lastOperationId=e.string();break;case 12:s.sessionCreatedAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.offset&&e.hasOwnProperty("offset")&&!r.isInteger(e.offset))return"offset: integer expected";if(null!=e.version&&e.hasOwnProperty("version")&&!r.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(t=0;t<e.metadata.length;++t){var n=o.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.initData&&e.hasOwnProperty("initData")&&!r.isString(e.initData)?"initData: string expected":null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&"boolean"!=typeof e.isInitialized?"isInitialized: boolean expected":null!=e.sessionId&&e.hasOwnProperty("sessionId")&&!r.isString(e.sessionId)?"sessionId: string expected":null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&!r.isString(e.sessionCreatedAt)?"sessionCreatedAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingConnectResponse)return e;var t=new o.CollaborativeEditingConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.offset&&(t.offset=e.offset>>>0),null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectResponse.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");for(t.metadata=[],n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");t.metadata[n]=o.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.initData&&(t.initData=String(e.initData)),null!=e.isInitialized&&(t.isInitialized=Boolean(e.isInitialized)),null!=e.sessionId&&(t.sessionId=String(e.sessionId)),null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.sessionCreatedAt&&(t.sessionCreatedAt=String(e.sessionCreatedAt)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.channel="",n.offset=0,n.version=0,n.initData="",n.isInitialized=!1,n.sessionId="",n.lastOperationId="",n.sessionCreatedAt=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.offset&&e.hasOwnProperty("offset")&&(n.offset=e.offset),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(var s=0;s<e.buffers.length;++s)n.buffers[s]=t.bytes===String?r.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(n.types=[],s=0;s<e.types.length;++s)n.types[s]=e.types[s];if(e.metadata&&e.metadata.length)for(n.metadata=[],s=0;s<e.metadata.length;++s)n.metadata[s]=o.OperationMetadataDescriptor.toObject(e.metadata[s],t);return null!=e.initData&&e.hasOwnProperty("initData")&&(n.initData=e.initData),null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&(n.isInitialized=e.isInitialized),null!=e.sessionId&&e.hasOwnProperty("sessionId")&&(n.sessionId=e.sessionId),null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&(n.sessionCreatedAt=e.sessionCreatedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectResponse"},s}(),o.CollaborativeEditingResponse=function(){function s(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.version=0,s.prototype.buffers=r.emptyArray,s.prototype.types=r.emptyArray,s.prototype.metadata=r.emptyArray,s.prototype.lastOperationId="",s.prototype.lastOperationAcceptedAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(8).uint32(e.version),null!=e.buffers&&e.buffers.length)for(var r=0;r<e.buffers.length;++r)t.uint32(18).bytes(e.buffers[r]);if(null!=e.types&&e.types.length){for(t.uint32(26).fork(),r=0;r<e.types.length;++r)t.uint32(e.types[r]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(r=0;r<e.metadata.length;++r)o.OperationMetadataDescriptor.encode(e.metadata[r],t.uint32(42).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(50).string(e.lastOperationId),null!=e.lastOperationAcceptedAt&&Object.hasOwnProperty.call(e,"lastOperationAcceptedAt")&&t.uint32(58).string(e.lastOperationAcceptedAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CollaborativeEditingResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.version=e.uint32();break;case 2:s.buffers&&s.buffers.length||(s.buffers=[]),s.buffers.push(e.bytes());break;case 3:if(s.types&&s.types.length||(s.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)s.types.push(e.uint32());else s.types.push(e.uint32());break;case 5:s.metadata&&s.metadata.length||(s.metadata=[]),s.metadata.push(o.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:s.lastOperationId=e.string();break;case 7:s.lastOperationAcceptedAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.version&&e.hasOwnProperty("version")&&!r.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(var t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||r.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(t=0;t<e.types.length;++t)if(!r.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(t=0;t<e.metadata.length;++t){var n=o.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!r.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&!r.isString(e.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CollaborativeEditingResponse)return e;var t=new o.CollaborativeEditingResponse;if(null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingResponse.buffers: array expected");t.buffers=[];for(var n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?r.base64.decode(e.buffers[n],t.buffers[n]=r.newBuffer(r.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");for(t.types=[],n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");for(t.metadata=[],n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");t.metadata[n]=o.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.lastOperationAcceptedAt&&(t.lastOperationAcceptedAt=String(e.lastOperationAcceptedAt)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.version=0,n.lastOperationId="",n.lastOperationAcceptedAt=""),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(var s=0;s<e.buffers.length;++s)n.buffers[s]=t.bytes===String?r.base64.encode(e.buffers[s],0,e.buffers[s].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[s]):e.buffers[s]}if(e.types&&e.types.length)for(n.types=[],s=0;s<e.types.length;++s)n.types[s]=e.types[s];if(e.metadata&&e.metadata.length)for(n.metadata=[],s=0;s<e.metadata.length;++s)n.metadata[s]=o.OperationMetadataDescriptor.toObject(e.metadata[s],t);return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&(n.lastOperationAcceptedAt=e.lastOperationAcceptedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingResponse"},s}(),o.GetDocumentDetailsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.lastDocumentSessionId="",s.prototype.lastDocumentSessionOperationId="",s.prototype.currentDocumentSessionId="",s.prototype.currentDocumentSessionVersion=0,s.prototype.currentDocumentSessionOperationId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.lastDocumentSessionId&&Object.hasOwnProperty.call(e,"lastDocumentSessionId")&&t.uint32(10).string(e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"lastDocumentSessionOperationId")&&t.uint32(18).string(e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&Object.hasOwnProperty.call(e,"currentDocumentSessionId")&&t.uint32(26).string(e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&Object.hasOwnProperty.call(e,"currentDocumentSessionVersion")&&t.uint32(32).uint32(e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"currentDocumentSessionOperationId")&&t.uint32(42).string(e.currentDocumentSessionOperationId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetDocumentDetailsResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.lastDocumentSessionId=e.string();break;case 2:s.lastDocumentSessionOperationId=e.string();break;case 3:s.currentDocumentSessionId=e.string();break;case 4:s.currentDocumentSessionVersion=e.uint32();break;case 5:s.currentDocumentSessionOperationId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&!r.isString(e.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&!r.isString(e.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&!r.isString(e.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&!r.isInteger(e.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&!r.isString(e.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},s.fromObject=function(e){if(e instanceof o.GetDocumentDetailsResponse)return e;var t=new o.GetDocumentDetailsResponse;return null!=e.lastDocumentSessionId&&(t.lastDocumentSessionId=String(e.lastDocumentSessionId)),null!=e.lastDocumentSessionOperationId&&(t.lastDocumentSessionOperationId=String(e.lastDocumentSessionOperationId)),null!=e.currentDocumentSessionId&&(t.currentDocumentSessionId=String(e.currentDocumentSessionId)),null!=e.currentDocumentSessionVersion&&(t.currentDocumentSessionVersion=e.currentDocumentSessionVersion>>>0),null!=e.currentDocumentSessionOperationId&&(t.currentDocumentSessionOperationId=String(e.currentDocumentSessionOperationId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.lastDocumentSessionId="",n.lastDocumentSessionOperationId="",n.currentDocumentSessionId="",n.currentDocumentSessionVersion=0,n.currentDocumentSessionOperationId=""),null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&(n.lastDocumentSessionId=e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&(n.lastDocumentSessionOperationId=e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&(n.currentDocumentSessionId=e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&(n.currentDocumentSessionVersion=e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&(n.currentDocumentSessionOperationId=e.currentDocumentSessionOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsResponse"},s}(),o.CommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.commentThreadId="",s.prototype.userId="",s.prototype.content="",s.prototype.documentId="",s.prototype.createdAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(26).string(e.userId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(34).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(42).string(e.documentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentId=e.string();break;case 2:s.commentThreadId=e.string();break;case 3:s.userId=e.string();break;case 4:s.content=e.string();break;case 5:s.documentId=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId)?"userId: string expected":null!=e.content&&e.hasOwnProperty("content")&&!r.isString(e.content)?"content: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentDescriptor)return e;var t=new o.CommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentId="",n.commentThreadId="",n.userId="",n.content="",n.documentId="",n.createdAt="",n.attributes=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentDescriptor"},s}(),o.CommentsThreadDescriptor=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=r.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)o.CommentDescriptor.encode(e.comments[r],t.uint32(18).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(42).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(58).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsThreadDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(o.CommentDescriptor.decode(e,e.uint32()));break;case 3:s.resolvedAt=e.string();break;case 4:s.resolvedBy=e.string();break;case 5:s.context=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.deletedAt=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var n=o.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!r.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsThreadDescriptor)return e;var t=new o.CommentsThreadDescriptor;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsThreadDescriptor.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");t.comments[n]=o.CommentDescriptor.fromObject(e.comments[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=o.CommentDescriptor.toObject(e.comments[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsThreadDescriptor"},s}(),o.CommentThreadAddedCommentDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentThreadAddedCommentDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentId=e.string();break;case 2:s.createdAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentThreadAddedCommentDescriptor)return e;var t=new o.CommentThreadAddedCommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentId="",n.createdAt=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentThreadAddedCommentDescriptor"},s}(),o.CommentsV2AddCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.content="",s.prototype.documentId="",s.prototype.commentId="",s.prototype.createdAt="",s.prototype.userId="",s.prototype.attributes="",s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(34).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(42).string(e.createdAt),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(50).string(e.userId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&o.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(66).fork()).ldelim(),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.content=e.string();break;case 3:s.documentId=e.string();break;case 4:s.commentId=e.string();break;case 5:s.createdAt=e.string();break;case 6:s.userId=e.string();break;case 7:s.attributes=e.string();break;case 8:s.commentThread=o.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!r.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId))return"commentId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt))return"createdAt: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId))return"userId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes))return"attributes: string expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){var t=o.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentMessage)return e;var t=new o.CommentsV2AddCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2AddCommentMessage.commentThread: object expected");t.commentThread=o.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.content="",n.documentId="",n.commentId="",n.createdAt="",n.userId="",n.attributes="",n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=o.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentMessage"},s}(),o.CommentsV2AddCommentThreadMessage=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.commentThreadId="",s.prototype.context="",s.prototype.createdAt="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.attributes="",s.prototype.deletedAt="",s.prototype.comments=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(42).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(50).string(e.resolvedBy),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)o.CommentDescriptor.encode(e.comments[r],t.uint32(74).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.commentThreadId=e.string();break;case 3:s.context=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.resolvedAt=e.string();break;case 6:s.resolvedBy=e.string();break;case 7:s.attributes=e.string();break;case 8:s.deletedAt=e.string();break;case 9:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(o.CommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context))return"context: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt))return"createdAt: string expected";if(null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt))return"resolvedAt: string expected";if(null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy))return"resolvedBy: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes))return"attributes: string expected";if(null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!r.isString(e.deletedAt))return"deletedAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var n=o.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentThreadMessage)return e;var t=new o.CommentsV2AddCommentThreadMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadMessage.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");t.comments[n]=o.CommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.documentId="",n.commentThreadId="",n.context="",n.createdAt="",n.resolvedAt="",n.resolvedBy="",n.attributes="",n.deletedAt=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=o.CommentDescriptor.toObject(e.comments[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadMessage"},s}(),o.CommentsV2ReopenCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ReopenCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ReopenCommentThreadMessage)return e;var t=new o.CommentsV2ReopenCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ReopenCommentThreadMessage"},s}(),o.CommentsV2ResolveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedBy="",s.prototype.resolvedAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(26).string(e.resolvedBy),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ResolveCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;case 3:s.resolvedBy=e.string();break;case 4:s.resolvedAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ResolveCommentThreadMessage)return e;var t=new o.CommentsV2ResolveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedBy="",n.resolvedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadMessage"},s}(),o.CommentsV2UpdateCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.context="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(34).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2UpdateCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;case 3:s.context=e.string();break;case 4:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context)?"context: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2UpdateCommentThreadMessage)return e;var t=new o.CommentsV2UpdateCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.context&&(t.context=String(e.context)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.context="",n.attributes=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentThreadMessage"},s}(),o.CommentsV2ConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ConnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ConnectMessage)return e;var t=new o.CommentsV2ConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectMessage"},s}(),o.CommentsV2GetCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetCommentThreadMessage)return e;var t=new o.CommentsV2GetCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadMessage"},s}(),o.CommentsV2GetDocumentThreadsMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetDocumentThreadsMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetDocumentThreadsMessage)return e;var t=new o.CommentsV2GetDocumentThreadsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsMessage"},s}(),o.CommentsV2RemoveCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2RemoveCommentMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.commentId=e.string();break;case 3:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2RemoveCommentMessage)return e;var t=new o.CommentsV2RemoveCommentMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentMessage"},s}(),o.CommentsV2RemoveCommentThreadMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2RemoveCommentThreadMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2RemoveCommentThreadMessage)return e;var t=new o.CommentsV2RemoveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentThreadMessage"},s}(),o.CommentsV2UpdateCommentMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.content="",s.prototype.documentId="",s.prototype.attributes="",s.prototype.isAttributesUpdated=!1,s.prototype.commentThread=null,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(26).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(34).string(e.documentId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(42).string(e.attributes),null!=e.isAttributesUpdated&&Object.hasOwnProperty.call(e,"isAttributesUpdated")&&t.uint32(48).bool(e.isAttributesUpdated),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&o.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(58).fork()).ldelim(),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2UpdateCommentMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.commentId=e.string();break;case 3:s.content=e.string();break;case 4:s.documentId=e.string();break;case 5:s.attributes=e.string();break;case 6:s.isAttributesUpdated=e.bool();break;case 7:s.commentThread=o.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId))return"commentId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!r.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes))return"attributes: string expected";if(null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&"boolean"!=typeof e.isAttributesUpdated)return"isAttributesUpdated: boolean expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){var t=o.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2UpdateCommentMessage)return e;var t=new o.CommentsV2UpdateCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.isAttributesUpdated&&(t.isAttributesUpdated=Boolean(e.isAttributesUpdated)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2UpdateCommentMessage.commentThread: object expected");t.commentThread=o.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.content="",n.documentId="",n.attributes="",n.isAttributesUpdated=!1,n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&(n.isAttributesUpdated=e.isAttributesUpdated),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=o.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentMessage"},s}(),o.CommentsV2AddCommentResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.createdAt="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.commentId=e.string();break;case 3:s.createdAt=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!r.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentResponse)return e;var t=new o.CommentsV2AddCommentResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentResponse"},s}(),o.CommentsV2AddCommentThreadResponse=function(){function s(e){if(this.comments=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.createdAt="",s.prototype.comments=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)o.CommentThreadAddedCommentDescriptor.encode(e.comments[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2AddCommentThreadResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.createdAt=e.string();break;case 3:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(o.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt))return"createdAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t){var n=o.CommentThreadAddedCommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2AddCommentThreadResponse)return e;var t=new o.CommentsV2AddCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadResponse.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");t.comments[n]=o.CommentThreadAddedCommentDescriptor.fromObject(e.comments[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=o.CommentThreadAddedCommentDescriptor.toObject(e.comments[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadResponse"},s}(),o.CommentsV2ResolveCommentThreadResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ResolveCommentThreadResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.documentId=e.string();break;case 3:s.resolvedAt=e.string();break;case 4:s.resolvedBy=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2ResolveCommentThreadResponse)return e;var t=new o.CommentsV2ResolveCommentThreadResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedAt="",n.resolvedBy=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadResponse"},s}(),o.CommentsV2ConnectResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.threads=r.emptyArray,s.prototype.threadsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.threads&&e.threads.length)for(var r=0;r<e.threads.length;++r)t.uint32(18).string(e.threads[r]);if(null!=e.threadsV2&&e.threadsV2.length)for(r=0;r<e.threadsV2.length;++r)o.CommentsThreadDescriptor.encode(e.threadsV2[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2ConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.threads&&s.threads.length||(s.threads=[]),s.threads.push(e.string());break;case 3:s.threadsV2&&s.threadsV2.length||(s.threadsV2=[]),s.threadsV2.push(o.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(var t=0;t<e.threads.length;++t)if(!r.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(t=0;t<e.threadsV2.length;++t){var n=o.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2ConnectResponse)return e;var t=new o.CommentsV2ConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2ConnectResponse.threads: array expected");t.threads=[];for(var n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2ConnectResponse.threadsV2: array expected");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");t.threadsV2[n]=o.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.threads&&e.threads.length){n.threads=[];for(var r=0;r<e.threads.length;++r)n.threads[r]=e.threads[r]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=o.CommentsThreadDescriptor.toObject(e.threadsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectResponse"},s}(),o.CommentsV2GetCommentThreadResponse=function(){function s(e){if(this.comments=[],this.commentsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.commentThreadId="",s.prototype.comments=r.emptyArray,s.prototype.commentsV2=r.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(var r=0;r<e.comments.length;++r)t.uint32(18).string(e.comments[r]);if(null!=e.commentsV2&&e.commentsV2.length)for(r=0;r<e.commentsV2.length;++r)o.CommentDescriptor.encode(e.commentsV2[r],t.uint32(26).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(42).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(50).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(58).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(74).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetCommentThreadResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.commentThreadId=e.string();break;case 2:s.comments&&s.comments.length||(s.comments=[]),s.comments.push(e.string());break;case 3:s.commentsV2&&s.commentsV2.length||(s.commentsV2=[]),s.commentsV2.push(o.CommentDescriptor.decode(e,e.uint32()));break;case 4:s.resolvedAt=e.string();break;case 5:s.resolvedBy=e.string();break;case 6:s.context=e.string();break;case 7:s.createdAt=e.string();break;case 8:s.deletedAt=e.string();break;case 9:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!r.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(var t=0;t<e.comments.length;++t)if(!r.isString(e.comments[t]))return"comments: string[] expected"}if(null!=e.commentsV2&&e.hasOwnProperty("commentsV2")){if(!Array.isArray(e.commentsV2))return"commentsV2: array expected";for(t=0;t<e.commentsV2.length;++t){var n=o.CommentDescriptor.verify(e.commentsV2[t]);if(n)return"commentsV2."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!r.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!r.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!r.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!r.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetCommentThreadResponse)return e;var t=new o.CommentsV2GetCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2GetCommentThreadResponse.comments: array expected");t.comments=[];for(var n=0;n<e.comments.length;++n)t.comments[n]=String(e.comments[n])}if(e.commentsV2){if(!Array.isArray(e.commentsV2))throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: array expected");for(t.commentsV2=[],n=0;n<e.commentsV2.length;++n){if("object"!=typeof e.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");t.commentsV2[n]=o.CommentDescriptor.fromObject(e.commentsV2[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.comments=[],n.commentsV2=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(var r=0;r<e.comments.length;++r)n.comments[r]=e.comments[r]}if(e.commentsV2&&e.commentsV2.length)for(n.commentsV2=[],r=0;r<e.commentsV2.length;++r)n.commentsV2[r]=o.CommentDescriptor.toObject(e.commentsV2[r],t);return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadResponse"},s}(),o.CommentsV2GetDocumentThreadsResponse=function(){function s(e){if(this.threads=[],this.threadsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.threads=r.emptyArray,s.prototype.threadsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.threads&&e.threads.length)for(var r=0;r<e.threads.length;++r)t.uint32(10).string(e.threads[r]);if(null!=e.threadsV2&&e.threadsV2.length)for(r=0;r<e.threadsV2.length;++r)o.CommentsThreadDescriptor.encode(e.threadsV2[r],t.uint32(18).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.CommentsV2GetDocumentThreadsResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.threads&&s.threads.length||(s.threads=[]),s.threads.push(e.string());break;case 2:s.threadsV2&&s.threadsV2.length||(s.threadsV2=[]),s.threadsV2.push(o.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(var t=0;t<e.threads.length;++t)if(!r.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(t=0;t<e.threadsV2.length;++t){var n=o.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.CommentsV2GetDocumentThreadsResponse)return e;var t=new o.CommentsV2GetDocumentThreadsResponse;if(e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");t.threads=[];for(var n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: array expected");for(t.threadsV2=[],n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");t.threadsV2[n]=o.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),e.threads&&e.threads.length){n.threads=[];for(var r=0;r<e.threads.length;++r)n.threads[r]=e.threads[r]}if(e.threadsV2&&e.threadsV2.length)for(n.threadsV2=[],r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=o.CommentsThreadDescriptor.toObject(e.threadsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsResponse"},s}(),o.KeyValueDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.key="",s.prototype.value="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.KeyValueDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.key=e.string();break;case 2:s.value=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!r.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!r.isString(e.value)?"value: string expected":null},s.fromObject=function(e){if(e instanceof o.KeyValueDescriptor)return e;var t=new o.KeyValueDescriptor;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/KeyValueDescriptor"},s}(),o.IsEditorBundleUploadedMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.bundleVersion="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(10).string(e.bundleVersion),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.IsEditorBundleUploadedMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.bundleVersion=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!r.isString(e.bundleVersion)?"bundleVersion: string expected":null},s.fromObject=function(e){if(e instanceof o.IsEditorBundleUploadedMessage)return e;var t=new o.IsEditorBundleUploadedMessage;return null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.bundleVersion=""),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedMessage"},s}(),o.IsEditorBundleUploadedResponse=function(){function r(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return r.prototype.isUploaded=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=n.create()),null!=e.isUploaded&&Object.hasOwnProperty.call(e,"isUploaded")&&t.uint32(8).bool(e.isUploaded),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.IsEditorBundleUploadedResponse;e.pos<r;){var i=e.uint32();i>>>3==1?s.isUploaded=e.bool():e.skipType(7&i)}return s},r.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&"boolean"!=typeof e.isUploaded?"isUploaded: boolean expected":null},r.fromObject=function(e){if(e instanceof o.IsEditorBundleUploadedResponse)return e;var t=new o.IsEditorBundleUploadedResponse;return null!=e.isUploaded&&(t.isUploaded=Boolean(e.isUploaded)),t},r.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.isUploaded=!1),null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&(n.isUploaded=e.isUploaded),n},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedResponse"},r}(),o.RevisionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.revisionId=e.string();break;case 2:s.name=e.string();break;case 3:s.creatorId=e.string();break;case 4:s.authorsIds=e.string();break;case 5:s.diffData=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.attributes=e.string();break;case 8:s.toVersion=e.uint32();break;case 9:s.fromVersion=e.uint32();break;case 10:s.isEmptyCurrent=e.bool();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!r.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!r.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!r.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!r.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!r.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!r.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!r.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof o.RevisionDescriptor)return e;var t=new o.RevisionDescriptor;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionDescriptor"},s}(),o.RevisionHistoryConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryConnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryConnectMessage)return e;var t=new o.RevisionHistoryConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectMessage"},s}(),o.RevisionHistoryGetRevisionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.revisionId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(18).string(e.revisionId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryGetRevisionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.revisionId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!r.isString(e.revisionId)?"revisionId: string expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryGetRevisionMessage)return e;var t=new o.RevisionHistoryGetRevisionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.revisionId&&(t.revisionId=String(e.revisionId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId="",n.revisionId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionMessage"},s}(),o.RevisionHistoryReconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryReconnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.requestId=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryReconnectMessage)return e;var t=new o.RevisionHistoryReconnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryReconnectMessage"},s}(),o.RevisionHistoryUpdateRevisionsMessage=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.prototype.revisions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var r=0;r<e.revisions.length;++r)o.RevisionDescriptor.encode(e.revisions[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryUpdateRevisionsMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.documentId=e.string();break;case 2:s.requestId=e.uint32();break;case 3:s.revisions&&s.revisions.length||(s.revisions=[]),s.revisions.push(o.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId))return"documentId: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var n=o.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryUpdateRevisionsMessage)return e;var t=new o.RevisionHistoryUpdateRevisionsMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: array expected");t.revisions=[];for(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");t.revisions[n]=o.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(var r=0;r<e.revisions.length;++r)n.revisions[r]=o.RevisionDescriptor.toObject(e.revisions[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsMessage"},s}(),o.RevisionHistoryConnectResponse=function(){function s(e){if(this.revisions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.requestId=0,s.prototype.revisions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(var r=0;r<e.revisions.length;++r)o.RevisionDescriptor.encode(e.revisions[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.requestId=e.uint32();break;case 3:s.revisions&&s.revisions.length||(s.revisions=[]),s.revisions.push(o.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(var t=0;t<e.revisions.length;++t){var n=o.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryConnectResponse)return e;var t=new o.RevisionHistoryConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryConnectResponse.revisions: array expected");t.revisions=[];for(var n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");t.revisions[n]=o.RevisionDescriptor.fromObject(e.revisions[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.channel="",n.requestId=0),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(var r=0;r<e.revisions.length;++r)n.revisions[r]=o.RevisionDescriptor.toObject(e.revisions[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectResponse"},s}(),o.RevisionHistoryGetRevisionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.revisionId="",s.prototype.name="",s.prototype.creatorId="",s.prototype.authorsIds="",s.prototype.diffData="",s.prototype.createdAt="",s.prototype.attributes="",s.prototype.toVersion=0,s.prototype.fromVersion=0,s.prototype.isEmptyCurrent=!1,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryGetRevisionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.revisionId=e.string();break;case 2:s.name=e.string();break;case 3:s.creatorId=e.string();break;case 4:s.authorsIds=e.string();break;case 5:s.diffData=e.string();break;case 6:s.createdAt=e.string();break;case 7:s.attributes=e.string();break;case 8:s.toVersion=e.uint32();break;case 9:s.fromVersion=e.uint32();break;case 10:s.isEmptyCurrent=e.bool();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!r.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!r.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!r.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!r.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!r.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!r.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!r.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryGetRevisionResponse)return e;var t=new o.RevisionHistoryGetRevisionResponse;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionResponse"},s}(),o.RevisionHistoryUpdateRevisionsResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.requestId=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(8).uint32(e.requestId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.RevisionHistoryUpdateRevisionsResponse;e.pos<r;){var i=e.uint32();i>>>3==1?s.requestId=e.uint32():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!r.isInteger(e.requestId)?"requestId: integer expected":null},s.fromObject=function(e){if(e instanceof o.RevisionHistoryUpdateRevisionsResponse)return e;var t=new o.RevisionHistoryUpdateRevisionsResponse;return null!=e.requestId&&(t.requestId=e.requestId>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.requestId=0),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsResponse"},s}(),o.SessionsSocketDescriptor=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.session="",s.prototype.user="",s.prototype.role="",s.prototype.permissions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.session&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(18).string(e.user),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)t.uint32(34).string(e.permissions[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SessionsSocketDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.session=e.string();break;case 2:s.user=e.string();break;case 3:s.role=e.string();break;case 4:s.permissions&&s.permissions.length||(s.permissions=[]),s.permissions.push(e.string());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.session&&e.hasOwnProperty("session")&&!r.isString(e.session))return"session: string expected";if(null!=e.user&&e.hasOwnProperty("user")&&!r.isString(e.user))return"user: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!r.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!r.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.SessionsSocketDescriptor)return e;var t=new o.SessionsSocketDescriptor;if(null!=e.session&&(t.session=String(e.session)),null!=e.user&&(t.user=String(e.user)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SessionsSocketDescriptor.permissions: array expected");t.permissions=[];for(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.session="",n.user="",n.role=""),null!=e.session&&e.hasOwnProperty("session")&&(n.session=e.session),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsSocketDescriptor"},s}(),o.SessionsConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.sessionType=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.sessionType&&Object.hasOwnProperty.call(e,"sessionType")&&t.uint32(16).uint32(e.sessionType),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SessionsConnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.sessionType=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.sessionType&&e.hasOwnProperty("sessionType")&&!r.isInteger(e.sessionType)?"sessionType: integer expected":null},s.fromObject=function(e){if(e instanceof o.SessionsConnectMessage)return e;var t=new o.SessionsConnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.sessionType&&(t.sessionType=e.sessionType>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.sessionType=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.sessionType&&e.hasOwnProperty("sessionType")&&(n.sessionType=e.sessionType),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectMessage"},s}(),o.SocketConnectMessage=function(){function s(e){if(this.permissions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.userId="",s.prototype.role="",s.prototype.permissions=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(var r=0;r<e.permissions.length;++r)t.uint32(34).string(e.permissions[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SocketConnectMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.userId=e.string();break;case 3:s.role=e.string();break;case 4:s.permissions&&s.permissions.length||(s.permissions=[]),s.permissions.push(e.string());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id))return"id: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!r.isString(e.userId))return"userId: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!r.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(var t=0;t<e.permissions.length;++t)if(!r.isString(e.permissions[t]))return"permissions: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.SocketConnectMessage)return e;var t=new o.SocketConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SocketConnectMessage.permissions: array expected");t.permissions=[];for(var n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.id="",n.userId="",n.role=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(var r=0;r<e.permissions.length;++r)n.permissions[r]=e.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketConnectMessage"},s}(),o.SocketDisconnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SocketDisconnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.id=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof o.SocketDisconnectMessage)return e;var t=new o.SocketDisconnectMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketDisconnectMessage"},s}(),o.SessionsConnectResponse=function(){function s(e){if(this.sockets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.sockets=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.sockets&&e.sockets.length)for(var r=0;r<e.sockets.length;++r)o.SessionsSocketDescriptor.encode(e.sockets[r],t.uint32(18).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SessionsConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.sockets&&s.sockets.length||(s.sockets=[]),s.sockets.push(o.SessionsSocketDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.sockets&&e.hasOwnProperty("sockets")){if(!Array.isArray(e.sockets))return"sockets: array expected";for(var t=0;t<e.sockets.length;++t){var n=o.SessionsSocketDescriptor.verify(e.sockets[t]);if(n)return"sockets."+n}}return null},s.fromObject=function(e){if(e instanceof o.SessionsConnectResponse)return e;var t=new o.SessionsConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.sockets){if(!Array.isArray(e.sockets))throw TypeError(".SessionsConnectResponse.sockets: array expected");t.sockets=[];for(var n=0;n<e.sockets.length;++n){if("object"!=typeof e.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");t.sockets[n]=o.SessionsSocketDescriptor.fromObject(e.sockets[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.sockets=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.sockets&&e.sockets.length){n.sockets=[];for(var r=0;r<e.sockets.length;++r)n.sockets[r]=o.SessionsSocketDescriptor.toObject(e.sockets[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectResponse"},s}(),o.SuggestionDescriptor=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.SuggestionDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.authorId=e.string();break;case 3:s.type=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.data=e.string();break;case 6:s.hasComments=e.bool();break;case 7:s.state=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!r.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.SuggestionDescriptor)return e;var t=new o.SuggestionDescriptor;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SuggestionDescriptor"},s}(),o.TrackChangesAddSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.type="",s.prototype.data="",s.prototype.originalSuggestionId="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).string(e.data),null!=e.originalSuggestionId&&Object.hasOwnProperty.call(e,"originalSuggestionId")&&t.uint32(42).string(e.originalSuggestionId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesAddSuggestionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.documentId=e.string();break;case 3:s.type=e.string();break;case 4:s.data=e.string();break;case 5:s.originalSuggestionId=e.string();break;case 6:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&!r.isString(e.originalSuggestionId)?"originalSuggestionId: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesAddSuggestionMessage)return e;var t=new o.TrackChangesAddSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.type&&(t.type=String(e.type)),null!=e.data&&(t.data=String(e.data)),null!=e.originalSuggestionId&&(t.originalSuggestionId=String(e.originalSuggestionId)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.documentId="",n.type="",n.data="",n.originalSuggestionId="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&(n.originalSuggestionId=e.originalSuggestionId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionMessage"},s}(),o.TrackChangesBatchUpdateSuggestionsStateMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=r.emptyArray,s.prototype.documentId="",s.prototype.state="",s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)t.uint32(10).string(e.ids[r]);return null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(26).string(e.state),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesBatchUpdateSuggestionsStateMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.ids&&s.ids.length||(s.ids=[]),s.ids.push(e.string());break;case 2:s.documentId=e.string();break;case 3:s.state=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(var t=0;t<e.ids.length;++t)if(!r.isString(e.ids[t]))return"ids: string[] expected"}return null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesBatchUpdateSuggestionsStateMessage)return e;var t=new o.TrackChangesBatchUpdateSuggestionsStateMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.state&&(t.state=String(e.state)),t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.documentId="",n.state=""),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesBatchUpdateSuggestionsStateMessage"},s}(),o.TrackChangesConnectMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesConnectMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesConnectMessage)return e;var t=new o.TrackChangesConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectMessage"},s}(),o.TrackChangesGetAllSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetAllSuggestionMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.documentId=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetAllSuggestionMessage)return e;var t=new o.TrackChangesGetAllSuggestionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionMessage"},s}(),o.TrackChangesGetSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetSuggestionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.documentId=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetSuggestionMessage)return e;var t=new o.TrackChangesGetSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.documentId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionMessage"},s}(),o.TrackChangesUpdateSuggestionMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.hasComments=!1,s.prototype.isHasCommentsModified=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(24).bool(e.hasComments),null!=e.isHasCommentsModified&&Object.hasOwnProperty.call(e,"isHasCommentsModified")&&t.uint32(32).bool(e.isHasCommentsModified),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(42).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesUpdateSuggestionMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.documentId=e.string();break;case 3:s.hasComments=e.bool();break;case 4:s.isHasCommentsModified=e.bool();break;case 5:s.state=e.string();break;case 6:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!r.isString(e.documentId)?"documentId: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&"boolean"!=typeof e.isHasCommentsModified?"isHasCommentsModified: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesUpdateSuggestionMessage)return e;var t=new o.TrackChangesUpdateSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.isHasCommentsModified&&(t.isHasCommentsModified=Boolean(e.isHasCommentsModified)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.documentId="",n.hasComments=!1,n.isHasCommentsModified=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&(n.isHasCommentsModified=e.isHasCommentsModified),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesUpdateSuggestionMessage"},s}(),o.TrackChangesAddSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesAddSuggestionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.authorId=e.string();break;case 3:s.type=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.data=e.string();break;case 6:s.hasComments=e.bool();break;case 7:s.state=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!r.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesAddSuggestionResponse)return e;var t=new o.TrackChangesAddSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionResponse"},s}(),o.TrackChangesConnectResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.channel="",s.prototype.suggestions=r.emptyArray,s.prototype.suggestionsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.suggestions&&e.suggestions.length)for(var r=0;r<e.suggestions.length;++r)t.uint32(18).string(e.suggestions[r]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(r=0;r<e.suggestionsV2.length;++r)o.SuggestionDescriptor.encode(e.suggestionsV2[r],t.uint32(26).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesConnectResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.channel=e.string();break;case 2:s.suggestions&&s.suggestions.length||(s.suggestions=[]),s.suggestions.push(e.string());break;case 3:s.suggestionsV2&&s.suggestionsV2.length||(s.suggestionsV2=[]),s.suggestionsV2.push(o.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!r.isString(e.channel))return"channel: string expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(var t=0;t<e.suggestions.length;++t)if(!r.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(t=0;t<e.suggestionsV2.length;++t){var n=o.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.TrackChangesConnectResponse)return e;var t=new o.TrackChangesConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesConnectResponse.suggestions: array expected");t.suggestions=[];for(var n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesConnectResponse.suggestionsV2: array expected");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");t.suggestionsV2[n]=o.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.suggestions&&e.suggestions.length){n.suggestions=[];for(var r=0;r<e.suggestions.length;++r)n.suggestions[r]=e.suggestions[r]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=o.SuggestionDescriptor.toObject(e.suggestionsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectResponse"},s}(),o.TrackChangesGetAllSuggestionsResponse=function(){function s(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.suggestions=r.emptyArray,s.prototype.suggestionsV2=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.suggestions&&e.suggestions.length)for(var r=0;r<e.suggestions.length;++r)t.uint32(10).string(e.suggestions[r]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(r=0;r<e.suggestionsV2.length;++r)o.SuggestionDescriptor.encode(e.suggestionsV2[r],t.uint32(18).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetAllSuggestionsResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.suggestions&&s.suggestions.length||(s.suggestions=[]),s.suggestions.push(e.string());break;case 2:s.suggestionsV2&&s.suggestionsV2.length||(s.suggestionsV2=[]),s.suggestionsV2.push(o.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(var t=0;t<e.suggestions.length;++t)if(!r.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(t=0;t<e.suggestionsV2.length;++t){var n=o.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetAllSuggestionsResponse)return e;var t=new o.TrackChangesGetAllSuggestionsResponse;if(e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");t.suggestions=[];for(var n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: array expected");for(t.suggestionsV2=[],n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");t.suggestionsV2[n]=o.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.suggestions&&e.suggestions.length){n.suggestions=[];for(var r=0;r<e.suggestions.length;++r)n.suggestions[r]=e.suggestions[r]}if(e.suggestionsV2&&e.suggestionsV2.length)for(n.suggestionsV2=[],r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=o.SuggestionDescriptor.toObject(e.suggestionsV2[r],t);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionsResponse"},s}(),o.TrackChangesGetSuggestionResponse=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.prototype.authorId="",s.prototype.type="",s.prototype.createdAt="",s.prototype.data="",s.prototype.hasComments=!1,s.prototype.state="",s.prototype.attributes="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.TrackChangesGetSuggestionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.id=e.string();break;case 2:s.authorId=e.string();break;case 3:s.type=e.string();break;case 4:s.createdAt=e.string();break;case 5:s.data=e.string();break;case 6:s.hasComments=e.bool();break;case 7:s.state=e.string();break;case 8:s.attributes=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!r.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!r.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!r.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!r.isString(e.attributes)?"attributes: string expected":null},s.fromObject=function(e){if(e instanceof o.TrackChangesGetSuggestionResponse)return e;var t=new o.TrackChangesGetSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionResponse"},s}(),o.UserDescriptor=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.attributes&&e.attributes.length)for(var r=0;r<e.attributes.length;++r)o.KeyValueDescriptor.encode(e.attributes[r],t.uint32(10).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.UserDescriptor;e.pos<r;){var i=e.uint32();i>>>3==1?(s.attributes&&s.attributes.length||(s.attributes=[]),s.attributes.push(o.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(var t=0;t<e.attributes.length;++t){var n=o.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof o.UserDescriptor)return e;var t=new o.UserDescriptor;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".UserDescriptor.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");t.attributes[n]=o.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var r=0;r<e.attributes.length;++r)n.attributes[r]=o.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserDescriptor"},s}(),o.GetManyUsersMessage=function(){function s(e){if(this.ids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.ids=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.ids&&e.ids.length)for(var r=0;r<e.ids.length;++r)t.uint32(10).string(e.ids[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetManyUsersMessage;e.pos<r;){var i=e.uint32();i>>>3==1?(s.ids&&s.ids.length||(s.ids=[]),s.ids.push(e.string())):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(var t=0;t<e.ids.length;++t)if(!r.isString(e.ids[t]))return"ids: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.GetManyUsersMessage)return e;var t=new o.GetManyUsersMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");t.ids=[];for(var n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.ids=[]),e.ids&&e.ids.length){n.ids=[];for(var r=0;r<e.ids.length;++r)n.ids[r]=e.ids[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersMessage"},s}(),o.GetUserMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.id="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetUserMessage;e.pos<r;){var i=e.uint32();i>>>3==1?s.id=e.string():e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isString(e.id)?"id: string expected":null},s.fromObject=function(e){if(e instanceof o.GetUserMessage)return e;var t=new o.GetUserMessage;return null!=e.id&&(t.id=String(e.id)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserMessage"},s}(),o.GetManyUsersResponse=function(){function s(e){if(this.users=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.users=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.users&&e.users.length)for(var r=0;r<e.users.length;++r)o.UserDescriptor.encode(e.users[r],t.uint32(10).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetManyUsersResponse;e.pos<r;){var i=e.uint32();i>>>3==1?(s.users&&s.users.length||(s.users=[]),s.users.push(o.UserDescriptor.decode(e,e.uint32()))):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.users&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(var t=0;t<e.users.length;++t){var n=o.UserDescriptor.verify(e.users[t]);if(n)return"users."+n}}return null},s.fromObject=function(e){if(e instanceof o.GetManyUsersResponse)return e;var t=new o.GetManyUsersResponse;if(e.users){if(!Array.isArray(e.users))throw TypeError(".GetManyUsersResponse.users: array expected");t.users=[];for(var n=0;n<e.users.length;++n){if("object"!=typeof e.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");t.users[n]=o.UserDescriptor.fromObject(e.users[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.users=[]),e.users&&e.users.length){n.users=[];for(var r=0;r<e.users.length;++r)n.users[r]=o.UserDescriptor.toObject(e.users[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersResponse"},s}(),o.GetUserResponse=function(){function s(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.attributes=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.attributes&&e.attributes.length)for(var r=0;r<e.attributes.length;++r)o.KeyValueDescriptor.encode(e.attributes[r],t.uint32(10).fork()).ldelim();return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.GetUserResponse;e.pos<r;){var i=e.uint32();i>>>3==1?(s.attributes&&s.attributes.length||(s.attributes=[]),s.attributes.push(o.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&i)}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(var t=0;t<e.attributes.length;++t){var n=o.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},s.fromObject=function(e){if(e instanceof o.GetUserResponse)return e;var t=new o.GetUserResponse;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".GetUserResponse.attributes: array expected");t.attributes=[];for(var n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");t.attributes[n]=o.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(var r=0;r<e.attributes.length;++r)n.attributes[r]=o.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserResponse"},s}(),o.ChannelMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.socketId="",s.prototype.data=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.socketId&&Object.hasOwnProperty.call(e,"socketId")&&t.uint32(18).string(e.socketId),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.ChannelMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.type=e.uint32();break;case 2:s.socketId=e.string();break;case 3:s.data=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isInteger(e.type)?"type: integer expected":null!=e.socketId&&e.hasOwnProperty("socketId")&&!r.isString(e.socketId)?"socketId: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||r.isString(e.data))?"data: buffer expected":null},s.fromObject=function(e){if(e instanceof o.ChannelMessage)return e;var t=new o.ChannelMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.socketId&&(t.socketId=String(e.socketId)),null!=e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.type=0,n.socketId="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=r.newBuffer(n.data)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.socketId&&e.hasOwnProperty("socketId")&&(n.socketId=e.socketId),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?r.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ChannelMessage"},s}(),o.BytesBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=r.newBuffer([]),s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).bytes(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.BytesBytesPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.bytes();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||r.isString(e.data))?"data: buffer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.BytesBytesPacketDataMessage)return e;var t=new o.BytesBytesPacketDataMessage;return null!=e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=r.newBuffer(n.data))),t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?r.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/BytesBytesPacketDataMessage"},s}(),o.NumberBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberBytesPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.NumberBytesPacketDataMessage)return e;var t=new o.NumberBytesPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberBytesPacketDataMessage"},s}(),o.NumberNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberNumberPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof o.NumberNumberPacketDataMessage)return e;var t=new o.NumberNumberPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberNumberPacketDataMessage"},s}(),o.NumberObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberObjectPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.NumberObjectPacketDataMessage)return e;var t=new o.NumberObjectPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberObjectPacketDataMessage"},s}(),o.NumberStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.NumberStringPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.uint32();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.NumberStringPacketDataMessage)return e;var t=new o.NumberStringPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberStringPacketDataMessage"},s}(),o.ObjectBufferPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.ObjectBufferPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.ObjectBufferPacketDataMessage)return e;var t=new o.ObjectBufferPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectBufferPacketDataMessage"},s}(),o.ObjectObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.ObjectObjectPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.ObjectObjectPacketDataMessage)return e;var t=new o.ObjectObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectObjectPacketDataMessage"},s}(),o.PacketMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.type=0,s.prototype.id=0,s.prototype.nsp="",s.prototype.data=r.newBuffer([]),s.prototype.options=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(16).uint32(e.id),null!=e.nsp&&Object.hasOwnProperty.call(e,"nsp")&&t.uint32(26).string(e.nsp),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&t.uint32(42).bytes(e.options),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.PacketMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.type=e.uint32();break;case 2:s.id=e.uint32();break;case 3:s.nsp=e.string();break;case 4:s.data=e.bytes();break;case 5:s.options=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!r.isInteger(e.type)?"type: integer expected":null!=e.id&&e.hasOwnProperty("id")&&!r.isInteger(e.id)?"id: integer expected":null!=e.nsp&&e.hasOwnProperty("nsp")&&!r.isString(e.nsp)?"nsp: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||r.isString(e.data))?"data: buffer expected":null!=e.options&&e.hasOwnProperty("options")&&!(e.options&&"number"==typeof e.options.length||r.isString(e.options))?"options: buffer expected":null},s.fromObject=function(e){if(e instanceof o.PacketMessage)return e;var t=new o.PacketMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.id&&(t.id=e.id>>>0),null!=e.nsp&&(t.nsp=String(e.nsp)),null!=e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.options&&("string"==typeof e.options?r.base64.decode(e.options,t.options=r.newBuffer(r.base64.length(e.options)),0):e.options.length>=0&&(t.options=e.options)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.type=0,n.id=0,n.nsp="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=r.newBuffer(n.data))),t.bytes===String?n.options="":(n.options=[],t.bytes!==Array&&(n.options=r.newBuffer(n.options)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.nsp&&e.hasOwnProperty("nsp")&&(n.nsp=e.nsp),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?r.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.options&&e.hasOwnProperty("options")&&(n.options=t.bytes===String?r.base64.encode(e.options,0,e.options.length):t.bytes===Array?Array.prototype.slice.call(e.options):e.options),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketMessage"},s}(),o.PacketOptionsMessage=function(){function s(e){if(this.rooms=[],this.except=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.flags="",s.prototype.rooms=r.emptyArray,s.prototype.except=r.emptyArray,s.create=function(e){return new s(e)},s.encode=function(e,t){if(t||(t=n.create()),null!=e.flags&&Object.hasOwnProperty.call(e,"flags")&&t.uint32(10).string(e.flags),null!=e.rooms&&e.rooms.length)for(var r=0;r<e.rooms.length;++r)t.uint32(18).string(e.rooms[r]);if(null!=e.except&&e.except.length)for(r=0;r<e.except.length;++r)t.uint32(26).string(e.except[r]);return t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.PacketOptionsMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.flags=e.string();break;case 2:s.rooms&&s.rooms.length||(s.rooms=[]),s.rooms.push(e.string());break;case 3:s.except&&s.except.length||(s.except=[]),s.except.push(e.string());break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.flags&&e.hasOwnProperty("flags")&&!r.isString(e.flags))return"flags: string expected";if(null!=e.rooms&&e.hasOwnProperty("rooms")){if(!Array.isArray(e.rooms))return"rooms: array expected";for(var t=0;t<e.rooms.length;++t)if(!r.isString(e.rooms[t]))return"rooms: string[] expected"}if(null!=e.except&&e.hasOwnProperty("except")){if(!Array.isArray(e.except))return"except: array expected";for(t=0;t<e.except.length;++t)if(!r.isString(e.except[t]))return"except: string[] expected"}return null},s.fromObject=function(e){if(e instanceof o.PacketOptionsMessage)return e;var t=new o.PacketOptionsMessage;if(null!=e.flags&&(t.flags=String(e.flags)),e.rooms){if(!Array.isArray(e.rooms))throw TypeError(".PacketOptionsMessage.rooms: array expected");t.rooms=[];for(var n=0;n<e.rooms.length;++n)t.rooms[n]=String(e.rooms[n])}if(e.except){if(!Array.isArray(e.except))throw TypeError(".PacketOptionsMessage.except: array expected");for(t.except=[],n=0;n<e.except.length;++n)t.except[n]=String(e.except[n])}return t},s.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.rooms=[],n.except=[]),t.defaults&&(n.flags=""),null!=e.flags&&e.hasOwnProperty("flags")&&(n.flags=e.flags),e.rooms&&e.rooms.length){n.rooms=[];for(var r=0;r<e.rooms.length;++r)n.rooms[r]=e.rooms[r]}if(e.except&&e.except.length)for(n.except=[],r=0;r<e.except.length;++r)n.except[r]=e.except[r];return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketOptionsMessage"},s}(),o.StringBytesPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=r.newBuffer([]),s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringBytesPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.bytes();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||r.isString(e.data1))?"data1: buffer expected":null},s.fromObject=function(e){if(e instanceof o.StringBytesPacketDataMessage)return e;var t=new o.StringBytesPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?r.base64.decode(e.data1,t.data1=r.newBuffer(r.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=r.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?r.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringBytesPacketDataMessage"},s}(),o.StringNumberPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1=0,s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringNumberPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.uint32();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isInteger(e.data1)?"data1: integer expected":null},s.fromObject=function(e){if(e instanceof o.StringNumberPacketDataMessage)return e;var t=new o.StringNumberPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=e.data1>>>0),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringNumberPacketDataMessage"},s}(),o.StringObjectPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringObjectPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.StringObjectPacketDataMessage)return e;var t=new o.StringObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringObjectPacketDataMessage"},s}(),o.StringStringPacketDataMessage=function(){function s(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(e){return new s(e)},s.encode=function(e,t){return t||(t=n.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},s.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,s=new o.StringStringPacketDataMessage;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:s.data=e.string();break;case 2:s.data1=e.string();break;default:e.skipType(7&i)}}return s},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!r.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!r.isString(e.data1)?"data1: string expected":null},s.fromObject=function(e){if(e instanceof o.StringStringPacketDataMessage)return e;var t=new o.StringStringPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},s.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},s.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},s}(),o},o=[n(2100)],void 0===(s="function"==typeof(r=i)?r.apply(t,o):r)||(e.exports=s)},4229:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(...e){}}},5132:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const o=n(2209),s=r(n(822)),i=n(3136),a=r(n(4701)),c=r(n(4858)),u=r(n(6732));t._SERVICE=13;class d extends((0,o.EmitterMixin)()){static async isBundleUploaded(e,t){const n=new a.default(t);if(e.state!==i.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new u.default("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(d._SERVICE,a.default.TYPE,s.default.encode(n));return s.default.decode(r,c.default).isUploaded}}d._SERVICE=t._SERVICE,t.default=d},4701:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new s(e.bundleVersion)}}t.default=s,s.TYPE="131",s.READABLE_TYPE_NAME="isEditorBundleUploaded",s.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",s.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}}},4858:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new s(e.isUploaded)}}t.default=s,s.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",s.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}}},6315:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(6732));class s extends o.default{constructor(e,t){super(e+" Service is not connected.",t)}}t.default=s},4916:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddCommentThreadMessage=t.IsEditorBundleUploadedResponse=t.IsEditorBundleUploadedMessage=t.GetDocumentDetailsResponse=t.GetDocumentDetailsMessage=t.ChannelMessage=t.RevisionHistoryUpdateRevisionsResponse=t.RevisionHistoryGetRevisionResponse=t.RevisionHistoryConnectResponse=t.RevisionHistoryUpdateRevisionsMessage=t.RevisionHistoryGetRevisionMessage=t.RevisionHistoryReconnectMessage=t.RevisionHistoryConnectMessage=t.User=t.GetManyUsersResponse=t.GetUserResponse=t.GetManyUsersMessage=t.GetUserMessage=t.BatchUpdateSuggestionsStateMessage=t.UpdateSuggestionMessage=t.GetSuggestionMessage=t.GetAllSuggestionsMessage=t.ConnectTrackChangesMessage=t.GetSuggestionResponse=t.GetAllSuggestionsResponse=t.ConnectTrackChangesResponse=t.AddSuggestionResponse=t.AddSuggestionMessage=t.SocketDisconnectMessage=t.SocketConnectMessage=t.SessionsConnectResponse=t.SessionsConnectMessage=t.GetCommentThreadResponse=t.ConnectCommentsResponse=t.AddCommentResponse=t.UpdateCommentMessage=t.RemoveCommentThreadMessage=t.GetDocumentThreadsResponse=t.RemoveCommentMessage=t.GetDocumentThreadsMessage=t.GetCommentThreadMessage=t.ConnectCommentsMessage=t.AddCommentMessage=t.CollaborativeEditingResponse=t.CollaborativeEditingConnectResponse=t.CollaborativeEditingUpdateMessage=t.CollaborativeEditingReconnectMessage=t.CollaborativeEditingConnectMessage=t.MessagesMapper=t.MessagesCompressor=void 0,t.Parser=t.PacketParser=t.Decoder=t.Encoder=t.ResolveCommentThreadResponse=t.AddCommentThreadResponse=t.UpdateCommentThreadMessage=t.ResolveCommentThreadMessage=t.ReopenCommentThreadMessage=void 0;const a=i(n(822));t.MessagesCompressor=a.default;const c=i(n(5668));t.MessagesMapper=c.default;const u=i(n(5834));t.CollaborativeEditingConnectMessage=u.default;const d=i(n(4053));t.CollaborativeEditingReconnectMessage=d.default;const l=i(n(4721));t.CollaborativeEditingUpdateMessage=l.default;const p=i(n(3297));t.CollaborativeEditingConnectResponse=p.default;const h=i(n(5184));t.CollaborativeEditingResponse=h.default;const f=i(n(3510));t.GetDocumentDetailsMessage=f.default;const m=i(n(2663));t.GetDocumentDetailsResponse=m.default;const g=i(n(4076));t.GetManyUsersMessage=g.default;const y=i(n(6461));t.GetManyUsersResponse=y.default;const b=i(n(3184));t.GetUserMessage=b.default;const v=i(n(1783));t.GetUserResponse=v.default;const O=i(n(2203));t.User=O.default;const w=i(n(8262));t.AddCommentMessage=w.default;const _=i(n(6689));t.AddCommentResponse=_.default;const k=i(n(7566));t.ConnectCommentsMessage=k.default;const x=i(n(673));t.GetCommentThreadMessage=x.default;const I=i(n(5254));t.GetDocumentThreadsMessage=I.default;const S=i(n(5049));t.GetDocumentThreadsResponse=S.default;const P=i(n(7848));t.RemoveCommentMessage=P.default;const T=i(n(5785));t.RemoveCommentThreadMessage=T.default;const A=i(n(5456));t.UpdateCommentMessage=A.default;const C=i(n(1376));t.ConnectCommentsResponse=C.default;const E=i(n(9725));t.GetCommentThreadResponse=E.default;const j=i(n(1663));t.UpdateCommentThreadMessage=j.default;const D=i(n(3822));t.ResolveCommentThreadMessage=D.default;const R=i(n(5516));t.ReopenCommentThreadMessage=R.default;const M=i(n(7228));t.AddCommentThreadMessage=M.default;const N=i(n(8576));t.AddCommentThreadResponse=N.default;const V=i(n(773));t.ResolveCommentThreadResponse=V.default;const B=i(n(7182));t.SessionsConnectMessage=B.default;const U=i(n(6118));t.SessionsConnectResponse=U.default;const J=i(n(733));t.SocketConnectMessage=J.default;const q=i(n(8902));t.SocketDisconnectMessage=q.default;const L=i(n(5596));t.AddSuggestionMessage=L.default;const G=i(n(772));t.AddSuggestionResponse=G.default;const Y=i(n(2414));t.GetAllSuggestionsResponse=Y.default;const F=i(n(9849));t.GetSuggestionResponse=F.default;const z=i(n(3031));t.GetSuggestionMessage=z.default;const K=i(n(4060));t.GetAllSuggestionsMessage=K.default;const H=i(n(2821));t.UpdateSuggestionMessage=H.default;const W=i(n(7323));t.ConnectTrackChangesMessage=W.default;const $=i(n(9940));t.ConnectTrackChangesResponse=$.default;const Z=i(n(8622));t.BatchUpdateSuggestionsStateMessage=Z.default;const Q=i(n(2269));t.RevisionHistoryConnectMessage=Q.default;const X=i(n(3728));t.RevisionHistoryReconnectMessage=X.default;const ee=i(n(8776));t.RevisionHistoryGetRevisionMessage=ee.default;const te=i(n(446));t.RevisionHistoryUpdateRevisionsMessage=te.default;const ne=i(n(5847));t.RevisionHistoryConnectResponse=ne.default;const re=i(n(9055));t.RevisionHistoryGetRevisionResponse=re.default;const oe=i(n(8386));t.RevisionHistoryUpdateRevisionsResponse=oe.default;const se=i(n(4858));t.IsEditorBundleUploadedResponse=se.default;const ie=i(n(4701));t.IsEditorBundleUploadedMessage=ie.default;const ae=s(n(9549));t.Parser=ae;const ce=i(n(6311));t.PacketParser=ce.default;const ue=i(n(2021));t.ChannelMessage=ue.default;const{Encoder:de,Decoder:le}=ae;t.Encoder=de,t.Decoder=le},3210:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4229));class s extends o.default{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}t.default=s,s.TYPE="1000"},822:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(6981));function s(e){return o.default[e.DESCRIPTOR_NAME]}t.default=class{static decode(e,t){const n=s(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=s(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}},5668:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(5834)),s=r(n(4053)),i=r(n(4721)),a=r(n(3510)),c=r(n(8262)),u=r(n(7566)),d=r(n(673)),l=r(n(5254)),p=r(n(7848)),h=r(n(5785)),f=r(n(5456)),m=r(n(7182)),g=r(n(733)),y=r(n(8902)),b=r(n(5596)),v=r(n(4060)),O=r(n(3031)),w=r(n(2821)),_=r(n(7323)),k=r(n(8622)),x=r(n(3184)),I=r(n(4076)),S=r(n(2269)),P=r(n(3728)),T=r(n(8776)),A=r(n(446)),C=r(n(4701)),E=r(n(3822)),j=r(n(5516)),D=r(n(1663)),R=r(n(7228)),M=new Map([[o.default.TYPE,o.default.READABLE_TYPE_NAME],[s.default.TYPE,s.default.READABLE_TYPE_NAME],[i.default.TYPE,i.default.READABLE_TYPE_NAME],[a.default.TYPE,a.default.READABLE_TYPE_NAME],[c.default.TYPE,c.default.READABLE_TYPE_NAME],[u.default.TYPE,u.default.READABLE_TYPE_NAME],[d.default.TYPE,d.default.READABLE_TYPE_NAME],[l.default.TYPE,l.default.READABLE_TYPE_NAME],[p.default.TYPE,p.default.READABLE_TYPE_NAME],[h.default.TYPE,h.default.READABLE_TYPE_NAME],[f.default.TYPE,f.default.READABLE_TYPE_NAME],[m.default.TYPE,m.default.READABLE_TYPE_NAME],[g.default.TYPE,g.default.READABLE_TYPE_NAME],[y.default.TYPE,y.default.READABLE_TYPE_NAME],[b.default.TYPE,b.default.READABLE_TYPE_NAME],[O.default.TYPE,O.default.READABLE_TYPE_NAME],[w.default.TYPE,w.default.READABLE_TYPE_NAME],[v.default.TYPE,v.default.READABLE_TYPE_NAME],[_.default.TYPE,_.default.READABLE_TYPE_NAME],[k.default.TYPE,k.default.READABLE_TYPE_NAME],[x.default.TYPE,x.default.READABLE_TYPE_NAME],[I.default.TYPE,I.default.READABLE_TYPE_NAME],[S.default.TYPE,S.default.READABLE_TYPE_NAME],[P.default.TYPE,P.default.READABLE_TYPE_NAME],[T.default.TYPE,T.default.READABLE_TYPE_NAME],[A.default.TYPE,A.default.READABLE_TYPE_NAME],[C.default.TYPE,C.default.READABLE_TYPE_NAME],[E.default.TYPE,E.default.READABLE_TYPE_NAME],[j.default.TYPE,j.default.READABLE_TYPE_NAME],[D.default.TYPE,D.default.READABLE_TYPE_NAME],[R.default.TYPE,R.default.READABLE_TYPE_NAME]]);t.default=class{static typeToStringName(e){var t;return null!==(t=M.get(String(e)))&&void 0!==t?t:e}}},3131:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4229));class s extends o.default{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,n]of Object.entries(e))void 0===n&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}t.default=s,s.DESCRIPTOR_NAME="RevisionDescriptor",s.DESCRIPTOR={fields:{revisionId:{type:"string",id:1},name:{type:"string",id:2},creatorId:{type:"string",id:3},authorsIds:{type:"string",id:4},diffData:{type:"string",id:5},createdAt:{type:"string",id:6},attributes:{type:"string",id:7},toVersion:{type:"uint32",id:8},fromVersion:{type:"uint32",id:9},isEmptyCurrent:{type:"bool",id:10}}}},2269:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="121",s.READABLE_TYPE_NAME="connectToRevisionHistory",s.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},8776:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new s(e.documentId,e.revisionId)}}t.default=s,s.TYPE="123",s.READABLE_TYPE_NAME="getRevision",s.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}}},3728:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new s(e.documentId,e.requestId)}}t.default=s,s.TYPE="122",s.READABLE_TYPE_NAME="reconnectToRevisionHistory",s.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}}},446:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(3131));class i extends o.default{constructor(e,t,n){super(),this.documentId=e,this.requestId=t,this.revisions=n}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(s.default.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(s.default.toObject)}}static create(e){return new i(e.documentId,e.requestId,e.revisions.map(s.default.create))}static fromJSON(e){return new i(e.documentId,e.requestId,e.revisions.map(s.default.fromJSON))}}t.default=i,i.TYPE="124",i.READABLE_TYPE_NAME="updateRevisions",i.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",i.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}}},5847:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(3131));class i extends o.default{constructor(e,t,n){super(),this.channel=e,this.requestId=t,this.revisions=n}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(s.default.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(s.default.toObject)}}static fromJSON(e){return new i(e.channel,e.requestId,e.revisions.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}}},9055:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(3131));class i extends o.default{constructor(e,t,n,r,o,s,i,a,c,u){super(),this.revisionId=e,this.name=t,this.creatorId=n,this.authorsIds=r,this.createdAt=o,this.diffData=s,this.attributes=i,this.fromVersion=a,this.toVersion=c,this.isEmptyCurrent=u}toJSON(){return s.default.toJSON(this)}toObject(){return s.default.toObject(this)}static create(e){return new i(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new i(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}t.default=i,i.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",i.DESCRIPTOR=s.default.DESCRIPTOR},8386:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new s(e.requestId)}}t.default=s,s.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",s.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}}},3432:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=n(2209),c=i(n(822)),u=i(n(8776)),d=i(n(9055)),l=i(n(446)),p=i(n(8386)),h=i(n(2269)),f=i(n(5847)),m=i(n(3728)),g=i(n(6732)),y=s(n(3136)),b=i(n(6315));t._SERVICE=12;class v extends((0,a.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new h.default(this._documentId))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}reconnect(e,t){if(this.isConnected)throw new g.default("Cannot reconnect to already connected service.",e);return this._connect(e,new m.default(this._documentId,t))}async updateRevisions(e,t){const n=l.default.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(l.default.TYPE,n),{requestId:o}=c.default.decode(r,p.default);return o}async getRevision(e){const t=new u.default(this._documentId,e),n=await this._sendRequest(u.default.TYPE,t);return c.default.decode(n,d.default).toObject()}async _connect(e,n){if(e.state!==y.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new g.default("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,n.constructor.TYPE,c.default.encode(n)),{channel:o,requestId:s,revisions:i}=c.default.decode(r,f.default).toObject();return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:y.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o),this._isConnected=!0,this.fire("connected"),{revisions:i,requestId:s}}_connectToChannel(e,t){this._channel=e._getChannel(v._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(l.default.TYPE),((e,t)=>{const{documentId:n,requestId:r,revisions:o}=c.default.decode(t,l.default).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:o})}))}_onWsGatewayStateChange(e){e===y.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,n){if(!this._wsGateway||!this._isConnected)throw new b.default("Revision History",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(n))}}v._SERVICE=t._SERVICE,t.default=v},3521:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WEB_SOCKET_GATEWAY_STATES=t.CommentsService=t.SessionCollection=t.TrackChangesService=t.WebSocketGateway=t.EditorService=t.RevisionHistoryService=t.CollaborativeEditingService=void 0;const a=s(n(3136));t.WebSocketGateway=a.default,Object.defineProperty(t,"WEB_SOCKET_GATEWAY_STATES",{enumerable:!0,get:function(){return a.WEB_SOCKET_GATEWAY_STATES}});const c=i(n(5132));t.EditorService=c.default;const u=i(n(3432));t.RevisionHistoryService=u.default;const d=i(n(716));t.TrackChangesService=d.default;const l=i(n(8333));t.SessionCollection=l.default;const p=i(n(247));t.CollaborativeEditingService=p.default;const h=i(n(1740));t.CommentsService=h.default},7182:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new s(e.id,e.sessionType)}}t.default=s,s.TYPE="31",s.READABLE_TYPE_NAME="getConnectedSockets",s.DESCRIPTOR_NAME="SessionsConnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}}},733:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){var e,t,n;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(e){return new s(e.id,e.userId,e.role,e.permissions)}}t.default=s,s.TYPE="32",s.READABLE_TYPE_NAME="connectSocket",s.DESCRIPTOR_NAME="SocketConnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}}},8902:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new s(e.id)}}t.default=s,s.TYPE="33",s.READABLE_TYPE_NAME="disconnectSocket",s.DESCRIPTOR_NAME="SocketDisconnectMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1}}}},6118:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t=[]){super(),this.channel=e,this.sockets=t}toJSON(){return{channel:this.channel,sockets:this.sockets.map((e=>({user:e.userId,session:e.id,role:e.role,permissions:e.permissions})))}}static fromJSON(e){return new s(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}t.default=s,s.DESCRIPTOR_NAME="SessionsConnectResponse",s.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}}},8333:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(2209),s=n(3825),i=r(n(2203)),a=r(n(3136)),c=r(n(6118)),u=r(n(7182)),d=r(n(733)),l=r(n(8902)),p=r(n(822));class h extends o.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new u.default(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(s._SERVICE,u.default.TYPE,p.default.encode(t));n=p.default.decode(e,c.default)}catch(e){n=new c.default(this._id,[])}this._connectToChannel(this._wsGateway,n.channel,this._sessionType);const r=await async function(e,t){const n=t.map((e=>e.userId)),r=n.length?await i.default.getMany(e,n):[];return t.map((e=>{const t={id:e.id,role:e.role,permissions:e.permissions};return t.user=e.userId&&r.find((t=>t.id===e.userId))||new i.default,t}))}(this._wsGateway,n.sockets);for(const e of r)super.add(e);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:a.default._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(e=!0){if(this._connected){for(this._connected=!1,this._eventsQueue=[];this.length;)super.remove(0);this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._wsGateway&&e&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),e&&this.stopListening()}}add(e,t){throw new TypeError("The collection is read-only.")}remove(e){throw new TypeError("The collection is read-only.")}_connectToChannel(e,t,n){this._channel=e._getChannel(n,t),this._channel&&(this._addHandler(this._channel,d.default.TYPE,(async t=>{const n=p.default.decode(t,d.default);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await i.default.get(e,n.userId)),super.add(t)}})),this._addHandler(this._channel,l.default.TYPE,(e=>{const t=p.default.decode(e,l.default);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===a.default.STATE_DISCONNECTED&&this.disconnect(!1),e===a.default.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let e;for(this._isRunning=!0;e=this._eventsQueue.shift();){const t=this._handlers.get(e.eventName);t&&await t(e.data)}this._isRunning=!1}_addHandler(e,t,n){const r=e.getEventName(t,!0);this.listenTo(e,r,(async(e,t)=>{const n=e.name;this._eventsQueue.push({eventName:n,data:t}),await this._runQueue()})),this._handlers.set(r,n)}}t.default=h},3825:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const o=r(n(8333));t._SERVICE=3,t.default=class{static async getConnectedSessions(e,t,n){const r=new o.default(t,n);return await r.connect(e),r}}},7282:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4229));class s extends o.default{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}t.default=s,s.DESCRIPTOR_NAME="SuggestionDescriptor",s.DESCRIPTOR={fields:{id:{id:1,type:"string"},authorId:{id:2,type:"string"},type:{id:3,type:"string"},createdAt:{id:4,type:"string"},data:{id:5,type:"string"},hasComments:{id:6,type:"bool"},state:{id:7,type:"string"},attributes:{id:8,type:"string"}}}},5596:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n,r={},o=null,s=null){super(),this.id=e,this.documentId=t,this.type=n,this.data=r,this.originalSuggestionId=o,this.attributes=s}toJSON(){return{id:this.id,documentId:this.documentId,type:this.type,data:JSON.stringify(this.data),originalSuggestionId:this.originalSuggestionId,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){var t;return new s(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.TYPE="101",s.READABLE_TYPE_NAME="addSuggestion",s.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},type:{type:"string",id:3},data:{type:"string",id:4},originalSuggestionId:{type:"string",id:5},attributes:{type:"string",id:6}}}},8622:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n){super(),this.ids=e,this.documentId=t,this.state=n}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(e){return new s(e.ids,e.documentId,e.state)}}t.default=s,s.TYPE="106",s.READABLE_TYPE_NAME="batchUpdateSuggestionsState",s.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",s.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}}},7323:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="105",s.READABLE_TYPE_NAME="connectToSuggestions",s.DESCRIPTOR_NAME="TrackChangesConnectMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},4060:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new s(e.documentId)}}t.default=s,s.TYPE="102",s.READABLE_TYPE_NAME="getAllSuggestions",s.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",s.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}}},3031:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new s(e.id,e.documentId)}}t.default=s,s.TYPE="103",s.READABLE_TYPE_NAME="getSuggestion",s.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}}},2821:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n,r,o,s=null){super(),this.id=e,this.documentId=t,this.hasComments=n,this.isHasCommentsModified=r,this.state=o,this.attributes=s}toJSON(){return{id:this.id,documentId:this.documentId,hasComments:this.hasComments,isHasCommentsModified:this.isHasCommentsModified,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new s(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.TYPE="104",s.READABLE_TYPE_NAME="updateSuggestion",s.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2},hasComments:{type:"bool",id:3},isHasCommentsModified:{type:"bool",id:4},state:{type:"string",id:5},attributes:{type:"string",id:6}}}},772:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n,r,o,s,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=o,this.state=s,this.data=i,this.attributes=a,this.createdAt=r?new Date(r):void 0}toJSON(){var e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new s(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",s.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}}},9940:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(7282));class i extends o.default{constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}t.default=i,i.DESCRIPTOR_NAME="TrackChangesConnectResponse",i.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}}},2414:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210)),s=r(n(7282));class i extends o.default{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(s.default.toJSON)}}static fromJSON(e){var t,n;return new i(null===(t=e.suggestions)||void 0===t?void 0:t.map(a),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(s.default.fromJSON))}}function a(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}t.default=i,i.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",i.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}}},9849:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n,r,o,s,i={},a=null){super(),this.id=e,this.authorId=t,this.type=n,this.hasComments=o,this.state=s,this.data=i,this.attributes=a,this.createdAt=new Date(r)}toJSON(){return{id:this.id,authorId:this.authorId,type:this.type,createdAt:this.createdAt.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new s(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}t.default=s,s.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",s.DESCRIPTOR={fields:{id:{type:"string",id:1},authorId:{type:"string",id:2},type:{type:"string",id:3},createdAt:{type:"string",id:4},data:{type:"string",id:5},hasComments:{type:"bool",id:6},state:{type:"string",id:7},attributes:{type:"string",id:8}}}},716:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t._SERVICE=void 0;const a=n(2209),c=i(n(822)),u=i(n(5596)),d=i(n(772)),l=i(n(3031)),p=i(n(9849)),h=i(n(4060)),f=i(n(2414)),m=i(n(2821)),g=i(n(7323)),y=i(n(9940)),b=i(n(6732)),v=s(n(3136)),O=i(n(6315)),w=i(n(9073)),_=i(n(8622));t._SERVICE=10;class k extends((0,a.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==v.WEB_SOCKET_GATEWAY_STATES.CONNECTED)throw new b.default("WebSocket Gateway is not connected.",e);const n=new g.default(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const r=await e._sendRequest(t._SERVICE,g.default.TYPE,c.default.encode(n)),o=c.default.decode(r,y.default);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:v.default._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,o.channel),this._isConnected=!0,this.fire("connected"),o.suggestions}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}async add(e,t,n,r=null,o){const s=new u.default(e,this._documentId,t,n,r,o),i=await this._sendRequest(u.default.TYPE,s);return c.default.decode(i,d.default)}async get(e,t=1){const n=new l.default(e,this._documentId);try{const e=await this._sendRequest(l.default.TYPE,n);return c.default.decode(e,p.default)}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.get(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw w.default.fromPublicError(n)}var r}async getAll(){const e=new h.default(this._documentId),t=await this._sendRequest(h.default.TYPE,e),{suggestions:n}=c.default.decode(t,f.default);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:o}=t,s=void 0!==n,i=new m.default(e,this._documentId,n,s,r,o);await this._sendRequest(m.default.TYPE,i)}async batchUpdateState(e){const t=new _.default(e.ids,this._documentId,e.state);await this._sendRequest(_.default.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(k._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(m.default.TYPE),((e,t)=>{const n=c.default.decode(t,m.default);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(e){e===v.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED&&this.disconnect()}_sendRequest(e,n){if(!this._wsGateway||!this._isConnected)throw new O.default("Track Changes",this);return this._wsGateway._sendRequest(t._SERVICE,e,c.default.encode(n))}}k._SERVICE=t._SERVICE,t.default=k},4076:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new s(e.ids)}}t.default=s,s.TYPE="22",s.READABLE_TYPE_NAME="getManyUsers",s.DESCRIPTOR_NAME="GetManyUsersMessage",s.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}}},3184:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new s(e.id)}}t.default=s,s.TYPE="21",s.READABLE_TYPE_NAME="getUser",s.DESCRIPTOR_NAME="GetUserMessage",s.DESCRIPTOR={fields:{id:{type:"string",id:1}}}},6461:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(i)}}static fromJSON(e){return new s(e.users.map(a))}}function i(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function a(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}t.default=s,s.DESCRIPTOR_NAME="GetManyUsersResponse",s.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}}},1783:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e){super(),this.attributes=e}toJSON(){return{attributes:Object.keys(this.attributes).map((e=>({key:e,value:JSON.stringify(this.attributes[e])})))}}static fromJSON(e){const t=e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{});return new s(t)}}t.default=s,s.DESCRIPTOR_NAME="GetUserResponse",s.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}}},2203:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3184)),s=r(n(1783)),i=r(n(822)),a=r(n(4076)),c=r(n(6461));class u{constructor(e={}){this._attributes=new Map;for(const t of Object.keys(e))"id"!==t?(this._attributes.set(t,e[t]),Object.defineProperty(this,t,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(t)})):this.id=e.id}static fromData(e){return new u(e)}static async get(e,t){const n=new o.default(t);try{const t=await e._sendRequest(u._SERVICE,o.default.TYPE,i.default.encode(n)),r=i.default.decode(t,s.default);return new u(r.attributes)}catch(e){return new u({id:t})}}static async getMany(e,t){const n=new a.default(t);try{const t=await e._sendRequest(u._SERVICE,a.default.TYPE,i.default.encode(n));return i.default.decode(t,c.default).users.map((e=>new u(e)))}catch(e){return t.map((e=>new u({id:e})))}}}u._SERVICE=2,t.default=u},989:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="48.1.0-alpha.0"},8290:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(2209),s=r(n(2021)),i=r(n(822));class a extends((0,o.EmitterMixin)()){constructor(e,t,n){super(),this._channelName=e,this._wsGateway=t,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let n="";return t&&(n+="all:"),n+="event",e&&(n+=":"+e),n}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=i.default.decode(e,s.default);this.fire(this.getEventName(t.type,!0),t.data,t.socketId),t.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(t.type),t.data,t.socketId)}))}}t.default=a},2021:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t,n){super(),this.type=e,this.socketId=t,this.data=n}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(e){return new s(e.type,e.socketId,e.data)}}t.default=s,s.DESCRIPTOR_NAME="ChannelMessage",s.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}}},6311:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(4645)),s=r(n(822));t.default=class{encode(e,t,n,r="/",i={}){if(t.length>2)throw new Error("PacketParser supports only 2 elements in data");const a={type:e,data:t,id:n,nsp:r};return s.default.encode(o.default.create(a,i))}decode(e){const t=s.default.decode(e,o.default);return{packet:{id:t.id,type:t.type,data:t.packetData,nsp:t.nsp},options:{flags:t.options.flags,rooms:t.options.rooms,except:t.options.except}}}}},4454:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.BUFFER,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}}},569:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}}},9256:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.NUMBER),u.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}}},4194:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new u(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.OBJECT),u.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}}},6700:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.NUMBER,c.MessageDataTypes.STRING),u.DESCRIPTOR_NAME="NumberStringPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}}},3903:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new u(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.OBJECT,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}}},3500:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new u(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.OBJECT,c.MessageDataTypes.OBJECT),u.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},8372:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}t.default=s,e.exports=s},4645:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(822)),s=r(n(3210)),i=r(n(9152)),a=r(n(4568)),c=r(n(569)),u=r(n(5229)),d=r(n(4454)),l=r(n(7926)),p=r(n(4194)),h=r(n(3500)),f=r(n(3903)),m=r(n(1919)),g=r(n(7513)),y=r(n(9256)),b=r(n(6700)),v=[c.default,u.default,d.default,l.default,p.default,h.default,f.default,m.default,g.default,y.default,b.default].reduce(((e,t)=>(e[t.TYPE]=t,e)),{});class O extends s.default{constructor(e,t,n,r="/",o=new i.default){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=o}get packetData(){return void 0===this.data.data&&void 0===this.data.data1?[]:this.data.data&&void 0===this.data.data1?[this.data.data]:[this.data.data,this.data.data1]}toJSON(){const e=o.default.encode(this.options),t=o.default.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:t,options:e}}static fromJSON(e){const t=Math.floor(e.type/10);return new O(e.type-10*t,o.default.decode(e.data,v[t]),e.id,e.nsp,e.options?o.default.decode(e.options,i.default):new i.default)}static create(e,t={}){var n;const r=a.default.getPacketType(a.default.getType(e.data[0]),a.default.getType(null!==(n=e.data[1])&&void 0!==n?n:e.data[0]));return new O(e.type,v[r].create(e.data[0],e.data[1]),e.id,e.nsp,new i.default(t.flags,t.rooms,t.except))}}t.default=O,O.TYPE=10,O.DESCRIPTOR_NAME="PacketMessage",O.DESCRIPTOR={fields:{type:{type:"uint32",id:1},id:{type:"uint32",id:2},nsp:{type:"string",id:3},data:{type:"bytes",id:4},options:{type:"bytes",id:5}}}},9152:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(3210));class s extends o.default{constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new s(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}t.default=s,s.TYPE=11,s.DESCRIPTOR_NAME="PacketOptionsMessage",s.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}}},5229:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.BUFFER),u.DESCRIPTOR_NAME="StringBytesPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}}},7513:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.NUMBER),u.DESCRIPTOR_NAME="StringNumberPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}}},7926:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new u(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.OBJECT),u.DESCRIPTOR_NAME="StringObjectPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},1919:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n(8372)),c=s(n(4568));class u extends a.default{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new u(e.data,e.data1)}static create(e,t){return new u(e,t)}}t.default=u,u.TYPE=c.default.getPacketType(c.MessageDataTypes.STRING,c.MessageDataTypes.STRING),u.DESCRIPTOR_NAME="StringStringPacketDataMessage",u.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}}},9549:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.ENCODED_TYPES=void 0;const o=n(4514),s=r(n(6311)),i=r(n(4568));t.ENCODED_TYPES=[o.PacketType.EVENT,o.PacketType.ACK,o.PacketType.BINARY_ACK,o.PacketType.BINARY_EVENT];class a extends o.Encoder{constructor(e=new s.default){super(),this._packetParser=e}encode(e){if(t.ENCODED_TYPES.includes(e.type))try{return[this._packetParser.encode(e.type,e.data,e.id,e.nsp)]}catch(e){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:e.message}})}return super.encode(e)}}t.Encoder=a;class c extends o.Decoder{constructor(e=new s.default){super(),this._packetParser=e}add(e){if(!i.default.isBuffer(e))return super.add(e);let t;try{t=this._packetParser.decode(e).packet}catch(t){return super.add(e)}super.emitReserved("decoded",t)}}t.Decoder=c},4568:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDataTypes=void 0;const n=!("undefined"==typeof process||!process.versions||!process.versions.node);var r,o;(o=r=t.MessageDataTypes||(t.MessageDataTypes={}))[o.BUFFER=1]="BUFFER",o[o.STRING=2]="STRING",o[o.NUMBER=3]="NUMBER",o[o.OBJECT=4]="OBJECT";class s{static getPacketType(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*Math.pow(10,e.length-n-1);return t}static getType(e){if(s.isBuffer(e))return r.BUFFER;const t=typeof e;return"string"===t?r.STRING:"number"===t?r.NUMBER:r.OBJECT}static isBuffer(e){return n&&Buffer.isBuffer(e)||e instanceof ArrayBuffer||e instanceof Uint8Array||this._isBufferView(e)}static _isBufferView(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}t.default=s},602:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(6732));class s{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}(),this.timeout=setTimeout((()=>this.error(new o.default("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}t.default=class{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const n=this._createRequest(t);try{return e(n),await n.promise}finally{this._finishRequest(n)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new s(this._context,e);return this._requests.add(t),t}_finishRequest(e){this._requests.delete(e),clearTimeout(e.timeout)}async _waitForRequests(e=5e3,t=0){return!this._requests.size||t>=e/500?Promise.resolve():(await new Promise((e=>{setTimeout(e,500)})),this._waitForRequests(e,t++))}}},3136:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WEB_SOCKET_GATEWAY_STATES=void 0;const o=n(8623),s=r(n(9655)),i=n(2209),a=r(n(8290)),c=r(n(2203)),u=r(n(989)),d=r(n(6732)),l=r(n(9073)),p=n(9549),h=r(n(602));var f,m;(m=f=t.WEB_SOCKET_GATEWAY_STATES||(t.WEB_SOCKET_GATEWAY_STATES={})).DISCONNECTED="disconnected",m.CONNECTING="connecting",m.CONNECTED="connected";class g extends((0,i.ObservableMixin)()){constructor(e,t,n={},r=o.io,i=c.default.get){if(super(),this._token=t,this._options=n,this._connectionProvider=r,this._userFactory=i,this._requestsManager=new h.default(this),this._channels=new Map,this._connectionAttempt=0,!e)throw new TypeError("Api address must be provided.");if(!this._token)throw new TypeError("Token must be provided.");this._options.requestTimeout||(this._options.requestTimeout=2e4),this._url=(0,s.default)(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",f.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==g.STATE_CONNECTED){if(n===g.STATE_DISCONNECTED)return this._requestsManager.errorAll(new d.default("Not connected.",this))}else try{this.me=await this._userFactory.call(c.default,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:g._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==f.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=f.DISCONNECTED)}async reconnect(){this._socket||this.state!==f.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=o.io,s=c.default.get){const i=new g(t,e,n,r,s);return await i._connect(),i}_sendRequest(e,t,n){if(!e)throw new d.default("`serviceName` must be provided.",this);if(this.state!==g.STATE_CONNECTED)throw new d.default("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new d.default("Not authenticated.",this);const r=new ArrayBuffer(n.length+2),o=new Uint8Array(r);return o[0]=e,o[1]=parseInt(t),o.set(n,2),this._emit(1,o)}_getChannel(e,t){const n=""+e+t;return!this._channels.has(n)&&this._socket&&this._channels.set(n,new a.default(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise(((e,t)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),n.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),n.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",o=this._connectionProvider(n,{parser:{Encoder:p.Encoder,Decoder:p.Decoder},path:r+"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:u.default},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=f.CONNECTING,o.on("connect",(()=>{this._debugEvent("connect"),this.socketId=o.id})),o.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),o.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),o.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),o.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=f.CONNECTING,this._connectionAttempt=e})),o.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),o.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=o,o}_emit(e,t){const n=this._socket;return this._requestsManager.send((r=>{n.emit(e,t,((e,t)=>{if(e)return r.error(l.default.fromPublicError(e));r.response(t)}))}),this._options.requestTimeout)}_addAuthData(e,t){this._socketAuth={environmentId:e,userId:t,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=f.CONNECTED;const e=async(e,t,n)=>{this._debugEvent("token:value:change");try{await this._authenticate(n)}catch(e){}};this._token.on("change:value",e),this._socket.io.off("reconnect_error"),this.on("disconnect",(()=>{this._token.off("change:value",e)}))}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=f.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const e of this._channels.values())e.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(e,t){if(!this._isDebugModeEnabled())return;const n=void 0!==t?", data: "+t:"";console.info((new Date).toLocaleString()+" "+e+n)}_reconnectionAttemptError(e){this._connectionAttempt>=2&&(this.disconnect(),e(d.default.fromPublicError({message:"The number of initial connection attempts exceeded.",explanation:"Three initial connection attempts failed. It can be caused by a missing or blocked Internet connection.",action:"Please verify the stability of your Internet connection and ensure that no antivirus or firewall software blocks the Web Socket protocol connections."})))}_onUnauthorized({error:e}){this._removeAuthData(),this.fire("error",l.default.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success","envId: "+t.environmentId+", userId: "+t.userId),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;return!!i.global.window.localStorage&&"true"===(null!==(e=i.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}g.STATE_DISCONNECTED=f.DISCONNECTED,g.STATE_CONNECTING=f.CONNECTING,g.STATE_CONNECTED=f.CONNECTED,g._CHANGE_STATE_EVENT_PRIORITY=i.priorities.get("highest")+999999,t.default=g},2100:(e,t,n)=>{"use strict";e.exports=n(9482)},9482:(e,t,n)=>{"use strict";var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=o,o()},1408:(e,t,n)=>{"use strict";e.exports=c;var r,o=n(9693),s=o.LongBits,i=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,d="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new r(e):d(e)})(e)}:d};function p(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},593:(e,t,n)=>{"use strict";e.exports=s;var r=n(1408);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(9693);function s(e){r.call(this,e)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},5054:e=>{"use strict";e.exports={}},5994:(e,t,n)=>{"use strict";t.Service=n(7948)},7948:(e,t,n)=>{"use strict";e.exports=o;var r=n(9693);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,s,i){if(!s)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(e,a,t,n,o,s);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof o))try{n=o[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(e,t,n)=>{"use strict";e.exports=o;var r=n(9693);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var i=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):s},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;o.fromHash=function(e){return e===i?s:new o((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},9693:function(e,t,n){"use strict";var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:()=>e,set:void 0,enumerable:!1,configurable:!0},toString:{value(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(537),r.base64=n(9745),r.EventEmitter=n(4459),r.float=n(897),r.inquire=n(3229),r.utf8=n(113),r.pool=n(7986),r.LongBits=n(1945),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},1173:(e,t,n)=>{"use strict";e.exports=l;var r,o=n(9693),s=o.LongBits,i=o.base64,a=o.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=p(),l.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(l.alloc=o.pool(l.alloc,o.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,s.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=s.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=s.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var y=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var n=l.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(y,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=p(),r._configure()}},3155:(e,t,n)=>{"use strict";e.exports=s;var r=n(1173);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(9693);function s(){r.call(this)}function i(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=o._Buffer_allocUnsafe,s.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},s.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},s._configure()},537:e=>{"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),r=0,o=2,s=!0;for(;o<arguments.length;)n[r++]=arguments[o++];return new Promise((function(o,i){n[r]=function(e){if(s)if(s=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,i(e))}}))}},9745:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),s=0;s<64;)o[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;n.encode=function(e,t,n){for(var o,s=null,i=[],a=0,c=0;t<n;){var u=e[t++];switch(c){case 0:i[a++]=r[u>>2],o=(3&u)<<4,c=1;break;case 1:i[a++]=r[o|u>>4],o=(15&u)<<2,c=2;break;case 2:i[a++]=r[o|u>>6],i[a++]=r[63&u],c=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,i)),a=0)}return c&&(i[a++]=r[o],i[a++]=61,1===c&&(i[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,i.slice(0,a))),s.join("")):String.fromCharCode.apply(String,i.slice(0,a))};var i="invalid encoding";n.decode=function(e,t,n){for(var r,s=n,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=o[u]))throw Error(i);switch(a){case 0:r=u,a=1;break;case 1:t[n++]=r<<2|(48&u)>>4,r=u,a=2;break;case 2:t[n++]=(15&r)<<4|(60&u)>>2,r=u,a=3;break;case 3:t[n++]=(3&r)<<6|u,a=0}}if(1===a)throw Error(i);return n-s},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},4459:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},897:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function s(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:s,e.writeFloatBE=r?s:o,e.readFloatLE=r?i:a,e.readFloatBE=r?a:i}():function(){function t(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2);e((o<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,n),o=2*(r>>31)+1,s=r>>>23&255,i=8388607&r;return 255===s?i?NaN:o*(1/0):0===s?1401298464324817e-60*o*i:o*Math.pow(2,s-150)*(i+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,o),e.readFloatBE=i.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function s(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:s,e.writeDoubleBE=r?s:o,e.readDoubleLE=r?i:a,e.readDoubleBE=r?a:i}():function(){function t(e,t,n,r,o,s){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,o,s+t),e(1/r>0?0:2147483648,o,s+n);else if(isNaN(r))e(0,o,s+t),e(2146959360,o,s+n);else if(r>17976931348623157e292)e(0,o,s+t),e((i<<31|2146435072)>>>0,o,s+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,o,s+t),e((i<<31|a/4294967296)>>>0,o,s+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,o,s+t),e((i<<31|c+1023<<20|1048576*a&1048575)>>>0,o,s+n)}}}function i(e,t,n,r,o){var s=e(r,o+t),i=e(r,o+n),a=2*(i>>31)+1,c=i>>>20&2047,u=4294967296*(1048575&i)+s;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,o,0,4),e.readDoubleBE=i.bind(null,s,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},3229:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},7986:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,o=r>>>1,s=null,i=r;return function(n){if(n<1||n>o)return e(n);i+n>r&&(s=e(r),i=0);var a=t.call(s,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},113:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,s=[],i=0;t<n;)(r=e[t++])<128?s[i++]=r:r>191&&r<224?s[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[i++]=55296+(r>>10),s[i++]=56320+(1023&r)):s[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join("")):String.fromCharCode.apply(String,s.slice(0,i))},n.write=function(e,t,n){for(var r,o,s=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&o),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-s}},7325:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck-content pre>code.ck-suggestion-marker-formatBlock{box-shadow:-7px 0 0 0 #ededed,-10px 0 0 0 var(--ck-color-suggestion-marker-format-border);display:block}.ck-content pre>code.ck-suggestion-marker-formatBlock.ck-suggestion-marker--active{box-shadow:-5px 0 0 0 #ededed,-8px 0 0 0 var(--ck-color-suggestion-marker-format-border-active)}",""]);const s=o},8717:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck-content .ck-suggestion-marker-deletion.ck-widget.ck-horizontal-line{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.ck-horizontal-line.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget.ck-horizontal-line{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .ck-suggestion-marker-insertion.ck-widget.ck-horizontal-line.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}",""]);const s=o},1437:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck-content .ck-suggestion-marker-deletion.ck-widget.image{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.image img{opacity:.6}.ck-content .ck-suggestion-marker-deletion.ck-widget.image figcaption{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.image.ck-suggestion-marker--active,.ck-content .ck-suggestion-marker-deletion.ck-widget.image.ck-suggestion-marker--active figcaption{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget.image,.ck-content .ck-suggestion-marker-insertion.ck-widget.image figcaption{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .ck-suggestion-marker-insertion.ck-widget.image.ck-suggestion-marker--active,.ck-content .ck-suggestion-marker-insertion.ck-widget.image.ck-suggestion-marker--active figcaption{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}.ck-content .ck-widget.image>figcaption.ck-suggestion-marker-deletion{background-color:var(--ck-color-suggestion-widget-deletion-background);border:none}.ck-content .ck-widget.image>figcaption.ck-suggestion-marker-deletion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-widget.image>figcaption.ck-suggestion-marker-insertion{background-color:var(--ck-color-suggestion-widget-insertion-background);border:none}.ck-content .ck-widget.image>figcaption.ck-suggestion-marker-insertion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}",""]);const s=o},2040:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck-content .ck-suggestion-marker-deletion.ck-widget.media{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.media .ck-media__wrapper{opacity:.6}.ck-content .ck-suggestion-marker-deletion.ck-widget.media.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget.media{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .ck-suggestion-marker-insertion.ck-widget.media.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}",""]);const s=o},6366:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck-content .ck-suggestion-marker-deletion.ck-widget.page-break{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.page-break.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget.page-break{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .ck-suggestion-marker-insertion.ck-widget.page-break.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}",""]);const s=o},7153:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":root{--ck-color-suggestion-widget-th-insertion-background:rgba(102,229,119,.12);--ck-color-suggestion-widget-th-insertion-background-active:rgba(37,218,61,.14);--ck-color-suggestion-widget-th-deletion-background:rgba(229,102,134,.14);--ck-color-suggestion-widget-th-deletion-background-active:rgba(196,33,74,.16)}.ck-content figure.table .ck-suggestion-marker-formatBlock{box-shadow:-3px 0 0 0 var(--ck-color-suggestion-marker-format-border)}.ck-content figure.table .ck-suggestion-marker-formatBlock.ck-suggestion-marker--active{box-shadow:-3px 0 0 0 var(--ck-color-suggestion-marker-format-border-active)}.ck-content .ck-suggestion-marker-insertion.table{border-color:var(--ck-color-suggestion-marker-insertion-border)}.ck-content .ck-suggestion-marker-insertion.table>figcaption{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .ck-suggestion-marker-insertion.table>table>tbody>tr>th,.ck-content .ck-suggestion-marker-insertion.table>table>thead>tr>th{background-color:var(--ck-color-suggestion-widget-th-insertion-background);border-color:var(--ck-color-suggestion-marker-insertion-border)}.ck-content .ck-suggestion-marker-insertion.table>table>tbody>tr>td{background-color:var(--ck-color-suggestion-widget-insertion-background);border-color:var(--ck-color-suggestion-marker-insertion-border)}.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active.table{border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active.table>figcaption{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active.table>table>tbody>tr>th,.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active.table>table>thead>tr>th{background-color:var(--ck-color-suggestion-widget-th-insertion-background-active);border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active.table>table>tbody>tr>td{background-color:var(--ck-color-suggestion-widget-insertion-background-active);border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-deletion.ck-widget.table{border-color:var(--ck-color-suggestion-marker-deletion-border)}.ck-content .ck-suggestion-marker-deletion.ck-widget.table>figcaption{background-color:var(--ck-color-suggestion-widget-deletion-background)}.ck-content .ck-suggestion-marker-deletion.ck-widget.table>table>tbody>tr>th,.ck-content .ck-suggestion-marker-deletion.ck-widget.table>table>thead>tr>th{background-color:var(--ck-color-suggestion-widget-th-deletion-background);border-color:var(--ck-color-suggestion-marker-deletion-border);text-decoration:none}.ck-content .ck-suggestion-marker-deletion.ck-widget.table>table>tbody>tr>td{background-color:var(--ck-color-suggestion-widget-deletion-background);border-color:var(--ck-color-suggestion-marker-deletion-border);text-decoration:none}.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active.table{border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active.table>figcaption{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active.table>table>tbody>tr>th,.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active.table>table>thead>tr>th{background-color:var(--ck-color-suggestion-widget-th-deletion-background-active);border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active.table>table>tbody>tr>td{background-color:var(--ck-color-suggestion-widget-deletion-background-active);border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .ck-widget.table>figcaption.ck-suggestion-marker-deletion{background-color:var(--ck-color-suggestion-widget-deletion-background);border:none}.ck-content .ck-widget.table>figcaption.ck-suggestion-marker-deletion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .ck-widget.table>figcaption.ck-suggestion-marker-insertion{background-color:var(--ck-color-suggestion-widget-insertion-background);border:none}.ck-content .ck-widget.table>figcaption.ck-suggestion-marker-insertion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}.ck-content .table th.ck-suggestion-marker-insertion{background-color:var(--ck-color-suggestion-widget-th-insertion-background)}.ck-content .table th.ck-suggestion-marker-insertion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-th-insertion-background-active)}.ck-content .table th.ck-suggestion-marker-deletion{background-color:var(--ck-color-suggestion-widget-th-deletion-background);text-decoration:none}.ck-content .table th.ck-suggestion-marker-deletion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-th-deletion-background-active)}.ck-content .table td.ck-suggestion-marker-insertion{background-color:var(--ck-color-suggestion-widget-insertion-background)}.ck-content .table td.ck-suggestion-marker-insertion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-insertion-background-active)}.ck-content .table td.ck-suggestion-marker-deletion{background-color:var(--ck-color-suggestion-widget-deletion-background);text-decoration:none}.ck-content .table td.ck-suggestion-marker-deletion.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-deletion-background-active)}.ck-content .table td.ck-suggestion-marker-formatBlock,.ck-content .table td.ck-suggestion-marker-formatInline,.ck-content .table th.ck-suggestion-marker-formatBlock,.ck-content .table th.ck-suggestion-marker-formatInline{background-color:var(--ck-color-suggestion-widget-format-background);box-shadow:none}.ck-content .table td.ck-suggestion-marker-formatBlock.ck-suggestion-marker--active,.ck-content .table td.ck-suggestion-marker-formatInline.ck-suggestion-marker--active,.ck-content .table th.ck-suggestion-marker-formatBlock.ck-suggestion-marker--active,.ck-content .table th.ck-suggestion-marker-formatInline.ck-suggestion-marker--active{background-color:var(--ck-color-suggestion-widget-format-background-active);box-shadow:none}",""]);const s=o},7374:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":root{--ck-color-comment-box-border:#f2de02;--ck-color-suggestion-box-deletion-border:#d85a79;--ck-color-suggestion-box-insertion-border:#5ad86b;--ck-color-suggestion-box-format-border:#5ac1d8}.ck .ck-suggestion{border-top-left-radius:var(--ck-border-radius)}.ck .ck-annotation{border-left:3px solid transparent}.ck .ck-suggestion--disabled-comments .ck-annotation{min-height:80px}.ck .ck-comment,.ck .ck-comment__input-container,.ck .ck-thread__comment-count,.ck .ck-thread__header{border-left:3px solid var(--ck-color-comment-box-border)}.ck .ck-suggestion-insertion .ck-suggestion{border-left-color:var(--ck-color-suggestion-box-insertion-border)}.ck .ck-suggestion-deletion .ck-suggestion{border-left-color:var(--ck-color-suggestion-box-deletion-border)}.ck .ck-suggestion-replace .ck-suggestion{border-left-color:var(--ck-color-suggestion-box-insertion-border)}.ck .ck-suggestion-format .ck-suggestion{border-left-color:var(--ck-color-suggestion-box-format-border)}.ck .ck-suggestion-wrapper{outline:0;overflow:hidden}.ck .ck-suggestion-type{font-weight:700}.ck .ck-suggestion-color{border-radius:14px;box-shadow:0 0 0 1px #444;display:inline-block;height:14px;margin:0 5px;vertical-align:text-bottom;width:14px}.ck .ck-suggestion-insertion .ck-comment,.ck .ck-suggestion-insertion .ck-comment__input-container,.ck .ck-suggestion-insertion .ck-thread__comment-count,.ck .ck-suggestion-replace .ck-comment,.ck .ck-suggestion-replace .ck-comment__input-container,.ck .ck-suggestion-replace .ck-thread__comment-count{border-left-color:var(--ck-color-suggestion-box-insertion-border)}.ck .ck-suggestion-deletion .ck-comment,.ck .ck-suggestion-deletion .ck-comment__input-container,.ck .ck-suggestion-deletion .ck-thread__comment-count{border-left-color:var(--ck-color-suggestion-box-deletion-border)}.ck .ck-suggestion-format .ck-comment,.ck .ck-suggestion-format .ck-comment__input-container,.ck .ck-suggestion-format .ck-thread__comment-count{border-left-color:var(--ck-color-suggestion-box-format-border)}",""]);const s=o},2228:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':root{--ck-color-suggestion-marker-insertion-border:rgba(30,174,49,.35);--ck-color-suggestion-marker-insertion-border-active:rgba(18,109,31,.5);--ck-color-suggestion-marker-insertion-background:rgba(102,229,119,.35);--ck-color-suggestion-marker-insertion-background-active:rgba(37,218,61,.5);--ck-color-suggestion-marker-deletion-border:rgba(174,30,66,.35);--ck-color-suggestion-marker-deletion-border-active:rgba(109,18,41,.5);--ck-color-suggestion-marker-deletion-background:rgba(229,102,134,.35);--ck-color-suggestion-marker-deletion-background-active:rgba(218,37,82,.5);--ck-color-suggestion-marker-deletion-stroke:rgba(87,15,33,.5);--ck-color-suggestion-marker-format-border:rgba(10,160,194,.4);--ck-color-suggestion-marker-format-border-active:rgba(10,160,194,.65);--ck-color-suggestion-widget-insertion-background:rgba(102,229,119,.05);--ck-color-suggestion-widget-insertion-background-active:rgba(37,218,61,.07);--ck-color-suggestion-widget-deletion-background:rgba(229,102,134,.05);--ck-color-suggestion-widget-deletion-background-active:rgba(196,33,74,.07);--ck-color-suggestion-widget-format-background:rgba(10,160,194,.09);--ck-color-suggestion-widget-format-background-active:rgba(10,160,194,.16)}.ck-content .ck-suggestion-marker-insertion{background:var(--ck-color-suggestion-marker-insertion-background);border-bottom:3px solid var(--ck-color-suggestion-marker-insertion-border);border-top:3px solid var(--ck-color-suggestion-marker-insertion-border)}.ck-content .ck-suggestion-marker-insertion.ck-suggestion-marker--active{background:var(--ck-color-suggestion-marker-insertion-background-active);border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-insertion.ck-widget{background:none;border:3px solid var(--ck-color-suggestion-marker-insertion-border);text-decoration:none}.ck-content .ck-suggestion-marker-insertion.ck-widget.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-deletion{background:var(--ck-color-suggestion-marker-deletion-background);border-bottom:3px solid var(--ck-color-suggestion-marker-deletion-border);border-top:3px solid var(--ck-color-suggestion-marker-deletion-border);text-decoration:line-through;text-decoration-color:var(--ck-color-suggestion-marker-deletion-stroke);text-decoration-thickness:3px}.ck-content .ck-suggestion-marker-deletion.ck-suggestion-marker--active{background:var(--ck-color-suggestion-marker-deletion-background-active);border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .ck-suggestion-marker-deletion.ck-widget{background:none;border:3px solid var(--ck-color-suggestion-marker-deletion-border);text-decoration:none}.ck-content .ck-suggestion-marker-deletion.ck-widget.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .ck-suggestion-marker-merge:after{background:var(--ck-color-suggestion-marker-deletion-background);border-bottom:3px solid var(--ck-color-suggestion-marker-deletion-border);border-top:3px solid var(--ck-color-suggestion-marker-deletion-border);color:var(--ck-color-suggestion-marker-deletion-stroke);content:"¶";text-decoration:line-through;text-decoration-color:var(--ck-color-suggestion-marker-deletion-stroke)}.ck-content .ck-suggestion-marker-merge.ck-suggestion-marker--active:after{background:var(--ck-color-suggestion-marker-deletion-background-active);border-color:var(--ck-color-suggestion-marker-deletion-border-active)}.ck-content .ck-suggestion-marker-split:after{background:var(--ck-color-suggestion-marker-insertion-background);border-bottom:3px solid var(--ck-color-suggestion-marker-insertion-border);border-top:3px solid var(--ck-color-suggestion-marker-insertion-border);color:var(--ck-color-suggestion-marker-insertion-border);content:"¶"}.ck-content .ck-suggestion-marker-split.ck-suggestion-marker--active:after{background:var(--ck-color-suggestion-marker-insertion-background-active);border-color:var(--ck-color-suggestion-marker-insertion-border-active)}.ck-content .ck-suggestion-marker-formatInline{border-bottom:3px solid var(--ck-color-suggestion-marker-format-border);border-top:3px solid var(--ck-color-suggestion-marker-format-border)}.ck-content .ck-suggestion-marker-formatInline.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-format-border-active)}.ck-content .ck-suggestion-marker-formatInline.ck-widget{background:none;border:3px solid var(--ck-color-suggestion-marker-format-border)}.ck-content .ck-suggestion-marker-formatInline.ck-widget.ck-suggestion-marker--active{border-color:var(--ck-color-suggestion-marker-format-border-active)}.ck-content .ck-suggestion-marker-formatBlock{background:none;border:0;box-shadow:-7px 0 0 0 var(--ck-color-base-background),-10px 0 0 0 var(--ck-color-suggestion-marker-format-border)}.ck-content .ck-suggestion-marker-formatBlock.ck-suggestion-marker--active{box-shadow:-5px 0 0 0 var(--ck-color-base-background),-8px 0 0 0 var(--ck-color-suggestion-marker-format-border-active)}.ck-content ol .ck-suggestion-marker-formatBlock,.ck-content ul .ck-suggestion-marker-formatBlock{box-shadow:-2px 0 0 0 var(--ck-color-base-background),-5px 0 0 0 var(--ck-color-suggestion-marker-format-border)}.ck-content ol .ck-suggestion-marker-formatBlock.ck-suggestion-marker--active,.ck-content ul .ck-suggestion-marker-formatBlock.ck-suggestion-marker--active{box-shadow:-2px 0 0 0 var(--ck-color-base-background),-5px 0 0 0 var(--ck-color-suggestion-marker-format-border-active)}',""]);const s=o},4808:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":root{--ck-user-colors--0:#6d78e8;--ck-user-colors--0-alpha:rgba(109,120,232,.15);--ck-user-colors--1:#007a6c;--ck-user-colors--1-alpha:rgba(0,122,108,.15);--ck-user-colors--2:#ba4545;--ck-user-colors--2-alpha:rgba(186,69,69,.15);--ck-user-colors--3:#5635b1;--ck-user-colors--3-alpha:rgba(86,53,177,.15);--ck-user-colors--4:#548a2e;--ck-user-colors--4-alpha:rgba(84,138,46,.15);--ck-user-colors--5:#c3185d;--ck-user-colors--5-alpha:rgba(195,24,93,.15);--ck-user-colors--6:#ea4343;--ck-user-colors--6-alpha:rgba(234,67,67,.15);--ck-user-colors--7:#0bc3d0;--ck-user-colors--7-alpha:rgba(11,195,208,.15);--ck-user-dot-size:6px}.ck .ck-user__color--0{color:var(--ck-user-colors--0)}.ck .ck-user__bg-color--0{background-color:var(--ck-user-colors--0)}.ck .ck-user__selection--0{background-color:var(--ck-user-colors--0-alpha)}.ck .ck-user__selection--0.ck-widget{background-color:transparent;border:3px solid var(--ck-user-colors--0)}.ck .ck-user__marker--0,.ck .ck-user__marker--0 .ck-user__marker-dot,.ck .ck-user__marker--0:after{background-color:var(--ck-user-colors--0)}.ck .ck-user__marker--0 .ck-user__marker-line{border:1px solid var(--ck-user-colors--0)}.ck .ck-user__color--1{color:var(--ck-user-colors--1)}.ck .ck-user__bg-color--1{background-color:var(--ck-user-colors--1)}.ck .ck-user__selection--1{background-color:var(--ck-user-colors--1-alpha)}.ck .ck-user__selection--1.ck-widget{background-color:transparent;border:3px solid var(--ck-user-colors--1)}.ck .ck-user__marker--1,.ck .ck-user__marker--1 .ck-user__marker-dot,.ck .ck-user__marker--1:after{background-color:var(--ck-user-colors--1)}.ck .ck-user__marker--1 .ck-user__marker-line{border:1px solid var(--ck-user-colors--1)}.ck .ck-user__color--2{color:var(--ck-user-colors--2)}.ck .ck-user__bg-color--2{background-color:var(--ck-user-colors--2)}.ck .ck-user__selection--2{background-color:var(--ck-user-colors--2-alpha)}.ck .ck-user__selection--2.ck-widget{background-color:transparent;border:3px solid var(--ck-user-colors--2)}.ck .ck-user__marker--2,.ck .ck-user__marker--2 .ck-user__marker-dot,.ck .ck-user__marker--2:after{background-color:var(--ck-user-colors--2)}.ck .ck-user__marker--2 .ck-user__marker-line{border:1px solid var(--ck-user-colors--2)}.ck .ck-user__color--3{color:var(--ck-user-colors--3)}.ck .ck-user__bg-color--3{background-color:var(--ck-user-colors--3)}.ck .ck-user__selection--3{background-color:var(--ck-user-colors--3-alpha)}.ck .ck-user__selection--3.ck-widget{background-color:transparent;border:3px solid var(--ck-user-colors--3)}.ck .ck-user__marker--3,.ck .ck-user__marker--3 .ck-user__marker-dot,.ck .ck-user__marker--3:after{background-color:var(--ck-user-colors--3)}.ck .ck-user__marker--3 .ck-user__marker-line{border:1px solid var(--ck-user-colors--3)}.ck .ck-user__color--4{color:var(--ck-user-colors--4)}.ck .ck-user__bg-color--4{background-color:var(--ck-user-colors--4)}.ck .ck-user__selection--4{background-color:var(--ck-user-colors--4-alpha)}.ck .ck-user__selection--4.ck-widget{background-color:transparent;border:3px solid var(--ck-user-colors--4)}.ck .ck-user__marker--4,.ck .ck-user__marker--4 .ck-user__marker-dot,.ck .ck-user__marker--4:after{background-color:var(--ck-user-colors--4)}.ck .ck-user__marker--4 .ck-user__marker-line{border:1px solid var(--ck-user-colors--4)}.ck .ck-user__color--5{color:var(--ck-user-colors--5)}.ck .ck-user__bg-color--5{background-color:var(--ck-user-colors--5)}.ck .ck-user__selection--5{background-color:var(--ck-user-colors--5-alpha)}.ck .ck-user__selection--5.ck-widget{background-color:transparent;border:3px solid var(--ck-user-colors--5)}.ck .ck-user__marker--5,.ck .ck-user__marker--5 .ck-user__marker-dot,.ck .ck-user__marker--5:after{background-color:var(--ck-user-colors--5)}.ck .ck-user__marker--5 .ck-user__marker-line{border:1px solid var(--ck-user-colors--5)}.ck .ck-user__color--6{color:var(--ck-user-colors--6)}.ck .ck-user__bg-color--6{background-color:var(--ck-user-colors--6)}.ck .ck-user__selection--6{background-color:var(--ck-user-colors--6-alpha)}.ck .ck-user__selection--6.ck-widget{background-color:transparent;border:3px solid var(--ck-user-colors--6)}.ck .ck-user__marker--6,.ck .ck-user__marker--6 .ck-user__marker-dot,.ck .ck-user__marker--6:after{background-color:var(--ck-user-colors--6)}.ck .ck-user__marker--6 .ck-user__marker-line{border:1px solid var(--ck-user-colors--6)}.ck .ck-user__color--7{color:var(--ck-user-colors--7)}.ck .ck-user__bg-color--7{background-color:var(--ck-user-colors--7)}.ck .ck-user__selection--7{background-color:var(--ck-user-colors--7-alpha)}.ck .ck-user__selection--7.ck-widget{background-color:transparent;border:3px solid var(--ck-user-colors--7)}.ck .ck-user__marker--7,.ck .ck-user__marker--7 .ck-user__marker-dot,.ck .ck-user__marker--7:after{background-color:var(--ck-user-colors--7)}.ck .ck-user__marker--7 .ck-user__marker-line{border:1px solid var(--ck-user-colors--7)}",""]);const s=o},7678:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":root{--ck-user-avatar-size:40px;--ck-user-avatar-background:#3670ab;--ck-user-avatar-color:#fff}.ck.ck-user{align-items:center;background-color:var(--ck-user-avatar-background);border-radius:50%;display:flex;height:var(--ck-user-avatar-size);justify-content:center;min-height:var(--ck-user-avatar-size);min-width:var(--ck-user-avatar-size);position:relative;width:var(--ck-user-avatar-size)}.ck.ck-user__name{color:var(--ck-user-avatar-color);cursor:default;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-user__name.ck-user__name--hidden{display:none}.ck.ck-user__img{background-color:var(--ck-user-avatar-background);background-position:50%;background-repeat:no-repeat;background-size:cover;border:2px solid var(--ck-user-avatar-background);border-radius:50%;display:none;height:inherit;width:inherit}.ck.ck-user__img.ck-user__anonymous{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23FFF' d='M9.8 20H2c0-5.7 5-5.7 6-7l.2-.8c-1.6-.8-2.7-2.7-2.7-5 0-2.8 2-5.2 4.3-5.2S14 4.4 14 7.3c0 2.2-1 4-2.6 5l.2.6c1.2 1.3 6 1.4 6 7H9.8z'/%3E%3C/svg%3E\");display:block}.ck.ck-user__img.ck-user__anonymous+.ck-user__name{display:none}.ck.ck-user__img.ck-user__avatar{background-color:#fff;display:block}.ck.ck-user__img.ck-user__img--hidden{display:none}.ck.ck-user__notification{align-items:center;background:#fff;border:2px solid #fff;border-radius:50%;box-sizing:content-box;display:flex;height:15px;justify-content:center;overflow:hidden;position:absolute;right:-7px;top:-8px;transform:translateZ(0);width:15px}.ck.ck-user__notification .ck-user__icon{background:#fff;color:var(--ck-color-annotation-info);height:19px;max-height:19px;max-width:19px;min-height:19px;min-width:19px;width:19px}",""]);const s=o},3286:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck.ck-balloon-panel.ck-tooltip{pointer-events:none;z-index:calc(var(--ck-z-modal) + 100)}:root{--ck-color-presence-list-dropdown-background:#fff;--ck-color-presence-list-dropdown-arrow-border:#ebebeb;--ck-presence-list-dropdown-list-max-width:250px;--ck-presence-list-dropdown-list-min-width:180px;--ck-presence-list-users-tooltip-max-width:120px;--ck-presence-list-users-tooltip-min-width:25px}.ck.ck-presence-list{align-items:center;display:flex;font-size:var(--ck-font-size-base);margin-right:var(--ck-spacing-standard);transition:margin-right .2s ease-in-out}.ck.ck-presence-list *{box-sizing:border-box}.ck.ck-presence-list__list{display:flex;justify-content:flex-end}.ck.ck-presence-list__counter{color:var(--ck-color-base-text)}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:0;color:inherit;font:inherit;margin-left:var(--ck-spacing-standard);outline:none;padding:0;position:relative}.ck.ck-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck.ck-presence-list--collapsed .ck-presence-list__list{margin-left:var(--ck-spacing-standard);min-width:calc(var(--ck-user-avatar-size)*1.5)}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{margin-left:calc(var(--ck-user-avatar-size)*-1 + 5px)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(2){opacity:.75}.ck.ck-presence-list__balloon{--ck-color-panel-border:var(--ck-color-presence-list-dropdown-arrow-border);--ck-color-panel-background:var(--ck-color-presence-list-dropdown-background);animation:fadeIn .3s ease-in-out;background-color:var(--ck-color-presence-list-dropdown-background);border:0;opacity:1}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-height:80vh;max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width);overflow-x:hidden;overflow-y:auto}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item{align-items:center;background:none;border:0;color:inherit;display:flex;font:inherit;outline:none;padding:0;padding:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:first-of-type .ck-presence-list__marker{border-top-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:last-of-type .ck-presence-list__marker{border-bottom-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck-user__full-name{color:var(--ck-color-base-text);margin-left:var(--ck-spacing-standard);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck.ck-presence-list__marker{height:100%;left:0;margin:0;position:absolute;width:3px}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const s=o},3608:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(7758),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ck .ck-user__marker{cursor:default;display:inline;position:relative}.ck .ck-user__marker:after{color:#fff;content:attr(data-name);display:none;font-family:Georgia,sans-serif;font-size:var(--ck-font-size-base);font-style:normal;font-weight:400;left:0;line-height:1;opacity:0;padding:var(--ck-spacing-small);position:absolute;top:-20px;transition:opacity .2s linear,transform .3s ease-in-out;white-space:nowrap;z-index:99999}.ck .ck-user__marker:hover .ck-user__marker-dot{width:0}.ck .ck-user__marker:hover:after{animation:fadeInLeft .3s ease-in-out;display:block;opacity:1}.ck .ck-user__marker-line{bottom:0;height:100%;position:absolute;width:0}.ck .ck-user__marker-dot{border-radius:50%;cursor:default;display:block;height:var(--ck-user-dot-size);left:50%;position:absolute;top:calc((var(--ck-user-dot-size)/2)*-1);transform:translate(-50%,-50%);width:var(--ck-user-dot-size)}.ck .ck-placeholder .ck-user__marker{display:none}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const s=o},7758:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var s=0;s<this.length;s++){var i=this[s][0];null!=i&&(o[i]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},7154:e=>{var t=1e3,n=60*t,r=60*n,o=24*r,s=7*o,i=365.25*o;function a(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var s=Math.abs(e);if(s>=o)return a(e,s,o,"day");if(s>=r)return a(e,s,r,"hour");if(s>=n)return a(e,s,n,"minute");if(s>=t)return a(e,s,t,"second");return e+" ms"}(e):function(e){var s=Math.abs(e);if(s>=o)return Math.round(e/o)+"d";if(s>=r)return Math.round(e/r)+"h";if(s>=n)return Math.round(e/n)+"m";if(s>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},5579:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(3847)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},3847:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,s,i=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),s=o-(n||o);r.diff=s,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";i++;const s=t.formatters[o];if("function"==typeof s){const t=e[i];n=s.call(r,t),e.splice(i,1),i--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(7154),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},6386:(e,t,n)=>{"use strict";e.exports=n(9016)},9016:(e,t,n)=>{"use strict";var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(2944),r.BufferWriter=n(2178),r.Reader=n(9867),r.BufferReader=n(2676),r.util=n(4155),r.rpc=n(3290),r.roots=n(284),r.configure=o,o()},9867:(e,t,n)=>{"use strict";e.exports=c;var r,o=n(4155),s=o.LongBits,i=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,d="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new r(e):d(e)})(e)}:d};function p(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},2676:(e,t,n)=>{"use strict";e.exports=s;var r=n(9867);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(4155);function s(e){r.call(this,e)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},284:e=>{"use strict";e.exports={}},3290:(e,t,n)=>{"use strict";t.Service=n(979)},979:(e,t,n)=>{"use strict";e.exports=o;var r=n(4155);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,s,i){if(!s)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(e,a,t,n,o,s);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof o))try{n=o[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},8950:(e,t,n)=>{"use strict";e.exports=o;var r=n(4155);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var i=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):s},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;o.fromHash=function(e){return e===i?s:new o((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},4155:function(e,t,n){"use strict";var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(537),r.base64=n(9745),r.EventEmitter=n(4459),r.float=n(897),r.inquire=n(3229),r.utf8=n(113),r.pool=n(7986),r.LongBits=n(8950),r.isNode=Boolean(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},2944:(e,t,n)=>{"use strict";e.exports=l;var r,o=n(4155),s=o.LongBits,i=o.base64,a=o.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=p(),l.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(l.alloc=o.pool(l.alloc,o.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,s.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=s.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=s.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var y=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var n=l.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(y,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=p(),r._configure()}},2178:(e,t,n)=>{"use strict";e.exports=s;var r=n(2944);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(4155);function s(){r.call(this)}function i(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=o._Buffer_allocUnsafe,s.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},s.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},s._configure()},1829:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,s,i=[];for(s in"string"!=typeof t&&(t="?"),e)if(n.call(e,s)){if((r=e[s])||null!=r&&!isNaN(r)||(r=""),s=o(s),r=o(r),null===s||null===r)continue;i.push(s+"="+r)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,o={};t=n.exec(e);){var s=r(t[1]),i=r(t[2]);null===s||null===i||s in o||(o[s]=i)}return o}},3722:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},3278:(e,t,n)=>{"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},s=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],o=0;o<e.length;o++){var s=e[o],c=t.base?s[0]+t.base:s[0],u=n[c]||0,d="".concat(c," ").concat(u);n[c]=u+1;var l=a(d),p={css:s[1],media:s[2],sourceMap:s[3]};-1!==l?(i[l].references++,i[l].updater(p)):i.push({identifier:d,updater:g(p,t),references:1}),r.push(d)}return r}function u(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=s(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var d,l=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function p(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,o);else{var s=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(s,i[t]):e.appendChild(s)}}function h(e,t,n){var r=n.css,o=n.media,s=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,m=0;function g(e,t){var n,r,o;if(t.singleton){var s=m++;n=f||(f=u(t)),r=p.bind(null,n,s,!1),o=p.bind(null,n,s,!0)}else n=u(t),r=h.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=a(n[r]);i[o].references--}for(var s=c(e,t),u=0;u<n.length;u++){var d=a(n[u]);0===i[d].references&&(i[d].updater(),i.splice(d,1))}n=s}}}},9655:(e,t,n)=>{"use strict";var r=n(3722),o=n(1829),s=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,d=/^[a-zA-Z]:/;function l(e){return(e||"").toString().replace(s,"")}var p=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function f(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},o={},s=typeof(e=e||r);if("blob:"===e.protocol)o=new y(unescape(e.pathname),{});else if("string"===s)for(t in o=new y(e,{}),h)delete o[t];else if("object"===s){for(t in e)t in h||(o[t]=e[t]);void 0===o.slashes&&(o.slashes=a.test(e.href))}return o}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=l(e)).replace(i,""),t=t||{};var n,r=u.exec(e),o=r[1]?r[1].toLowerCase():"",s=!!r[2],a=!!r[3],c=0;return s?a?(n=r[2]+r[3]+r[4],c=r[2].length+r[3].length):(n=r[2]+r[4],c=r[2].length):a?(n=r[3]+r[4],c=r[3].length):n=r[4],"file:"===o?c>=2&&(n=n.slice(2)):m(o)?n=r[4]:o?s&&(n=n.slice(2)):c>=2&&m(t.protocol)&&(n=r[4]),{protocol:o,slashes:s||m(o),slashesCount:c,rest:n}}function y(e,t,n){if(e=(e=l(e)).replace(i,""),!(this instanceof y))return new y(e,t,n);var s,a,c,u,h,b,v=p.slice(),O=typeof t,w=this,_=0;for("object"!==O&&"string"!==O&&(n=t,t=null),n&&"function"!=typeof n&&(n=o.parse),s=!(a=g(e||"",t=f(t))).protocol&&!a.slashes,w.slashes=a.slashes||s&&t.slashes,w.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||d.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(w.protocol)))&&(v[3]=[/(.*)/,"pathname"]);_<v.length;_++)"function"!=typeof(u=v[_])?(c=u[0],b=u[1],c!=c?w[b]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof u[2]?(w[b]=e.slice(0,h),e=e.slice(h+u[2])):(w[b]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(w[b]=h[1],e=e.slice(0,h.index)),w[b]=w[b]||s&&u[3]&&t[b]||"",u[4]&&(w[b]=w[b].toLowerCase())):e=u(e,w);n&&(w.query=n(w.query)),s&&t.slashes&&"/"!==w.pathname.charAt(0)&&(""!==w.pathname||""!==t.pathname)&&(w.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],s=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(s=!0),n.splice(r,1),i--);return s&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(w.pathname,t.pathname)),"/"!==w.pathname.charAt(0)&&m(w.protocol)&&(w.pathname="/"+w.pathname),r(w.port,w.protocol)||(w.host=w.hostname,w.port=""),w.username=w.password="",w.auth&&(~(h=w.auth.indexOf(":"))?(w.username=w.auth.slice(0,h),w.username=encodeURIComponent(decodeURIComponent(w.username)),w.password=w.auth.slice(h+1),w.password=encodeURIComponent(decodeURIComponent(w.password))):w.username=encodeURIComponent(decodeURIComponent(w.auth)),w.auth=w.password?w.username+":"+w.password:w.username),w.origin="file:"!==w.protocol&&m(w.protocol)&&w.host?w.protocol+"//"+w.host:"null",w.href=w.toString()}y.prototype={set:function(e,t,n){var s=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||o.parse)(t)),s[e]=t;break;case"port":s[e]=t,r(t,s.protocol)?t&&(s.host=s.hostname+":"+t):(s.host=s.hostname,s[e]="");break;case"hostname":s[e]=t,s.port&&(t+=":"+s.port),s.host=t;break;case"host":s[e]=t,c.test(t)?(t=t.split(":"),s.port=t.pop(),s.hostname=t.join(":")):(s.hostname=t,s.port="");break;case"protocol":s.protocol=t.toLowerCase(),s.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";s[e]=t.charAt(0)!==i?i+t:t}else s[e]=t;break;case"username":case"password":s[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(s.username=t.slice(0,a),s.username=encodeURIComponent(decodeURIComponent(s.username)),s.password=t.slice(a+1),s.password=encodeURIComponent(decodeURIComponent(s.password))):s.username=encodeURIComponent(decodeURIComponent(t))}for(var u=0;u<p.length;u++){var d=p[u];d[4]&&(s[d[1]]=s[d[1]].toLowerCase())}return s.auth=s.password?s.username+":"+s.password:s.username,s.origin="file:"!==s.protocol&&m(s.protocol)&&s.host?s.protocol+"//"+s.host:"null",s.href=s.toString(),s},toString:function(e){e&&"function"==typeof e||(e=o.stringify);var t,n=this,r=n.host,s=n.protocol;s&&":"!==s.charAt(s.length-1)&&(s+=":");var i=s+(n.protocol&&n.slashes||m(n.protocol)?"//":"");return n.username?(i+=n.username,n.password&&(i+=":"+n.password),i+="@"):n.password?(i+=":"+n.password,i+="@"):"file:"!==n.protocol&&m(n.protocol)&&!r&&"/"!==n.pathname&&(i+="@"),(":"===r[r.length-1]||c.test(n.hostname)&&!n.port)&&(r+=":"),i+=r+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},y.extractProtocol=g,y.location=f,y.trimLeft=l,y.qs=o,e.exports=y},5003:(e,t,n)=>{"use strict";var r;n.r(t),n.d(t,{NIL:()=>j,parse:()=>g,stringify:()=>d,v1:()=>m,v3:()=>S,v4:()=>P,v5:()=>E,validate:()=>a,version:()=>D});var o=new Uint8Array(16);function s(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}const i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function(e){return"string"==typeof e&&i.test(e)};for(var c=[],u=0;u<256;++u)c.push((u+256).toString(16).substr(1));const d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n};var l,p,h=0,f=0;const m=function(e,t,n){var r=t&&n||0,o=t||new Array(16),i=(e=e||{}).node||l,a=void 0!==e.clockseq?e.clockseq:p;if(null==i||null==a){var c=e.random||(e.rng||s)();null==i&&(i=l=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==a&&(a=p=16383&(c[6]<<8|c[7]))}var u=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:f+1,g=u-h+(m-f)/1e4;if(g<0&&void 0===e.clockseq&&(a=a+1&16383),(g<0||u>h)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=u,f=m,p=a;var y=(1e4*(268435455&(u+=122192928e5))+m)%4294967296;o[r++]=y>>>24&255,o[r++]=y>>>16&255,o[r++]=y>>>8&255,o[r++]=255&y;var b=u/4294967296*1e4&268435455;o[r++]=b>>>8&255,o[r++]=255&b,o[r++]=b>>>24&15|16,o[r++]=b>>>16&255,o[r++]=a>>>8|128,o[r++]=255&a;for(var v=0;v<6;++v)o[r+v]=i[v];return t||d(o)};const g=function(e){if(!a(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function y(e,t,n){function r(e,r,o,s){if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=g(r)),16!==r.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var i=new Uint8Array(16+e.length);if(i.set(r),i.set(e,r.length),(i=n(i))[6]=15&i[6]|t,i[8]=63&i[8]|128,o){s=s||0;for(var a=0;a<16;++a)o[s+a]=i[a];return o}return d(i)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function b(e){return 14+(e+64>>>9<<4)+1}function v(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function O(e,t,n,r,o,s){return v((i=v(v(t,e),v(r,s)))<<(a=o)|i>>>32-a,n);var i,a}function w(e,t,n,r,o,s,i){return O(t&n|~t&r,e,t,o,s,i)}function _(e,t,n,r,o,s,i){return O(t&r|n&~r,e,t,o,s,i)}function k(e,t,n,r,o,s,i){return O(t^n^r,e,t,o,s,i)}function x(e,t,n,r,o,s,i){return O(n^(t|~r),e,t,o,s,i)}const I=function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,r="0123456789abcdef",o=0;o<n;o+=8){var s=e[o>>5]>>>o%32&255,i=parseInt(r.charAt(s>>>4&15)+r.charAt(15&s),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[b(t)-1]=t;for(var n=1732584193,r=-271733879,o=-1732584194,s=271733878,i=0;i<e.length;i+=16){var a=n,c=r,u=o,d=s;n=w(n,r,o,s,e[i],7,-680876936),s=w(s,n,r,o,e[i+1],12,-389564586),o=w(o,s,n,r,e[i+2],17,606105819),r=w(r,o,s,n,e[i+3],22,-1044525330),n=w(n,r,o,s,e[i+4],7,-176418897),s=w(s,n,r,o,e[i+5],12,1200080426),o=w(o,s,n,r,e[i+6],17,-1473231341),r=w(r,o,s,n,e[i+7],22,-45705983),n=w(n,r,o,s,e[i+8],7,1770035416),s=w(s,n,r,o,e[i+9],12,-1958414417),o=w(o,s,n,r,e[i+10],17,-42063),r=w(r,o,s,n,e[i+11],22,-1990404162),n=w(n,r,o,s,e[i+12],7,1804603682),s=w(s,n,r,o,e[i+13],12,-40341101),o=w(o,s,n,r,e[i+14],17,-1502002290),n=_(n,r=w(r,o,s,n,e[i+15],22,1236535329),o,s,e[i+1],5,-165796510),s=_(s,n,r,o,e[i+6],9,-1069501632),o=_(o,s,n,r,e[i+11],14,643717713),r=_(r,o,s,n,e[i],20,-373897302),n=_(n,r,o,s,e[i+5],5,-701558691),s=_(s,n,r,o,e[i+10],9,38016083),o=_(o,s,n,r,e[i+15],14,-660478335),r=_(r,o,s,n,e[i+4],20,-405537848),n=_(n,r,o,s,e[i+9],5,568446438),s=_(s,n,r,o,e[i+14],9,-1019803690),o=_(o,s,n,r,e[i+3],14,-187363961),r=_(r,o,s,n,e[i+8],20,1163531501),n=_(n,r,o,s,e[i+13],5,-1444681467),s=_(s,n,r,o,e[i+2],9,-51403784),o=_(o,s,n,r,e[i+7],14,1735328473),n=k(n,r=_(r,o,s,n,e[i+12],20,-1926607734),o,s,e[i+5],4,-378558),s=k(s,n,r,o,e[i+8],11,-2022574463),o=k(o,s,n,r,e[i+11],16,1839030562),r=k(r,o,s,n,e[i+14],23,-35309556),n=k(n,r,o,s,e[i+1],4,-1530992060),s=k(s,n,r,o,e[i+4],11,1272893353),o=k(o,s,n,r,e[i+7],16,-155497632),r=k(r,o,s,n,e[i+10],23,-1094730640),n=k(n,r,o,s,e[i+13],4,681279174),s=k(s,n,r,o,e[i],11,-358537222),o=k(o,s,n,r,e[i+3],16,-722521979),r=k(r,o,s,n,e[i+6],23,76029189),n=k(n,r,o,s,e[i+9],4,-640364487),s=k(s,n,r,o,e[i+12],11,-421815835),o=k(o,s,n,r,e[i+15],16,530742520),n=x(n,r=k(r,o,s,n,e[i+2],23,-995338651),o,s,e[i],6,-198630844),s=x(s,n,r,o,e[i+7],10,1126891415),o=x(o,s,n,r,e[i+14],15,-1416354905),r=x(r,o,s,n,e[i+5],21,-57434055),n=x(n,r,o,s,e[i+12],6,1700485571),s=x(s,n,r,o,e[i+3],10,-1894986606),o=x(o,s,n,r,e[i+10],15,-1051523),r=x(r,o,s,n,e[i+1],21,-2054922799),n=x(n,r,o,s,e[i+8],6,1873313359),s=x(s,n,r,o,e[i+15],10,-30611744),o=x(o,s,n,r,e[i+6],15,-1560198380),r=x(r,o,s,n,e[i+13],21,1309151649),n=x(n,r,o,s,e[i+4],6,-145523070),s=x(s,n,r,o,e[i+11],10,-1120210379),o=x(o,s,n,r,e[i+2],15,718787259),r=x(r,o,s,n,e[i+9],21,-343485551),n=v(n,a),r=v(r,c),o=v(o,u),s=v(s,d)}return[n,r,o,s]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(b(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))};const S=y("v3",48,I);const P=function(e,t,n){var r=(e=e||{}).random||(e.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return d(r)};function T(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:case 3:return t^n^r;case 2:return t&n^t&r^n&r}}function A(e,t){return e<<t|e>>>32-t}const C=function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var o=0;o<r.length;++o)e.push(r.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var s=e.length/4+2,i=Math.ceil(s/16),a=new Array(i),c=0;c<i;++c){for(var u=new Uint32Array(16),d=0;d<16;++d)u[d]=e[64*c+4*d]<<24|e[64*c+4*d+1]<<16|e[64*c+4*d+2]<<8|e[64*c+4*d+3];a[c]=u}a[i-1][14]=8*(e.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(e.length-1)&4294967295;for(var l=0;l<i;++l){for(var p=new Uint32Array(80),h=0;h<16;++h)p[h]=a[l][h];for(var f=16;f<80;++f)p[f]=A(p[f-3]^p[f-8]^p[f-14]^p[f-16],1);for(var m=n[0],g=n[1],y=n[2],b=n[3],v=n[4],O=0;O<80;++O){var w=Math.floor(O/20),_=A(m,5)+T(w,g,y,b)+v+t[w]+p[O]>>>0;v=b,b=y,y=A(g,30)>>>0,g=m,m=_}n[0]=n[0]+m>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+y>>>0,n[3]=n[3]+b>>>0,n[4]=n[4]+v>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]};const E=y("v5",80,C),j="00000000-0000-0000-0000-000000000000";const D=function(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},2704:(e,t,n)=>{e.exports=n(7079)("./src/core.js")},1492:(e,t,n)=>{e.exports=n(7079)("./src/engine.js")},9273:(e,t,n)=>{e.exports=n(7079)("./src/ui.js")},2209:(e,t,n)=>{e.exports=n(7079)("./src/utils.js")},7079:e=>{"use strict";e.exports=CKEditor5.dll},4880:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const r=n(665);function o(e,t){if(!e)return e;if((0,r.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=o(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r],t));return n}return e}function s(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=s(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=s(e[n],t));return e}t.deconstructPacket=function(e){const t=[],n=e.data,r=e;return r.data=o(n,t),r.attachments=t.length,{packet:r,buffers:t}},t.reconstructPacket=function(e,t){return e.data=s(e.data,t),delete e.attachments,e}},4514:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const r=n(5867),o=n(4880),s=n(665),i=(0,n(5579).default)("socket.io-parser");var a;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(a=t.PacketType||(t.PacketType={}));t.Encoder=class{constructor(e){this.replacer=e}encode(e){return i("encoding packet %j",e),e.type!==a.EVENT&&e.type!==a.ACK||!(0,s.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==a.BINARY_EVENT&&e.type!==a.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),i("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,o.deconstructPacket)(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};class c extends r.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===a.BINARY_EVENT;n||t.type===a.BINARY_ACK?(t.type=n?a.EVENT:a.ACK,this.reconstructor=new u(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,s.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===a[n.type])throw new Error("unknown packet type "+n.type);if(n.type===a.BINARY_EVENT||n.type===a.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!c.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return i("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case a.CONNECT:return"object"==typeof t;case a.DISCONNECT:return void 0===t;case a.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case a.EVENT:case a.BINARY_EVENT:return Array.isArray(t)&&("string"==typeof t[0]||"number"==typeof t[0]);case a.ACK:case a.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}t.Decoder=c;class u{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,o.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},665:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const n="function"==typeof ArrayBuffer,r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,o=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),i="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);function a(e){return n&&(e instanceof ArrayBuffer||r(e))||s&&e instanceof Blob||i&&e instanceof File}t.isBinary=a,t.hasBinary=function e(t,n){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if(a(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0;return!1}},6051:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCORS=void 0;let n=!1;try{n="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}t.hasCORS=n},8573:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0,t.encode=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},t.decode=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}},8736:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const n=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parse=function(e){const t=e,o=e.indexOf("["),s=e.indexOf("]");-1!=o&&-1!=s&&(e=e.substring(0,o)+e.substring(o,s).replace(/:/g,";")+e.substring(s,e.length));let i=n.exec(e||""),a={},c=14;for(;c--;)a[r[c]]=i[c]||"";return-1!=o&&-1!=s&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,a.path),a.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,a.query),a}},7058:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.yeast=t.decode=t.encode=void 0;const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),r=64,o={};let s,i=0,a=0;function c(e){let t="";do{t=n[e%r]+t,e=Math.floor(e/r)}while(e>0);return t}for(t.encode=c,t.decode=function(e){let t=0;for(a=0;a<e.length;a++)t=t*r+o[e.charAt(a)];return t},t.yeast=function(){const e=c(+new Date);return e!==s?(i=0,s=e):e+"."+c(i++)};a<r;a++)o[n[a]]=a},66:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalThisShim=void 0,t.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},5769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=t.parse=t.installTimerFunctions=t.transports=t.Transport=t.protocol=t.Socket=void 0;const r=n(1187);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return r.Socket}}),t.protocol=r.Socket.protocol;var o=n(4291);Object.defineProperty(t,"Transport",{enumerable:!0,get:function(){return o.Transport}});var s=n(6449);Object.defineProperty(t,"transports",{enumerable:!0,get:function(){return s.transports}});var i=n(102);Object.defineProperty(t,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var a=n(8736);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.parse}});var c=n(9233);Object.defineProperty(t,"nextTick",{enumerable:!0,get:function(){return c.nextTick}})},1187:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const o=n(6449),s=n(102),i=n(8573),a=n(8736),c=r(n(5579)),u=n(5867),d=n(9558),l=(0,c.default)("engine.io-client:socket");class p extends u.Emitter{constructor(e,t={}){super(),this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=(0,a.parse)(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=(0,a.parse)(t.host).host),(0,s.installTimerFunctions)(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=(0,i.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){l('creating transport "%s"',e);const t=Object.assign({},this.opts.query);t.EIO=d.protocol,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return l("options: %j",n),new o.transports[e](n)}open(){let e;if(this.opts.rememberUpgrade&&p.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return l("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){l("setting transport %s",e.name),this.transport&&(l("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){l('probing transport "%s"',e);let t=this.createTransport(e),n=!1;p.priorWebsocketSuccess=!1;const r=()=>{n||(l('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(r=>{if(!n)if("pong"===r.type&&"probe"===r.data){if(l('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;p.priorWebsocketSuccess="websocket"===t.name,l('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{n||"closed"!==this.readyState&&(l("changing transport and sending upgrade packet"),u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{l('probe transport "%s" failed',e);const n=new Error("probe error");n.transport=t.name,this.emitReserved("upgradeError",n)}})))};function o(){n||(n=!0,u(),t.close(),t=null)}const s=n=>{const r=new Error("probe error: "+n);r.transport=t.name,o(),l('probe transport "%s" failed because of error: %s',e,n),this.emitReserved("upgradeError",r)};function i(){s("transport closed")}function a(){s("socket closed")}function c(e){t&&e.name!==t.name&&(l('"%s" works - aborting "%s"',e.name,t.name),o())}const u=()=>{t.removeListener("open",r),t.removeListener("error",s),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",s),t.once("close",i),this.once("close",a),this.once("upgrading",c),t.open()}onOpen(){if(l("socket open"),this.readyState="open",p.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){l("starting upgrade probes");let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(l('socket receive: type "%s", data "%s"',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}else l('packet received with socket readyState "%s"',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();l("flushing %d packets in socket",e.length),this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=(0,s.byteLength)(n)),t>0&&e>this.maxPayload)return l("only send %d out of %d packets",t,this.writeBuffer.length),this.writeBuffer.slice(0,t);e+=2}return l("payload size is %d (max: %d)",e,this.maxPayload),this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),l("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){l("socket error %j",e),p.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(l('socket close with reason: "%s"',e),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}t.Socket=p,p.protocol=d.protocol},4291:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=void 0;const o=n(9558),s=n(5867),i=n(102),a=(0,r(n(5579)).default)("engine.io-client:transport");class c extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class u extends s.Emitter{constructor(e){super(),this.writable=!1,(0,i.installTimerFunctions)(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new c(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState?this.write(e):a("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=(0,o.decodePacket)(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}}t.Transport=u},6449:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transports=void 0;const r=n(3737),o=n(4199);t.transports={websocket:o.WS,polling:r.Polling}},3737:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=t.Polling=void 0;const o=n(4291),s=r(n(5579)),i=n(7058),a=n(8573),c=n(9558),u=n(4582),d=n(5867),l=n(102),p=n(66),h=(0,s.default)("engine.io-client:polling");function f(){}const m=null!=new u.XHR({xdomain:!1}).responseType;class g extends o.Transport{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=m&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{h("paused"),this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(h("we are currently polling - waiting to pause"),e++,this.once("pollComplete",(function(){h("pre-pause polling complete"),--e||t()}))),this.writable||(h("we are currently writing - waiting to pause"),e++,this.once("drain",(function(){h("pre-pause writing complete"),--e||t()})))}else t()}poll(){h("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){h("polling got data %s",e);(0,c.decodePayload)(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this.poll():h('ignoring poll - transport state "%s"',this.readyState))}doClose(){const e=()=>{h("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(h("transport open - closing"),e()):(h("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,(0,c.encodePayload)(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,i.yeast)()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=(0,a.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new y(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){h("xhr poll");const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}t.Polling=g;class y extends d.Emitter{constructor(e,t){super(),(0,l.installTimerFunctions)(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=(0,l.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new u.XHR(e);try{h("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},h("xhr data %s",this.data),t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=y.requestsCount++,y.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=f,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete y.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(t.Request=y,y.requestsCount=0,y.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",b);else if("function"==typeof addEventListener){const e="onpagehide"in p.globalThisShim?"pagehide":"unload";addEventListener(e,b,!1)}function b(){for(let e in y.requests)y.requests.hasOwnProperty(e)&&y.requests[e].abort()}},9233:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBinaryType=t.usingBrowserWebSocket=t.WebSocket=t.nextTick=void 0;const r=n(66);t.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),t.WebSocket=r.globalThisShim.WebSocket||r.globalThisShim.MozWebSocket,t.usingBrowserWebSocket=!0,t.defaultBinaryType="arraybuffer"},4199:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WS=void 0;const o=n(4291),s=n(8573),i=n(7058),a=n(102),c=n(9233),u=r(n(5579)),d=n(9558),l=(0,u.default)("engine.io-client:websocket"),p="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class h extends o.Transport{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=p?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=c.usingBrowserWebSocket&&!p?t?new c.WebSocket(e,t):new c.WebSocket(e):new c.WebSocket(e,t,n)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||c.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;(0,d.encodePacket)(n,this.supportsBinary,(e=>{const t={};if(!c.usingBrowserWebSocket&&(n.options&&(t.compress=n.options.compress),this.opts.perMessageDeflate)){("string"==typeof e?Buffer.byteLength(e):e.length)<this.opts.perMessageDeflate.threshold&&(t.compress=!1)}try{c.usingBrowserWebSocket?this.ws.send(e):this.ws.send(e,t)}catch(e){l("websocket closed before onclose event")}r&&(0,c.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=(0,i.yeast)()),this.supportsBinary||(e.b64=1);const r=(0,s.encode)(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!c.WebSocket}}t.WS=h},4582:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHR=void 0;const r=n(6051),o=n(66);t.XHR=function(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||r.hasCORS))return new XMLHttpRequest}catch(e){}if(!t)try{return new(o.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}},102:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.byteLength=t.installTimerFunctions=t.pick=void 0;const r=n(66);t.pick=function(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})};const o=r.globalThisShim.setTimeout,s=r.globalThisShim.clearTimeout;t.installTimerFunctions=function(e,t){t.useNativeTimers?(e.setTimeoutFn=o.bind(r.globalThisShim),e.clearTimeoutFn=s.bind(r.globalThisShim)):(e.setTimeoutFn=r.globalThisShim.setTimeout.bind(r.globalThisShim),e.clearTimeoutFn=r.globalThisShim.clearTimeout.bind(r.globalThisShim))};t.byteLength=function(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}},2747:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_PACKET=t.PACKET_TYPES_REVERSE=t.PACKET_TYPES=void 0;const n=Object.create(null);t.PACKET_TYPES=n,n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";const r=Object.create(null);t.PACKET_TYPES_REVERSE=r,Object.keys(n).forEach((e=>{r[n[e]]=e}));t.ERROR_PACKET={type:"error",data:"parser error"}},4522:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)r[n.charCodeAt(e)]=e;t.encode=e=>{let t,r=new Uint8Array(e),o=r.length,s="";for(t=0;t<o;t+=3)s+=n[r[t]>>2],s+=n[(3&r[t])<<4|r[t+1]>>4],s+=n[(15&r[t+1])<<2|r[t+2]>>6],s+=n[63&r[t+2]];return o%3==2?s=s.substring(0,s.length-1)+"=":o%3==1&&(s=s.substring(0,s.length-2)+"=="),s};t.decode=e=>{let t,n,o,s,i,a=.75*e.length,c=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const d=new ArrayBuffer(a),l=new Uint8Array(d);for(t=0;t<c;t+=4)n=r[e.charCodeAt(t)],o=r[e.charCodeAt(t+1)],s=r[e.charCodeAt(t+2)],i=r[e.charCodeAt(t+3)],l[u++]=n<<2|o>>4,l[u++]=(15&o)<<4|s>>2,l[u++]=(3&s)<<6|63&i;return d}},9415:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2747),o=n(4522),s="function"==typeof ArrayBuffer,i=(e,t)=>{if(s){const n=(0,o.decode)(e);return a(n,t)}return{base64:!0,data:e}},a=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e;t.default=(e,t)=>{if("string"!=typeof e)return{type:"message",data:a(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:i(e.substring(1),t)};return r.PACKET_TYPES_REVERSE[n]?e.length>1?{type:r.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:r.PACKET_TYPES_REVERSE[n]}:r.ERROR_PACKET}},6178:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2747),o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),s="function"==typeof ArrayBuffer,i=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};t.default=({type:e,data:t},n,a)=>{return o&&t instanceof Blob?n?a(t):i(t,a):s&&(t instanceof ArrayBuffer||(c=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(c):c&&c.buffer instanceof ArrayBuffer))?n?a(t):i(new Blob([t]),a):a(r.PACKET_TYPES[e]+(t||""));var c}},9558:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePayload=t.decodePacket=t.encodePayload=t.encodePacket=t.protocol=void 0;const r=n(6178);t.encodePacket=r.default;const o=n(9415);t.decodePacket=o.default;const s=String.fromCharCode(30);t.encodePayload=(e,t)=>{const n=e.length,o=new Array(n);let i=0;e.forEach(((e,a)=>{(0,r.default)(e,!1,(e=>{o[a]=e,++i===n&&t(o.join(s))}))}))};t.decodePayload=(e,t)=>{const n=e.split(s),r=[];for(let e=0;e<n.length;e++){const s=(0,o.default)(n[e],t);if(r.push(s),"error"===s.type)break}return r},t.protocol=4},1067:(e,t)=>{"use strict";function n(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Object.defineProperty(t,"__esModule",{value:!0}),t.Backoff=void 0,t.Backoff=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},8623:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const o=n(4197),s=n(3288);Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return s.Manager}});const i=n(3232);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return i.Socket}});const a=r(n(5579)).default("socket.io-client"),c={};function u(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};const n=o.url(e,t.path||"/socket.io"),r=n.source,i=n.id,u=n.path,d=c[i]&&u in c[i].nsps;let l;return t.forceNew||t["force new connection"]||!1===t.multiplex||d?(a("ignoring socket cache for %s",r),l=new s.Manager(r,t)):(c[i]||(a("new io instance for %s",r),c[i]=new s.Manager(r,t)),l=c[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}t.io=u,t.connect=u,t.default=u,Object.assign(u,{Manager:s.Manager,Socket:i.Socket,io:u,connect:u});var d=n(170);Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return d.protocol}}),e.exports=u},3288:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=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 n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Manager=void 0;const a=n(5769),c=n(3232),u=s(n(170)),d=n(6263),l=n(1067),p=n(5867),h=i(n(5579)).default("socket.io-client:manager");class f extends p.Emitter{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,a.installTimerFunctions(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new l.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||u;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(h("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;h("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=d.on(t,"open",(function(){n.onopen(),e&&e()})),o=d.on(t,"error",(t=>{h("error"),n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;h("connect attempt will timeout after %d",e),0===e&&r();const n=this.setTimeoutFn((()=>{h("connect attempt timed out after %d",e),r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){h("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(d.on(e,"ping",this.onping.bind(this)),d.on(e,"data",this.ondata.bind(this)),d.on(e,"error",this.onerror.bind(this)),d.on(e,"close",this.onclose.bind(this)),d.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){a.nextTick((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){h("error",e),this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new c.Socket(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return void h("socket %s is still active, skipping close",e)}this._close()}_packet(e){h("writing packet %j",e);const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){h("cleanup"),this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){h("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){h("closed due to %s",e),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)h("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();h("will wait %dms before reconnect attempt",t),this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(h("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(h("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):(h("reconnect success"),e.onreconnect())})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}t.Manager=f},6263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.on=void 0,t.on=function(e,t,n){return e.on(t,n),function(){e.off(t,n)}}},3232:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;const o=n(170),s=n(6263),i=n(5867),a=r(n(5579)).default("socket.io-client:socket"),c=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class u extends i.Emitter{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[s.on(e,"open",this.onopen.bind(this)),s.on(e,"packet",this.onpacket.bind(this)),s.on(e,"error",this.onerror.bind(this)),s.on(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(c.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:o.PacketType.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++;a("emitting packet with ack id %d",e);const r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)?a("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const o=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&(a("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(t,1));a("event with ack id %d has timed out after %d ms",e,r),t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,o)=>{t.push(((e,t)=>n?e?o(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(a("packet [%d] is discarded after %d tries",n.id,n.tryCount),this._queue.shift(),t&&t(e)):(a("packet [%d] was successfully sent",n.id),this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(a("draining queue"),!this.connected||0===this._queue.length)return;const t=this._queue[0];!t.pending||e?(t.pending=!0,t.tryCount++,a("sending packet [%d] (try n°%d)",t.id,t.tryCount),this.flags=t.flags,this.emit.apply(this,t.args)):a("packet [%d] has already been sent and is waiting for an ack",t.id)}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:o.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){a("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case o.PacketType.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case o.PacketType.EVENT:case o.PacketType.BINARY_EVENT:this.onevent(e);break;case o.PacketType.ACK:case o.PacketType.BINARY_ACK:this.onack(e);break;case o.PacketType.DISCONNECT:this.ondisconnect();break;case o.PacketType.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,a("sending ack %j",r),t.packet({type:o.PacketType.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t?(a("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):a("bad ack %s",e.id)}onconnect(e,t){a("socket connected with id %s",e),this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:o.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}t.Socket=u},4197:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.url=void 0;const o=n(5769),s=r(n(5579)).default("socket.io-client:url");t.url=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(s("protocol-less url %s",e),e=void 0!==n?n.protocol+"//"+e:"https://"+e),s("parse %s",e),r=o.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}},2830:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const r=n(3980);function o(e,t){if(!e)return e;if((0,r.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=o(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r],t));return n}return e}function s(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=s(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=s(e[n],t));return e}t.deconstructPacket=function(e){const t=[],n=e.data,r=e;return r.data=o(n,t),r.attachments=t.length,{packet:r,buffers:t}},t.reconstructPacket=function(e,t){return e.data=s(e.data,t),delete e.attachments,e}},170:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const r=n(5867),o=n(2830),s=n(3980),i=(0,n(5579).default)("socket.io-parser"),a=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var c;t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(c=t.PacketType||(t.PacketType={}));function u(e){return"[object Object]"===Object.prototype.toString.call(e)}t.Encoder=class{constructor(e){this.replacer=e}encode(e){return i("encoding packet %j",e),e.type!==c.EVENT&&e.type!==c.ACK||!(0,s.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==c.BINARY_EVENT&&e.type!==c.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),i("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,o.deconstructPacket)(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};class d extends r.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===c.BINARY_EVENT;n||t.type===c.BINARY_ACK?(t.type=n?c.EVENT:c.ACK,this.reconstructor=new l(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,s.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===c[n.type])throw new Error("unknown packet type "+n.type);if(n.type===c.BINARY_EVENT||n.type===c.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!d.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return i("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case c.CONNECT:return u(t);case c.DISCONNECT:return void 0===t;case c.CONNECT_ERROR:return"string"==typeof t||u(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===a.indexOf(t[0]));case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}t.Decoder=d;class l{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,o.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},3980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const n="function"==typeof ArrayBuffer,r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,o=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),i="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);function a(e){return n&&(e instanceof ArrayBuffer||r(e))||s&&e instanceof Blob||i&&e instanceof File}t.isBinary=a,t.hasBinary=function e(t,n){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if(a(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0;return!1}},5867:(e,t,n)=>{"use strict";function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}n.r(t),n.d(t,{Emitter:()=>r}),r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},r.prototype.emitReserved=r.prototype.emit,r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>Vo,CloudServicesRevisionHistoryAdapter:()=>cs,CloudServicesTrackChangesAdapter:()=>Fo,PresenceList:()=>di,RealTimeCollaborationClient:()=>Io,RealTimeCollaborativeComments:()=>Qo,RealTimeCollaborativeEditing:()=>jo,RealTimeCollaborativeRevisionHistory:()=>fs,RealTimeCollaborativeTrackChanges:()=>rs});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{AttributeOperation:()=>se,Element:()=>ge,InsertOperation:()=>ie,MarkerOperation:()=>ae,MergeOperation:()=>ce,MoveOperation:()=>ue,Position:()=>fe,Range:()=>me,RenameOperation:()=>de,RootAttributeOperation:()=>le,RootOperation:()=>pe,SplitOperation:()=>he,default:()=>oe});var t=__webpack_require__(2704),n=__webpack_require__(2209),r=__webpack_require__(9273),o=__webpack_require__(1492),s=__webpack_require__(3521);const i=["online","CONNECTED","get","offline","disconnect","constructor","The limit of maximum concurrent connections that the collaboration server can handle has been reached. Try opening the document again in a few minutes. Please contact your system administrator if the problem persists.","CloudServices","Connected users limit exceeded","websocketgateway-invalid-plugin-interface","then","has","cloudServices.requestTimeout","error","DISCONNECTED","CONNECTING","_reconnectionStack","isInReconnectionStack","limitExceeded","initialReconnectionInterval","change:me","_shouldPluginsReconnect","connect","_reconnect","listenTo","catch","delete","websocketgateway-missing-token","code","_isBrowserOffline","_domEmitter","websocketgateway-plugin-already-registered","connection","state","websocketgateway-missing-websocket-url","webSocketUrl","real-time-collaboration","config","pluginName","plugins","function","init","WebSocketGateway","define","stopListening","context","cloudservices-init","destroy","cloudservices-reconnection-error","reconnect","token","removeFromReconnectionStack","addToReconnectionStack","set","requires","cloudServices.connectionTimeout"];var a,c;a=i,c=413,function(e){for(;--e;)a.push(a.shift())}(++c);const u=function(e,t){return i[e-=0]};class d extends t.ContextPlugin{static get[u("0x21")](){return[u("0x2a"),r.Notification]}static get[u("0x11")](){return u("0x15")}constructor(e){super(e),this[u("0x20")](u("0xc"),s.WEB_SOCKET_GATEWAY_STATES[u("0x24")]),this.set(u("0x8"),!1),this[u("0x33")]=new Set,this[u("0x0")]=!1,this[u("0x9")]=Object.create(n.DomEmitterMixin)}[u("0x14")](){const e=this[u("0x18")],t=e[u("0x12")].get(u("0x2a")),o=e.plugins[u("0x25")](r.Notification);if(!t[u("0x1d")])throw new n.CKEditorError(u("0x6"),this);if(!t[u("0xe")])throw new n.CKEditorError(u("0xd"),this);return this[u("0x9")][u("0x3")](window,u("0x26"),(()=>this[u("0x8")]=!0)),this[u("0x9")][u("0x3")](window,u("0x23"),(()=>this[u("0x8")]=!1)),this[u("0x18")][u("0x10")][u("0x16")]("cloudServices.connectionTimeout",10),this[u("0x18")][u("0x10")][u("0x16")](u("0x2f"),20),d[u("0x15")][u("0x1")](t.token,t[u("0xe")],{timeout:1e3*this[u("0x18")][u("0x10")][u("0x25")](u("0x22")),requestTimeout:1e3*this.context.config[u("0x25")](u("0x2f"))})[u("0x2d")]((e=>{if(this[u("0xb")]=e,this.bind(u("0xc")).to(e,u("0xc"),this,u("0x8"),((e,t)=>("connected"!==e&&(this[u("0x0")]=!0),t||e!==s.WEB_SOCKET_GATEWAY_STATES[u("0x24")]?s.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED:this[u("0xc")]==s.WEB_SOCKET_GATEWAY_STATES[u("0x31")]&&this[u("0x0")]?(this._shouldPluginsReconnect=!1,this._reconnect(),s.WEB_SOCKET_GATEWAY_STATES[u("0x32")]):s.WEB_SOCKET_GATEWAY_STATES.CONNECTED))),this[u("0xb")].on("error",((e,t)=>{if(u("0x35")!==t[u("0x7")])throw console[u("0x30")](t),new n.CKEditorError(u("0x19"),null,{originalError:t});o.showWarning(u("0x29"),{title:u("0x2b"),namespace:u("0xf")})})),!e.me)return new Promise((t=>e.on(u("0x37"),t)))}))[u("0x4")]((e=>{throw console[u("0x30")](e),new n.CKEditorError(u("0x19"),null,{originalError:e})}))}[u("0x1f")](e){if(u("0x13")!=typeof e.reconnect)throw new n.CKEditorError(u("0x2c"),this);if(this.isInReconnectionStack(e))throw new n.CKEditorError(u("0xa"),this,{name:e[u("0x28")][u("0x11")]});this[u("0x33")].add(e)}[u("0x1e")](e){this[u("0x33")][u("0x5")](e)}[u("0x34")](e){return this._reconnectionStack[u("0x2e")](e)}[u("0x2")](){return this[u("0xb")][u("0x1c")]()[u("0x2d")]((()=>Promise.all(Array.from(this[u("0x33")],(e=>e[u("0x1c")]())))))[u("0x2d")]((()=>this.state=s.WEB_SOCKET_GATEWAY_STATES[u("0x24")])).catch((e=>{throw console[u("0x30")](e),new n.CKEditorError(u("0x1b"),this.context)}))}[u("0x1a")](){this.connection&&this[u("0xb")][u("0x27")](),this[u("0xc")]=s.WEB_SOCKET_GATEWAY_STATES.DISCONNECTED,this._domEmitter[u("0x17")](),super.destroy()}}d.WebSocketGateway=s.WebSocketGateway,d[u("0x36")]=1e3;class l extends t.ContextPlugin{static get pluginName(){return"Permissions"}setPermissions(e,r){let o;if(r||(r=this.context.config.get("collaboration.channelId")),this.context.config.get("collaboration.channelId")==r?o=this.context:"editors"in this.context&&this.context.editors&&(o=this.context.editors.find((e=>e.config.get("collaboration.channelId")==r))),!o)throw new n.CKEditorError("permissions-set-permissions-invalid-channel-id",null);const s=o.plugins,i=s.has("CommentsRepository")?s.get("CommentsRepository"):void 0,a=s.has("CommentsOnly")&&s.get("CommentsOnly"),c=e.includes("document:write"),u=e.includes("comment:modify_all"),d=e.includes("comment:admin"),l=e.includes("comment:write"),p=l||d,h=p||u,f=c||p;if(a&&(a.isEnabled=!c&&h),o instanceof t.Editor){!(c||h&&i)?o.enableReadOnlyMode("no-permissions"):o.disableReadOnlyMode("no-permissions")}if(i){i.setPermissions({admin:d,modifyAll:u,write:l,resolve:f},r);const e=o instanceof t.Editor&&o.commands.get("addCommentThread");e&&(p?e.clearForceDisabled("noPermissions"):e.forceDisabled("noPermissions"))}}}function p(e,t){const n=e.t;switch(t){case"Anonymous":return n("Anonymous");case"Yes":return n("Yes");case"No":return n("No");case"Are you sure?":return n("Are you sure?");default:return""}}var h=__webpack_require__(3278),f=__webpack_require__.n(h),m=__webpack_require__(4808),g={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(m.Z,g);m.Z.locals;class y extends t.ContextPlugin{static get pluginName(){return"Users"}static get requires(){return[l]}constructor(e){super(e),this.context.config.define("users.anonymousUserId","anonymous-user"),this.context.config.define("users.colorsCount",8),this.users=new n.Collection,this._locale=e.locale,this._licenseKeyCheckInterval=null,this._lastColor=0,this._myId=null,this.decorate("getOperationAuthor")}init(){const e=this.context;this.licenseKey=e.config.get("licenseKey");const t=["licenseKeyTrial","licenseKeyInvalid","licenseKeyValid","licenseKeyTrialLimit:operations","licenseKeyTrialLimit:time","licenseKeyTrialLimit:revisions"];this._licenseKeyCheckInterval=setInterval((()=>{let r;for(const n in e){const o=e[n];if(t.includes(o)){delete e[n],r=o;break}}if("licenseKeyInvalid"===r)throw clearInterval(this._licenseKeyCheckInterval),new n.CKEditorError("invalid-license-key",null);if("licenseKeyTrial"===r&&console.info("You are using the trial version of CKEditor 5 collaboration plugin with limited usage. Make sure you will not use it in the production environment."),"licenseKeyTrialLimit:operations"===r)throw clearInterval(this._licenseKeyCheckInterval),new n.CKEditorError("trial-license-key-reached-limit-changes",null);if("licenseKeyTrialLimit:time"===r)throw clearInterval(this._licenseKeyCheckInterval),new n.CKEditorError("trial-license-key-reached-limit-time",null);if("licenseKeyTrialLimit:revisions"===r)throw clearInterval(this._licenseKeyCheckInterval),new n.CKEditorError("trial-license-key-reached-limit-revisions",null);"licenseKeyValid"===r&&clearInterval(this._licenseKeyCheckInterval)}),1e3),this._addAnonymousUser()}get me(){return null==this._myId?null:this.getUser(this._myId)}addUser({id:e,name:t,...r}){if(!e||"string"!=typeof e)throw new n.CKEditorError("users-add-invalid-id");if(this.users.has(e))throw new n.CKEditorError("users-add-duplicated-id",null,{id:e});const o={...r,id:e,name:v(this._locale,t),color:this._getNextColor()};o.name=v(this._locale,o.name);const s=new b(o);return this.users.add(s),s}getUser(e){return this.users.get(e)}useAnonymousUser(){const e=this.context.config.get("users.anonymousUserId");this._myId||this.defineMe(e)}defineMe(e){if(this._myId)throw new n.CKEditorError("users-me-already-defined",null);if(!this.getUser(e))throw new n.CKEditorError("users-me-missing-user",null);this._myId=e}getOperationAuthor(){return this.me}destroy(){super.destroy(),clearInterval(this._licenseKeyCheckInterval)}_getNextColor(){const e=this.context.config.get("users.colorsCount");return this._lastColor>=e&&(this._lastColor=0),new O(this._lastColor++)}_addAnonymousUser(){const e=this.context.config.get("users.anonymousUserId");this.addUser({id:e,name:p(this._locale,"Anonymous")})._isAnonymous=!0}}class b{constructor(e){this.id=e.id,this.color=e.color,this.name=e.name,this.avatar=e.avatar,this._isAnonymous=!1}get isAnonymous(){return this._isAnonymous}get initials(){const e=this.name.split(" ");return 1===e.length?this._getInitial(e[0]):this._getInitial(e[0])+this._getInitial(e[e.length-1])}_getInitial(e){return e.charAt(0).toUpperCase()}}function v(e,t=""){return""==(t=t.trim())?p(e,"Anonymous"):t}class O{constructor(e){this._id=e}getBackgroundColorClass(){return`ck-user__bg-color--${this._id}`}getSelectionClass(){return`ck-user__selection--${this._id}`}getMarkerClass(){return`ck-user__marker--${this._id}`}}var w=__webpack_require__(7678),_={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(w.Z,_);w.Z.locals;class k extends r.View{constructor(e,t,n){super(e),this.name=t.name,this.notificationView=null;const o=["ck","ck-user__img"];if(t.isAnonymous&&o.push("ck-user__anonymous"),t.avatar&&o.push("ck-user__avatar"),n){const e=new r.IconView;e.extendTemplate({attributes:{class:["ck-user__icon"]}}),e.content='\x3c!--\n\n What you\'re currently looking at is the source code of a legally protected, proprietary software.\n Letters is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,\n all Letters content is authored by CKSource engineers and consists of CKSource-owned intellectual property.\n\n Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n\n!--\x3e\n\n<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0zm1 15H9v-2h2v2zm0-4H9V5h2v6z"/></svg>\n',this.notificationView={tag:"div",attributes:{class:["ck","ck-user__notification"],"data-cke-tooltip-position":"n","data-cke-tooltip-text":n},children:[e]}}const s=[{tag:"div",attributes:{class:o,style:{"background-image":t.avatar?`url('${t.avatar}')`:""}}},{tag:"div",attributes:{class:t.avatar?"ck ck-user__name ck-user__name--hidden":"ck ck-user__name"},children:[{text:t.initials}]}];this.notificationView&&s.push(this.notificationView),this.setTemplate({tag:"div",attributes:{class:["ck","ck-user"],"data-user-id":t.id},children:s})}}var x=__webpack_require__(7374),I={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(x.Z,I);x.Z.locals;var S=__webpack_require__(2228),P={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(S.Z,P);S.Z.locals;var T=__webpack_require__(1437),A={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(T.Z,A);T.Z.locals;var C=__webpack_require__(8717),E={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(C.Z,E);C.Z.locals;var j=__webpack_require__(2040),D={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(j.Z,D);j.Z.locals;var R=__webpack_require__(6366),M={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(R.Z,M);R.Z.locals;var N=__webpack_require__(7153),V={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(N.Z,V);N.Z.locals;var B=__webpack_require__(7325),U={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(B.Z,U);B.Z.locals;const J=["allConnectedUsers","sessions-unregister-not-exist","_createUser","_handleSessionAdd","getUser","_users","values","assign","addUser","getUserRole","getUserBySessionId","role","change:state","listenTo","delete","init","remove","getUserSessions","add","pluginName","unregister","channelConnectedUsers","user","register","set","orderNumber","has","_uniqueUsersCount","sessionId","_registeredSessions","get","plugins","forEach","requires","state","channelSessions","connected","connection","size","sessionAdd:","context","stopListening","clear","_handleSessionRemove"];var q,L;q=J,L=169,function(e){for(;--e;)q.push(q.shift())}(++L);const G=function(e,t){return J[e-=0]};class Y extends t.ContextPlugin{static get[G("0x1a")](){return"Sessions"}static get[G("0x28")](){return[d,y]}constructor(e){super(e),this.channelSessions=new Map,this.channelConnectedUsers=new Map,this[G("0x7")]=new n.Collection,this[G("0x24")]=new Map,this[G("0x22")]=0,this._users=this[G("0x3")][G("0x26")][G("0x25")](y)}[G("0x16")](){const e=this[G("0x3")][G("0x26")].get(d);this[G("0x14")](e,G("0x13"),((e,t,n)=>{if(G("0x2b")!==n)this.channelSessions[G("0x27")]((e=>e.clear())),this[G("0x1c")][G("0x27")]((e=>e[G("0x5")]())),this[G("0x7")][G("0x5")]();else for(const[e,t]of this[G("0x24")])for(const n of t)this[G("0xa")](e,n)})),this[G("0x9")](e[G("0x0")].me,!0)}[G("0x1e")](e,t){if(this._registeredSessions[G("0x21")](e))throw new n.CKEditorError("sessions-register-already-registered",null,{channelId:e});this._registeredSessions[G("0x1f")](e,t),this[G("0x2a")][G("0x1f")](e,new n.Collection),this[G("0x1c")].set(e,new n.Collection),this.listenTo(t,G("0x19"),((t,n)=>this[G("0xa")](e,n))),this[G("0x14")](t,G("0x17"),((t,n)=>this[G("0x6")](e,n)));for(const n of t)this._handleSessionAdd(e,n)}[G("0x1b")](e){if(!this[G("0x24")].has(e))throw new n.CKEditorError(G("0x8"),null,{channelId:e});const t=this._registeredSessions[G("0x25")](e);this[G("0x4")](t);for(const n of t)G("0x2b")===this[G("0x3")][G("0x26")][G("0x25")](d)[G("0x29")]&&this[G("0x6")](e,n);this._registeredSessions[G("0x15")](e),this.channelSessions[G("0x15")](e),this[G("0x1c")][G("0x15")](e)}get mySessionId(){return this[G("0x3")][G("0x26")].get(d)[G("0x0")][G("0x23")]}[G("0x11")](e){for(const t of this[G("0x2a")].values())for(const n of t)if(n.id===e)return n.user}[G("0x18")](e,t){const n=t?[this.channelSessions[G("0x25")](t)]:this[G("0x2a")][G("0xd")](),r=new Set;for(const t of n)for(const n of t)n[G("0x1d")].id===e.id&&r[G("0x19")](n.id);return r}[G("0x10")](e){for(const t of this.channelSessions[G("0xd")]())for(const n of t)if(n[G("0x1d")]===e)return n[G("0x12")]}[G("0xa")](e,t){if(G("0x2b")!==this.context[G("0x26")][G("0x25")](d).state)return;const n=t[G("0x1d")],r=this[G("0xc")][G("0xb")](n.id)||this._createUser(n),o=Object[G("0xe")]({},t,{user:r});this.channelSessions.get(e)[G("0x19")](o);const s=this[G("0x1c")][G("0x25")](e);s[G("0x21")](r.id)||s.add(r),this[G("0x7")][G("0x21")](r.id)||this[G("0x7")].add(r),this.fire(G("0x2")+e,{channelId:e,session:o})}[G("0x6")](e,t){if("connected"!==this[G("0x3")][G("0x26")].get(d)[G("0x29")])return;const n=this[G("0x1c")][G("0x25")](e),r=t[G("0x1d")];r.id&&(this[G("0x2a")][G("0x25")](e)[G("0x17")](t.id),n[G("0x21")](r.id)&&!this[G("0x18")](r,e)[G("0x1")]&&n[G("0x17")](r.id),this[G("0x7")][G("0x25")](r.id)&&!this[G("0x18")](r).size&&this[G("0x7")][G("0x17")](r.id))}[G("0x9")](e,t){const n=this[G("0xc")][G("0xf")](e);return t&&this[G("0xc")].defineMe(e.id),n[G("0x20")]=this[G("0x22")]++,n}}var F=__webpack_require__(3608),z={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(F.Z,z);F.Z.locals;const K=["user:range","isObject","document","getUserBySessionId","markerRange","markerToHighlight","toRange","model","plugins","user:position","end","removeMarker","getMarkerClass","ck-user__marker ","detach","editing","requires","mySessionId","contenteditable","innerHTML","set","getPositions","rootName","createUIElement","conversion","color","selection","nodeAfter","updateMarker","schema","tableCell","view","root","clear","applyOperation","getRange","checkChild","oldRange","markerToElement","getAttribute","for","user:range:","pluginName","editingDowncast","get","has","name","enqueueChange","update:user:range","_createdBatches","type","isCollapsed","toDomElement","UserMarkers","change","markers","getStart","split",'⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>⁠',"createRange","getSelectionClass","getNearestSelectionRange","userPositionMarker","markerName","$text","hasDomSelection","deletionPosition","isSimilar","span","startsWith","setCustomProperty","addMarker","editor","isLimit","user:position:","user:","undo","orderNumber","getCustomProperty","hasContent","data-session-id","$graveyard","init","delete","reconvertMarker","start"];var H,W;H=K,W=449,function(e){for(;--e;)H.push(H.shift())}(++W);const $=function(e,t){return K[e-=0]};class Z extends t.Plugin{static get[$("0x53")](){return[Y]}static get[$("0x17")](){return $("0x22")}[$("0x3f")](){const e=this[$("0x35")],t=e[$("0x4b")].get(Y);e[$("0x5")][$("0x15")]("editingDowncast")[$("0x13")]({model:$("0x4c"),view:(n,{writer:r})=>function(e,t,n,r){const o=e[$("0x2c")][$("0x26")](":")[2],s=n[$("0x46")](o);if(!s||o===n[$("0x54")])return;if(!r[$("0x4a")][$("0xa")].checkChild(e[$("0x47")][$("0x42")],$("0x2d")))return;const i={class:$("0x50")+s[$("0x6")][$("0x4f")](),"data-name":s[$("0x1b")],"data-session-id":o},a=r[$("0x4a")][$("0x24")][$("0x19")](e.markerName)[$("0x25")](),c=a[$("0x8")],u=r[$("0x4a")][$("0xa")];if(c&&u[$("0x44")](c)&&u.isInline(c)&&!r[$("0x4a")][$("0x24")][$("0x19")]($("0x16")+o)[$("0x10")]()[$("0x20")])return;const d=a.parent;return r[$("0x4a")][$("0xa")][$("0x36")](d)&&!r[$("0x4a")][$("0x3c")](d)&&(i[$("0x55")]=!1),function(e,t){const n=e[$("0x4")]($("0x31"),t);return e[$("0x33")]($("0x2b"),!0,n),n.render=function(e){const t=this[$("0x21")](e);return t[$("0x0")]=$("0x27"),t},n[$("0x30")]=function(e){return!(!this.getCustomProperty("userPositionMarker")||!e[$("0x3b")]($("0x2b"))||this.getAttribute($("0x3d"))!=e[$("0x14")]($("0x3d")))},n}(t,i)}(n,r,t,e)}),e[$("0x5")].for($("0x18"))[$("0x48")]({model:$("0x43"),view:e=>function(e,t){const n=e[$("0x2c")].split(":")[2];if(n===t[$("0x54")])return null;const r=t[$("0x46")](n);return r?{id:n,classes:["ck-user__selection",r[$("0x6")][$("0x29")]()],attributes:{"data-session-id":n},priority:2e3+r[$("0x3a")]}:{id:n,classes:[]}}(e,t)}),function(e){const t=e.model,n=new Map,r=e.plugins.get(Y);t[$("0x24")].on($("0x1d"),((s,i,a,c)=>{if(!c&&n[$("0x19")](i[$("0x1b")]))return n[$("0x19")](i[$("0x1b")]).detach(),void n[$("0x40")](i.name);const u=i[$("0x1b")].split(":")[2];if(u===r.mySessionId)return;const d=$("0x37")+u;t.markers[$("0x1a")](d)&&e.editing[$("0x41")](d),i.on("change:range",((e,r,s)=>{if($("0x3e")!=r.root[$("0x3")]&&$("0x3e")==i[$("0x10")]()[$("0xd")][$("0x3")]&&!n.has(i[$("0x1b")])){const e=t[$("0xa")][$("0x2a")](s[$("0x2f")]);if(e){const r=o.LiveRange.fromRange(e);n[$("0x1")](i.name,r),r.on("change:range",((e,o,s)=>{if($("0x3e")==r[$("0xd")][$("0x3")]){const e=t[$("0xa")][$("0x2a")](s[$("0x2f")]);e?(r[$("0x42")]=e.start,r[$("0x4d")]=e[$("0x4d")]):(n[$("0x40")](i[$("0x1b")]),r[$("0x51")]())}}))}}}))})),t[$("0x45")].on($("0x23"),(()=>{n.size>0&&t[$("0x1c")]({isUndoable:!1},(e=>{for(const[r,o]of n)$("0x3e")==t[$("0x24")][$("0x19")](r)[$("0x10")]()[$("0xd")].rootName&&(Q(r[$("0x26")](":")[2],o[$("0x49")](),t,e),o.detach());n[$("0xe")]()}))}))}(e)}afterInit(){const e=this[$("0x35")],t=e.commands[$("0x19")]($("0x39"));t&&e[$("0x4a")].on($("0xf"),((n,r)=>{const o=r[0];if("marker"!=o[$("0x1f")]||!o.name[$("0x32")]($("0x38")))return;const s=o.batch;t[$("0x1e")][$("0x1a")](s)&&(o.newRange=o.oldRange?e[$("0x4a")][$("0x28")](o[$("0x12")][$("0x42")],o.oldRange[$("0x4d")]):null)}),{priority:"highest"})}createUserMarkerOperations(){const e=this[$("0x35")],t=e[$("0x4a")][$("0x45")],n=e.plugins.get(Y);e[$("0x4a")][$("0x1c")]({isUndoable:!1},(r=>{const o="user:range:"+n[$("0x54")],s=$("0x37")+n.mySessionId,i=e.model.markers.has(o);e[$("0x52")][$("0xc")][$("0x2e")]?Q(n[$("0x54")],t[$("0x7")].getFirstRange(),e[$("0x4a")],r):i&&(r[$("0x4e")](o),r.removeMarker(s))}))}}function Q(e,t,n,r){const o="user:range:"+e,s="user:position:"+e,i=t.getContainedElement();let a=t[$("0x42")];i&&i.is("element",$("0xb"))&&(a=function(e,t){for(const n of e[$("0x2")]())if(t[$("0xa")][$("0x11")](n,$("0x2d")))return n}(t,n),t=r[$("0x28")](a));const c=r[$("0x28")](a);n[$("0x24")][$("0x1a")](o)?(r[$("0x9")](o,{range:t}),r[$("0x9")](s,{range:c})):(r[$("0x34")](o,{range:t,usingOperation:!0}),r.addMarker(s,{range:c,usingOperation:!0}))}function X(e,t,n){const r=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return r({string:"Sending data to the server.",id:"PENDING_ACTION_SENDING_DATA"});case"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.":return r("The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.");case"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.":return r("The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");case"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.":return r("The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");case"The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.":return r("The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.");case"Synchronization issue":return r("Synchronization issue");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return r({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}var ee=__webpack_require__(6386);const te=ee.Reader,ne=ee.Writer,re=ee.util,oe=ee.roots.default||(ee.roots.default={}),se=oe.AttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.range=null,e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ne.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&oe.Range.encode(e.range,t.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.AttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.range=oe.Range.decode(e,e.uint32());break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.range&&e.hasOwnProperty("range")){let t=oe.Range.verify(e.range);if(t)return"range."+t}return null!=e.key&&e.hasOwnProperty("key")&&!re.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!re.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!re.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof oe.AttributeOperation)return e;let t=new oe.AttributeOperation;if(null!=e.range){if("object"!=typeof e.range)throw TypeError(".AttributeOperation.range: object expected");t.range=oe.Range.fromObject(e.range)}return null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.range=null,n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.range&&e.hasOwnProperty("range")&&(n.range=oe.Range.toObject(e.range,t)),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/AttributeOperation"},e})(),ie=oe.InsertOperation=(()=>{function e(e){if(this.nodes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.nodes=re.emptyArray,e.prototype.shouldReceiveAttributes=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ne.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&oe.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.nodes&&e.nodes.length)for(let n=0;n<e.nodes.length;++n)oe.Element.encode(e.nodes[n],t.uint32(18).fork()).ldelim();return null!=e.shouldReceiveAttributes&&Object.hasOwnProperty.call(e,"shouldReceiveAttributes")&&t.uint32(24).bool(e.shouldReceiveAttributes),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.InsertOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=oe.Position.decode(e,e.uint32());break;case 2:r.nodes&&r.nodes.length||(r.nodes=[]),r.nodes.push(oe.Element.decode(e,e.uint32()));break;case 3:r.shouldReceiveAttributes=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=oe.Position.verify(e.position);if(t)return"position."+t}if(null!=e.nodes&&e.hasOwnProperty("nodes")){if(!Array.isArray(e.nodes))return"nodes: array expected";for(let t=0;t<e.nodes.length;++t){let n=oe.Element.verify(e.nodes[t]);if(n)return"nodes."+n}}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&"boolean"!=typeof e.shouldReceiveAttributes?"shouldReceiveAttributes: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof oe.InsertOperation)return e;let t=new oe.InsertOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".InsertOperation.position: object expected");t.position=oe.Position.fromObject(e.position)}if(e.nodes){if(!Array.isArray(e.nodes))throw TypeError(".InsertOperation.nodes: array expected");t.nodes=[];for(let n=0;n<e.nodes.length;++n){if("object"!=typeof e.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");t.nodes[n]=oe.Element.fromObject(e.nodes[n])}}return null!=e.shouldReceiveAttributes&&(t.shouldReceiveAttributes=Boolean(e.shouldReceiveAttributes)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.nodes=[]),t.defaults&&(n.position=null,n.shouldReceiveAttributes=!1,n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=oe.Position.toObject(e.position,t)),e.nodes&&e.nodes.length){n.nodes=[];for(let r=0;r<e.nodes.length;++r)n.nodes[r]=oe.Element.toObject(e.nodes[r],t)}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=e.shouldReceiveAttributes),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/InsertOperation"},e})(),ae=oe.MarkerOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.oldRange=null,e.prototype.newRange=null,e.prototype.affectsData=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ne.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.oldRange&&Object.hasOwnProperty.call(e,"oldRange")&&oe.Range.encode(e.oldRange,t.uint32(18).fork()).ldelim(),null!=e.newRange&&Object.hasOwnProperty.call(e,"newRange")&&oe.Range.encode(e.newRange,t.uint32(26).fork()).ldelim(),null!=e.affectsData&&Object.hasOwnProperty.call(e,"affectsData")&&t.uint32(32).bool(e.affectsData),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.MarkerOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.name=e.string();break;case 2:r.oldRange=oe.Range.decode(e,e.uint32());break;case 3:r.newRange=oe.Range.decode(e,e.uint32());break;case 4:r.affectsData=e.bool();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!re.isString(e.name))return"name: string expected";if(null!=e.oldRange&&e.hasOwnProperty("oldRange")){let t=oe.Range.verify(e.oldRange);if(t)return"oldRange."+t}if(null!=e.newRange&&e.hasOwnProperty("newRange")){let t=oe.Range.verify(e.newRange);if(t)return"newRange."+t}return null!=e.affectsData&&e.hasOwnProperty("affectsData")&&"boolean"!=typeof e.affectsData?"affectsData: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof oe.MarkerOperation)return e;let t=new oe.MarkerOperation;if(null!=e.name&&(t.name=String(e.name)),null!=e.oldRange){if("object"!=typeof e.oldRange)throw TypeError(".MarkerOperation.oldRange: object expected");t.oldRange=oe.Range.fromObject(e.oldRange)}if(null!=e.newRange){if("object"!=typeof e.newRange)throw TypeError(".MarkerOperation.newRange: object expected");t.newRange=oe.Range.fromObject(e.newRange)}return null!=e.affectsData&&(t.affectsData=Boolean(e.affectsData)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.name="",n.oldRange=null,n.newRange=null,n.affectsData=!1,n.wasUndone=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.oldRange&&e.hasOwnProperty("oldRange")&&(n.oldRange=oe.Range.toObject(e.oldRange,t)),null!=e.newRange&&e.hasOwnProperty("newRange")&&(n.newRange=oe.Range.toObject(e.newRange,t)),null!=e.affectsData&&e.hasOwnProperty("affectsData")&&(n.affectsData=e.affectsData),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MarkerOperation"},e})(),ce=oe.MergeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.targetPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ne.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&oe.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&oe.Position.encode(e.targetPosition,t.uint32(18).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&oe.Position.encode(e.graveyardPosition,t.uint32(26).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(32).uint32(e.howMany),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.MergeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=oe.Position.decode(e,e.uint32());break;case 2:r.targetPosition=oe.Position.decode(e,e.uint32());break;case 3:r.graveyardPosition=oe.Position.decode(e,e.uint32());break;case 4:r.howMany=e.uint32();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=oe.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=oe.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=oe.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}return null!=e.howMany&&e.hasOwnProperty("howMany")&&!re.isInteger(e.howMany)?"howMany: integer expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof oe.MergeOperation)return e;let t=new oe.MergeOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");t.sourcePosition=oe.Position.fromObject(e.sourcePosition)}if(null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");t.targetPosition=oe.Position.fromObject(e.targetPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");t.graveyardPosition=oe.Position.fromObject(e.graveyardPosition)}return null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.targetPosition=null,n.graveyardPosition=null,n.howMany=0,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=oe.Position.toObject(e.sourcePosition,t)),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=oe.Position.toObject(e.targetPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=oe.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MergeOperation"},e})(),ue=oe.MoveOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.howMany=0,e.prototype.targetPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ne.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&oe.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(16).uint32(e.howMany),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&oe.Position.encode(e.targetPosition,t.uint32(26).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.MoveOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=oe.Position.decode(e,e.uint32());break;case 2:r.howMany=e.uint32();break;case 3:r.targetPosition=oe.Position.decode(e,e.uint32());break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=oe.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!re.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=oe.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof oe.MoveOperation)return e;let t=new oe.MoveOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");t.sourcePosition=oe.Position.fromObject(e.sourcePosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MoveOperation.targetPosition: object expected");t.targetPosition=oe.Position.fromObject(e.targetPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=oe.Position.toObject(e.sourcePosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=oe.Position.toObject(e.targetPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MoveOperation"},e})(),de=oe.RenameOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.oldName="",e.prototype.newName="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ne.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&oe.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.oldName&&Object.hasOwnProperty.call(e,"oldName")&&t.uint32(18).string(e.oldName),null!=e.newName&&Object.hasOwnProperty.call(e,"newName")&&t.uint32(26).string(e.newName),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.RenameOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=oe.Position.decode(e,e.uint32());break;case 2:r.oldName=e.string();break;case 3:r.newName=e.string();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=oe.Position.verify(e.position);if(t)return"position."+t}return null!=e.oldName&&e.hasOwnProperty("oldName")&&!re.isString(e.oldName)?"oldName: string expected":null!=e.newName&&e.hasOwnProperty("newName")&&!re.isString(e.newName)?"newName: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof oe.RenameOperation)return e;let t=new oe.RenameOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".RenameOperation.position: object expected");t.position=oe.Position.fromObject(e.position)}return null!=e.oldName&&(t.oldName=String(e.oldName)),null!=e.newName&&(t.newName=String(e.newName)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=oe.Position.toObject(e.position,t)),null!=e.oldName&&e.hasOwnProperty("oldName")&&(n.oldName=e.oldName),null!=e.newName&&e.hasOwnProperty("newName")&&(n.newName=e.newName),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RenameOperation"},e})(),le=oe.RootAttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ne.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.RootAttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.root&&e.hasOwnProperty("root")&&!re.isString(e.root)?"root: string expected":null!=e.key&&e.hasOwnProperty("key")&&!re.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!re.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!re.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof oe.RootAttributeOperation)return e;let t=new oe.RootAttributeOperation;return null!=e.root&&(t.root=String(e.root)),null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.root="",n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootAttributeOperation"},e})(),pe=oe.RootOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rootName="",e.prototype.elementName="",e.prototype.isAdd=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ne.create()),null!=e.rootName&&Object.hasOwnProperty.call(e,"rootName")&&t.uint32(10).string(e.rootName),null!=e.elementName&&Object.hasOwnProperty.call(e,"elementName")&&t.uint32(18).string(e.elementName),null!=e.isAdd&&Object.hasOwnProperty.call(e,"isAdd")&&t.uint32(24).bool(e.isAdd),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.RootOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.rootName=e.string();break;case 2:r.elementName=e.string();break;case 3:r.isAdd=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.rootName&&e.hasOwnProperty("rootName")&&!re.isString(e.rootName)?"rootName: string expected":null!=e.elementName&&e.hasOwnProperty("elementName")&&!re.isString(e.elementName)?"elementName: string expected":null!=e.isAdd&&e.hasOwnProperty("isAdd")&&"boolean"!=typeof e.isAdd?"isAdd: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof oe.RootOperation)return e;let t=new oe.RootOperation;return null!=e.rootName&&(t.rootName=String(e.rootName)),null!=e.elementName&&(t.elementName=String(e.elementName)),null!=e.isAdd&&(t.isAdd=Boolean(e.isAdd)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.rootName="",n.elementName="",n.isAdd=!1,n.wasUndone=!1),null!=e.rootName&&e.hasOwnProperty("rootName")&&(n.rootName=e.rootName),null!=e.elementName&&e.hasOwnProperty("elementName")&&(n.elementName=e.elementName),null!=e.isAdd&&e.hasOwnProperty("isAdd")&&(n.isAdd=e.isAdd),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootOperation"},e})(),he=oe.SplitOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.splitPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.insertionPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ne.create()),null!=e.splitPosition&&Object.hasOwnProperty.call(e,"splitPosition")&&oe.Position.encode(e.splitPosition,t.uint32(10).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&oe.Position.encode(e.graveyardPosition,t.uint32(18).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(24).uint32(e.howMany),null!=e.insertionPosition&&Object.hasOwnProperty.call(e,"insertionPosition")&&oe.Position.encode(e.insertionPosition,t.uint32(34).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.SplitOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.splitPosition=oe.Position.decode(e,e.uint32());break;case 2:r.graveyardPosition=oe.Position.decode(e,e.uint32());break;case 3:r.howMany=e.uint32();break;case 4:r.insertionPosition=oe.Position.decode(e,e.uint32());break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.splitPosition&&e.hasOwnProperty("splitPosition")){let t=oe.Position.verify(e.splitPosition);if(t)return"splitPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=oe.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!re.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")){let t=oe.Position.verify(e.insertionPosition);if(t)return"insertionPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof oe.SplitOperation)return e;let t=new oe.SplitOperation;if(null!=e.splitPosition){if("object"!=typeof e.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");t.splitPosition=oe.Position.fromObject(e.splitPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");t.graveyardPosition=oe.Position.fromObject(e.graveyardPosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.insertionPosition){if("object"!=typeof e.insertionPosition)throw TypeError(".SplitOperation.insertionPosition: object expected");t.insertionPosition=oe.Position.fromObject(e.insertionPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.splitPosition=null,n.graveyardPosition=null,n.howMany=0,n.insertionPosition=null,n.wasUndone=!1),null!=e.splitPosition&&e.hasOwnProperty("splitPosition")&&(n.splitPosition=oe.Position.toObject(e.splitPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=oe.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(n.insertionPosition=oe.Position.toObject(e.insertionPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SplitOperation"},e})(),fe=oe.Position=(()=>{function e(e){if(this.path=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.rootMain=!1,e.prototype.rootGraveyard=!1,e.prototype.path=re.emptyArray,e.prototype.stickiness="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ne.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.rootMain&&Object.hasOwnProperty.call(e,"rootMain")&&t.uint32(16).bool(e.rootMain),null!=e.rootGraveyard&&Object.hasOwnProperty.call(e,"rootGraveyard")&&t.uint32(24).bool(e.rootGraveyard),null!=e.path&&e.path.length){t.uint32(34).fork();for(let n=0;n<e.path.length;++n)t.uint32(e.path[n]);t.ldelim()}return null!=e.stickiness&&Object.hasOwnProperty.call(e,"stickiness")&&t.uint32(42).string(e.stickiness),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.Position;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.rootMain=e.bool();break;case 3:r.rootGraveyard=e.bool();break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.path.push(e.uint32())}else r.path.push(e.uint32());break;case 5:r.stickiness=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.root&&e.hasOwnProperty("root")&&!re.isString(e.root))return"root: string expected";if(null!=e.rootMain&&e.hasOwnProperty("rootMain")&&"boolean"!=typeof e.rootMain)return"rootMain: boolean expected";if(null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&"boolean"!=typeof e.rootGraveyard)return"rootGraveyard: boolean expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(let t=0;t<e.path.length;++t)if(!re.isInteger(e.path[t]))return"path: integer[] expected"}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&!re.isString(e.stickiness)?"stickiness: string expected":null},e.fromObject=function(e){if(e instanceof oe.Position)return e;let t=new oe.Position;if(null!=e.root&&(t.root=String(e.root)),null!=e.rootMain&&(t.rootMain=Boolean(e.rootMain)),null!=e.rootGraveyard&&(t.rootGraveyard=Boolean(e.rootGraveyard)),e.path){if(!Array.isArray(e.path))throw TypeError(".Position.path: array expected");t.path=[];for(let n=0;n<e.path.length;++n)t.path[n]=e.path[n]>>>0}return null!=e.stickiness&&(t.stickiness=String(e.stickiness)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.path=[]),t.defaults&&(n.root="",n.rootMain=!1,n.rootGraveyard=!1,n.stickiness=""),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.rootMain&&e.hasOwnProperty("rootMain")&&(n.rootMain=e.rootMain),null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&(n.rootGraveyard=e.rootGraveyard),e.path&&e.path.length){n.path=[];for(let t=0;t<e.path.length;++t)n.path[t]=e.path[t]}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&(n.stickiness=e.stickiness),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Position"},e})(),me=oe.Range=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.start=null,e.prototype.end=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=ne.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&oe.Position.encode(e.start,t.uint32(10).fork()).ldelim(),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&oe.Position.encode(e.end,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n=void 0===t?e.len:e.pos+t,r=new oe.Range;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.start=oe.Position.decode(e,e.uint32());break;case 2:r.end=oe.Position.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.start&&e.hasOwnProperty("start")){let t=oe.Position.verify(e.start);if(t)return"start."+t}if(null!=e.end&&e.hasOwnProperty("end")){let t=oe.Position.verify(e.end);if(t)return"end."+t}return null},e.fromObject=function(e){if(e instanceof oe.Range)return e;let t=new oe.Range;if(null!=e.start){if("object"!=typeof e.start)throw TypeError(".Range.start: object expected");t.start=oe.Position.fromObject(e.start)}if(null!=e.end){if("object"!=typeof e.end)throw TypeError(".Range.end: object expected");t.end=oe.Position.fromObject(e.end)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.start=null,n.end=null),null!=e.start&&e.hasOwnProperty("start")&&(n.start=oe.Position.toObject(e.start,t)),null!=e.end&&e.hasOwnProperty("end")&&(n.end=oe.Position.toObject(e.end,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Range"},e})(),ge=oe.Element=(()=>{function e(e){if(this.children=[],this.attributesBoolean={},e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.children=re.emptyArray,e.prototype.data="",e.prototype.attributesBoolean=re.emptyObject,e.prototype.attributesJson="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=ne.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.children&&e.children.length)for(let n=0;n<e.children.length;++n)oe.Element.encode(e.children[n],t.uint32(18).fork()).ldelim();if(null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).string(e.data),null!=e.attributesBoolean&&Object.hasOwnProperty.call(e,"attributesBoolean"))for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(16).bool(e.attributesBoolean[n[r]]).ldelim();return null!=e.attributesJson&&Object.hasOwnProperty.call(e,"attributesJson")&&t.uint32(42).string(e.attributesJson),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof te||(e=te.create(e));let n,r,o=void 0===t?e.len:e.pos+t,s=new oe.Element;for(;e.pos<o;){let t=e.uint32();switch(t>>>3){case 1:s.name=e.string();break;case 2:s.children&&s.children.length||(s.children=[]),s.children.push(oe.Element.decode(e,e.uint32()));break;case 3:s.data=e.string();break;case 4:{s.attributesBoolean===re.emptyObject&&(s.attributesBoolean={});let t=e.uint32()+e.pos;for(n="",r=!1;e.pos<t;){let t=e.uint32();switch(t>>>3){case 1:n=e.string();break;case 2:r=e.bool();break;default:e.skipType(7&t)}}s.attributesBoolean[n]=r;break}case 5:s.attributesJson=e.string();break;default:e.skipType(7&t)}}return s},e.decodeDelimited=function(e){return e instanceof te||(e=new te(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!re.isString(e.name))return"name: string expected";if(null!=e.children&&e.hasOwnProperty("children")){if(!Array.isArray(e.children))return"children: array expected";for(let t=0;t<e.children.length;++t){let n=oe.Element.verify(e.children[t]);if(n)return"children."+n}}if(null!=e.data&&e.hasOwnProperty("data")&&!re.isString(e.data))return"data: string expected";if(null!=e.attributesBoolean&&e.hasOwnProperty("attributesBoolean")){if(!re.isObject(e.attributesBoolean))return"attributesBoolean: object expected";let t=Object.keys(e.attributesBoolean);for(let n=0;n<t.length;++n)if("boolean"!=typeof e.attributesBoolean[t[n]])return"attributesBoolean: boolean{k:string} expected"}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&!re.isString(e.attributesJson)?"attributesJson: string expected":null},e.fromObject=function(e){if(e instanceof oe.Element)return e;let t=new oe.Element;if(null!=e.name&&(t.name=String(e.name)),e.children){if(!Array.isArray(e.children))throw TypeError(".Element.children: array expected");t.children=[];for(let n=0;n<e.children.length;++n){if("object"!=typeof e.children[n])throw TypeError(".Element.children: object expected");t.children[n]=oe.Element.fromObject(e.children[n])}}if(null!=e.data&&(t.data=String(e.data)),e.attributesBoolean){if("object"!=typeof e.attributesBoolean)throw TypeError(".Element.attributesBoolean: object expected");t.attributesBoolean={};for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.attributesBoolean[n[r]]=Boolean(e.attributesBoolean[n[r]])}return null!=e.attributesJson&&(t.attributesJson=String(e.attributesJson)),t},e.toObject=function(e,t){t||(t={});let n,r={};if((t.arrays||t.defaults)&&(r.children=[]),(t.objects||t.defaults)&&(r.attributesBoolean={}),t.defaults&&(r.name="",r.data="",r.attributesJson=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),e.children&&e.children.length){r.children=[];for(let n=0;n<e.children.length;++n)r.children[n]=oe.Element.toObject(e.children[n],t)}if(null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),e.attributesBoolean&&(n=Object.keys(e.attributesBoolean)).length){r.attributesBoolean={};for(let t=0;t<n.length;++t)r.attributesBoolean[n[t]]=e.attributesBoolean[n[t]]}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&(r.attributesJson=e.attributesJson),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,ee.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},e})();class ye{constructor(){this._protobufRoot=e}getDescriptor(e){return new be(this._protobufRoot[e])}}class be{constructor(e){this._protobuf=e}compress(e){const t=this._protobuf.verify(e);if(t)throw Error(t);return this._protobuf.encode(this._protobuf.create(e)).finish()}decompress(e){return this._protobuf.toObject(this._protobuf.decode(e),{oneofs:!0})}}const ve=function(){this.__data__=[],this.size=0};const Oe=function(e,t){return e===t||e!=e&&t!=t};const we=function(e,t){for(var n=e.length;n--;)if(Oe(e[n][0],t))return n;return-1};var _e=Array.prototype.splice;const ke=function(e){var t=this.__data__,n=we(t,e);return!(n<0)&&(n==t.length-1?t.pop():_e.call(t,n,1),--this.size,!0)};const xe=function(e){var t=this.__data__,n=we(t,e);return n<0?void 0:t[n][1]};const Ie=function(e){return we(this.__data__,e)>-1};const Se=function(e,t){var n=this.__data__,r=we(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Pe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Pe.prototype.clear=ve,Pe.prototype.delete=ke,Pe.prototype.get=xe,Pe.prototype.has=Ie,Pe.prototype.set=Se;const Te=Pe;const Ae=function(){this.__data__=new Te,this.size=0};const Ce=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const Ee=function(e){return this.__data__.get(e)};const je=function(e){return this.__data__.has(e)};const De="object"==typeof global&&global&&global.Object===Object&&global;var Re="object"==typeof self&&self&&self.Object===Object&&self;const Me=De||Re||Function("return this")();const Ne=Me.Symbol;var Ve=Object.prototype,Be=Ve.hasOwnProperty,Ue=Ve.toString,Je=Ne?Ne.toStringTag:void 0;const qe=function(e){var t=Be.call(e,Je),n=e[Je];try{e[Je]=void 0;var r=!0}catch(e){}var o=Ue.call(e);return r&&(t?e[Je]=n:delete e[Je]),o};var Le=Object.prototype.toString;const Ge=function(e){return Le.call(e)};var Ye=Ne?Ne.toStringTag:void 0;const Fe=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ye&&Ye in Object(e)?qe(e):Ge(e)};const ze=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Ke=function(e){if(!ze(e))return!1;var t=Fe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const He=Me["__core-js_shared__"];var We,$e=(We=/[^.]+$/.exec(He&&He.keys&&He.keys.IE_PROTO||""))?"Symbol(src)_1."+We:"";const Ze=function(e){return!!$e&&$e in e};var Qe=Function.prototype.toString;const Xe=function(e){if(null!=e){try{return Qe.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var et=/^\[object .+?Constructor\]$/,tt=Function.prototype,nt=Object.prototype,rt=tt.toString,ot=nt.hasOwnProperty,st=RegExp("^"+rt.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const it=function(e){return!(!ze(e)||Ze(e))&&(Ke(e)?st:et).test(Xe(e))};const at=function(e,t){return null==e?void 0:e[t]};const ct=function(e,t){var n=at(e,t);return it(n)?n:void 0};const ut=ct(Me,"Map");const dt=ct(Object,"create");const lt=function(){this.__data__=dt?dt(null):{},this.size=0};const pt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var ht=Object.prototype.hasOwnProperty;const ft=function(e){var t=this.__data__;if(dt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ht.call(t,e)?t[e]:void 0};var mt=Object.prototype.hasOwnProperty;const gt=function(e){var t=this.__data__;return dt?void 0!==t[e]:mt.call(t,e)};const yt=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=dt&&void 0===t?"__lodash_hash_undefined__":t,this};function bt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bt.prototype.clear=lt,bt.prototype.delete=pt,bt.prototype.get=ft,bt.prototype.has=gt,bt.prototype.set=yt;const vt=bt;const Ot=function(){this.size=0,this.__data__={hash:new vt,map:new(ut||Te),string:new vt}};const wt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const _t=function(e,t){var n=e.__data__;return wt(t)?n["string"==typeof t?"string":"hash"]:n.map};const kt=function(e){var t=_t(this,e).delete(e);return this.size-=t?1:0,t};const xt=function(e){return _t(this,e).get(e)};const It=function(e){return _t(this,e).has(e)};const St=function(e,t){var n=_t(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Pt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Pt.prototype.clear=Ot,Pt.prototype.delete=kt,Pt.prototype.get=xt,Pt.prototype.has=It,Pt.prototype.set=St;const Tt=Pt;const At=function(e,t){var n=this.__data__;if(n instanceof Te){var r=n.__data__;if(!ut||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Tt(r)}return n.set(e,t),this.size=n.size,this};function Ct(e){var t=this.__data__=new Te(e);this.size=t.size}Ct.prototype.clear=Ae,Ct.prototype.delete=Ce,Ct.prototype.get=Ee,Ct.prototype.has=je,Ct.prototype.set=At;const Et=Ct;const jt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const Dt=function(){try{var e=ct(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const Rt=function(e,t,n){"__proto__"==t&&Dt?Dt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var Mt=Object.prototype.hasOwnProperty;const Nt=function(e,t,n){var r=e[t];Mt.call(e,t)&&Oe(r,n)&&(void 0!==n||t in e)||Rt(e,t,n)};const Vt=function(e,t,n,r){var o=!n;n||(n={});for(var s=-1,i=t.length;++s<i;){var a=t[s],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),o?Rt(n,a,c):Nt(n,a,c)}return n};const Bt=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const Ut=function(e){return null!=e&&"object"==typeof e};const Jt=function(e){return Ut(e)&&"[object Arguments]"==Fe(e)};var qt=Object.prototype,Lt=qt.hasOwnProperty,Gt=qt.propertyIsEnumerable;const Yt=Jt(function(){return arguments}())?Jt:function(e){return Ut(e)&&Lt.call(e,"callee")&&!Gt.call(e,"callee")};const Ft=Array.isArray;const zt=function(){return!1};var Kt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ht=Kt&&"object"==typeof module&&module&&!module.nodeType&&module,Wt=Ht&&Ht.exports===Kt?Me.Buffer:void 0;const $t=(Wt?Wt.isBuffer:void 0)||zt;var Zt=/^(?:0|[1-9]\d*)$/;const Qt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Zt.test(e))&&e>-1&&e%1==0&&e<t};const Xt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var en={};en["[object Float32Array]"]=en["[object Float64Array]"]=en["[object Int8Array]"]=en["[object Int16Array]"]=en["[object Int32Array]"]=en["[object Uint8Array]"]=en["[object Uint8ClampedArray]"]=en["[object Uint16Array]"]=en["[object Uint32Array]"]=!0,en["[object Arguments]"]=en["[object Array]"]=en["[object ArrayBuffer]"]=en["[object Boolean]"]=en["[object DataView]"]=en["[object Date]"]=en["[object Error]"]=en["[object Function]"]=en["[object Map]"]=en["[object Number]"]=en["[object Object]"]=en["[object RegExp]"]=en["[object Set]"]=en["[object String]"]=en["[object WeakMap]"]=!1;const tn=function(e){return Ut(e)&&Xt(e.length)&&!!en[Fe(e)]};const nn=function(e){return function(t){return e(t)}};var rn="object"==typeof exports&&exports&&!exports.nodeType&&exports,on=rn&&"object"==typeof module&&module&&!module.nodeType&&module,sn=on&&on.exports===rn&&De.process;const an=function(){try{var e=on&&on.require&&on.require("util").types;return e||sn&&sn.binding&&sn.binding("util")}catch(e){}}();var cn=an&&an.isTypedArray;const un=cn?nn(cn):tn;var dn=Object.prototype.hasOwnProperty;const ln=function(e,t){var n=Ft(e),r=!n&&Yt(e),o=!n&&!r&&$t(e),s=!n&&!r&&!o&&un(e),i=n||r||o||s,a=i?Bt(e.length,String):[],c=a.length;for(var u in e)!t&&!dn.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Qt(u,c))||a.push(u);return a};var pn=Object.prototype;const hn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||pn)};const fn=function(e,t){return function(n){return e(t(n))}};const mn=fn(Object.keys,Object);var gn=Object.prototype.hasOwnProperty;const yn=function(e){if(!hn(e))return mn(e);var t=[];for(var n in Object(e))gn.call(e,n)&&"constructor"!=n&&t.push(n);return t};const bn=function(e){return null!=e&&Xt(e.length)&&!Ke(e)};const vn=function(e){return bn(e)?ln(e):yn(e)};const On=function(e,t){return e&&Vt(t,vn(t),e)};const wn=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var _n=Object.prototype.hasOwnProperty;const kn=function(e){if(!ze(e))return wn(e);var t=hn(e),n=[];for(var r in e)("constructor"!=r||!t&&_n.call(e,r))&&n.push(r);return n};const xn=function(e){return bn(e)?ln(e,!0):kn(e)};const In=function(e,t){return e&&Vt(t,xn(t),e)};var Sn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Pn=Sn&&"object"==typeof module&&module&&!module.nodeType&&module,Tn=Pn&&Pn.exports===Sn?Me.Buffer:void 0,An=Tn?Tn.allocUnsafe:void 0;const Cn=function(e,t){if(t)return e.slice();var n=e.length,r=An?An(n):new e.constructor(n);return e.copy(r),r};const En=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};const jn=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,s=[];++n<r;){var i=e[n];t(i,n,e)&&(s[o++]=i)}return s};const Dn=function(){return[]};var Rn=Object.prototype.propertyIsEnumerable,Mn=Object.getOwnPropertySymbols;const Nn=Mn?function(e){return null==e?[]:(e=Object(e),jn(Mn(e),(function(t){return Rn.call(e,t)})))}:Dn;const Vn=function(e,t){return Vt(e,Nn(e),t)};const Bn=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e};const Un=fn(Object.getPrototypeOf,Object);const Jn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Bn(t,Nn(e)),e=Un(e);return t}:Dn;const qn=function(e,t){return Vt(e,Jn(e),t)};const Ln=function(e,t,n){var r=t(e);return Ft(e)?r:Bn(r,n(e))};const Gn=function(e){return Ln(e,vn,Nn)};const Yn=function(e){return Ln(e,xn,Jn)};const Fn=ct(Me,"DataView");const zn=ct(Me,"Promise");const Kn=ct(Me,"Set");const Hn=ct(Me,"WeakMap");var Wn="[object Map]",$n="[object Promise]",Zn="[object Set]",Qn="[object WeakMap]",Xn="[object DataView]",er=Xe(Fn),tr=Xe(ut),nr=Xe(zn),rr=Xe(Kn),or=Xe(Hn),sr=Fe;(Fn&&sr(new Fn(new ArrayBuffer(1)))!=Xn||ut&&sr(new ut)!=Wn||zn&&sr(zn.resolve())!=$n||Kn&&sr(new Kn)!=Zn||Hn&&sr(new Hn)!=Qn)&&(sr=function(e){var t=Fe(e),n="[object Object]"==t?e.constructor:void 0,r=n?Xe(n):"";if(r)switch(r){case er:return Xn;case tr:return Wn;case nr:return $n;case rr:return Zn;case or:return Qn}return t});const ir=sr;var ar=Object.prototype.hasOwnProperty;const cr=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ar.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const ur=Me.Uint8Array;const dr=function(e){var t=new e.constructor(e.byteLength);return new ur(t).set(new ur(e)),t};const lr=function(e,t){var n=t?dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var pr=/\w*$/;const hr=function(e){var t=new e.constructor(e.source,pr.exec(e));return t.lastIndex=e.lastIndex,t};var fr=Ne?Ne.prototype:void 0,mr=fr?fr.valueOf:void 0;const gr=function(e){return mr?Object(mr.call(e)):{}};const yr=function(e,t){var n=t?dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const br=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return dr(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return lr(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return yr(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return hr(e);case"[object Symbol]":return gr(e)}};var vr=Object.create;const Or=function(){function e(){}return function(t){if(!ze(t))return{};if(vr)return vr(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const wr=function(e){return"function"!=typeof e.constructor||hn(e)?{}:Or(Un(e))};const _r=function(e){return Ut(e)&&"[object Map]"==ir(e)};var kr=an&&an.isMap;const xr=kr?nn(kr):_r;const Ir=function(e){return Ut(e)&&"[object Set]"==ir(e)};var Sr=an&&an.isSet;const Pr=Sr?nn(Sr):Ir;var Tr="[object Arguments]",Ar="[object Function]",Cr="[object Object]",Er={};Er[Tr]=Er["[object Array]"]=Er["[object ArrayBuffer]"]=Er["[object DataView]"]=Er["[object Boolean]"]=Er["[object Date]"]=Er["[object Float32Array]"]=Er["[object Float64Array]"]=Er["[object Int8Array]"]=Er["[object Int16Array]"]=Er["[object Int32Array]"]=Er["[object Map]"]=Er["[object Number]"]=Er[Cr]=Er["[object RegExp]"]=Er["[object Set]"]=Er["[object String]"]=Er["[object Symbol]"]=Er["[object Uint8Array]"]=Er["[object Uint8ClampedArray]"]=Er["[object Uint16Array]"]=Er["[object Uint32Array]"]=!0,Er["[object Error]"]=Er[Ar]=Er["[object WeakMap]"]=!1;const jr=function e(t,n,r,o,s,i){var a,c=1&n,u=2&n,d=4&n;if(r&&(a=s?r(t,o,s,i):r(t)),void 0!==a)return a;if(!ze(t))return t;var l=Ft(t);if(l){if(a=cr(t),!c)return En(t,a)}else{var p=ir(t),h=p==Ar||"[object GeneratorFunction]"==p;if($t(t))return Cn(t,c);if(p==Cr||p==Tr||h&&!s){if(a=u||h?{}:wr(t),!c)return u?qn(t,In(a,t)):Vn(t,On(a,t))}else{if(!Er[p])return s?t:{};a=br(t,p,c)}}i||(i=new Et);var f=i.get(t);if(f)return f;i.set(t,a),Pr(t)?t.forEach((function(o){a.add(e(o,n,r,o,t,i))})):xr(t)&&t.forEach((function(o,s){a.set(s,e(o,n,r,s,t,i))}));var m=l?void 0:(d?u?Yn:Gn:u?xn:vn)(t);return jt(m||t,(function(o,s){m&&(o=t[s=o]),Nt(a,s,e(o,n,r,s,t,i))})),a};const Dr=function(e){return jr(e,5)};const Rr=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const Mr=function(e){return this.__data__.has(e)};function Nr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Tt;++t<n;)this.add(e[t])}Nr.prototype.add=Nr.prototype.push=Rr,Nr.prototype.has=Mr;const Vr=Nr;const Br=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const Ur=function(e,t){return e.has(t)};const Jr=function(e,t,n,r,o,s){var i=1&n,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var l=-1,p=!0,h=2&n?new Vr:void 0;for(s.set(e,t),s.set(t,e);++l<a;){var f=e[l],m=t[l];if(r)var g=i?r(m,f,l,t,e,s):r(f,m,l,e,t,s);if(void 0!==g){if(g)continue;p=!1;break}if(h){if(!Br(t,(function(e,t){if(!Ur(h,t)&&(f===e||o(f,e,n,r,s)))return h.push(t)}))){p=!1;break}}else if(f!==m&&!o(f,m,n,r,s)){p=!1;break}}return s.delete(e),s.delete(t),p};const qr=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const Lr=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Gr=Ne?Ne.prototype:void 0,Yr=Gr?Gr.valueOf:void 0;const Fr=function(e,t,n,r,o,s,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new ur(e),new ur(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Oe(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=qr;case"[object Set]":var c=1&r;if(a||(a=Lr),e.size!=t.size&&!c)return!1;var u=i.get(e);if(u)return u==t;r|=2,i.set(e,t);var d=Jr(a(e),a(t),r,o,s,i);return i.delete(e),d;case"[object Symbol]":if(Yr)return Yr.call(e)==Yr.call(t)}return!1};var zr=Object.prototype.hasOwnProperty;const Kr=function(e,t,n,r,o,s){var i=1&n,a=Gn(e),c=a.length;if(c!=Gn(t).length&&!i)return!1;for(var u=c;u--;){var d=a[u];if(!(i?d in t:zr.call(t,d)))return!1}var l=s.get(e),p=s.get(t);if(l&&p)return l==t&&p==e;var h=!0;s.set(e,t),s.set(t,e);for(var f=i;++u<c;){var m=e[d=a[u]],g=t[d];if(r)var y=i?r(g,m,d,t,e,s):r(m,g,d,e,t,s);if(!(void 0===y?m===g||o(m,g,n,r,s):y)){h=!1;break}f||(f="constructor"==d)}if(h&&!f){var b=e.constructor,v=t.constructor;b==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(h=!1)}return s.delete(e),s.delete(t),h};var Hr="[object Arguments]",Wr="[object Array]",$r="[object Object]",Zr=Object.prototype.hasOwnProperty;const Qr=function(e,t,n,r,o,s){var i=Ft(e),a=Ft(t),c=i?Wr:ir(e),u=a?Wr:ir(t),d=(c=c==Hr?$r:c)==$r,l=(u=u==Hr?$r:u)==$r,p=c==u;if(p&&$t(e)){if(!$t(t))return!1;i=!0,d=!1}if(p&&!d)return s||(s=new Et),i||un(e)?Jr(e,t,n,r,o,s):Fr(e,t,c,n,r,o,s);if(!(1&n)){var h=d&&Zr.call(e,"__wrapped__"),f=l&&Zr.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,g=f?t.value():t;return s||(s=new Et),o(m,g,n,r,s)}}return!!p&&(s||(s=new Et),Kr(e,t,n,r,o,s))};const Xr=function e(t,n,r,o,s){return t===n||(null==t||null==n||!Ut(t)&&!Ut(n)?t!=t&&n!=n:Qr(t,n,r,o,e,s))};const eo=function(e,t){return Xr(e,t)};function to(e,t){const n=Dr(e);return n.path[n.path.length-1]+=t,n}function no(e,t){return e.root===t.root&&eo(e.path,t.path)}function ro(e){so(e,(e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e)))}function oo(e){so(e,(e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e)))}function so(e,t){for(const n in e){const r=e[n];"nodes"!==n&&ze(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):so(r,t))}return e}class io{constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return ro(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){t.types.shift();const n=this._protobufDescriptor.decompress(t.buffers.shift());oo(n),n.__className=this._operationName,e.push(n)}}class ao extends io{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),ro(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,o=this._protobufDescriptor.decompress(r.shift());n.shift(),this._deserializeOneOf("oldValue",o),this._deserializeOneOf("newValue",o),oo(o),o.__className=this._operationName,e.push(o)}_serializeOneOf(e,t){const n=t[e];"boolean"==typeof n?t[`${e}Boolean`]=n:t[`${e}Json`]=JSON.stringify(n)}_deserializeOneOf(e,t){const n=`${e}Json`;t[n]?(t[e]=JSON.parse(t[n]),delete t[n]):(t[e]=t[`${e}Boolean`],delete t[`${e}Boolean`])}}class co extends io{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),ro(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,o=this._protobufDescriptor.decompress(r.shift());n.shift(),o.nodes||(o.nodes=[]),this._deserializeNodesAttributes(o.nodes),oo(o),o.__className=this._operationName,e.push(o)}_serializeNodesAttributes(e){for(const t of e){if(t.attributes){const e=t.attributes;this._areValuesBoolean(e)?t.attributesBoolean=e:t.attributesJson=JSON.stringify(e)}t.children&&this._serializeNodesAttributes(t.children)}}_deserializeNodesAttributes(e){for(const t of e)(t.attributesBoolean||t.attributesJson)&&(t.attributesBoolean?(t.attributes=t.attributesBoolean,delete t.attributesBoolean):(t.attributes=JSON.parse(t.attributesJson),delete t.attributesJson)),t.children&&this._deserializeNodesAttributes(t.children)}_areValuesBoolean(e){return Object.keys(e).every((t=>"boolean"==typeof e[t]))}}class uo extends io{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class lo extends io{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class po extends uo{constructor(e,t,n,r){super(e,t,n),this._omittedNamespace=r+":"}compress(e,t){return!("MarkerOperation"!=t[0].__className||!t[0].name.startsWith(this._omittedNamespace))&&(t[0].name=t[0].name.replace(new RegExp("^"+this._omittedNamespace),""),super.compress(e,t),!0)}decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.name=this._omittedNamespace+n.name}}class ho{constructor(e,t){this._id=e,this._context=t}compress(e,t){let n;for(;t.length>1&&this._compareOperations(t[0],t[1]);)n?(n=this._combineNext(t.shift(),n),e.types.push(0)):(n=Dr(t.shift()),e.types.push(this._id));return!!n&&(n=this._combineNext(t.shift(),n),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0)}decompress(e,t){const n=this._decompressSingleOperation(t);for(;0==t.types[0];)t.types.shift(),e.push(this._splitCurrent(n));e.push(n)}}class fo extends ho{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=Dr(e),n=t.nodes[0],r=e.nodes[0],o=r.data[Symbol.iterator]().next().value,s=o.length;return n.data=o,r.data=r.data.substr(s),e.position=to(e.position,s),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=no(to(e.position,n),t.position),o=e.nodes[0],s=t.nodes[0];return r&&this._compareAttributes(o,s)}return!1}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("InsertOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("InsertOperation").decompress(t,e),t[0]}_checkOperation(e){return"InsertOperation"==e.__className&&1==e.nodes.length&&e.nodes[0].data&&!e.wasUndone&&1==Array.from(e.nodes[0].data).length}_compareAttributes(e,t){const n=Object.keys(e.attributes||{}),r=Object.keys(t.attributes||{});return n.length===r.length&&n.every((n=>t.attributes[n]&&t.attributes[n]===e.attributes[n]))}}class mo extends ho{_combineNext(e,t){return t.howMany++,t.sourcePosition=Dr(e.sourcePosition),t}_splitCurrent(e){const t=Dr(e);return e.howMany--,t.howMany=1,t.sourcePosition=to(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(no(to(e.sourcePosition,-1),t.sourcePosition)&&no(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class go extends ho{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=Dr(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(no(e.sourcePosition,t.sourcePosition)&&no(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class yo extends ho{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&no(n.newRange.start,n.newRange.end)&&(n.newRange.end=null),t.shift(),e.types.push(this._id),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0}decompress(e,t){const n=this._decompressSingleOperation(t);n.newRange&&!n.newRange.end&&(n.newRange.end=Dr(n.newRange.start));const r=Dr(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=Dr(r.newRange.start)),r.name="user:position:"+r.name.split(":")[2],t.types.shift(),e.push(n),e.push(r)}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MarkerOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MarkerOperation").decompress(t,e),t[0]}_compareOperations(e,t){return!(!e||!t)&&("MarkerOperation"==e.__className&&"MarkerOperation"==t.__className&&!(!e.name.startsWith("user:")||!t.name.startsWith("user:")||e.name==t.name))}}class bo{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new ye;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new lo(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",ao),this._registerOperationCompressor(11,"InsertOperation",co),this._registerOperationCompressor(12,"MarkerOperation",uo),this._registerOperationCompressor(13,"MergeOperation",io),this._registerOperationCompressor(14,"MoveOperation",io),this._registerOperationCompressor(15,"RenameOperation",io),this._registerOperationCompressor(16,"RootAttributeOperation",ao),this._registerOperationCompressor(17,"SplitOperation",io),this._registerCompressor(18,"CommentMarkerOperation",new po(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new po(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",io),this._registerActionCompressor(100,"TypingAction",fo),this._registerActionCompressor(101,"DeletingAction",mo),this._registerActionCompressor(102,"ForwardDeletingAction",go),this._registerActionCompressor(103,"UserSelectionAction",yo)}compress(e){if(!e||!e[0])throw new n.CKEditorError("no-operations-provided",this);const t={types:[],buffers:[],baseVersion:e[0].baseVersion};for(;e.length;)this._getCompressorByName("UserSelectionAction").compress(t,e)||this._getCompressorByName("TypingAction").compress(t,e)||this._getCompressorByName("DeletingAction").compress(t,e)||this._getCompressorByName("ForwardDeletingAction").compress(t,e)||this._getCompressorByName("CommentMarkerOperation").compress(t,e)||this._getCompressorByName("SuggestionMarkerOperation").compress(t,e)||this._getCompressorByName(e[0].__className).compress(t,e);return t}decompress(e){const t=[];for(;e.types.length;){this._compressorById.get(e.types[0]).decompress(t,e)}return t.forEach(((t,n)=>t.baseVersion=e.baseVersion+n)),t}_getCompressorByName(e){return this._compressorByName.get(e)}_registerOperationCompressor(e,t,n){const r=new n(e,t,this._protobufFactory.getDescriptor(t));this._registerCompressor(e,t,r)}_registerActionCompressor(e,t,n){const r=new n(e,this);this._registerCompressor(e,t,r)}_registerCompressor(e,t,n){this._compressorById.set(e,n),this._compressorByName.set(t,n)}}var vo=__webpack_require__(4916);const Oo=["position","set","_crash","_fetchMissingUsers","$root","_currentBufferDelay","finally","_initThrowingOnDataSet","push","_authorId","connected","_bufferedOperations","getRoot","model","_knownOperations","PENDING_ACTION_SENDING_DATA","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","getMany","size","disconnected","plugins","batch","entries","_compressor","then","_initSessionsHandling","unregister","channelSessions","offset","_handleInitialConnectionData","reconnect","_lastSyncedOperationId","applyOperation","_isPendingUpdate","suppressErrorInCollaboration","_sendBufferedOperationsDelayId","serverHistory","init","disableReadOnlyMode","markers","_decompressOperations","stop","includes","isAttached","metadata","_service","length","_operationToId","cloud-services-internal-error: Collaborative Editing Service is not connected.","CommentsOnly","bind","createPositionAt","getIdOfTheLastOperation","listenTo","get","_handleExternalOperations","realtimecollaborationclient-init-session-connection-error","realtimecollaborationclient-initservice-internal-error","stopListening","getUser","forEach","addRoot","editing","locale","collaboration.channelId","_shouldSendSelectionUpdate","initData","realtimecollaborationclient-init-non-existent-root","_connectService","apply","_lastServerVersion","return","cs:removeUser","code","filter","wereChangesApplied","_disconnectService","_hasSynchronizationProblem","setPermissions","realtimecollaborationclient-sendbufferedoperations","_handleReconnectionResponse","state","add","root","keys","userId","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","collaboration-missing-channelid","bufferOperation","cloud-services-internal-error: Request timeout.","_getOperationsFromInitData","toJSON","_connectAfterSessionHasBeenFlushed","_hasSelectionChanged","_sendBufferedOperationsDelayed","createUserMarkerOperations","slice","high","operationsReceived","getConnectedSessions","remove","fromJSON","_pendingAction","_disconnectionOperations","document:write","enqueueChange","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","selection","type","The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.","_saveOperationInBuffer","round","__className","rtc-offline","message","_handleReceivedOperations","_channelId","baseVersion","createPositionFromPath","_isConnected","isUndoneOperation","startsWith","rootName","from","_handleReconnectionError","version","error","real-time-collaboration","editor","sessionAdd:","getOperations","catch","collaboration","wasUndone","change:hasDomSelection","start","has","_updateServerHistory","lastOperationId","_document","getReversed","sendOperations","_isDisconnection","_isAttached","setIdForTheLastOperation","marker","_isInit","change:range","realtimecollaborationclient-init-document-already-initialized","getDocumentDetails","currentDocumentSession","_setPendingAction","document","_handleSendingSelectionMarkers","_offset","_applyOperationsSet","fire","reset","createRange","differ","addUser","_compressOperations","RealTimeCollaborationClient","data","roots","destroy","isEnabled","map","_ignoredOperations","enableReadOnlyMode","cloud-services-internal-error: Not connected.","_operationIdentifier","rootsAttributes","_baseBufferDelay","_isEditingAllowed","view","realtimecollaborationclient-handleserverresponse","sessionCreatedAt","end","lastSyncVersion","config","history","getOperationAuthor","_clearPendingAction","_sendBufferedOperations","_handleServerResponse","showWarning","clone","Notification","_refreshUserSelectionMarkers","requires","_shouldSendUpdate","connect","CollaborativeEditingService","createdAt","The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.","Permissions","sessionId","_setUpDataInit","detachRoot"];var wo,_o;wo=Oo,_o=492,function(e){for(;--e;)wo.push(wo.shift())}(++_o);const ko=function(e,t){return Oo[e-=0]};let xo=1;class Io extends t.Plugin{static get[ko("0x62")](){return[d,Y,Z,t.PendingActions,y,r.Notification]}static get pluginName(){return ko("0x46")}get cloudDocumentVersion(){return this[ko("0xb2")]+this[ko("0x3e")]}get[ko("0xb2")](){return this[ko("0x90")][ko("0x21")]-this[ko("0x3e")]}get[ko("0x57")](){const e=this[ko("0x90")][ko("0x26")]();for(let t=e[ko("0x9a")]-1;t>=0;t--){const n=e[t];if(!this[ko("0xb")][ko("0x2c")](n))return n.baseVersion+1-this[ko("0x3e")]}return 0}constructor(e){if(super(e),this._offset=0,this[ko("0x69")]=null,this.serverHistory=new o.History,this.editor[ko("0x58")].define(ko("0x28"),{}),this._channelId=this.editor[ko("0x58")][ko("0xa2")](ko("0xac")),!this[ko("0x18")])throw new n.CKEditorError(ko("0xc3"),this);const t=e.config[ko("0xa2")]("cloudServices.bundleVersion")||n.version;this[ko("0x99")]=new(Io[ko("0x65")])(t,this[ko("0x18")]),this[ko("0x2f")]=this.editor[ko("0x79")][ko("0x3c")],this[ko("0x83")]=new bo,this[ko("0x77")]=[],this[ko("0x7a")]=new WeakSet,this[ko("0x6d")]("_isPendingUpdate",!1),this[ko("0x6d")](ko("0xb9"),!1),this[ko("0xa")]=null,this[ko("0x1")]=!1,this[ko("0x8f")]=null,this._baseBufferDelay=300,this[ko("0x71")]=this[ko("0x51")],this[ko("0x8b")]=null,this[ko("0xb")]=new WeakSet,this[ko("0x4f")]=new To(this._disconnectionOperations)}[ko("0x91")](){const e=this.editor,t=e.plugins[ko("0xa2")](y),n=e[ko("0x80")][ko("0xa2")](d);this[ko("0xa1")](t,ko("0x5a"),((e,n)=>{const r=n[0];r[ko("0x75")]&&(e[ko("0xb3")]=t[ko("0xa7")](r[ko("0x75")]),e.stop()),null===r[ko("0x75")]&&(e.return=null,e[ko("0x95")]())}),{priority:ko("0x5")}),this[ko("0xa1")](e[ko("0x79")][ko("0x3c")][ko("0xf")],ko("0x37"),((e,t)=>{t.directChange&&this[ko("0x61")]()})),this[ko("0xa1")](e[ko("0xaa")][ko("0x53")],ko("0x2a"),(()=>{this[ko("0x61")]()})),this[ko("0x73")](),e.model.on(ko("0x8c"),((e,t)=>{const n=t[0];n.isDocumentOperation&&(this[ko("0x12")](n),this[ko("0x63")]()&&this._sendBufferedOperationsDelayed())})),this._setUpDataInit(),this.bind("_isEditingAllowed").to(n,ko("0xbd"),this,ko("0xb9"),((e,t)=>ko("0x76")===e&&!t)),this.on("change:_isEditingAllowed",(()=>{this[ko("0x52")]?e[ko("0x92")](ko("0x15")):e[ko("0x4d")](ko("0x15"))})),this[ko("0x52")]?e[ko("0x92")]("rtc-offline"):e[ko("0x4d")](ko("0x15")),this[ko("0x6d")]("_isConnected",!1)}async[ko("0x8a")](){const e=this[ko("0x24")][ko("0x80")][ko("0xa2")](Y),t=this[ko("0x24")].plugins[ko("0xa2")](d);try{this._isPendingUpdate=!0,e[ko("0x86")](this[ko("0x18")]);const n=await this[ko("0x99")].reconnect(t.connection,this.lastSyncVersion);await this[ko("0xbc")](n)&&(this[ko("0x8d")]=!1,this._clearPendingAction());const r=await this[ko("0x99")].getConnectedSessions();e.register(this[ko("0x18")],r),this._handleSendingSelectionMarkers(),this[ko("0x1b")]=!0}catch(e){if("404"===e.code&&this[ko("0x69")])await this[ko("0x0")]();else if("409"===e[ko("0xb5")]){const e=X(this.editor[ko("0xab")],ko("0xe"));this._handleReconnectionError(e)}else{if(!(e instanceof So))throw e;this[ko("0x20")]()}}}[ko("0x49")](){const e=this[ko("0x24")][ko("0x80")][ko("0xa2")](d),t=this[ko("0x24")][ko("0x80")].get(Y);this.editor[ko("0x4d")]("rtc-destroyed"),t[ko("0x87")][ko("0x2c")](this._channelId)&&t[ko("0x86")](this[ko("0x18")]),e.removeFromReconnectionStack(this),this[ko("0xb8")](),super[ko("0x49")]()}async[ko("0xbc")](e){if(this[ko("0x69")]!==e[ko("0x69")]&&this[ko("0x8b")]!==e[ko("0x2e")])throw new So;return this[ko("0x69")]=e[ko("0x69")],this._handleServerResponse([],{...e,wereChangesApplied:!1,data:e[ko("0x47")]},ko("0x8a"))}async[ko("0xb0")](e,t=!1){const{connection:n}=this[ko("0x24")].plugins[ko("0xa2")](d);Io[ko("0x65")][ko("0x7")](n,this[ko("0x18")])[ko("0x84")]((e=>this[ko("0x85")](e))).catch((e=>{this[ko("0x6e")](ko("0xa4"),e)})),this[ko("0xa1")](this._service,ko("0x6"),this[ko("0x17")][ko("0x9e")](this)),this[ko("0xa1")](this[ko("0x99")],"error",((e,t)=>{this[ko("0x6e")](ko("0xa5"),t)})),this[ko("0xa1")](this._service,ko("0x7f"),(()=>{this._isConnected=!1}));const r=this[ko("0x4f")].getIdOfTheLastOperation(e),o=await this[ko("0x99")][ko("0x64")](n,this[ko("0x45")](e),r);if(this[ko("0x69")]=o[ko("0x69")],o.wereChangesApplied&&(this._isPendingUpdate=!1,this[ko("0x5b")]()),t){if(!o.wereChangesApplied)return void this[ko("0x20")]();this[ko("0x90")][ko("0x41")](),this[ko("0x3e")]=o[ko("0x88")],this[ko("0x90")][ko("0x21")]=this[ko("0x3e")],await this._handleServerResponse(e,o,"reconnection: flushed session")}else await this[ko("0x89")](o,e);this[ko("0x3d")](),this[ko("0x1b")]=!0}[ko("0x3d")](){const e=this[ko("0x24")][ko("0x80")][ko("0xa2")](Y),t=this[ko("0x24")][ko("0x80")].get(Z),n=e[ko("0x87")][ko("0xa2")](this._channelId);n&&n[ko("0x9a")]>1?t[ko("0x3")]():this[ko("0xa1")](e,"sessionAdd:"+this[ko("0x18")],(()=>{2===e[ko("0x87")][ko("0xa2")](this._channelId)[ko("0x9a")]&&t[ko("0x3")]()}))}async[ko("0x17")](e,t,n,r){if(!this[ko("0x8d")]&&this[ko("0x2f")].version==t){const e=this[ko("0x94")](n,r);await this[ko("0x6f")](e),this[ko("0xa3")](e,t,n[ko("0x2e")])||this[ko("0x6e")]("realtimecollaborationclient-initservice-incorrect-server-operation")}}async[ko("0x0")](){this[ko("0xb8")]();const{locale:e}=this[ko("0x24")];let t;try{t=await this[ko("0x99")][ko("0x39")]()}catch(t){const n=X(e,ko("0xc2"));return void this[ko("0x20")](n)}const n=t[ko("0x3a")]||t.lastDocumentSession;if(this[ko("0x8b")]===n[ko("0x2e")])await this[ko("0xb0")](this[ko("0x24")][ko("0x79")][ko("0x3c")][ko("0x59")][ko("0x26")](),!0);else{const t=X(e,ko("0x67"));this[ko("0x20")](t)}}[ko("0xb8")](){this._service.disconnect(),this[ko("0x77")]=[],clearTimeout(this[ko("0x8f")]),this[ko("0xa6")](this[ko("0x99")])}[ko("0x85")](e){const t=this[ko("0x24")][ko("0x80")].get(Y);this[ko("0xa1")](t,ko("0x25")+this[ko("0x18")],((e,{session:n})=>{if(n.id===t.mySessionId){e.off();const t=this.editor[ko("0x80")].has(ko("0x9d"))&&this[ko("0x24")][ko("0x80")][ko("0xa2")](ko("0x9d"));let r=n.permissions;t&&t[ko("0x4a")]&&(r=r[ko("0xb6")]((e=>ko("0xc")!==e))),this[ko("0x24")].plugins.get(ko("0x68"))[ko("0xba")](r,this[ko("0x18")])}})),t.register(this[ko("0x18")],e)}[ko("0x73")](){const e=this[ko("0x24")].data.set;this[ko("0x24")].data[ko("0x6d")]=(...t)=>{if(!t[t[ko("0x9a")]-1][ko("0x8e")])throw new n.CKEditorError(ko("0x7c"),this);e[ko("0xb1")](this[ko("0x24")].data,t)}}[ko("0x6a")](){this.editor[ko("0x47")].on("init",((e,[t])=>{if(this[ko("0x2f")][ko("0x21")])throw new n.CKEditorError(ko("0x38"),this);e.stop(),this[ko("0x3b")]();const r=this[ko("0x24")][ko("0x58")].get(ko("0x50")),o=this._getOperationsFromInitData(t,r);e[ko("0xb3")]=this[ko("0xb0")](o).then((()=>{this[ko("0x24")].plugins[ko("0xa2")](d).addToReconnectionStack(this),this.editor.data[ko("0x40")]("ready")})).catch((e=>this._crash("realtimecollaborationclient-init-connection-failed",e)))[ko("0x72")]((()=>this[ko("0x5b")]()))}),{priority:"high"})}async[ko("0x6f")](e){const t=this[ko("0x24")][ko("0x80")][ko("0xa2")](y),{connection:n}=this.editor[ko("0x80")][ko("0xa2")](d),r=new Set;for(const n of e){const e=n._authorId;e&&!t[ko("0xa7")](e)&&r[ko("0xbe")](e)}if(0===r[ko("0x7e")])return;const o=await vo.User[ko("0x7d")](n,Array[ko("0x1f")](r));for(const e of o)t[ko("0xa7")](e.id)||t[ko("0x44")](e)}[ko("0xc6")](e,t={}){const r=this[ko("0x24")].model,s=[];let i=0;const a="string"==typeof e?{main:e}:e;for(const e of Object[ko("0xc0")](a)){if(!this[ko("0x2f")][ko("0x48")][ko("0x2c")](e))throw new n.CKEditorError(ko("0xaf"),this);const t=this[ko("0x24")].data.parse(a[e]),c=this[ko("0x2f")].getRoot(e),u=new o.InsertOperation(r[ko("0x9f")](c,0),t,i++);s[ko("0x74")](u);for(const[e,n]of t[ko("0x93")]){const t=r[ko("0x42")](r[ko("0x1a")](c,n[ko("0x2b")].path[ko("0x4")]()),r[ko("0x1a")](c,n[ko("0x56")].path.slice())),a=new o.MarkerOperation(e,null,t,r[ko("0x93")],!0,i++);s[ko("0x74")](a)}}if(t)for(const[e,a]of Object[ko("0x82")](t)){const t=r[ko("0x3c")][ko("0x78")](e);if(!t)throw new n.CKEditorError("multi-root-editor-root-attributes-no-root",null);for(const[e,n]of Object[ko("0x82")](a))if(null!==n){const r=new o.RootAttributeOperation(t,e,null,n,i++);s[ko("0x74")](r)}}return s}async[ko("0x89")](e,t){let n;this[ko("0x3e")]=e.offset;const r=e.wereChangesApplied&&!e[ko("0xae")],o=r?0:e.data[ko("0x19")];if(r)n=t,n[ko("0xa8")]((t=>{t[ko("0x66")]=e[ko("0x55")],t[ko("0x36")]=!0,t._authorId=null})),this._applyOperationsSet(n,r);else{if(e[ko("0xae")]){const t=this[ko("0xc6")](e[ko("0xae")]);this[ko("0x2f")][ko("0x59")][ko("0x21")]=-t.length,t[ko("0xa8")]((n=>{n[ko("0x19")]-=t[ko("0x9a")],n[ko("0x66")]=e[ko("0x55")],n[ko("0x36")]=!0,n._authorId=null})),this[ko("0x3f")](t,!0),this[ko("0x90")][ko("0x21")]=-t.length+this[ko("0x3e")],this[ko("0x2d")](t)}this[ko("0x2f")][ko("0x59")][ko("0x21")]=o,n=this[ko("0x94")](e[ko("0x47")],e[ko("0x98")]),await this._fetchMissingUsers(n),this._applyOperationsSet(n,r)}e.lastOperationId&&(this[ko("0x4f")][ko("0x34")](n,e[ko("0x2e")]),this[ko("0x8b")]=e.lastOperationId),this[ko("0x90")][ko("0x21")]=o+this[ko("0x3e")],this[ko("0x2d")](n)}[ko("0x6e")](e,t){throw this._isPendingUpdate=!0,t&&console[ko("0x22")](t),new n.CKEditorError(e,this.editor)}_saveOperationInBuffer(e){this._knownOperations[ko("0x2c")](e)||(this._knownOperations[ko("0xbe")](e),this._bufferedOperations[ko("0x74")](e),this[ko("0xa")]||ko("0x35")==e[ko("0x10")]&&!e.affectsData||this[ko("0x3b")]())}[ko("0x2")](e=!1){!e&&this[ko("0x8d")]||(this[ko("0x8d")]=!0,clearTimeout(this[ko("0x8f")]),this[ko("0x8f")]=setTimeout((()=>{this[ko("0x5c")]()[ko("0x84")]((e=>{e&&(this._clearPendingAction(),this._isPendingUpdate=!1)}))[ko("0x27")]((e=>{if(this[ko("0x5b")](),this[ko("0x8d")]=!1,!((t=e)[ko("0x16")][ko("0x1d")](ko("0x4e"))||t[ko("0x16")][ko("0x1d")](ko("0x9c"))||t[ko("0x16")][ko("0x1d")](ko("0xc5"))))throw e;var t}))}),this[ko("0x71")]))}async[ko("0x5c")](){const e=this[ko("0x24")][ko("0x80")][ko("0xa2")](Z);if(this[ko("0xad")]()&&(e[ko("0x3")](),this[ko("0x1")]=!1),!this[ko("0x63")]())return!0;const t=[...this[ko("0x77")]];for(const e of t)e[ko("0x29")]=this[ko("0x2f")][ko("0x59")][ko("0x1c")](e);const n=this._operationIdentifier[ko("0xa0")](t),r=xo++,o=this[ko("0x45")](t),s=await this[ko("0x99")][ko("0x31")](o,o.baseVersion,n);try{return await this[ko("0x5d")](t,s,r)}catch(e){return this._crash(ko("0xbb"),e)}}async _handleServerResponse(e,t,n){if(ko("0x22")in t)throw t.error;let r=!1;if(t[ko("0xb7")]){t[ko("0x2e")]&&(this._lastSyncedOperationId=t.lastOperationId),this[ko("0x77")]=this._bufferedOperations[ko("0xb6")]((t=>!e[ko("0x96")](t)));for(const n of e)n[ko("0x66")]="lastOperationAcceptedAt"in t&&t.lastOperationAcceptedAt||void 0;this[ko("0x2d")](e),r=!0,this._currentBufferDelay=this._baseBufferDelay}else{const e=this._decompressOperations(t[ko("0x47")],t[ko("0x98")])[ko("0xb6")]((e=>e.baseVersion>=this[ko("0xb2")]));await this[ko("0x6f")](e),r=this[ko("0xa3")](e,t[ko("0x21")],t.lastOperationId),this[ko("0x71")]=Math[ko("0x13")](this._currentBufferDelay/2)}return r?!this[ko("0x63")]()||(this[ko("0x2")](!0),!1):this[ko("0x6e")](ko("0x54"))}[ko("0xa3")](e,t,n){try{const r={document:this[ko("0x2f")],useRelations:!1,padWithNoOps:!0},{operationsA:s,operationsB:i,originalOperations:a}=(0,o.transformSets)(e,this[ko("0x77")],r);Po(s,this[ko("0x2f")][ko("0x21")]),Po(i,t);for(const e of s){const t=a[ko("0xa2")](e);e[ko("0x75")]=t?t._authorId:null}n&&(this._operationIdentifier[ko("0x34")](e,n),this[ko("0x8b")]=n),this._bufferedOperations=[...i],this[ko("0x3f")](s),this[ko("0x2d")](e)}catch(e){return console.error(e),!1}return!0}[ko("0x3f")](e,t=!1){this[ko("0x24")].model[ko("0xd")]({isUndoable:!1,isLocal:!1},(t=>{for(const n of e)this[ko("0x7a")][ko("0xbe")](n),t[ko("0x81")].addOperation(n),this[ko("0x24")][ko("0x79")].applyOperation(n)}))}[ko("0x2d")](e){e[ko("0xa8")]((e=>{const t=e[ko("0x5f")]();t._authorId=e[ko("0x75")],t._isInit=!!e[ko("0x36")],t[ko("0x66")]=e.createdAt,t[ko("0x19")]+=this._offset,e[ko("0x32")]&&this[ko("0xb")][ko("0xbe")](t),this[ko("0x90")].addOperation(t)}))}[ko("0x20")](e){const t=this[ko("0x24")].plugins[ko("0xa2")](ko("0x60")),n=this[ko("0x24")][ko("0xab")];e||(e=X(n,ko("0x11"))),t[ko("0x5e")](e,{title:X(n,"Synchronization issue"),namespace:ko("0x23")}),this[ko("0xb9")]=!0,clearTimeout(this[ko("0x8f")]),this[ko("0x77")]=[],this[ko("0x24")][ko("0x80")][ko("0xa2")](d)[ko("0x49")]()}[ko("0x3b")](){this._pendingAction||(this[ko("0xa")]=this[ko("0x24")][ko("0x80")][ko("0xa2")](t.PendingActions)[ko("0xbe")](X(this.editor[ko("0xab")],ko("0x7b"))))}_clearPendingAction(){this[ko("0xa")]&&(this[ko("0x24")][ko("0x80")][ko("0xa2")](t.PendingActions)[ko("0x8")](this[ko("0xa")]),this[ko("0xa")]=null)}[ko("0x45")](e){const t=e[ko("0x4b")]((e=>e[ko("0xc7")]()));return this[ko("0x83")].compress(t)}[ko("0x94")](e,t){const n=new Set;return this._compressor.decompress(e)[ko("0x4b")](((e,r)=>{const s=ko("0x91")==t[r][ko("0x10")];if(s&&"InsertOperation"==e[ko("0x14")]){const t=e[ko("0x6c")][ko("0xbf")];if(!this._document.getRoot(t)){const e=new o.RootOperation(t,ko("0x70"),!0,this[ko("0x2f")],null);this[ko("0x2f")][ko("0x78")](t)[ko("0x33")]=!0,this._document[ko("0x43")][ko("0xc4")](e)}}const i=o.OperationFactory[ko("0x9")](e,this[ko("0x2f")]);if(ko("0x6b")==i.type)n.add(e[ko("0x1e")]);else if(ko("0xa9")==i[ko("0x10")]){const t=this[ko("0x2f")][ko("0x78")](e[ko("0x1e")]);t&&t[ko("0x97")]()&&!n[ko("0x2c")](e[ko("0x1e")])&&(t._isAttached=!1,this[ko("0x2f")].differ[ko("0xc4")](i[ko("0x30")]()))}return i[ko("0x29")]=e[ko("0x29")],i[ko("0x36")]=s,i[ko("0x75")]=s?null:t[r][ko("0xc1")],i[ko("0x32")]=ko("0xb4")===t[r][ko("0x10")],i[ko("0x66")]=t[r][ko("0x66")],i}))}[ko("0x61")](){this[ko("0x1")]=!0,this[ko("0xad")]()?this._sendBufferedOperationsDelayed():this[ko("0x1")]=!1}[ko("0xad")](){const e=this.editor[ko("0x80")][ko("0xa2")](Y)[ko("0x87")][ko("0xa2")](this._channelId);return!this[ko("0x24")].isReadOnly&&!!e&&e.length>1&&this[ko("0x1")]}[ko("0x63")](){return this[ko("0x77")][ko("0x9a")]>0||this[ko("0xad")]()}}Io[ko("0x65")]=s.CollaborativeEditingService;class So extends Error{}function Po(e,t){for(const n of e)n[ko("0x19")]=t++}class To{constructor(e){this[ko("0x4c")]=e,this._operationToId=new WeakMap}[ko("0xa0")](e){let t=e[ko("0x9a")];for(;t--;){const r=e[t];if(!this[ko("0x4c")][ko("0x2c")](r)){if(!this[ko("0x9b")][ko("0x2c")](r)){const e=(0,n.uid)().slice(1,18);this[ko("0x9b")][ko("0x6d")](r,e)}return this._operationToId[ko("0xa2")](r)}}}[ko("0x34")](e,t){if(!t)return;let n=e[ko("0x9a")];for(;n--;){const r=e[n];this[ko("0x4c")][ko("0x2c")](r)||this[ko("0x9b")][ko("0x6d")](r,t)}}}var Ao,Co,Eo=["RealTimeCollaborativeEditing"];Ao=Eo,Co=262,function(e){for(;--e;)Ao.push(Ao.shift())}(++Co);class jo extends t.Plugin{static get requires(){return[Io]}static get pluginName(){return function(e,t){return Eo[e-=0]}("0x0")}}const Do=["_terminateService","resolve","createdAt","_fetchMissingUsersForThreads","commentThreadRemoved","authorId","get","getCommentThread","CommentsService","permissions","removeCommentThread","context","cloudservicescommentsadapter-service-not-exist","404","getComment","unregister","getConnectedSessions","commentThreadReopened","collaboration.channelId","content","reopen","startsWith","register","commentUpdated","updateComment","CommentsRepository","Permissions","set","addUser","_getService","map","plugins","delete","cloudservicescommentsadapter-disconnect-not-exist","getUser","init","getCommentThreads","_services","update","updateCommentThread","config","listenTo","addToReconnectionStack","_setUpService","attributes","setPermissions","resolveCommentThread","comments","addComment","removeComment","keys","remove","off","message","commentId","resolvedBy","requires","sessionAdd:","commentAdded","disconnect","has","commentThreadId","add","catch","from","_connectService","destroy","assign","reconnect","addCommentThread","userId"];var Ro,Mo;Ro=Do,Mo=262,function(e){for(;--e;)Ro.push(Ro.shift())}(++Mo);const No=function(e,t){return Do[e-=0]};class Vo extends t.ContextPlugin{static get[No("0x7")](){return[d,No("0x2f"),Y,y]}constructor(e){super(e),this[No("0x3b")]=new Map}async[No("0x39")](){const e=this[No("0x21")],n=e.plugins[No("0x1c")](No("0x2f"));if(e[No("0x35")][No("0x1c")](d)[No("0x40")](this),n.adapter={addCommentThread:async({channelId:e,threadId:t,comments:n,resolvedAt:r,resolvedBy:o,context:s,attributes:i})=>{const a=await this._getService(e).addCommentThread({commentThreadId:t,comments:n[No("0x34")]((n=>{return o=e,{commentThreadId:t,commentId:(r=n)[No("0x5")],userId:r[No("0x1b")],content:r[No("0x29")],documentId:o,createdAt:r[No("0x18")],attributes:r[No("0x42")]||{}};var r,o})),resolvedAt:r,resolvedBy:o,context:s,attributes:i}).catch(Uo);return{threadId:a.commentThreadId,comments:a[No("0x45")]}},getCommentThread:async({channelId:e,threadId:t})=>{const n=await this._getService(e)[No("0x1d")](t).catch(Uo);return await this._fetchMissingUsersForThreads([n]),{threadId:n[No("0xc")],comments:n.comments[No("0x34")](Jo),context:n[No("0x21")],resolvedAt:n.resolvedAt,resolvedBy:n[No("0x6")],attributes:n[No("0x42")]||{}}},updateCommentThread:async({channelId:e,threadId:t,context:n,attributes:r})=>this[No("0x33")](e)[No("0x3d")]({commentThreadId:t,context:n,attributes:r})[No("0xe")](Bo).catch(Uo),resolveCommentThread:async({channelId:e,threadId:t})=>{const n=await this[No("0x33")](e)[No("0x44")](t).catch(Bo)[No("0xe")](Uo);return{threadId:n[No("0xc")],resolvedAt:n.resolvedAt,resolvedBy:n.resolvedBy}},reopenCommentThread:async({channelId:e,threadId:t})=>this[No("0x33")](e).reopenCommentThread(t).catch(Bo)[No("0xe")](Uo),removeCommentThread:({channelId:e,threadId:t})=>this[No("0x33")](e)[No("0x20")](t)[No("0xe")](Bo).catch(Uo),addComment:({channelId:e,threadId:t,commentId:n,content:r,attributes:o})=>this._getService(e)[No("0x46")](t,n,r,o)[No("0xe")](Uo),updateComment:({channelId:e,threadId:t,commentId:n,content:r,attributes:o})=>this[No("0x33")](e)[No("0x2e")](t,n,r,o)[No("0xe")](Bo).catch(Uo),removeComment:({channelId:e,threadId:t,commentId:n})=>this[No("0x33")](e)[No("0x0")](t,n).catch(Bo)[No("0xe")](Uo)},e instanceof t.Context){const t=e.config.get("collaboration.channelId"),n=e.plugins[No("0x1c")](Y);await this[No("0x41")](t);const r=await this[No("0x3b")].get(t).getConnectedSessions();this[No("0x3f")](n,No("0x8")+t,((e,{session:r})=>{r.id===n.mySessionId&&(e[No("0x3")](),this[No("0x21")][No("0x35")][No("0x1c")](No("0x30"))[No("0x43")](r[No("0x1f")],t))})),n.register(t,r)}}async _setUpService(e){if(this[No("0x3b")][No("0xb")](e))throw new n.CKEditorError("cloudservicescommentsadapter-connect-already-connected",null,{channelId:e});const t=this[No("0x21")].plugins.get(No("0x2f")),r=new Vo.CommentsService(e);this[No("0x3b")][No("0x31")](e,r),this[No("0x3f")](r,"commentThreadAdded",((e,n)=>{const{commentThreadId:r,documentId:o,context:s,attributes:i,resolvedAt:a,resolvedBy:c,comments:u}=n;t[No("0x1d")](r)||t.addCommentThread({threadId:r,channelId:o,comments:u?u.map(Jo):[],context:s,attributes:i,resolvedAt:a,resolvedBy:c,isFromAdapter:!0})})),this[No("0x3f")](r,"commentThreadUpdated",((e,{commentThreadId:n,documentId:r,context:o,attributes:s})=>{t[No("0x1d")](n)&&t.updateCommentThread({threadId:n,channelId:r,context:o,attributes:s,isFromAdapter:!0})})),this[No("0x3f")](r,"commentThreadResolved",((e,{commentThreadId:n,resolvedBy:r,resolvedAt:o})=>{const s=t[No("0x1d")](n);s&&s[No("0x17")]({resolvedBy:r,resolvedAt:o,isFromAdapter:!0})})),this.listenTo(r,No("0x27"),((e,{commentThreadId:n})=>{const r=t.getCommentThread(n);r&&r[No("0x2a")]({isFromAdapter:!0})})),this[No("0x3f")](r,No("0x1a"),((e,{commentThreadId:n})=>{const r=t.getCommentThread(n);r&&r[No("0x2")]({isFromAdapter:!0})})),this[No("0x3f")](r,No("0x9"),((e,n)=>{const r=n.commentThreadId,o=t[No("0x1d")](r);o&&o[No("0x46")]({...Jo(n),isFromAdapter:!0})})),this[No("0x3f")](r,No("0x2d"),((e,{commentThreadId:n,commentId:r,content:o,attributes:s})=>{const i=t[No("0x1d")](n);if(i){const e=i.getComment(r);e&&e[No("0x3c")]({content:o,attributes:s,isFromAdapter:!0})}})),this[No("0x3f")](r,"commentRemoved",((e,{commentThreadId:n,commentId:r})=>{const o=t.getCommentThread(n);if(o){const e=o[No("0x24")](r);e&&e[No("0x2")]({isFromAdapter:!0})}})),await this[No("0x10")](e)}[No("0x11")](){if(this[No("0x21")]instanceof t.Context){const e=this[No("0x21")].config[No("0x1c")](No("0x28"));this._terminateService(e)}}[No("0x16")](e){if(!this[No("0x3b")][No("0xb")](e))throw new n.CKEditorError(No("0x37"),null,{channelId:e});this._getService(e)[No("0xa")](),this._services[No("0x36")](e)}async[No("0x13")](){for(const e of this[No("0x3b")][No("0x1")]())await this[No("0x10")](e);if(this[No("0x21")]instanceof t.Context){const e=this[No("0x21")][No("0x3e")].get(No("0x28")),t=this[No("0x21")][No("0x35")].get(Y);t[No("0x25")](e);const n=await this._services[No("0x1c")](e)[No("0x26")]();t[No("0x2c")](e,n)}}async[No("0x10")](e){const{connection:t}=this[No("0x21")][No("0x35")][No("0x1c")](d),n=this[No("0x21")][No("0x35")][No("0x1c")](No("0x2f")),r=this[No("0x3b")][No("0x1c")](e),o=await r.connect(t);await this[No("0x19")](o);const s=new Set(Array[No("0xf")](n[No("0x3a")]({channelId:e}),(e=>e.id)));for(const e of o)s.delete(e[No("0xc")]);for(const e of s)n[No("0x1d")](e)[No("0x2")]({isFromAdapter:!0});for(const t of o){let r=n[No("0x1d")](t.commentThreadId);const{commentThreadId:o,context:s,attributes:i,resolvedBy:a,resolvedAt:c,deletedAt:u}=t;r||(r=n[No("0x14")]({channelId:e,threadId:o,context:s,attributes:i||{},resolvedBy:a,resolvedAt:c,deletedAt:u,isFromAdapter:!0}));const d=new Set(Array[No("0xf")](r[No("0x45")],(e=>e.id)));for(const e of t[No("0x45")])d[No("0x36")](e.commentId);for(const e of d)r[No("0x24")](e)[No("0x2")]({isFromAdapter:!0});for(const e of t[No("0x45")]){const t=r[No("0x24")](e.commentId);t?t[No("0x29")]!==e[No("0x29")]&&t[No("0x3c")]({content:e[No("0x29")],isFromAdapter:!0}):r[No("0x46")](Object[No("0x12")](Jo(e),{isFromAdapter:!0}))}}}[No("0x33")](e){if(!this[No("0x3b")][No("0xb")](e))throw new n.CKEditorError(No("0x22"),null,{channelId:e});return this[No("0x3b")][No("0x1c")](e)}async[No("0x19")](e){const t=this[No("0x21")][No("0x35")][No("0x1c")](y),{connection:n}=this[No("0x21")][No("0x35")][No("0x1c")](d),r=new Set;for(const{resolvedBy:n,comments:o}of e){n&&!t.getUser(n)&&r[No("0xd")](n);for(const{userId:e}of o)t[No("0x38")](e)||r.add(e)}if(0===r.size)return;const o=await vo.User.getMany(n,Array[No("0xf")](r));for(const e of o)t.getUser(e.id)||t[No("0x32")](e)}}async function Bo(e){if(No("0x23")!==e.code)throw e}function Uo(e){if((t=e)[No("0x4")][No("0x2b")]("cloud-services-internal-error: Comments Service is not connected.")||t[No("0x4")][No("0x2b")]("cloud-services-internal-error: Not connected.")||t[No("0x4")][No("0x2b")]("cloud-services-internal-error: Request timeout."))return new Promise((()=>{}));var t;throw e}function Jo(e){return{threadId:e[No("0xc")],commentId:e[No("0x5")],content:e[No("0x29")],createdAt:e[No("0x18")],authorId:e[No("0x15")],attributes:e.attributes||{}}}Vo[No("0x1e")]=s.CommentsService;const qo=["connect","cloud-services-internal-error: Not connected.","open","get","data","size","add","startsWith","then","_trackChangesService","getSuggestion","editor","values","find","plugins","listenTo","TrackChangesService","message","originalSuggestionId","TrackChangesEditing","reconnect","collaboration.channelId","catch","state","_bufferedRequests","isConnected","suggestionUpdated","cloud-services-internal-error: Request timeout.","attributes","_waitForServiceReady","connected","hasSuggestion","config","getUser","adapter","connection","from","update","_fetchMissingUsersForThreads","getMany","delete","type"];var Lo,Go;Lo=qo,Go=460,function(e){for(;--e;)Lo.push(Lo.shift())}(++Go);const Yo=function(e,t){return qo[e-=0]};class Fo extends t.Plugin{static get requires(){return[Vo,Yo("0x15"),d]}constructor(e){super(e);const t=this.editor[Yo("0x22")].get(Yo("0x17"));this[Yo("0x1a")]=new Map,this[Yo("0xb")]=new(Fo[Yo("0x12")])(t)}init(){const e=this[Yo("0xd")][Yo("0x10")][Yo("0x5")](d),t=this[Yo("0xd")][Yo("0x10")].get(Yo("0x15"));return t[Yo("0x24")]={getSuggestion:async e=>{await this[Yo("0x1f")]();const t=await this[Yo("0xb")][Yo("0x5")](e).catch(zo);return await this._fetchMissingUsersForThreads([t]),t},addSuggestion:async({id:e,type:t,data:n,originalSuggestionId:r,attributes:o})=>{await this[Yo("0x1f")]();const s={id:e,type:t,data:n,originalSuggestionId:r,attributes:o},i=await this[Yo("0xb")][Yo("0x8")](e,t,n,r,o).catch((t=>{if(Ko(t))return new Promise((t=>{this[Yo("0x1a")].set(e,{resolve:t,suggestionData:s})}));throw t}));return this._bufferedRequests[Yo("0x0")](e),i},updateSuggestion:async(e,t)=>{if(await this[Yo("0x1f")](),Yo("0x4")!==t[Yo("0x19")])return this[Yo("0xb")][Yo("0x27")](e,t)[Yo("0x18")](zo)}},this[Yo("0x11")](this._trackChangesService,Yo("0x1c"),((e,n)=>{t[Yo("0x21")](n.id)&&(t[Yo("0xc")](n.id)[Yo("0x1e")]=n[Yo("0x1e")])})),this[Yo("0xb")][Yo("0x2")](e[Yo("0x25")])[Yo("0xa")]((n=>(e.addToReconnectionStack(this),this._fetchMissingUsersForThreads(n)[Yo("0xa")]((()=>{for(const e of n)t.addSuggestionData(e)._saved=!0})))))}async[Yo("0x16")](){const e=this.editor[Yo("0x10")][Yo("0x5")](Yo("0x15")),{connection:t}=this[Yo("0xd")].plugins.get(d),n=await this[Yo("0xb")][Yo("0x2")](t);await this[Yo("0x28")](n);for(const{suggestionData:e,resolve:t}of this[Yo("0x1a")][Yo("0xe")]()){let r=n[Yo("0xf")]((t=>t.id===e.id));r||(r=await this[Yo("0xb")][Yo("0x8")](e.id,e[Yo("0x1")],e[Yo("0x6")],e[Yo("0x14")])),t(r)}for(const t of n)e[Yo("0x21")](t.id)||e.addSuggestionData(t)}async[Yo("0x1f")](){this[Yo("0xb")][Yo("0x1b")]||await new Promise((e=>{this.listenTo(this._trackChangesService,Yo("0x20"),(t=>{t.off(),e()}))}))}async[Yo("0x28")](e){const t=this.editor.plugins[Yo("0x5")](y),{connection:n}=this[Yo("0xd")][Yo("0x10")][Yo("0x5")](d),r=new Set;for(const{authorId:n}of e)t[Yo("0x23")](n)||r[Yo("0x8")](n);if(0===r[Yo("0x7")])return;const o=await vo.User[Yo("0x29")](n,Array[Yo("0x26")](r));for(const e of o)t.getUser(e.id)||t.addUser(e)}}function zo(e){if(Ko(e))return new Promise((()=>{}));throw e}function Ko(e){return e.message[Yo("0x9")](Yo("0x3"))||e[Yo("0x13")][Yo("0x9")](Yo("0x1d"))}Fo[Yo("0x12")]=s.TrackChangesService;const Ho=["change:state","switchReadOnly","requires","destroy","data","CommentsEditing","config","connected","pluginName","listenTo","RealTimeCollaborativeComments","isThreadsLoadingPaused","CommentsRepository","_setUpService","get","ready","once","plugins","collaboration.channelId","editor"];var Wo,$o;Wo=Ho,$o=200,function(e){for(;--e;)Wo.push(Wo.shift())}(++$o);const Zo=function(e,t){return Ho[e-=0]};class Qo extends t.Plugin{static get[Zo("0x2")](){return["Comments",Vo,jo,d]}static get[Zo("0x8")](){return Zo("0xa")}init(){const e=this.editor[Zo("0x11")].get(d),t=this[Zo("0x13")][Zo("0x11")][Zo("0xe")](Zo("0x5")),n=this[Zo("0x13")].plugins.get(Vo);return this.editor[Zo("0x4")][Zo("0x10")](Zo("0xf"),(()=>{this[Zo("0x9")](e,Zo("0x0"),((e,n,r)=>{t[Zo("0xb")]=Zo("0x7")!==r}))})),this[Zo("0x9")](e,Zo("0x0"),((e,t,n)=>{this[Zo("0x13")].plugins.get(Zo("0xc"))[Zo("0x1")](Zo("0x7")!==n)})),n[Zo("0xd")](this[Zo("0x13")].config.get(Zo("0x12")))}[Zo("0x3")](){this[Zo("0x13")][Zo("0x11")][Zo("0xe")](Vo)._terminateService(this[Zo("0x13")][Zo("0x6")][Zo("0xe")](Zo("0x12"))),super[Zo("0x3")]()}}var Xo,es,ts=["TrackChanges","pluginName","RealTimeCollaborativeTrackChanges"];Xo=ts,es=117,function(e){for(;--e;)Xo.push(Xo.shift())}(++es);var ns=function(e,t){return ts[e-=0]};class rs extends t.Plugin{static get requires(){return[Qo,Fo,ns("0x0")]}static get[ns("0x1")](){return ns("0x2")}}const os=["length","_preventResendingRevisionData","_bufferUpdate","isEmptyCurrent","repository","createdAt","_fetchMissingUsers","400","authors","_lastRequestId","isBundleUploaded","getMany","toVersion","cloud-services-internal-error: Request timeout.","_handleRevisionsUpdate","_getLatestVersion","reconnect","_startingVersion","cloud-services-internal-error: Not connected.","wrongRequestId","serverHistory","RevisionHistoryService","keys","_getLatestVersionFromServerOperations","_waitForServiceReady","_revisionHistoryService","change:_isConnected","_bufferedUpdates","then","destroy","cloud-services-internal-error: Revision History Service is not connected.","_revisions","reverse","size","authorsIds","plugins","setRevisionData","baseVersion","from","getUser","_isConnected","listenTo","connect","_isPendingUpdate","buildRevisionData","_revisionTracker","bind","addRevisionData","_createCurrentRevision","startsWith","editor","getRevision","getRevisions","code","_update","off","max","requires","RevisionTracker","collaboration.channelId","data","_revisionDataBuilder","message","getOperations","isConnected","_fixRevision","creatorId","marker","get","sessionId","has","addUser","_oldOffset","catch","config","currentRevision","connection","isEnabled","updateRevisions","revisionsUpdated","CONNECTED","change:_isPendingUpdate","reInit","map","once","fromVersion"];var ss,is;ss=os,is=111,function(e){for(;--e;)ss.push(ss.shift())}(++is);const as=function(e,t){return os[e-=0]};class cs extends t.Plugin{static get[as("0x20")](){return[d,Io,as("0x21"),Y,y]}constructor(e){super(e);const t=this[as("0x19")].config[as("0x2b")](as("0x22"));this._lastRequestId=null,this[as("0x14")]=this[as("0x19")][as("0xa")].get(as("0x21")),this[as("0x0")]=new cs.RevisionHistoryService(t)}async init(){const e=this[as("0x19")][as("0xa")][as("0x2b")](Io),t=e[as("0x51")],r=this[as("0x19")].plugins.get(d);this[as("0x14")].setSource({history:t,getLatestVersion:()=>this[as("0x4c")](),getCurrentRevisionId:()=>e[as("0x2c")]});const o=this[as("0x19")][as("0x31")][as("0x2b")]("cloudServices.bundleVersion")||n.version,i=await s.EditorService[as("0x47")](r[as("0x33")],o);this[as("0x14")].adapter={getRevision:async({revisionId:e})=>(await this[as("0x55")](),await this[as("0x0")][as("0x1a")](e)),updateRevisions:async e=>{await this[as("0x55")]();const t=this[as("0x14")][as("0x32")];if(i&&1===e[as("0x3d")]&&e[0].id===t.id)return e;for(const n of e)n.id===t.id&&(n[as("0x40")]=n[as("0x3c")]===n.toVersion);return this[as("0x0")][as("0x35")](e,this[as("0x46")]).then((t=>(this[as("0x46")]=t,e)))[as("0x30")]((t=>{if(us(t)||as("0x44")===t[as("0x1c")]&&void 0!==t[as("0x23")][as("0x50")]){for(const t of e)!this[as("0x14")][as("0x41")][as("0x1a")](t.id)||this[as("0x14")][as("0x3f")](t.id,t,!1);if(us(t))throw t;return e}throw t}))}},this[as("0x10")](this[as("0x0")],as("0x36"),((e,{revisionsData:t,requestId:n})=>{Math[as("0x1f")](...t[as("0x3a")]((e=>e[as("0x49")])))>this[as("0x54")]()-1?this._getLatestVersion()[as("0x3")]((()=>{this[as("0x4b")](t,n)})):this[as("0x4b")](t,n)}));const{revisions:a,requestId:c}=await this._revisionHistoryService[as("0x11")](r[as("0x33")]);r.addToReconnectionStack(this),this[as("0x46")]=c,await this[as("0x43")](a);for(const e of a)this[as("0x14")][as("0x16")](e);this.listenTo(e,as("0x1"),((t,n,r)=>{r&&(this._oldOffset=e._offset,t[as("0x1e")]())})),this[as("0x14")][as("0x15")](as("0x34")).to(r,"state",(e=>e===s.WEB_SOCKET_GATEWAY_STATES[as("0x37")]))}async reconnect(){const e=this[as("0x19")][as("0xa")][as("0x2b")](d),t=this[as("0x19")][as("0xa")][as("0x2b")](Io),n=async()=>{const n=this._revisionTracker.currentRevision,r=n.id,o=r!==t[as("0x2c")];if(o){const e=t._offset-this[as("0x2f")],o=this._getLatestVersionFromServerOperations();if(this[as("0x14")][as("0x24")][as("0x39")](),n.toVersion+e!==o){const t=n[as("0x3c")]+e,r=this[as("0x19")][as("0xa")].get(y),s=this[as("0x14")][as("0x13")]({revision:n,from:t,to:o});s.id=n.id;const i=s.authorsIds[as("0x3a")]((e=>r.getUser(e)));n._update({...s,authors:i},!0),this[as("0x14")][as("0x3f")](n.id,s,!0)}this[as("0x14")][as("0x4e")]=o,n[as("0x49")]===n[as("0x3c")]&&!this._revisionTracker[as("0x2")][as("0x2d")](r)&&this[as("0x14")][as("0x41")][as("0x6")].remove(r),this[as("0x14")][as("0x17")](o)}const{revisions:s,requestId:i}=await this[as("0x0")][as("0x4d")](e[as("0x33")],this[as("0x46")]);o&&s[as("0x3d")]>0?t._handleReconnectionError():(await this[as("0x43")](s),this[as("0x4b")](s,i),this._revisionTracker.sendBufferedUpdates())};return t[as("0xf")]?n():new Promise(((e,r)=>{t.once(as("0x1"),(()=>{n().then(e)[as("0x30")](r)}))}))}[as("0x4")](){super[as("0x4")]()}async[as("0x55")](){this[as("0x0")][as("0x27")]||await new Promise((e=>{this[as("0x10")](this[as("0x0")],"connected",(t=>{t.off(),e()}))}))}[as("0x54")](){const e=this[as("0x19")][as("0xa")].get(Io).serverHistory[as("0x26")]()[as("0x7")]();for(const t of e)if(as("0x2a")!==t.type||t.affectsData)return t[as("0xc")]+1}[as("0x4c")](){const e=this[as("0x19")][as("0xa")][as("0x2b")](Io);return new Promise((t=>{e[as("0x12")]?e[as("0x3b")](as("0x38"),(()=>{t(this[as("0x54")]())})):t(this[as("0x54")]())}))}_handleRevisionsUpdate(e,t){const n=this[as("0x14")][as("0x41")];this._lastRequestId=t;for(const t of e){const e=n[as("0x1a")](t.id);if(e){if((t[as("0x3c")]||t.toVersion)&&(t.diffData=null),e===this[as("0x14")][as("0x32")]){const n=Math[as("0x1f")](e[as("0x49")],t.toVersion),r=Math.max(e[as("0x3c")],t[as("0x3c")]);let o;e[as("0x49")]===t[as("0x49")]&&e[as("0x3c")]===t[as("0x3c")]?(o=!0,this._preventResendingRevisionData(t)):t[as("0x49")]===n&&t.fromVersion===r?o=!1:(e[as("0x49")]===n&&e[as("0x3c")]===r||this[as("0x28")]({revision:e,from:r,to:n}),o=!0),o&&(delete t[as("0x3c")],delete t[as("0x49")],delete t.diffData,delete t[as("0x42")],delete t[as("0x9")])}this[as("0x14")][as("0xb")](t),this[as("0x3e")](t)}else this._revisionTracker.addRevisionData(t)}const r=n[as("0x1b")]();r[as("0x7")]();for(let e=0;e<r.length-1;e++){const t=r[e],n=r[e+1];if(t[as("0x3c")]<n[as("0x49")]){const e=n[as("0x49")],r=Math.max(e,t.toVersion);this._fixRevision({revision:t,from:e,to:r})}}}_fixRevision({revision:e,from:t,to:n}={}){const r=this[as("0x19")][as("0xa")].get(y),o=this._revisionTracker[as("0x13")]({revision:e,from:t,to:n});o[as("0x45")]=o[as("0x9")][as("0x3a")]((e=>r.getUser(e))),e[as("0x1d")](o)}[as("0x3e")](e){const t={};t.id=e.id;for(const n of Object[as("0x53")](e))"id"!==n&&(t[n]=void 0);this._revisionTracker._bufferUpdate(t.id,t,!0)}async[as("0x43")](e){const t=this[as("0x19")][as("0xa")][as("0x2b")](y),{connection:n}=this[as("0x19")][as("0xa")][as("0x2b")](d),r=new Set;for(const t of e){for(const e of t[as("0x9")])s(e);t[as("0x29")]&&s(t[as("0x29")])}if(0===r[as("0x8")])return;const o=await vo.User[as("0x48")](n,Array[as("0xd")](r));for(const e of o)t[as("0xe")](e.id)||t[as("0x2e")](e);function s(e){t[as("0xe")](e)||r.add(e)}}}function us(e){return e.message[as("0x18")](as("0x5"))||e[as("0x25")][as("0x18")](as("0x4f"))||e.message[as("0x18")](as("0x4a"))}cs[as("0x52")]=s.RevisionHistoryService;var ds,ls,ps=["requires","pluginName","RealTimeCollaborativeRevisionHistory"];ds=ps,ls=485,function(e){for(;--e;)ds.push(ds.shift())}(++ls);var hs=function(e,t){return ps[e-=0]};class fs extends t.Plugin{static get[hs("0x1")](){return["RevisionHistory",cs,jo]}static get[hs("0x2")](){return hs("0x0")}}var ms=Function.prototype,gs=Object.prototype,ys=ms.toString,bs=gs.hasOwnProperty,vs=ys.call(Object);const Os=function(e){if(!Ut(e)||"[object Object]"!=Fe(e))return!1;var t=Un(e);if(null===t)return!0;var n=bs.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ys.call(n)==vs};const ws=function(e){return Ut(e)&&1===e.nodeType&&!Os(e)},_s=["ck-presence-list__counter--hidden","isHidden","setTemplate","set","usersCount","div","ck-presence-list__counter"];var ks,xs;ks=_s,xs=162,function(e){for(;--e;)ks.push(ks.shift())}(++xs);const Is=function(e,t){return _s[e-=0]};class Ss extends r.View{constructor(e){super(e);const t=this.bindTemplate;this[Is("0x2")](Is("0x3"),0),this.set("isHidden",!0),this[Is("0x1")]({tag:Is("0x4"),attributes:{class:["ck",Is("0x5"),t.if(Is("0x0"),Is("0x6"))]},children:[{text:t.to(Is("0x3"),(t=>X(e,"CONNECTED_USERS",t)))}]})}}const Ps=["fire","setTemplate","items","execute","bindTemplate","ck-presence-list__list","div"];var Ts,As;Ts=Ps,As=295,function(e){for(;--e;)Ts.push(Ts.shift())}(++As);const Cs=function(e,t){return Ps[e-=0]};class Es extends r.View{constructor(e){super(e),this[Cs("0x1")]=this.createCollection();const t=this[Cs("0x3")];this[Cs("0x0")]({tag:Cs("0x5"),attributes:{class:["ck",Cs("0x4")]},children:this.items,on:{click:t.to((()=>this[Cs("0x6")](Cs("0x2"))))}})}}var js=__webpack_require__(3286),Ds={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};f()(js.Z,Ds);js.Z.locals;const Rs=["first","bindTemplate","ck-reset","items","counterView","isCollapsed","tooltipPosition","setTemplate","change","ck-presence-list","ck-presence-list--collapsed","inlineListView"];var Ms,Ns;Ms=Rs,Ns=257,function(e){for(;--e;)Ms.push(Ms.shift())}(++Ns);const Vs=function(e,t){return Rs[e-=0]};class Bs extends r.View{constructor(e){super(e);const t=this[Vs("0x8")];this.set(Vs("0x0"),!0),this.counterView=new Ss(this.locale),this.inlineListView=new Es(e),this.listenTo(this[Vs("0x6")][Vs("0xa")],Vs("0x3"),(()=>{for(const e of this[Vs("0x6")][Vs("0xa")])e[Vs("0x1")]="s";this[Vs("0x6")][Vs("0xa")][Vs("0x7")]&&(this[Vs("0x6")][Vs("0xa")][Vs("0x7")][Vs("0x1")]="se")})),this[Vs("0x2")]({tag:"div",attributes:{class:["ck",Vs("0x4"),Vs("0x9"),"ck-rounded-corners",t.if(Vs("0x0"),Vs("0x5"))]},children:[this[Vs("0xb")],this.inlineListView]})}}var Us,Js,qs=["setTemplate","ck-presence-list__dropdown-list-wrapper","items","createCollection","div"];Us=qs,Js=155,function(e){for(;--e;)Us.push(Us.shift())}(++Js);var Ls=function(e,t){return qs[e-=0]};class Gs extends r.View{constructor(e){super(e),this.items=this[Ls("0x3")](),this[Ls("0x0")]({tag:Ls("0x4"),attributes:{class:["ck","ck-presence-list__dropdown-list"]},children:[{tag:Ls("0x4"),attributes:{class:["ck",Ls("0x1")]},children:this[Ls("0x2")]}]})}}const Ys=["ck-user__full-name","bindTemplate","getBackgroundColorClass","setTemplate","execute","name","div","span","fire","button","true","tag","color","userView","ck-presence-list__marker"];var Fs,zs;Fs=Ys,zs=384,function(e){for(;--e;)Fs.push(Fs.shift())}(++zs);const Ks=function(e,t){return Ys[e-=0]};class Hs extends r.View{constructor(e,t,n){super(e);const r=this[Ks("0x7")];this[Ks("0x4")]=new k(e,t);const o={tag:Ks("0xc"),attributes:{class:["ck","ck-presence-list__dropdown-list-item"]},children:[this[Ks("0x4")],{tag:Ks("0xd"),attributes:{class:["ck",Ks("0x6")]},children:[{text:t[Ks("0xb")]}]},{tag:Ks("0xd"),attributes:{class:["ck",Ks("0x5"),t[Ks("0x3")][Ks("0x8")]()],"aria-hidden":Ks("0x1")}}]};n&&(o[Ks("0x2")]=Ks("0x0"),o.on={click:r.to((()=>this[Ks("0xe")](Ks("0xa"))))}),this[Ks("0x9")](o)}}const Ws=["ck-presence-list__list-item__tooltip","execute","div","ck-presence-list__list-item","userView","button","tag","color","hasTooltip","setTemplate","name","fire","getBackgroundColorClass","true","tooltipPosition","span","bindTemplate"];var $s,Zs;$s=Ws,Zs=426,function(e){for(;--e;)$s.push($s.shift())}(++Zs);const Qs=function(e,t){return Ws[e-=0]};class Xs extends r.View{constructor(e,t,n){super(e);const r=this[Qs("0xf")];this.set(Qs("0x7"),!0),this.set(Qs("0xd"),""),this[Qs("0x3")]=new k(e,t),this.markerView=new ei(e,t);const o={tag:Qs("0x1"),attributes:{class:["ck",Qs("0x2")],"data-cke-tooltip-text":this.userView[Qs("0x9")],"data-cke-tooltip-position":r.to(Qs("0xd")),"data-cke-tooltip-disabled":r.to(Qs("0x7"),(e=>!e)),"data-cke-tooltip-class":Qs("0x10")},children:[this.userView,this.markerView]};n&&(o[Qs("0x5")]=Qs("0x4"),o.on={click:r.to((()=>this[Qs("0xa")](Qs("0x0"))))}),this[Qs("0x8")](o)}}class ei extends r.View{constructor(e,t){super(e),this[Qs("0x8")]({tag:Qs("0xe"),attributes:{class:["ck","ck-presence-list__marker",t[Qs("0x6")][Qs("0xb")]()],"aria-hidden":Qs("0xc")}})}}const ti=["onClick","isRendered","remove","reverse","showDropdown","bind","inlineListView","usersCount","bodyCollection","detachFromDom","isCollapsed","bindTo","presencelist-collapseat-invalid-format","context","locale","plugins","allConnectedUsers","presencelist-missing-container","_allConnectedUsers","appendChild","items","get","pin","_createView","_handleUserRemove","presenceDropdownView","element","presenceList.collapseAt","listenTo","hideDropdown","execute","attachToDom","add","balloonPanelView","render","requires","content","using","config","view","number","presenceList.container","length","_handleUserAdd","isVisible","set","lastConnectedUsers","define","destroy"];var ni,ri;ni=ti,ri=258,function(e){for(;--e;)ni.push(ni.shift())}(++ri);const oi=function(e,t){return ti[e-=0]};class si extends t.ContextPlugin{constructor(e){super(e),this[oi("0x0")][oi("0x19")][oi("0x22")]("presenceList",{collapseAt:6});const t=e.config[oi("0x8")](oi("0xe"));if(oi("0x1b")!=typeof t)throw new n.CKEditorError("presencelist-collapseat-invalid-format",this);if(t<1)throw new n.CKEditorError(oi("0x30"),this);this._allConnectedUsers=this[oi("0x0")][oi("0x2")].get(Y)[oi("0x3")],this[oi("0x20")](oi("0x2b"),0),this[oi("0x21")]=new n.Collection,this[oi("0x14")]=new r.BalloonPanelView,this[oi("0x14")].class="ck ck-presence-list__balloon",this[oi("0x1a")]=this._createView(),this[oi("0xc")]=void 0}static get[oi("0x16")](){return[Y]}init(){for(const e of this[oi("0x5")])this[oi("0x1e")](e);this[oi("0xf")](this[oi("0x5")],oi("0x13"),((e,t)=>{this[oi("0x1e")](t)})),this[oi("0xf")](this._allConnectedUsers,oi("0x26"),((e,t)=>{this[oi("0xb")](t)}))}[oi("0xa")](){const e=this.context,t=new Bs(this[oi("0x0")].locale),o=this[oi("0x14")];if(!ws(e[oi("0x19")][oi("0x8")](oi("0x1c"))))throw new n.CKEditorError(oi("0x4"),this);return t.counterView.bind(oi("0x2b")).to(this),t.bind(oi("0x2e")).to(this,oi("0x2b"),(n=>{const r=n>=e[oi("0x19")][oi("0x8")](oi("0xe"));return t.counterView.isHidden=!(1==n||r),r||this[oi("0x10")](),r})),t.inlineListView[oi("0x7")].bindTo(this.lastConnectedUsers)[oi("0x18")]((n=>{const r=e.config[oi("0x8")]("presenceList"),o=new Xs(e.locale,n,!!r[oi("0x24")]);return o[oi("0x29")]("hasTooltip").to(t,oi("0x2e"),(e=>!e)),r[oi("0x24")]&&this[oi("0xf")](o,"execute",(()=>{this[oi("0x1a")][oi("0x2e")]||r[oi("0x24")](n,o.element)})),o})),this[oi("0xf")](t.inlineListView,oi("0x11"),(()=>{this.presenceDropdownView?this.hideDropdown():this[oi("0x1a")][oi("0x2e")]&&this[oi("0x28")]()})),t[oi("0x15")](),o[oi("0x15")](),(0,r.clickOutsideHandler)({emitter:t,activator:()=>o[oi("0x1f")],contextElements:[o[oi("0xd")],t.inlineListView[oi("0xd")]],callback:()=>this[oi("0x10")]()}),e.config[oi("0x8")]("presenceList.container")[oi("0x6")](t[oi("0xd")]),this.bodyCollection=new r.BodyCollection(this[oi("0x0")].locale),this.bodyCollection[oi("0x12")](),this.bodyCollection[oi("0x13")](o),t}[oi("0x1e")](e){this[oi("0x2b")]++,5==this.lastConnectedUsers.length&&this.lastConnectedUsers.remove(0),this.lastConnectedUsers[oi("0x13")](e)}[oi("0xb")](e){if(this[oi("0x2b")]--,this[oi("0x21")][oi("0x8")](e.id)&&(this[oi("0x21")][oi("0x26")](e.id),this.lastConnectedUsers[oi("0x1d")]<this[oi("0x2b")]))for(const e of Array.from(this._allConnectedUsers)[oi("0x27")]())if(!this.lastConnectedUsers[oi("0x8")](e.id))return void this[oi("0x21")][oi("0x13")](e,0)}showDropdown(){if(this[oi("0xc")])return;this[oi("0xc")]=new Gs(this[oi("0x0")].locale);const e=this[oi("0x0")][oi("0x19")][oi("0x8")]("presenceList");this.presenceDropdownView[oi("0x7")][oi("0x2f")](this[oi("0x5")])[oi("0x18")]((t=>{const n=new Hs(this[oi("0x0")][oi("0x1")],t,!!e[oi("0x24")]);return e[oi("0x24")]&&this[oi("0xf")](n,oi("0x11"),(()=>{e[oi("0x24")](t,n[oi("0xd")])})),n})),this[oi("0x14")].content[oi("0x13")](this.presenceDropdownView),this[oi("0x14")][oi("0x9")]({target:this[oi("0x1a")][oi("0x2a")][oi("0xd")]})}[oi("0x10")](){this[oi("0xc")]&&(this[oi("0x14")].unpin(),this[oi("0x14")][oi("0x17")][oi("0x26")](this[oi("0xc")]),this[oi("0xc")][oi("0x23")](),this.presenceDropdownView=void 0)}[oi("0x23")](){super.destroy(),this[oi("0x1a")]&&this.view[oi("0x25")]&&this[oi("0x1a")][oi("0x23")](),this.bodyCollection&&this[oi("0x2c")][oi("0x2d")]()}}var ii,ai,ci=["requires","pluginName"];ii=ci,ai=413,function(e){for(;--e;)ii.push(ii.shift())}(++ai);var ui=function(e,t){return ci[e-=0]};class di extends t.ContextPlugin{static get[ui("0x1")](){return[Y,si]}static get[ui("0x0")](){return"PresenceList"}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;(0,n.ObservableMixin)();(0,n.EmitterMixin)()})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();