@ckeditor/ckeditor5-real-time-collaboration 46.0.1 → 46.0.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +1 -1
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +14 -14
- package/src/common-translations.js +1 -1
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
- package/src/realtimecollaborativetrackchanges.js +1 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
/*!
|
|
3
3
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
4
|
* For licensing, see LICENSE.md.
|
|
5
|
-
*/(()=>{var __webpack_modules__={6:(t,e,n)=>{"use strict";t.exports=l;var r,s=n(737),o=s.LongBits,i=s.base64,a=s.utf8;function c(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}function d(){}function u(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function l(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return s.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(t,e,n){e[n]=255&t}function f(t,e){this.len=t,this.next=void 0,this.val=e}function m(t,e,n){for(;t.hi;)e[n++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=127&t.lo|128,t.lo=t.lo>>>7;e[n++]=t.lo}function y(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}l.create=p(),l.alloc=function(t){return new s.Array(t)},s.Array!==Array&&(l.alloc=s.pool(l.alloc,s.Array.prototype.subarray)),l.prototype._push=function(t,e,n){return this.tail=this.tail.next=new c(t,e,n),this.len+=e,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(t,e,n){for(;t>127;)e[n++]=127&t|128,t>>>=7;e[n]=t},l.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new f((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},l.prototype.int32=function(t){return t<0?this._push(m,10,o.fromNumber(t)):this.uint32(t)},l.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},l.prototype.uint64=function(t){var e=o.from(t);return this._push(m,e.length(),e)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(t){var e=o.from(t).zzEncode();return this._push(m,e.length(),e)},l.prototype.bool=function(t){return this._push(h,1,t?1:0)},l.prototype.fixed32=function(t){return this._push(y,4,t>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(t){var e=o.from(t);return this._push(y,4,e.lo)._push(y,4,e.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(t){return this._push(s.float.writeFloatLE,4,t)},l.prototype.double=function(t){return this._push(s.float.writeDoubleLE,8,t)};var g=s.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var r=0;r<t.length;++r)e[n+r]=t[r]};l.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(h,1,0);if(s.isString(t)){var n=l.alloc(e=i.length(t));i.decode(t,n,0),t=n}return this.uint32(e)._push(g,e,t)},l.prototype.string=function(t){var e=a.length(t);return e?this.uint32(e)._push(a.write,e,t):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 t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this},l.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e},l._configure=function(t){r=t,l.create=p(),r._configure()}},106:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(168),s=n.n(r),o=n(433),i=n.n(o)()(s());i.push([t.id,'.ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:calc(var(--ck-z-dialog) + 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:inline-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;flex-direction:row;justify-content:flex-end;position:relative}.ck.ck-presence-list__list:after{background:transparent;bottom:-15px;content:"";height:15px;left:0;position:absolute;width:100%}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:1px solid transparent;color:inherit;font:inherit;margin-left:var(--ck-spacing-medium);outline:none;padding:0;position:relative}.ck.ck-presence-list__list-item:focus{border:var(--ck-focus-ring);border-radius:0;box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck-rounded-corners .ck.ck-presence-list__list-item:focus,.ck.ck-presence-list__list-item.ck-rounded-corners:focus{border-radius:var(--ck-border-radius)}.ck.ck-presence-list__list-item .ck-label{height:0;overflow:hidden;width:0}.ck.ck-presence-list__list-item:first-child{margin-left:0}.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:5px;position:relative;width:100%}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}.ck.ck-presence-list--collapsed .ck-presence-list__list{border:1px solid transparent;min-width:calc(var(--ck-user-avatar-size)*2);padding-left:1px}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck-presence-list__list:focus{border:var(--ck-focus-ring);border-radius:0;box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck-rounded-corners .ck.ck-presence-list--collapsed .ck-presence-list__list:focus,.ck.ck-presence-list--collapsed .ck-presence-list__list.ck-rounded-corners:focus{border-radius:var(--ck-border-radius)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{border:0;margin-left:calc(var(--ck-user-avatar-size)*-.35);padding:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:first-child{margin-left:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:last-child{order:unset}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item .ck-user{--ck-presence-list-avatar-border-color:var(--ck-color-base-foreground);border:2px solid var(--ck-presence-list-avatar-border-color);margin-left:0;margin-right:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item.ck-presence-list__users-counter{margin-left:0;margin-right:0}.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}@media (prefers-reduced-motion:reduce){.ck.ck-presence-list__balloon{animation:none}}.ck.ck-presence-list__balloon ul{background-color:var(--ck-color-presence-list-dropdown-background)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper.ck-presence-list__dropdown-list-wrapper_scrollable{max-height:80vh;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:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:focus{box-shadow:var(--ck-focus-outer-shadow),0 0;outline:var(--ck-focus-ring);outline-offset:-1px;position:relative;z-index:1}.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.ck-presence-list__users-counter{--ck-presence-list-counter-border-color:var(--ck-user-avatar-background);--ck-presence-list-counter-background-color:var(--ck-user-avatar-color);align-items:center;background-color:var(--ck-presence-list-counter-background-color);border:2px solid var(--ck-presence-list-counter-border-color);border-radius:50%;box-sizing:border-box;display:flex;height:calc(var(--ck-user-avatar-size) - 4px);justify-content:center;line-height:100%;margin:4px 2px 2px;position:relative;width:calc(var(--ck-user-avatar-size) - 4px)}.ck.ck-presence-list__users-counter__text{--ck-presence-list-counter-text-color:var(--ck-user-avatar-background);color:var(--ck-presence-list-counter-text-color);cursor:default;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}',""]);const a=i},130:(t,e,n)=>{"use strict";t.exports=s;var r=n(737);function s(t,e){this.lo=t>>>0,this.hi=e>>>0}var o=s.zero=new s(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var i=s.zeroHash="\0\0\0\0\0\0\0\0";s.fromNumber=function(t){if(0===t)return o;var e=t<0;e&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return e&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new s(n,r)},s.from=function(t){if("number"==typeof t)return s.fromNumber(t);if(r.isString(t)){if(!r.Long)return s.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new s(t.low>>>0,t.high>>>0):o},s.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+4294967296*n)}return this.lo+4294967296*this.hi},s.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var a=String.prototype.charCodeAt;s.fromHash=function(t){return t===i?o:new s((a.call(t,0)|a.call(t,1)<<8|a.call(t,2)<<16|a.call(t,3)<<24)>>>0,(a.call(t,4)|a.call(t,5)<<8|a.call(t,6)<<16|a.call(t,7)<<24)>>>0)},s.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)},s.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},s.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},s.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},156:t=>{"use strict";t.exports={}},168:t=>{"use strict";t.exports=function(t){return t[1]}},178:(t,e,n)=>{"use strict";e.Service=n(418)},199:(t,e,n)=>{"use strict";t.exports=n(995)},211:(t,e,n)=>{t.exports=n(312)("./src/collaboration-core.js")},230: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(t){}return null}module.exports=inquire},237:t=>{"use strict";t.exports=CKEditor5.dll},262:t=>{"use strict";var e={};t.exports=function(t,n){var r=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(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},310:t=>{"use strict";t.exports=function(t,e){var n=new Array(arguments.length-1),r=0,s=2,o=!0;for(;s<arguments.length;)n[r++]=arguments[s++];return new Promise(function(s,i){n[r]=function(t){if(o)if(o=!1,t)i(t);else{for(var e=new Array(arguments.length-1),n=0;n<e.length;)e[n++]=arguments[n];s.apply(null,e)}};try{t.apply(e||null,n)}catch(t){o&&(o=!1,i(t))}})}},311:(t,e,n)=>{t.exports=n(237)("./src/ui.js")},312:t=>{"use strict";t.exports=CKEditor5.collaborationDll},319:t=>{"use strict";t.exports=function(t,e,n){var r=n||8192,s=r>>>1,o=null,i=r;return function(n){if(n<1||n>s)return t(n);i+n>r&&(o=t(r),i=0);var a=e.call(o,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},357:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},365:t=>{"use strict";function e(t){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),r=128===n[3];function s(t,r,s){e[0]=t,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3]}function o(t,r,s){e[0]=t,r[s]=n[3],r[s+1]=n[2],r[s+2]=n[1],r[s+3]=n[0]}function i(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],e[0]}function a(t,r){return n[3]=t[r],n[2]=t[r+1],n[1]=t[r+2],n[0]=t[r+3],e[0]}t.writeFloatLE=r?s:o,t.writeFloatBE=r?o:s,t.readFloatLE=r?i:a,t.readFloatBE=r?a:i}():function(){function e(t,e,n,r){var s=e<0?1:0;if(s&&(e=-e),0===e)t(1/e>0?0:2147483648,n,r);else if(isNaN(e))t(2143289344,n,r);else if(e>34028234663852886e22)t((s<<31|2139095040)>>>0,n,r);else if(e<11754943508222875e-54)t((s<<31|Math.round(e/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(e)/Math.LN2);t((s<<31|o+127<<23|8388607&Math.round(e*Math.pow(2,-o)*8388608))>>>0,n,r)}}function i(t,e,n){var r=t(e,n),s=2*(r>>31)+1,o=r>>>23&255,i=8388607&r;return 255===o?i?NaN:s*(1/0):0===o?1401298464324817e-60*s*i:s*Math.pow(2,o-150)*(i+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,r),t.readFloatLE=i.bind(null,s),t.readFloatBE=i.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),r=128===n[7];function s(t,r,s){e[0]=t,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3],r[s+4]=n[4],r[s+5]=n[5],r[s+6]=n[6],r[s+7]=n[7]}function o(t,r,s){e[0]=t,r[s]=n[7],r[s+1]=n[6],r[s+2]=n[5],r[s+3]=n[4],r[s+4]=n[3],r[s+5]=n[2],r[s+6]=n[1],r[s+7]=n[0]}function i(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],n[4]=t[r+4],n[5]=t[r+5],n[6]=t[r+6],n[7]=t[r+7],e[0]}function a(t,r){return n[7]=t[r],n[6]=t[r+1],n[5]=t[r+2],n[4]=t[r+3],n[3]=t[r+4],n[2]=t[r+5],n[1]=t[r+6],n[0]=t[r+7],e[0]}t.writeDoubleLE=r?s:o,t.writeDoubleBE=r?o:s,t.readDoubleLE=r?i:a,t.readDoubleBE=r?a:i}():function(){function e(t,e,n,r,s,o){var i=r<0?1:0;if(i&&(r=-r),0===r)t(0,s,o+e),t(1/r>0?0:2147483648,s,o+n);else if(isNaN(r))t(0,s,o+e),t(2146959360,s,o+n);else if(r>17976931348623157e292)t(0,s,o+e),t((i<<31|2146435072)>>>0,s,o+n);else{var a;if(r<22250738585072014e-324)t((a=r/5e-324)>>>0,s,o+e),t((i<<31|a/4294967296)>>>0,s,o+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),t(4503599627370496*(a=r*Math.pow(2,-c))>>>0,s,o+e),t((i<<31|c+1023<<20|1048576*a&1048575)>>>0,s,o+n)}}}function i(t,e,n,r,s){var o=t(r,s+e),i=t(r,s+n),a=2*(i>>31)+1,c=i>>>20&2047,d=4294967296*(1048575&i)+o;return 2047===c?d?NaN:a*(1/0):0===c?5e-324*a*d:a*Math.pow(2,c-1075)*(d+4503599627370496)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,r,4,0),t.readDoubleLE=i.bind(null,s,0,4),t.readDoubleBE=i.bind(null,o,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function r(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function s(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function o(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},366:(t,e,n)=>{"use strict";t.exports=c;var r,s=n(737),o=s.LongBits,i=s.utf8;function a(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function c(t){this.buf=t,this.pos=0,this.len=t.length}var d,u="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new c(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new c(t);throw Error("illegal buffer")},l=function(){return s.Buffer?function(t){return(c.create=function(t){return s.Buffer.isBuffer(t)?new r(t):u(t)})(t)}:u};function p(){var t=new o(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function h(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=s.Array.prototype.subarray||s.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 t=this.uint32();return t>>>1^-(1&t)},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 t=s.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=s.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},c.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw a(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(e,n);if(e===n){var r=s.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,e,n)},c.prototype.string=function(){var t=this.bytes();return i.read(t,0,t.length)},c.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},c._configure=function(t){r=t,c.create=l(),r._configure();var e=s.Long?"toLong":"toNumber";s.merge(c.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return f.call(this)[e](!0)},sfixed64:function(){return f.call(this)[e](!1)}})}},418:(t,e,n)=>{"use strict";t.exports=s;var r=n(737);function s(t,e,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(n)}(s.prototype=Object.create(r.EventEmitter.prototype)).constructor=s,s.prototype.rpcCall=function t(e,n,s,o,i){if(!o)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(t,a,e,n,s,o);if(a.rpcImpl)try{return a.rpcImpl(e,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(t,n){if(t)return a.emit("error",t,e),i(t);if(null!==n){if(!(n instanceof s))try{n=s[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return a.emit("error",t,e),i(t)}return a.emit("data",n,e),i(null,n)}a.end(!0)})}catch(t){return a.emit("error",t,e),void setTimeout(function(){i(t)},0)}else setTimeout(function(){i(Error("already ended"))},0)},s.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},433:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,r,s,o){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var d=0;d<t.length;d++){var u=[].concat(t[d]);r&&i[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),e.push(u))}},e}},535:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(168),s=n.n(r),o=n(433),i=n.n(o)()(s());i.push([t.id,".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-user__marker-tooltip{color:#fff;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}@media (prefers-reduced-motion:reduce){.ck .ck-user__marker-tooltip{transition:none}}.ck .ck-user__marker-line{bottom:0;height:100%;position:absolute;width:0}.ck .ck-user__marker{cursor:default;display:inline;position:relative}.ck .ck-user__marker.ck-user__marker_hovered .ck-user__marker-dot{width:0}.ck .ck-user__marker.ck-user__marker_hovered .ck-user__marker-tooltip{animation:fadeInLeft .3s ease-in-out;display:block;opacity:1}.ck .ck-placeholder .ck-user__marker{display:none}@media (prefers-reduced-motion:reduce){.ck .ck-user__marker,.ck .ck-user__marker *,.ck .ck-user__marker:after{animation:none!important}}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const a=i},545:t=>{"use strict";var e,n=(e=[],function(t,n){return e[t]=n,e.filter(Boolean).join("\n")});function r(t,e,r,s){var o;if(r)o="";else{o="",s.supports&&(o+="@supports (".concat(s.supports,") {")),s.media&&(o+="@media ".concat(s.media," {"));var i=void 0!==s.layer;i&&(o+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),o+=s.css,i&&(o+="}"),s.media&&(o+="}"),s.supports&&(o+="}")}if(t.styleSheet)t.styleSheet.cssText=n(e,o);else{var a=document.createTextNode(o),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(a,c[e]):t.appendChild(a)}}var s={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=s.singletonCounter++,n=s.singleton||(s.singleton=t.insertStyleElement(t));return{update:function(t){r(n,e,!1,t)},remove:function(t){r(n,e,!0,t)}}}},553:(t,e)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function s(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var r,o,i=[];for(o in"string"!=typeof e&&(e="?"),t)if(n.call(t,o)){if((r=t[o])||null!=r&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;i.push(o+"="+r)}return i.length?e+i.join("&"):""},e.parse=function(t){for(var e,n=/([^=?#&]+)=?([^&]*)/g,s={};e=n.exec(t);){var o=r(e[1]),i=r(e[2]);null===o||null===i||o in s||(s[o]=i)}return s}},584:(t,e,n)=>{t.exports=n(237)("./src/utils.js")},623:(t,e,n)=>{"use strict";t.exports=o;var r=n(6);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(){r.call(this)}function i(t,e,n){t.length<40?s.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}o._configure=function(){o.alloc=s._Buffer_allocUnsafe,o.writeBytesBuffer=s.Buffer&&s.Buffer.prototype instanceof Uint8Array&&"set"===s.Buffer.prototype.set.name?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var r=0;r<t.length;)e[n++]=t[r++]}},o.prototype.bytes=function(t){s.isString(t)&&(t=s._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(o.writeBytesBuffer,e,t),this},o.prototype.string=function(t){var e=s.Buffer.byteLength(t);return this.uint32(e),e&&this._push(i,e,t),this},o._configure()},662:(t,e)=>{"use strict";var n=e;n.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&"="===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var r=new Array(64),s=new Array(123),o=0;o<64;)s[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(t,e,n){for(var s,o=null,i=[],a=0,c=0;e<n;){var d=t[e++];switch(c){case 0:i[a++]=r[d>>2],s=(3&d)<<4,c=1;break;case 1:i[a++]=r[s|d>>4],s=(15&d)<<2,c=2;break;case 2:i[a++]=r[s|d>>6],i[a++]=r[63&d],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0)}return c&&(i[a++]=r[s],i[a++]=61,1===c&&(i[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))};var i="invalid encoding";n.decode=function(t,e,n){for(var r,o=n,a=0,c=0;c<t.length;){var d=t.charCodeAt(c++);if(61===d&&a>1)break;if(void 0===(d=s[d]))throw Error(i);switch(a){case 0:r=d,a=1;break;case 1:e[n++]=r<<2|(48&d)>>4,r=d,a=2;break;case 2:e[n++]=(15&r)<<4|(60&d)>>2,r=d,a=3;break;case 3:e[n++]=(3&r)<<6|d,a=0}}if(1===a)throw Error(i);return n-o},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},667:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}},673:t=>{"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var o={},i=[],a=0;a<t.length;a++){var c=t[a],d=r.base?c[0]+r.base:c[0],u=o[d]||0,l="".concat(d," ").concat(u);o[d]=u+1;var p=n(l),h={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)e[p].references++,e[p].updater(h);else{var f=s(h,r);r.byIndex=a,e.splice(a,0,{identifier:l,updater:f,references:1})}i.push(l)}return i}function s(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,s){var o=r(t=t||[],s=s||{});return function(t){t=t||[];for(var i=0;i<o.length;i++){var a=n(o[i]);e[a].references--}for(var c=r(t,s),d=0;d<o.length;d++){var u=n(o[d]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}o=c}}},696:t=>{"use strict";t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},707:t=>{"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],r=0;r<n.length;)n[r].fn===e?n.splice(r,1):++r;return this},e.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<e.length;)e[r].fn.apply(e[r++].ctx,n)}return this}},737:function(t,e,n){"use strict";var r=e;function s(t,e,n){for(var r=Object.keys(e),s=0;s<r.length;++s)void 0!==t[r[s]]&&n||(t[r[s]]=e[r[s]]);return t}function o(t){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&s(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}r.asPromise=n(310),r.base64=n(662),r.EventEmitter=n(707),r.float=n(365),r.inquire=n(230),r.utf8=n(742),r.pool=n(319),r.LongBits=n(130),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(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},r.isString=function(t){return"string"==typeof t||t instanceof String},r.isObject=function(t){return t&&"object"==typeof t},r.isset=r.isSet=function(t,e){var n=t[e];return!(null==n||!t.hasOwnProperty(e))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var t=r.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t){return"number"==typeof t?r.Buffer?r._Buffer_allocUnsafe(t):new r.Array(t):r.Buffer?r._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},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(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,e){var n=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))},r.merge=s,r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;n>-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},r.oneOfSetter=function(t){return function(e){for(var n=0;n<t.length;++n)t[n]!==e&&delete this[t[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var t=r.Buffer;t?(r._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,n){return new t(e,n)},r._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},742:(t,e)=>{"use strict";var n=e;n.length=function(t){for(var e=0,n=0,r=0;r<t.length;++r)(n=t.charCodeAt(r))<128?e+=1:n<2048?e+=2:55296==(64512&n)&&56320==(64512&t.charCodeAt(r+1))?(++r,e+=4):e+=3;return e},n.read=function(t,e,n){if(n-e<1)return"";for(var r,s=null,o=[],i=0;e<n;)(r=t[e++])<128?o[i++]=r:r>191&&r<224?o[i++]=(31&r)<<6|63&t[e++]:r>239&&r<365?(r=((7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,o[i++]=55296+(r>>10),o[i++]=56320+(1023&r)):o[i++]=(15&r)<<12|(63&t[e++])<<6|63&t[e++],i>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),i=0);return s?(i&&s.push(String.fromCharCode.apply(String,o.slice(0,i))),s.join("")):String.fromCharCode.apply(String,o.slice(0,i))},n.write=function(t,e,n){for(var r,s,o=n,i=0;i<t.length;++i)(r=t.charCodeAt(i))<128?e[n++]=r:r<2048?(e[n++]=r>>6|192,e[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(s=t.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&s),++i,e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128);return n-o}},782:(t,e,n)=>{t.exports=n(237)("./src/core.js")},783:(t,e,n)=>{t.exports=n(237)("./src/engine.js")},835:(t,e,n)=>{"use strict";var r=n(696),s=n(553),o=/^[\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(t){return(t||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(t,e){return m(e.protocol)?t.replace(/\\/g,"/"):t},["/","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(t){var e,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},s={},o=typeof(t=t||r);if("blob:"===t.protocol)s=new g(unescape(t.pathname),{});else if("string"===o)for(e in s=new g(t,{}),h)delete s[e];else if("object"===o){for(e in t)e in h||(s[e]=t[e]);void 0===s.slashes&&(s.slashes=a.test(t.href))}return s}function m(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function y(t,e){t=(t=l(t)).replace(i,""),e=e||{};var n,r=d.exec(t),s=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],c=0;return o?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:"===s?c>=2&&(n=n.slice(2)):m(s)?n=r[4]:s?o&&(n=n.slice(2)):c>=2&&m(e.protocol)&&(n=r[4]),{protocol:s,slashes:o||m(s),slashesCount:c,rest:n}}function g(t,e,n){if(t=(t=l(t)).replace(i,""),!(this instanceof g))return new g(t,e,n);var o,a,c,d,h,b,O=p.slice(),w=typeof e,v=this,I=0;for("object"!==w&&"string"!==w&&(n=e,e=null),n&&"function"!=typeof n&&(n=s.parse),o=!(a=y(t||"",e=f(e))).protocol&&!a.slashes,v.slashes=a.slashes||o&&e.slashes,v.protocol=a.protocol||e.protocol||"",t=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(v.protocol)))&&(O[3]=[/(.*)/,"pathname"]);I<O.length;I++)"function"!=typeof(d=O[I])?(c=d[0],b=d[1],c!=c?v[b]=t:"string"==typeof c?~(h="@"===c?t.lastIndexOf(c):t.indexOf(c))&&("number"==typeof d[2]?(v[b]=t.slice(0,h),t=t.slice(h+d[2])):(v[b]=t.slice(h),t=t.slice(0,h))):(h=c.exec(t))&&(v[b]=h[1],t=t.slice(0,h.index)),v[b]=v[b]||o&&d[3]&&e[b]||"",d[4]&&(v[b]=v[b].toLowerCase())):t=d(t,v);n&&(v.query=n(v.query)),o&&e.slashes&&"/"!==v.pathname.charAt(0)&&(""!==v.pathname||""!==e.pathname)&&(v.pathname=function(t,e){if(""===t)return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),r=n.length,s=n[r-1],o=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(o=!0),n.splice(r,1),i--);return o&&n.unshift(""),"."!==s&&".."!==s||n.push(""),n.join("/")}(v.pathname,e.pathname)),"/"!==v.pathname.charAt(0)&&m(v.protocol)&&(v.pathname="/"+v.pathname),r(v.port,v.protocol)||(v.host=v.hostname,v.port=""),v.username=v.password="",v.auth&&(~(h=v.auth.indexOf(":"))?(v.username=v.auth.slice(0,h),v.username=encodeURIComponent(decodeURIComponent(v.username)),v.password=v.auth.slice(h+1),v.password=encodeURIComponent(decodeURIComponent(v.password))):v.username=encodeURIComponent(decodeURIComponent(v.auth)),v.auth=v.password?v.username+":"+v.password:v.username),v.origin="file:"!==v.protocol&&m(v.protocol)&&v.host?v.protocol+"//"+v.host:"null",v.href=v.toString()}g.prototype={set:function(t,e,n){var o=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(n||s.parse)(e)),o[t]=e;break;case"port":o[t]=e,r(e,o.protocol)?e&&(o.host=o.hostname+":"+e):(o.host=o.hostname,o[t]="");break;case"hostname":o[t]=e,o.port&&(e+=":"+o.port),o.host=e;break;case"host":o[t]=e,c.test(e)?(e=e.split(":"),o.port=e.pop(),o.hostname=e.join(":")):(o.hostname=e,o.port="");break;case"protocol":o.protocol=e.toLowerCase(),o.slashes=!n;break;case"pathname":case"hash":if(e){var i="pathname"===t?"/":"#";o[t]=e.charAt(0)!==i?i+e:e}else o[t]=e;break;case"username":case"password":o[t]=encodeURIComponent(e);break;case"auth":var a=e.indexOf(":");~a?(o.username=e.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=e.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(e))}for(var d=0;d<p.length;d++){var u=p[d];u[4]&&(o[u[1]]=o[u[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&m(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(t){t&&"function"==typeof t||(t=s.stringify);var e,n=this,r=n.host,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(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,(e="object"==typeof n.query?t(n.query):n.query)&&(i+="?"!==e.charAt(0)?"?"+e:e),n.hash&&(i+=n.hash),i}},g.extractProtocol=y,g.location=f,g.trimLeft=l,g.qs=s,t.exports=g},895:(t,e,n)=>{"use strict";t.exports=o;var r=n(366);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(t){r.call(this,t)}o._configure=function(){s.Buffer&&(o.prototype._slice=s.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o._configure()},995:(t,e,n)=>{"use strict";var r=e;function s(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(6),r.BufferWriter=n(623),r.Reader=n(366),r.BufferReader=n(895),r.util=n(737),r.rpc=n(178),r.roots=n(156),r.configure=s,s()}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={id:t,exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>Es,CloudServicesRevisionHistoryAdapter:()=>Xs,CloudServicesTrackChangesAdapter:()=>Bs,PresenceList:()=>Go,PresenceListUI:()=>Bo,RealTimeCollaborationClient:()=>ws,RealTimeCollaborativeComments:()=>Ls,RealTimeCollaborativeEditing:()=>Ts,RealTimeCollaborativeRevisionHistory:()=>ro,RealTimeCollaborativeTrackChanges:()=>Ks,Sessions:()=>Zn,WebSocketGateway:()=>Hn});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{Decoder:()=>Dt,Encoder:()=>jt,PacketType:()=>Ct,protocol:()=>_t});var e=__webpack_require__(782),n=__webpack_require__(584),r=__webpack_require__(311),s=__webpack_require__(783);class o{static DESCRIPTOR_NAME;static DESCRIPTOR;constructor(...t){}}class i extends o{static TYPE="1000";static READABLE_TYPE_NAME;constructor(...t){super()}static fromJSON(t){throw new TypeError("Must be implemented in a child class!")}}class a extends i{id;static TYPE="21";static READABLE_TYPE_NAME="getUser";static DESCRIPTOR_NAME="GetUserMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1}}};constructor(t){super(),this.id=t}toJSON(){return{id:this.id}}static fromJSON(t){return new a(t.id)}}class c extends i{attributes;static DESCRIPTOR_NAME="GetUserResponse";static DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};constructor(t){super(),this.attributes=t}toJSON(){return{attributes:Object.keys(this.attributes).map(t=>({key:t,value:JSON.stringify(this.attributes[t])}))}}static fromJSON(t){const e=t.attributes.reduce((t,e)=>(t[e.key]=e.value?JSON.parse(e.value):null,t),{});return new c(e)}}var d=__webpack_require__(199);const u=(()=>{var t=d.Reader,e=d.Writer,n=d.util,r=d.roots.default||(d.roots.default={});return r.OperationMetadataDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.userId="",s.prototype.type="",s.prototype.createdAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.userId&&Object.hasOwnProperty.call(t,"userId")&&n.uint32(10).string(t.userId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(18).string(t.type),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(26).string(t.createdAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.OperationMetadataDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.userId=e.string();break;case 2:i.type=e.string();break;case 3:i.createdAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.userId&&t.hasOwnProperty("userId")&&!n.isString(t.userId)?"userId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null},s.fromObject=function(t){if(t instanceof r.OperationMetadataDescriptor)return t;var e=new r.OperationMetadataDescriptor;return null!=t.userId&&(e.userId=String(t.userId)),null!=t.type&&(e.type=String(t.type)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.userId="",n.type="",n.createdAt=""),null!=t.userId&&t.hasOwnProperty("userId")&&(n.userId=t.userId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/OperationMetadataDescriptor"},s}(),r.CollaborativeEditingConnectMessage=function(){function s(t){if(this.buffers=[],this.types=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.lastOperationId="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.bundleVersion&&Object.hasOwnProperty.call(t,"bundleVersion")&&n.uint32(18).string(t.bundleVersion),null!=t.buffers&&t.buffers.length)for(var r=0;r<t.buffers.length;++r)n.uint32(26).bytes(t.buffers[r]);if(null!=t.types&&t.types.length){for(n.uint32(34).fork(),r=0;r<t.types.length;++r)n.uint32(t.types[r]);n.ldelim()}return null!=t.lastOperationId&&Object.hasOwnProperty.call(t,"lastOperationId")&&n.uint32(42).string(t.lastOperationId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.bundleVersion=e.string();break;case 3:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(e.bytes());break;case 4:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=e.uint32()+e.pos;e.pos<c;)i.types.push(e.uint32());else i.types.push(e.uint32());break;case 5:i.lastOperationId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id))return"id: string expected";if(null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&!n.isString(t.bundleVersion))return"bundleVersion: string expected";if(null!=t.buffers&&t.hasOwnProperty("buffers")){if(!Array.isArray(t.buffers))return"buffers: array expected";for(var e=0;e<t.buffers.length;++e)if(!(t.buffers[e]&&"number"==typeof t.buffers[e].length||n.isString(t.buffers[e])))return"buffers: buffer[] expected"}if(null!=t.types&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(e=0;e<t.types.length;++e)if(!n.isInteger(t.types[e]))return"types: integer[] expected"}return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&!n.isString(t.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingConnectMessage)return t;var e=new r.CollaborativeEditingConnectMessage;if(null!=t.id&&(e.id=String(t.id)),null!=t.bundleVersion&&(e.bundleVersion=String(t.bundleVersion)),t.buffers){if(!Array.isArray(t.buffers))throw TypeError(".CollaborativeEditingConnectMessage.buffers: array expected");e.buffers=[];for(var s=0;s<t.buffers.length;++s)"string"==typeof t.buffers[s]?n.base64.decode(t.buffers[s],e.buffers[s]=n.newBuffer(n.base64.length(t.buffers[s])),0):t.buffers[s].length>=0&&(e.buffers[s]=t.buffers[s])}if(t.types){if(!Array.isArray(t.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");for(e.types=[],s=0;s<t.types.length;++s)e.types[s]=t.types[s]>>>0}return null!=t.lastOperationId&&(e.lastOperationId=String(t.lastOperationId)),e},s.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.buffers=[],r.types=[]),e.defaults&&(r.id="",r.bundleVersion="",r.lastOperationId=""),null!=t.id&&t.hasOwnProperty("id")&&(r.id=t.id),null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&(r.bundleVersion=t.bundleVersion),t.buffers&&t.buffers.length){r.buffers=[];for(var s=0;s<t.buffers.length;++s)r.buffers[s]=e.bytes===String?n.base64.encode(t.buffers[s],0,t.buffers[s].length):e.bytes===Array?Array.prototype.slice.call(t.buffers[s]):t.buffers[s]}if(t.types&&t.types.length)for(r.types=[],s=0;s<t.types.length;++s)r.types[s]=t.types[s];return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&(r.lastOperationId=t.lastOperationId),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingConnectMessage"},s}(),r.CollaborativeEditingReconnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.lastKnowVersion=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.bundleVersion&&Object.hasOwnProperty.call(t,"bundleVersion")&&n.uint32(18).string(t.bundleVersion),null!=t.lastKnowVersion&&Object.hasOwnProperty.call(t,"lastKnowVersion")&&n.uint32(24).uint32(t.lastKnowVersion),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingReconnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.bundleVersion=e.string();break;case 3:i.lastKnowVersion=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&!n.isString(t.bundleVersion)?"bundleVersion: string expected":null!=t.lastKnowVersion&&t.hasOwnProperty("lastKnowVersion")&&!n.isInteger(t.lastKnowVersion)?"lastKnowVersion: integer expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingReconnectMessage)return t;var e=new r.CollaborativeEditingReconnectMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.bundleVersion&&(e.bundleVersion=String(t.bundleVersion)),null!=t.lastKnowVersion&&(e.lastKnowVersion=t.lastKnowVersion>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.bundleVersion="",n.lastKnowVersion=0),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&(n.bundleVersion=t.bundleVersion),null!=t.lastKnowVersion&&t.hasOwnProperty("lastKnowVersion")&&(n.lastKnowVersion=t.lastKnowVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingReconnectMessage"},s}(),r.CollaborativeEditingUpdateMessage=function(){function s(t){if(this.buffers=[],this.types=[],this.metadata=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.baseVersion=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.lastOperationId="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.baseVersion&&Object.hasOwnProperty.call(t,"baseVersion")&&n.uint32(16).uint32(t.baseVersion),null!=t.buffers&&t.buffers.length)for(var s=0;s<t.buffers.length;++s)n.uint32(26).bytes(t.buffers[s]);if(null!=t.types&&t.types.length){for(n.uint32(34).fork(),s=0;s<t.types.length;++s)n.uint32(t.types[s]);n.ldelim()}if(null!=t.metadata&&t.metadata.length)for(s=0;s<t.metadata.length;++s)r.OperationMetadataDescriptor.encode(t.metadata[s],n.uint32(50).fork()).ldelim();return null!=t.lastOperationId&&Object.hasOwnProperty.call(t,"lastOperationId")&&n.uint32(58).string(t.lastOperationId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingUpdateMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.baseVersion=e.uint32();break;case 3:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(e.bytes());break;case 4:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=e.uint32()+e.pos;e.pos<c;)i.types.push(e.uint32());else i.types.push(e.uint32());break;case 6:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:i.lastOperationId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id))return"id: string expected";if(null!=t.baseVersion&&t.hasOwnProperty("baseVersion")&&!n.isInteger(t.baseVersion))return"baseVersion: integer expected";if(null!=t.buffers&&t.hasOwnProperty("buffers")){if(!Array.isArray(t.buffers))return"buffers: array expected";for(var e=0;e<t.buffers.length;++e)if(!(t.buffers[e]&&"number"==typeof t.buffers[e].length||n.isString(t.buffers[e])))return"buffers: buffer[] expected"}if(null!=t.types&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(e=0;e<t.types.length;++e)if(!n.isInteger(t.types[e]))return"types: integer[] expected"}if(null!=t.metadata&&t.hasOwnProperty("metadata")){if(!Array.isArray(t.metadata))return"metadata: array expected";for(e=0;e<t.metadata.length;++e){var s=r.OperationMetadataDescriptor.verify(t.metadata[e]);if(s)return"metadata."+s}}return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&!n.isString(t.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingUpdateMessage)return t;var e=new r.CollaborativeEditingUpdateMessage;if(null!=t.id&&(e.id=String(t.id)),null!=t.baseVersion&&(e.baseVersion=t.baseVersion>>>0),t.buffers){if(!Array.isArray(t.buffers))throw TypeError(".CollaborativeEditingUpdateMessage.buffers: array expected");e.buffers=[];for(var s=0;s<t.buffers.length;++s)"string"==typeof t.buffers[s]?n.base64.decode(t.buffers[s],e.buffers[s]=n.newBuffer(n.base64.length(t.buffers[s])),0):t.buffers[s].length>=0&&(e.buffers[s]=t.buffers[s])}if(t.types){if(!Array.isArray(t.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");for(e.types=[],s=0;s<t.types.length;++s)e.types[s]=t.types[s]>>>0}if(t.metadata){if(!Array.isArray(t.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");for(e.metadata=[],s=0;s<t.metadata.length;++s){if("object"!=typeof t.metadata[s])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");e.metadata[s]=r.OperationMetadataDescriptor.fromObject(t.metadata[s])}}return null!=t.lastOperationId&&(e.lastOperationId=String(t.lastOperationId)),e},s.toObject=function(t,e){e||(e={});var s={};if((e.arrays||e.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),e.defaults&&(s.id="",s.baseVersion=0,s.lastOperationId=""),null!=t.id&&t.hasOwnProperty("id")&&(s.id=t.id),null!=t.baseVersion&&t.hasOwnProperty("baseVersion")&&(s.baseVersion=t.baseVersion),t.buffers&&t.buffers.length){s.buffers=[];for(var o=0;o<t.buffers.length;++o)s.buffers[o]=e.bytes===String?n.base64.encode(t.buffers[o],0,t.buffers[o].length):e.bytes===Array?Array.prototype.slice.call(t.buffers[o]):t.buffers[o]}if(t.types&&t.types.length)for(s.types=[],o=0;o<t.types.length;++o)s.types[o]=t.types[o];if(t.metadata&&t.metadata.length)for(s.metadata=[],o=0;o<t.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(t.metadata[o],e);return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&(s.lastOperationId=t.lastOperationId),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingUpdateMessage"},s}(),r.GetDocumentDetailsMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.prototype.environmentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.environmentId&&Object.hasOwnProperty.call(t,"environmentId")&&n.uint32(18).string(t.environmentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetDocumentDetailsMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.environmentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.environmentId&&t.hasOwnProperty("environmentId")&&!n.isString(t.environmentId)?"environmentId: string expected":null},s.fromObject=function(t){if(t instanceof r.GetDocumentDetailsMessage)return t;var e=new r.GetDocumentDetailsMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.environmentId&&(e.environmentId=String(t.environmentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId="",n.environmentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.environmentId&&t.hasOwnProperty("environmentId")&&(n.environmentId=t.environmentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetDocumentDetailsMessage"},s}(),r.CollaborativeEditingConnectResponse=function(){function s(t){if(this.buffers=[],this.types=[],this.metadata=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.offset=0,s.prototype.version=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.initData="",s.prototype.isInitialized=!1,s.prototype.sessionId="",s.prototype.lastOperationId="",s.prototype.sessionCreatedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.offset&&Object.hasOwnProperty.call(t,"offset")&&n.uint32(16).uint32(t.offset),null!=t.version&&Object.hasOwnProperty.call(t,"version")&&n.uint32(24).uint32(t.version),null!=t.buffers&&t.buffers.length)for(var s=0;s<t.buffers.length;++s)n.uint32(34).bytes(t.buffers[s]);if(null!=t.types&&t.types.length){for(n.uint32(42).fork(),s=0;s<t.types.length;++s)n.uint32(t.types[s]);n.ldelim()}if(null!=t.metadata&&t.metadata.length)for(s=0;s<t.metadata.length;++s)r.OperationMetadataDescriptor.encode(t.metadata[s],n.uint32(58).fork()).ldelim();return null!=t.initData&&Object.hasOwnProperty.call(t,"initData")&&n.uint32(66).string(t.initData),null!=t.isInitialized&&Object.hasOwnProperty.call(t,"isInitialized")&&n.uint32(72).bool(t.isInitialized),null!=t.sessionId&&Object.hasOwnProperty.call(t,"sessionId")&&n.uint32(82).string(t.sessionId),null!=t.lastOperationId&&Object.hasOwnProperty.call(t,"lastOperationId")&&n.uint32(90).string(t.lastOperationId),null!=t.sessionCreatedAt&&Object.hasOwnProperty.call(t,"sessionCreatedAt")&&n.uint32(98).string(t.sessionCreatedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.offset=e.uint32();break;case 3:i.version=e.uint32();break;case 4:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(e.bytes());break;case 5:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=e.uint32()+e.pos;e.pos<c;)i.types.push(e.uint32());else i.types.push(e.uint32());break;case 7:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:i.initData=e.string();break;case 9:i.isInitialized=e.bool();break;case 10:i.sessionId=e.string();break;case 11:i.lastOperationId=e.string();break;case 12:i.sessionCreatedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.offset&&t.hasOwnProperty("offset")&&!n.isInteger(t.offset))return"offset: integer expected";if(null!=t.version&&t.hasOwnProperty("version")&&!n.isInteger(t.version))return"version: integer expected";if(null!=t.buffers&&t.hasOwnProperty("buffers")){if(!Array.isArray(t.buffers))return"buffers: array expected";for(var e=0;e<t.buffers.length;++e)if(!(t.buffers[e]&&"number"==typeof t.buffers[e].length||n.isString(t.buffers[e])))return"buffers: buffer[] expected"}if(null!=t.types&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(e=0;e<t.types.length;++e)if(!n.isInteger(t.types[e]))return"types: integer[] expected"}if(null!=t.metadata&&t.hasOwnProperty("metadata")){if(!Array.isArray(t.metadata))return"metadata: array expected";for(e=0;e<t.metadata.length;++e){var s=r.OperationMetadataDescriptor.verify(t.metadata[e]);if(s)return"metadata."+s}}return null!=t.initData&&t.hasOwnProperty("initData")&&!n.isString(t.initData)?"initData: string expected":null!=t.isInitialized&&t.hasOwnProperty("isInitialized")&&"boolean"!=typeof t.isInitialized?"isInitialized: boolean expected":null!=t.sessionId&&t.hasOwnProperty("sessionId")&&!n.isString(t.sessionId)?"sessionId: string expected":null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&!n.isString(t.lastOperationId)?"lastOperationId: string expected":null!=t.sessionCreatedAt&&t.hasOwnProperty("sessionCreatedAt")&&!n.isString(t.sessionCreatedAt)?"sessionCreatedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingConnectResponse)return t;var e=new r.CollaborativeEditingConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),null!=t.offset&&(e.offset=t.offset>>>0),null!=t.version&&(e.version=t.version>>>0),t.buffers){if(!Array.isArray(t.buffers))throw TypeError(".CollaborativeEditingConnectResponse.buffers: array expected");e.buffers=[];for(var s=0;s<t.buffers.length;++s)"string"==typeof t.buffers[s]?n.base64.decode(t.buffers[s],e.buffers[s]=n.newBuffer(n.base64.length(t.buffers[s])),0):t.buffers[s].length>=0&&(e.buffers[s]=t.buffers[s])}if(t.types){if(!Array.isArray(t.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");for(e.types=[],s=0;s<t.types.length;++s)e.types[s]=t.types[s]>>>0}if(t.metadata){if(!Array.isArray(t.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");for(e.metadata=[],s=0;s<t.metadata.length;++s){if("object"!=typeof t.metadata[s])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");e.metadata[s]=r.OperationMetadataDescriptor.fromObject(t.metadata[s])}}return null!=t.initData&&(e.initData=String(t.initData)),null!=t.isInitialized&&(e.isInitialized=Boolean(t.isInitialized)),null!=t.sessionId&&(e.sessionId=String(t.sessionId)),null!=t.lastOperationId&&(e.lastOperationId=String(t.lastOperationId)),null!=t.sessionCreatedAt&&(e.sessionCreatedAt=String(t.sessionCreatedAt)),e},s.toObject=function(t,e){e||(e={});var s={};if((e.arrays||e.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),e.defaults&&(s.channel="",s.offset=0,s.version=0,s.initData="",s.isInitialized=!1,s.sessionId="",s.lastOperationId="",s.sessionCreatedAt=""),null!=t.channel&&t.hasOwnProperty("channel")&&(s.channel=t.channel),null!=t.offset&&t.hasOwnProperty("offset")&&(s.offset=t.offset),null!=t.version&&t.hasOwnProperty("version")&&(s.version=t.version),t.buffers&&t.buffers.length){s.buffers=[];for(var o=0;o<t.buffers.length;++o)s.buffers[o]=e.bytes===String?n.base64.encode(t.buffers[o],0,t.buffers[o].length):e.bytes===Array?Array.prototype.slice.call(t.buffers[o]):t.buffers[o]}if(t.types&&t.types.length)for(s.types=[],o=0;o<t.types.length;++o)s.types[o]=t.types[o];if(t.metadata&&t.metadata.length)for(s.metadata=[],o=0;o<t.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(t.metadata[o],e);return null!=t.initData&&t.hasOwnProperty("initData")&&(s.initData=t.initData),null!=t.isInitialized&&t.hasOwnProperty("isInitialized")&&(s.isInitialized=t.isInitialized),null!=t.sessionId&&t.hasOwnProperty("sessionId")&&(s.sessionId=t.sessionId),null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&(s.lastOperationId=t.lastOperationId),null!=t.sessionCreatedAt&&t.hasOwnProperty("sessionCreatedAt")&&(s.sessionCreatedAt=t.sessionCreatedAt),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingConnectResponse"},s}(),r.CollaborativeEditingResponse=function(){function s(t){if(this.buffers=[],this.types=[],this.metadata=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.version=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.lastOperationId="",s.prototype.lastOperationAcceptedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.version&&Object.hasOwnProperty.call(t,"version")&&n.uint32(8).uint32(t.version),null!=t.buffers&&t.buffers.length)for(var s=0;s<t.buffers.length;++s)n.uint32(18).bytes(t.buffers[s]);if(null!=t.types&&t.types.length){for(n.uint32(26).fork(),s=0;s<t.types.length;++s)n.uint32(t.types[s]);n.ldelim()}if(null!=t.metadata&&t.metadata.length)for(s=0;s<t.metadata.length;++s)r.OperationMetadataDescriptor.encode(t.metadata[s],n.uint32(42).fork()).ldelim();return null!=t.lastOperationId&&Object.hasOwnProperty.call(t,"lastOperationId")&&n.uint32(50).string(t.lastOperationId),null!=t.lastOperationAcceptedAt&&Object.hasOwnProperty.call(t,"lastOperationAcceptedAt")&&n.uint32(58).string(t.lastOperationAcceptedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.version=e.uint32();break;case 2:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(e.bytes());break;case 3:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=e.uint32()+e.pos;e.pos<c;)i.types.push(e.uint32());else i.types.push(e.uint32());break;case 5:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:i.lastOperationId=e.string();break;case 7:i.lastOperationAcceptedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.version&&t.hasOwnProperty("version")&&!n.isInteger(t.version))return"version: integer expected";if(null!=t.buffers&&t.hasOwnProperty("buffers")){if(!Array.isArray(t.buffers))return"buffers: array expected";for(var e=0;e<t.buffers.length;++e)if(!(t.buffers[e]&&"number"==typeof t.buffers[e].length||n.isString(t.buffers[e])))return"buffers: buffer[] expected"}if(null!=t.types&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(e=0;e<t.types.length;++e)if(!n.isInteger(t.types[e]))return"types: integer[] expected"}if(null!=t.metadata&&t.hasOwnProperty("metadata")){if(!Array.isArray(t.metadata))return"metadata: array expected";for(e=0;e<t.metadata.length;++e){var s=r.OperationMetadataDescriptor.verify(t.metadata[e]);if(s)return"metadata."+s}}return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&!n.isString(t.lastOperationId)?"lastOperationId: string expected":null!=t.lastOperationAcceptedAt&&t.hasOwnProperty("lastOperationAcceptedAt")&&!n.isString(t.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingResponse)return t;var e=new r.CollaborativeEditingResponse;if(null!=t.version&&(e.version=t.version>>>0),t.buffers){if(!Array.isArray(t.buffers))throw TypeError(".CollaborativeEditingResponse.buffers: array expected");e.buffers=[];for(var s=0;s<t.buffers.length;++s)"string"==typeof t.buffers[s]?n.base64.decode(t.buffers[s],e.buffers[s]=n.newBuffer(n.base64.length(t.buffers[s])),0):t.buffers[s].length>=0&&(e.buffers[s]=t.buffers[s])}if(t.types){if(!Array.isArray(t.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");for(e.types=[],s=0;s<t.types.length;++s)e.types[s]=t.types[s]>>>0}if(t.metadata){if(!Array.isArray(t.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");for(e.metadata=[],s=0;s<t.metadata.length;++s){if("object"!=typeof t.metadata[s])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");e.metadata[s]=r.OperationMetadataDescriptor.fromObject(t.metadata[s])}}return null!=t.lastOperationId&&(e.lastOperationId=String(t.lastOperationId)),null!=t.lastOperationAcceptedAt&&(e.lastOperationAcceptedAt=String(t.lastOperationAcceptedAt)),e},s.toObject=function(t,e){e||(e={});var s={};if((e.arrays||e.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),e.defaults&&(s.version=0,s.lastOperationId="",s.lastOperationAcceptedAt=""),null!=t.version&&t.hasOwnProperty("version")&&(s.version=t.version),t.buffers&&t.buffers.length){s.buffers=[];for(var o=0;o<t.buffers.length;++o)s.buffers[o]=e.bytes===String?n.base64.encode(t.buffers[o],0,t.buffers[o].length):e.bytes===Array?Array.prototype.slice.call(t.buffers[o]):t.buffers[o]}if(t.types&&t.types.length)for(s.types=[],o=0;o<t.types.length;++o)s.types[o]=t.types[o];if(t.metadata&&t.metadata.length)for(s.metadata=[],o=0;o<t.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(t.metadata[o],e);return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&(s.lastOperationId=t.lastOperationId),null!=t.lastOperationAcceptedAt&&t.hasOwnProperty("lastOperationAcceptedAt")&&(s.lastOperationAcceptedAt=t.lastOperationAcceptedAt),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingResponse"},s}(),r.GetDocumentDetailsResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.lastDocumentSessionId="",s.prototype.lastDocumentSessionOperationId="",s.prototype.currentDocumentSessionId="",s.prototype.currentDocumentSessionVersion=0,s.prototype.currentDocumentSessionOperationId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.lastDocumentSessionId&&Object.hasOwnProperty.call(t,"lastDocumentSessionId")&&n.uint32(10).string(t.lastDocumentSessionId),null!=t.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(t,"lastDocumentSessionOperationId")&&n.uint32(18).string(t.lastDocumentSessionOperationId),null!=t.currentDocumentSessionId&&Object.hasOwnProperty.call(t,"currentDocumentSessionId")&&n.uint32(26).string(t.currentDocumentSessionId),null!=t.currentDocumentSessionVersion&&Object.hasOwnProperty.call(t,"currentDocumentSessionVersion")&&n.uint32(32).uint32(t.currentDocumentSessionVersion),null!=t.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(t,"currentDocumentSessionOperationId")&&n.uint32(42).string(t.currentDocumentSessionOperationId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetDocumentDetailsResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.lastDocumentSessionId=e.string();break;case 2:i.lastDocumentSessionOperationId=e.string();break;case 3:i.currentDocumentSessionId=e.string();break;case 4:i.currentDocumentSessionVersion=e.uint32();break;case 5:i.currentDocumentSessionOperationId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.lastDocumentSessionId&&t.hasOwnProperty("lastDocumentSessionId")&&!n.isString(t.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=t.lastDocumentSessionOperationId&&t.hasOwnProperty("lastDocumentSessionOperationId")&&!n.isString(t.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=t.currentDocumentSessionId&&t.hasOwnProperty("currentDocumentSessionId")&&!n.isString(t.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=t.currentDocumentSessionVersion&&t.hasOwnProperty("currentDocumentSessionVersion")&&!n.isInteger(t.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=t.currentDocumentSessionOperationId&&t.hasOwnProperty("currentDocumentSessionOperationId")&&!n.isString(t.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},s.fromObject=function(t){if(t instanceof r.GetDocumentDetailsResponse)return t;var e=new r.GetDocumentDetailsResponse;return null!=t.lastDocumentSessionId&&(e.lastDocumentSessionId=String(t.lastDocumentSessionId)),null!=t.lastDocumentSessionOperationId&&(e.lastDocumentSessionOperationId=String(t.lastDocumentSessionOperationId)),null!=t.currentDocumentSessionId&&(e.currentDocumentSessionId=String(t.currentDocumentSessionId)),null!=t.currentDocumentSessionVersion&&(e.currentDocumentSessionVersion=t.currentDocumentSessionVersion>>>0),null!=t.currentDocumentSessionOperationId&&(e.currentDocumentSessionOperationId=String(t.currentDocumentSessionOperationId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.lastDocumentSessionId="",n.lastDocumentSessionOperationId="",n.currentDocumentSessionId="",n.currentDocumentSessionVersion=0,n.currentDocumentSessionOperationId=""),null!=t.lastDocumentSessionId&&t.hasOwnProperty("lastDocumentSessionId")&&(n.lastDocumentSessionId=t.lastDocumentSessionId),null!=t.lastDocumentSessionOperationId&&t.hasOwnProperty("lastDocumentSessionOperationId")&&(n.lastDocumentSessionOperationId=t.lastDocumentSessionOperationId),null!=t.currentDocumentSessionId&&t.hasOwnProperty("currentDocumentSessionId")&&(n.currentDocumentSessionId=t.currentDocumentSessionId),null!=t.currentDocumentSessionVersion&&t.hasOwnProperty("currentDocumentSessionVersion")&&(n.currentDocumentSessionVersion=t.currentDocumentSessionVersion),null!=t.currentDocumentSessionOperationId&&t.hasOwnProperty("currentDocumentSessionOperationId")&&(n.currentDocumentSessionOperationId=t.currentDocumentSessionOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetDocumentDetailsResponse"},s}(),r.CommentDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(10).string(t.commentId),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(18).string(t.commentThreadId),null!=t.userId&&Object.hasOwnProperty.call(t,"userId")&&n.uint32(26).string(t.userId),null!=t.content&&Object.hasOwnProperty.call(t,"content")&&n.uint32(34).string(t.content),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(42).string(t.documentId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(50).string(t.createdAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentId=e.string();break;case 2:i.commentThreadId=e.string();break;case 3:i.userId=e.string();break;case 4:i.content=e.string();break;case 5:i.documentId=e.string();break;case 6:i.createdAt=e.string();break;case 7:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId)?"commentId: string expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.userId&&t.hasOwnProperty("userId")&&!n.isString(t.userId)?"userId: string expected":null!=t.content&&t.hasOwnProperty("content")&&!n.isString(t.content)?"content: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentDescriptor)return t;var e=new r.CommentDescriptor;return null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.userId&&(e.userId=String(t.userId)),null!=t.content&&(e.content=String(t.content)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentId="",n.commentThreadId="",n.userId="",n.content="",n.documentId="",n.createdAt="",n.attributes=""),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.userId&&t.hasOwnProperty("userId")&&(n.userId=t.userId),null!=t.content&&t.hasOwnProperty("content")&&(n.content=t.content),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentDescriptor"},s}(),r.CommentsThreadDescriptor=function(){function s(t){if(this.comments=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.comments=n.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.comments&&t.comments.length)for(var s=0;s<t.comments.length;++s)r.CommentDescriptor.encode(t.comments[s],n.uint32(18).fork()).ldelim();return null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(26).string(t.resolvedAt),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(34).string(t.resolvedBy),null!=t.context&&Object.hasOwnProperty.call(t,"context")&&n.uint32(42).string(t.context),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(50).string(t.createdAt),null!=t.deletedAt&&Object.hasOwnProperty.call(t,"deletedAt")&&n.uint32(58).string(t.deletedAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(66).string(t.attributes),null!=t.unlinkedAt&&Object.hasOwnProperty.call(t,"unlinkedAt")&&n.uint32(74).string(t.unlinkedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsThreadDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentDescriptor.decode(e,e.uint32()));break;case 3:i.resolvedAt=e.string();break;case 4:i.resolvedBy=e.string();break;case 5:i.context=e.string();break;case 6:i.createdAt=e.string();break;case 7:i.deletedAt=e.string();break;case 8:i.attributes=e.string();break;case 9:i.unlinkedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.comments&&t.hasOwnProperty("comments")){if(!Array.isArray(t.comments))return"comments: array expected";for(var e=0;e<t.comments.length;++e){var s=r.CommentDescriptor.verify(t.comments[e]);if(s)return"comments."+s}}return null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt)?"resolvedAt: string expected":null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy)?"resolvedBy: string expected":null!=t.context&&t.hasOwnProperty("context")&&!n.isString(t.context)?"context: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&!n.isString(t.deletedAt)?"deletedAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&!n.isString(t.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsThreadDescriptor)return t;var e=new r.CommentsThreadDescriptor;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),t.comments){if(!Array.isArray(t.comments))throw TypeError(".CommentsThreadDescriptor.comments: array expected");e.comments=[];for(var n=0;n<t.comments.length;++n){if("object"!=typeof t.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");e.comments[n]=r.CommentDescriptor.fromObject(t.comments[n])}}return null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),null!=t.context&&(e.context=String(t.context)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.deletedAt&&(e.deletedAt=String(t.deletedAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.unlinkedAt&&(e.unlinkedAt=String(t.unlinkedAt)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.comments=[]),e.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),t.comments&&t.comments.length){n.comments=[];for(var s=0;s<t.comments.length;++s)n.comments[s]=r.CommentDescriptor.toObject(t.comments[s],e)}return null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),null!=t.context&&t.hasOwnProperty("context")&&(n.context=t.context),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&(n.deletedAt=t.deletedAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=t.unlinkedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsThreadDescriptor"},s}(),r.CommentThreadAddedCommentDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentId="",s.prototype.createdAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(10).string(t.commentId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(18).string(t.createdAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentThreadAddedCommentDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentId=e.string();break;case 2:i.createdAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId)?"commentId: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentThreadAddedCommentDescriptor)return t;var e=new r.CommentThreadAddedCommentDescriptor;return null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentId="",n.createdAt=""),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentThreadAddedCommentDescriptor"},s}(),r.CommentsV2AddCommentMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.content&&Object.hasOwnProperty.call(t,"content")&&n.uint32(18).string(t.content),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(26).string(t.documentId),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(34).string(t.commentId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(42).string(t.createdAt),null!=t.userId&&Object.hasOwnProperty.call(t,"userId")&&n.uint32(50).string(t.userId),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),null!=t.commentThread&&Object.hasOwnProperty.call(t,"commentThread")&&r.CommentsThreadDescriptor.encode(t.commentThread,n.uint32(66).fork()).ldelim(),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2AddCommentMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.content=e.string();break;case 3:i.documentId=e.string();break;case 4:i.commentId=e.string();break;case 5:i.createdAt=e.string();break;case 6:i.userId=e.string();break;case 7:i.attributes=e.string();break;case 8:i.commentThread=r.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.content&&t.hasOwnProperty("content")&&!n.isString(t.content))return"content: string expected";if(null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId))return"documentId: string expected";if(null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId))return"commentId: string expected";if(null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt))return"createdAt: string expected";if(null!=t.userId&&t.hasOwnProperty("userId")&&!n.isString(t.userId))return"userId: string expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes))return"attributes: string expected";if(null!=t.commentThread&&t.hasOwnProperty("commentThread")){var e=r.CommentsThreadDescriptor.verify(t.commentThread);if(e)return"commentThread."+e}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2AddCommentMessage)return t;var e=new r.CommentsV2AddCommentMessage;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.content&&(e.content=String(t.content)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.userId&&(e.userId=String(t.userId)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.commentThread){if("object"!=typeof t.commentThread)throw TypeError(".CommentsV2AddCommentMessage.commentThread: object expected");e.commentThread=r.CommentsThreadDescriptor.fromObject(t.commentThread)}return e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.content="",n.documentId="",n.commentId="",n.createdAt="",n.userId="",n.attributes="",n.commentThread=null),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.content&&t.hasOwnProperty("content")&&(n.content=t.content),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.userId&&t.hasOwnProperty("userId")&&(n.userId=t.userId),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.commentThread&&t.hasOwnProperty("commentThread")&&(n.commentThread=r.CommentsThreadDescriptor.toObject(t.commentThread,e)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2AddCommentMessage"},s}(),r.CommentsV2AddCommentThreadMessage=function(){function s(t){if(this.comments=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(18).string(t.commentThreadId),null!=t.context&&Object.hasOwnProperty.call(t,"context")&&n.uint32(26).string(t.context),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(34).string(t.createdAt),null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(42).string(t.resolvedAt),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(50).string(t.resolvedBy),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),null!=t.deletedAt&&Object.hasOwnProperty.call(t,"deletedAt")&&n.uint32(66).string(t.deletedAt),null!=t.comments&&t.comments.length)for(var s=0;s<t.comments.length;++s)r.CommentDescriptor.encode(t.comments[s],n.uint32(74).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2AddCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.commentThreadId=e.string();break;case 3:i.context=e.string();break;case 4:i.createdAt=e.string();break;case 5:i.resolvedAt=e.string();break;case 6:i.resolvedBy=e.string();break;case 7:i.attributes=e.string();break;case 8:i.deletedAt=e.string();break;case 9:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId))return"documentId: string expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.context&&t.hasOwnProperty("context")&&!n.isString(t.context))return"context: string expected";if(null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt))return"createdAt: string expected";if(null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt))return"resolvedAt: string expected";if(null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy))return"resolvedBy: string expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes))return"attributes: string expected";if(null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&!n.isString(t.deletedAt))return"deletedAt: string expected";if(null!=t.comments&&t.hasOwnProperty("comments")){if(!Array.isArray(t.comments))return"comments: array expected";for(var e=0;e<t.comments.length;++e){var s=r.CommentDescriptor.verify(t.comments[e]);if(s)return"comments."+s}}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2AddCommentThreadMessage)return t;var e=new r.CommentsV2AddCommentThreadMessage;if(null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.context&&(e.context=String(t.context)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.deletedAt&&(e.deletedAt=String(t.deletedAt)),t.comments){if(!Array.isArray(t.comments))throw TypeError(".CommentsV2AddCommentThreadMessage.comments: array expected");e.comments=[];for(var n=0;n<t.comments.length;++n){if("object"!=typeof t.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");e.comments[n]=r.CommentDescriptor.fromObject(t.comments[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.comments=[]),e.defaults&&(n.documentId="",n.commentThreadId="",n.context="",n.createdAt="",n.resolvedAt="",n.resolvedBy="",n.attributes="",n.deletedAt=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.context&&t.hasOwnProperty("context")&&(n.context=t.context),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&(n.deletedAt=t.deletedAt),t.comments&&t.comments.length){n.comments=[];for(var s=0;s<t.comments.length;++s)n.comments[s]=r.CommentDescriptor.toObject(t.comments[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2AddCommentThreadMessage"},s}(),r.CommentsV2ReopenCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ReopenCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2ReopenCommentThreadMessage)return t;var e=new r.CommentsV2ReopenCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ReopenCommentThreadMessage"},s}(),r.CommentsV2ResolveCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedBy="",s.prototype.resolvedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(26).string(t.resolvedBy),null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(34).string(t.resolvedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ResolveCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;case 3:i.resolvedBy=e.string();break;case 4:i.resolvedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy)?"resolvedBy: string expected":null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt)?"resolvedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2ResolveCommentThreadMessage)return t;var e=new r.CommentsV2ResolveCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedBy="",n.resolvedAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ResolveCommentThreadMessage"},s}(),r.CommentsV2UpdateCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.context="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.context&&Object.hasOwnProperty.call(t,"context")&&n.uint32(26).string(t.context),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(34).string(t.attributes),null!=t.unlinkedAt&&Object.hasOwnProperty.call(t,"unlinkedAt")&&n.uint32(42).string(t.unlinkedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2UpdateCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;case 3:i.context=e.string();break;case 4:i.attributes=e.string();break;case 5:i.unlinkedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.context&&t.hasOwnProperty("context")&&!n.isString(t.context)?"context: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&!n.isString(t.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2UpdateCommentThreadMessage)return t;var e=new r.CommentsV2UpdateCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.context&&(e.context=String(t.context)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.unlinkedAt&&(e.unlinkedAt=String(t.unlinkedAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId="",n.context="",n.attributes="",n.unlinkedAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.context&&t.hasOwnProperty("context")&&(n.context=t.context),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=t.unlinkedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2UpdateCommentThreadMessage"},s}(),r.CommentsV2ConnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2ConnectMessage)return t;var e=new r.CommentsV2ConnectMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ConnectMessage"},s}(),r.CommentsV2GetCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2GetCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2GetCommentThreadMessage)return t;var e=new r.CommentsV2GetCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2GetCommentThreadMessage"},s}(),r.CommentsV2GetDocumentThreadsMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2GetDocumentThreadsMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2GetDocumentThreadsMessage)return t;var e=new r.CommentsV2GetDocumentThreadsMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2GetDocumentThreadsMessage"},s}(),r.CommentsV2RemoveCommentMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(18).string(t.commentId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(26).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2RemoveCommentMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.commentId=e.string();break;case 3:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId)?"commentId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2RemoveCommentMessage)return t;var e=new r.CommentsV2RemoveCommentMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.commentId="",n.documentId=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2RemoveCommentMessage"},s}(),r.CommentsV2RemoveCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2RemoveCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2RemoveCommentThreadMessage)return t;var e=new r.CommentsV2RemoveCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2RemoveCommentThreadMessage"},s}(),r.CommentsV2UpdateCommentMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(18).string(t.commentId),null!=t.content&&Object.hasOwnProperty.call(t,"content")&&n.uint32(26).string(t.content),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(34).string(t.documentId),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(42).string(t.attributes),null!=t.isAttributesUpdated&&Object.hasOwnProperty.call(t,"isAttributesUpdated")&&n.uint32(48).bool(t.isAttributesUpdated),null!=t.commentThread&&Object.hasOwnProperty.call(t,"commentThread")&&r.CommentsThreadDescriptor.encode(t.commentThread,n.uint32(58).fork()).ldelim(),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2UpdateCommentMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.commentId=e.string();break;case 3:i.content=e.string();break;case 4:i.documentId=e.string();break;case 5:i.attributes=e.string();break;case 6:i.isAttributesUpdated=e.bool();break;case 7:i.commentThread=r.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId))return"commentId: string expected";if(null!=t.content&&t.hasOwnProperty("content")&&!n.isString(t.content))return"content: string expected";if(null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId))return"documentId: string expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes))return"attributes: string expected";if(null!=t.isAttributesUpdated&&t.hasOwnProperty("isAttributesUpdated")&&"boolean"!=typeof t.isAttributesUpdated)return"isAttributesUpdated: boolean expected";if(null!=t.commentThread&&t.hasOwnProperty("commentThread")){var e=r.CommentsThreadDescriptor.verify(t.commentThread);if(e)return"commentThread."+e}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2UpdateCommentMessage)return t;var e=new r.CommentsV2UpdateCommentMessage;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.content&&(e.content=String(t.content)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.isAttributesUpdated&&(e.isAttributesUpdated=Boolean(t.isAttributesUpdated)),null!=t.commentThread){if("object"!=typeof t.commentThread)throw TypeError(".CommentsV2UpdateCommentMessage.commentThread: object expected");e.commentThread=r.CommentsThreadDescriptor.fromObject(t.commentThread)}return e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.commentId="",n.content="",n.documentId="",n.attributes="",n.isAttributesUpdated=!1,n.commentThread=null),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.content&&t.hasOwnProperty("content")&&(n.content=t.content),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.isAttributesUpdated&&t.hasOwnProperty("isAttributesUpdated")&&(n.isAttributesUpdated=t.isAttributesUpdated),null!=t.commentThread&&t.hasOwnProperty("commentThread")&&(n.commentThread=r.CommentsThreadDescriptor.toObject(t.commentThread,e)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2UpdateCommentMessage"},s}(),r.CommentsV2AddCommentResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.createdAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(18).string(t.commentId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(26).string(t.createdAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2AddCommentResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.commentId=e.string();break;case 3:i.createdAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId)?"commentId: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2AddCommentResponse)return t;var e=new r.CommentsV2AddCommentResponse;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.commentId="",n.createdAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2AddCommentResponse"},s}(),r.CommentsV2AddCommentThreadResponse=function(){function s(t){if(this.comments=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.createdAt="",s.prototype.comments=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(18).string(t.createdAt),null!=t.comments&&t.comments.length)for(var s=0;s<t.comments.length;++s)r.CommentThreadAddedCommentDescriptor.encode(t.comments[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2AddCommentThreadResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.createdAt=e.string();break;case 3:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt))return"createdAt: string expected";if(null!=t.comments&&t.hasOwnProperty("comments")){if(!Array.isArray(t.comments))return"comments: array expected";for(var e=0;e<t.comments.length;++e){var s=r.CommentThreadAddedCommentDescriptor.verify(t.comments[e]);if(s)return"comments."+s}}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2AddCommentThreadResponse)return t;var e=new r.CommentsV2AddCommentThreadResponse;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),t.comments){if(!Array.isArray(t.comments))throw TypeError(".CommentsV2AddCommentThreadResponse.comments: array expected");e.comments=[];for(var n=0;n<t.comments.length;++n){if("object"!=typeof t.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");e.comments[n]=r.CommentThreadAddedCommentDescriptor.fromObject(t.comments[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.comments=[]),e.defaults&&(n.commentThreadId="",n.createdAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),t.comments&&t.comments.length){n.comments=[];for(var s=0;s<t.comments.length;++s)n.comments[s]=r.CommentThreadAddedCommentDescriptor.toObject(t.comments[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2AddCommentThreadResponse"},s}(),r.CommentsV2ResolveCommentThreadResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(26).string(t.resolvedAt),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(34).string(t.resolvedBy),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ResolveCommentThreadResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;case 3:i.resolvedAt=e.string();break;case 4:i.resolvedBy=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt)?"resolvedAt: string expected":null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy)?"resolvedBy: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2ResolveCommentThreadResponse)return t;var e=new r.CommentsV2ResolveCommentThreadResponse;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedAt="",n.resolvedBy=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ResolveCommentThreadResponse"},s}(),r.CommentsV2ConnectResponse=function(){function s(t){if(this.threads=[],this.threadsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.threads=n.emptyArray,s.prototype.threadsV2=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.threads&&t.threads.length)for(var s=0;s<t.threads.length;++s)n.uint32(18).string(t.threads[s]);if(null!=t.threadsV2&&t.threadsV2.length)for(s=0;s<t.threadsV2.length;++s)r.CommentsThreadDescriptor.encode(t.threadsV2[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.threads&&i.threads.length||(i.threads=[]),i.threads.push(e.string());break;case 3:i.threadsV2&&i.threadsV2.length||(i.threadsV2=[]),i.threadsV2.push(r.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.threads&&t.hasOwnProperty("threads")){if(!Array.isArray(t.threads))return"threads: array expected";for(var e=0;e<t.threads.length;++e)if(!n.isString(t.threads[e]))return"threads: string[] expected"}if(null!=t.threadsV2&&t.hasOwnProperty("threadsV2")){if(!Array.isArray(t.threadsV2))return"threadsV2: array expected";for(e=0;e<t.threadsV2.length;++e){var s=r.CommentsThreadDescriptor.verify(t.threadsV2[e]);if(s)return"threadsV2."+s}}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2ConnectResponse)return t;var e=new r.CommentsV2ConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),t.threads){if(!Array.isArray(t.threads))throw TypeError(".CommentsV2ConnectResponse.threads: array expected");e.threads=[];for(var n=0;n<t.threads.length;++n)e.threads[n]=String(t.threads[n])}if(t.threadsV2){if(!Array.isArray(t.threadsV2))throw TypeError(".CommentsV2ConnectResponse.threadsV2: array expected");for(e.threadsV2=[],n=0;n<t.threadsV2.length;++n){if("object"!=typeof t.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");e.threadsV2[n]=r.CommentsThreadDescriptor.fromObject(t.threadsV2[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.threads=[],n.threadsV2=[]),e.defaults&&(n.channel=""),null!=t.channel&&t.hasOwnProperty("channel")&&(n.channel=t.channel),t.threads&&t.threads.length){n.threads=[];for(var s=0;s<t.threads.length;++s)n.threads[s]=t.threads[s]}if(t.threadsV2&&t.threadsV2.length)for(n.threadsV2=[],s=0;s<t.threadsV2.length;++s)n.threadsV2[s]=r.CommentsThreadDescriptor.toObject(t.threadsV2[s],e);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ConnectResponse"},s}(),r.CommentsV2GetCommentThreadResponse=function(){function s(t){if(this.comments=[],this.commentsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.comments=n.emptyArray,s.prototype.commentsV2=n.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.comments&&t.comments.length)for(var s=0;s<t.comments.length;++s)n.uint32(18).string(t.comments[s]);if(null!=t.commentsV2&&t.commentsV2.length)for(s=0;s<t.commentsV2.length;++s)r.CommentDescriptor.encode(t.commentsV2[s],n.uint32(26).fork()).ldelim();return null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(34).string(t.resolvedAt),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(42).string(t.resolvedBy),null!=t.context&&Object.hasOwnProperty.call(t,"context")&&n.uint32(50).string(t.context),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(58).string(t.createdAt),null!=t.deletedAt&&Object.hasOwnProperty.call(t,"deletedAt")&&n.uint32(66).string(t.deletedAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(74).string(t.attributes),null!=t.unlinkedAt&&Object.hasOwnProperty.call(t,"unlinkedAt")&&n.uint32(82).string(t.unlinkedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2GetCommentThreadResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(e.string());break;case 3:i.commentsV2&&i.commentsV2.length||(i.commentsV2=[]),i.commentsV2.push(r.CommentDescriptor.decode(e,e.uint32()));break;case 4:i.resolvedAt=e.string();break;case 5:i.resolvedBy=e.string();break;case 6:i.context=e.string();break;case 7:i.createdAt=e.string();break;case 8:i.deletedAt=e.string();break;case 9:i.attributes=e.string();break;case 10:i.unlinkedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.comments&&t.hasOwnProperty("comments")){if(!Array.isArray(t.comments))return"comments: array expected";for(var e=0;e<t.comments.length;++e)if(!n.isString(t.comments[e]))return"comments: string[] expected"}if(null!=t.commentsV2&&t.hasOwnProperty("commentsV2")){if(!Array.isArray(t.commentsV2))return"commentsV2: array expected";for(e=0;e<t.commentsV2.length;++e){var s=r.CommentDescriptor.verify(t.commentsV2[e]);if(s)return"commentsV2."+s}}return null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt)?"resolvedAt: string expected":null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy)?"resolvedBy: string expected":null!=t.context&&t.hasOwnProperty("context")&&!n.isString(t.context)?"context: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&!n.isString(t.deletedAt)?"deletedAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&!n.isString(t.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2GetCommentThreadResponse)return t;var e=new r.CommentsV2GetCommentThreadResponse;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),t.comments){if(!Array.isArray(t.comments))throw TypeError(".CommentsV2GetCommentThreadResponse.comments: array expected");e.comments=[];for(var n=0;n<t.comments.length;++n)e.comments[n]=String(t.comments[n])}if(t.commentsV2){if(!Array.isArray(t.commentsV2))throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: array expected");for(e.commentsV2=[],n=0;n<t.commentsV2.length;++n){if("object"!=typeof t.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");e.commentsV2[n]=r.CommentDescriptor.fromObject(t.commentsV2[n])}}return null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),null!=t.context&&(e.context=String(t.context)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.deletedAt&&(e.deletedAt=String(t.deletedAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.unlinkedAt&&(e.unlinkedAt=String(t.unlinkedAt)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.comments=[],n.commentsV2=[]),e.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),t.comments&&t.comments.length){n.comments=[];for(var s=0;s<t.comments.length;++s)n.comments[s]=t.comments[s]}if(t.commentsV2&&t.commentsV2.length)for(n.commentsV2=[],s=0;s<t.commentsV2.length;++s)n.commentsV2[s]=r.CommentDescriptor.toObject(t.commentsV2[s],e);return null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),null!=t.context&&t.hasOwnProperty("context")&&(n.context=t.context),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&(n.deletedAt=t.deletedAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=t.unlinkedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2GetCommentThreadResponse"},s}(),r.CommentsV2GetDocumentThreadsResponse=function(){function s(t){if(this.threads=[],this.threadsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.threads=n.emptyArray,s.prototype.threadsV2=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.threads&&t.threads.length)for(var s=0;s<t.threads.length;++s)n.uint32(10).string(t.threads[s]);if(null!=t.threadsV2&&t.threadsV2.length)for(s=0;s<t.threadsV2.length;++s)r.CommentsThreadDescriptor.encode(t.threadsV2[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2GetDocumentThreadsResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.threads&&i.threads.length||(i.threads=[]),i.threads.push(e.string());break;case 2:i.threadsV2&&i.threadsV2.length||(i.threadsV2=[]),i.threadsV2.push(r.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.threads&&t.hasOwnProperty("threads")){if(!Array.isArray(t.threads))return"threads: array expected";for(var e=0;e<t.threads.length;++e)if(!n.isString(t.threads[e]))return"threads: string[] expected"}if(null!=t.threadsV2&&t.hasOwnProperty("threadsV2")){if(!Array.isArray(t.threadsV2))return"threadsV2: array expected";for(e=0;e<t.threadsV2.length;++e){var s=r.CommentsThreadDescriptor.verify(t.threadsV2[e]);if(s)return"threadsV2."+s}}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2GetDocumentThreadsResponse)return t;var e=new r.CommentsV2GetDocumentThreadsResponse;if(t.threads){if(!Array.isArray(t.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");e.threads=[];for(var n=0;n<t.threads.length;++n)e.threads[n]=String(t.threads[n])}if(t.threadsV2){if(!Array.isArray(t.threadsV2))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: array expected");for(e.threadsV2=[],n=0;n<t.threadsV2.length;++n){if("object"!=typeof t.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");e.threadsV2[n]=r.CommentsThreadDescriptor.fromObject(t.threadsV2[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.threads=[],n.threadsV2=[]),t.threads&&t.threads.length){n.threads=[];for(var s=0;s<t.threads.length;++s)n.threads[s]=t.threads[s]}if(t.threadsV2&&t.threadsV2.length)for(n.threadsV2=[],s=0;s<t.threadsV2.length;++s)n.threadsV2[s]=r.CommentsThreadDescriptor.toObject(t.threadsV2[s],e);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2GetDocumentThreadsResponse"},s}(),r.KeyValueDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.key="",s.prototype.value="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.key&&Object.hasOwnProperty.call(t,"key")&&n.uint32(10).string(t.key),null!=t.value&&Object.hasOwnProperty.call(t,"value")&&n.uint32(18).string(t.value),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.KeyValueDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.key=e.string();break;case 2:i.value=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.key&&t.hasOwnProperty("key")&&!n.isString(t.key)?"key: string expected":null!=t.value&&t.hasOwnProperty("value")&&!n.isString(t.value)?"value: string expected":null},s.fromObject=function(t){if(t instanceof r.KeyValueDescriptor)return t;var e=new r.KeyValueDescriptor;return null!=t.key&&(e.key=String(t.key)),null!=t.value&&(e.value=String(t.value)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.key="",n.value=""),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.value&&t.hasOwnProperty("value")&&(n.value=t.value),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/KeyValueDescriptor"},s}(),r.IsEditorBundleUploadedMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.bundleVersion="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.bundleVersion&&Object.hasOwnProperty.call(t,"bundleVersion")&&n.uint32(10).string(t.bundleVersion),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.IsEditorBundleUploadedMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.bundleVersion=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&!n.isString(t.bundleVersion)?"bundleVersion: string expected":null},s.fromObject=function(t){if(t instanceof r.IsEditorBundleUploadedMessage)return t;var e=new r.IsEditorBundleUploadedMessage;return null!=t.bundleVersion&&(e.bundleVersion=String(t.bundleVersion)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.bundleVersion=""),null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&(n.bundleVersion=t.bundleVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/IsEditorBundleUploadedMessage"},s}(),r.IsEditorBundleUploadedResponse=function(){function n(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return n.prototype.isUploaded=!1,n.create=function(t){return new n(t)},n.encode=function(t,n){return n||(n=e.create()),null!=t.isUploaded&&Object.hasOwnProperty.call(t,"isUploaded")&&n.uint32(8).bool(t.isUploaded),n},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.IsEditorBundleUploadedResponse;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.isUploaded=e.bool():e.skipType(7&a)}return i},n.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},n.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.isUploaded&&t.hasOwnProperty("isUploaded")&&"boolean"!=typeof t.isUploaded?"isUploaded: boolean expected":null},n.fromObject=function(t){if(t instanceof r.IsEditorBundleUploadedResponse)return t;var e=new r.IsEditorBundleUploadedResponse;return null!=t.isUploaded&&(e.isUploaded=Boolean(t.isUploaded)),e},n.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.isUploaded=!1),null!=t.isUploaded&&t.hasOwnProperty("isUploaded")&&(n.isUploaded=t.isUploaded),n},n.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},n.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/IsEditorBundleUploadedResponse"},n}(),r.RevisionDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.revisionId&&Object.hasOwnProperty.call(t,"revisionId")&&n.uint32(10).string(t.revisionId),null!=t.name&&Object.hasOwnProperty.call(t,"name")&&n.uint32(18).string(t.name),null!=t.creatorId&&Object.hasOwnProperty.call(t,"creatorId")&&n.uint32(26).string(t.creatorId),null!=t.authorsIds&&Object.hasOwnProperty.call(t,"authorsIds")&&n.uint32(34).string(t.authorsIds),null!=t.diffData&&Object.hasOwnProperty.call(t,"diffData")&&n.uint32(42).string(t.diffData),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(50).string(t.createdAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),null!=t.toVersion&&Object.hasOwnProperty.call(t,"toVersion")&&n.uint32(64).uint32(t.toVersion),null!=t.fromVersion&&Object.hasOwnProperty.call(t,"fromVersion")&&n.uint32(72).uint32(t.fromVersion),null!=t.isEmptyCurrent&&Object.hasOwnProperty.call(t,"isEmptyCurrent")&&n.uint32(80).bool(t.isEmptyCurrent),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.revisionId=e.string();break;case 2:i.name=e.string();break;case 3:i.creatorId=e.string();break;case 4:i.authorsIds=e.string();break;case 5:i.diffData=e.string();break;case 6:i.createdAt=e.string();break;case 7:i.attributes=e.string();break;case 8:i.toVersion=e.uint32();break;case 9:i.fromVersion=e.uint32();break;case 10:i.isEmptyCurrent=e.bool();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.revisionId&&t.hasOwnProperty("revisionId")&&!n.isString(t.revisionId)?"revisionId: string expected":null!=t.name&&t.hasOwnProperty("name")&&!n.isString(t.name)?"name: string expected":null!=t.creatorId&&t.hasOwnProperty("creatorId")&&!n.isString(t.creatorId)?"creatorId: string expected":null!=t.authorsIds&&t.hasOwnProperty("authorsIds")&&!n.isString(t.authorsIds)?"authorsIds: string expected":null!=t.diffData&&t.hasOwnProperty("diffData")&&!n.isString(t.diffData)?"diffData: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.toVersion&&t.hasOwnProperty("toVersion")&&!n.isInteger(t.toVersion)?"toVersion: integer expected":null!=t.fromVersion&&t.hasOwnProperty("fromVersion")&&!n.isInteger(t.fromVersion)?"fromVersion: integer expected":null!=t.isEmptyCurrent&&t.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof t.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RevisionDescriptor)return t;var e=new r.RevisionDescriptor;return null!=t.revisionId&&(e.revisionId=String(t.revisionId)),null!=t.name&&(e.name=String(t.name)),null!=t.creatorId&&(e.creatorId=String(t.creatorId)),null!=t.authorsIds&&(e.authorsIds=String(t.authorsIds)),null!=t.diffData&&(e.diffData=String(t.diffData)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.toVersion&&(e.toVersion=t.toVersion>>>0),null!=t.fromVersion&&(e.fromVersion=t.fromVersion>>>0),null!=t.isEmptyCurrent&&(e.isEmptyCurrent=Boolean(t.isEmptyCurrent)),e},s.toObject=function(t,e){e||(e={});var n={};return e.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!=t.revisionId&&t.hasOwnProperty("revisionId")&&(n.revisionId=t.revisionId),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.creatorId&&t.hasOwnProperty("creatorId")&&(n.creatorId=t.creatorId),null!=t.authorsIds&&t.hasOwnProperty("authorsIds")&&(n.authorsIds=t.authorsIds),null!=t.diffData&&t.hasOwnProperty("diffData")&&(n.diffData=t.diffData),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.toVersion&&t.hasOwnProperty("toVersion")&&(n.toVersion=t.toVersion),null!=t.fromVersion&&t.hasOwnProperty("fromVersion")&&(n.fromVersion=t.fromVersion),null!=t.isEmptyCurrent&&t.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=t.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionDescriptor"},s}(),r.RevisionHistoryConnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryConnectMessage)return t;var e=new r.RevisionHistoryConnectMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryConnectMessage"},s}(),r.RevisionHistoryGetRevisionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.prototype.revisionId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.revisionId&&Object.hasOwnProperty.call(t,"revisionId")&&n.uint32(18).string(t.revisionId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryGetRevisionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.revisionId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.revisionId&&t.hasOwnProperty("revisionId")&&!n.isString(t.revisionId)?"revisionId: string expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryGetRevisionMessage)return t;var e=new r.RevisionHistoryGetRevisionMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.revisionId&&(e.revisionId=String(t.revisionId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId="",n.revisionId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.revisionId&&t.hasOwnProperty("revisionId")&&(n.revisionId=t.revisionId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryGetRevisionMessage"},s}(),r.RevisionHistoryReconnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.requestId&&Object.hasOwnProperty.call(t,"requestId")&&n.uint32(16).uint32(t.requestId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryReconnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.requestId=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.requestId&&t.hasOwnProperty("requestId")&&!n.isInteger(t.requestId)?"requestId: integer expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryReconnectMessage)return t;var e=new r.RevisionHistoryReconnectMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.requestId&&(e.requestId=t.requestId>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId="",n.requestId=0),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.requestId&&t.hasOwnProperty("requestId")&&(n.requestId=t.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryReconnectMessage"},s}(),r.RevisionHistoryUpdateRevisionsMessage=function(){function s(t){if(this.revisions=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.prototype.revisions=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.requestId&&Object.hasOwnProperty.call(t,"requestId")&&n.uint32(16).uint32(t.requestId),null!=t.revisions&&t.revisions.length)for(var s=0;s<t.revisions.length;++s)r.RevisionDescriptor.encode(t.revisions[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryUpdateRevisionsMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.requestId=e.uint32();break;case 3:i.revisions&&i.revisions.length||(i.revisions=[]),i.revisions.push(r.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId))return"documentId: string expected";if(null!=t.requestId&&t.hasOwnProperty("requestId")&&!n.isInteger(t.requestId))return"requestId: integer expected";if(null!=t.revisions&&t.hasOwnProperty("revisions")){if(!Array.isArray(t.revisions))return"revisions: array expected";for(var e=0;e<t.revisions.length;++e){var s=r.RevisionDescriptor.verify(t.revisions[e]);if(s)return"revisions."+s}}return null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryUpdateRevisionsMessage)return t;var e=new r.RevisionHistoryUpdateRevisionsMessage;if(null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.requestId&&(e.requestId=t.requestId>>>0),t.revisions){if(!Array.isArray(t.revisions))throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: array expected");e.revisions=[];for(var n=0;n<t.revisions.length;++n){if("object"!=typeof t.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");e.revisions[n]=r.RevisionDescriptor.fromObject(t.revisions[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.revisions=[]),e.defaults&&(n.documentId="",n.requestId=0),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.requestId&&t.hasOwnProperty("requestId")&&(n.requestId=t.requestId),t.revisions&&t.revisions.length){n.revisions=[];for(var s=0;s<t.revisions.length;++s)n.revisions[s]=r.RevisionDescriptor.toObject(t.revisions[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryUpdateRevisionsMessage"},s}(),r.RevisionHistoryConnectResponse=function(){function s(t){if(this.revisions=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.requestId=0,s.prototype.revisions=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.requestId&&Object.hasOwnProperty.call(t,"requestId")&&n.uint32(16).uint32(t.requestId),null!=t.revisions&&t.revisions.length)for(var s=0;s<t.revisions.length;++s)r.RevisionDescriptor.encode(t.revisions[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.requestId=e.uint32();break;case 3:i.revisions&&i.revisions.length||(i.revisions=[]),i.revisions.push(r.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.requestId&&t.hasOwnProperty("requestId")&&!n.isInteger(t.requestId))return"requestId: integer expected";if(null!=t.revisions&&t.hasOwnProperty("revisions")){if(!Array.isArray(t.revisions))return"revisions: array expected";for(var e=0;e<t.revisions.length;++e){var s=r.RevisionDescriptor.verify(t.revisions[e]);if(s)return"revisions."+s}}return null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryConnectResponse)return t;var e=new r.RevisionHistoryConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),null!=t.requestId&&(e.requestId=t.requestId>>>0),t.revisions){if(!Array.isArray(t.revisions))throw TypeError(".RevisionHistoryConnectResponse.revisions: array expected");e.revisions=[];for(var n=0;n<t.revisions.length;++n){if("object"!=typeof t.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");e.revisions[n]=r.RevisionDescriptor.fromObject(t.revisions[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.revisions=[]),e.defaults&&(n.channel="",n.requestId=0),null!=t.channel&&t.hasOwnProperty("channel")&&(n.channel=t.channel),null!=t.requestId&&t.hasOwnProperty("requestId")&&(n.requestId=t.requestId),t.revisions&&t.revisions.length){n.revisions=[];for(var s=0;s<t.revisions.length;++s)n.revisions[s]=r.RevisionDescriptor.toObject(t.revisions[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryConnectResponse"},s}(),r.RevisionHistoryGetRevisionResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.revisionId&&Object.hasOwnProperty.call(t,"revisionId")&&n.uint32(10).string(t.revisionId),null!=t.name&&Object.hasOwnProperty.call(t,"name")&&n.uint32(18).string(t.name),null!=t.creatorId&&Object.hasOwnProperty.call(t,"creatorId")&&n.uint32(26).string(t.creatorId),null!=t.authorsIds&&Object.hasOwnProperty.call(t,"authorsIds")&&n.uint32(34).string(t.authorsIds),null!=t.diffData&&Object.hasOwnProperty.call(t,"diffData")&&n.uint32(42).string(t.diffData),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(50).string(t.createdAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),null!=t.toVersion&&Object.hasOwnProperty.call(t,"toVersion")&&n.uint32(64).uint32(t.toVersion),null!=t.fromVersion&&Object.hasOwnProperty.call(t,"fromVersion")&&n.uint32(72).uint32(t.fromVersion),null!=t.isEmptyCurrent&&Object.hasOwnProperty.call(t,"isEmptyCurrent")&&n.uint32(80).bool(t.isEmptyCurrent),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryGetRevisionResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.revisionId=e.string();break;case 2:i.name=e.string();break;case 3:i.creatorId=e.string();break;case 4:i.authorsIds=e.string();break;case 5:i.diffData=e.string();break;case 6:i.createdAt=e.string();break;case 7:i.attributes=e.string();break;case 8:i.toVersion=e.uint32();break;case 9:i.fromVersion=e.uint32();break;case 10:i.isEmptyCurrent=e.bool();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.revisionId&&t.hasOwnProperty("revisionId")&&!n.isString(t.revisionId)?"revisionId: string expected":null!=t.name&&t.hasOwnProperty("name")&&!n.isString(t.name)?"name: string expected":null!=t.creatorId&&t.hasOwnProperty("creatorId")&&!n.isString(t.creatorId)?"creatorId: string expected":null!=t.authorsIds&&t.hasOwnProperty("authorsIds")&&!n.isString(t.authorsIds)?"authorsIds: string expected":null!=t.diffData&&t.hasOwnProperty("diffData")&&!n.isString(t.diffData)?"diffData: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.toVersion&&t.hasOwnProperty("toVersion")&&!n.isInteger(t.toVersion)?"toVersion: integer expected":null!=t.fromVersion&&t.hasOwnProperty("fromVersion")&&!n.isInteger(t.fromVersion)?"fromVersion: integer expected":null!=t.isEmptyCurrent&&t.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof t.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryGetRevisionResponse)return t;var e=new r.RevisionHistoryGetRevisionResponse;return null!=t.revisionId&&(e.revisionId=String(t.revisionId)),null!=t.name&&(e.name=String(t.name)),null!=t.creatorId&&(e.creatorId=String(t.creatorId)),null!=t.authorsIds&&(e.authorsIds=String(t.authorsIds)),null!=t.diffData&&(e.diffData=String(t.diffData)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.toVersion&&(e.toVersion=t.toVersion>>>0),null!=t.fromVersion&&(e.fromVersion=t.fromVersion>>>0),null!=t.isEmptyCurrent&&(e.isEmptyCurrent=Boolean(t.isEmptyCurrent)),e},s.toObject=function(t,e){e||(e={});var n={};return e.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!=t.revisionId&&t.hasOwnProperty("revisionId")&&(n.revisionId=t.revisionId),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.creatorId&&t.hasOwnProperty("creatorId")&&(n.creatorId=t.creatorId),null!=t.authorsIds&&t.hasOwnProperty("authorsIds")&&(n.authorsIds=t.authorsIds),null!=t.diffData&&t.hasOwnProperty("diffData")&&(n.diffData=t.diffData),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.toVersion&&t.hasOwnProperty("toVersion")&&(n.toVersion=t.toVersion),null!=t.fromVersion&&t.hasOwnProperty("fromVersion")&&(n.fromVersion=t.fromVersion),null!=t.isEmptyCurrent&&t.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=t.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryGetRevisionResponse"},s}(),r.RevisionHistoryUpdateRevisionsResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.requestId=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.requestId&&Object.hasOwnProperty.call(t,"requestId")&&n.uint32(8).uint32(t.requestId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryUpdateRevisionsResponse;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.requestId=e.uint32():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.requestId&&t.hasOwnProperty("requestId")&&!n.isInteger(t.requestId)?"requestId: integer expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryUpdateRevisionsResponse)return t;var e=new r.RevisionHistoryUpdateRevisionsResponse;return null!=t.requestId&&(e.requestId=t.requestId>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.requestId=0),null!=t.requestId&&t.hasOwnProperty("requestId")&&(n.requestId=t.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryUpdateRevisionsResponse"},s}(),r.SessionsSocketDescriptor=function(){function s(t){if(this.permissions=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.session="",s.prototype.user="",s.prototype.role="",s.prototype.permissions=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.session&&Object.hasOwnProperty.call(t,"session")&&n.uint32(10).string(t.session),null!=t.user&&Object.hasOwnProperty.call(t,"user")&&n.uint32(18).string(t.user),null!=t.role&&Object.hasOwnProperty.call(t,"role")&&n.uint32(26).string(t.role),null!=t.permissions&&t.permissions.length)for(var r=0;r<t.permissions.length;++r)n.uint32(34).string(t.permissions[r]);return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SessionsSocketDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.session=e.string();break;case 2:i.user=e.string();break;case 3:i.role=e.string();break;case 4:i.permissions&&i.permissions.length||(i.permissions=[]),i.permissions.push(e.string());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.session&&t.hasOwnProperty("session")&&!n.isString(t.session))return"session: string expected";if(null!=t.user&&t.hasOwnProperty("user")&&!n.isString(t.user))return"user: string expected";if(null!=t.role&&t.hasOwnProperty("role")&&!n.isString(t.role))return"role: string expected";if(null!=t.permissions&&t.hasOwnProperty("permissions")){if(!Array.isArray(t.permissions))return"permissions: array expected";for(var e=0;e<t.permissions.length;++e)if(!n.isString(t.permissions[e]))return"permissions: string[] expected"}return null},s.fromObject=function(t){if(t instanceof r.SessionsSocketDescriptor)return t;var e=new r.SessionsSocketDescriptor;if(null!=t.session&&(e.session=String(t.session)),null!=t.user&&(e.user=String(t.user)),null!=t.role&&(e.role=String(t.role)),t.permissions){if(!Array.isArray(t.permissions))throw TypeError(".SessionsSocketDescriptor.permissions: array expected");e.permissions=[];for(var n=0;n<t.permissions.length;++n)e.permissions[n]=String(t.permissions[n])}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.permissions=[]),e.defaults&&(n.session="",n.user="",n.role=""),null!=t.session&&t.hasOwnProperty("session")&&(n.session=t.session),null!=t.user&&t.hasOwnProperty("user")&&(n.user=t.user),null!=t.role&&t.hasOwnProperty("role")&&(n.role=t.role),t.permissions&&t.permissions.length){n.permissions=[];for(var r=0;r<t.permissions.length;++r)n.permissions[r]=t.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SessionsSocketDescriptor"},s}(),r.SessionsConnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.sessionType=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.sessionType&&Object.hasOwnProperty.call(t,"sessionType")&&n.uint32(16).uint32(t.sessionType),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SessionsConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.sessionType=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.sessionType&&t.hasOwnProperty("sessionType")&&!n.isInteger(t.sessionType)?"sessionType: integer expected":null},s.fromObject=function(t){if(t instanceof r.SessionsConnectMessage)return t;var e=new r.SessionsConnectMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.sessionType&&(e.sessionType=t.sessionType>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.sessionType=0),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.sessionType&&t.hasOwnProperty("sessionType")&&(n.sessionType=t.sessionType),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SessionsConnectMessage"},s}(),r.SocketConnectMessage=function(){function s(t){if(this.permissions=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.userId="",s.prototype.role="",s.prototype.permissions=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.userId&&Object.hasOwnProperty.call(t,"userId")&&n.uint32(18).string(t.userId),null!=t.role&&Object.hasOwnProperty.call(t,"role")&&n.uint32(26).string(t.role),null!=t.permissions&&t.permissions.length)for(var r=0;r<t.permissions.length;++r)n.uint32(34).string(t.permissions[r]);return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SocketConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.userId=e.string();break;case 3:i.role=e.string();break;case 4:i.permissions&&i.permissions.length||(i.permissions=[]),i.permissions.push(e.string());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id))return"id: string expected";if(null!=t.userId&&t.hasOwnProperty("userId")&&!n.isString(t.userId))return"userId: string expected";if(null!=t.role&&t.hasOwnProperty("role")&&!n.isString(t.role))return"role: string expected";if(null!=t.permissions&&t.hasOwnProperty("permissions")){if(!Array.isArray(t.permissions))return"permissions: array expected";for(var e=0;e<t.permissions.length;++e)if(!n.isString(t.permissions[e]))return"permissions: string[] expected"}return null},s.fromObject=function(t){if(t instanceof r.SocketConnectMessage)return t;var e=new r.SocketConnectMessage;if(null!=t.id&&(e.id=String(t.id)),null!=t.userId&&(e.userId=String(t.userId)),null!=t.role&&(e.role=String(t.role)),t.permissions){if(!Array.isArray(t.permissions))throw TypeError(".SocketConnectMessage.permissions: array expected");e.permissions=[];for(var n=0;n<t.permissions.length;++n)e.permissions[n]=String(t.permissions[n])}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.permissions=[]),e.defaults&&(n.id="",n.userId="",n.role=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.userId&&t.hasOwnProperty("userId")&&(n.userId=t.userId),null!=t.role&&t.hasOwnProperty("role")&&(n.role=t.role),t.permissions&&t.permissions.length){n.permissions=[];for(var r=0;r<t.permissions.length;++r)n.permissions[r]=t.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SocketConnectMessage"},s}(),r.SocketDisconnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SocketDisconnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.id=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null},s.fromObject=function(t){if(t instanceof r.SocketDisconnectMessage)return t;var e=new r.SocketDisconnectMessage;return null!=t.id&&(e.id=String(t.id)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SocketDisconnectMessage"},s}(),r.SessionsConnectResponse=function(){function s(t){if(this.sockets=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.sockets=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.sockets&&t.sockets.length)for(var s=0;s<t.sockets.length;++s)r.SessionsSocketDescriptor.encode(t.sockets[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SessionsConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.sockets&&i.sockets.length||(i.sockets=[]),i.sockets.push(r.SessionsSocketDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.sockets&&t.hasOwnProperty("sockets")){if(!Array.isArray(t.sockets))return"sockets: array expected";for(var e=0;e<t.sockets.length;++e){var s=r.SessionsSocketDescriptor.verify(t.sockets[e]);if(s)return"sockets."+s}}return null},s.fromObject=function(t){if(t instanceof r.SessionsConnectResponse)return t;var e=new r.SessionsConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),t.sockets){if(!Array.isArray(t.sockets))throw TypeError(".SessionsConnectResponse.sockets: array expected");e.sockets=[];for(var n=0;n<t.sockets.length;++n){if("object"!=typeof t.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");e.sockets[n]=r.SessionsSocketDescriptor.fromObject(t.sockets[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.sockets=[]),e.defaults&&(n.channel=""),null!=t.channel&&t.hasOwnProperty("channel")&&(n.channel=t.channel),t.sockets&&t.sockets.length){n.sockets=[];for(var s=0;s<t.sockets.length;++s)n.sockets[s]=r.SessionsSocketDescriptor.toObject(t.sockets[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SessionsConnectResponse"},s}(),r.SuggestionDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.authorId&&Object.hasOwnProperty.call(t,"authorId")&&n.uint32(18).string(t.authorId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(26).string(t.type),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(34).string(t.createdAt),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(42).string(t.data),null!=t.hasComments&&Object.hasOwnProperty.call(t,"hasComments")&&n.uint32(48).bool(t.hasComments),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(58).string(t.state),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(66).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SuggestionDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.authorId=e.string();break;case 3:i.type=e.string();break;case 4:i.createdAt=e.string();break;case 5:i.data=e.string();break;case 6:i.hasComments=e.bool();break;case 7:i.state=e.string();break;case 8:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.authorId&&t.hasOwnProperty("authorId")&&!n.isString(t.authorId)?"authorId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.hasComments&&t.hasOwnProperty("hasComments")&&"boolean"!=typeof t.hasComments?"hasComments: boolean expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.SuggestionDescriptor)return t;var e=new r.SuggestionDescriptor;return null!=t.id&&(e.id=String(t.id)),null!=t.authorId&&(e.authorId=String(t.authorId)),null!=t.type&&(e.type=String(t.type)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.data&&(e.data=String(t.data)),null!=t.hasComments&&(e.hasComments=Boolean(t.hasComments)),null!=t.state&&(e.state=String(t.state)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.authorId&&t.hasOwnProperty("authorId")&&(n.authorId=t.authorId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.hasComments&&t.hasOwnProperty("hasComments")&&(n.hasComments=t.hasComments),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SuggestionDescriptor"},s}(),r.TrackChangesAddSuggestionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.type="",s.prototype.data="",s.prototype.originalSuggestionId="",s.prototype.attributes="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(26).string(t.type),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(34).string(t.data),null!=t.originalSuggestionId&&Object.hasOwnProperty.call(t,"originalSuggestionId")&&n.uint32(42).string(t.originalSuggestionId),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(50).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesAddSuggestionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.documentId=e.string();break;case 3:i.type=e.string();break;case 4:i.data=e.string();break;case 5:i.originalSuggestionId=e.string();break;case 6:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.originalSuggestionId&&t.hasOwnProperty("originalSuggestionId")&&!n.isString(t.originalSuggestionId)?"originalSuggestionId: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesAddSuggestionMessage)return t;var e=new r.TrackChangesAddSuggestionMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.type&&(e.type=String(t.type)),null!=t.data&&(e.data=String(t.data)),null!=t.originalSuggestionId&&(e.originalSuggestionId=String(t.originalSuggestionId)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.documentId="",n.type="",n.data="",n.originalSuggestionId="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.originalSuggestionId&&t.hasOwnProperty("originalSuggestionId")&&(n.originalSuggestionId=t.originalSuggestionId),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesAddSuggestionMessage"},s}(),r.TrackChangesBatchUpdateSuggestionsStateMessage=function(){function s(t){if(this.ids=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.ids=n.emptyArray,s.prototype.documentId="",s.prototype.state="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.ids&&t.ids.length)for(var r=0;r<t.ids.length;++r)n.uint32(10).string(t.ids[r]);return null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(26).string(t.state),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesBatchUpdateSuggestionsStateMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.ids&&i.ids.length||(i.ids=[]),i.ids.push(e.string());break;case 2:i.documentId=e.string();break;case 3:i.state=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.ids&&t.hasOwnProperty("ids")){if(!Array.isArray(t.ids))return"ids: array expected";for(var e=0;e<t.ids.length;++e)if(!n.isString(t.ids[e]))return"ids: string[] expected"}return null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesBatchUpdateSuggestionsStateMessage)return t;var e=new r.TrackChangesBatchUpdateSuggestionsStateMessage;if(t.ids){if(!Array.isArray(t.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");e.ids=[];for(var n=0;n<t.ids.length;++n)e.ids[n]=String(t.ids[n])}return null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.state&&(e.state=String(t.state)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.ids=[]),e.defaults&&(n.documentId="",n.state=""),t.ids&&t.ids.length){n.ids=[];for(var r=0;r<t.ids.length;++r)n.ids[r]=t.ids[r]}return null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesBatchUpdateSuggestionsStateMessage"},s}(),r.TrackChangesConnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesConnectMessage)return t;var e=new r.TrackChangesConnectMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesConnectMessage"},s}(),r.TrackChangesGetAllSuggestionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesGetAllSuggestionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesGetAllSuggestionMessage)return t;var e=new r.TrackChangesGetAllSuggestionMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesGetAllSuggestionMessage"},s}(),r.TrackChangesGetSuggestionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesGetSuggestionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesGetSuggestionMessage)return t;var e=new r.TrackChangesGetSuggestionMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.documentId=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesGetSuggestionMessage"},s}(),r.TrackChangesUpdateSuggestionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.hasComments&&Object.hasOwnProperty.call(t,"hasComments")&&n.uint32(24).bool(t.hasComments),null!=t.isHasCommentsModified&&Object.hasOwnProperty.call(t,"isHasCommentsModified")&&n.uint32(32).bool(t.isHasCommentsModified),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(42).string(t.state),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(50).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesUpdateSuggestionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.documentId=e.string();break;case 3:i.hasComments=e.bool();break;case 4:i.isHasCommentsModified=e.bool();break;case 5:i.state=e.string();break;case 6:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.hasComments&&t.hasOwnProperty("hasComments")&&"boolean"!=typeof t.hasComments?"hasComments: boolean expected":null!=t.isHasCommentsModified&&t.hasOwnProperty("isHasCommentsModified")&&"boolean"!=typeof t.isHasCommentsModified?"isHasCommentsModified: boolean expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesUpdateSuggestionMessage)return t;var e=new r.TrackChangesUpdateSuggestionMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.hasComments&&(e.hasComments=Boolean(t.hasComments)),null!=t.isHasCommentsModified&&(e.isHasCommentsModified=Boolean(t.isHasCommentsModified)),null!=t.state&&(e.state=String(t.state)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.documentId="",n.hasComments=!1,n.isHasCommentsModified=!1,n.state="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.hasComments&&t.hasOwnProperty("hasComments")&&(n.hasComments=t.hasComments),null!=t.isHasCommentsModified&&t.hasOwnProperty("isHasCommentsModified")&&(n.isHasCommentsModified=t.isHasCommentsModified),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesUpdateSuggestionMessage"},s}(),r.TrackChangesAddSuggestionResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.authorId&&Object.hasOwnProperty.call(t,"authorId")&&n.uint32(18).string(t.authorId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(26).string(t.type),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(34).string(t.createdAt),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(42).string(t.data),null!=t.hasComments&&Object.hasOwnProperty.call(t,"hasComments")&&n.uint32(48).bool(t.hasComments),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(58).string(t.state),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(66).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesAddSuggestionResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.authorId=e.string();break;case 3:i.type=e.string();break;case 4:i.createdAt=e.string();break;case 5:i.data=e.string();break;case 6:i.hasComments=e.bool();break;case 7:i.state=e.string();break;case 8:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.authorId&&t.hasOwnProperty("authorId")&&!n.isString(t.authorId)?"authorId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.hasComments&&t.hasOwnProperty("hasComments")&&"boolean"!=typeof t.hasComments?"hasComments: boolean expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesAddSuggestionResponse)return t;var e=new r.TrackChangesAddSuggestionResponse;return null!=t.id&&(e.id=String(t.id)),null!=t.authorId&&(e.authorId=String(t.authorId)),null!=t.type&&(e.type=String(t.type)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.data&&(e.data=String(t.data)),null!=t.hasComments&&(e.hasComments=Boolean(t.hasComments)),null!=t.state&&(e.state=String(t.state)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.authorId&&t.hasOwnProperty("authorId")&&(n.authorId=t.authorId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.hasComments&&t.hasOwnProperty("hasComments")&&(n.hasComments=t.hasComments),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesAddSuggestionResponse"},s}(),r.TrackChangesConnectResponse=function(){function s(t){if(this.suggestions=[],this.suggestionsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.suggestions=n.emptyArray,s.prototype.suggestionsV2=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.suggestions&&t.suggestions.length)for(var s=0;s<t.suggestions.length;++s)n.uint32(18).string(t.suggestions[s]);if(null!=t.suggestionsV2&&t.suggestionsV2.length)for(s=0;s<t.suggestionsV2.length;++s)r.SuggestionDescriptor.encode(t.suggestionsV2[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.suggestions&&i.suggestions.length||(i.suggestions=[]),i.suggestions.push(e.string());break;case 3:i.suggestionsV2&&i.suggestionsV2.length||(i.suggestionsV2=[]),i.suggestionsV2.push(r.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.suggestions&&t.hasOwnProperty("suggestions")){if(!Array.isArray(t.suggestions))return"suggestions: array expected";for(var e=0;e<t.suggestions.length;++e)if(!n.isString(t.suggestions[e]))return"suggestions: string[] expected"}if(null!=t.suggestionsV2&&t.hasOwnProperty("suggestionsV2")){if(!Array.isArray(t.suggestionsV2))return"suggestionsV2: array expected";for(e=0;e<t.suggestionsV2.length;++e){var s=r.SuggestionDescriptor.verify(t.suggestionsV2[e]);if(s)return"suggestionsV2."+s}}return null},s.fromObject=function(t){if(t instanceof r.TrackChangesConnectResponse)return t;var e=new r.TrackChangesConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),t.suggestions){if(!Array.isArray(t.suggestions))throw TypeError(".TrackChangesConnectResponse.suggestions: array expected");e.suggestions=[];for(var n=0;n<t.suggestions.length;++n)e.suggestions[n]=String(t.suggestions[n])}if(t.suggestionsV2){if(!Array.isArray(t.suggestionsV2))throw TypeError(".TrackChangesConnectResponse.suggestionsV2: array expected");for(e.suggestionsV2=[],n=0;n<t.suggestionsV2.length;++n){if("object"!=typeof t.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");e.suggestionsV2[n]=r.SuggestionDescriptor.fromObject(t.suggestionsV2[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.defaults&&(n.channel=""),null!=t.channel&&t.hasOwnProperty("channel")&&(n.channel=t.channel),t.suggestions&&t.suggestions.length){n.suggestions=[];for(var s=0;s<t.suggestions.length;++s)n.suggestions[s]=t.suggestions[s]}if(t.suggestionsV2&&t.suggestionsV2.length)for(n.suggestionsV2=[],s=0;s<t.suggestionsV2.length;++s)n.suggestionsV2[s]=r.SuggestionDescriptor.toObject(t.suggestionsV2[s],e);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesConnectResponse"},s}(),r.TrackChangesGetAllSuggestionsResponse=function(){function s(t){if(this.suggestions=[],this.suggestionsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.suggestions=n.emptyArray,s.prototype.suggestionsV2=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.suggestions&&t.suggestions.length)for(var s=0;s<t.suggestions.length;++s)n.uint32(10).string(t.suggestions[s]);if(null!=t.suggestionsV2&&t.suggestionsV2.length)for(s=0;s<t.suggestionsV2.length;++s)r.SuggestionDescriptor.encode(t.suggestionsV2[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesGetAllSuggestionsResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.suggestions&&i.suggestions.length||(i.suggestions=[]),i.suggestions.push(e.string());break;case 2:i.suggestionsV2&&i.suggestionsV2.length||(i.suggestionsV2=[]),i.suggestionsV2.push(r.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.suggestions&&t.hasOwnProperty("suggestions")){if(!Array.isArray(t.suggestions))return"suggestions: array expected";for(var e=0;e<t.suggestions.length;++e)if(!n.isString(t.suggestions[e]))return"suggestions: string[] expected"}if(null!=t.suggestionsV2&&t.hasOwnProperty("suggestionsV2")){if(!Array.isArray(t.suggestionsV2))return"suggestionsV2: array expected";for(e=0;e<t.suggestionsV2.length;++e){var s=r.SuggestionDescriptor.verify(t.suggestionsV2[e]);if(s)return"suggestionsV2."+s}}return null},s.fromObject=function(t){if(t instanceof r.TrackChangesGetAllSuggestionsResponse)return t;var e=new r.TrackChangesGetAllSuggestionsResponse;if(t.suggestions){if(!Array.isArray(t.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");e.suggestions=[];for(var n=0;n<t.suggestions.length;++n)e.suggestions[n]=String(t.suggestions[n])}if(t.suggestionsV2){if(!Array.isArray(t.suggestionsV2))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: array expected");for(e.suggestionsV2=[],n=0;n<t.suggestionsV2.length;++n){if("object"!=typeof t.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");e.suggestionsV2[n]=r.SuggestionDescriptor.fromObject(t.suggestionsV2[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),t.suggestions&&t.suggestions.length){n.suggestions=[];for(var s=0;s<t.suggestions.length;++s)n.suggestions[s]=t.suggestions[s]}if(t.suggestionsV2&&t.suggestionsV2.length)for(n.suggestionsV2=[],s=0;s<t.suggestionsV2.length;++s)n.suggestionsV2[s]=r.SuggestionDescriptor.toObject(t.suggestionsV2[s],e);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesGetAllSuggestionsResponse"},s}(),r.TrackChangesGetSuggestionResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.authorId&&Object.hasOwnProperty.call(t,"authorId")&&n.uint32(18).string(t.authorId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(26).string(t.type),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(34).string(t.createdAt),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(42).string(t.data),null!=t.hasComments&&Object.hasOwnProperty.call(t,"hasComments")&&n.uint32(48).bool(t.hasComments),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(58).string(t.state),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(66).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesGetSuggestionResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.authorId=e.string();break;case 3:i.type=e.string();break;case 4:i.createdAt=e.string();break;case 5:i.data=e.string();break;case 6:i.hasComments=e.bool();break;case 7:i.state=e.string();break;case 8:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.authorId&&t.hasOwnProperty("authorId")&&!n.isString(t.authorId)?"authorId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.hasComments&&t.hasOwnProperty("hasComments")&&"boolean"!=typeof t.hasComments?"hasComments: boolean expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesGetSuggestionResponse)return t;var e=new r.TrackChangesGetSuggestionResponse;return null!=t.id&&(e.id=String(t.id)),null!=t.authorId&&(e.authorId=String(t.authorId)),null!=t.type&&(e.type=String(t.type)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.data&&(e.data=String(t.data)),null!=t.hasComments&&(e.hasComments=Boolean(t.hasComments)),null!=t.state&&(e.state=String(t.state)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.authorId&&t.hasOwnProperty("authorId")&&(n.authorId=t.authorId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.hasComments&&t.hasOwnProperty("hasComments")&&(n.hasComments=t.hasComments),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesGetSuggestionResponse"},s}(),r.UserDescriptor=function(){function s(t){if(this.attributes=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.attributes=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.attributes&&t.attributes.length)for(var s=0;s<t.attributes.length;++s)r.KeyValueDescriptor.encode(t.attributes[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.UserDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?(i.attributes&&i.attributes.length||(i.attributes=[]),i.attributes.push(r.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")){if(!Array.isArray(t.attributes))return"attributes: array expected";for(var e=0;e<t.attributes.length;++e){var n=r.KeyValueDescriptor.verify(t.attributes[e]);if(n)return"attributes."+n}}return null},s.fromObject=function(t){if(t instanceof r.UserDescriptor)return t;var e=new r.UserDescriptor;if(t.attributes){if(!Array.isArray(t.attributes))throw TypeError(".UserDescriptor.attributes: array expected");e.attributes=[];for(var n=0;n<t.attributes.length;++n){if("object"!=typeof t.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");e.attributes[n]=r.KeyValueDescriptor.fromObject(t.attributes[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.attributes=[]),t.attributes&&t.attributes.length){n.attributes=[];for(var s=0;s<t.attributes.length;++s)n.attributes[s]=r.KeyValueDescriptor.toObject(t.attributes[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/UserDescriptor"},s}(),r.GetManyUsersMessage=function(){function s(t){if(this.ids=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.ids=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.ids&&t.ids.length)for(var r=0;r<t.ids.length;++r)n.uint32(10).string(t.ids[r]);return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetManyUsersMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?(i.ids&&i.ids.length||(i.ids=[]),i.ids.push(e.string())):e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.ids&&t.hasOwnProperty("ids")){if(!Array.isArray(t.ids))return"ids: array expected";for(var e=0;e<t.ids.length;++e)if(!n.isString(t.ids[e]))return"ids: string[] expected"}return null},s.fromObject=function(t){if(t instanceof r.GetManyUsersMessage)return t;var e=new r.GetManyUsersMessage;if(t.ids){if(!Array.isArray(t.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");e.ids=[];for(var n=0;n<t.ids.length;++n)e.ids[n]=String(t.ids[n])}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.ids=[]),t.ids&&t.ids.length){n.ids=[];for(var r=0;r<t.ids.length;++r)n.ids[r]=t.ids[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetManyUsersMessage"},s}(),r.GetUserMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetUserMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.id=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null},s.fromObject=function(t){if(t instanceof r.GetUserMessage)return t;var e=new r.GetUserMessage;return null!=t.id&&(e.id=String(t.id)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetUserMessage"},s}(),r.GetManyUsersResponse=function(){function s(t){if(this.users=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.users=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.users&&t.users.length)for(var s=0;s<t.users.length;++s)r.UserDescriptor.encode(t.users[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetManyUsersResponse;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?(i.users&&i.users.length||(i.users=[]),i.users.push(r.UserDescriptor.decode(e,e.uint32()))):e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.users&&t.hasOwnProperty("users")){if(!Array.isArray(t.users))return"users: array expected";for(var e=0;e<t.users.length;++e){var n=r.UserDescriptor.verify(t.users[e]);if(n)return"users."+n}}return null},s.fromObject=function(t){if(t instanceof r.GetManyUsersResponse)return t;var e=new r.GetManyUsersResponse;if(t.users){if(!Array.isArray(t.users))throw TypeError(".GetManyUsersResponse.users: array expected");e.users=[];for(var n=0;n<t.users.length;++n){if("object"!=typeof t.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");e.users[n]=r.UserDescriptor.fromObject(t.users[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.users=[]),t.users&&t.users.length){n.users=[];for(var s=0;s<t.users.length;++s)n.users[s]=r.UserDescriptor.toObject(t.users[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetManyUsersResponse"},s}(),r.GetUserResponse=function(){function s(t){if(this.attributes=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.attributes=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.attributes&&t.attributes.length)for(var s=0;s<t.attributes.length;++s)r.KeyValueDescriptor.encode(t.attributes[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetUserResponse;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?(i.attributes&&i.attributes.length||(i.attributes=[]),i.attributes.push(r.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")){if(!Array.isArray(t.attributes))return"attributes: array expected";for(var e=0;e<t.attributes.length;++e){var n=r.KeyValueDescriptor.verify(t.attributes[e]);if(n)return"attributes."+n}}return null},s.fromObject=function(t){if(t instanceof r.GetUserResponse)return t;var e=new r.GetUserResponse;if(t.attributes){if(!Array.isArray(t.attributes))throw TypeError(".GetUserResponse.attributes: array expected");e.attributes=[];for(var n=0;n<t.attributes.length;++n){if("object"!=typeof t.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");e.attributes[n]=r.KeyValueDescriptor.fromObject(t.attributes[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.attributes=[]),t.attributes&&t.attributes.length){n.attributes=[];for(var s=0;s<t.attributes.length;++s)n.attributes[s]=r.KeyValueDescriptor.toObject(t.attributes[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetUserResponse"},s}(),r.ChannelMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.type=0,s.prototype.socketId="",s.prototype.data=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(8).uint32(t.type),null!=t.socketId&&Object.hasOwnProperty.call(t,"socketId")&&n.uint32(18).string(t.socketId),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(26).bytes(t.data),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.ChannelMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.type=e.uint32();break;case 2:i.socketId=e.string();break;case 3:i.data=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isInteger(t.type)?"type: integer expected":null!=t.socketId&&t.hasOwnProperty("socketId")&&!n.isString(t.socketId)?"socketId: string expected":null!=t.data&&t.hasOwnProperty("data")&&!(t.data&&"number"==typeof t.data.length||n.isString(t.data))?"data: buffer expected":null},s.fromObject=function(t){if(t instanceof r.ChannelMessage)return t;var e=new r.ChannelMessage;return null!=t.type&&(e.type=t.type>>>0),null!=t.socketId&&(e.socketId=String(t.socketId)),null!=t.data&&("string"==typeof t.data?n.base64.decode(t.data,e.data=n.newBuffer(n.base64.length(t.data)),0):t.data.length>=0&&(e.data=t.data)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.type=0,r.socketId="",e.bytes===String?r.data="":(r.data=[],e.bytes!==Array&&(r.data=n.newBuffer(r.data)))),null!=t.type&&t.hasOwnProperty("type")&&(r.type=t.type),null!=t.socketId&&t.hasOwnProperty("socketId")&&(r.socketId=t.socketId),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?n.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/ChannelMessage"},s}(),r.BytesBytesPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=n.newBuffer([]),s.prototype.data1=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).bytes(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).bytes(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.BytesBytesPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.bytes();break;case 2:i.data1=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!(t.data&&"number"==typeof t.data.length||n.isString(t.data))?"data: buffer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!(t.data1&&"number"==typeof t.data1.length||n.isString(t.data1))?"data1: buffer expected":null},s.fromObject=function(t){if(t instanceof r.BytesBytesPacketDataMessage)return t;var e=new r.BytesBytesPacketDataMessage;return null!=t.data&&("string"==typeof t.data?n.base64.decode(t.data,e.data=n.newBuffer(n.base64.length(t.data)),0):t.data.length>=0&&(e.data=t.data)),null!=t.data1&&("string"==typeof t.data1?n.base64.decode(t.data1,e.data1=n.newBuffer(n.base64.length(t.data1)),0):t.data1.length>=0&&(e.data1=t.data1)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.data="":(r.data=[],e.bytes!==Array&&(r.data=n.newBuffer(r.data))),e.bytes===String?r.data1="":(r.data1=[],e.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?n.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(r.data1=e.bytes===String?n.base64.encode(t.data1,0,t.data1.length):e.bytes===Array?Array.prototype.slice.call(t.data1):t.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/BytesBytesPacketDataMessage"},s}(),r.NumberBytesPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=0,s.prototype.data1=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(8).uint32(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).bytes(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.NumberBytesPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.uint32();break;case 2:i.data1=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isInteger(t.data)?"data: integer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!(t.data1&&"number"==typeof t.data1.length||n.isString(t.data1))?"data1: buffer expected":null},s.fromObject=function(t){if(t instanceof r.NumberBytesPacketDataMessage)return t;var e=new r.NumberBytesPacketDataMessage;return null!=t.data&&(e.data=t.data>>>0),null!=t.data1&&("string"==typeof t.data1?n.base64.decode(t.data1,e.data1=n.newBuffer(n.base64.length(t.data1)),0):t.data1.length>=0&&(e.data1=t.data1)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.data=0,e.bytes===String?r.data1="":(r.data1=[],e.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=t.data&&t.hasOwnProperty("data")&&(r.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(r.data1=e.bytes===String?n.base64.encode(t.data1,0,t.data1.length):e.bytes===Array?Array.prototype.slice.call(t.data1):t.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/NumberBytesPacketDataMessage"},s}(),r.NumberNumberPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=0,s.prototype.data1=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(8).uint32(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(16).uint32(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.NumberNumberPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.uint32();break;case 2:i.data1=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isInteger(t.data)?"data: integer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isInteger(t.data1)?"data1: integer expected":null},s.fromObject=function(t){if(t instanceof r.NumberNumberPacketDataMessage)return t;var e=new r.NumberNumberPacketDataMessage;return null!=t.data&&(e.data=t.data>>>0),null!=t.data1&&(e.data1=t.data1>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data=0,n.data1=0),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/NumberNumberPacketDataMessage"},s}(),r.NumberObjectPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(8).uint32(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.NumberObjectPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.uint32();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isInteger(t.data)?"data: integer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.NumberObjectPacketDataMessage)return t;var e=new r.NumberObjectPacketDataMessage;return null!=t.data&&(e.data=t.data>>>0),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data=0,n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/NumberObjectPacketDataMessage"},s}(),r.NumberStringPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(8).uint32(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.NumberStringPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.uint32();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isInteger(t.data)?"data: integer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.NumberStringPacketDataMessage)return t;var e=new r.NumberStringPacketDataMessage;return null!=t.data&&(e.data=t.data>>>0),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data=0,n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/NumberStringPacketDataMessage"},s}(),r.ObjectBufferPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).bytes(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.ObjectBufferPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!(t.data1&&"number"==typeof t.data1.length||n.isString(t.data1))?"data1: buffer expected":null},s.fromObject=function(t){if(t instanceof r.ObjectBufferPacketDataMessage)return t;var e=new r.ObjectBufferPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&("string"==typeof t.data1?n.base64.decode(t.data1,e.data1=n.newBuffer(n.base64.length(t.data1)),0):t.data1.length>=0&&(e.data1=t.data1)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.data="",e.bytes===String?r.data1="":(r.data1=[],e.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=t.data&&t.hasOwnProperty("data")&&(r.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(r.data1=e.bytes===String?n.base64.encode(t.data1,0,t.data1.length):e.bytes===Array?Array.prototype.slice.call(t.data1):t.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/ObjectBufferPacketDataMessage"},s}(),r.ObjectObjectPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.ObjectObjectPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.ObjectObjectPacketDataMessage)return t;var e=new r.ObjectObjectPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data="",n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/ObjectObjectPacketDataMessage"},s}(),r.PacketMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.type=0,s.prototype.id=0,s.prototype.nsp="",s.prototype.data=n.newBuffer([]),s.prototype.options=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(8).uint32(t.type),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(16).uint32(t.id),null!=t.nsp&&Object.hasOwnProperty.call(t,"nsp")&&n.uint32(26).string(t.nsp),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(34).bytes(t.data),null!=t.options&&Object.hasOwnProperty.call(t,"options")&&n.uint32(42).bytes(t.options),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.PacketMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.type=e.uint32();break;case 2:i.id=e.uint32();break;case 3:i.nsp=e.string();break;case 4:i.data=e.bytes();break;case 5:i.options=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isInteger(t.type)?"type: integer expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isInteger(t.id)?"id: integer expected":null!=t.nsp&&t.hasOwnProperty("nsp")&&!n.isString(t.nsp)?"nsp: string expected":null!=t.data&&t.hasOwnProperty("data")&&!(t.data&&"number"==typeof t.data.length||n.isString(t.data))?"data: buffer expected":null!=t.options&&t.hasOwnProperty("options")&&!(t.options&&"number"==typeof t.options.length||n.isString(t.options))?"options: buffer expected":null},s.fromObject=function(t){if(t instanceof r.PacketMessage)return t;var e=new r.PacketMessage;return null!=t.type&&(e.type=t.type>>>0),null!=t.id&&(e.id=t.id>>>0),null!=t.nsp&&(e.nsp=String(t.nsp)),null!=t.data&&("string"==typeof t.data?n.base64.decode(t.data,e.data=n.newBuffer(n.base64.length(t.data)),0):t.data.length>=0&&(e.data=t.data)),null!=t.options&&("string"==typeof t.options?n.base64.decode(t.options,e.options=n.newBuffer(n.base64.length(t.options)),0):t.options.length>=0&&(e.options=t.options)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.type=0,r.id=0,r.nsp="",e.bytes===String?r.data="":(r.data=[],e.bytes!==Array&&(r.data=n.newBuffer(r.data))),e.bytes===String?r.options="":(r.options=[],e.bytes!==Array&&(r.options=n.newBuffer(r.options)))),null!=t.type&&t.hasOwnProperty("type")&&(r.type=t.type),null!=t.id&&t.hasOwnProperty("id")&&(r.id=t.id),null!=t.nsp&&t.hasOwnProperty("nsp")&&(r.nsp=t.nsp),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?n.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data),null!=t.options&&t.hasOwnProperty("options")&&(r.options=e.bytes===String?n.base64.encode(t.options,0,t.options.length):e.bytes===Array?Array.prototype.slice.call(t.options):t.options),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/PacketMessage"},s}(),r.PacketOptionsMessage=function(){function s(t){if(this.rooms=[],this.except=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.flags="",s.prototype.rooms=n.emptyArray,s.prototype.except=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.flags&&Object.hasOwnProperty.call(t,"flags")&&n.uint32(10).string(t.flags),null!=t.rooms&&t.rooms.length)for(var r=0;r<t.rooms.length;++r)n.uint32(18).string(t.rooms[r]);if(null!=t.except&&t.except.length)for(r=0;r<t.except.length;++r)n.uint32(26).string(t.except[r]);return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.PacketOptionsMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.flags=e.string();break;case 2:i.rooms&&i.rooms.length||(i.rooms=[]),i.rooms.push(e.string());break;case 3:i.except&&i.except.length||(i.except=[]),i.except.push(e.string());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.flags&&t.hasOwnProperty("flags")&&!n.isString(t.flags))return"flags: string expected";if(null!=t.rooms&&t.hasOwnProperty("rooms")){if(!Array.isArray(t.rooms))return"rooms: array expected";for(var e=0;e<t.rooms.length;++e)if(!n.isString(t.rooms[e]))return"rooms: string[] expected"}if(null!=t.except&&t.hasOwnProperty("except")){if(!Array.isArray(t.except))return"except: array expected";for(e=0;e<t.except.length;++e)if(!n.isString(t.except[e]))return"except: string[] expected"}return null},s.fromObject=function(t){if(t instanceof r.PacketOptionsMessage)return t;var e=new r.PacketOptionsMessage;if(null!=t.flags&&(e.flags=String(t.flags)),t.rooms){if(!Array.isArray(t.rooms))throw TypeError(".PacketOptionsMessage.rooms: array expected");e.rooms=[];for(var n=0;n<t.rooms.length;++n)e.rooms[n]=String(t.rooms[n])}if(t.except){if(!Array.isArray(t.except))throw TypeError(".PacketOptionsMessage.except: array expected");for(e.except=[],n=0;n<t.except.length;++n)e.except[n]=String(t.except[n])}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.rooms=[],n.except=[]),e.defaults&&(n.flags=""),null!=t.flags&&t.hasOwnProperty("flags")&&(n.flags=t.flags),t.rooms&&t.rooms.length){n.rooms=[];for(var r=0;r<t.rooms.length;++r)n.rooms[r]=t.rooms[r]}if(t.except&&t.except.length)for(n.except=[],r=0;r<t.except.length;++r)n.except[r]=t.except[r];return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/PacketOptionsMessage"},s}(),r.StringBytesPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).bytes(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.StringBytesPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!(t.data1&&"number"==typeof t.data1.length||n.isString(t.data1))?"data1: buffer expected":null},s.fromObject=function(t){if(t instanceof r.StringBytesPacketDataMessage)return t;var e=new r.StringBytesPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&("string"==typeof t.data1?n.base64.decode(t.data1,e.data1=n.newBuffer(n.base64.length(t.data1)),0):t.data1.length>=0&&(e.data1=t.data1)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.data="",e.bytes===String?r.data1="":(r.data1=[],e.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=t.data&&t.hasOwnProperty("data")&&(r.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(r.data1=e.bytes===String?n.base64.encode(t.data1,0,t.data1.length):e.bytes===Array?Array.prototype.slice.call(t.data1):t.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringBytesPacketDataMessage"},s}(),r.StringNumberPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(16).uint32(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.StringNumberPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isInteger(t.data1)?"data1: integer expected":null},s.fromObject=function(t){if(t instanceof r.StringNumberPacketDataMessage)return t;var e=new r.StringNumberPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&(e.data1=t.data1>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data="",n.data1=0),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringNumberPacketDataMessage"},s}(),r.StringObjectPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.StringObjectPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.StringObjectPacketDataMessage)return t;var e=new r.StringObjectPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data="",n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringObjectPacketDataMessage"},s}(),r.StringStringPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.StringStringPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.StringStringPacketDataMessage)return t;var e=new r.StringStringPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data="",n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringStringPacketDataMessage"},s}(),r})();class l{static decode(t,e){const n=p(e).decode("undefined"==typeof window?t:new Uint8Array(t));return e.fromJSON({...n})}static encode(t){const e=p(t.constructor),n=t.toJSON(),r=e.verify(n);if(r)throw Error(r);return e.encode(e.create(n)).finish()}}function p(t){return u[t.DESCRIPTOR_NAME]}class h extends i{ids;static TYPE="22";static READABLE_TYPE_NAME="getManyUsers";static DESCRIPTOR_NAME="GetManyUsersMessage";static DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};constructor(t){super(),this.ids=t}toJSON(){return{ids:this.ids}}static fromJSON(t){return new h(t.ids)}}class f extends i{users;static DESCRIPTOR_NAME="GetManyUsersResponse";static DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};constructor(t){super(),this.users=t}toJSON(){return{users:this.users.map(m)}}static fromJSON(t){return new f(t.users.map(y))}}function m(t){return{attributes:Object.keys(t).map(e=>({key:e,value:JSON.stringify(t[e])}))}}function y(t){return t.attributes.reduce((t,e)=>(t[e.key]=e.value?JSON.parse(e.value):null,t),{})}class g{static _SERVICE=2;constructor(t={}){this._attributes=new Map;for(const e of Object.keys(t))"id"!==e?(this._attributes.set(e,t[e]),Object.defineProperty(this,e,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(e)})):this.id=t.id}static fromData(t){return new g(t)}static async get(t,e){const n=new a(e);try{const e=await t._sendRequest(g._SERVICE,a.TYPE,l.encode(n)),r=l.decode(e,c);return new g(r.attributes)}catch(t){return new g({id:e})}}static async getMany(t,e){const n=new h(e);try{const e=await t._sendRequest(g._SERVICE,h.TYPE,l.encode(n));return l.decode(e,f).users.map(t=>new g(t))}catch(t){return e.map(t=>new g({id:t}))}}}const b=g,O=Object.create(null);O.open="0",O.close="1",O.ping="2",O.pong="3",O.message="4",O.upgrade="5",O.noop="6";const w=Object.create(null);Object.keys(O).forEach(t=>{w[O[t]]=t});const v={type:"error",data:"parser error"},I="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),S="function"==typeof ArrayBuffer,k=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,P=({type:t,data:e},n,r)=>I&&e instanceof Blob?n?r(e):A(e,r):S&&(e instanceof ArrayBuffer||k(e))?n?r(e):A(new Blob([e]),r):r(O[t]+(e||"")),A=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+(t||""))},n.readAsDataURL(t)};function T(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let _;const C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)j[C.charCodeAt(t)]=t;const E="function"==typeof ArrayBuffer,D=(t,e)=>{if("string"!=typeof t)return{type:"message",data:x(t,e)};const n=t.charAt(0);if("b"===n)return{type:"message",data:R(t.substring(1),e)};return w[n]?t.length>1?{type:w[n],data:t.substring(1)}:{type:w[n]}:v},R=(t,e)=>{if(E){const n=(t=>{let e,n,r,s,o,i=.75*t.length,a=t.length,c=0;"="===t[t.length-1]&&(i--,"="===t[t.length-2]&&i--);const d=new ArrayBuffer(i),u=new Uint8Array(d);for(e=0;e<a;e+=4)n=j[t.charCodeAt(e)],r=j[t.charCodeAt(e+1)],s=j[t.charCodeAt(e+2)],o=j[t.charCodeAt(e+3)],u[c++]=n<<2|r>>4,u[c++]=(15&r)<<4|s>>2,u[c++]=(3&s)<<6|63&o;return d})(t);return x(n,e)}return{base64:!0,data:t}},x=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,N=String.fromCharCode(30);function V(){return new TransformStream({transform(t,e){!function(t,e){I&&t.data instanceof Blob?t.data.arrayBuffer().then(T).then(e):S&&(t.data instanceof ArrayBuffer||k(t.data))?e(T(t.data)):P(t,!1,t=>{_||(_=new TextEncoder),e(_.encode(t))})}(t,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const t=new DataView(s.buffer);t.setUint8(0,126),t.setUint16(1,r)}else{s=new Uint8Array(9);const t=new DataView(s.buffer);t.setUint8(0,127),t.setBigUint64(1,BigInt(r))}t.data&&"string"!=typeof t.data&&(s[0]|=128),e.enqueue(s),e.enqueue(n)})}})}let M;function B(t){return t.reduce((t,e)=>t+e.length,0)}function U(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let s=0;s<e;s++)n[s]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function J(t){if(t)return function(t){for(var e in J.prototype)t[e]=J.prototype[e];return t}(t)}J.prototype.on=J.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},J.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},J.prototype.off=J.prototype.removeListener=J.prototype.removeAllListeners=J.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var s=0;s<r.length;s++)if((n=r[s])===e||n.fn===e){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},J.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,e)}return this},J.prototype.emitReserved=J.prototype.emit,J.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},J.prototype.hasListeners=function(t){return!!this.listeners(t).length};const q="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function G(t,...e){return e.reduce((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e),{})}const L=q.setTimeout,Y=q.clearTimeout;function H(t,e){e.useNativeTimers?(t.setTimeoutFn=L.bind(q),t.clearTimeoutFn=Y.bind(q)):(t.setTimeoutFn=q.setTimeout.bind(q),t.clearTimeoutFn=q.clearTimeout.bind(q))}function z(t){return"string"==typeof t?function(t){let e=0,n=0;for(let r=0,s=t.length;r<s;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))}class F extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class K extends J{constructor(t){super(),this.writable=!1,H(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,n){return super.emitReserved("error",new F(t,e,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const e=D(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){const t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(t){const e=function(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}(t);return e.length?"?"+e:""}}const W="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Q={};let Z,X=0,$=0;function tt(t){let e="";do{e=W[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}function et(){const t=tt(+new Date);return t!==Z?(X=0,Z=t):t+"."+tt(X++)}for(;$<64;$++)Q[W[$]]=$;let nt=!1;try{nt="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}const rt=nt;function st(t){const e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||rt))return new XMLHttpRequest}catch(t){}if(!e)try{return new(q[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}function ot(){}const it=null!=new st({xdomain:!1}).responseType;class at extends J{constructor(t,e){super(),H(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.data=void 0!==e.data?e.data:null,this.create()}create(){var t;const e=G(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;const n=this.xhr=new st(e);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&n.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(t){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{n.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var t;3===n.readyState&&(null===(t=this.opts.cookieJar)||void 0===t||t.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"==typeof n.status?n.status:0)},0))},n.send(this.data)}catch(t){return void this.setTimeoutFn(()=>{this.onError(t)},0)}"undefined"!=typeof document&&(this.index=at.requestsCount++,at.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=ot,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete at.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(at.requestsCount=0,at.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",ct);else if("function"==typeof addEventListener){addEventListener("onpagehide"in q?"pagehide":"unload",ct,!1)}function ct(){for(let t in at.requests)at.requests.hasOwnProperty(t)&&at.requests[t].abort()}const dt="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),ut=q.WebSocket||q.MozWebSocket,lt="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const pt={websocket:class extends K{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,n=lt?{}:G(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=lt?new ut(t,e,n):e?new ut(t,e):new ut(t)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;P(n,this.supportsBinary,t=>{try{this.ws.send(t)}catch(t){}r&&dt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=et()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}check(){return!!ut}},webtransport:class extends K{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const e=function(t,e){M||(M=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(0===r){if(B(n)<1)break;const t=U(n,1);o=!(128&~t[0]),s=127&t[0],r=s<126?3:126===s?1:2}else if(1===r){if(B(n)<2)break;const t=U(n,2);s=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),r=3}else if(2===r){if(B(n)<8)break;const t=U(n,8),e=new DataView(t.buffer,t.byteOffset,t.length),o=e.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(v);break}s=o*Math.pow(2,32)+e.getUint32(4),r=3}else{if(B(n)<s)break;const t=U(n,s);a.enqueue(D(o?t:M.decode(t),e)),r=0}if(0===s||s>t){a.enqueue(v);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(e).getReader(),r=V();r.readable.pipeTo(t.writable),this.writer=r.writable.getWriter();const s=()=>{n.read().then(({done:t,value:e})=>{t||(this.onPacket(e),s())}).catch(t=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;this.writer.write(n).then(()=>{r&&dt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;null===(t=this.transport)||void 0===t||t.close()}},polling:class extends K{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){const e="https:"===location.protocol;let n=location.port;n||(n=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||n!==t.port}const e=t&&t.forceBase64;this.supportsBinary=it&&!e,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){((t,e)=>{const n=t.split(N),r=[];for(let t=0;t<n.length;t++){const s=D(n[t],e);if(r.push(s),"error"===s.type)break}return r})(t,this.socket.binaryType).forEach(t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,((t,e)=>{const n=t.length,r=new Array(n);let s=0;t.forEach((t,o)=>{P(t,!1,t=>{r[o]=t,++s===n&&e(r.join(N))})})})(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=et()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new at(this.uri(),t)}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",(t,e)=>{this.onError("xhr post error",t,e)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(t,e)=>{this.onError("xhr poll error",t,e)}),this.pollXhr=t}}},ht=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ft=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function mt(t){if(t.length>2e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");-1!=n&&-1!=r&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let s=ht.exec(t||""),o={},i=14;for(;i--;)o[ft[i]]=s[i]||"";return-1!=n&&-1!=r&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=function(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");"/"!=e.slice(0,1)&&0!==e.length||r.splice(0,1);"/"==e.slice(-1)&&r.splice(r.length-1,1);return r}(0,o.path),o.queryKey=function(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,r){e&&(n[e]=r)}),n}(0,o.query),o}class yt extends J{constructor(t,e={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=mt(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=mt(e.host).host),H(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket","webtransport"],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:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},n=t.split("&");for(let t=0,r=n.length;t<r;t++){let r=n[t].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}(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(t){const e=Object.assign({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);const n=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new pt[t](n)}open(){let t;if(this.opts.rememberUpgrade&&yt.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(t){let e=this.createTransport(t),n=!1;yt.priorWebsocketSuccess=!1;const r=()=>{n||(e.send([{type:"ping",data:"probe"}]),e.once("packet",t=>{if(!n)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;yt.priorWebsocketSuccess="websocket"===e.name,this.transport.pause(()=>{n||"closed"!==this.readyState&&(d(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{const t=new Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}}))};function s(){n||(n=!0,d(),e.close(),e=null)}const o=t=>{const n=new Error("probe error: "+t);n.transport=e.name,s(),this.emitReserved("upgradeError",n)};function i(){o("transport closed")}function a(){o("socket closed")}function c(t){e&&t.name!==e.name&&s()}const d=()=>{e.removeListener("open",r),e.removeListener("error",o),e.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};e.once("open",r),e.once("error",o),e.once("close",i),this.once("close",a),this.once("upgrading",c),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn(()=>{n||e.open()},200):e.open()}onOpen(){if(this.readyState="open",yt.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let t=0;const e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.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 t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let e=0;e<this.writeBuffer.length;e++){const n=this.writeBuffer[e].data;if(n&&(t+=z(n)),e>0&&t>this.maxPayload)return this.writeBuffer.slice(0,e);t+=2}return this.writeBuffer}write(t,e,n){return this.sendPacket("message",t,e,n),this}send(t,e,n){return this.sendPacket("message",t,e,n),this}sendPacket(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:t,data:e,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}onError(t){yt.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(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",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let n=0;const r=t.length;for(;n<r;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}yt.protocol=4;yt.protocol;const gt="function"==typeof ArrayBuffer,bt=Object.prototype.toString,Ot="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===bt.call(Blob),wt="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===bt.call(File);function vt(t){return gt&&(t instanceof ArrayBuffer||(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer)(t))||Ot&&t instanceof Blob||wt&&t instanceof File}function It(t,e){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let e=0,n=t.length;e<n;e++)if(It(t[e]))return!0;return!1}if(vt(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return It(t.toJSON(),!0);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&It(t[e]))return!0;return!1}function St(t){const e=[],n=t.data,r=t;return r.data=kt(n,e),r.attachments=e.length,{packet:r,buffers:e}}function kt(t,e){if(!t)return t;if(vt(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=kt(t[r],e);return n}if("object"==typeof t&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=kt(t[r],e));return n}return t}function Pt(t,e){return t.data=At(t.data,e),delete t.attachments,t}function At(t,e){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=At(t[n],e);else if("object"==typeof t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=At(t[n],e));return t}const Tt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],_t=5;var Ct;!function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(Ct||(Ct={}));class jt{constructor(t){this.replacer=t}encode(t){return t.type!==Ct.EVENT&&t.type!==Ct.ACK||!It(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===Ct.EVENT?Ct.BINARY_EVENT:Ct.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==Ct.BINARY_EVENT&&t.type!==Ct.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){const e=St(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r}}function Et(t){return"[object Object]"===Object.prototype.toString.call(t)}class Dt extends J{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);const n=e.type===Ct.BINARY_EVENT;n||e.type===Ct.BINARY_ACK?(e.type=n?Ct.EVENT:Ct.ACK,this.reconstructor=new Rt(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!vt(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;const n={type:Number(t.charAt(0))};if(void 0===Ct[n.type])throw new Error("unknown packet type "+n.type);if(n.type===Ct.BINARY_EVENT||n.type===Ct.BINARY_ACK){const r=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);const s=t.substring(r,e);if(s!=Number(s)||"-"!==t.charAt(e))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===t.charAt(e+1)){const r=e+1;for(;++e;){if(","===t.charAt(e))break;if(e===t.length)break}n.nsp=t.substring(r,e)}else n.nsp="/";const r=t.charAt(e+1);if(""!==r&&Number(r)==r){const r=e+1;for(;++e;){const n=t.charAt(e);if(null==n||Number(n)!=n){--e;break}if(e===t.length)break}n.id=Number(t.substring(r,e+1))}if(t.charAt(++e)){const r=this.tryParse(t.substr(e));if(!Dt.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case Ct.CONNECT:return Et(e);case Ct.DISCONNECT:return void 0===e;case Ct.CONNECT_ERROR:return"string"==typeof e||Et(e);case Ct.EVENT:case Ct.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===Tt.indexOf(e[0]));case Ct.ACK:case Ct.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Rt{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=Pt(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function xt(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Nt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Vt extends J{constructor(t,e,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=t,this.nsp=e,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 t=this.io;this.subs=[xt(t,"open",this.onopen.bind(this)),xt(t,"packet",this.onpacket.bind(this)),xt(t,"error",this.onerror.bind(this)),xt(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(Nt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const n={type:Ct.EVENT,data:e,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){const t=this.ids++,r=e.pop();this._registerAckCallback(t,r),n.id=t}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(t,e){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[t]=e);const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,new Error("operation has timed out"))},r);this.acks[t]=(...t)=>{this.io.clearTimeoutFn(s),e.apply(this,[null,...t])}}emitWithAck(t,...e){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise((r,s)=>{e.push((t,e)=>n?t?s(t):r(e):r(t)),this.emit(t,...e)})}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((t,...r)=>{if(n!==this._queue[0])return;return null!==t?n.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...r)),n.pending=!1,this._drainQueue()}),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;const e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ct.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ct.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 Ct.EVENT:case Ct.BINARY_EVENT:this.onevent(t);break;case Ct.ACK:case Ct.BINARY_ACK:this.onack(t);break;case Ct.DISCONNECT:this.ondisconnect();break;case Ct.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let n=!1;return function(...r){n||(n=!0,e.packet({type:Ct.ACK,id:t,data:r}))}}onack(t){const e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ct.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const n of e)n.apply(this,t.data)}}}function Mt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Mt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=1&Math.floor(10*e)?t+n:t-n}return 0|Math.min(t,this.max)},Mt.prototype.reset=function(){this.attempts=0},Mt.prototype.setMin=function(t){this.ms=t},Mt.prototype.setMax=function(t){this.max=t},Mt.prototype.setJitter=function(t){this.jitter=t};class Bt extends J{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(n=e,e=void 0),(n=n||{}).path=n.path||"/socket.io",this.opts=n,H(this,n),this.reconnection(!1!==n.reconnection),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=n.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new Mt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==n.timeout?2e4:n.timeout),this._readyState="closed",this.uri=e;const s=n.parser||t;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=!1!==n.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new yt(this.uri,this.opts);const e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=xt(e,"open",function(){n.onopen(),t&&t()}),s=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},o=xt(e,"error",s);if(!1!==this._timeout){const t=this._timeout,n=this.setTimeoutFn(()=>{r(),s(new Error("timeout")),e.close()},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xt(t,"ping",this.onping.bind(this)),xt(t,"data",this.ondata.bind(this)),xt(t,"error",this.onerror.bind(this)),xt(t,"close",this.onclose.bind(this)),xt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){dt(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new Vt(this,t,e),this.nsps[t]=n),n}_destroy(t){const e=Object.keys(this.nsps);for(const t of e){if(this.nsps[t].active)return}this._close()}_packet(t){const e=this.encoder.encode(t);for(let n=0;n<e.length;n++)this.engine.write(e[n],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ut={};function Jt(t,e){"object"==typeof t&&(e=t,t=void 0);const n=function(t,e="",n){let r=t;n=n||"undefined"!=typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==n?n.protocol+"//"+t:"https://"+t),r=mt(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}(t,(e=e||{}).path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=Ut[s]&&o in Ut[s].nsps;let a;return e.forceNew||e["force new connection"]||!1===e.multiplex||i?a=new Bt(r,e):(Ut[s]||(Ut[s]=new Bt(r,e)),a=Ut[s]),n.query&&!e.query&&(e.query=n.queryKey),a.socket(n.path,e)}Object.assign(Jt,{Manager:Bt,Socket:Vt,io:Jt,connect:Jt});var qt=__webpack_require__(835);class Gt extends i{type;socketId;data;static DESCRIPTOR_NAME="ChannelMessage";static DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};constructor(t,e,n){super(),this.type=t,this.socketId=e,this.data=n}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(t){return new Gt(t.type,t.socketId,t.data)}}const Lt=class extends((0,n.EmitterMixin)()){_channelName;_wsGateway;_socket;constructor(t,e,n){super(),this._channelName=t,this._wsGateway=e,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(t,e=!1){let n="";return e&&(n+="all:"),n+="event",t&&(n+=":"+t),n}_subscribeToChannel(){this._socket.on(this._channelName,t=>{const e=l.decode(t,Gt);this.fire(this.getEventName(e.type,!0),e.data,e.socketId),e.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(e.type),e.data,e.socketId)})}};class Yt extends Error{context;code;data;constructor(t,e,n=null,r={}){super("cloud-services-internal-error: "+t),this.context=e,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(t){return new Yt(function(t){let e="cloud-services-error: "+t.message;return t.data&&(e+="\nError data: "+JSON.stringify(t.data)),t.explanation&&(e+="\nExplanation: "+t.explanation),t.action&&(e+="\nAction: "+t.action),t.traceId&&(e+="\nTraceId: "+t.traceId),t.code&&(e+="\nCode: "+t.code),e}(t),t)}}class Ht extends Error{code;traceId;data;constructor(t,e){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=t,this.code=e.code,this.traceId=e.traceId,this.data=e.data}static fromPublicError(t){return new Ht(function(t){let e="cloud-services-server-error: "+t.message;return t.explanation&&(e+="\nExplanation: "+t.explanation),t.action&&(e+="\nAction: "+t.action),t.traceId&&(e+="\nTraceId: "+t.traceId),t.code&&(e+="\nCode: "+t.code),e}(t),t)}}class zt extends i{flags;rooms;except;static TYPE=11;static DESCRIPTOR_NAME="PacketOptionsMessage";static DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};constructor(t,e=[],n=[]){super(),this.flags=t,this.rooms=e,this.except=n}toJSON(){return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:this.rooms?.length?this.rooms:void 0,except:this.except?.length?this.except:void 0}}static fromJSON(t){return new zt(t.flags&&JSON.parse(t.flags),t.rooms,t.except)}}const Ft=(()=>!("undefined"==typeof process||!process.versions?.node))(),Kt=1,Wt=2,Qt=3,Zt=4;class Xt{static getPacketType(...t){let e=0;for(let n=0;n<t.length;n++)e+=t[n]*Math.pow(10,t.length-n-1);return e}static getType(t){if(Xt.isBuffer(t))return Kt;const e=typeof t;return"string"===e?Wt:"number"===e?Qt:Zt}static isBuffer(t){return Ft&&Buffer.isBuffer(t)||t instanceof ArrayBuffer||t instanceof Uint8Array||this._isBufferView(t)}static _isBufferView(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer}}class $t extends i{data;data1;static create(t,e){throw new TypeError("Must be implemented in a child class!")}}class te extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Qt,Kt))();static DESCRIPTOR_NAME="NumberBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new te(t.data,t.data1)}static create(t,e){return new te(t,e)}}class ee extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Wt,Kt))();static DESCRIPTOR_NAME="StringBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ee(t.data,t.data1)}static create(t,e){return new ee(t,e)}}class ne extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Kt,Kt))();static DESCRIPTOR_NAME="BytesBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ne(t.data,t.data1)}static create(t,e){return new ne(t,e)}}class re extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Wt,Zt))();static DESCRIPTOR_NAME="StringObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(t){return new re(t.data,t.data1&&JSON.parse(t.data1))}static create(t,e){return new re(t,e)}}class se extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Qt,Zt))();static DESCRIPTOR_NAME="NumberObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(t){return new se(t.data,t.data1&&JSON.parse(t.data1))}static create(t,e){return new se(t,e)}}class oe extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Zt,Zt))();static DESCRIPTOR_NAME="ObjectObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(t){return new oe(t.data&&JSON.parse(t.data),t.data1&&JSON.parse(t.data1))}static create(t,e){return new oe(t,e)}}class ie extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Zt,Kt))();static DESCRIPTOR_NAME="ObjectBufferPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(t){return new ie(t.data&&JSON.parse(t.data),t.data1)}static create(t,e){return new ie(t,e)}}class ae extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Wt,Wt))();static DESCRIPTOR_NAME="StringStringPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ae(t.data,t.data1)}static create(t,e){return new ae(t,e)}}class ce extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Wt,Qt))();static DESCRIPTOR_NAME="StringNumberPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ce(t.data,t.data1)}static create(t,e){return new ce(t,e)}}class de extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Qt,Qt))();static DESCRIPTOR_NAME="NumberNumberPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new de(t.data,t.data1)}static create(t,e){return new de(t,e)}}class ue extends $t{data;data1;static TYPE=(()=>Xt.getPacketType(Qt,Wt))();static DESCRIPTOR_NAME="NumberStringPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ue(t.data,t.data1)}static create(t,e){return new ue(t,e)}}const le=(()=>[te,ee,ne,re,se,oe,ie,ae,ce,de,ue].reduce((t,e)=>(t[e.TYPE]=e,t),{}))();class pe extends i{type;data;id;nsp;options;static TYPE=10;static DESCRIPTOR_NAME="PacketMessage";static 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}}};constructor(t,e,n,r="/",s){super(),this.type=t,this.data=e,this.id=n,this.nsp=r,this.options=s??new zt}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 t=l.encode(this.options),e=l.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:e,options:t}}static fromJSON(t){const e=Math.floor(t.type/10);return new pe(t.type-10*e,l.decode(t.data,le[e]),t.id,t.nsp,t.options?l.decode(t.options,zt):new zt)}static create(t,e={}){const n=Xt.getPacketType(Xt.getType(t.data[0]),Xt.getType(t.data[1]??t.data[0]));return new pe(t.type,le[n].create(t.data[0],t.data[1]),t.id,t.nsp,new zt(e.flags,e.rooms,e.except))}}class he{encode(t,e,n,r="/",s={}){if(e.length>2)throw new Error("PacketParser supports only 2 elements in data");const o={type:t,data:e,id:n,nsp:r};return l.encode(pe.create(o,s))}decode(t){const e=l.decode(t,pe);return{packet:{id:e.id,type:e.type,data:e.packetData,nsp:e.nsp},options:{flags:e.options.flags,rooms:e.options.rooms,except:e.options.except}}}}const fe=(()=>[Ct.EVENT,Ct.ACK,Ct.BINARY_ACK,Ct.BINARY_EVENT])();class me extends jt{_packetParser;constructor(t){super(),this._packetParser=t??new he}encode(t){if(fe.includes(t.type))try{return[this._packetParser.encode(t.type,t.data,t.id,t.nsp)]}catch(t){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:t.message}})}return super.encode(t)}}class ye extends Dt{_packetParser;constructor(t){super(),this._packetParser=t??new he}add(t){if(!Xt.isBuffer(t))return super.add(t);let e;try{e=this._packetParser.decode(t).packet}catch(e){return super.add(t)}super.emitReserved("decoded",e)}}class ge{_context;_deferredPromise=function(){let t,e;const n=new Promise((n,r)=>{t=n,e=r});return{resolve:t,reject:e,promise:n}}();timeout;constructor(t,e){this._context=t,this.timeout=setTimeout(()=>this.error(new Yt("Request timeout.",this._context)),e)}get promise(){return this._deferredPromise.promise}response(t){this._deferredPromise.resolve(t)}error(t){this._deferredPromise.reject(t)}}class be{_context;_requests=new Set;constructor(t){this._context=t}async send(t,e=45e3){const n=this._createRequest(e);try{return t(n),await n.promise}finally{this._finishRequest(n)}}errorAll(t){for(const e of this._requests)e.error(t)}waitForAllRequests(t=45e3){return this._waitForRequests(t)}_createRequest(t){const e=new ge(this._context,t);return this._requests.add(e),e}_finishRequest(t){this._requests.delete(t),clearTimeout(t.timeout)}async _waitForRequests(t=5e3,e=0){return!this._requests.size||e>=t/500?Promise.resolve():(await new Promise(t=>{setTimeout(t,500)}),this._waitForRequests(t,e++))}}const Oe={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};class we extends((0,n.ObservableMixin)()){_requestsManager;_url;_socket;_socketAuth;_channels;_connectionAttempt=0;_token;_options;_connectionProvider;_userFactory;static STATE_DISCONNECTED=(()=>Oe.DISCONNECTED)();static STATE_CONNECTING=(()=>Oe.CONNECTING)();static STATE_CONNECTED=(()=>Oe.CONNECTED)();static _CHANGE_STATE_EVENT_PRIORITY=(()=>n.priorities.get("highest")+999999)();constructor(t,e,n,r,s){if(super(),this._token=e,this._options=n??{},this._connectionProvider=r??Jt,this._userFactory=s??b.get,this._requestsManager=new be(this),this._channels=new Map,!t)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=qt(t.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Oe.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",async(t,e,n)=>{if(this._debugEvent("ws-gw:change:state",n),n!==we.STATE_CONNECTED){if(n===we.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Yt("Not connected.",this))}else try{this.me=await this._userFactory.call(b,this,this._socketAuth?.userId)}catch(t){}},{priority:we._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",(t,e)=>{this._options.onError?this._options.onError(e):console.error(e)})}get sessionId(){return this.socketId}waitForAllRequests(t){return this._requestsManager.waitForAllRequests(t)}disconnect(){this.state!==Oe.DISCONNECTED&&(this._socket?.disconnect(),this._socket=void 0,this.state=Oe.DISCONNECTED)}async reconnect(){this._socket||this.state!==Oe.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(t,e="local.cs.dev:443/ws-v2",n={},r=Jt,s=b.get){const o=new we(e,t,n,r,s);return await o._connect(),o}_sendRequest(t,e,n){if(!t)throw new Yt("`serviceName` must be provided.",this);if(this.state!==we.STATE_CONNECTED)throw new Yt("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new Yt("Not authenticated.",this);const r=new ArrayBuffer(n.length+2),s=new Uint8Array(r);return s[0]=t,s[1]=parseInt(e),s.set(n,2),this._emit(1,s)}_getChannel(t,e){const n=""+t+e;return!this._channels.has(n)&&this._socket&&this._channels.set(n,new Lt(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise((t,e)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(e)}),n.once("connect",async()=>{this._debugEvent("once-connect");try{await this._onConnect(),t()}catch(t){e(t)}}),n.connect()})}_getPortByProtocol(t){return["http:","ws:"].includes(t)?80:443}_setupSocket(){if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),e=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,n=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",r=this._connectionProvider(e,{parser:{Encoder:me,Decoder:ye},path:n+"/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:"53.0.0"},agent:this._options.agent??!1,closeOnBeforeunload:!1});return this.state=Oe.CONNECTING,r.on("connect",()=>{this._debugEvent("connect"),this.socketId=r.id}),r.on("connect_error",t=>{this._debugEvent("connect_error",t)}),r.on("disconnect",()=>{this._debugEvent("disconnect"),this._onDisconnect()}),r.io.on("reconnect",async()=>{this._debugEvent("reconnect"),await this._onReconnect()}),r.io.on("reconnect_attempt",t=>{this._debugEvent("reconnect_attempt",t),this.state=Oe.CONNECTING,this._connectionAttempt=t}),r.on("unauthorized",t=>{this._debugEvent("unauthorized"),this._onUnauthorized(t)}),r.on("authenticationRequest",async t=>{this._debugEvent("authenticationRequest",t.attempt),await this._onReconnect()}),this._socket=r,r}_emit(t,e){const n=this._socket;return this._requestsManager.send(r=>{n.emit(t,e,(t,e)=>{if(t)return r.error(Ht.fromPublicError(t));r.response(e)})},this._options.requestTimeout)}_addAuthData(t,e){this._socketAuth={environmentId:t,userId:e,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=Oe.CONNECTED;const t=async(t,e,n)=>{this._debugEvent("token:value:change");try{await this._authenticate(n)}catch(t){}};this._token.on("change:value",t),this._socket.io.off("reconnect_error"),this.on("disconnect",()=>{this._token.off("change:value",t)})}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=Oe.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const t of this._channels.values())t.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(t,e){if(!this._isDebugModeEnabled())return;const n=void 0!==e?", data: "+e:"";console.info((new Date).toLocaleString()+" "+t+n)}_reconnectionAttemptError(t){this._connectionAttempt>=2&&(this.disconnect(),t(Yt.fromPublicError({message:"The number of initial connection attempts exceeded.",explanation:"Three initial connection attempts failed. It can be caused by a slow, unstable, 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:t}){this._removeAuthData(),this.fire("error",Ht.fromPublicError(t))}async _authenticate(t){try{this._debugEvent("authenticate:start");const e=await this._emit(2,{token:t});this._debugEvent("authenticate:success","envId: "+e.environmentId+", userId: "+e.userId),this._addAuthData(e.environmentId,e.userId)}catch(t){throw this._debugEvent("authenticate:error",t.message),this._removeAuthData(),t}}_isDebugModeEnabled(){return!!n.global.window.localStorage&&"true"===(n.global.window.localStorage.getItem("csClientDebugMode")??"false").toLowerCase()}}const ve=we;class Ie extends i{bundleVersion;static TYPE="131";static READABLE_TYPE_NAME="isEditorBundleUploaded";static DESCRIPTOR_NAME="IsEditorBundleUploadedMessage";static DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};constructor(t){super(),this.bundleVersion=t}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(t){return new Ie(t.bundleVersion)}}class Se extends i{isUploaded;static DESCRIPTOR_NAME="IsEditorBundleUploadedResponse";static DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};constructor(t){super(),this.isUploaded=t}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(t){return new Se(t.isUploaded)}}class ke extends((0,n.EmitterMixin)()){static _SERVICE=13;static async isBundleUploaded(t,e){const n=new Ie(e);if(t.state!==Oe.CONNECTED)throw new Yt("WebSocket Gateway is not connected.",t);const r=await t._sendRequest(ke._SERVICE,Ie.TYPE,l.encode(n));return l.decode(r,Se).isUploaded}}const Pe=ke;class Ae extends i{documentId;revisionId;static TYPE="123";static READABLE_TYPE_NAME="getRevision";static DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};constructor(t,e){super(),this.documentId=t,this.revisionId=e}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(t){return new Ae(t.documentId,t.revisionId)}}class Te extends o{static DESCRIPTOR_NAME="RevisionDescriptor";static 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}}};static create(t){return{revisionId:t.id,name:t.name,creatorId:t.creatorId,createdAt:t.createdAt,fromVersion:t.fromVersion,toVersion:t.toVersion,isEmptyCurrent:t.isEmptyCurrent,diffData:t.diffData?JSON.stringify(t.diffData):void 0,attributes:t.attributes,authorsIds:t.authorsIds}}static toJSON(t){return{revisionId:t.revisionId,name:t.name,creatorId:t.creatorId,authorsIds:t.authorsIds?JSON.stringify(t.authorsIds):void 0,diffData:t.diffData,createdAt:t.createdAt?.toISOString(),attributes:t.attributes?JSON.stringify(t.attributes):void 0,toVersion:t.toVersion,fromVersion:t.fromVersion,isEmptyCurrent:t.isEmptyCurrent}}static fromJSON(t){return{revisionId:(t={...t}).revisionId,name:t.name,creatorId:t.creatorId,authorsIds:t.authorsIds?JSON.parse(t.authorsIds):void 0,diffData:t.diffData,createdAt:t.createdAt?new Date(t.createdAt):void 0,attributes:t.attributes?JSON.parse(t.attributes):void 0,toVersion:t.toVersion,fromVersion:t.fromVersion,isEmptyCurrent:t.isEmptyCurrent}}static toObject(t){return function(t){for(const[e,n]of Object.entries(t))void 0===n&&delete t[e];return t}({id:t.revisionId,name:t.name,creatorId:t.creatorId,createdAt:t.createdAt,fromVersion:t.fromVersion,toVersion:t.toVersion,isEmptyCurrent:t.isEmptyCurrent,diffData:t.diffData?JSON.parse(t.diffData):void 0,attributes:t.attributes,authorsIds:t.authorsIds})}}class _e extends i{revisionId;name;creatorId;authorsIds;createdAt;diffData;attributes;fromVersion;toVersion;isEmptyCurrent;static DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse";static DESCRIPTOR=(()=>Te.DESCRIPTOR)();constructor(t,e,n,r,s,o,i,a,c,d){super(),this.revisionId=t,this.name=e,this.creatorId=n,this.authorsIds=r,this.createdAt=s,this.diffData=o,this.attributes=i,this.fromVersion=a,this.toVersion=c,this.isEmptyCurrent=d}toJSON(){return Te.toJSON(this)}toObject(){return Te.toObject(this)}static create(t){return new _e(t.revisionId,t.name,t.creatorId,t.authorsIds,t.createdAt,t.diffData,t.attributes,t.fromVersion,t.toVersion,t.isEmptyCurrent)}static fromJSON(t){return new _e(t.revisionId,t.name,t.creatorId,t.authorsIds?JSON.parse(t.authorsIds):void 0,t.createdAt?new Date(t.createdAt):void 0,t.diffData,t.attributes?JSON.parse(t.attributes):void 0,t.fromVersion,t.toVersion,t.isEmptyCurrent)}}class Ce extends i{documentId;requestId;revisions;static TYPE="124";static READABLE_TYPE_NAME="updateRevisions";static DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};constructor(t,e,n){super(),this.documentId=t,this.requestId=e,this.revisions=n}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Te.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Te.toObject)}}static create(t){return new Ce(t.documentId,t.requestId,t.revisions.map(Te.create))}static fromJSON(t){return new Ce(t.documentId,t.requestId,t.revisions.map(Te.fromJSON))}}class je extends i{requestId;static DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse";static DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};constructor(t){super(),this.requestId=t}toJSON(){return{requestId:this.requestId}}static fromJSON(t){return new je(t.requestId)}}class Ee extends i{documentId;static TYPE="121";static READABLE_TYPE_NAME="connectToRevisionHistory";static DESCRIPTOR_NAME="RevisionHistoryConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new Ee(t.documentId)}}class De extends i{channel;requestId;revisions;static DESCRIPTOR_NAME="RevisionHistoryConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};constructor(t,e,n){super(),this.channel=t,this.requestId=e,this.revisions=n}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Te.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Te.toObject)}}static fromJSON(t){return new De(t.channel,t.requestId,t.revisions.map(Te.fromJSON))}}class Re extends i{documentId;requestId;static TYPE="122";static READABLE_TYPE_NAME="reconnectToRevisionHistory";static DESCRIPTOR_NAME="RevisionHistoryReconnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};constructor(t,e){super(),this.documentId=t,this.requestId=e}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(t){return new Re(t.documentId,t.requestId)}}class xe extends Yt{constructor(t,e){super(t+" Service is not connected.",e)}}class Ne extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;static _SERVICE=12;constructor(t){super(),this._documentId=t}get isConnected(){return this._isConnected}connect(t){return this._isConnected?Promise.resolve():this._connect(t,new Ee(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(t,e){if(this.isConnected)throw new Yt("Cannot reconnect to already connected service.",t);return this._connect(t,new Re(this._documentId,e))}async updateRevisions(t,e){const n=Ce.create({documentId:this._documentId,requestId:e,revisions:t}),r=await this._sendRequest(Ce.TYPE,n),{requestId:s}=l.decode(r,je);return s}async getRevision(t){const e=new Ae(this._documentId,t),n=await this._sendRequest(Ae.TYPE,e);return l.decode(n,_e).toObject()}async _connect(t,e){if(t.state!==Oe.CONNECTED)throw new Yt("WebSocket Gateway is not connected.",t);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(12,e.constructor.TYPE,l.encode(e)),{channel:r,requestId:s,revisions:o}=l.decode(n,De).toObject();return this.listenTo(t,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:ve._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(t,r),this._isConnected=!0,this.fire("connected"),{revisions:o,requestId:s}}_connectToChannel(t,e){this._channel=t._getChannel(Ne._SERVICE,e),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Ce.TYPE),(t,e)=>{const{documentId:n,requestId:r,revisions:s}=l.decode(e,Ce).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})})}_onWsGatewayStateChange(t){t===Oe.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new xe("Revision History",this);return this._wsGateway._sendRequest(12,t,l.encode(e))}}const Ve=Ne;class Me extends i{id;documentId;type;data;originalSuggestionId;attributes;static TYPE="101";static READABLE_TYPE_NAME="addSuggestion";static DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage";static 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}}};constructor(t,e,n,r={},s=null,o=null){super(),this.id=t,this.documentId=e,this.type=n,this.data=r,this.originalSuggestionId=s,this.attributes=o}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(t){return new Me(t.id,t.documentId,t.type,JSON.parse(t.data),t.originalSuggestionId??null,t.attributes?JSON.parse(t.attributes):null)}}class Be extends i{id;authorId;type;hasComments;state;data;attributes;createdAt;static DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse";static 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}}};constructor(t,e,n,r,s,o,i={},a=null){super(),this.id=t,this.authorId=e,this.type=n,this.hasComments=s,this.state=o,this.data=i,this.attributes=a,this.createdAt=r?new Date(r):void 0}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(t){return new Be(t.id,t.authorId,t.type,t.createdAt,t.hasComments,t.state,JSON.parse(t.data),t.attributes?JSON.parse(t.attributes):null)}}class Ue extends i{id;documentId;static TYPE="103";static READABLE_TYPE_NAME="getSuggestion";static DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(t,e){super(),this.id=t,this.documentId=e}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(t){return new Ue(t.id,t.documentId)}}class Je extends i{id;authorId;type;hasComments;state;data;attributes;createdAt;static DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse";static 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}}};constructor(t,e,n,r,s,o,i={},a=null){super(),this.id=t,this.authorId=e,this.type=n,this.hasComments=s,this.state=o,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(t){return new Je(t.id,t.authorId,t.type,t.createdAt,t.hasComments,t.state,JSON.parse(t.data),t.attributes?JSON.parse(t.attributes):null)}}class qe extends i{documentId;static TYPE="102";static READABLE_TYPE_NAME="getAllSuggestions";static DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new qe(t.documentId)}}class Ge extends o{static DESCRIPTOR_NAME="SuggestionDescriptor";static 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"}}};static toJSON(t){return{...t,data:t.data?JSON.stringify(t.data):t.data,attributes:t.attributes?JSON.stringify(t.attributes):t.attributes,createdAt:t.createdAt?.toISOString()}}static fromJSON(t){return{...t,data:t.data?JSON.parse(t.data):t.data,attributes:t.attributes?JSON.parse(t.attributes):t.attributes,createdAt:t.createdAt?new Date(t.createdAt):void 0}}}class Le extends i{_suggestions;_suggestionsV2;suggestions;static DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse";static DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};constructor(t,e){super(),this._suggestions=t,this._suggestionsV2=e,this.suggestions=e?.length?e:t}toJSON(){return{suggestions:this._suggestions?.map(t=>JSON.stringify(t)),suggestionsV2:this._suggestionsV2?.map(Ge.toJSON)}}static fromJSON(t){return new Le(t.suggestions?.map(Ye),t.suggestionsV2?.map(Ge.fromJSON))}}function Ye(t){const e=JSON.parse(t);return e.createdAt=e.createdAt?new Date(e.createdAt):void 0,e}class He extends i{id;documentId;hasComments;isHasCommentsModified;state;attributes;static TYPE="104";static READABLE_TYPE_NAME="updateSuggestion";static DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage";static 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}}};constructor(t,e,n,r,s,o=null){super(),this.id=t,this.documentId=e,this.hasComments=n,this.isHasCommentsModified=r,this.state=s,this.attributes=o}toJSON(){return{id:this.id,documentId:this.documentId,hasComments:this.hasComments,isHasCommentsModified:this.isHasCommentsModified,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(t){return new He(t.id,t.documentId,t.hasComments,t.isHasCommentsModified,t.state,t.attributes?JSON.parse(t.attributes):null)}}class ze extends i{documentId;static TYPE="105";static READABLE_TYPE_NAME="connectToSuggestions";static DESCRIPTOR_NAME="TrackChangesConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new ze(t.documentId)}}class Fe extends i{channel;_suggestions;_suggestionsV2;suggestions;static DESCRIPTOR_NAME="TrackChangesConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};constructor(t,e,n){super(),this.channel=t,this._suggestions=e,this._suggestionsV2=n,this.suggestions=n?.length?n:e}toJSON(){return{channel:this.channel,suggestions:this._suggestions?.map(t=>JSON.stringify(t)),suggestionsV2:this._suggestionsV2?.map(Ge.toJSON)}}static fromJSON(t){return new Fe(t.channel,t.suggestions?.map(t=>JSON.parse(t)),t.suggestionsV2?.map(Ge.fromJSON))}}class Ke extends i{ids;documentId;state;static TYPE="106";static READABLE_TYPE_NAME="batchUpdateSuggestionsState";static DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage";static DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};constructor(t,e,n){super(),this.ids=t,this.documentId=e,this.state=n}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(t){return new Ke(t.ids,t.documentId,t.state)}}class We extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;static _SERVICE=10;constructor(t){super(),this._documentId=t}get isConnected(){return this._isConnected}async connect(t){if(this._isConnected)return;if(t.state!==Oe.CONNECTED)throw new Yt("WebSocket Gateway is not connected.",t);const e=new ze(this._documentId);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(10,ze.TYPE,l.encode(e)),r=l.decode(n,Fe);return this.listenTo(t,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:ve._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(t,r.channel),this._isConnected=!0,this.fire("connected"),r.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(t,e,n,r=null,s){const o=new Me(t,this._documentId,e,n,r,s),i=await this._sendRequest(Me.TYPE,o);return l.decode(i,Be)}async get(t,e=1){const n=new Ue(t,this._documentId);try{const t=await this._sendRequest(Ue.TYPE,n);return l.decode(t,Je)}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&e<5)return await(r=100*e,new Promise(t=>{setTimeout(t,r)})),this.get(t,e+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw Ht.fromPublicError(n)}var r}async getAll(){const t=new qe(this._documentId),e=await this._sendRequest(qe.TYPE,t),{suggestions:n}=l.decode(e,Le);return n}async update(t,e={}){const{hasComments:n,state:r,attributes:s}=e,o=void 0!==n,i=new He(t,this._documentId,n,o,r,s);await this._sendRequest(He.TYPE,i)}async batchUpdateState(t){const e=new Ke(t.ids,this._documentId,t.state);await this._sendRequest(Ke.TYPE,e)}_connectToChannel(t,e){this._channel=t._getChannel(We._SERVICE,e),this._channel&&this.listenTo(this._channel,this._channel.getEventName(He.TYPE),(t,e)=>{const n=l.decode(e,He);this.fire("suggestionUpdated",n)})}_onWsGatewayStateChange(t){t===Oe.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new xe("Track Changes",this);return this._wsGateway._sendRequest(10,t,l.encode(e))}}const Qe=We,Ze={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Xe;const $e=new Uint8Array(16);function tn(){if(!Xe&&(Xe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xe($e)}const en=[];for(let t=0;t<256;++t)en.push((t+256).toString(16).slice(1));function nn(t,e=0){return en[t[e+0]]+en[t[e+1]]+en[t[e+2]]+en[t[e+3]]+"-"+en[t[e+4]]+en[t[e+5]]+"-"+en[t[e+6]]+en[t[e+7]]+"-"+en[t[e+8]]+en[t[e+9]]+"-"+en[t[e+10]]+en[t[e+11]]+en[t[e+12]]+en[t[e+13]]+en[t[e+14]]+en[t[e+15]]}const rn=function(t,e,n){if(Ze.randomUUID&&!e&&!t)return Ze.randomUUID();const r=(t=t||{}).random||(t.rng||tn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return nn(r)};class sn extends i{channel;sockets;static DESCRIPTOR_NAME="SessionsConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};constructor(t,e=[]){super(),this.channel=t,this.sockets=e}toJSON(){return{channel:this.channel,sockets:this.sockets.map(t=>({user:t.userId,session:t.id,role:t.role,permissions:t.permissions}))}}static fromJSON(t){return new sn(t.channel,t.sockets.map(t=>({id:t.session,userId:t.user,role:t.role,permissions:t.permissions})))}}class on extends i{id;sessionType;static TYPE="31";static READABLE_TYPE_NAME="getConnectedSockets";static DESCRIPTOR_NAME="SessionsConnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};constructor(t,e){super(),this.id=t,this.sessionType=e}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(t){return new on(t.id,t.sessionType)}}class an extends i{id;userId;role;permissions;static TYPE="32";static READABLE_TYPE_NAME="connectSocket";static DESCRIPTOR_NAME="SocketConnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};constructor(t,e,n,r){super(),this.id=t,this.userId=e,this.role=n,this.permissions=r}toJSON(){return{id:this.id,userId:this.userId??void 0,role:this.role??void 0,permissions:this.permissions??void 0}}static fromJSON(t){return new an(t.id,t.userId,t.role,t.permissions)}}class cn extends i{id;static TYPE="33";static READABLE_TYPE_NAME="disconnectSocket";static DESCRIPTOR_NAME="SocketDisconnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1}}};constructor(t){super(),this.id=t}toJSON(){return{id:this.id}}static fromJSON(t){return new cn(t.id)}}const dn=class extends n.Collection{_id;_sessionType;_handlers=new Map;_channel;_wsGateway;_connected;_eventsQueue=[];_isRunning=!1;constructor(t,e){super({idProperty:"id"}),this._id=t,this._sessionType=e}async connect(t){this._wsGateway=t,this.stopListening(t,"change:state");const e=new on(this._id,this._sessionType);let n;try{const t=await this._wsGateway._sendRequest(3,on.TYPE,l.encode(e));n=l.decode(t,sn)}catch(t){n=new sn(this._id,[])}this._connectToChannel(this._wsGateway,n.channel,this._sessionType);const r=await async function(t,e){const n=e.map(t=>t.userId),r=n.length?await b.getMany(t,n):[];return e.map(t=>{const e={id:t.id,role:t.role,permissions:t.permissions};return e.user=t.userId&&r.find(e=>e.id===t.userId)||new b,e})}(this._wsGateway,n.sockets);for(const t of r)super.add(t);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:ve._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(t=!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&&t&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),t&&this.stopListening()}}add(t,e){throw new TypeError("The collection is read-only.")}remove(t){throw new TypeError("The collection is read-only.")}_connectToChannel(t,e,n){this._channel=t._getChannel(n,e),this._channel&&(this._addHandler(this._channel,an.TYPE,async e=>{const n=l.decode(e,an);if(-1===this.getIndex(n.id)){const e={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(e.user=await b.get(t,n.userId)),super.add(e)}}),this._addHandler(this._channel,cn.TYPE,t=>{const e=l.decode(t,cn);-1!==this.getIndex(e.id)&&super.remove(e.id)}))}async _onWsGatewayStateChange(t){t===ve.STATE_DISCONNECTED&&this.disconnect(!1),t===ve.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let t;for(this._isRunning=!0;t=this._eventsQueue.shift();){const e=this._handlers.get(t.eventName);e&&await e(t.data)}this._isRunning=!1}_addHandler(t,e,n){const r=t.getEventName(e,!0);this.listenTo(t,r,async(t,e)=>{const n=t.name;this._eventsQueue.push({eventName:n,data:e}),await this._runQueue()}),this._handlers.set(r,n)}};class un{static async getConnectedSessions(t,e,n){const r=new dn(e,n);return await r.connect(t),r}}class ln extends i{id;buffers;types;bundleVersion;lastOperationId;static TYPE="11";static READABLE_TYPE_NAME="connectToDocument";static DESCRIPTOR_NAME="CollaborativeEditingConnectMessage";static 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}}};constructor(t,e,n,r,s=""){super(),this.id=t,this.buffers=e,this.types=n,this.bundleVersion=r,this.lastOperationId=s}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,bundleVersion:this.bundleVersion,lastOperationId:this.lastOperationId}}static fromJSON(t){return new ln(t.id,t.buffers,t.types,t.bundleVersion,t.lastOperationId)}}class pn{static prepareMetadataForOperations(t,e){if(!t?.length||!e?.length)return[];const n=[];let r=0;for(const s of t)if(0!==s){if(!e[r])throw new Error("Missing metadata for a operation");n.push(e[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(t,e){if(!t?.length||!e?.length)return[];const n=[];for(let r=0;r<t.length;r++)if(0!==t[r]){if(!e[r])throw new Error("Missing metadata for a operation");n.push(e[r])}return n}}class hn extends o{static DESCRIPTOR_NAME="OperationMetadataDescriptor";static DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};static toJSON({createdAt:t,...e}){const n={...e};return t?.toISOString&&(n.createdAt=t.toISOString()),n}static fromJSON({createdAt:t,...e}){const n={...e};return t&&(n.createdAt=new Date(t)),n}}class fn extends i{id;buffers;types;baseVersion;metadata;lastOperationId;static TYPE="13";static READABLE_TYPE_NAME="updateDocument";static DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage";static 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}}};constructor(t,e,n,r,s=[],o=""){super(),this.id=t,this.buffers=e,this.types=n,this.baseVersion=r,this.metadata=s,this.lastOperationId=o}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:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(t){return new fn(t.id,t.buffers,t.types,t.baseVersion,pn.prepareMetadataForOperations(t.types,t.metadata).map(hn.fromJSON),t.lastOperationId)}}class mn extends i{id;lastKnowVersion;bundleVersion;static TYPE="12";static READABLE_TYPE_NAME="reconnectToDocument";static DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};constructor(t,e,n){super(),this.id=t,this.lastKnowVersion=e,this.bundleVersion=n}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(t){return new mn(t.id,t.lastKnowVersion,t.bundleVersion)}}class yn extends i{version;buffers;types;metadata;lastOperationId;lastOperationAcceptedAt;static DESCRIPTOR_NAME="CollaborativeEditingResponse";static 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}}};constructor(t,e=[],n=[],r=[],s="",o=null){super(),this.version=t,this.buffers=e,this.types=n,this.metadata=r,this.lastOperationId=s,this.lastOperationAcceptedAt=o}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){return!this.types?.length}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(t){return new yn(t.version,t.buffers,t.types,pn.prepareMetadataForOperations(t.types,t.metadata).map(hn.fromJSON),t.lastOperationId,t.lastOperationAcceptedAt?new Date(t.lastOperationAcceptedAt):null)}static create(t){return new yn(t.version,t.buffers,t.types,t.metadata,t.lastOperationId,t.lastOperationAcceptedAt?new Date(t.lastOperationAcceptedAt):null)}}class gn extends i{channel;version;buffers;types;offset;metadata;initData;sessionId;lastOperationId;sessionCreatedAt;static DESCRIPTOR_NAME="CollaborativeEditingConnectResponse";static 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:hn.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}}}))();constructor(t,e,n=[],r=[],s=0,o=[],i=null,a="",c="",d=null){super(),this.channel=t,this.version=e,this.buffers=n,this.types=r,this.offset=s,this.metadata=o,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(){return!this.types?.length&&null===this.initData}toJSON(){return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),initData:this.initData??"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(t){return new gn(t.channel,t.version,t.buffers,t.types,t.offset,t.metadata,t.initData,t.sessionId,t.lastOperationId,t.sessionCreatedAt)}static fromJSON(t){let e=null;return!0===t.isInitialized?e=t.initData??"":"boolean"!=typeof t.isInitialized&&t.initData&&(e=t.initData),gn.create({channel:t.channel,version:t.version,buffers:t.buffers,types:t.types,offset:t.offset,metadata:pn.prepareMetadataForOperations(t.types,t.metadata).map(hn.fromJSON),initData:e,sessionId:t.sessionId,lastOperationId:t.lastOperationId,sessionCreatedAt:t.sessionCreatedAt?new Date(t.sessionCreatedAt):null})}}class bn extends i{lastDocumentSession;currentDocumentSession;static DESCRIPTOR_NAME="GetDocumentDetailsResponse";static 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}}};constructor(t,e){super(),this.lastDocumentSession=t,this.currentDocumentSession=e}get data(){return{lastDocumentSessionId:this.lastDocumentSession?.id,lastDocumentSessionOperationId:this.lastDocumentSession?.lastOperationId,currentDocumentSessionId:this.currentDocumentSession?.id,currentDocumentSessionVersion:this.currentDocumentSession?.version,currentDocumentSessionOperationId:this.currentDocumentSession?.lastOperationId}}toJSON(){return{lastDocumentSessionId:this.lastDocumentSession?.id,lastDocumentSessionOperationId:this.lastDocumentSession?.lastOperationId,currentDocumentSessionId:this.currentDocumentSession?.id,currentDocumentSessionVersion:this.currentDocumentSession?.version,currentDocumentSessionOperationId:this.currentDocumentSession?.lastOperationId}}static fromJSON(t){const e=t.lastDocumentSessionId?{id:t.lastDocumentSessionId,lastOperationId:t.lastDocumentSessionOperationId}:void 0,n=t.currentDocumentSessionId?{lastOperationId:t.currentDocumentSessionOperationId,version:t.currentDocumentSessionVersion,id:t.currentDocumentSessionId}:void 0;return new bn(e,n)}}class On extends i{documentId;static TYPE="14";static READABLE_TYPE_NAME="getDocumentDetails";static DESCRIPTOR_NAME="GetDocumentDetailsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};constructor(t){super(),this.documentId=t}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new On(t.documentId)}}const wn=class extends((0,n.EmitterMixin)()){static _SERVICE=1;_bundleVersion;_id;_isConnected;_wsGateway;_channel;_connectedSessions;constructor(t,e){if(super(),!t)throw new TypeError('Param "bundleVersion" must be provided.');this._id=e??rn(),this._isConnected=!1,this._bundleVersion=t}getId(){return this._id}isConnected(){return this._isConnected}connect(t,e={buffers:[],types:[]},n){const r=new ln(this.getId(),e.buffers,e.types,this._bundleVersion,n);return this._connect(t,r)}reconnect(t,e){if(this.isConnected())throw new Yt("Cannot reconnect to already connected service.",t);return this._connect(t,new mn(this.getId(),e,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 t=new On(this.getId());if(!this._wsGateway)throw new xe("Collaborative Editing",this);const e=await this._wsGateway._sendRequest(1,On.TYPE,l.encode(t));return l.decode(e,bn)}async sendOperations(t,e,n){if(!t?.types?.length)throw new Yt("Cannot send empty update.",this._wsGateway);const r="number"==typeof e?e:parseInt(e);if(!Number.isInteger(r)||r<0)throw new Yt("Base version not provided.",this._wsGateway);const s=new fn(this.getId(),t.buffers,t.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new xe("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,fn.TYPE,l.encode(s));return l.decode(o,yn)}async getConnectedSessions(){if(!this._isConnected)throw new xe("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await un.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(t,e){return un.getConnectedSessions(t,e,1)}async _connect(t,e){if(this.isConnected())return;if(t.state!==ve.STATE_CONNECTED)throw new Yt("WebSocket Gateway is not connected.",t);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(1,e.constructor.TYPE,l.encode(e)),r=l.decode(n,gn);return this.listenTo(t,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:ve._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(t,r.channel),this._isConnected=!0,this.fire("connected"),r}_connectToChannel(t,e){this._channel=t._getChannel(1,e),this.listenTo(this._channel,this._channel.getEventName(fn.TYPE),(t,e)=>{const n=l.decode(e,fn);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)})}_onWsGatewayStateChange(t){t===ve.STATE_DISCONNECTED&&this.disconnect()}};class vn extends o{static DESCRIPTOR_NAME="CommentDescriptor";static 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"}}};static toJSON(t){return{...t,createdAt:t.createdAt?.toISOString(),attributes:t.attributes?JSON.stringify(t.attributes):null}}static fromJSON(t){return{...t,createdAt:new Date(t.createdAt),attributes:t.attributes?JSON.parse(t.attributes):null}}}class In extends o{static DESCRIPTOR_NAME="CommentsThreadDescriptor";static 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},unlinkedAt:{type:"string",id:9}}};static toJSON(t){return{...t,createdAt:t.createdAt?.toISOString(),deletedAt:t.deletedAt?.toISOString(),resolvedAt:t.resolvedAt?.toISOString(),attributes:t.attributes?JSON.stringify(t.attributes):null,context:t.context?JSON.stringify(t.context):t.context,comments:t.comments?.map(vn.toJSON),unlinkedAt:t.unlinkedAt?.toISOString()}}static fromJSON(t){return{...t,createdAt:t.createdAt?new Date(t.createdAt):void 0,deletedAt:t.deletedAt?new Date(t.deletedAt):void 0,resolvedAt:t.resolvedAt?new Date(t.resolvedAt):void 0,attributes:t.attributes?JSON.parse(t.attributes):null,context:t.context?JSON.parse(t.context):void 0,comments:t.comments?.map(vn.fromJSON),unlinkedAt:t.unlinkedAt?new Date(t.unlinkedAt):void 0}}}class Sn extends i{documentId;commentThreadId;content;commentId;userId;attributes;commentThread;createdAt;static TYPE="91";static READABLE_TYPE_NAME="addComment";static DESCRIPTOR_NAME="CommentsV2AddCommentMessage";static 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}}};constructor(t,e,n,r="",s,o="",i=null,a){super(),this.documentId=t,this.commentThreadId=e,this.content=n,this.commentId=r,this.userId=o,this.attributes=i,this.commentThread=a,this.createdAt=s?new Date(s):""}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?In.toJSON(this.commentThread):void 0}}static fromJSON(t){return new Sn(t.documentId,t.commentThreadId,t.content,t.commentId?t.commentId:void 0,t.createdAt?new Date(t.createdAt):void 0,t.userId?t.userId:void 0,t.attributes?JSON.parse(t.attributes):{},t.commentThread?In.fromJSON(t.commentThread):void 0)}}class kn extends i{commentThreadId;commentId;createdAt;static DESCRIPTOR_NAME="CommentsV2AddCommentResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};constructor(t,e,n){super(),this.commentThreadId=t,this.commentId=e,this.createdAt=new Date(n)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(t){return new kn(t.commentThreadId,t.commentId,t.createdAt)}}class Pn extends i{documentId;static TYPE="92";static READABLE_TYPE_NAME="connectToComment";static DESCRIPTOR_NAME="CommentsV2ConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new Pn(t.documentId)}}class An extends i{channel;_threads;_threadsV2;threads;static DESCRIPTOR_NAME="CommentsV2ConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};constructor(t,e,n){super(),this.channel=t,this._threads=e,this._threadsV2=n,this.threads=n?.length?n:e}toJSON(){return{channel:this.channel,threads:this._threads?.map(t=>JSON.stringify(t)),threadsV2:this._threadsV2?.map(In.toJSON)}}static fromJSON(t){return new An(t.channel,t.threads?.map(t=>JSON.parse(t)),t.threadsV2?.map(In.fromJSON))}}class Tn extends i{documentId;commentThreadId;commentId;static TYPE="95";static READABLE_TYPE_NAME="removeComment";static DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};constructor(t,e,n){super(),this.documentId=t,this.commentThreadId=e,this.commentId=n}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(t){return new Tn(t.documentId,t.commentThreadId,t.commentId)}}class _n extends i{documentId;commentThreadId;static TYPE="97";static READABLE_TYPE_NAME="removeCommentThread";static DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(t,e){super(),this.documentId=t,this.commentThreadId=e}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(t){return new _n(t.documentId,t.commentThreadId)}}class Cn extends i{documentId;commentThreadId;commentId;content;attributes;isAttributesUpdated;commentThread;static TYPE="96";static READABLE_TYPE_NAME="updateComment";static DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage";static 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}}};constructor(t,e,n,r,s=null,o=!1,i){super(),this.documentId=t,this.commentThreadId=e,this.commentId=n,this.content=r,this.attributes=s,this.isAttributesUpdated=o,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?In.toJSON(this.commentThread):void 0}}static fromJSON(t){return new Cn(t.documentId,t.commentThreadId,t.commentId,t.content,t.attributes?JSON.parse(t.attributes):null,t.isAttributesUpdated,t.commentThread?In.fromJSON(t.commentThread):void 0)}}class jn extends i{commentThreadId;documentId;static TYPE="93";static READABLE_TYPE_NAME="getComment";static DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(t,e){super(),this.commentThreadId=t,this.documentId=e}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(t){return new jn(t.commentThreadId,t.documentId)}}class En extends i{commentThreadId;_comments;_commentsV2;resolvedBy;comments;createdAt;deletedAt;resolvedAt;attributes;context;unlinkedAt;static DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse";static 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},unlinkedAt:{type:"string",id:10}}};constructor(t,e,n,r,s,o,i,a,c,d){super(),this.commentThreadId=t,this._comments=e,this._commentsV2=n,this.resolvedBy=s,this.comments=n?.length?n:e,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.unlinkedAt="string"==typeof d?new Date(d):d,this.attributes="string"==typeof r?JSON.parse(r):r,this.context="string"==typeof o?JSON.parse(o):o}toJSON(){return{commentThreadId:this.commentThreadId,comments:this._comments?.map(t=>JSON.stringify(t)),commentsV2:this._commentsV2?.map(vn.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:this.createdAt?.toISOString(),deletedAt:this.deletedAt?.toISOString(),resolvedAt:this.resolvedAt?.toISOString(),unlinkedAt:this.unlinkedAt?.toISOString()}}static fromJSON(t){return new En(t.commentThreadId,t.comments?.map(t=>function(t){const e=JSON.parse(t);return{...e,createdAt:new Date(e.createdAt)}}(t)),t.commentsV2?.map(vn.fromJSON),t.attributes?JSON.parse(t.attributes):t.attributes,t.resolvedBy,t.context?JSON.parse(t.context):t.context,t.createdAt,t.deletedAt,t.resolvedAt,t.unlinkedAt)}}class Dn extends i{documentId;static TYPE="94";static READABLE_TYPE_NAME="getDocumentThreads";static DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new Dn(t.documentId)}}class Rn extends i{_threads;_threadsV2;threads;static DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse";static DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};constructor(t,e){super(),this._threads=t,this._threadsV2=e,this.threads=e?.length?e:t}toJSON(){return{threads:this._threads?.map(t=>JSON.stringify(t)),threadsV2:this._threadsV2?.map(In.toJSON)}}static fromJSON(t){return new Rn(t.threads?.map(t=>function(t){const e=JSON.parse(t),n={...e};return e.comments&&(n.comments=e.comments?.map(t=>({...t,createdAt:new Date(t.createdAt)}))),n}(t)),t.threadsV2?.map(In.fromJSON))}}class xn extends o{static DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor";static DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};static toJSON(t){return{commentId:t.commentId,createdAt:t.createdAt?.toISOString()}}static fromJSON(t){return{commentId:t.commentId,createdAt:new Date(t.createdAt)}}}class Nn extends i{commentThreadId;comments;createdAt;static DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};constructor(t,e,n=[]){super(),this.commentThreadId=t,this.comments=n,this.createdAt=new Date(e)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString(),comments:this.comments.map(t=>xn.toJSON(t))}}static fromJSON(t){return new Nn(t.commentThreadId,t.createdAt,t.comments.map(t=>xn.fromJSON(t)))}}class Vn extends i{documentId;commentThreadId;comments;context;resolvedBy;attributes;createdAt;resolvedAt;deletedAt;static TYPE="140";static READABLE_TYPE_NAME="addCommentThread";static DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage";static 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}}};constructor(t,e,n=[],r,s=null,o=null,i=null,a=null,c=null){super(),this.documentId=t,this.commentThreadId=e,this.comments=n,this.context=r,this.resolvedBy=s,this.attributes=c,this.createdAt=o?new Date(o):"",this.resolvedAt=i?new Date(i):"",this.deletedAt=a?new Date(a):""}toJSON(){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:this.comments?.map(t=>vn.toJSON(t))}}static fromJSON(t){return new Vn(t.documentId,t.commentThreadId,t.comments?.map(e=>vn.fromJSON({...e,documentId:t.documentId,commentThreadId:t.commentThreadId})),t.context?JSON.parse(t.context):t.context,t.resolvedBy,t.createdAt?new Date(t.createdAt):void 0,t.resolvedAt?new Date(t.resolvedAt):void 0,t.deletedAt?new Date(t.deletedAt):void 0,t.attributes?JSON.parse(t.attributes):t.attributes)}}class Mn extends i{commentThreadId;documentId;resolvedBy;resolvedAt;static TYPE="142";static READABLE_TYPE_NAME="resolveCommentThread";static DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};constructor(t,e,n,r){super(),this.commentThreadId=t,this.documentId=e,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt?.toISOString()}}static fromJSON(t){return new Mn(t.commentThreadId,t.documentId,t.resolvedBy,t.resolvedAt)}}class Bn extends i{commentThreadId;documentId;static TYPE="141";static READABLE_TYPE_NAME="reopenCommentThread";static DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(t,e){super(),this.commentThreadId=t,this.documentId=e}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(t){return new Bn(t.commentThreadId,t.documentId)}}class Un extends i{commentThreadId;documentId;context;attributes;unlinkedAt;static TYPE="143";static READABLE_TYPE_NAME="updateCommentThread";static DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},context:{type:"string",id:3},attributes:{type:"string",id:4},unlinkedAt:{type:"string",id:5}}};constructor(t,e,n,r=null,s=null){super(),this.commentThreadId=t,this.documentId=e,this.context=n,this.attributes=r,this.unlinkedAt=s?new Date(s):""}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,unlinkedAt:this.unlinkedAt instanceof Date?this.unlinkedAt.toISOString():this.unlinkedAt}}static fromJSON(t){return new Un(t.commentThreadId,t.documentId,t.context?JSON.parse(t.context):t.context,t.attributes?JSON.parse(t.attributes):null,t.unlinkedAt?new Date(t.unlinkedAt):null)}}class Jn extends i{commentThreadId;documentId;resolvedBy;resolvedAt;static DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};constructor(t,e,n,r){super(),this.commentThreadId=t,this.documentId=e,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(t){return new Jn(t.commentThreadId,t.documentId,t.resolvedBy,t.resolvedAt)}}class qn extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;_connectedSessions;static _SERVICE=9;constructor(t){super(),this._documentId=t}get isConnected(){return this._isConnected}async connect(t){if(this._isConnected)return;if(t.state!==Oe.CONNECTED)throw new Yt("WebSocket Gateway is not connected.",t);const e=new Pn(this._documentId);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(9,Pn.TYPE,l.encode(e)),{channel:r,threads:s}=l.decode(n,An);return this.listenTo(t,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:ve._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(t,r),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(t,e,n,r){const s=new Sn(this._documentId,t,n,e,void 0,void 0,r),o=await this._sendRequest(Sn.TYPE,s);return l.decode(o,kn)}async updateComment(t,e,n,r){const s=void 0!==r,o=new Cn(this._documentId,t,e,n,r,s);await this._sendRequest(Cn.TYPE,o)}async removeComment(t,e){const n=new Tn(this._documentId,t,e);await this._sendRequest(Tn.TYPE,n)}async removeCommentThread(t){const e=new _n(this._documentId,t);await this._sendRequest(_n.TYPE,e)}async addCommentThread(t){const e=new Vn(this._documentId,t.commentThreadId,t.comments?.map(e=>({...e,documentId:this._documentId,commentThreadId:t.commentThreadId})),t.context,t.resolvedBy,t.createdAt,t.resolvedAt,t.deletedAt,t.attributes),n=await this._sendRequest(Vn.TYPE,e);return l.decode(n,Nn)}async resolveCommentThread(t){const e=new Mn(t,this._documentId),n=await this._sendRequest(Mn.TYPE,e);return l.decode(n,Jn)}async reopenCommentThread(t){const e=new Bn(t,this._documentId);await this._sendRequest(Bn.TYPE,e)}async updateCommentThread(t){const e=new Un(t.commentThreadId,this._documentId,t.context,t.attributes,t.unlinkedAt);await this._sendRequest(Un.TYPE,e)}async getCommentThread(t,e=1){const n=new jn(t,this._documentId);try{const t=await this._sendRequest(jn.TYPE,n),e=l.decode(t,En);return{commentThreadId:e.commentThreadId,comments:e.comments,attributes:e.attributes,context:e.context,resolvedAt:e.resolvedAt,resolvedBy:e.resolvedBy,deletedAt:e.deletedAt,unlinkedAt:e.unlinkedAt}}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&e<5)return await(r=100*e,new Promise(t=>{setTimeout(t,r)})),this.getCommentThread(t,e+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw Ht.fromPublicError(n)}var r}async getDocumentThreads(){const t=new Dn(this._documentId),e=await this._sendRequest(Dn.TYPE,t),{threads:n}=l.decode(e,Rn);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new xe("Comments",this);return this._connectedSessions||(this._connectedSessions=await un.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(t,e){this._channel=t._getChannel(qn._SERVICE,e),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Sn.TYPE),(t,e)=>{const n=l.decode(e,Sn);this.fire("commentAdded",n)}),this.listenTo(this._channel,this._channel.getEventName(Tn.TYPE),(t,e)=>{const n=l.decode(e,Tn);this.fire("commentRemoved",n)}),this.listenTo(this._channel,this._channel.getEventName(Cn.TYPE),(t,e)=>{const n=l.decode(e,Cn);this.fire("commentUpdated",n)}),this.listenTo(this._channel,this._channel.getEventName(_n.TYPE),(t,e)=>{const n=l.decode(e,_n);this.fire("commentThreadRemoved",n)}),this.listenTo(this._channel,this._channel.getEventName(Vn.TYPE),(t,e)=>{const n=l.decode(e,Vn);this.fire("commentThreadAdded",n)}),this.listenTo(this._channel,this._channel.getEventName(Un.TYPE),(t,e)=>{const n=l.decode(e,Un);this.fire("commentThreadUpdated",n)}),this.listenTo(this._channel,this._channel.getEventName(Mn.TYPE),(t,e)=>{const n=l.decode(e,Mn);this.fire("commentThreadResolved",n)}),this.listenTo(this._channel,this._channel.getEventName(Bn.TYPE),(t,e)=>{const n=l.decode(e,Bn);this.fire("commentThreadReopened",n)}))}_onWsGatewayStateChange(t){t===Oe.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new xe("Comments",this);return this._wsGateway._sendRequest(9,t,l.encode(e))}}const Gn=qn,Ln=zn;function Yn(){const t=["then","delete","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.","_domEmitter","Connected users limit exceeded","pluginName","connection","init","offline","catch","WebSocketGateway","has","set","websocketgateway-missing-websocket-url","destroy","disconnect","DISCONNECTED","removeFromReconnectionStack","836163SHtIyR","requires","isOfficialPlugin","isInReconnectionStack","state","function","cloudServices.requestTimeout","_reconnectionStack","webSocketUrl","change:me","token","_shouldPluginsReconnect","constructor","plugins","stopListening","CONNECTING","9636858HVDGgM","174itBGyr","51702240qNHsFz","define","initialReconnectionInterval","connected","cloudservices-reconnection-error","limitExceeded","2778458WJWsNZ","addToReconnectionStack","add","from","showWarning","code","cloudservices-init","config","296160aPkDhX","online","isPremiumPlugin","real-time-collaboration","3604476rgQzuY","error","CloudServices","context","_isBrowserOffline","CONNECTED","websocketgateway-plugin-already-registered","connect","get","reconnect","websocketgateway-missing-token","bind","cloudServices.connectionTimeout","listenTo","3156045nDXfQY","_reconnect","websocketgateway-invalid-plugin-interface","all"];return(Yn=function(){return t})()}!function(t){const e=zn,n=t();for(;;)try{if(862158===parseInt(e(303))/1+-parseInt(e(327))/2+-parseInt(e(281))/3+-parseInt(e(267))/4+-parseInt(e(335))/5*(parseInt(e(320))/6)+-parseInt(e(319))/7+parseInt(e(321))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Yn);class Hn extends e.ContextPlugin{static[Ln(295)]=(()=>ve)();static[Ln(323)]=1e3;[Ln(291)];[Ln(310)];[Ln(314)];[Ln(288)];static get[Ln(304)](){return[Ln(269),r.Notification]}static get[Ln(290)](){return Ln(295)}static get[Ln(305)](){return!0}static get[Ln(337)](){return!0}constructor(t){const e=Ln;super(t),this[e(297)](e(307),Oe[e(272)]),this[e(297)](e(271),!1),this[e(310)]=new Set,this[e(314)]=!1,this[e(288)]=new((0,n.DomEmitterMixin)())}[Ln(292)](){const t=Ln,e=this[t(270)],s=e[t(316)][t(275)](t(269)),o=e[t(316)][t(275)](r.Notification);if(!s[t(313)])throw new n.CKEditorError(t(277),this);if(!s[t(311)])throw new n.CKEditorError(t(298),this);return this[t(288)][t(280)](window,t(293),()=>this[t(271)]=!0),this[t(288)][t(280)](window,t(336),()=>this[t(271)]=!1),this[t(270)][t(334)][t(322)](t(279),10),this[t(270)][t(334)][t(322)](t(309),20),Hn[t(295)][t(274)](s[t(313)],s[t(311)],{timeout:1e3*this[t(270)][t(334)][t(275)](t(279)),requestTimeout:1e3*this[t(270)][t(334)][t(275)](t(309))})[t(285)](e=>{const r=t;if(this[r(291)]=e,this[r(278)](r(307)).to(e,r(307),this,r(271),(t,e)=>(r(324)!==t&&(this[r(314)]=!0),e||t!==Oe[r(272)]?Oe[r(301)]:this[r(307)]==Oe[r(301)]&&this[r(314)]?(this[r(314)]=!1,this[r(282)](),Oe[r(318)]):Oe[r(272)])),this[r(291)].on(r(268),(t,e)=>{const s=r;if(s(326)!==e[s(332)])throw console[s(268)](e),new n.CKEditorError(s(333),null,{originalError:e});o[s(331)](s(287),{title:s(289),namespace:s(266)})}),!e.me)return new Promise(t=>e.on(r(312),t))})[t(294)](e=>{const r=t;throw console[r(268)](e),new n.CKEditorError(r(333),null,{originalError:e})})}[Ln(328)](t){const e=Ln;if(e(308)!=typeof t[e(276)])throw new n.CKEditorError(e(283),this);if(this[e(306)](t))throw new n.CKEditorError(e(273),this,{name:t[e(315)][e(290)]});this[e(310)][e(329)](t)}[Ln(302)](t){const e=Ln;this[e(310)][e(286)](t)}[Ln(306)](t){const e=Ln;return this[e(310)][e(296)](t)}[Ln(282)](){const t=Ln;return this[t(291)][t(276)]()[t(285)](()=>Promise[t(284)](Array[t(330)](this[t(310)],e=>e[t(276)]())))[t(285)](()=>this[t(307)]=Oe[t(272)])[t(294)](e=>{const r=t;throw console[r(268)](e),new n.CKEditorError(r(325),this[r(270)])})}[Ln(300)](){const t=Ln;this[t(291)]&&this[t(291)][t(300)](),this[t(307)]=Oe[t(301)],this[t(288)][t(317)]()}[Ln(299)](){const t=Ln;this[t(300)](),super[t(299)]()}}function zn(t,e){const n=Yn();return(zn=function(t,e){return n[t-=266]})(t,e)}var Fn=__webpack_require__(211);const Kn=Qn;function Wn(){const t=["state","delete","10WzGVRV","role","context","register","20nSKwhB","change:state","84iwWfJD","getUserRole","clear","getUser","getUserSessions","sessions-register-already-registered","getUserBySessionId","452890IppiBy","listenTo","857694fRlfxq","get","has","4745AHzCZH","unregister","assign","sessionId","isMe","size","values","_registeredSessions","_users","317WWGsSZ","orderNumber","sessionAdd:","Sessions","isOfficialPlugin","804WtJJZH","plugins","set","add","154533iJbieg","mySessionId","requires","allConnectedUsers","user","_handleSessionAdd","127831HzYitl","isPremiumPlugin","pluginName","153abDlMO","sessions-unregister-not-exist","502696FsjzTP","49238jCgoBg","connected","channelConnectedUsers","_handleSessionRemove","channelSessions","init","forEach","defineMe","remove","addUser","fire","6366HBwnKf","_uniqueUsersCount","stopListening","connection","_createUser"];return(Wn=function(){return t})()}function Qn(t,e){const n=Wn();return(Qn=function(t,e){return n[t-=451]})(t,e)}!function(t){const e=Qn,n=t();for(;;)try{if(986525===parseInt(e(490))/1*(parseInt(e(456))/2)+-parseInt(e(499))/3*(parseInt(e(467))/4)+-parseInt(e(463))/5*(parseInt(e(478))/6)+parseInt(e(469))/7*(-parseInt(e(510))/8)+-parseInt(e(508))/9*(-parseInt(e(476))/10)+-parseInt(e(505))/11*(parseInt(e(495))/12)+-parseInt(e(481))/13*(-parseInt(e(511))/14))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Wn);class Zn extends e.ContextPlugin{[Kn(515)];[Kn(513)];[Kn(502)];[Kn(488)];[Kn(457)];[Kn(489)];static get[Kn(507)](){return Kn(493)}static get[Kn(494)](){return!0}static get[Kn(506)](){return!0}static get[Kn(501)](){return[Hn,Fn.Users]}constructor(t){const e=Kn;super(t),this[e(515)]=new Map,this[e(513)]=new Map,this[e(502)]=new n.Collection,this[e(488)]=new Map,this[e(457)]=0,this[e(489)]=this[e(465)][e(496)][e(479)](Fn.Users)}[Kn(516)](){const t=Kn,e=this[t(465)][t(496)][t(479)](Hn);this[t(477)](e,t(468),(e,n,r)=>{const s=t;if(s(512)!==r)this[s(515)][s(451)](t=>t[s(471)]()),this[s(513)][s(451)](t=>t[s(471)]()),this[s(502)][s(471)]();else for(const[t,e]of this[s(488)])for(const n of e)this[s(504)](t,n)}),this[t(460)](e[t(459)].me,!0)}[Kn(466)](t,e){const r=Kn;if(this[r(488)][r(480)](t))throw new n.CKEditorError(r(474),null,{channelId:t});this[r(488)][r(497)](t,e),this[r(515)][r(497)](t,new n.Collection),this[r(513)][r(497)](t,new n.Collection),this[r(477)](e,r(498),(e,n)=>this[r(504)](t,n)),this[r(477)](e,r(453),(e,n)=>this[r(514)](t,n));for(const n of e)this[r(504)](t,n)}[Kn(482)](t){const e=Kn;if(!this[e(488)][e(480)](t))throw new n.CKEditorError(e(509),null,{channelId:t});const r=this[e(488)][e(479)](t);this[e(458)](r);for(const n of r)e(512)===this[e(465)][e(496)][e(479)](Hn)[e(461)]&&this[e(514)](t,n);this[e(488)][e(462)](t),this[e(515)][e(462)](t),this[e(513)][e(462)](t)}get[Kn(500)](){const t=Kn;return this[t(465)][t(496)][t(479)](Hn)[t(459)][t(484)]}[Kn(475)](t){const e=Kn;for(const n of this[e(515)][e(487)]())for(const r of n)if(r.id===t)return r[e(503)]}[Kn(473)](t,e){const n=Kn,r=e?[this[n(515)][n(479)](e)]:this[n(515)][n(487)](),s=new Set;for(const e of r)for(const r of e)r[n(503)].id===t.id&&s[n(498)](r.id);return s}[Kn(470)](t){const e=Kn;for(const n of this[e(515)][e(487)]())for(const r of n)if(r[e(503)]===t)return r[e(464)]}[Kn(504)](t,e){const n=Kn;if(n(512)!==this[n(465)][n(496)][n(479)](Hn)[n(461)])return;const r=e[n(503)],s=this[n(489)][n(472)](r.id)||this[n(460)](r),o=Object[n(483)]({},e,{user:s});this[n(515)][n(479)](t)[n(498)](o);const i=this[n(513)][n(479)](t);i[n(480)](s.id)||i[n(498)](s),this[n(502)][n(480)](s.id)||this[n(502)][n(498)](s,s[n(485)]?0:void 0),this[n(455)](n(492)+t,{channelId:t,session:o})}[Kn(514)](t,e){const n=Kn;if(n(512)!==this[n(465)][n(496)][n(479)](Hn)[n(461)])return;const r=this[n(513)][n(479)](t),s=e[n(503)];s.id&&(this[n(515)][n(479)](t)[n(453)](e.id),r[n(480)](s.id)&&!this[n(473)](s,t)[n(486)]&&r[n(453)](s.id),this[n(502)][n(479)](s.id)&&!this[n(473)](s)[n(486)]&&this[n(502)][n(453)](s.id))}[Kn(460)](t,e){const n=Kn,r=this[n(489)][n(454)](t);return e&&this[n(489)][n(452)](t.id),r[n(491)]=this[n(457)]++,r}}var Xn=__webpack_require__(673),$n=__webpack_require__.n(Xn),tr=__webpack_require__(545),er=__webpack_require__.n(tr),nr=__webpack_require__(262),rr=__webpack_require__.n(nr),sr=__webpack_require__(667),or=__webpack_require__.n(sr),ir=__webpack_require__(357),ar=__webpack_require__.n(ir),cr=__webpack_require__(535),dr={attributes:{"data-cke":!0}};dr.setAttributes=or(),dr.insert=rr().bind(null,"head"),dr.domAPI=er(),dr.insertStyleElement=ar();$n()(cr.A,dr);cr.A&&cr.A.locals&&cr.A.locals;const ur=lr;function lr(t,e){const n=pr();return(lr=function(t,e){return n[t-=349]})(t,e)}function pr(){const t=["3159000LfisjA","getSelectionClass","user:position","getNearestSelectionRange","get","getStart","detach","editing","listenTo","update:user:range","enqueueChange","name","selection","10jIovcJ","markerNameToElements","start","split","user:range:","conversion","schema","getUserBySessionId","Escape","marker","59016yaVwsg","getPositions","createUIElement","document","$graveyard","init","userPositionMarker","markerToHighlight","keydown","getMarkerClass","$text","markerName","delete","view","span","isSimilar","newRange","markers","outerHTML","hasContent","size","tableCell","startsWith","getRange","createElement","add","remove","ck-user__selection","pluginName","editor","ck-user__marker-tooltip","isLimit","1146sckkPD","stopListening","ck-user__marker_hovered","parent","nodeAfter","toDomElement","130029ODxYVO","destroy","false","setCustomProperty","change","fromRange","removeClass","data-session-id","undo","mySessionId","oldRange","isDocumentOperation","isOfficialPlugin","setAttribute","isObject","813115KqsuqC","render","UserMarkers","isInline","getCustomProperty","plugins","user:range","_createdBatches","contenteditable","type","spellcheck","1659296uEwXsv","requires","addEventListener","highest","for","reconvertMarker","createUserMarkerOperations","commands","innerHTML","5733iaIFlF","user:position:","createRange","removeMarker","model","checkChild","afterInit","getFirstRange","1259564MtPtDY","getContainedElement","deletionPosition","editingDowncast","mouseenter","batch","rootName","updateMarker","mapper",'<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>',"ck-user__marker ","addMarker","color","root","user:","isCollapsed","orderNumber","end","_domEmitter","classList","textContent","markerToElement","change:range","hasDomSelection","clear","markerRange","toRange","mouseleave","applyOperation","set","isPremiumPlugin","has","getAttribute","element"];return(pr=function(){return t})()}!function(t){const e=lr,n=t();for(;;)try{if(171096===parseInt(e(445))/1+-parseInt(e(397))/2*(parseInt(e(407))/3)+parseInt(e(350))/4+-parseInt(e(460))/5+-parseInt(e(439))/6*(parseInt(e(480))/7)+-parseInt(e(471))/8+parseInt(e(384))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(pr);class hr extends e.Plugin{[ur(368)]=new((0,n.DomEmitterMixin)());static get[ur(472)](){return[Zn]}static get[ur(435)](){return ur(462)}static get[ur(457)](){return!0}static get[ur(380)](){return!0}[ur(412)](){const t=ur,e=this[t(436)],r=e[t(465)][t(388)](Zn);e[t(402)][t(475)](t(353))[t(371)]({model:t(386),view:(n,{writer:s})=>function(e,n,r,s){const o=t,i=e[o(418)][o(400)](":")[2],a=r[o(404)](i);if(!a||i===r[o(454)])return;if(!s[o(484)][o(403)][o(485)](e[o(375)][o(399)],o(417)))return;const c={class:o(360)+a[o(362)][o(416)](),"data-name":a[o(395)],"data-session-id":i},d=s[o(484)][o(424)][o(388)](e[o(418)])[o(389)](),u=d[o(443)],l=s[o(484)][o(403)];if(u&&l[o(459)](u)&&l[o(463)](u)&&!s[o(484)][o(424)][o(388)](o(401)+i)[o(430)]()[o(365)])return;const p=d[o(442)];return s[o(484)][o(403)][o(438)](p)&&!s[o(484)][o(426)](p)&&(c[o(468)]=!1),function(t,e,n){const r=o,s=t[r(409)](r(421),e);return t[r(448)](r(413),!0,s),s[r(461)]=function(t){const e=r,s=this[e(444)](t),o=document[e(431)](e(421));return o[e(369)][e(432)](e(437)),o[e(458)](e(468),e(447)),o[e(458)](e(470),e(447)),o[e(370)]=n[e(395)],s[e(479)]=e(359)+o[e(425)]+"",s[e(473)](e(354),()=>{const t=e;s[t(369)][t(432)](t(441))}),s[e(473)](e(377),()=>{const t=e;s[t(369)][t(433)](t(441))}),s},s[r(422)]=function(t){const e=r;return!(!this[e(464)](e(413))||!t[e(464)](e(413))||this[e(382)](e(452))!=t[e(382)](e(452)))},s}(n,c,a)}(n,s,r,e)}),e[t(402)][t(475)](t(353))[t(414)]({model:t(466),view:e=>function(e,n){const r=t,s=e[r(418)][r(400)](":")[2];if(s===n[r(454)])return null;const o=n[r(404)](s);return o?{id:s,classes:[r(434),o[r(362)][r(385)]()],attributes:{"data-session-id":s},priority:2e3+o[r(366)]}:{id:s,classes:[]}}(e,r)}),function(e){const n=t,r=e[n(484)],o=new Map,i=e[n(465)][n(388)](Zn);r[n(424)].on(n(393),(t,a,c,d)=>{const u=n;if(!d&&o[u(388)](a[u(395)]))return o[u(388)](a[u(395)])[u(390)](),void o[u(419)](a[u(395)]);const l=a[u(395)][u(400)](":")[2];if(l===i[u(454)])return;const p=u(481)+l;r[u(424)][u(381)](p)&&e[u(391)][u(476)](p),a.on(u(372),(t,e,n)=>{const i=u;if(i(411)!=e[i(363)][i(356)]&&i(411)==a[i(430)]()[i(363)][i(356)]&&!o[i(381)](a[i(395)])){const t=r[i(403)][i(387)](n[i(352)]);if(t){const e=s.ModelLiveRange[i(450)](t);o[i(379)](a[i(395)],e),e.on(i(372),(t,n,s)=>{const c=i;if(c(411)==e[c(363)][c(356)]){const t=r[c(403)][c(387)](s[c(352)]);t?(e[c(399)]=t[c(399)],e[c(367)]=t[c(367)]):(o[c(419)](a[c(395)]),e[c(390)]())}})}}})}),r[n(410)].on(n(449),()=>{const t=n;o[t(427)]>0&&r[t(394)]({isUndoable:!1},e=>{const n=t;for(const[t,s]of o)n(411)==r[n(424)][n(388)](t)[n(430)]()[n(363)][n(356)]&&(fr(t[n(400)](":")[2],s[n(376)](),r,e),s[n(390)]());o[n(374)]()})})}(e),this[t(368)][t(392)](n.global[t(410)],t(415),(n,{key:r})=>{const s=t;s(405)===r&&function(t){const e=s;t[e(391)][e(420)][e(449)](n=>{const r=e;for(const e of t[r(484)][r(424)]){if(!e[r(395)][r(429)](r(386)))continue;const s=t[r(391)][r(358)][r(398)](e[r(395)]);if(s)for(const t of s)n[r(451)](r(441),t)}})}(e)},{useCapture:!0})}[ur(486)](){const t=ur,e=this[t(436)],n=e[t(478)][t(388)](t(453));n&&e[t(484)].on(t(378),(r,s)=>{const o=t,i=s[0];if(!i[o(456)])return;if(o(406)!=i[o(469)]||!i[o(395)][o(429)](o(364)))return;const a=i[o(355)];n[o(467)][o(381)](a)&&(i[o(423)]=i[o(455)]?e[o(484)][o(482)](i[o(455)][o(399)],i[o(455)][o(367)]):null)},{priority:t(474)})}[ur(446)](){const t=ur;return this[t(368)][t(440)](),super[t(446)]()}[ur(477)](){const t=ur,e=this[t(436)],n=e[t(484)][t(410)],r=e[t(465)][t(388)](Zn);e[t(484)][t(394)]({isUndoable:!1},s=>{const o=t,i=o(401)+r[o(454)],a=o(481)+r[o(454)],c=e[o(484)][o(424)][o(381)](i);e[o(391)][o(420)][o(373)]?fr(r[o(454)],n[o(396)][o(349)](),e[o(484)],s):c&&(s[o(483)](i),s[o(483)](a))})}}function fr(t,e,n,r){const s=ur,o=s(401)+t,i=s(481)+t,a=e[s(351)]();let c=e[s(399)];if(a&&a.is(s(383),s(428))){const t=function(t,e){const n=s;for(const r of t[n(408)]())if(e[n(403)][n(485)](r,n(417)))return r}(e,n);t&&(c=t,e=r[s(482)](c))}const d=r[s(482)](c);n[s(424)][s(381)](o)?(r[s(357)](o,{range:e}),r[s(357)](i,{range:d})):(r[s(361)](o,{range:e,usingOperation:!0}),r[s(361)](i,{range:d,usingOperation:!0}))}function mr(t,e,n){const r=t.t,s=t.t;switch(e){case"PENDING_ACTION_SENDING_DATA":return s({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 s("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 s("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 s("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 s("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 s("Synchronization issue");case"Connected users list dropdown menu":return s("Connected users list dropdown menu");case"Collapsed connected users list (press ENTER to open it)":return s("Collapsed connected users list (press ENTER to open it)");case"Connected users list":return s("Connected users list");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return s({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}const yr=(()=>{var t=d.Reader,e=d.Writer,n=d.util,r=d.roots.default||(d.roots.default={});return r.AttributeOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.range=null,s.prototype.key="",s.prototype.oldValueBoolean=!1,s.prototype.oldValueJson="",s.prototype.newValueBoolean=!1,s.prototype.newValueJson="",s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.range&&Object.hasOwnProperty.call(t,"range")&&r.Range.encode(t.range,n.uint32(10).fork()).ldelim(),null!=t.key&&Object.hasOwnProperty.call(t,"key")&&n.uint32(18).string(t.key),null!=t.oldValueBoolean&&Object.hasOwnProperty.call(t,"oldValueBoolean")&&n.uint32(24).bool(t.oldValueBoolean),null!=t.oldValueJson&&Object.hasOwnProperty.call(t,"oldValueJson")&&n.uint32(34).string(t.oldValueJson),null!=t.newValueBoolean&&Object.hasOwnProperty.call(t,"newValueBoolean")&&n.uint32(40).bool(t.newValueBoolean),null!=t.newValueJson&&Object.hasOwnProperty.call(t,"newValueJson")&&n.uint32(50).string(t.newValueJson),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(56).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.AttributeOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.range=r.Range.decode(e,e.uint32());break;case 2:o.key=e.string();break;case 3:o.oldValueBoolean=e.bool();break;case 4:o.oldValueJson=e.string();break;case 5:o.newValueBoolean=e.bool();break;case 6:o.newValueJson=e.string();break;case 7:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.range&&t.hasOwnProperty("range")){var e=r.Range.verify(t.range);if(e)return"range."+e}return null!=t.key&&t.hasOwnProperty("key")&&!n.isString(t.key)?"key: string expected":null!=t.oldValueBoolean&&t.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof t.oldValueBoolean?"oldValueBoolean: boolean expected":null!=t.oldValueJson&&t.hasOwnProperty("oldValueJson")&&!n.isString(t.oldValueJson)?"oldValueJson: string expected":null!=t.newValueBoolean&&t.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof t.newValueBoolean?"newValueBoolean: boolean expected":null!=t.newValueJson&&t.hasOwnProperty("newValueJson")&&!n.isString(t.newValueJson)?"newValueJson: string expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.AttributeOperation)return t;var e=new r.AttributeOperation;if(null!=t.range){if("object"!=typeof t.range)throw TypeError(".AttributeOperation.range: object expected");e.range=r.Range.fromObject(t.range)}return null!=t.key&&(e.key=String(t.key)),null!=t.oldValueBoolean&&(e.oldValueBoolean=Boolean(t.oldValueBoolean)),null!=t.oldValueJson&&(e.oldValueJson=String(t.oldValueJson)),null!=t.newValueBoolean&&(e.newValueBoolean=Boolean(t.newValueBoolean)),null!=t.newValueJson&&(e.newValueJson=String(t.newValueJson)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.range=null,n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=t.range&&t.hasOwnProperty("range")&&(n.range=r.Range.toObject(t.range,e)),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.oldValueBoolean&&t.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=t.oldValueBoolean),null!=t.oldValueJson&&t.hasOwnProperty("oldValueJson")&&(n.oldValueJson=t.oldValueJson),null!=t.newValueBoolean&&t.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=t.newValueBoolean),null!=t.newValueJson&&t.hasOwnProperty("newValueJson")&&(n.newValueJson=t.newValueJson),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/AttributeOperation"},s}(),r.InsertOperation=function(){function s(t){if(this.nodes=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.position=null,s.prototype.nodes=n.emptyArray,s.prototype.shouldReceiveAttributes=!1,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.position&&Object.hasOwnProperty.call(t,"position")&&r.Position.encode(t.position,n.uint32(10).fork()).ldelim(),null!=t.nodes&&t.nodes.length)for(var s=0;s<t.nodes.length;++s)r.Element.encode(t.nodes[s],n.uint32(18).fork()).ldelim();return null!=t.shouldReceiveAttributes&&Object.hasOwnProperty.call(t,"shouldReceiveAttributes")&&n.uint32(24).bool(t.shouldReceiveAttributes),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(32).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.InsertOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.position=r.Position.decode(e,e.uint32());break;case 2:o.nodes&&o.nodes.length||(o.nodes=[]),o.nodes.push(r.Element.decode(e,e.uint32()));break;case 3:o.shouldReceiveAttributes=e.bool();break;case 4:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.position&&t.hasOwnProperty("position")&&(n=r.Position.verify(t.position)))return"position."+n;if(null!=t.nodes&&t.hasOwnProperty("nodes")){if(!Array.isArray(t.nodes))return"nodes: array expected";for(var e=0;e<t.nodes.length;++e){var n;if(n=r.Element.verify(t.nodes[e]))return"nodes."+n}}return null!=t.shouldReceiveAttributes&&t.hasOwnProperty("shouldReceiveAttributes")&&"boolean"!=typeof t.shouldReceiveAttributes?"shouldReceiveAttributes: boolean expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.InsertOperation)return t;var e=new r.InsertOperation;if(null!=t.position){if("object"!=typeof t.position)throw TypeError(".InsertOperation.position: object expected");e.position=r.Position.fromObject(t.position)}if(t.nodes){if(!Array.isArray(t.nodes))throw TypeError(".InsertOperation.nodes: array expected");e.nodes=[];for(var n=0;n<t.nodes.length;++n){if("object"!=typeof t.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");e.nodes[n]=r.Element.fromObject(t.nodes[n])}}return null!=t.shouldReceiveAttributes&&(e.shouldReceiveAttributes=Boolean(t.shouldReceiveAttributes)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.nodes=[]),e.defaults&&(n.position=null,n.shouldReceiveAttributes=!1,n.wasUndone=!1),null!=t.position&&t.hasOwnProperty("position")&&(n.position=r.Position.toObject(t.position,e)),t.nodes&&t.nodes.length){n.nodes=[];for(var s=0;s<t.nodes.length;++s)n.nodes[s]=r.Element.toObject(t.nodes[s],e)}return null!=t.shouldReceiveAttributes&&t.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=t.shouldReceiveAttributes),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/InsertOperation"},s}(),r.MarkerOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.name="",s.prototype.oldRange=null,s.prototype.newRange=null,s.prototype.affectsData=!1,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.name&&Object.hasOwnProperty.call(t,"name")&&n.uint32(10).string(t.name),null!=t.oldRange&&Object.hasOwnProperty.call(t,"oldRange")&&r.Range.encode(t.oldRange,n.uint32(18).fork()).ldelim(),null!=t.newRange&&Object.hasOwnProperty.call(t,"newRange")&&r.Range.encode(t.newRange,n.uint32(26).fork()).ldelim(),null!=t.affectsData&&Object.hasOwnProperty.call(t,"affectsData")&&n.uint32(32).bool(t.affectsData),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(40).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.MarkerOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.name=e.string();break;case 2:o.oldRange=r.Range.decode(e,e.uint32());break;case 3:o.newRange=r.Range.decode(e,e.uint32());break;case 4:o.affectsData=e.bool();break;case 5:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.name&&t.hasOwnProperty("name")&&!n.isString(t.name))return"name: string expected";var e;if(null!=t.oldRange&&t.hasOwnProperty("oldRange")&&(e=r.Range.verify(t.oldRange)))return"oldRange."+e;if(null!=t.newRange&&t.hasOwnProperty("newRange")&&(e=r.Range.verify(t.newRange)))return"newRange."+e;return null!=t.affectsData&&t.hasOwnProperty("affectsData")&&"boolean"!=typeof t.affectsData?"affectsData: boolean expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.MarkerOperation)return t;var e=new r.MarkerOperation;if(null!=t.name&&(e.name=String(t.name)),null!=t.oldRange){if("object"!=typeof t.oldRange)throw TypeError(".MarkerOperation.oldRange: object expected");e.oldRange=r.Range.fromObject(t.oldRange)}if(null!=t.newRange){if("object"!=typeof t.newRange)throw TypeError(".MarkerOperation.newRange: object expected");e.newRange=r.Range.fromObject(t.newRange)}return null!=t.affectsData&&(e.affectsData=Boolean(t.affectsData)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.name="",n.oldRange=null,n.newRange=null,n.affectsData=!1,n.wasUndone=!1),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.oldRange&&t.hasOwnProperty("oldRange")&&(n.oldRange=r.Range.toObject(t.oldRange,e)),null!=t.newRange&&t.hasOwnProperty("newRange")&&(n.newRange=r.Range.toObject(t.newRange,e)),null!=t.affectsData&&t.hasOwnProperty("affectsData")&&(n.affectsData=t.affectsData),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/MarkerOperation"},s}(),r.MergeOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.sourcePosition=null,s.prototype.targetPosition=null,s.prototype.graveyardPosition=null,s.prototype.howMany=0,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.sourcePosition&&Object.hasOwnProperty.call(t,"sourcePosition")&&r.Position.encode(t.sourcePosition,n.uint32(10).fork()).ldelim(),null!=t.targetPosition&&Object.hasOwnProperty.call(t,"targetPosition")&&r.Position.encode(t.targetPosition,n.uint32(18).fork()).ldelim(),null!=t.graveyardPosition&&Object.hasOwnProperty.call(t,"graveyardPosition")&&r.Position.encode(t.graveyardPosition,n.uint32(26).fork()).ldelim(),null!=t.howMany&&Object.hasOwnProperty.call(t,"howMany")&&n.uint32(32).uint32(t.howMany),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(40).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.MergeOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.sourcePosition=r.Position.decode(e,e.uint32());break;case 2:o.targetPosition=r.Position.decode(e,e.uint32());break;case 3:o.graveyardPosition=r.Position.decode(e,e.uint32());break;case 4:o.howMany=e.uint32();break;case 5:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e;if(null!=t.sourcePosition&&t.hasOwnProperty("sourcePosition")&&(e=r.Position.verify(t.sourcePosition)))return"sourcePosition."+e;if(null!=t.targetPosition&&t.hasOwnProperty("targetPosition")&&(e=r.Position.verify(t.targetPosition)))return"targetPosition."+e;if(null!=t.graveyardPosition&&t.hasOwnProperty("graveyardPosition")&&(e=r.Position.verify(t.graveyardPosition)))return"graveyardPosition."+e;return null!=t.howMany&&t.hasOwnProperty("howMany")&&!n.isInteger(t.howMany)?"howMany: integer expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.MergeOperation)return t;var e=new r.MergeOperation;if(null!=t.sourcePosition){if("object"!=typeof t.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");e.sourcePosition=r.Position.fromObject(t.sourcePosition)}if(null!=t.targetPosition){if("object"!=typeof t.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");e.targetPosition=r.Position.fromObject(t.targetPosition)}if(null!=t.graveyardPosition){if("object"!=typeof t.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");e.graveyardPosition=r.Position.fromObject(t.graveyardPosition)}return null!=t.howMany&&(e.howMany=t.howMany>>>0),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.sourcePosition=null,n.targetPosition=null,n.graveyardPosition=null,n.howMany=0,n.wasUndone=!1),null!=t.sourcePosition&&t.hasOwnProperty("sourcePosition")&&(n.sourcePosition=r.Position.toObject(t.sourcePosition,e)),null!=t.targetPosition&&t.hasOwnProperty("targetPosition")&&(n.targetPosition=r.Position.toObject(t.targetPosition,e)),null!=t.graveyardPosition&&t.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=r.Position.toObject(t.graveyardPosition,e)),null!=t.howMany&&t.hasOwnProperty("howMany")&&(n.howMany=t.howMany),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/MergeOperation"},s}(),r.MoveOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.sourcePosition=null,s.prototype.howMany=0,s.prototype.targetPosition=null,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.sourcePosition&&Object.hasOwnProperty.call(t,"sourcePosition")&&r.Position.encode(t.sourcePosition,n.uint32(10).fork()).ldelim(),null!=t.howMany&&Object.hasOwnProperty.call(t,"howMany")&&n.uint32(16).uint32(t.howMany),null!=t.targetPosition&&Object.hasOwnProperty.call(t,"targetPosition")&&r.Position.encode(t.targetPosition,n.uint32(26).fork()).ldelim(),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(32).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.MoveOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.sourcePosition=r.Position.decode(e,e.uint32());break;case 2:o.howMany=e.uint32();break;case 3:o.targetPosition=r.Position.decode(e,e.uint32());break;case 4:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e;if(null!=t.sourcePosition&&t.hasOwnProperty("sourcePosition")&&(e=r.Position.verify(t.sourcePosition)))return"sourcePosition."+e;if(null!=t.howMany&&t.hasOwnProperty("howMany")&&!n.isInteger(t.howMany))return"howMany: integer expected";if(null!=t.targetPosition&&t.hasOwnProperty("targetPosition")&&(e=r.Position.verify(t.targetPosition)))return"targetPosition."+e;return null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.MoveOperation)return t;var e=new r.MoveOperation;if(null!=t.sourcePosition){if("object"!=typeof t.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");e.sourcePosition=r.Position.fromObject(t.sourcePosition)}if(null!=t.howMany&&(e.howMany=t.howMany>>>0),null!=t.targetPosition){if("object"!=typeof t.targetPosition)throw TypeError(".MoveOperation.targetPosition: object expected");e.targetPosition=r.Position.fromObject(t.targetPosition)}return null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=t.sourcePosition&&t.hasOwnProperty("sourcePosition")&&(n.sourcePosition=r.Position.toObject(t.sourcePosition,e)),null!=t.howMany&&t.hasOwnProperty("howMany")&&(n.howMany=t.howMany),null!=t.targetPosition&&t.hasOwnProperty("targetPosition")&&(n.targetPosition=r.Position.toObject(t.targetPosition,e)),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/MoveOperation"},s}(),r.RenameOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.position=null,s.prototype.oldName="",s.prototype.newName="",s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.position&&Object.hasOwnProperty.call(t,"position")&&r.Position.encode(t.position,n.uint32(10).fork()).ldelim(),null!=t.oldName&&Object.hasOwnProperty.call(t,"oldName")&&n.uint32(18).string(t.oldName),null!=t.newName&&Object.hasOwnProperty.call(t,"newName")&&n.uint32(26).string(t.newName),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(32).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RenameOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.position=r.Position.decode(e,e.uint32());break;case 2:o.oldName=e.string();break;case 3:o.newName=e.string();break;case 4:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.position&&t.hasOwnProperty("position")){var e=r.Position.verify(t.position);if(e)return"position."+e}return null!=t.oldName&&t.hasOwnProperty("oldName")&&!n.isString(t.oldName)?"oldName: string expected":null!=t.newName&&t.hasOwnProperty("newName")&&!n.isString(t.newName)?"newName: string expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RenameOperation)return t;var e=new r.RenameOperation;if(null!=t.position){if("object"!=typeof t.position)throw TypeError(".RenameOperation.position: object expected");e.position=r.Position.fromObject(t.position)}return null!=t.oldName&&(e.oldName=String(t.oldName)),null!=t.newName&&(e.newName=String(t.newName)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=t.position&&t.hasOwnProperty("position")&&(n.position=r.Position.toObject(t.position,e)),null!=t.oldName&&t.hasOwnProperty("oldName")&&(n.oldName=t.oldName),null!=t.newName&&t.hasOwnProperty("newName")&&(n.newName=t.newName),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RenameOperation"},s}(),r.RootAttributeOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.root="",s.prototype.key="",s.prototype.oldValueBoolean=!1,s.prototype.oldValueJson="",s.prototype.newValueBoolean=!1,s.prototype.newValueJson="",s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.root&&Object.hasOwnProperty.call(t,"root")&&n.uint32(10).string(t.root),null!=t.key&&Object.hasOwnProperty.call(t,"key")&&n.uint32(18).string(t.key),null!=t.oldValueBoolean&&Object.hasOwnProperty.call(t,"oldValueBoolean")&&n.uint32(24).bool(t.oldValueBoolean),null!=t.oldValueJson&&Object.hasOwnProperty.call(t,"oldValueJson")&&n.uint32(34).string(t.oldValueJson),null!=t.newValueBoolean&&Object.hasOwnProperty.call(t,"newValueBoolean")&&n.uint32(40).bool(t.newValueBoolean),null!=t.newValueJson&&Object.hasOwnProperty.call(t,"newValueJson")&&n.uint32(50).string(t.newValueJson),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(56).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RootAttributeOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.root=e.string();break;case 2:o.key=e.string();break;case 3:o.oldValueBoolean=e.bool();break;case 4:o.oldValueJson=e.string();break;case 5:o.newValueBoolean=e.bool();break;case 6:o.newValueJson=e.string();break;case 7:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.root&&t.hasOwnProperty("root")&&!n.isString(t.root)?"root: string expected":null!=t.key&&t.hasOwnProperty("key")&&!n.isString(t.key)?"key: string expected":null!=t.oldValueBoolean&&t.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof t.oldValueBoolean?"oldValueBoolean: boolean expected":null!=t.oldValueJson&&t.hasOwnProperty("oldValueJson")&&!n.isString(t.oldValueJson)?"oldValueJson: string expected":null!=t.newValueBoolean&&t.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof t.newValueBoolean?"newValueBoolean: boolean expected":null!=t.newValueJson&&t.hasOwnProperty("newValueJson")&&!n.isString(t.newValueJson)?"newValueJson: string expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RootAttributeOperation)return t;var e=new r.RootAttributeOperation;return null!=t.root&&(e.root=String(t.root)),null!=t.key&&(e.key=String(t.key)),null!=t.oldValueBoolean&&(e.oldValueBoolean=Boolean(t.oldValueBoolean)),null!=t.oldValueJson&&(e.oldValueJson=String(t.oldValueJson)),null!=t.newValueBoolean&&(e.newValueBoolean=Boolean(t.newValueBoolean)),null!=t.newValueJson&&(e.newValueJson=String(t.newValueJson)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.root="",n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=t.root&&t.hasOwnProperty("root")&&(n.root=t.root),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.oldValueBoolean&&t.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=t.oldValueBoolean),null!=t.oldValueJson&&t.hasOwnProperty("oldValueJson")&&(n.oldValueJson=t.oldValueJson),null!=t.newValueBoolean&&t.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=t.newValueBoolean),null!=t.newValueJson&&t.hasOwnProperty("newValueJson")&&(n.newValueJson=t.newValueJson),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RootAttributeOperation"},s}(),r.RootOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.rootName="",s.prototype.elementName="",s.prototype.isAdd=!1,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.rootName&&Object.hasOwnProperty.call(t,"rootName")&&n.uint32(10).string(t.rootName),null!=t.elementName&&Object.hasOwnProperty.call(t,"elementName")&&n.uint32(18).string(t.elementName),null!=t.isAdd&&Object.hasOwnProperty.call(t,"isAdd")&&n.uint32(24).bool(t.isAdd),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(32).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RootOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.rootName=e.string();break;case 2:o.elementName=e.string();break;case 3:o.isAdd=e.bool();break;case 4:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.rootName&&t.hasOwnProperty("rootName")&&!n.isString(t.rootName)?"rootName: string expected":null!=t.elementName&&t.hasOwnProperty("elementName")&&!n.isString(t.elementName)?"elementName: string expected":null!=t.isAdd&&t.hasOwnProperty("isAdd")&&"boolean"!=typeof t.isAdd?"isAdd: boolean expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RootOperation)return t;var e=new r.RootOperation;return null!=t.rootName&&(e.rootName=String(t.rootName)),null!=t.elementName&&(e.elementName=String(t.elementName)),null!=t.isAdd&&(e.isAdd=Boolean(t.isAdd)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.rootName="",n.elementName="",n.isAdd=!1,n.wasUndone=!1),null!=t.rootName&&t.hasOwnProperty("rootName")&&(n.rootName=t.rootName),null!=t.elementName&&t.hasOwnProperty("elementName")&&(n.elementName=t.elementName),null!=t.isAdd&&t.hasOwnProperty("isAdd")&&(n.isAdd=t.isAdd),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RootOperation"},s}(),r.SplitOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.splitPosition=null,s.prototype.graveyardPosition=null,s.prototype.howMany=0,s.prototype.insertionPosition=null,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.splitPosition&&Object.hasOwnProperty.call(t,"splitPosition")&&r.Position.encode(t.splitPosition,n.uint32(10).fork()).ldelim(),null!=t.graveyardPosition&&Object.hasOwnProperty.call(t,"graveyardPosition")&&r.Position.encode(t.graveyardPosition,n.uint32(18).fork()).ldelim(),null!=t.howMany&&Object.hasOwnProperty.call(t,"howMany")&&n.uint32(24).uint32(t.howMany),null!=t.insertionPosition&&Object.hasOwnProperty.call(t,"insertionPosition")&&r.Position.encode(t.insertionPosition,n.uint32(34).fork()).ldelim(),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(40).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SplitOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.splitPosition=r.Position.decode(e,e.uint32());break;case 2:o.graveyardPosition=r.Position.decode(e,e.uint32());break;case 3:o.howMany=e.uint32();break;case 4:o.insertionPosition=r.Position.decode(e,e.uint32());break;case 5:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e;if(null!=t.splitPosition&&t.hasOwnProperty("splitPosition")&&(e=r.Position.verify(t.splitPosition)))return"splitPosition."+e;if(null!=t.graveyardPosition&&t.hasOwnProperty("graveyardPosition")&&(e=r.Position.verify(t.graveyardPosition)))return"graveyardPosition."+e;if(null!=t.howMany&&t.hasOwnProperty("howMany")&&!n.isInteger(t.howMany))return"howMany: integer expected";if(null!=t.insertionPosition&&t.hasOwnProperty("insertionPosition")&&(e=r.Position.verify(t.insertionPosition)))return"insertionPosition."+e;return null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.SplitOperation)return t;var e=new r.SplitOperation;if(null!=t.splitPosition){if("object"!=typeof t.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");e.splitPosition=r.Position.fromObject(t.splitPosition)}if(null!=t.graveyardPosition){if("object"!=typeof t.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");e.graveyardPosition=r.Position.fromObject(t.graveyardPosition)}if(null!=t.howMany&&(e.howMany=t.howMany>>>0),null!=t.insertionPosition){if("object"!=typeof t.insertionPosition)throw TypeError(".SplitOperation.insertionPosition: object expected");e.insertionPosition=r.Position.fromObject(t.insertionPosition)}return null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.splitPosition=null,n.graveyardPosition=null,n.howMany=0,n.insertionPosition=null,n.wasUndone=!1),null!=t.splitPosition&&t.hasOwnProperty("splitPosition")&&(n.splitPosition=r.Position.toObject(t.splitPosition,e)),null!=t.graveyardPosition&&t.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=r.Position.toObject(t.graveyardPosition,e)),null!=t.howMany&&t.hasOwnProperty("howMany")&&(n.howMany=t.howMany),null!=t.insertionPosition&&t.hasOwnProperty("insertionPosition")&&(n.insertionPosition=r.Position.toObject(t.insertionPosition,e)),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SplitOperation"},s}(),r.Position=function(){function s(t){if(this.path=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.root="",s.prototype.rootMain=!1,s.prototype.rootGraveyard=!1,s.prototype.path=n.emptyArray,s.prototype.stickiness="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.root&&Object.hasOwnProperty.call(t,"root")&&n.uint32(10).string(t.root),null!=t.rootMain&&Object.hasOwnProperty.call(t,"rootMain")&&n.uint32(16).bool(t.rootMain),null!=t.rootGraveyard&&Object.hasOwnProperty.call(t,"rootGraveyard")&&n.uint32(24).bool(t.rootGraveyard),null!=t.path&&t.path.length){n.uint32(34).fork();for(var r=0;r<t.path.length;++r)n.uint32(t.path[r]);n.ldelim()}return null!=t.stickiness&&Object.hasOwnProperty.call(t,"stickiness")&&n.uint32(42).string(t.stickiness),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.Position;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.root=e.string();break;case 2:o.rootMain=e.bool();break;case 3:o.rootGraveyard=e.bool();break;case 4:if(o.path&&o.path.length||(o.path=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.path.push(e.uint32());else o.path.push(e.uint32());break;case 5:o.stickiness=e.string();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.root&&t.hasOwnProperty("root")&&!n.isString(t.root))return"root: string expected";if(null!=t.rootMain&&t.hasOwnProperty("rootMain")&&"boolean"!=typeof t.rootMain)return"rootMain: boolean expected";if(null!=t.rootGraveyard&&t.hasOwnProperty("rootGraveyard")&&"boolean"!=typeof t.rootGraveyard)return"rootGraveyard: boolean expected";if(null!=t.path&&t.hasOwnProperty("path")){if(!Array.isArray(t.path))return"path: array expected";for(var e=0;e<t.path.length;++e)if(!n.isInteger(t.path[e]))return"path: integer[] expected"}return null!=t.stickiness&&t.hasOwnProperty("stickiness")&&!n.isString(t.stickiness)?"stickiness: string expected":null},s.fromObject=function(t){if(t instanceof r.Position)return t;var e=new r.Position;if(null!=t.root&&(e.root=String(t.root)),null!=t.rootMain&&(e.rootMain=Boolean(t.rootMain)),null!=t.rootGraveyard&&(e.rootGraveyard=Boolean(t.rootGraveyard)),t.path){if(!Array.isArray(t.path))throw TypeError(".Position.path: array expected");e.path=[];for(var n=0;n<t.path.length;++n)e.path[n]=t.path[n]>>>0}return null!=t.stickiness&&(e.stickiness=String(t.stickiness)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.path=[]),e.defaults&&(n.root="",n.rootMain=!1,n.rootGraveyard=!1,n.stickiness=""),null!=t.root&&t.hasOwnProperty("root")&&(n.root=t.root),null!=t.rootMain&&t.hasOwnProperty("rootMain")&&(n.rootMain=t.rootMain),null!=t.rootGraveyard&&t.hasOwnProperty("rootGraveyard")&&(n.rootGraveyard=t.rootGraveyard),t.path&&t.path.length){n.path=[];for(var r=0;r<t.path.length;++r)n.path[r]=t.path[r]}return null!=t.stickiness&&t.hasOwnProperty("stickiness")&&(n.stickiness=t.stickiness),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/Position"},s}(),r.Range=function(){function n(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return n.prototype.start=null,n.prototype.end=null,n.create=function(t){return new n(t)},n.encode=function(t,n){return n||(n=e.create()),null!=t.start&&Object.hasOwnProperty.call(t,"start")&&r.Position.encode(t.start,n.uint32(10).fork()).ldelim(),null!=t.end&&Object.hasOwnProperty.call(t,"end")&&r.Position.encode(t.end,n.uint32(18).fork()).ldelim(),n},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.Range;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.start=r.Position.decode(e,e.uint32());break;case 2:o.end=r.Position.decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},n.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},n.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e;if(null!=t.start&&t.hasOwnProperty("start")&&(e=r.Position.verify(t.start)))return"start."+e;if(null!=t.end&&t.hasOwnProperty("end")&&(e=r.Position.verify(t.end)))return"end."+e;return null},n.fromObject=function(t){if(t instanceof r.Range)return t;var e=new r.Range;if(null!=t.start){if("object"!=typeof t.start)throw TypeError(".Range.start: object expected");e.start=r.Position.fromObject(t.start)}if(null!=t.end){if("object"!=typeof t.end)throw TypeError(".Range.end: object expected");e.end=r.Position.fromObject(t.end)}return e},n.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.start=null,n.end=null),null!=t.start&&t.hasOwnProperty("start")&&(n.start=r.Position.toObject(t.start,e)),null!=t.end&&t.hasOwnProperty("end")&&(n.end=r.Position.toObject(t.end,e)),n},n.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},n.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/Range"},n}(),r.Element=function(){function s(t){if(this.children=[],this.attributesBoolean={},t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.name="",s.prototype.children=n.emptyArray,s.prototype.data="",s.prototype.attributesBoolean=n.emptyObject,s.prototype.attributesJson="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.name&&Object.hasOwnProperty.call(t,"name")&&n.uint32(10).string(t.name),null!=t.children&&t.children.length)for(var s=0;s<t.children.length;++s)r.Element.encode(t.children[s],n.uint32(18).fork()).ldelim();if(null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(26).string(t.data),null!=t.attributesBoolean&&Object.hasOwnProperty.call(t,"attributesBoolean")){var o=Object.keys(t.attributesBoolean);for(s=0;s<o.length;++s)n.uint32(34).fork().uint32(10).string(o[s]).uint32(16).bool(t.attributesBoolean[o[s]]).ldelim()}return null!=t.attributesJson&&Object.hasOwnProperty.call(t,"attributesJson")&&n.uint32(42).string(t.attributesJson),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,s){e instanceof t||(e=t.create(e));for(var o,i,a=void 0===s?e.len:e.pos+s,c=new r.Element;e.pos<a;){var d=e.uint32();switch(d>>>3){case 1:c.name=e.string();break;case 2:c.children&&c.children.length||(c.children=[]),c.children.push(r.Element.decode(e,e.uint32()));break;case 3:c.data=e.string();break;case 4:c.attributesBoolean===n.emptyObject&&(c.attributesBoolean={});var u=e.uint32()+e.pos;for(o="",i=!1;e.pos<u;){var l=e.uint32();switch(l>>>3){case 1:o=e.string();break;case 2:i=e.bool();break;default:e.skipType(7&l)}}c.attributesBoolean[o]=i;break;case 5:c.attributesJson=e.string();break;default:e.skipType(7&d)}}return c},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.name&&t.hasOwnProperty("name")&&!n.isString(t.name))return"name: string expected";if(null!=t.children&&t.hasOwnProperty("children")){if(!Array.isArray(t.children))return"children: array expected";for(var e=0;e<t.children.length;++e){var s=r.Element.verify(t.children[e]);if(s)return"children."+s}}if(null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data))return"data: string expected";if(null!=t.attributesBoolean&&t.hasOwnProperty("attributesBoolean")){if(!n.isObject(t.attributesBoolean))return"attributesBoolean: object expected";var o=Object.keys(t.attributesBoolean);for(e=0;e<o.length;++e)if("boolean"!=typeof t.attributesBoolean[o[e]])return"attributesBoolean: boolean{k:string} expected"}return null!=t.attributesJson&&t.hasOwnProperty("attributesJson")&&!n.isString(t.attributesJson)?"attributesJson: string expected":null},s.fromObject=function(t){if(t instanceof r.Element)return t;var e=new r.Element;if(null!=t.name&&(e.name=String(t.name)),t.children){if(!Array.isArray(t.children))throw TypeError(".Element.children: array expected");e.children=[];for(var n=0;n<t.children.length;++n){if("object"!=typeof t.children[n])throw TypeError(".Element.children: object expected");e.children[n]=r.Element.fromObject(t.children[n])}}if(null!=t.data&&(e.data=String(t.data)),t.attributesBoolean){if("object"!=typeof t.attributesBoolean)throw TypeError(".Element.attributesBoolean: object expected");e.attributesBoolean={};var s=Object.keys(t.attributesBoolean);for(n=0;n<s.length;++n)e.attributesBoolean[s[n]]=Boolean(t.attributesBoolean[s[n]])}return null!=t.attributesJson&&(e.attributesJson=String(t.attributesJson)),e},s.toObject=function(t,e){e||(e={});var n,s={};if((e.arrays||e.defaults)&&(s.children=[]),(e.objects||e.defaults)&&(s.attributesBoolean={}),e.defaults&&(s.name="",s.data="",s.attributesJson=""),null!=t.name&&t.hasOwnProperty("name")&&(s.name=t.name),t.children&&t.children.length){s.children=[];for(var o=0;o<t.children.length;++o)s.children[o]=r.Element.toObject(t.children[o],e)}if(null!=t.data&&t.hasOwnProperty("data")&&(s.data=t.data),t.attributesBoolean&&(n=Object.keys(t.attributesBoolean)).length){s.attributesBoolean={};for(o=0;o<n.length;++o)s.attributesBoolean[n[o]]=t.attributesBoolean[n[o]]}return null!=t.attributesJson&&t.hasOwnProperty("attributesJson")&&(s.attributesJson=t.attributesJson),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/Element"},s}(),r})();class gr{_protobufRoot;constructor(){this._protobufRoot=yr}getDescriptor(t){return new br(this._protobufRoot[t])}}class br{_protobuf;constructor(t){this._protobuf=t}compress(t){const e=this._protobuf.verify(t);if(e)throw Error(e);return this._protobuf.encode(this._protobuf.create(t)).finish()}decompress(t){return this._protobuf.toObject(this._protobuf.decode(t),{oneofs:!0})}}function Or(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function wr(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const vr="[object RegExp]",Ir="[object String]",Sr="[object Number]",kr="[object Boolean]",Pr="[object Arguments]",Ar="[object Symbol]",Tr="[object Date]",_r="[object Map]",Cr="[object Set]",jr="[object Array]",Er="[object ArrayBuffer]",Dr="[object Object]",Rr="[object DataView]",xr="[object Uint8Array]",Nr="[object Uint8ClampedArray]",Vr="[object Uint16Array]",Mr="[object Uint32Array]",Br="[object Int8Array]",Ur="[object Int16Array]",Jr="[object Int32Array]",qr="[object Float32Array]",Gr="[object Float64Array]";function Lr(t,e,n,r=new Map,s=void 0){const o=s?.(t,e,n,r);if(null!=o)return o;if(function(t){return null==t||"object"!=typeof t&&"function"!=typeof t}(t))return t;if(r.has(t))return r.get(t);if(Array.isArray(t)){const e=new Array(t.length);r.set(t,e);for(let o=0;o<t.length;o++)e[o]=Lr(t[o],o,n,r,s);return Object.hasOwn(t,"index")&&(e.index=t.index),Object.hasOwn(t,"input")&&(e.input=t.input),e}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,e}if(t instanceof Map){const e=new Map;r.set(t,e);for(const[o,i]of t)e.set(o,Lr(i,o,n,r,s));return e}if(t instanceof Set){const e=new Set;r.set(t,e);for(const o of t)e.add(Lr(o,void 0,n,r,s));return e}if("undefined"!=typeof Buffer&&Buffer.isBuffer(t))return t.subarray();if(function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(t)){const e=new(Object.getPrototypeOf(t).constructor)(t.length);r.set(t,e);for(let o=0;o<t.length;o++)e[o]=Lr(t[o],o,n,r,s);return e}if(t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const e=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return r.set(t,e),Yr(e,t,n,r,s),e}if("undefined"!=typeof File&&t instanceof File){const e=new File([t],t.name,{type:t.type});return r.set(t,e),Yr(e,t,n,r,s),e}if(t instanceof Blob){const e=new Blob([t],{type:t.type});return r.set(t,e),Yr(e,t,n,r,s),e}if(t instanceof Error){const e=new t.constructor;return r.set(t,e),e.message=t.message,e.name=t.name,e.stack=t.stack,e.cause=t.cause,Yr(e,t,n,r,s),e}if("object"==typeof t&&function(t){switch(wr(t)){case Pr:case jr:case Er:case Rr:case kr:case Tr:case qr:case Gr:case Br:case Ur:case Jr:case _r:case Sr:case Dr:case vr:case Cr:case Ir:case Ar:case xr:case Nr:case Vr:case Mr:return!0;default:return!1}}(t)){const e=Object.create(Object.getPrototypeOf(t));return r.set(t,e),Yr(e,t,n,r,s),e}return t}function Yr(t,e,n=t,r,s){const o=[...Object.keys(e),...Or(e)];for(let i=0;i<o.length;i++){const a=o[i],c=Object.getOwnPropertyDescriptor(t,a);(null==c||c.writable)&&(t[a]=Lr(e[a],a,n,r,s))}}function Hr(t,e){return function(t,e){return Lr(t,void 0,t,new Map,e)}(t,(n,r,s,o)=>{const i=e?.(n,r,s,o);if(null!=i)return i;if("object"==typeof t)switch(Object.prototype.toString.call(t)){case Sr:case Ir:case kr:{const e=new t.constructor(t?.valueOf());return Yr(e,t),e}case Pr:{const e={};return Yr(e,t),e.length=t.length,e[Symbol.iterator]=t[Symbol.iterator],e}default:return}})}function zr(t){return Hr(t)}function Fr(t){if(!t||"object"!=typeof t)return!1;const e=Object.getPrototypeOf(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e))&&"[object Object]"===Object.prototype.toString.call(t)}function Kr(t,e,n,r,s,o,i){const a=i(t,e,n,r,s,o);if(void 0!==a)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return t===e;case"number":return t===e||Object.is(t,e);case"object":return Wr(t,e,o,i)}return Wr(t,e,o,i)}function Wr(t,e,n,r){if(Object.is(t,e))return!0;let s=wr(t),o=wr(e);if(s===Pr&&(s=Dr),o===Pr&&(o=Dr),s!==o)return!1;switch(s){case Ir:return t.toString()===e.toString();case Sr:return function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t.valueOf(),e.valueOf());case kr:case Tr:case Ar:return Object.is(t.valueOf(),e.valueOf());case vr:return t.source===e.source&&t.flags===e.flags;case"[object Function]":return t===e}const i=(n=n??new Map).get(t),a=n.get(e);if(null!=i&&null!=a)return i===e;n.set(t,e),n.set(e,t);try{switch(s){case _r:if(t.size!==e.size)return!1;for(const[s,o]of t.entries())if(!e.has(s)||!Kr(o,e.get(s),s,t,e,n,r))return!1;return!0;case Cr:{if(t.size!==e.size)return!1;const s=Array.from(t.values()),o=Array.from(e.values());for(let i=0;i<s.length;i++){const a=s[i],c=o.findIndex(s=>Kr(a,s,void 0,t,e,n,r));if(-1===c)return!1;o.splice(c,1)}return!0}case jr:case xr:case Nr:case Vr:case Mr:case"[object BigUint64Array]":case Br:case Ur:case Jr:case"[object BigInt64Array]":case qr:case Gr:if("undefined"!=typeof Buffer&&Buffer.isBuffer(t)!==Buffer.isBuffer(e))return!1;if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(!Kr(t[s],e[s],s,t,e,n,r))return!1;return!0;case Er:return t.byteLength===e.byteLength&&Wr(new Uint8Array(t),new Uint8Array(e),n,r);case Rr:return t.byteLength===e.byteLength&&t.byteOffset===e.byteOffset&&Wr(new Uint8Array(t),new Uint8Array(e),n,r);case"[object Error]":return t.name===e.name&&t.message===e.message;case Dr:{if(!(Wr(t.constructor,e.constructor,n,r)||Fr(t)&&Fr(e)))return!1;const s=[...Object.keys(t),...Or(t)],o=[...Object.keys(e),...Or(e)];if(s.length!==o.length)return!1;for(let o=0;o<s.length;o++){const i=s[o],a=t[i];if(!Object.hasOwn(e,i))return!1;if(!Kr(a,e[i],i,t,e,n,r))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Qr(){}function Zr(t,e){return function(t,e,n){return Kr(t,e,void 0,void 0,void 0,void 0,n)}(t,e,Qr)}function Xr(t){return null!==t&&("object"==typeof t||"function"==typeof t)}function $r(t,e){const n=zr(t);return n.path[n.path.length-1]+=e,n}function ts(t,e){return t.root===e.root&&Zr(t.path,e.path)}function es(t){rs(t,t=>("main"==t.root?(t.rootMain=!0,delete t.root):"$graveyard"==t.root&&(t.rootGraveyard=!0,delete t.root),t))}function ns(t){rs(t,t=>(t.rootMain?(t.root="main",delete t.rootMain):t.rootGraveyard&&(t.root="$graveyard",delete t.rootGraveyard),t))}function rs(t,e){for(const n in t){const r=t[n];"nodes"!==n&&Xr(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?t[n]=e(r):rs(r,e))}return t}class ss{_id;_operationName;_protobufDescriptor;constructor(t,e,n){this._id=t,this._operationName=e,this._protobufDescriptor=n}compress(t,e){const n=e.shift();return es(n),t.buffers.push(this._protobufDescriptor.compress(n)),t.types.push(this._id),!0}decompress(t,e){e.types.shift();const n=this._protobufDescriptor.decompress(e.buffers.shift());ns(n),n.__className=this._operationName,t.push(n)}}class os extends ss{compress(t,e){const n=e.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),es(n),t.buffers.push(this._protobufDescriptor.compress(n)),t.types.push(this._id),!0}decompress(t,e){const{types:n,buffers:r}=e,s=this._protobufDescriptor.decompress(r.shift());n.shift(),this._deserializeOneOf("oldValue",s),this._deserializeOneOf("newValue",s),ns(s),s.__className=this._operationName,t.push(s)}_serializeOneOf(t,e){const n=e[t];"boolean"==typeof n?e[`${t}Boolean`]=n:e[`${t}Json`]=JSON.stringify(n)}_deserializeOneOf(t,e){const n=`${t}Json`;e[n]?(e[t]=JSON.parse(e[n]),delete e[n]):(e[t]=e[`${t}Boolean`],delete e[`${t}Boolean`])}}class is extends ss{compress(t,e){const n=e.shift();return this._serializeNodesAttributes(n.nodes),es(n),t.buffers.push(this._protobufDescriptor.compress(n)),t.types.push(this._id),!0}decompress(t,e){const{types:n,buffers:r}=e,s=this._protobufDescriptor.decompress(r.shift());n.shift(),s.nodes||(s.nodes=[]),this._deserializeNodesAttributes(s.nodes),ns(s),s.__className=this._operationName,t.push(s)}_serializeNodesAttributes(t){for(const e of t){if(e.attributes){const t=e.attributes;this._areValuesBoolean(t)?e.attributesBoolean=t:e.attributesJson=JSON.stringify(t)}e.children&&this._serializeNodesAttributes(e.children)}}_deserializeNodesAttributes(t){for(const e of t)(e.attributesBoolean||e.attributesJson)&&(e.attributesBoolean?(e.attributes=e.attributesBoolean,delete e.attributesBoolean):(e.attributes=JSON.parse(e.attributesJson),delete e.attributesJson)),e.children&&this._deserializeNodesAttributes(e.children)}_areValuesBoolean(t){return Object.keys(t).every(e=>"boolean"==typeof t[e])}}class as extends ss{decompress(t,e){super.decompress(t,e);const n=t[t.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class cs extends ss{compress(t,e){return e.shift(),t.types.push(this._id),!0}decompress(t,e){e.types.shift(),t.push({__className:this._operationName})}}class ds extends as{_omittedNamespace;constructor(t,e,n,r){super(t,e,n),this._omittedNamespace=r+":"}compress(t,e){return!("MarkerOperation"!=e[0].__className||!e[0].name.startsWith(this._omittedNamespace))&&(e[0].name=e[0].name.replace(new RegExp("^"+this._omittedNamespace),""),super.compress(t,e),!0)}decompress(t,e){super.decompress(t,e);const n=t[t.length-1];n.name=this._omittedNamespace+n.name}}class us{_id;_context;constructor(t,e){this._id=t,this._context=e}compress(t,e){let n;for(;e.length>1&&this._compareOperations(e[0],e[1]);)n?(n=this._combineNext(e.shift(),n),t.types.push(0)):(n=zr(e.shift()),t.types.push(this._id));return!!n&&(n=this._combineNext(e.shift(),n),t.types.push(0),t.buffers.push(this._compressSingleOperation(n)),!0)}decompress(t,e){const n=this._decompressSingleOperation(e);for(;0==e.types[0];)e.types.shift(),t.push(this._splitCurrent(n));t.push(n)}}class ls extends us{_combineNext(t,e){return e.nodes[0].data+=t.nodes[0].data,e}_splitCurrent(t){const e=zr(t),n=e.nodes[0],r=t.nodes[0],s=r.data[Symbol.iterator]().next().value,o=s.length;return n.data=s,r.data=r.data.substr(o),t.position=$r(t.position,o),e}_compareOperations(t,e){if(this._checkOperation(t)&&this._checkOperation(e)){const n=t.nodes[0].data.length,r=ts($r(t.position,n),e.position),s=t.nodes[0],o=e.nodes[0];return r&&this._compareAttributes(s,o)}return!1}_compressSingleOperation(t){const e={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("InsertOperation").compress(e,[t]),e.buffers[0]}_decompressSingleOperation(t){const e=[];return this._context._getCompressorByName("InsertOperation").decompress(e,t),e[0]}_checkOperation(t){return"InsertOperation"==t.__className&&1==t.nodes.length&&t.nodes[0].data&&!t.wasUndone&&1==Array.from(t.nodes[0].data).length}_compareAttributes(t,e){const n=Object.keys(t.attributes||{}),r=Object.keys(e.attributes||{});return n.length===r.length&&n.every(n=>e.attributes[n]&&e.attributes[n]===t.attributes[n])}}class ps extends us{_combineNext(t,e){return e.howMany++,e.sourcePosition=zr(t.sourcePosition),e}_splitCurrent(t){const e=zr(t);return t.howMany--,e.howMany=1,e.sourcePosition=$r(e.sourcePosition,t.howMany),e}_compareOperations(t,e){return!(!this._checkOperation(t)||!this._checkOperation(e))&&(ts($r(t.sourcePosition,-1),e.sourcePosition)&&ts(t.targetPosition,e.targetPosition))}_compressSingleOperation(t){const e={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(e,[t]),e.buffers[0]}_decompressSingleOperation(t){const e=[];return this._context._getCompressorByName("MoveOperation").decompress(e,t),e[0]}_checkOperation(t){return"MoveOperation"==t.__className&&"$graveyard"==t.targetPosition.root&&1==t.howMany&&!t.wasUndone}}class hs extends us{_combineNext(t,e){return e.howMany++,e}_splitCurrent(t){const e=zr(t);return e.howMany=1,t.howMany--,e}_compareOperations(t,e){return!(!this._checkOperation(t)||!this._checkOperation(e))&&(ts(t.sourcePosition,e.sourcePosition)&&ts(t.targetPosition,e.targetPosition))}_compressSingleOperation(t){const e={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(e,[t]),e.buffers[0]}_decompressSingleOperation(t){const e=[];return this._context._getCompressorByName("MoveOperation").decompress(e,t),e[0]}_checkOperation(t){return"MoveOperation"==t.__className&&"$graveyard"==t.targetPosition.root&&1==t.howMany&&!t.wasUndone}}class fs extends us{compress(t,e){if(!this._compareOperations(e[0],e[1]))return!1;const n=e.shift();return n.oldRange=null,n.newRange&&ts(n.newRange.start,n.newRange.end)&&(n.newRange.end=null),e.shift(),t.types.push(this._id),t.types.push(0),t.buffers.push(this._compressSingleOperation(n)),!0}decompress(t,e){const n=this._decompressSingleOperation(e);n.newRange&&!n.newRange.end&&(n.newRange.end=zr(n.newRange.start));const r=zr(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=zr(r.newRange.start)),r.name="user:position:"+r.name.split(":")[2],e.types.shift(),t.push(n),t.push(r)}_compressSingleOperation(t){const e={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MarkerOperation").compress(e,[t]),e.buffers[0]}_decompressSingleOperation(t){const e=[];return this._context._getCompressorByName("MarkerOperation").decompress(e,t),e[0]}_compareOperations(t,e){return!(!t||!e)&&("MarkerOperation"==t.__className&&"MarkerOperation"==e.__className&&!(!t.name.startsWith("user:")||!e.name.startsWith("user:")||t.name==e.name))}}class ms{_compressorById;_compressorByName;_protobufFactory;constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new gr;const t=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new cs(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",os),this._registerOperationCompressor(11,"InsertOperation",is),this._registerOperationCompressor(12,"MarkerOperation",as),this._registerOperationCompressor(13,"MergeOperation",ss),this._registerOperationCompressor(14,"MoveOperation",ss),this._registerOperationCompressor(15,"RenameOperation",ss),this._registerOperationCompressor(16,"RootAttributeOperation",os),this._registerOperationCompressor(17,"SplitOperation",ss),this._registerCompressor(18,"CommentMarkerOperation",new ds(18,"MarkerOperation",t,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new ds(19,"MarkerOperation",t,"suggestion")),this._registerOperationCompressor(20,"RootOperation",ss),this._registerActionCompressor(100,"TypingAction",ls),this._registerActionCompressor(101,"DeletingAction",ps),this._registerActionCompressor(102,"ForwardDeletingAction",hs),this._registerActionCompressor(103,"UserSelectionAction",fs)}compress(t){if(!t||!t[0])throw new n.CKEditorError("no-operations-provided",this);const e={types:[],buffers:[],baseVersion:t[0].baseVersion};for(;t.length;)this._getCompressorByName("UserSelectionAction").compress(e,t)||this._getCompressorByName("TypingAction").compress(e,t)||this._getCompressorByName("DeletingAction").compress(e,t)||this._getCompressorByName("ForwardDeletingAction").compress(e,t)||this._getCompressorByName("CommentMarkerOperation").compress(e,t)||this._getCompressorByName("SuggestionMarkerOperation").compress(e,t)||this._getCompressorByName(t[0].__className).compress(e,t);return e}decompress(t){const e=[];for(;t.types.length;){const r=this._compressorById.get(t.types[0]);if(!r)throw new n.CKEditorError("decompress-compressor-not-found",this,{type:t.types[0]});r.decompress(e,t)}return e.forEach((e,n)=>e.baseVersion=t.baseVersion+n),e}_getCompressorByName(t){return this._compressorByName.get(t)}_registerOperationCompressor(t,e,n){const r=new n(t,e,this._protobufFactory.getDescriptor(e));this._registerCompressor(t,e,r)}_registerActionCompressor(t,e,n){const r=new n(t,this);this._registerCompressor(t,e,r)}_registerCompressor(t,e,n){this._compressorById.set(t,n),this._compressorByName.set(e,n)}}const ys=gs;function gs(t,e){const n=Os();return(gs=function(t,e){return n[t-=443]})(t,e)}!function(t){const e=gs,n=t();for(;;)try{if(485627===-parseInt(e(538))/1+-parseInt(e(638))/2+parseInt(e(613))/3+-parseInt(e(696))/4+parseInt(e(514))/5+parseInt(e(560))/6*(-parseInt(e(467))/7)+parseInt(e(508))/8*(parseInt(e(698))/9))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Os);let bs=1;function Os(){const t=["CommentsOnly","enableReadOnlyMode","rootsAttributes","affectsData","lastSyncVersion","_lastSyncedOperationId","getIdOfTheLastOperation","18BfgVXi","push","offset","lastOperationId","reconnect","_pendingAction","cloudDocumentVersion","newRange","size","Synchronization issue","end","_saveOperationInBuffer","_connectService","decompress","createRoot","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","isReadOnly","change:_isPendingUpdate","_handleInitialConnectionData","_isPendingUpdate","sendOperations","_setUpDataInit","directChange","pluginName","_sendBufferedOperationsDelayed","_service","_disconnectionOperations","error","_hasSelectionChanged","Permissions","_knownRootNames","_baseBufferDelay","_knownOperations","showWarning","_loadRoot","_disconnectService","_authorId","editor","createRange","collaboration.channelId","state","disableReadOnlyMode","metadata","roots","404","_operationIdentifier","_handleServerResponse","selection","isEnabled","slice","realtimecollaborationclient-init-session-connection-error","isUndoneOperation","CollaborativeEditingService","1853448irydWb","change:range","move","_isInit","_compressOperations","_isConnected","addRootAttribute","position","reconnection: flushed session","editing","rootName","_refreshUserSelectionMarkers","setIdForTheLastOperation","multi-root-editor-root-attributes-no-root","_bufferRootLoad","cloudServices.bundleVersion","_bufferedOperations","_addKnownRoot","_handleExternalOperations","sessionAdd:","addToReconnectionStack","_waitUntilSynced","_applyOperationsSet","createUserMarkerOperations","connection","711302DwArxa","_offset","_getAffectedRoot","realtimecollaborationclient-error","affectedSelectable","finally","lastOperationAcceptedAt","_decompressOperations","data","startsWith","define","serverHistory","stop","getUser","_shouldSendSelectionUpdate","from","type","catch","path","_ignoredOperations","createPositionAt","_lastServerVersion","sessionCreatedAt","root","currentDocumentSession","_setPendingAction","applyOperation","message","_isDisconnection","parse","RealTimeCollaborationClient","_updateServerHistory","_fetchMissingUsers","_shouldSendUpdate","_channelId","getConnectedSessions","bind","realtimecollaborationclient-init-non-existent-root","_isEditingAllowed","__className","Notification","ready","version","$root","lastDocumentSession","baseVersion","InsertOperation","wereChangesApplied","fromJSON","model","getOperationAuthor","apply","change:hasDomSelection","mySessionId","has","_connectAfterSessionHasBeenFlushed","change:_isEditingAllowed","view","2022132DlxLtk","cs:removeUser","110367pwtZEx","realtimecollaborationclient-init-connection-failed","addUser","channelSessions","requires","stopListening","init","code","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.","realtimecollaborationclient-init-service-incorrect-server-operation","realtimecollaborationclient-init-service-internal-error","_document","attributes","isPremiumPlugin","suppressErrorInCollaboration","entries","return","isOfficialPlugin","realtimecollaborationclient-handleserverresponse","sessionId","keys","_initThrowingOnDataSet","_handleReconnectionResponse","length","collaboration-missing-channelid","initData","getOperations","toJSON","map","addOperation","242487FtVOaW","_handleReconnectionError","PENDING_ACTION_SENDING_DATA","_handleSendingSelectionMarkers","_getOperationsFromInitData","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","real-time-collaboration","_isLoaded","realtimecollaborationclient-sendbufferedoperations","rtc-offline","batch","_sendBufferedOperations","destroy","register","createPositionFromPath","history","_hasSynchronizationProblem","forEach","start","targetPosition","_currentBufferDelay","reset","insert","409","marker","locale","getRoot","realtimecollaborationclient","clone","permissions","unregister","connect","cloud-services-internal-error: Request timeout.","removeFromReconnectionStack","_sendBufferedOperationsDelayId","differ","_clearPendingAction","disconnected","markers","set","getMany","280eNWDIC","setPermissions","document:write","_isAttached","off","_compressor","2370280BWBHCT","get","connected","remove","createdAt","operationsReceived","_initSessionsHandling","loadRoot","listenTo","cloud-services-internal-error: Not connected.","userId","realtimecollaborationclient-init-document-already-initialized","_crash","_operationToId","includes","round","rtc-destroyed","_handleReceivedOperations","enqueueChange","add","disconnect","string","compress","document","70343jZEipd","collaboration","addRoot","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.","high","filter","isDocumentOperation","then","fire","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","wasUndone","getDocumentDetails","config","plugins","cloud-services-internal-error: Collaborative Editing Service is not connected."];return(Os=function(){return t})()}class ws extends e.Plugin{static[ys(612)]=(()=>wn)();[ys(639)];[ys(456)];[ys(649)];[ys(672)];[ys(585)];[ys(448)];[ys(513)];[ys(629)];[ys(592)];[ys(590)];[ys(565)];[ys(588)];[ys(501)];[ys(591)];[ys(487)];[ys(558)];[ys(586)];[ys(605)];static get[ys(702)](){return[Hn,Zn,hr,e.PendingActions,Fn.Users,r.Notification]}static get[ys(583)](){return ys(668)}static get[ys(454)](){return!0}static get[ys(450)](){return!0}get[ys(566)](){const t=ys;return this[t(659)]+this[t(639)]}get[ys(659)](){const t=ys;return this[t(649)][t(680)]-this[t(639)]}get[ys(557)](){const t=ys,e=this[t(649)][t(463)]();for(let n=e[t(460)]-1;n>=0;n--){const r=e[n];if(!this[t(586)][t(692)](r))return r[t(683)]+1-this[t(639)]}return 0}constructor(t){const e=ys;if(super(t),this[e(639)]=0,this[e(456)]=null,this[e(649)]=new s.History,this[e(597)][e(550)][e(648)](e(539),{}),this[e(672)]=this[e(597)][e(550)][e(515)](e(599)),!this[e(672)])throw new n.CKEditorError(e(461),this);const r=t[e(550)][e(515)](e(628))||n.version;this[e(585)]=new(ws[e(612)])(r,this[e(672)]),this[e(448)]=this[e(597)][e(687)][e(537)],this[e(513)]=new ms,this[e(629)]=[],this[e(592)]=new WeakSet,this[e(590)]=new Set,this[e(506)](e(579),!1),this[e(506)](e(483),!1),this[e(565)]=null,this[e(588)]=!1,this[e(501)]=null,this[e(591)]=300,this[e(487)]=this[e(591)],this[e(558)]=null,this[e(586)]=new WeakSet,this[e(605)]=new Ss(this[e(586)])}[ys(443)](){const t=ys,e=this[t(597)],n=e[t(551)][t(515)](Fn.Users),r=e[t(551)][t(515)](Hn);this[t(522)](n,t(688),(e,r)=>{const s=t,o=r[0];o[s(596)]&&(e[s(453)]=n[s(651)](o[s(596)]),e[s(650)]()),null===o[s(596)]&&(e[s(453)]=null,e[s(650)]())},{priority:t(542)}),this[t(522)](e[t(687)][t(537)][t(607)],t(614),(e,n)=>{const r=t;n[r(582)]&&this[r(624)]()}),this[t(522)](e[t(622)][t(695)],t(690),()=>{this[t(624)]()}),this[t(458)](),e[t(687)].on(t(664),(e,n)=>{const r=t,s=n[0];s[r(544)]&&(this[r(571)](s),this[r(671)]()&&this[r(584)]())}),this[t(581)](),this[t(674)](t(676)).to(r,t(600),this,t(483),(e,n)=>t(516)===e&&!n),this.on(t(694),()=>{const n=t;this[n(676)]?e[n(601)](n(476)):e[n(554)](n(476))}),this[t(676)]?e[t(601)](t(476)):e[t(554)](t(476)),this[t(506)](t(618),!1)}async[ys(564)](){const t=ys,e=this[t(597)][t(551)][t(515)](Zn),n=this[t(597)][t(551)][t(515)](Hn);try{this[t(579)]=!0,e[t(497)](this[t(672)]);const r=await this[t(585)][t(564)](n[t(637)],this[t(557)]);await this[t(459)](r)&&(this[t(579)]=!1,this[t(503)]());const s=await this[t(585)][t(673)]();e[t(480)](this[t(672)],s),this[t(470)](),this[t(618)]=!0}catch(e){if(function(e){const n=t;return n(604)===e[n(444)]}(e)&&this[t(456)])await this[t(693)]();else if(function(e){const n=t;return n(490)===e[n(444)]}(e)){const e=mr(this[t(597)][t(492)],t(575));this[t(468)](e)}else{if(!(e instanceof vs))throw e;this[t(468)]()}}}[ys(479)](){const t=ys,e=this[t(597)][t(551)][t(515)](Hn),n=this[t(597)][t(551)][t(515)](Zn);this[t(597)][t(554)](t(530)),n[t(701)][t(692)](this[t(672)])&&n[t(497)](this[t(672)]),e[t(500)](this),this[t(595)](),super[t(479)]()}async[ys(459)](t){const e=ys;if(this[e(456)]!==t[e(456)]&&this[e(558)]!==t[e(563)])throw new vs;return this[e(456)]=t[e(456)],this[e(606)]([],{...t,wereChangesApplied:!1,data:t[e(646)]},e(564))}async[ys(572)](t,e=!1){const n=ys,{connection:r}=this[n(597)][n(551)][n(515)](Hn);ws[n(612)][n(673)](r,this[n(672)])[n(545)](t=>this[n(520)](t))[n(655)](t=>{const e=n;this[e(526)](e(610),t)}),this[n(522)](this[n(585)],n(519),this[n(531)][n(674)](this)),this[n(522)](this[n(585)],n(587),(t,e)=>{const r=n;this[r(526)](r(447),e)}),this[n(522)](this[n(585)],n(504),()=>{this[n(618)]=!1});const s=this[n(605)][n(559)](t);this[n(579)]=!0;const o=await this[n(585)][n(498)](r,this[n(617)](t),s);if(this[n(456)]=o[n(456)],e){if(!o[n(685)])return void this[n(468)]();this[n(579)]=!1,this[n(503)](),this[n(649)][n(488)](),this[n(639)]=o[n(562)],this[n(649)][n(680)]=this[n(639)],await this[n(606)](t,o,n(621))}else await this[n(578)](o,t);this[n(470)](),this[n(618)]=!0}[ys(470)](){const t=ys,e=this[t(597)][t(551)][t(515)](Zn),n=this[t(597)][t(551)][t(515)](hr),r=e[t(701)][t(515)](this[t(672)]);r&&r[t(460)]>1?n[t(636)]():this[t(522)](e,t(632)+this[t(672)],()=>{const r=t;2===e[r(701)][r(515)](this[r(672)])[r(460)]&&n[r(636)]()})}async[ys(531)](t,e,n,r){const s=ys;if(!this[s(579)]&&this[s(448)][s(680)]==e){const t=this[s(645)](n,r);await this[s(670)](t),this[s(631)](t,e,n[s(563)])||this[s(526)](s(446))}}async[ys(693)](){const t=ys;this[t(595)]();const{locale:e}=this[t(597)];let n;try{n=await this[t(585)][t(549)]()}catch{const n=mr(e,t(472));return void this[t(468)](n)}const r=n[t(662)]||n[t(682)];if(this[t(558)]!==r[t(563)]){const n=mr(e,t(541));return void this[t(468)](n)}await this[t(572)](this[t(597)][t(687)][t(537)][t(482)][t(463)](),!0)}[ys(595)](){const t=ys;this[t(585)][t(534)](),this[t(629)]=[],clearTimeout(this[t(501)]),this[t(703)](this[t(585)])}[ys(520)](t){const e=ys,n=this[e(597)][e(551)][e(515)](Zn);this[e(522)](n,e(632)+this[e(672)],(t,{session:r})=>{const s=e;if(r.id===n[s(691)]){t[s(512)]();const e=this[s(597)][s(551)][s(692)](s(553))&&this[s(597)][s(551)][s(515)](s(553));let n=r[s(496)];e&&e[s(608)]&&(n=n[s(543)](t=>s(510)!==t)),this[s(597)][s(551)][s(515)](s(589))[s(509)](n,this[s(672)])}}),n[e(480)](this[e(672)],t)}[ys(458)](){const t=ys,e=this[t(597)][t(646)][t(506)];this[t(597)][t(646)][t(506)]=(...r)=>{const s=t;if(!r[r[s(460)]-1][s(451)])throw new n.CKEditorError(s(547),this);e[s(689)](this[s(597)][s(646)],r)}}[ys(581)](){const t=ys;this[t(597)][t(646)].on(t(443),(e,[r])=>{const o=t;if(this[o(448)][o(680)])throw new n.CKEditorError(o(525),this);e[o(650)](),this[o(663)]();const i=this[o(597)][o(550)][o(515)](o(555)),a=this[o(471)](r,i);0==a[o(460)]&&a[o(561)](new s.NoOperation(0)),e[o(453)]=this[o(572)](a)[o(545)](()=>{const t=o;this[t(597)][t(551)][t(515)](Hn)[t(633)](this),this[t(597)][t(646)][t(546)](t(679))})[o(655)](t=>this[o(526)](o(699),t))[o(643)](()=>this[o(503)]())},{priority:t(542)}),this[t(597)].on(t(521),async(e,[n,r])=>{const s=t;e[s(650)]();const o=this[s(597)][s(687)][s(537)][s(493)](n);if(!this[s(590)][s(692)](n)){const t=r&&r[s(646)]?r[s(646)]:"",e=r&&r[s(449)]?r[s(449)]:{};await this[s(594)](n,t,e)}this[s(597)][s(687)][s(532)]({isUndoable:!1},()=>{const t=s;o[t(474)]=!0,this[t(597)][t(687)][t(537)][t(502)][t(627)](o)})},{priority:t(542)})}async[ys(670)](t){const e=ys,n=this[e(597)][e(551)][e(515)](Fn.Users),{connection:r}=this[e(597)][e(551)][e(515)](Hn),s=new Set;for(const r of t){const t=r[e(596)];t&&!n[e(651)](t)&&s[e(533)](t)}if(0===s[e(568)])return;const o=await b[e(507)](r,Array[e(653)](s));for(const t of o)n[e(651)](t.id)||n[e(700)](t)}[ys(471)](t,e={}){const r=ys,o=this[r(597)][r(687)],i=[];let a=0;const c=r(535)==typeof t?{main:t}:t;for(const t of Object[r(457)](c)){if(!this[r(448)][r(603)][r(692)](t))throw new n.CKEditorError(r(675),this);const e=this[r(597)][r(646)][r(667)](c[t]),d=this[r(448)][r(493)](t),u=new s.InsertOperation(o[r(658)](d,0),e,a++);i[r(561)](u);for(const[t,n]of e[r(505)]){const e=o[r(598)](o[r(481)](d,n[r(485)][r(656)][r(609)]()),o[r(481)](d,n[r(570)][r(656)][r(609)]())),c=new s.MarkerOperation(t,null,e,o[r(505)],!0,a++);i[r(561)](c)}}if(e)for(const[t,c]of Object[r(452)](e)){const e=o[r(537)][r(493)](t);if(!e)throw new n.CKEditorError(r(626),null);for(const[t,n]of Object[r(452)](c))if(null!==n){const o=new s.RootAttributeOperation(e,t,null,n,a++);i[r(561)](o)}}return i}async[ys(594)](t,e,n){const r=ys;this[r(471)]({[t]:e},{[t]:n})[r(484)]((t,e)=>{const n=r;t[n(683)]=this[n(448)][n(680)]+e,t[n(616)]=!0,this[n(571)](t)}),this[r(584)](),await this[r(634)]()}async[ys(578)](t,e){const n=ys;let r;this[n(639)]=t[n(562)];const s=t[n(685)]&&!t[n(462)],o=s?0:t[n(646)][n(683)];if(e[n(484)](e=>{const r=n;e[r(616)]=!0,e[r(518)]=t[r(660)],e[r(596)]=null}),s)r=e,this[n(635)](r,s);else{if(t[n(462)]){const e=this[n(471)](t[n(462)]);this[n(448)][n(482)][n(680)]=-e[n(460)],e[n(484)](r=>{const s=n;r[s(683)]-=e[s(460)],r[s(518)]=t[s(660)],r[s(616)]=!0,r[s(596)]=null}),this[n(635)](e,!0),this[n(649)][n(680)]=-e[n(460)]+this[n(639)],this[n(669)](e)}this[n(448)][n(482)][n(680)]=o,r=this[n(645)](t[n(646)],t[n(602)]),await this[n(670)](r),this[n(635)](r,s)}t[n(563)]&&(this[n(605)][n(625)](r,t[n(563)]),this[n(558)]=t[n(563)]),this[n(649)][n(680)]=o+this[n(639)],this[n(669)](r),e[n(543)](t=>{const e=n,r=this[e(640)](t);return r&&!this[e(590)][e(692)](r)})[n(484)]((t,e)=>{const r=n;t[r(683)]=this[r(448)][r(680)]+e,this[r(571)](t)}),this[n(671)]()?(this[n(487)]=0,this[n(584)](!0),await this[n(634)]()):(this[n(579)]=!1,this[n(503)]())}[ys(526)](t,e){const r=ys,s=e&&e[r(665)];if(s&&s[r(647)](r(494)))throw e;const o=this[r(597)][r(551)][r(515)](Hn);throw this[r(579)]=!0,o[r(534)](),this[r(597)][r(554)](r(641)),new n.CKEditorError(t,this[r(597)],s?{originalError:s}:void 0)}[ys(571)](t){const e=ys;this[e(592)][e(692)](t)||(this[e(592)][e(533)](t),this[e(629)][e(561)](t),this[e(565)]||e(491)==t[e(654)]&&!t[e(556)]||this[e(663)]())}[ys(584)](t=!1){const e=ys;!t&&this[e(579)]||(this[e(579)]=!0,clearTimeout(this[e(501)]),this[e(501)]=setTimeout(()=>{const t=e;this[t(478)]()[t(545)](e=>{const n=t;e&&(this[n(503)](),this[n(579)]=!1)})[t(655)](e=>{const n=t;this[n(503)](),this[n(579)]=!1,function(t){const e=n;return t[e(665)][e(647)](e(523))||t[e(665)][e(647)](e(552))||t[e(665)][e(647)](e(499))}(e)||this[n(526)](e[n(665)],e)})},this[e(487)]))}[ys(634)](){return new Promise(t=>{const e=gs;this.on(e(577),()=>{t()})})}async[ys(478)](){const t=ys,e=this[t(597)][t(551)][t(515)](hr);if(this[t(652)]()&&(e[t(636)](),this[t(588)]=!1),!this[t(671)]())return!0;const n=[...this[t(629)]];for(const e of n)e[t(548)]=this[t(448)][t(482)][t(611)](e);const r=this[t(605)][t(559)](n),s=bs++,o=this[t(617)](n),i=await this[t(585)][t(580)](o,o[t(683)],r);try{return await this[t(606)](n,i,s)}catch(e){return this[t(526)](t(475),e)}}async[ys(606)](t,e,n){const r=ys;if(r(587)in e)throw e[r(587)];let s=!1;if(e[r(685)]){e[r(563)]&&(this[r(558)]=e[r(563)]),this[r(629)]=this[r(629)][r(543)](e=>!t[r(528)](e));for(const n of t)n[r(518)]=r(644)in e&&e[r(644)]||void 0;Is(t,e[r(680)]-t[r(460)]),this[r(669)](t);const n=t[r(543)](t=>{const e=r;if(!t[e(616)])return!1;const n=this[e(640)](t);return n&&!this[e(590)][e(692)](n)});Is(n,this[r(448)][r(680)]),this[r(635)](n),s=!0,this[r(487)]=this[r(591)]}else{const t=this[r(645)](e[r(646)],e[r(602)])[r(543)](t=>t[r(683)]>=this[r(659)]);t[r(484)](t=>this[r(630)](t)),this[r(629)]=this[r(629)][r(543)](t=>!t[r(616)]||!this[r(590)][r(692)](this[r(640)](t))),this[r(629)][r(460)]&&Is(this[r(629)],this[r(629)][0][r(683)]),await this[r(670)](t),s=this[r(631)](t,e[r(680)],e[r(563)]),this[r(487)]=Math[r(529)](this[r(487)]/2)}return s?!this[r(671)]()||(this[r(584)](!0),!1):this[r(526)](r(455))}[ys(631)](t,e,n){const r=ys;try{const o={document:this[r(448)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,s.transformOperationSets)(t,this[r(629)],o);Is(i,this[r(448)][r(680)]),Is(a,e);for(const t of i){const e=c[r(515)](t);t[r(596)]=e?e[r(596)]:null}n&&(this[r(605)][r(625)](t,n),this[r(558)]=n),this[r(629)]=[...a],this[r(635)](i),this[r(669)](t)}catch(t){return console[r(587)](t),!1}return!0}[ys(635)](t,e=!1){const n=ys;this[n(597)][n(687)][n(532)]({isUndoable:!1,isLocal:!1},e=>{const r=n;for(const n of t)this[r(592)][r(533)](n),this[r(630)](n),e[r(477)][r(466)](n),this[r(597)][r(687)][r(664)](n)})}[ys(630)](t){const e=ys,n=this[e(640)](t);n&&this[e(590)][e(533)](n)}[ys(640)](t){const e=ys;let n,r;switch(t[e(654)]){case e(489):n=t[e(620)][e(661)];break;case e(491):if(r=t[e(567)],!r)return null;n=r[e(661)];break;case e(619):n=t[e(661)];break;case e(540):n=t[e(642)];break;case e(615):n=t[e(486)][e(661)];break;default:return null}return n[e(623)]}[ys(669)](t){const e=ys;t[e(484)](t=>{const n=e,r=t[n(495)]();r[n(596)]=t[n(596)],r[n(616)]=!!t[n(616)],r[n(518)]=t[n(518)],r[n(683)]+=this[n(639)],t[n(666)]&&this[n(586)][n(533)](r),this[n(649)][n(466)](r)})}[ys(468)](t){const e=ys,n=this[e(597)][e(551)][e(515)](e(678)),r=this[e(597)][e(492)];t||(t=mr(r,e(445))),n[e(593)](t,{title:mr(r,e(569)),namespace:e(473)}),this[e(483)]=!0,clearTimeout(this[e(501)]),this[e(629)]=[],this[e(597)][e(551)][e(515)](Hn)[e(534)]()}[ys(663)](){const t=ys;this[t(565)]||(this[t(565)]=this[t(597)][t(551)][t(515)](e.PendingActions)[t(533)](mr(this[t(597)][t(492)],t(469))))}[ys(503)](){const t=ys;this[t(565)]&&(this[t(597)][t(551)][t(515)](e.PendingActions)[t(517)](this[t(565)]),this[t(565)]=null)}[ys(617)](t){const e=ys,n=t[e(465)](t=>t[e(464)]());return this[e(513)][e(536)](n)}[ys(645)](t,e){const n=ys;return this[n(513)][n(573)](t)[n(465)]((t,r)=>{const o=n,i=o(443)==e[r][o(654)];if(o(684)==t[o(677)]){const e=t[o(620)][o(661)];!this[o(448)][o(493)](e)&&(this[o(448)][o(574)](o(681),e)[o(511)]=!1)}const a=s.OperationFactory[o(686)](t,this[o(448)]);return a[o(548)]=t[o(548)],a[o(616)]=i,a[o(596)]=i?null:e[r][o(524)],a[o(666)]=o(697)===e[r][o(654)],a[o(518)]=e[r][o(518)],a})}[ys(624)](){const t=ys;this[t(588)]=!0,this[t(652)]()?this[t(584)]():this[t(588)]=!1}[ys(652)](){const t=ys,e=this[t(597)][t(551)][t(515)](Zn)[t(701)][t(515)](this[t(672)]);return!this[t(597)][t(576)]&&!!e&&e[t(460)]>1&&this[t(588)]}[ys(671)](){const t=ys;return this[t(629)][t(460)]>0||this[t(652)]()}}class vs extends Error{}function Is(t,e){const n=ys;for(const r of t)r[n(683)]=e++}class Ss{[ys(657)];[ys(527)];constructor(t){const e=ys;this[e(657)]=t,this[e(527)]=new WeakMap}[ys(559)](t){const e=ys;let r=t[e(460)];for(;r--;){const s=t[r];if(!this[e(657)][e(692)](s)){if(!this[e(527)][e(692)](s)){const t=(0,n.uid)()[e(609)](1,18);this[e(527)][e(506)](s,t)}return this[e(527)][e(515)](s)}}}[ys(625)](t,e){const n=ys;if(!e)return;let r=t[n(460)];for(;r--;){const s=t[r];this[n(657)][n(692)](s)||this[n(527)][n(506)](s,e)}}}function ks(t,e){var n=As();return(ks=function(t,e){return n[t-=442]})(t,e)}var Ps=ks;function As(){var t=["11432MWuLQv","isOfficialPlugin","requires","120hlTbwS","RealTimeCollaborativeEditing","4863085VaFRhj","397179xyRDdv","2313412MdCoQs","43231203ZSumPC","8481696RrNAql","pluginName","966Zwyiag","isPremiumPlugin","85372QWzSTU"];return(As=function(){return t})()}!function(t){for(var e=ks,n=t();;)try{if(920371===parseInt(e(448))/1+-parseInt(e(449))/2+parseInt(e(453))/3*(-parseInt(e(442))/4)+-parseInt(e(447))/5+-parseInt(e(451))/6+-parseInt(e(455))/7*(-parseInt(e(445))/8)+parseInt(e(450))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(As);class Ts extends e.Plugin{static get[Ps(444)](){return[ws]}static get[Ps(452)](){return Ps(446)}static get[Ps(443)](){return!0}static get[Ps(454)](){return!0}}const _s=js;function Cs(){const t=["465474nOBOzt","code","commentRemoved","reconnect","get","commentThreadUpdated","5720otFEPW","resolve","CommentsRepository","setPermissions","disconnect","resolvedAt","404","init","message","resolveCommentThread","commentThreadResolved","8460810guldkz","remove","cloud-services-internal-error: Request timeout.","1309PVlVoJ","userId","context","resolvedBy","getCommentThread","commentThreadRemoved","getMany","listenTo","cloudservicescommentsadapter-connect-already-connected","_fetchMissingUsersForThreads","authorId","updateComment","map","createdAt","reopenCommentThread","reopen","Permissions","6glZlyk","off","commentThreadAdded","CloudServicesCommentsAdapter","3219235teYtDL","update","removeComment","2hmomjZ","getConnectedSessions","CommentsService","startsWith","commentAdded","keys","adapter","has","_getService","unregister","addToReconnectionStack","getUser","isPremiumPlugin","register","cloudservicescommentsadapter-service-not-exist","addUser","addCommentThread","size","plugins","deletedAt","addComment","1515754VPqdeA","connect","attributes","_services","commentUpdated","requires","getComment","comments","_terminateService","catch","content","cloud-services-internal-error: Not connected.","assign","set","permissions","pluginName","_setUpService","8638840LzXWkg","1178268rZQimF","removeCommentThread","_connectService","commentThreadReopened","collaboration.channelId","destroy","sessionAdd:","commentThreadId","add","cloudservicescommentsadapter-disconnect-not-exist","cloud-services-internal-error: Comments Service is not connected.","getCommentThreads","commentId","isOfficialPlugin","config","delete","from","updateCommentThread","mySessionId"];return(Cs=function(){return t})()}function js(t,e){const n=Cs();return(js=function(t,e){return n[t-=112]})(t,e)}!function(t){const e=js,n=t();for(;;)try{if(939057===parseInt(e(158))/1+-parseInt(e(137))/2*(-parseInt(e(195))/3)+parseInt(e(176))/4+-parseInt(e(134))/5*(-parseInt(e(130))/6)+-parseInt(e(113))/7*(-parseInt(e(201))/8)+-parseInt(e(212))/9+-parseInt(e(175))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Cs);class Es extends e.ContextPlugin{static[_s(139)]=(()=>Gn)();[_s(161)];static get[_s(163)](){return[Hn,_s(203),Zn,Fn.Users]}static get[_s(173)](){return _s(133)}static get[_s(189)](){return!0}static get[_s(149)](){return!0}constructor(t){const e=_s;super(t),this[e(161)]=new Map}async[_s(208)](){const t=_s,n=this[t(115)],r=n[t(155)][t(199)](t(203));if(n[t(155)][t(199)](Hn)[t(147)](this),r[t(143)]={addCommentThread:async({channelId:e,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=t,d=await this[c(145)](e)[c(153)]({commentThreadId:n,comments:r[c(125)](t=>function(t,e,n){const r=c;return{commentThreadId:n,commentId:t[r(188)],userId:t[r(123)],content:t[r(168)],documentId:e,createdAt:t[r(126)],attributes:t[r(160)]||{}}}(t,e,n)),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(167)](Rs);return{threadId:d[c(183)],comments:d[c(165)]}},getCommentThread:async({channelId:e,threadId:n})=>{const r=t,s=await this[r(145)](e)[r(117)](n)[r(167)](Rs);return s[r(156)]?null:(await this[r(122)]([s]),{threadId:s[r(183)],comments:s[r(165)][r(125)](xs),context:s[r(115)],resolvedAt:s[r(206)],resolvedBy:s[r(116)],attributes:s[r(160)]||{}})},updateCommentThread:async({channelId:e,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[t(145)](e)[t(193)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[t(167)](Ds)[t(167)](Rs),resolveCommentThread:async({channelId:e,threadId:n})=>{const r=t,s=await this[r(145)](e)[r(210)](n)[r(167)](Ds)[r(167)](Rs);return{threadId:s[r(183)],resolvedAt:s[r(206)],resolvedBy:s[r(116)]}},reopenCommentThread:async({channelId:e,threadId:n})=>this[t(145)](e)[t(127)](n)[t(167)](Ds)[t(167)](Rs),removeCommentThread:({channelId:e,threadId:n})=>this[t(145)](e)[t(177)](n)[t(167)](Ds)[t(167)](Rs),addComment:({channelId:e,threadId:n,commentId:r,content:s,attributes:o})=>this[t(145)](e)[t(157)](n,r,s,o)[t(167)](Rs),updateComment:({channelId:e,threadId:n,commentId:r,content:s,attributes:o})=>this[t(145)](e)[t(124)](n,r,s,o)[t(167)](Ds)[t(167)](Rs),removeComment:({channelId:e,threadId:n,commentId:r})=>this[t(145)](e)[t(136)](n,r)[t(167)](Ds)[t(167)](Rs)},n instanceof e.Context){const e=n[t(190)][t(199)](t(180)),r=n[t(155)][t(199)](Zn);await this[t(174)](e);const s=await this[t(161)][t(199)](e)[t(138)]();this[t(120)](r,t(182)+e,(n,{session:s})=>{const o=t;s.id===r[o(194)]&&(n[o(131)](),this[o(115)][o(155)][o(199)](o(129))[o(204)](s[o(172)],e))}),r[t(150)](e,s)}}async[_s(174)](t){const e=_s;if(this[e(161)][e(144)](t))throw new n.CKEditorError(e(121),null,{channelId:t});const r=this[e(115)][e(155)][e(199)](e(203)),s=new(Es[e(139)])(t);this[e(161)][e(171)](t,s),this[e(120)](s,e(132),(t,n)=>{const s=e,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=n;r[s(117)](o)||r[s(153)]({threadId:o,channelId:i,comments:l?l[s(125)](xs):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})}),this[e(120)](s,e(200),(t,{commentThreadId:n,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=e;r[c(117)](n)&&r[c(193)]({threadId:n,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})}),this[e(120)](s,e(211),(t,{commentThreadId:n,resolvedBy:s,resolvedAt:o})=>{const i=e,a=r[i(117)](n);a&&a[i(202)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})}),this[e(120)](s,e(179),(t,{commentThreadId:n})=>{const s=e,o=r[s(117)](n);o&&o[s(128)]({isFromAdapter:!0})}),this[e(120)](s,e(118),(t,{commentThreadId:n})=>{const s=e,o=r[s(117)](n);o&&o[s(213)]({isFromAdapter:!0})}),this[e(120)](s,e(141),(t,n)=>{const s=e,o=n[s(183)],i=r[s(117)](o);i&&i[s(157)]({...xs(n),isFromAdapter:!0})}),this[e(120)](s,e(162),(t,{commentThreadId:n,commentId:s,content:o,attributes:i})=>{const a=e,c=r[a(117)](n);if(c){const t=c[a(164)](s);t&&t[a(135)]({content:o,attributes:i,isFromAdapter:!0})}}),this[e(120)](s,e(197),(t,{commentThreadId:n,commentId:s})=>{const o=e,i=r[o(117)](n);if(i){const t=i[o(164)](s);t&&t[o(213)]({isFromAdapter:!0})}}),await this[e(178)](t)}[_s(181)](){const t=_s;if(this[t(115)]instanceof e.Context){const e=this[t(115)][t(190)][t(199)](t(180));this[t(166)](e)}}[_s(166)](t){const e=_s;if(!this[e(161)][e(144)](t))throw new n.CKEditorError(e(185),null,{channelId:t});this[e(145)](t)[e(205)](),this[e(161)][e(191)](t)}async[_s(198)](){const t=_s;for(const e of this[t(161)][t(142)]())await this[t(178)](e);if(this[t(115)]instanceof e.Context){const e=this[t(115)][t(190)][t(199)](t(180)),n=this[t(115)][t(155)][t(199)](Zn);n[t(146)](e);const r=await this[t(161)][t(199)](e)[t(138)]();n[t(150)](e,r)}}async[_s(178)](t){const e=_s,{connection:n}=this[e(115)][e(155)][e(199)](Hn),r=this[e(115)][e(155)][e(199)](e(203)),s=this[e(161)][e(199)](t),o=await s[e(159)](n);await this[e(122)](o);const i=new Set(Array[e(192)](r[e(187)]({channelId:t}),t=>t.id));for(const t of o)t[e(156)]||i[e(191)](t[e(183)]);for(const t of i)r[e(117)](t)[e(213)]({isFromAdapter:!0});for(const n of o){let s=r[e(117)](n[e(183)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[e(153)]({channelId:t,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[e(192)](s[e(165)],t=>t.id));for(const t of n[e(165)])p[e(191)](t[e(188)]);for(const t of p)s[e(164)](t)[e(213)]({isFromAdapter:!0});for(const t of n[e(165)]){const n=s[e(164)](t[e(188)]);n?n[e(168)]!==t[e(168)]&&n[e(135)]({content:t[e(168)],isFromAdapter:!0}):s[e(157)](Object[e(170)](xs(t),{isFromAdapter:!0}))}}}[_s(145)](t){const e=_s;if(!this[e(161)][e(144)](t))throw new n.CKEditorError(e(151),null,{channelId:t});return this[e(161)][e(199)](t)}async[_s(122)](t){const e=_s,n=this[e(115)][e(155)][e(199)](Fn.Users),{connection:r}=this[e(115)][e(155)][e(199)](Hn),s=new Set;for(const{resolvedBy:r,comments:o}of t){r&&!n[e(148)](r)&&s[e(184)](r);for(const{userId:t}of o)n[e(148)](t)||s[e(184)](t)}if(0===s[e(154)])return;const o=await b[e(119)](r,Array[e(192)](s));for(const t of o)n[e(148)](t.id)||n[e(152)](t)}}async function Ds(t){const e=_s;if(e(207)!==t[e(196)])throw t}function Rs(t){const e=_s;if((n=t)[e(209)][e(140)](e(186))||n[e(209)][e(140)](e(169))||n[e(209)][e(140)](e(112)))return new Promise(()=>{});var n;throw t}function xs(t){const e=_s;return{threadId:t[e(183)],commentId:t[e(188)],content:t[e(168)],createdAt:t[e(126)],authorId:t[e(114)],attributes:t[e(160)]||{}}}const Ns=Vs;function Vs(t,e){const n=Ms();return(Vs=function(t,e){return n[t-=375]})(t,e)}function Ms(){const t=["getSuggestion","99IQEClM","attributes","open","cloud-services-internal-error: Request timeout.","startsWith","originalSuggestionId","addSuggestionData","getMany","connect","CloudServicesTrackChangesAdapter","size","33BaEbTI","find","_waitForServiceReady","values","isOfficialPlugin","set","pluginName","getUser","TrackChangesEditing","editor","init","then","from","96436Upiuep","isPremiumPlugin","372846dTpNMU","202OnyTjV","update","_trackChangesService","199688NMspmU","message","type","hasSuggestion","cloud-services-internal-error: Not connected.","suggestionUpdated","isConnected","addUser","state","requires","_bufferedRequests","delete","142170SkzMLO","_saved","TrackChangesService","addToReconnectionStack","data","listenTo","plugins","config","collaboration.channelId","add","catch","off","_fetchMissingUsersForThreads","get","203mOrGdt","148870QGsYMr","connected","reconnect","connection","adapter","1178166WJLPoP","8351AHETBI"];return(Ms=function(){return t})()}!function(t){const e=Vs,n=t();for(;;)try{if(475139===parseInt(e(425))/1*(parseInt(e(389))/2)+parseInt(e(438))/3*(parseInt(e(386))/4)+-parseInt(e(404))/5+parseInt(e(388))/6+parseInt(e(418))/7*(-parseInt(e(392))/8)+-parseInt(e(427))/9*(-parseInt(e(419))/10)+-parseInt(e(424))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Ms);class Bs extends e.Plugin{static[Ns(406)]=(()=>Qe)();[Ns(402)];[Ns(391)];static get[Ns(401)](){return[Es,Ns(381),Hn]}static get[Ns(379)](){return Ns(436)}static get[Ns(377)](){return!0}static get[Ns(387)](){return!0}constructor(t){const e=Ns;super(t);const n=this[e(382)][e(411)][e(417)](e(412));this[e(402)]=new Map,this[e(391)]=new(Bs[e(406)])(n)}[Ns(383)](){const t=Ns,e=this[t(382)][t(410)][t(417)](Hn),n=this[t(382)][t(410)][t(417)](t(381));return n[t(423)]={getSuggestion:async e=>{const n=t;await this[n(375)]();const r=await this[n(391)][n(417)](e)[n(414)](Us);return await this[n(416)]([r]),r},addSuggestion:async({id:e,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=t;await this[i(375)]();const a={id:e,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(391)][i(413)](e,n,r,s,o)[i(414)](t=>{if(Js(t))return new Promise(t=>{const n=Vs;this[n(402)][n(378)](e,{resolve:t,suggestionData:a})});throw t});return this[i(402)][i(403)](e),c},updateSuggestion:async(e,n)=>{const r=t;if(await this[r(375)](),r(429)!==n[r(400)])return this[r(391)][r(390)](e,n)[r(414)](Us)}},this[t(409)](this[t(391)],t(397),(e,r)=>{const s=t;n[s(395)](r.id)&&(n[s(426)](r.id)[s(428)]=r[s(428)])}),this[t(391)][t(435)](e[t(422)])[t(384)](r=>(e[t(407)](this),this[t(416)](r)[t(384)](()=>{const e=t;for(const t of r)n[e(433)](t)[e(405)]=!0})))}async[Ns(421)](){const t=Ns,e=this[t(382)][t(410)][t(417)](t(381)),{connection:n}=this[t(382)][t(410)][t(417)](Hn),r=await this[t(391)][t(435)](n);await this[t(416)](r);for(const{suggestionData:e,resolve:n}of this[t(402)][t(376)]()){let s=r[t(439)](t=>t.id===e.id);s||(s=await this[t(391)][t(413)](e.id,e[t(394)],e[t(408)],e[t(432)])),n(s)}for(const n of r)e[t(395)](n.id)||e[t(433)](n)}async[Ns(375)](){const t=Ns;this[t(391)][t(398)]||await new Promise(e=>{const n=t;this[n(409)](this[n(391)],n(420),t=>{t[n(415)](),e()})})}async[Ns(416)](t){const e=Ns,n=this[e(382)][e(410)][e(417)](Fn.Users),{connection:r}=this[e(382)][e(410)][e(417)](Hn),s=new Set;for(const{authorId:r}of t)n[e(380)](r)||s[e(413)](r);if(0===s[e(437)])return;const o=await b[e(434)](r,Array[e(385)](s));for(const t of o)n[e(380)](t.id)||n[e(399)](t)}}function Us(t){if(Js(t))return new Promise(()=>{});throw t}function Js(t){const e=Ns;return t[e(393)][e(431)](e(396))||t[e(393)][e(431)](e(430))}const qs=Gs;function Gs(t,e){const n=Ys();return(Gs=function(t,e){return n[t-=426]})(t,e)}!function(t){const e=Gs,n=t();for(;;)try{if(385810===-parseInt(e(432))/1+-parseInt(e(443))/2+-parseInt(e(445))/3+-parseInt(e(442))/4*(-parseInt(e(428))/5)+parseInt(e(436))/6*(-parseInt(e(430))/7)+-parseInt(e(457))/8*(parseInt(e(456))/9)+parseInt(e(451))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Ys);class Ls extends e.Plugin{static get[qs(448)](){return[qs(426),Es,Ts,Hn]}static get[qs(435)](){return qs(452)}static get[qs(439)](){return!0}static get[qs(437)](){return!0}[qs(446)](){const t=qs,e=this[t(454)][t(438)][t(441)](Hn),n=this[t(454)][t(438)][t(441)](t(447)),r=this[t(454)][t(438)][t(441)](Es);return this[t(454)][t(455)][t(450)](t(459),()=>{const r=t;this[r(453)](e,r(431),(t,e,s)=>{const o=r;n[o(460)]=o(427)!==s})}),this[t(453)](e,t(431),(e,n,r)=>{const s=t;this[s(454)][s(438)][s(441)](s(444))[s(434)](s(427)!==r)}),r[t(429)](this[t(454)][t(449)][t(441)](t(433)))}[qs(458)](){const t=qs;this[t(454)][t(438)][t(441)](Es)[t(440)](this[t(454)][t(449)][t(441)](t(433))),super[t(458)]()}}function Ys(){const t=["get","256tGJCpD","589406KZeEGO","CommentsRepository","2052411iqcRpJ","init","CommentsEditing","requires","config","once","23760040QabAwV","RealTimeCollaborativeComments","listenTo","editor","data","9teBuxZ","5299384Vdxksl","destroy","ready","isThreadsLoadingPaused","Comments","connected","38345FXcyvV","_setUpService","2380xIqJpN","change:state","272967afxkYb","collaboration.channelId","switchReadOnly","pluginName","10002gzOgRl","isPremiumPlugin","plugins","isOfficialPlugin","_terminateService"];return(Ys=function(){return t})()}var Hs=Fs;function zs(){var t=["isPremiumPlugin","TrackChanges","3568086gjlsrI","4prWoBu","260pTRUGZ","333783lgOuCM","2929585wLizsM","RealTimeCollaborativeTrackChanges","3907855XrWGjj","isOfficialPlugin","251608pPNPvJ","6942AhsFfD","2709884uZcnZr","pluginName","requires","8TLUUES"];return(zs=function(){return t})()}function Fs(t,e){var n=zs();return(Fs=function(t,e){return n[t-=149]})(t,e)}!function(t){for(var e=Fs,n=t();;)try{if(353366===parseInt(e(152))/1+parseInt(e(161))/2*(parseInt(e(153))/3)+-parseInt(e(154))/4+parseInt(e(164))/5+parseInt(e(160))/6+-parseInt(e(150))/7*(-parseInt(e(157))/8)+parseInt(e(163))/9*(-parseInt(e(162))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(zs);class Ks extends e.Plugin{static get[Hs(156)](){return[Ls,Bs,Hs(159)]}static get[Hs(155)](){return Hs(149)}static get[Hs(151)](){return!0}static get[Hs(158)](){return!0}}const Ws=Zs;function Qs(){const t=["_isConnected","reverse","connection","3753129BuVniu","469687QeYHWh","_revisionDataBuilder","get","editor","_bufferedUpdates","collaboration.channelId","4162110kTBwuM","_waitForServiceReady","400","requires","getUser","bind","isPremiumPlugin","_getLatestVersion","isOfficialPlugin","reInit","RevisionHistory","_isPendingUpdate","listenTo","_fixRevision","getMany","sessionId","_handleRevisionsUpdate","add","max","sendBufferedUpdates","code","revisionsUpdated","setRevisionData","adapter","remove","cloud-services-internal-error: Not connected.","_oldOffset","serverHistory","keys","baseVersion","RevisionTracker","connect","authors","456wlHHqG","reconnect","setSource","message","length","_getLatestVersionFromServerOperations","wrongRequestId","authorsIds","cloud-services-internal-error: Revision History Service is not connected.","data","1583604yRmJVO","_preventResendingRevisionData","size","has","_offset","_revisionTracker","isConnected","pluginName","init","_handleReconnectionError","createdAt","change:_isConnected","connected","updateRevisions","destroy","22946PLqmnh","repository","isBundleUploaded","map","_fetchMissingUsers","_revisions","CONNECTED","diffData","3500puLBMs","state","fromVersion","toVersion","marker","currentRevision","once","_lastRequestId","getRevisions","catch","isEnabled","25221654RgandL","addUser","buildRevisionData","addToReconnectionStack","config","cloud-services-internal-error: Request timeout.","_createCurrentRevision","change:_isPendingUpdate","_startingVersion","RevisionHistoryService","isEmptyCurrent","then","startsWith","off","2fmQkim","_update","cloudServices.bundleVersion","affectsData","CloudServicesRevisionHistoryAdapter","getOperations","plugins","_revisionHistoryService","getRevision","type","from","_bufferUpdate","creatorId","addRevisionData"];return(Qs=function(){return t})()}function Zs(t,e){const n=Qs();return(Zs=function(t,e){return n[t-=123]})(t,e)}!function(t){const e=Zs,n=t();for(;;)try{if(736973===parseInt(e(225))/1*(parseInt(e(207))/2)+-parseInt(e(224))/3+-parseInt(e(182))/4+-parseInt(e(231))/5+-parseInt(e(159))/6+-parseInt(e(174))/7*(parseInt(e(149))/8)+parseInt(e(193))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Qs);class Xs extends e.Plugin{static[Ws(202)]=(()=>Ve)();[Ws(189)];[Ws(164)];[Ws(214)];[Ws(142)];static get[Ws(234)](){return[Hn,ws,Ws(126),Zn,Fn.Users]}static get[Ws(166)](){return Ws(211)}static get[Ws(124)](){return!0}static get[Ws(237)](){return!0}constructor(t){const e=Ws;super(t);const n=this[e(228)][e(197)][e(227)](e(230));this[e(189)]=null,this[e(164)]=this[e(228)][e(213)][e(227)](e(146)),this[e(214)]=new(Xs[e(202)])(n)}async[Ws(167)](){const t=Ws,e=this[t(228)][t(213)][t(227)](ws),r=e[t(143)],s=this[t(228)][t(213)][t(227)](Hn);this[t(164)][t(151)]({history:r,getLatestVersion:()=>this[t(123)](),getCurrentRevisionId:()=>e[t(131)]});const o=this[t(228)][t(197)][t(227)](t(209))||n.version,i=await Pe[t(176)](s[t(223)],o);this[t(228)][t(213)][t(227)](t(126))[t(139)]={getRevision:async({revisionId:e})=>(await this[t(232)](),await this[t(214)][t(215)](e)),updateRevisions:async e=>{const n=t;await this[n(232)]();const r=this[n(164)][n(187)];if(i&&1===e[n(153)]&&e[0].id===r.id)return e;for(const t of e)t.id===r.id&&(t[n(203)]=t[n(184)]===t[n(185)]);return this[n(214)][n(172)](e,this[n(189)])[n(204)](t=>(this[n(189)]=t,e))[n(191)](t=>{const r=n;if($s(t)||r(233)===t[r(136)]&&void 0!==t[r(158)][r(155)]){for(const t of e)!this[r(164)][r(175)][r(215)](t.id)||this[r(164)][r(218)](t.id,t,!1);if($s(t))throw t;return e}throw t})}},this[t(128)](this[t(214)],t(137),(e,{revisionsData:n,requestId:r})=>{const s=t;Math[s(134)](...n[s(177)](t=>t[s(185)]))>this[s(154)]()-1?this[s(123)]()[s(204)](()=>{this[s(132)](n,r)}):this[s(132)](n,r)});const{revisions:a,requestId:c}=await this[t(214)][t(147)](s[t(223)]);s[t(196)](this),this[t(189)]=c,await this[t(178)](a);for(const e of a)this[t(164)][t(220)](e);this[t(128)](e,t(170),(n,r,s)=>{const o=t;s&&(this[o(142)]=e[o(163)],n[o(206)]())}),this[t(164)][t(236)](t(192)).to(s,t(183),e=>e===Oe[t(180)])}async[Ws(150)](){const t=Ws,e=this[t(228)][t(213)][t(227)](Hn),n=this[t(228)][t(213)][t(227)](ws),r=async()=>{const r=t,s=this[r(164)][r(187)],o=s.id,i=o!==n[r(131)];if(i){const t=n[r(163)]-this[r(142)],e=this[r(154)]();if(this[r(164)][r(226)][r(125)](),s[r(185)]+t!==e){const n=s[r(184)]+t,o=this[r(228)][r(213)][r(227)](Fn.Users),i=this[r(164)][r(195)]({revision:s,from:n,to:e});i.id=s.id;const a=i[r(156)][r(177)](t=>o[r(235)](t));s[r(208)]({...i,authors:a},!0),this[r(164)][r(218)](s.id,i,!0)}this[r(164)][r(201)]=e,s[r(185)]===s[r(184)]&&!this[r(164)][r(229)][r(162)](o)&&this[r(164)][r(175)][r(179)][r(140)](o),this[r(164)][r(199)](e)}const{revisions:a,requestId:c}=await this[r(214)][r(150)](e[r(223)],this[r(189)]);i&&a[r(153)]>0?n[r(168)]():(await this[r(178)](a),this[r(132)](a,c),this[r(164)][r(135)]())};return n[t(221)]?r():new Promise((e,s)=>{const o=t;n[o(188)](o(170),()=>{const t=o;r()[t(204)](e)[t(191)](s)})})}[Ws(173)](){super[Ws(173)]()}async[Ws(232)](){const t=Ws;this[t(214)][t(165)]||await new Promise(e=>{const n=t;this[n(128)](this[n(214)],n(171),t=>{t[n(206)](),e()})})}[Ws(154)](){const t=Ws,e=this[t(228)][t(213)][t(227)](ws)[t(143)][t(212)]()[t(222)]();for(const n of e)if(t(186)!==n[t(216)]||n[t(210)])return n[t(145)]+1}[Ws(123)](){const t=Ws,e=this[t(228)][t(213)][t(227)](ws);return new Promise(n=>{const r=t;e[r(127)]?e[r(188)](r(200),()=>{n(this[r(154)]())}):n(this[r(154)]())})}[Ws(132)](t,e){const n=Ws,r=this[n(164)][n(175)];this[n(189)]=e;for(const e of t){const t=r[n(215)](e.id);if(t){if((e[n(184)]||e[n(185)])&&(e[n(181)]=null),t===this[n(164)][n(187)]){const r=Math[n(134)](t[n(185)],e[n(185)]),s=Math[n(134)](t[n(184)],e[n(184)]);let o;t[n(185)]===e[n(185)]&&t[n(184)]===e[n(184)]?(o=!0,this[n(160)](e)):e[n(185)]===r&&e[n(184)]===s?o=!1:(t[n(185)]===r&&t[n(184)]===s||this[n(129)]({revision:t,from:s,to:r}),o=!0),o&&(delete e[n(184)],delete e[n(185)],delete e[n(181)],delete e[n(169)],delete e[n(156)])}this[n(164)][n(138)](e),this[n(160)](e)}else this[n(164)][n(220)](e)}const s=r[n(190)]();s[n(222)]();for(let t=0;t<s[n(153)]-1;t++){const e=s[t],r=s[t+1];if(e[n(184)]<r[n(185)]){const t=r[n(185)],s=Math[n(134)](t,e[n(185)]);this[n(129)]({revision:e,from:t,to:s})}}}[Ws(129)]({revision:t,from:e,to:n}={}){const r=Ws,s=this[r(228)][r(213)][r(227)](Fn.Users),o=this[r(164)][r(195)]({revision:t,from:e,to:n});o[r(148)]=o[r(156)][r(177)](t=>s[r(235)](t)),t[r(208)](o)}[Ws(160)](t){const e=Ws,n={};n.id=t.id;for(const r of Object[e(144)](t))"id"!==r&&(n[r]=void 0);this[e(164)][e(218)](n.id,n,!0)}async[Ws(178)](t){const e=Ws,n=this[e(228)][e(213)][e(227)](Fn.Users),{connection:r}=this[e(228)][e(213)][e(227)](Hn),s=new Set;for(const n of t){for(const t of n[e(156)])i(t);n[e(219)]&&i(n[e(219)])}if(0===s[e(161)])return;const o=await b[e(130)](r,Array[e(217)](s));for(const t of o)n[e(235)](t.id)||n[e(194)](t);function i(t){const r=e;n[r(235)](t)||s[r(133)](t)}}}function $s(t){const e=Ws;return t[e(152)][e(205)](e(157))||t[e(152)][e(205)](e(141))||t[e(152)][e(205)](e(198))}function to(){var t=["31336okKHBI","558tpgonl","49698960RMdurn","3137553mCrnKO","RealTimeCollaborativeRevisionHistory","1635953HwvIfq","927pqrZJg","10024Uglpny","RevisionHistory","requires","193430rWrnCF","5CRlJYe","isPremiumPlugin","pluginName","7025020IcwYqt","isOfficialPlugin"];return(to=function(){return t})()}var eo=no;function no(t,e){var n=to();return(no=function(t,e){return n[t-=202]})(t,e)}!function(t){for(var e=no,n=t();;)try{if(971749===-parseInt(e(210))/1+-parseInt(e(215))/2+-parseInt(e(208))/3+-parseInt(e(203))/4*(parseInt(e(216))/5)+-parseInt(e(206))/6*(-parseInt(e(212))/7)+-parseInt(e(205))/8*(-parseInt(e(211))/9)+parseInt(e(207))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(to);class ro extends e.Plugin{static get[eo(214)](){return[eo(213),Xs,Ts]}static get[eo(202)](){return eo(209)}static get[eo(204)](){return!0}static get[eo(217)](){return!0}}function so(t){return function(t){return"object"==typeof t&&null!==t}(t)&&1===t.nodeType&&!function(t){if("object"!=typeof t)return!1;if(null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==Object.prototype.toString.call(t)){const e=t[Symbol.toStringTag];return null!=e&&(!!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable&&t.toString()===`[object ${e}]`)}let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t)}const oo=ao;function io(){const t=["ck-presence-list__users-counter","_collapseAt","isHidden","724788NrLnKJ","toString","usersCount","1251775qNqVhm","4591100LVWxCF","ck-presence-list__list-item","ck-presence-list__counter--hidden","3116832SqAKQE","25742wdHbaR","122156FJdpHE","279VOfdEU","bindTemplate","ck-presence-list__users-counter__text","listitem","set","div","bind","setTemplate","48748zLhtQN"];return(io=function(){return t})()}function ao(t,e){const n=io();return(ao=function(t,e){return n[t-=152]})(t,e)}!function(t){const e=ao,n=t();for(;;)try{if(727761===parseInt(e(153))/1+-parseInt(e(158))/2*(parseInt(e(160))/3)+parseInt(e(159))/4+parseInt(e(154))/5+parseInt(e(172))/6+-parseInt(e(168))/7+-parseInt(e(157))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(io);class co extends r.View{[oo(170)];constructor(t,e=6){const n=oo;super(t);const r=this[n(161)];this[n(164)](n(171),!0),this[n(164)](n(152),0),this[n(170)]=e,this[n(166)](n(171)).to(this,n(152),t=>t<e),this[n(167)]({tag:n(165),attributes:{class:["ck",n(155),r.if(n(171),n(156))],role:n(163)},children:[{tag:n(165),attributes:{class:["ck",n(169)]},children:[{tag:n(165),attributes:{class:["ck",n(162)]},children:[{text:r.to(n(152),t=>"+"+(t-this[n(170)]+2)[n(173)]())}]}]}]})}}const uo=lo;function lo(t,e){const n=po();return(lo=function(t,e){return n[t-=420]})(t,e)}function po(){const t=["6261318vrRqeM","4904095Sxelqb","fire","contains","ck-presence-list__list","focus","div","Collapsed connected users list (press ENTER to open it)","setTemplate","2SVRKqS","keystrokes","7900050JObYsQ","listenTo","hasPopup","change:hasPopup","2871861sqyaVC","Connected users list","set","presencelist:hide","isExpanded","removeAttribute","createCollection","setAttribute","render","list","179221BLpJFT","aria-expanded","relatedTarget","24ewUZpo",".ck-balloon-panel_with-arrow","bindTemplate","287800idyNDB","645012VEURyS",".ck-presence-list__dropdown-list","presencelist:show","items","element","querySelector"];return(po=function(){return t})()}!function(t){const e=lo,n=t();for(;;)try{if(694243===parseInt(e(443))/1+-parseInt(e(421))/2*(parseInt(e(427))/3)+-parseInt(e(444))/4+parseInt(e(451))/5+parseInt(e(423))/6+parseInt(e(437))/7*(-parseInt(e(440))/8)+-parseInt(e(450))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(po);class ho extends r.View{[uo(447)];[uo(422)];constructor(t){const e=uo;super(t);const r=this[e(442)];this[e(447)]=this[e(433)](),this[e(422)]=new n.KeystrokeHandler,this[e(429)]({hasPopup:!1,isExpanded:!1}),this[e(420)]({tag:e(456),attributes:{"aria-haspopup":r.if(e(425)),"aria-expanded":r.to(e(431),t=>this[e(425)]&&String(t)),"aria-label":r.to(e(425),n=>mr(t,e(n?457:428))),role:e(436),tabindex:r.to(e(425),t=>!!t&&0),class:["ck",e(454)]},children:this[e(447)],on:{mouseenter:r.to(()=>this[e(452)](e(446))),mouseleave:r.to(t=>{const n=e,r=t,s=document[n(449)](n(445)),o=document[n(449)](n(441));s?.[n(453)](r[n(439)])||o?.[n(453)](r[n(439)])||this[n(452)](n(430))})}}),this.on(e(426),(t,n,r)=>{const s=e;this[s(448)]&&(r?this[s(448)][s(434)](s(438),String(this[s(431)])):this[s(448)][s(432)](s(438)))})}[uo(455)](){const t=uo;this[t(448)][t(455)]()}[uo(435)](){const t=uo;super[t(435)](),this[t(422)][t(424)](this[t(448)])}}var fo=__webpack_require__(106),mo={attributes:{"data-cke":!0}};mo.setAttributes=or(),mo.insert=rr().bind(null,"head"),mo.domAPI=er(),mo.insertStyleElement=ar();$n()(fo.A,mo);fo.A&&fo.A.locals&&fo.A.locals;const yo=go;function go(t,e){const n=bo();return(go=function(t,e){return n[t-=132]})(t,e)}function bo(){const t=["bind","2884212kJgcLr","change","ck-reset","inlineListView","listenTo","283458ZKzTGv","ck-presence-list--collapsed","hasPopup","650640wzkgcf","356656XUXqJn","1410752ZcPqjx","ck-presence-list","first","counterView","locale","958915STrjQd","tooltipPosition","bindTemplate","isCollapsed","382446QFKqVI","div","30XZByhZ","setTemplate","items","set","ck-rounded-corners"];return(bo=function(){return t})()}!function(t){const e=go,n=t();for(;;)try{if(497501===-parseInt(e(153))/1+-parseInt(e(137))/2+-parseInt(e(150))/3+parseInt(e(145))/4+parseInt(e(133))/5*(parseInt(e(139))/6)+-parseInt(e(155))/7+-parseInt(e(154))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(bo);class Oo extends r.View{[yo(158)];[yo(148)];constructor(t,e=6){const n=yo;super(t);const r=this[n(135)];this[n(142)](n(136),!0),this[n(158)]=new co(this[n(132)],e),this[n(148)]=new ho(t),this[n(148)][n(144)](n(152)).to(this,n(136)),this[n(149)](this[n(148)][n(141)],n(146),()=>{const t=n;for(const e of this[t(148)][t(141)])e[t(134)]="s";this[t(148)][t(141)][t(157)]&&(this[t(148)][t(141)][t(157)][t(134)]="se")}),this[n(140)]({tag:n(138),attributes:{class:["ck",n(156),n(147),n(143),r.if(n(136),n(151))]},children:[this[n(148)]]})}}const wo=vo;function vo(t,e){const n=So();return(vo=function(t,e){return n[t-=366]})(t,e)}!function(t){const e=vo,n=t();for(;;)try{if(894129===parseInt(e(410))/1*(-parseInt(e(374))/2)+-parseInt(e(381))/3+-parseInt(e(373))/4*(parseInt(e(402))/5)+-parseInt(e(390))/6*(-parseInt(e(371))/7)+-parseInt(e(392))/8*(-parseInt(e(401))/9)+parseInt(e(366))/10+-parseInt(e(387))/11*(-parseInt(e(403))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(So);class Io extends r.View{[wo(408)];constructor(t,e){const n=wo;super(t);const r=this[n(378)];this[n(408)]=new ko(t,e),this[n(406)]({tag:n(367),attributes:{tabindex:-1,role:n(379),class:["ck",n(411)],"aria-label":mr(t,n(376))},children:[this[n(408)]],on:{mouseleave:r.to(t=>{const e=n,r=t,s=document[e(405)](e(400)),o=document[e(405)](e(396));s?.[e(369)](r[e(384)])||o?.[e(369)](r[e(384)])||this[e(389)](e(388))})}})}}function So(){const t=["ariaLabelledBy","querySelector","setTemplate","listenTo","listWrapperView","ck-presence-list__dropdown-list-wrapper_scrollable","1829SCgEaX","ck-presence-list__dropdown-list","render","12109700kpeBVS","div","ck-presence-list__dropdown-list-wrapper","contains","clientHeight","10577LtgfKg","_isScrollable","4RqyHdY","1714ljApXv","ck-reset","Connected users list dropdown menu","ariaLabel","bindTemplate","application","set","2182281YucEWG","change","window","relatedTarget","innerHeight","resize","11dsiAiW","presencelist:hide","fire","1482TncJpS","role","8LLUWqe","checkIfScrollable","scrollHeight","max",".ck-balloon-panel_with-arrow","element","ck-list","items",".ck-presence-list__list","13417461QNEMwY","3966175AOIflu","10886736LMHaKL"];return(So=function(){return t})()}class ko extends r.ListView{constructor(t,e){const r=wo;super(t);const s=this[r(378)];this[r(380)](r(372),!1),this[r(406)]({tag:e?r(367):"ul",attributes:{class:["ck",r(375),r(398),r(368),s.if(r(372),r(409))],role:s.to(r(391)),"aria-label":s.to(r(377)),"aria-labelledby":s.to(r(404))},children:this[r(399)]}),this[r(407)](n.global[r(383)],r(386),()=>this[r(393)]()),this[r(399)].on(r(382),()=>this[r(393)]())}[wo(412)](){const t=wo;super[t(412)](),this[t(393)]()}[wo(393)](){const t=wo,e=this[t(397)];e&&(this[t(372)]=Math[t(395)](e[t(394)],e[t(370)])>.8*window[t(385)])}}const Po=To;function Ao(){const t=["name","1643949GhKmVp","fire","bindTemplate","button","true","263298yjuGHZ","ck-presence-list__marker","8bElcXg","1020895FjXmSU","execute","2039760fDgcbl","color","19146410AOtWwi","focus","getBackgroundColorClass","presentation","tag","1158794ygpsKA","userView","ck-presence-list__dropdown-list-item","9VIDTny","574664zbehvM","element","5phZmYM","span","ck-user__full-name","setTemplate"];return(Ao=function(){return t})()}function To(t,e){const n=Ao();return(To=function(t,e){return n[t-=134]})(t,e)}!function(t){const e=To,n=t();for(;;)try{if(609184===-parseInt(e(139))/1+-parseInt(e(141))/2+-parseInt(e(151))/3*(-parseInt(e(152))/4)+-parseInt(e(154))/5*(parseInt(e(136))/6)+parseInt(e(148))/7+parseInt(e(138))/8*(parseInt(e(159))/9)+parseInt(e(143))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Ao);class _o extends r.ListItemView{[Po(149)];constructor(t,e,n){const r=Po;super(t);const s=this[r(161)];this[r(149)]=new Fn.UserView(t,e);const o={tag:"li",attributes:{class:["ck",r(150)],tabindex:-1,role:r(146),"aria-label":e[r(158)]},children:[this[r(149)],{tag:r(155),attributes:{class:["ck",r(156)]},children:[{text:e[r(158)]}]},{tag:r(155),attributes:{class:["ck",r(137),e[r(142)][r(145)]()],"aria-hidden":r(135)}}]};n&&(o[r(147)]=r(134),o.on={click:s.to(()=>this[r(160)](r(140)))}),this[r(157)](o)}[Po(144)](){const t=Po;this[t(153)][t(144)]()}}const Co=jo;function jo(t,e){const n=Ro();return(jo=function(t,e){return n[t-=478]})(t,e)}!function(t){const e=jo,n=t();for(;;)try{if(439909===parseInt(e(499))/1*(-parseInt(e(493))/2)+-parseInt(e(486))/3+parseInt(e(508))/4*(parseInt(e(485))/5)+parseInt(e(491))/6*(parseInt(e(495))/7)+-parseInt(e(501))/8+parseInt(e(498))/9*(-parseInt(e(506))/10)+-parseInt(e(482))/11*(-parseInt(e(507))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Ro);class Eo extends r.View{[Co(505)];[Co(480)];constructor(t,e,n){const s=Co;super(t);const o=this[s(479)];this[s(490)](s(494),!1),this[s(490)](s(487),!0),this[s(490)](s(492),""),this[s(505)]=new Fn.UserView(t,e),this[s(480)]=new Do(t,e);const i=new r.LabelView(t);i[s(511)][s(481)]=s(510),i[s(496)]=e[s(489)];const a={tag:s(504),attributes:{class:["ck",s(488)],role:s(483),tabindex:o.to(s(494),t=>!!t&&0),"aria-labelledby":i.id,"data-cke-tooltip-text":this[s(505)][s(489)],"data-cke-tooltip-position":o.to(s(492)),"data-cke-tooltip-disabled":o.to(s(487),t=>!t),"data-cke-tooltip-class":s(500)},children:[this[s(505)],this[s(480)],i]};n&&(a[s(481)]=s(497),a.on={click:o.to(()=>this[s(512)](s(484)))}),this[s(478)](a)}}class Do extends r.View{constructor(t,e){const n=Co;super(t),this[n(478)]({tag:n(510),attributes:{class:["ck",n(502),e[n(513)][n(503)]()],"aria-hidden":n(509)}})}}function Ro(){const t=["set","78wXHOLB","tooltipPosition","2UWOFGp","isFocusable","236257uJDdrK","text","button","33786AKgfeS","359069skTnin","ck-presence-list__list-item__tooltip","844240gfqaEI","ck-presence-list__marker","getBackgroundColorClass","div","userView","240ZxDosB","811968YOlXNP","1836kYOvgh","true","span","template","fire","color","setTemplate","bindTemplate","markerView","tag","77WBlire","listitem","execute","2715fJSpip","501132YAERAF","hasTooltip","ck-presence-list__list-item","name"];return(Ro=function(){return t})()}const xo=No;function No(t,e){const n=Vo();return(No=function(t,e){return n[t-=409]})(t,e)}function Vo(){const t=["filter","focusTracker","context","body","keystrokes","isVisible","pluginName","checkIfScrollable","allConnectedUsers","presenceList","presencelist-collapseat-invalid-format","isRendered","1229930gLxTPP","remove","_createView","presenceList.collapseAt","min","presenceDropdownView","view","offsetWidth","detachFromDom","Enter","activeElement","presencelist:hide","_handleUserRemove","1694005KHEqCv","class","isCollapsed","displayMe","button","1367528ilIygs","destroy","isMe","isFocusable","find","change:isFocused","bind","hideDropdown","showDropdown","items","content",':not([disabled]):not([tabindex="-1"])',"bindTo","Tab","requires","reverse","element","4414304GAmvvB","input","get","indexOf","number","textarea","onClick","6AoyyOe","appendChild","892164nRWIAY","Shift+Tab","tabIndex","isExpanded","presencelist-missing-container","Esc","querySelectorAll","unpin","focus","presenceList.container","execute","[tabindex]","_bodyCollection","join","503202vOdOVw","ck ck-presence-list__balloon","init","locale","1134012KCxAdw","sort","select","listenTo","using","define","attachToDom","hasTooltip","set","isOfficialPlugin","_allConnectedUsers","counterView","inlineListView","[contenteditable]","plugins","_handleUserAdd","add","currentDisplayedUsers","isPremiumPlugin","balloonPanelView","length","presenceList.displayMe","offsetHeight","usersCount","from","presencelist:show","pin","render","map","config","PresenceListUI"];return(Vo=function(){return t})()}!function(t){const e=No,n=t();for(;;)try{if(493262===parseInt(e(442))/1+parseInt(e(503))/2+-parseInt(e(440))/3*(parseInt(e(416))/4)+parseInt(e(411))/5+-parseInt(e(460))/6+parseInt(e(456))/7+-parseInt(e(433))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Vo);const Mo={collapseAt:6,displayMe:!0};class Bo extends e.ContextPlugin{[xo(477)];[xo(479)];[xo(509)];[xo(508)];[xo(454)]=null;static get[xo(497)](){return xo(490)}static get[xo(469)](){return!0}static get[xo(478)](){return!0}constructor(t){const e=xo;super(t),this[e(493)][e(489)][e(465)](e(500),Mo);const s=t[e(489)][e(435)](e(506));if(e(437)!=typeof s)throw new n.CKEditorError(e(501),this);if(s<1)throw new n.CKEditorError(e(501),this);this[e(470)]=this[e(493)][e(474)][e(435)](Zn)[e(499)],this[e(468)](e(483),0),this[e(477)]=new n.Collection,this[e(479)]=new r.BalloonPanelView,this[e(479)][e(412)]=e(457),this[e(509)]=this[e(505)](),this[e(508)]=void 0}static get[xo(430)](){return[Zn]}[xo(458)](){const t=xo;for(const e of this[t(470)])this[t(475)](e);this[t(463)](this[t(470)],t(476),(e,n)=>{this[t(475)](n)}),this[t(463)](this[t(470)],t(504),(e,n)=>{this[t(410)](n)})}[xo(505)](){const t=xo,e=this[t(493)],s=new Oo(this[t(493)][t(459)],this[t(493)][t(489)][t(435)](t(506))),o=this[t(479)];if(!so(e[t(489)][t(435)](t(451))))throw new n.CKEditorError(t(446),this);return s[t(471)][t(422)](t(483)).to(this),s[t(422)](t(413)).to(this,t(483),n=>{const r=t,{collapseAt:o}=e[r(489)][r(435)](r(500)),i=n>=o;if(i&&!s[r(472)][r(425)][r(420)](t=>t instanceof co)){const t=this[r(493)][r(489)][r(435)](r(506))-1;this[r(477)][r(480)]==t&&this[r(477)][r(480)]>1&&this[r(477)][r(504)](this[r(477)][r(480)]-1),s[r(472)][r(425)][r(476)](s[r(471)])}return i||this[r(423)](),i}),s[t(472)][t(425)][t(428)](this[t(477)])[t(464)](n=>{const r=t,o=e[r(489)][r(435)](r(500)),i=new Eo(e[r(459)],n,!!o[r(439)]);return i[r(422)](r(467)).to(s,r(413),t=>!t),i[r(422)](r(419)).to(s,r(413),t=>!t),o[r(439)]&&this[r(463)](i,r(452),()=>{const t=r;this[t(509)][t(413)]||o[t(439)](n,i[t(432)])}),i}),this[t(463)](s[t(472)],t(485),()=>{const e=t;this[e(509)][e(413)]&&this[e(424)]()}),this[t(463)](s[t(472)],t(409),()=>{const e=t;this[e(508)]&&this[e(423)]()}),s[t(472)][t(495)][t(468)](t(512),(e,n)=>{const r=t;this[r(509)][r(413)]&&(this[r(424)](),n())}),s[t(487)](),o[t(487)](),(0,r.clickOutsideHandler)({emitter:s,activator:()=>o[t(496)],contextElements:[o[t(432)],s[t(472)][t(432)]],callback:()=>this[t(423)]()}),e[t(489)][t(435)](t(451))[t(441)](s[t(432)]),this[t(454)]=new r.BodyCollection(this[t(493)][t(459)]),this[t(454)][t(466)](),this[t(454)][t(476)](this[t(479)]),s}[xo(475)](t){const e=xo;if(!this[e(493)][e(489)][e(435)](e(481))&&t[e(418)])return;const n=this[e(493)][e(489)][e(435)](e(506))-1;for(this[e(483)]++;this[e(477)][e(480)]>=n-(this[e(509)][e(413)]?1:0)&&this[e(477)][e(480)]>1;)this[e(477)][e(504)](1);const r=t[e(418)]?0:this[e(477)][e(480)];this[e(477)][e(476)](t,r)}[xo(410)](t){const e=xo;this[e(483)]--;const{collapseAt:n}=this[e(493)][e(489)][e(435)](e(500)),r=this[e(483)]>=n;if(this[e(477)][e(435)](t.id))this[e(477)][e(504)](t.id);else if(r&&this[e(477)][e(480)]+1===n-1)return;if(this[e(477)][e(480)]+(r?1:0)<this[e(483)])for(const t of Array[e(484)](this[e(470)])[e(431)]())if(!this[e(477)][e(435)](t.id)&&(this[e(477)][e(476)](t,Math[e(507)](this[e(477)][e(480)]-(r?1:0),1)),this[e(477)][e(480)]+(r?1:0)===n-1))return}[xo(424)](){const t=xo;if(this[t(508)])return;const e=this[t(493)][t(489)][t(435)](t(500));this[t(508)]=new Io(this[t(493)][t(459)],!!e[t(439)]),this[t(509)][t(472)][t(445)]=!0,this[t(463)](this[t(508)],t(409),()=>{const e=t;this[e(508)]&&this[e(423)]()});const{listWrapperView:n}=this[t(508)];n[t(425)][t(428)](this[t(470)])[t(464)](n=>{const r=t;if(!e[r(414)]&&n[r(418)])return null;const s=new _o(this[r(493)][r(459)],n,!!e[r(439)]);return e[r(439)]&&this[r(463)](s,r(452),()=>{const t=r;e[t(439)](n,s[t(432)])}),s}),this[t(479)][t(426)][t(476)](this[t(508)]),this[t(479)][t(486)]({target:this[t(509)][t(472)][t(432)]}),n[t(450)](),n[t(498)]();const r=(e,n)=>{const r=t;this[r(423)](),this[r(509)][r(472)][r(450)](),n()};n[t(495)][t(468)](t(447),r),n[t(495)][t(468)](t(443),r),n[t(495)][t(468)](t(429),(e,n)=>{const r=t;!function(t){const e=No,n=["a",e(415),e(434),e(462),e(438),e(453),e(473)][e(488)](t=>t+e(427))[e(455)](","),r=[...document[e(494)][e(448)](n)][e(491)](t=>t===document[e(513)]||t[e(510)]+t[e(482)]>0)[e(461)]((t,n)=>(t[e(444)]||0)-(n[e(444)]||0)),s=r[e(436)](t),o=r[(s+1)%r[e(480)]];o&&o[e(450)]()}(this[r(509)][r(432)]),this[r(423)](),n()}),n[t(492)][t(476)](this[t(509)][t(432)]),n[t(492)].on(t(421),(e,n,r)=>{r||this[t(423)]()})}[xo(423)](){const t=xo;this[t(508)]&&(this[t(509)][t(472)][t(445)]=!1,this[t(479)][t(449)](),this[t(479)][t(426)][t(504)](this[t(508)]),this[t(508)][t(417)](),this[t(508)]=void 0)}[xo(417)](){const t=xo;super[t(417)](),this[t(509)]&&this[t(509)][t(502)]&&this[t(509)][t(417)](),this[t(454)]&&(this[t(454)][t(511)](),this[t(454)][t(417)](),this[t(454)]=null)}}var Uo=qo;function Jo(){var t=["9348544fvfaLD","9755unttDF","isPremiumPlugin","requires","8084167uHaNsI","63kyGRXX","1332390pjNLag","pluginName","isOfficialPlugin","232EdWnWo","1211560GCuJfu","36537oTrxid","4404408RFlzmz","116YJdZpv","PresenceList"];return(Jo=function(){return t})()}function qo(t,e){var n=Jo();return(qo=function(t,e){return n[t-=133]})(t,e)}!function(t){for(var e=qo,n=t();;)try{if(650568===parseInt(e(137))/1*(-parseInt(e(134))/2)+parseInt(e(147))/3*(-parseInt(e(145))/4)+parseInt(e(146))/5+parseInt(e(133))/6+-parseInt(e(140))/7+parseInt(e(136))/8+parseInt(e(141))/9*(parseInt(e(142))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Jo);class Go extends e.ContextPlugin{static get[Uo(139)](){return[Zn,Bo]}static get[Uo(143)](){return Uo(135)}static get[Uo(144)](){return!0}static get[Uo(138)](){return!0}}function Lo(t,e){var n=Yo();return(Lo=function(t,e){return n[t-=381]})(t,e)}function Yo(){var t=["1042232hdevXy","3741576mDTVqs","516944kQAXmt","1163yxtWIy","474BVtJvP","1473565aSrMUr","3UGAjtc","45JFEoba","66DJvTOe","13ffHvpU","42LrvmKl","400242FWukco","448410rHThfv"];return(Yo=function(){return t})()}!function(t){for(var e=Lo,n=t();;)try{if(356719===parseInt(e(384))/1*(-parseInt(e(385))/2)+parseInt(e(387))/3*(parseInt(e(383))/4)+parseInt(e(386))/5+parseInt(e(392))/6*(-parseInt(e(391))/7)+parseInt(e(381))/8*(parseInt(e(388))/9)+-parseInt(e(393))/10*(-parseInt(e(389))/11)+parseInt(e(382))/12*(-parseInt(e(390))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Yo)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();
|
|
5
|
+
*/(()=>{var __webpack_modules__={6:(t,e,n)=>{"use strict";t.exports=l;var r,s=n(737),o=s.LongBits,i=s.base64,a=s.utf8;function c(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}function d(){}function u(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function l(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return s.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(t,e,n){e[n]=255&t}function f(t,e){this.len=t,this.next=void 0,this.val=e}function m(t,e,n){for(;t.hi;)e[n++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=127&t.lo|128,t.lo=t.lo>>>7;e[n++]=t.lo}function y(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}l.create=p(),l.alloc=function(t){return new s.Array(t)},s.Array!==Array&&(l.alloc=s.pool(l.alloc,s.Array.prototype.subarray)),l.prototype._push=function(t,e,n){return this.tail=this.tail.next=new c(t,e,n),this.len+=e,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(t,e,n){for(;t>127;)e[n++]=127&t|128,t>>>=7;e[n]=t},l.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new f((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},l.prototype.int32=function(t){return t<0?this._push(m,10,o.fromNumber(t)):this.uint32(t)},l.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},l.prototype.uint64=function(t){var e=o.from(t);return this._push(m,e.length(),e)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(t){var e=o.from(t).zzEncode();return this._push(m,e.length(),e)},l.prototype.bool=function(t){return this._push(h,1,t?1:0)},l.prototype.fixed32=function(t){return this._push(y,4,t>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(t){var e=o.from(t);return this._push(y,4,e.lo)._push(y,4,e.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(t){return this._push(s.float.writeFloatLE,4,t)},l.prototype.double=function(t){return this._push(s.float.writeDoubleLE,8,t)};var g=s.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var r=0;r<t.length;++r)e[n+r]=t[r]};l.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(h,1,0);if(s.isString(t)){var n=l.alloc(e=i.length(t));i.decode(t,n,0),t=n}return this.uint32(e)._push(g,e,t)},l.prototype.string=function(t){var e=a.length(t);return e?this.uint32(e)._push(a.write,e,t):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 t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this},l.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e},l._configure=function(t){r=t,l.create=p(),r._configure()}},106:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(168),s=n.n(r),o=n(433),i=n.n(o)()(s());i.push([t.id,'.ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:calc(var(--ck-z-dialog) + 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:inline-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;flex-direction:row;justify-content:flex-end;position:relative}.ck.ck-presence-list__list:after{background:transparent;bottom:-15px;content:"";height:15px;left:0;position:absolute;width:100%}.ck.ck-presence-list__counter--hidden{display:none}.ck.ck-presence-list__list-item{background:none;border:1px solid transparent;color:inherit;font:inherit;margin-left:var(--ck-spacing-medium);outline:none;padding:0;position:relative}.ck.ck-presence-list__list-item:focus{border:var(--ck-focus-ring);border-radius:0;box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck-rounded-corners .ck.ck-presence-list__list-item:focus,.ck.ck-presence-list__list-item.ck-rounded-corners:focus{border-radius:var(--ck-border-radius)}.ck.ck-presence-list__list-item .ck-label{height:0;overflow:hidden;width:0}.ck.ck-presence-list__list-item:first-child{margin-left:0}.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:5px;position:relative;width:100%}.ck-presence-list__balloon button.ck-presence-list__dropdown-list-item *,.ck-presence-list__list button.ck-presence-list__list-item *{cursor:pointer}.ck.ck-presence-list--collapsed .ck-presence-list__list{border:1px solid transparent;min-width:calc(var(--ck-user-avatar-size)*2);padding-left:1px}.ck.ck-presence-list--collapsed .ck-presence-list__list *{cursor:pointer;transition:all .4s ease-in-out}.ck.ck-presence-list--collapsed .ck-presence-list__list:focus{border:var(--ck-focus-ring);border-radius:0;box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck-rounded-corners .ck.ck-presence-list--collapsed .ck-presence-list__list:focus,.ck.ck-presence-list--collapsed .ck-presence-list__list.ck-rounded-corners:focus{border-radius:var(--ck-border-radius)}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item{border:0;margin-left:calc(var(--ck-user-avatar-size)*-.35);padding:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:first-child{margin-left:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:last-child{order:unset}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item .ck-user{--ck-presence-list-avatar-border-color:var(--ck-color-base-foreground);border:2px solid var(--ck-presence-list-avatar-border-color);margin-left:0;margin-right:0}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item.ck-presence-list__users-counter{margin-left:0;margin-right:0}.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}@media (prefers-reduced-motion:reduce){.ck.ck-presence-list__balloon{animation:none}}.ck.ck-presence-list__balloon ul{background-color:var(--ck-color-presence-list-dropdown-background)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper{border-radius:var(--ck-border-radius);max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-wrapper.ck-presence-list__dropdown-list-wrapper_scrollable{max-height:80vh;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:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:focus{box-shadow:var(--ck-focus-outer-shadow),0 0;outline:var(--ck-focus-ring);outline-offset:-1px;position:relative;z-index:1}.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.ck-presence-list__users-counter{--ck-presence-list-counter-border-color:var(--ck-user-avatar-background);--ck-presence-list-counter-background-color:var(--ck-user-avatar-color);align-items:center;background-color:var(--ck-presence-list-counter-background-color);border:2px solid var(--ck-presence-list-counter-border-color);border-radius:50%;box-sizing:border-box;display:flex;height:calc(var(--ck-user-avatar-size) - 4px);justify-content:center;line-height:100%;margin:4px 2px 2px;position:relative;width:calc(var(--ck-user-avatar-size) - 4px)}.ck.ck-presence-list__users-counter__text{--ck-presence-list-counter-text-color:var(--ck-user-avatar-background);color:var(--ck-presence-list-counter-text-color);cursor:default;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}',""]);const a=i},130:(t,e,n)=>{"use strict";t.exports=s;var r=n(737);function s(t,e){this.lo=t>>>0,this.hi=e>>>0}var o=s.zero=new s(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var i=s.zeroHash="\0\0\0\0\0\0\0\0";s.fromNumber=function(t){if(0===t)return o;var e=t<0;e&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return e&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new s(n,r)},s.from=function(t){if("number"==typeof t)return s.fromNumber(t);if(r.isString(t)){if(!r.Long)return s.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new s(t.low>>>0,t.high>>>0):o},s.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+4294967296*n)}return this.lo+4294967296*this.hi},s.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var a=String.prototype.charCodeAt;s.fromHash=function(t){return t===i?o:new s((a.call(t,0)|a.call(t,1)<<8|a.call(t,2)<<16|a.call(t,3)<<24)>>>0,(a.call(t,4)|a.call(t,5)<<8|a.call(t,6)<<16|a.call(t,7)<<24)>>>0)},s.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)},s.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},s.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},s.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},156:t=>{"use strict";t.exports={}},168:t=>{"use strict";t.exports=function(t){return t[1]}},178:(t,e,n)=>{"use strict";e.Service=n(418)},199:(t,e,n)=>{"use strict";t.exports=n(995)},211:(t,e,n)=>{t.exports=n(312)("./src/collaboration-core.js")},230: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(t){}return null}module.exports=inquire},237:t=>{"use strict";t.exports=CKEditor5.dll},262:t=>{"use strict";var e={};t.exports=function(t,n){var r=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(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},310:t=>{"use strict";t.exports=function(t,e){var n=new Array(arguments.length-1),r=0,s=2,o=!0;for(;s<arguments.length;)n[r++]=arguments[s++];return new Promise(function(s,i){n[r]=function(t){if(o)if(o=!1,t)i(t);else{for(var e=new Array(arguments.length-1),n=0;n<e.length;)e[n++]=arguments[n];s.apply(null,e)}};try{t.apply(e||null,n)}catch(t){o&&(o=!1,i(t))}})}},311:(t,e,n)=>{t.exports=n(237)("./src/ui.js")},312:t=>{"use strict";t.exports=CKEditor5.collaborationDll},319:t=>{"use strict";t.exports=function(t,e,n){var r=n||8192,s=r>>>1,o=null,i=r;return function(n){if(n<1||n>s)return t(n);i+n>r&&(o=t(r),i=0);var a=e.call(o,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},357:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},365:t=>{"use strict";function e(t){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),r=128===n[3];function s(t,r,s){e[0]=t,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3]}function o(t,r,s){e[0]=t,r[s]=n[3],r[s+1]=n[2],r[s+2]=n[1],r[s+3]=n[0]}function i(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],e[0]}function a(t,r){return n[3]=t[r],n[2]=t[r+1],n[1]=t[r+2],n[0]=t[r+3],e[0]}t.writeFloatLE=r?s:o,t.writeFloatBE=r?o:s,t.readFloatLE=r?i:a,t.readFloatBE=r?a:i}():function(){function e(t,e,n,r){var s=e<0?1:0;if(s&&(e=-e),0===e)t(1/e>0?0:2147483648,n,r);else if(isNaN(e))t(2143289344,n,r);else if(e>34028234663852886e22)t((s<<31|2139095040)>>>0,n,r);else if(e<11754943508222875e-54)t((s<<31|Math.round(e/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(e)/Math.LN2);t((s<<31|o+127<<23|8388607&Math.round(e*Math.pow(2,-o)*8388608))>>>0,n,r)}}function i(t,e,n){var r=t(e,n),s=2*(r>>31)+1,o=r>>>23&255,i=8388607&r;return 255===o?i?NaN:s*(1/0):0===o?1401298464324817e-60*s*i:s*Math.pow(2,o-150)*(i+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,r),t.readFloatLE=i.bind(null,s),t.readFloatBE=i.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),r=128===n[7];function s(t,r,s){e[0]=t,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3],r[s+4]=n[4],r[s+5]=n[5],r[s+6]=n[6],r[s+7]=n[7]}function o(t,r,s){e[0]=t,r[s]=n[7],r[s+1]=n[6],r[s+2]=n[5],r[s+3]=n[4],r[s+4]=n[3],r[s+5]=n[2],r[s+6]=n[1],r[s+7]=n[0]}function i(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],n[4]=t[r+4],n[5]=t[r+5],n[6]=t[r+6],n[7]=t[r+7],e[0]}function a(t,r){return n[7]=t[r],n[6]=t[r+1],n[5]=t[r+2],n[4]=t[r+3],n[3]=t[r+4],n[2]=t[r+5],n[1]=t[r+6],n[0]=t[r+7],e[0]}t.writeDoubleLE=r?s:o,t.writeDoubleBE=r?o:s,t.readDoubleLE=r?i:a,t.readDoubleBE=r?a:i}():function(){function e(t,e,n,r,s,o){var i=r<0?1:0;if(i&&(r=-r),0===r)t(0,s,o+e),t(1/r>0?0:2147483648,s,o+n);else if(isNaN(r))t(0,s,o+e),t(2146959360,s,o+n);else if(r>17976931348623157e292)t(0,s,o+e),t((i<<31|2146435072)>>>0,s,o+n);else{var a;if(r<22250738585072014e-324)t((a=r/5e-324)>>>0,s,o+e),t((i<<31|a/4294967296)>>>0,s,o+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),t(4503599627370496*(a=r*Math.pow(2,-c))>>>0,s,o+e),t((i<<31|c+1023<<20|1048576*a&1048575)>>>0,s,o+n)}}}function i(t,e,n,r,s){var o=t(r,s+e),i=t(r,s+n),a=2*(i>>31)+1,c=i>>>20&2047,d=4294967296*(1048575&i)+o;return 2047===c?d?NaN:a*(1/0):0===c?5e-324*a*d:a*Math.pow(2,c-1075)*(d+4503599627370496)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,r,4,0),t.readDoubleLE=i.bind(null,s,0,4),t.readDoubleBE=i.bind(null,o,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function r(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function s(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function o(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},366:(t,e,n)=>{"use strict";t.exports=c;var r,s=n(737),o=s.LongBits,i=s.utf8;function a(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function c(t){this.buf=t,this.pos=0,this.len=t.length}var d,u="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new c(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new c(t);throw Error("illegal buffer")},l=function(){return s.Buffer?function(t){return(c.create=function(t){return s.Buffer.isBuffer(t)?new r(t):u(t)})(t)}:u};function p(){var t=new o(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw a(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw a(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function h(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=s.Array.prototype.subarray||s.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 t=this.uint32();return t>>>1^-(1&t)},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 t=s.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var t=s.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},c.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw a(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(e,n);if(e===n){var r=s.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,e,n)},c.prototype.string=function(){var t=this.bytes();return i.read(t,0,t.length)},c.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw a(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},c._configure=function(t){r=t,c.create=l(),r._configure();var e=s.Long?"toLong":"toNumber";s.merge(c.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return f.call(this)[e](!0)},sfixed64:function(){return f.call(this)[e](!1)}})}},418:(t,e,n)=>{"use strict";t.exports=s;var r=n(737);function s(t,e,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(n)}(s.prototype=Object.create(r.EventEmitter.prototype)).constructor=s,s.prototype.rpcCall=function t(e,n,s,o,i){if(!o)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(t,a,e,n,s,o);if(a.rpcImpl)try{return a.rpcImpl(e,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(t,n){if(t)return a.emit("error",t,e),i(t);if(null!==n){if(!(n instanceof s))try{n=s[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return a.emit("error",t,e),i(t)}return a.emit("data",n,e),i(null,n)}a.end(!0)})}catch(t){return a.emit("error",t,e),void setTimeout(function(){i(t)},0)}else setTimeout(function(){i(Error("already ended"))},0)},s.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},433:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,r,s,o){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var d=0;d<t.length;d++){var u=[].concat(t[d]);r&&i[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),e.push(u))}},e}},535:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(168),s=n.n(r),o=n(433),i=n.n(o)()(s());i.push([t.id,".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-user__marker-tooltip{color:#fff;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}@media (prefers-reduced-motion:reduce){.ck .ck-user__marker-tooltip{transition:none}}.ck .ck-user__marker-line{bottom:0;height:100%;position:absolute;width:0}.ck .ck-user__marker{cursor:default;display:inline;position:relative}.ck .ck-user__marker.ck-user__marker_hovered .ck-user__marker-dot{width:0}.ck .ck-user__marker.ck-user__marker_hovered .ck-user__marker-tooltip{animation:fadeInLeft .3s ease-in-out;display:block;opacity:1}.ck .ck-placeholder .ck-user__marker{display:none}@media (prefers-reduced-motion:reduce){.ck .ck-user__marker,.ck .ck-user__marker *,.ck .ck-user__marker:after{animation:none!important}}@keyframes fadeInLeft{0%{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:translateX(0)}}",""]);const a=i},545:t=>{"use strict";var e,n=(e=[],function(t,n){return e[t]=n,e.filter(Boolean).join("\n")});function r(t,e,r,s){var o;if(r)o="";else{o="",s.supports&&(o+="@supports (".concat(s.supports,") {")),s.media&&(o+="@media ".concat(s.media," {"));var i=void 0!==s.layer;i&&(o+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),o+=s.css,i&&(o+="}"),s.media&&(o+="}"),s.supports&&(o+="}")}if(t.styleSheet)t.styleSheet.cssText=n(e,o);else{var a=document.createTextNode(o),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(a,c[e]):t.appendChild(a)}}var s={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=s.singletonCounter++,n=s.singleton||(s.singleton=t.insertStyleElement(t));return{update:function(t){r(n,e,!1,t)},remove:function(t){r(n,e,!0,t)}}}},553:(t,e)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function s(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var r,o,i=[];for(o in"string"!=typeof e&&(e="?"),t)if(n.call(t,o)){if((r=t[o])||null!=r&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;i.push(o+"="+r)}return i.length?e+i.join("&"):""},e.parse=function(t){for(var e,n=/([^=?#&]+)=?([^&]*)/g,s={};e=n.exec(t);){var o=r(e[1]),i=r(e[2]);null===o||null===i||o in s||(s[o]=i)}return s}},584:(t,e,n)=>{t.exports=n(237)("./src/utils.js")},623:(t,e,n)=>{"use strict";t.exports=o;var r=n(6);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(){r.call(this)}function i(t,e,n){t.length<40?s.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}o._configure=function(){o.alloc=s._Buffer_allocUnsafe,o.writeBytesBuffer=s.Buffer&&s.Buffer.prototype instanceof Uint8Array&&"set"===s.Buffer.prototype.set.name?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var r=0;r<t.length;)e[n++]=t[r++]}},o.prototype.bytes=function(t){s.isString(t)&&(t=s._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(o.writeBytesBuffer,e,t),this},o.prototype.string=function(t){var e=s.Buffer.byteLength(t);return this.uint32(e),e&&this._push(i,e,t),this},o._configure()},662:(t,e)=>{"use strict";var n=e;n.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&"="===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var r=new Array(64),s=new Array(123),o=0;o<64;)s[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(t,e,n){for(var s,o=null,i=[],a=0,c=0;e<n;){var d=t[e++];switch(c){case 0:i[a++]=r[d>>2],s=(3&d)<<4,c=1;break;case 1:i[a++]=r[s|d>>4],s=(15&d)<<2,c=2;break;case 2:i[a++]=r[s|d>>6],i[a++]=r[63&d],c=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0)}return c&&(i[a++]=r[s],i[a++]=61,1===c&&(i[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))};var i="invalid encoding";n.decode=function(t,e,n){for(var r,o=n,a=0,c=0;c<t.length;){var d=t.charCodeAt(c++);if(61===d&&a>1)break;if(void 0===(d=s[d]))throw Error(i);switch(a){case 0:r=d,a=1;break;case 1:e[n++]=r<<2|(48&d)>>4,r=d,a=2;break;case 2:e[n++]=(15&r)<<4|(60&d)>>2,r=d,a=3;break;case 3:e[n++]=(3&r)<<6|d,a=0}}if(1===a)throw Error(i);return n-o},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},667:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}},673:t=>{"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var o={},i=[],a=0;a<t.length;a++){var c=t[a],d=r.base?c[0]+r.base:c[0],u=o[d]||0,l="".concat(d," ").concat(u);o[d]=u+1;var p=n(l),h={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)e[p].references++,e[p].updater(h);else{var f=s(h,r);r.byIndex=a,e.splice(a,0,{identifier:l,updater:f,references:1})}i.push(l)}return i}function s(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,s){var o=r(t=t||[],s=s||{});return function(t){t=t||[];for(var i=0;i<o.length;i++){var a=n(o[i]);e[a].references--}for(var c=r(t,s),d=0;d<o.length;d++){var u=n(o[d]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}o=c}}},696:t=>{"use strict";t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},707:t=>{"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],r=0;r<n.length;)n[r].fn===e?n.splice(r,1):++r;return this},e.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<e.length;)e[r].fn.apply(e[r++].ctx,n)}return this}},737:function(t,e,n){"use strict";var r=e;function s(t,e,n){for(var r=Object.keys(e),s=0;s<r.length;++s)void 0!==t[r[s]]&&n||(t[r[s]]=e[r[s]]);return t}function o(t){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&s(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}r.asPromise=n(310),r.base64=n(662),r.EventEmitter=n(707),r.float=n(365),r.inquire=n(230),r.utf8=n(742),r.pool=n(319),r.LongBits=n(130),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(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},r.isString=function(t){return"string"==typeof t||t instanceof String},r.isObject=function(t){return t&&"object"==typeof t},r.isset=r.isSet=function(t,e){var n=t[e];return!(null==n||!t.hasOwnProperty(e))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var t=r.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t){return"number"==typeof t?r.Buffer?r._Buffer_allocUnsafe(t):new r.Array(t):r.Buffer?r._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},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(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,e){var n=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))},r.merge=s,r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;n>-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},r.oneOfSetter=function(t){return function(e){for(var n=0;n<t.length;++n)t[n]!==e&&delete this[t[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var t=r.Buffer;t?(r._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,n){return new t(e,n)},r._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},742:(t,e)=>{"use strict";var n=e;n.length=function(t){for(var e=0,n=0,r=0;r<t.length;++r)(n=t.charCodeAt(r))<128?e+=1:n<2048?e+=2:55296==(64512&n)&&56320==(64512&t.charCodeAt(r+1))?(++r,e+=4):e+=3;return e},n.read=function(t,e,n){if(n-e<1)return"";for(var r,s=null,o=[],i=0;e<n;)(r=t[e++])<128?o[i++]=r:r>191&&r<224?o[i++]=(31&r)<<6|63&t[e++]:r>239&&r<365?(r=((7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,o[i++]=55296+(r>>10),o[i++]=56320+(1023&r)):o[i++]=(15&r)<<12|(63&t[e++])<<6|63&t[e++],i>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),i=0);return s?(i&&s.push(String.fromCharCode.apply(String,o.slice(0,i))),s.join("")):String.fromCharCode.apply(String,o.slice(0,i))},n.write=function(t,e,n){for(var r,s,o=n,i=0;i<t.length;++i)(r=t.charCodeAt(i))<128?e[n++]=r:r<2048?(e[n++]=r>>6|192,e[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(s=t.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&s),++i,e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128);return n-o}},782:(t,e,n)=>{t.exports=n(237)("./src/core.js")},783:(t,e,n)=>{t.exports=n(237)("./src/engine.js")},835:(t,e,n)=>{"use strict";var r=n(696),s=n(553),o=/^[\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(t){return(t||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(t,e){return m(e.protocol)?t.replace(/\\/g,"/"):t},["/","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(t){var e,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},s={},o=typeof(t=t||r);if("blob:"===t.protocol)s=new g(unescape(t.pathname),{});else if("string"===o)for(e in s=new g(t,{}),h)delete s[e];else if("object"===o){for(e in t)e in h||(s[e]=t[e]);void 0===s.slashes&&(s.slashes=a.test(t.href))}return s}function m(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function y(t,e){t=(t=l(t)).replace(i,""),e=e||{};var n,r=d.exec(t),s=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],c=0;return o?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:"===s?c>=2&&(n=n.slice(2)):m(s)?n=r[4]:s?o&&(n=n.slice(2)):c>=2&&m(e.protocol)&&(n=r[4]),{protocol:s,slashes:o||m(s),slashesCount:c,rest:n}}function g(t,e,n){if(t=(t=l(t)).replace(i,""),!(this instanceof g))return new g(t,e,n);var o,a,c,d,h,b,O=p.slice(),w=typeof e,I=this,v=0;for("object"!==w&&"string"!==w&&(n=e,e=null),n&&"function"!=typeof n&&(n=s.parse),o=!(a=y(t||"",e=f(e))).protocol&&!a.slashes,I.slashes=a.slashes||o&&e.slashes,I.protocol=a.protocol||e.protocol||"",t=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(I.protocol)))&&(O[3]=[/(.*)/,"pathname"]);v<O.length;v++)"function"!=typeof(d=O[v])?(c=d[0],b=d[1],c!=c?I[b]=t:"string"==typeof c?~(h="@"===c?t.lastIndexOf(c):t.indexOf(c))&&("number"==typeof d[2]?(I[b]=t.slice(0,h),t=t.slice(h+d[2])):(I[b]=t.slice(h),t=t.slice(0,h))):(h=c.exec(t))&&(I[b]=h[1],t=t.slice(0,h.index)),I[b]=I[b]||o&&d[3]&&e[b]||"",d[4]&&(I[b]=I[b].toLowerCase())):t=d(t,I);n&&(I.query=n(I.query)),o&&e.slashes&&"/"!==I.pathname.charAt(0)&&(""!==I.pathname||""!==e.pathname)&&(I.pathname=function(t,e){if(""===t)return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),r=n.length,s=n[r-1],o=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(o=!0),n.splice(r,1),i--);return o&&n.unshift(""),"."!==s&&".."!==s||n.push(""),n.join("/")}(I.pathname,e.pathname)),"/"!==I.pathname.charAt(0)&&m(I.protocol)&&(I.pathname="/"+I.pathname),r(I.port,I.protocol)||(I.host=I.hostname,I.port=""),I.username=I.password="",I.auth&&(~(h=I.auth.indexOf(":"))?(I.username=I.auth.slice(0,h),I.username=encodeURIComponent(decodeURIComponent(I.username)),I.password=I.auth.slice(h+1),I.password=encodeURIComponent(decodeURIComponent(I.password))):I.username=encodeURIComponent(decodeURIComponent(I.auth)),I.auth=I.password?I.username+":"+I.password:I.username),I.origin="file:"!==I.protocol&&m(I.protocol)&&I.host?I.protocol+"//"+I.host:"null",I.href=I.toString()}g.prototype={set:function(t,e,n){var o=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(n||s.parse)(e)),o[t]=e;break;case"port":o[t]=e,r(e,o.protocol)?e&&(o.host=o.hostname+":"+e):(o.host=o.hostname,o[t]="");break;case"hostname":o[t]=e,o.port&&(e+=":"+o.port),o.host=e;break;case"host":o[t]=e,c.test(e)?(e=e.split(":"),o.port=e.pop(),o.hostname=e.join(":")):(o.hostname=e,o.port="");break;case"protocol":o.protocol=e.toLowerCase(),o.slashes=!n;break;case"pathname":case"hash":if(e){var i="pathname"===t?"/":"#";o[t]=e.charAt(0)!==i?i+e:e}else o[t]=e;break;case"username":case"password":o[t]=encodeURIComponent(e);break;case"auth":var a=e.indexOf(":");~a?(o.username=e.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=e.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(e))}for(var d=0;d<p.length;d++){var u=p[d];u[4]&&(o[u[1]]=o[u[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&m(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(t){t&&"function"==typeof t||(t=s.stringify);var e,n=this,r=n.host,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(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,(e="object"==typeof n.query?t(n.query):n.query)&&(i+="?"!==e.charAt(0)?"?"+e:e),n.hash&&(i+=n.hash),i}},g.extractProtocol=y,g.location=f,g.trimLeft=l,g.qs=s,t.exports=g},895:(t,e,n)=>{"use strict";t.exports=o;var r=n(366);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(t){r.call(this,t)}o._configure=function(){s.Buffer&&(o.prototype._slice=s.Buffer.prototype.slice)},o.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},o._configure()},995:(t,e,n)=>{"use strict";var r=e;function s(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(6),r.BufferWriter=n(623),r.Reader=n(366),r.BufferReader=n(895),r.util=n(737),r.rpc=n(178),r.roots=n(156),r.configure=s,s()}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={id:t,exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var n in e)__webpack_require__.o(e,n)&&!__webpack_require__.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>Es,CloudServicesRevisionHistoryAdapter:()=>$s,CloudServicesTrackChangesAdapter:()=>Ms,PresenceList:()=>Lo,PresenceListUI:()=>Bo,RealTimeCollaborationClient:()=>ws,RealTimeCollaborativeComments:()=>Hs,RealTimeCollaborativeEditing:()=>As,RealTimeCollaborativeRevisionHistory:()=>ro,RealTimeCollaborativeTrackChanges:()=>Ks,Sessions:()=>Zn,WebSocketGateway:()=>zn});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{Decoder:()=>Dt,Encoder:()=>jt,PacketType:()=>Ct,protocol:()=>_t});var e=__webpack_require__(782),n=__webpack_require__(584),r=__webpack_require__(311),s=__webpack_require__(783);class o{static DESCRIPTOR_NAME;static DESCRIPTOR;constructor(...t){}}class i extends o{static TYPE="1000";static READABLE_TYPE_NAME;constructor(...t){super()}static fromJSON(t){throw new TypeError("Must be implemented in a child class!")}}class a extends i{id;static TYPE="21";static READABLE_TYPE_NAME="getUser";static DESCRIPTOR_NAME="GetUserMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1}}};constructor(t){super(),this.id=t}toJSON(){return{id:this.id}}static fromJSON(t){return new a(t.id)}}class c extends i{attributes;static DESCRIPTOR_NAME="GetUserResponse";static DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};constructor(t){super(),this.attributes=t}toJSON(){return{attributes:Object.keys(this.attributes).map(t=>({key:t,value:JSON.stringify(this.attributes[t])}))}}static fromJSON(t){const e=t.attributes.reduce((t,e)=>(t[e.key]=e.value?JSON.parse(e.value):null,t),{});return new c(e)}}var d=__webpack_require__(199);const u=(()=>{var t=d.Reader,e=d.Writer,n=d.util,r=d.roots.default||(d.roots.default={});return r.OperationMetadataDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.userId="",s.prototype.type="",s.prototype.createdAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.userId&&Object.hasOwnProperty.call(t,"userId")&&n.uint32(10).string(t.userId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(18).string(t.type),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(26).string(t.createdAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.OperationMetadataDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.userId=e.string();break;case 2:i.type=e.string();break;case 3:i.createdAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.userId&&t.hasOwnProperty("userId")&&!n.isString(t.userId)?"userId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null},s.fromObject=function(t){if(t instanceof r.OperationMetadataDescriptor)return t;var e=new r.OperationMetadataDescriptor;return null!=t.userId&&(e.userId=String(t.userId)),null!=t.type&&(e.type=String(t.type)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.userId="",n.type="",n.createdAt=""),null!=t.userId&&t.hasOwnProperty("userId")&&(n.userId=t.userId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/OperationMetadataDescriptor"},s}(),r.CollaborativeEditingConnectMessage=function(){function s(t){if(this.buffers=[],this.types=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.lastOperationId="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.bundleVersion&&Object.hasOwnProperty.call(t,"bundleVersion")&&n.uint32(18).string(t.bundleVersion),null!=t.buffers&&t.buffers.length)for(var r=0;r<t.buffers.length;++r)n.uint32(26).bytes(t.buffers[r]);if(null!=t.types&&t.types.length){for(n.uint32(34).fork(),r=0;r<t.types.length;++r)n.uint32(t.types[r]);n.ldelim()}return null!=t.lastOperationId&&Object.hasOwnProperty.call(t,"lastOperationId")&&n.uint32(42).string(t.lastOperationId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.bundleVersion=e.string();break;case 3:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(e.bytes());break;case 4:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=e.uint32()+e.pos;e.pos<c;)i.types.push(e.uint32());else i.types.push(e.uint32());break;case 5:i.lastOperationId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id))return"id: string expected";if(null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&!n.isString(t.bundleVersion))return"bundleVersion: string expected";if(null!=t.buffers&&t.hasOwnProperty("buffers")){if(!Array.isArray(t.buffers))return"buffers: array expected";for(var e=0;e<t.buffers.length;++e)if(!(t.buffers[e]&&"number"==typeof t.buffers[e].length||n.isString(t.buffers[e])))return"buffers: buffer[] expected"}if(null!=t.types&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(e=0;e<t.types.length;++e)if(!n.isInteger(t.types[e]))return"types: integer[] expected"}return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&!n.isString(t.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingConnectMessage)return t;var e=new r.CollaborativeEditingConnectMessage;if(null!=t.id&&(e.id=String(t.id)),null!=t.bundleVersion&&(e.bundleVersion=String(t.bundleVersion)),t.buffers){if(!Array.isArray(t.buffers))throw TypeError(".CollaborativeEditingConnectMessage.buffers: array expected");e.buffers=[];for(var s=0;s<t.buffers.length;++s)"string"==typeof t.buffers[s]?n.base64.decode(t.buffers[s],e.buffers[s]=n.newBuffer(n.base64.length(t.buffers[s])),0):t.buffers[s].length>=0&&(e.buffers[s]=t.buffers[s])}if(t.types){if(!Array.isArray(t.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");for(e.types=[],s=0;s<t.types.length;++s)e.types[s]=t.types[s]>>>0}return null!=t.lastOperationId&&(e.lastOperationId=String(t.lastOperationId)),e},s.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.buffers=[],r.types=[]),e.defaults&&(r.id="",r.bundleVersion="",r.lastOperationId=""),null!=t.id&&t.hasOwnProperty("id")&&(r.id=t.id),null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&(r.bundleVersion=t.bundleVersion),t.buffers&&t.buffers.length){r.buffers=[];for(var s=0;s<t.buffers.length;++s)r.buffers[s]=e.bytes===String?n.base64.encode(t.buffers[s],0,t.buffers[s].length):e.bytes===Array?Array.prototype.slice.call(t.buffers[s]):t.buffers[s]}if(t.types&&t.types.length)for(r.types=[],s=0;s<t.types.length;++s)r.types[s]=t.types[s];return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&(r.lastOperationId=t.lastOperationId),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingConnectMessage"},s}(),r.CollaborativeEditingReconnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.bundleVersion="",s.prototype.lastKnowVersion=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.bundleVersion&&Object.hasOwnProperty.call(t,"bundleVersion")&&n.uint32(18).string(t.bundleVersion),null!=t.lastKnowVersion&&Object.hasOwnProperty.call(t,"lastKnowVersion")&&n.uint32(24).uint32(t.lastKnowVersion),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingReconnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.bundleVersion=e.string();break;case 3:i.lastKnowVersion=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&!n.isString(t.bundleVersion)?"bundleVersion: string expected":null!=t.lastKnowVersion&&t.hasOwnProperty("lastKnowVersion")&&!n.isInteger(t.lastKnowVersion)?"lastKnowVersion: integer expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingReconnectMessage)return t;var e=new r.CollaborativeEditingReconnectMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.bundleVersion&&(e.bundleVersion=String(t.bundleVersion)),null!=t.lastKnowVersion&&(e.lastKnowVersion=t.lastKnowVersion>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.bundleVersion="",n.lastKnowVersion=0),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&(n.bundleVersion=t.bundleVersion),null!=t.lastKnowVersion&&t.hasOwnProperty("lastKnowVersion")&&(n.lastKnowVersion=t.lastKnowVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingReconnectMessage"},s}(),r.CollaborativeEditingUpdateMessage=function(){function s(t){if(this.buffers=[],this.types=[],this.metadata=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.baseVersion=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.lastOperationId="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.baseVersion&&Object.hasOwnProperty.call(t,"baseVersion")&&n.uint32(16).uint32(t.baseVersion),null!=t.buffers&&t.buffers.length)for(var s=0;s<t.buffers.length;++s)n.uint32(26).bytes(t.buffers[s]);if(null!=t.types&&t.types.length){for(n.uint32(34).fork(),s=0;s<t.types.length;++s)n.uint32(t.types[s]);n.ldelim()}if(null!=t.metadata&&t.metadata.length)for(s=0;s<t.metadata.length;++s)r.OperationMetadataDescriptor.encode(t.metadata[s],n.uint32(50).fork()).ldelim();return null!=t.lastOperationId&&Object.hasOwnProperty.call(t,"lastOperationId")&&n.uint32(58).string(t.lastOperationId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingUpdateMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.baseVersion=e.uint32();break;case 3:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(e.bytes());break;case 4:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=e.uint32()+e.pos;e.pos<c;)i.types.push(e.uint32());else i.types.push(e.uint32());break;case 6:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:i.lastOperationId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id))return"id: string expected";if(null!=t.baseVersion&&t.hasOwnProperty("baseVersion")&&!n.isInteger(t.baseVersion))return"baseVersion: integer expected";if(null!=t.buffers&&t.hasOwnProperty("buffers")){if(!Array.isArray(t.buffers))return"buffers: array expected";for(var e=0;e<t.buffers.length;++e)if(!(t.buffers[e]&&"number"==typeof t.buffers[e].length||n.isString(t.buffers[e])))return"buffers: buffer[] expected"}if(null!=t.types&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(e=0;e<t.types.length;++e)if(!n.isInteger(t.types[e]))return"types: integer[] expected"}if(null!=t.metadata&&t.hasOwnProperty("metadata")){if(!Array.isArray(t.metadata))return"metadata: array expected";for(e=0;e<t.metadata.length;++e){var s=r.OperationMetadataDescriptor.verify(t.metadata[e]);if(s)return"metadata."+s}}return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&!n.isString(t.lastOperationId)?"lastOperationId: string expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingUpdateMessage)return t;var e=new r.CollaborativeEditingUpdateMessage;if(null!=t.id&&(e.id=String(t.id)),null!=t.baseVersion&&(e.baseVersion=t.baseVersion>>>0),t.buffers){if(!Array.isArray(t.buffers))throw TypeError(".CollaborativeEditingUpdateMessage.buffers: array expected");e.buffers=[];for(var s=0;s<t.buffers.length;++s)"string"==typeof t.buffers[s]?n.base64.decode(t.buffers[s],e.buffers[s]=n.newBuffer(n.base64.length(t.buffers[s])),0):t.buffers[s].length>=0&&(e.buffers[s]=t.buffers[s])}if(t.types){if(!Array.isArray(t.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");for(e.types=[],s=0;s<t.types.length;++s)e.types[s]=t.types[s]>>>0}if(t.metadata){if(!Array.isArray(t.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");for(e.metadata=[],s=0;s<t.metadata.length;++s){if("object"!=typeof t.metadata[s])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");e.metadata[s]=r.OperationMetadataDescriptor.fromObject(t.metadata[s])}}return null!=t.lastOperationId&&(e.lastOperationId=String(t.lastOperationId)),e},s.toObject=function(t,e){e||(e={});var s={};if((e.arrays||e.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),e.defaults&&(s.id="",s.baseVersion=0,s.lastOperationId=""),null!=t.id&&t.hasOwnProperty("id")&&(s.id=t.id),null!=t.baseVersion&&t.hasOwnProperty("baseVersion")&&(s.baseVersion=t.baseVersion),t.buffers&&t.buffers.length){s.buffers=[];for(var o=0;o<t.buffers.length;++o)s.buffers[o]=e.bytes===String?n.base64.encode(t.buffers[o],0,t.buffers[o].length):e.bytes===Array?Array.prototype.slice.call(t.buffers[o]):t.buffers[o]}if(t.types&&t.types.length)for(s.types=[],o=0;o<t.types.length;++o)s.types[o]=t.types[o];if(t.metadata&&t.metadata.length)for(s.metadata=[],o=0;o<t.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(t.metadata[o],e);return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&(s.lastOperationId=t.lastOperationId),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingUpdateMessage"},s}(),r.GetDocumentDetailsMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.prototype.environmentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.environmentId&&Object.hasOwnProperty.call(t,"environmentId")&&n.uint32(18).string(t.environmentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetDocumentDetailsMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.environmentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.environmentId&&t.hasOwnProperty("environmentId")&&!n.isString(t.environmentId)?"environmentId: string expected":null},s.fromObject=function(t){if(t instanceof r.GetDocumentDetailsMessage)return t;var e=new r.GetDocumentDetailsMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.environmentId&&(e.environmentId=String(t.environmentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId="",n.environmentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.environmentId&&t.hasOwnProperty("environmentId")&&(n.environmentId=t.environmentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetDocumentDetailsMessage"},s}(),r.CollaborativeEditingConnectResponse=function(){function s(t){if(this.buffers=[],this.types=[],this.metadata=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.offset=0,s.prototype.version=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.initData="",s.prototype.isInitialized=!1,s.prototype.sessionId="",s.prototype.lastOperationId="",s.prototype.sessionCreatedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.offset&&Object.hasOwnProperty.call(t,"offset")&&n.uint32(16).uint32(t.offset),null!=t.version&&Object.hasOwnProperty.call(t,"version")&&n.uint32(24).uint32(t.version),null!=t.buffers&&t.buffers.length)for(var s=0;s<t.buffers.length;++s)n.uint32(34).bytes(t.buffers[s]);if(null!=t.types&&t.types.length){for(n.uint32(42).fork(),s=0;s<t.types.length;++s)n.uint32(t.types[s]);n.ldelim()}if(null!=t.metadata&&t.metadata.length)for(s=0;s<t.metadata.length;++s)r.OperationMetadataDescriptor.encode(t.metadata[s],n.uint32(58).fork()).ldelim();return null!=t.initData&&Object.hasOwnProperty.call(t,"initData")&&n.uint32(66).string(t.initData),null!=t.isInitialized&&Object.hasOwnProperty.call(t,"isInitialized")&&n.uint32(72).bool(t.isInitialized),null!=t.sessionId&&Object.hasOwnProperty.call(t,"sessionId")&&n.uint32(82).string(t.sessionId),null!=t.lastOperationId&&Object.hasOwnProperty.call(t,"lastOperationId")&&n.uint32(90).string(t.lastOperationId),null!=t.sessionCreatedAt&&Object.hasOwnProperty.call(t,"sessionCreatedAt")&&n.uint32(98).string(t.sessionCreatedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.offset=e.uint32();break;case 3:i.version=e.uint32();break;case 4:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(e.bytes());break;case 5:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=e.uint32()+e.pos;e.pos<c;)i.types.push(e.uint32());else i.types.push(e.uint32());break;case 7:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:i.initData=e.string();break;case 9:i.isInitialized=e.bool();break;case 10:i.sessionId=e.string();break;case 11:i.lastOperationId=e.string();break;case 12:i.sessionCreatedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.offset&&t.hasOwnProperty("offset")&&!n.isInteger(t.offset))return"offset: integer expected";if(null!=t.version&&t.hasOwnProperty("version")&&!n.isInteger(t.version))return"version: integer expected";if(null!=t.buffers&&t.hasOwnProperty("buffers")){if(!Array.isArray(t.buffers))return"buffers: array expected";for(var e=0;e<t.buffers.length;++e)if(!(t.buffers[e]&&"number"==typeof t.buffers[e].length||n.isString(t.buffers[e])))return"buffers: buffer[] expected"}if(null!=t.types&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(e=0;e<t.types.length;++e)if(!n.isInteger(t.types[e]))return"types: integer[] expected"}if(null!=t.metadata&&t.hasOwnProperty("metadata")){if(!Array.isArray(t.metadata))return"metadata: array expected";for(e=0;e<t.metadata.length;++e){var s=r.OperationMetadataDescriptor.verify(t.metadata[e]);if(s)return"metadata."+s}}return null!=t.initData&&t.hasOwnProperty("initData")&&!n.isString(t.initData)?"initData: string expected":null!=t.isInitialized&&t.hasOwnProperty("isInitialized")&&"boolean"!=typeof t.isInitialized?"isInitialized: boolean expected":null!=t.sessionId&&t.hasOwnProperty("sessionId")&&!n.isString(t.sessionId)?"sessionId: string expected":null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&!n.isString(t.lastOperationId)?"lastOperationId: string expected":null!=t.sessionCreatedAt&&t.hasOwnProperty("sessionCreatedAt")&&!n.isString(t.sessionCreatedAt)?"sessionCreatedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingConnectResponse)return t;var e=new r.CollaborativeEditingConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),null!=t.offset&&(e.offset=t.offset>>>0),null!=t.version&&(e.version=t.version>>>0),t.buffers){if(!Array.isArray(t.buffers))throw TypeError(".CollaborativeEditingConnectResponse.buffers: array expected");e.buffers=[];for(var s=0;s<t.buffers.length;++s)"string"==typeof t.buffers[s]?n.base64.decode(t.buffers[s],e.buffers[s]=n.newBuffer(n.base64.length(t.buffers[s])),0):t.buffers[s].length>=0&&(e.buffers[s]=t.buffers[s])}if(t.types){if(!Array.isArray(t.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");for(e.types=[],s=0;s<t.types.length;++s)e.types[s]=t.types[s]>>>0}if(t.metadata){if(!Array.isArray(t.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");for(e.metadata=[],s=0;s<t.metadata.length;++s){if("object"!=typeof t.metadata[s])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");e.metadata[s]=r.OperationMetadataDescriptor.fromObject(t.metadata[s])}}return null!=t.initData&&(e.initData=String(t.initData)),null!=t.isInitialized&&(e.isInitialized=Boolean(t.isInitialized)),null!=t.sessionId&&(e.sessionId=String(t.sessionId)),null!=t.lastOperationId&&(e.lastOperationId=String(t.lastOperationId)),null!=t.sessionCreatedAt&&(e.sessionCreatedAt=String(t.sessionCreatedAt)),e},s.toObject=function(t,e){e||(e={});var s={};if((e.arrays||e.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),e.defaults&&(s.channel="",s.offset=0,s.version=0,s.initData="",s.isInitialized=!1,s.sessionId="",s.lastOperationId="",s.sessionCreatedAt=""),null!=t.channel&&t.hasOwnProperty("channel")&&(s.channel=t.channel),null!=t.offset&&t.hasOwnProperty("offset")&&(s.offset=t.offset),null!=t.version&&t.hasOwnProperty("version")&&(s.version=t.version),t.buffers&&t.buffers.length){s.buffers=[];for(var o=0;o<t.buffers.length;++o)s.buffers[o]=e.bytes===String?n.base64.encode(t.buffers[o],0,t.buffers[o].length):e.bytes===Array?Array.prototype.slice.call(t.buffers[o]):t.buffers[o]}if(t.types&&t.types.length)for(s.types=[],o=0;o<t.types.length;++o)s.types[o]=t.types[o];if(t.metadata&&t.metadata.length)for(s.metadata=[],o=0;o<t.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(t.metadata[o],e);return null!=t.initData&&t.hasOwnProperty("initData")&&(s.initData=t.initData),null!=t.isInitialized&&t.hasOwnProperty("isInitialized")&&(s.isInitialized=t.isInitialized),null!=t.sessionId&&t.hasOwnProperty("sessionId")&&(s.sessionId=t.sessionId),null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&(s.lastOperationId=t.lastOperationId),null!=t.sessionCreatedAt&&t.hasOwnProperty("sessionCreatedAt")&&(s.sessionCreatedAt=t.sessionCreatedAt),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingConnectResponse"},s}(),r.CollaborativeEditingResponse=function(){function s(t){if(this.buffers=[],this.types=[],this.metadata=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.version=0,s.prototype.buffers=n.emptyArray,s.prototype.types=n.emptyArray,s.prototype.metadata=n.emptyArray,s.prototype.lastOperationId="",s.prototype.lastOperationAcceptedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.version&&Object.hasOwnProperty.call(t,"version")&&n.uint32(8).uint32(t.version),null!=t.buffers&&t.buffers.length)for(var s=0;s<t.buffers.length;++s)n.uint32(18).bytes(t.buffers[s]);if(null!=t.types&&t.types.length){for(n.uint32(26).fork(),s=0;s<t.types.length;++s)n.uint32(t.types[s]);n.ldelim()}if(null!=t.metadata&&t.metadata.length)for(s=0;s<t.metadata.length;++s)r.OperationMetadataDescriptor.encode(t.metadata[s],n.uint32(42).fork()).ldelim();return null!=t.lastOperationId&&Object.hasOwnProperty.call(t,"lastOperationId")&&n.uint32(50).string(t.lastOperationId),null!=t.lastOperationAcceptedAt&&Object.hasOwnProperty.call(t,"lastOperationAcceptedAt")&&n.uint32(58).string(t.lastOperationAcceptedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CollaborativeEditingResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.version=e.uint32();break;case 2:i.buffers&&i.buffers.length||(i.buffers=[]),i.buffers.push(e.bytes());break;case 3:if(i.types&&i.types.length||(i.types=[]),2==(7&a))for(var c=e.uint32()+e.pos;e.pos<c;)i.types.push(e.uint32());else i.types.push(e.uint32());break;case 5:i.metadata&&i.metadata.length||(i.metadata=[]),i.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:i.lastOperationId=e.string();break;case 7:i.lastOperationAcceptedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.version&&t.hasOwnProperty("version")&&!n.isInteger(t.version))return"version: integer expected";if(null!=t.buffers&&t.hasOwnProperty("buffers")){if(!Array.isArray(t.buffers))return"buffers: array expected";for(var e=0;e<t.buffers.length;++e)if(!(t.buffers[e]&&"number"==typeof t.buffers[e].length||n.isString(t.buffers[e])))return"buffers: buffer[] expected"}if(null!=t.types&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(e=0;e<t.types.length;++e)if(!n.isInteger(t.types[e]))return"types: integer[] expected"}if(null!=t.metadata&&t.hasOwnProperty("metadata")){if(!Array.isArray(t.metadata))return"metadata: array expected";for(e=0;e<t.metadata.length;++e){var s=r.OperationMetadataDescriptor.verify(t.metadata[e]);if(s)return"metadata."+s}}return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&!n.isString(t.lastOperationId)?"lastOperationId: string expected":null!=t.lastOperationAcceptedAt&&t.hasOwnProperty("lastOperationAcceptedAt")&&!n.isString(t.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CollaborativeEditingResponse)return t;var e=new r.CollaborativeEditingResponse;if(null!=t.version&&(e.version=t.version>>>0),t.buffers){if(!Array.isArray(t.buffers))throw TypeError(".CollaborativeEditingResponse.buffers: array expected");e.buffers=[];for(var s=0;s<t.buffers.length;++s)"string"==typeof t.buffers[s]?n.base64.decode(t.buffers[s],e.buffers[s]=n.newBuffer(n.base64.length(t.buffers[s])),0):t.buffers[s].length>=0&&(e.buffers[s]=t.buffers[s])}if(t.types){if(!Array.isArray(t.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");for(e.types=[],s=0;s<t.types.length;++s)e.types[s]=t.types[s]>>>0}if(t.metadata){if(!Array.isArray(t.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");for(e.metadata=[],s=0;s<t.metadata.length;++s){if("object"!=typeof t.metadata[s])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");e.metadata[s]=r.OperationMetadataDescriptor.fromObject(t.metadata[s])}}return null!=t.lastOperationId&&(e.lastOperationId=String(t.lastOperationId)),null!=t.lastOperationAcceptedAt&&(e.lastOperationAcceptedAt=String(t.lastOperationAcceptedAt)),e},s.toObject=function(t,e){e||(e={});var s={};if((e.arrays||e.defaults)&&(s.buffers=[],s.types=[],s.metadata=[]),e.defaults&&(s.version=0,s.lastOperationId="",s.lastOperationAcceptedAt=""),null!=t.version&&t.hasOwnProperty("version")&&(s.version=t.version),t.buffers&&t.buffers.length){s.buffers=[];for(var o=0;o<t.buffers.length;++o)s.buffers[o]=e.bytes===String?n.base64.encode(t.buffers[o],0,t.buffers[o].length):e.bytes===Array?Array.prototype.slice.call(t.buffers[o]):t.buffers[o]}if(t.types&&t.types.length)for(s.types=[],o=0;o<t.types.length;++o)s.types[o]=t.types[o];if(t.metadata&&t.metadata.length)for(s.metadata=[],o=0;o<t.metadata.length;++o)s.metadata[o]=r.OperationMetadataDescriptor.toObject(t.metadata[o],e);return null!=t.lastOperationId&&t.hasOwnProperty("lastOperationId")&&(s.lastOperationId=t.lastOperationId),null!=t.lastOperationAcceptedAt&&t.hasOwnProperty("lastOperationAcceptedAt")&&(s.lastOperationAcceptedAt=t.lastOperationAcceptedAt),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CollaborativeEditingResponse"},s}(),r.GetDocumentDetailsResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.lastDocumentSessionId="",s.prototype.lastDocumentSessionOperationId="",s.prototype.currentDocumentSessionId="",s.prototype.currentDocumentSessionVersion=0,s.prototype.currentDocumentSessionOperationId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.lastDocumentSessionId&&Object.hasOwnProperty.call(t,"lastDocumentSessionId")&&n.uint32(10).string(t.lastDocumentSessionId),null!=t.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(t,"lastDocumentSessionOperationId")&&n.uint32(18).string(t.lastDocumentSessionOperationId),null!=t.currentDocumentSessionId&&Object.hasOwnProperty.call(t,"currentDocumentSessionId")&&n.uint32(26).string(t.currentDocumentSessionId),null!=t.currentDocumentSessionVersion&&Object.hasOwnProperty.call(t,"currentDocumentSessionVersion")&&n.uint32(32).uint32(t.currentDocumentSessionVersion),null!=t.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(t,"currentDocumentSessionOperationId")&&n.uint32(42).string(t.currentDocumentSessionOperationId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetDocumentDetailsResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.lastDocumentSessionId=e.string();break;case 2:i.lastDocumentSessionOperationId=e.string();break;case 3:i.currentDocumentSessionId=e.string();break;case 4:i.currentDocumentSessionVersion=e.uint32();break;case 5:i.currentDocumentSessionOperationId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.lastDocumentSessionId&&t.hasOwnProperty("lastDocumentSessionId")&&!n.isString(t.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=t.lastDocumentSessionOperationId&&t.hasOwnProperty("lastDocumentSessionOperationId")&&!n.isString(t.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=t.currentDocumentSessionId&&t.hasOwnProperty("currentDocumentSessionId")&&!n.isString(t.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=t.currentDocumentSessionVersion&&t.hasOwnProperty("currentDocumentSessionVersion")&&!n.isInteger(t.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=t.currentDocumentSessionOperationId&&t.hasOwnProperty("currentDocumentSessionOperationId")&&!n.isString(t.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},s.fromObject=function(t){if(t instanceof r.GetDocumentDetailsResponse)return t;var e=new r.GetDocumentDetailsResponse;return null!=t.lastDocumentSessionId&&(e.lastDocumentSessionId=String(t.lastDocumentSessionId)),null!=t.lastDocumentSessionOperationId&&(e.lastDocumentSessionOperationId=String(t.lastDocumentSessionOperationId)),null!=t.currentDocumentSessionId&&(e.currentDocumentSessionId=String(t.currentDocumentSessionId)),null!=t.currentDocumentSessionVersion&&(e.currentDocumentSessionVersion=t.currentDocumentSessionVersion>>>0),null!=t.currentDocumentSessionOperationId&&(e.currentDocumentSessionOperationId=String(t.currentDocumentSessionOperationId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.lastDocumentSessionId="",n.lastDocumentSessionOperationId="",n.currentDocumentSessionId="",n.currentDocumentSessionVersion=0,n.currentDocumentSessionOperationId=""),null!=t.lastDocumentSessionId&&t.hasOwnProperty("lastDocumentSessionId")&&(n.lastDocumentSessionId=t.lastDocumentSessionId),null!=t.lastDocumentSessionOperationId&&t.hasOwnProperty("lastDocumentSessionOperationId")&&(n.lastDocumentSessionOperationId=t.lastDocumentSessionOperationId),null!=t.currentDocumentSessionId&&t.hasOwnProperty("currentDocumentSessionId")&&(n.currentDocumentSessionId=t.currentDocumentSessionId),null!=t.currentDocumentSessionVersion&&t.hasOwnProperty("currentDocumentSessionVersion")&&(n.currentDocumentSessionVersion=t.currentDocumentSessionVersion),null!=t.currentDocumentSessionOperationId&&t.hasOwnProperty("currentDocumentSessionOperationId")&&(n.currentDocumentSessionOperationId=t.currentDocumentSessionOperationId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetDocumentDetailsResponse"},s}(),r.CommentDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(10).string(t.commentId),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(18).string(t.commentThreadId),null!=t.userId&&Object.hasOwnProperty.call(t,"userId")&&n.uint32(26).string(t.userId),null!=t.content&&Object.hasOwnProperty.call(t,"content")&&n.uint32(34).string(t.content),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(42).string(t.documentId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(50).string(t.createdAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentId=e.string();break;case 2:i.commentThreadId=e.string();break;case 3:i.userId=e.string();break;case 4:i.content=e.string();break;case 5:i.documentId=e.string();break;case 6:i.createdAt=e.string();break;case 7:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId)?"commentId: string expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.userId&&t.hasOwnProperty("userId")&&!n.isString(t.userId)?"userId: string expected":null!=t.content&&t.hasOwnProperty("content")&&!n.isString(t.content)?"content: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentDescriptor)return t;var e=new r.CommentDescriptor;return null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.userId&&(e.userId=String(t.userId)),null!=t.content&&(e.content=String(t.content)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentId="",n.commentThreadId="",n.userId="",n.content="",n.documentId="",n.createdAt="",n.attributes=""),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.userId&&t.hasOwnProperty("userId")&&(n.userId=t.userId),null!=t.content&&t.hasOwnProperty("content")&&(n.content=t.content),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentDescriptor"},s}(),r.CommentsThreadDescriptor=function(){function s(t){if(this.comments=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.comments=n.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.comments&&t.comments.length)for(var s=0;s<t.comments.length;++s)r.CommentDescriptor.encode(t.comments[s],n.uint32(18).fork()).ldelim();return null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(26).string(t.resolvedAt),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(34).string(t.resolvedBy),null!=t.context&&Object.hasOwnProperty.call(t,"context")&&n.uint32(42).string(t.context),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(50).string(t.createdAt),null!=t.deletedAt&&Object.hasOwnProperty.call(t,"deletedAt")&&n.uint32(58).string(t.deletedAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(66).string(t.attributes),null!=t.unlinkedAt&&Object.hasOwnProperty.call(t,"unlinkedAt")&&n.uint32(74).string(t.unlinkedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsThreadDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentDescriptor.decode(e,e.uint32()));break;case 3:i.resolvedAt=e.string();break;case 4:i.resolvedBy=e.string();break;case 5:i.context=e.string();break;case 6:i.createdAt=e.string();break;case 7:i.deletedAt=e.string();break;case 8:i.attributes=e.string();break;case 9:i.unlinkedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.comments&&t.hasOwnProperty("comments")){if(!Array.isArray(t.comments))return"comments: array expected";for(var e=0;e<t.comments.length;++e){var s=r.CommentDescriptor.verify(t.comments[e]);if(s)return"comments."+s}}return null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt)?"resolvedAt: string expected":null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy)?"resolvedBy: string expected":null!=t.context&&t.hasOwnProperty("context")&&!n.isString(t.context)?"context: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&!n.isString(t.deletedAt)?"deletedAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&!n.isString(t.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsThreadDescriptor)return t;var e=new r.CommentsThreadDescriptor;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),t.comments){if(!Array.isArray(t.comments))throw TypeError(".CommentsThreadDescriptor.comments: array expected");e.comments=[];for(var n=0;n<t.comments.length;++n){if("object"!=typeof t.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");e.comments[n]=r.CommentDescriptor.fromObject(t.comments[n])}}return null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),null!=t.context&&(e.context=String(t.context)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.deletedAt&&(e.deletedAt=String(t.deletedAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.unlinkedAt&&(e.unlinkedAt=String(t.unlinkedAt)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.comments=[]),e.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),t.comments&&t.comments.length){n.comments=[];for(var s=0;s<t.comments.length;++s)n.comments[s]=r.CommentDescriptor.toObject(t.comments[s],e)}return null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),null!=t.context&&t.hasOwnProperty("context")&&(n.context=t.context),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&(n.deletedAt=t.deletedAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=t.unlinkedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsThreadDescriptor"},s}(),r.CommentThreadAddedCommentDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentId="",s.prototype.createdAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(10).string(t.commentId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(18).string(t.createdAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentThreadAddedCommentDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentId=e.string();break;case 2:i.createdAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId)?"commentId: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentThreadAddedCommentDescriptor)return t;var e=new r.CommentThreadAddedCommentDescriptor;return null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentId="",n.createdAt=""),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentThreadAddedCommentDescriptor"},s}(),r.CommentsV2AddCommentMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.content&&Object.hasOwnProperty.call(t,"content")&&n.uint32(18).string(t.content),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(26).string(t.documentId),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(34).string(t.commentId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(42).string(t.createdAt),null!=t.userId&&Object.hasOwnProperty.call(t,"userId")&&n.uint32(50).string(t.userId),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),null!=t.commentThread&&Object.hasOwnProperty.call(t,"commentThread")&&r.CommentsThreadDescriptor.encode(t.commentThread,n.uint32(66).fork()).ldelim(),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2AddCommentMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.content=e.string();break;case 3:i.documentId=e.string();break;case 4:i.commentId=e.string();break;case 5:i.createdAt=e.string();break;case 6:i.userId=e.string();break;case 7:i.attributes=e.string();break;case 8:i.commentThread=r.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.content&&t.hasOwnProperty("content")&&!n.isString(t.content))return"content: string expected";if(null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId))return"documentId: string expected";if(null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId))return"commentId: string expected";if(null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt))return"createdAt: string expected";if(null!=t.userId&&t.hasOwnProperty("userId")&&!n.isString(t.userId))return"userId: string expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes))return"attributes: string expected";if(null!=t.commentThread&&t.hasOwnProperty("commentThread")){var e=r.CommentsThreadDescriptor.verify(t.commentThread);if(e)return"commentThread."+e}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2AddCommentMessage)return t;var e=new r.CommentsV2AddCommentMessage;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.content&&(e.content=String(t.content)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.userId&&(e.userId=String(t.userId)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.commentThread){if("object"!=typeof t.commentThread)throw TypeError(".CommentsV2AddCommentMessage.commentThread: object expected");e.commentThread=r.CommentsThreadDescriptor.fromObject(t.commentThread)}return e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.content="",n.documentId="",n.commentId="",n.createdAt="",n.userId="",n.attributes="",n.commentThread=null),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.content&&t.hasOwnProperty("content")&&(n.content=t.content),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.userId&&t.hasOwnProperty("userId")&&(n.userId=t.userId),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.commentThread&&t.hasOwnProperty("commentThread")&&(n.commentThread=r.CommentsThreadDescriptor.toObject(t.commentThread,e)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2AddCommentMessage"},s}(),r.CommentsV2AddCommentThreadMessage=function(){function s(t){if(this.comments=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(18).string(t.commentThreadId),null!=t.context&&Object.hasOwnProperty.call(t,"context")&&n.uint32(26).string(t.context),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(34).string(t.createdAt),null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(42).string(t.resolvedAt),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(50).string(t.resolvedBy),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),null!=t.deletedAt&&Object.hasOwnProperty.call(t,"deletedAt")&&n.uint32(66).string(t.deletedAt),null!=t.comments&&t.comments.length)for(var s=0;s<t.comments.length;++s)r.CommentDescriptor.encode(t.comments[s],n.uint32(74).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2AddCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.commentThreadId=e.string();break;case 3:i.context=e.string();break;case 4:i.createdAt=e.string();break;case 5:i.resolvedAt=e.string();break;case 6:i.resolvedBy=e.string();break;case 7:i.attributes=e.string();break;case 8:i.deletedAt=e.string();break;case 9:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId))return"documentId: string expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.context&&t.hasOwnProperty("context")&&!n.isString(t.context))return"context: string expected";if(null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt))return"createdAt: string expected";if(null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt))return"resolvedAt: string expected";if(null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy))return"resolvedBy: string expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes))return"attributes: string expected";if(null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&!n.isString(t.deletedAt))return"deletedAt: string expected";if(null!=t.comments&&t.hasOwnProperty("comments")){if(!Array.isArray(t.comments))return"comments: array expected";for(var e=0;e<t.comments.length;++e){var s=r.CommentDescriptor.verify(t.comments[e]);if(s)return"comments."+s}}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2AddCommentThreadMessage)return t;var e=new r.CommentsV2AddCommentThreadMessage;if(null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.context&&(e.context=String(t.context)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.deletedAt&&(e.deletedAt=String(t.deletedAt)),t.comments){if(!Array.isArray(t.comments))throw TypeError(".CommentsV2AddCommentThreadMessage.comments: array expected");e.comments=[];for(var n=0;n<t.comments.length;++n){if("object"!=typeof t.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");e.comments[n]=r.CommentDescriptor.fromObject(t.comments[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.comments=[]),e.defaults&&(n.documentId="",n.commentThreadId="",n.context="",n.createdAt="",n.resolvedAt="",n.resolvedBy="",n.attributes="",n.deletedAt=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.context&&t.hasOwnProperty("context")&&(n.context=t.context),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&(n.deletedAt=t.deletedAt),t.comments&&t.comments.length){n.comments=[];for(var s=0;s<t.comments.length;++s)n.comments[s]=r.CommentDescriptor.toObject(t.comments[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2AddCommentThreadMessage"},s}(),r.CommentsV2ReopenCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ReopenCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2ReopenCommentThreadMessage)return t;var e=new r.CommentsV2ReopenCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ReopenCommentThreadMessage"},s}(),r.CommentsV2ResolveCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedBy="",s.prototype.resolvedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(26).string(t.resolvedBy),null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(34).string(t.resolvedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ResolveCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;case 3:i.resolvedBy=e.string();break;case 4:i.resolvedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy)?"resolvedBy: string expected":null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt)?"resolvedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2ResolveCommentThreadMessage)return t;var e=new r.CommentsV2ResolveCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedBy="",n.resolvedAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ResolveCommentThreadMessage"},s}(),r.CommentsV2UpdateCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.context="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.context&&Object.hasOwnProperty.call(t,"context")&&n.uint32(26).string(t.context),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(34).string(t.attributes),null!=t.unlinkedAt&&Object.hasOwnProperty.call(t,"unlinkedAt")&&n.uint32(42).string(t.unlinkedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2UpdateCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;case 3:i.context=e.string();break;case 4:i.attributes=e.string();break;case 5:i.unlinkedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.context&&t.hasOwnProperty("context")&&!n.isString(t.context)?"context: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&!n.isString(t.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2UpdateCommentThreadMessage)return t;var e=new r.CommentsV2UpdateCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.context&&(e.context=String(t.context)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.unlinkedAt&&(e.unlinkedAt=String(t.unlinkedAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId="",n.context="",n.attributes="",n.unlinkedAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.context&&t.hasOwnProperty("context")&&(n.context=t.context),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=t.unlinkedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2UpdateCommentThreadMessage"},s}(),r.CommentsV2ConnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2ConnectMessage)return t;var e=new r.CommentsV2ConnectMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ConnectMessage"},s}(),r.CommentsV2GetCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2GetCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2GetCommentThreadMessage)return t;var e=new r.CommentsV2GetCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2GetCommentThreadMessage"},s}(),r.CommentsV2GetDocumentThreadsMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2GetDocumentThreadsMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2GetDocumentThreadsMessage)return t;var e=new r.CommentsV2GetDocumentThreadsMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2GetDocumentThreadsMessage"},s}(),r.CommentsV2RemoveCommentMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(18).string(t.commentId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(26).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2RemoveCommentMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.commentId=e.string();break;case 3:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId)?"commentId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2RemoveCommentMessage)return t;var e=new r.CommentsV2RemoveCommentMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.commentId="",n.documentId=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2RemoveCommentMessage"},s}(),r.CommentsV2RemoveCommentThreadMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2RemoveCommentThreadMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2RemoveCommentThreadMessage)return t;var e=new r.CommentsV2RemoveCommentThreadMessage;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2RemoveCommentThreadMessage"},s}(),r.CommentsV2UpdateCommentMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(18).string(t.commentId),null!=t.content&&Object.hasOwnProperty.call(t,"content")&&n.uint32(26).string(t.content),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(34).string(t.documentId),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(42).string(t.attributes),null!=t.isAttributesUpdated&&Object.hasOwnProperty.call(t,"isAttributesUpdated")&&n.uint32(48).bool(t.isAttributesUpdated),null!=t.commentThread&&Object.hasOwnProperty.call(t,"commentThread")&&r.CommentsThreadDescriptor.encode(t.commentThread,n.uint32(58).fork()).ldelim(),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2UpdateCommentMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.commentId=e.string();break;case 3:i.content=e.string();break;case 4:i.documentId=e.string();break;case 5:i.attributes=e.string();break;case 6:i.isAttributesUpdated=e.bool();break;case 7:i.commentThread=r.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId))return"commentId: string expected";if(null!=t.content&&t.hasOwnProperty("content")&&!n.isString(t.content))return"content: string expected";if(null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId))return"documentId: string expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes))return"attributes: string expected";if(null!=t.isAttributesUpdated&&t.hasOwnProperty("isAttributesUpdated")&&"boolean"!=typeof t.isAttributesUpdated)return"isAttributesUpdated: boolean expected";if(null!=t.commentThread&&t.hasOwnProperty("commentThread")){var e=r.CommentsThreadDescriptor.verify(t.commentThread);if(e)return"commentThread."+e}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2UpdateCommentMessage)return t;var e=new r.CommentsV2UpdateCommentMessage;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.content&&(e.content=String(t.content)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.isAttributesUpdated&&(e.isAttributesUpdated=Boolean(t.isAttributesUpdated)),null!=t.commentThread){if("object"!=typeof t.commentThread)throw TypeError(".CommentsV2UpdateCommentMessage.commentThread: object expected");e.commentThread=r.CommentsThreadDescriptor.fromObject(t.commentThread)}return e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.commentId="",n.content="",n.documentId="",n.attributes="",n.isAttributesUpdated=!1,n.commentThread=null),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.content&&t.hasOwnProperty("content")&&(n.content=t.content),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.isAttributesUpdated&&t.hasOwnProperty("isAttributesUpdated")&&(n.isAttributesUpdated=t.isAttributesUpdated),null!=t.commentThread&&t.hasOwnProperty("commentThread")&&(n.commentThread=r.CommentsThreadDescriptor.toObject(t.commentThread,e)),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2UpdateCommentMessage"},s}(),r.CommentsV2AddCommentResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.commentId="",s.prototype.createdAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.commentId&&Object.hasOwnProperty.call(t,"commentId")&&n.uint32(18).string(t.commentId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(26).string(t.createdAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2AddCommentResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.commentId=e.string();break;case 3:i.createdAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.commentId&&t.hasOwnProperty("commentId")&&!n.isString(t.commentId)?"commentId: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2AddCommentResponse)return t;var e=new r.CommentsV2AddCommentResponse;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.commentId&&(e.commentId=String(t.commentId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.commentId="",n.createdAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.commentId&&t.hasOwnProperty("commentId")&&(n.commentId=t.commentId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2AddCommentResponse"},s}(),r.CommentsV2AddCommentThreadResponse=function(){function s(t){if(this.comments=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.createdAt="",s.prototype.comments=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(18).string(t.createdAt),null!=t.comments&&t.comments.length)for(var s=0;s<t.comments.length;++s)r.CommentThreadAddedCommentDescriptor.encode(t.comments[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2AddCommentThreadResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.createdAt=e.string();break;case 3:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(r.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt))return"createdAt: string expected";if(null!=t.comments&&t.hasOwnProperty("comments")){if(!Array.isArray(t.comments))return"comments: array expected";for(var e=0;e<t.comments.length;++e){var s=r.CommentThreadAddedCommentDescriptor.verify(t.comments[e]);if(s)return"comments."+s}}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2AddCommentThreadResponse)return t;var e=new r.CommentsV2AddCommentThreadResponse;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),t.comments){if(!Array.isArray(t.comments))throw TypeError(".CommentsV2AddCommentThreadResponse.comments: array expected");e.comments=[];for(var n=0;n<t.comments.length;++n){if("object"!=typeof t.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");e.comments[n]=r.CommentThreadAddedCommentDescriptor.fromObject(t.comments[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.comments=[]),e.defaults&&(n.commentThreadId="",n.createdAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),t.comments&&t.comments.length){n.comments=[];for(var s=0;s<t.comments.length;++s)n.comments[s]=r.CommentThreadAddedCommentDescriptor.toObject(t.comments[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2AddCommentThreadResponse"},s}(),r.CommentsV2ResolveCommentThreadResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.documentId="",s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(26).string(t.resolvedAt),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(34).string(t.resolvedBy),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ResolveCommentThreadResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.documentId=e.string();break;case 3:i.resolvedAt=e.string();break;case 4:i.resolvedBy=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId)?"commentThreadId: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt)?"resolvedAt: string expected":null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy)?"resolvedBy: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2ResolveCommentThreadResponse)return t;var e=new r.CommentsV2ResolveCommentThreadResponse;return null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedAt="",n.resolvedBy=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ResolveCommentThreadResponse"},s}(),r.CommentsV2ConnectResponse=function(){function s(t){if(this.threads=[],this.threadsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.threads=n.emptyArray,s.prototype.threadsV2=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.threads&&t.threads.length)for(var s=0;s<t.threads.length;++s)n.uint32(18).string(t.threads[s]);if(null!=t.threadsV2&&t.threadsV2.length)for(s=0;s<t.threadsV2.length;++s)r.CommentsThreadDescriptor.encode(t.threadsV2[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2ConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.threads&&i.threads.length||(i.threads=[]),i.threads.push(e.string());break;case 3:i.threadsV2&&i.threadsV2.length||(i.threadsV2=[]),i.threadsV2.push(r.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.threads&&t.hasOwnProperty("threads")){if(!Array.isArray(t.threads))return"threads: array expected";for(var e=0;e<t.threads.length;++e)if(!n.isString(t.threads[e]))return"threads: string[] expected"}if(null!=t.threadsV2&&t.hasOwnProperty("threadsV2")){if(!Array.isArray(t.threadsV2))return"threadsV2: array expected";for(e=0;e<t.threadsV2.length;++e){var s=r.CommentsThreadDescriptor.verify(t.threadsV2[e]);if(s)return"threadsV2."+s}}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2ConnectResponse)return t;var e=new r.CommentsV2ConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),t.threads){if(!Array.isArray(t.threads))throw TypeError(".CommentsV2ConnectResponse.threads: array expected");e.threads=[];for(var n=0;n<t.threads.length;++n)e.threads[n]=String(t.threads[n])}if(t.threadsV2){if(!Array.isArray(t.threadsV2))throw TypeError(".CommentsV2ConnectResponse.threadsV2: array expected");for(e.threadsV2=[],n=0;n<t.threadsV2.length;++n){if("object"!=typeof t.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");e.threadsV2[n]=r.CommentsThreadDescriptor.fromObject(t.threadsV2[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.threads=[],n.threadsV2=[]),e.defaults&&(n.channel=""),null!=t.channel&&t.hasOwnProperty("channel")&&(n.channel=t.channel),t.threads&&t.threads.length){n.threads=[];for(var s=0;s<t.threads.length;++s)n.threads[s]=t.threads[s]}if(t.threadsV2&&t.threadsV2.length)for(n.threadsV2=[],s=0;s<t.threadsV2.length;++s)n.threadsV2[s]=r.CommentsThreadDescriptor.toObject(t.threadsV2[s],e);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2ConnectResponse"},s}(),r.CommentsV2GetCommentThreadResponse=function(){function s(t){if(this.comments=[],this.commentsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.commentThreadId="",s.prototype.comments=n.emptyArray,s.prototype.commentsV2=n.emptyArray,s.prototype.resolvedAt="",s.prototype.resolvedBy="",s.prototype.context="",s.prototype.createdAt="",s.prototype.deletedAt="",s.prototype.attributes="",s.prototype.unlinkedAt="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.commentThreadId&&Object.hasOwnProperty.call(t,"commentThreadId")&&n.uint32(10).string(t.commentThreadId),null!=t.comments&&t.comments.length)for(var s=0;s<t.comments.length;++s)n.uint32(18).string(t.comments[s]);if(null!=t.commentsV2&&t.commentsV2.length)for(s=0;s<t.commentsV2.length;++s)r.CommentDescriptor.encode(t.commentsV2[s],n.uint32(26).fork()).ldelim();return null!=t.resolvedAt&&Object.hasOwnProperty.call(t,"resolvedAt")&&n.uint32(34).string(t.resolvedAt),null!=t.resolvedBy&&Object.hasOwnProperty.call(t,"resolvedBy")&&n.uint32(42).string(t.resolvedBy),null!=t.context&&Object.hasOwnProperty.call(t,"context")&&n.uint32(50).string(t.context),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(58).string(t.createdAt),null!=t.deletedAt&&Object.hasOwnProperty.call(t,"deletedAt")&&n.uint32(66).string(t.deletedAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(74).string(t.attributes),null!=t.unlinkedAt&&Object.hasOwnProperty.call(t,"unlinkedAt")&&n.uint32(82).string(t.unlinkedAt),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2GetCommentThreadResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.commentThreadId=e.string();break;case 2:i.comments&&i.comments.length||(i.comments=[]),i.comments.push(e.string());break;case 3:i.commentsV2&&i.commentsV2.length||(i.commentsV2=[]),i.commentsV2.push(r.CommentDescriptor.decode(e,e.uint32()));break;case 4:i.resolvedAt=e.string();break;case 5:i.resolvedBy=e.string();break;case 6:i.context=e.string();break;case 7:i.createdAt=e.string();break;case 8:i.deletedAt=e.string();break;case 9:i.attributes=e.string();break;case 10:i.unlinkedAt=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&!n.isString(t.commentThreadId))return"commentThreadId: string expected";if(null!=t.comments&&t.hasOwnProperty("comments")){if(!Array.isArray(t.comments))return"comments: array expected";for(var e=0;e<t.comments.length;++e)if(!n.isString(t.comments[e]))return"comments: string[] expected"}if(null!=t.commentsV2&&t.hasOwnProperty("commentsV2")){if(!Array.isArray(t.commentsV2))return"commentsV2: array expected";for(e=0;e<t.commentsV2.length;++e){var s=r.CommentDescriptor.verify(t.commentsV2[e]);if(s)return"commentsV2."+s}}return null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&!n.isString(t.resolvedAt)?"resolvedAt: string expected":null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&!n.isString(t.resolvedBy)?"resolvedBy: string expected":null!=t.context&&t.hasOwnProperty("context")&&!n.isString(t.context)?"context: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&!n.isString(t.deletedAt)?"deletedAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&!n.isString(t.unlinkedAt)?"unlinkedAt: string expected":null},s.fromObject=function(t){if(t instanceof r.CommentsV2GetCommentThreadResponse)return t;var e=new r.CommentsV2GetCommentThreadResponse;if(null!=t.commentThreadId&&(e.commentThreadId=String(t.commentThreadId)),t.comments){if(!Array.isArray(t.comments))throw TypeError(".CommentsV2GetCommentThreadResponse.comments: array expected");e.comments=[];for(var n=0;n<t.comments.length;++n)e.comments[n]=String(t.comments[n])}if(t.commentsV2){if(!Array.isArray(t.commentsV2))throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: array expected");for(e.commentsV2=[],n=0;n<t.commentsV2.length;++n){if("object"!=typeof t.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");e.commentsV2[n]=r.CommentDescriptor.fromObject(t.commentsV2[n])}}return null!=t.resolvedAt&&(e.resolvedAt=String(t.resolvedAt)),null!=t.resolvedBy&&(e.resolvedBy=String(t.resolvedBy)),null!=t.context&&(e.context=String(t.context)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.deletedAt&&(e.deletedAt=String(t.deletedAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.unlinkedAt&&(e.unlinkedAt=String(t.unlinkedAt)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.comments=[],n.commentsV2=[]),e.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=t.commentThreadId&&t.hasOwnProperty("commentThreadId")&&(n.commentThreadId=t.commentThreadId),t.comments&&t.comments.length){n.comments=[];for(var s=0;s<t.comments.length;++s)n.comments[s]=t.comments[s]}if(t.commentsV2&&t.commentsV2.length)for(n.commentsV2=[],s=0;s<t.commentsV2.length;++s)n.commentsV2[s]=r.CommentDescriptor.toObject(t.commentsV2[s],e);return null!=t.resolvedAt&&t.hasOwnProperty("resolvedAt")&&(n.resolvedAt=t.resolvedAt),null!=t.resolvedBy&&t.hasOwnProperty("resolvedBy")&&(n.resolvedBy=t.resolvedBy),null!=t.context&&t.hasOwnProperty("context")&&(n.context=t.context),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.deletedAt&&t.hasOwnProperty("deletedAt")&&(n.deletedAt=t.deletedAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.unlinkedAt&&t.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=t.unlinkedAt),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2GetCommentThreadResponse"},s}(),r.CommentsV2GetDocumentThreadsResponse=function(){function s(t){if(this.threads=[],this.threadsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.threads=n.emptyArray,s.prototype.threadsV2=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.threads&&t.threads.length)for(var s=0;s<t.threads.length;++s)n.uint32(10).string(t.threads[s]);if(null!=t.threadsV2&&t.threadsV2.length)for(s=0;s<t.threadsV2.length;++s)r.CommentsThreadDescriptor.encode(t.threadsV2[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.CommentsV2GetDocumentThreadsResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.threads&&i.threads.length||(i.threads=[]),i.threads.push(e.string());break;case 2:i.threadsV2&&i.threadsV2.length||(i.threadsV2=[]),i.threadsV2.push(r.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.threads&&t.hasOwnProperty("threads")){if(!Array.isArray(t.threads))return"threads: array expected";for(var e=0;e<t.threads.length;++e)if(!n.isString(t.threads[e]))return"threads: string[] expected"}if(null!=t.threadsV2&&t.hasOwnProperty("threadsV2")){if(!Array.isArray(t.threadsV2))return"threadsV2: array expected";for(e=0;e<t.threadsV2.length;++e){var s=r.CommentsThreadDescriptor.verify(t.threadsV2[e]);if(s)return"threadsV2."+s}}return null},s.fromObject=function(t){if(t instanceof r.CommentsV2GetDocumentThreadsResponse)return t;var e=new r.CommentsV2GetDocumentThreadsResponse;if(t.threads){if(!Array.isArray(t.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");e.threads=[];for(var n=0;n<t.threads.length;++n)e.threads[n]=String(t.threads[n])}if(t.threadsV2){if(!Array.isArray(t.threadsV2))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: array expected");for(e.threadsV2=[],n=0;n<t.threadsV2.length;++n){if("object"!=typeof t.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");e.threadsV2[n]=r.CommentsThreadDescriptor.fromObject(t.threadsV2[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.threads=[],n.threadsV2=[]),t.threads&&t.threads.length){n.threads=[];for(var s=0;s<t.threads.length;++s)n.threads[s]=t.threads[s]}if(t.threadsV2&&t.threadsV2.length)for(n.threadsV2=[],s=0;s<t.threadsV2.length;++s)n.threadsV2[s]=r.CommentsThreadDescriptor.toObject(t.threadsV2[s],e);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/CommentsV2GetDocumentThreadsResponse"},s}(),r.KeyValueDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.key="",s.prototype.value="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.key&&Object.hasOwnProperty.call(t,"key")&&n.uint32(10).string(t.key),null!=t.value&&Object.hasOwnProperty.call(t,"value")&&n.uint32(18).string(t.value),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.KeyValueDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.key=e.string();break;case 2:i.value=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.key&&t.hasOwnProperty("key")&&!n.isString(t.key)?"key: string expected":null!=t.value&&t.hasOwnProperty("value")&&!n.isString(t.value)?"value: string expected":null},s.fromObject=function(t){if(t instanceof r.KeyValueDescriptor)return t;var e=new r.KeyValueDescriptor;return null!=t.key&&(e.key=String(t.key)),null!=t.value&&(e.value=String(t.value)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.key="",n.value=""),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.value&&t.hasOwnProperty("value")&&(n.value=t.value),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/KeyValueDescriptor"},s}(),r.IsEditorBundleUploadedMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.bundleVersion="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.bundleVersion&&Object.hasOwnProperty.call(t,"bundleVersion")&&n.uint32(10).string(t.bundleVersion),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.IsEditorBundleUploadedMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.bundleVersion=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&!n.isString(t.bundleVersion)?"bundleVersion: string expected":null},s.fromObject=function(t){if(t instanceof r.IsEditorBundleUploadedMessage)return t;var e=new r.IsEditorBundleUploadedMessage;return null!=t.bundleVersion&&(e.bundleVersion=String(t.bundleVersion)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.bundleVersion=""),null!=t.bundleVersion&&t.hasOwnProperty("bundleVersion")&&(n.bundleVersion=t.bundleVersion),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/IsEditorBundleUploadedMessage"},s}(),r.IsEditorBundleUploadedResponse=function(){function n(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return n.prototype.isUploaded=!1,n.create=function(t){return new n(t)},n.encode=function(t,n){return n||(n=e.create()),null!=t.isUploaded&&Object.hasOwnProperty.call(t,"isUploaded")&&n.uint32(8).bool(t.isUploaded),n},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.IsEditorBundleUploadedResponse;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.isUploaded=e.bool():e.skipType(7&a)}return i},n.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},n.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.isUploaded&&t.hasOwnProperty("isUploaded")&&"boolean"!=typeof t.isUploaded?"isUploaded: boolean expected":null},n.fromObject=function(t){if(t instanceof r.IsEditorBundleUploadedResponse)return t;var e=new r.IsEditorBundleUploadedResponse;return null!=t.isUploaded&&(e.isUploaded=Boolean(t.isUploaded)),e},n.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.isUploaded=!1),null!=t.isUploaded&&t.hasOwnProperty("isUploaded")&&(n.isUploaded=t.isUploaded),n},n.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},n.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/IsEditorBundleUploadedResponse"},n}(),r.RevisionDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.revisionId&&Object.hasOwnProperty.call(t,"revisionId")&&n.uint32(10).string(t.revisionId),null!=t.name&&Object.hasOwnProperty.call(t,"name")&&n.uint32(18).string(t.name),null!=t.creatorId&&Object.hasOwnProperty.call(t,"creatorId")&&n.uint32(26).string(t.creatorId),null!=t.authorsIds&&Object.hasOwnProperty.call(t,"authorsIds")&&n.uint32(34).string(t.authorsIds),null!=t.diffData&&Object.hasOwnProperty.call(t,"diffData")&&n.uint32(42).string(t.diffData),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(50).string(t.createdAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),null!=t.toVersion&&Object.hasOwnProperty.call(t,"toVersion")&&n.uint32(64).uint32(t.toVersion),null!=t.fromVersion&&Object.hasOwnProperty.call(t,"fromVersion")&&n.uint32(72).uint32(t.fromVersion),null!=t.isEmptyCurrent&&Object.hasOwnProperty.call(t,"isEmptyCurrent")&&n.uint32(80).bool(t.isEmptyCurrent),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.revisionId=e.string();break;case 2:i.name=e.string();break;case 3:i.creatorId=e.string();break;case 4:i.authorsIds=e.string();break;case 5:i.diffData=e.string();break;case 6:i.createdAt=e.string();break;case 7:i.attributes=e.string();break;case 8:i.toVersion=e.uint32();break;case 9:i.fromVersion=e.uint32();break;case 10:i.isEmptyCurrent=e.bool();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.revisionId&&t.hasOwnProperty("revisionId")&&!n.isString(t.revisionId)?"revisionId: string expected":null!=t.name&&t.hasOwnProperty("name")&&!n.isString(t.name)?"name: string expected":null!=t.creatorId&&t.hasOwnProperty("creatorId")&&!n.isString(t.creatorId)?"creatorId: string expected":null!=t.authorsIds&&t.hasOwnProperty("authorsIds")&&!n.isString(t.authorsIds)?"authorsIds: string expected":null!=t.diffData&&t.hasOwnProperty("diffData")&&!n.isString(t.diffData)?"diffData: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.toVersion&&t.hasOwnProperty("toVersion")&&!n.isInteger(t.toVersion)?"toVersion: integer expected":null!=t.fromVersion&&t.hasOwnProperty("fromVersion")&&!n.isInteger(t.fromVersion)?"fromVersion: integer expected":null!=t.isEmptyCurrent&&t.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof t.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RevisionDescriptor)return t;var e=new r.RevisionDescriptor;return null!=t.revisionId&&(e.revisionId=String(t.revisionId)),null!=t.name&&(e.name=String(t.name)),null!=t.creatorId&&(e.creatorId=String(t.creatorId)),null!=t.authorsIds&&(e.authorsIds=String(t.authorsIds)),null!=t.diffData&&(e.diffData=String(t.diffData)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.toVersion&&(e.toVersion=t.toVersion>>>0),null!=t.fromVersion&&(e.fromVersion=t.fromVersion>>>0),null!=t.isEmptyCurrent&&(e.isEmptyCurrent=Boolean(t.isEmptyCurrent)),e},s.toObject=function(t,e){e||(e={});var n={};return e.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!=t.revisionId&&t.hasOwnProperty("revisionId")&&(n.revisionId=t.revisionId),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.creatorId&&t.hasOwnProperty("creatorId")&&(n.creatorId=t.creatorId),null!=t.authorsIds&&t.hasOwnProperty("authorsIds")&&(n.authorsIds=t.authorsIds),null!=t.diffData&&t.hasOwnProperty("diffData")&&(n.diffData=t.diffData),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.toVersion&&t.hasOwnProperty("toVersion")&&(n.toVersion=t.toVersion),null!=t.fromVersion&&t.hasOwnProperty("fromVersion")&&(n.fromVersion=t.fromVersion),null!=t.isEmptyCurrent&&t.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=t.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionDescriptor"},s}(),r.RevisionHistoryConnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryConnectMessage)return t;var e=new r.RevisionHistoryConnectMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryConnectMessage"},s}(),r.RevisionHistoryGetRevisionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.prototype.revisionId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.revisionId&&Object.hasOwnProperty.call(t,"revisionId")&&n.uint32(18).string(t.revisionId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryGetRevisionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.revisionId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.revisionId&&t.hasOwnProperty("revisionId")&&!n.isString(t.revisionId)?"revisionId: string expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryGetRevisionMessage)return t;var e=new r.RevisionHistoryGetRevisionMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.revisionId&&(e.revisionId=String(t.revisionId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId="",n.revisionId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.revisionId&&t.hasOwnProperty("revisionId")&&(n.revisionId=t.revisionId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryGetRevisionMessage"},s}(),r.RevisionHistoryReconnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.requestId&&Object.hasOwnProperty.call(t,"requestId")&&n.uint32(16).uint32(t.requestId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryReconnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.requestId=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.requestId&&t.hasOwnProperty("requestId")&&!n.isInteger(t.requestId)?"requestId: integer expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryReconnectMessage)return t;var e=new r.RevisionHistoryReconnectMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.requestId&&(e.requestId=t.requestId>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId="",n.requestId=0),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.requestId&&t.hasOwnProperty("requestId")&&(n.requestId=t.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryReconnectMessage"},s}(),r.RevisionHistoryUpdateRevisionsMessage=function(){function s(t){if(this.revisions=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.prototype.requestId=0,s.prototype.revisions=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),null!=t.requestId&&Object.hasOwnProperty.call(t,"requestId")&&n.uint32(16).uint32(t.requestId),null!=t.revisions&&t.revisions.length)for(var s=0;s<t.revisions.length;++s)r.RevisionDescriptor.encode(t.revisions[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryUpdateRevisionsMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.documentId=e.string();break;case 2:i.requestId=e.uint32();break;case 3:i.revisions&&i.revisions.length||(i.revisions=[]),i.revisions.push(r.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId))return"documentId: string expected";if(null!=t.requestId&&t.hasOwnProperty("requestId")&&!n.isInteger(t.requestId))return"requestId: integer expected";if(null!=t.revisions&&t.hasOwnProperty("revisions")){if(!Array.isArray(t.revisions))return"revisions: array expected";for(var e=0;e<t.revisions.length;++e){var s=r.RevisionDescriptor.verify(t.revisions[e]);if(s)return"revisions."+s}}return null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryUpdateRevisionsMessage)return t;var e=new r.RevisionHistoryUpdateRevisionsMessage;if(null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.requestId&&(e.requestId=t.requestId>>>0),t.revisions){if(!Array.isArray(t.revisions))throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: array expected");e.revisions=[];for(var n=0;n<t.revisions.length;++n){if("object"!=typeof t.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");e.revisions[n]=r.RevisionDescriptor.fromObject(t.revisions[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.revisions=[]),e.defaults&&(n.documentId="",n.requestId=0),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.requestId&&t.hasOwnProperty("requestId")&&(n.requestId=t.requestId),t.revisions&&t.revisions.length){n.revisions=[];for(var s=0;s<t.revisions.length;++s)n.revisions[s]=r.RevisionDescriptor.toObject(t.revisions[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryUpdateRevisionsMessage"},s}(),r.RevisionHistoryConnectResponse=function(){function s(t){if(this.revisions=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.requestId=0,s.prototype.revisions=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.requestId&&Object.hasOwnProperty.call(t,"requestId")&&n.uint32(16).uint32(t.requestId),null!=t.revisions&&t.revisions.length)for(var s=0;s<t.revisions.length;++s)r.RevisionDescriptor.encode(t.revisions[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.requestId=e.uint32();break;case 3:i.revisions&&i.revisions.length||(i.revisions=[]),i.revisions.push(r.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.requestId&&t.hasOwnProperty("requestId")&&!n.isInteger(t.requestId))return"requestId: integer expected";if(null!=t.revisions&&t.hasOwnProperty("revisions")){if(!Array.isArray(t.revisions))return"revisions: array expected";for(var e=0;e<t.revisions.length;++e){var s=r.RevisionDescriptor.verify(t.revisions[e]);if(s)return"revisions."+s}}return null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryConnectResponse)return t;var e=new r.RevisionHistoryConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),null!=t.requestId&&(e.requestId=t.requestId>>>0),t.revisions){if(!Array.isArray(t.revisions))throw TypeError(".RevisionHistoryConnectResponse.revisions: array expected");e.revisions=[];for(var n=0;n<t.revisions.length;++n){if("object"!=typeof t.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");e.revisions[n]=r.RevisionDescriptor.fromObject(t.revisions[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.revisions=[]),e.defaults&&(n.channel="",n.requestId=0),null!=t.channel&&t.hasOwnProperty("channel")&&(n.channel=t.channel),null!=t.requestId&&t.hasOwnProperty("requestId")&&(n.requestId=t.requestId),t.revisions&&t.revisions.length){n.revisions=[];for(var s=0;s<t.revisions.length;++s)n.revisions[s]=r.RevisionDescriptor.toObject(t.revisions[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryConnectResponse"},s}(),r.RevisionHistoryGetRevisionResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.revisionId&&Object.hasOwnProperty.call(t,"revisionId")&&n.uint32(10).string(t.revisionId),null!=t.name&&Object.hasOwnProperty.call(t,"name")&&n.uint32(18).string(t.name),null!=t.creatorId&&Object.hasOwnProperty.call(t,"creatorId")&&n.uint32(26).string(t.creatorId),null!=t.authorsIds&&Object.hasOwnProperty.call(t,"authorsIds")&&n.uint32(34).string(t.authorsIds),null!=t.diffData&&Object.hasOwnProperty.call(t,"diffData")&&n.uint32(42).string(t.diffData),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(50).string(t.createdAt),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(58).string(t.attributes),null!=t.toVersion&&Object.hasOwnProperty.call(t,"toVersion")&&n.uint32(64).uint32(t.toVersion),null!=t.fromVersion&&Object.hasOwnProperty.call(t,"fromVersion")&&n.uint32(72).uint32(t.fromVersion),null!=t.isEmptyCurrent&&Object.hasOwnProperty.call(t,"isEmptyCurrent")&&n.uint32(80).bool(t.isEmptyCurrent),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryGetRevisionResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.revisionId=e.string();break;case 2:i.name=e.string();break;case 3:i.creatorId=e.string();break;case 4:i.authorsIds=e.string();break;case 5:i.diffData=e.string();break;case 6:i.createdAt=e.string();break;case 7:i.attributes=e.string();break;case 8:i.toVersion=e.uint32();break;case 9:i.fromVersion=e.uint32();break;case 10:i.isEmptyCurrent=e.bool();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.revisionId&&t.hasOwnProperty("revisionId")&&!n.isString(t.revisionId)?"revisionId: string expected":null!=t.name&&t.hasOwnProperty("name")&&!n.isString(t.name)?"name: string expected":null!=t.creatorId&&t.hasOwnProperty("creatorId")&&!n.isString(t.creatorId)?"creatorId: string expected":null!=t.authorsIds&&t.hasOwnProperty("authorsIds")&&!n.isString(t.authorsIds)?"authorsIds: string expected":null!=t.diffData&&t.hasOwnProperty("diffData")&&!n.isString(t.diffData)?"diffData: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null!=t.toVersion&&t.hasOwnProperty("toVersion")&&!n.isInteger(t.toVersion)?"toVersion: integer expected":null!=t.fromVersion&&t.hasOwnProperty("fromVersion")&&!n.isInteger(t.fromVersion)?"fromVersion: integer expected":null!=t.isEmptyCurrent&&t.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof t.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryGetRevisionResponse)return t;var e=new r.RevisionHistoryGetRevisionResponse;return null!=t.revisionId&&(e.revisionId=String(t.revisionId)),null!=t.name&&(e.name=String(t.name)),null!=t.creatorId&&(e.creatorId=String(t.creatorId)),null!=t.authorsIds&&(e.authorsIds=String(t.authorsIds)),null!=t.diffData&&(e.diffData=String(t.diffData)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.attributes&&(e.attributes=String(t.attributes)),null!=t.toVersion&&(e.toVersion=t.toVersion>>>0),null!=t.fromVersion&&(e.fromVersion=t.fromVersion>>>0),null!=t.isEmptyCurrent&&(e.isEmptyCurrent=Boolean(t.isEmptyCurrent)),e},s.toObject=function(t,e){e||(e={});var n={};return e.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!=t.revisionId&&t.hasOwnProperty("revisionId")&&(n.revisionId=t.revisionId),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.creatorId&&t.hasOwnProperty("creatorId")&&(n.creatorId=t.creatorId),null!=t.authorsIds&&t.hasOwnProperty("authorsIds")&&(n.authorsIds=t.authorsIds),null!=t.diffData&&t.hasOwnProperty("diffData")&&(n.diffData=t.diffData),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),null!=t.toVersion&&t.hasOwnProperty("toVersion")&&(n.toVersion=t.toVersion),null!=t.fromVersion&&t.hasOwnProperty("fromVersion")&&(n.fromVersion=t.fromVersion),null!=t.isEmptyCurrent&&t.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=t.isEmptyCurrent),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryGetRevisionResponse"},s}(),r.RevisionHistoryUpdateRevisionsResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.requestId=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.requestId&&Object.hasOwnProperty.call(t,"requestId")&&n.uint32(8).uint32(t.requestId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.RevisionHistoryUpdateRevisionsResponse;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.requestId=e.uint32():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.requestId&&t.hasOwnProperty("requestId")&&!n.isInteger(t.requestId)?"requestId: integer expected":null},s.fromObject=function(t){if(t instanceof r.RevisionHistoryUpdateRevisionsResponse)return t;var e=new r.RevisionHistoryUpdateRevisionsResponse;return null!=t.requestId&&(e.requestId=t.requestId>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.requestId=0),null!=t.requestId&&t.hasOwnProperty("requestId")&&(n.requestId=t.requestId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RevisionHistoryUpdateRevisionsResponse"},s}(),r.SessionsSocketDescriptor=function(){function s(t){if(this.permissions=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.session="",s.prototype.user="",s.prototype.role="",s.prototype.permissions=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.session&&Object.hasOwnProperty.call(t,"session")&&n.uint32(10).string(t.session),null!=t.user&&Object.hasOwnProperty.call(t,"user")&&n.uint32(18).string(t.user),null!=t.role&&Object.hasOwnProperty.call(t,"role")&&n.uint32(26).string(t.role),null!=t.permissions&&t.permissions.length)for(var r=0;r<t.permissions.length;++r)n.uint32(34).string(t.permissions[r]);return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SessionsSocketDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.session=e.string();break;case 2:i.user=e.string();break;case 3:i.role=e.string();break;case 4:i.permissions&&i.permissions.length||(i.permissions=[]),i.permissions.push(e.string());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.session&&t.hasOwnProperty("session")&&!n.isString(t.session))return"session: string expected";if(null!=t.user&&t.hasOwnProperty("user")&&!n.isString(t.user))return"user: string expected";if(null!=t.role&&t.hasOwnProperty("role")&&!n.isString(t.role))return"role: string expected";if(null!=t.permissions&&t.hasOwnProperty("permissions")){if(!Array.isArray(t.permissions))return"permissions: array expected";for(var e=0;e<t.permissions.length;++e)if(!n.isString(t.permissions[e]))return"permissions: string[] expected"}return null},s.fromObject=function(t){if(t instanceof r.SessionsSocketDescriptor)return t;var e=new r.SessionsSocketDescriptor;if(null!=t.session&&(e.session=String(t.session)),null!=t.user&&(e.user=String(t.user)),null!=t.role&&(e.role=String(t.role)),t.permissions){if(!Array.isArray(t.permissions))throw TypeError(".SessionsSocketDescriptor.permissions: array expected");e.permissions=[];for(var n=0;n<t.permissions.length;++n)e.permissions[n]=String(t.permissions[n])}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.permissions=[]),e.defaults&&(n.session="",n.user="",n.role=""),null!=t.session&&t.hasOwnProperty("session")&&(n.session=t.session),null!=t.user&&t.hasOwnProperty("user")&&(n.user=t.user),null!=t.role&&t.hasOwnProperty("role")&&(n.role=t.role),t.permissions&&t.permissions.length){n.permissions=[];for(var r=0;r<t.permissions.length;++r)n.permissions[r]=t.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SessionsSocketDescriptor"},s}(),r.SessionsConnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.sessionType=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.sessionType&&Object.hasOwnProperty.call(t,"sessionType")&&n.uint32(16).uint32(t.sessionType),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SessionsConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.sessionType=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.sessionType&&t.hasOwnProperty("sessionType")&&!n.isInteger(t.sessionType)?"sessionType: integer expected":null},s.fromObject=function(t){if(t instanceof r.SessionsConnectMessage)return t;var e=new r.SessionsConnectMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.sessionType&&(e.sessionType=t.sessionType>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.sessionType=0),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.sessionType&&t.hasOwnProperty("sessionType")&&(n.sessionType=t.sessionType),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SessionsConnectMessage"},s}(),r.SocketConnectMessage=function(){function s(t){if(this.permissions=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.userId="",s.prototype.role="",s.prototype.permissions=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.userId&&Object.hasOwnProperty.call(t,"userId")&&n.uint32(18).string(t.userId),null!=t.role&&Object.hasOwnProperty.call(t,"role")&&n.uint32(26).string(t.role),null!=t.permissions&&t.permissions.length)for(var r=0;r<t.permissions.length;++r)n.uint32(34).string(t.permissions[r]);return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SocketConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.userId=e.string();break;case 3:i.role=e.string();break;case 4:i.permissions&&i.permissions.length||(i.permissions=[]),i.permissions.push(e.string());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id))return"id: string expected";if(null!=t.userId&&t.hasOwnProperty("userId")&&!n.isString(t.userId))return"userId: string expected";if(null!=t.role&&t.hasOwnProperty("role")&&!n.isString(t.role))return"role: string expected";if(null!=t.permissions&&t.hasOwnProperty("permissions")){if(!Array.isArray(t.permissions))return"permissions: array expected";for(var e=0;e<t.permissions.length;++e)if(!n.isString(t.permissions[e]))return"permissions: string[] expected"}return null},s.fromObject=function(t){if(t instanceof r.SocketConnectMessage)return t;var e=new r.SocketConnectMessage;if(null!=t.id&&(e.id=String(t.id)),null!=t.userId&&(e.userId=String(t.userId)),null!=t.role&&(e.role=String(t.role)),t.permissions){if(!Array.isArray(t.permissions))throw TypeError(".SocketConnectMessage.permissions: array expected");e.permissions=[];for(var n=0;n<t.permissions.length;++n)e.permissions[n]=String(t.permissions[n])}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.permissions=[]),e.defaults&&(n.id="",n.userId="",n.role=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.userId&&t.hasOwnProperty("userId")&&(n.userId=t.userId),null!=t.role&&t.hasOwnProperty("role")&&(n.role=t.role),t.permissions&&t.permissions.length){n.permissions=[];for(var r=0;r<t.permissions.length;++r)n.permissions[r]=t.permissions[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SocketConnectMessage"},s}(),r.SocketDisconnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SocketDisconnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.id=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null},s.fromObject=function(t){if(t instanceof r.SocketDisconnectMessage)return t;var e=new r.SocketDisconnectMessage;return null!=t.id&&(e.id=String(t.id)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SocketDisconnectMessage"},s}(),r.SessionsConnectResponse=function(){function s(t){if(this.sockets=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.sockets=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.sockets&&t.sockets.length)for(var s=0;s<t.sockets.length;++s)r.SessionsSocketDescriptor.encode(t.sockets[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SessionsConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.sockets&&i.sockets.length||(i.sockets=[]),i.sockets.push(r.SessionsSocketDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.sockets&&t.hasOwnProperty("sockets")){if(!Array.isArray(t.sockets))return"sockets: array expected";for(var e=0;e<t.sockets.length;++e){var s=r.SessionsSocketDescriptor.verify(t.sockets[e]);if(s)return"sockets."+s}}return null},s.fromObject=function(t){if(t instanceof r.SessionsConnectResponse)return t;var e=new r.SessionsConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),t.sockets){if(!Array.isArray(t.sockets))throw TypeError(".SessionsConnectResponse.sockets: array expected");e.sockets=[];for(var n=0;n<t.sockets.length;++n){if("object"!=typeof t.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");e.sockets[n]=r.SessionsSocketDescriptor.fromObject(t.sockets[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.sockets=[]),e.defaults&&(n.channel=""),null!=t.channel&&t.hasOwnProperty("channel")&&(n.channel=t.channel),t.sockets&&t.sockets.length){n.sockets=[];for(var s=0;s<t.sockets.length;++s)n.sockets[s]=r.SessionsSocketDescriptor.toObject(t.sockets[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SessionsConnectResponse"},s}(),r.SuggestionDescriptor=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.authorId&&Object.hasOwnProperty.call(t,"authorId")&&n.uint32(18).string(t.authorId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(26).string(t.type),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(34).string(t.createdAt),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(42).string(t.data),null!=t.hasComments&&Object.hasOwnProperty.call(t,"hasComments")&&n.uint32(48).bool(t.hasComments),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(58).string(t.state),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(66).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.SuggestionDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.authorId=e.string();break;case 3:i.type=e.string();break;case 4:i.createdAt=e.string();break;case 5:i.data=e.string();break;case 6:i.hasComments=e.bool();break;case 7:i.state=e.string();break;case 8:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.authorId&&t.hasOwnProperty("authorId")&&!n.isString(t.authorId)?"authorId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.hasComments&&t.hasOwnProperty("hasComments")&&"boolean"!=typeof t.hasComments?"hasComments: boolean expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.SuggestionDescriptor)return t;var e=new r.SuggestionDescriptor;return null!=t.id&&(e.id=String(t.id)),null!=t.authorId&&(e.authorId=String(t.authorId)),null!=t.type&&(e.type=String(t.type)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.data&&(e.data=String(t.data)),null!=t.hasComments&&(e.hasComments=Boolean(t.hasComments)),null!=t.state&&(e.state=String(t.state)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.authorId&&t.hasOwnProperty("authorId")&&(n.authorId=t.authorId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.hasComments&&t.hasOwnProperty("hasComments")&&(n.hasComments=t.hasComments),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SuggestionDescriptor"},s}(),r.TrackChangesAddSuggestionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.documentId="",s.prototype.type="",s.prototype.data="",s.prototype.originalSuggestionId="",s.prototype.attributes="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(26).string(t.type),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(34).string(t.data),null!=t.originalSuggestionId&&Object.hasOwnProperty.call(t,"originalSuggestionId")&&n.uint32(42).string(t.originalSuggestionId),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(50).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesAddSuggestionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.documentId=e.string();break;case 3:i.type=e.string();break;case 4:i.data=e.string();break;case 5:i.originalSuggestionId=e.string();break;case 6:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.originalSuggestionId&&t.hasOwnProperty("originalSuggestionId")&&!n.isString(t.originalSuggestionId)?"originalSuggestionId: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesAddSuggestionMessage)return t;var e=new r.TrackChangesAddSuggestionMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.type&&(e.type=String(t.type)),null!=t.data&&(e.data=String(t.data)),null!=t.originalSuggestionId&&(e.originalSuggestionId=String(t.originalSuggestionId)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.documentId="",n.type="",n.data="",n.originalSuggestionId="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.originalSuggestionId&&t.hasOwnProperty("originalSuggestionId")&&(n.originalSuggestionId=t.originalSuggestionId),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesAddSuggestionMessage"},s}(),r.TrackChangesBatchUpdateSuggestionsStateMessage=function(){function s(t){if(this.ids=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.ids=n.emptyArray,s.prototype.documentId="",s.prototype.state="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.ids&&t.ids.length)for(var r=0;r<t.ids.length;++r)n.uint32(10).string(t.ids[r]);return null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(26).string(t.state),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesBatchUpdateSuggestionsStateMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.ids&&i.ids.length||(i.ids=[]),i.ids.push(e.string());break;case 2:i.documentId=e.string();break;case 3:i.state=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.ids&&t.hasOwnProperty("ids")){if(!Array.isArray(t.ids))return"ids: array expected";for(var e=0;e<t.ids.length;++e)if(!n.isString(t.ids[e]))return"ids: string[] expected"}return null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesBatchUpdateSuggestionsStateMessage)return t;var e=new r.TrackChangesBatchUpdateSuggestionsStateMessage;if(t.ids){if(!Array.isArray(t.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");e.ids=[];for(var n=0;n<t.ids.length;++n)e.ids[n]=String(t.ids[n])}return null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.state&&(e.state=String(t.state)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.ids=[]),e.defaults&&(n.documentId="",n.state=""),t.ids&&t.ids.length){n.ids=[];for(var r=0;r<t.ids.length;++r)n.ids[r]=t.ids[r]}return null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesBatchUpdateSuggestionsStateMessage"},s}(),r.TrackChangesConnectMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesConnectMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesConnectMessage)return t;var e=new r.TrackChangesConnectMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesConnectMessage"},s}(),r.TrackChangesGetAllSuggestionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(10).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesGetAllSuggestionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.documentId=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesGetAllSuggestionMessage)return t;var e=new r.TrackChangesGetAllSuggestionMessage;return null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.documentId=""),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesGetAllSuggestionMessage"},s}(),r.TrackChangesGetSuggestionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.prototype.documentId="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesGetSuggestionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.documentId=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesGetSuggestionMessage)return t;var e=new r.TrackChangesGetSuggestionMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.documentId&&(e.documentId=String(t.documentId)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.documentId=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesGetSuggestionMessage"},s}(),r.TrackChangesUpdateSuggestionMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.documentId&&Object.hasOwnProperty.call(t,"documentId")&&n.uint32(18).string(t.documentId),null!=t.hasComments&&Object.hasOwnProperty.call(t,"hasComments")&&n.uint32(24).bool(t.hasComments),null!=t.isHasCommentsModified&&Object.hasOwnProperty.call(t,"isHasCommentsModified")&&n.uint32(32).bool(t.isHasCommentsModified),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(42).string(t.state),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(50).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesUpdateSuggestionMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.documentId=e.string();break;case 3:i.hasComments=e.bool();break;case 4:i.isHasCommentsModified=e.bool();break;case 5:i.state=e.string();break;case 6:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.documentId&&t.hasOwnProperty("documentId")&&!n.isString(t.documentId)?"documentId: string expected":null!=t.hasComments&&t.hasOwnProperty("hasComments")&&"boolean"!=typeof t.hasComments?"hasComments: boolean expected":null!=t.isHasCommentsModified&&t.hasOwnProperty("isHasCommentsModified")&&"boolean"!=typeof t.isHasCommentsModified?"isHasCommentsModified: boolean expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesUpdateSuggestionMessage)return t;var e=new r.TrackChangesUpdateSuggestionMessage;return null!=t.id&&(e.id=String(t.id)),null!=t.documentId&&(e.documentId=String(t.documentId)),null!=t.hasComments&&(e.hasComments=Boolean(t.hasComments)),null!=t.isHasCommentsModified&&(e.isHasCommentsModified=Boolean(t.isHasCommentsModified)),null!=t.state&&(e.state=String(t.state)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.documentId="",n.hasComments=!1,n.isHasCommentsModified=!1,n.state="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.documentId&&t.hasOwnProperty("documentId")&&(n.documentId=t.documentId),null!=t.hasComments&&t.hasOwnProperty("hasComments")&&(n.hasComments=t.hasComments),null!=t.isHasCommentsModified&&t.hasOwnProperty("isHasCommentsModified")&&(n.isHasCommentsModified=t.isHasCommentsModified),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesUpdateSuggestionMessage"},s}(),r.TrackChangesAddSuggestionResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.authorId&&Object.hasOwnProperty.call(t,"authorId")&&n.uint32(18).string(t.authorId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(26).string(t.type),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(34).string(t.createdAt),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(42).string(t.data),null!=t.hasComments&&Object.hasOwnProperty.call(t,"hasComments")&&n.uint32(48).bool(t.hasComments),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(58).string(t.state),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(66).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesAddSuggestionResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.authorId=e.string();break;case 3:i.type=e.string();break;case 4:i.createdAt=e.string();break;case 5:i.data=e.string();break;case 6:i.hasComments=e.bool();break;case 7:i.state=e.string();break;case 8:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.authorId&&t.hasOwnProperty("authorId")&&!n.isString(t.authorId)?"authorId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.hasComments&&t.hasOwnProperty("hasComments")&&"boolean"!=typeof t.hasComments?"hasComments: boolean expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesAddSuggestionResponse)return t;var e=new r.TrackChangesAddSuggestionResponse;return null!=t.id&&(e.id=String(t.id)),null!=t.authorId&&(e.authorId=String(t.authorId)),null!=t.type&&(e.type=String(t.type)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.data&&(e.data=String(t.data)),null!=t.hasComments&&(e.hasComments=Boolean(t.hasComments)),null!=t.state&&(e.state=String(t.state)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.authorId&&t.hasOwnProperty("authorId")&&(n.authorId=t.authorId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.hasComments&&t.hasOwnProperty("hasComments")&&(n.hasComments=t.hasComments),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesAddSuggestionResponse"},s}(),r.TrackChangesConnectResponse=function(){function s(t){if(this.suggestions=[],this.suggestionsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.channel="",s.prototype.suggestions=n.emptyArray,s.prototype.suggestionsV2=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.channel&&Object.hasOwnProperty.call(t,"channel")&&n.uint32(10).string(t.channel),null!=t.suggestions&&t.suggestions.length)for(var s=0;s<t.suggestions.length;++s)n.uint32(18).string(t.suggestions[s]);if(null!=t.suggestionsV2&&t.suggestionsV2.length)for(s=0;s<t.suggestionsV2.length;++s)r.SuggestionDescriptor.encode(t.suggestionsV2[s],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesConnectResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.channel=e.string();break;case 2:i.suggestions&&i.suggestions.length||(i.suggestions=[]),i.suggestions.push(e.string());break;case 3:i.suggestionsV2&&i.suggestionsV2.length||(i.suggestionsV2=[]),i.suggestionsV2.push(r.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.channel&&t.hasOwnProperty("channel")&&!n.isString(t.channel))return"channel: string expected";if(null!=t.suggestions&&t.hasOwnProperty("suggestions")){if(!Array.isArray(t.suggestions))return"suggestions: array expected";for(var e=0;e<t.suggestions.length;++e)if(!n.isString(t.suggestions[e]))return"suggestions: string[] expected"}if(null!=t.suggestionsV2&&t.hasOwnProperty("suggestionsV2")){if(!Array.isArray(t.suggestionsV2))return"suggestionsV2: array expected";for(e=0;e<t.suggestionsV2.length;++e){var s=r.SuggestionDescriptor.verify(t.suggestionsV2[e]);if(s)return"suggestionsV2."+s}}return null},s.fromObject=function(t){if(t instanceof r.TrackChangesConnectResponse)return t;var e=new r.TrackChangesConnectResponse;if(null!=t.channel&&(e.channel=String(t.channel)),t.suggestions){if(!Array.isArray(t.suggestions))throw TypeError(".TrackChangesConnectResponse.suggestions: array expected");e.suggestions=[];for(var n=0;n<t.suggestions.length;++n)e.suggestions[n]=String(t.suggestions[n])}if(t.suggestionsV2){if(!Array.isArray(t.suggestionsV2))throw TypeError(".TrackChangesConnectResponse.suggestionsV2: array expected");for(e.suggestionsV2=[],n=0;n<t.suggestionsV2.length;++n){if("object"!=typeof t.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");e.suggestionsV2[n]=r.SuggestionDescriptor.fromObject(t.suggestionsV2[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.defaults&&(n.channel=""),null!=t.channel&&t.hasOwnProperty("channel")&&(n.channel=t.channel),t.suggestions&&t.suggestions.length){n.suggestions=[];for(var s=0;s<t.suggestions.length;++s)n.suggestions[s]=t.suggestions[s]}if(t.suggestionsV2&&t.suggestionsV2.length)for(n.suggestionsV2=[],s=0;s<t.suggestionsV2.length;++s)n.suggestionsV2[s]=r.SuggestionDescriptor.toObject(t.suggestionsV2[s],e);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesConnectResponse"},s}(),r.TrackChangesGetAllSuggestionsResponse=function(){function s(t){if(this.suggestions=[],this.suggestionsV2=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.suggestions=n.emptyArray,s.prototype.suggestionsV2=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.suggestions&&t.suggestions.length)for(var s=0;s<t.suggestions.length;++s)n.uint32(10).string(t.suggestions[s]);if(null!=t.suggestionsV2&&t.suggestionsV2.length)for(s=0;s<t.suggestionsV2.length;++s)r.SuggestionDescriptor.encode(t.suggestionsV2[s],n.uint32(18).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesGetAllSuggestionsResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.suggestions&&i.suggestions.length||(i.suggestions=[]),i.suggestions.push(e.string());break;case 2:i.suggestionsV2&&i.suggestionsV2.length||(i.suggestionsV2=[]),i.suggestionsV2.push(r.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.suggestions&&t.hasOwnProperty("suggestions")){if(!Array.isArray(t.suggestions))return"suggestions: array expected";for(var e=0;e<t.suggestions.length;++e)if(!n.isString(t.suggestions[e]))return"suggestions: string[] expected"}if(null!=t.suggestionsV2&&t.hasOwnProperty("suggestionsV2")){if(!Array.isArray(t.suggestionsV2))return"suggestionsV2: array expected";for(e=0;e<t.suggestionsV2.length;++e){var s=r.SuggestionDescriptor.verify(t.suggestionsV2[e]);if(s)return"suggestionsV2."+s}}return null},s.fromObject=function(t){if(t instanceof r.TrackChangesGetAllSuggestionsResponse)return t;var e=new r.TrackChangesGetAllSuggestionsResponse;if(t.suggestions){if(!Array.isArray(t.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");e.suggestions=[];for(var n=0;n<t.suggestions.length;++n)e.suggestions[n]=String(t.suggestions[n])}if(t.suggestionsV2){if(!Array.isArray(t.suggestionsV2))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: array expected");for(e.suggestionsV2=[],n=0;n<t.suggestionsV2.length;++n){if("object"!=typeof t.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");e.suggestionsV2[n]=r.SuggestionDescriptor.fromObject(t.suggestionsV2[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),t.suggestions&&t.suggestions.length){n.suggestions=[];for(var s=0;s<t.suggestions.length;++s)n.suggestions[s]=t.suggestions[s]}if(t.suggestionsV2&&t.suggestionsV2.length)for(n.suggestionsV2=[],s=0;s<t.suggestionsV2.length;++s)n.suggestionsV2[s]=r.SuggestionDescriptor.toObject(t.suggestionsV2[s],e);return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesGetAllSuggestionsResponse"},s}(),r.TrackChangesGetSuggestionResponse=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[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(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),null!=t.authorId&&Object.hasOwnProperty.call(t,"authorId")&&n.uint32(18).string(t.authorId),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(26).string(t.type),null!=t.createdAt&&Object.hasOwnProperty.call(t,"createdAt")&&n.uint32(34).string(t.createdAt),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(42).string(t.data),null!=t.hasComments&&Object.hasOwnProperty.call(t,"hasComments")&&n.uint32(48).bool(t.hasComments),null!=t.state&&Object.hasOwnProperty.call(t,"state")&&n.uint32(58).string(t.state),null!=t.attributes&&Object.hasOwnProperty.call(t,"attributes")&&n.uint32(66).string(t.attributes),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.TrackChangesGetSuggestionResponse;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.id=e.string();break;case 2:i.authorId=e.string();break;case 3:i.type=e.string();break;case 4:i.createdAt=e.string();break;case 5:i.data=e.string();break;case 6:i.hasComments=e.bool();break;case 7:i.state=e.string();break;case 8:i.attributes=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null!=t.authorId&&t.hasOwnProperty("authorId")&&!n.isString(t.authorId)?"authorId: string expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isString(t.type)?"type: string expected":null!=t.createdAt&&t.hasOwnProperty("createdAt")&&!n.isString(t.createdAt)?"createdAt: string expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.hasComments&&t.hasOwnProperty("hasComments")&&"boolean"!=typeof t.hasComments?"hasComments: boolean expected":null!=t.state&&t.hasOwnProperty("state")&&!n.isString(t.state)?"state: string expected":null!=t.attributes&&t.hasOwnProperty("attributes")&&!n.isString(t.attributes)?"attributes: string expected":null},s.fromObject=function(t){if(t instanceof r.TrackChangesGetSuggestionResponse)return t;var e=new r.TrackChangesGetSuggestionResponse;return null!=t.id&&(e.id=String(t.id)),null!=t.authorId&&(e.authorId=String(t.authorId)),null!=t.type&&(e.type=String(t.type)),null!=t.createdAt&&(e.createdAt=String(t.createdAt)),null!=t.data&&(e.data=String(t.data)),null!=t.hasComments&&(e.hasComments=Boolean(t.hasComments)),null!=t.state&&(e.state=String(t.state)),null!=t.attributes&&(e.attributes=String(t.attributes)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),null!=t.authorId&&t.hasOwnProperty("authorId")&&(n.authorId=t.authorId),null!=t.type&&t.hasOwnProperty("type")&&(n.type=t.type),null!=t.createdAt&&t.hasOwnProperty("createdAt")&&(n.createdAt=t.createdAt),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.hasComments&&t.hasOwnProperty("hasComments")&&(n.hasComments=t.hasComments),null!=t.state&&t.hasOwnProperty("state")&&(n.state=t.state),null!=t.attributes&&t.hasOwnProperty("attributes")&&(n.attributes=t.attributes),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/TrackChangesGetSuggestionResponse"},s}(),r.UserDescriptor=function(){function s(t){if(this.attributes=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.attributes=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.attributes&&t.attributes.length)for(var s=0;s<t.attributes.length;++s)r.KeyValueDescriptor.encode(t.attributes[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.UserDescriptor;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?(i.attributes&&i.attributes.length||(i.attributes=[]),i.attributes.push(r.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")){if(!Array.isArray(t.attributes))return"attributes: array expected";for(var e=0;e<t.attributes.length;++e){var n=r.KeyValueDescriptor.verify(t.attributes[e]);if(n)return"attributes."+n}}return null},s.fromObject=function(t){if(t instanceof r.UserDescriptor)return t;var e=new r.UserDescriptor;if(t.attributes){if(!Array.isArray(t.attributes))throw TypeError(".UserDescriptor.attributes: array expected");e.attributes=[];for(var n=0;n<t.attributes.length;++n){if("object"!=typeof t.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");e.attributes[n]=r.KeyValueDescriptor.fromObject(t.attributes[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.attributes=[]),t.attributes&&t.attributes.length){n.attributes=[];for(var s=0;s<t.attributes.length;++s)n.attributes[s]=r.KeyValueDescriptor.toObject(t.attributes[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/UserDescriptor"},s}(),r.GetManyUsersMessage=function(){function s(t){if(this.ids=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.ids=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.ids&&t.ids.length)for(var r=0;r<t.ids.length;++r)n.uint32(10).string(t.ids[r]);return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetManyUsersMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?(i.ids&&i.ids.length||(i.ids=[]),i.ids.push(e.string())):e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.ids&&t.hasOwnProperty("ids")){if(!Array.isArray(t.ids))return"ids: array expected";for(var e=0;e<t.ids.length;++e)if(!n.isString(t.ids[e]))return"ids: string[] expected"}return null},s.fromObject=function(t){if(t instanceof r.GetManyUsersMessage)return t;var e=new r.GetManyUsersMessage;if(t.ids){if(!Array.isArray(t.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");e.ids=[];for(var n=0;n<t.ids.length;++n)e.ids[n]=String(t.ids[n])}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.ids=[]),t.ids&&t.ids.length){n.ids=[];for(var r=0;r<t.ids.length;++r)n.ids[r]=t.ids[r]}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetManyUsersMessage"},s}(),r.GetUserMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.id="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(10).string(t.id),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetUserMessage;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?i.id=e.string():e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isString(t.id)?"id: string expected":null},s.fromObject=function(t){if(t instanceof r.GetUserMessage)return t;var e=new r.GetUserMessage;return null!=t.id&&(e.id=String(t.id)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.id=""),null!=t.id&&t.hasOwnProperty("id")&&(n.id=t.id),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetUserMessage"},s}(),r.GetManyUsersResponse=function(){function s(t){if(this.users=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.users=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.users&&t.users.length)for(var s=0;s<t.users.length;++s)r.UserDescriptor.encode(t.users[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetManyUsersResponse;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?(i.users&&i.users.length||(i.users=[]),i.users.push(r.UserDescriptor.decode(e,e.uint32()))):e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.users&&t.hasOwnProperty("users")){if(!Array.isArray(t.users))return"users: array expected";for(var e=0;e<t.users.length;++e){var n=r.UserDescriptor.verify(t.users[e]);if(n)return"users."+n}}return null},s.fromObject=function(t){if(t instanceof r.GetManyUsersResponse)return t;var e=new r.GetManyUsersResponse;if(t.users){if(!Array.isArray(t.users))throw TypeError(".GetManyUsersResponse.users: array expected");e.users=[];for(var n=0;n<t.users.length;++n){if("object"!=typeof t.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");e.users[n]=r.UserDescriptor.fromObject(t.users[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.users=[]),t.users&&t.users.length){n.users=[];for(var s=0;s<t.users.length;++s)n.users[s]=r.UserDescriptor.toObject(t.users[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetManyUsersResponse"},s}(),r.GetUserResponse=function(){function s(t){if(this.attributes=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.attributes=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.attributes&&t.attributes.length)for(var s=0;s<t.attributes.length;++s)r.KeyValueDescriptor.encode(t.attributes[s],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.GetUserResponse;e.pos<o;){var a=e.uint32();if(a===s)break;a>>>3==1?(i.attributes&&i.attributes.length||(i.attributes=[]),i.attributes.push(r.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&a)}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.attributes&&t.hasOwnProperty("attributes")){if(!Array.isArray(t.attributes))return"attributes: array expected";for(var e=0;e<t.attributes.length;++e){var n=r.KeyValueDescriptor.verify(t.attributes[e]);if(n)return"attributes."+n}}return null},s.fromObject=function(t){if(t instanceof r.GetUserResponse)return t;var e=new r.GetUserResponse;if(t.attributes){if(!Array.isArray(t.attributes))throw TypeError(".GetUserResponse.attributes: array expected");e.attributes=[];for(var n=0;n<t.attributes.length;++n){if("object"!=typeof t.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");e.attributes[n]=r.KeyValueDescriptor.fromObject(t.attributes[n])}}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.attributes=[]),t.attributes&&t.attributes.length){n.attributes=[];for(var s=0;s<t.attributes.length;++s)n.attributes[s]=r.KeyValueDescriptor.toObject(t.attributes[s],e)}return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/GetUserResponse"},s}(),r.ChannelMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.type=0,s.prototype.socketId="",s.prototype.data=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(8).uint32(t.type),null!=t.socketId&&Object.hasOwnProperty.call(t,"socketId")&&n.uint32(18).string(t.socketId),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(26).bytes(t.data),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.ChannelMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.type=e.uint32();break;case 2:i.socketId=e.string();break;case 3:i.data=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isInteger(t.type)?"type: integer expected":null!=t.socketId&&t.hasOwnProperty("socketId")&&!n.isString(t.socketId)?"socketId: string expected":null!=t.data&&t.hasOwnProperty("data")&&!(t.data&&"number"==typeof t.data.length||n.isString(t.data))?"data: buffer expected":null},s.fromObject=function(t){if(t instanceof r.ChannelMessage)return t;var e=new r.ChannelMessage;return null!=t.type&&(e.type=t.type>>>0),null!=t.socketId&&(e.socketId=String(t.socketId)),null!=t.data&&("string"==typeof t.data?n.base64.decode(t.data,e.data=n.newBuffer(n.base64.length(t.data)),0):t.data.length>=0&&(e.data=t.data)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.type=0,r.socketId="",e.bytes===String?r.data="":(r.data=[],e.bytes!==Array&&(r.data=n.newBuffer(r.data)))),null!=t.type&&t.hasOwnProperty("type")&&(r.type=t.type),null!=t.socketId&&t.hasOwnProperty("socketId")&&(r.socketId=t.socketId),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?n.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/ChannelMessage"},s}(),r.BytesBytesPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=n.newBuffer([]),s.prototype.data1=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).bytes(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).bytes(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.BytesBytesPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.bytes();break;case 2:i.data1=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!(t.data&&"number"==typeof t.data.length||n.isString(t.data))?"data: buffer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!(t.data1&&"number"==typeof t.data1.length||n.isString(t.data1))?"data1: buffer expected":null},s.fromObject=function(t){if(t instanceof r.BytesBytesPacketDataMessage)return t;var e=new r.BytesBytesPacketDataMessage;return null!=t.data&&("string"==typeof t.data?n.base64.decode(t.data,e.data=n.newBuffer(n.base64.length(t.data)),0):t.data.length>=0&&(e.data=t.data)),null!=t.data1&&("string"==typeof t.data1?n.base64.decode(t.data1,e.data1=n.newBuffer(n.base64.length(t.data1)),0):t.data1.length>=0&&(e.data1=t.data1)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.data="":(r.data=[],e.bytes!==Array&&(r.data=n.newBuffer(r.data))),e.bytes===String?r.data1="":(r.data1=[],e.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?n.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(r.data1=e.bytes===String?n.base64.encode(t.data1,0,t.data1.length):e.bytes===Array?Array.prototype.slice.call(t.data1):t.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/BytesBytesPacketDataMessage"},s}(),r.NumberBytesPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=0,s.prototype.data1=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(8).uint32(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).bytes(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.NumberBytesPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.uint32();break;case 2:i.data1=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isInteger(t.data)?"data: integer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!(t.data1&&"number"==typeof t.data1.length||n.isString(t.data1))?"data1: buffer expected":null},s.fromObject=function(t){if(t instanceof r.NumberBytesPacketDataMessage)return t;var e=new r.NumberBytesPacketDataMessage;return null!=t.data&&(e.data=t.data>>>0),null!=t.data1&&("string"==typeof t.data1?n.base64.decode(t.data1,e.data1=n.newBuffer(n.base64.length(t.data1)),0):t.data1.length>=0&&(e.data1=t.data1)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.data=0,e.bytes===String?r.data1="":(r.data1=[],e.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=t.data&&t.hasOwnProperty("data")&&(r.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(r.data1=e.bytes===String?n.base64.encode(t.data1,0,t.data1.length):e.bytes===Array?Array.prototype.slice.call(t.data1):t.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/NumberBytesPacketDataMessage"},s}(),r.NumberNumberPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=0,s.prototype.data1=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(8).uint32(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(16).uint32(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.NumberNumberPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.uint32();break;case 2:i.data1=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isInteger(t.data)?"data: integer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isInteger(t.data1)?"data1: integer expected":null},s.fromObject=function(t){if(t instanceof r.NumberNumberPacketDataMessage)return t;var e=new r.NumberNumberPacketDataMessage;return null!=t.data&&(e.data=t.data>>>0),null!=t.data1&&(e.data1=t.data1>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data=0,n.data1=0),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/NumberNumberPacketDataMessage"},s}(),r.NumberObjectPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(8).uint32(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.NumberObjectPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.uint32();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isInteger(t.data)?"data: integer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.NumberObjectPacketDataMessage)return t;var e=new r.NumberObjectPacketDataMessage;return null!=t.data&&(e.data=t.data>>>0),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data=0,n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/NumberObjectPacketDataMessage"},s}(),r.NumberStringPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data=0,s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(8).uint32(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.NumberStringPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.uint32();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isInteger(t.data)?"data: integer expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.NumberStringPacketDataMessage)return t;var e=new r.NumberStringPacketDataMessage;return null!=t.data&&(e.data=t.data>>>0),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data=0,n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/NumberStringPacketDataMessage"},s}(),r.ObjectBufferPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).bytes(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.ObjectBufferPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!(t.data1&&"number"==typeof t.data1.length||n.isString(t.data1))?"data1: buffer expected":null},s.fromObject=function(t){if(t instanceof r.ObjectBufferPacketDataMessage)return t;var e=new r.ObjectBufferPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&("string"==typeof t.data1?n.base64.decode(t.data1,e.data1=n.newBuffer(n.base64.length(t.data1)),0):t.data1.length>=0&&(e.data1=t.data1)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.data="",e.bytes===String?r.data1="":(r.data1=[],e.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=t.data&&t.hasOwnProperty("data")&&(r.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(r.data1=e.bytes===String?n.base64.encode(t.data1,0,t.data1.length):e.bytes===Array?Array.prototype.slice.call(t.data1):t.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/ObjectBufferPacketDataMessage"},s}(),r.ObjectObjectPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.ObjectObjectPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.ObjectObjectPacketDataMessage)return t;var e=new r.ObjectObjectPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data="",n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/ObjectObjectPacketDataMessage"},s}(),r.PacketMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.type=0,s.prototype.id=0,s.prototype.nsp="",s.prototype.data=n.newBuffer([]),s.prototype.options=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.type&&Object.hasOwnProperty.call(t,"type")&&n.uint32(8).uint32(t.type),null!=t.id&&Object.hasOwnProperty.call(t,"id")&&n.uint32(16).uint32(t.id),null!=t.nsp&&Object.hasOwnProperty.call(t,"nsp")&&n.uint32(26).string(t.nsp),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(34).bytes(t.data),null!=t.options&&Object.hasOwnProperty.call(t,"options")&&n.uint32(42).bytes(t.options),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.PacketMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.type=e.uint32();break;case 2:i.id=e.uint32();break;case 3:i.nsp=e.string();break;case 4:i.data=e.bytes();break;case 5:i.options=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.type&&t.hasOwnProperty("type")&&!n.isInteger(t.type)?"type: integer expected":null!=t.id&&t.hasOwnProperty("id")&&!n.isInteger(t.id)?"id: integer expected":null!=t.nsp&&t.hasOwnProperty("nsp")&&!n.isString(t.nsp)?"nsp: string expected":null!=t.data&&t.hasOwnProperty("data")&&!(t.data&&"number"==typeof t.data.length||n.isString(t.data))?"data: buffer expected":null!=t.options&&t.hasOwnProperty("options")&&!(t.options&&"number"==typeof t.options.length||n.isString(t.options))?"options: buffer expected":null},s.fromObject=function(t){if(t instanceof r.PacketMessage)return t;var e=new r.PacketMessage;return null!=t.type&&(e.type=t.type>>>0),null!=t.id&&(e.id=t.id>>>0),null!=t.nsp&&(e.nsp=String(t.nsp)),null!=t.data&&("string"==typeof t.data?n.base64.decode(t.data,e.data=n.newBuffer(n.base64.length(t.data)),0):t.data.length>=0&&(e.data=t.data)),null!=t.options&&("string"==typeof t.options?n.base64.decode(t.options,e.options=n.newBuffer(n.base64.length(t.options)),0):t.options.length>=0&&(e.options=t.options)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.type=0,r.id=0,r.nsp="",e.bytes===String?r.data="":(r.data=[],e.bytes!==Array&&(r.data=n.newBuffer(r.data))),e.bytes===String?r.options="":(r.options=[],e.bytes!==Array&&(r.options=n.newBuffer(r.options)))),null!=t.type&&t.hasOwnProperty("type")&&(r.type=t.type),null!=t.id&&t.hasOwnProperty("id")&&(r.id=t.id),null!=t.nsp&&t.hasOwnProperty("nsp")&&(r.nsp=t.nsp),null!=t.data&&t.hasOwnProperty("data")&&(r.data=e.bytes===String?n.base64.encode(t.data,0,t.data.length):e.bytes===Array?Array.prototype.slice.call(t.data):t.data),null!=t.options&&t.hasOwnProperty("options")&&(r.options=e.bytes===String?n.base64.encode(t.options,0,t.options.length):e.bytes===Array?Array.prototype.slice.call(t.options):t.options),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/PacketMessage"},s}(),r.PacketOptionsMessage=function(){function s(t){if(this.rooms=[],this.except=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.flags="",s.prototype.rooms=n.emptyArray,s.prototype.except=n.emptyArray,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.flags&&Object.hasOwnProperty.call(t,"flags")&&n.uint32(10).string(t.flags),null!=t.rooms&&t.rooms.length)for(var r=0;r<t.rooms.length;++r)n.uint32(18).string(t.rooms[r]);if(null!=t.except&&t.except.length)for(r=0;r<t.except.length;++r)n.uint32(26).string(t.except[r]);return n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.PacketOptionsMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.flags=e.string();break;case 2:i.rooms&&i.rooms.length||(i.rooms=[]),i.rooms.push(e.string());break;case 3:i.except&&i.except.length||(i.except=[]),i.except.push(e.string());break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.flags&&t.hasOwnProperty("flags")&&!n.isString(t.flags))return"flags: string expected";if(null!=t.rooms&&t.hasOwnProperty("rooms")){if(!Array.isArray(t.rooms))return"rooms: array expected";for(var e=0;e<t.rooms.length;++e)if(!n.isString(t.rooms[e]))return"rooms: string[] expected"}if(null!=t.except&&t.hasOwnProperty("except")){if(!Array.isArray(t.except))return"except: array expected";for(e=0;e<t.except.length;++e)if(!n.isString(t.except[e]))return"except: string[] expected"}return null},s.fromObject=function(t){if(t instanceof r.PacketOptionsMessage)return t;var e=new r.PacketOptionsMessage;if(null!=t.flags&&(e.flags=String(t.flags)),t.rooms){if(!Array.isArray(t.rooms))throw TypeError(".PacketOptionsMessage.rooms: array expected");e.rooms=[];for(var n=0;n<t.rooms.length;++n)e.rooms[n]=String(t.rooms[n])}if(t.except){if(!Array.isArray(t.except))throw TypeError(".PacketOptionsMessage.except: array expected");for(e.except=[],n=0;n<t.except.length;++n)e.except[n]=String(t.except[n])}return e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.rooms=[],n.except=[]),e.defaults&&(n.flags=""),null!=t.flags&&t.hasOwnProperty("flags")&&(n.flags=t.flags),t.rooms&&t.rooms.length){n.rooms=[];for(var r=0;r<t.rooms.length;++r)n.rooms[r]=t.rooms[r]}if(t.except&&t.except.length)for(n.except=[],r=0;r<t.except.length;++r)n.except[r]=t.except[r];return n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/PacketOptionsMessage"},s}(),r.StringBytesPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1=n.newBuffer([]),s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).bytes(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.StringBytesPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.bytes();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!(t.data1&&"number"==typeof t.data1.length||n.isString(t.data1))?"data1: buffer expected":null},s.fromObject=function(t){if(t instanceof r.StringBytesPacketDataMessage)return t;var e=new r.StringBytesPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&("string"==typeof t.data1?n.base64.decode(t.data1,e.data1=n.newBuffer(n.base64.length(t.data1)),0):t.data1.length>=0&&(e.data1=t.data1)),e},s.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.data="",e.bytes===String?r.data1="":(r.data1=[],e.bytes!==Array&&(r.data1=n.newBuffer(r.data1)))),null!=t.data&&t.hasOwnProperty("data")&&(r.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(r.data1=e.bytes===String?n.base64.encode(t.data1,0,t.data1.length):e.bytes===Array?Array.prototype.slice.call(t.data1):t.data1),r},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringBytesPacketDataMessage"},s}(),r.StringNumberPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1=0,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(16).uint32(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.StringNumberPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.uint32();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isInteger(t.data1)?"data1: integer expected":null},s.fromObject=function(t){if(t instanceof r.StringNumberPacketDataMessage)return t;var e=new r.StringNumberPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&(e.data1=t.data1>>>0),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data="",n.data1=0),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringNumberPacketDataMessage"},s}(),r.StringObjectPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.StringObjectPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.StringObjectPacketDataMessage)return t;var e=new r.StringObjectPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data="",n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringObjectPacketDataMessage"},s}(),r.StringStringPacketDataMessage=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.data="",s.prototype.data1="",s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(10).string(t.data),null!=t.data1&&Object.hasOwnProperty.call(t,"data1")&&n.uint32(18).string(t.data1),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n,s){e instanceof t||(e=t.create(e));for(var o=void 0===n?e.len:e.pos+n,i=new r.StringStringPacketDataMessage;e.pos<o;){var a=e.uint32();if(a===s)break;switch(a>>>3){case 1:i.data=e.string();break;case 2:i.data1=e.string();break;default:e.skipType(7&a)}}return i},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data)?"data: string expected":null!=t.data1&&t.hasOwnProperty("data1")&&!n.isString(t.data1)?"data1: string expected":null},s.fromObject=function(t){if(t instanceof r.StringStringPacketDataMessage)return t;var e=new r.StringStringPacketDataMessage;return null!=t.data&&(e.data=String(t.data)),null!=t.data1&&(e.data1=String(t.data1)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.data="",n.data1=""),null!=t.data&&t.hasOwnProperty("data")&&(n.data=t.data),null!=t.data1&&t.hasOwnProperty("data1")&&(n.data1=t.data1),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringStringPacketDataMessage"},s}(),r})();class l{static decode(t,e){const n=p(e).decode("undefined"==typeof window?t:new Uint8Array(t));return e.fromJSON({...n})}static encode(t){const e=p(t.constructor),n=t.toJSON(),r=e.verify(n);if(r)throw Error(r);return e.encode(e.create(n)).finish()}}function p(t){return u[t.DESCRIPTOR_NAME]}class h extends i{ids;static TYPE="22";static READABLE_TYPE_NAME="getManyUsers";static DESCRIPTOR_NAME="GetManyUsersMessage";static DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};constructor(t){super(),this.ids=t}toJSON(){return{ids:this.ids}}static fromJSON(t){return new h(t.ids)}}class f extends i{users;static DESCRIPTOR_NAME="GetManyUsersResponse";static DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};constructor(t){super(),this.users=t}toJSON(){return{users:this.users.map(m)}}static fromJSON(t){return new f(t.users.map(y))}}function m(t){return{attributes:Object.keys(t).map(e=>({key:e,value:JSON.stringify(t[e])}))}}function y(t){return t.attributes.reduce((t,e)=>(t[e.key]=e.value?JSON.parse(e.value):null,t),{})}class g{static _SERVICE=2;constructor(t={}){this._attributes=new Map;for(const e of Object.keys(t))"id"!==e?(this._attributes.set(e,t[e]),Object.defineProperty(this,e,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(e)})):this.id=t.id}static fromData(t){return new g(t)}static async get(t,e){const n=new a(e);try{const e=await t._sendRequest(g._SERVICE,a.TYPE,l.encode(n)),r=l.decode(e,c);return new g(r.attributes)}catch(t){return new g({id:e})}}static async getMany(t,e){const n=new h(e);try{const e=await t._sendRequest(g._SERVICE,h.TYPE,l.encode(n));return l.decode(e,f).users.map(t=>new g(t))}catch(t){return e.map(t=>new g({id:t}))}}}const b=g,O=Object.create(null);O.open="0",O.close="1",O.ping="2",O.pong="3",O.message="4",O.upgrade="5",O.noop="6";const w=Object.create(null);Object.keys(O).forEach(t=>{w[O[t]]=t});const I={type:"error",data:"parser error"},v="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),S="function"==typeof ArrayBuffer,k=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,P=({type:t,data:e},n,r)=>v&&e instanceof Blob?n?r(e):A(e,r):S&&(e instanceof ArrayBuffer||k(e))?n?r(e):A(new Blob([e]),r):r(O[t]+(e||"")),A=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+(t||""))},n.readAsDataURL(t)};function T(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let _;const C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)j[C.charCodeAt(t)]=t;const E="function"==typeof ArrayBuffer,D=(t,e)=>{if("string"!=typeof t)return{type:"message",data:x(t,e)};const n=t.charAt(0);if("b"===n)return{type:"message",data:R(t.substring(1),e)};return w[n]?t.length>1?{type:w[n],data:t.substring(1)}:{type:w[n]}:I},R=(t,e)=>{if(E){const n=(t=>{let e,n,r,s,o,i=.75*t.length,a=t.length,c=0;"="===t[t.length-1]&&(i--,"="===t[t.length-2]&&i--);const d=new ArrayBuffer(i),u=new Uint8Array(d);for(e=0;e<a;e+=4)n=j[t.charCodeAt(e)],r=j[t.charCodeAt(e+1)],s=j[t.charCodeAt(e+2)],o=j[t.charCodeAt(e+3)],u[c++]=n<<2|r>>4,u[c++]=(15&r)<<4|s>>2,u[c++]=(3&s)<<6|63&o;return d})(t);return x(n,e)}return{base64:!0,data:t}},x=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,N=String.fromCharCode(30);function V(){return new TransformStream({transform(t,e){!function(t,e){v&&t.data instanceof Blob?t.data.arrayBuffer().then(T).then(e):S&&(t.data instanceof ArrayBuffer||k(t.data))?e(T(t.data)):P(t,!1,t=>{_||(_=new TextEncoder),e(_.encode(t))})}(t,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const t=new DataView(s.buffer);t.setUint8(0,126),t.setUint16(1,r)}else{s=new Uint8Array(9);const t=new DataView(s.buffer);t.setUint8(0,127),t.setBigUint64(1,BigInt(r))}t.data&&"string"!=typeof t.data&&(s[0]|=128),e.enqueue(s),e.enqueue(n)})}})}let M;function B(t){return t.reduce((t,e)=>t+e.length,0)}function U(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let s=0;s<e;s++)n[s]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function J(t){if(t)return function(t){for(var e in J.prototype)t[e]=J.prototype[e];return t}(t)}J.prototype.on=J.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},J.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},J.prototype.off=J.prototype.removeListener=J.prototype.removeAllListeners=J.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var s=0;s<r.length;s++)if((n=r[s])===e||n.fn===e){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},J.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,e)}return this},J.prototype.emitReserved=J.prototype.emit,J.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},J.prototype.hasListeners=function(t){return!!this.listeners(t).length};const q="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function L(t,...e){return e.reduce((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e),{})}const G=q.setTimeout,H=q.clearTimeout;function Y(t,e){e.useNativeTimers?(t.setTimeoutFn=G.bind(q),t.clearTimeoutFn=H.bind(q)):(t.setTimeoutFn=q.setTimeout.bind(q),t.clearTimeoutFn=q.clearTimeout.bind(q))}function z(t){return"string"==typeof t?function(t){let e=0,n=0;for(let r=0,s=t.length;r<s;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))}class F extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class K extends J{constructor(t){super(),this.writable=!1,Y(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,n){return super.emitReserved("error",new F(t,e,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const e=D(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){const t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(t){const e=function(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}(t);return e.length?"?"+e:""}}const W="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),X={};let Z,$=0,Q=0;function tt(t){let e="";do{e=W[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}function et(){const t=tt(+new Date);return t!==Z?($=0,Z=t):t+"."+tt($++)}for(;Q<64;Q++)X[W[Q]]=Q;let nt=!1;try{nt="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}const rt=nt;function st(t){const e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||rt))return new XMLHttpRequest}catch(t){}if(!e)try{return new(q[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}function ot(){}const it=null!=new st({xdomain:!1}).responseType;class at extends J{constructor(t,e){super(),Y(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.data=void 0!==e.data?e.data:null,this.create()}create(){var t;const e=L(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;const n=this.xhr=new st(e);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&n.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(t){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{n.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var t;3===n.readyState&&(null===(t=this.opts.cookieJar)||void 0===t||t.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn(()=>{this.onError("number"==typeof n.status?n.status:0)},0))},n.send(this.data)}catch(t){return void this.setTimeoutFn(()=>{this.onError(t)},0)}"undefined"!=typeof document&&(this.index=at.requestsCount++,at.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=ot,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete at.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(at.requestsCount=0,at.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",ct);else if("function"==typeof addEventListener){addEventListener("onpagehide"in q?"pagehide":"unload",ct,!1)}function ct(){for(let t in at.requests)at.requests.hasOwnProperty(t)&&at.requests[t].abort()}const dt="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),ut=q.WebSocket||q.MozWebSocket,lt="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const pt={websocket:class extends K{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,n=lt?{}:L(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=lt?new ut(t,e,n):e?new ut(t,e):new ut(t)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;P(n,this.supportsBinary,t=>{try{this.ws.send(t)}catch(t){}r&&dt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=et()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}check(){return!!ut}},webtransport:class extends K{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const e=function(t,e){M||(M=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(0===r){if(B(n)<1)break;const t=U(n,1);o=!(128&~t[0]),s=127&t[0],r=s<126?3:126===s?1:2}else if(1===r){if(B(n)<2)break;const t=U(n,2);s=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),r=3}else if(2===r){if(B(n)<8)break;const t=U(n,8),e=new DataView(t.buffer,t.byteOffset,t.length),o=e.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(I);break}s=o*Math.pow(2,32)+e.getUint32(4),r=3}else{if(B(n)<s)break;const t=U(n,s);a.enqueue(D(o?t:M.decode(t),e)),r=0}if(0===s||s>t){a.enqueue(I);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(e).getReader(),r=V();r.readable.pipeTo(t.writable),this.writer=r.writable.getWriter();const s=()=>{n.read().then(({done:t,value:e})=>{t||(this.onPacket(e),s())}).catch(t=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;this.writer.write(n).then(()=>{r&&dt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;null===(t=this.transport)||void 0===t||t.close()}},polling:class extends K{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){const e="https:"===location.protocol;let n=location.port;n||(n=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||n!==t.port}const e=t&&t.forceBase64;this.supportsBinary=it&&!e,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){((t,e)=>{const n=t.split(N),r=[];for(let t=0;t<n.length;t++){const s=D(n[t],e);if(r.push(s),"error"===s.type)break}return r})(t,this.socket.binaryType).forEach(t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)}),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,((t,e)=>{const n=t.length,r=new Array(n);let s=0;t.forEach((t,o)=>{P(t,!1,t=>{r[o]=t,++s===n&&e(r.join(N))})})})(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=et()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new at(this.uri(),t)}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",(t,e)=>{this.onError("xhr post error",t,e)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(t,e)=>{this.onError("xhr poll error",t,e)}),this.pollXhr=t}}},ht=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ft=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function mt(t){if(t.length>2e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");-1!=n&&-1!=r&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let s=ht.exec(t||""),o={},i=14;for(;i--;)o[ft[i]]=s[i]||"";return-1!=n&&-1!=r&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=function(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");"/"!=e.slice(0,1)&&0!==e.length||r.splice(0,1);"/"==e.slice(-1)&&r.splice(r.length-1,1);return r}(0,o.path),o.queryKey=function(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,r){e&&(n[e]=r)}),n}(0,o.query),o}class yt extends J{constructor(t,e={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=mt(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=mt(e.host).host),Y(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket","webtransport"],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:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},n=t.split("&");for(let t=0,r=n.length;t<r;t++){let r=n[t].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}(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(t){const e=Object.assign({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);const n=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new pt[t](n)}open(){let t;if(this.opts.rememberUpgrade&&yt.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(t){let e=this.createTransport(t),n=!1;yt.priorWebsocketSuccess=!1;const r=()=>{n||(e.send([{type:"ping",data:"probe"}]),e.once("packet",t=>{if(!n)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;yt.priorWebsocketSuccess="websocket"===e.name,this.transport.pause(()=>{n||"closed"!==this.readyState&&(d(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{const t=new Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}}))};function s(){n||(n=!0,d(),e.close(),e=null)}const o=t=>{const n=new Error("probe error: "+t);n.transport=e.name,s(),this.emitReserved("upgradeError",n)};function i(){o("transport closed")}function a(){o("socket closed")}function c(t){e&&t.name!==e.name&&s()}const d=()=>{e.removeListener("open",r),e.removeListener("error",o),e.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};e.once("open",r),e.once("error",o),e.once("close",i),this.once("close",a),this.once("upgrading",c),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn(()=>{n||e.open()},200):e.open()}onOpen(){if(this.readyState="open",yt.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let t=0;const e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.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 t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let e=0;e<this.writeBuffer.length;e++){const n=this.writeBuffer[e].data;if(n&&(t+=z(n)),e>0&&t>this.maxPayload)return this.writeBuffer.slice(0,e);t+=2}return this.writeBuffer}write(t,e,n){return this.sendPacket("message",t,e,n),this}send(t,e,n){return this.sendPacket("message",t,e,n),this}sendPacket(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:t,data:e,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}onError(t){yt.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(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",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let n=0;const r=t.length;for(;n<r;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}yt.protocol=4;yt.protocol;const gt="function"==typeof ArrayBuffer,bt=Object.prototype.toString,Ot="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===bt.call(Blob),wt="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===bt.call(File);function It(t){return gt&&(t instanceof ArrayBuffer||(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer)(t))||Ot&&t instanceof Blob||wt&&t instanceof File}function vt(t,e){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let e=0,n=t.length;e<n;e++)if(vt(t[e]))return!0;return!1}if(It(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return vt(t.toJSON(),!0);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&vt(t[e]))return!0;return!1}function St(t){const e=[],n=t.data,r=t;return r.data=kt(n,e),r.attachments=e.length,{packet:r,buffers:e}}function kt(t,e){if(!t)return t;if(It(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=kt(t[r],e);return n}if("object"==typeof t&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=kt(t[r],e));return n}return t}function Pt(t,e){return t.data=At(t.data,e),delete t.attachments,t}function At(t,e){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=At(t[n],e);else if("object"==typeof t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=At(t[n],e));return t}const Tt=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],_t=5;var Ct;!function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(Ct||(Ct={}));class jt{constructor(t){this.replacer=t}encode(t){return t.type!==Ct.EVENT&&t.type!==Ct.ACK||!vt(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===Ct.EVENT?Ct.BINARY_EVENT:Ct.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==Ct.BINARY_EVENT&&t.type!==Ct.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){const e=St(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r}}function Et(t){return"[object Object]"===Object.prototype.toString.call(t)}class Dt extends J{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);const n=e.type===Ct.BINARY_EVENT;n||e.type===Ct.BINARY_ACK?(e.type=n?Ct.EVENT:Ct.ACK,this.reconstructor=new Rt(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!It(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;const n={type:Number(t.charAt(0))};if(void 0===Ct[n.type])throw new Error("unknown packet type "+n.type);if(n.type===Ct.BINARY_EVENT||n.type===Ct.BINARY_ACK){const r=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);const s=t.substring(r,e);if(s!=Number(s)||"-"!==t.charAt(e))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===t.charAt(e+1)){const r=e+1;for(;++e;){if(","===t.charAt(e))break;if(e===t.length)break}n.nsp=t.substring(r,e)}else n.nsp="/";const r=t.charAt(e+1);if(""!==r&&Number(r)==r){const r=e+1;for(;++e;){const n=t.charAt(e);if(null==n||Number(n)!=n){--e;break}if(e===t.length)break}n.id=Number(t.substring(r,e+1))}if(t.charAt(++e)){const r=this.tryParse(t.substr(e));if(!Dt.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case Ct.CONNECT:return Et(e);case Ct.DISCONNECT:return void 0===e;case Ct.CONNECT_ERROR:return"string"==typeof e||Et(e);case Ct.EVENT:case Ct.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===Tt.indexOf(e[0]));case Ct.ACK:case Ct.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Rt{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=Pt(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function xt(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Nt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Vt extends J{constructor(t,e,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=t,this.nsp=e,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 t=this.io;this.subs=[xt(t,"open",this.onopen.bind(this)),xt(t,"packet",this.onpacket.bind(this)),xt(t,"error",this.onerror.bind(this)),xt(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(Nt.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const n={type:Ct.EVENT,data:e,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){const t=this.ids++,r=e.pop();this._registerAckCallback(t,r),n.id=t}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(t,e){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[t]=e);const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,new Error("operation has timed out"))},r);this.acks[t]=(...t)=>{this.io.clearTimeoutFn(s),e.apply(this,[null,...t])}}emitWithAck(t,...e){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise((r,s)=>{e.push((t,e)=>n?t?s(t):r(e):r(t)),this.emit(t,...e)})}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((t,...r)=>{if(n!==this._queue[0])return;return null!==t?n.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...r)),n.pending=!1,this._drainQueue()}),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;const e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ct.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ct.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 Ct.EVENT:case Ct.BINARY_EVENT:this.onevent(t);break;case Ct.ACK:case Ct.BINARY_ACK:this.onack(t);break;case Ct.DISCONNECT:this.ondisconnect();break;case Ct.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let n=!1;return function(...r){n||(n=!0,e.packet({type:Ct.ACK,id:t,data:r}))}}onack(t){const e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ct.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const n of e)n.apply(this,t.data)}}}function Mt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Mt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=1&Math.floor(10*e)?t+n:t-n}return 0|Math.min(t,this.max)},Mt.prototype.reset=function(){this.attempts=0},Mt.prototype.setMin=function(t){this.ms=t},Mt.prototype.setMax=function(t){this.max=t},Mt.prototype.setJitter=function(t){this.jitter=t};class Bt extends J{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(n=e,e=void 0),(n=n||{}).path=n.path||"/socket.io",this.opts=n,Y(this,n),this.reconnection(!1!==n.reconnection),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=n.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new Mt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==n.timeout?2e4:n.timeout),this._readyState="closed",this.uri=e;const s=n.parser||t;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=!1!==n.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new yt(this.uri,this.opts);const e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=xt(e,"open",function(){n.onopen(),t&&t()}),s=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},o=xt(e,"error",s);if(!1!==this._timeout){const t=this._timeout,n=this.setTimeoutFn(()=>{r(),s(new Error("timeout")),e.close()},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xt(t,"ping",this.onping.bind(this)),xt(t,"data",this.ondata.bind(this)),xt(t,"error",this.onerror.bind(this)),xt(t,"close",this.onclose.bind(this)),xt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){dt(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new Vt(this,t,e),this.nsps[t]=n),n}_destroy(t){const e=Object.keys(this.nsps);for(const t of e){if(this.nsps[t].active)return}this._close()}_packet(t){const e=this.encoder.encode(t);for(let n=0;n<e.length;n++)this.engine.write(e[n],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ut={};function Jt(t,e){"object"==typeof t&&(e=t,t=void 0);const n=function(t,e="",n){let r=t;n=n||"undefined"!=typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==n?n.protocol+"//"+t:"https://"+t),r=mt(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}(t,(e=e||{}).path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=Ut[s]&&o in Ut[s].nsps;let a;return e.forceNew||e["force new connection"]||!1===e.multiplex||i?a=new Bt(r,e):(Ut[s]||(Ut[s]=new Bt(r,e)),a=Ut[s]),n.query&&!e.query&&(e.query=n.queryKey),a.socket(n.path,e)}Object.assign(Jt,{Manager:Bt,Socket:Vt,io:Jt,connect:Jt});var qt=__webpack_require__(835);class Lt extends i{type;socketId;data;static DESCRIPTOR_NAME="ChannelMessage";static DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};constructor(t,e,n){super(),this.type=t,this.socketId=e,this.data=n}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(t){return new Lt(t.type,t.socketId,t.data)}}const Gt=class extends((0,n.EmitterMixin)()){_channelName;_wsGateway;_socket;constructor(t,e,n){super(),this._channelName=t,this._wsGateway=e,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(t,e=!1){let n="";return e&&(n+="all:"),n+="event",t&&(n+=":"+t),n}_subscribeToChannel(){this._socket.on(this._channelName,t=>{const e=l.decode(t,Lt);this.fire(this.getEventName(e.type,!0),e.data,e.socketId),e.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(e.type),e.data,e.socketId)})}};class Ht extends Error{context;code;data;constructor(t,e,n=null,r={}){super("cloud-services-internal-error: "+t),this.context=e,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(t){return new Ht(function(t){let e="cloud-services-error: "+t.message;return t.data&&(e+="\nError data: "+JSON.stringify(t.data)),t.explanation&&(e+="\nExplanation: "+t.explanation),t.action&&(e+="\nAction: "+t.action),t.traceId&&(e+="\nTraceId: "+t.traceId),t.code&&(e+="\nCode: "+t.code),e}(t),t)}}class Yt extends Error{code;traceId;data;constructor(t,e){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=t,this.code=e.code,this.traceId=e.traceId,this.data=e.data}static fromPublicError(t){return new Yt(function(t){let e="cloud-services-server-error: "+t.message;return t.explanation&&(e+="\nExplanation: "+t.explanation),t.action&&(e+="\nAction: "+t.action),t.traceId&&(e+="\nTraceId: "+t.traceId),t.code&&(e+="\nCode: "+t.code),e}(t),t)}}class zt extends i{flags;rooms;except;static TYPE=11;static DESCRIPTOR_NAME="PacketOptionsMessage";static DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};constructor(t,e=[],n=[]){super(),this.flags=t,this.rooms=e,this.except=n}toJSON(){return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:this.rooms?.length?this.rooms:void 0,except:this.except?.length?this.except:void 0}}static fromJSON(t){return new zt(t.flags&&JSON.parse(t.flags),t.rooms,t.except)}}const Ft=(()=>!("undefined"==typeof process||!process.versions?.node))(),Kt=1,Wt=2,Xt=3,Zt=4;class $t{static getPacketType(...t){let e=0;for(let n=0;n<t.length;n++)e+=t[n]*Math.pow(10,t.length-n-1);return e}static getType(t){if($t.isBuffer(t))return Kt;const e=typeof t;return"string"===e?Wt:"number"===e?Xt:Zt}static isBuffer(t){return Ft&&Buffer.isBuffer(t)||t instanceof ArrayBuffer||t instanceof Uint8Array||this._isBufferView(t)}static _isBufferView(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer}}class Qt extends i{data;data1;static create(t,e){throw new TypeError("Must be implemented in a child class!")}}class te extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Xt,Kt))();static DESCRIPTOR_NAME="NumberBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new te(t.data,t.data1)}static create(t,e){return new te(t,e)}}class ee extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Wt,Kt))();static DESCRIPTOR_NAME="StringBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ee(t.data,t.data1)}static create(t,e){return new ee(t,e)}}class ne extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Kt,Kt))();static DESCRIPTOR_NAME="BytesBytesPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ne(t.data,t.data1)}static create(t,e){return new ne(t,e)}}class re extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Wt,Zt))();static DESCRIPTOR_NAME="StringObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(t){return new re(t.data,t.data1&&JSON.parse(t.data1))}static create(t,e){return new re(t,e)}}class se extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Xt,Zt))();static DESCRIPTOR_NAME="NumberObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(t){return new se(t.data,t.data1&&JSON.parse(t.data1))}static create(t,e){return new se(t,e)}}class oe extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Zt,Zt))();static DESCRIPTOR_NAME="ObjectObjectPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(t){return new oe(t.data&&JSON.parse(t.data),t.data1&&JSON.parse(t.data1))}static create(t,e){return new oe(t,e)}}class ie extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Zt,Kt))();static DESCRIPTOR_NAME="ObjectBufferPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(t){return new ie(t.data&&JSON.parse(t.data),t.data1)}static create(t,e){return new ie(t,e)}}class ae extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Wt,Wt))();static DESCRIPTOR_NAME="StringStringPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ae(t.data,t.data1)}static create(t,e){return new ae(t,e)}}class ce extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Wt,Xt))();static DESCRIPTOR_NAME="StringNumberPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ce(t.data,t.data1)}static create(t,e){return new ce(t,e)}}class de extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Xt,Xt))();static DESCRIPTOR_NAME="NumberNumberPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new de(t.data,t.data1)}static create(t,e){return new de(t,e)}}class ue extends Qt{data;data1;static TYPE=(()=>$t.getPacketType(Xt,Wt))();static DESCRIPTOR_NAME="NumberStringPacketDataMessage";static DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ue(t.data,t.data1)}static create(t,e){return new ue(t,e)}}const le=(()=>[te,ee,ne,re,se,oe,ie,ae,ce,de,ue].reduce((t,e)=>(t[e.TYPE]=e,t),{}))();class pe extends i{type;data;id;nsp;options;static TYPE=10;static DESCRIPTOR_NAME="PacketMessage";static 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}}};constructor(t,e,n,r="/",s){super(),this.type=t,this.data=e,this.id=n,this.nsp=r,this.options=s??new zt}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 t=l.encode(this.options),e=l.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:e,options:t}}static fromJSON(t){const e=Math.floor(t.type/10);return new pe(t.type-10*e,l.decode(t.data,le[e]),t.id,t.nsp,t.options?l.decode(t.options,zt):new zt)}static create(t,e={}){const n=$t.getPacketType($t.getType(t.data[0]),$t.getType(t.data[1]??t.data[0]));return new pe(t.type,le[n].create(t.data[0],t.data[1]),t.id,t.nsp,new zt(e.flags,e.rooms,e.except))}}class he{encode(t,e,n,r="/",s={}){if(e.length>2)throw new Error("PacketParser supports only 2 elements in data");const o={type:t,data:e,id:n,nsp:r};return l.encode(pe.create(o,s))}decode(t){const e=l.decode(t,pe);return{packet:{id:e.id,type:e.type,data:e.packetData,nsp:e.nsp},options:{flags:e.options.flags,rooms:e.options.rooms,except:e.options.except}}}}const fe=(()=>[Ct.EVENT,Ct.ACK,Ct.BINARY_ACK,Ct.BINARY_EVENT])();class me extends jt{_packetParser;constructor(t){super(),this._packetParser=t??new he}encode(t){if(fe.includes(t.type))try{return[this._packetParser.encode(t.type,t.data,t.id,t.nsp)]}catch(t){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:t.message}})}return super.encode(t)}}class ye extends Dt{_packetParser;constructor(t){super(),this._packetParser=t??new he}add(t){if(!$t.isBuffer(t))return super.add(t);let e;try{e=this._packetParser.decode(t).packet}catch(e){return super.add(t)}super.emitReserved("decoded",e)}}class ge{_context;_deferredPromise=function(){let t,e;const n=new Promise((n,r)=>{t=n,e=r});return{resolve:t,reject:e,promise:n}}();timeout;constructor(t,e){this._context=t,this.timeout=setTimeout(()=>this.error(new Ht("Request timeout.",this._context)),e)}get promise(){return this._deferredPromise.promise}response(t){this._deferredPromise.resolve(t)}error(t){this._deferredPromise.reject(t)}}class be{_context;_requests=new Set;constructor(t){this._context=t}async send(t,e=45e3){const n=this._createRequest(e);try{return t(n),await n.promise}finally{this._finishRequest(n)}}errorAll(t){for(const e of this._requests)e.error(t)}waitForAllRequests(t=45e3){return this._waitForRequests(t)}_createRequest(t){const e=new ge(this._context,t);return this._requests.add(e),e}_finishRequest(t){this._requests.delete(t),clearTimeout(t.timeout)}async _waitForRequests(t=5e3,e=0){return!this._requests.size||e>=t/500?Promise.resolve():(await new Promise(t=>{setTimeout(t,500)}),this._waitForRequests(t,e++))}}const Oe={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};class we extends((0,n.ObservableMixin)()){_requestsManager;_url;_socket;_socketAuth;_channels;_connectionAttempt=0;_token;_options;_connectionProvider;_userFactory;static STATE_DISCONNECTED=(()=>Oe.DISCONNECTED)();static STATE_CONNECTING=(()=>Oe.CONNECTING)();static STATE_CONNECTED=(()=>Oe.CONNECTED)();static _CHANGE_STATE_EVENT_PRIORITY=(()=>n.priorities.get("highest")+999999)();constructor(t,e,n,r,s){if(super(),this._token=e,this._options=n??{},this._connectionProvider=r??Jt,this._userFactory=s??b.get,this._requestsManager=new be(this),this._channels=new Map,!t)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=qt(t.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Oe.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",async(t,e,n)=>{if(this._debugEvent("ws-gw:change:state",n),n!==we.STATE_CONNECTED){if(n===we.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Ht("Not connected.",this))}else try{this.me=await this._userFactory.call(b,this,this._socketAuth?.userId)}catch(t){}},{priority:we._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",(t,e)=>{this._options.onError?this._options.onError(e):console.error(e)})}get sessionId(){return this.socketId}waitForAllRequests(t){return this._requestsManager.waitForAllRequests(t)}disconnect(){this.state!==Oe.DISCONNECTED&&(this._socket?.disconnect(),this._socket=void 0,this.state=Oe.DISCONNECTED)}async reconnect(){this._socket||this.state!==Oe.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(t,e="local.cs.dev:443/ws-v2",n={},r=Jt,s=b.get){const o=new we(e,t,n,r,s);return await o._connect(),o}_sendRequest(t,e,n){if(!t)throw new Ht("`serviceName` must be provided.",this);if(this.state!==we.STATE_CONNECTED)throw new Ht("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new Ht("Not authenticated.",this);const r=new ArrayBuffer(n.length+2),s=new Uint8Array(r);return s[0]=t,s[1]=parseInt(e),s.set(n,2),this._emit(1,s)}_getChannel(t,e){const n=""+t+e;return!this._channels.has(n)&&this._socket&&this._channels.set(n,new Gt(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise((t,e)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(e)}),n.once("connect",async()=>{this._debugEvent("once-connect");try{await this._onConnect(),t()}catch(t){e(t)}}),n.connect()})}_getPortByProtocol(t){return["http:","ws:"].includes(t)?80:443}_setupSocket(){if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),e=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,n=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",r=this._connectionProvider(e,{parser:{Encoder:me,Decoder:ye},path:n+"/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:"53.0.0"},agent:this._options.agent??!1,closeOnBeforeunload:!1});return this.state=Oe.CONNECTING,r.on("connect",()=>{this._debugEvent("connect"),this.socketId=r.id}),r.on("connect_error",t=>{this._debugEvent("connect_error",t)}),r.on("disconnect",()=>{this._debugEvent("disconnect"),this._onDisconnect()}),r.io.on("reconnect",async()=>{this._debugEvent("reconnect"),await this._onReconnect()}),r.io.on("reconnect_attempt",t=>{this._debugEvent("reconnect_attempt",t),this.state=Oe.CONNECTING,this._connectionAttempt=t}),r.on("unauthorized",t=>{this._debugEvent("unauthorized"),this._onUnauthorized(t)}),r.on("authenticationRequest",async t=>{this._debugEvent("authenticationRequest",t.attempt),await this._onReconnect()}),this._socket=r,r}_emit(t,e){const n=this._socket;return this._requestsManager.send(r=>{n.emit(t,e,(t,e)=>{if(t)return r.error(Yt.fromPublicError(t));r.response(e)})},this._options.requestTimeout)}_addAuthData(t,e){this._socketAuth={environmentId:t,userId:e,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=Oe.CONNECTED;const t=async(t,e,n)=>{this._debugEvent("token:value:change");try{await this._authenticate(n)}catch(t){}};this._token.on("change:value",t),this._socket.io.off("reconnect_error"),this.on("disconnect",()=>{this._token.off("change:value",t)})}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=Oe.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const t of this._channels.values())t.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(t,e){if(!this._isDebugModeEnabled())return;const n=void 0!==e?", data: "+e:"";console.info((new Date).toLocaleString()+" "+t+n)}_reconnectionAttemptError(t){this._connectionAttempt>=2&&(this.disconnect(),t(Ht.fromPublicError({message:"The number of initial connection attempts exceeded.",explanation:"Three initial connection attempts failed. It can be caused by a slow, unstable, 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:t}){this._removeAuthData(),this.fire("error",Yt.fromPublicError(t))}async _authenticate(t){try{this._debugEvent("authenticate:start");const e=await this._emit(2,{token:t});this._debugEvent("authenticate:success","envId: "+e.environmentId+", userId: "+e.userId),this._addAuthData(e.environmentId,e.userId)}catch(t){throw this._debugEvent("authenticate:error",t.message),this._removeAuthData(),t}}_isDebugModeEnabled(){return!!n.global.window.localStorage&&"true"===(n.global.window.localStorage.getItem("csClientDebugMode")??"false").toLowerCase()}}const Ie=we;class ve extends i{bundleVersion;static TYPE="131";static READABLE_TYPE_NAME="isEditorBundleUploaded";static DESCRIPTOR_NAME="IsEditorBundleUploadedMessage";static DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};constructor(t){super(),this.bundleVersion=t}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(t){return new ve(t.bundleVersion)}}class Se extends i{isUploaded;static DESCRIPTOR_NAME="IsEditorBundleUploadedResponse";static DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};constructor(t){super(),this.isUploaded=t}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(t){return new Se(t.isUploaded)}}class ke extends((0,n.EmitterMixin)()){static _SERVICE=13;static async isBundleUploaded(t,e){const n=new ve(e);if(t.state!==Oe.CONNECTED)throw new Ht("WebSocket Gateway is not connected.",t);const r=await t._sendRequest(ke._SERVICE,ve.TYPE,l.encode(n));return l.decode(r,Se).isUploaded}}const Pe=ke;class Ae extends i{documentId;revisionId;static TYPE="123";static READABLE_TYPE_NAME="getRevision";static DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};constructor(t,e){super(),this.documentId=t,this.revisionId=e}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(t){return new Ae(t.documentId,t.revisionId)}}class Te extends o{static DESCRIPTOR_NAME="RevisionDescriptor";static 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}}};static create(t){return{revisionId:t.id,name:t.name,creatorId:t.creatorId,createdAt:t.createdAt,fromVersion:t.fromVersion,toVersion:t.toVersion,isEmptyCurrent:t.isEmptyCurrent,diffData:t.diffData?JSON.stringify(t.diffData):void 0,attributes:t.attributes,authorsIds:t.authorsIds}}static toJSON(t){return{revisionId:t.revisionId,name:t.name,creatorId:t.creatorId,authorsIds:t.authorsIds?JSON.stringify(t.authorsIds):void 0,diffData:t.diffData,createdAt:t.createdAt?.toISOString(),attributes:t.attributes?JSON.stringify(t.attributes):void 0,toVersion:t.toVersion,fromVersion:t.fromVersion,isEmptyCurrent:t.isEmptyCurrent}}static fromJSON(t){return{revisionId:(t={...t}).revisionId,name:t.name,creatorId:t.creatorId,authorsIds:t.authorsIds?JSON.parse(t.authorsIds):void 0,diffData:t.diffData,createdAt:t.createdAt?new Date(t.createdAt):void 0,attributes:t.attributes?JSON.parse(t.attributes):void 0,toVersion:t.toVersion,fromVersion:t.fromVersion,isEmptyCurrent:t.isEmptyCurrent}}static toObject(t){return function(t){for(const[e,n]of Object.entries(t))void 0===n&&delete t[e];return t}({id:t.revisionId,name:t.name,creatorId:t.creatorId,createdAt:t.createdAt,fromVersion:t.fromVersion,toVersion:t.toVersion,isEmptyCurrent:t.isEmptyCurrent,diffData:t.diffData?JSON.parse(t.diffData):void 0,attributes:t.attributes,authorsIds:t.authorsIds})}}class _e extends i{revisionId;name;creatorId;authorsIds;createdAt;diffData;attributes;fromVersion;toVersion;isEmptyCurrent;static DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse";static DESCRIPTOR=(()=>Te.DESCRIPTOR)();constructor(t,e,n,r,s,o,i,a,c,d){super(),this.revisionId=t,this.name=e,this.creatorId=n,this.authorsIds=r,this.createdAt=s,this.diffData=o,this.attributes=i,this.fromVersion=a,this.toVersion=c,this.isEmptyCurrent=d}toJSON(){return Te.toJSON(this)}toObject(){return Te.toObject(this)}static create(t){return new _e(t.revisionId,t.name,t.creatorId,t.authorsIds,t.createdAt,t.diffData,t.attributes,t.fromVersion,t.toVersion,t.isEmptyCurrent)}static fromJSON(t){return new _e(t.revisionId,t.name,t.creatorId,t.authorsIds?JSON.parse(t.authorsIds):void 0,t.createdAt?new Date(t.createdAt):void 0,t.diffData,t.attributes?JSON.parse(t.attributes):void 0,t.fromVersion,t.toVersion,t.isEmptyCurrent)}}class Ce extends i{documentId;requestId;revisions;static TYPE="124";static READABLE_TYPE_NAME="updateRevisions";static DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};constructor(t,e,n){super(),this.documentId=t,this.requestId=e,this.revisions=n}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Te.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Te.toObject)}}static create(t){return new Ce(t.documentId,t.requestId,t.revisions.map(Te.create))}static fromJSON(t){return new Ce(t.documentId,t.requestId,t.revisions.map(Te.fromJSON))}}class je extends i{requestId;static DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse";static DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};constructor(t){super(),this.requestId=t}toJSON(){return{requestId:this.requestId}}static fromJSON(t){return new je(t.requestId)}}class Ee extends i{documentId;static TYPE="121";static READABLE_TYPE_NAME="connectToRevisionHistory";static DESCRIPTOR_NAME="RevisionHistoryConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new Ee(t.documentId)}}class De extends i{channel;requestId;revisions;static DESCRIPTOR_NAME="RevisionHistoryConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};constructor(t,e,n){super(),this.channel=t,this.requestId=e,this.revisions=n}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Te.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Te.toObject)}}static fromJSON(t){return new De(t.channel,t.requestId,t.revisions.map(Te.fromJSON))}}class Re extends i{documentId;requestId;static TYPE="122";static READABLE_TYPE_NAME="reconnectToRevisionHistory";static DESCRIPTOR_NAME="RevisionHistoryReconnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};constructor(t,e){super(),this.documentId=t,this.requestId=e}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(t){return new Re(t.documentId,t.requestId)}}class xe extends Ht{constructor(t,e){super(t+" Service is not connected.",e)}}class Ne extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;static _SERVICE=12;constructor(t){super(),this._documentId=t}get isConnected(){return this._isConnected}connect(t){return this._isConnected?Promise.resolve():this._connect(t,new Ee(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(t,e){if(this.isConnected)throw new Ht("Cannot reconnect to already connected service.",t);return this._connect(t,new Re(this._documentId,e))}async updateRevisions(t,e){const n=Ce.create({documentId:this._documentId,requestId:e,revisions:t}),r=await this._sendRequest(Ce.TYPE,n),{requestId:s}=l.decode(r,je);return s}async getRevision(t){const e=new Ae(this._documentId,t),n=await this._sendRequest(Ae.TYPE,e);return l.decode(n,_e).toObject()}async _connect(t,e){if(t.state!==Oe.CONNECTED)throw new Ht("WebSocket Gateway is not connected.",t);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(12,e.constructor.TYPE,l.encode(e)),{channel:r,requestId:s,revisions:o}=l.decode(n,De).toObject();return this.listenTo(t,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:Ie._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(t,r),this._isConnected=!0,this.fire("connected"),{revisions:o,requestId:s}}_connectToChannel(t,e){this._channel=t._getChannel(Ne._SERVICE,e),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Ce.TYPE),(t,e)=>{const{documentId:n,requestId:r,revisions:s}=l.decode(e,Ce).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})})}_onWsGatewayStateChange(t){t===Oe.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new xe("Revision History",this);return this._wsGateway._sendRequest(12,t,l.encode(e))}}const Ve=Ne;class Me extends i{id;documentId;type;data;originalSuggestionId;attributes;static TYPE="101";static READABLE_TYPE_NAME="addSuggestion";static DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage";static 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}}};constructor(t,e,n,r={},s=null,o=null){super(),this.id=t,this.documentId=e,this.type=n,this.data=r,this.originalSuggestionId=s,this.attributes=o}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(t){return new Me(t.id,t.documentId,t.type,JSON.parse(t.data),t.originalSuggestionId??null,t.attributes?JSON.parse(t.attributes):null)}}class Be extends i{id;authorId;type;hasComments;state;data;attributes;createdAt;static DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse";static 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}}};constructor(t,e,n,r,s,o,i={},a=null){super(),this.id=t,this.authorId=e,this.type=n,this.hasComments=s,this.state=o,this.data=i,this.attributes=a,this.createdAt=r?new Date(r):void 0}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(t){return new Be(t.id,t.authorId,t.type,t.createdAt,t.hasComments,t.state,JSON.parse(t.data),t.attributes?JSON.parse(t.attributes):null)}}class Ue extends i{id;documentId;static TYPE="103";static READABLE_TYPE_NAME="getSuggestion";static DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(t,e){super(),this.id=t,this.documentId=e}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(t){return new Ue(t.id,t.documentId)}}class Je extends i{id;authorId;type;hasComments;state;data;attributes;createdAt;static DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse";static 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}}};constructor(t,e,n,r,s,o,i={},a=null){super(),this.id=t,this.authorId=e,this.type=n,this.hasComments=s,this.state=o,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(t){return new Je(t.id,t.authorId,t.type,t.createdAt,t.hasComments,t.state,JSON.parse(t.data),t.attributes?JSON.parse(t.attributes):null)}}class qe extends i{documentId;static TYPE="102";static READABLE_TYPE_NAME="getAllSuggestions";static DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new qe(t.documentId)}}class Le extends o{static DESCRIPTOR_NAME="SuggestionDescriptor";static 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"}}};static toJSON(t){return{...t,data:t.data?JSON.stringify(t.data):t.data,attributes:t.attributes?JSON.stringify(t.attributes):t.attributes,createdAt:t.createdAt?.toISOString()}}static fromJSON(t){return{...t,data:t.data?JSON.parse(t.data):t.data,attributes:t.attributes?JSON.parse(t.attributes):t.attributes,createdAt:t.createdAt?new Date(t.createdAt):void 0}}}class Ge extends i{_suggestions;_suggestionsV2;suggestions;static DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse";static DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};constructor(t,e){super(),this._suggestions=t,this._suggestionsV2=e,this.suggestions=e?.length?e:t}toJSON(){return{suggestions:this._suggestions?.map(t=>JSON.stringify(t)),suggestionsV2:this._suggestionsV2?.map(Le.toJSON)}}static fromJSON(t){return new Ge(t.suggestions?.map(He),t.suggestionsV2?.map(Le.fromJSON))}}function He(t){const e=JSON.parse(t);return e.createdAt=e.createdAt?new Date(e.createdAt):void 0,e}class Ye extends i{id;documentId;hasComments;isHasCommentsModified;state;attributes;static TYPE="104";static READABLE_TYPE_NAME="updateSuggestion";static DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage";static 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}}};constructor(t,e,n,r,s,o=null){super(),this.id=t,this.documentId=e,this.hasComments=n,this.isHasCommentsModified=r,this.state=s,this.attributes=o}toJSON(){return{id:this.id,documentId:this.documentId,hasComments:this.hasComments,isHasCommentsModified:this.isHasCommentsModified,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(t){return new Ye(t.id,t.documentId,t.hasComments,t.isHasCommentsModified,t.state,t.attributes?JSON.parse(t.attributes):null)}}class ze extends i{documentId;static TYPE="105";static READABLE_TYPE_NAME="connectToSuggestions";static DESCRIPTOR_NAME="TrackChangesConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new ze(t.documentId)}}class Fe extends i{channel;_suggestions;_suggestionsV2;suggestions;static DESCRIPTOR_NAME="TrackChangesConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};constructor(t,e,n){super(),this.channel=t,this._suggestions=e,this._suggestionsV2=n,this.suggestions=n?.length?n:e}toJSON(){return{channel:this.channel,suggestions:this._suggestions?.map(t=>JSON.stringify(t)),suggestionsV2:this._suggestionsV2?.map(Le.toJSON)}}static fromJSON(t){return new Fe(t.channel,t.suggestions?.map(t=>JSON.parse(t)),t.suggestionsV2?.map(Le.fromJSON))}}class Ke extends i{ids;documentId;state;static TYPE="106";static READABLE_TYPE_NAME="batchUpdateSuggestionsState";static DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage";static DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};constructor(t,e,n){super(),this.ids=t,this.documentId=e,this.state=n}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(t){return new Ke(t.ids,t.documentId,t.state)}}class We extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;static _SERVICE=10;constructor(t){super(),this._documentId=t}get isConnected(){return this._isConnected}async connect(t){if(this._isConnected)return;if(t.state!==Oe.CONNECTED)throw new Ht("WebSocket Gateway is not connected.",t);const e=new ze(this._documentId);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(10,ze.TYPE,l.encode(e)),r=l.decode(n,Fe);return this.listenTo(t,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:Ie._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(t,r.channel),this._isConnected=!0,this.fire("connected"),r.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(t,e,n,r=null,s){const o=new Me(t,this._documentId,e,n,r,s),i=await this._sendRequest(Me.TYPE,o);return l.decode(i,Be)}async get(t,e=1){const n=new Ue(t,this._documentId);try{const t=await this._sendRequest(Ue.TYPE,n);return l.decode(t,Je)}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&e<5)return await(r=100*e,new Promise(t=>{setTimeout(t,r)})),this.get(t,e+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw Yt.fromPublicError(n)}var r}async getAll(){const t=new qe(this._documentId),e=await this._sendRequest(qe.TYPE,t),{suggestions:n}=l.decode(e,Ge);return n}async update(t,e={}){const{hasComments:n,state:r,attributes:s}=e,o=void 0!==n,i=new Ye(t,this._documentId,n,o,r,s);await this._sendRequest(Ye.TYPE,i)}async batchUpdateState(t){const e=new Ke(t.ids,this._documentId,t.state);await this._sendRequest(Ke.TYPE,e)}_connectToChannel(t,e){this._channel=t._getChannel(We._SERVICE,e),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Ye.TYPE),(t,e)=>{const n=l.decode(e,Ye);this.fire("suggestionUpdated",n)})}_onWsGatewayStateChange(t){t===Oe.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new xe("Track Changes",this);return this._wsGateway._sendRequest(10,t,l.encode(e))}}const Xe=We,Ze={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let $e;const Qe=new Uint8Array(16);function tn(){if(!$e&&($e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$e))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $e(Qe)}const en=[];for(let t=0;t<256;++t)en.push((t+256).toString(16).slice(1));function nn(t,e=0){return en[t[e+0]]+en[t[e+1]]+en[t[e+2]]+en[t[e+3]]+"-"+en[t[e+4]]+en[t[e+5]]+"-"+en[t[e+6]]+en[t[e+7]]+"-"+en[t[e+8]]+en[t[e+9]]+"-"+en[t[e+10]]+en[t[e+11]]+en[t[e+12]]+en[t[e+13]]+en[t[e+14]]+en[t[e+15]]}const rn=function(t,e,n){if(Ze.randomUUID&&!e&&!t)return Ze.randomUUID();const r=(t=t||{}).random||(t.rng||tn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return nn(r)};class sn extends i{channel;sockets;static DESCRIPTOR_NAME="SessionsConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};constructor(t,e=[]){super(),this.channel=t,this.sockets=e}toJSON(){return{channel:this.channel,sockets:this.sockets.map(t=>({user:t.userId,session:t.id,role:t.role,permissions:t.permissions}))}}static fromJSON(t){return new sn(t.channel,t.sockets.map(t=>({id:t.session,userId:t.user,role:t.role,permissions:t.permissions})))}}class on extends i{id;sessionType;static TYPE="31";static READABLE_TYPE_NAME="getConnectedSockets";static DESCRIPTOR_NAME="SessionsConnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};constructor(t,e){super(),this.id=t,this.sessionType=e}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(t){return new on(t.id,t.sessionType)}}class an extends i{id;userId;role;permissions;static TYPE="32";static READABLE_TYPE_NAME="connectSocket";static DESCRIPTOR_NAME="SocketConnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};constructor(t,e,n,r){super(),this.id=t,this.userId=e,this.role=n,this.permissions=r}toJSON(){return{id:this.id,userId:this.userId??void 0,role:this.role??void 0,permissions:this.permissions??void 0}}static fromJSON(t){return new an(t.id,t.userId,t.role,t.permissions)}}class cn extends i{id;static TYPE="33";static READABLE_TYPE_NAME="disconnectSocket";static DESCRIPTOR_NAME="SocketDisconnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1}}};constructor(t){super(),this.id=t}toJSON(){return{id:this.id}}static fromJSON(t){return new cn(t.id)}}const dn=class extends n.Collection{_id;_sessionType;_handlers=new Map;_channel;_wsGateway;_connected;_eventsQueue=[];_isRunning=!1;constructor(t,e){super({idProperty:"id"}),this._id=t,this._sessionType=e}async connect(t){this._wsGateway=t,this.stopListening(t,"change:state");const e=new on(this._id,this._sessionType);let n;try{const t=await this._wsGateway._sendRequest(3,on.TYPE,l.encode(e));n=l.decode(t,sn)}catch(t){n=new sn(this._id,[])}this._connectToChannel(this._wsGateway,n.channel,this._sessionType);const r=await async function(t,e){const n=e.map(t=>t.userId),r=n.length?await b.getMany(t,n):[];return e.map(t=>{const e={id:t.id,role:t.role,permissions:t.permissions};return e.user=t.userId&&r.find(e=>e.id===t.userId)||new b,e})}(this._wsGateway,n.sockets);for(const t of r)super.add(t);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:Ie._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(t=!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&&t&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),t&&this.stopListening()}}add(t,e){throw new TypeError("The collection is read-only.")}remove(t){throw new TypeError("The collection is read-only.")}_connectToChannel(t,e,n){this._channel=t._getChannel(n,e),this._channel&&(this._addHandler(this._channel,an.TYPE,async e=>{const n=l.decode(e,an);if(-1===this.getIndex(n.id)){const e={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(e.user=await b.get(t,n.userId)),super.add(e)}}),this._addHandler(this._channel,cn.TYPE,t=>{const e=l.decode(t,cn);-1!==this.getIndex(e.id)&&super.remove(e.id)}))}async _onWsGatewayStateChange(t){t===Ie.STATE_DISCONNECTED&&this.disconnect(!1),t===Ie.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let t;for(this._isRunning=!0;t=this._eventsQueue.shift();){const e=this._handlers.get(t.eventName);e&&await e(t.data)}this._isRunning=!1}_addHandler(t,e,n){const r=t.getEventName(e,!0);this.listenTo(t,r,async(t,e)=>{const n=t.name;this._eventsQueue.push({eventName:n,data:e}),await this._runQueue()}),this._handlers.set(r,n)}};class un{static async getConnectedSessions(t,e,n){const r=new dn(e,n);return await r.connect(t),r}}class ln extends i{id;buffers;types;bundleVersion;lastOperationId;static TYPE="11";static READABLE_TYPE_NAME="connectToDocument";static DESCRIPTOR_NAME="CollaborativeEditingConnectMessage";static 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}}};constructor(t,e,n,r,s=""){super(),this.id=t,this.buffers=e,this.types=n,this.bundleVersion=r,this.lastOperationId=s}toJSON(){return{id:this.id,buffers:this.buffers,types:this.types,bundleVersion:this.bundleVersion,lastOperationId:this.lastOperationId}}static fromJSON(t){return new ln(t.id,t.buffers,t.types,t.bundleVersion,t.lastOperationId)}}class pn{static prepareMetadataForOperations(t,e){if(!t?.length||!e?.length)return[];const n=[];let r=0;for(const s of t)if(0!==s){if(!e[r])throw new Error("Missing metadata for a operation");n.push(e[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(t,e){if(!t?.length||!e?.length)return[];const n=[];for(let r=0;r<t.length;r++)if(0!==t[r]){if(!e[r])throw new Error("Missing metadata for a operation");n.push(e[r])}return n}}class hn extends o{static DESCRIPTOR_NAME="OperationMetadataDescriptor";static DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};static toJSON({createdAt:t,...e}){const n={...e};return t?.toISOString&&(n.createdAt=t.toISOString()),n}static fromJSON({createdAt:t,...e}){const n={...e};return t&&(n.createdAt=new Date(t)),n}}class fn extends i{id;buffers;types;baseVersion;metadata;lastOperationId;static TYPE="13";static READABLE_TYPE_NAME="updateDocument";static DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage";static 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}}};constructor(t,e,n,r,s=[],o=""){super(),this.id=t,this.buffers=e,this.types=n,this.baseVersion=r,this.metadata=s,this.lastOperationId=o}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:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(t){return new fn(t.id,t.buffers,t.types,t.baseVersion,pn.prepareMetadataForOperations(t.types,t.metadata).map(hn.fromJSON),t.lastOperationId)}}class mn extends i{id;lastKnowVersion;bundleVersion;static TYPE="12";static READABLE_TYPE_NAME="reconnectToDocument";static DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage";static DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};constructor(t,e,n){super(),this.id=t,this.lastKnowVersion=e,this.bundleVersion=n}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(t){return new mn(t.id,t.lastKnowVersion,t.bundleVersion)}}class yn extends i{version;buffers;types;metadata;lastOperationId;lastOperationAcceptedAt;static DESCRIPTOR_NAME="CollaborativeEditingResponse";static 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}}};constructor(t,e=[],n=[],r=[],s="",o=null){super(),this.version=t,this.buffers=e,this.types=n,this.metadata=r,this.lastOperationId=s,this.lastOperationAcceptedAt=o}get data(){return{buffers:this.buffers,types:this.types,baseVersion:this.version-this.types.length,lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt}}get wereChangesApplied(){return!this.types?.length}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(t){return new yn(t.version,t.buffers,t.types,pn.prepareMetadataForOperations(t.types,t.metadata).map(hn.fromJSON),t.lastOperationId,t.lastOperationAcceptedAt?new Date(t.lastOperationAcceptedAt):null)}static create(t){return new yn(t.version,t.buffers,t.types,t.metadata,t.lastOperationId,t.lastOperationAcceptedAt?new Date(t.lastOperationAcceptedAt):null)}}class gn extends i{channel;version;buffers;types;offset;metadata;initData;sessionId;lastOperationId;sessionCreatedAt;static DESCRIPTOR_NAME="CollaborativeEditingConnectResponse";static 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:hn.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}}}))();constructor(t,e,n=[],r=[],s=0,o=[],i=null,a="",c="",d=null){super(),this.channel=t,this.version=e,this.buffers=n,this.types=r,this.offset=s,this.metadata=o,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(){return!this.types?.length&&null===this.initData}toJSON(){return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:pn.removeUnnecessaryMetadata(this.types,this.metadata).map(hn.toJSON),initData:this.initData??"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(t){return new gn(t.channel,t.version,t.buffers,t.types,t.offset,t.metadata,t.initData,t.sessionId,t.lastOperationId,t.sessionCreatedAt)}static fromJSON(t){let e=null;return!0===t.isInitialized?e=t.initData??"":"boolean"!=typeof t.isInitialized&&t.initData&&(e=t.initData),gn.create({channel:t.channel,version:t.version,buffers:t.buffers,types:t.types,offset:t.offset,metadata:pn.prepareMetadataForOperations(t.types,t.metadata).map(hn.fromJSON),initData:e,sessionId:t.sessionId,lastOperationId:t.lastOperationId,sessionCreatedAt:t.sessionCreatedAt?new Date(t.sessionCreatedAt):null})}}class bn extends i{lastDocumentSession;currentDocumentSession;static DESCRIPTOR_NAME="GetDocumentDetailsResponse";static 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}}};constructor(t,e){super(),this.lastDocumentSession=t,this.currentDocumentSession=e}get data(){return{lastDocumentSessionId:this.lastDocumentSession?.id,lastDocumentSessionOperationId:this.lastDocumentSession?.lastOperationId,currentDocumentSessionId:this.currentDocumentSession?.id,currentDocumentSessionVersion:this.currentDocumentSession?.version,currentDocumentSessionOperationId:this.currentDocumentSession?.lastOperationId}}toJSON(){return{lastDocumentSessionId:this.lastDocumentSession?.id,lastDocumentSessionOperationId:this.lastDocumentSession?.lastOperationId,currentDocumentSessionId:this.currentDocumentSession?.id,currentDocumentSessionVersion:this.currentDocumentSession?.version,currentDocumentSessionOperationId:this.currentDocumentSession?.lastOperationId}}static fromJSON(t){const e=t.lastDocumentSessionId?{id:t.lastDocumentSessionId,lastOperationId:t.lastDocumentSessionOperationId}:void 0,n=t.currentDocumentSessionId?{lastOperationId:t.currentDocumentSessionOperationId,version:t.currentDocumentSessionVersion,id:t.currentDocumentSessionId}:void 0;return new bn(e,n)}}class On extends i{documentId;static TYPE="14";static READABLE_TYPE_NAME="getDocumentDetails";static DESCRIPTOR_NAME="GetDocumentDetailsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};constructor(t){super(),this.documentId=t}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new On(t.documentId)}}const wn=class extends((0,n.EmitterMixin)()){static _SERVICE=1;_bundleVersion;_id;_isConnected;_wsGateway;_channel;_connectedSessions;constructor(t,e){if(super(),!t)throw new TypeError('Param "bundleVersion" must be provided.');this._id=e??rn(),this._isConnected=!1,this._bundleVersion=t}getId(){return this._id}isConnected(){return this._isConnected}connect(t,e={buffers:[],types:[]},n){const r=new ln(this.getId(),e.buffers,e.types,this._bundleVersion,n);return this._connect(t,r)}reconnect(t,e){if(this.isConnected())throw new Ht("Cannot reconnect to already connected service.",t);return this._connect(t,new mn(this.getId(),e,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 t=new On(this.getId());if(!this._wsGateway)throw new xe("Collaborative Editing",this);const e=await this._wsGateway._sendRequest(1,On.TYPE,l.encode(t));return l.decode(e,bn)}async sendOperations(t,e,n){if(!t?.types?.length)throw new Ht("Cannot send empty update.",this._wsGateway);const r="number"==typeof e?e:parseInt(e);if(!Number.isInteger(r)||r<0)throw new Ht("Base version not provided.",this._wsGateway);const s=new fn(this.getId(),t.buffers,t.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new xe("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,fn.TYPE,l.encode(s));return l.decode(o,yn)}async getConnectedSessions(){if(!this._isConnected)throw new xe("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await un.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(t,e){return un.getConnectedSessions(t,e,1)}async _connect(t,e){if(this.isConnected())return;if(t.state!==Ie.STATE_CONNECTED)throw new Ht("WebSocket Gateway is not connected.",t);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(1,e.constructor.TYPE,l.encode(e)),r=l.decode(n,gn);return this.listenTo(t,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:Ie._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(t,r.channel),this._isConnected=!0,this.fire("connected"),r}_connectToChannel(t,e){this._channel=t._getChannel(1,e),this.listenTo(this._channel,this._channel.getEventName(fn.TYPE),(t,e)=>{const n=l.decode(e,fn);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)})}_onWsGatewayStateChange(t){t===Ie.STATE_DISCONNECTED&&this.disconnect()}};class In extends o{static DESCRIPTOR_NAME="CommentDescriptor";static 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"}}};static toJSON(t){return{...t,createdAt:t.createdAt?.toISOString(),attributes:t.attributes?JSON.stringify(t.attributes):null}}static fromJSON(t){return{...t,createdAt:new Date(t.createdAt),attributes:t.attributes?JSON.parse(t.attributes):null}}}class vn extends o{static DESCRIPTOR_NAME="CommentsThreadDescriptor";static 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},unlinkedAt:{type:"string",id:9}}};static toJSON(t){return{...t,createdAt:t.createdAt?.toISOString(),deletedAt:t.deletedAt?.toISOString(),resolvedAt:t.resolvedAt?.toISOString(),attributes:t.attributes?JSON.stringify(t.attributes):null,context:t.context?JSON.stringify(t.context):t.context,comments:t.comments?.map(In.toJSON),unlinkedAt:t.unlinkedAt?.toISOString()}}static fromJSON(t){return{...t,createdAt:t.createdAt?new Date(t.createdAt):void 0,deletedAt:t.deletedAt?new Date(t.deletedAt):void 0,resolvedAt:t.resolvedAt?new Date(t.resolvedAt):void 0,attributes:t.attributes?JSON.parse(t.attributes):null,context:t.context?JSON.parse(t.context):void 0,comments:t.comments?.map(In.fromJSON),unlinkedAt:t.unlinkedAt?new Date(t.unlinkedAt):void 0}}}class Sn extends i{documentId;commentThreadId;content;commentId;userId;attributes;commentThread;createdAt;static TYPE="91";static READABLE_TYPE_NAME="addComment";static DESCRIPTOR_NAME="CommentsV2AddCommentMessage";static 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}}};constructor(t,e,n,r="",s,o="",i=null,a){super(),this.documentId=t,this.commentThreadId=e,this.content=n,this.commentId=r,this.userId=o,this.attributes=i,this.commentThread=a,this.createdAt=s?new Date(s):""}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?vn.toJSON(this.commentThread):void 0}}static fromJSON(t){return new Sn(t.documentId,t.commentThreadId,t.content,t.commentId?t.commentId:void 0,t.createdAt?new Date(t.createdAt):void 0,t.userId?t.userId:void 0,t.attributes?JSON.parse(t.attributes):{},t.commentThread?vn.fromJSON(t.commentThread):void 0)}}class kn extends i{commentThreadId;commentId;createdAt;static DESCRIPTOR_NAME="CommentsV2AddCommentResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};constructor(t,e,n){super(),this.commentThreadId=t,this.commentId=e,this.createdAt=new Date(n)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(t){return new kn(t.commentThreadId,t.commentId,t.createdAt)}}class Pn extends i{documentId;static TYPE="92";static READABLE_TYPE_NAME="connectToComment";static DESCRIPTOR_NAME="CommentsV2ConnectMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new Pn(t.documentId)}}class An extends i{channel;_threads;_threadsV2;threads;static DESCRIPTOR_NAME="CommentsV2ConnectResponse";static DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};constructor(t,e,n){super(),this.channel=t,this._threads=e,this._threadsV2=n,this.threads=n?.length?n:e}toJSON(){return{channel:this.channel,threads:this._threads?.map(t=>JSON.stringify(t)),threadsV2:this._threadsV2?.map(vn.toJSON)}}static fromJSON(t){return new An(t.channel,t.threads?.map(t=>JSON.parse(t)),t.threadsV2?.map(vn.fromJSON))}}class Tn extends i{documentId;commentThreadId;commentId;static TYPE="95";static READABLE_TYPE_NAME="removeComment";static DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};constructor(t,e,n){super(),this.documentId=t,this.commentThreadId=e,this.commentId=n}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(t){return new Tn(t.documentId,t.commentThreadId,t.commentId)}}class _n extends i{documentId;commentThreadId;static TYPE="97";static READABLE_TYPE_NAME="removeCommentThread";static DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(t,e){super(),this.documentId=t,this.commentThreadId=e}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(t){return new _n(t.documentId,t.commentThreadId)}}class Cn extends i{documentId;commentThreadId;commentId;content;attributes;isAttributesUpdated;commentThread;static TYPE="96";static READABLE_TYPE_NAME="updateComment";static DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage";static 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}}};constructor(t,e,n,r,s=null,o=!1,i){super(),this.documentId=t,this.commentThreadId=e,this.commentId=n,this.content=r,this.attributes=s,this.isAttributesUpdated=o,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?vn.toJSON(this.commentThread):void 0}}static fromJSON(t){return new Cn(t.documentId,t.commentThreadId,t.commentId,t.content,t.attributes?JSON.parse(t.attributes):null,t.isAttributesUpdated,t.commentThread?vn.fromJSON(t.commentThread):void 0)}}class jn extends i{commentThreadId;documentId;static TYPE="93";static READABLE_TYPE_NAME="getComment";static DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(t,e){super(),this.commentThreadId=t,this.documentId=e}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(t){return new jn(t.commentThreadId,t.documentId)}}class En extends i{commentThreadId;_comments;_commentsV2;resolvedBy;comments;createdAt;deletedAt;resolvedAt;attributes;context;unlinkedAt;static DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse";static 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},unlinkedAt:{type:"string",id:10}}};constructor(t,e,n,r,s,o,i,a,c,d){super(),this.commentThreadId=t,this._comments=e,this._commentsV2=n,this.resolvedBy=s,this.comments=n?.length?n:e,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.unlinkedAt="string"==typeof d?new Date(d):d,this.attributes="string"==typeof r?JSON.parse(r):r,this.context="string"==typeof o?JSON.parse(o):o}toJSON(){return{commentThreadId:this.commentThreadId,comments:this._comments?.map(t=>JSON.stringify(t)),commentsV2:this._commentsV2?.map(In.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:this.createdAt?.toISOString(),deletedAt:this.deletedAt?.toISOString(),resolvedAt:this.resolvedAt?.toISOString(),unlinkedAt:this.unlinkedAt?.toISOString()}}static fromJSON(t){return new En(t.commentThreadId,t.comments?.map(t=>function(t){const e=JSON.parse(t);return{...e,createdAt:new Date(e.createdAt)}}(t)),t.commentsV2?.map(In.fromJSON),t.attributes?JSON.parse(t.attributes):t.attributes,t.resolvedBy,t.context?JSON.parse(t.context):t.context,t.createdAt,t.deletedAt,t.resolvedAt,t.unlinkedAt)}}class Dn extends i{documentId;static TYPE="94";static READABLE_TYPE_NAME="getDocumentThreads";static DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage";static DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new Dn(t.documentId)}}class Rn extends i{_threads;_threadsV2;threads;static DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse";static DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};constructor(t,e){super(),this._threads=t,this._threadsV2=e,this.threads=e?.length?e:t}toJSON(){return{threads:this._threads?.map(t=>JSON.stringify(t)),threadsV2:this._threadsV2?.map(vn.toJSON)}}static fromJSON(t){return new Rn(t.threads?.map(t=>function(t){const e=JSON.parse(t),n={...e};return e.comments&&(n.comments=e.comments?.map(t=>({...t,createdAt:new Date(t.createdAt)}))),n}(t)),t.threadsV2?.map(vn.fromJSON))}}class xn extends o{static DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor";static DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};static toJSON(t){return{commentId:t.commentId,createdAt:t.createdAt?.toISOString()}}static fromJSON(t){return{commentId:t.commentId,createdAt:new Date(t.createdAt)}}}class Nn extends i{commentThreadId;comments;createdAt;static DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};constructor(t,e,n=[]){super(),this.commentThreadId=t,this.comments=n,this.createdAt=new Date(e)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString(),comments:this.comments.map(t=>xn.toJSON(t))}}static fromJSON(t){return new Nn(t.commentThreadId,t.createdAt,t.comments.map(t=>xn.fromJSON(t)))}}class Vn extends i{documentId;commentThreadId;comments;context;resolvedBy;attributes;createdAt;resolvedAt;deletedAt;static TYPE="140";static READABLE_TYPE_NAME="addCommentThread";static DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage";static 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}}};constructor(t,e,n=[],r,s=null,o=null,i=null,a=null,c=null){super(),this.documentId=t,this.commentThreadId=e,this.comments=n,this.context=r,this.resolvedBy=s,this.attributes=c,this.createdAt=o?new Date(o):"",this.resolvedAt=i?new Date(i):"",this.deletedAt=a?new Date(a):""}toJSON(){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:this.comments?.map(t=>In.toJSON(t))}}static fromJSON(t){return new Vn(t.documentId,t.commentThreadId,t.comments?.map(e=>In.fromJSON({...e,documentId:t.documentId,commentThreadId:t.commentThreadId})),t.context?JSON.parse(t.context):t.context,t.resolvedBy,t.createdAt?new Date(t.createdAt):void 0,t.resolvedAt?new Date(t.resolvedAt):void 0,t.deletedAt?new Date(t.deletedAt):void 0,t.attributes?JSON.parse(t.attributes):t.attributes)}}class Mn extends i{commentThreadId;documentId;resolvedBy;resolvedAt;static TYPE="142";static READABLE_TYPE_NAME="resolveCommentThread";static DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};constructor(t,e,n,r){super(),this.commentThreadId=t,this.documentId=e,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt?.toISOString()}}static fromJSON(t){return new Mn(t.commentThreadId,t.documentId,t.resolvedBy,t.resolvedAt)}}class Bn extends i{commentThreadId;documentId;static TYPE="141";static READABLE_TYPE_NAME="reopenCommentThread";static DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};constructor(t,e){super(),this.commentThreadId=t,this.documentId=e}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(t){return new Bn(t.commentThreadId,t.documentId)}}class Un extends i{commentThreadId;documentId;context;attributes;unlinkedAt;static TYPE="143";static READABLE_TYPE_NAME="updateCommentThread";static DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},context:{type:"string",id:3},attributes:{type:"string",id:4},unlinkedAt:{type:"string",id:5}}};constructor(t,e,n,r=null,s=null){super(),this.commentThreadId=t,this.documentId=e,this.context=n,this.attributes=r,this.unlinkedAt=s?new Date(s):""}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,unlinkedAt:this.unlinkedAt instanceof Date?this.unlinkedAt.toISOString():this.unlinkedAt}}static fromJSON(t){return new Un(t.commentThreadId,t.documentId,t.context?JSON.parse(t.context):t.context,t.attributes?JSON.parse(t.attributes):null,t.unlinkedAt?new Date(t.unlinkedAt):null)}}class Jn extends i{commentThreadId;documentId;resolvedBy;resolvedAt;static DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse";static DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};constructor(t,e,n,r){super(),this.commentThreadId=t,this.documentId=e,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(t){return new Jn(t.commentThreadId,t.documentId,t.resolvedBy,t.resolvedAt)}}class qn extends((0,n.EmitterMixin)()){_documentId;_isConnected=!1;_wsGateway;_channel;_connectedSessions;static _SERVICE=9;constructor(t){super(),this._documentId=t}get isConnected(){return this._isConnected}async connect(t){if(this._isConnected)return;if(t.state!==Oe.CONNECTED)throw new Ht("WebSocket Gateway is not connected.",t);const e=new Pn(this._documentId);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(9,Pn.TYPE,l.encode(e)),{channel:r,threads:s}=l.decode(n,An);return this.listenTo(t,"change:state",(t,e,n)=>this._onWsGatewayStateChange(n),{priority:Ie._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(t,r),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(t,e,n,r){const s=new Sn(this._documentId,t,n,e,void 0,void 0,r),o=await this._sendRequest(Sn.TYPE,s);return l.decode(o,kn)}async updateComment(t,e,n,r){const s=void 0!==r,o=new Cn(this._documentId,t,e,n,r,s);await this._sendRequest(Cn.TYPE,o)}async removeComment(t,e){const n=new Tn(this._documentId,t,e);await this._sendRequest(Tn.TYPE,n)}async removeCommentThread(t){const e=new _n(this._documentId,t);await this._sendRequest(_n.TYPE,e)}async addCommentThread(t){const e=new Vn(this._documentId,t.commentThreadId,t.comments?.map(e=>({...e,documentId:this._documentId,commentThreadId:t.commentThreadId})),t.context,t.resolvedBy,t.createdAt,t.resolvedAt,t.deletedAt,t.attributes),n=await this._sendRequest(Vn.TYPE,e);return l.decode(n,Nn)}async resolveCommentThread(t){const e=new Mn(t,this._documentId),n=await this._sendRequest(Mn.TYPE,e);return l.decode(n,Jn)}async reopenCommentThread(t){const e=new Bn(t,this._documentId);await this._sendRequest(Bn.TYPE,e)}async updateCommentThread(t){const e=new Un(t.commentThreadId,this._documentId,t.context,t.attributes,t.unlinkedAt);await this._sendRequest(Un.TYPE,e)}async getCommentThread(t,e=1){const n=new jn(t,this._documentId);try{const t=await this._sendRequest(jn.TYPE,n),e=l.decode(t,En);return{commentThreadId:e.commentThreadId,comments:e.comments,attributes:e.attributes,context:e.context,resolvedAt:e.resolvedAt,resolvedBy:e.resolvedBy,deletedAt:e.deletedAt,unlinkedAt:e.unlinkedAt}}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&e<5)return await(r=100*e,new Promise(t=>{setTimeout(t,r)})),this.getCommentThread(t,e+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw Yt.fromPublicError(n)}var r}async getDocumentThreads(){const t=new Dn(this._documentId),e=await this._sendRequest(Dn.TYPE,t),{threads:n}=l.decode(e,Rn);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new xe("Comments",this);return this._connectedSessions||(this._connectedSessions=await un.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(t,e){this._channel=t._getChannel(qn._SERVICE,e),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Sn.TYPE),(t,e)=>{const n=l.decode(e,Sn);this.fire("commentAdded",n)}),this.listenTo(this._channel,this._channel.getEventName(Tn.TYPE),(t,e)=>{const n=l.decode(e,Tn);this.fire("commentRemoved",n)}),this.listenTo(this._channel,this._channel.getEventName(Cn.TYPE),(t,e)=>{const n=l.decode(e,Cn);this.fire("commentUpdated",n)}),this.listenTo(this._channel,this._channel.getEventName(_n.TYPE),(t,e)=>{const n=l.decode(e,_n);this.fire("commentThreadRemoved",n)}),this.listenTo(this._channel,this._channel.getEventName(Vn.TYPE),(t,e)=>{const n=l.decode(e,Vn);this.fire("commentThreadAdded",n)}),this.listenTo(this._channel,this._channel.getEventName(Un.TYPE),(t,e)=>{const n=l.decode(e,Un);this.fire("commentThreadUpdated",n)}),this.listenTo(this._channel,this._channel.getEventName(Mn.TYPE),(t,e)=>{const n=l.decode(e,Mn);this.fire("commentThreadResolved",n)}),this.listenTo(this._channel,this._channel.getEventName(Bn.TYPE),(t,e)=>{const n=l.decode(e,Bn);this.fire("commentThreadReopened",n)}))}_onWsGatewayStateChange(t){t===Oe.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new xe("Comments",this);return this._wsGateway._sendRequest(9,t,l.encode(e))}}const Ln=qn,Gn=Yn;function Hn(){const t=["limitExceeded","webSocketUrl","websocketgateway-plugin-already-registered","DISCONNECTED","listenTo","bind","set","define","WebSocketGateway","8196htlPPD","235DFOIDV","_shouldPluginsReconnect","cloudServices.requestTimeout","has","from","delete","context","stopListening","4783044PcwRwl","destroy","connected","CONNECTING","get","initialReconnectionInterval","plugins","isOfficialPlugin","state","1470dNeQBw","websocketgateway-missing-token","1407255mZEMIq","change:me","3TqBlKK","code","pluginName","cloudServices.connectionTimeout","removeFromReconnectionStack","requires","real-time-collaboration","CONNECTED","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.","config","Connected users limit exceeded","add","CloudServices","42211JDvwXR","disconnect","connection","showWarning","8dZBYRs","_domEmitter","websocketgateway-missing-websocket-url","init","130383VNmDxn","isPremiumPlugin","cloudservices-reconnection-error","token","addToReconnectionStack","cloudservices-init","_isBrowserOffline","error","638974PtsMWO","connect","_reconnectionStack","all","194706LSvBIg","isInReconnectionStack","17832cHFbNu","12SySGHC","function","then","_reconnect","online","offline","constructor","catch","reconnect","websocketgateway-invalid-plugin-interface"];return(Hn=function(){return t})()}function Yn(t,e){const n=Hn();return(Yn=function(t,e){return n[t-=346]})(t,e)}!function(t){const e=Yn,n=t();for(;;)try{if(985286===-parseInt(e(385))/1+parseInt(e(416))/2*(parseInt(e(387))/3)+parseInt(e(422))/4*(parseInt(e(366))/5)+parseInt(e(346))/6*(parseInt(e(374))/7)+parseInt(e(404))/8*(parseInt(e(420))/9)+parseInt(e(383))/10*(-parseInt(e(408))/11)+-parseInt(e(365))/12*(-parseInt(e(400))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Hn);class zn extends e.ContextPlugin{static[Gn(364)]=(()=>Ie)();static[Gn(379)]=1e3;[Gn(402)];[Gn(418)];[Gn(367)];[Gn(405)];static get[Gn(392)](){return[Gn(399),r.Notification]}static get[Gn(389)](){return Gn(364)}static get[Gn(381)](){return!0}static get[Gn(409)](){return!0}constructor(t){const e=Gn;super(t),this[e(362)](e(382),Oe[e(394)]),this[e(362)](e(414),!1),this[e(418)]=new Set,this[e(367)]=!1,this[e(405)]=new((0,n.DomEmitterMixin)())}[Gn(407)](){const t=Gn,e=this[t(372)],s=e[t(380)][t(378)](t(399)),o=e[t(380)][t(378)](r.Notification);if(!s[t(411)])throw new n.CKEditorError(t(384),this);if(!s[t(357)])throw new n.CKEditorError(t(406),this);return this[t(405)][t(360)](window,t(351),()=>this[t(414)]=!0),this[t(405)][t(360)](window,t(350),()=>this[t(414)]=!1),this[t(372)][t(396)][t(363)](t(390),10),this[t(372)][t(396)][t(363)](t(368),20),zn[t(364)][t(417)](s[t(411)],s[t(357)],{timeout:1e3*this[t(372)][t(396)][t(378)](t(390)),requestTimeout:1e3*this[t(372)][t(396)][t(378)](t(368))})[t(348)](e=>{const r=t;if(this[r(402)]=e,this[r(361)](r(382)).to(e,r(382),this,r(414),(t,e)=>(r(376)!==t&&(this[r(367)]=!0),e||t!==Oe[r(394)]?Oe[r(359)]:this[r(382)]==Oe[r(359)]&&this[r(367)]?(this[r(367)]=!1,this[r(349)](),Oe[r(377)]):Oe[r(394)])),this[r(402)].on(r(415),(t,e)=>{const s=r;if(s(356)!==e[s(388)])throw console[s(415)](e),new n.CKEditorError(s(413),null,{originalError:e});o[s(403)](s(395),{title:s(397),namespace:s(393)})}),!e.me)return new Promise(t=>e.on(r(386),t))})[t(353)](e=>{const r=t;throw console[r(415)](e),new n.CKEditorError(r(413),null,{originalError:e})})}[Gn(412)](t){const e=Gn;if(e(347)!=typeof t[e(354)])throw new n.CKEditorError(e(355),this);if(this[e(421)](t))throw new n.CKEditorError(e(358),this,{name:t[e(352)][e(389)]});this[e(418)][e(398)](t)}[Gn(391)](t){const e=Gn;this[e(418)][e(371)](t)}[Gn(421)](t){const e=Gn;return this[e(418)][e(369)](t)}[Gn(349)](){const t=Gn;return this[t(402)][t(354)]()[t(348)](()=>Promise[t(419)](Array[t(370)](this[t(418)],e=>e[t(354)]())))[t(348)](()=>this[t(382)]=Oe[t(394)])[t(353)](e=>{const r=t;throw console[r(415)](e),new n.CKEditorError(r(410),this[r(372)])})}[Gn(401)](){const t=Gn;this[t(402)]&&this[t(402)][t(401)](),this[t(382)]=Oe[t(359)],this[t(405)][t(373)]()}[Gn(375)](){const t=Gn;this[t(401)](),super[t(375)]()}}var Fn=__webpack_require__(211);const Kn=Xn;function Wn(){const t=["listenTo","unregister","channelConnectedUsers","user","_registeredSessions","forEach","defineMe","channelSessions","_uniqueUsersCount","_createUser","connection","4PFXJgH","_handleSessionAdd","isPremiumPlugin","has","connected","get","size","mySessionId","addUser","requires","delete","isMe","Sessions","allConnectedUsers","stopListening","sessions-register-already-registered","clear","getUserSessions","133740IVXOUZ","remove","state","init","32548xzhrfa","getUser","assign","2764164OpaCVf","3625006aPpnSK","7491450dJDuiu","sessionAdd:","add","plugins","_users","424ADejWO","545fgEZVW","change:state","role","fire","register","set","3871356oXMUTT","values","getUserRole","108441XowiXs","isOfficialPlugin","pluginName","orderNumber","context","sessionId","getUserBySessionId","_handleSessionRemove","sessions-unregister-not-exist"];return(Wn=function(){return t})()}function Xn(t,e){const n=Wn();return(Xn=function(t,e){return n[t-=287]})(t,e)}!function(t){const e=Xn,n=t();for(;;)try{if(556068===-parseInt(e(342))/1*(-parseInt(e(300))/2)+-parseInt(e(325))/3+-parseInt(e(322))/4*(-parseInt(e(333))/5)+-parseInt(e(339))/6+-parseInt(e(326))/7+parseInt(e(332))/8*(parseInt(e(318))/9)+parseInt(e(327))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Wn);class Zn extends e.ContextPlugin{[Kn(296)];[Kn(291)];[Kn(313)];[Kn(293)];[Kn(297)];[Kn(331)];static get[Kn(344)](){return Kn(312)}static get[Kn(343)](){return!0}static get[Kn(302)](){return!0}static get[Kn(309)](){return[zn,Fn.Users]}constructor(t){const e=Kn;super(t),this[e(296)]=new Map,this[e(291)]=new Map,this[e(313)]=new n.Collection,this[e(293)]=new Map,this[e(297)]=0,this[e(331)]=this[e(346)][e(330)][e(305)](Fn.Users)}[Kn(321)](){const t=Kn,e=this[t(346)][t(330)][t(305)](zn);this[t(289)](e,t(334),(e,n,r)=>{const s=t;if(s(304)!==r)this[s(296)][s(294)](t=>t[s(316)]()),this[s(291)][s(294)](t=>t[s(316)]()),this[s(313)][s(316)]();else for(const[t,e]of this[s(293)])for(const n of e)this[s(301)](t,n)}),this[t(298)](e[t(299)].me,!0)}[Kn(337)](t,e){const r=Kn;if(this[r(293)][r(303)](t))throw new n.CKEditorError(r(315),null,{channelId:t});this[r(293)][r(338)](t,e),this[r(296)][r(338)](t,new n.Collection),this[r(291)][r(338)](t,new n.Collection),this[r(289)](e,r(329),(e,n)=>this[r(301)](t,n)),this[r(289)](e,r(319),(e,n)=>this[r(287)](t,n));for(const n of e)this[r(301)](t,n)}[Kn(290)](t){const e=Kn;if(!this[e(293)][e(303)](t))throw new n.CKEditorError(e(288),null,{channelId:t});const r=this[e(293)][e(305)](t);this[e(314)](r);for(const n of r)e(304)===this[e(346)][e(330)][e(305)](zn)[e(320)]&&this[e(287)](t,n);this[e(293)][e(310)](t),this[e(296)][e(310)](t),this[e(291)][e(310)](t)}get[Kn(307)](){const t=Kn;return this[t(346)][t(330)][t(305)](zn)[t(299)][t(347)]}[Kn(348)](t){const e=Kn;for(const n of this[e(296)][e(340)]())for(const r of n)if(r.id===t)return r[e(292)]}[Kn(317)](t,e){const n=Kn,r=e?[this[n(296)][n(305)](e)]:this[n(296)][n(340)](),s=new Set;for(const e of r)for(const r of e)r[n(292)].id===t.id&&s[n(329)](r.id);return s}[Kn(341)](t){const e=Kn;for(const n of this[e(296)][e(340)]())for(const r of n)if(r[e(292)]===t)return r[e(335)]}[Kn(301)](t,e){const n=Kn;if(n(304)!==this[n(346)][n(330)][n(305)](zn)[n(320)])return;const r=e[n(292)],s=this[n(331)][n(323)](r.id)||this[n(298)](r),o=Object[n(324)]({},e,{user:s});this[n(296)][n(305)](t)[n(329)](o);const i=this[n(291)][n(305)](t);i[n(303)](s.id)||i[n(329)](s),this[n(313)][n(303)](s.id)||this[n(313)][n(329)](s,s[n(311)]?0:void 0),this[n(336)](n(328)+t,{channelId:t,session:o})}[Kn(287)](t,e){const n=Kn;if(n(304)!==this[n(346)][n(330)][n(305)](zn)[n(320)])return;const r=this[n(291)][n(305)](t),s=e[n(292)];s.id&&(this[n(296)][n(305)](t)[n(319)](e.id),r[n(303)](s.id)&&!this[n(317)](s,t)[n(306)]&&r[n(319)](s.id),this[n(313)][n(305)](s.id)&&!this[n(317)](s)[n(306)]&&this[n(313)][n(319)](s.id))}[Kn(298)](t,e){const n=Kn,r=this[n(331)][n(308)](t);return e&&this[n(331)][n(295)](t.id),r[n(345)]=this[n(297)]++,r}}var $n=__webpack_require__(673),Qn=__webpack_require__.n($n),tr=__webpack_require__(545),er=__webpack_require__.n(tr),nr=__webpack_require__(262),rr=__webpack_require__.n(nr),sr=__webpack_require__(667),or=__webpack_require__.n(sr),ir=__webpack_require__(357),ar=__webpack_require__.n(ir),cr=__webpack_require__(535),dr={attributes:{"data-cke":!0}};dr.setAttributes=or(),dr.insert=rr().bind(null,"head"),dr.domAPI=er(),dr.insertStyleElement=ar();Qn()(cr.A,dr);cr.A&&cr.A.locals&&cr.A.locals;const ur=lr;function lr(t,e){const n=pr();return(lr=function(t,e){return n[t-=363]})(t,e)}function pr(){const t=["getNearestSelectionRange","checkChild","user:range","start","undo","textContent","span","mouseenter","mapper","size","destroy","setAttribute","render","detach","isLimit","spellcheck","nodeAfter","$text","document","createUserMarkerOperations","marker","markers","false","root","updateMarker","addMarker","pluginName","tableCell","user:position:","getAttribute","parent","toDomElement","isPremiumPlugin","getStart","removeMarker","update:user:range","for","conversion","contenteditable","userPositionMarker","4378385kCaukP","clear","outerHTML","classList","add","isOfficialPlugin","requires","oldRange","mouseleave","$graveyard","addEventListener","ck-user__marker-tooltip","newRange","setCustomProperty","keydown","getPositions","user:","isInline","data-session-id","createUIElement","markerToElement","highest","selection","startsWith","mySessionId","_createdBatches","Escape","stopListening","end","UserMarkers","listenTo","change","plugins","user:position","getUserBySessionId","commands","markerToHighlight","15263990kcuGkH","reconvertMarker","isCollapsed",'<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>',"element","set","enqueueChange","split","getCustomProperty","isObject","getRange","484JhpEwS","get","rootName","name","getContainedElement","batch","innerHTML","change:range","markerName","init","881559gVkbiJ","removeClass","markerRange","markerNameToElements","editing","user:range:","hasContent","2157ksfLwo","ck-user__marker_hovered","createElement","ck-user__marker ","applyOperation","delete","deletionPosition","editor","getSelectionClass","type","ck-user__selection","editingDowncast","isDocumentOperation","schema","986CFmFiO","model","31qttltH","createRange","10766920QnRiMG","color","9673137GXKeKd","getFirstRange","18hSgBSB","isSimilar","orderNumber","hasDomSelection","view","getMarkerClass","toRange","afterInit","_domEmitter","remove","fromRange","has"];return(pr=function(){return t})()}!function(t){const e=lr,n=t();for(;;)try{if(685745===-parseInt(e(457))/1*(-parseInt(e(455))/2)+-parseInt(e(441))/3*(parseInt(e(424))/4)+-parseInt(e(376))/5+parseInt(e(463))/6*(parseInt(e(434))/7)+-parseInt(e(459))/8+parseInt(e(461))/9+parseInt(e(413))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(pr);class hr extends e.Plugin{[ur(471)]=new((0,n.DomEmitterMixin)());static get[ur(382)](){return[Zn]}static get[ur(501)](){return ur(405)}static get[ur(381)](){return!0}static get[ur(368)](){return!0}[ur(433)](){const t=ur,e=this[t(448)],r=e[t(408)][t(425)](Zn);e[t(373)][t(372)](t(452))[t(396)]({model:t(409),view:(n,{writer:s})=>function(e,n,r,s){const o=t,i=e[o(432)][o(420)](":")[2],a=r[o(410)](i);if(!a||i===r[o(400)])return;if(!s[o(456)][o(454)][o(476)](e[o(436)][o(478)],o(492)))return;const c={class:o(444)+a[o(460)][o(468)](),"data-name":a[o(427)],"data-session-id":i},d=s[o(456)][o(496)][o(425)](e[o(432)])[o(369)](),u=d[o(491)],l=s[o(456)][o(454)];if(u&&l[o(422)](u)&&l[o(393)](u)&&!s[o(456)][o(496)][o(425)](o(439)+i)[o(423)]()[o(415)])return;const p=d[o(366)];return s[o(456)][o(454)][o(489)](p)&&!s[o(456)][o(440)](p)&&(c[o(374)]=!1),function(t,e,n){const r=o,s=t[r(395)](r(481),e);return t[r(389)](r(375),!0,s),s[r(487)]=function(t){const e=r,s=this[e(367)](t),o=document[e(443)](e(481));return o[e(379)][e(380)](e(387)),o[e(486)](e(374),e(497)),o[e(486)](e(490),e(497)),o[e(480)]=n[e(427)],s[e(430)]=e(416)+o[e(378)]+"",s[e(386)](e(482),()=>{const t=e;s[t(379)][t(380)](t(442))}),s[e(386)](e(384),()=>{const t=e;s[t(379)][t(472)](t(442))}),s},s[r(464)]=function(t){const e=r;return!(!this[e(421)](e(375))||!t[e(421)](e(375))||this[e(365)](e(394))!=t[e(365)](e(394)))},s}(n,c,a)}(n,s,r,e)}),e[t(373)][t(372)](t(452))[t(412)]({model:t(477),view:e=>function(e,n){const r=t,s=e[r(432)][r(420)](":")[2];if(s===n[r(400)])return null;const o=n[r(410)](s);return o?{id:s,classes:[r(451),o[r(460)][r(449)]()],attributes:{"data-session-id":s},priority:2e3+o[r(465)]}:{id:s,classes:[]}}(e,r)}),function(e){const n=t,r=e[n(456)],o=new Map,i=e[n(408)][n(425)](Zn);r[n(496)].on(n(371),(t,a,c,d)=>{const u=n;if(!d&&o[u(425)](a[u(427)]))return o[u(425)](a[u(427)])[u(488)](),void o[u(446)](a[u(427)]);const l=a[u(427)][u(420)](":")[2];if(l===i[u(400)])return;const p=u(364)+l;r[u(496)][u(474)](p)&&e[u(438)][u(414)](p),a.on(u(431),(t,e,n)=>{const i=u;if(i(385)!=e[i(498)][i(426)]&&i(385)==a[i(423)]()[i(498)][i(426)]&&!o[i(474)](a[i(427)])){const t=r[i(454)][i(475)](n[i(447)]);if(t){const e=s.ModelLiveRange[i(473)](t);o[i(418)](a[i(427)],e),e.on(i(431),(t,n,s)=>{const c=i;if(c(385)==e[c(498)][c(426)]){const t=r[c(454)][c(475)](s[c(447)]);t?(e[c(478)]=t[c(478)],e[c(404)]=t[c(404)]):(o[c(446)](a[c(427)]),e[c(488)]())}})}}})}),r[n(493)].on(n(407),()=>{const t=n;o[t(484)]>0&&r[t(419)]({isUndoable:!1},e=>{const n=t;for(const[t,s]of o)n(385)==r[n(496)][n(425)](t)[n(423)]()[n(498)][n(426)]&&(fr(t[n(420)](":")[2],s[n(469)](),r,e),s[n(488)]());o[n(377)]()})})}(e),this[t(471)][t(406)](n.global[t(493)],t(390),(n,{key:r})=>{const s=t;s(402)===r&&function(t){const e=s;t[e(438)][e(467)][e(407)](n=>{const r=e;for(const e of t[r(456)][r(496)]){if(!e[r(427)][r(399)](r(409)))continue;const s=t[r(438)][r(483)][r(437)](e[r(427)]);if(s)for(const t of s)n[r(435)](r(442),t)}})}(e)},{useCapture:!0})}[ur(470)](){const t=ur,e=this[t(448)],n=e[t(411)][t(425)](t(479));n&&e[t(456)].on(t(445),(r,s)=>{const o=t,i=s[0];if(!i[o(453)])return;if(o(495)!=i[o(450)]||!i[o(427)][o(399)](o(392)))return;const a=i[o(429)];n[o(401)][o(474)](a)&&(i[o(388)]=i[o(383)]?e[o(456)][o(458)](i[o(383)][o(478)],i[o(383)][o(404)]):null)},{priority:t(397)})}[ur(485)](){const t=ur;return this[t(471)][t(403)](),super[t(485)]()}[ur(494)](){const t=ur,e=this[t(448)],n=e[t(456)][t(493)],r=e[t(408)][t(425)](Zn);e[t(456)][t(419)]({isUndoable:!1},s=>{const o=t,i=o(439)+r[o(400)],a=o(364)+r[o(400)],c=e[o(456)][o(496)][o(474)](i);e[o(438)][o(467)][o(466)]?fr(r[o(400)],n[o(398)][o(462)](),e[o(456)],s):c&&(s[o(370)](i),s[o(370)](a))})}}function fr(t,e,n,r){const s=ur,o=s(439)+t,i=s(364)+t,a=e[s(428)]();let c=e[s(478)];if(a&&a.is(s(417),s(363))){const t=function(t,e){const n=s;for(const r of t[n(391)]())if(e[n(454)][n(476)](r,n(492)))return r}(e,n);t&&(c=t,e=r[s(458)](c))}const d=r[s(458)](c);n[s(496)][s(474)](o)?(r[s(499)](o,{range:e}),r[s(499)](i,{range:d})):(r[s(500)](o,{range:e,usingOperation:!0}),r[s(500)](i,{range:d,usingOperation:!0}))}function mr(t,e,n){const r=t.t,s=t.t;switch(e){case"PENDING_ACTION_SENDING_DATA":return s({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 s("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 s("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 s("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 s("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 s("Synchronization issue");case"Connected users list dropdown menu":return s("Connected users list dropdown menu");case"Collapsed connected users list (press ENTER to open it)":return s("Collapsed connected users list (press ENTER to open it)");case"Connected users list":return s("Connected users list");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return s({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}const yr=(()=>{var t=d.Reader,e=d.Writer,n=d.util,r=d.roots.default||(d.roots.default={});return r.AttributeOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.range=null,s.prototype.key="",s.prototype.oldValueBoolean=!1,s.prototype.oldValueJson="",s.prototype.newValueBoolean=!1,s.prototype.newValueJson="",s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.range&&Object.hasOwnProperty.call(t,"range")&&r.Range.encode(t.range,n.uint32(10).fork()).ldelim(),null!=t.key&&Object.hasOwnProperty.call(t,"key")&&n.uint32(18).string(t.key),null!=t.oldValueBoolean&&Object.hasOwnProperty.call(t,"oldValueBoolean")&&n.uint32(24).bool(t.oldValueBoolean),null!=t.oldValueJson&&Object.hasOwnProperty.call(t,"oldValueJson")&&n.uint32(34).string(t.oldValueJson),null!=t.newValueBoolean&&Object.hasOwnProperty.call(t,"newValueBoolean")&&n.uint32(40).bool(t.newValueBoolean),null!=t.newValueJson&&Object.hasOwnProperty.call(t,"newValueJson")&&n.uint32(50).string(t.newValueJson),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(56).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.AttributeOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.range=r.Range.decode(e,e.uint32());break;case 2:o.key=e.string();break;case 3:o.oldValueBoolean=e.bool();break;case 4:o.oldValueJson=e.string();break;case 5:o.newValueBoolean=e.bool();break;case 6:o.newValueJson=e.string();break;case 7:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.range&&t.hasOwnProperty("range")){var e=r.Range.verify(t.range);if(e)return"range."+e}return null!=t.key&&t.hasOwnProperty("key")&&!n.isString(t.key)?"key: string expected":null!=t.oldValueBoolean&&t.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof t.oldValueBoolean?"oldValueBoolean: boolean expected":null!=t.oldValueJson&&t.hasOwnProperty("oldValueJson")&&!n.isString(t.oldValueJson)?"oldValueJson: string expected":null!=t.newValueBoolean&&t.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof t.newValueBoolean?"newValueBoolean: boolean expected":null!=t.newValueJson&&t.hasOwnProperty("newValueJson")&&!n.isString(t.newValueJson)?"newValueJson: string expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.AttributeOperation)return t;var e=new r.AttributeOperation;if(null!=t.range){if("object"!=typeof t.range)throw TypeError(".AttributeOperation.range: object expected");e.range=r.Range.fromObject(t.range)}return null!=t.key&&(e.key=String(t.key)),null!=t.oldValueBoolean&&(e.oldValueBoolean=Boolean(t.oldValueBoolean)),null!=t.oldValueJson&&(e.oldValueJson=String(t.oldValueJson)),null!=t.newValueBoolean&&(e.newValueBoolean=Boolean(t.newValueBoolean)),null!=t.newValueJson&&(e.newValueJson=String(t.newValueJson)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.range=null,n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=t.range&&t.hasOwnProperty("range")&&(n.range=r.Range.toObject(t.range,e)),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.oldValueBoolean&&t.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=t.oldValueBoolean),null!=t.oldValueJson&&t.hasOwnProperty("oldValueJson")&&(n.oldValueJson=t.oldValueJson),null!=t.newValueBoolean&&t.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=t.newValueBoolean),null!=t.newValueJson&&t.hasOwnProperty("newValueJson")&&(n.newValueJson=t.newValueJson),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/AttributeOperation"},s}(),r.InsertOperation=function(){function s(t){if(this.nodes=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.position=null,s.prototype.nodes=n.emptyArray,s.prototype.shouldReceiveAttributes=!1,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.position&&Object.hasOwnProperty.call(t,"position")&&r.Position.encode(t.position,n.uint32(10).fork()).ldelim(),null!=t.nodes&&t.nodes.length)for(var s=0;s<t.nodes.length;++s)r.Element.encode(t.nodes[s],n.uint32(18).fork()).ldelim();return null!=t.shouldReceiveAttributes&&Object.hasOwnProperty.call(t,"shouldReceiveAttributes")&&n.uint32(24).bool(t.shouldReceiveAttributes),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(32).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.InsertOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.position=r.Position.decode(e,e.uint32());break;case 2:o.nodes&&o.nodes.length||(o.nodes=[]),o.nodes.push(r.Element.decode(e,e.uint32()));break;case 3:o.shouldReceiveAttributes=e.bool();break;case 4:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.position&&t.hasOwnProperty("position")&&(n=r.Position.verify(t.position)))return"position."+n;if(null!=t.nodes&&t.hasOwnProperty("nodes")){if(!Array.isArray(t.nodes))return"nodes: array expected";for(var e=0;e<t.nodes.length;++e){var n;if(n=r.Element.verify(t.nodes[e]))return"nodes."+n}}return null!=t.shouldReceiveAttributes&&t.hasOwnProperty("shouldReceiveAttributes")&&"boolean"!=typeof t.shouldReceiveAttributes?"shouldReceiveAttributes: boolean expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.InsertOperation)return t;var e=new r.InsertOperation;if(null!=t.position){if("object"!=typeof t.position)throw TypeError(".InsertOperation.position: object expected");e.position=r.Position.fromObject(t.position)}if(t.nodes){if(!Array.isArray(t.nodes))throw TypeError(".InsertOperation.nodes: array expected");e.nodes=[];for(var n=0;n<t.nodes.length;++n){if("object"!=typeof t.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");e.nodes[n]=r.Element.fromObject(t.nodes[n])}}return null!=t.shouldReceiveAttributes&&(e.shouldReceiveAttributes=Boolean(t.shouldReceiveAttributes)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.nodes=[]),e.defaults&&(n.position=null,n.shouldReceiveAttributes=!1,n.wasUndone=!1),null!=t.position&&t.hasOwnProperty("position")&&(n.position=r.Position.toObject(t.position,e)),t.nodes&&t.nodes.length){n.nodes=[];for(var s=0;s<t.nodes.length;++s)n.nodes[s]=r.Element.toObject(t.nodes[s],e)}return null!=t.shouldReceiveAttributes&&t.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=t.shouldReceiveAttributes),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/InsertOperation"},s}(),r.MarkerOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.name="",s.prototype.oldRange=null,s.prototype.newRange=null,s.prototype.affectsData=!1,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.name&&Object.hasOwnProperty.call(t,"name")&&n.uint32(10).string(t.name),null!=t.oldRange&&Object.hasOwnProperty.call(t,"oldRange")&&r.Range.encode(t.oldRange,n.uint32(18).fork()).ldelim(),null!=t.newRange&&Object.hasOwnProperty.call(t,"newRange")&&r.Range.encode(t.newRange,n.uint32(26).fork()).ldelim(),null!=t.affectsData&&Object.hasOwnProperty.call(t,"affectsData")&&n.uint32(32).bool(t.affectsData),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(40).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.MarkerOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.name=e.string();break;case 2:o.oldRange=r.Range.decode(e,e.uint32());break;case 3:o.newRange=r.Range.decode(e,e.uint32());break;case 4:o.affectsData=e.bool();break;case 5:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.name&&t.hasOwnProperty("name")&&!n.isString(t.name))return"name: string expected";var e;if(null!=t.oldRange&&t.hasOwnProperty("oldRange")&&(e=r.Range.verify(t.oldRange)))return"oldRange."+e;if(null!=t.newRange&&t.hasOwnProperty("newRange")&&(e=r.Range.verify(t.newRange)))return"newRange."+e;return null!=t.affectsData&&t.hasOwnProperty("affectsData")&&"boolean"!=typeof t.affectsData?"affectsData: boolean expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.MarkerOperation)return t;var e=new r.MarkerOperation;if(null!=t.name&&(e.name=String(t.name)),null!=t.oldRange){if("object"!=typeof t.oldRange)throw TypeError(".MarkerOperation.oldRange: object expected");e.oldRange=r.Range.fromObject(t.oldRange)}if(null!=t.newRange){if("object"!=typeof t.newRange)throw TypeError(".MarkerOperation.newRange: object expected");e.newRange=r.Range.fromObject(t.newRange)}return null!=t.affectsData&&(e.affectsData=Boolean(t.affectsData)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.name="",n.oldRange=null,n.newRange=null,n.affectsData=!1,n.wasUndone=!1),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.oldRange&&t.hasOwnProperty("oldRange")&&(n.oldRange=r.Range.toObject(t.oldRange,e)),null!=t.newRange&&t.hasOwnProperty("newRange")&&(n.newRange=r.Range.toObject(t.newRange,e)),null!=t.affectsData&&t.hasOwnProperty("affectsData")&&(n.affectsData=t.affectsData),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/MarkerOperation"},s}(),r.MergeOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.sourcePosition=null,s.prototype.targetPosition=null,s.prototype.graveyardPosition=null,s.prototype.howMany=0,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.sourcePosition&&Object.hasOwnProperty.call(t,"sourcePosition")&&r.Position.encode(t.sourcePosition,n.uint32(10).fork()).ldelim(),null!=t.targetPosition&&Object.hasOwnProperty.call(t,"targetPosition")&&r.Position.encode(t.targetPosition,n.uint32(18).fork()).ldelim(),null!=t.graveyardPosition&&Object.hasOwnProperty.call(t,"graveyardPosition")&&r.Position.encode(t.graveyardPosition,n.uint32(26).fork()).ldelim(),null!=t.howMany&&Object.hasOwnProperty.call(t,"howMany")&&n.uint32(32).uint32(t.howMany),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(40).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.MergeOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.sourcePosition=r.Position.decode(e,e.uint32());break;case 2:o.targetPosition=r.Position.decode(e,e.uint32());break;case 3:o.graveyardPosition=r.Position.decode(e,e.uint32());break;case 4:o.howMany=e.uint32();break;case 5:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e;if(null!=t.sourcePosition&&t.hasOwnProperty("sourcePosition")&&(e=r.Position.verify(t.sourcePosition)))return"sourcePosition."+e;if(null!=t.targetPosition&&t.hasOwnProperty("targetPosition")&&(e=r.Position.verify(t.targetPosition)))return"targetPosition."+e;if(null!=t.graveyardPosition&&t.hasOwnProperty("graveyardPosition")&&(e=r.Position.verify(t.graveyardPosition)))return"graveyardPosition."+e;return null!=t.howMany&&t.hasOwnProperty("howMany")&&!n.isInteger(t.howMany)?"howMany: integer expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.MergeOperation)return t;var e=new r.MergeOperation;if(null!=t.sourcePosition){if("object"!=typeof t.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");e.sourcePosition=r.Position.fromObject(t.sourcePosition)}if(null!=t.targetPosition){if("object"!=typeof t.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");e.targetPosition=r.Position.fromObject(t.targetPosition)}if(null!=t.graveyardPosition){if("object"!=typeof t.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");e.graveyardPosition=r.Position.fromObject(t.graveyardPosition)}return null!=t.howMany&&(e.howMany=t.howMany>>>0),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.sourcePosition=null,n.targetPosition=null,n.graveyardPosition=null,n.howMany=0,n.wasUndone=!1),null!=t.sourcePosition&&t.hasOwnProperty("sourcePosition")&&(n.sourcePosition=r.Position.toObject(t.sourcePosition,e)),null!=t.targetPosition&&t.hasOwnProperty("targetPosition")&&(n.targetPosition=r.Position.toObject(t.targetPosition,e)),null!=t.graveyardPosition&&t.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=r.Position.toObject(t.graveyardPosition,e)),null!=t.howMany&&t.hasOwnProperty("howMany")&&(n.howMany=t.howMany),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/MergeOperation"},s}(),r.MoveOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.sourcePosition=null,s.prototype.howMany=0,s.prototype.targetPosition=null,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.sourcePosition&&Object.hasOwnProperty.call(t,"sourcePosition")&&r.Position.encode(t.sourcePosition,n.uint32(10).fork()).ldelim(),null!=t.howMany&&Object.hasOwnProperty.call(t,"howMany")&&n.uint32(16).uint32(t.howMany),null!=t.targetPosition&&Object.hasOwnProperty.call(t,"targetPosition")&&r.Position.encode(t.targetPosition,n.uint32(26).fork()).ldelim(),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(32).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.MoveOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.sourcePosition=r.Position.decode(e,e.uint32());break;case 2:o.howMany=e.uint32();break;case 3:o.targetPosition=r.Position.decode(e,e.uint32());break;case 4:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e;if(null!=t.sourcePosition&&t.hasOwnProperty("sourcePosition")&&(e=r.Position.verify(t.sourcePosition)))return"sourcePosition."+e;if(null!=t.howMany&&t.hasOwnProperty("howMany")&&!n.isInteger(t.howMany))return"howMany: integer expected";if(null!=t.targetPosition&&t.hasOwnProperty("targetPosition")&&(e=r.Position.verify(t.targetPosition)))return"targetPosition."+e;return null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.MoveOperation)return t;var e=new r.MoveOperation;if(null!=t.sourcePosition){if("object"!=typeof t.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");e.sourcePosition=r.Position.fromObject(t.sourcePosition)}if(null!=t.howMany&&(e.howMany=t.howMany>>>0),null!=t.targetPosition){if("object"!=typeof t.targetPosition)throw TypeError(".MoveOperation.targetPosition: object expected");e.targetPosition=r.Position.fromObject(t.targetPosition)}return null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=t.sourcePosition&&t.hasOwnProperty("sourcePosition")&&(n.sourcePosition=r.Position.toObject(t.sourcePosition,e)),null!=t.howMany&&t.hasOwnProperty("howMany")&&(n.howMany=t.howMany),null!=t.targetPosition&&t.hasOwnProperty("targetPosition")&&(n.targetPosition=r.Position.toObject(t.targetPosition,e)),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/MoveOperation"},s}(),r.RenameOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.position=null,s.prototype.oldName="",s.prototype.newName="",s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.position&&Object.hasOwnProperty.call(t,"position")&&r.Position.encode(t.position,n.uint32(10).fork()).ldelim(),null!=t.oldName&&Object.hasOwnProperty.call(t,"oldName")&&n.uint32(18).string(t.oldName),null!=t.newName&&Object.hasOwnProperty.call(t,"newName")&&n.uint32(26).string(t.newName),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(32).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RenameOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.position=r.Position.decode(e,e.uint32());break;case 2:o.oldName=e.string();break;case 3:o.newName=e.string();break;case 4:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.position&&t.hasOwnProperty("position")){var e=r.Position.verify(t.position);if(e)return"position."+e}return null!=t.oldName&&t.hasOwnProperty("oldName")&&!n.isString(t.oldName)?"oldName: string expected":null!=t.newName&&t.hasOwnProperty("newName")&&!n.isString(t.newName)?"newName: string expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RenameOperation)return t;var e=new r.RenameOperation;if(null!=t.position){if("object"!=typeof t.position)throw TypeError(".RenameOperation.position: object expected");e.position=r.Position.fromObject(t.position)}return null!=t.oldName&&(e.oldName=String(t.oldName)),null!=t.newName&&(e.newName=String(t.newName)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=t.position&&t.hasOwnProperty("position")&&(n.position=r.Position.toObject(t.position,e)),null!=t.oldName&&t.hasOwnProperty("oldName")&&(n.oldName=t.oldName),null!=t.newName&&t.hasOwnProperty("newName")&&(n.newName=t.newName),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RenameOperation"},s}(),r.RootAttributeOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.root="",s.prototype.key="",s.prototype.oldValueBoolean=!1,s.prototype.oldValueJson="",s.prototype.newValueBoolean=!1,s.prototype.newValueJson="",s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.root&&Object.hasOwnProperty.call(t,"root")&&n.uint32(10).string(t.root),null!=t.key&&Object.hasOwnProperty.call(t,"key")&&n.uint32(18).string(t.key),null!=t.oldValueBoolean&&Object.hasOwnProperty.call(t,"oldValueBoolean")&&n.uint32(24).bool(t.oldValueBoolean),null!=t.oldValueJson&&Object.hasOwnProperty.call(t,"oldValueJson")&&n.uint32(34).string(t.oldValueJson),null!=t.newValueBoolean&&Object.hasOwnProperty.call(t,"newValueBoolean")&&n.uint32(40).bool(t.newValueBoolean),null!=t.newValueJson&&Object.hasOwnProperty.call(t,"newValueJson")&&n.uint32(50).string(t.newValueJson),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(56).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RootAttributeOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.root=e.string();break;case 2:o.key=e.string();break;case 3:o.oldValueBoolean=e.bool();break;case 4:o.oldValueJson=e.string();break;case 5:o.newValueBoolean=e.bool();break;case 6:o.newValueJson=e.string();break;case 7:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.root&&t.hasOwnProperty("root")&&!n.isString(t.root)?"root: string expected":null!=t.key&&t.hasOwnProperty("key")&&!n.isString(t.key)?"key: string expected":null!=t.oldValueBoolean&&t.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof t.oldValueBoolean?"oldValueBoolean: boolean expected":null!=t.oldValueJson&&t.hasOwnProperty("oldValueJson")&&!n.isString(t.oldValueJson)?"oldValueJson: string expected":null!=t.newValueBoolean&&t.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof t.newValueBoolean?"newValueBoolean: boolean expected":null!=t.newValueJson&&t.hasOwnProperty("newValueJson")&&!n.isString(t.newValueJson)?"newValueJson: string expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RootAttributeOperation)return t;var e=new r.RootAttributeOperation;return null!=t.root&&(e.root=String(t.root)),null!=t.key&&(e.key=String(t.key)),null!=t.oldValueBoolean&&(e.oldValueBoolean=Boolean(t.oldValueBoolean)),null!=t.oldValueJson&&(e.oldValueJson=String(t.oldValueJson)),null!=t.newValueBoolean&&(e.newValueBoolean=Boolean(t.newValueBoolean)),null!=t.newValueJson&&(e.newValueJson=String(t.newValueJson)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.root="",n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=t.root&&t.hasOwnProperty("root")&&(n.root=t.root),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.oldValueBoolean&&t.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=t.oldValueBoolean),null!=t.oldValueJson&&t.hasOwnProperty("oldValueJson")&&(n.oldValueJson=t.oldValueJson),null!=t.newValueBoolean&&t.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=t.newValueBoolean),null!=t.newValueJson&&t.hasOwnProperty("newValueJson")&&(n.newValueJson=t.newValueJson),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RootAttributeOperation"},s}(),r.RootOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.rootName="",s.prototype.elementName="",s.prototype.isAdd=!1,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.rootName&&Object.hasOwnProperty.call(t,"rootName")&&n.uint32(10).string(t.rootName),null!=t.elementName&&Object.hasOwnProperty.call(t,"elementName")&&n.uint32(18).string(t.elementName),null!=t.isAdd&&Object.hasOwnProperty.call(t,"isAdd")&&n.uint32(24).bool(t.isAdd),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(32).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RootOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.rootName=e.string();break;case 2:o.elementName=e.string();break;case 3:o.isAdd=e.bool();break;case 4:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.rootName&&t.hasOwnProperty("rootName")&&!n.isString(t.rootName)?"rootName: string expected":null!=t.elementName&&t.hasOwnProperty("elementName")&&!n.isString(t.elementName)?"elementName: string expected":null!=t.isAdd&&t.hasOwnProperty("isAdd")&&"boolean"!=typeof t.isAdd?"isAdd: boolean expected":null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.RootOperation)return t;var e=new r.RootOperation;return null!=t.rootName&&(e.rootName=String(t.rootName)),null!=t.elementName&&(e.elementName=String(t.elementName)),null!=t.isAdd&&(e.isAdd=Boolean(t.isAdd)),null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.rootName="",n.elementName="",n.isAdd=!1,n.wasUndone=!1),null!=t.rootName&&t.hasOwnProperty("rootName")&&(n.rootName=t.rootName),null!=t.elementName&&t.hasOwnProperty("elementName")&&(n.elementName=t.elementName),null!=t.isAdd&&t.hasOwnProperty("isAdd")&&(n.isAdd=t.isAdd),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/RootOperation"},s}(),r.SplitOperation=function(){function s(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.splitPosition=null,s.prototype.graveyardPosition=null,s.prototype.howMany=0,s.prototype.insertionPosition=null,s.prototype.wasUndone=!1,s.create=function(t){return new s(t)},s.encode=function(t,n){return n||(n=e.create()),null!=t.splitPosition&&Object.hasOwnProperty.call(t,"splitPosition")&&r.Position.encode(t.splitPosition,n.uint32(10).fork()).ldelim(),null!=t.graveyardPosition&&Object.hasOwnProperty.call(t,"graveyardPosition")&&r.Position.encode(t.graveyardPosition,n.uint32(18).fork()).ldelim(),null!=t.howMany&&Object.hasOwnProperty.call(t,"howMany")&&n.uint32(24).uint32(t.howMany),null!=t.insertionPosition&&Object.hasOwnProperty.call(t,"insertionPosition")&&r.Position.encode(t.insertionPosition,n.uint32(34).fork()).ldelim(),null!=t.wasUndone&&Object.hasOwnProperty.call(t,"wasUndone")&&n.uint32(40).bool(t.wasUndone),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SplitOperation;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.splitPosition=r.Position.decode(e,e.uint32());break;case 2:o.graveyardPosition=r.Position.decode(e,e.uint32());break;case 3:o.howMany=e.uint32();break;case 4:o.insertionPosition=r.Position.decode(e,e.uint32());break;case 5:o.wasUndone=e.bool();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e;if(null!=t.splitPosition&&t.hasOwnProperty("splitPosition")&&(e=r.Position.verify(t.splitPosition)))return"splitPosition."+e;if(null!=t.graveyardPosition&&t.hasOwnProperty("graveyardPosition")&&(e=r.Position.verify(t.graveyardPosition)))return"graveyardPosition."+e;if(null!=t.howMany&&t.hasOwnProperty("howMany")&&!n.isInteger(t.howMany))return"howMany: integer expected";if(null!=t.insertionPosition&&t.hasOwnProperty("insertionPosition")&&(e=r.Position.verify(t.insertionPosition)))return"insertionPosition."+e;return null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&"boolean"!=typeof t.wasUndone?"wasUndone: boolean expected":null},s.fromObject=function(t){if(t instanceof r.SplitOperation)return t;var e=new r.SplitOperation;if(null!=t.splitPosition){if("object"!=typeof t.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");e.splitPosition=r.Position.fromObject(t.splitPosition)}if(null!=t.graveyardPosition){if("object"!=typeof t.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");e.graveyardPosition=r.Position.fromObject(t.graveyardPosition)}if(null!=t.howMany&&(e.howMany=t.howMany>>>0),null!=t.insertionPosition){if("object"!=typeof t.insertionPosition)throw TypeError(".SplitOperation.insertionPosition: object expected");e.insertionPosition=r.Position.fromObject(t.insertionPosition)}return null!=t.wasUndone&&(e.wasUndone=Boolean(t.wasUndone)),e},s.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.splitPosition=null,n.graveyardPosition=null,n.howMany=0,n.insertionPosition=null,n.wasUndone=!1),null!=t.splitPosition&&t.hasOwnProperty("splitPosition")&&(n.splitPosition=r.Position.toObject(t.splitPosition,e)),null!=t.graveyardPosition&&t.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=r.Position.toObject(t.graveyardPosition,e)),null!=t.howMany&&t.hasOwnProperty("howMany")&&(n.howMany=t.howMany),null!=t.insertionPosition&&t.hasOwnProperty("insertionPosition")&&(n.insertionPosition=r.Position.toObject(t.insertionPosition,e)),null!=t.wasUndone&&t.hasOwnProperty("wasUndone")&&(n.wasUndone=t.wasUndone),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/SplitOperation"},s}(),r.Position=function(){function s(t){if(this.path=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.root="",s.prototype.rootMain=!1,s.prototype.rootGraveyard=!1,s.prototype.path=n.emptyArray,s.prototype.stickiness="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.root&&Object.hasOwnProperty.call(t,"root")&&n.uint32(10).string(t.root),null!=t.rootMain&&Object.hasOwnProperty.call(t,"rootMain")&&n.uint32(16).bool(t.rootMain),null!=t.rootGraveyard&&Object.hasOwnProperty.call(t,"rootGraveyard")&&n.uint32(24).bool(t.rootGraveyard),null!=t.path&&t.path.length){n.uint32(34).fork();for(var r=0;r<t.path.length;++r)n.uint32(t.path[r]);n.ldelim()}return null!=t.stickiness&&Object.hasOwnProperty.call(t,"stickiness")&&n.uint32(42).string(t.stickiness),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.Position;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.root=e.string();break;case 2:o.rootMain=e.bool();break;case 3:o.rootGraveyard=e.bool();break;case 4:if(o.path&&o.path.length||(o.path=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.path.push(e.uint32());else o.path.push(e.uint32());break;case 5:o.stickiness=e.string();break;default:e.skipType(7&i)}}return o},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.root&&t.hasOwnProperty("root")&&!n.isString(t.root))return"root: string expected";if(null!=t.rootMain&&t.hasOwnProperty("rootMain")&&"boolean"!=typeof t.rootMain)return"rootMain: boolean expected";if(null!=t.rootGraveyard&&t.hasOwnProperty("rootGraveyard")&&"boolean"!=typeof t.rootGraveyard)return"rootGraveyard: boolean expected";if(null!=t.path&&t.hasOwnProperty("path")){if(!Array.isArray(t.path))return"path: array expected";for(var e=0;e<t.path.length;++e)if(!n.isInteger(t.path[e]))return"path: integer[] expected"}return null!=t.stickiness&&t.hasOwnProperty("stickiness")&&!n.isString(t.stickiness)?"stickiness: string expected":null},s.fromObject=function(t){if(t instanceof r.Position)return t;var e=new r.Position;if(null!=t.root&&(e.root=String(t.root)),null!=t.rootMain&&(e.rootMain=Boolean(t.rootMain)),null!=t.rootGraveyard&&(e.rootGraveyard=Boolean(t.rootGraveyard)),t.path){if(!Array.isArray(t.path))throw TypeError(".Position.path: array expected");e.path=[];for(var n=0;n<t.path.length;++n)e.path[n]=t.path[n]>>>0}return null!=t.stickiness&&(e.stickiness=String(t.stickiness)),e},s.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.path=[]),e.defaults&&(n.root="",n.rootMain=!1,n.rootGraveyard=!1,n.stickiness=""),null!=t.root&&t.hasOwnProperty("root")&&(n.root=t.root),null!=t.rootMain&&t.hasOwnProperty("rootMain")&&(n.rootMain=t.rootMain),null!=t.rootGraveyard&&t.hasOwnProperty("rootGraveyard")&&(n.rootGraveyard=t.rootGraveyard),t.path&&t.path.length){n.path=[];for(var r=0;r<t.path.length;++r)n.path[r]=t.path[r]}return null!=t.stickiness&&t.hasOwnProperty("stickiness")&&(n.stickiness=t.stickiness),n},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/Position"},s}(),r.Range=function(){function n(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return n.prototype.start=null,n.prototype.end=null,n.create=function(t){return new n(t)},n.encode=function(t,n){return n||(n=e.create()),null!=t.start&&Object.hasOwnProperty.call(t,"start")&&r.Position.encode(t.start,n.uint32(10).fork()).ldelim(),null!=t.end&&Object.hasOwnProperty.call(t,"end")&&r.Position.encode(t.end,n.uint32(18).fork()).ldelim(),n},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(e,n){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.Range;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.start=r.Position.decode(e,e.uint32());break;case 2:o.end=r.Position.decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},n.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},n.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e;if(null!=t.start&&t.hasOwnProperty("start")&&(e=r.Position.verify(t.start)))return"start."+e;if(null!=t.end&&t.hasOwnProperty("end")&&(e=r.Position.verify(t.end)))return"end."+e;return null},n.fromObject=function(t){if(t instanceof r.Range)return t;var e=new r.Range;if(null!=t.start){if("object"!=typeof t.start)throw TypeError(".Range.start: object expected");e.start=r.Position.fromObject(t.start)}if(null!=t.end){if("object"!=typeof t.end)throw TypeError(".Range.end: object expected");e.end=r.Position.fromObject(t.end)}return e},n.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.start=null,n.end=null),null!=t.start&&t.hasOwnProperty("start")&&(n.start=r.Position.toObject(t.start,e)),null!=t.end&&t.hasOwnProperty("end")&&(n.end=r.Position.toObject(t.end,e)),n},n.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},n.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/Range"},n}(),r.Element=function(){function s(t){if(this.children=[],this.attributesBoolean={},t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return s.prototype.name="",s.prototype.children=n.emptyArray,s.prototype.data="",s.prototype.attributesBoolean=n.emptyObject,s.prototype.attributesJson="",s.create=function(t){return new s(t)},s.encode=function(t,n){if(n||(n=e.create()),null!=t.name&&Object.hasOwnProperty.call(t,"name")&&n.uint32(10).string(t.name),null!=t.children&&t.children.length)for(var s=0;s<t.children.length;++s)r.Element.encode(t.children[s],n.uint32(18).fork()).ldelim();if(null!=t.data&&Object.hasOwnProperty.call(t,"data")&&n.uint32(26).string(t.data),null!=t.attributesBoolean&&Object.hasOwnProperty.call(t,"attributesBoolean")){var o=Object.keys(t.attributesBoolean);for(s=0;s<o.length;++s)n.uint32(34).fork().uint32(10).string(o[s]).uint32(16).bool(t.attributesBoolean[o[s]]).ldelim()}return null!=t.attributesJson&&Object.hasOwnProperty.call(t,"attributesJson")&&n.uint32(42).string(t.attributesJson),n},s.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},s.decode=function(e,s){e instanceof t||(e=t.create(e));for(var o,i,a=void 0===s?e.len:e.pos+s,c=new r.Element;e.pos<a;){var d=e.uint32();switch(d>>>3){case 1:c.name=e.string();break;case 2:c.children&&c.children.length||(c.children=[]),c.children.push(r.Element.decode(e,e.uint32()));break;case 3:c.data=e.string();break;case 4:c.attributesBoolean===n.emptyObject&&(c.attributesBoolean={});var u=e.uint32()+e.pos;for(o="",i=!1;e.pos<u;){var l=e.uint32();switch(l>>>3){case 1:o=e.string();break;case 2:i=e.bool();break;default:e.skipType(7&l)}}c.attributesBoolean[o]=i;break;case 5:c.attributesJson=e.string();break;default:e.skipType(7&d)}}return c},s.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},s.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.name&&t.hasOwnProperty("name")&&!n.isString(t.name))return"name: string expected";if(null!=t.children&&t.hasOwnProperty("children")){if(!Array.isArray(t.children))return"children: array expected";for(var e=0;e<t.children.length;++e){var s=r.Element.verify(t.children[e]);if(s)return"children."+s}}if(null!=t.data&&t.hasOwnProperty("data")&&!n.isString(t.data))return"data: string expected";if(null!=t.attributesBoolean&&t.hasOwnProperty("attributesBoolean")){if(!n.isObject(t.attributesBoolean))return"attributesBoolean: object expected";var o=Object.keys(t.attributesBoolean);for(e=0;e<o.length;++e)if("boolean"!=typeof t.attributesBoolean[o[e]])return"attributesBoolean: boolean{k:string} expected"}return null!=t.attributesJson&&t.hasOwnProperty("attributesJson")&&!n.isString(t.attributesJson)?"attributesJson: string expected":null},s.fromObject=function(t){if(t instanceof r.Element)return t;var e=new r.Element;if(null!=t.name&&(e.name=String(t.name)),t.children){if(!Array.isArray(t.children))throw TypeError(".Element.children: array expected");e.children=[];for(var n=0;n<t.children.length;++n){if("object"!=typeof t.children[n])throw TypeError(".Element.children: object expected");e.children[n]=r.Element.fromObject(t.children[n])}}if(null!=t.data&&(e.data=String(t.data)),t.attributesBoolean){if("object"!=typeof t.attributesBoolean)throw TypeError(".Element.attributesBoolean: object expected");e.attributesBoolean={};var s=Object.keys(t.attributesBoolean);for(n=0;n<s.length;++n)e.attributesBoolean[s[n]]=Boolean(t.attributesBoolean[s[n]])}return null!=t.attributesJson&&(e.attributesJson=String(t.attributesJson)),e},s.toObject=function(t,e){e||(e={});var n,s={};if((e.arrays||e.defaults)&&(s.children=[]),(e.objects||e.defaults)&&(s.attributesBoolean={}),e.defaults&&(s.name="",s.data="",s.attributesJson=""),null!=t.name&&t.hasOwnProperty("name")&&(s.name=t.name),t.children&&t.children.length){s.children=[];for(var o=0;o<t.children.length;++o)s.children[o]=r.Element.toObject(t.children[o],e)}if(null!=t.data&&t.hasOwnProperty("data")&&(s.data=t.data),t.attributesBoolean&&(n=Object.keys(t.attributesBoolean)).length){s.attributesBoolean={};for(o=0;o<n.length;++o)s.attributesBoolean[n[o]]=t.attributesBoolean[n[o]]}return null!=t.attributesJson&&t.hasOwnProperty("attributesJson")&&(s.attributesJson=t.attributesJson),s},s.prototype.toJSON=function(){return this.constructor.toObject(this,d.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/Element"},s}(),r})();class gr{_protobufRoot;constructor(){this._protobufRoot=yr}getDescriptor(t){return new br(this._protobufRoot[t])}}class br{_protobuf;constructor(t){this._protobuf=t}compress(t){const e=this._protobuf.verify(t);if(e)throw Error(e);return this._protobuf.encode(this._protobuf.create(t)).finish()}decompress(t){return this._protobuf.toObject(this._protobuf.decode(t),{oneofs:!0})}}function Or(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function wr(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Ir="[object RegExp]",vr="[object String]",Sr="[object Number]",kr="[object Boolean]",Pr="[object Arguments]",Ar="[object Symbol]",Tr="[object Date]",_r="[object Map]",Cr="[object Set]",jr="[object Array]",Er="[object ArrayBuffer]",Dr="[object Object]",Rr="[object DataView]",xr="[object Uint8Array]",Nr="[object Uint8ClampedArray]",Vr="[object Uint16Array]",Mr="[object Uint32Array]",Br="[object Int8Array]",Ur="[object Int16Array]",Jr="[object Int32Array]",qr="[object Float32Array]",Lr="[object Float64Array]";function Gr(t,e,n,r=new Map,s=void 0){const o=s?.(t,e,n,r);if(null!=o)return o;if(function(t){return null==t||"object"!=typeof t&&"function"!=typeof t}(t))return t;if(r.has(t))return r.get(t);if(Array.isArray(t)){const e=new Array(t.length);r.set(t,e);for(let o=0;o<t.length;o++)e[o]=Gr(t[o],o,n,r,s);return Object.hasOwn(t,"index")&&(e.index=t.index),Object.hasOwn(t,"input")&&(e.input=t.input),e}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,e}if(t instanceof Map){const e=new Map;r.set(t,e);for(const[o,i]of t)e.set(o,Gr(i,o,n,r,s));return e}if(t instanceof Set){const e=new Set;r.set(t,e);for(const o of t)e.add(Gr(o,void 0,n,r,s));return e}if("undefined"!=typeof Buffer&&Buffer.isBuffer(t))return t.subarray();if(function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(t)){const e=new(Object.getPrototypeOf(t).constructor)(t.length);r.set(t,e);for(let o=0;o<t.length;o++)e[o]=Gr(t[o],o,n,r,s);return e}if(t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const e=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return r.set(t,e),Hr(e,t,n,r,s),e}if("undefined"!=typeof File&&t instanceof File){const e=new File([t],t.name,{type:t.type});return r.set(t,e),Hr(e,t,n,r,s),e}if(t instanceof Blob){const e=new Blob([t],{type:t.type});return r.set(t,e),Hr(e,t,n,r,s),e}if(t instanceof Error){const e=new t.constructor;return r.set(t,e),e.message=t.message,e.name=t.name,e.stack=t.stack,e.cause=t.cause,Hr(e,t,n,r,s),e}if("object"==typeof t&&function(t){switch(wr(t)){case Pr:case jr:case Er:case Rr:case kr:case Tr:case qr:case Lr:case Br:case Ur:case Jr:case _r:case Sr:case Dr:case Ir:case Cr:case vr:case Ar:case xr:case Nr:case Vr:case Mr:return!0;default:return!1}}(t)){const e=Object.create(Object.getPrototypeOf(t));return r.set(t,e),Hr(e,t,n,r,s),e}return t}function Hr(t,e,n=t,r,s){const o=[...Object.keys(e),...Or(e)];for(let i=0;i<o.length;i++){const a=o[i],c=Object.getOwnPropertyDescriptor(t,a);(null==c||c.writable)&&(t[a]=Gr(e[a],a,n,r,s))}}function Yr(t,e){return function(t,e){return Gr(t,void 0,t,new Map,e)}(t,(n,r,s,o)=>{const i=e?.(n,r,s,o);if(null!=i)return i;if("object"==typeof t)switch(Object.prototype.toString.call(t)){case Sr:case vr:case kr:{const e=new t.constructor(t?.valueOf());return Hr(e,t),e}case Pr:{const e={};return Hr(e,t),e.length=t.length,e[Symbol.iterator]=t[Symbol.iterator],e}default:return}})}function zr(t){return Yr(t)}function Fr(t){if(!t||"object"!=typeof t)return!1;const e=Object.getPrototypeOf(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e))&&"[object Object]"===Object.prototype.toString.call(t)}function Kr(t,e,n,r,s,o,i){const a=i(t,e,n,r,s,o);if(void 0!==a)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return t===e;case"number":return t===e||Object.is(t,e);case"object":return Wr(t,e,o,i)}return Wr(t,e,o,i)}function Wr(t,e,n,r){if(Object.is(t,e))return!0;let s=wr(t),o=wr(e);if(s===Pr&&(s=Dr),o===Pr&&(o=Dr),s!==o)return!1;switch(s){case vr:return t.toString()===e.toString();case Sr:return function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t.valueOf(),e.valueOf());case kr:case Tr:case Ar:return Object.is(t.valueOf(),e.valueOf());case Ir:return t.source===e.source&&t.flags===e.flags;case"[object Function]":return t===e}const i=(n=n??new Map).get(t),a=n.get(e);if(null!=i&&null!=a)return i===e;n.set(t,e),n.set(e,t);try{switch(s){case _r:if(t.size!==e.size)return!1;for(const[s,o]of t.entries())if(!e.has(s)||!Kr(o,e.get(s),s,t,e,n,r))return!1;return!0;case Cr:{if(t.size!==e.size)return!1;const s=Array.from(t.values()),o=Array.from(e.values());for(let i=0;i<s.length;i++){const a=s[i],c=o.findIndex(s=>Kr(a,s,void 0,t,e,n,r));if(-1===c)return!1;o.splice(c,1)}return!0}case jr:case xr:case Nr:case Vr:case Mr:case"[object BigUint64Array]":case Br:case Ur:case Jr:case"[object BigInt64Array]":case qr:case Lr:if("undefined"!=typeof Buffer&&Buffer.isBuffer(t)!==Buffer.isBuffer(e))return!1;if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(!Kr(t[s],e[s],s,t,e,n,r))return!1;return!0;case Er:return t.byteLength===e.byteLength&&Wr(new Uint8Array(t),new Uint8Array(e),n,r);case Rr:return t.byteLength===e.byteLength&&t.byteOffset===e.byteOffset&&Wr(new Uint8Array(t),new Uint8Array(e),n,r);case"[object Error]":return t.name===e.name&&t.message===e.message;case Dr:{if(!(Wr(t.constructor,e.constructor,n,r)||Fr(t)&&Fr(e)))return!1;const s=[...Object.keys(t),...Or(t)],o=[...Object.keys(e),...Or(e)];if(s.length!==o.length)return!1;for(let o=0;o<s.length;o++){const i=s[o],a=t[i];if(!Object.hasOwn(e,i))return!1;if(!Kr(a,e[i],i,t,e,n,r))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Xr(){}function Zr(t,e){return function(t,e,n){return Kr(t,e,void 0,void 0,void 0,void 0,n)}(t,e,Xr)}function $r(t){return null!==t&&("object"==typeof t||"function"==typeof t)}function Qr(t,e){const n=zr(t);return n.path[n.path.length-1]+=e,n}function ts(t,e){return t.root===e.root&&Zr(t.path,e.path)}function es(t){rs(t,t=>("main"==t.root?(t.rootMain=!0,delete t.root):"$graveyard"==t.root&&(t.rootGraveyard=!0,delete t.root),t))}function ns(t){rs(t,t=>(t.rootMain?(t.root="main",delete t.rootMain):t.rootGraveyard&&(t.root="$graveyard",delete t.rootGraveyard),t))}function rs(t,e){for(const n in t){const r=t[n];"nodes"!==n&&$r(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?t[n]=e(r):rs(r,e))}return t}class ss{_id;_operationName;_protobufDescriptor;constructor(t,e,n){this._id=t,this._operationName=e,this._protobufDescriptor=n}compress(t,e){const n=e.shift();return es(n),t.buffers.push(this._protobufDescriptor.compress(n)),t.types.push(this._id),!0}decompress(t,e){e.types.shift();const n=this._protobufDescriptor.decompress(e.buffers.shift());ns(n),n.__className=this._operationName,t.push(n)}}class os extends ss{compress(t,e){const n=e.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),es(n),t.buffers.push(this._protobufDescriptor.compress(n)),t.types.push(this._id),!0}decompress(t,e){const{types:n,buffers:r}=e,s=this._protobufDescriptor.decompress(r.shift());n.shift(),this._deserializeOneOf("oldValue",s),this._deserializeOneOf("newValue",s),ns(s),s.__className=this._operationName,t.push(s)}_serializeOneOf(t,e){const n=e[t];"boolean"==typeof n?e[`${t}Boolean`]=n:e[`${t}Json`]=JSON.stringify(n)}_deserializeOneOf(t,e){const n=`${t}Json`;e[n]?(e[t]=JSON.parse(e[n]),delete e[n]):(e[t]=e[`${t}Boolean`],delete e[`${t}Boolean`])}}class is extends ss{compress(t,e){const n=e.shift();return this._serializeNodesAttributes(n.nodes),es(n),t.buffers.push(this._protobufDescriptor.compress(n)),t.types.push(this._id),!0}decompress(t,e){const{types:n,buffers:r}=e,s=this._protobufDescriptor.decompress(r.shift());n.shift(),s.nodes||(s.nodes=[]),this._deserializeNodesAttributes(s.nodes),ns(s),s.__className=this._operationName,t.push(s)}_serializeNodesAttributes(t){for(const e of t){if(e.attributes){const t=e.attributes;this._areValuesBoolean(t)?e.attributesBoolean=t:e.attributesJson=JSON.stringify(t)}e.children&&this._serializeNodesAttributes(e.children)}}_deserializeNodesAttributes(t){for(const e of t)(e.attributesBoolean||e.attributesJson)&&(e.attributesBoolean?(e.attributes=e.attributesBoolean,delete e.attributesBoolean):(e.attributes=JSON.parse(e.attributesJson),delete e.attributesJson)),e.children&&this._deserializeNodesAttributes(e.children)}_areValuesBoolean(t){return Object.keys(t).every(e=>"boolean"==typeof t[e])}}class as extends ss{decompress(t,e){super.decompress(t,e);const n=t[t.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class cs extends ss{compress(t,e){return e.shift(),t.types.push(this._id),!0}decompress(t,e){e.types.shift(),t.push({__className:this._operationName})}}class ds extends as{_omittedNamespace;constructor(t,e,n,r){super(t,e,n),this._omittedNamespace=r+":"}compress(t,e){return!("MarkerOperation"!=e[0].__className||!e[0].name.startsWith(this._omittedNamespace))&&(e[0].name=e[0].name.replace(new RegExp("^"+this._omittedNamespace),""),super.compress(t,e),!0)}decompress(t,e){super.decompress(t,e);const n=t[t.length-1];n.name=this._omittedNamespace+n.name}}class us{_id;_context;constructor(t,e){this._id=t,this._context=e}compress(t,e){let n;for(;e.length>1&&this._compareOperations(e[0],e[1]);)n?(n=this._combineNext(e.shift(),n),t.types.push(0)):(n=zr(e.shift()),t.types.push(this._id));return!!n&&(n=this._combineNext(e.shift(),n),t.types.push(0),t.buffers.push(this._compressSingleOperation(n)),!0)}decompress(t,e){const n=this._decompressSingleOperation(e);for(;0==e.types[0];)e.types.shift(),t.push(this._splitCurrent(n));t.push(n)}}class ls extends us{_combineNext(t,e){return e.nodes[0].data+=t.nodes[0].data,e}_splitCurrent(t){const e=zr(t),n=e.nodes[0],r=t.nodes[0],s=r.data[Symbol.iterator]().next().value,o=s.length;return n.data=s,r.data=r.data.substr(o),t.position=Qr(t.position,o),e}_compareOperations(t,e){if(this._checkOperation(t)&&this._checkOperation(e)){const n=t.nodes[0].data.length,r=ts(Qr(t.position,n),e.position),s=t.nodes[0],o=e.nodes[0];return r&&this._compareAttributes(s,o)}return!1}_compressSingleOperation(t){const e={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("InsertOperation").compress(e,[t]),e.buffers[0]}_decompressSingleOperation(t){const e=[];return this._context._getCompressorByName("InsertOperation").decompress(e,t),e[0]}_checkOperation(t){return"InsertOperation"==t.__className&&1==t.nodes.length&&t.nodes[0].data&&!t.wasUndone&&1==Array.from(t.nodes[0].data).length}_compareAttributes(t,e){const n=Object.keys(t.attributes||{}),r=Object.keys(e.attributes||{});return n.length===r.length&&n.every(n=>e.attributes[n]&&e.attributes[n]===t.attributes[n])}}class ps extends us{_combineNext(t,e){return e.howMany++,e.sourcePosition=zr(t.sourcePosition),e}_splitCurrent(t){const e=zr(t);return t.howMany--,e.howMany=1,e.sourcePosition=Qr(e.sourcePosition,t.howMany),e}_compareOperations(t,e){return!(!this._checkOperation(t)||!this._checkOperation(e))&&(ts(Qr(t.sourcePosition,-1),e.sourcePosition)&&ts(t.targetPosition,e.targetPosition))}_compressSingleOperation(t){const e={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(e,[t]),e.buffers[0]}_decompressSingleOperation(t){const e=[];return this._context._getCompressorByName("MoveOperation").decompress(e,t),e[0]}_checkOperation(t){return"MoveOperation"==t.__className&&"$graveyard"==t.targetPosition.root&&1==t.howMany&&!t.wasUndone}}class hs extends us{_combineNext(t,e){return e.howMany++,e}_splitCurrent(t){const e=zr(t);return e.howMany=1,t.howMany--,e}_compareOperations(t,e){return!(!this._checkOperation(t)||!this._checkOperation(e))&&(ts(t.sourcePosition,e.sourcePosition)&&ts(t.targetPosition,e.targetPosition))}_compressSingleOperation(t){const e={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(e,[t]),e.buffers[0]}_decompressSingleOperation(t){const e=[];return this._context._getCompressorByName("MoveOperation").decompress(e,t),e[0]}_checkOperation(t){return"MoveOperation"==t.__className&&"$graveyard"==t.targetPosition.root&&1==t.howMany&&!t.wasUndone}}class fs extends us{compress(t,e){if(!this._compareOperations(e[0],e[1]))return!1;const n=e.shift();return n.oldRange=null,n.newRange&&ts(n.newRange.start,n.newRange.end)&&(n.newRange.end=null),e.shift(),t.types.push(this._id),t.types.push(0),t.buffers.push(this._compressSingleOperation(n)),!0}decompress(t,e){const n=this._decompressSingleOperation(e);n.newRange&&!n.newRange.end&&(n.newRange.end=zr(n.newRange.start));const r=zr(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=zr(r.newRange.start)),r.name="user:position:"+r.name.split(":")[2],e.types.shift(),t.push(n),t.push(r)}_compressSingleOperation(t){const e={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MarkerOperation").compress(e,[t]),e.buffers[0]}_decompressSingleOperation(t){const e=[];return this._context._getCompressorByName("MarkerOperation").decompress(e,t),e[0]}_compareOperations(t,e){return!(!t||!e)&&("MarkerOperation"==t.__className&&"MarkerOperation"==e.__className&&!(!t.name.startsWith("user:")||!e.name.startsWith("user:")||t.name==e.name))}}class ms{_compressorById;_compressorByName;_protobufFactory;constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new gr;const t=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new cs(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",os),this._registerOperationCompressor(11,"InsertOperation",is),this._registerOperationCompressor(12,"MarkerOperation",as),this._registerOperationCompressor(13,"MergeOperation",ss),this._registerOperationCompressor(14,"MoveOperation",ss),this._registerOperationCompressor(15,"RenameOperation",ss),this._registerOperationCompressor(16,"RootAttributeOperation",os),this._registerOperationCompressor(17,"SplitOperation",ss),this._registerCompressor(18,"CommentMarkerOperation",new ds(18,"MarkerOperation",t,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new ds(19,"MarkerOperation",t,"suggestion")),this._registerOperationCompressor(20,"RootOperation",ss),this._registerActionCompressor(100,"TypingAction",ls),this._registerActionCompressor(101,"DeletingAction",ps),this._registerActionCompressor(102,"ForwardDeletingAction",hs),this._registerActionCompressor(103,"UserSelectionAction",fs)}compress(t){if(!t||!t[0])throw new n.CKEditorError("no-operations-provided",this);const e={types:[],buffers:[],baseVersion:t[0].baseVersion};for(;t.length;)this._getCompressorByName("UserSelectionAction").compress(e,t)||this._getCompressorByName("TypingAction").compress(e,t)||this._getCompressorByName("DeletingAction").compress(e,t)||this._getCompressorByName("ForwardDeletingAction").compress(e,t)||this._getCompressorByName("CommentMarkerOperation").compress(e,t)||this._getCompressorByName("SuggestionMarkerOperation").compress(e,t)||this._getCompressorByName(t[0].__className).compress(e,t);return e}decompress(t){const e=[];for(;t.types.length;){const r=this._compressorById.get(t.types[0]);if(!r)throw new n.CKEditorError("decompress-compressor-not-found",this,{type:t.types[0]});r.decompress(e,t)}return e.forEach((e,n)=>e.baseVersion=t.baseVersion+n),e}_getCompressorByName(t){return this._compressorByName.get(t)}_registerOperationCompressor(t,e,n){const r=new n(t,e,this._protobufFactory.getDescriptor(e));this._registerCompressor(t,e,r)}_registerActionCompressor(t,e,n){const r=new n(t,this);this._registerCompressor(t,e,r)}_registerCompressor(t,e,n){this._compressorById.set(t,n),this._compressorByName.set(e,n)}}const ys=Os;function gs(){const t=["cloud-services-internal-error: Not connected.","setIdForTheLastOperation","Permissions","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","_knownOperations","_shouldSendSelectionUpdate","change:_isEditingAllowed","_channelId","change:range","size","addToReconnectionStack","sessionCreatedAt","marker","_isConnected","get","_authorId","sessionId","_connectService","_setPendingAction","affectedSelectable","rootName","history","affectsData","cloud-services-internal-error: Request timeout.","cloudServices.bundleVersion","_initSessionsHandling","Synchronization issue","high","_lastServerVersion","86304FvaSOJ","collaboration-missing-channelid","Notification","rtc-destroyed","parse","_addKnownRoot","realtimecollaborationclient-init-connection-failed","_setUpDataInit","rtc-offline","_isAttached","start","move","rootsAttributes","cs:removeUser","reset","getRoot","insert","state","targetPosition","realtimecollaborationclient-init-service-internal-error","position","error","lastOperationId","createRoot","clone","_lastSyncedOperationId","currentDocumentSession","bind","_hasSynchronizationProblem","_baseBufferDelay","connection","_connectAfterSessionHasBeenFlushed","applyOperation","entries","30FuqOcC","sendOperations","_fetchMissingUsers","then","getOperations","locale","_handleReconnectionResponse","realtimecollaborationclient-error","_document","startsWith","CommentsOnly","isEnabled","_compressor","realtimecollaborationclient-sendbufferedoperations","isUndoneOperation","_isPendingUpdate","from","_crash","$root","connect","isOfficialPlugin","requires","multi-root-editor-root-attributes-no-root","_disconnectionOperations","_applyOperationsSet","message","isPremiumPlugin","_offset","change:_isPendingUpdate","PENDING_ACTION_SENDING_DATA","enqueueChange","isReadOnly","return","40hWfzhO","_getOperationsFromInitData","code","InsertOperation","mySessionId","_getAffectedRoot","editing","lastSyncVersion","addRootAttribute","realtimecollaborationclient-init-non-existent-root","path","baseVersion","_isLoaded","selection","_isInit","markers","_handleReconnectionError","createUserMarkerOperations","_handleInitialConnectionData","channelSessions","loadRoot","userId","string","__className","version","_saveOperationInBuffer","slice","_disconnectService","_pendingAction","_ignoredOperations","isDocumentOperation","createRange","createdAt","model","filter","suppressErrorInCollaboration","register","_clearPendingAction","editor","batch","end","lastOperationAcceptedAt","realtimecollaborationclient-init-document-already-initialized","_refreshUserSelectionMarkers","showWarning","createPositionFromPath","serverHistory","finally","permissions","setPermissions","_handleSendingSelectionMarkers","_operationToId","_sendBufferedOperations","66363DzrKCP","directChange","287740dMBYje","addUser","realtimecollaborationclient-init-session-connection-error","offset","toJSON","_initThrowingOnDataSet","realtimecollaborationclient-init-service-incorrect-server-operation","CollaborativeEditingService","fromJSON","getUser","decompress","fire","config","_service","551241GLCRFT","reconnect","_bufferRootLoad","change:hasDomSelection","wereChangesApplied","RealTimeCollaborationClient","addOperation","lastDocumentSession","map","pluginName","listenTo","root","getOperationAuthor","8748ExzRoN","differ","32oTfQCp","_handleReceivedOperations","attributes","removeFromReconnectionStack","unregister","catch","getConnectedSessions","plugins","view","newRange","forEach","apply","_operationIdentifier","1596yDYTbf","addRoot","_handleExternalOperations","6fESzrx","push","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","enableReadOnlyMode","_decompressOperations","includes","disableReadOnlyMode","compress","add","_loadRoot","sessionAdd:","_sendBufferedOperationsDelayId","_compressOperations","set","off","define","real-time-collaboration","_handleServerResponse","409","getIdOfTheLastOperation","stop","disconnected","disconnect","_currentBufferDelay","round","keys","cloudDocumentVersion","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","has","document","collaboration.channelId","_knownRootNames","_isDisconnection","collaboration","initData","getDocumentDetails","_shouldSendUpdate","destroy","operationsReceived","_updateServerHistory","_waitUntilSynced","getMany","ready","metadata","cloud-services-internal-error: Collaborative Editing Service is not connected.","762111SGCDou","_sendBufferedOperationsDelayed","init","stopListening","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.","document:write","_bufferedOperations","_isEditingAllowed","reconnection: flushed session","404","type","data","wasUndone","711250weQZhP","roots","realtimecollaborationclient","length","_hasSelectionChanged","connected","createPositionAt","realtimecollaborationclient-handleserverresponse","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.","remove"];return(gs=function(){return t})()}!function(t){const e=Os,n=t();for(;;)try{if(146873===-parseInt(e(683))/1*(parseInt(e(501))/2)+-parseInt(e(650))/3*(parseInt(e(616))/4)+-parseInt(e(738))/5+parseInt(e(519))/6*(parseInt(e(564))/7)+-parseInt(e(503))/8*(parseInt(e(752))/9)+-parseInt(e(577))/10+-parseInt(e(736))/11*(-parseInt(e(516))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(gs);let bs=1;function Os(t,e){const n=gs();return(Os=function(t,e){return n[t-=492]})(t,e)}class ws extends e.Plugin{static[ys(745)]=(()=>wn)();[ys(677)];[ys(603)];[ys(729)];[ys(594)];[ys(751)];[ys(658)];[ys(662)];[ys(570)];[ys(591)];[ys(550)];[ys(711)];[ys(581)];[ys(530)];[ys(645)];[ys(542)];[ys(641)];[ys(673)];[ys(515)];static get[ys(671)](){return[zn,Zn,hr,e.PendingActions,Fn.Users,r.Notification]}static get[ys(497)](){return ys(493)}static get[ys(670)](){return!0}static get[ys(676)](){return!0}get[ys(545)](){const t=ys;return this[t(615)]+this[t(677)]}get[ys(615)](){const t=ys;return this[t(729)][t(707)]-this[t(677)]}get[ys(690)](){const t=ys,e=this[t(729)][t(654)]();for(let n=e[t(580)]-1;n>=0;n--){const r=e[n];if(!this[t(673)][t(547)](r))return r[t(694)]+1-this[t(677)]}return 0}constructor(t){const e=ys;if(super(t),this[e(677)]=0,this[e(603)]=null,this[e(729)]=new s.History,this[e(721)][e(750)][e(534)](e(552),{}),this[e(594)]=this[e(721)][e(750)][e(601)](e(549)),!this[e(594)])throw new n.CKEditorError(e(617),this);const r=t[e(750)][e(601)](e(611))||n.version;this[e(751)]=new(ws[e(745)])(r,this[e(594)]),this[e(658)]=this[e(721)][e(716)][e(548)],this[e(662)]=new ms,this[e(570)]=[],this[e(591)]=new WeakSet,this[e(550)]=new Set,this[e(532)](e(665),!1),this[e(532)](e(644),!1),this[e(711)]=null,this[e(581)]=!1,this[e(530)]=null,this[e(645)]=300,this[e(542)]=this[e(645)],this[e(641)]=null,this[e(673)]=new WeakSet,this[e(515)]=new Ss(this[e(673)])}[ys(566)](){const t=ys,e=this[t(721)],n=e[t(510)][t(601)](Fn.Users),r=e[t(510)][t(601)](zn);this[t(498)](n,t(500),(e,r)=>{const s=t,o=r[0];o[s(602)]&&(e[s(682)]=n[s(747)](o[s(602)]),e[s(539)]()),null===o[s(602)]&&(e[s(682)]=null,e[s(539)]())},{priority:t(614)}),this[t(498)](e[t(716)][t(548)][t(696)],t(595),(e,n)=>{const r=t;n[r(737)]&&this[r(726)]()}),this[t(498)](e[t(689)][t(511)],t(755),()=>{this[t(726)]()}),this[t(743)](),e[t(716)].on(t(648),(e,n)=>{const r=t,s=n[0];s[r(713)]&&(this[r(708)](s),this[r(555)]()&&this[r(565)]())}),this[t(623)](),this[t(643)](t(571)).to(r,t(633),this,t(644),(e,n)=>t(582)===e&&!n),this.on(t(593),()=>{const n=t;this[n(571)]?e[n(525)](n(624)):e[n(522)](n(624))}),this[t(571)]?e[t(525)](t(624)):e[t(522)](t(624)),this[t(532)](t(600),!1)}async[ys(753)](){const t=ys,e=this[t(721)][t(510)][t(601)](Zn),n=this[t(721)][t(510)][t(601)](zn);try{this[t(665)]=!0,e[t(507)](this[t(594)]);const r=await this[t(751)][t(753)](n[t(646)],this[t(690)]);await this[t(656)](r)&&(this[t(665)]=!1,this[t(720)]());const s=await this[t(751)][t(509)]();e[t(719)](this[t(594)],s),this[t(733)](),this[t(600)]=!0}catch(e){if(function(e){const n=t;return n(573)===e[n(685)]}(e)&&this[t(603)])await this[t(647)]();else if(function(e){const n=t;return n(537)===e[n(685)]}(e)){const e=mr(this[t(721)][t(655)],t(546));this[t(699)](e)}else{if(!(e instanceof Is))throw e;this[t(699)]()}}}[ys(556)](){const t=ys,e=this[t(721)][t(510)][t(601)](zn),n=this[t(721)][t(510)][t(601)](Zn);this[t(721)][t(522)](t(619)),n[t(702)][t(547)](this[t(594)])&&n[t(507)](this[t(594)]),e[t(506)](this),this[t(710)](),super[t(556)]()}async[ys(656)](t){const e=ys;if(this[e(603)]!==t[e(603)]&&this[e(641)]!==t[e(638)])throw new Is;return this[e(603)]=t[e(603)],this[e(536)]([],{...t,wereChangesApplied:!1,data:t[e(575)]},e(753))}async[ys(604)](t,e=!1){const n=ys,{connection:r}=this[n(721)][n(510)][n(601)](zn);ws[n(745)][n(509)](r,this[n(594)])[n(653)](t=>this[n(612)](t))[n(508)](t=>{const e=n;this[e(667)](e(740),t)}),this[n(498)](this[n(751)],n(557),this[n(504)][n(643)](this)),this[n(498)](this[n(751)],n(637),(t,e)=>{const r=n;this[r(667)](r(635),e)}),this[n(498)](this[n(751)],n(540),()=>{this[n(600)]=!1});const s=this[n(515)][n(538)](t);this[n(665)]=!0;const o=await this[n(751)][n(669)](r,this[n(531)](t),s);if(this[n(603)]=o[n(603)],e){if(!o[n(492)])return void this[n(699)]();this[n(665)]=!1,this[n(720)](),this[n(729)][n(630)](),this[n(677)]=o[n(741)],this[n(729)][n(707)]=this[n(677)],await this[n(536)](t,o,n(572))}else await this[n(701)](o,t);this[n(733)](),this[n(600)]=!0}[ys(733)](){const t=ys,e=this[t(721)][t(510)][t(601)](Zn),n=this[t(721)][t(510)][t(601)](hr),r=e[t(702)][t(601)](this[t(594)]);r&&r[t(580)]>1?n[t(700)]():this[t(498)](e,t(529)+this[t(594)],()=>{const r=t;2===e[r(702)][r(601)](this[r(594)])[r(580)]&&n[r(700)]()})}async[ys(504)](t,e,n,r){const s=ys;if(!this[s(665)]&&this[s(658)][s(707)]==e){const t=this[s(523)](n,r);await this[s(652)](t),this[s(518)](t,e,n[s(638)])||this[s(667)](s(744))}}async[ys(647)](){const t=ys;this[t(710)]();const{locale:e}=this[t(721)];let n;try{n=await this[t(751)][t(554)]()}catch{const n=mr(e,t(590));return void this[t(699)](n)}const r=n[t(642)]||n[t(495)];if(this[t(641)]!==r[t(638)]){const n=mr(e,t(568));return void this[t(699)](n)}await this[t(604)](this[t(721)][t(716)][t(548)][t(608)][t(654)](),!0)}[ys(710)](){const t=ys;this[t(751)][t(541)](),this[t(570)]=[],clearTimeout(this[t(530)]),this[t(567)](this[t(751)])}[ys(612)](t){const e=ys,n=this[e(721)][e(510)][e(601)](Zn);this[e(498)](n,e(529)+this[e(594)],(t,{session:r})=>{const s=e;if(r.id===n[s(687)]){t[s(533)]();const e=this[s(721)][s(510)][s(547)](s(660))&&this[s(721)][s(510)][s(601)](s(660));let n=r[s(731)];e&&e[s(661)]&&(n=n[s(717)](t=>s(569)!==t)),this[s(721)][s(510)][s(601)](s(589))[s(732)](n,this[s(594)])}}),n[e(719)](this[e(594)],t)}[ys(743)](){const t=ys,e=this[t(721)][t(575)][t(532)];this[t(721)][t(575)][t(532)]=(...r)=>{const s=t;if(!r[r[s(580)]-1][s(718)])throw new n.CKEditorError(s(521),this);e[s(514)](this[s(721)][s(575)],r)}}[ys(623)](){const t=ys;this[t(721)][t(575)].on(t(566),(e,[r])=>{const o=t;if(this[o(658)][o(707)])throw new n.CKEditorError(o(725),this);e[o(539)](),this[o(605)]();const i=this[o(721)][o(750)][o(601)](o(628)),a=this[o(684)](r,i);0==a[o(580)]&&a[o(520)](new s.NoOperation(0)),e[o(682)]=this[o(604)](a)[o(653)](()=>{const t=o;this[t(721)][t(510)][t(601)](zn)[t(597)](this),this[t(721)][t(575)][t(749)](t(561))})[o(508)](t=>this[o(667)](o(622),t))[o(730)](()=>this[o(720)]())},{priority:t(614)}),this[t(721)].on(t(703),async(e,[n,r])=>{const s=t;e[s(539)]();const o=this[s(721)][s(716)][s(548)][s(631)](n);if(!this[s(550)][s(547)](n)){const t=r&&r[s(575)]?r[s(575)]:"",e=r&&r[s(505)]?r[s(505)]:{};await this[s(528)](n,t,e)}this[s(721)][s(716)][s(680)]({isUndoable:!1},()=>{const t=s;o[t(695)]=!0,this[t(721)][t(716)][t(548)][t(502)][t(754)](o)})},{priority:t(614)})}async[ys(652)](t){const e=ys,n=this[e(721)][e(510)][e(601)](Fn.Users),{connection:r}=this[e(721)][e(510)][e(601)](zn),s=new Set;for(const r of t){const t=r[e(602)];t&&!n[e(747)](t)&&s[e(527)](t)}if(0===s[e(596)])return;const o=await b[e(560)](r,Array[e(666)](s));for(const t of o)n[e(747)](t.id)||n[e(739)](t)}[ys(684)](t,e={}){const r=ys,o=this[r(721)][r(716)],i=[];let a=0;const c=r(705)==typeof t?{main:t}:t;for(const t of Object[r(544)](c)){if(!this[r(658)][r(578)][r(547)](t))throw new n.CKEditorError(r(692),this);const e=this[r(721)][r(575)][r(620)](c[t]),d=this[r(658)][r(631)](t),u=new s.InsertOperation(o[r(583)](d,0),e,a++);i[r(520)](u);for(const[t,n]of e[r(698)]){const e=o[r(714)](o[r(728)](d,n[r(626)][r(693)][r(709)]()),o[r(728)](d,n[r(723)][r(693)][r(709)]())),c=new s.MarkerOperation(t,null,e,o[r(698)],!0,a++);i[r(520)](c)}}if(e)for(const[t,c]of Object[r(649)](e)){const e=o[r(548)][r(631)](t);if(!e)throw new n.CKEditorError(r(672),null);for(const[t,n]of Object[r(649)](c))if(null!==n){const o=new s.RootAttributeOperation(e,t,null,n,a++);i[r(520)](o)}}return i}async[ys(528)](t,e,n){const r=ys;this[r(684)]({[t]:e},{[t]:n})[r(513)]((t,e)=>{const n=r;t[n(694)]=this[n(658)][n(707)]+e,t[n(697)]=!0,this[n(708)](t)}),this[r(565)](),await this[r(559)]()}async[ys(701)](t,e){const n=ys;let r;this[n(677)]=t[n(741)];const s=t[n(492)]&&!t[n(553)],o=s?0:t[n(575)][n(694)];if(e[n(513)](e=>{const r=n;e[r(697)]=!0,e[r(715)]=t[r(598)],e[r(602)]=null}),s)r=e,this[n(674)](r,s);else{if(t[n(553)]){const e=this[n(684)](t[n(553)]);this[n(658)][n(608)][n(707)]=-e[n(580)],e[n(513)](r=>{const s=n;r[s(694)]-=e[s(580)],r[s(715)]=t[s(598)],r[s(697)]=!0,r[s(602)]=null}),this[n(674)](e,!0),this[n(729)][n(707)]=-e[n(580)]+this[n(677)],this[n(558)](e)}this[n(658)][n(608)][n(707)]=o,r=this[n(523)](t[n(575)],t[n(562)]),await this[n(652)](r),this[n(674)](r,s)}t[n(638)]&&(this[n(515)][n(588)](r,t[n(638)]),this[n(641)]=t[n(638)]),this[n(729)][n(707)]=o+this[n(677)],this[n(558)](r),e[n(717)](t=>{const e=n,r=this[e(688)](t);return r&&!this[e(550)][e(547)](r)})[n(513)]((t,e)=>{const r=n;t[r(694)]=this[r(658)][r(707)]+e,this[r(708)](t)}),this[n(555)]()?(this[n(542)]=0,this[n(565)](!0),await this[n(559)]()):(this[n(665)]=!1,this[n(720)]())}[ys(667)](t,e){const r=ys,s=e&&e[r(675)];if(s&&s[r(659)](r(579)))throw e;const o=this[r(721)][r(510)][r(601)](zn);throw this[r(665)]=!0,o[r(541)](),this[r(721)][r(522)](r(657)),new n.CKEditorError(t,this[r(721)],s?{originalError:s}:void 0)}[ys(708)](t){const e=ys;this[e(591)][e(547)](t)||(this[e(591)][e(527)](t),this[e(570)][e(520)](t),this[e(711)]||e(599)==t[e(574)]&&!t[e(609)]||this[e(605)]())}[ys(565)](t=!1){const e=ys;!t&&this[e(665)]||(this[e(665)]=!0,clearTimeout(this[e(530)]),this[e(530)]=setTimeout(()=>{const t=e;this[t(735)]()[t(653)](e=>{const n=t;e&&(this[n(720)](),this[n(665)]=!1)})[t(508)](e=>{const n=t;this[n(720)](),this[n(665)]=!1,function(t){const e=n;return t[e(675)][e(659)](e(587))||t[e(675)][e(659)](e(563))||t[e(675)][e(659)](e(610))}(e)||this[n(667)](e[n(675)],e)})},this[e(542)]))}[ys(559)](){return new Promise(t=>{const e=Os;this.on(e(678),()=>{t()})})}async[ys(735)](){const t=ys,e=this[t(721)][t(510)][t(601)](hr);if(this[t(592)]()&&(e[t(700)](),this[t(581)]=!1),!this[t(555)]())return!0;const n=[...this[t(570)]];for(const e of n)e[t(576)]=this[t(658)][t(608)][t(664)](e);const r=this[t(515)][t(538)](n),s=bs++,o=this[t(531)](n),i=await this[t(751)][t(651)](o,o[t(694)],r);try{return await this[t(536)](n,i,s)}catch(e){return this[t(667)](t(663),e)}}async[ys(536)](t,e,n){const r=ys;if(r(637)in e)throw e[r(637)];let s=!1;if(e[r(492)]){e[r(638)]&&(this[r(641)]=e[r(638)]),this[r(570)]=this[r(570)][r(717)](e=>!t[r(524)](e));for(const n of t)n[r(715)]=r(724)in e&&e[r(724)]||void 0;vs(t,e[r(707)]-t[r(580)]),this[r(558)](t);const n=t[r(717)](t=>{const e=r;if(!t[e(697)])return!1;const n=this[e(688)](t);return n&&!this[e(550)][e(547)](n)});vs(n,this[r(658)][r(707)]),this[r(674)](n),s=!0,this[r(542)]=this[r(645)]}else{const t=this[r(523)](e[r(575)],e[r(562)])[r(717)](t=>t[r(694)]>=this[r(615)]);t[r(513)](t=>this[r(621)](t)),this[r(570)]=this[r(570)][r(717)](t=>!t[r(697)]||!this[r(550)][r(547)](this[r(688)](t))),this[r(570)][r(580)]&&vs(this[r(570)],this[r(570)][0][r(694)]),await this[r(652)](t),s=this[r(518)](t,e[r(707)],e[r(638)]),this[r(542)]=Math[r(543)](this[r(542)]/2)}return s?!this[r(555)]()||(this[r(565)](!0),!1):this[r(667)](r(584))}[ys(518)](t,e,n){const r=ys;try{const o={document:this[r(658)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,s.transformOperationSets)(t,this[r(570)],o);vs(i,this[r(658)][r(707)]),vs(a,e);for(const t of i){const e=c[r(601)](t);t[r(602)]=e?e[r(602)]:null}n&&(this[r(515)][r(588)](t,n),this[r(641)]=n),this[r(570)]=[...a],this[r(674)](i),this[r(558)](t)}catch(t){return console[r(637)](t),!1}return!0}[ys(674)](t,e=!1){const n=ys;this[n(721)][n(716)][n(680)]({isUndoable:!1,isLocal:!1},e=>{const r=n;for(const n of t)this[r(591)][r(527)](n),this[r(621)](n),e[r(722)][r(494)](n),this[r(721)][r(716)][r(648)](n)})}[ys(621)](t){const e=ys,n=this[e(688)](t);n&&this[e(550)][e(527)](n)}[ys(688)](t){const e=ys;let n,r;switch(t[e(574)]){case e(632):n=t[e(636)][e(499)];break;case e(599):if(r=t[e(512)],!r)return null;n=r[e(499)];break;case e(691):n=t[e(499)];break;case e(517):n=t[e(606)];break;case e(627):n=t[e(634)][e(499)];break;default:return null}return n[e(607)]}[ys(558)](t){const e=ys;t[e(513)](t=>{const n=e,r=t[n(640)]();r[n(602)]=t[n(602)],r[n(697)]=!!t[n(697)],r[n(715)]=t[n(715)],r[n(694)]+=this[n(677)],t[n(551)]&&this[n(673)][n(527)](r),this[n(729)][n(494)](r)})}[ys(699)](t){const e=ys,n=this[e(721)][e(510)][e(601)](e(618)),r=this[e(721)][e(655)];t||(t=mr(r,e(585))),n[e(727)](t,{title:mr(r,e(613)),namespace:e(535)}),this[e(644)]=!0,clearTimeout(this[e(530)]),this[e(570)]=[],this[e(721)][e(510)][e(601)](zn)[e(541)]()}[ys(605)](){const t=ys;this[t(711)]||(this[t(711)]=this[t(721)][t(510)][t(601)](e.PendingActions)[t(527)](mr(this[t(721)][t(655)],t(679))))}[ys(720)](){const t=ys;this[t(711)]&&(this[t(721)][t(510)][t(601)](e.PendingActions)[t(586)](this[t(711)]),this[t(711)]=null)}[ys(531)](t){const e=ys,n=t[e(496)](t=>t[e(742)]());return this[e(662)][e(526)](n)}[ys(523)](t,e){const n=ys;return this[n(662)][n(748)](t)[n(496)]((t,r)=>{const o=n,i=o(566)==e[r][o(574)];if(o(686)==t[o(706)]){const e=t[o(636)][o(499)];!this[o(658)][o(631)](e)&&(this[o(658)][o(639)](o(668),e)[o(625)]=!1)}const a=s.OperationFactory[o(746)](t,this[o(658)]);return a[o(576)]=t[o(576)],a[o(697)]=i,a[o(602)]=i?null:e[r][o(704)],a[o(551)]=o(629)===e[r][o(574)],a[o(715)]=e[r][o(715)],a})}[ys(726)](){const t=ys;this[t(581)]=!0,this[t(592)]()?this[t(565)]():this[t(581)]=!1}[ys(592)](){const t=ys,e=this[t(721)][t(510)][t(601)](Zn)[t(702)][t(601)](this[t(594)]);return!this[t(721)][t(681)]&&!!e&&e[t(580)]>1&&this[t(581)]}[ys(555)](){const t=ys;return this[t(570)][t(580)]>0||this[t(592)]()}}class Is extends Error{}function vs(t,e){const n=ys;for(const r of t)r[n(694)]=e++}class Ss{[ys(712)];[ys(734)];constructor(t){const e=ys;this[e(712)]=t,this[e(734)]=new WeakMap}[ys(538)](t){const e=ys;let r=t[e(580)];for(;r--;){const s=t[r];if(!this[e(712)][e(547)](s)){if(!this[e(734)][e(547)](s)){const t=(0,n.uid)()[e(709)](1,18);this[e(734)][e(532)](s,t)}return this[e(734)][e(601)](s)}}}[ys(588)](t,e){const n=ys;if(!e)return;let r=t[n(580)];for(;r--;){const s=t[r];this[n(712)][n(547)](s)||this[n(734)][n(532)](s,e)}}}var ks=Ps;function Ps(t,e){var n=Ts();return(Ps=function(t,e){return n[t-=432]})(t,e)}!function(t){for(var e=Ps,n=t();;)try{if(509153===-parseInt(e(446))/1*(-parseInt(e(443))/2)+parseInt(e(436))/3+-parseInt(e(433))/4+-parseInt(e(434))/5*(parseInt(e(441))/6)+parseInt(e(432))/7*(-parseInt(e(442))/8)+parseInt(e(440))/9+parseInt(e(435))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Ts);class As extends e.Plugin{static get[ks(439)](){return[ws]}static get[ks(444)](){return ks(445)}static get[ks(437)](){return!0}static get[ks(438)](){return!0}}function Ts(){var t=["424eVrQia","2JoumoO","pluginName","RealTimeCollaborativeEditing","516259BEBJwz","50806OAVmLw","1839640xlPXgU","26715yVXGsy","7401990EnVJnu","185673lpZCIF","isOfficialPlugin","isPremiumPlugin","requires","8877978IiVLIF","1068Zkuecq"];return(Ts=function(){return t})()}const _s=js;function Cs(){const t=["commentThreadRemoved","commentId","getUser","delete","disconnect","_connectService","commentRemoved","2136HQHdrA","init","content","commentUpdated","removeComment","5130qDLcZq","117NyHIyc","resolvedAt","addCommentThread","reopenCommentThread","CommentsRepository","register","message","505832RXSswN","commentThreadResolved","context","addToReconnectionStack","from","getMany","commentThreadAdded","addUser","adapter","removeCommentThread","cloudservicescommentsadapter-disconnect-not-exist","has","commentAdded","commentThreadReopened","connect","createdAt","resolvedBy","isOfficialPlugin","isPremiumPlugin","cloud-services-internal-error: Request timeout.","add","_services","keys","4112645WnyZJu","cloud-services-internal-error: Comments Service is not connected.","assign","code","Permissions","cloudservicescommentsadapter-connect-already-connected","cloud-services-internal-error: Not connected.","sessionAdd:","getCommentThreads","deletedAt","comments","updateCommentThread","3842PxLjFN","map","resolve","plugins","CommentsService","resolveCommentThread","19455190VtkGqJ","reopen","getConnectedSessions","set","404","update","commentThreadId","getComment","catch","size","_fetchMissingUsersForThreads","reconnect","get","config","authorId","_terminateService","userId","_getService","pluginName","requires","permissions","remove","listenTo","destroy","collaboration.channelId","_setUpService","addComment","off","1157622oTkeTr","unregister","attributes","setPermissions","startsWith","cloudservicescommentsadapter-service-not-exist","updateComment","commentThreadUpdated","2324UxYmNd","getCommentThread","4700128tCjWMu","mySessionId","CloudServicesCommentsAdapter"];return(Cs=function(){return t})()}function js(t,e){const n=Cs();return(js=function(t,e){return n[t-=300]})(t,e)}!function(t){const e=js,n=t();for(;;)try{if(765469===parseInt(e(386))/1+-parseInt(e(352))/2*(-parseInt(e(304))/3)+-parseInt(e(396))/4+parseInt(e(340))/5+parseInt(e(309))/6*(-parseInt(e(394))/7)+parseInt(e(317))/8*(parseInt(e(310))/9)+-parseInt(e(358))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Cs);class Es extends e.ContextPlugin{static[_s(356)]=(()=>Ln)();[_s(338)];static get[_s(377)](){return[zn,_s(314),Zn,Fn.Users]}static get[_s(376)](){return _s(398)}static get[_s(334)](){return!0}static get[_s(335)](){return!0}constructor(t){const e=_s;super(t),this[e(338)]=new Map}async[_s(305)](){const t=_s,n=this[t(319)],r=n[t(355)][t(370)](t(314));if(n[t(355)][t(370)](zn)[t(320)](this),r[t(325)]={addCommentThread:async({channelId:e,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=t,d=await this[c(375)](e)[c(312)]({commentThreadId:n,comments:r[c(353)](t=>function(t,e,n){const r=c;return{commentThreadId:n,commentId:t[r(400)],userId:t[r(372)],content:t[r(306)],documentId:e,createdAt:t[r(332)],attributes:t[r(388)]||{}}}(t,e,n)),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(366)](Rs);return{threadId:d[c(364)],comments:d[c(350)]}},getCommentThread:async({channelId:e,threadId:n})=>{const r=t,s=await this[r(375)](e)[r(395)](n)[r(366)](Rs);return s[r(349)]?null:(await this[r(368)]([s]),{threadId:s[r(364)],comments:s[r(350)][r(353)](xs),context:s[r(319)],resolvedAt:s[r(311)],resolvedBy:s[r(333)],attributes:s[r(388)]||{}})},updateCommentThread:async({channelId:e,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[t(375)](e)[t(351)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[t(366)](Ds)[t(366)](Rs),resolveCommentThread:async({channelId:e,threadId:n})=>{const r=t,s=await this[r(375)](e)[r(357)](n)[r(366)](Ds)[r(366)](Rs);return{threadId:s[r(364)],resolvedAt:s[r(311)],resolvedBy:s[r(333)]}},reopenCommentThread:async({channelId:e,threadId:n})=>this[t(375)](e)[t(313)](n)[t(366)](Ds)[t(366)](Rs),removeCommentThread:({channelId:e,threadId:n})=>this[t(375)](e)[t(326)](n)[t(366)](Ds)[t(366)](Rs),addComment:({channelId:e,threadId:n,commentId:r,content:s,attributes:o})=>this[t(375)](e)[t(384)](n,r,s,o)[t(366)](Rs),updateComment:({channelId:e,threadId:n,commentId:r,content:s,attributes:o})=>this[t(375)](e)[t(392)](n,r,s,o)[t(366)](Ds)[t(366)](Rs),removeComment:({channelId:e,threadId:n,commentId:r})=>this[t(375)](e)[t(308)](n,r)[t(366)](Ds)[t(366)](Rs)},n instanceof e.Context){const e=n[t(371)][t(370)](t(382)),r=n[t(355)][t(370)](Zn);await this[t(383)](e);const s=await this[t(338)][t(370)](e)[t(360)]();this[t(380)](r,t(347)+e,(n,{session:s})=>{const o=t;s.id===r[o(397)]&&(n[o(385)](),this[o(319)][o(355)][o(370)](o(344))[o(389)](s[o(378)],e))}),r[t(315)](e,s)}}async[_s(383)](t){const e=_s;if(this[e(338)][e(328)](t))throw new n.CKEditorError(e(345),null,{channelId:t});const r=this[e(319)][e(355)][e(370)](e(314)),s=new(Es[e(356)])(t);this[e(338)][e(361)](t,s),this[e(380)](s,e(323),(t,n)=>{const s=e,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=n;r[s(395)](o)||r[s(312)]({threadId:o,channelId:i,comments:l?l[s(353)](xs):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})}),this[e(380)](s,e(393),(t,{commentThreadId:n,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=e;r[c(395)](n)&&r[c(351)]({threadId:n,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})}),this[e(380)](s,e(318),(t,{commentThreadId:n,resolvedBy:s,resolvedAt:o})=>{const i=e,a=r[i(395)](n);a&&a[i(354)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})}),this[e(380)](s,e(330),(t,{commentThreadId:n})=>{const s=e,o=r[s(395)](n);o&&o[s(359)]({isFromAdapter:!0})}),this[e(380)](s,e(399),(t,{commentThreadId:n})=>{const s=e,o=r[s(395)](n);o&&o[s(379)]({isFromAdapter:!0})}),this[e(380)](s,e(329),(t,n)=>{const s=e,o=n[s(364)],i=r[s(395)](o);i&&i[s(384)]({...xs(n),isFromAdapter:!0})}),this[e(380)](s,e(307),(t,{commentThreadId:n,commentId:s,content:o,attributes:i})=>{const a=e,c=r[a(395)](n);if(c){const t=c[a(365)](s);t&&t[a(363)]({content:o,attributes:i,isFromAdapter:!0})}}),this[e(380)](s,e(303),(t,{commentThreadId:n,commentId:s})=>{const o=e,i=r[o(395)](n);if(i){const t=i[o(365)](s);t&&t[o(379)]({isFromAdapter:!0})}}),await this[e(302)](t)}[_s(381)](){const t=_s;if(this[t(319)]instanceof e.Context){const e=this[t(319)][t(371)][t(370)](t(382));this[t(373)](e)}}[_s(373)](t){const e=_s;if(!this[e(338)][e(328)](t))throw new n.CKEditorError(e(327),null,{channelId:t});this[e(375)](t)[e(301)](),this[e(338)][e(300)](t)}async[_s(369)](){const t=_s;for(const e of this[t(338)][t(339)]())await this[t(302)](e);if(this[t(319)]instanceof e.Context){const e=this[t(319)][t(371)][t(370)](t(382)),n=this[t(319)][t(355)][t(370)](Zn);n[t(387)](e);const r=await this[t(338)][t(370)](e)[t(360)]();n[t(315)](e,r)}}async[_s(302)](t){const e=_s,{connection:n}=this[e(319)][e(355)][e(370)](zn),r=this[e(319)][e(355)][e(370)](e(314)),s=this[e(338)][e(370)](t),o=await s[e(331)](n);await this[e(368)](o);const i=new Set(Array[e(321)](r[e(348)]({channelId:t}),t=>t.id));for(const t of o)t[e(349)]||i[e(300)](t[e(364)]);for(const t of i)r[e(395)](t)[e(379)]({isFromAdapter:!0});for(const n of o){let s=r[e(395)](n[e(364)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[e(312)]({channelId:t,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[e(321)](s[e(350)],t=>t.id));for(const t of n[e(350)])p[e(300)](t[e(400)]);for(const t of p)s[e(365)](t)[e(379)]({isFromAdapter:!0});for(const t of n[e(350)]){const n=s[e(365)](t[e(400)]);n?n[e(306)]!==t[e(306)]&&n[e(363)]({content:t[e(306)],isFromAdapter:!0}):s[e(384)](Object[e(342)](xs(t),{isFromAdapter:!0}))}}}[_s(375)](t){const e=_s;if(!this[e(338)][e(328)](t))throw new n.CKEditorError(e(391),null,{channelId:t});return this[e(338)][e(370)](t)}async[_s(368)](t){const e=_s,n=this[e(319)][e(355)][e(370)](Fn.Users),{connection:r}=this[e(319)][e(355)][e(370)](zn),s=new Set;for(const{resolvedBy:r,comments:o}of t){r&&!n[e(401)](r)&&s[e(337)](r);for(const{userId:t}of o)n[e(401)](t)||s[e(337)](t)}if(0===s[e(367)])return;const o=await b[e(322)](r,Array[e(321)](s));for(const t of o)n[e(401)](t.id)||n[e(324)](t)}}async function Ds(t){const e=_s;if(e(362)!==t[e(343)])throw t}function Rs(t){const e=_s;if((n=t)[e(316)][e(390)](e(341))||n[e(316)][e(390)](e(346))||n[e(316)][e(390)](e(336)))return new Promise(()=>{});var n;throw t}function xs(t){const e=_s;return{threadId:t[e(364)],commentId:t[e(400)],content:t[e(306)],createdAt:t[e(332)],authorId:t[e(374)],attributes:t[e(388)]||{}}}const Ns=Bs;function Vs(){const t=["isConnected","4369365FIUOvE","416823yFUuTA","startsWith","1943784pvQwfD","_bufferedRequests","delete","pluginName","1703148itKwlT","editor","suggestionUpdated","requires","add","then","isPremiumPlugin","open","addToReconnectionStack","listenTo","cloud-services-internal-error: Request timeout.","config","off","_trackChangesService","find","type","get","init","set","data","getSuggestion","size","catch","cloud-services-internal-error: Not connected.","connect","adapter","_saved","1657356CHbEer","state","_waitForServiceReady","plugins","getMany","reconnect","TrackChangesService","message","hasSuggestion","update","attributes","CloudServicesTrackChangesAdapter","originalSuggestionId","getUser","22155042nVxtHM","229616tnpmlJ","_fetchMissingUsersForThreads","TrackChangesEditing","collaboration.channelId","addUser","connected","addSuggestionData","connection","from","values","isOfficialPlugin"];return(Vs=function(){return t})()}!function(t){const e=Bs,n=t();for(;;)try{if(457299===-parseInt(e(361))/1+-parseInt(e(409))/2+-parseInt(e(394))/3+-parseInt(e(367))/4+-parseInt(e(360))/5+-parseInt(e(363))/6+parseInt(e(408))/7)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Vs);class Ms extends e.Plugin{static[Ns(400)]=(()=>Xe)();[Ns(364)];[Ns(380)];static get[Ns(370)](){return[Es,Ns(350),zn]}static get[Ns(366)](){return Ns(405)}static get[Ns(358)](){return!0}static get[Ns(373)](){return!0}constructor(t){const e=Ns;super(t);const n=this[e(368)][e(378)][e(383)](e(351));this[e(364)]=new Map,this[e(380)]=new(Ms[e(400)])(n)}[Ns(384)](){const t=Ns,e=this[t(368)][t(397)][t(383)](zn),n=this[t(368)][t(397)][t(383)](t(350));return n[t(392)]={getSuggestion:async e=>{const n=t;await this[n(396)]();const r=await this[n(380)][n(383)](e)[n(389)](Us);return await this[n(349)]([r]),r},addSuggestion:async({id:e,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=t;await this[i(396)]();const a={id:e,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(380)][i(371)](e,n,r,s,o)[i(389)](t=>{if(Js(t))return new Promise(t=>{const n=Bs;this[n(364)][n(385)](e,{resolve:t,suggestionData:a})});throw t});return this[i(364)][i(365)](e),c},updateSuggestion:async(e,n)=>{const r=t;if(await this[r(396)](),r(374)!==n[r(395)])return this[r(380)][r(403)](e,n)[r(389)](Us)}},this[t(376)](this[t(380)],t(369),(e,r)=>{const s=t;n[s(402)](r.id)&&(n[s(387)](r.id)[s(404)]=r[s(404)])}),this[t(380)][t(391)](e[t(355)])[t(372)](r=>(e[t(375)](this),this[t(349)](r)[t(372)](()=>{const e=t;for(const t of r)n[e(354)](t)[e(393)]=!0})))}async[Ns(399)](){const t=Ns,e=this[t(368)][t(397)][t(383)](t(350)),{connection:n}=this[t(368)][t(397)][t(383)](zn),r=await this[t(380)][t(391)](n);await this[t(349)](r);for(const{suggestionData:e,resolve:n}of this[t(364)][t(357)]()){let s=r[t(381)](t=>t.id===e.id);s||(s=await this[t(380)][t(371)](e.id,e[t(382)],e[t(386)],e[t(406)])),n(s)}for(const n of r)e[t(402)](n.id)||e[t(354)](n)}async[Ns(396)](){const t=Ns;this[t(380)][t(359)]||await new Promise(e=>{const n=t;this[n(376)](this[n(380)],n(353),t=>{t[n(379)](),e()})})}async[Ns(349)](t){const e=Ns,n=this[e(368)][e(397)][e(383)](Fn.Users),{connection:r}=this[e(368)][e(397)][e(383)](zn),s=new Set;for(const{authorId:r}of t)n[e(407)](r)||s[e(371)](r);if(0===s[e(388)])return;const o=await b[e(398)](r,Array[e(356)](s));for(const t of o)n[e(407)](t.id)||n[e(352)](t)}}function Bs(t,e){const n=Vs();return(Bs=function(t,e){return n[t-=349]})(t,e)}function Us(t){if(Js(t))return new Promise(()=>{});throw t}function Js(t){const e=Ns;return t[e(401)][e(362)](e(390))||t[e(401)][e(362)](e(377))}function qs(){const t=["23779283pePyFp","RealTimeCollaborativeComments","Comments","get","switchReadOnly","once","pluginName","_setUpService","editor","4894071SlYOfU","config","4VXABdo","12EXdmFh","collaboration.channelId","data","init","CommentsRepository","listenTo","ready","6smnLRi","2036YEOKNI","_terminateService","destroy","connected","isPremiumPlugin","isOfficialPlugin","3099zqoyZn","3780010pwPJnQ","change:state","5468360mzfsPV","plugins","78439MlpMBr","requires","9rgPFpD","4863720GJezYb","CommentsEditing","isThreadsLoadingPaused"];return(qs=function(){return t})()}const Ls=Gs;function Gs(t,e){const n=qs();return(Gs=function(t,e){return n[t-=158]})(t,e)}!function(t){const e=Gs,n=t();for(;;)try{if(553231===parseInt(e(171))/1*(-parseInt(e(188))/2)+-parseInt(e(166))/3*(-parseInt(e(160))/4)+-parseInt(e(174))/5*(parseInt(e(159))/6)+-parseInt(e(186))/7+parseInt(e(169))/8*(-parseInt(e(173))/9)+parseInt(e(167))/10+parseInt(e(177))/11*(parseInt(e(189))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(qs);class Hs extends e.Plugin{static get[Ls(172)](){return[Ls(179),Es,As,zn]}static get[Ls(183)](){return Ls(178)}static get[Ls(165)](){return!0}static get[Ls(164)](){return!0}[Ls(192)](){const t=Ls,e=this[t(185)][t(170)][t(180)](zn),n=this[t(185)][t(170)][t(180)](t(175)),r=this[t(185)][t(170)][t(180)](Es);return this[t(185)][t(191)][t(182)](t(158),()=>{const r=t;this[r(194)](e,r(168),(t,e,s)=>{const o=r;n[o(176)]=o(163)!==s})}),this[t(194)](e,t(168),(e,n,r)=>{const s=t;this[s(185)][s(170)][s(180)](s(193))[s(181)](s(163)!==r)}),r[t(184)](this[t(185)][t(187)][t(180)](t(190)))}[Ls(162)](){const t=Ls;this[t(185)][t(170)][t(180)](Es)[t(161)](this[t(185)][t(187)][t(180)](t(190))),super[t(162)]()}}var Ys=zs;function zs(t,e){var n=Fs();return(zs=function(t,e){return n[t-=293]})(t,e)}function Fs(){var t=["1517720flZzXv","pluginName","requires","isOfficialPlugin","RealTimeCollaborativeTrackChanges","1217127ebdpDH","TrackChanges","550949odMkgO","2540190gTmOhp","1088117dOjSmk","isPremiumPlugin","1776984RLeaXy","84dbrkoi","3866480YJoiDO"];return(Fs=function(){return t})()}!function(t){for(var e=zs,n=t();;)try{if(685954===parseInt(e(302))/1+-parseInt(e(301))/2+-parseInt(e(298))/3+-parseInt(e(293))/4+parseInt(e(306))/5+parseInt(e(305))/6*(parseInt(e(300))/7)+-parseInt(e(304))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Fs);class Ks extends e.Plugin{static get[Ys(295)](){return[Hs,Ms,Ys(299)]}static get[Ys(294)](){return Ys(297)}static get[Ys(296)](){return!0}static get[Ys(303)](){return!0}}const Ws=Zs;function Xs(){const t=["_preventResendingRevisionData","adapter","affectsData","_fixRevision","pluginName","268710zfcFJp","RevisionTracker","2346966VtXbog","RevisionHistory","change:_isPendingUpdate","getUser","getRevision","21ZNBHcx","state","isOfficialPlugin","getRevisions","off","creatorId","currentRevision","code","138048hSnrtb","90511UQlMvX","from","get","_offset","isPremiumPlugin","_waitForServiceReady","CloudServicesRevisionHistoryAdapter","message","400","diffData","change:_isConnected","plugins","data","16kqvxlw","marker","updateRevisions","_handleReconnectionError","isEnabled","toVersion","wrongRequestId","_revisionHistoryService","config","cloud-services-internal-error: Revision History Service is not connected.","requires","createdAt","getOperations","_startingVersion","RevisionHistoryService","_fetchMissingUsers","buildRevisionData","fromVersion","_revisionDataBuilder","addUser","_getLatestVersionFromServerOperations","max","init","setRevisionData","authors","cloud-services-internal-error: Not connected.","38056JHGxuv","destroy","connected","2104836gFGlbd","type","_getLatestVersion","repository","size","startsWith","_oldOffset","reverse","_bufferUpdate","2091440aYbOfP","reconnect","_isConnected","setSource","_handleRevisionsUpdate","sendBufferedUpdates","baseVersion","serverHistory","8SVBDPw","cloud-services-internal-error: Request timeout.","_createCurrentRevision","addToReconnectionStack","bind","remove","_update","revisionsUpdated","_revisionTracker","_revisions","CONNECTED","catch","connect","addRevisionData","listenTo","collaboration.channelId","has","authorsIds","connection","add","once","_lastRequestId","then","cloudServices.bundleVersion","length","isConnected","sessionId","isBundleUploaded","getMany","editor","isEmptyCurrent","keys","_bufferedUpdates","map","reInit","_isPendingUpdate"];return(Xs=function(){return t})()}function Zs(t,e){const n=Xs();return(Zs=function(t,e){return n[t-=219]})(t,e)}!function(t){const e=Zs,n=t();for(;;)try{if(192990===parseInt(e(228))/1+-parseInt(e(287))/2*(-parseInt(e(227))/3)+parseInt(e(241))/4*(-parseInt(e(328))/5)+-parseInt(e(270))/6+parseInt(e(219))/7*(parseInt(e(267))/8)+parseInt(e(330))/9+parseInt(e(279))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Xs);class $s extends e.Plugin{static[Ws(255)]=(()=>Ve)();[Ws(308)];[Ws(295)];[Ws(248)];[Ws(276)];static get[Ws(251)](){return[zn,ws,Ws(331),Zn,Fn.Users]}static get[Ws(327)](){return Ws(234)}static get[Ws(221)](){return!0}static get[Ws(232)](){return!0}constructor(t){const e=Ws;super(t);const n=this[e(316)][e(249)][e(230)](e(302));this[e(308)]=null,this[e(295)]=this[e(316)][e(239)][e(230)](e(329)),this[e(248)]=new($s[e(255)])(n)}async[Ws(263)](){const t=Ws,e=this[t(316)][t(239)][t(230)](ws),r=e[t(286)],s=this[t(316)][t(239)][t(230)](zn);this[t(295)][t(282)]({history:r,getLatestVersion:()=>this[t(272)](),getCurrentRevisionId:()=>e[t(313)]});const o=this[t(316)][t(249)][t(230)](t(310))||n.version,i=await Pe[t(314)](s[t(305)],o);this[t(316)][t(239)][t(230)](t(331))[t(324)]={getRevision:async({revisionId:e})=>(await this[t(233)](),await this[t(248)][t(334)](e)),updateRevisions:async e=>{const n=t;await this[n(233)]();const r=this[n(295)][n(225)];if(i&&1===e[n(311)]&&e[0].id===r.id)return e;for(const t of e)t.id===r.id&&(t[n(317)]=t[n(258)]===t[n(246)]);return this[n(248)][n(243)](e,this[n(308)])[n(309)](t=>(this[n(308)]=t,e))[n(298)](t=>{const r=n;if(Qs(t)||r(236)===t[r(226)]&&void 0!==t[r(240)][r(247)]){for(const t of e)!this[r(295)][r(273)][r(334)](t.id)||this[r(295)][r(278)](t.id,t,!1);if(Qs(t))throw t;return e}throw t})}},this[t(301)](this[t(248)],t(294),(e,{revisionsData:n,requestId:r})=>{const s=t;Math[s(262)](...n[s(320)](t=>t[s(246)]))>this[s(261)]()-1?this[s(272)]()[s(309)](()=>{this[s(283)](n,r)}):this[s(283)](n,r)});const{revisions:a,requestId:c}=await this[t(248)][t(299)](s[t(305)]);s[t(290)](this),this[t(308)]=c,await this[t(256)](a);for(const e of a)this[t(295)][t(300)](e);this[t(301)](e,t(238),(n,r,s)=>{const o=t;s&&(this[o(276)]=e[o(231)],n[o(223)]())}),this[t(295)][t(291)](t(245)).to(s,t(220),e=>e===Oe[t(297)])}async[Ws(280)](){const t=Ws,e=this[t(316)][t(239)][t(230)](zn),n=this[t(316)][t(239)][t(230)](ws),r=async()=>{const r=t,s=this[r(295)][r(225)],o=s.id,i=o!==n[r(313)];if(i){const t=n[r(231)]-this[r(276)],e=this[r(261)]();if(this[r(295)][r(259)][r(321)](),s[r(246)]+t!==e){const n=s[r(258)]+t,o=this[r(316)][r(239)][r(230)](Fn.Users),i=this[r(295)][r(257)]({revision:s,from:n,to:e});i.id=s.id;const a=i[r(304)][r(320)](t=>o[r(333)](t));s[r(293)]({...i,authors:a},!0),this[r(295)][r(278)](s.id,i,!0)}this[r(295)][r(254)]=e,s[r(246)]===s[r(258)]&&!this[r(295)][r(319)][r(303)](o)&&this[r(295)][r(273)][r(296)][r(292)](o),this[r(295)][r(289)](e)}const{revisions:a,requestId:c}=await this[r(248)][r(280)](e[r(305)],this[r(308)]);i&&a[r(311)]>0?n[r(244)]():(await this[r(256)](a),this[r(283)](a,c),this[r(295)][r(284)]())};return n[t(281)]?r():new Promise((e,s)=>{const o=t;n[o(307)](o(238),()=>{const t=o;r()[t(309)](e)[t(298)](s)})})}[Ws(268)](){super[Ws(268)]()}async[Ws(233)](){const t=Ws;this[t(248)][t(312)]||await new Promise(e=>{const n=t;this[n(301)](this[n(248)],n(269),t=>{t[n(223)](),e()})})}[Ws(261)](){const t=Ws,e=this[t(316)][t(239)][t(230)](ws)[t(286)][t(253)]()[t(277)]();for(const n of e)if(t(242)!==n[t(271)]||n[t(325)])return n[t(285)]+1}[Ws(272)](){const t=Ws,e=this[t(316)][t(239)][t(230)](ws);return new Promise(n=>{const r=t;e[r(322)]?e[r(307)](r(332),()=>{n(this[r(261)]())}):n(this[r(261)]())})}[Ws(283)](t,e){const n=Ws,r=this[n(295)][n(273)];this[n(308)]=e;for(const e of t){const t=r[n(334)](e.id);if(t){if((e[n(258)]||e[n(246)])&&(e[n(237)]=null),t===this[n(295)][n(225)]){const r=Math[n(262)](t[n(246)],e[n(246)]),s=Math[n(262)](t[n(258)],e[n(258)]);let o;t[n(246)]===e[n(246)]&&t[n(258)]===e[n(258)]?(o=!0,this[n(323)](e)):e[n(246)]===r&&e[n(258)]===s?o=!1:(t[n(246)]===r&&t[n(258)]===s||this[n(326)]({revision:t,from:s,to:r}),o=!0),o&&(delete e[n(258)],delete e[n(246)],delete e[n(237)],delete e[n(252)],delete e[n(304)])}this[n(295)][n(264)](e),this[n(323)](e)}else this[n(295)][n(300)](e)}const s=r[n(222)]();s[n(277)]();for(let t=0;t<s[n(311)]-1;t++){const e=s[t],r=s[t+1];if(e[n(258)]<r[n(246)]){const t=r[n(246)],s=Math[n(262)](t,e[n(246)]);this[n(326)]({revision:e,from:t,to:s})}}}[Ws(326)]({revision:t,from:e,to:n}={}){const r=Ws,s=this[r(316)][r(239)][r(230)](Fn.Users),o=this[r(295)][r(257)]({revision:t,from:e,to:n});o[r(265)]=o[r(304)][r(320)](t=>s[r(333)](t)),t[r(293)](o)}[Ws(323)](t){const e=Ws,n={};n.id=t.id;for(const r of Object[e(318)](t))"id"!==r&&(n[r]=void 0);this[e(295)][e(278)](n.id,n,!0)}async[Ws(256)](t){const e=Ws,n=this[e(316)][e(239)][e(230)](Fn.Users),{connection:r}=this[e(316)][e(239)][e(230)](zn),s=new Set;for(const n of t){for(const t of n[e(304)])i(t);n[e(224)]&&i(n[e(224)])}if(0===s[e(274)])return;const o=await b[e(315)](r,Array[e(229)](s));for(const t of o)n[e(333)](t.id)||n[e(260)](t);function i(t){const r=e;n[r(333)](t)||s[r(306)](t)}}}function Qs(t){const e=Ws;return t[e(235)][e(275)](e(250))||t[e(235)][e(275)](e(266))||t[e(235)][e(275)](e(288))}var to=no;function eo(){var t=["isOfficialPlugin","RealTimeCollaborativeRevisionHistory","6241698ISKUhI","1107192PZNtuh","pluginName","12448KESGns","57628hWItDL","requires","22FsSXqo","4890486DXjRbz","isPremiumPlugin","4QePFlw","35unQKcb","116010wOPAXK","3805840ZnnyDg","RevisionHistory","267XgHiYf"];return(eo=function(){return t})()}function no(t,e){var n=eo();return(no=function(t,e){return n[t-=148]})(t,e)}!function(t){for(var e=no,n=t();;)try{if(606158===parseInt(e(161))/1*(parseInt(e(156))/2)+parseInt(e(149))/3*(parseInt(e(155))/4)+parseInt(e(164))/5+parseInt(e(159))/6+-parseInt(e(162))/7*(parseInt(e(153))/8)+-parseInt(e(152))/9+-parseInt(e(163))/10*(-parseInt(e(158))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(eo);class ro extends e.Plugin{static get[to(157)](){return[to(148),$s,As]}static get[to(154)](){return to(151)}static get[to(150)](){return!0}static get[to(160)](){return!0}}function so(t){return function(t){return"object"==typeof t&&null!==t}(t)&&1===t.nodeType&&!function(t){if("object"!=typeof t)return!1;if(null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==Object.prototype.toString.call(t)){const e=t[Symbol.toStringTag];return null!=e&&(!!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable&&t.toString()===`[object ${e}]`)}let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t)}const oo=ao;function io(){const t=["8137865eNKsIR","listitem","setTemplate","ck-presence-list__counter--hidden","div","12555103SfuHfT","ck-presence-list__list-item","_collapseAt","isHidden","2840524MqTnNv","3632MXZurQ","usersCount","14943740mNYbln","toString","1OqApYt","3jWjZRX","ck-presence-list__users-counter__text","6dPEcrz","bindTemplate","bind","ck-presence-list__users-counter","set","17037cvZfED","588216AtVDyr","9079035TdMwzH"];return(io=function(){return t})()}function ao(t,e){const n=io();return(ao=function(t,e){return n[t-=245]})(t,e)}!function(t){const e=ao,n=t();for(;;)try{if(828386===-parseInt(e(248))/1*(-parseInt(e(257))/2)+parseInt(e(249))/3*(parseInt(e(268))/4)+parseInt(e(259))/5*(parseInt(e(251))/6)+-parseInt(e(258))/7+-parseInt(e(269))/8*(parseInt(e(256))/9)+parseInt(e(246))/10+-parseInt(e(264))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(io);class co extends r.View{[oo(266)];constructor(t,e=6){const n=oo;super(t);const r=this[n(252)];this[n(255)](n(267),!0),this[n(255)](n(245),0),this[n(266)]=e,this[n(253)](n(267)).to(this,n(245),t=>t<e),this[n(261)]({tag:n(263),attributes:{class:["ck",n(265),r.if(n(267),n(262))],role:n(260)},children:[{tag:n(263),attributes:{class:["ck",n(254)]},children:[{tag:n(263),attributes:{class:["ck",n(250)]},children:[{text:r.to(n(245),t=>"+"+(t-this[n(266)]+2)[n(247)]())}]}]}]})}}function uo(t,e){const n=po();return(uo=function(t,e){return n[t-=233]})(t,e)}const lo=uo;function po(){const t=["216753USaRMR","132zMUDqS","change:hasPopup","contains","element","300MbrVZj","aria-expanded","fire","isExpanded","render","keystrokes","createCollection","1062518KynqjM","listenTo","9768064fuqnlw","relatedTarget","1133kySlRp","querySelector","bindTemplate","938484RTuzTr","7cKWHgO","197300rksWTc","focus","setTemplate","Connected users list","hasPopup","set","div","items","Collapsed connected users list (press ENTER to open it)","50718WKezeS","removeAttribute",".ck-presence-list__dropdown-list","presencelist:show","ck-presence-list__list","320045VaWzXu","list","setAttribute","presencelist:hide",".ck-balloon-panel_with-arrow"];return(po=function(){return t})()}!function(t){const e=uo,n=t();for(;;)try{if(741200===parseInt(e(258))/1+-parseInt(e(270))/2+-parseInt(e(248))/3*(parseInt(e(263))/4)+-parseInt(e(253))/5*(-parseInt(e(259))/6)+parseInt(e(238))/7*(-parseInt(e(272))/8)+parseInt(e(237))/9+-parseInt(e(239))/10*(-parseInt(e(234))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(po);class ho extends r.View{[lo(246)];[lo(268)];constructor(t){const e=lo;super(t);const r=this[e(236)];this[e(246)]=this[e(269)](),this[e(268)]=new n.KeystrokeHandler,this[e(244)]({hasPopup:!1,isExpanded:!1}),this[e(241)]({tag:e(245),attributes:{"aria-haspopup":r.if(e(243)),"aria-expanded":r.to(e(266),t=>this[e(243)]&&String(t)),"aria-label":r.to(e(243),n=>mr(t,e(n?247:242))),role:e(254),tabindex:r.to(e(243),t=>!!t&&0),class:["ck",e(252)]},children:this[e(246)],on:{mouseenter:r.to(()=>this[e(265)](e(251))),mouseleave:r.to(t=>{const n=e,r=t,s=document[n(235)](n(250)),o=document[n(235)](n(257));s?.[n(261)](r[n(233)])||o?.[n(261)](r[n(233)])||this[n(265)](n(256))})}}),this.on(e(260),(t,n,r)=>{const s=e;this[s(262)]&&(r?this[s(262)][s(255)](s(264),String(this[s(266)])):this[s(262)][s(249)](s(264)))})}[lo(240)](){const t=lo;this[t(262)][t(240)]()}[lo(267)](){const t=lo;super[t(267)](),this[t(268)][t(271)](this[t(262)])}}var fo=__webpack_require__(106),mo={attributes:{"data-cke":!0}};mo.setAttributes=or(),mo.insert=rr().bind(null,"head"),mo.domAPI=er(),mo.insertStyleElement=ar();Qn()(fo.A,mo);fo.A&&fo.A.locals&&fo.A.locals;const yo=go;function go(t,e){const n=bo();return(go=function(t,e){return n[t-=262]})(t,e)}function bo(){const t=["4176036zuqSJx","items","listenTo","first","locale","8264GedYFk","bindTemplate","bind","hasPopup","12Lsrwlz","ck-presence-list--collapsed","counterView","change","463075VzLKkw","324aFjDux","ck-presence-list","inlineListView","1477FWuGup","isCollapsed","569892olNvxM","4HOcEnv","set","setTemplate","20004DRvgXw","tooltipPosition","6070880ouBkCT","div","10746868ZkryEW","8snFLyo","ck-rounded-corners","ck-reset"];return(bo=function(){return t})()}!function(t){const e=go,n=t();for(;;)try{if(393119===-parseInt(e(272))/1+-parseInt(e(289))/2*(-parseInt(e(267))/3)+parseInt(e(273))/4*(-parseInt(e(266))/5)+parseInt(e(276))/6*(parseInt(e(270))/7)+parseInt(e(281))/8*(-parseInt(e(284))/9)+-parseInt(e(278))/10+-parseInt(e(280))/11*(-parseInt(e(262))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(bo);class Oo extends r.View{[yo(264)];[yo(269)];constructor(t,e=6){const n=yo;super(t);const r=this[n(290)];this[n(274)](n(271),!0),this[n(264)]=new co(this[n(288)],e),this[n(269)]=new ho(t),this[n(269)][n(291)](n(292)).to(this,n(271)),this[n(286)](this[n(269)][n(285)],n(265),()=>{const t=n;for(const e of this[t(269)][t(285)])e[t(277)]="s";this[t(269)][t(285)][t(287)]&&(this[t(269)][t(285)][t(287)][t(277)]="se")}),this[n(275)]({tag:n(279),attributes:{class:["ck",n(268),n(283),n(282),r.if(n(271),n(263))]},children:[this[n(269)]]})}}const wo=Io;function Io(t,e){const n=vo();return(Io=function(t,e){return n[t-=311]})(t,e)}function vo(){const t=["application","bindTemplate","227108YEvkbp","3887415LbDqvM","10bXLYdh","max","ck-presence-list__dropdown-list-wrapper","checkIfScrollable","6051112LFSwDf","render","listenTo","_isScrollable","fire","ck-list","ariaLabel","element","12zFsqUi","innerHeight","window","resize","clientHeight","set","presencelist:hide","scrollHeight","286511exPLca","58735BXEOKE","setTemplate","relatedTarget","contains","Connected users list dropdown menu","change","11140212RMEHCN","querySelector","items","11ZkbXeb","listWrapperView",".ck-presence-list__list","ck-presence-list__dropdown-list-wrapper_scrollable","ariaLabelledBy","1829679MHSXCO","172hJnGgL","ck-reset","role","6VrCEVv","ck-presence-list__dropdown-list","div",".ck-balloon-panel_with-arrow"];return(vo=function(){return t})()}!function(t){const e=Io,n=t();for(;;)try{if(450566===parseInt(e(354))/1*(-parseInt(e(326))/2)+parseInt(e(322))/3+parseInt(e(323))/4*(parseInt(e(355))/5)+-parseInt(e(346))/6*(parseInt(e(332))/7)+parseInt(e(338))/8+-parseInt(e(333))/9*(-parseInt(e(334))/10)+-parseInt(e(317))/11*(parseInt(e(314))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(vo);class So extends r.View{[wo(318)];constructor(t,e){const n=wo;super(t);const r=this[n(331)];this[n(318)]=new ko(t,e),this[n(356)]({tag:n(328),attributes:{tabindex:-1,role:n(330),class:["ck",n(327)],"aria-label":mr(t,n(312))},children:[this[n(318)]],on:{mouseleave:r.to(t=>{const e=n,r=t,s=document[e(315)](e(319)),o=document[e(315)](e(329));s?.[e(311)](r[e(357)])||o?.[e(311)](r[e(357)])||this[e(342)](e(352))})}})}}class ko extends r.ListView{constructor(t,e){const r=wo;super(t);const s=this[r(331)];this[r(351)](r(341),!1),this[r(356)]({tag:e?r(328):"ul",attributes:{class:["ck",r(324),r(343),r(336),s.if(r(341),r(320))],role:s.to(r(325)),"aria-label":s.to(r(344)),"aria-labelledby":s.to(r(321))},children:this[r(316)]}),this[r(340)](n.global[r(348)],r(349),()=>this[r(337)]()),this[r(316)].on(r(313),()=>this[r(337)]())}[wo(339)](){const t=wo;super[t(339)](),this[t(337)]()}[wo(337)](){const t=wo,e=this[t(345)];e&&(this[t(341)]=Math[t(335)](e[t(353)],e[t(350)])>.8*window[t(347)])}}const Po=To;function Ao(){const t=["focus","2FAvvye","7700TsOTeL","tag","27458LhpfUL","presentation","1047368CcdNCa","2764275jGnDHu","getBackgroundColorClass","userView","ck-user__full-name","3924fpTJjW","color","ck-presence-list__marker","button","fire","3151160lINrtA","name","3116030tJmKJi","4SySJuH","true","ck-presence-list__dropdown-list-item","execute","span","bindTemplate","element","8543904asCiDH","setTemplate"];return(Ao=function(){return t})()}function To(t,e){const n=Ao();return(To=function(t,e){return n[t-=500]})(t,e)}!function(t){const e=To,n=t();for(;;)try{if(728096===-parseInt(e(518))/1*(-parseInt(e(515))/2)+-parseInt(e(521))/3*(-parseInt(e(505))/4)+parseInt(e(504))/5+-parseInt(e(512))/6+-parseInt(e(520))/7+parseInt(e(502))/8+-parseInt(e(525))/9*(-parseInt(e(516))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Ao);class _o extends r.ListItemView{[Po(523)];constructor(t,e,n){const r=Po;super(t);const s=this[r(510)];this[r(523)]=new Fn.UserView(t,e);const o={tag:"li",attributes:{class:["ck",r(507)],tabindex:-1,role:r(519),"aria-label":e[r(503)]},children:[this[r(523)],{tag:r(509),attributes:{class:["ck",r(524)]},children:[{text:e[r(503)]}]},{tag:r(509),attributes:{class:["ck",r(527),e[r(526)][r(522)]()],"aria-hidden":r(506)}}]};n&&(o[r(517)]=r(500),o.on={click:s.to(()=>this[r(501)](r(508)))}),this[r(513)](o)}[Po(514)](){const t=Po;this[t(511)][t(514)]()}}const Co=Do;function jo(){const t=["text","span","139731cRSlLL","color","getBackgroundColorClass","markerView","bindTemplate","ck-presence-list__list-item","set","name","42198AEapao","2891FSBbev","8RjPyop","1178385RNDWVK","tooltipPosition","4674uMVldi","userView","true","tag","36YFibEh","isFocusable","hasTooltip","1057108UGdsLL","div","5125390ozPIrJ","button","execute","setTemplate","ck-presence-list__marker","ck-presence-list__list-item__tooltip","template","172251tFbDhj","fire","listitem"];return(jo=function(){return t})()}!function(t){const e=Do,n=t();for(;;)try{if(176546===parseInt(e(410))/1+parseInt(e(393))/2*(-parseInt(e(418))/3)+parseInt(e(396))/4+parseInt(e(421))/5+-parseInt(e(423))/6*(-parseInt(e(419))/7)+parseInt(e(420))/8*(-parseInt(e(405))/9)+-parseInt(e(398))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(jo);class Eo extends r.View{[Co(424)];[Co(413)];constructor(t,e,n){const s=Co;super(t);const o=this[s(414)];this[s(416)](s(394),!1),this[s(416)](s(395),!0),this[s(416)](s(422),""),this[s(424)]=new Fn.UserView(t,e),this[s(413)]=new Ro(t,e);const i=new r.LabelView(t);i[s(404)][s(426)]=s(409),i[s(408)]=e[s(417)];const a={tag:s(397),attributes:{class:["ck",s(415)],role:s(407),tabindex:o.to(s(394),t=>!!t&&0),"aria-labelledby":i.id,"data-cke-tooltip-text":this[s(424)][s(417)],"data-cke-tooltip-position":o.to(s(422)),"data-cke-tooltip-disabled":o.to(s(395),t=>!t),"data-cke-tooltip-class":s(403)},children:[this[s(424)],this[s(413)],i]};n&&(a[s(426)]=s(399),a.on={click:o.to(()=>this[s(406)](s(400)))}),this[s(401)](a)}}function Do(t,e){const n=jo();return(Do=function(t,e){return n[t-=393]})(t,e)}class Ro extends r.View{constructor(t,e){const n=Co;super(t),this[n(401)]({tag:n(409),attributes:{class:["ck",n(402),e[n(411)][n(412)]()],"aria-hidden":n(425)}})}}const xo=No;function No(t,e){const n=Vo();return(No=function(t,e){return n[t-=347]})(t,e)}function Vo(){const t=["locale","isMe","isRendered","from","105804oTqROK","join","474010pxSHjf","min","presencelist:show","change:isFocused","get","checkIfScrollable","init","261uRzkpJ","add","focus","isVisible","indexOf","querySelectorAll","isExpanded","keystrokes","currentDisplayedUsers","input","map","render","presenceList","inlineListView","class","detachFromDom",':not([disabled]):not([tabindex="-1"])',"1500zkhmYv","hideDropdown","execute","isPremiumPlugin","number","72KIxijp","isOfficialPlugin","presencelist:hide","activeElement","appendChild","[tabindex]","Tab","onClick","requires","define","listenTo","Esc","reverse","find","offsetWidth","_allConnectedUsers","pin","filter","Shift+Tab","config","_bodyCollection","1814772xsWXNu","element","showDropdown","10AZtnHw","presenceList.container","plugins","312984nlzVql","counterView","allConnectedUsers","length","Enter","using","destroy","textarea","sort","_handleUserAdd","isCollapsed","view","_createView","tabIndex","content","select","button","context","5837700tOpoKk","presencelist-collapseat-invalid-format","PresenceListUI","balloonPanelView","bindTo","isFocusable","presenceList.displayMe","_handleUserRemove","ck ck-presence-list__balloon","pluginName","set","196EUeXOc","remove","presenceDropdownView","focusTracker","[contenteditable]","items","offsetHeight","displayMe","presenceList.collapseAt","hasTooltip","unpin","982420fXWmiH","body","bind","attachToDom","usersCount","presencelist-missing-container"];return(Vo=function(){return t})()}!function(t){const e=No,n=t();for(;;)try{if(602331===-parseInt(e(416))/1*(parseInt(e(433))/2)+parseInt(e(351))/3+-parseInt(e(397))/4*(parseInt(e(354))/5)+parseInt(e(407))/6*(parseInt(e(386))/7)+parseInt(e(357))/8+parseInt(e(438))/9*(-parseInt(e(409))/10)+parseInt(e(375))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Vo);const Mo={collapseAt:6,displayMe:!0};class Bo extends e.ContextPlugin{[xo(424)];[xo(378)];[xo(368)];[xo(388)];[xo(350)]=null;static get[xo(384)](){return xo(377)}static get[xo(439)](){return!0}static get[xo(436)](){return!0}constructor(t){const e=xo;super(t),this[e(374)][e(349)][e(447)](e(428),Mo);const s=t[e(349)][e(413)](e(394));if(e(437)!=typeof s)throw new n.CKEditorError(e(376),this);if(s<1)throw new n.CKEditorError(e(376),this);this[e(453)]=this[e(374)][e(356)][e(413)](Zn)[e(359)],this[e(385)](e(401),0),this[e(424)]=new n.Collection,this[e(378)]=new r.BalloonPanelView,this[e(378)][e(430)]=e(383),this[e(368)]=this[e(369)](),this[e(388)]=void 0}static get[xo(446)](){return[Zn]}[xo(415)](){const t=xo;for(const e of this[t(453)])this[t(366)](e);this[t(448)](this[t(453)],t(417),(e,n)=>{this[t(366)](n)}),this[t(448)](this[t(453)],t(387),(e,n)=>{this[t(382)](n)})}[xo(369)](){const t=xo,e=this[t(374)],s=new Oo(this[t(374)][t(403)],this[t(374)][t(349)][t(413)](t(394))),o=this[t(378)];if(!so(e[t(349)][t(413)](t(355))))throw new n.CKEditorError(t(402),this);return s[t(358)][t(399)](t(401)).to(this),s[t(399)](t(367)).to(this,t(401),n=>{const r=t,{collapseAt:o}=e[r(349)][r(413)](r(428)),i=n>=o;if(i&&!s[r(429)][r(391)][r(451)](t=>t instanceof co)){const t=this[r(374)][r(349)][r(413)](r(394))-1;this[r(424)][r(360)]==t&&this[r(424)][r(360)]>1&&this[r(424)][r(387)](this[r(424)][r(360)]-1),s[r(429)][r(391)][r(417)](s[r(358)])}return i||this[r(434)](),i}),s[t(429)][t(391)][t(379)](this[t(424)])[t(362)](n=>{const r=t,o=e[r(349)][r(413)](r(428)),i=new Eo(e[r(403)],n,!!o[r(445)]);return i[r(399)](r(395)).to(s,r(367),t=>!t),i[r(399)](r(380)).to(s,r(367),t=>!t),o[r(445)]&&this[r(448)](i,r(435),()=>{const t=r;this[t(368)][t(367)]||o[t(445)](n,i[t(352)])}),i}),this[t(448)](s[t(429)],t(411),()=>{const e=t;this[e(368)][e(367)]&&this[e(353)]()}),this[t(448)](s[t(429)],t(440),()=>{const e=t;this[e(388)]&&this[e(434)]()}),s[t(429)][t(423)][t(385)](t(361),(e,n)=>{const r=t;this[r(368)][r(367)]&&(this[r(353)](),n())}),s[t(427)](),o[t(427)](),(0,r.clickOutsideHandler)({emitter:s,activator:()=>o[t(419)],contextElements:[o[t(352)],s[t(429)][t(352)]],callback:()=>this[t(434)]()}),e[t(349)][t(413)](t(355))[t(442)](s[t(352)]),this[t(350)]=new r.BodyCollection(this[t(374)][t(403)]),this[t(350)][t(400)](),this[t(350)][t(417)](this[t(378)]),s}[xo(366)](t){const e=xo;if(!this[e(374)][e(349)][e(413)](e(381))&&t[e(404)])return;const n=this[e(374)][e(349)][e(413)](e(394))-1;for(this[e(401)]++;this[e(424)][e(360)]>=n-(this[e(368)][e(367)]?1:0)&&this[e(424)][e(360)]>1;)this[e(424)][e(387)](1);const r=t[e(404)]?0:this[e(424)][e(360)];this[e(424)][e(417)](t,r)}[xo(382)](t){const e=xo;this[e(401)]--;const{collapseAt:n}=this[e(374)][e(349)][e(413)](e(428)),r=this[e(401)]>=n;if(this[e(424)][e(413)](t.id))this[e(424)][e(387)](t.id);else if(r&&this[e(424)][e(360)]+1===n-1)return;if(this[e(424)][e(360)]+(r?1:0)<this[e(401)])for(const t of Array[e(406)](this[e(453)])[e(450)]())if(!this[e(424)][e(413)](t.id)&&(this[e(424)][e(417)](t,Math[e(410)](this[e(424)][e(360)]-(r?1:0),1)),this[e(424)][e(360)]+(r?1:0)===n-1))return}[xo(353)](){const t=xo;if(this[t(388)])return;const e=this[t(374)][t(349)][t(413)](t(428));this[t(388)]=new So(this[t(374)][t(403)],!!e[t(445)]),this[t(368)][t(429)][t(422)]=!0,this[t(448)](this[t(388)],t(440),()=>{const e=t;this[e(388)]&&this[e(434)]()});const{listWrapperView:n}=this[t(388)];n[t(391)][t(379)](this[t(453)])[t(362)](n=>{const r=t;if(!e[r(393)]&&n[r(404)])return null;const s=new _o(this[r(374)][r(403)],n,!!e[r(445)]);return e[r(445)]&&this[r(448)](s,r(435),()=>{const t=r;e[t(445)](n,s[t(352)])}),s}),this[t(378)][t(371)][t(417)](this[t(388)]),this[t(378)][t(454)]({target:this[t(368)][t(429)][t(352)]}),n[t(418)](),n[t(414)]();const r=(e,n)=>{const r=t;this[r(434)](),this[r(368)][r(429)][r(418)](),n()};n[t(423)][t(385)](t(449),r),n[t(423)][t(385)](t(348),r),n[t(423)][t(385)](t(444),(e,n)=>{const r=t;!function(t){const e=No,n=["a",e(373),e(425),e(372),e(364),e(443),e(390)][e(426)](t=>t+e(432))[e(408)](","),r=[...document[e(398)][e(421)](n)][e(347)](t=>t===document[e(441)]||t[e(452)]+t[e(392)]>0)[e(365)]((t,n)=>(t[e(370)]||0)-(n[e(370)]||0)),s=r[e(420)](t),o=r[(s+1)%r[e(360)]];o&&o[e(418)]()}(this[r(368)][r(352)]),this[r(434)](),n()}),n[t(389)][t(417)](this[t(368)][t(352)]),n[t(389)].on(t(412),(e,n,r)=>{r||this[t(434)]()})}[xo(434)](){const t=xo;this[t(388)]&&(this[t(368)][t(429)][t(422)]=!1,this[t(378)][t(396)](),this[t(378)][t(371)][t(387)](this[t(388)]),this[t(388)][t(363)](),this[t(388)]=void 0)}[xo(363)](){const t=xo;super[t(363)](),this[t(368)]&&this[t(368)][t(405)]&&this[t(368)][t(363)](),this[t(350)]&&(this[t(350)][t(431)](),this[t(350)][t(363)](),this[t(350)]=null)}}var Uo=qo;function Jo(){var t=["pluginName","9AHNGKf","isOfficialPlugin","requires","156MliDLL","238242finUkl","20LvZMms","isPremiumPlugin","102dDAQdI","13248pyKJDW","2027424AKAtgX","94088YDnbEh","24560McpwjL","1590523hBuHHb","PresenceList","180758iFjghH"];return(Jo=function(){return t})()}function qo(t,e){var n=Jo();return(qo=function(t,e){return n[t-=279]})(t,e)}!function(t){for(var e=qo,n=t();;)try{if(150760===parseInt(e(283))/1+-parseInt(e(293))/2+parseInt(e(286))/3*(-parseInt(e(287))/4)+parseInt(e(290))/5*(parseInt(e(282))/6)+-parseInt(e(288))/7+-parseInt(e(289))/8*(parseInt(e(279))/9)+parseInt(e(284))/10*(parseInt(e(291))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Jo);class Lo extends e.ContextPlugin{static get[Uo(281)](){return[Zn,Bo]}static get[Uo(294)](){return Uo(292)}static get[Uo(280)](){return!0}static get[Uo(285)](){return!0}}function Go(){var t=["578696kvrFMZ","21olldjl","1709398NgDyXX","40IPZbcd","541028oNkBhV","274848VWJyDu","25039630PBIryL","3MiBlpF","4472541BWNPbp","317574rzownR"];return(Go=function(){return t})()}function Ho(t,e){var n=Go();return(Ho=function(t,e){return n[t-=184]})(t,e)}!function(t){for(var e=Ho,n=t();;)try{if(575380===-parseInt(e(188))/1+parseInt(e(191))/2*(-parseInt(e(186))/3)+-parseInt(e(193))/4*(parseInt(e(192))/5)+parseInt(e(184))/6+parseInt(e(190))/7*(-parseInt(e(189))/8)+parseInt(e(187))/9+parseInt(e(185))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Go)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();
|