@ckeditor/ckeditor5-real-time-collaboration 44.3.0-alpha.7 → 44.3.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.
Files changed (168) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/bg.js +1 -1
  12. package/dist/translations/bg.umd.js +1 -1
  13. package/dist/translations/bn.js +1 -1
  14. package/dist/translations/bn.umd.js +1 -1
  15. package/dist/translations/bs.js +1 -1
  16. package/dist/translations/bs.umd.js +1 -1
  17. package/dist/translations/ca.js +1 -1
  18. package/dist/translations/ca.umd.js +1 -1
  19. package/dist/translations/cs.js +1 -1
  20. package/dist/translations/cs.umd.js +1 -1
  21. package/dist/translations/da.js +1 -1
  22. package/dist/translations/da.umd.js +1 -1
  23. package/dist/translations/de-ch.js +1 -1
  24. package/dist/translations/de-ch.umd.js +1 -1
  25. package/dist/translations/de.js +1 -1
  26. package/dist/translations/de.umd.js +1 -1
  27. package/dist/translations/el.js +1 -1
  28. package/dist/translations/el.umd.js +1 -1
  29. package/dist/translations/en-au.js +1 -1
  30. package/dist/translations/en-au.umd.js +1 -1
  31. package/dist/translations/en-gb.js +1 -1
  32. package/dist/translations/en-gb.umd.js +1 -1
  33. package/dist/translations/en.js +1 -1
  34. package/dist/translations/en.umd.js +1 -1
  35. package/dist/translations/eo.js +1 -1
  36. package/dist/translations/eo.umd.js +1 -1
  37. package/dist/translations/es-co.js +1 -1
  38. package/dist/translations/es-co.umd.js +1 -1
  39. package/dist/translations/es.js +1 -1
  40. package/dist/translations/es.umd.js +1 -1
  41. package/dist/translations/et.js +1 -1
  42. package/dist/translations/et.umd.js +1 -1
  43. package/dist/translations/eu.js +1 -1
  44. package/dist/translations/eu.umd.js +1 -1
  45. package/dist/translations/fa.js +1 -1
  46. package/dist/translations/fa.umd.js +1 -1
  47. package/dist/translations/fi.js +1 -1
  48. package/dist/translations/fi.umd.js +1 -1
  49. package/dist/translations/fr.js +1 -1
  50. package/dist/translations/fr.umd.js +1 -1
  51. package/dist/translations/gl.js +1 -1
  52. package/dist/translations/gl.umd.js +1 -1
  53. package/dist/translations/gu.js +1 -1
  54. package/dist/translations/gu.umd.js +1 -1
  55. package/dist/translations/he.js +1 -1
  56. package/dist/translations/he.umd.js +1 -1
  57. package/dist/translations/hi.js +1 -1
  58. package/dist/translations/hi.umd.js +1 -1
  59. package/dist/translations/hr.js +1 -1
  60. package/dist/translations/hr.umd.js +1 -1
  61. package/dist/translations/hu.js +1 -1
  62. package/dist/translations/hu.umd.js +1 -1
  63. package/dist/translations/hy.js +1 -1
  64. package/dist/translations/hy.umd.js +1 -1
  65. package/dist/translations/id.js +1 -1
  66. package/dist/translations/id.umd.js +1 -1
  67. package/dist/translations/it.js +1 -1
  68. package/dist/translations/it.umd.js +1 -1
  69. package/dist/translations/ja.js +1 -1
  70. package/dist/translations/ja.umd.js +1 -1
  71. package/dist/translations/jv.js +1 -1
  72. package/dist/translations/jv.umd.js +1 -1
  73. package/dist/translations/kk.js +1 -1
  74. package/dist/translations/kk.umd.js +1 -1
  75. package/dist/translations/km.js +1 -1
  76. package/dist/translations/km.umd.js +1 -1
  77. package/dist/translations/kn.js +1 -1
  78. package/dist/translations/kn.umd.js +1 -1
  79. package/dist/translations/ko.js +1 -1
  80. package/dist/translations/ko.umd.js +1 -1
  81. package/dist/translations/ku.js +1 -1
  82. package/dist/translations/ku.umd.js +1 -1
  83. package/dist/translations/lt.js +1 -1
  84. package/dist/translations/lt.umd.js +1 -1
  85. package/dist/translations/lv.js +1 -1
  86. package/dist/translations/lv.umd.js +1 -1
  87. package/dist/translations/ms.js +1 -1
  88. package/dist/translations/ms.umd.js +1 -1
  89. package/dist/translations/nb.js +1 -1
  90. package/dist/translations/nb.umd.js +1 -1
  91. package/dist/translations/ne.js +1 -1
  92. package/dist/translations/ne.umd.js +1 -1
  93. package/dist/translations/nl.js +1 -1
  94. package/dist/translations/nl.umd.js +1 -1
  95. package/dist/translations/no.js +1 -1
  96. package/dist/translations/no.umd.js +1 -1
  97. package/dist/translations/oc.js +1 -1
  98. package/dist/translations/oc.umd.js +1 -1
  99. package/dist/translations/pl.js +1 -1
  100. package/dist/translations/pl.umd.js +1 -1
  101. package/dist/translations/pt-br.js +1 -1
  102. package/dist/translations/pt-br.umd.js +1 -1
  103. package/dist/translations/pt.js +1 -1
  104. package/dist/translations/pt.umd.js +1 -1
  105. package/dist/translations/ro.js +1 -1
  106. package/dist/translations/ro.umd.js +1 -1
  107. package/dist/translations/ru.js +1 -1
  108. package/dist/translations/ru.umd.js +1 -1
  109. package/dist/translations/si.js +1 -1
  110. package/dist/translations/si.umd.js +1 -1
  111. package/dist/translations/sk.js +1 -1
  112. package/dist/translations/sk.umd.js +1 -1
  113. package/dist/translations/sl.js +1 -1
  114. package/dist/translations/sl.umd.js +1 -1
  115. package/dist/translations/sq.js +1 -1
  116. package/dist/translations/sq.umd.js +1 -1
  117. package/dist/translations/sr-latn.js +1 -1
  118. package/dist/translations/sr-latn.umd.js +1 -1
  119. package/dist/translations/sr.js +1 -1
  120. package/dist/translations/sr.umd.js +1 -1
  121. package/dist/translations/sv.js +1 -1
  122. package/dist/translations/sv.umd.js +1 -1
  123. package/dist/translations/th.js +1 -1
  124. package/dist/translations/th.umd.js +1 -1
  125. package/dist/translations/ti.js +1 -1
  126. package/dist/translations/ti.umd.js +1 -1
  127. package/dist/translations/tk.js +1 -1
  128. package/dist/translations/tk.umd.js +1 -1
  129. package/dist/translations/tr.js +1 -1
  130. package/dist/translations/tr.umd.js +1 -1
  131. package/dist/translations/tt.js +1 -1
  132. package/dist/translations/tt.umd.js +1 -1
  133. package/dist/translations/ug.js +1 -1
  134. package/dist/translations/ug.umd.js +1 -1
  135. package/dist/translations/uk.js +1 -1
  136. package/dist/translations/uk.umd.js +1 -1
  137. package/dist/translations/ur.js +1 -1
  138. package/dist/translations/ur.umd.js +1 -1
  139. package/dist/translations/uz.js +1 -1
  140. package/dist/translations/uz.umd.js +1 -1
  141. package/dist/translations/vi.js +1 -1
  142. package/dist/translations/vi.umd.js +1 -1
  143. package/dist/translations/zh-cn.js +1 -1
  144. package/dist/translations/zh-cn.umd.js +1 -1
  145. package/dist/translations/zh.js +1 -1
  146. package/dist/translations/zh.umd.js +1 -1
  147. package/package.json +14 -14
  148. package/src/common-translations.js +1 -1
  149. package/src/index.js +1 -1
  150. package/src/presencelist/presencelistui.js +1 -1
  151. package/src/presencelist/view/presencecounterview.js +1 -1
  152. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  153. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  154. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  155. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  156. package/src/presencelist/view/presencelistview.js +1 -1
  157. package/src/presencelist.js +1 -1
  158. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
  159. package/src/realtimecollaborativecomments.js +1 -1
  160. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
  161. package/src/realtimecollaborativeediting/sessions.js +1 -1
  162. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  163. package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
  164. package/src/realtimecollaborativeediting.js +1 -1
  165. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
  166. package/src/realtimecollaborativerevisionhistory.js +1 -1
  167. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
  168. 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: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}.ck.ck-presence-list__counter{color:var(--ck-color-base-text);margin-right:var(--ck-spacing-large)}.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-small);outline:none;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-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck-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)}.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)*-1 + 7px);padding: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:nth-last-child(2){opacity:.75}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(n+6){display:none}.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 .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}@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:()=>ed,CloudServicesRevisionHistoryAdapter:()=>Pd,CloudServicesTrackChangesAdapter:()=>cd,PresenceList:()=>yu,RealTimeCollaborationClient:()=>Lc,RealTimeCollaborativeComments:()=>md,RealTimeCollaborativeEditing:()=>Qc,RealTimeCollaborativeRevisionHistory:()=>Cd,RealTimeCollaborativeTrackChanges:()=>Od,Sessions:()=>ys});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{Decoder:()=>Vt,Encoder:()=>Rt,PacketType:()=>xt,protocol:()=>Dt});var e=__webpack_require__(782),n=__webpack_require__(584),r=__webpack_require__(311),s=__webpack_require__(783);class o{constructor(...t){}}class i extends o{constructor(...t){super()}static fromJSON(t){throw new TypeError("Must be implemented in a child class!")}}i.TYPE="1000";const a=i;class c extends a{constructor(t){super(),this.id=t}toJSON(){return{id:this.id}}static fromJSON(t){return new c(t.id)}}c.TYPE="21",c.READABLE_TYPE_NAME="getUser",c.DESCRIPTOR_NAME="GetUserMessage",c.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const d=c;class u extends a{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 u(e)}}u.DESCRIPTOR_NAME="GetUserResponse",u.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};const l=u;var p=__webpack_require__(199);const h=(()=>{var t=p.Reader,e=p.Writer,n=p.util,r=p.roots.default||(p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.OperationMetadataDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.userId=e.string();break;case 2:o.type=e.string();break;case 3:o.createdAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingConnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.bundleVersion=e.string();break;case 3:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(e.bytes());break;case 4:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.types.push(e.uint32());else o.types.push(e.uint32());break;case 5:o.lastOperationId=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingReconnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.bundleVersion=e.string();break;case 3:o.lastKnowVersion=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingUpdateMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.baseVersion=e.uint32();break;case 3:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(e.bytes());break;case 4:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.types.push(e.uint32());else o.types.push(e.uint32());break;case 6:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:o.lastOperationId=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetDocumentDetailsMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.environmentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.offset=e.uint32();break;case 3:o.version=e.uint32();break;case 4:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(e.bytes());break;case 5:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.types.push(e.uint32());else o.types.push(e.uint32());break;case 7:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:o.initData=e.string();break;case 9:o.isInitialized=e.bool();break;case 10:o.sessionId=e.string();break;case 11:o.lastOperationId=e.string();break;case 12:o.sessionCreatedAt=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.version=e.uint32();break;case 2:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(e.bytes());break;case 3:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.types.push(e.uint32());else o.types.push(e.uint32());break;case 5:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:o.lastOperationId=e.string();break;case 7:o.lastOperationAcceptedAt=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetDocumentDetailsResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.lastDocumentSessionId=e.string();break;case 2:o.lastDocumentSessionOperationId=e.string();break;case 3:o.currentDocumentSessionId=e.string();break;case 4:o.currentDocumentSessionVersion=e.uint32();break;case 5:o.currentDocumentSessionOperationId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentId=e.string();break;case 2:o.commentThreadId=e.string();break;case 3:o.userId=e.string();break;case 4:o.content=e.string();break;case 5:o.documentId=e.string();break;case 6:o.createdAt=e.string();break;case 7:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsThreadDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentDescriptor.decode(e,e.uint32()));break;case 3:o.resolvedAt=e.string();break;case 4:o.resolvedBy=e.string();break;case 5:o.context=e.string();break;case 6:o.createdAt=e.string();break;case 7:o.deletedAt=e.string();break;case 8:o.attributes=e.string();break;case 9:o.unlinkedAt=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentThreadAddedCommentDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentId=e.string();break;case 2:o.createdAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2AddCommentMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.content=e.string();break;case 3:o.documentId=e.string();break;case 4:o.commentId=e.string();break;case 5:o.createdAt=e.string();break;case 6:o.userId=e.string();break;case 7:o.attributes=e.string();break;case 8:o.commentThread=r.CommentsThreadDescriptor.decode(e,e.uint32());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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2AddCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.commentThreadId=e.string();break;case 3:o.context=e.string();break;case 4:o.createdAt=e.string();break;case 5:o.resolvedAt=e.string();break;case 6:o.resolvedBy=e.string();break;case 7:o.attributes=e.string();break;case 8:o.deletedAt=e.string();break;case 9:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ReopenCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ResolveCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=e.string();break;case 3:o.resolvedBy=e.string();break;case 4:o.resolvedAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2UpdateCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=e.string();break;case 3:o.context=e.string();break;case 4:o.attributes=e.string();break;case 5:o.unlinkedAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ConnectMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2GetCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2GetDocumentThreadsMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2RemoveCommentMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.commentId=e.string();break;case 3:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2RemoveCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2UpdateCommentMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.commentId=e.string();break;case 3:o.content=e.string();break;case 4:o.documentId=e.string();break;case 5:o.attributes=e.string();break;case 6:o.isAttributesUpdated=e.bool();break;case 7:o.commentThread=r.CommentsThreadDescriptor.decode(e,e.uint32());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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2AddCommentResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.commentId=e.string();break;case 3:o.createdAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2AddCommentThreadResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.createdAt=e.string();break;case 3:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ResolveCommentThreadResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=e.string();break;case 3:o.resolvedAt=e.string();break;case 4:o.resolvedBy=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.threads&&o.threads.length||(o.threads=[]),o.threads.push(e.string());break;case 3:o.threadsV2&&o.threadsV2.length||(o.threadsV2=[]),o.threadsV2.push(r.CommentsThreadDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2GetCommentThreadResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(e.string());break;case 3:o.commentsV2&&o.commentsV2.length||(o.commentsV2=[]),o.commentsV2.push(r.CommentDescriptor.decode(e,e.uint32()));break;case 4:o.resolvedAt=e.string();break;case 5:o.resolvedBy=e.string();break;case 6:o.context=e.string();break;case 7:o.createdAt=e.string();break;case 8:o.deletedAt=e.string();break;case 9:o.attributes=e.string();break;case 10:o.unlinkedAt=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2GetDocumentThreadsResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.threads&&o.threads.length||(o.threads=[]),o.threads.push(e.string());break;case 2:o.threadsV2&&o.threadsV2.length||(o.threadsV2=[]),o.threadsV2.push(r.CommentsThreadDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.KeyValueDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.key=e.string();break;case 2:o.value=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.IsEditorBundleUploadedMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.bundleVersion=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.IsEditorBundleUploadedResponse;e.pos<s;){var i=e.uint32();i>>>3==1?o.isUploaded=e.bool():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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.revisionId=e.string();break;case 2:o.name=e.string();break;case 3:o.creatorId=e.string();break;case 4:o.authorsIds=e.string();break;case 5:o.diffData=e.string();break;case 6:o.createdAt=e.string();break;case 7:o.attributes=e.string();break;case 8:o.toVersion=e.uint32();break;case 9:o.fromVersion=e.uint32();break;case 10:o.isEmptyCurrent=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryConnectMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryGetRevisionMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.revisionId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryReconnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.requestId=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryUpdateRevisionsMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.requestId=e.uint32();break;case 3:o.revisions&&o.revisions.length||(o.revisions=[]),o.revisions.push(r.RevisionDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.requestId=e.uint32();break;case 3:o.revisions&&o.revisions.length||(o.revisions=[]),o.revisions.push(r.RevisionDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryGetRevisionResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.revisionId=e.string();break;case 2:o.name=e.string();break;case 3:o.creatorId=e.string();break;case 4:o.authorsIds=e.string();break;case 5:o.diffData=e.string();break;case 6:o.createdAt=e.string();break;case 7:o.attributes=e.string();break;case 8:o.toVersion=e.uint32();break;case 9:o.fromVersion=e.uint32();break;case 10:o.isEmptyCurrent=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryUpdateRevisionsResponse;e.pos<s;){var i=e.uint32();i>>>3==1?o.requestId=e.uint32():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SessionsSocketDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.session=e.string();break;case 2:o.user=e.string();break;case 3:o.role=e.string();break;case 4:o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SessionsConnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.sessionType=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SocketConnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.userId=e.string();break;case 3:o.role=e.string();break;case 4:o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SocketDisconnectMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.id=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SessionsConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.sockets&&o.sockets.length||(o.sockets=[]),o.sockets.push(r.SessionsSocketDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SuggestionDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.authorId=e.string();break;case 3:o.type=e.string();break;case 4:o.createdAt=e.string();break;case 5:o.data=e.string();break;case 6:o.hasComments=e.bool();break;case 7:o.state=e.string();break;case 8:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesAddSuggestionMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.documentId=e.string();break;case 3:o.type=e.string();break;case 4:o.data=e.string();break;case 5:o.originalSuggestionId=e.string();break;case 6:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesBatchUpdateSuggestionsStateMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.ids&&o.ids.length||(o.ids=[]),o.ids.push(e.string());break;case 2:o.documentId=e.string();break;case 3:o.state=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesConnectMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesGetAllSuggestionMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesGetSuggestionMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesUpdateSuggestionMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.documentId=e.string();break;case 3:o.hasComments=e.bool();break;case 4:o.isHasCommentsModified=e.bool();break;case 5:o.state=e.string();break;case 6:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesAddSuggestionResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.authorId=e.string();break;case 3:o.type=e.string();break;case 4:o.createdAt=e.string();break;case 5:o.data=e.string();break;case 6:o.hasComments=e.bool();break;case 7:o.state=e.string();break;case 8:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.suggestions&&o.suggestions.length||(o.suggestions=[]),o.suggestions.push(e.string());break;case 3:o.suggestionsV2&&o.suggestionsV2.length||(o.suggestionsV2=[]),o.suggestionsV2.push(r.SuggestionDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesGetAllSuggestionsResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.suggestions&&o.suggestions.length||(o.suggestions=[]),o.suggestions.push(e.string());break;case 2:o.suggestionsV2&&o.suggestionsV2.length||(o.suggestionsV2=[]),o.suggestionsV2.push(r.SuggestionDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesGetSuggestionResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.authorId=e.string();break;case 3:o.type=e.string();break;case 4:o.createdAt=e.string();break;case 5:o.data=e.string();break;case 6:o.hasComments=e.bool();break;case 7:o.state=e.string();break;case 8:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.UserDescriptor;e.pos<s;){var i=e.uint32();i>>>3==1?(o.attributes&&o.attributes.length||(o.attributes=[]),o.attributes.push(r.KeyValueDescriptor.decode(e,e.uint32()))):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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetManyUsersMessage;e.pos<s;){var i=e.uint32();i>>>3==1?(o.ids&&o.ids.length||(o.ids=[]),o.ids.push(e.string())):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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetUserMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.id=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetManyUsersResponse;e.pos<s;){var i=e.uint32();i>>>3==1?(o.users&&o.users.length||(o.users=[]),o.users.push(r.UserDescriptor.decode(e,e.uint32()))):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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetUserResponse;e.pos<s;){var i=e.uint32();i>>>3==1?(o.attributes&&o.attributes.length||(o.attributes=[]),o.attributes.push(r.KeyValueDescriptor.decode(e,e.uint32()))):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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.ChannelMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.type=e.uint32();break;case 2:o.socketId=e.string();break;case 3:o.data=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.BytesBytesPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.bytes();break;case 2:o.data1=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.NumberBytesPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.uint32();break;case 2:o.data1=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.NumberNumberPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.uint32();break;case 2:o.data1=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.NumberObjectPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.uint32();break;case 2:o.data1=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.NumberStringPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.uint32();break;case 2:o.data1=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.ObjectBufferPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.ObjectObjectPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.PacketMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.type=e.uint32();break;case 2:o.id=e.uint32();break;case 3:o.nsp=e.string();break;case 4:o.data=e.bytes();break;case 5:o.options=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.PacketOptionsMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.flags=e.string();break;case 2:o.rooms&&o.rooms.length||(o.rooms=[]),o.rooms.push(e.string());break;case 3:o.except&&o.except.length||(o.except=[]),o.except.push(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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.StringBytesPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.StringNumberPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.StringObjectPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.StringStringPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=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){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,p.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringStringPacketDataMessage"},s}(),r})();class f{static decode(t,e){const n=m(e).decode("undefined"==typeof window?t:new Uint8Array(t));return e.fromJSON({...n})}static encode(t){const e=m(t.constructor),n=t.toJSON(),r=e.verify(n);if(r)throw Error(r);return e.encode(e.create(n)).finish()}}function m(t){return h[t.DESCRIPTOR_NAME]}class y extends a{constructor(t){super(),this.ids=t}toJSON(){return{ids:this.ids}}static fromJSON(t){return new y(t.ids)}}y.TYPE="22",y.READABLE_TYPE_NAME="getManyUsers",y.DESCRIPTOR_NAME="GetManyUsersMessage",y.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};const g=y;class b extends a{constructor(t){super(),this.users=t}toJSON(){return{users:this.users.map(w)}}static fromJSON(t){return new b(t.users.map(v))}}b.DESCRIPTOR_NAME="GetManyUsersResponse",b.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};const O=b;function w(t){return{attributes:Object.keys(t).map((e=>({key:e,value:JSON.stringify(t[e])})))}}function v(t){return t.attributes.reduce(((t,e)=>(t[e.key]=e.value?JSON.parse(e.value):null,t)),{})}class I{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 I(t)}static async get(t,e){const n=new d(e);try{const e=await t._sendRequest(I._SERVICE,d.TYPE,f.encode(n)),r=f.decode(e,l);return new I(r.attributes)}catch(t){return new I({id:e})}}static async getMany(t,e){const n=new g(e);try{const e=await t._sendRequest(I._SERVICE,g.TYPE,f.encode(n));return f.decode(e,O).users.map((t=>new I(t)))}catch(t){return e.map((t=>new I({id:t})))}}}I._SERVICE=2;const S=I,P=Object.create(null);P.open="0",P.close="1",P.ping="2",P.pong="3",P.message="4",P.upgrade="5",P.noop="6";const k=Object.create(null);Object.keys(P).forEach((t=>{k[P[t]]=t}));const A={type:"error",data:"parser error"},_="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),T="function"==typeof ArrayBuffer,C=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,j=({type:t,data:e},n,r)=>_&&e instanceof Blob?n?r(e):E(e,r):T&&(e instanceof ArrayBuffer||C(e))?n?r(e):E(new Blob([e]),r):r(P[t]+(e||"")),E=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+(t||""))},n.readAsDataURL(t)};function D(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let x;const R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)N[R.charCodeAt(t)]=t;const V="function"==typeof ArrayBuffer,M=(t,e)=>{if("string"!=typeof t)return{type:"message",data:U(t,e)};const n=t.charAt(0);if("b"===n)return{type:"message",data:B(t.substring(1),e)};return k[n]?t.length>1?{type:k[n],data:t.substring(1)}:{type:k[n]}:A},B=(t,e)=>{if(V){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=N[t.charCodeAt(e)],r=N[t.charCodeAt(e+1)],s=N[t.charCodeAt(e+2)],o=N[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 U(n,e)}return{base64:!0,data:t}},U=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,J=String.fromCharCode(30);function q(){return new TransformStream({transform(t,e){!function(t,e){_&&t.data instanceof Blob?t.data.arrayBuffer().then(D).then(e):T&&(t.data instanceof ArrayBuffer||C(t.data))?e(D(t.data)):j(t,!1,(t=>{x||(x=new TextEncoder),e(x.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 G;function L(t){return t.reduce(((t,e)=>t+e.length),0)}function H(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 Y(t){if(t)return function(t){for(var e in Y.prototype)t[e]=Y.prototype[e];return t}(t)}Y.prototype.on=Y.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},Y.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},Y.prototype.off=Y.prototype.removeListener=Y.prototype.removeAllListeners=Y.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},Y.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},Y.prototype.emitReserved=Y.prototype.emit,Y.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},Y.prototype.hasListeners=function(t){return!!this.listeners(t).length};const z="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function F(t,...e){return e.reduce(((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e)),{})}const K=z.setTimeout,W=z.clearTimeout;function Q(t,e){e.useNativeTimers?(t.setTimeoutFn=K.bind(z),t.clearTimeoutFn=W.bind(z)):(t.setTimeoutFn=z.setTimeout.bind(z),t.clearTimeoutFn=z.clearTimeout.bind(z))}class Z extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class $ extends Y{constructor(t){super(),this.writable=!1,Q(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,n){return super.emitReserved("error",new Z(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=M(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 X="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),tt={};let et,nt=0,rt=0;function st(t){let e="";do{e=X[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}function ot(){const t=st(+new Date);return t!==et?(nt=0,et=t):t+"."+st(nt++)}for(;rt<64;rt++)tt[X[rt]]=rt;let it=!1;try{it="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}const at=it;function ct(t){const e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||at))return new XMLHttpRequest}catch(t){}if(!e)try{return new(z[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}function dt(){}const ut=null!=new ct({xdomain:!1}).responseType;class lt extends Y{constructor(t,e){super(),Q(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=F(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;const n=this.xhr=new ct(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=lt.requestsCount++,lt.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=dt,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete lt.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(lt.requestsCount=0,lt.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",pt);else if("function"==typeof addEventListener){addEventListener("onpagehide"in z?"pagehide":"unload",pt,!1)}function pt(){for(let t in lt.requests)lt.requests.hasOwnProperty(t)&&lt.requests[t].abort()}const ht="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),ft=z.WebSocket||z.MozWebSocket,mt="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const yt={websocket:class extends ${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=mt?{}:F(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=mt?new ft(t,e,n):e?new ft(t,e):new ft(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;j(n,this.supportsBinary,(t=>{try{this.ws.send(t)}catch(t){}r&&ht((()=>{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]=ot()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}check(){return!!ft}},webtransport:class extends ${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){G||(G=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(L(n)<1)break;const t=H(n,1);o=!(128&~t[0]),s=127&t[0],r=s<126?3:126===s?1:2}else if(1===r){if(L(n)<2)break;const t=H(n,2);s=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),r=3}else if(2===r){if(L(n)<8)break;const t=H(n,8),e=new DataView(t.buffer,t.byteOffset,t.length),o=e.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(A);break}s=o*Math.pow(2,32)+e.getUint32(4),r=3}else{if(L(n)<s)break;const t=H(n,s);a.enqueue(M(o?t:G.decode(t),e)),r=0}if(0===s||s>t){a.enqueue(A);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(e).getReader(),r=q();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&&ht((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var t;null===(t=this.transport)||void 0===t||t.close()}},polling:class extends ${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=ut&&!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(J),r=[];for(let t=0;t<n.length;t++){const s=M(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)=>{j(t,!1,(t=>{r[o]=t,++s===n&&e(r.join(J))}))}))})(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]=ot()),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 lt(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}}},gt=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,bt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ot(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=gt.exec(t||""),o={},i=14;for(;i--;)o[bt[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 wt extends Y{constructor(t,e={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=Ot(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=Ot(e.host).host),Q(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 yt[t](n)}open(){let t;if(this.opts.rememberUpgrade&&wt.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;wt.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;wt.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",wt.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 n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(t+="string"==typeof(e=r)?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}(e):Math.ceil(1.33*(e.byteLength||e.size))),n>0&&t>this.maxPayload)return this.writeBuffer.slice(0,n);t+=2}var e;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){wt.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}}wt.protocol=4;wt.protocol;const vt="function"==typeof ArrayBuffer,It=Object.prototype.toString,St="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===It.call(Blob),Pt="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===It.call(File);function kt(t){return vt&&(t instanceof ArrayBuffer||(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer)(t))||St&&t instanceof Blob||Pt&&t instanceof File}function At(t,e){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let e=0,n=t.length;e<n;e++)if(At(t[e]))return!0;return!1}if(kt(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return At(t.toJSON(),!0);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&At(t[e]))return!0;return!1}function _t(t){const e=[],n=t.data,r=t;return r.data=Tt(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Tt(t,e){if(!t)return t;if(kt(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]=Tt(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]=Tt(t[r],e));return n}return t}function Ct(t,e){return t.data=jt(t.data,e),delete t.attachments,t}function jt(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]=jt(t[n],e);else if("object"==typeof t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=jt(t[n],e));return t}const Et=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Dt=5;var xt;!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"}(xt||(xt={}));class Rt{constructor(t){this.replacer=t}encode(t){return t.type!==xt.EVENT&&t.type!==xt.ACK||!At(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===xt.EVENT?xt.BINARY_EVENT:xt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==xt.BINARY_EVENT&&t.type!==xt.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=_t(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r}}function Nt(t){return"[object Object]"===Object.prototype.toString.call(t)}class Vt extends Y{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===xt.BINARY_EVENT;n||e.type===xt.BINARY_ACK?(e.type=n?xt.EVENT:xt.ACK,this.reconstructor=new Mt(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!kt(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===xt[n.type])throw new Error("unknown packet type "+n.type);if(n.type===xt.BINARY_EVENT||n.type===xt.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(!Vt.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 xt.CONNECT:return Nt(e);case xt.DISCONNECT:return void 0===e;case xt.CONNECT_ERROR:return"string"==typeof e||Nt(e);case xt.EVENT:case xt.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===Et.indexOf(e[0]));case xt.ACK:case xt.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Mt{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=Ct(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Bt(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Ut=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Jt extends Y{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=[Bt(t,"open",this.onopen.bind(this)),Bt(t,"packet",this.onpacket.bind(this)),Bt(t,"error",this.onerror.bind(this)),Bt(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(Ut.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:xt.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:xt.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 xt.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 xt.EVENT:case xt.BINARY_EVENT:this.onevent(t);break;case xt.ACK:case xt.BINARY_ACK:this.onack(t);break;case xt.DISCONNECT:this.ondisconnect();break;case xt.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:xt.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:xt.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 qt(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}qt.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)},qt.prototype.reset=function(){this.attempts=0},qt.prototype.setMin=function(t){this.ms=t},qt.prototype.setMax=function(t){this.max=t},qt.prototype.setJitter=function(t){this.jitter=t};class Gt extends Y{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,Q(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 qt({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 wt(this.uri,this.opts);const e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Bt(e,"open",(function(){n.onopen(),t&&t()})),s=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},o=Bt(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(Bt(t,"ping",this.onping.bind(this)),Bt(t,"data",this.ondata.bind(this)),Bt(t,"error",this.onerror.bind(this)),Bt(t,"close",this.onclose.bind(this)),Bt(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){ht((()=>{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 Jt(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 Lt={};function Ht(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=Ot(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=Lt[s]&&o in Lt[s].nsps;let a;return e.forceNew||e["force new connection"]||!1===e.multiplex||i?a=new Gt(r,e):(Lt[s]||(Lt[s]=new Gt(r,e)),a=Lt[s]),n.query&&!e.query&&(e.query=n.queryKey),a.socket(n.path,e)}Object.assign(Ht,{Manager:Gt,Socket:Jt,io:Ht,connect:Ht});var Yt=__webpack_require__(835);class zt extends a{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 zt(t.type,t.socketId,t.data)}}zt.DESCRIPTOR_NAME="ChannelMessage",zt.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};const Ft=zt,Kt=class extends((0,n.EmitterMixin)()){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=f.decode(t,Ft);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 Wt extends Error{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 Wt(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 Qt extends Error{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 Qt(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 a{constructor(t,e=[],n=[]){super(),this.flags=t,this.rooms=e,this.except=n}toJSON(){var t,e;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(t=this.rooms)||void 0===t?void 0:t.length)?this.rooms:void 0,except:(null===(e=this.except)||void 0===e?void 0:e.length)?this.except:void 0}}static fromJSON(t){return new Zt(t.flags&&JSON.parse(t.flags),t.rooms,t.except)}}Zt.TYPE=11,Zt.DESCRIPTOR_NAME="PacketOptionsMessage",Zt.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};const $t=Zt,Xt=(()=>!("undefined"==typeof process||!process.versions||!process.versions.node))(),te=1,ee=2,ne=3,re=4;class se{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(se.isBuffer(t))return te;const e=typeof t;return"string"===e?ee:"number"===e?ne:re}static isBuffer(t){return Xt&&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 oe extends a{static create(t,e){throw new TypeError("Must be implemented in a child class!")}}class ie extends oe{constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ie(t.data,t.data1)}static create(t,e){return new ie(t,e)}}ie.TYPE=(()=>se.getPacketType(ne,te))(),ie.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",ie.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};const ae=ie;class ce extends oe{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)}}ce.TYPE=(()=>se.getPacketType(ee,te))(),ce.DESCRIPTOR_NAME="StringBytesPacketDataMessage",ce.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};const de=ce;class ue extends oe{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)}}ue.TYPE=(()=>se.getPacketType(te,te))(),ue.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",ue.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};const le=ue;class pe extends oe{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 pe(t.data,t.data1&&JSON.parse(t.data1))}static create(t,e){return new pe(t,e)}}pe.TYPE=(()=>se.getPacketType(ee,re))(),pe.DESCRIPTOR_NAME="StringObjectPacketDataMessage",pe.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const he=pe;class fe extends oe{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 fe(t.data,t.data1&&JSON.parse(t.data1))}static create(t,e){return new fe(t,e)}}fe.TYPE=(()=>se.getPacketType(ne,re))(),fe.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",fe.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const me=fe;class ye extends oe{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 ye(t.data&&JSON.parse(t.data),t.data1&&JSON.parse(t.data1))}static create(t,e){return new ye(t,e)}}ye.TYPE=(()=>se.getPacketType(re,re))(),ye.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",ye.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const ge=ye;class be extends oe{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 be(t.data&&JSON.parse(t.data),t.data1)}static create(t,e){return new be(t,e)}}be.TYPE=(()=>se.getPacketType(re,te))(),be.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",be.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};const Oe=be;class we extends oe{constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new we(t.data,t.data1)}static create(t,e){return new we(t,e)}}we.TYPE=(()=>se.getPacketType(ee,ee))(),we.DESCRIPTOR_NAME="StringStringPacketDataMessage",we.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const ve=we;class Ie extends oe{constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new Ie(t.data,t.data1)}static create(t,e){return new Ie(t,e)}}Ie.TYPE=(()=>se.getPacketType(ee,ne))(),Ie.DESCRIPTOR_NAME="StringNumberPacketDataMessage",Ie.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};const Se=Ie;class Pe extends oe{constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new Pe(t.data,t.data1)}static create(t,e){return new Pe(t,e)}}Pe.TYPE=(()=>se.getPacketType(ne,ne))(),Pe.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",Pe.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};const ke=Pe;class Ae extends oe{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)}}Ae.TYPE=(()=>se.getPacketType(ne,ee))(),Ae.DESCRIPTOR_NAME="NumberStringPacketDataMessage",Ae.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const _e=Ae,Te=(()=>[ae,de,le,he,me,ge,Oe,ve,Se,ke,_e].reduce(((t,e)=>(t[e.TYPE]=e,t)),{}))();class Ce extends a{constructor(t,e,n,r="/",s){super(),this.type=t,this.data=e,this.id=n,this.nsp=r,this.options=null!=s?s:new $t}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=f.encode(this.options),e=f.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 Ce(t.type-10*e,f.decode(t.data,Te[e]),t.id,t.nsp,t.options?f.decode(t.options,$t):new $t)}static create(t,e={}){var n;const r=se.getPacketType(se.getType(t.data[0]),se.getType(null!==(n=t.data[1])&&void 0!==n?n:t.data[0]));return new Ce(t.type,Te[r].create(t.data[0],t.data[1]),t.id,t.nsp,new $t(e.flags,e.rooms,e.except))}}Ce.TYPE=10,Ce.DESCRIPTOR_NAME="PacketMessage",Ce.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}}};const je=Ce;class Ee{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 f.encode(je.create(o,s))}decode(t){const e=f.decode(t,je);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 De=(()=>[xt.EVENT,xt.ACK,xt.BINARY_ACK,xt.BINARY_EVENT])();class xe extends Rt{constructor(t){super(),this._packetParser=null!=t?t:new Ee}encode(t){if(De.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 Re extends Vt{constructor(t){super(),this._packetParser=null!=t?t:new Ee}add(t){if(!se.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 Ne{constructor(t,e){this._context=t,this._deferredPromise=function(){let t,e;const n=new Promise(((n,r)=>{t=n,e=r}));return{resolve:t,reject:e,promise:n}}(),this.timeout=setTimeout((()=>this.error(new Wt("Request timeout.",this._context))),e)}get promise(){return this._deferredPromise.promise}response(t){this._deferredPromise.resolve(t)}error(t){this._deferredPromise.reject(t)}}class Ve{constructor(t){this._context=t,this._requests=new Set}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 Ne(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 Me={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};class Be extends((0,n.ObservableMixin)()){constructor(t,e,n,r,s){if(super(),this._connectionAttempt=0,this._token=e,this._options=null!=n?n:{},this._connectionProvider=null!=r?r:Ht,this._userFactory=null!=s?s:S.get,this._requestsManager=new Ve(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=Yt(t.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Me.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(t,e,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==Be.STATE_CONNECTED){if(n===Be.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Wt("Not connected.",this))}else try{this.me=await this._userFactory.call(S,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(t){}}),{priority:Be._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(){var t;this.state!==Me.DISCONNECTED&&(null===(t=this._socket)||void 0===t||t.disconnect(),this._socket=void 0,this.state=Me.DISCONNECTED)}async reconnect(){this._socket||this.state!==Me.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(t,e="local.cs.dev:443/ws-v2",n={},r=Ht,s=S.get){const o=new Be(e,t,n,r,s);return await o._connect(),o}_sendRequest(t,e,n){if(!t)throw new Wt("`serviceName` must be provided.",this);if(this.state!==Be.STATE_CONNECTED)throw new Wt("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new Wt("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 Kt(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(){var t;if(this._socket)return this._socket;const e=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+e,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",s=this._connectionProvider(n,{parser:{Encoder:xe,Decoder:Re},path:r+"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:"52.6.11"},agent:null!==(t=this._options.agent)&&void 0!==t&&t,closeOnBeforeunload:!1});return this.state=Me.CONNECTING,s.on("connect",(()=>{this._debugEvent("connect"),this.socketId=s.id})),s.on("connect_error",(t=>{this._debugEvent("connect_error",t)})),s.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),s.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),s.io.on("reconnect_attempt",(t=>{this._debugEvent("reconnect_attempt",t),this.state=Me.CONNECTING,this._connectionAttempt=t})),s.on("unauthorized",(t=>{this._debugEvent("unauthorized"),this._onUnauthorized(t)})),s.on("authenticationRequest",(async t=>{this._debugEvent("authenticationRequest",t.attempt),await this._onReconnect()})),this._socket=s,s}_emit(t,e){const n=this._socket;return this._requestsManager.send((r=>{n.emit(t,e,((t,e)=>{if(t)return r.error(Qt.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=Me.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=Me.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(Wt.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",Qt.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(){var t;return!!n.global.window.localStorage&&"true"===(null!==(t=n.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==t?t:"false").toLowerCase()}}Be.STATE_DISCONNECTED=(()=>Me.DISCONNECTED)(),Be.STATE_CONNECTING=(()=>Me.CONNECTING)(),Be.STATE_CONNECTED=(()=>Me.CONNECTED)(),Be._CHANGE_STATE_EVENT_PRIORITY=(()=>n.priorities.get("highest")+999999)();const Ue=Be;class Je extends a{constructor(t){super(),this.bundleVersion=t}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(t){return new Je(t.bundleVersion)}}Je.TYPE="131",Je.READABLE_TYPE_NAME="isEditorBundleUploaded",Je.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",Je.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};const qe=Je;class Ge extends a{constructor(t){super(),this.isUploaded=t}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(t){return new Ge(t.isUploaded)}}Ge.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",Ge.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};const Le=Ge;class He extends((0,n.EmitterMixin)()){static async isBundleUploaded(t,e){const n=new qe(e);if(t.state!==Me.CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);const r=await t._sendRequest(He._SERVICE,qe.TYPE,f.encode(n));return f.decode(r,Le).isUploaded}}He._SERVICE=13;const Ye=He;class ze extends a{constructor(t,e){super(),this.documentId=t,this.revisionId=e}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(t){return new ze(t.documentId,t.revisionId)}}ze.TYPE="123",ze.READABLE_TYPE_NAME="getRevision",ze.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",ze.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};const Fe=ze;class Ke extends o{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){var e;return{revisionId:t.revisionId,name:t.name,creatorId:t.creatorId,authorsIds:t.authorsIds?JSON.stringify(t.authorsIds):void 0,diffData:t.diffData,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.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})}}Ke.DESCRIPTOR_NAME="RevisionDescriptor",Ke.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}}};const We=Ke;class Qe extends a{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 We.toJSON(this)}toObject(){return We.toObject(this)}static create(t){return new Qe(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 Qe(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)}}Qe.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",Qe.DESCRIPTOR=We.DESCRIPTOR;const Ze=Qe;class $e extends a{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(We.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(We.toObject)}}static create(t){return new $e(t.documentId,t.requestId,t.revisions.map(We.create))}static fromJSON(t){return new $e(t.documentId,t.requestId,t.revisions.map(We.fromJSON))}}$e.TYPE="124",$e.READABLE_TYPE_NAME="updateRevisions",$e.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",$e.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};const Xe=$e;class tn extends a{constructor(t){super(),this.requestId=t}toJSON(){return{requestId:this.requestId}}static fromJSON(t){return new tn(t.requestId)}}tn.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",tn.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};const en=tn;class nn extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new nn(t.documentId)}}nn.TYPE="121",nn.READABLE_TYPE_NAME="connectToRevisionHistory",nn.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",nn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const rn=nn;class sn extends a{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(We.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(We.toObject)}}static fromJSON(t){return new sn(t.channel,t.requestId,t.revisions.map(We.fromJSON))}}sn.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",sn.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};const on=sn;class an extends a{constructor(t,e){super(),this.documentId=t,this.requestId=e}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(t){return new an(t.documentId,t.requestId)}}an.TYPE="122",an.READABLE_TYPE_NAME="reconnectToRevisionHistory",an.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",an.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};const cn=an;class dn extends Wt{constructor(t,e){super(t+" Service is not connected.",e)}}class un extends((0,n.EmitterMixin)()){constructor(t){super(),this._documentId=t,this._isConnected=!1}get isConnected(){return this._isConnected}connect(t){return this._isConnected?Promise.resolve():this._connect(t,new rn(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 Wt("Cannot reconnect to already connected service.",t);return this._connect(t,new cn(this._documentId,e))}async updateRevisions(t,e){const n=Xe.create({documentId:this._documentId,requestId:e,revisions:t}),r=await this._sendRequest(Xe.TYPE,n),{requestId:s}=f.decode(r,en);return s}async getRevision(t){const e=new Fe(this._documentId,t),n=await this._sendRequest(Fe.TYPE,e);return f.decode(n,Ze).toObject()}async _connect(t,e){if(t.state!==Me.CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(12,e.constructor.TYPE,f.encode(e)),{channel:r,requestId:s,revisions:o}=f.decode(n,on).toObject();return this.listenTo(t,"change:state",((t,e,n)=>this._onWsGatewayStateChange(n)),{priority:Ue._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(un._SERVICE,e),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Xe.TYPE),((t,e)=>{const{documentId:n,requestId:r,revisions:s}=f.decode(e,Xe).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})}))}_onWsGatewayStateChange(t){t===Me.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new dn("Revision History",this);return this._wsGateway._sendRequest(12,t,f.encode(e))}}un._SERVICE=12;const ln=un;class pn extends a{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){var e;return new pn(t.id,t.documentId,t.type,JSON.parse(t.data),null!==(e=t.originalSuggestionId)&&void 0!==e?e:null,t.attributes?JSON.parse(t.attributes):null)}}pn.TYPE="101",pn.READABLE_TYPE_NAME="addSuggestion",pn.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",pn.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}}};const hn=pn;class fn extends a{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(){var t;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(t=this.createdAt)||void 0===t?void 0:t.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(t){return new fn(t.id,t.authorId,t.type,t.createdAt,t.hasComments,t.state,JSON.parse(t.data),t.attributes?JSON.parse(t.attributes):null)}}fn.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",fn.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}}};const mn=fn;class yn extends a{constructor(t,e){super(),this.id=t,this.documentId=e}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(t){return new yn(t.id,t.documentId)}}yn.TYPE="103",yn.READABLE_TYPE_NAME="getSuggestion",yn.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",yn.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};const gn=yn;class bn extends a{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 bn(t.id,t.authorId,t.type,t.createdAt,t.hasComments,t.state,JSON.parse(t.data),t.attributes?JSON.parse(t.attributes):null)}}bn.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",bn.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}}};const On=bn;class wn extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new wn(t.documentId)}}wn.TYPE="102",wn.READABLE_TYPE_NAME="getAllSuggestions",wn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",wn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const vn=wn;class In extends o{static toJSON(t){var e;return{...t,data:t.data?JSON.stringify(t.data):t.data,attributes:t.attributes?JSON.stringify(t.attributes):t.attributes,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.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}}}In.DESCRIPTOR_NAME="SuggestionDescriptor",In.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"}}};const Sn=In;class Pn extends a{constructor(t,e){super(),this._suggestions=t,this._suggestionsV2=e,this.suggestions=(null==e?void 0:e.length)?e:t}toJSON(){var t,e;return{suggestions:null===(t=this._suggestions)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),suggestionsV2:null===(e=this._suggestionsV2)||void 0===e?void 0:e.map(Sn.toJSON)}}static fromJSON(t){var e,n;return new Pn(null===(e=t.suggestions)||void 0===e?void 0:e.map(An),null===(n=t.suggestionsV2)||void 0===n?void 0:n.map(Sn.fromJSON))}}Pn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",Pn.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};const kn=Pn;function An(t){const e=JSON.parse(t);return e.createdAt=e.createdAt?new Date(e.createdAt):void 0,e}class _n extends a{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 _n(t.id,t.documentId,t.hasComments,t.isHasCommentsModified,t.state,t.attributes?JSON.parse(t.attributes):null)}}_n.TYPE="104",_n.READABLE_TYPE_NAME="updateSuggestion",_n.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",_n.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}}};const Tn=_n;class Cn extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new Cn(t.documentId)}}Cn.TYPE="105",Cn.READABLE_TYPE_NAME="connectToSuggestions",Cn.DESCRIPTOR_NAME="TrackChangesConnectMessage",Cn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const jn=Cn;class En extends a{constructor(t,e,n){super(),this.channel=t,this._suggestions=e,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:e}toJSON(){var t,e;return{channel:this.channel,suggestions:null===(t=this._suggestions)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),suggestionsV2:null===(e=this._suggestionsV2)||void 0===e?void 0:e.map(Sn.toJSON)}}static fromJSON(t){var e,n;return new En(t.channel,null===(e=t.suggestions)||void 0===e?void 0:e.map((t=>JSON.parse(t))),null===(n=t.suggestionsV2)||void 0===n?void 0:n.map(Sn.fromJSON))}}En.DESCRIPTOR_NAME="TrackChangesConnectResponse",En.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};const Dn=En;class xn extends a{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 xn(t.ids,t.documentId,t.state)}}xn.TYPE="106",xn.READABLE_TYPE_NAME="batchUpdateSuggestionsState",xn.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",xn.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};const Rn=xn;class Nn extends((0,n.EmitterMixin)()){constructor(t){super(),this._documentId=t,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(t){if(this._isConnected)return;if(t.state!==Me.CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);const e=new jn(this._documentId);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(10,jn.TYPE,f.encode(e)),r=f.decode(n,Dn);return this.listenTo(t,"change:state",((t,e,n)=>this._onWsGatewayStateChange(n)),{priority:Ue._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 hn(t,this._documentId,e,n,r,s),i=await this._sendRequest(hn.TYPE,o);return f.decode(i,mn)}async get(t,e=1){const n=new gn(t,this._documentId);try{const t=await this._sendRequest(gn.TYPE,n);return f.decode(t,On)}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 Qt.fromPublicError(n)}var r}async getAll(){const t=new vn(this._documentId),e=await this._sendRequest(vn.TYPE,t),{suggestions:n}=f.decode(e,kn);return n}async update(t,e={}){const{hasComments:n,state:r,attributes:s}=e,o=void 0!==n,i=new Tn(t,this._documentId,n,o,r,s);await this._sendRequest(Tn.TYPE,i)}async batchUpdateState(t){const e=new Rn(t.ids,this._documentId,t.state);await this._sendRequest(Rn.TYPE,e)}_connectToChannel(t,e){this._channel=t._getChannel(Nn._SERVICE,e),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Tn.TYPE),((t,e)=>{const n=f.decode(e,Tn);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(t){t===Me.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new dn("Track Changes",this);return this._wsGateway._sendRequest(10,t,f.encode(e))}}Nn._SERVICE=10;const Vn=Nn,Mn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Bn;const Un=new Uint8Array(16);function Jn(){if(!Bn&&(Bn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bn(Un)}const qn=[];for(let t=0;t<256;++t)qn.push((t+256).toString(16).slice(1));function Gn(t,e=0){return qn[t[e+0]]+qn[t[e+1]]+qn[t[e+2]]+qn[t[e+3]]+"-"+qn[t[e+4]]+qn[t[e+5]]+"-"+qn[t[e+6]]+qn[t[e+7]]+"-"+qn[t[e+8]]+qn[t[e+9]]+"-"+qn[t[e+10]]+qn[t[e+11]]+qn[t[e+12]]+qn[t[e+13]]+qn[t[e+14]]+qn[t[e+15]]}const Ln=function(t,e,n){if(Mn.randomUUID&&!e&&!t)return Mn.randomUUID();const r=(t=t||{}).random||(t.rng||Jn)();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 Gn(r)};class Hn extends a{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 Hn(t.channel,t.sockets.map((t=>({id:t.session,userId:t.user,role:t.role,permissions:t.permissions}))))}}Hn.DESCRIPTOR_NAME="SessionsConnectResponse",Hn.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};const Yn=Hn;class zn extends a{constructor(t,e){super(),this.id=t,this.sessionType=e}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(t){return new zn(t.id,t.sessionType)}}zn.TYPE="31",zn.READABLE_TYPE_NAME="getConnectedSockets",zn.DESCRIPTOR_NAME="SessionsConnectMessage",zn.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};const Fn=zn;class Kn extends a{constructor(t,e,n,r){super(),this.id=t,this.userId=e,this.role=n,this.permissions=r}toJSON(){var t,e,n;return{id:this.id,userId:null!==(t=this.userId)&&void 0!==t?t:void 0,role:null!==(e=this.role)&&void 0!==e?e:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(t){return new Kn(t.id,t.userId,t.role,t.permissions)}}Kn.TYPE="32",Kn.READABLE_TYPE_NAME="connectSocket",Kn.DESCRIPTOR_NAME="SocketConnectMessage",Kn.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};const Wn=Kn;class Qn extends a{constructor(t){super(),this.id=t}toJSON(){return{id:this.id}}static fromJSON(t){return new Qn(t.id)}}Qn.TYPE="33",Qn.READABLE_TYPE_NAME="disconnectSocket",Qn.DESCRIPTOR_NAME="SocketDisconnectMessage",Qn.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const Zn=Qn,$n=class extends n.Collection{constructor(t,e){super({idProperty:"id"}),this._id=t,this._sessionType=e,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(t){this._wsGateway=t,this.stopListening(t,"change:state");const e=new Fn(this._id,this._sessionType);let n;try{const t=await this._wsGateway._sendRequest(3,Fn.TYPE,f.encode(e));n=f.decode(t,Yn)}catch(t){n=new Yn(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 S.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 S,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:Ue._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,Wn.TYPE,(async e=>{const n=f.decode(e,Wn);if(-1===this.getIndex(n.id)){const e={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(e.user=await S.get(t,n.userId)),super.add(e)}})),this._addHandler(this._channel,Zn.TYPE,(t=>{const e=f.decode(t,Zn);-1!==this.getIndex(e.id)&&super.remove(e.id)})))}async _onWsGatewayStateChange(t){t===Ue.STATE_DISCONNECTED&&this.disconnect(!1),t===Ue.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 Xn{static async getConnectedSessions(t,e,n){const r=new $n(e,n);return await r.connect(t),r}}class tr extends a{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 tr(t.id,t.buffers,t.types,t.bundleVersion,t.lastOperationId)}}tr.TYPE="11",tr.READABLE_TYPE_NAME="connectToDocument",tr.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",tr.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}}};const er=tr;class nr{static prepareMetadataForOperations(t,e){if(!(t&&t.length&&e&&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&&t.length&&e&&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 rr extends o{static toJSON({createdAt:t,...e}){const n={...e};return(null==t?void 0:t.toISOString)&&(n.createdAt=t.toISOString()),n}static fromJSON({createdAt:t,...e}){const n={...e};return t&&(n.createdAt=new Date(t)),n}}rr.DESCRIPTOR_NAME="OperationMetadataDescriptor",rr.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};const sr=rr;class or extends a{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:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(t){return new or(t.id,t.buffers,t.types,t.baseVersion,nr.prepareMetadataForOperations(t.types,t.metadata).map(sr.fromJSON),t.lastOperationId)}}or.TYPE="13",or.READABLE_TYPE_NAME="updateDocument",or.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",or.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}}};const ir=or;class ar extends a{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 ar(t.id,t.lastKnowVersion,t.bundleVersion)}}ar.TYPE="12",ar.READABLE_TYPE_NAME="reconnectToDocument",ar.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",ar.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};const cr=ar;class dr extends a{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(){var t;return!(null===(t=this.types)||void 0===t?void 0:t.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(t){return new dr(t.version,t.buffers,t.types,nr.prepareMetadataForOperations(t.types,t.metadata).map(sr.fromJSON),t.lastOperationId,t.lastOperationAcceptedAt?new Date(t.lastOperationAcceptedAt):null)}static create(t){return new dr(t.version,t.buffers,t.types,t.metadata,t.lastOperationId,t.lastOperationAcceptedAt?new Date(t.lastOperationAcceptedAt):null)}}dr.DESCRIPTOR_NAME="CollaborativeEditingResponse",dr.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}}};const ur=dr;class lr extends a{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(){var t;return!(null===(t=this.types)||void 0===t?void 0:t.length)&&null===this.initData}toJSON(){var t;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),initData:null!==(t=this.initData)&&void 0!==t?t:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(t){return new lr(t.channel,t.version,t.buffers,t.types,t.offset,t.metadata,t.initData,t.sessionId,t.lastOperationId,t.sessionCreatedAt)}static fromJSON(t){var e;let n=null;return!0===t.isInitialized?n=null!==(e=t.initData)&&void 0!==e?e:"":"boolean"!=typeof t.isInitialized&&t.initData&&(n=t.initData),lr.create({channel:t.channel,version:t.version,buffers:t.buffers,types:t.types,offset:t.offset,metadata:nr.prepareMetadataForOperations(t.types,t.metadata).map(sr.fromJSON),initData:n,sessionId:t.sessionId,lastOperationId:t.lastOperationId,sessionCreatedAt:t.sessionCreatedAt?new Date(t.sessionCreatedAt):null})}}lr.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",lr.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:sr.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}}};const pr=lr;class hr extends a{constructor(t,e){super(),this.lastDocumentSession=t,this.currentDocumentSession=e}get data(){var t,e,n,r,s;return{lastDocumentSessionId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.id,lastDocumentSessionOperationId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}toJSON(){var t,e,n,r,s;return{lastDocumentSessionId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.id,lastDocumentSessionOperationId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.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 hr(e,n)}}hr.DESCRIPTOR_NAME="GetDocumentDetailsResponse",hr.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}}};const fr=hr;class mr extends a{constructor(t){super(),this.documentId=t}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new mr(t.documentId)}}mr.TYPE="14",mr.READABLE_TYPE_NAME="getDocumentDetails",mr.DESCRIPTOR_NAME="GetDocumentDetailsMessage",mr.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};const yr=mr;class gr extends((0,n.EmitterMixin)()){constructor(t,e){if(super(),!t)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=e?e:Ln(),this._isConnected=!1,this._bundleVersion=t}getId(){return this._id}isConnected(){return this._isConnected}connect(t,e={buffers:[],types:[]},n){const r=new er(this.getId(),e.buffers,e.types,this._bundleVersion,n);return this._connect(t,r)}reconnect(t,e){if(this.isConnected())throw new Wt("Cannot reconnect to already connected service.",t);return this._connect(t,new cr(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 yr(this.getId());if(!this._wsGateway)throw new dn("Collaborative Editing",this);const e=await this._wsGateway._sendRequest(1,yr.TYPE,f.encode(t));return f.decode(e,fr)}async sendOperations(t,e,n){if(!t||!t.types||!t.types.length)throw new Wt("Cannot send empty update.",this._wsGateway);const r="number"==typeof e?e:parseInt(e);if(!Number.isInteger(r)||r<0)throw new Wt("Base version not provided.",this._wsGateway);const s=new ir(this.getId(),t.buffers,t.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new dn("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,ir.TYPE,f.encode(s));return f.decode(o,ur)}async getConnectedSessions(){if(!this._isConnected)throw new dn("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await Xn.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(t,e){return Xn.getConnectedSessions(t,e,1)}async _connect(t,e){if(this.isConnected())return;if(t.state!==Ue.STATE_CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(1,e.constructor.TYPE,f.encode(e)),r=f.decode(n,pr);return this.listenTo(t,"change:state",((t,e,n)=>this._onWsGatewayStateChange(n)),{priority:Ue._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(ir.TYPE),((t,e)=>{const n=f.decode(e,ir);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(t){t===Ue.STATE_DISCONNECTED&&this.disconnect()}}gr._SERVICE=1;const br=gr;class Or extends o{static toJSON(t){var e;return{...t,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.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}}}Or.DESCRIPTOR_NAME="CommentDescriptor",Or.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"}}};const wr=Or;class vr extends o{static toJSON(t){var e,n,r,s,o;return{...t,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.toISOString(),deletedAt:null===(n=t.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=t.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:t.attributes?JSON.stringify(t.attributes):null,context:t.context?JSON.stringify(t.context):t.context,comments:null===(s=t.comments)||void 0===s?void 0:s.map(wr.toJSON),unlinkedAt:null===(o=t.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(t){var e;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:null===(e=t.comments)||void 0===e?void 0:e.map(wr.fromJSON),unlinkedAt:t.unlinkedAt?new Date(t.unlinkedAt):void 0}}}vr.DESCRIPTOR_NAME="CommentsThreadDescriptor",vr.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}}};const Ir=vr;class Sr extends a{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?Ir.toJSON(this.commentThread):void 0}}static fromJSON(t){return new Sr(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?Ir.fromJSON(t.commentThread):void 0)}}Sr.TYPE="91",Sr.READABLE_TYPE_NAME="addComment",Sr.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",Sr.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}}};const Pr=Sr;class kr extends a{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 kr(t.commentThreadId,t.commentId,t.createdAt)}}kr.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",kr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};const Ar=kr;class _r extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new _r(t.documentId)}}_r.TYPE="92",_r.READABLE_TYPE_NAME="connectToComment",_r.DESCRIPTOR_NAME="CommentsV2ConnectMessage",_r.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const Tr=_r;class Cr extends a{constructor(t,e,n){super(),this.channel=t,this._threads=e,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:e}toJSON(){var t,e;return{channel:this.channel,threads:null===(t=this._threads)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),threadsV2:null===(e=this._threadsV2)||void 0===e?void 0:e.map(Ir.toJSON)}}static fromJSON(t){var e,n;return new Cr(t.channel,null===(e=t.threads)||void 0===e?void 0:e.map((t=>JSON.parse(t))),null===(n=t.threadsV2)||void 0===n?void 0:n.map(Ir.fromJSON))}}Cr.DESCRIPTOR_NAME="CommentsV2ConnectResponse",Cr.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};const jr=Cr;class Er extends a{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 Er(t.documentId,t.commentThreadId,t.commentId)}}Er.TYPE="95",Er.READABLE_TYPE_NAME="removeComment",Er.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",Er.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};const Dr=Er;class xr extends a{constructor(t,e){super(),this.documentId=t,this.commentThreadId=e}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(t){return new xr(t.documentId,t.commentThreadId)}}xr.TYPE="97",xr.READABLE_TYPE_NAME="removeCommentThread",xr.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",xr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const Rr=xr;class Nr extends a{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?Ir.toJSON(this.commentThread):void 0}}static fromJSON(t){return new Nr(t.documentId,t.commentThreadId,t.commentId,t.content,t.attributes?JSON.parse(t.attributes):null,t.isAttributesUpdated,t.commentThread?Ir.fromJSON(t.commentThread):void 0)}}Nr.TYPE="96",Nr.READABLE_TYPE_NAME="updateComment",Nr.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",Nr.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}}};const Vr=Nr;class Mr extends a{constructor(t,e){super(),this.commentThreadId=t,this.documentId=e}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(t){return new Mr(t.commentThreadId,t.documentId)}}Mr.TYPE="93",Mr.READABLE_TYPE_NAME="getComment",Mr.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",Mr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const Br=Mr;class Ur extends a{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=(null==n?void 0: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(){var t,e,n,r,s,o;return{commentThreadId:this.commentThreadId,comments:null===(t=this._comments)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),commentsV2:null===(e=this._commentsV2)||void 0===e?void 0:e.map(wr.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:null===(n=this.createdAt)||void 0===n?void 0:n.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(s=this.resolvedAt)||void 0===s?void 0:s.toISOString(),unlinkedAt:null===(o=this.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(t){var e,n;return new Ur(t.commentThreadId,null===(e=t.comments)||void 0===e?void 0:e.map((t=>function(t){const e=JSON.parse(t);return{...e,createdAt:new Date(e.createdAt)}}(t))),null===(n=t.commentsV2)||void 0===n?void 0:n.map(wr.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)}}Ur.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",Ur.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}}};const Jr=Ur;class qr extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new qr(t.documentId)}}qr.TYPE="94",qr.READABLE_TYPE_NAME="getDocumentThreads",qr.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",qr.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const Gr=qr;class Lr extends a{constructor(t,e){super(),this._threads=t,this._threadsV2=e,this.threads=(null==e?void 0:e.length)?e:t}toJSON(){var t,e;return{threads:null===(t=this._threads)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),threadsV2:null===(e=this._threadsV2)||void 0===e?void 0:e.map(Ir.toJSON)}}static fromJSON(t){var e,n;return new Lr(null===(e=t.threads)||void 0===e?void 0:e.map((t=>function(t){var e;const n=JSON.parse(t),r={...n};return n.comments&&(r.comments=null===(e=n.comments)||void 0===e?void 0:e.map((t=>({...t,createdAt:new Date(t.createdAt)})))),r}(t))),null===(n=t.threadsV2)||void 0===n?void 0:n.map(Ir.fromJSON))}}Lr.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",Lr.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};const Hr=Lr;class Yr extends o{static toJSON(t){var e;return{commentId:t.commentId,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(t){return{commentId:t.commentId,createdAt:new Date(t.createdAt)}}}Yr.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",Yr.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};const zr=Yr;class Fr extends a{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=>zr.toJSON(t)))}}static fromJSON(t){return new Fr(t.commentThreadId,t.createdAt,t.comments.map((t=>zr.fromJSON(t))))}}Fr.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",Fr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};const Kr=Fr;class Wr extends a{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(){var t;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(t=this.comments)||void 0===t?void 0:t.map((t=>wr.toJSON(t)))}}static fromJSON(t){var e;return new Wr(t.documentId,t.commentThreadId,null===(e=t.comments)||void 0===e?void 0:e.map((e=>wr.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)}}Wr.TYPE="140",Wr.READABLE_TYPE_NAME="addCommentThread",Wr.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",Wr.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}}};const Qr=Wr;class Zr extends a{constructor(t,e,n,r){super(),this.commentThreadId=t,this.documentId=e,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var t;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(t=this.resolvedAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(t){return new Zr(t.commentThreadId,t.documentId,t.resolvedBy,t.resolvedAt)}}Zr.TYPE="142",Zr.READABLE_TYPE_NAME="resolveCommentThread",Zr.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",Zr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};const $r=Zr;class Xr extends a{constructor(t,e){super(),this.commentThreadId=t,this.documentId=e}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(t){return new Xr(t.commentThreadId,t.documentId)}}Xr.TYPE="141",Xr.READABLE_TYPE_NAME="reopenCommentThread",Xr.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",Xr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const ts=Xr;class es extends a{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 es(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)}}es.TYPE="143",es.READABLE_TYPE_NAME="updateCommentThread",es.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",es.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}}};const ns=es;class rs extends a{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 rs(t.commentThreadId,t.documentId,t.resolvedBy,t.resolvedAt)}}rs.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",rs.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};const ss=rs;class os extends((0,n.EmitterMixin)()){constructor(t){super(),this._documentId=t,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(t){if(this._isConnected)return;if(t.state!==Me.CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);const e=new Tr(this._documentId);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(9,Tr.TYPE,f.encode(e)),{channel:r,threads:s}=f.decode(n,jr);return this.listenTo(t,"change:state",((t,e,n)=>this._onWsGatewayStateChange(n)),{priority:Ue._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 Pr(this._documentId,t,n,e,void 0,void 0,r),o=await this._sendRequest(Pr.TYPE,s);return f.decode(o,Ar)}async updateComment(t,e,n,r){const s=void 0!==r,o=new Vr(this._documentId,t,e,n,r,s);await this._sendRequest(Vr.TYPE,o)}async removeComment(t,e){const n=new Dr(this._documentId,t,e);await this._sendRequest(Dr.TYPE,n)}async removeCommentThread(t){const e=new Rr(this._documentId,t);await this._sendRequest(Rr.TYPE,e)}async addCommentThread(t){var e;const n=new Qr(this._documentId,t.commentThreadId,null===(e=t.comments)||void 0===e?void 0:e.map((e=>({...e,documentId:this._documentId,commentThreadId:t.commentThreadId}))),t.context,t.resolvedBy,t.createdAt,t.resolvedAt,t.deletedAt,t.attributes),r=await this._sendRequest(Qr.TYPE,n);return f.decode(r,Kr)}async resolveCommentThread(t){const e=new $r(t,this._documentId),n=await this._sendRequest($r.TYPE,e);return f.decode(n,ss)}async reopenCommentThread(t){const e=new ts(t,this._documentId);await this._sendRequest(ts.TYPE,e)}async updateCommentThread(t){const e=new ns(t.commentThreadId,this._documentId,t.context,t.attributes,t.unlinkedAt);await this._sendRequest(ns.TYPE,e)}async getCommentThread(t,e=1){const n=new Br(t,this._documentId);try{const t=await this._sendRequest(Br.TYPE,n),e=f.decode(t,Jr);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 Qt.fromPublicError(n)}var r}async getDocumentThreads(){const t=new Gr(this._documentId),e=await this._sendRequest(Gr.TYPE,t),{threads:n}=f.decode(e,Hr);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new dn("Comments",this);return this._connectedSessions||(this._connectedSessions=await Xn.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(t,e){this._channel=t._getChannel(os._SERVICE,e),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Pr.TYPE),((t,e)=>{const n=f.decode(e,Pr);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(Dr.TYPE),((t,e)=>{const n=f.decode(e,Dr);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(Vr.TYPE),((t,e)=>{const n=f.decode(e,Vr);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Rr.TYPE),((t,e)=>{const n=f.decode(e,Rr);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(Qr.TYPE),((t,e)=>{const n=f.decode(e,Qr);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(ns.TYPE),((t,e)=>{const n=f.decode(e,ns);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName($r.TYPE),((t,e)=>{const n=f.decode(e,$r);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(ts.TYPE),((t,e)=>{const n=f.decode(e,ts);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(t){t===Me.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new dn("Comments",this);return this._wsGateway._sendRequest(9,t,f.encode(e))}}os._SERVICE=9;const is=os,as=us;!function(t){const e=us,n=t();for(;;)try{if(442011===-parseInt(e(351))/1*(parseInt(e(363))/2)+parseInt(e(352))/3+parseInt(e(324))/4*(parseInt(e(332))/5)+parseInt(e(328))/6*(-parseInt(e(319))/7)+-parseInt(e(294))/8+parseInt(e(306))/9+-parseInt(e(314))/10*(-parseInt(e(347))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(ds);class cs extends e.ContextPlugin{static get[as(293)](){return[as(307),r.Notification]}static get[as(362)](){return as(357)}static get[as(349)](){return!0}static get[as(308)](){return!0}constructor(t){const e=as;super(t),this[e(291)](e(305),Me[e(315)]),this[e(291)](e(340),!1),this[e(350)]=new Set,this[e(297)]=!1,this[e(335)]=Object[e(309)](n.DomEmitterMixin)}[as(336)](){const t=as,e=this[t(325)],s=e[t(355)][t(304)](t(307)),o=e[t(355)][t(304)](r.Notification);if(!s[t(338)])throw new n.CKEditorError(t(364),this);if(!s[t(313)])throw new n.CKEditorError(t(361),this);return this[t(335)][t(312)](window,t(322),(()=>this[t(340)]=!0)),this[t(335)][t(312)](window,t(316),(()=>this[t(340)]=!1)),this[t(325)][t(289)][t(329)](t(302),10),this[t(325)][t(289)][t(329)](t(358),20),cs[t(357)][t(301)](s[t(338)],s[t(313)],{timeout:1e3*this[t(325)][t(289)][t(304)](t(302)),requestTimeout:1e3*this[t(325)][t(289)][t(304)](t(358))})[t(295)]((e=>{const r=t;if(this[r(330)]=e,this[r(345)](r(305)).to(e,r(305),this,r(340),((t,e)=>(r(298)!==t&&(this[r(297)]=!0),e||t!==Me[r(315)]?Me[r(342)]:this[r(305)]==Me[r(342)]&&this[r(297)]?(this[r(297)]=!1,this[r(348)](),Me[r(343)]):Me[r(315)]))),this[r(330)].on(r(331),((t,e)=>{const s=r;if(s(299)!==e[s(346)])throw console[s(331)](e),new n.CKEditorError(s(321),null,{originalError:e});o[s(360)](s(354),{title:s(337),namespace:s(326)})})),!e.me)return new Promise((t=>e.on(r(341),t)))}))[t(310)]((e=>{const r=t;throw console[r(331)](e),new n.CKEditorError(r(321),null,{originalError:e})}))}[as(327)](t){const e=as;if(e(333)!=typeof t[e(320)])throw new n.CKEditorError(e(292),this);if(this[e(317)](t))throw new n.CKEditorError(e(318),this,{name:t[e(300)][e(362)]});this[e(350)][e(353)](t)}[as(303)](t){const e=as;this[e(350)][e(296)](t)}[as(317)](t){const e=as;return this[e(350)][e(290)](t)}[as(348)](){const t=as;return this[t(330)][t(320)]()[t(295)]((()=>Promise[t(339)](Array[t(323)](this[t(350)],(e=>e[t(320)]())))))[t(295)]((()=>this[t(305)]=Me[t(315)]))[t(310)]((e=>{const r=t;throw console[r(331)](e),new n.CKEditorError(r(359),this[r(325)])}))}[as(356)](){const t=as;this[t(330)]&&this[t(330)][t(356)](),this[t(305)]=Me[t(342)],this[t(335)][t(344)]()}[as(334)](){const t=as;this[t(356)](),super[t(334)]()}}function ds(){const t=["all","_isBrowserOffline","change:me","DISCONNECTED","CONNECTING","stopListening","bind","code","106425YPyLvA","_reconnect","isOfficialPlugin","_reconnectionStack","3WlDsLy","2468679LUtkRw","add","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.","plugins","disconnect","WebSocketGateway","cloudServices.requestTimeout","cloudservices-reconnection-error","showWarning","websocketgateway-missing-websocket-url","pluginName","188886WmdWSY","websocketgateway-missing-token","config","has","set","websocketgateway-invalid-plugin-interface","requires","6567216Yspdyh","then","delete","_shouldPluginsReconnect","connected","limitExceeded","constructor","connect","cloudServices.connectionTimeout","removeFromReconnectionStack","get","state","1278036UxXqyI","CloudServices","isPremiumPlugin","create","catch","initialReconnectionInterval","listenTo","webSocketUrl","1180KcJbWJ","CONNECTED","online","isInReconnectionStack","websocketgateway-plugin-already-registered","7KqHBbt","reconnect","cloudservices-init","offline","from","2924pqBqlt","context","real-time-collaboration","addToReconnectionStack","4032888JMvWVg","define","connection","error","765LjQEoF","function","destroy","_domEmitter","init","Connected users limit exceeded","token"];return(ds=function(){return t})()}function us(t,e){const n=ds();return(us=function(t,e){return n[t-=289]})(t,e)}cs[as(357)]=Ue,cs[as(311)]=1e3;const ls=cs;var ps=__webpack_require__(211);function hs(t,e){const n=fs();return(hs=function(t,e){return n[t-=201]})(t,e)}function fs(){const t=["user","84JgYglH","_handleSessionAdd","23219417NSsfGZ","get","_uniqueUsersCount","context","values","mySessionId","fire","1471128libsBi","getUserRole","sessionAdd:","plugins","addUser","getUserBySessionId","channelSessions","isPremiumPlugin","init","sessionId","isOfficialPlugin","165678UheKJk","has","assign","4247244ByOQsg","unregister","remove","getUserSessions","11704tBqCTf","sessions-unregister-not-exist","pluginName","allConnectedUsers","getUser","_users","register","38nVVNMo","connection","1393nWmzFi","add","state","sessions-register-already-registered","size","connected","stopListening","listenTo","12mECNbu","5fLSRoQ","Sessions","channelConnectedUsers","role","_createUser","_registeredSessions","set","17009jWJnUK","change:state","orderNumber","30MZBimT","isMe","forEach","delete","_handleSessionRemove","clear","defineMe","requires","11819170MfZtAz"];return(fs=function(){return t})()}const ms=hs;!function(t){const e=hs,n=t();for(;;)try{if(824757===-parseInt(e(215))/1*(-parseInt(e(262))/2)+parseInt(e(248))/3*(parseInt(e(228))/4)+-parseInt(e(208))/5*(parseInt(e(237))/6)+-parseInt(e(264))/7*(-parseInt(e(255))/8)+-parseInt(e(251))/9*(parseInt(e(218))/10)+-parseInt(e(226))/11+parseInt(e(207))/12*(parseInt(e(230))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(fs);class ys extends e.ContextPlugin{static get[ms(257)](){return ms(209)}static get[ms(247)](){return!0}static get[ms(244)](){return!0}static get[ms(225)](){return[ls,ps.Users]}constructor(t){const e=ms;super(t),this[e(243)]=new Map,this[e(210)]=new Map,this[e(258)]=new n.Collection,this[e(213)]=new Map,this[e(232)]=0,this[e(260)]=this[e(233)][e(240)][e(231)](ps.Users)}[ms(245)](){const t=ms,e=this[t(233)][t(240)][t(231)](ls);this[t(206)](e,t(216),((e,n,r)=>{const s=t;if(s(204)!==r)this[s(243)][s(220)]((t=>t[s(223)]())),this[s(210)][s(220)]((t=>t[s(223)]())),this[s(258)][s(223)]();else for(const[t,e]of this[s(213)])for(const n of e)this[s(229)](t,n)})),this[t(212)](e[t(263)].me,!0)}[ms(261)](t,e){const r=ms;if(this[r(213)][r(249)](t))throw new n.CKEditorError(r(202),null,{channelId:t});this[r(213)][r(214)](t,e),this[r(243)][r(214)](t,new n.Collection),this[r(210)][r(214)](t,new n.Collection),this[r(206)](e,r(265),((e,n)=>this[r(229)](t,n))),this[r(206)](e,r(253),((e,n)=>this[r(222)](t,n)));for(const n of e)this[r(229)](t,n)}[ms(252)](t){const e=ms;if(!this[e(213)][e(249)](t))throw new n.CKEditorError(e(256),null,{channelId:t});const r=this[e(213)][e(231)](t);this[e(205)](r);for(const n of r)e(204)===this[e(233)][e(240)][e(231)](ls)[e(201)]&&this[e(222)](t,n);this[e(213)][e(221)](t),this[e(243)][e(221)](t),this[e(210)][e(221)](t)}get[ms(235)](){const t=ms;return this[t(233)][t(240)][t(231)](ls)[t(263)][t(246)]}[ms(242)](t){const e=ms;for(const n of this[e(243)][e(234)]())for(const r of n)if(r.id===t)return r[e(227)]}[ms(254)](t,e){const n=ms,r=e?[this[n(243)][n(231)](e)]:this[n(243)][n(234)](),s=new Set;for(const e of r)for(const r of e)r[n(227)].id===t.id&&s[n(265)](r.id);return s}[ms(238)](t){const e=ms;for(const n of this[e(243)][e(234)]())for(const r of n)if(r[e(227)]===t)return r[e(211)]}[ms(229)](t,e){const n=ms;if(n(204)!==this[n(233)][n(240)][n(231)](ls)[n(201)])return;const r=e[n(227)],s=this[n(260)][n(259)](r.id)||this[n(212)](r),o=Object[n(250)]({},e,{user:s});this[n(243)][n(231)](t)[n(265)](o);const i=this[n(210)][n(231)](t);i[n(249)](s.id)||i[n(265)](s),this[n(258)][n(249)](s.id)||this[n(258)][n(265)](s,s[n(219)]?0:void 0),this[n(236)](n(239)+t,{channelId:t,session:o})}[ms(222)](t,e){const n=ms;if(n(204)!==this[n(233)][n(240)][n(231)](ls)[n(201)])return;const r=this[n(210)][n(231)](t),s=e[n(227)];s.id&&(this[n(243)][n(231)](t)[n(253)](e.id),r[n(249)](s.id)&&!this[n(254)](s,t)[n(203)]&&r[n(253)](s.id),this[n(258)][n(231)](s.id)&&!this[n(254)](s)[n(203)]&&this[n(258)][n(253)](s.id))}[ms(212)](t,e){const n=ms,r=this[n(260)][n(241)](t);return e&&this[n(260)][n(224)](t.id),r[n(217)]=this[n(232)]++,r}}var gs=__webpack_require__(673),bs=__webpack_require__.n(gs),Os=__webpack_require__(545),ws=__webpack_require__.n(Os),vs=__webpack_require__(262),Is=__webpack_require__.n(vs),Ss=__webpack_require__(667),Ps=__webpack_require__.n(Ss),ks=__webpack_require__(357),As=__webpack_require__.n(ks),_s=__webpack_require__(535),Ts={attributes:{"data-cke":!0}};Ts.setAttributes=Ps(),Ts.insert=Is().bind(null,"head"),Ts.domAPI=ws(),Ts.insertStyleElement=As();bs()(_s.A,Ts);_s.A&&_s.A.locals&&_s.A.locals;function Cs(){const t=["conversion","getMarkerClass","nodeAfter","mouseleave","span","applyOperation","4741500ucZBWO","$graveyard","8QmqYSU","mouseenter","Escape","contenteditable","removeClass","14vnDurP","editingDowncast","UserMarkers","ck-user__marker_hovered","render","2fagwnZ","spellcheck","add","plugins","has","addEventListener","isCollapsed","data-session-id","checkChild","getUserBySessionId","getFirstRange","ck-user__marker ","schema","detach","parent","markerRange","5611859etTfKT","markerToHighlight","getAttribute","tableCell","ck-user__marker-tooltip","getRange","editing","mySessionId","newRange","pluginName","user:position:","ck-user__selection","undo","afterInit","1782174IqnImU","user:range","markers","size","552737dVBRMN","3891312dKpOqx","end","markerName","requires","fromRange","hasDomSelection","_domEmitter","36DsqiAW","view","isInline","oldRange","stopListening","marker","enqueueChange","orderNumber","color",'⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>',"keydown","set","toRange","deletionPosition","getContainedElement","split","getCustomProperty","getStart","hasContent","delete","innerHTML","startsWith","document","getSelectionClass","isPremiumPlugin","change:range","listenTo","markerNameToElements","user:","updateMarker","rootName","init","isSimilar","outerHTML","isLimit","classList","destroy","highest","1976540HEHNlE","addMarker","false","reconvertMarker","isOfficialPlugin","type","get","name","for","1003065tKrnSK","setCustomProperty","createUIElement","isObject","textContent","$text","createElement","markerToElement","createRange","toDomElement","root","commands","selection","getNearestSelectionRange","getPositions","mapper","update:user:range","model","batch","user:range:","start","9ckjumD","isDocumentOperation","userPositionMarker","setAttribute","element","_createdBatches","editor","createUserMarkerOperations","removeMarker","user:position","change","clear","remove"];return(Cs=function(){return t})()}const js=Ds;!function(t){const e=Ds,n=t();for(;;)try{if(548119===parseInt(e(583))/1*(-parseInt(e(549))/2)+parseInt(e(497))/3+parseInt(e(539))/4*(parseInt(e(488))/5)+parseInt(e(579))/6*(-parseInt(e(544))/7)+parseInt(e(584))/8*(-parseInt(e(518))/9)+-parseInt(e(537))/10+-parseInt(e(565))/11*(-parseInt(e(591))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Cs);class Es extends e.Plugin{constructor(){const t=Ds;super(...arguments),this[t(590)]=new((0,n.DomEmitterMixin)())}static get[js(587)](){return[ys]}static get[js(574)](){return js(546)}static get[js(492)](){return!0}static get[js(474)](){return!0}[js(481)](){const t=js,e=this[t(524)],r=e[t(552)][t(494)](ys);e[t(531)][t(496)](t(545))[t(504)]({model:t(527),view:(n,{writer:s})=>function(e,n,r,s){const o=t,i=e[o(586)][o(465)](":")[2],a=r[o(558)](i);if(!a||i===r[o(572)])return;if(!s[o(514)][o(561)][o(557)](e[o(564)][o(517)],o(502)))return;const c={class:o(560)+a[o(458)][o(532)](),"data-name":a[o(495)],"data-session-id":i},d=s[o(514)][o(581)][o(494)](e[o(586)])[o(467)](),u=d[o(533)],l=s[o(514)][o(561)];if(u&&l[o(500)](u)&&l[o(593)](u)&&!s[o(514)][o(581)][o(494)](o(516)+i)[o(570)]()[o(555)])return;const p=d[o(563)];return s[o(514)][o(561)][o(484)](p)&&!s[o(514)][o(468)](p)&&(c[o(542)]=!1),function(t,e,n){const r=o,s=t[r(499)](r(535),e);return t[r(498)](r(520),!0,s),s[r(548)]=function(t){const e=r,s=this[e(506)](t),o=document[e(503)](e(535));return o[e(485)][e(551)](e(569)),o[e(521)](e(542),e(490)),o[e(521)](e(550),e(490)),o[e(501)]=n[e(495)],s[e(470)]=e(459)+o[e(483)]+"⁠",s[e(554)](e(540),(()=>{const t=e;s[t(485)][t(551)](t(547))})),s[e(554)](e(534),(()=>{const t=e;s[t(485)][t(530)](t(547))})),s},s[r(482)]=function(t){const e=r;return!(!this[e(466)](e(520))||!t[e(466)](e(520))||this[e(567)](e(556))!=t[e(567)](e(556)))},s}(n,c,a)}(n,s,r,e)}),e[t(531)][t(496)](t(545))[t(566)]({model:t(580),view:e=>function(e,n){const r=t,s=e[r(586)][r(465)](":")[2];if(s===n[r(572)])return null;const o=n[r(558)](s);return o?{id:s,classes:[r(576),o[r(458)][r(473)]()],attributes:{"data-session-id":s},priority:2e3+o[r(598)]}:{id:s,classes:[]}}(e,r)}),function(e){const n=t,r=e[n(514)],o=new Map,i=e[n(552)][n(494)](ys);r[n(581)].on(n(513),((t,a,c,d)=>{const u=n;if(!d&&o[u(494)](a[u(495)]))return o[u(494)](a[u(495)])[u(562)](),void o[u(469)](a[u(495)]);const l=a[u(495)][u(465)](":")[2];if(l===i[u(572)])return;const p=u(575)+l;r[u(581)][u(553)](p)&&e[u(571)][u(491)](p),a.on(u(475),((t,e,n)=>{const i=u;if(i(538)!=e[i(507)][i(480)]&&i(538)==a[i(570)]()[i(507)][i(480)]&&!o[i(553)](a[i(495)])){const t=r[i(561)][i(510)](n[i(463)]);if(t){const e=s.LiveRange[i(588)](t);o[i(461)](a[i(495)],e),e.on(i(475),((t,n,s)=>{const c=i;if(c(538)==e[c(507)][c(480)]){const t=r[c(561)][c(510)](s[c(463)]);t?(e[c(517)]=t[c(517)],e[c(585)]=t[c(585)]):(o[c(469)](a[c(495)]),e[c(562)]())}}))}}}))})),r[n(472)].on(n(528),(()=>{const t=n;o[t(582)]>0&&r[t(597)]({isUndoable:!1},(e=>{const n=t;for(const[t,s]of o)n(538)==r[n(581)][n(494)](t)[n(570)]()[n(507)][n(480)]&&(xs(t[n(465)](":")[2],s[n(462)](),r,e),s[n(562)]());o[n(529)]()}))}))}(e),this[t(590)][t(476)](n.global[t(472)],t(460),((n,{key:r})=>{const s=t;s(541)===r&&function(t){const e=s;t[e(571)][e(592)][e(528)]((n=>{const r=e;for(const e of t[r(514)][r(581)]){if(!e[r(495)][r(471)](r(527)))continue;const s=t[r(571)][r(512)][r(477)](e[r(495)]);if(s)for(const t of s)n[r(543)](r(547),t)}}))}(e)}),{useCapture:!0})}[js(578)](){const t=js,e=this[t(524)],n=e[t(508)][t(494)](t(577));n&&e[t(514)].on(t(536),((r,s)=>{const o=t,i=s[0];if(!i[o(519)])return;if(o(596)!=i[o(493)]||!i[o(495)][o(471)](o(478)))return;const a=i[o(515)];n[o(523)][o(553)](a)&&(i[o(573)]=i[o(594)]?e[o(514)][o(505)](i[o(594)][o(517)],i[o(594)][o(585)]):null)}),{priority:t(487)})}[js(486)](){const t=js;return this[t(590)][t(595)](),super[t(486)]()}[js(525)](){const t=js,e=this[t(524)],n=e[t(514)][t(472)],r=e[t(552)][t(494)](ys);e[t(514)][t(597)]({isUndoable:!1},(s=>{const o=t,i=o(516)+r[o(572)],a=o(575)+r[o(572)],c=e[o(514)][o(581)][o(553)](i);e[o(571)][o(592)][o(589)]?xs(r[o(572)],n[o(509)][o(559)](),e[o(514)],s):c&&(s[o(526)](i),s[o(526)](a))}))}}function Ds(t,e){const n=Cs();return(Ds=function(t,e){return n[t-=458]})(t,e)}function xs(t,e,n,r){const s=js,o=s(516)+t,i=s(575)+t,a=e[s(464)]();let c=e[s(517)];a&&a.is(s(522),s(568))&&(c=function(t,e){const n=s;for(const r of t[n(511)]())if(e[n(561)][n(557)](r,n(502)))return r}(e,n),e=r[s(505)](c));const d=r[s(505)](c);n[s(581)][s(553)](o)?(r[s(479)](o,{range:e}),r[s(479)](i,{range:d})):(r[s(489)](o,{range:e,usingOperation:!0}),r[s(489)](i,{range:d,usingOperation:!0}))}function Rs(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 Ns=(()=>{var t=p.Reader,e=p.Writer,n=p.util,r=p.roots.default||(p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/Element"},s}(),r})();class Vs{constructor(){this._protobufRoot=Ns}getDescriptor(t){return new Ms(this._protobufRoot[t])}}class Ms{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})}}const Bs=function(){this.__data__=[],this.size=0};const Us=function(t,e){return t===e||t!=t&&e!=e};const Js=function(t,e){for(var n=t.length;n--;)if(Us(t[n][0],e))return n;return-1};var qs=Array.prototype.splice;const Gs=function(t){var e=this.__data__,n=Js(e,t);return!(n<0)&&(n==e.length-1?e.pop():qs.call(e,n,1),--this.size,!0)};const Ls=function(t){var e=this.__data__,n=Js(e,t);return n<0?void 0:e[n][1]};const Hs=function(t){return Js(this.__data__,t)>-1};const Ys=function(t,e){var n=this.__data__,r=Js(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};function zs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}zs.prototype.clear=Bs,zs.prototype.delete=Gs,zs.prototype.get=Ls,zs.prototype.has=Hs,zs.prototype.set=Ys;const Fs=zs;const Ks=function(){this.__data__=new Fs,this.size=0};const Ws=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};const Qs=function(t){return this.__data__.get(t)};const Zs=function(t){return this.__data__.has(t)};const $s="object"==typeof global&&global&&global.Object===Object&&global;var Xs="object"==typeof self&&self&&self.Object===Object&&self;const to=$s||Xs||Function("return this")();const eo=to.Symbol;var no=Object.prototype,ro=no.hasOwnProperty,so=no.toString,oo=eo?eo.toStringTag:void 0;const io=function(t){var e=ro.call(t,oo),n=t[oo];try{t[oo]=void 0;var r=!0}catch(t){}var s=so.call(t);return r&&(e?t[oo]=n:delete t[oo]),s};var ao=Object.prototype.toString;const co=function(t){return ao.call(t)};var uo=eo?eo.toStringTag:void 0;const lo=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":uo&&uo in Object(t)?io(t):co(t)};const po=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const ho=function(t){if(!po(t))return!1;var e=lo(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const fo=to["__core-js_shared__"];var mo,yo=(mo=/[^.]+$/.exec(fo&&fo.keys&&fo.keys.IE_PROTO||""))?"Symbol(src)_1."+mo:"";const go=function(t){return!!yo&&yo in t};var bo=Function.prototype.toString;const Oo=function(t){if(null!=t){try{return bo.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var wo=/^\[object .+?Constructor\]$/,vo=Function.prototype,Io=Object.prototype,So=vo.toString,Po=Io.hasOwnProperty,ko=RegExp("^"+So.call(Po).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Ao=function(t){return!(!po(t)||go(t))&&(ho(t)?ko:wo).test(Oo(t))};const _o=function(t,e){return null==t?void 0:t[e]};const To=function(t,e){var n=_o(t,e);return Ao(n)?n:void 0};const Co=To(to,"Map");const jo=To(Object,"create");const Eo=function(){this.__data__=jo?jo(null):{},this.size=0};const Do=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var xo=Object.prototype.hasOwnProperty;const Ro=function(t){var e=this.__data__;if(jo){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return xo.call(e,t)?e[t]:void 0};var No=Object.prototype.hasOwnProperty;const Vo=function(t){var e=this.__data__;return jo?void 0!==e[t]:No.call(e,t)};const Mo=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=jo&&void 0===e?"__lodash_hash_undefined__":e,this};function Bo(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Bo.prototype.clear=Eo,Bo.prototype.delete=Do,Bo.prototype.get=Ro,Bo.prototype.has=Vo,Bo.prototype.set=Mo;const Uo=Bo;const Jo=function(){this.size=0,this.__data__={hash:new Uo,map:new(Co||Fs),string:new Uo}};const qo=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};const Go=function(t,e){var n=t.__data__;return qo(e)?n["string"==typeof e?"string":"hash"]:n.map};const Lo=function(t){var e=Go(this,t).delete(t);return this.size-=e?1:0,e};const Ho=function(t){return Go(this,t).get(t)};const Yo=function(t){return Go(this,t).has(t)};const zo=function(t,e){var n=Go(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Fo(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Fo.prototype.clear=Jo,Fo.prototype.delete=Lo,Fo.prototype.get=Ho,Fo.prototype.has=Yo,Fo.prototype.set=zo;const Ko=Fo;const Wo=function(t,e){var n=this.__data__;if(n instanceof Fs){var r=n.__data__;if(!Co||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ko(r)}return n.set(t,e),this.size=n.size,this};function Qo(t){var e=this.__data__=new Fs(t);this.size=e.size}Qo.prototype.clear=Ks,Qo.prototype.delete=Ws,Qo.prototype.get=Qs,Qo.prototype.has=Zs,Qo.prototype.set=Wo;const Zo=Qo;const $o=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t};const Xo=function(){try{var t=To(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const ti=function(t,e,n){"__proto__"==e&&Xo?Xo(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n};var ei=Object.prototype.hasOwnProperty;const ni=function(t,e,n){var r=t[e];ei.call(t,e)&&Us(r,n)&&(void 0!==n||e in t)||ti(t,e,n)};const ri=function(t,e,n,r){var s=!n;n||(n={});for(var o=-1,i=e.length;++o<i;){var a=e[o],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),s?ti(n,a,c):ni(n,a,c)}return n};const si=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r};const oi=function(t){return null!=t&&"object"==typeof t};const ii=function(t){return oi(t)&&"[object Arguments]"==lo(t)};var ai=Object.prototype,ci=ai.hasOwnProperty,di=ai.propertyIsEnumerable,ui=ii(function(){return arguments}())?ii:function(t){return oi(t)&&ci.call(t,"callee")&&!di.call(t,"callee")};const li=ui;const pi=Array.isArray;const hi=function(){return!1};var fi="object"==typeof exports&&exports&&!exports.nodeType&&exports,mi=fi&&"object"==typeof module&&module&&!module.nodeType&&module,yi=mi&&mi.exports===fi?to.Buffer:void 0;const gi=(yi?yi.isBuffer:void 0)||hi;var bi=/^(?:0|[1-9]\d*)$/;const Oi=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&bi.test(t))&&t>-1&&t%1==0&&t<e};const wi=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var vi={};vi["[object Float32Array]"]=vi["[object Float64Array]"]=vi["[object Int8Array]"]=vi["[object Int16Array]"]=vi["[object Int32Array]"]=vi["[object Uint8Array]"]=vi["[object Uint8ClampedArray]"]=vi["[object Uint16Array]"]=vi["[object Uint32Array]"]=!0,vi["[object Arguments]"]=vi["[object Array]"]=vi["[object ArrayBuffer]"]=vi["[object Boolean]"]=vi["[object DataView]"]=vi["[object Date]"]=vi["[object Error]"]=vi["[object Function]"]=vi["[object Map]"]=vi["[object Number]"]=vi["[object Object]"]=vi["[object RegExp]"]=vi["[object Set]"]=vi["[object String]"]=vi["[object WeakMap]"]=!1;const Ii=function(t){return oi(t)&&wi(t.length)&&!!vi[lo(t)]};const Si=function(t){return function(e){return t(e)}};var Pi="object"==typeof exports&&exports&&!exports.nodeType&&exports,ki=Pi&&"object"==typeof module&&module&&!module.nodeType&&module,Ai=ki&&ki.exports===Pi&&$s.process;const _i=function(){try{var t=ki&&ki.require&&ki.require("util").types;return t||Ai&&Ai.binding&&Ai.binding("util")}catch(t){}}();var Ti=_i&&_i.isTypedArray;const Ci=Ti?Si(Ti):Ii;var ji=Object.prototype.hasOwnProperty;const Ei=function(t,e){var n=pi(t),r=!n&&li(t),s=!n&&!r&&gi(t),o=!n&&!r&&!s&&Ci(t),i=n||r||s||o,a=i?si(t.length,String):[],c=a.length;for(var d in t)!e&&!ji.call(t,d)||i&&("length"==d||s&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Oi(d,c))||a.push(d);return a};var Di=Object.prototype;const xi=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Di)};const Ri=function(t,e){return function(n){return t(e(n))}};const Ni=Ri(Object.keys,Object);var Vi=Object.prototype.hasOwnProperty;const Mi=function(t){if(!xi(t))return Ni(t);var e=[];for(var n in Object(t))Vi.call(t,n)&&"constructor"!=n&&e.push(n);return e};const Bi=function(t){return null!=t&&wi(t.length)&&!ho(t)};const Ui=function(t){return Bi(t)?Ei(t):Mi(t)};const Ji=function(t,e){return t&&ri(e,Ui(e),t)};const qi=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e};var Gi=Object.prototype.hasOwnProperty;const Li=function(t){if(!po(t))return qi(t);var e=xi(t),n=[];for(var r in t)("constructor"!=r||!e&&Gi.call(t,r))&&n.push(r);return n};const Hi=function(t){return Bi(t)?Ei(t,!0):Li(t)};const Yi=function(t,e){return t&&ri(e,Hi(e),t)};var zi="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fi=zi&&"object"==typeof module&&module&&!module.nodeType&&module,Ki=Fi&&Fi.exports===zi?to.Buffer:void 0,Wi=Ki?Ki.allocUnsafe:void 0;const Qi=function(t,e){if(e)return t.slice();var n=t.length,r=Wi?Wi(n):new t.constructor(n);return t.copy(r),r};const Zi=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e};const $i=function(t,e){for(var n=-1,r=null==t?0:t.length,s=0,o=[];++n<r;){var i=t[n];e(i,n,t)&&(o[s++]=i)}return o};const Xi=function(){return[]};var ta=Object.prototype.propertyIsEnumerable,ea=Object.getOwnPropertySymbols;const na=ea?function(t){return null==t?[]:(t=Object(t),$i(ea(t),(function(e){return ta.call(t,e)})))}:Xi;const ra=function(t,e){return ri(t,na(t),e)};const sa=function(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t};const oa=Ri(Object.getPrototypeOf,Object);const ia=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)sa(e,na(t)),t=oa(t);return e}:Xi;const aa=function(t,e){return ri(t,ia(t),e)};const ca=function(t,e,n){var r=e(t);return pi(t)?r:sa(r,n(t))};const da=function(t){return ca(t,Ui,na)};const ua=function(t){return ca(t,Hi,ia)};const la=To(to,"DataView");const pa=To(to,"Promise");const ha=To(to,"Set");const fa=To(to,"WeakMap");var ma="[object Map]",ya="[object Promise]",ga="[object Set]",ba="[object WeakMap]",Oa="[object DataView]",wa=Oo(la),va=Oo(Co),Ia=Oo(pa),Sa=Oo(ha),Pa=Oo(fa),ka=lo;(la&&ka(new la(new ArrayBuffer(1)))!=Oa||Co&&ka(new Co)!=ma||pa&&ka(pa.resolve())!=ya||ha&&ka(new ha)!=ga||fa&&ka(new fa)!=ba)&&(ka=function(t){var e=lo(t),n="[object Object]"==e?t.constructor:void 0,r=n?Oo(n):"";if(r)switch(r){case wa:return Oa;case va:return ma;case Ia:return ya;case Sa:return ga;case Pa:return ba}return e});const Aa=ka;var _a=Object.prototype.hasOwnProperty;const Ta=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&_a.call(t,"index")&&(n.index=t.index,n.input=t.input),n};const Ca=to.Uint8Array;const ja=function(t){var e=new t.constructor(t.byteLength);return new Ca(e).set(new Ca(t)),e};const Ea=function(t,e){var n=e?ja(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)};var Da=/\w*$/;const xa=function(t){var e=new t.constructor(t.source,Da.exec(t));return e.lastIndex=t.lastIndex,e};var Ra=eo?eo.prototype:void 0,Na=Ra?Ra.valueOf:void 0;const Va=function(t){return Na?Object(Na.call(t)):{}};const Ma=function(t,e){var n=e?ja(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};const Ba=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return ja(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return Ea(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ma(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return xa(t);case"[object Symbol]":return Va(t)}};var Ua=Object.create;const Ja=function(){function t(){}return function(e){if(!po(e))return{};if(Ua)return Ua(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const qa=function(t){return"function"!=typeof t.constructor||xi(t)?{}:Ja(oa(t))};const Ga=function(t){return oi(t)&&"[object Map]"==Aa(t)};var La=_i&&_i.isMap;const Ha=La?Si(La):Ga;const Ya=function(t){return oi(t)&&"[object Set]"==Aa(t)};var za=_i&&_i.isSet;const Fa=za?Si(za):Ya;var Ka="[object Arguments]",Wa="[object Function]",Qa="[object Object]",Za={};Za[Ka]=Za["[object Array]"]=Za["[object ArrayBuffer]"]=Za["[object DataView]"]=Za["[object Boolean]"]=Za["[object Date]"]=Za["[object Float32Array]"]=Za["[object Float64Array]"]=Za["[object Int8Array]"]=Za["[object Int16Array]"]=Za["[object Int32Array]"]=Za["[object Map]"]=Za["[object Number]"]=Za[Qa]=Za["[object RegExp]"]=Za["[object Set]"]=Za["[object String]"]=Za["[object Symbol]"]=Za["[object Uint8Array]"]=Za["[object Uint8ClampedArray]"]=Za["[object Uint16Array]"]=Za["[object Uint32Array]"]=!0,Za["[object Error]"]=Za[Wa]=Za["[object WeakMap]"]=!1;const $a=function t(e,n,r,s,o,i){var a,c=1&n,d=2&n,u=4&n;if(r&&(a=o?r(e,s,o,i):r(e)),void 0!==a)return a;if(!po(e))return e;var l=pi(e);if(l){if(a=Ta(e),!c)return Zi(e,a)}else{var p=Aa(e),h=p==Wa||"[object GeneratorFunction]"==p;if(gi(e))return Qi(e,c);if(p==Qa||p==Ka||h&&!o){if(a=d||h?{}:qa(e),!c)return d?aa(e,Yi(a,e)):ra(e,Ji(a,e))}else{if(!Za[p])return o?e:{};a=Ba(e,p,c)}}i||(i=new Zo);var f=i.get(e);if(f)return f;i.set(e,a),Fa(e)?e.forEach((function(s){a.add(t(s,n,r,s,e,i))})):Ha(e)&&e.forEach((function(s,o){a.set(o,t(s,n,r,o,e,i))}));var m=l?void 0:(u?d?ua:da:d?Hi:Ui)(e);return $o(m||e,(function(s,o){m&&(s=e[o=s]),ni(a,o,t(s,n,r,o,e,i))})),a};const Xa=function(t){return $a(t,5)};const tc=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const ec=function(t){return this.__data__.has(t)};function nc(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Ko;++e<n;)this.add(t[e])}nc.prototype.add=nc.prototype.push=tc,nc.prototype.has=ec;const rc=nc;const sc=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1};const oc=function(t,e){return t.has(e)};const ic=function(t,e,n,r,s,o){var i=1&n,a=t.length,c=e.length;if(a!=c&&!(i&&c>a))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var l=-1,p=!0,h=2&n?new rc:void 0;for(o.set(t,e),o.set(e,t);++l<a;){var f=t[l],m=e[l];if(r)var y=i?r(m,f,l,e,t,o):r(f,m,l,t,e,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!sc(e,(function(t,e){if(!oc(h,e)&&(f===t||s(f,t,n,r,o)))return h.push(e)}))){p=!1;break}}else if(f!==m&&!s(f,m,n,r,o)){p=!1;break}}return o.delete(t),o.delete(e),p};const ac=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n};const cc=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n};var dc=eo?eo.prototype:void 0,uc=dc?dc.valueOf:void 0;const lc=function(t,e,n,r,s,o,i){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Ca(t),new Ca(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Us(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=ac;case"[object Set]":var c=1&r;if(a||(a=cc),t.size!=e.size&&!c)return!1;var d=i.get(t);if(d)return d==e;r|=2,i.set(t,e);var u=ic(a(t),a(e),r,s,o,i);return i.delete(t),u;case"[object Symbol]":if(uc)return uc.call(t)==uc.call(e)}return!1};var pc=Object.prototype.hasOwnProperty;const hc=function(t,e,n,r,s,o){var i=1&n,a=da(t),c=a.length;if(c!=da(e).length&&!i)return!1;for(var d=c;d--;){var u=a[d];if(!(i?u in e:pc.call(e,u)))return!1}var l=o.get(t),p=o.get(e);if(l&&p)return l==e&&p==t;var h=!0;o.set(t,e),o.set(e,t);for(var f=i;++d<c;){var m=t[u=a[d]],y=e[u];if(r)var g=i?r(y,m,u,e,t,o):r(m,y,u,t,e,o);if(!(void 0===g?m===y||s(m,y,n,r,o):g)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var b=t.constructor,O=e.constructor;b==O||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return o.delete(t),o.delete(e),h};var fc="[object Arguments]",mc="[object Array]",yc="[object Object]",gc=Object.prototype.hasOwnProperty;const bc=function(t,e,n,r,s,o){var i=pi(t),a=pi(e),c=i?mc:Aa(t),d=a?mc:Aa(e),u=(c=c==fc?yc:c)==yc,l=(d=d==fc?yc:d)==yc,p=c==d;if(p&&gi(t)){if(!gi(e))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new Zo),i||Ci(t)?ic(t,e,n,r,s,o):lc(t,e,c,n,r,s,o);if(!(1&n)){var h=u&&gc.call(t,"__wrapped__"),f=l&&gc.call(e,"__wrapped__");if(h||f){var m=h?t.value():t,y=f?e.value():e;return o||(o=new Zo),s(m,y,n,r,o)}}return!!p&&(o||(o=new Zo),hc(t,e,n,r,s,o))};const Oc=function t(e,n,r,s,o){return e===n||(null==e||null==n||!oi(e)&&!oi(n)?e!=e&&n!=n:bc(e,n,r,s,t,o))};const wc=function(t,e){return Oc(t,e)};function vc(t,e){const n=Xa(t);return n.path[n.path.length-1]+=e,n}function Ic(t,e){return t.root===e.root&&wc(t.path,e.path)}function Sc(t){kc(t,(t=>("main"==t.root?(t.rootMain=!0,delete t.root):"$graveyard"==t.root&&(t.rootGraveyard=!0,delete t.root),t)))}function Pc(t){kc(t,(t=>(t.rootMain?(t.root="main",delete t.rootMain):t.rootGraveyard&&(t.root="$graveyard",delete t.rootGraveyard),t)))}function kc(t,e){for(const n in t){const r=t[n];"nodes"!==n&&po(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?t[n]=e(r):kc(r,e))}return t}class Ac{constructor(t,e,n){this._id=t,this._operationName=e,this._protobufDescriptor=n}compress(t,e){const n=e.shift();return Sc(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());Pc(n),n.__className=this._operationName,t.push(n)}}class _c extends Ac{compress(t,e){const n=e.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),Sc(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),Pc(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 Tc extends Ac{compress(t,e){const n=e.shift();return this._serializeNodesAttributes(n.nodes),Sc(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),Pc(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 Cc extends Ac{decompress(t,e){super.decompress(t,e);const n=t[t.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class jc extends Ac{compress(t,e){return e.shift(),t.types.push(this._id),!0}decompress(t,e){e.types.shift(),t.push({__className:this._operationName})}}class Ec extends Cc{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 Dc{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=Xa(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 xc extends Dc{_combineNext(t,e){return e.nodes[0].data+=t.nodes[0].data,e}_splitCurrent(t){const e=Xa(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=vc(t.position,o),e}_compareOperations(t,e){if(this._checkOperation(t)&&this._checkOperation(e)){const n=t.nodes[0].data.length,r=Ic(vc(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 Rc extends Dc{_combineNext(t,e){return e.howMany++,e.sourcePosition=Xa(t.sourcePosition),e}_splitCurrent(t){const e=Xa(t);return t.howMany--,e.howMany=1,e.sourcePosition=vc(e.sourcePosition,t.howMany),e}_compareOperations(t,e){return!(!this._checkOperation(t)||!this._checkOperation(e))&&(Ic(vc(t.sourcePosition,-1),e.sourcePosition)&&Ic(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 Nc extends Dc{_combineNext(t,e){return e.howMany++,e}_splitCurrent(t){const e=Xa(t);return e.howMany=1,t.howMany--,e}_compareOperations(t,e){return!(!this._checkOperation(t)||!this._checkOperation(e))&&(Ic(t.sourcePosition,e.sourcePosition)&&Ic(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 Vc extends Dc{compress(t,e){if(!this._compareOperations(e[0],e[1]))return!1;const n=e.shift();return n.oldRange=null,n.newRange&&Ic(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=Xa(n.newRange.start));const r=Xa(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=Xa(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 Mc{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new Vs;const t=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new jc(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",_c),this._registerOperationCompressor(11,"InsertOperation",Tc),this._registerOperationCompressor(12,"MarkerOperation",Cc),this._registerOperationCompressor(13,"MergeOperation",Ac),this._registerOperationCompressor(14,"MoveOperation",Ac),this._registerOperationCompressor(15,"RenameOperation",Ac),this._registerOperationCompressor(16,"RootAttributeOperation",_c),this._registerOperationCompressor(17,"SplitOperation",Ac),this._registerCompressor(18,"CommentMarkerOperation",new Ec(18,"MarkerOperation",t,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Ec(19,"MarkerOperation",t,"suggestion")),this._registerOperationCompressor(20,"RootOperation",Ac),this._registerActionCompressor(100,"TypingAction",xc),this._registerActionCompressor(101,"DeletingAction",Rc),this._registerActionCompressor(102,"ForwardDeletingAction",Nc),this._registerActionCompressor(103,"UserSelectionAction",Vc)}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)}}function Bc(){const t=["sessionAdd:","realtimecollaborationclient-init-service-incorrect-server-operation","_handleInitialConnectionData","compress","suppressErrorInCollaboration","connect","disableReadOnlyMode","10141614IqZMfe","_sendBufferedOperations","listenTo","createRange","bind","213930eGaLpO","lastOperationId","operationsReceived","removeFromReconnectionStack","enqueueChange","collaboration.channelId","directChange","_addKnownRoot","start","_lastServerVersion","_offset","createUserMarkerOperations","filter","requires","type","size","_currentBufferDelay","_isInit","addToReconnectionStack","multi-root-editor-root-attributes-no-root","stop","cloud-services-internal-error: Not connected.","get","_setPendingAction","editing","sessionId","setIdForTheLastOperation","realtimecollaborationclient","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.","isOfficialPlugin","11730299GKbHuG","$root","_crash","showWarning","addRootAttribute","703758eFqoDg","set","end","addOperation","36yisVVy","collaboration","PENDING_ACTION_SENDING_DATA","connected","_clearPendingAction","_saveOperationInBuffer","startsWith","keys","return","markers","message","_hasSynchronizationProblem","getUser","locale","_fetchMissingUsers","_operationToId","_getOperationsFromInitData","remove","_authorId","__className","_handleReceivedOperations","forEach","selection","clone","change:range","1661474yzzSap","_bufferRootLoad","string","_service","fire","baseVersion","409","collaboration-missing-channelid","destroy","round","_handleReconnectionError","permissions","change:hasDomSelection","finally","rootsAttributes","realtimecollaborationclient-sendbufferedoperations","toJSON","isEnabled","getConnectedSessions","_document","_initSessionsHandling","_bufferedOperations","plugins","affectedSelectable","lastOperationAcceptedAt","targetPosition","register","setPermissions","metadata","_sendBufferedOperationsDelayed","createRoot","init","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.","_pendingAction","_disconnectionOperations","_isLoaded","getMany","ready","CollaborativeEditingService","cloud-services-internal-error: Collaborative Editing Service is not connected.","state","_connectService","_shouldSendUpdate","roots","model","userId","realtimecollaborationclient-init-non-existent-root","fromJSON","lastSyncVersion","off","code","_handleSendingSelectionMarkers","history","parse","_getAffectedRoot","sessionCreatedAt","_ignoredOperations","position","connection","enableReadOnlyMode","_compressOperations","disconnect","Notification","addUser","realtimecollaborationclient-error","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","reset","serverHistory","add","getOperations","_isConnected","realtimecollaborationclient-init-session-connection-error","change:_isEditingAllowed","define","newRange","_channelId","cs:removeUser","affectsData","_compressor","_lastSyncedOperationId","from","_baseBufferDelay","_isAttached","getOperationAuthor","_setUpDataInit","realtimecollaborationclient-init-connection-failed","change:_isPendingUpdate","apply","_disconnectService","isPremiumPlugin","Synchronization issue","realtimecollaborationclient-handleserverresponse","404","_applyOperationsSet","loadRoot","stopListening","realtimecollaborationclient-init-document-already-initialized","differ","error","unregister","createPositionAt","data","_initThrowingOnDataSet","3412OtVMee","createdAt","rootName","document","_waitUntilSynced","_isEditingAllowed","_knownRootNames","has","getIdOfTheLastOperation","_updateServerHistory","initData","createPositionFromPath","getDocumentDetails","_shouldSendSelectionUpdate","insert","isDocumentOperation","_isDisconnection","_handleExternalOperations","mySessionId","catch","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","rtc-destroyed","document:write","map","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","rtc-offline","attributes","lastDocumentSession","pluginName","applyOperation","_sendBufferedOperationsDelayId","Permissions","batch","high","InsertOperation","1857tQoVwV","getRoot","decompress","_refreshUserSelectionMarkers","isUndoneOperation","move","disconnected","push","config","12550240elrDHW","version","_hasSelectionChanged","currentDocumentSession","cloud-services-internal-error: Request timeout.","isReadOnly","realtimecollaborationclient-init-service-internal-error","_loadRoot","cloudServices.bundleVersion","root","marker","path","includes","wasUndone","editor","_handleReconnectionResponse","length","CommentsOnly","real-time-collaboration","_connectAfterSessionHasBeenFlushed","wereChangesApplied","then","_handleServerResponse","view","addRoot","entries","_decompressOperations","_isPendingUpdate","reconnect","reconnection: flushed session","slice","channelSessions","_knownOperations","RealTimeCollaborationClient","sendOperations","offset","cloudDocumentVersion","_operationIdentifier"];return(Bc=function(){return t})()}const Uc=Jc;function Jc(t,e){const n=Bc();return(Jc=function(t,e){return n[t-=282]})(t,e)}!function(t){const e=Jc,n=t();for(;;)try{if(896144===-parseInt(e(481))/1+parseInt(e(323))/2*(parseInt(e(358))/3)+-parseInt(e(456))/4*(-parseInt(e(417))/5)+-parseInt(e(452))/6+parseInt(e(447))/7+-parseInt(e(367))/8+parseInt(e(412))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Bc);let qc=1;class Gc extends e.Plugin{static get[Uc(430)](){return[ls,ys,Es,e.PendingActions,ps.Users,r.Notification]}static get[Uc(351)](){return Uc(400)}static get[Uc(446)](){return!0}static get[Uc(309)](){return!0}get[Uc(403)](){const t=Uc;return this[t(426)]+this[t(427)]}get[Uc(426)](){const t=Uc;return this[t(287)][t(368)]-this[t(427)]}get[Uc(529)](){const t=Uc,e=this[t(287)][t(289)]();for(let n=e[t(383)]-1;n>=0;n--){const r=e[n];if(!this[t(515)][t(330)](r))return r[t(486)]+1-this[t(427)]}return 0}constructor(t){const e=Uc;if(super(t),this[e(427)]=0,this[e(442)]=null,this[e(287)]=new s.History,this[e(381)][e(366)][e(293)](e(457),{}),this[e(295)]=this[e(381)][e(366)][e(439)](e(422)),!this[e(295)])throw new n.CKEditorError(e(488),this);const r=t[e(366)][e(439)](e(375))||n.version;this[e(484)]=new(Gc[e(519)])(r,this[e(295)]),this[e(500)]=this[e(381)][e(525)][e(326)],this[e(298)]=new Mc,this[e(502)]=[],this[e(399)]=new WeakSet,this[e(329)]=new Set,this[e(453)](e(394),!1),this[e(453)](e(467),!1),this[e(514)]=null,this[e(369)]=!1,this[e(353)]=null,this[e(301)]=300,this[e(433)]=this[e(301)],this[e(299)]=null,this[e(515)]=new WeakSet,this[e(404)]=new zc(this[e(515)])}[Uc(512)](){const t=Uc,e=this[t(381)],n=e[t(503)][t(439)](ps.Users),r=e[t(503)][t(439)](ls);this[t(414)](n,t(303),((e,r)=>{const s=t,o=r[0];o[s(474)]&&(e[s(464)]=n[s(468)](o[s(474)]),e[s(437)]()),null===o[s(474)]&&(e[s(464)]=null,e[s(437)]())}),{priority:t(356)}),this[t(414)](e[t(525)][t(326)][t(478)],t(480),((e,n)=>{const r=t;n[r(423)]&&this[r(361)]()})),this[t(414)](e[t(441)][t(390)],t(493),(()=>{this[t(361)]()})),this[t(322)](),e[t(525)].on(t(352),((e,n)=>{const r=t,s=n[0];s[r(338)]&&(this[r(461)](s),this[r(523)]()&&this[r(510)]())})),this[t(304)](),this[t(416)](t(328)).to(r,t(521),this,t(467),((e,n)=>t(459)===e&&!n)),this.on(t(292),(()=>{const n=t;this[n(328)]?e[n(411)](n(348)):e[n(540)](n(348))})),this[t(328)]?e[t(411)](t(348)):e[t(540)](t(348)),this[t(453)](t(290),!1)}async[Uc(395)](){const t=Uc,e=this[t(381)][t(503)][t(439)](ys),n=this[t(381)][t(503)][t(439)](ls);try{this[t(394)]=!0,e[t(319)](this[t(295)]);const r=await this[t(484)][t(395)](n[t(539)],this[t(529)]);await this[t(382)](r)&&(this[t(394)]=!1,this[t(460)]());const s=await this[t(484)][t(499)]();e[t(507)](this[t(295)],s),this[t(532)](),this[t(290)]=!0}catch(e){if(function(e){const n=t;return n(312)===e[n(531)]}(e)&&this[t(442)])await this[t(386)]();else if(function(e){const n=t;return n(487)===e[n(531)]}(e)){const e=Rs(this[t(381)][t(469)],t(285));this[t(491)](e)}else{if(!(e instanceof Hc))throw e;this[t(491)]()}}}[Uc(489)](){const t=Uc,e=this[t(381)][t(503)][t(439)](ls),n=this[t(381)][t(503)][t(439)](ys);this[t(381)][t(540)](t(344)),n[t(398)][t(330)](this[t(295)])&&n[t(319)](this[t(295)]),e[t(420)](this),this[t(308)](),super[t(489)]()}async[Uc(382)](t){const e=Uc;if(this[e(442)]!==t[e(442)]&&this[e(299)]!==t[e(418)])throw new Hc;return this[e(442)]=t[e(442)],this[e(389)]([],{...t,wereChangesApplied:!1,data:t[e(321)]},e(395))}async[Uc(522)](t,e=!1){const n=Uc,{connection:r}=this[n(381)][n(503)][n(439)](ls);Gc[n(519)][n(499)](r,this[n(295)])[n(388)]((t=>this[n(501)](t)))[n(342)]((t=>{const e=n;this[e(449)](e(291),t)})),this[n(414)](this[n(484)],n(419),this[n(476)][n(416)](this)),this[n(414)](this[n(484)],n(318),((t,e)=>{const r=n;this[r(449)](r(373),e)})),this[n(414)](this[n(484)],n(364),(()=>{this[n(290)]=!1}));const s=this[n(404)][n(331)](t);this[n(394)]=!0;const o=await this[n(484)][n(410)](r,this[n(541)](t),s);if(this[n(442)]=o[n(442)],e){if(!o[n(387)])return void this[n(491)]();this[n(394)]=!1,this[n(460)](),this[n(287)][n(286)](),this[n(427)]=o[n(402)],this[n(287)][n(368)]=this[n(427)],await this[n(389)](t,o,n(396))}else await this[n(407)](o,t);this[n(532)](),this[n(290)]=!0}[Uc(532)](){const t=Uc,e=this[t(381)][t(503)][t(439)](ys),n=this[t(381)][t(503)][t(439)](Es),r=e[t(398)][t(439)](this[t(295)]);r&&r[t(383)]>1?n[t(428)]():this[t(414)](e,t(405)+this[t(295)],(()=>{const r=t;2===e[r(398)][r(439)](this[r(295)])[r(383)]&&n[r(428)]()}))}async[Uc(476)](t,e,n,r){const s=Uc;if(!this[s(394)]&&this[s(500)][s(368)]==e){const t=this[s(393)](n,r);await this[s(470)](t),this[s(340)](t,e,n[s(418)])||this[s(449)](s(406))}}async[Uc(386)](){const t=Uc;this[t(308)]();const{locale:e}=this[t(381)];let n;try{n=await this[t(484)][t(335)]()}catch(n){const r=Rs(e,t(347));return void this[t(491)](r)}const r=n[t(370)]||n[t(350)];if(this[t(299)]===r[t(418)])await this[t(522)](this[t(381)][t(525)][t(326)][t(533)][t(289)](),!0);else{const n=Rs(e,t(513));this[t(491)](n)}}[Uc(308)](){const t=Uc;this[t(484)][t(542)](),this[t(502)]=[],clearTimeout(this[t(353)]),this[t(315)](this[t(484)])}[Uc(501)](t){const e=Uc,n=this[e(381)][e(503)][e(439)](ys);this[e(414)](n,e(405)+this[e(295)],((t,{session:r})=>{const s=e;if(r.id===n[s(341)]){t[s(530)]();const e=this[s(381)][s(503)][s(330)](s(384))&&this[s(381)][s(503)][s(439)](s(384));let n=r[s(492)];e&&e[s(498)]&&(n=n[s(429)]((t=>s(345)!==t))),this[s(381)][s(503)][s(439)](s(354))[s(508)](n,this[s(295)])}})),n[e(507)](this[e(295)],t)}[Uc(322)](){const t=Uc,e=this[t(381)][t(321)][t(453)];this[t(381)][t(321)][t(453)]=(...r)=>{const s=t;if(!r[r[s(383)]-1][s(409)])throw new n.CKEditorError(s(343),this);e[s(307)](this[s(381)][s(321)],r)}}[Uc(304)](){const t=Uc;this[t(381)][t(321)].on(t(512),((e,[r])=>{const o=t;if(this[o(500)][o(368)])throw new n.CKEditorError(o(316),this);e[o(437)](),this[o(440)]();const i=this[o(381)][o(366)][o(439)](o(495)),a=this[o(472)](r,i);0==a[o(383)]&&a[o(365)](new s.NoOperation(0)),e[o(464)]=this[o(522)](a)[o(388)]((()=>{const t=o;this[t(381)][t(503)][t(439)](ls)[t(435)](this),this[t(381)][t(321)][t(485)](t(518))}))[o(342)]((t=>this[o(449)](o(305),t)))[o(494)]((()=>this[o(460)]()))}),{priority:t(356)}),this[t(381)].on(t(314),(async(e,[n,r])=>{const s=t;e[s(437)]();const o=this[s(381)][s(525)][s(326)][s(359)](n);if(!this[s(329)][s(330)](n)){const t=r&&r[s(321)]?r[s(321)]:"",e=r&&r[s(349)]?r[s(349)]:{};await this[s(374)](n,t,e)}this[s(381)][s(525)][s(421)]({isUndoable:!1},(()=>{const t=s;o[t(516)]=!0,this[t(381)][t(525)][t(326)][t(317)][t(482)](o)}))}),{priority:t(356)})}async[Uc(470)](t){const e=Uc,n=this[e(381)][e(503)][e(439)](ps.Users),{connection:r}=this[e(381)][e(503)][e(439)](ls),s=new Set;for(const r of t){const t=r[e(474)];t&&!n[e(468)](t)&&s[e(288)](t)}if(0===s[e(432)])return;const o=await S[e(517)](r,Array[e(300)](s));for(const t of o)n[e(468)](t.id)||n[e(283)](t)}[Uc(472)](t,e={}){const r=Uc,o=this[r(381)][r(525)],i=[];let a=0;const c=r(483)==typeof t?{main:t}:t;for(const t of Object[r(463)](c)){if(!this[r(500)][r(524)][r(330)](t))throw new n.CKEditorError(r(527),this);const e=this[r(381)][r(321)][r(534)](c[t]),d=this[r(500)][r(359)](t),u=new s.InsertOperation(o[r(320)](d,0),e,a++);i[r(365)](u);for(const[t,n]of e[r(465)]){const e=o[r(415)](o[r(334)](d,n[r(425)][r(378)][r(397)]()),o[r(334)](d,n[r(454)][r(378)][r(397)]())),c=new s.MarkerOperation(t,null,e,o[r(465)],!0,a++);i[r(365)](c)}}if(e)for(const[t,c]of Object[r(392)](e)){const e=o[r(326)][r(359)](t);if(!e)throw new n.CKEditorError(r(436),null);for(const[t,n]of Object[r(392)](c))if(null!==n){const o=new s.RootAttributeOperation(e,t,null,n,a++);i[r(365)](o)}}return i}async[Uc(374)](t,e,n){const r=Uc;this[r(472)]({[t]:e},{[t]:n})[r(477)](((t,e)=>{const n=r;t[n(486)]=this[n(500)][n(368)]+e,t[n(434)]=!0,this[n(461)](t)})),this[r(510)](),await this[r(327)]()}async[Uc(407)](t,e){const n=Uc;let r;this[n(427)]=t[n(402)];const s=t[n(387)]&&!t[n(333)],o=s?0:t[n(321)][n(486)];if(e[n(477)]((e=>{const r=n;e[r(434)]=!0,e[r(324)]=t[r(536)],e[r(474)]=null})),s)r=e,this[n(313)](r,s);else{if(t[n(333)]){const e=this[n(472)](t[n(333)]);this[n(500)][n(533)][n(368)]=-e[n(383)],e[n(477)]((r=>{const s=n;r[s(486)]-=e[s(383)],r[s(324)]=t[s(536)],r[s(434)]=!0,r[s(474)]=null})),this[n(313)](e,!0),this[n(287)][n(368)]=-e[n(383)]+this[n(427)],this[n(332)](e)}this[n(500)][n(533)][n(368)]=o,r=this[n(393)](t[n(321)],t[n(509)]),await this[n(470)](r),this[n(313)](r,s)}t[n(418)]&&(this[n(404)][n(443)](r,t[n(418)]),this[n(299)]=t[n(418)]),this[n(287)][n(368)]=o+this[n(427)],this[n(332)](r),e[n(429)]((t=>{const e=n,r=this[e(535)](t);return r&&!this[e(329)][e(330)](r)}))[n(477)](((t,e)=>{const r=n;t[r(486)]=this[r(500)][r(368)]+e,this[r(461)](t)})),this[n(523)]()?(this[n(433)]=0,this[n(510)](!0),await this[n(327)]()):(this[n(394)]=!1,this[n(460)]())}[Uc(449)](t,e){const r=Uc,s=e&&e[r(466)];if(s&&s[r(462)](r(444)))throw e;const o=this[r(381)][r(503)][r(439)](ls);throw this[r(394)]=!0,o[r(542)](),this[r(381)][r(540)](r(284)),new n.CKEditorError(t,this[r(381)],s?{originalError:s}:void 0)}[Uc(461)](t){const e=Uc;this[e(399)][e(330)](t)||(this[e(399)][e(288)](t),this[e(502)][e(365)](t),this[e(514)]||e(377)==t[e(431)]&&!t[e(297)]||this[e(440)]())}[Uc(510)](t=!1){const e=Uc;!t&&this[e(394)]||(this[e(394)]=!0,clearTimeout(this[e(353)]),this[e(353)]=setTimeout((()=>{const t=e;this[t(413)]()[t(388)]((e=>{const n=t;e&&(this[n(460)](),this[n(394)]=!1)}))[t(342)]((e=>{const n=t;this[n(460)](),this[n(394)]=!1,function(t){const e=n;return t[e(466)][e(462)](e(438))||t[e(466)][e(462)](e(520))||t[e(466)][e(462)](e(371))}(e)||this[n(449)](e[n(466)],e)}))}),this[e(433)]))}[Uc(327)](){return new Promise((t=>{const e=Jc;this.on(e(306),(()=>{t()}))}))}async[Uc(413)](){const t=Uc,e=this[t(381)][t(503)][t(439)](Es);if(this[t(336)]()&&(e[t(428)](),this[t(369)]=!1),!this[t(523)]())return!0;const n=[...this[t(502)]];for(const e of n)e[t(380)]=this[t(500)][t(533)][t(362)](e);const r=this[t(404)][t(331)](n),s=qc++,o=this[t(541)](n),i=await this[t(484)][t(401)](o,o[t(486)],r);try{return await this[t(389)](n,i,s)}catch(e){return this[t(449)](t(496),e)}}async[Uc(389)](t,e,n){const r=Uc;if(r(318)in e)throw e[r(318)];let s=!1;if(e[r(387)]){e[r(418)]&&(this[r(299)]=e[r(418)]),this[r(502)]=this[r(502)][r(429)]((e=>!t[r(379)](e)));for(const n of t)n[r(324)]=r(505)in e&&e[r(505)]||void 0;Yc(t,e[r(368)]-t[r(383)]),this[r(332)](t);const n=t[r(429)]((t=>{const e=r;if(!t[e(434)])return!1;const n=this[e(535)](t);return n&&!this[e(329)][e(330)](n)}));Yc(n,this[r(500)][r(368)]),this[r(313)](n),s=!0,this[r(433)]=this[r(301)]}else{const t=this[r(393)](e[r(321)],e[r(509)])[r(429)]((t=>t[r(486)]>=this[r(426)]));t[r(477)]((t=>this[r(424)](t))),this[r(502)]=this[r(502)][r(429)]((t=>!t[r(434)]||!this[r(329)][r(330)](this[r(535)](t)))),this[r(502)][r(383)]&&Yc(this[r(502)],this[r(502)][0][r(486)]),await this[r(470)](t),s=this[r(340)](t,e[r(368)],e[r(418)]),this[r(433)]=Math[r(490)](this[r(433)]/2)}return s?!this[r(523)]()||(this[r(510)](!0),!1):this[r(449)](r(311))}[Uc(340)](t,e,n){const r=Uc;try{const o={document:this[r(500)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,s.transformSets)(t,this[r(502)],o);Yc(i,this[r(500)][r(368)]),Yc(a,e);for(const t of i){const e=c[r(439)](t);t[r(474)]=e?e[r(474)]:null}n&&(this[r(404)][r(443)](t,n),this[r(299)]=n),this[r(502)]=[...a],this[r(313)](i),this[r(332)](t)}catch(t){return console[r(318)](t),!1}return!0}[Uc(313)](t,e=!1){const n=Uc;this[n(381)][n(525)][n(421)]({isUndoable:!1,isLocal:!1},(e=>{const r=n;for(const n of t)this[r(399)][r(288)](n),this[r(424)](n),e[r(355)][r(455)](n),this[r(381)][r(525)][r(352)](n)}))}[Uc(424)](t){const e=Uc,n=this[e(535)](t);n&&this[e(329)][e(288)](n)}[Uc(535)](t){const e=Uc;let n,r;switch(t[e(431)]){case e(337):n=t[e(538)][e(376)];break;case e(377):if(r=t[e(294)],!r)return null;n=r[e(376)];break;case e(451):n=t[e(376)];break;case e(391):n=t[e(504)];break;case e(363):n=t[e(506)][e(376)];break;default:return null}return n[e(325)]}[Uc(332)](t){const e=Uc;t[e(477)]((t=>{const n=e,r=t[n(479)]();r[n(474)]=t[n(474)],r[n(434)]=!!t[n(434)],r[n(324)]=t[n(324)],r[n(486)]+=this[n(427)],t[n(339)]&&this[n(515)][n(288)](r),this[n(287)][n(455)](r)}))}[Uc(491)](t){const e=Uc,n=this[e(381)][e(503)][e(439)](e(282)),r=this[e(381)][e(469)];t||(t=Rs(r,e(445))),n[e(450)](t,{title:Rs(r,e(310)),namespace:e(385)}),this[e(467)]=!0,clearTimeout(this[e(353)]),this[e(502)]=[],this[e(381)][e(503)][e(439)](ls)[e(542)]()}[Uc(440)](){const t=Uc;this[t(514)]||(this[t(514)]=this[t(381)][t(503)][t(439)](e.PendingActions)[t(288)](Rs(this[t(381)][t(469)],t(458))))}[Uc(460)](){const t=Uc;this[t(514)]&&(this[t(381)][t(503)][t(439)](e.PendingActions)[t(473)](this[t(514)]),this[t(514)]=null)}[Uc(541)](t){const e=Uc,n=t[e(346)]((t=>t[e(497)]()));return this[e(298)][e(408)](n)}[Uc(393)](t,e){const n=Uc;return this[n(298)][n(360)](t)[n(346)](((t,r)=>{const o=n,i=o(512)==e[r][o(431)];if(o(357)==t[o(475)]){const e=t[o(538)][o(376)];!this[o(500)][o(359)](e)&&(this[o(500)][o(511)](o(448),e)[o(302)]=!1)}const a=s.OperationFactory[o(528)](t,this[o(500)]);return a[o(380)]=t[o(380)],a[o(434)]=i,a[o(474)]=i?null:e[r][o(526)],a[o(339)]=o(296)===e[r][o(431)],a[o(324)]=e[r][o(324)],a}))}[Uc(361)](){const t=Uc;this[t(369)]=!0,this[t(336)]()?this[t(510)]():this[t(369)]=!1}[Uc(336)](){const t=Uc,e=this[t(381)][t(503)][t(439)](ys)[t(398)][t(439)](this[t(295)]);return!this[t(381)][t(372)]&&!!e&&e[t(383)]>1&&this[t(369)]}[Uc(523)](){const t=Uc;return this[t(502)][t(383)]>0||this[t(336)]()}}Gc[Uc(519)]=br;const Lc=Gc;class Hc extends Error{}function Yc(t,e){const n=Uc;for(const r of t)r[n(486)]=e++}class zc{constructor(t){const e=Uc;this[e(537)]=t,this[e(471)]=new WeakMap}[Uc(331)](t){const e=Uc;let r=t[e(383)];for(;r--;){const s=t[r];if(!this[e(537)][e(330)](s)){if(!this[e(471)][e(330)](s)){const t=(0,n.uid)()[e(397)](1,18);this[e(471)][e(453)](s,t)}return this[e(471)][e(439)](s)}}}[Uc(443)](t,e){const n=Uc;if(!e)return;let r=t[n(383)];for(;r--;){const s=t[r];this[n(537)][n(330)](s)||this[n(471)][n(453)](s,e)}}}function Fc(t,e){var n=Wc();return(Fc=function(t,e){return n[t-=118]})(t,e)}var Kc=Fc;function Wc(){var t=["RealTimeCollaborativeEditing","isPremiumPlugin","6001300fwObJX","pluginName","1003290HJKMDt","30676352xbsLew","8758878TbktiZ","isOfficialPlugin","requires","4968246bvaaaM","1568221QilTnE","8646885OsAaGE"];return(Wc=function(){return t})()}!function(t){for(var e=Fc,n=t();;)try{if(896685===-parseInt(e(124))/1+parseInt(e(118))/2+parseInt(e(123))/3+parseInt(e(128))/4+parseInt(e(125))/5+parseInt(e(120))/6+-parseInt(e(119))/7)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Wc);class Qc extends e.Plugin{static get[Kc(122)](){return[Lc]}static get[Kc(129)](){return Kc(126)}static get[Kc(121)](){return!0}static get[Kc(127)](){return!0}}const Zc=$c;function $c(t,e){const n=Xc();return($c=function(t,e){return n[t-=383]})(t,e)}function Xc(){const t=["_terminateService","attributes","addUser","userId","set","commentThreadReopened","plugins","createdAt","commentThreadRemoved","config","reconnect","from","getCommentThreads","has","pluginName","Permissions","reopenCommentThread","CommentsRepository","catch","getComment","cloudservicescommentsadapter-disconnect-not-exist","removeCommentThread","162984xfkpId","register","listenTo","commentThreadUpdated","404","580054UmHMZw","init","assign","map","getConnectedSessions","reopen","destroy","add","_connectService","62266sgWNkY","off","get","_fetchMissingUsersForThreads","getMany","_getService","commentId","commentAdded","delete","addCommentThread","startsWith","keys","cloudservicescommentsadapter-service-not-exist","collaboration.channelId","adapter","resolvedBy","comments","isOfficialPlugin","disconnect","CloudServicesCommentsAdapter","updateComment","commentThreadAdded","cloud-services-internal-error: Request timeout.","connect","content","update","updateCommentThread","isPremiumPlugin","1792075QGJJJm","getCommentThread","sessionAdd:","permissions","unregister","1905748HlvpWI","commentUpdated","_setUpService","commentThreadId","requires","addToReconnectionStack","setPermissions","deletedAt","_services","removeComment","getUser","message","size","cloud-services-internal-error: Not connected.","addComment","authorId","context","310650FHlmip","cloudservicescommentsadapter-connect-already-connected","commentRemoved","3423448yrmPvp","code","remove","resolve","commentThreadResolved","mySessionId","cloud-services-internal-error: Comments Service is not connected.","CommentsService","resolvedAt","resolveCommentThread"];return(Xc=function(){return t})()}!function(t){const e=$c,n=t();for(;;)try{if(273222===parseInt(e(430))/1+-parseInt(e(421))/2+-parseInt(e(416))/3+parseInt(e(463))/4+-parseInt(e(458))/5+-parseInt(e(480))/6+parseInt(e(384))/7)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Xc);class td extends e.ContextPlugin{static get[Zc(467)](){return[ls,Zc(411),ys,ps.Users]}static get[Zc(408)](){return Zc(449)}static get[Zc(447)](){return!0}static get[Zc(457)](){return!0}constructor(t){const e=Zc;super(t),this[e(471)]=new Map}async[Zc(422)](){const t=Zc,n=this[t(479)],r=n[t(400)][t(432)](t(411));if(n[t(400)][t(432)](ls)[t(468)](this),r[t(444)]={addCommentThread:async({channelId:e,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=t,d=await this[c(435)](e)[c(439)]({commentThreadId:n,comments:r[c(424)]((t=>function(t,e,n){const r=c;return{commentThreadId:n,commentId:t[r(436)],userId:t[r(478)],content:t[r(454)],documentId:e,createdAt:t[r(401)],attributes:t[r(395)]||{}}}(t,e,n))),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(412)](rd);return{threadId:d[c(466)],comments:d[c(446)]}},getCommentThread:async({channelId:e,threadId:n})=>{const r=t,s=await this[r(435)](e)[r(459)](n)[r(412)](rd);return s[r(470)]?null:(await this[r(433)]([s]),{threadId:s[r(466)],comments:s[r(446)][r(424)](sd),context:s[r(479)],resolvedAt:s[r(392)],resolvedBy:s[r(445)],attributes:s[r(395)]||{}})},updateCommentThread:async({channelId:e,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[t(435)](e)[t(456)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[t(412)](nd)[t(412)](rd),resolveCommentThread:async({channelId:e,threadId:n})=>{const r=t,s=await this[r(435)](e)[r(393)](n)[r(412)](nd)[r(412)](rd);return{threadId:s[r(466)],resolvedAt:s[r(392)],resolvedBy:s[r(445)]}},reopenCommentThread:async({channelId:e,threadId:n})=>this[t(435)](e)[t(410)](n)[t(412)](nd)[t(412)](rd),removeCommentThread:({channelId:e,threadId:n})=>this[t(435)](e)[t(415)](n)[t(412)](nd)[t(412)](rd),addComment:({channelId:e,threadId:n,commentId:r,content:s,attributes:o})=>this[t(435)](e)[t(477)](n,r,s,o)[t(412)](rd),updateComment:({channelId:e,threadId:n,commentId:r,content:s,attributes:o})=>this[t(435)](e)[t(450)](n,r,s,o)[t(412)](nd)[t(412)](rd),removeComment:({channelId:e,threadId:n,commentId:r})=>this[t(435)](e)[t(472)](n,r)[t(412)](nd)[t(412)](rd)},n instanceof e.Context){const e=n[t(403)][t(432)](t(443)),r=n[t(400)][t(432)](ys);await this[t(465)](e);const s=await this[t(471)][t(432)](e)[t(425)]();this[t(418)](r,t(460)+e,((n,{session:s})=>{const o=t;s.id===r[o(389)]&&(n[o(431)](),this[o(479)][o(400)][o(432)](o(409))[o(469)](s[o(461)],e))})),r[t(417)](e,s)}}async[Zc(465)](t){const e=Zc;if(this[e(471)][e(407)](t))throw new n.CKEditorError(e(481),null,{channelId:t});const r=this[e(479)][e(400)][e(432)](e(411)),s=new(td[e(391)])(t);this[e(471)][e(398)](t,s),this[e(418)](s,e(451),((t,n)=>{const s=e,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=n;r[s(459)](o)||r[s(439)]({threadId:o,channelId:i,comments:l?l[s(424)](sd):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})})),this[e(418)](s,e(419),((t,{commentThreadId:n,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=e;r[c(459)](n)&&r[c(456)]({threadId:n,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})})),this[e(418)](s,e(388),((t,{commentThreadId:n,resolvedBy:s,resolvedAt:o})=>{const i=e,a=r[i(459)](n);a&&a[i(387)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})})),this[e(418)](s,e(399),((t,{commentThreadId:n})=>{const s=e,o=r[s(459)](n);o&&o[s(426)]({isFromAdapter:!0})})),this[e(418)](s,e(402),((t,{commentThreadId:n})=>{const s=e,o=r[s(459)](n);o&&o[s(386)]({isFromAdapter:!0})})),this[e(418)](s,e(437),((t,n)=>{const s=e,o=n[s(466)],i=r[s(459)](o);i&&i[s(477)]({...sd(n),isFromAdapter:!0})})),this[e(418)](s,e(464),((t,{commentThreadId:n,commentId:s,content:o,attributes:i})=>{const a=e,c=r[a(459)](n);if(c){const t=c[a(413)](s);t&&t[a(455)]({content:o,attributes:i,isFromAdapter:!0})}})),this[e(418)](s,e(383),((t,{commentThreadId:n,commentId:s})=>{const o=e,i=r[o(459)](n);if(i){const t=i[o(413)](s);t&&t[o(386)]({isFromAdapter:!0})}})),await this[e(429)](t)}[Zc(427)](){const t=Zc;if(this[t(479)]instanceof e.Context){const e=this[t(479)][t(403)][t(432)](t(443));this[t(394)](e)}}[Zc(394)](t){const e=Zc;if(!this[e(471)][e(407)](t))throw new n.CKEditorError(e(414),null,{channelId:t});this[e(435)](t)[e(448)](),this[e(471)][e(438)](t)}async[Zc(404)](){const t=Zc;for(const e of this[t(471)][t(441)]())await this[t(429)](e);if(this[t(479)]instanceof e.Context){const e=this[t(479)][t(403)][t(432)](t(443)),n=this[t(479)][t(400)][t(432)](ys);n[t(462)](e);const r=await this[t(471)][t(432)](e)[t(425)]();n[t(417)](e,r)}}async[Zc(429)](t){const e=Zc,{connection:n}=this[e(479)][e(400)][e(432)](ls),r=this[e(479)][e(400)][e(432)](e(411)),s=this[e(471)][e(432)](t),o=await s[e(453)](n);await this[e(433)](o);const i=new Set(Array[e(405)](r[e(406)]({channelId:t}),(t=>t.id)));for(const t of o)t[e(470)]||i[e(438)](t[e(466)]);for(const t of i)r[e(459)](t)[e(386)]({isFromAdapter:!0});for(const n of o){let s=r[e(459)](n[e(466)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[e(439)]({channelId:t,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[e(405)](s[e(446)],(t=>t.id)));for(const t of n[e(446)])p[e(438)](t[e(436)]);for(const t of p)s[e(413)](t)[e(386)]({isFromAdapter:!0});for(const t of n[e(446)]){const n=s[e(413)](t[e(436)]);n?n[e(454)]!==t[e(454)]&&n[e(455)]({content:t[e(454)],isFromAdapter:!0}):s[e(477)](Object[e(423)](sd(t),{isFromAdapter:!0}))}}}[Zc(435)](t){const e=Zc;if(!this[e(471)][e(407)](t))throw new n.CKEditorError(e(442),null,{channelId:t});return this[e(471)][e(432)](t)}async[Zc(433)](t){const e=Zc,n=this[e(479)][e(400)][e(432)](ps.Users),{connection:r}=this[e(479)][e(400)][e(432)](ls),s=new Set;for(const{resolvedBy:r,comments:o}of t){r&&!n[e(473)](r)&&s[e(428)](r);for(const{userId:t}of o)n[e(473)](t)||s[e(428)](t)}if(0===s[e(475)])return;const o=await S[e(434)](r,Array[e(405)](s));for(const t of o)n[e(473)](t.id)||n[e(396)](t)}}td[Zc(391)]=is;const ed=td;async function nd(t){const e=Zc;if(e(420)!==t[e(385)])throw t}function rd(t){const e=Zc;if((n=t)[e(474)][e(440)](e(390))||n[e(474)][e(440)](e(476))||n[e(474)][e(440)](e(452)))return new Promise((()=>{}));var n;throw t}function sd(t){const e=Zc;return{threadId:t[e(466)],commentId:t[e(436)],content:t[e(454)],createdAt:t[e(401)],authorId:t[e(397)],attributes:t[e(395)]||{}}}const od=dd;!function(t){const e=dd,n=t();for(;;)try{if(693805===parseInt(e(353))/1+parseInt(e(328))/2*(-parseInt(e(322))/3)+-parseInt(e(330))/4*(parseInt(e(372))/5)+-parseInt(e(326))/6*(-parseInt(e(378))/7)+parseInt(e(361))/8*(-parseInt(e(367))/9)+parseInt(e(360))/10*(-parseInt(e(345))/11)+parseInt(e(325))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(ad);class id extends e.Plugin{static get[od(344)](){return[ed,od(363),ls]}static get[od(380)](){return od(355)}static get[od(338)](){return!0}static get[od(331)](){return!0}constructor(t){const e=od;super(t);const n=this[e(359)][e(324)][e(383)](e(321));this[e(329)]=new Map,this[e(366)]=new(id[e(381)])(n)}[od(339)](){const t=od,e=this[t(359)][t(356)][t(383)](ls),n=this[t(359)][t(356)][t(383)](t(363));return n[t(368)]={getSuggestion:async e=>{const n=t;await this[n(332)]();const r=await this[n(366)][n(383)](e)[n(350)](ud);return await this[n(342)]([r]),r},addSuggestion:async({id:e,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=t;await this[i(332)]();const a={id:e,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(366)][i(319)](e,n,r,s,o)[i(350)]((t=>{if(ld(t))return new Promise((t=>{const n=dd;this[n(329)][n(327)](e,{resolve:t,suggestionData:a})}));throw t}));return this[i(329)][i(348)](e),c},updateSuggestion:async(e,n)=>{const r=t;if(await this[r(332)](),r(382)!==n[r(335)])return this[r(366)][r(379)](e,n)[r(350)](ud)}},this[t(370)](this[t(366)],t(384),((e,r)=>{const s=t;n[s(377)](r.id)&&(n[s(333)](r.id)[s(346)]=r[s(346)])})),this[t(366)][t(340)](e[t(323)])[t(320)]((r=>(e[t(365)](this),this[t(342)](r)[t(320)]((()=>{const e=t;for(const t of r)n[e(336)](t)[e(374)]=!0})))))}async[od(376)](){const t=od,e=this[t(359)][t(356)][t(383)](t(363)),{connection:n}=this[t(359)][t(356)][t(383)](ls),r=await this[t(366)][t(340)](n);await this[t(342)](r);for(const{suggestionData:e,resolve:n}of this[t(329)][t(349)]()){let s=r[t(354)]((t=>t.id===e.id));s||(s=await this[t(366)][t(319)](e.id,e[t(375)],e[t(373)],e[t(334)])),n(s)}for(const n of r)e[t(377)](n.id)||e[t(336)](n)}async[od(332)](){const t=od;this[t(366)][t(369)]||await new Promise((e=>{const n=t;this[n(370)](this[n(366)],n(371),(t=>{t[n(364)](),e()}))}))}async[od(342)](t){const e=od,n=this[e(359)][e(356)][e(383)](ps.Users),{connection:r}=this[e(359)][e(356)][e(383)](ls),s=new Set;for(const{authorId:r}of t)n[e(358)](r)||s[e(319)](r);if(0===s[e(351)])return;const o=await S[e(337)](r,Array[e(343)](s));for(const t of o)n[e(358)](t.id)||n[e(347)](t)}}function ad(){const t=["TrackChangesEditing","off","addToReconnectionStack","_trackChangesService","7726788uySAux","adapter","isConnected","listenTo","connected","85950CzIJdg","data","_saved","type","reconnect","hasSuggestion","28hHmglc","update","pluginName","TrackChangesService","open","get","suggestionUpdated","add","then","collaboration.channelId","749967lUeAss","connection","config","27045048gfEwkd","1253814JmNgzG","set","2vtEWRY","_bufferedRequests","316npaqSJ","isPremiumPlugin","_waitForServiceReady","getSuggestion","originalSuggestionId","state","addSuggestionData","getMany","isOfficialPlugin","init","connect","startsWith","_fetchMissingUsersForThreads","from","requires","11wZgLLH","attributes","addUser","delete","values","catch","size","message","224863hKEvJX","find","CloudServicesTrackChangesAdapter","plugins","cloud-services-internal-error: Not connected.","getUser","editor","1541570rEMtFb","8PalhDf","cloud-services-internal-error: Request timeout."];return(ad=function(){return t})()}id[od(381)]=Vn;const cd=id;function dd(t,e){const n=ad();return(dd=function(t,e){return n[t-=319]})(t,e)}function ud(t){if(ld(t))return new Promise((()=>{}));throw t}function ld(t){const e=od;return t[e(352)][e(341)](e(357))||t[e(352)][e(341)](e(362))}const pd=fd;function hd(){const t=["983627CTMXKW","4hswBmB","_setUpService","init","18216iIHhnd","isOfficialPlugin","collaboration.channelId","9661920jKtCHF","data","CommentsEditing","once","RealTimeCollaborativeComments","32496772efFNsw","ready","editor","config","3891759hQTjzp","36450bBXAHj","switchReadOnly","3080250WskMDO","isPremiumPlugin","listenTo","change:state","Comments","4480mllryd","1326qqGKab","_terminateService","pluginName","CommentsRepository","requires","plugins","connected","get","destroy","isThreadsLoadingPaused","7IIgOxy"];return(hd=function(){return t})()}function fd(t,e){const n=hd();return(fd=function(t,e){return n[t-=411]})(t,e)}!function(t){const e=fd,n=t();for(;;)try{if(811577===-parseInt(e(422))/1+parseInt(e(441))/2+parseInt(e(438))/3*(parseInt(e(423))/4)+-parseInt(e(439))/5*(-parseInt(e(411))/6)+-parseInt(e(421))/7*(-parseInt(e(429))/8)+parseInt(e(426))/9*(-parseInt(e(446))/10)+-parseInt(e(434))/11)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(hd);class md extends e.Plugin{static get[pd(415)](){return[pd(445),ed,Qc,ls]}static get[pd(413)](){return pd(433)}static get[pd(427)](){return!0}static get[pd(442)](){return!0}[pd(425)](){const t=pd,e=this[t(436)][t(416)][t(418)](ls),n=this[t(436)][t(416)][t(418)](t(431)),r=this[t(436)][t(416)][t(418)](ed);return this[t(436)][t(430)][t(432)](t(435),(()=>{const r=t;this[r(443)](e,r(444),((t,e,s)=>{const o=r;n[o(420)]=o(417)!==s}))})),this[t(443)](e,t(444),((e,n,r)=>{const s=t;this[s(436)][s(416)][s(418)](s(414))[s(440)](s(417)!==r)})),r[t(424)](this[t(436)][t(437)][t(418)](t(428)))}[pd(419)](){const t=pd;this[t(436)][t(416)][t(418)](ed)[t(412)](this[t(436)][t(437)][t(418)](t(428))),super[t(419)]()}}var yd=bd;function gd(){var t=["106603FqOROI","126OZZKom","2323940CWsaIz","isPremiumPlugin","4666710gyeuBh","requires","99282xNHsLw","RealTimeCollaborativeTrackChanges","1750260FxVIlN","9oBTBYP","isOfficialPlugin","4zMHXrA","TrackChanges","543144bqBedm","pluginName","910168vAlMJN"];return(gd=function(){return t})()}function bd(t,e){var n=gd();return(bd=function(t,e){return n[t-=402]})(t,e)}!function(t){for(var e=bd,n=t();;)try{if(294072===-parseInt(e(409))/1+parseInt(e(402))/2+parseInt(e(404))/3+parseInt(e(407))/4*(parseInt(e(414))/5)+-parseInt(e(413))/6*(-parseInt(e(412))/7)+-parseInt(e(411))/8*(parseInt(e(405))/9)+-parseInt(e(416))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(gd);class Od extends e.Plugin{static get[yd(417)](){return[md,cd,yd(408)]}static get[yd(410)](){return yd(403)}static get[yd(406)](){return!0}static get[yd(415)](){return!0}}const wd=vd;function vd(t,e){const n=Id();return(vd=function(t,e){return n[t-=188]})(t,e)}function Id(){const t=["cloud-services-internal-error: Revision History Service is not connected.","pluginName","3805LjlGeV","_waitForServiceReady","fromVersion","affectsData","400","updateRevisions","addRevisionData","bind","config","getRevision","_revisionTracker","marker","code","CloudServicesRevisionHistoryAdapter","sendBufferedUpdates","isEnabled","_fixRevision","153798ZoQZrt","100pZeBgb","addUser","connection","catch","cloud-services-internal-error: Request timeout.","_fetchMissingUsers","RevisionTracker","editor","33YQpFyq","10706871SUdZzD","get","from","plugins","reInit","_handleRevisionsUpdate","3SAJXdX","authors","getUser","remove","data","off","_getLatestVersionFromServerOperations","destroy","baseVersion","_revisions","init","_oldOffset","2873316AuTvZD","creatorId","has","connect","startsWith","once","_bufferedUpdates","requires","_bufferUpdate","cloud-services-internal-error: Not connected.","isBundleUploaded","RevisionHistoryService","_lastRequestId","_preventResendingRevisionData","4524UYGCFA","_offset","length","buildRevisionData","getOperations","repository","reverse","wrongRequestId","1384148VPWofQ","adapter","isConnected","toVersion","sessionId","getRevisions","getMany","8BnBmwl","max","_startingVersion","size","_isPendingUpdate","add","_isConnected","setSource","currentRevision","reconnect","revisionsUpdated","listenTo","_createCurrentRevision","_getLatestVersion","authorsIds","setRevisionData","isEmptyCurrent","change:_isConnected","keys","isPremiumPlugin","diffData","addToReconnectionStack","map","connected","then","state","_update","10917784rXiMtB","cloudServices.bundleVersion","_revisionDataBuilder","1326726HYPIUW","_revisionHistoryService","type","isOfficialPlugin","serverHistory","CONNECTED","collaboration.channelId","_handleReconnectionError","createdAt","message","change:_isPendingUpdate"];return(Id=function(){return t})()}!function(t){const e=vd,n=t();for(;;)try{if(944042===parseInt(e(283))/1*(parseInt(e(223))/2)+parseInt(e(299))/3*(parseInt(e(216))/4)+parseInt(e(266))/5*(parseInt(e(208))/6)+parseInt(e(293))/7+-parseInt(e(250))/8+parseInt(e(253))/9*(-parseInt(e(284))/10)+-parseInt(e(292))/11*(-parseInt(e(194))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Id);class Sd extends e.Plugin{static get[wd(201)](){return[ls,Lc,wd(290),ys,ps.Users]}static get[wd(265)](){return wd(279)}static get[wd(256)](){return!0}static get[wd(242)](){return!0}constructor(t){const e=wd;super(t);const n=this[e(291)][e(274)][e(294)](e(259));this[e(206)]=null,this[e(276)]=this[e(291)][e(296)][e(294)](e(290)),this[e(254)]=new(Sd[e(205)])(n)}async[wd(192)](){const t=wd,e=this[t(291)][t(296)][t(294)](Lc),r=e[t(257)],s=this[t(291)][t(296)][t(294)](ls);this[t(276)][t(230)]({history:r,getLatestVersion:()=>this[t(236)](),getCurrentRevisionId:()=>e[t(220)]});const o=this[t(291)][t(274)][t(294)](t(251))||n.version,i=await Ye[t(204)](s[t(286)],o);this[t(276)][t(217)]={getRevision:async({revisionId:e})=>(await this[t(267)](),await this[t(254)][t(275)](e)),updateRevisions:async e=>{const n=t;await this[n(267)]();const r=this[n(276)][n(231)];if(i&&1===e[n(210)]&&e[0].id===r.id)return e;for(const t of e)t.id===r.id&&(t[n(239)]=t[n(268)]===t[n(219)]);return this[n(254)][n(271)](e,this[n(206)])[n(247)]((t=>(this[n(206)]=t,e)))[n(287)]((t=>{const r=n;if(kd(t)||r(270)===t[r(278)]&&void 0!==t[r(303)][r(215)]){for(const t of e)!this[r(276)][r(213)][r(275)](t.id)||this[r(276)][r(202)](t.id,t,!1);if(kd(t))throw t;return e}throw t}))}},this[t(234)](this[t(254)],t(233),((e,{revisionsData:n,requestId:r})=>{const s=t;Math[s(224)](...n[s(245)]((t=>t[s(219)])))>this[s(188)]()-1?this[s(236)]()[s(247)]((()=>{this[s(298)](n,r)})):this[s(298)](n,r)}));const{revisions:a,requestId:c}=await this[t(254)][t(197)](s[t(286)]);s[t(244)](this),this[t(206)]=c,await this[t(289)](a);for(const e of a)this[t(276)][t(272)](e);this[t(234)](e,t(240),((n,r,s)=>{const o=t;s&&(this[o(193)]=e[o(209)],n[o(304)]())})),this[t(276)][t(273)](t(281)).to(s,t(248),(e=>e===Me[t(258)]))}async[wd(232)](){const t=wd,e=this[t(291)][t(296)][t(294)](ls),n=this[t(291)][t(296)][t(294)](Lc),r=async()=>{const r=t,s=this[r(276)][r(231)],o=s.id,i=o!==n[r(220)];if(i){const t=n[r(209)]-this[r(193)],e=this[r(188)]();if(this[r(276)][r(252)][r(297)](),s[r(219)]+t!==e){const n=s[r(268)]+t,o=this[r(291)][r(296)][r(294)](ps.Users),i=this[r(276)][r(211)]({revision:s,from:n,to:e});i.id=s.id;const a=i[r(237)][r(245)]((t=>o[r(301)](t)));s[r(249)]({...i,authors:a},!0),this[r(276)][r(202)](s.id,i,!0)}this[r(276)][r(225)]=e,s[r(219)]===s[r(268)]&&!this[r(276)][r(200)][r(196)](o)&&this[r(276)][r(213)][r(191)][r(302)](o),this[r(276)][r(235)](e)}const{revisions:a,requestId:c}=await this[r(254)][r(232)](e[r(286)],this[r(206)]);i&&a[r(210)]>0?n[r(260)]():(await this[r(289)](a),this[r(298)](a,c),this[r(276)][r(280)]())};return n[t(229)]?r():new Promise(((e,s)=>{const o=t;n[o(199)](o(240),(()=>{const t=o;r()[t(247)](e)[t(287)](s)}))}))}[wd(189)](){super[wd(189)]()}async[wd(267)](){const t=wd;this[t(254)][t(218)]||await new Promise((e=>{const n=t;this[n(234)](this[n(254)],n(246),(t=>{t[n(304)](),e()}))}))}[wd(188)](){const t=wd,e=this[t(291)][t(296)][t(294)](Lc)[t(257)][t(212)]()[t(214)]();for(const n of e)if(t(277)!==n[t(255)]||n[t(269)])return n[t(190)]+1}[wd(236)](){const t=wd,e=this[t(291)][t(296)][t(294)](Lc);return new Promise((n=>{const r=t;e[r(227)]?e[r(199)](r(263),(()=>{n(this[r(188)]())})):n(this[r(188)]())}))}[wd(298)](t,e){const n=wd,r=this[n(276)][n(213)];this[n(206)]=e;for(const e of t){const t=r[n(275)](e.id);if(t){if((e[n(268)]||e[n(219)])&&(e[n(243)]=null),t===this[n(276)][n(231)]){const r=Math[n(224)](t[n(219)],e[n(219)]),s=Math[n(224)](t[n(268)],e[n(268)]);let o;t[n(219)]===e[n(219)]&&t[n(268)]===e[n(268)]?(o=!0,this[n(207)](e)):e[n(219)]===r&&e[n(268)]===s?o=!1:(t[n(219)]===r&&t[n(268)]===s||this[n(282)]({revision:t,from:s,to:r}),o=!0),o&&(delete e[n(268)],delete e[n(219)],delete e[n(243)],delete e[n(261)],delete e[n(237)])}this[n(276)][n(238)](e),this[n(207)](e)}else this[n(276)][n(272)](e)}const s=r[n(221)]();s[n(214)]();for(let t=0;t<s[n(210)]-1;t++){const e=s[t],r=s[t+1];if(e[n(268)]<r[n(219)]){const t=r[n(219)],s=Math[n(224)](t,e[n(219)]);this[n(282)]({revision:e,from:t,to:s})}}}[wd(282)]({revision:t,from:e,to:n}={}){const r=wd,s=this[r(291)][r(296)][r(294)](ps.Users),o=this[r(276)][r(211)]({revision:t,from:e,to:n});o[r(300)]=o[r(237)][r(245)]((t=>s[r(301)](t))),t[r(249)](o)}[wd(207)](t){const e=wd,n={};n.id=t.id;for(const r of Object[e(241)](t))"id"!==r&&(n[r]=void 0);this[e(276)][e(202)](n.id,n,!0)}async[wd(289)](t){const e=wd,n=this[e(291)][e(296)][e(294)](ps.Users),{connection:r}=this[e(291)][e(296)][e(294)](ls),s=new Set;for(const n of t){for(const t of n[e(237)])i(t);n[e(195)]&&i(n[e(195)])}if(0===s[e(226)])return;const o=await S[e(222)](r,Array[e(295)](s));for(const t of o)n[e(301)](t.id)||n[e(285)](t);function i(t){const r=e;n[r(301)](t)||s[r(228)](t)}}}Sd[wd(205)]=ln;const Pd=Sd;function kd(t){const e=wd;return t[e(262)][e(198)](e(264))||t[e(262)][e(198)](e(203))||t[e(262)][e(198)](e(288))}var Ad=Td;function _d(){var t=["10BwNlLs","4683290JRyujP","requires","78383107Ekjtxn","isOfficialPlugin","12103542plXKQw","isPremiumPlugin","pluginName","218545AOJTAe","13233320wyFjPe","4TvqzxC","48WQitFo","6HVzogy","RealTimeCollaborativeRevisionHistory","RevisionHistory","3346329xHCtld","207658OuNtGB"];return(_d=function(){return t})()}function Td(t,e){var n=_d();return(Td=function(t,e){return n[t-=234]})(t,e)}!function(t){for(var e=Td,n=t();;)try{if(832220===-parseInt(e(236))/1+-parseInt(e(244))/2*(parseInt(e(239))/3)+-parseInt(e(238))/4*(parseInt(e(246))/5)+-parseInt(e(240))/6*(parseInt(e(243))/7)+-parseInt(e(237))/8+-parseInt(e(250))/9+parseInt(e(245))/10*(parseInt(e(248))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(_d);class Cd extends e.Plugin{static get[Ad(247)](){return[Ad(242),Pd,Qc]}static get[Ad(235)](){return Ad(241)}static get[Ad(249)](){return!0}static get[Ad(234)](){return!0}}var jd=Function.prototype,Ed=Object.prototype,Dd=jd.toString,xd=Ed.hasOwnProperty,Rd=Dd.call(Object);const Nd=function(t){if(!oi(t)||"[object Object]"!=lo(t))return!1;var e=oa(t);if(null===e)return!0;var n=xd.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dd.call(n)==Rd};const Vd=function(t){return oi(t)&&1===t.nodeType&&!Nd(t)};function Md(){const t=["bindTemplate","3201688lqZRrt","setTemplate","584336hfQxKD","5257190cjLCcv","set","5RPiQWQ","usersCount","ck-presence-list__counter--hidden","9dyRWmD","ck-presence-list__counter","div","isHidden","6zxqDMq","102926uUtInn","1340840TXOtnb","98231vtoTAb","129645QXYOQp","CONNECTED_USERS"];return(Md=function(){return t})()}function Bd(t,e){const n=Md();return(Bd=function(t,e){return n[t-=385]})(t,e)}!function(t){const e=Bd,n=t();for(;;)try{if(447272===parseInt(e(403))/1+-parseInt(e(385))/2+-parseInt(e(387))/3+-parseInt(e(392))/4*(-parseInt(e(395))/5)+parseInt(e(402))/6*(-parseInt(e(386))/7)+parseInt(e(390))/8+-parseInt(e(398))/9*(-parseInt(e(393))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Md);class Ud extends r.View{constructor(t){const e=Bd;super(t);const n=this[e(389)];this[e(394)](e(396),0),this[e(394)](e(401),!0),this[e(391)]({tag:e(400),attributes:{class:["ck",e(399),n.if(e(401),e(397))]},children:[{text:n.to(e(396),(n=>Rs(t,e(388),n)))}]})}}const Jd=qd;function qd(t,e){const n=Gd();return(qd=function(t,e){return n[t-=397]})(t,e)}function Gd(){const t=["removeAttribute","listenTo","list","5378256zRDqyy","focus","div","3390924OGuAfQ","render","Collapsed connected users list (press ENTER to open it)","setAttribute","set","2307403uJMnYf","bindTemplate","items","637483sOwoCU","isExpanded","1714962Ksfrfy","fire","hasPopup","251026QCJcRE","execute","createCollection","element","change:hasPopup","5492TPvxZU","setTemplate","Connected users list","aria-expanded","keystrokes","ck-presence-list__list","545KczFnr"];return(Gd=function(){return t})()}!function(t){const e=qd,n=t();for(;;)try{if(325474===parseInt(e(400))/1+-parseInt(e(405))/2+parseInt(e(402))/3+-parseInt(e(410))/4*(-parseInt(e(416))/5)+-parseInt(e(423))/6+parseInt(e(397))/7+-parseInt(e(420))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Gd);class Ld extends r.View{constructor(t){const e=qd;super(t);const r=this[e(398)];this[e(399)]=this[e(407)](),this[e(414)]=new n.KeystrokeHandler,this[e(427)]({hasPopup:!1,isExpanded:!1}),this[e(411)]({tag:e(422),attributes:{"aria-haspopup":r.if(e(404)),"aria-expanded":r.to(e(401),(t=>this[e(404)]&&String(t))),"aria-label":r.to(e(404),(n=>Rs(t,e(n?425:412)))),role:e(419),tabindex:r.to(e(404),(t=>!!t&&0)),class:["ck",e(415)]},children:this[e(399)],on:{click:r.to((()=>this[e(403)](e(406))))}}),this.on(e(409),((t,n,r)=>{const s=e;this[s(408)]&&(r?this[s(408)][s(426)](s(413),String(this[s(401)])):this[s(408)][s(417)](s(413)))}))}[Jd(421)](){const t=Jd;this[t(408)][t(421)]()}[Jd(424)](){const t=Jd;super[t(424)](),this[t(414)][t(418)](this[t(408)])}}var Hd=__webpack_require__(106),Yd={attributes:{"data-cke":!0}};Yd.setAttributes=Ps(),Yd.insert=Is().bind(null,"head"),Yd.domAPI=ws(),Yd.insertStyleElement=As();bs()(Hd.A,Yd);Hd.A&&Hd.A.locals&&Hd.A.locals;function zd(){const t=["items","first","div","listenTo","set","5255zccjWH","2284768NkHibn","counterView","locale","5950881GNpKnf","bindTemplate","5MGPbDL","966156tpeZsy","ck-reset","isCollapsed","ck-rounded-corners","setTemplate","186pkguwx","ck-presence-list","ck-presence-list--collapsed","5081424URfNnO","tooltipPosition","bind","1180209jKUvVb","5770114wInrey","inlineListView","change","hasPopup"];return(zd=function(){return t})()}function Fd(t,e){const n=zd();return(Fd=function(t,e){return n[t-=249]})(t,e)}!function(t){const e=Fd,n=t();for(;;)try{if(535479===parseInt(e(276))/1*(parseInt(e(260))/2)+-parseInt(e(266))/3+-parseInt(e(249))/4+parseInt(e(254))/5*(parseInt(e(255))/6)+parseInt(e(267))/7+-parseInt(e(263))/8+parseInt(e(252))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(zd);class Kd extends r.View{constructor(t){const e=Fd;super(t);const n=this[e(253)];this[e(275)](e(257),!0),this[e(250)]=new Ud(this[e(251)]),this[e(268)]=new Ld(t),this[e(268)][e(265)](e(270)).to(this,e(257)),this[e(274)](this[e(268)][e(271)],e(269),(()=>{const t=e;for(const e of this[t(268)][t(271)])e[t(264)]="s";this[t(268)][t(271)][t(272)]&&(this[t(268)][t(271)][t(272)][t(264)]="se")})),this[e(259)]({tag:e(273),attributes:{class:["ck",e(261),e(256),e(258),n.if(e(257),e(262))]},children:[this[e(250)],this[e(268)]]})}}const Wd=$d;function Qd(){const t=["element","role","3169240LmwGMu","innerHeight","3873780NmjcAg","checkIfScrollable","div","ck-presence-list__dropdown-list-wrapper_scrollable","ck-reset","bindTemplate","ck-presence-list__dropdown-list","resize","7547496gBvqFP","1925553KuTQRB","listWrapperView","776475jCBVlT","clientHeight","max","4KGxFQY","setTemplate","scrollHeight","listenTo","ariaLabelledBy","window","render","ck-presence-list__dropdown-list-wrapper","items","set","ck-list","Connected users list dropdown menu","ariaLabel","change","_isScrollable","application","1900212qLDQxU","198264VKwSUG","387hxZEQb"];return(Qd=function(){return t})()}!function(t){const e=$d,n=t();for(;;)try{if(644634===parseInt(e(392))/1+-parseInt(e(395))/2*(parseInt(e(411))/3)+parseInt(e(418))/4+parseInt(e(416))/5+-parseInt(e(389))/6+-parseInt(e(390))/7+parseInt(e(412))/8*(parseInt(e(413))/9))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Qd);class Zd extends r.View{constructor(t,e){const n=$d;super(t),this[n(391)]=new Xd(t,e),this[n(396)]({tag:n(383),attributes:{tabindex:-1,role:n(410),class:["ck",n(387)],"aria-label":Rs(t,n(406))},children:[this[n(391)]]})}}function $d(t,e){const n=Qd();return($d=function(t,e){return n[t-=382]})(t,e)}class Xd extends r.ListView{constructor(t,e){const r=$d;super(t);const s=this[r(386)];this[r(404)](r(409),!1),this[r(396)]({tag:e?r(383):"ul",attributes:{class:["ck",r(385),r(405),r(402),s.if(r(409),r(384))],role:s.to(r(415)),"aria-label":s.to(r(407)),"aria-labelledby":s.to(r(399))},children:this[r(403)]}),this[r(398)](n.global[r(400)],r(388),(()=>this[r(382)]())),this[r(403)].on(r(408),(()=>this[r(382)]()))}[Wd(401)](){const t=Wd;super[t(401)](),this[t(382)]()}[Wd(382)](){const t=Wd,e=this[t(414)];e&&(this[t(409)]=Math[t(394)](e[t(397)],e[t(393)])>.8*window[t(417)])}}function tu(){const t=["ck-user__full-name","ck-presence-list__dropdown-list-item","name","execute","presentation","ck-presence-list__marker","2246950KbKWpT","span","1848595UImIvK","getBackgroundColorClass","tag","element","color","18FjntqM","3830376pQnYJS","3631390kCJcjc","472NArdQC","bindTemplate","112131gcIdKz","fire","true","10GVwszE","button","userView","setTemplate","297561TGDmmq","focus","3903543OQVkQu"];return(tu=function(){return t})()}const eu=nu;function nu(t,e){const n=tu();return(nu=function(t,e){return n[t-=345]})(t,e)}!function(t){const e=nu,n=t();for(;;)try{if(779193===parseInt(e(361))/1*(parseInt(e(357))/2)+-parseInt(e(363))/3+-parseInt(e(350))/4+-parseInt(e(372))/5*(-parseInt(e(349))/6)+-parseInt(e(351))/7+-parseInt(e(352))/8*(-parseInt(e(354))/9)+parseInt(e(370))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(tu);class ru extends r.ListItemView{constructor(t,e,n){const r=nu;super(t);const s=this[r(353)];this[r(359)]=new ps.UserView(t,e);const o={tag:"li",attributes:{class:["ck",r(365)],tabindex:-1,role:r(368),"aria-label":e[r(366)]},children:[this[r(359)],{tag:r(371),attributes:{class:["ck",r(364)]},children:[{text:e[r(366)]}]},{tag:r(371),attributes:{class:["ck",r(369),e[r(348)][r(345)]()],"aria-hidden":r(356)}}]};n&&(o[r(346)]=r(358),o.on={click:s.to((()=>this[r(355)](r(367))))}),this[r(360)](o)}[eu(362)](){const t=eu;this[t(347)][t(362)]()}}function su(t,e){const n=iu();return(su=function(t,e){return n[t-=107]})(t,e)}!function(t){const e=su,n=t();for(;;)try{if(846907===parseInt(e(142))/1*(-parseInt(e(133))/2)+parseInt(e(132))/3*(parseInt(e(138))/4)+-parseInt(e(111))/5*(parseInt(e(118))/6)+parseInt(e(116))/7*(-parseInt(e(140))/8)+parseInt(e(136))/9*(parseInt(e(128))/10)+-parseInt(e(112))/11+parseInt(e(124))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(iu);class ou extends r.View{constructor(t,e,n){const s=su;super(t);const o=this[s(141)];this[s(109)](s(121),!1),this[s(109)](s(127),!0),this[s(109)](s(110),""),this[s(129)]=new ps.UserView(t,e),this[s(126)]=new au(t,e);const i=new r.LabelView(t);i[s(119)][s(137)]=s(125),i[s(120)]=e[s(115)];const a={tag:s(134),attributes:{class:["ck",s(131)],role:s(139),tabindex:o.to(s(121),(t=>!!t&&0)),"aria-labelledby":i.id,"data-cke-tooltip-text":this[s(129)][s(115)],"data-cke-tooltip-position":o.to(s(110)),"data-cke-tooltip-disabled":o.to(s(127),(t=>!t)),"data-cke-tooltip-class":s(108)},children:[this[s(129)],this[s(126)],i]};n&&(a[s(137)]=s(130),a.on={click:o.to((()=>this[s(117)](s(123))))}),this[s(113)](a)}}function iu(){const t=["execute","50223900SegGuM","span","markerView","hasTooltip","24050tWiRCU","userView","button","ck-presence-list__list-item","853131ZTIIKo","2223686ZrLGQM","div","ck-presence-list__marker","1602NShhQz","tag","4krMdyb","listitem","20904fZqMpO","bindTemplate","1hsHZOU","getBackgroundColorClass","ck-presence-list__list-item__tooltip","set","tooltipPosition","1147825JKRZDs","17227320gohgvP","setTemplate","true","name","1218BHbDKF","fire","24rQHuXS","template","text","isFocusable","color"];return(iu=function(){return t})()}class au extends r.View{constructor(t,e){const n=su;super(t),this[n(113)]({tag:n(125),attributes:{class:["ck",n(135),e[n(122)][n(107)]()],"aria-hidden":n(114)}})}}const cu=du;function du(t,e){const n=lu();return(du=function(t,e){return n[t-=132]})(t,e)}!function(t){const e=du,n=t();for(;;)try{if(530185===-parseInt(e(144))/1+parseInt(e(151))/2+parseInt(e(134))/3+parseInt(e(216))/4*(-parseInt(e(193))/5)+parseInt(e(162))/6+-parseInt(e(220))/7+parseInt(e(147))/8*(parseInt(e(207))/9))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(lu);const uu={collapseAt:6,displayMe:!0};function lu(){const t=["2572101DkXoWN","Enter","set","focus","indexOf","tabIndex","destroy","hideDropdown","bindTo","isCollapsed",':not([disabled]):not([tabindex="-1"])',"onClick","presenceList.container","_handleUserRemove","686064jEself","plugins","content","input","textarea","presenceDropdownView","listenTo","add","offsetWidth","Esc","1002642AZqtHX","button","requires","8cGxkyI","filter","isFocusable","presenceList.collapseAt","1639596wUMtae","view","length","execute","get","init","activeElement","Shift+Tab","counterView","offsetHeight","bind","51720fgyxoM","[contenteditable]","allConnectedUsers","context","_handleUserAdd","body","isRendered","reverse","presenceList.displayMe","remove","sort","unpin","isExpanded","showDropdown","from","min","balloonPanelView","map","isHidden","items","isMe","render","element","presenceList","usersCount","inlineListView","isVisible","using","number","_bodyCollection","config","4647865QKFSTC","displayMe","select","_createView","pin","ck ck-presence-list__balloon","attachToDom","focusTracker","appendChild","hasTooltip","class","_allConnectedUsers","join","detachFromDom","15954633raZzFj","locale","Tab","keystrokes","presencelist-collapseat-invalid-format","change:isFocused","[tabindex]","define","presencelist-missing-container","4lcHLSU","currentDisplayedUsers","querySelectorAll","checkIfScrollable"];return(lu=function(){return t})()}class pu extends e.ContextPlugin{constructor(t){const e=du;super(t),this[e(191)]=null,this[e(165)][e(192)][e(214)](e(185),uu);const s=t[e(192)][e(155)](e(150));if(e(190)!=typeof s)throw new n.CKEditorError(e(211),this);if(s<1)throw new n.CKEditorError(e(211),this);this[e(204)]=this[e(165)][e(135)][e(155)](ys)[e(164)],this[e(222)](e(186),0),this[e(217)]=new n.Collection,this[e(178)]=new r.BalloonPanelView,this[e(178)][e(203)]=e(198),this[e(152)]=this[e(196)](),this[e(139)]=void 0}static get[cu(146)](){return[ys]}[cu(156)](){const t=cu;for(const e of this[t(204)])this[t(166)](e);this[t(140)](this[t(204)],t(141),((e,n)=>{this[t(166)](n)})),this[t(140)](this[t(204)],t(171),((e,n)=>{this[t(133)](n)}))}[cu(196)](){const t=cu,e=this[t(165)],s=new Kd(this[t(165)][t(208)]),o=this[t(178)];if(!Vd(e[t(192)][t(155)](t(132))))throw new n.CKEditorError(t(215),this);return s[t(159)][t(161)](t(186)).to(this),s[t(161)](t(229)).to(this,t(186),(n=>{const r=t,{collapseAt:o,displayMe:i}=e[r(192)][r(155)](r(185)),a=n>=o;return s[r(159)][r(180)]=!(1==n&&i||a),a||this[r(227)](),a})),s[t(187)][t(181)][t(228)](this[t(217)])[t(189)]((n=>{const r=t,o=e[r(192)][r(155)](r(185)),i=new ou(e[r(208)],n,!!o[r(231)]);return i[r(161)](r(202)).to(s,r(229),(t=>!t)),i[r(161)](r(149)).to(s,r(229),(t=>!t)),o[r(231)]&&this[r(140)](i,r(154),(()=>{const t=r;this[t(152)][t(229)]||o[t(231)](n,i[t(184)])})),i})),this[t(140)](s[t(187)],t(154),(()=>{const e=t;this[e(139)]?this[e(227)]():this[e(152)][e(229)]&&this[e(175)]()})),s[t(187)][t(210)][t(222)](t(221),((e,n)=>{const r=t;this[r(152)][r(229)]&&(this[r(175)](),n())})),s[t(183)](),o[t(183)](),(0,r.clickOutsideHandler)({emitter:s,activator:()=>o[t(188)],contextElements:[o[t(184)],s[t(187)][t(184)]],callback:()=>this[t(227)]()}),e[t(192)][t(155)](t(132))[t(201)](s[t(184)]),this[t(191)]=new r.BodyCollection(this[t(165)][t(208)]),this[t(191)][t(199)](),this[t(191)][t(141)](this[t(178)]),s}[cu(166)](t){const e=cu;if(!this[e(165)][e(192)][e(155)](e(170))&&t[e(182)])return;const n=this[e(165)][e(192)][e(155)](e(150))-1;this[e(186)]++,this[e(217)][e(153)]==n&&this[e(217)][e(153)]>1&&this[e(217)][e(171)](1);const r=t[e(182)]?0:this[e(217)][e(153)];this[e(217)][e(141)](t,r)}[cu(133)](t){const e=cu;if(this[e(186)]--,this[e(217)][e(155)](t.id)&&(this[e(217)][e(171)](t.id),this[e(217)][e(153)]<this[e(186)]))for(const t of Array[e(176)](this[e(204)])[e(169)]())if(!this[e(217)][e(155)](t.id))return void this[e(217)][e(141)](t,Math[e(177)](this[e(217)][e(153)],1))}[cu(175)](){const t=cu;if(this[t(139)])return;const e=this[t(165)][t(192)][t(155)](t(185));this[t(139)]=new Zd(this[t(165)][t(208)],!!e[t(231)]),this[t(152)][t(187)][t(174)]=!0;const{listWrapperView:n}=this[t(139)];n[t(181)][t(228)](this[t(204)])[t(189)]((n=>{const r=t;if(!e[r(194)]&&n[r(182)])return null;const s=new ru(this[r(165)][r(208)],n,!!e[r(231)]);return e[r(231)]&&this[r(140)](s,r(154),(()=>{const t=r;e[t(231)](n,s[t(184)])})),s})),this[t(178)][t(136)][t(141)](this[t(139)]),this[t(178)][t(197)]({target:this[t(152)][t(187)][t(184)]}),n[t(223)](),n[t(219)]();const r=(e,n)=>{const r=t;this[r(227)](),this[r(152)][r(187)][r(223)](),n()};n[t(210)][t(222)](t(143),r),n[t(210)][t(222)](t(158),r),n[t(210)][t(222)](t(209),((e,n)=>{const r=t;!function(t){const e=du,n=["a",e(145),e(137),e(195),e(138),e(213),e(163)][e(179)]((t=>t+e(230)))[e(205)](","),r=[...document[e(167)][e(218)](n)][e(148)]((t=>t===document[e(157)]||t[e(142)]+t[e(160)]>0))[e(172)](((t,n)=>(t[e(225)]||0)-(n[e(225)]||0))),s=r[e(224)](t),o=r[(s+1)%r[e(153)]];o&&o[e(223)]()}(this[r(152)][r(184)]),this[r(227)](),n()})),n[t(200)][t(141)](this[t(152)][t(184)]),n[t(200)].on(t(212),((e,n,r)=>{r||this[t(227)]()}))}[cu(227)](){const t=cu;this[t(139)]&&(this[t(152)][t(187)][t(174)]=!1,this[t(178)][t(173)](),this[t(178)][t(136)][t(171)](this[t(139)]),this[t(139)][t(226)](),this[t(139)]=void 0)}[cu(226)](){const t=cu;super[t(226)](),this[t(152)]&&this[t(152)][t(168)]&&this[t(152)][t(226)](),this[t(191)]&&(this[t(191)][t(206)](),this[t(191)][t(226)](),this[t(191)]=null)}}var hu=fu;function fu(t,e){var n=mu();return(fu=function(t,e){return n[t-=220]})(t,e)}function mu(){var t=["isOfficialPlugin","requires","isPremiumPlugin","823116DJuywK","PresenceList","197740hjYOGo","16kisIdO","398118AZPloT","pluginName","29496TnPlxE","575886qjOpgd","941418QgVZcr","8SZAPaR","200425YFFbor"];return(mu=function(){return t})()}!function(t){for(var e=fu,n=t();;)try{if(198333===parseInt(e(220))/1+-parseInt(e(230))/2+parseInt(e(228))/3+-parseInt(e(223))/4*(-parseInt(e(224))/5)+-parseInt(e(221))/6+-parseInt(e(232))/7*(-parseInt(e(231))/8)+-parseInt(e(222))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(mu);class yu extends e.ContextPlugin{static get[hu(226)](){return[ys,pu]}static get[hu(233)](){return hu(229)}static get[hu(225)](){return!0}static get[hu(227)](){return!0}}function gu(){var t=["10683018iYksla","1773686DJhnPz","1523840dBAsCP","3070020NQUIfm","3Fbcvjd","6ycnsYc","679BnqCLp","2351968LchGHR","96664ifmOCg","1207631xOTpbM"];return(gu=function(){return t})()}function bu(t,e){var n=gu();return(bu=function(t,e){return n[t-=231]})(t,e)}!function(t){for(var e=bu,n=t();;)try{if(713873===-parseInt(e(231))/1+-parseInt(e(233))/2*(-parseInt(e(236))/3)+parseInt(e(239))/4+-parseInt(e(235))/5*(-parseInt(e(237))/6)+-parseInt(e(238))/7*(-parseInt(e(240))/8)+-parseInt(e(232))/9+-parseInt(e(234))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(gu)})(),(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: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}.ck.ck-presence-list__counter{color:var(--ck-color-base-text);margin-right:var(--ck-spacing-large)}.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-small);outline:none;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-tooltip.ck-presence-list__list-item__tooltip>.ck-tooltip__text{display:inline-block;max-width:var(--ck-presence-list-users-tooltip-max-width);overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__marker{display:block;height:3px;margin-top:3px;position:relative;width:100%}.ck-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)}.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)*-1 + 7px);padding: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:nth-last-child(2){opacity:.75}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(3){opacity:.55}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(4){opacity:.35}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(5){opacity:.15}.ck.ck-presence-list--collapsed .ck.ck-presence-list__list-item:nth-last-child(n+6){display:none}.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 .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}@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:()=>ed,CloudServicesRevisionHistoryAdapter:()=>Pd,CloudServicesTrackChangesAdapter:()=>cd,PresenceList:()=>yu,RealTimeCollaborationClient:()=>Gc,RealTimeCollaborativeComments:()=>md,RealTimeCollaborativeEditing:()=>Qc,RealTimeCollaborativeRevisionHistory:()=>Cd,RealTimeCollaborativeTrackChanges:()=>Od,Sessions:()=>ms});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{Decoder:()=>Vt,Encoder:()=>Rt,PacketType:()=>xt,protocol:()=>Dt});var e=__webpack_require__(782),n=__webpack_require__(584),r=__webpack_require__(311),s=__webpack_require__(783);class o{constructor(...t){}}class i extends o{constructor(...t){super()}static fromJSON(t){throw new TypeError("Must be implemented in a child class!")}}i.TYPE="1000";const a=i;class c extends a{constructor(t){super(),this.id=t}toJSON(){return{id:this.id}}static fromJSON(t){return new c(t.id)}}c.TYPE="21",c.READABLE_TYPE_NAME="getUser",c.DESCRIPTOR_NAME="GetUserMessage",c.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const d=c;class u extends a{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 u(e)}}u.DESCRIPTOR_NAME="GetUserResponse",u.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};const l=u;var p=__webpack_require__(199);const h=(()=>{var t=p.Reader,e=p.Writer,n=p.util,r=p.roots.default||(p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.OperationMetadataDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.userId=e.string();break;case 2:o.type=e.string();break;case 3:o.createdAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingConnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.bundleVersion=e.string();break;case 3:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(e.bytes());break;case 4:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.types.push(e.uint32());else o.types.push(e.uint32());break;case 5:o.lastOperationId=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingReconnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.bundleVersion=e.string();break;case 3:o.lastKnowVersion=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingUpdateMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.baseVersion=e.uint32();break;case 3:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(e.bytes());break;case 4:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.types.push(e.uint32());else o.types.push(e.uint32());break;case 6:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:o.lastOperationId=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetDocumentDetailsMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.environmentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.offset=e.uint32();break;case 3:o.version=e.uint32();break;case 4:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(e.bytes());break;case 5:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.types.push(e.uint32());else o.types.push(e.uint32());break;case 7:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:o.initData=e.string();break;case 9:o.isInitialized=e.bool();break;case 10:o.sessionId=e.string();break;case 11:o.lastOperationId=e.string();break;case 12:o.sessionCreatedAt=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CollaborativeEditingResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.version=e.uint32();break;case 2:o.buffers&&o.buffers.length||(o.buffers=[]),o.buffers.push(e.bytes());break;case 3:if(o.types&&o.types.length||(o.types=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)o.types.push(e.uint32());else o.types.push(e.uint32());break;case 5:o.metadata&&o.metadata.length||(o.metadata=[]),o.metadata.push(r.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:o.lastOperationId=e.string();break;case 7:o.lastOperationAcceptedAt=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetDocumentDetailsResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.lastDocumentSessionId=e.string();break;case 2:o.lastDocumentSessionOperationId=e.string();break;case 3:o.currentDocumentSessionId=e.string();break;case 4:o.currentDocumentSessionVersion=e.uint32();break;case 5:o.currentDocumentSessionOperationId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentId=e.string();break;case 2:o.commentThreadId=e.string();break;case 3:o.userId=e.string();break;case 4:o.content=e.string();break;case 5:o.documentId=e.string();break;case 6:o.createdAt=e.string();break;case 7:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsThreadDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentDescriptor.decode(e,e.uint32()));break;case 3:o.resolvedAt=e.string();break;case 4:o.resolvedBy=e.string();break;case 5:o.context=e.string();break;case 6:o.createdAt=e.string();break;case 7:o.deletedAt=e.string();break;case 8:o.attributes=e.string();break;case 9:o.unlinkedAt=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentThreadAddedCommentDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentId=e.string();break;case 2:o.createdAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2AddCommentMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.content=e.string();break;case 3:o.documentId=e.string();break;case 4:o.commentId=e.string();break;case 5:o.createdAt=e.string();break;case 6:o.userId=e.string();break;case 7:o.attributes=e.string();break;case 8:o.commentThread=r.CommentsThreadDescriptor.decode(e,e.uint32());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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2AddCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.commentThreadId=e.string();break;case 3:o.context=e.string();break;case 4:o.createdAt=e.string();break;case 5:o.resolvedAt=e.string();break;case 6:o.resolvedBy=e.string();break;case 7:o.attributes=e.string();break;case 8:o.deletedAt=e.string();break;case 9:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ReopenCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ResolveCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=e.string();break;case 3:o.resolvedBy=e.string();break;case 4:o.resolvedAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2UpdateCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=e.string();break;case 3:o.context=e.string();break;case 4:o.attributes=e.string();break;case 5:o.unlinkedAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ConnectMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2GetCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2GetDocumentThreadsMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2RemoveCommentMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.commentId=e.string();break;case 3:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2RemoveCommentThreadMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2UpdateCommentMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.commentId=e.string();break;case 3:o.content=e.string();break;case 4:o.documentId=e.string();break;case 5:o.attributes=e.string();break;case 6:o.isAttributesUpdated=e.bool();break;case 7:o.commentThread=r.CommentsThreadDescriptor.decode(e,e.uint32());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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2AddCommentResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.commentId=e.string();break;case 3:o.createdAt=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2AddCommentThreadResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.createdAt=e.string();break;case 3:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(r.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ResolveCommentThreadResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.documentId=e.string();break;case 3:o.resolvedAt=e.string();break;case 4:o.resolvedBy=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2ConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.threads&&o.threads.length||(o.threads=[]),o.threads.push(e.string());break;case 3:o.threadsV2&&o.threadsV2.length||(o.threadsV2=[]),o.threadsV2.push(r.CommentsThreadDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2GetCommentThreadResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.commentThreadId=e.string();break;case 2:o.comments&&o.comments.length||(o.comments=[]),o.comments.push(e.string());break;case 3:o.commentsV2&&o.commentsV2.length||(o.commentsV2=[]),o.commentsV2.push(r.CommentDescriptor.decode(e,e.uint32()));break;case 4:o.resolvedAt=e.string();break;case 5:o.resolvedBy=e.string();break;case 6:o.context=e.string();break;case 7:o.createdAt=e.string();break;case 8:o.deletedAt=e.string();break;case 9:o.attributes=e.string();break;case 10:o.unlinkedAt=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.CommentsV2GetDocumentThreadsResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.threads&&o.threads.length||(o.threads=[]),o.threads.push(e.string());break;case 2:o.threadsV2&&o.threadsV2.length||(o.threadsV2=[]),o.threadsV2.push(r.CommentsThreadDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.KeyValueDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.key=e.string();break;case 2:o.value=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.IsEditorBundleUploadedMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.bundleVersion=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.IsEditorBundleUploadedResponse;e.pos<s;){var i=e.uint32();i>>>3==1?o.isUploaded=e.bool():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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.revisionId=e.string();break;case 2:o.name=e.string();break;case 3:o.creatorId=e.string();break;case 4:o.authorsIds=e.string();break;case 5:o.diffData=e.string();break;case 6:o.createdAt=e.string();break;case 7:o.attributes=e.string();break;case 8:o.toVersion=e.uint32();break;case 9:o.fromVersion=e.uint32();break;case 10:o.isEmptyCurrent=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryConnectMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryGetRevisionMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.revisionId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryReconnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.requestId=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryUpdateRevisionsMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.documentId=e.string();break;case 2:o.requestId=e.uint32();break;case 3:o.revisions&&o.revisions.length||(o.revisions=[]),o.revisions.push(r.RevisionDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.requestId=e.uint32();break;case 3:o.revisions&&o.revisions.length||(o.revisions=[]),o.revisions.push(r.RevisionDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryGetRevisionResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.revisionId=e.string();break;case 2:o.name=e.string();break;case 3:o.creatorId=e.string();break;case 4:o.authorsIds=e.string();break;case 5:o.diffData=e.string();break;case 6:o.createdAt=e.string();break;case 7:o.attributes=e.string();break;case 8:o.toVersion=e.uint32();break;case 9:o.fromVersion=e.uint32();break;case 10:o.isEmptyCurrent=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.RevisionHistoryUpdateRevisionsResponse;e.pos<s;){var i=e.uint32();i>>>3==1?o.requestId=e.uint32():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SessionsSocketDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.session=e.string();break;case 2:o.user=e.string();break;case 3:o.role=e.string();break;case 4:o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SessionsConnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.sessionType=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SocketConnectMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.userId=e.string();break;case 3:o.role=e.string();break;case 4:o.permissions&&o.permissions.length||(o.permissions=[]),o.permissions.push(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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SocketDisconnectMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.id=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SessionsConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.sockets&&o.sockets.length||(o.sockets=[]),o.sockets.push(r.SessionsSocketDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.SuggestionDescriptor;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.authorId=e.string();break;case 3:o.type=e.string();break;case 4:o.createdAt=e.string();break;case 5:o.data=e.string();break;case 6:o.hasComments=e.bool();break;case 7:o.state=e.string();break;case 8:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesAddSuggestionMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.documentId=e.string();break;case 3:o.type=e.string();break;case 4:o.data=e.string();break;case 5:o.originalSuggestionId=e.string();break;case 6:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesBatchUpdateSuggestionsStateMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.ids&&o.ids.length||(o.ids=[]),o.ids.push(e.string());break;case 2:o.documentId=e.string();break;case 3:o.state=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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesConnectMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesGetAllSuggestionMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.documentId=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesGetSuggestionMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.documentId=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesUpdateSuggestionMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.documentId=e.string();break;case 3:o.hasComments=e.bool();break;case 4:o.isHasCommentsModified=e.bool();break;case 5:o.state=e.string();break;case 6:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesAddSuggestionResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.authorId=e.string();break;case 3:o.type=e.string();break;case 4:o.createdAt=e.string();break;case 5:o.data=e.string();break;case 6:o.hasComments=e.bool();break;case 7:o.state=e.string();break;case 8:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesConnectResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.channel=e.string();break;case 2:o.suggestions&&o.suggestions.length||(o.suggestions=[]),o.suggestions.push(e.string());break;case 3:o.suggestionsV2&&o.suggestionsV2.length||(o.suggestionsV2=[]),o.suggestionsV2.push(r.SuggestionDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesGetAllSuggestionsResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.suggestions&&o.suggestions.length||(o.suggestions=[]),o.suggestions.push(e.string());break;case 2:o.suggestionsV2&&o.suggestionsV2.length||(o.suggestionsV2=[]),o.suggestionsV2.push(r.SuggestionDescriptor.decode(e,e.uint32()));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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.TrackChangesGetSuggestionResponse;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.id=e.string();break;case 2:o.authorId=e.string();break;case 3:o.type=e.string();break;case 4:o.createdAt=e.string();break;case 5:o.data=e.string();break;case 6:o.hasComments=e.bool();break;case 7:o.state=e.string();break;case 8:o.attributes=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.UserDescriptor;e.pos<s;){var i=e.uint32();i>>>3==1?(o.attributes&&o.attributes.length||(o.attributes=[]),o.attributes.push(r.KeyValueDescriptor.decode(e,e.uint32()))):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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetManyUsersMessage;e.pos<s;){var i=e.uint32();i>>>3==1?(o.ids&&o.ids.length||(o.ids=[]),o.ids.push(e.string())):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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetUserMessage;e.pos<s;){var i=e.uint32();i>>>3==1?o.id=e.string():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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetManyUsersResponse;e.pos<s;){var i=e.uint32();i>>>3==1?(o.users&&o.users.length||(o.users=[]),o.users.push(r.UserDescriptor.decode(e,e.uint32()))):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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.GetUserResponse;e.pos<s;){var i=e.uint32();i>>>3==1?(o.attributes&&o.attributes.length||(o.attributes=[]),o.attributes.push(r.KeyValueDescriptor.decode(e,e.uint32()))):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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.ChannelMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.type=e.uint32();break;case 2:o.socketId=e.string();break;case 3:o.data=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.BytesBytesPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.bytes();break;case 2:o.data1=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.NumberBytesPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.uint32();break;case 2:o.data1=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.NumberNumberPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.uint32();break;case 2:o.data1=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.NumberObjectPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.uint32();break;case 2:o.data1=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.NumberStringPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.uint32();break;case 2:o.data1=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.ObjectBufferPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.ObjectObjectPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.PacketMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.type=e.uint32();break;case 2:o.id=e.uint32();break;case 3:o.nsp=e.string();break;case 4:o.data=e.bytes();break;case 5:o.options=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.PacketOptionsMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.flags=e.string();break;case 2:o.rooms&&o.rooms.length||(o.rooms=[]),o.rooms.push(e.string());break;case 3:o.except&&o.except.length||(o.except=[]),o.except.push(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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.StringBytesPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=e.bytes();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.StringNumberPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=e.uint32();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.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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.StringObjectPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=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){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,p.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){e instanceof t||(e=t.create(e));for(var s=void 0===n?e.len:e.pos+n,o=new r.StringStringPacketDataMessage;e.pos<s;){var i=e.uint32();switch(i>>>3){case 1:o.data=e.string();break;case 2:o.data1=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){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,p.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/StringStringPacketDataMessage"},s}(),r})();class f{static decode(t,e){const n=m(e).decode("undefined"==typeof window?t:new Uint8Array(t));return e.fromJSON({...n})}static encode(t){const e=m(t.constructor),n=t.toJSON(),r=e.verify(n);if(r)throw Error(r);return e.encode(e.create(n)).finish()}}function m(t){return h[t.DESCRIPTOR_NAME]}class y extends a{constructor(t){super(),this.ids=t}toJSON(){return{ids:this.ids}}static fromJSON(t){return new y(t.ids)}}y.TYPE="22",y.READABLE_TYPE_NAME="getManyUsers",y.DESCRIPTOR_NAME="GetManyUsersMessage",y.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};const g=y;class b extends a{constructor(t){super(),this.users=t}toJSON(){return{users:this.users.map(w)}}static fromJSON(t){return new b(t.users.map(v))}}b.DESCRIPTOR_NAME="GetManyUsersResponse",b.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};const O=b;function w(t){return{attributes:Object.keys(t).map((e=>({key:e,value:JSON.stringify(t[e])})))}}function v(t){return t.attributes.reduce(((t,e)=>(t[e.key]=e.value?JSON.parse(e.value):null,t)),{})}class I{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 I(t)}static async get(t,e){const n=new d(e);try{const e=await t._sendRequest(I._SERVICE,d.TYPE,f.encode(n)),r=f.decode(e,l);return new I(r.attributes)}catch(t){return new I({id:e})}}static async getMany(t,e){const n=new g(e);try{const e=await t._sendRequest(I._SERVICE,g.TYPE,f.encode(n));return f.decode(e,O).users.map((t=>new I(t)))}catch(t){return e.map((t=>new I({id:t})))}}}I._SERVICE=2;const S=I,P=Object.create(null);P.open="0",P.close="1",P.ping="2",P.pong="3",P.message="4",P.upgrade="5",P.noop="6";const k=Object.create(null);Object.keys(P).forEach((t=>{k[P[t]]=t}));const A={type:"error",data:"parser error"},_="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),T="function"==typeof ArrayBuffer,C=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,j=({type:t,data:e},n,r)=>_&&e instanceof Blob?n?r(e):E(e,r):T&&(e instanceof ArrayBuffer||C(e))?n?r(e):E(new Blob([e]),r):r(P[t]+(e||"")),E=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+(t||""))},n.readAsDataURL(t)};function D(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let x;const R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)N[R.charCodeAt(t)]=t;const V="function"==typeof ArrayBuffer,M=(t,e)=>{if("string"!=typeof t)return{type:"message",data:B(t,e)};const n=t.charAt(0);if("b"===n)return{type:"message",data:U(t.substring(1),e)};return k[n]?t.length>1?{type:k[n],data:t.substring(1)}:{type:k[n]}:A},U=(t,e)=>{if(V){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=N[t.charCodeAt(e)],r=N[t.charCodeAt(e+1)],s=N[t.charCodeAt(e+2)],o=N[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 B(n,e)}return{base64:!0,data:t}},B=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,J=String.fromCharCode(30);function q(){return new TransformStream({transform(t,e){!function(t,e){_&&t.data instanceof Blob?t.data.arrayBuffer().then(D).then(e):T&&(t.data instanceof ArrayBuffer||C(t.data))?e(D(t.data)):j(t,!1,(t=>{x||(x=new TextEncoder),e(x.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 G;function L(t){return t.reduce(((t,e)=>t+e.length),0)}function Y(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 H(t){if(t)return function(t){for(var e in H.prototype)t[e]=H.prototype[e];return t}(t)}H.prototype.on=H.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},H.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},H.prototype.off=H.prototype.removeListener=H.prototype.removeAllListeners=H.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},H.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},H.prototype.emitReserved=H.prototype.emit,H.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},H.prototype.hasListeners=function(t){return!!this.listeners(t).length};const z="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function F(t,...e){return e.reduce(((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e)),{})}const K=z.setTimeout,W=z.clearTimeout;function Q(t,e){e.useNativeTimers?(t.setTimeoutFn=K.bind(z),t.clearTimeoutFn=W.bind(z)):(t.setTimeoutFn=z.setTimeout.bind(z),t.clearTimeoutFn=z.clearTimeout.bind(z))}class $ extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class X extends H{constructor(t){super(),this.writable=!1,Q(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,n){return super.emitReserved("error",new $(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=M(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 Z="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),tt={};let et,nt=0,rt=0;function st(t){let e="";do{e=Z[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}function ot(){const t=st(+new Date);return t!==et?(nt=0,et=t):t+"."+st(nt++)}for(;rt<64;rt++)tt[Z[rt]]=rt;let it=!1;try{it="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}const at=it;function ct(t){const e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||at))return new XMLHttpRequest}catch(t){}if(!e)try{return new(z[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}function dt(){}const ut=null!=new ct({xdomain:!1}).responseType;class lt extends H{constructor(t,e){super(),Q(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=F(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;const n=this.xhr=new ct(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=lt.requestsCount++,lt.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=dt,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete lt.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(lt.requestsCount=0,lt.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",pt);else if("function"==typeof addEventListener){addEventListener("onpagehide"in z?"pagehide":"unload",pt,!1)}function pt(){for(let t in lt.requests)lt.requests.hasOwnProperty(t)&&lt.requests[t].abort()}const ht="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),ft=z.WebSocket||z.MozWebSocket,mt="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const yt={websocket:class extends X{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=mt?{}:F(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=mt?new ft(t,e,n):e?new ft(t,e):new ft(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;j(n,this.supportsBinary,(t=>{try{this.ws.send(t)}catch(t){}r&&ht((()=>{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]=ot()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}check(){return!!ft}},webtransport:class extends X{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){G||(G=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(L(n)<1)break;const t=Y(n,1);o=!(128&~t[0]),s=127&t[0],r=s<126?3:126===s?1:2}else if(1===r){if(L(n)<2)break;const t=Y(n,2);s=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),r=3}else if(2===r){if(L(n)<8)break;const t=Y(n,8),e=new DataView(t.buffer,t.byteOffset,t.length),o=e.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(A);break}s=o*Math.pow(2,32)+e.getUint32(4),r=3}else{if(L(n)<s)break;const t=Y(n,s);a.enqueue(M(o?t:G.decode(t),e)),r=0}if(0===s||s>t){a.enqueue(A);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(e).getReader(),r=q();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&&ht((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var t;null===(t=this.transport)||void 0===t||t.close()}},polling:class extends X{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=ut&&!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(J),r=[];for(let t=0;t<n.length;t++){const s=M(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)=>{j(t,!1,(t=>{r[o]=t,++s===n&&e(r.join(J))}))}))})(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]=ot()),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 lt(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}}},gt=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,bt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ot(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=gt.exec(t||""),o={},i=14;for(;i--;)o[bt[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 wt extends H{constructor(t,e={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=Ot(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=Ot(e.host).host),Q(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 yt[t](n)}open(){let t;if(this.opts.rememberUpgrade&&wt.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;wt.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;wt.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",wt.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 n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(t+="string"==typeof(e=r)?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}(e):Math.ceil(1.33*(e.byteLength||e.size))),n>0&&t>this.maxPayload)return this.writeBuffer.slice(0,n);t+=2}var e;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){wt.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}}wt.protocol=4;wt.protocol;const vt="function"==typeof ArrayBuffer,It=Object.prototype.toString,St="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===It.call(Blob),Pt="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===It.call(File);function kt(t){return vt&&(t instanceof ArrayBuffer||(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer)(t))||St&&t instanceof Blob||Pt&&t instanceof File}function At(t,e){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let e=0,n=t.length;e<n;e++)if(At(t[e]))return!0;return!1}if(kt(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return At(t.toJSON(),!0);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&At(t[e]))return!0;return!1}function _t(t){const e=[],n=t.data,r=t;return r.data=Tt(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Tt(t,e){if(!t)return t;if(kt(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]=Tt(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]=Tt(t[r],e));return n}return t}function Ct(t,e){return t.data=jt(t.data,e),delete t.attachments,t}function jt(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]=jt(t[n],e);else if("object"==typeof t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=jt(t[n],e));return t}const Et=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Dt=5;var xt;!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"}(xt||(xt={}));class Rt{constructor(t){this.replacer=t}encode(t){return t.type!==xt.EVENT&&t.type!==xt.ACK||!At(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===xt.EVENT?xt.BINARY_EVENT:xt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==xt.BINARY_EVENT&&t.type!==xt.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=_t(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r}}function Nt(t){return"[object Object]"===Object.prototype.toString.call(t)}class Vt extends H{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===xt.BINARY_EVENT;n||e.type===xt.BINARY_ACK?(e.type=n?xt.EVENT:xt.ACK,this.reconstructor=new Mt(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!kt(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===xt[n.type])throw new Error("unknown packet type "+n.type);if(n.type===xt.BINARY_EVENT||n.type===xt.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(!Vt.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 xt.CONNECT:return Nt(e);case xt.DISCONNECT:return void 0===e;case xt.CONNECT_ERROR:return"string"==typeof e||Nt(e);case xt.EVENT:case xt.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===Et.indexOf(e[0]));case xt.ACK:case xt.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Mt{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=Ct(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Ut(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Bt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Jt extends H{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=[Ut(t,"open",this.onopen.bind(this)),Ut(t,"packet",this.onpacket.bind(this)),Ut(t,"error",this.onerror.bind(this)),Ut(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(Bt.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:xt.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:xt.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 xt.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 xt.EVENT:case xt.BINARY_EVENT:this.onevent(t);break;case xt.ACK:case xt.BINARY_ACK:this.onack(t);break;case xt.DISCONNECT:this.ondisconnect();break;case xt.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:xt.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:xt.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 qt(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}qt.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)},qt.prototype.reset=function(){this.attempts=0},qt.prototype.setMin=function(t){this.ms=t},qt.prototype.setMax=function(t){this.max=t},qt.prototype.setJitter=function(t){this.jitter=t};class Gt extends H{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,Q(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 qt({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 wt(this.uri,this.opts);const e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Ut(e,"open",(function(){n.onopen(),t&&t()})),s=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},o=Ut(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(Ut(t,"ping",this.onping.bind(this)),Ut(t,"data",this.ondata.bind(this)),Ut(t,"error",this.onerror.bind(this)),Ut(t,"close",this.onclose.bind(this)),Ut(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){ht((()=>{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 Jt(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 Lt={};function Yt(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=Ot(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=Lt[s]&&o in Lt[s].nsps;let a;return e.forceNew||e["force new connection"]||!1===e.multiplex||i?a=new Gt(r,e):(Lt[s]||(Lt[s]=new Gt(r,e)),a=Lt[s]),n.query&&!e.query&&(e.query=n.queryKey),a.socket(n.path,e)}Object.assign(Yt,{Manager:Gt,Socket:Jt,io:Yt,connect:Yt});var Ht=__webpack_require__(835);class zt extends a{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 zt(t.type,t.socketId,t.data)}}zt.DESCRIPTOR_NAME="ChannelMessage",zt.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};const Ft=zt,Kt=class extends((0,n.EmitterMixin)()){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=f.decode(t,Ft);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 Wt extends Error{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 Wt(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 Qt extends Error{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 Qt(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 $t extends a{constructor(t,e=[],n=[]){super(),this.flags=t,this.rooms=e,this.except=n}toJSON(){var t,e;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(t=this.rooms)||void 0===t?void 0:t.length)?this.rooms:void 0,except:(null===(e=this.except)||void 0===e?void 0:e.length)?this.except:void 0}}static fromJSON(t){return new $t(t.flags&&JSON.parse(t.flags),t.rooms,t.except)}}$t.TYPE=11,$t.DESCRIPTOR_NAME="PacketOptionsMessage",$t.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};const Xt=$t,Zt=(()=>!("undefined"==typeof process||!process.versions||!process.versions.node))(),te=1,ee=2,ne=3,re=4;class se{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(se.isBuffer(t))return te;const e=typeof t;return"string"===e?ee:"number"===e?ne:re}static isBuffer(t){return Zt&&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 oe extends a{static create(t,e){throw new TypeError("Must be implemented in a child class!")}}class ie extends oe{constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new ie(t.data,t.data1)}static create(t,e){return new ie(t,e)}}ie.TYPE=(()=>se.getPacketType(ne,te))(),ie.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",ie.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};const ae=ie;class ce extends oe{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)}}ce.TYPE=(()=>se.getPacketType(ee,te))(),ce.DESCRIPTOR_NAME="StringBytesPacketDataMessage",ce.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};const de=ce;class ue extends oe{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)}}ue.TYPE=(()=>se.getPacketType(te,te))(),ue.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",ue.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};const le=ue;class pe extends oe{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 pe(t.data,t.data1&&JSON.parse(t.data1))}static create(t,e){return new pe(t,e)}}pe.TYPE=(()=>se.getPacketType(ee,re))(),pe.DESCRIPTOR_NAME="StringObjectPacketDataMessage",pe.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const he=pe;class fe extends oe{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 fe(t.data,t.data1&&JSON.parse(t.data1))}static create(t,e){return new fe(t,e)}}fe.TYPE=(()=>se.getPacketType(ne,re))(),fe.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",fe.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const me=fe;class ye extends oe{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 ye(t.data&&JSON.parse(t.data),t.data1&&JSON.parse(t.data1))}static create(t,e){return new ye(t,e)}}ye.TYPE=(()=>se.getPacketType(re,re))(),ye.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",ye.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const ge=ye;class be extends oe{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 be(t.data&&JSON.parse(t.data),t.data1)}static create(t,e){return new be(t,e)}}be.TYPE=(()=>se.getPacketType(re,te))(),be.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",be.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};const Oe=be;class we extends oe{constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new we(t.data,t.data1)}static create(t,e){return new we(t,e)}}we.TYPE=(()=>se.getPacketType(ee,ee))(),we.DESCRIPTOR_NAME="StringStringPacketDataMessage",we.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};const ve=we;class Ie extends oe{constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new Ie(t.data,t.data1)}static create(t,e){return new Ie(t,e)}}Ie.TYPE=(()=>se.getPacketType(ee,ne))(),Ie.DESCRIPTOR_NAME="StringNumberPacketDataMessage",Ie.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};const Se=Ie;class Pe extends oe{constructor(t,e){super(),this.data=t,this.data1=e}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(t){return new Pe(t.data,t.data1)}static create(t,e){return new Pe(t,e)}}Pe.TYPE=(()=>se.getPacketType(ne,ne))(),Pe.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",Pe.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};const ke=Pe;class Ae extends oe{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)}}Ae.TYPE=(()=>se.getPacketType(ne,ee))(),Ae.DESCRIPTOR_NAME="NumberStringPacketDataMessage",Ae.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const _e=Ae,Te=(()=>[ae,de,le,he,me,ge,Oe,ve,Se,ke,_e].reduce(((t,e)=>(t[e.TYPE]=e,t)),{}))();class Ce extends a{constructor(t,e,n,r="/",s){super(),this.type=t,this.data=e,this.id=n,this.nsp=r,this.options=null!=s?s:new Xt}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=f.encode(this.options),e=f.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 Ce(t.type-10*e,f.decode(t.data,Te[e]),t.id,t.nsp,t.options?f.decode(t.options,Xt):new Xt)}static create(t,e={}){var n;const r=se.getPacketType(se.getType(t.data[0]),se.getType(null!==(n=t.data[1])&&void 0!==n?n:t.data[0]));return new Ce(t.type,Te[r].create(t.data[0],t.data[1]),t.id,t.nsp,new Xt(e.flags,e.rooms,e.except))}}Ce.TYPE=10,Ce.DESCRIPTOR_NAME="PacketMessage",Ce.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}}};const je=Ce;class Ee{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 f.encode(je.create(o,s))}decode(t){const e=f.decode(t,je);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 De=(()=>[xt.EVENT,xt.ACK,xt.BINARY_ACK,xt.BINARY_EVENT])();class xe extends Rt{constructor(t){super(),this._packetParser=null!=t?t:new Ee}encode(t){if(De.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 Re extends Vt{constructor(t){super(),this._packetParser=null!=t?t:new Ee}add(t){if(!se.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 Ne{constructor(t,e){this._context=t,this._deferredPromise=function(){let t,e;const n=new Promise(((n,r)=>{t=n,e=r}));return{resolve:t,reject:e,promise:n}}(),this.timeout=setTimeout((()=>this.error(new Wt("Request timeout.",this._context))),e)}get promise(){return this._deferredPromise.promise}response(t){this._deferredPromise.resolve(t)}error(t){this._deferredPromise.reject(t)}}class Ve{constructor(t){this._context=t,this._requests=new Set}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 Ne(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 Me={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};class Ue extends((0,n.ObservableMixin)()){constructor(t,e,n,r,s){if(super(),this._connectionAttempt=0,this._token=e,this._options=null!=n?n:{},this._connectionProvider=null!=r?r:Yt,this._userFactory=null!=s?s:S.get,this._requestsManager=new Ve(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=Ht(t.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Me.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(t,e,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==Ue.STATE_CONNECTED){if(n===Ue.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Wt("Not connected.",this))}else try{this.me=await this._userFactory.call(S,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(t){}}),{priority:Ue._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(){var t;this.state!==Me.DISCONNECTED&&(null===(t=this._socket)||void 0===t||t.disconnect(),this._socket=void 0,this.state=Me.DISCONNECTED)}async reconnect(){this._socket||this.state!==Me.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(t,e="local.cs.dev:443/ws-v2",n={},r=Yt,s=S.get){const o=new Ue(e,t,n,r,s);return await o._connect(),o}_sendRequest(t,e,n){if(!t)throw new Wt("`serviceName` must be provided.",this);if(this.state!==Ue.STATE_CONNECTED)throw new Wt("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new Wt("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 Kt(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(){var t;if(this._socket)return this._socket;const e=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+e,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",s=this._connectionProvider(n,{parser:{Encoder:xe,Decoder:Re},path:r+"/ws-v2/ws",transports:["websocket"],timeout:void 0!==this._options.timeout?this._options.timeout:5e3,reconnection:void 0===this._options.autoReconnect||this._options.autoReconnect,reconnectionDelay:1e3,reconnectionDelayMax:5e3,rejectUnauthorized:void 0===this._options.rejectUnauthorized||this._options.rejectUnauthorized,query:{version:"52.6.11"},agent:null!==(t=this._options.agent)&&void 0!==t&&t,closeOnBeforeunload:!1});return this.state=Me.CONNECTING,s.on("connect",(()=>{this._debugEvent("connect"),this.socketId=s.id})),s.on("connect_error",(t=>{this._debugEvent("connect_error",t)})),s.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),s.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),s.io.on("reconnect_attempt",(t=>{this._debugEvent("reconnect_attempt",t),this.state=Me.CONNECTING,this._connectionAttempt=t})),s.on("unauthorized",(t=>{this._debugEvent("unauthorized"),this._onUnauthorized(t)})),s.on("authenticationRequest",(async t=>{this._debugEvent("authenticationRequest",t.attempt),await this._onReconnect()})),this._socket=s,s}_emit(t,e){const n=this._socket;return this._requestsManager.send((r=>{n.emit(t,e,((t,e)=>{if(t)return r.error(Qt.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=Me.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=Me.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(Wt.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",Qt.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(){var t;return!!n.global.window.localStorage&&"true"===(null!==(t=n.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==t?t:"false").toLowerCase()}}Ue.STATE_DISCONNECTED=(()=>Me.DISCONNECTED)(),Ue.STATE_CONNECTING=(()=>Me.CONNECTING)(),Ue.STATE_CONNECTED=(()=>Me.CONNECTED)(),Ue._CHANGE_STATE_EVENT_PRIORITY=(()=>n.priorities.get("highest")+999999)();const Be=Ue;class Je extends a{constructor(t){super(),this.bundleVersion=t}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(t){return new Je(t.bundleVersion)}}Je.TYPE="131",Je.READABLE_TYPE_NAME="isEditorBundleUploaded",Je.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",Je.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};const qe=Je;class Ge extends a{constructor(t){super(),this.isUploaded=t}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(t){return new Ge(t.isUploaded)}}Ge.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",Ge.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};const Le=Ge;class Ye extends((0,n.EmitterMixin)()){static async isBundleUploaded(t,e){const n=new qe(e);if(t.state!==Me.CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);const r=await t._sendRequest(Ye._SERVICE,qe.TYPE,f.encode(n));return f.decode(r,Le).isUploaded}}Ye._SERVICE=13;const He=Ye;class ze extends a{constructor(t,e){super(),this.documentId=t,this.revisionId=e}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(t){return new ze(t.documentId,t.revisionId)}}ze.TYPE="123",ze.READABLE_TYPE_NAME="getRevision",ze.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",ze.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};const Fe=ze;class Ke extends o{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){var e;return{revisionId:t.revisionId,name:t.name,creatorId:t.creatorId,authorsIds:t.authorsIds?JSON.stringify(t.authorsIds):void 0,diffData:t.diffData,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.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})}}Ke.DESCRIPTOR_NAME="RevisionDescriptor",Ke.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}}};const We=Ke;class Qe extends a{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 We.toJSON(this)}toObject(){return We.toObject(this)}static create(t){return new Qe(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 Qe(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)}}Qe.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",Qe.DESCRIPTOR=We.DESCRIPTOR;const $e=Qe;class Xe extends a{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(We.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(We.toObject)}}static create(t){return new Xe(t.documentId,t.requestId,t.revisions.map(We.create))}static fromJSON(t){return new Xe(t.documentId,t.requestId,t.revisions.map(We.fromJSON))}}Xe.TYPE="124",Xe.READABLE_TYPE_NAME="updateRevisions",Xe.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",Xe.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};const Ze=Xe;class tn extends a{constructor(t){super(),this.requestId=t}toJSON(){return{requestId:this.requestId}}static fromJSON(t){return new tn(t.requestId)}}tn.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",tn.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};const en=tn;class nn extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new nn(t.documentId)}}nn.TYPE="121",nn.READABLE_TYPE_NAME="connectToRevisionHistory",nn.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",nn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const rn=nn;class sn extends a{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(We.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(We.toObject)}}static fromJSON(t){return new sn(t.channel,t.requestId,t.revisions.map(We.fromJSON))}}sn.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",sn.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};const on=sn;class an extends a{constructor(t,e){super(),this.documentId=t,this.requestId=e}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(t){return new an(t.documentId,t.requestId)}}an.TYPE="122",an.READABLE_TYPE_NAME="reconnectToRevisionHistory",an.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",an.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};const cn=an;class dn extends Wt{constructor(t,e){super(t+" Service is not connected.",e)}}class un extends((0,n.EmitterMixin)()){constructor(t){super(),this._documentId=t,this._isConnected=!1}get isConnected(){return this._isConnected}connect(t){return this._isConnected?Promise.resolve():this._connect(t,new rn(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 Wt("Cannot reconnect to already connected service.",t);return this._connect(t,new cn(this._documentId,e))}async updateRevisions(t,e){const n=Ze.create({documentId:this._documentId,requestId:e,revisions:t}),r=await this._sendRequest(Ze.TYPE,n),{requestId:s}=f.decode(r,en);return s}async getRevision(t){const e=new Fe(this._documentId,t),n=await this._sendRequest(Fe.TYPE,e);return f.decode(n,$e).toObject()}async _connect(t,e){if(t.state!==Me.CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(12,e.constructor.TYPE,f.encode(e)),{channel:r,requestId:s,revisions:o}=f.decode(n,on).toObject();return this.listenTo(t,"change:state",((t,e,n)=>this._onWsGatewayStateChange(n)),{priority:Be._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(un._SERVICE,e),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Ze.TYPE),((t,e)=>{const{documentId:n,requestId:r,revisions:s}=f.decode(e,Ze).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})}))}_onWsGatewayStateChange(t){t===Me.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new dn("Revision History",this);return this._wsGateway._sendRequest(12,t,f.encode(e))}}un._SERVICE=12;const ln=un;class pn extends a{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){var e;return new pn(t.id,t.documentId,t.type,JSON.parse(t.data),null!==(e=t.originalSuggestionId)&&void 0!==e?e:null,t.attributes?JSON.parse(t.attributes):null)}}pn.TYPE="101",pn.READABLE_TYPE_NAME="addSuggestion",pn.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",pn.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}}};const hn=pn;class fn extends a{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(){var t;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(t=this.createdAt)||void 0===t?void 0:t.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(t){return new fn(t.id,t.authorId,t.type,t.createdAt,t.hasComments,t.state,JSON.parse(t.data),t.attributes?JSON.parse(t.attributes):null)}}fn.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",fn.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}}};const mn=fn;class yn extends a{constructor(t,e){super(),this.id=t,this.documentId=e}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(t){return new yn(t.id,t.documentId)}}yn.TYPE="103",yn.READABLE_TYPE_NAME="getSuggestion",yn.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",yn.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};const gn=yn;class bn extends a{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 bn(t.id,t.authorId,t.type,t.createdAt,t.hasComments,t.state,JSON.parse(t.data),t.attributes?JSON.parse(t.attributes):null)}}bn.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",bn.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}}};const On=bn;class wn extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new wn(t.documentId)}}wn.TYPE="102",wn.READABLE_TYPE_NAME="getAllSuggestions",wn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",wn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const vn=wn;class In extends o{static toJSON(t){var e;return{...t,data:t.data?JSON.stringify(t.data):t.data,attributes:t.attributes?JSON.stringify(t.attributes):t.attributes,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.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}}}In.DESCRIPTOR_NAME="SuggestionDescriptor",In.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"}}};const Sn=In;class Pn extends a{constructor(t,e){super(),this._suggestions=t,this._suggestionsV2=e,this.suggestions=(null==e?void 0:e.length)?e:t}toJSON(){var t,e;return{suggestions:null===(t=this._suggestions)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),suggestionsV2:null===(e=this._suggestionsV2)||void 0===e?void 0:e.map(Sn.toJSON)}}static fromJSON(t){var e,n;return new Pn(null===(e=t.suggestions)||void 0===e?void 0:e.map(An),null===(n=t.suggestionsV2)||void 0===n?void 0:n.map(Sn.fromJSON))}}Pn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",Pn.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};const kn=Pn;function An(t){const e=JSON.parse(t);return e.createdAt=e.createdAt?new Date(e.createdAt):void 0,e}class _n extends a{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 _n(t.id,t.documentId,t.hasComments,t.isHasCommentsModified,t.state,t.attributes?JSON.parse(t.attributes):null)}}_n.TYPE="104",_n.READABLE_TYPE_NAME="updateSuggestion",_n.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",_n.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}}};const Tn=_n;class Cn extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new Cn(t.documentId)}}Cn.TYPE="105",Cn.READABLE_TYPE_NAME="connectToSuggestions",Cn.DESCRIPTOR_NAME="TrackChangesConnectMessage",Cn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const jn=Cn;class En extends a{constructor(t,e,n){super(),this.channel=t,this._suggestions=e,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:e}toJSON(){var t,e;return{channel:this.channel,suggestions:null===(t=this._suggestions)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),suggestionsV2:null===(e=this._suggestionsV2)||void 0===e?void 0:e.map(Sn.toJSON)}}static fromJSON(t){var e,n;return new En(t.channel,null===(e=t.suggestions)||void 0===e?void 0:e.map((t=>JSON.parse(t))),null===(n=t.suggestionsV2)||void 0===n?void 0:n.map(Sn.fromJSON))}}En.DESCRIPTOR_NAME="TrackChangesConnectResponse",En.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};const Dn=En;class xn extends a{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 xn(t.ids,t.documentId,t.state)}}xn.TYPE="106",xn.READABLE_TYPE_NAME="batchUpdateSuggestionsState",xn.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",xn.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};const Rn=xn;class Nn extends((0,n.EmitterMixin)()){constructor(t){super(),this._documentId=t,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(t){if(this._isConnected)return;if(t.state!==Me.CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);const e=new jn(this._documentId);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(10,jn.TYPE,f.encode(e)),r=f.decode(n,Dn);return this.listenTo(t,"change:state",((t,e,n)=>this._onWsGatewayStateChange(n)),{priority:Be._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 hn(t,this._documentId,e,n,r,s),i=await this._sendRequest(hn.TYPE,o);return f.decode(i,mn)}async get(t,e=1){const n=new gn(t,this._documentId);try{const t=await this._sendRequest(gn.TYPE,n);return f.decode(t,On)}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 Qt.fromPublicError(n)}var r}async getAll(){const t=new vn(this._documentId),e=await this._sendRequest(vn.TYPE,t),{suggestions:n}=f.decode(e,kn);return n}async update(t,e={}){const{hasComments:n,state:r,attributes:s}=e,o=void 0!==n,i=new Tn(t,this._documentId,n,o,r,s);await this._sendRequest(Tn.TYPE,i)}async batchUpdateState(t){const e=new Rn(t.ids,this._documentId,t.state);await this._sendRequest(Rn.TYPE,e)}_connectToChannel(t,e){this._channel=t._getChannel(Nn._SERVICE,e),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Tn.TYPE),((t,e)=>{const n=f.decode(e,Tn);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(t){t===Me.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new dn("Track Changes",this);return this._wsGateway._sendRequest(10,t,f.encode(e))}}Nn._SERVICE=10;const Vn=Nn,Mn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Un;const Bn=new Uint8Array(16);function Jn(){if(!Un&&(Un="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Un))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Un(Bn)}const qn=[];for(let t=0;t<256;++t)qn.push((t+256).toString(16).slice(1));function Gn(t,e=0){return qn[t[e+0]]+qn[t[e+1]]+qn[t[e+2]]+qn[t[e+3]]+"-"+qn[t[e+4]]+qn[t[e+5]]+"-"+qn[t[e+6]]+qn[t[e+7]]+"-"+qn[t[e+8]]+qn[t[e+9]]+"-"+qn[t[e+10]]+qn[t[e+11]]+qn[t[e+12]]+qn[t[e+13]]+qn[t[e+14]]+qn[t[e+15]]}const Ln=function(t,e,n){if(Mn.randomUUID&&!e&&!t)return Mn.randomUUID();const r=(t=t||{}).random||(t.rng||Jn)();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 Gn(r)};class Yn extends a{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 Yn(t.channel,t.sockets.map((t=>({id:t.session,userId:t.user,role:t.role,permissions:t.permissions}))))}}Yn.DESCRIPTOR_NAME="SessionsConnectResponse",Yn.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};const Hn=Yn;class zn extends a{constructor(t,e){super(),this.id=t,this.sessionType=e}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(t){return new zn(t.id,t.sessionType)}}zn.TYPE="31",zn.READABLE_TYPE_NAME="getConnectedSockets",zn.DESCRIPTOR_NAME="SessionsConnectMessage",zn.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};const Fn=zn;class Kn extends a{constructor(t,e,n,r){super(),this.id=t,this.userId=e,this.role=n,this.permissions=r}toJSON(){var t,e,n;return{id:this.id,userId:null!==(t=this.userId)&&void 0!==t?t:void 0,role:null!==(e=this.role)&&void 0!==e?e:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(t){return new Kn(t.id,t.userId,t.role,t.permissions)}}Kn.TYPE="32",Kn.READABLE_TYPE_NAME="connectSocket",Kn.DESCRIPTOR_NAME="SocketConnectMessage",Kn.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};const Wn=Kn;class Qn extends a{constructor(t){super(),this.id=t}toJSON(){return{id:this.id}}static fromJSON(t){return new Qn(t.id)}}Qn.TYPE="33",Qn.READABLE_TYPE_NAME="disconnectSocket",Qn.DESCRIPTOR_NAME="SocketDisconnectMessage",Qn.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const $n=Qn,Xn=class extends n.Collection{constructor(t,e){super({idProperty:"id"}),this._id=t,this._sessionType=e,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(t){this._wsGateway=t,this.stopListening(t,"change:state");const e=new Fn(this._id,this._sessionType);let n;try{const t=await this._wsGateway._sendRequest(3,Fn.TYPE,f.encode(e));n=f.decode(t,Hn)}catch(t){n=new Hn(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 S.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 S,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:Be._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,Wn.TYPE,(async e=>{const n=f.decode(e,Wn);if(-1===this.getIndex(n.id)){const e={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(e.user=await S.get(t,n.userId)),super.add(e)}})),this._addHandler(this._channel,$n.TYPE,(t=>{const e=f.decode(t,$n);-1!==this.getIndex(e.id)&&super.remove(e.id)})))}async _onWsGatewayStateChange(t){t===Be.STATE_DISCONNECTED&&this.disconnect(!1),t===Be.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 Zn{static async getConnectedSessions(t,e,n){const r=new Xn(e,n);return await r.connect(t),r}}class tr extends a{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 tr(t.id,t.buffers,t.types,t.bundleVersion,t.lastOperationId)}}tr.TYPE="11",tr.READABLE_TYPE_NAME="connectToDocument",tr.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",tr.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}}};const er=tr;class nr{static prepareMetadataForOperations(t,e){if(!(t&&t.length&&e&&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&&t.length&&e&&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 rr extends o{static toJSON({createdAt:t,...e}){const n={...e};return(null==t?void 0:t.toISOString)&&(n.createdAt=t.toISOString()),n}static fromJSON({createdAt:t,...e}){const n={...e};return t&&(n.createdAt=new Date(t)),n}}rr.DESCRIPTOR_NAME="OperationMetadataDescriptor",rr.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};const sr=rr;class or extends a{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:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(t){return new or(t.id,t.buffers,t.types,t.baseVersion,nr.prepareMetadataForOperations(t.types,t.metadata).map(sr.fromJSON),t.lastOperationId)}}or.TYPE="13",or.READABLE_TYPE_NAME="updateDocument",or.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",or.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}}};const ir=or;class ar extends a{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 ar(t.id,t.lastKnowVersion,t.bundleVersion)}}ar.TYPE="12",ar.READABLE_TYPE_NAME="reconnectToDocument",ar.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",ar.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};const cr=ar;class dr extends a{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(){var t;return!(null===(t=this.types)||void 0===t?void 0:t.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(t){return new dr(t.version,t.buffers,t.types,nr.prepareMetadataForOperations(t.types,t.metadata).map(sr.fromJSON),t.lastOperationId,t.lastOperationAcceptedAt?new Date(t.lastOperationAcceptedAt):null)}static create(t){return new dr(t.version,t.buffers,t.types,t.metadata,t.lastOperationId,t.lastOperationAcceptedAt?new Date(t.lastOperationAcceptedAt):null)}}dr.DESCRIPTOR_NAME="CollaborativeEditingResponse",dr.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}}};const ur=dr;class lr extends a{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(){var t;return!(null===(t=this.types)||void 0===t?void 0:t.length)&&null===this.initData}toJSON(){var t;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:nr.removeUnnecessaryMetadata(this.types,this.metadata).map(sr.toJSON),initData:null!==(t=this.initData)&&void 0!==t?t:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(t){return new lr(t.channel,t.version,t.buffers,t.types,t.offset,t.metadata,t.initData,t.sessionId,t.lastOperationId,t.sessionCreatedAt)}static fromJSON(t){var e;let n=null;return!0===t.isInitialized?n=null!==(e=t.initData)&&void 0!==e?e:"":"boolean"!=typeof t.isInitialized&&t.initData&&(n=t.initData),lr.create({channel:t.channel,version:t.version,buffers:t.buffers,types:t.types,offset:t.offset,metadata:nr.prepareMetadataForOperations(t.types,t.metadata).map(sr.fromJSON),initData:n,sessionId:t.sessionId,lastOperationId:t.lastOperationId,sessionCreatedAt:t.sessionCreatedAt?new Date(t.sessionCreatedAt):null})}}lr.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",lr.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:sr.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}}};const pr=lr;class hr extends a{constructor(t,e){super(),this.lastDocumentSession=t,this.currentDocumentSession=e}get data(){var t,e,n,r,s;return{lastDocumentSessionId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.id,lastDocumentSessionOperationId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}toJSON(){var t,e,n,r,s;return{lastDocumentSessionId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.id,lastDocumentSessionOperationId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.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 hr(e,n)}}hr.DESCRIPTOR_NAME="GetDocumentDetailsResponse",hr.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}}};const fr=hr;class mr extends a{constructor(t){super(),this.documentId=t}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new mr(t.documentId)}}mr.TYPE="14",mr.READABLE_TYPE_NAME="getDocumentDetails",mr.DESCRIPTOR_NAME="GetDocumentDetailsMessage",mr.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};const yr=mr;class gr extends((0,n.EmitterMixin)()){constructor(t,e){if(super(),!t)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=e?e:Ln(),this._isConnected=!1,this._bundleVersion=t}getId(){return this._id}isConnected(){return this._isConnected}connect(t,e={buffers:[],types:[]},n){const r=new er(this.getId(),e.buffers,e.types,this._bundleVersion,n);return this._connect(t,r)}reconnect(t,e){if(this.isConnected())throw new Wt("Cannot reconnect to already connected service.",t);return this._connect(t,new cr(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 yr(this.getId());if(!this._wsGateway)throw new dn("Collaborative Editing",this);const e=await this._wsGateway._sendRequest(1,yr.TYPE,f.encode(t));return f.decode(e,fr)}async sendOperations(t,e,n){if(!t||!t.types||!t.types.length)throw new Wt("Cannot send empty update.",this._wsGateway);const r="number"==typeof e?e:parseInt(e);if(!Number.isInteger(r)||r<0)throw new Wt("Base version not provided.",this._wsGateway);const s=new ir(this.getId(),t.buffers,t.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new dn("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,ir.TYPE,f.encode(s));return f.decode(o,ur)}async getConnectedSessions(){if(!this._isConnected)throw new dn("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await Zn.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(t,e){return Zn.getConnectedSessions(t,e,1)}async _connect(t,e){if(this.isConnected())return;if(t.state!==Be.STATE_CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(1,e.constructor.TYPE,f.encode(e)),r=f.decode(n,pr);return this.listenTo(t,"change:state",((t,e,n)=>this._onWsGatewayStateChange(n)),{priority:Be._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(ir.TYPE),((t,e)=>{const n=f.decode(e,ir);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(t){t===Be.STATE_DISCONNECTED&&this.disconnect()}}gr._SERVICE=1;const br=gr;class Or extends o{static toJSON(t){var e;return{...t,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.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}}}Or.DESCRIPTOR_NAME="CommentDescriptor",Or.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"}}};const wr=Or;class vr extends o{static toJSON(t){var e,n,r,s,o;return{...t,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.toISOString(),deletedAt:null===(n=t.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=t.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:t.attributes?JSON.stringify(t.attributes):null,context:t.context?JSON.stringify(t.context):t.context,comments:null===(s=t.comments)||void 0===s?void 0:s.map(wr.toJSON),unlinkedAt:null===(o=t.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(t){var e;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:null===(e=t.comments)||void 0===e?void 0:e.map(wr.fromJSON),unlinkedAt:t.unlinkedAt?new Date(t.unlinkedAt):void 0}}}vr.DESCRIPTOR_NAME="CommentsThreadDescriptor",vr.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}}};const Ir=vr;class Sr extends a{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?Ir.toJSON(this.commentThread):void 0}}static fromJSON(t){return new Sr(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?Ir.fromJSON(t.commentThread):void 0)}}Sr.TYPE="91",Sr.READABLE_TYPE_NAME="addComment",Sr.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",Sr.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}}};const Pr=Sr;class kr extends a{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 kr(t.commentThreadId,t.commentId,t.createdAt)}}kr.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",kr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};const Ar=kr;class _r extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new _r(t.documentId)}}_r.TYPE="92",_r.READABLE_TYPE_NAME="connectToComment",_r.DESCRIPTOR_NAME="CommentsV2ConnectMessage",_r.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const Tr=_r;class Cr extends a{constructor(t,e,n){super(),this.channel=t,this._threads=e,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:e}toJSON(){var t,e;return{channel:this.channel,threads:null===(t=this._threads)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),threadsV2:null===(e=this._threadsV2)||void 0===e?void 0:e.map(Ir.toJSON)}}static fromJSON(t){var e,n;return new Cr(t.channel,null===(e=t.threads)||void 0===e?void 0:e.map((t=>JSON.parse(t))),null===(n=t.threadsV2)||void 0===n?void 0:n.map(Ir.fromJSON))}}Cr.DESCRIPTOR_NAME="CommentsV2ConnectResponse",Cr.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};const jr=Cr;class Er extends a{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 Er(t.documentId,t.commentThreadId,t.commentId)}}Er.TYPE="95",Er.READABLE_TYPE_NAME="removeComment",Er.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",Er.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};const Dr=Er;class xr extends a{constructor(t,e){super(),this.documentId=t,this.commentThreadId=e}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(t){return new xr(t.documentId,t.commentThreadId)}}xr.TYPE="97",xr.READABLE_TYPE_NAME="removeCommentThread",xr.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",xr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const Rr=xr;class Nr extends a{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?Ir.toJSON(this.commentThread):void 0}}static fromJSON(t){return new Nr(t.documentId,t.commentThreadId,t.commentId,t.content,t.attributes?JSON.parse(t.attributes):null,t.isAttributesUpdated,t.commentThread?Ir.fromJSON(t.commentThread):void 0)}}Nr.TYPE="96",Nr.READABLE_TYPE_NAME="updateComment",Nr.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",Nr.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}}};const Vr=Nr;class Mr extends a{constructor(t,e){super(),this.commentThreadId=t,this.documentId=e}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(t){return new Mr(t.commentThreadId,t.documentId)}}Mr.TYPE="93",Mr.READABLE_TYPE_NAME="getComment",Mr.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",Mr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const Ur=Mr;class Br extends a{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=(null==n?void 0: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(){var t,e,n,r,s,o;return{commentThreadId:this.commentThreadId,comments:null===(t=this._comments)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),commentsV2:null===(e=this._commentsV2)||void 0===e?void 0:e.map(wr.toJSON),attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,context:this.context?JSON.stringify(this.context):this.context,resolvedBy:this.resolvedBy,createdAt:null===(n=this.createdAt)||void 0===n?void 0:n.toISOString(),deletedAt:null===(r=this.deletedAt)||void 0===r?void 0:r.toISOString(),resolvedAt:null===(s=this.resolvedAt)||void 0===s?void 0:s.toISOString(),unlinkedAt:null===(o=this.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(t){var e,n;return new Br(t.commentThreadId,null===(e=t.comments)||void 0===e?void 0:e.map((t=>function(t){const e=JSON.parse(t);return{...e,createdAt:new Date(e.createdAt)}}(t))),null===(n=t.commentsV2)||void 0===n?void 0:n.map(wr.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)}}Br.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",Br.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}}};const Jr=Br;class qr extends a{constructor(t){super(),this.documentId=t}toJSON(){return{documentId:this.documentId}}static fromJSON(t){return new qr(t.documentId)}}qr.TYPE="94",qr.READABLE_TYPE_NAME="getDocumentThreads",qr.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",qr.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};const Gr=qr;class Lr extends a{constructor(t,e){super(),this._threads=t,this._threadsV2=e,this.threads=(null==e?void 0:e.length)?e:t}toJSON(){var t,e;return{threads:null===(t=this._threads)||void 0===t?void 0:t.map((t=>JSON.stringify(t))),threadsV2:null===(e=this._threadsV2)||void 0===e?void 0:e.map(Ir.toJSON)}}static fromJSON(t){var e,n;return new Lr(null===(e=t.threads)||void 0===e?void 0:e.map((t=>function(t){var e;const n=JSON.parse(t),r={...n};return n.comments&&(r.comments=null===(e=n.comments)||void 0===e?void 0:e.map((t=>({...t,createdAt:new Date(t.createdAt)})))),r}(t))),null===(n=t.threadsV2)||void 0===n?void 0:n.map(Ir.fromJSON))}}Lr.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",Lr.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};const Yr=Lr;class Hr extends o{static toJSON(t){var e;return{commentId:t.commentId,createdAt:null===(e=t.createdAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(t){return{commentId:t.commentId,createdAt:new Date(t.createdAt)}}}Hr.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",Hr.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};const zr=Hr;class Fr extends a{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=>zr.toJSON(t)))}}static fromJSON(t){return new Fr(t.commentThreadId,t.createdAt,t.comments.map((t=>zr.fromJSON(t))))}}Fr.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",Fr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};const Kr=Fr;class Wr extends a{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(){var t;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(t=this.comments)||void 0===t?void 0:t.map((t=>wr.toJSON(t)))}}static fromJSON(t){var e;return new Wr(t.documentId,t.commentThreadId,null===(e=t.comments)||void 0===e?void 0:e.map((e=>wr.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)}}Wr.TYPE="140",Wr.READABLE_TYPE_NAME="addCommentThread",Wr.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",Wr.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}}};const Qr=Wr;class $r extends a{constructor(t,e,n,r){super(),this.commentThreadId=t,this.documentId=e,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var t;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(t=this.resolvedAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(t){return new $r(t.commentThreadId,t.documentId,t.resolvedBy,t.resolvedAt)}}$r.TYPE="142",$r.READABLE_TYPE_NAME="resolveCommentThread",$r.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",$r.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};const Xr=$r;class Zr extends a{constructor(t,e){super(),this.commentThreadId=t,this.documentId=e}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(t){return new Zr(t.commentThreadId,t.documentId)}}Zr.TYPE="141",Zr.READABLE_TYPE_NAME="reopenCommentThread",Zr.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",Zr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};const ts=Zr;class es extends a{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 es(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)}}es.TYPE="143",es.READABLE_TYPE_NAME="updateCommentThread",es.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",es.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}}};const ns=es;class rs extends a{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 rs(t.commentThreadId,t.documentId,t.resolvedBy,t.resolvedAt)}}rs.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",rs.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};const ss=rs;class os extends((0,n.EmitterMixin)()){constructor(t){super(),this._documentId=t,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(t){if(this._isConnected)return;if(t.state!==Me.CONNECTED)throw new Wt("WebSocket Gateway is not connected.",t);const e=new Tr(this._documentId);this._wsGateway=t,this.stopListening(t,"change:state");const n=await t._sendRequest(9,Tr.TYPE,f.encode(e)),{channel:r,threads:s}=f.decode(n,jr);return this.listenTo(t,"change:state",((t,e,n)=>this._onWsGatewayStateChange(n)),{priority:Be._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 Pr(this._documentId,t,n,e,void 0,void 0,r),o=await this._sendRequest(Pr.TYPE,s);return f.decode(o,Ar)}async updateComment(t,e,n,r){const s=void 0!==r,o=new Vr(this._documentId,t,e,n,r,s);await this._sendRequest(Vr.TYPE,o)}async removeComment(t,e){const n=new Dr(this._documentId,t,e);await this._sendRequest(Dr.TYPE,n)}async removeCommentThread(t){const e=new Rr(this._documentId,t);await this._sendRequest(Rr.TYPE,e)}async addCommentThread(t){var e;const n=new Qr(this._documentId,t.commentThreadId,null===(e=t.comments)||void 0===e?void 0:e.map((e=>({...e,documentId:this._documentId,commentThreadId:t.commentThreadId}))),t.context,t.resolvedBy,t.createdAt,t.resolvedAt,t.deletedAt,t.attributes),r=await this._sendRequest(Qr.TYPE,n);return f.decode(r,Kr)}async resolveCommentThread(t){const e=new Xr(t,this._documentId),n=await this._sendRequest(Xr.TYPE,e);return f.decode(n,ss)}async reopenCommentThread(t){const e=new ts(t,this._documentId);await this._sendRequest(ts.TYPE,e)}async updateCommentThread(t){const e=new ns(t.commentThreadId,this._documentId,t.context,t.attributes,t.unlinkedAt);await this._sendRequest(ns.TYPE,e)}async getCommentThread(t,e=1){const n=new Ur(t,this._documentId);try{const t=await this._sendRequest(Ur.TYPE,n),e=f.decode(t,Jr);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 Qt.fromPublicError(n)}var r}async getDocumentThreads(){const t=new Gr(this._documentId),e=await this._sendRequest(Gr.TYPE,t),{threads:n}=f.decode(e,Yr);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new dn("Comments",this);return this._connectedSessions||(this._connectedSessions=await Zn.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(t,e){this._channel=t._getChannel(os._SERVICE,e),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(Pr.TYPE),((t,e)=>{const n=f.decode(e,Pr);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(Dr.TYPE),((t,e)=>{const n=f.decode(e,Dr);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(Vr.TYPE),((t,e)=>{const n=f.decode(e,Vr);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Rr.TYPE),((t,e)=>{const n=f.decode(e,Rr);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(Qr.TYPE),((t,e)=>{const n=f.decode(e,Qr);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(ns.TYPE),((t,e)=>{const n=f.decode(e,ns);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Xr.TYPE),((t,e)=>{const n=f.decode(e,Xr);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(ts.TYPE),((t,e)=>{const n=f.decode(e,ts);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(t){t===Me.DISCONNECTED&&this.disconnect()}_sendRequest(t,e){if(!this._wsGateway||!this._isConnected)throw new dn("Comments",this);return this._wsGateway._sendRequest(9,t,f.encode(e))}}os._SERVICE=9;const is=os,as=cs;function cs(t,e){const n=ds();return(cs=function(t,e){return n[t-=414]})(t,e)}function ds(){const t=["CONNECTING","has","CloudServices","define","3058034cAThHE","real-time-collaboration","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.","create","from","code","config","12niJmbH","reconnect","_reconnect","constructor","15014103HXTYyR","then","12ooFpKe","webSocketUrl","function","44808OESQbl","DISCONNECTED","all","change:me","272pZXMzV","context","CONNECTED","isInReconnectionStack","destroy","stopListening","WebSocketGateway","delete","error","721115EotiEC","addToReconnectionStack","isPremiumPlugin","online","showWarning","cloudservices-reconnection-error","disconnect","init","573106TWkRpI","catch","connection","_shouldPluginsReconnect","cloudServices.connectionTimeout","cloudservices-init","connected","8889255QjlTtU","offline","Connected users limit exceeded","websocketgateway-missing-token","pluginName","state","_reconnectionStack","248633NWUCun","websocketgateway-plugin-already-registered","4CzCZJv","get","token","set","plugins","_domEmitter","listenTo","cloudServices.requestTimeout","websocketgateway-missing-websocket-url","websocketgateway-invalid-plugin-interface","16CUlJfd","requires","limitExceeded","_isBrowserOffline","removeFromReconnectionStack","bind","initialReconnectionInterval","connect","add","30FnwkBs","isOfficialPlugin"];return(ds=function(){return t})()}!function(t){const e=cs,n=t();for(;;)try{if(672321===parseInt(e(423))/1*(parseInt(e(485))/2)+-parseInt(e(464))/3*(-parseInt(e(468))/4)+-parseInt(e(477))/5*(parseInt(e(461))/6)+parseInt(e(448))/7*(parseInt(e(433))/8)+-parseInt(e(414))/9+parseInt(e(442))/10*(parseInt(e(421))/11)+parseInt(e(455))/12*(-parseInt(e(459))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(ds);class us extends e.ContextPlugin{static get[as(434)](){return[as(446),r.Notification]}static get[as(418)](){return as(474)}static get[as(443)](){return!0}static get[as(479)](){return!0}constructor(t){const e=as;super(t),this[e(426)](e(419),Me[e(470)]),this[e(426)](e(436),!1),this[e(420)]=new Set,this[e(488)]=!1,this[e(428)]=Object[e(451)](n.DomEmitterMixin)}[as(484)](){const t=as,e=this[t(469)],s=e[t(427)][t(424)](t(446)),o=e[t(427)][t(424)](r.Notification);if(!s[t(425)])throw new n.CKEditorError(t(417),this);if(!s[t(462)])throw new n.CKEditorError(t(431),this);return this[t(428)][t(429)](window,t(415),(()=>this[t(436)]=!0)),this[t(428)][t(429)](window,t(480),(()=>this[t(436)]=!1)),this[t(469)][t(454)][t(447)](t(489),10),this[t(469)][t(454)][t(447)](t(430),20),us[t(474)][t(440)](s[t(425)],s[t(462)],{timeout:1e3*this[t(469)][t(454)][t(424)](t(489)),requestTimeout:1e3*this[t(469)][t(454)][t(424)](t(430))})[t(460)]((e=>{const r=t;if(this[r(487)]=e,this[r(438)](r(419)).to(e,r(419),this,r(436),((t,e)=>(r(491)!==t&&(this[r(488)]=!0),e||t!==Me[r(470)]?Me[r(465)]:this[r(419)]==Me[r(465)]&&this[r(488)]?(this[r(488)]=!1,this[r(457)](),Me[r(444)]):Me[r(470)]))),this[r(487)].on(r(476),((t,e)=>{const s=r;if(s(435)!==e[s(453)])throw console[s(476)](e),new n.CKEditorError(s(490),null,{originalError:e});o[s(481)](s(450),{title:s(416),namespace:s(449)})})),!e.me)return new Promise((t=>e.on(r(467),t)))}))[t(486)]((e=>{const r=t;throw console[r(476)](e),new n.CKEditorError(r(490),null,{originalError:e})}))}[as(478)](t){const e=as;if(e(463)!=typeof t[e(456)])throw new n.CKEditorError(e(432),this);if(this[e(471)](t))throw new n.CKEditorError(e(422),this,{name:t[e(458)][e(418)]});this[e(420)][e(441)](t)}[as(437)](t){const e=as;this[e(420)][e(475)](t)}[as(471)](t){const e=as;return this[e(420)][e(445)](t)}[as(457)](){const t=as;return this[t(487)][t(456)]()[t(460)]((()=>Promise[t(466)](Array[t(452)](this[t(420)],(e=>e[t(456)]())))))[t(460)]((()=>this[t(419)]=Me[t(470)]))[t(486)]((e=>{const r=t;throw console[r(476)](e),new n.CKEditorError(r(482),this[r(469)])}))}[as(483)](){const t=as;this[t(487)]&&this[t(487)][t(483)](),this[t(419)]=Me[t(465)],this[t(428)][t(473)]()}[as(472)](){const t=as;this[t(483)](),super[t(472)]()}}us[as(474)]=Be,us[as(439)]=1e3;const ls=us;var ps=__webpack_require__(211);const hs=fs;function fs(t,e){const n=ys();return(fs=function(t,e){return n[t-=404]})(t,e)}!function(t){const e=fs,n=t();for(;;)try{if(935122===parseInt(e(422))/1+parseInt(e(425))/2+-parseInt(e(442))/3*(-parseInt(e(427))/4)+-parseInt(e(461))/5+parseInt(e(412))/6*(-parseInt(e(439))/7)+-parseInt(e(444))/8*(-parseInt(e(447))/9)+parseInt(e(434))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(ys);class ms extends e.ContextPlugin{static get[hs(464)](){return hs(431)}static get[hs(432)](){return!0}static get[hs(457)](){return!0}static get[hs(419)](){return[ls,ps.Users]}constructor(t){const e=hs;super(t),this[e(413)]=new Map,this[e(418)]=new Map,this[e(462)]=new n.Collection,this[e(449)]=new Map,this[e(448)]=0,this[e(424)]=this[e(408)][e(420)][e(404)](ps.Users)}[hs(407)](){const t=hs,e=this[t(408)][t(420)][t(404)](ls);this[t(463)](e,t(443),((e,n,r)=>{const s=t;if(s(416)!==r)this[s(413)][s(459)]((t=>t[s(417)]())),this[s(418)][s(459)]((t=>t[s(417)]())),this[s(462)][s(417)]();else for(const[t,e]of this[s(449)])for(const n of e)this[s(456)](t,n)})),this[t(441)](e[t(409)].me,!0)}[hs(421)](t,e){const r=hs;if(this[r(449)][r(429)](t))throw new n.CKEditorError(r(410),null,{channelId:t});this[r(449)][r(458)](t,e),this[r(413)][r(458)](t,new n.Collection),this[r(418)][r(458)](t,new n.Collection),this[r(463)](e,r(411),((e,n)=>this[r(456)](t,n))),this[r(463)](e,r(453),((e,n)=>this[r(460)](t,n)));for(const n of e)this[r(456)](t,n)}[hs(436)](t){const e=hs;if(!this[e(449)][e(429)](t))throw new n.CKEditorError(e(452),null,{channelId:t});const r=this[e(449)][e(404)](t);this[e(433)](r);for(const n of r)e(416)===this[e(408)][e(420)][e(404)](ls)[e(450)]&&this[e(460)](t,n);this[e(449)][e(406)](t),this[e(413)][e(406)](t),this[e(418)][e(406)](t)}get[hs(415)](){const t=hs;return this[t(408)][t(420)][t(404)](ls)[t(409)][t(451)]}[hs(445)](t){const e=hs;for(const n of this[e(413)][e(428)]())for(const r of n)if(r.id===t)return r[e(440)]}[hs(430)](t,e){const n=hs,r=e?[this[n(413)][n(404)](e)]:this[n(413)][n(428)](),s=new Set;for(const e of r)for(const r of e)r[n(440)].id===t.id&&s[n(411)](r.id);return s}[hs(437)](t){const e=hs;for(const n of this[e(413)][e(428)]())for(const r of n)if(r[e(440)]===t)return r[e(405)]}[hs(456)](t,e){const n=hs;if(n(416)!==this[n(408)][n(420)][n(404)](ls)[n(450)])return;const r=e[n(440)],s=this[n(424)][n(454)](r.id)||this[n(441)](r),o=Object[n(446)]({},e,{user:s});this[n(413)][n(404)](t)[n(411)](o);const i=this[n(418)][n(404)](t);i[n(429)](s.id)||i[n(411)](s),this[n(462)][n(429)](s.id)||this[n(462)][n(411)](s,s[n(426)]?0:void 0),this[n(435)](n(455)+t,{channelId:t,session:o})}[hs(460)](t,e){const n=hs;if(n(416)!==this[n(408)][n(420)][n(404)](ls)[n(450)])return;const r=this[n(418)][n(404)](t),s=e[n(440)];s.id&&(this[n(413)][n(404)](t)[n(453)](e.id),r[n(429)](s.id)&&!this[n(430)](s,t)[n(414)]&&r[n(453)](s.id),this[n(462)][n(404)](s.id)&&!this[n(430)](s)[n(414)]&&this[n(462)][n(453)](s.id))}[hs(441)](t,e){const n=hs,r=this[n(424)][n(465)](t);return e&&this[n(424)][n(438)](t.id),r[n(423)]=this[n(448)]++,r}}function ys(){const t=["listenTo","pluginName","addUser","get","role","delete","init","context","connection","sessions-register-already-registered","add","11057358xNPTnU","channelSessions","size","mySessionId","connected","clear","channelConnectedUsers","requires","plugins","register","484089YNkDeS","orderNumber","_users","1859418IRTwLR","isMe","5236jOfHms","values","has","getUserSessions","Sessions","isOfficialPlugin","stopListening","245580KpHlfr","fire","unregister","getUserRole","defineMe","7RgwALK","user","_createUser","3513YOvtNk","change:state","48eLUYSA","getUserBySessionId","assign","1794393dXDbar","_uniqueUsersCount","_registeredSessions","state","sessionId","sessions-unregister-not-exist","remove","getUser","sessionAdd:","_handleSessionAdd","isPremiumPlugin","set","forEach","_handleSessionRemove","6947210AXVGkr","allConnectedUsers"];return(ys=function(){return t})()}var gs=__webpack_require__(673),bs=__webpack_require__.n(gs),Os=__webpack_require__(545),ws=__webpack_require__.n(Os),vs=__webpack_require__(262),Is=__webpack_require__.n(vs),Ss=__webpack_require__(667),Ps=__webpack_require__.n(Ss),ks=__webpack_require__(357),As=__webpack_require__.n(ks),_s=__webpack_require__(535),Ts={attributes:{"data-cke":!0}};Ts.setAttributes=Ps(),Ts.insert=Is().bind(null,"head"),Ts.domAPI=ws(),Ts.insertStyleElement=As();bs()(_s.A,Ts);_s.A&&_s.A.locals&&_s.A.locals;const Cs=Es;function js(){const t=["root","ck-user__selection","getPositions","getCustomProperty","setCustomProperty","keydown","addMarker","stopListening","mouseenter","getRange","innerHTML","applyOperation","schema","3456610JYgCAa","clear","25666XagEUd","removeClass","parent","createUIElement","getUserBySessionId","enqueueChange","_domEmitter","commands","selection","rootName","getMarkerClass","userPositionMarker","pluginName","document","12hwdQOt","setAttribute","tableCell","55BwWwJM","contenteditable","span","isObject","948507CZIBxK","toDomElement","data-session-id","reconvertMarker","ck-user__marker-tooltip","markers","user:","afterInit","markerToElement","getSelectionClass","destroy","oldRange","delete","type","requires","createRange","user:position:","textContent","nodeAfter","user:range:","plugins","mouseleave","color","createUserMarkerOperations","isInline","markerRange","fromRange","change","marker","change:range","hasContent","editing","split","deletionPosition","getAttribute","isPremiumPlugin","render","conversion","view","element","toRange","mySessionId","get","getFirstRange","start","markerNameToElements","set","updateMarker","createElement","has","remove","UserMarkers","false","detach","hasDomSelection","checkChild","model","_createdBatches","highest","editingDowncast",'⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span>',"mapper","3375558KewJMl","isDocumentOperation","ck-user__marker ","add","newRange","$text","isSimilar","name","945krIkiM","undo","markerToHighlight","init","542936OirKGP","isOfficialPlugin","Escape","batch","editor","listenTo","outerHTML","end","for","removeMarker","getNearestSelectionRange","40988AtNYNF","update:user:range","isCollapsed","spellcheck","markerName","$graveyard","orderNumber","ck-user__marker_hovered","user:position","startsWith","1230iOZurA","size","addEventListener","getStart","isLimit","getContainedElement","classList","user:range"];return(js=function(){return t})()}function Es(t,e){const n=js();return(Es=function(t,e){return n[t-=249]})(t,e)}!function(t){const e=Es,n=t();for(;;)try{if(232505===-parseInt(e(345))/1*(-parseInt(e(331))/2)+parseInt(e(352))/3+parseInt(e(298))/4*(-parseInt(e(348))/5)+parseInt(e(308))/6*(-parseInt(e(283))/7)+-parseInt(e(287))/8+-parseInt(e(275))/9+parseInt(e(329))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(js);class Ds extends e.Plugin{constructor(){const t=Es;super(...arguments),this[t(337)]=new((0,n.DomEmitterMixin)())}static get[Cs(366)](){return[ms]}static get[Cs(343)](){return Cs(264)}static get[Cs(288)](){return!0}static get[Cs(387)](){return!0}[Cs(286)](){const t=Cs,e=this[t(291)],r=e[t(372)][t(255)](ms);e[t(250)][t(295)](t(272))[t(360)]({model:t(306),view:(n,{writer:s})=>function(e,n,r,s){const o=t,i=e[o(302)][o(384)](":")[2],a=r[o(335)](i);if(!a||i===r[o(254)])return;if(!s[o(269)][o(328)][o(268)](e[o(377)][o(257)],o(280)))return;const c={class:o(277)+a[o(374)][o(341)](),"data-name":a[o(282)],"data-session-id":i},d=s[o(269)][o(357)][o(255)](e[o(302)])[o(311)](),u=d[o(370)],l=s[o(269)][o(328)];if(u&&l[o(351)](u)&&l[o(376)](u)&&!s[o(269)][o(357)][o(255)](o(371)+i)[o(325)]()[o(300)])return;const p=d[o(333)];return s[o(269)][o(328)][o(312)](p)&&!s[o(269)][o(382)](p)&&(c[o(349)]=!1),function(t,e,n){const r=o,s=t[r(334)](r(350),e);return t[r(320)](r(342),!0,s),s[r(249)]=function(t){const e=r,s=this[e(353)](t),o=document[e(261)](e(350));return o[e(314)][e(278)](e(356)),o[e(346)](e(349),e(265)),o[e(346)](e(301),e(265)),o[e(369)]=n[e(282)],s[e(326)]=e(273)+o[e(293)]+"⁠",s[e(310)](e(324),(()=>{const t=e;s[t(314)][t(278)](t(305))})),s[e(310)](e(373),(()=>{const t=e;s[t(314)][t(263)](t(305))})),s},s[r(281)]=function(t){const e=r;return!(!this[e(319)](e(342))||!t[e(319)](e(342))||this[e(386)](e(354))!=t[e(386)](e(354)))},s}(n,c,a)}(n,s,r,e)}),e[t(250)][t(295)](t(272))[t(285)]({model:t(315),view:e=>function(e,n){const r=t,s=e[r(302)][r(384)](":")[2];if(s===n[r(254)])return null;const o=n[r(335)](s);return o?{id:s,classes:[r(317),o[r(374)][r(361)]()],attributes:{"data-session-id":s},priority:2e3+o[r(304)]}:{id:s,classes:[]}}(e,r)}),function(e){const n=t,r=e[n(269)],o=new Map,i=e[n(372)][n(255)](ms);r[n(357)].on(n(299),((t,a,c,d)=>{const u=n;if(!d&&o[u(255)](a[u(282)]))return o[u(255)](a[u(282)])[u(266)](),void o[u(364)](a[u(282)]);const l=a[u(282)][u(384)](":")[2];if(l===i[u(254)])return;const p=u(368)+l;r[u(357)][u(262)](p)&&e[u(383)][u(355)](p),a.on(u(381),((t,e,n)=>{const i=u;if(i(303)!=e[i(316)][i(340)]&&i(303)==a[i(325)]()[i(316)][i(340)]&&!o[i(262)](a[i(282)])){const t=r[i(328)][i(297)](n[i(385)]);if(t){const e=s.LiveRange[i(378)](t);o[i(259)](a[i(282)],e),e.on(i(381),((t,n,s)=>{const c=i;if(c(303)==e[c(316)][c(340)]){const t=r[c(328)][c(297)](s[c(385)]);t?(e[c(257)]=t[c(257)],e[c(294)]=t[c(294)]):(o[c(364)](a[c(282)]),e[c(266)]())}}))}}}))})),r[n(344)].on(n(379),(()=>{const t=n;o[t(309)]>0&&r[t(336)]({isUndoable:!1},(e=>{const n=t;for(const[t,s]of o)n(303)==r[n(357)][n(255)](t)[n(325)]()[n(316)][n(340)]&&(xs(t[n(384)](":")[2],s[n(253)](),r,e),s[n(266)]());o[n(330)]()}))}))}(e),this[t(337)][t(292)](n.global[t(344)],t(321),((n,{key:r})=>{const s=t;s(289)===r&&function(t){const e=s;t[e(383)][e(251)][e(379)]((n=>{const r=e;for(const e of t[r(269)][r(357)]){if(!e[r(282)][r(307)](r(306)))continue;const s=t[r(383)][r(274)][r(258)](e[r(282)]);if(s)for(const t of s)n[r(332)](r(305),t)}}))}(e)}),{useCapture:!0})}[Cs(359)](){const t=Cs,e=this[t(291)],n=e[t(338)][t(255)](t(284));n&&e[t(269)].on(t(327),((r,s)=>{const o=t,i=s[0];if(!i[o(276)])return;if(o(380)!=i[o(365)]||!i[o(282)][o(307)](o(358)))return;const a=i[o(290)];n[o(270)][o(262)](a)&&(i[o(279)]=i[o(363)]?e[o(269)][o(367)](i[o(363)][o(257)],i[o(363)][o(294)]):null)}),{priority:t(271)})}[Cs(362)](){const t=Cs;return this[t(337)][t(323)](),super[t(362)]()}[Cs(375)](){const t=Cs,e=this[t(291)],n=e[t(269)][t(344)],r=e[t(372)][t(255)](ms);e[t(269)][t(336)]({isUndoable:!1},(s=>{const o=t,i=o(371)+r[o(254)],a=o(368)+r[o(254)],c=e[o(269)][o(357)][o(262)](i);e[o(383)][o(251)][o(267)]?xs(r[o(254)],n[o(339)][o(256)](),e[o(269)],s):c&&(s[o(296)](i),s[o(296)](a))}))}}function xs(t,e,n,r){const s=Cs,o=s(371)+t,i=s(368)+t,a=e[s(313)]();let c=e[s(257)];a&&a.is(s(252),s(347))&&(c=function(t,e){const n=s;for(const r of t[n(318)]())if(e[n(328)][n(268)](r,n(280)))return r}(e,n),e=r[s(367)](c));const d=r[s(367)](c);n[s(357)][s(262)](o)?(r[s(260)](o,{range:e}),r[s(260)](i,{range:d})):(r[s(322)](o,{range:e,usingOperation:!0}),r[s(322)](i,{range:d,usingOperation:!0}))}function Rs(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 Ns=(()=>{var t=p.Reader,e=p.Writer,n=p.util,r=p.roots.default||(p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.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,p.util.toJSONOptions)},s.getTypeUrl=function(t){return void 0===t&&(t="type.googleapis.com"),t+"/Element"},s}(),r})();class Vs{constructor(){this._protobufRoot=Ns}getDescriptor(t){return new Ms(this._protobufRoot[t])}}class Ms{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})}}const Us=function(){this.__data__=[],this.size=0};const Bs=function(t,e){return t===e||t!=t&&e!=e};const Js=function(t,e){for(var n=t.length;n--;)if(Bs(t[n][0],e))return n;return-1};var qs=Array.prototype.splice;const Gs=function(t){var e=this.__data__,n=Js(e,t);return!(n<0)&&(n==e.length-1?e.pop():qs.call(e,n,1),--this.size,!0)};const Ls=function(t){var e=this.__data__,n=Js(e,t);return n<0?void 0:e[n][1]};const Ys=function(t){return Js(this.__data__,t)>-1};const Hs=function(t,e){var n=this.__data__,r=Js(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};function zs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}zs.prototype.clear=Us,zs.prototype.delete=Gs,zs.prototype.get=Ls,zs.prototype.has=Ys,zs.prototype.set=Hs;const Fs=zs;const Ks=function(){this.__data__=new Fs,this.size=0};const Ws=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};const Qs=function(t){return this.__data__.get(t)};const $s=function(t){return this.__data__.has(t)};const Xs="object"==typeof global&&global&&global.Object===Object&&global;var Zs="object"==typeof self&&self&&self.Object===Object&&self;const to=Xs||Zs||Function("return this")();const eo=to.Symbol;var no=Object.prototype,ro=no.hasOwnProperty,so=no.toString,oo=eo?eo.toStringTag:void 0;const io=function(t){var e=ro.call(t,oo),n=t[oo];try{t[oo]=void 0;var r=!0}catch(t){}var s=so.call(t);return r&&(e?t[oo]=n:delete t[oo]),s};var ao=Object.prototype.toString;const co=function(t){return ao.call(t)};var uo=eo?eo.toStringTag:void 0;const lo=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":uo&&uo in Object(t)?io(t):co(t)};const po=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const ho=function(t){if(!po(t))return!1;var e=lo(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const fo=to["__core-js_shared__"];var mo,yo=(mo=/[^.]+$/.exec(fo&&fo.keys&&fo.keys.IE_PROTO||""))?"Symbol(src)_1."+mo:"";const go=function(t){return!!yo&&yo in t};var bo=Function.prototype.toString;const Oo=function(t){if(null!=t){try{return bo.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var wo=/^\[object .+?Constructor\]$/,vo=Function.prototype,Io=Object.prototype,So=vo.toString,Po=Io.hasOwnProperty,ko=RegExp("^"+So.call(Po).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Ao=function(t){return!(!po(t)||go(t))&&(ho(t)?ko:wo).test(Oo(t))};const _o=function(t,e){return null==t?void 0:t[e]};const To=function(t,e){var n=_o(t,e);return Ao(n)?n:void 0};const Co=To(to,"Map");const jo=To(Object,"create");const Eo=function(){this.__data__=jo?jo(null):{},this.size=0};const Do=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var xo=Object.prototype.hasOwnProperty;const Ro=function(t){var e=this.__data__;if(jo){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return xo.call(e,t)?e[t]:void 0};var No=Object.prototype.hasOwnProperty;const Vo=function(t){var e=this.__data__;return jo?void 0!==e[t]:No.call(e,t)};const Mo=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=jo&&void 0===e?"__lodash_hash_undefined__":e,this};function Uo(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Uo.prototype.clear=Eo,Uo.prototype.delete=Do,Uo.prototype.get=Ro,Uo.prototype.has=Vo,Uo.prototype.set=Mo;const Bo=Uo;const Jo=function(){this.size=0,this.__data__={hash:new Bo,map:new(Co||Fs),string:new Bo}};const qo=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};const Go=function(t,e){var n=t.__data__;return qo(e)?n["string"==typeof e?"string":"hash"]:n.map};const Lo=function(t){var e=Go(this,t).delete(t);return this.size-=e?1:0,e};const Yo=function(t){return Go(this,t).get(t)};const Ho=function(t){return Go(this,t).has(t)};const zo=function(t,e){var n=Go(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Fo(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Fo.prototype.clear=Jo,Fo.prototype.delete=Lo,Fo.prototype.get=Yo,Fo.prototype.has=Ho,Fo.prototype.set=zo;const Ko=Fo;const Wo=function(t,e){var n=this.__data__;if(n instanceof Fs){var r=n.__data__;if(!Co||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ko(r)}return n.set(t,e),this.size=n.size,this};function Qo(t){var e=this.__data__=new Fs(t);this.size=e.size}Qo.prototype.clear=Ks,Qo.prototype.delete=Ws,Qo.prototype.get=Qs,Qo.prototype.has=$s,Qo.prototype.set=Wo;const $o=Qo;const Xo=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t};const Zo=function(){try{var t=To(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const ti=function(t,e,n){"__proto__"==e&&Zo?Zo(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n};var ei=Object.prototype.hasOwnProperty;const ni=function(t,e,n){var r=t[e];ei.call(t,e)&&Bs(r,n)&&(void 0!==n||e in t)||ti(t,e,n)};const ri=function(t,e,n,r){var s=!n;n||(n={});for(var o=-1,i=e.length;++o<i;){var a=e[o],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),s?ti(n,a,c):ni(n,a,c)}return n};const si=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r};const oi=function(t){return null!=t&&"object"==typeof t};const ii=function(t){return oi(t)&&"[object Arguments]"==lo(t)};var ai=Object.prototype,ci=ai.hasOwnProperty,di=ai.propertyIsEnumerable,ui=ii(function(){return arguments}())?ii:function(t){return oi(t)&&ci.call(t,"callee")&&!di.call(t,"callee")};const li=ui;const pi=Array.isArray;const hi=function(){return!1};var fi="object"==typeof exports&&exports&&!exports.nodeType&&exports,mi=fi&&"object"==typeof module&&module&&!module.nodeType&&module,yi=mi&&mi.exports===fi?to.Buffer:void 0;const gi=(yi?yi.isBuffer:void 0)||hi;var bi=/^(?:0|[1-9]\d*)$/;const Oi=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&bi.test(t))&&t>-1&&t%1==0&&t<e};const wi=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var vi={};vi["[object Float32Array]"]=vi["[object Float64Array]"]=vi["[object Int8Array]"]=vi["[object Int16Array]"]=vi["[object Int32Array]"]=vi["[object Uint8Array]"]=vi["[object Uint8ClampedArray]"]=vi["[object Uint16Array]"]=vi["[object Uint32Array]"]=!0,vi["[object Arguments]"]=vi["[object Array]"]=vi["[object ArrayBuffer]"]=vi["[object Boolean]"]=vi["[object DataView]"]=vi["[object Date]"]=vi["[object Error]"]=vi["[object Function]"]=vi["[object Map]"]=vi["[object Number]"]=vi["[object Object]"]=vi["[object RegExp]"]=vi["[object Set]"]=vi["[object String]"]=vi["[object WeakMap]"]=!1;const Ii=function(t){return oi(t)&&wi(t.length)&&!!vi[lo(t)]};const Si=function(t){return function(e){return t(e)}};var Pi="object"==typeof exports&&exports&&!exports.nodeType&&exports,ki=Pi&&"object"==typeof module&&module&&!module.nodeType&&module,Ai=ki&&ki.exports===Pi&&Xs.process;const _i=function(){try{var t=ki&&ki.require&&ki.require("util").types;return t||Ai&&Ai.binding&&Ai.binding("util")}catch(t){}}();var Ti=_i&&_i.isTypedArray;const Ci=Ti?Si(Ti):Ii;var ji=Object.prototype.hasOwnProperty;const Ei=function(t,e){var n=pi(t),r=!n&&li(t),s=!n&&!r&&gi(t),o=!n&&!r&&!s&&Ci(t),i=n||r||s||o,a=i?si(t.length,String):[],c=a.length;for(var d in t)!e&&!ji.call(t,d)||i&&("length"==d||s&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Oi(d,c))||a.push(d);return a};var Di=Object.prototype;const xi=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Di)};const Ri=function(t,e){return function(n){return t(e(n))}};const Ni=Ri(Object.keys,Object);var Vi=Object.prototype.hasOwnProperty;const Mi=function(t){if(!xi(t))return Ni(t);var e=[];for(var n in Object(t))Vi.call(t,n)&&"constructor"!=n&&e.push(n);return e};const Ui=function(t){return null!=t&&wi(t.length)&&!ho(t)};const Bi=function(t){return Ui(t)?Ei(t):Mi(t)};const Ji=function(t,e){return t&&ri(e,Bi(e),t)};const qi=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e};var Gi=Object.prototype.hasOwnProperty;const Li=function(t){if(!po(t))return qi(t);var e=xi(t),n=[];for(var r in t)("constructor"!=r||!e&&Gi.call(t,r))&&n.push(r);return n};const Yi=function(t){return Ui(t)?Ei(t,!0):Li(t)};const Hi=function(t,e){return t&&ri(e,Yi(e),t)};var zi="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fi=zi&&"object"==typeof module&&module&&!module.nodeType&&module,Ki=Fi&&Fi.exports===zi?to.Buffer:void 0,Wi=Ki?Ki.allocUnsafe:void 0;const Qi=function(t,e){if(e)return t.slice();var n=t.length,r=Wi?Wi(n):new t.constructor(n);return t.copy(r),r};const $i=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e};const Xi=function(t,e){for(var n=-1,r=null==t?0:t.length,s=0,o=[];++n<r;){var i=t[n];e(i,n,t)&&(o[s++]=i)}return o};const Zi=function(){return[]};var ta=Object.prototype.propertyIsEnumerable,ea=Object.getOwnPropertySymbols;const na=ea?function(t){return null==t?[]:(t=Object(t),Xi(ea(t),(function(e){return ta.call(t,e)})))}:Zi;const ra=function(t,e){return ri(t,na(t),e)};const sa=function(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t};const oa=Ri(Object.getPrototypeOf,Object);const ia=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)sa(e,na(t)),t=oa(t);return e}:Zi;const aa=function(t,e){return ri(t,ia(t),e)};const ca=function(t,e,n){var r=e(t);return pi(t)?r:sa(r,n(t))};const da=function(t){return ca(t,Bi,na)};const ua=function(t){return ca(t,Yi,ia)};const la=To(to,"DataView");const pa=To(to,"Promise");const ha=To(to,"Set");const fa=To(to,"WeakMap");var ma="[object Map]",ya="[object Promise]",ga="[object Set]",ba="[object WeakMap]",Oa="[object DataView]",wa=Oo(la),va=Oo(Co),Ia=Oo(pa),Sa=Oo(ha),Pa=Oo(fa),ka=lo;(la&&ka(new la(new ArrayBuffer(1)))!=Oa||Co&&ka(new Co)!=ma||pa&&ka(pa.resolve())!=ya||ha&&ka(new ha)!=ga||fa&&ka(new fa)!=ba)&&(ka=function(t){var e=lo(t),n="[object Object]"==e?t.constructor:void 0,r=n?Oo(n):"";if(r)switch(r){case wa:return Oa;case va:return ma;case Ia:return ya;case Sa:return ga;case Pa:return ba}return e});const Aa=ka;var _a=Object.prototype.hasOwnProperty;const Ta=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&_a.call(t,"index")&&(n.index=t.index,n.input=t.input),n};const Ca=to.Uint8Array;const ja=function(t){var e=new t.constructor(t.byteLength);return new Ca(e).set(new Ca(t)),e};const Ea=function(t,e){var n=e?ja(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)};var Da=/\w*$/;const xa=function(t){var e=new t.constructor(t.source,Da.exec(t));return e.lastIndex=t.lastIndex,e};var Ra=eo?eo.prototype:void 0,Na=Ra?Ra.valueOf:void 0;const Va=function(t){return Na?Object(Na.call(t)):{}};const Ma=function(t,e){var n=e?ja(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};const Ua=function(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return ja(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return Ea(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ma(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return xa(t);case"[object Symbol]":return Va(t)}};var Ba=Object.create;const Ja=function(){function t(){}return function(e){if(!po(e))return{};if(Ba)return Ba(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const qa=function(t){return"function"!=typeof t.constructor||xi(t)?{}:Ja(oa(t))};const Ga=function(t){return oi(t)&&"[object Map]"==Aa(t)};var La=_i&&_i.isMap;const Ya=La?Si(La):Ga;const Ha=function(t){return oi(t)&&"[object Set]"==Aa(t)};var za=_i&&_i.isSet;const Fa=za?Si(za):Ha;var Ka="[object Arguments]",Wa="[object Function]",Qa="[object Object]",$a={};$a[Ka]=$a["[object Array]"]=$a["[object ArrayBuffer]"]=$a["[object DataView]"]=$a["[object Boolean]"]=$a["[object Date]"]=$a["[object Float32Array]"]=$a["[object Float64Array]"]=$a["[object Int8Array]"]=$a["[object Int16Array]"]=$a["[object Int32Array]"]=$a["[object Map]"]=$a["[object Number]"]=$a[Qa]=$a["[object RegExp]"]=$a["[object Set]"]=$a["[object String]"]=$a["[object Symbol]"]=$a["[object Uint8Array]"]=$a["[object Uint8ClampedArray]"]=$a["[object Uint16Array]"]=$a["[object Uint32Array]"]=!0,$a["[object Error]"]=$a[Wa]=$a["[object WeakMap]"]=!1;const Xa=function t(e,n,r,s,o,i){var a,c=1&n,d=2&n,u=4&n;if(r&&(a=o?r(e,s,o,i):r(e)),void 0!==a)return a;if(!po(e))return e;var l=pi(e);if(l){if(a=Ta(e),!c)return $i(e,a)}else{var p=Aa(e),h=p==Wa||"[object GeneratorFunction]"==p;if(gi(e))return Qi(e,c);if(p==Qa||p==Ka||h&&!o){if(a=d||h?{}:qa(e),!c)return d?aa(e,Hi(a,e)):ra(e,Ji(a,e))}else{if(!$a[p])return o?e:{};a=Ua(e,p,c)}}i||(i=new $o);var f=i.get(e);if(f)return f;i.set(e,a),Fa(e)?e.forEach((function(s){a.add(t(s,n,r,s,e,i))})):Ya(e)&&e.forEach((function(s,o){a.set(o,t(s,n,r,o,e,i))}));var m=l?void 0:(u?d?ua:da:d?Yi:Bi)(e);return Xo(m||e,(function(s,o){m&&(s=e[o=s]),ni(a,o,t(s,n,r,o,e,i))})),a};const Za=function(t){return Xa(t,5)};const tc=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const ec=function(t){return this.__data__.has(t)};function nc(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Ko;++e<n;)this.add(t[e])}nc.prototype.add=nc.prototype.push=tc,nc.prototype.has=ec;const rc=nc;const sc=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1};const oc=function(t,e){return t.has(e)};const ic=function(t,e,n,r,s,o){var i=1&n,a=t.length,c=e.length;if(a!=c&&!(i&&c>a))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var l=-1,p=!0,h=2&n?new rc:void 0;for(o.set(t,e),o.set(e,t);++l<a;){var f=t[l],m=e[l];if(r)var y=i?r(m,f,l,e,t,o):r(f,m,l,t,e,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!sc(e,(function(t,e){if(!oc(h,e)&&(f===t||s(f,t,n,r,o)))return h.push(e)}))){p=!1;break}}else if(f!==m&&!s(f,m,n,r,o)){p=!1;break}}return o.delete(t),o.delete(e),p};const ac=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n};const cc=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n};var dc=eo?eo.prototype:void 0,uc=dc?dc.valueOf:void 0;const lc=function(t,e,n,r,s,o,i){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Ca(t),new Ca(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Bs(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=ac;case"[object Set]":var c=1&r;if(a||(a=cc),t.size!=e.size&&!c)return!1;var d=i.get(t);if(d)return d==e;r|=2,i.set(t,e);var u=ic(a(t),a(e),r,s,o,i);return i.delete(t),u;case"[object Symbol]":if(uc)return uc.call(t)==uc.call(e)}return!1};var pc=Object.prototype.hasOwnProperty;const hc=function(t,e,n,r,s,o){var i=1&n,a=da(t),c=a.length;if(c!=da(e).length&&!i)return!1;for(var d=c;d--;){var u=a[d];if(!(i?u in e:pc.call(e,u)))return!1}var l=o.get(t),p=o.get(e);if(l&&p)return l==e&&p==t;var h=!0;o.set(t,e),o.set(e,t);for(var f=i;++d<c;){var m=t[u=a[d]],y=e[u];if(r)var g=i?r(y,m,u,e,t,o):r(m,y,u,t,e,o);if(!(void 0===g?m===y||s(m,y,n,r,o):g)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var b=t.constructor,O=e.constructor;b==O||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return o.delete(t),o.delete(e),h};var fc="[object Arguments]",mc="[object Array]",yc="[object Object]",gc=Object.prototype.hasOwnProperty;const bc=function(t,e,n,r,s,o){var i=pi(t),a=pi(e),c=i?mc:Aa(t),d=a?mc:Aa(e),u=(c=c==fc?yc:c)==yc,l=(d=d==fc?yc:d)==yc,p=c==d;if(p&&gi(t)){if(!gi(e))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new $o),i||Ci(t)?ic(t,e,n,r,s,o):lc(t,e,c,n,r,s,o);if(!(1&n)){var h=u&&gc.call(t,"__wrapped__"),f=l&&gc.call(e,"__wrapped__");if(h||f){var m=h?t.value():t,y=f?e.value():e;return o||(o=new $o),s(m,y,n,r,o)}}return!!p&&(o||(o=new $o),hc(t,e,n,r,s,o))};const Oc=function t(e,n,r,s,o){return e===n||(null==e||null==n||!oi(e)&&!oi(n)?e!=e&&n!=n:bc(e,n,r,s,t,o))};const wc=function(t,e){return Oc(t,e)};function vc(t,e){const n=Za(t);return n.path[n.path.length-1]+=e,n}function Ic(t,e){return t.root===e.root&&wc(t.path,e.path)}function Sc(t){kc(t,(t=>("main"==t.root?(t.rootMain=!0,delete t.root):"$graveyard"==t.root&&(t.rootGraveyard=!0,delete t.root),t)))}function Pc(t){kc(t,(t=>(t.rootMain?(t.root="main",delete t.rootMain):t.rootGraveyard&&(t.root="$graveyard",delete t.rootGraveyard),t)))}function kc(t,e){for(const n in t){const r=t[n];"nodes"!==n&&po(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?t[n]=e(r):kc(r,e))}return t}class Ac{constructor(t,e,n){this._id=t,this._operationName=e,this._protobufDescriptor=n}compress(t,e){const n=e.shift();return Sc(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());Pc(n),n.__className=this._operationName,t.push(n)}}class _c extends Ac{compress(t,e){const n=e.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),Sc(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),Pc(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 Tc extends Ac{compress(t,e){const n=e.shift();return this._serializeNodesAttributes(n.nodes),Sc(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),Pc(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 Cc extends Ac{decompress(t,e){super.decompress(t,e);const n=t[t.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class jc extends Ac{compress(t,e){return e.shift(),t.types.push(this._id),!0}decompress(t,e){e.types.shift(),t.push({__className:this._operationName})}}class Ec extends Cc{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 Dc{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=Za(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 xc extends Dc{_combineNext(t,e){return e.nodes[0].data+=t.nodes[0].data,e}_splitCurrent(t){const e=Za(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=vc(t.position,o),e}_compareOperations(t,e){if(this._checkOperation(t)&&this._checkOperation(e)){const n=t.nodes[0].data.length,r=Ic(vc(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 Rc extends Dc{_combineNext(t,e){return e.howMany++,e.sourcePosition=Za(t.sourcePosition),e}_splitCurrent(t){const e=Za(t);return t.howMany--,e.howMany=1,e.sourcePosition=vc(e.sourcePosition,t.howMany),e}_compareOperations(t,e){return!(!this._checkOperation(t)||!this._checkOperation(e))&&(Ic(vc(t.sourcePosition,-1),e.sourcePosition)&&Ic(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 Nc extends Dc{_combineNext(t,e){return e.howMany++,e}_splitCurrent(t){const e=Za(t);return e.howMany=1,t.howMany--,e}_compareOperations(t,e){return!(!this._checkOperation(t)||!this._checkOperation(e))&&(Ic(t.sourcePosition,e.sourcePosition)&&Ic(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 Vc extends Dc{compress(t,e){if(!this._compareOperations(e[0],e[1]))return!1;const n=e.shift();return n.oldRange=null,n.newRange&&Ic(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=Za(n.newRange.start));const r=Za(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=Za(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 Mc{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new Vs;const t=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new jc(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",_c),this._registerOperationCompressor(11,"InsertOperation",Tc),this._registerOperationCompressor(12,"MarkerOperation",Cc),this._registerOperationCompressor(13,"MergeOperation",Ac),this._registerOperationCompressor(14,"MoveOperation",Ac),this._registerOperationCompressor(15,"RenameOperation",Ac),this._registerOperationCompressor(16,"RootAttributeOperation",_c),this._registerOperationCompressor(17,"SplitOperation",Ac),this._registerCompressor(18,"CommentMarkerOperation",new Ec(18,"MarkerOperation",t,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Ec(19,"MarkerOperation",t,"suggestion")),this._registerOperationCompressor(20,"RootOperation",Ac),this._registerActionCompressor(100,"TypingAction",xc),this._registerActionCompressor(101,"DeletingAction",Rc),this._registerActionCompressor(102,"ForwardDeletingAction",Nc),this._registerActionCompressor(103,"UserSelectionAction",Vc)}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 Uc=Lc;!function(t){const e=Lc,n=t();for(;;)try{if(303131===-parseInt(e(386))/1*(parseInt(e(319))/2)+parseInt(e(299))/3*(-parseInt(e(465))/4)+parseInt(e(357))/5+-parseInt(e(281))/6*(-parseInt(e(456))/7)+-parseInt(e(273))/8*(parseInt(e(247))/9)+parseInt(e(284))/10*(parseInt(e(248))/11)+parseInt(e(308))/12*(parseInt(e(225))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(qc);let Bc=1;class Jc extends e.Plugin{static get[Uc(312)](){return[ls,ms,Ds,e.PendingActions,ps.Users,r.Notification]}static get[Uc(460)](){return Uc(303)}static get[Uc(348)](){return!0}static get[Uc(466)](){return!0}get[Uc(378)](){const t=Uc;return this[t(471)]+this[t(269)]}get[Uc(471)](){const t=Uc;return this[t(388)][t(397)]-this[t(269)]}get[Uc(458)](){const t=Uc,e=this[t(388)][t(443)]();for(let n=e[t(414)]-1;n>=0;n--){const r=e[n];if(!this[t(277)][t(350)](r))return r[t(343)]+1-this[t(269)]}return 0}constructor(t){const e=Uc;if(super(t),this[e(269)]=0,this[e(279)]=null,this[e(388)]=new s.History,this[e(387)][e(383)][e(324)](e(307),{}),this[e(469)]=this[e(387)][e(383)][e(361)](e(347)),!this[e(469)])throw new n.CKEditorError(e(241),this);const r=t[e(383)][e(361)](e(459))||n.version;this[e(406)]=new(Jc[e(338)])(r,this[e(469)]),this[e(467)]=this[e(387)][e(267)][e(453)],this[e(447)]=new Mc,this[e(336)]=[],this[e(254)]=new WeakSet,this[e(337)]=new Set,this[e(245)](e(257),!1),this[e(245)](e(429),!1),this[e(428)]=null,this[e(375)]=!1,this[e(230)]=null,this[e(320)]=300,this[e(360)]=this[e(320)],this[e(473)]=null,this[e(277)]=new WeakSet,this[e(433)]=new zc(this[e(277)])}[Uc(234)](){const t=Uc,e=this[t(387)],n=e[t(399)][t(361)](ps.Users),r=e[t(399)][t(361)](ls);this[t(296)](n,t(293),((e,r)=>{const s=t,o=r[0];o[s(390)]&&(e[s(373)]=n[s(260)](o[s(390)]),e[s(345)]()),null===o[s(390)]&&(e[s(373)]=null,e[s(345)]())}),{priority:t(363)}),this[t(296)](e[t(267)][t(453)][t(313)],t(451),((e,n)=>{const r=t;n[r(306)]&&this[r(401)]()})),this[t(296)](e[t(300)][t(351)],t(252),(()=>{this[t(401)]()})),this[t(286)](),e[t(267)].on(t(311),((e,n)=>{const r=t,s=n[0];s[r(263)]&&(this[r(385)](s),this[r(326)]()&&this[r(244)]())})),this[t(472)](),this[t(262)](t(237)).to(r,t(457),this,t(429),((e,n)=>t(392)===e&&!n)),this.on(t(393),(()=>{const n=t;this[n(237)]?e[n(382)](n(408)):e[n(372)](n(408))})),this[t(237)]?e[t(382)](t(408)):e[t(372)](t(408)),this[t(245)](t(274),!1)}async[Uc(462)](){const t=Uc,e=this[t(387)][t(399)][t(361)](ms),n=this[t(387)][t(399)][t(361)](ls);try{this[t(257)]=!0,e[t(430)](this[t(469)]);const r=await this[t(406)][t(462)](n[t(335)],this[t(458)]);await this[t(440)](r)&&(this[t(257)]=!1,this[t(354)]());const s=await this[t(406)][t(371)]();e[t(403)](this[t(469)],s),this[t(322)](),this[t(274)]=!0}catch(e){if(function(e){const n=t;return n(302)===e[n(374)]}(e)&&this[t(279)])await this[t(407)]();else if(function(e){const n=t;return n(314)===e[n(374)]}(e)){const e=Rs(this[t(387)][t(331)],t(427));this[t(432)](e)}else{if(!(e instanceof Yc))throw e;this[t(432)]()}}}[Uc(328)](){const t=Uc,e=this[t(387)][t(399)][t(361)](ls),n=this[t(387)][t(399)][t(361)](ms);this[t(387)][t(372)](t(228)),n[t(270)][t(350)](this[t(469)])&&n[t(430)](this[t(469)]),e[t(384)](this),this[t(305)](),super[t(328)]()}async[Uc(440)](t){const e=Uc;if(this[e(279)]!==t[e(279)]&&this[e(473)]!==t[e(404)])throw new Yc;return this[e(279)]=t[e(279)],this[e(431)]([],{...t,wereChangesApplied:!1,data:t[e(265)]},e(462))}async[Uc(251)](t,e=!1){const n=Uc,{connection:r}=this[n(387)][n(399)][n(361)](ls);Jc[n(338)][n(371)](r,this[n(469)])[n(217)]((t=>this[n(341)](t)))[n(362)]((t=>{const e=n;this[e(229)](e(321),t)})),this[n(296)](this[n(406)],n(301),this[n(418)][n(262)](this)),this[n(296)](this[n(406)],n(477),((t,e)=>{const r=n;this[r(229)](r(318),e)})),this[n(296)](this[n(406)],n(409),(()=>{this[n(274)]=!1}));const s=this[n(433)][n(475)](t);this[n(257)]=!0;const o=await this[n(406)][n(255)](r,this[n(216)](t),s);if(this[n(279)]=o[n(279)],e){if(!o[n(442)])return void this[n(432)]();this[n(257)]=!1,this[n(354)](),this[n(388)][n(421)](),this[n(269)]=o[n(261)],this[n(388)][n(397)]=this[n(269)],await this[n(431)](t,o,n(243))}else await this[n(334)](o,t);this[n(322)](),this[n(274)]=!0}[Uc(322)](){const t=Uc,e=this[t(387)][t(399)][t(361)](ms),n=this[t(387)][t(399)][t(361)](Ds),r=e[t(270)][t(361)](this[t(469)]);r&&r[t(414)]>1?n[t(400)]():this[t(296)](e,t(419)+this[t(469)],(()=>{const r=t;2===e[r(270)][r(361)](this[r(469)])[r(414)]&&n[r(400)]()}))}async[Uc(418)](t,e,n,r){const s=Uc;if(!this[s(257)]&&this[s(467)][s(397)]==e){const t=this[s(436)](n,r);await this[s(420)](t),this[s(434)](t,e,n[s(404)])||this[s(229)](s(222))}}async[Uc(407)](){const t=Uc;this[t(305)]();const{locale:e}=this[t(387)];let n;try{n=await this[t(406)][t(333)]()}catch(n){const r=Rs(e,t(441));return void this[t(432)](r)}const r=n[t(290)]||n[t(294)];if(this[t(473)]===r[t(404)])await this[t(251)](this[t(387)][t(267)][t(453)][t(271)][t(443)](),!0);else{const n=Rs(e,t(444));this[t(432)](n)}}[Uc(305)](){const t=Uc;this[t(406)][t(297)](),this[t(336)]=[],clearTimeout(this[t(230)]),this[t(349)](this[t(406)])}[Uc(341)](t){const e=Uc,n=this[e(387)][e(399)][e(361)](ms);this[e(296)](n,e(419)+this[e(469)],((t,{session:r})=>{const s=e;if(r.id===n[s(445)]){t[s(376)]();const e=this[s(387)][s(399)][s(350)](s(280))&&this[s(387)][s(399)][s(361)](s(280));let n=r[s(478)];e&&e[s(266)]&&(n=n[s(391)]((t=>s(352)!==t))),this[s(387)][s(399)][s(361)](s(224))[s(417)](n,this[s(469)])}})),n[e(403)](this[e(469)],t)}[Uc(286)](){const t=Uc,e=this[t(387)][t(265)][t(245)];this[t(387)][t(265)][t(245)]=(...r)=>{const s=t;if(!r[r[s(414)]-1][s(410)])throw new n.CKEditorError(s(402),this);e[s(340)](this[s(387)][s(265)],r)}}[Uc(472)](){const t=Uc;this[t(387)][t(265)].on(t(234),((e,[r])=>{const o=t;if(this[o(467)][o(397)])throw new n.CKEditorError(o(448),this);e[o(345)](),this[o(339)]();const i=this[o(387)][o(383)][o(361)](o(346)),a=this[o(219)](r,i);0==a[o(414)]&&a[o(449)](new s.NoOperation(0)),e[o(373)]=this[o(251)](a)[o(217)]((()=>{const t=o;this[t(387)][t(399)][t(361)](ls)[t(452)](this),this[t(387)][t(265)][t(368)](t(239))}))[o(362)]((t=>this[o(229)](o(389),t)))[o(283)]((()=>this[o(354)]()))}),{priority:t(363)}),this[t(387)].on(t(367),(async(e,[n,r])=>{const s=t;e[s(345)]();const o=this[s(387)][s(267)][s(453)][s(282)](n);if(!this[s(337)][s(350)](n)){const t=r&&r[s(265)]?r[s(265)]:"",e=r&&r[s(405)]?r[s(405)]:{};await this[s(238)](n,t,e)}this[s(387)][s(267)][s(242)]({isUndoable:!1},(()=>{const t=s;o[t(381)]=!0,this[t(387)][t(267)][t(453)][t(317)][t(232)](o)}))}),{priority:t(363)})}async[Uc(420)](t){const e=Uc,n=this[e(387)][e(399)][e(361)](ps.Users),{connection:r}=this[e(387)][e(399)][e(361)](ls),s=new Set;for(const r of t){const t=r[e(390)];t&&!n[e(260)](t)&&s[e(236)](t)}if(0===s[e(291)])return;const o=await S[e(246)](r,Array[e(395)](s));for(const t of o)n[e(260)](t.id)||n[e(425)](t)}[Uc(219)](t,e={}){const r=Uc,o=this[r(387)][r(267)],i=[];let a=0;const c=r(259)==typeof t?{main:t}:t;for(const t of Object[r(295)](c)){if(!this[r(467)][r(435)][r(350)](t))throw new n.CKEditorError(r(364),this);const e=this[r(387)][r(265)][r(413)](c[t]),d=this[r(467)][r(282)](t),u=new s.InsertOperation(o[r(342)](d,0),e,a++);i[r(449)](u);for(const[t,n]of e[r(215)]){const e=o[r(233)](o[r(426)](d,n[r(415)][r(276)][r(438)]()),o[r(426)](d,n[r(218)][r(276)][r(438)]())),c=new s.MarkerOperation(t,null,e,o[r(215)],!0,a++);i[r(449)](c)}}if(e)for(const[t,c]of Object[r(275)](e)){const e=o[r(453)][r(282)](t);if(!e)throw new n.CKEditorError(r(424),null);for(const[t,n]of Object[r(275)](c))if(null!==n){const o=new s.RootAttributeOperation(e,t,null,n,a++);i[r(449)](o)}}return i}async[Uc(238)](t,e,n){const r=Uc;this[r(219)]({[t]:e},{[t]:n})[r(258)](((t,e)=>{const n=r;t[n(343)]=this[n(467)][n(397)]+e,t[n(287)]=!0,this[n(385)](t)})),this[r(244)](),await this[r(370)]()}async[Uc(334)](t,e){const n=Uc;let r;this[n(269)]=t[n(261)];const s=t[n(442)]&&!t[n(454)],o=s?0:t[n(265)][n(343)];if(e[n(258)]((e=>{const r=n;e[r(287)]=!0,e[r(365)]=t[r(394)],e[r(390)]=null})),s)r=e,this[n(455)](r,s);else{if(t[n(454)]){const e=this[n(219)](t[n(454)]);this[n(467)][n(271)][n(397)]=-e[n(414)],e[n(258)]((r=>{const s=n;r[s(343)]-=e[s(414)],r[s(365)]=t[s(394)],r[s(287)]=!0,r[s(390)]=null})),this[n(455)](e,!0),this[n(388)][n(397)]=-e[n(414)]+this[n(269)],this[n(227)](e)}this[n(467)][n(271)][n(397)]=o,r=this[n(436)](t[n(265)],t[n(464)]),await this[n(420)](r),this[n(455)](r,s)}t[n(404)]&&(this[n(433)][n(223)](r,t[n(404)]),this[n(473)]=t[n(404)]),this[n(388)][n(397)]=o+this[n(269)],this[n(227)](r),e[n(391)]((t=>{const e=n,r=this[e(356)](t);return r&&!this[e(337)][e(350)](r)}))[n(258)](((t,e)=>{const r=n;t[r(343)]=this[r(467)][r(397)]+e,this[r(385)](t)})),this[n(326)]()?(this[n(360)]=0,this[n(244)](!0),await this[n(370)]()):(this[n(257)]=!1,this[n(354)]())}[Uc(229)](t,e){const r=Uc,s=e&&e[r(423)];if(s&&s[r(396)](r(240)))throw e;const o=this[r(387)][r(399)][r(361)](ls);throw this[r(257)]=!0,o[r(297)](),this[r(387)][r(372)](r(355)),new n.CKEditorError(t,this[r(387)],s?{originalError:s}:void 0)}[Uc(385)](t){const e=Uc;this[e(254)][e(350)](t)||(this[e(254)][e(236)](t),this[e(336)][e(449)](t),this[e(428)]||e(288)==t[e(479)]&&!t[e(278)]||this[e(339)]())}[Uc(244)](t=!1){const e=Uc;!t&&this[e(257)]||(this[e(257)]=!0,clearTimeout(this[e(230)]),this[e(230)]=setTimeout((()=>{const t=e;this[t(353)]()[t(217)]((e=>{const n=t;e&&(this[n(354)](),this[n(257)]=!1)}))[t(362)]((e=>{const n=t;this[n(354)](),this[n(257)]=!1,function(t){const e=n;return t[e(423)][e(396)](e(309))||t[e(423)][e(396)](e(450))||t[e(423)][e(396)](e(461))}(e)||this[n(229)](e[n(423)],e)}))}),this[e(360)]))}[Uc(370)](){return new Promise((t=>{const e=Lc;this.on(e(446),(()=>{t()}))}))}async[Uc(353)](){const t=Uc,e=this[t(387)][t(399)][t(361)](Ds);if(this[t(304)]()&&(e[t(400)](),this[t(375)]=!1),!this[t(326)]())return!0;const n=[...this[t(336)]];for(const e of n)e[t(249)]=this[t(467)][t(271)][t(325)](e);const r=this[t(433)][t(475)](n),s=Bc++,o=this[t(216)](n),i=await this[t(406)][t(398)](o,o[t(343)],r);try{return await this[t(431)](n,i,s)}catch(e){return this[t(229)](t(268),e)}}async[Uc(431)](t,e,n){const r=Uc;if(r(477)in e)throw e[r(477)];let s=!1;if(e[r(442)]){e[r(404)]&&(this[r(473)]=e[r(404)]),this[r(336)]=this[r(336)][r(391)]((e=>!t[r(315)](e)));for(const n of t)n[r(365)]=r(231)in e&&e[r(231)]||void 0;Hc(t,e[r(397)]-t[r(414)]),this[r(227)](t);const n=t[r(391)]((t=>{const e=r;if(!t[e(287)])return!1;const n=this[e(356)](t);return n&&!this[e(337)][e(350)](n)}));Hc(n,this[r(467)][r(397)]),this[r(455)](n),s=!0,this[r(360)]=this[r(320)]}else{const t=this[r(436)](e[r(265)],e[r(464)])[r(391)]((t=>t[r(343)]>=this[r(471)]));t[r(258)]((t=>this[r(327)](t))),this[r(336)]=this[r(336)][r(391)]((t=>!t[r(287)]||!this[r(337)][r(350)](this[r(356)](t)))),this[r(336)][r(414)]&&Hc(this[r(336)],this[r(336)][0][r(343)]),await this[r(420)](t),s=this[r(434)](t,e[r(397)],e[r(404)]),this[r(360)]=Math[r(344)](this[r(360)]/2)}return s?!this[r(326)]()||(this[r(244)](!0),!1):this[r(229)](r(298))}[Uc(434)](t,e,n){const r=Uc;try{const o={document:this[r(467)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,s.transformSets)(t,this[r(336)],o);Hc(i,this[r(467)][r(397)]),Hc(a,e);for(const t of i){const e=c[r(361)](t);t[r(390)]=e?e[r(390)]:null}n&&(this[r(433)][r(223)](t,n),this[r(473)]=n),this[r(336)]=[...a],this[r(455)](i),this[r(227)](t)}catch(t){return console[r(477)](t),!1}return!0}[Uc(455)](t,e=!1){const n=Uc;this[n(387)][n(267)][n(242)]({isUndoable:!1,isLocal:!1},(e=>{const r=n;for(const n of t)this[r(254)][r(236)](n),this[r(327)](n),e[r(470)][r(272)](n),this[r(387)][r(267)][r(311)](n)}))}[Uc(327)](t){const e=Uc,n=this[e(356)](t);n&&this[e(337)][e(236)](n)}[Uc(356)](t){const e=Uc;let n,r;switch(t[e(479)]){case e(250):n=t[e(463)][e(330)];break;case e(288):if(r=t[e(358)],!r)return null;n=r[e(330)];break;case e(379):n=t[e(330)];break;case e(416):n=t[e(377)];break;case e(253):n=t[e(226)][e(330)];break;default:return null}return n[e(437)]}[Uc(227)](t){const e=Uc;t[e(258)]((t=>{const n=e,r=t[n(369)]();r[n(390)]=t[n(390)],r[n(287)]=!!t[n(287)],r[n(365)]=t[n(365)],r[n(343)]+=this[n(269)],t[n(422)]&&this[n(277)][n(236)](r),this[n(388)][n(272)](r)}))}[Uc(432)](t){const e=Uc,n=this[e(387)][e(399)][e(361)](e(256)),r=this[e(387)][e(331)];t||(t=Rs(r,e(380))),n[e(474)](t,{title:Rs(r,e(476)),namespace:e(221)}),this[e(429)]=!0,clearTimeout(this[e(230)]),this[e(336)]=[],this[e(387)][e(399)][e(361)](ls)[e(297)]()}[Uc(339)](){const t=Uc;this[t(428)]||(this[t(428)]=this[t(387)][t(399)][t(361)](e.PendingActions)[t(236)](Rs(this[t(387)][t(331)],t(412))))}[Uc(354)](){const t=Uc;this[t(428)]&&(this[t(387)][t(399)][t(361)](e.PendingActions)[t(323)](this[t(428)]),this[t(428)]=null)}[Uc(216)](t){const e=Uc,n=t[e(411)]((t=>t[e(359)]()));return this[e(447)][e(332)](n)}[Uc(436)](t,e){const n=Uc;return this[n(447)][n(439)](t)[n(411)](((t,r)=>{const o=n,i=o(234)==e[r][o(479)];if(o(329)==t[o(220)]){const e=t[o(463)][o(330)];!this[o(467)][o(282)](e)&&(this[o(467)][o(264)](o(235),e)[o(289)]=!1)}const a=s.OperationFactory[o(366)](t,this[o(467)]);return a[o(249)]=t[o(249)],a[o(287)]=i,a[o(390)]=i?null:e[r][o(292)],a[o(422)]=o(310)===e[r][o(479)],a[o(365)]=e[r][o(365)],a}))}[Uc(401)](){const t=Uc;this[t(375)]=!0,this[t(304)]()?this[t(244)]():this[t(375)]=!1}[Uc(304)](){const t=Uc,e=this[t(387)][t(399)][t(361)](ms)[t(270)][t(361)](this[t(469)]);return!this[t(387)][t(285)]&&!!e&&e[t(414)]>1&&this[t(375)]}[Uc(326)](){const t=Uc;return this[t(336)][t(414)]>0||this[t(304)]()}}function qc(){const t=["locale","compress","getDocumentDetails","_handleInitialConnectionData","connection","_bufferedOperations","_knownRootNames","CollaborativeEditingService","_setPendingAction","apply","_initSessionsHandling","createPositionAt","baseVersion","round","stop","rootsAttributes","collaboration.channelId","isOfficialPlugin","stopListening","has","view","document:write","_sendBufferedOperations","_clearPendingAction","realtimecollaborationclient-error","_getAffectedRoot","2786650ibZqFh","newRange","toJSON","_currentBufferDelay","get","catch","high","realtimecollaborationclient-init-non-existent-root","createdAt","fromJSON","loadRoot","fire","clone","_waitUntilSynced","getConnectedSessions","enableReadOnlyMode","return","code","_hasSelectionChanged","off","affectedSelectable","cloudDocumentVersion","addRootAttribute","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.","_isLoaded","disableReadOnlyMode","config","removeFromReconnectionStack","_saveOperationInBuffer","1jHhneI","editor","serverHistory","realtimecollaborationclient-init-connection-failed","_authorId","filter","connected","change:_isEditingAllowed","sessionCreatedAt","from","startsWith","version","sendOperations","plugins","createUserMarkerOperations","_refreshUserSelectionMarkers","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","register","lastOperationId","attributes","_service","_connectAfterSessionHasBeenFlushed","rtc-offline","disconnected","suppressErrorInCollaboration","map","PENDING_ACTION_SENDING_DATA","parse","length","start","addRoot","setPermissions","_handleReceivedOperations","sessionAdd:","_fetchMissingUsers","reset","_isDisconnection","message","multi-root-editor-root-attributes-no-root","addUser","createPositionFromPath","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","_pendingAction","_hasSynchronizationProblem","unregister","_handleServerResponse","_handleReconnectionError","_operationIdentifier","_handleExternalOperations","roots","_decompressOperations","rootName","slice","decompress","_handleReconnectionResponse","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","wereChangesApplied","getOperations","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.","mySessionId","change:_isPendingUpdate","_compressor","realtimecollaborationclient-init-document-already-initialized","push","cloud-services-internal-error: Collaborative Editing Service is not connected.","change:range","addToReconnectionStack","document","initData","_applyOperationsSet","1343741vcEdnY","state","lastSyncVersion","cloudServices.bundleVersion","pluginName","cloud-services-internal-error: Request timeout.","reconnect","position","metadata","1473568XOYIcb","isPremiumPlugin","_document","_ignoredOperations","_channelId","batch","_lastServerVersion","_setUpDataInit","_lastSyncedOperationId","showWarning","getIdOfTheLastOperation","Synchronization issue","error","permissions","type","markers","_compressOperations","then","end","_getOperationsFromInitData","__className","real-time-collaboration","realtimecollaborationclient-init-service-incorrect-server-operation","setIdForTheLastOperation","Permissions","104seFYwd","targetPosition","_updateServerHistory","rtc-destroyed","_crash","_sendBufferedOperationsDelayId","lastOperationAcceptedAt","_bufferRootLoad","createRange","init","$root","add","_isEditingAllowed","_loadRoot","ready","realtimecollaborationclient","collaboration-missing-channelid","enqueueChange","reconnection: flushed session","_sendBufferedOperationsDelayed","set","getMany","177183DFeptq","209EhcUwZ","wasUndone","insert","_connectService","change:hasDomSelection","move","_knownOperations","connect","Notification","_isPendingUpdate","forEach","string","getUser","offset","bind","isDocumentOperation","createRoot","data","isEnabled","model","realtimecollaborationclient-sendbufferedoperations","_offset","channelSessions","history","addOperation","232EKJeKx","_isConnected","entries","path","_disconnectionOperations","affectsData","sessionId","CommentsOnly","12CLHAlj","getRoot","finally","93630sHQIpJ","isReadOnly","_initThrowingOnDataSet","_isInit","marker","_isAttached","currentDocumentSession","size","userId","getOperationAuthor","lastDocumentSession","keys","listenTo","disconnect","realtimecollaborationclient-handleserverresponse","3XjcvKi","editing","operationsReceived","404","RealTimeCollaborationClient","_shouldSendSelectionUpdate","_disconnectService","directChange","collaboration","248208UWxyjE","cloud-services-internal-error: Not connected.","cs:removeUser","applyOperation","requires","selection","409","includes","_operationToId","differ","realtimecollaborationclient-init-service-internal-error","84358FTmQRs","_baseBufferDelay","realtimecollaborationclient-init-session-connection-error","_handleSendingSelectionMarkers","remove","define","isUndoneOperation","_shouldSendUpdate","_addKnownRoot","destroy","InsertOperation","root"];return(qc=function(){return t})()}Jc[Uc(338)]=br;const Gc=Jc;function Lc(t,e){const n=qc();return(Lc=function(t,e){return n[t-=215]})(t,e)}class Yc extends Error{}function Hc(t,e){const n=Uc;for(const r of t)r[n(343)]=e++}class zc{constructor(t){const e=Uc;this[e(468)]=t,this[e(316)]=new WeakMap}[Uc(475)](t){const e=Uc;let r=t[e(414)];for(;r--;){const s=t[r];if(!this[e(468)][e(350)](s)){if(!this[e(316)][e(350)](s)){const t=(0,n.uid)()[e(438)](1,18);this[e(316)][e(245)](s,t)}return this[e(316)][e(361)](s)}}}[Uc(223)](t,e){const n=Uc;if(!e)return;let r=t[n(414)];for(;r--;){const s=t[r];this[n(468)][n(350)](s)||this[n(316)][n(245)](s,e)}}}var Fc=Kc;function Kc(t,e){var n=Wc();return(Kc=function(t,e){return n[t-=380]})(t,e)}function Wc(){var t=["3555605oqACrS","pluginName","isOfficialPlugin","1898932HuiySj","30SEVEab","121256zYIWXJ","27DUhCZA","3753544yvhOCW","1020537aqtGVO","4540113qqEMtt","12aRQFQv","2563346XHfrcf","requires","RealTimeCollaborativeEditing","isPremiumPlugin"];return(Wc=function(){return t})()}!function(t){for(var e=Kc,n=t();;)try{if(661201===-parseInt(e(384))/1+-parseInt(e(387))/2+-parseInt(e(382))/3*(parseInt(e(381))/4)+parseInt(e(391))/5+-parseInt(e(386))/6*(-parseInt(e(394))/7)+parseInt(e(383))/8+-parseInt(e(385))/9*(-parseInt(e(380))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Wc);class Qc extends e.Plugin{static get[Fc(388)](){return[Gc]}static get[Fc(392)](){return Fc(389)}static get[Fc(393)](){return!0}static get[Fc(390)](){return!0}}const $c=Zc;!function(t){const e=Zc,n=t();for(;;)try{if(276995===-parseInt(e(517))/1+-parseInt(e(436))/2*(parseInt(e(472))/3)+-parseInt(e(438))/4*(-parseInt(e(449))/5)+parseInt(e(469))/6*(-parseInt(e(494))/7)+parseInt(e(445))/8+-parseInt(e(498))/9+-parseInt(e(478))/10*(-parseInt(e(505))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(td);class Xc extends e.ContextPlugin{static get[$c(482)](){return[ls,$c(528),ms,ps.Users]}static get[$c(442)](){return $c(444)}static get[$c(454)](){return!0}static get[$c(525)](){return!0}constructor(t){const e=$c;super(t),this[e(428)]=new Map}async[$c(446)](){const t=$c,n=this[t(497)],r=n[t(490)][t(440)](t(528));if(n[t(490)][t(440)](ls)[t(455)](this),r[t(508)]={addCommentThread:async({channelId:e,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=t,d=await this[c(450)](e)[c(484)]({commentThreadId:n,comments:r[c(432)]((t=>function(t,e,n){const r=c;return{commentThreadId:n,commentId:t[r(479)],userId:t[r(489)],content:t[r(495)],documentId:e,createdAt:t[r(526)],attributes:t[r(512)]||{}}}(t,e,n))),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(518)](rd);return{threadId:d[c(480)],comments:d[c(524)]}},getCommentThread:async({channelId:e,threadId:n})=>{const r=t,s=await this[r(450)](e)[r(527)](n)[r(518)](rd);return s[r(452)]?null:(await this[r(491)]([s]),{threadId:s[r(480)],comments:s[r(524)][r(432)](sd),context:s[r(497)],resolvedAt:s[r(485)],resolvedBy:s[r(430)],attributes:s[r(512)]||{}})},updateCommentThread:async({channelId:e,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[t(450)](e)[t(516)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[t(518)](nd)[t(518)](rd),resolveCommentThread:async({channelId:e,threadId:n})=>{const r=t,s=await this[r(450)](e)[r(488)](n)[r(518)](nd)[r(518)](rd);return{threadId:s[r(480)],resolvedAt:s[r(485)],resolvedBy:s[r(430)]}},reopenCommentThread:async({channelId:e,threadId:n})=>this[t(450)](e)[t(465)](n)[t(518)](nd)[t(518)](rd),removeCommentThread:({channelId:e,threadId:n})=>this[t(450)](e)[t(522)](n)[t(518)](nd)[t(518)](rd),addComment:({channelId:e,threadId:n,commentId:r,content:s,attributes:o})=>this[t(450)](e)[t(434)](n,r,s,o)[t(518)](rd),updateComment:({channelId:e,threadId:n,commentId:r,content:s,attributes:o})=>this[t(450)](e)[t(483)](n,r,s,o)[t(518)](nd)[t(518)](rd),removeComment:({channelId:e,threadId:n,commentId:r})=>this[t(450)](e)[t(457)](n,r)[t(518)](nd)[t(518)](rd)},n instanceof e.Context){const e=n[t(499)][t(440)](t(506)),r=n[t(490)][t(440)](ms);await this[t(463)](e);const s=await this[t(428)][t(440)](e)[t(448)]();this[t(456)](r,t(468)+e,((n,{session:s})=>{const o=t;s.id===r[o(492)]&&(n[o(500)](),this[o(497)][o(490)][o(440)](o(509))[o(461)](s[o(520)],e))})),r[t(519)](e,s)}}async[$c(463)](t){const e=$c;if(this[e(428)][e(467)](t))throw new n.CKEditorError(e(476),null,{channelId:t});const r=this[e(497)][e(490)][e(440)](e(528)),s=new(Xc[e(530)])(t);this[e(428)][e(487)](t,s),this[e(456)](s,e(510),((t,n)=>{const s=e,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=n;r[s(527)](o)||r[s(484)]({threadId:o,channelId:i,comments:l?l[s(432)](sd):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})})),this[e(456)](s,e(429),((t,{commentThreadId:n,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=e;r[c(527)](n)&&r[c(516)]({threadId:n,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})})),this[e(456)](s,e(521),((t,{commentThreadId:n,resolvedBy:s,resolvedAt:o})=>{const i=e,a=r[i(527)](n);a&&a[i(439)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})})),this[e(456)](s,e(470),((t,{commentThreadId:n})=>{const s=e,o=r[s(527)](n);o&&o[s(443)]({isFromAdapter:!0})})),this[e(456)](s,e(459),((t,{commentThreadId:n})=>{const s=e,o=r[s(527)](n);o&&o[s(431)]({isFromAdapter:!0})})),this[e(456)](s,e(502),((t,n)=>{const s=e,o=n[s(480)],i=r[s(527)](o);i&&i[s(434)]({...sd(n),isFromAdapter:!0})})),this[e(456)](s,e(473),((t,{commentThreadId:n,commentId:s,content:o,attributes:i})=>{const a=e,c=r[a(527)](n);if(c){const t=c[a(529)](s);t&&t[a(507)]({content:o,attributes:i,isFromAdapter:!0})}})),this[e(456)](s,e(503),((t,{commentThreadId:n,commentId:s})=>{const o=e,i=r[o(527)](n);if(i){const t=i[o(529)](s);t&&t[o(431)]({isFromAdapter:!0})}})),await this[e(523)](t)}[$c(477)](){const t=$c;if(this[t(497)]instanceof e.Context){const e=this[t(497)][t(499)][t(440)](t(506));this[t(451)](e)}}[$c(451)](t){const e=$c;if(!this[e(428)][e(467)](t))throw new n.CKEditorError(e(486),null,{channelId:t});this[e(450)](t)[e(466)](),this[e(428)][e(471)](t)}async[$c(496)](){const t=$c;for(const e of this[t(428)][t(511)]())await this[t(523)](e);if(this[t(497)]instanceof e.Context){const e=this[t(497)][t(499)][t(440)](t(506)),n=this[t(497)][t(490)][t(440)](ms);n[t(515)](e);const r=await this[t(428)][t(440)](e)[t(448)]();n[t(519)](e,r)}}async[$c(523)](t){const e=$c,{connection:n}=this[e(497)][e(490)][e(440)](ls),r=this[e(497)][e(490)][e(440)](e(528)),s=this[e(428)][e(440)](t),o=await s[e(513)](n);await this[e(491)](o);const i=new Set(Array[e(460)](r[e(481)]({channelId:t}),(t=>t.id)));for(const t of o)t[e(452)]||i[e(471)](t[e(480)]);for(const t of i)r[e(527)](t)[e(431)]({isFromAdapter:!0});for(const n of o){let s=r[e(527)](n[e(480)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[e(484)]({channelId:t,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[e(460)](s[e(524)],(t=>t.id)));for(const t of n[e(524)])p[e(471)](t[e(479)]);for(const t of p)s[e(529)](t)[e(431)]({isFromAdapter:!0});for(const t of n[e(524)]){const n=s[e(529)](t[e(479)]);n?n[e(495)]!==t[e(495)]&&n[e(507)]({content:t[e(495)],isFromAdapter:!0}):s[e(434)](Object[e(493)](sd(t),{isFromAdapter:!0}))}}}[$c(450)](t){const e=$c;if(!this[e(428)][e(467)](t))throw new n.CKEditorError(e(462),null,{channelId:t});return this[e(428)][e(440)](t)}async[$c(491)](t){const e=$c,n=this[e(497)][e(490)][e(440)](ps.Users),{connection:r}=this[e(497)][e(490)][e(440)](ls),s=new Set;for(const{resolvedBy:r,comments:o}of t){r&&!n[e(435)](r)&&s[e(453)](r);for(const{userId:t}of o)n[e(435)](t)||s[e(453)](t)}if(0===s[e(504)])return;const o=await S[e(474)](r,Array[e(460)](s));for(const t of o)n[e(435)](t.id)||n[e(475)](t)}}function Zc(t,e){const n=td();return(Zc=function(t,e){return n[t-=428]})(t,e)}function td(){const t=["content","reconnect","context","3593601eHQjAA","config","off","message","commentAdded","commentRemoved","size","33077pwEArF","collaboration.channelId","update","adapter","Permissions","commentThreadAdded","keys","attributes","connect","cloud-services-internal-error: Not connected.","unregister","updateCommentThread","428221irMLaH","catch","register","permissions","commentThreadResolved","removeCommentThread","_connectService","comments","isPremiumPlugin","createdAt","getCommentThread","CommentsRepository","getComment","CommentsService","_services","commentThreadUpdated","resolvedBy","remove","map","code","addComment","getUser","28fjqaVE","userId","84468BzbDFT","resolve","get","cloud-services-internal-error: Comments Service is not connected.","pluginName","reopen","CloudServicesCommentsAdapter","940720YRBKXe","init","cloud-services-internal-error: Request timeout.","getConnectedSessions","130FLFxvJ","_getService","_terminateService","deletedAt","add","isOfficialPlugin","addToReconnectionStack","listenTo","removeComment","startsWith","commentThreadRemoved","from","setPermissions","cloudservicescommentsadapter-service-not-exist","_setUpService","404","reopenCommentThread","disconnect","has","sessionAdd:","12BvaQHw","commentThreadReopened","delete","79404ZGfFee","commentUpdated","getMany","addUser","cloudservicescommentsadapter-connect-already-connected","destroy","4310vDgpAZ","commentId","commentThreadId","getCommentThreads","requires","updateComment","addCommentThread","resolvedAt","cloudservicescommentsadapter-disconnect-not-exist","set","resolveCommentThread","authorId","plugins","_fetchMissingUsersForThreads","mySessionId","assign","1706572OmNpiL"];return(td=function(){return t})()}Xc[$c(530)]=is;const ed=Xc;async function nd(t){const e=$c;if(e(464)!==t[e(433)])throw t}function rd(t){const e=$c;if((n=t)[e(501)][e(458)](e(441))||n[e(501)][e(458)](e(514))||n[e(501)][e(458)](e(447)))return new Promise((()=>{}));var n;throw t}function sd(t){const e=$c;return{threadId:t[e(480)],commentId:t[e(479)],content:t[e(495)],createdAt:t[e(526)],authorId:t[e(437)],attributes:t[e(512)]||{}}}function od(t,e){const n=dd();return(od=function(t,e){return n[t-=154]})(t,e)}const id=od;!function(t){const e=od,n=t();for(;;)try{if(925222===-parseInt(e(164))/1+parseInt(e(201))/2+parseInt(e(156))/3*(parseInt(e(186))/4)+parseInt(e(208))/5+parseInt(e(161))/6+parseInt(e(184))/7+parseInt(e(157))/8*(-parseInt(e(191))/9))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(dd);class ad extends e.Plugin{static get[id(178)](){return[ed,id(165),ls]}static get[id(167)](){return id(192)}static get[id(203)](){return!0}static get[id(172)](){return!0}constructor(t){const e=id;super(t);const n=this[e(160)][e(169)][e(170)](e(198));this[e(206)]=new Map,this[e(199)]=new(ad[e(210)])(n)}[id(166)](){const t=id,e=this[t(160)][t(195)][t(170)](ls),n=this[t(160)][t(195)][t(170)](t(165));return n[t(155)]={getSuggestion:async e=>{const n=t;await this[n(207)]();const r=await this[n(199)][n(170)](e)[n(176)](ud);return await this[n(213)]([r]),r},addSuggestion:async({id:e,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=t;await this[i(207)]();const a={id:e,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(199)][i(188)](e,n,r,s,o)[i(176)]((t=>{if(ld(t))return new Promise((t=>{const n=od;this[n(206)][n(159)](e,{resolve:t,suggestionData:a})}));throw t}));return this[i(206)][i(173)](e),c},updateSuggestion:async(e,n)=>{const r=t;if(await this[r(207)](),r(193)!==n[r(194)])return this[r(199)][r(162)](e,n)[r(176)](ud)}},this[t(177)](this[t(199)],t(163),((e,r)=>{const s=t;n[s(154)](r.id)&&(n[s(187)](r.id)[s(216)]=r[s(216)])})),this[t(199)][t(185)](e[t(202)])[t(190)]((r=>(e[t(215)](this),this[t(213)](r)[t(190)]((()=>{const e=t;for(const t of r)n[e(197)](t)[e(181)]=!0})))))}async[id(183)](){const t=id,e=this[t(160)][t(195)][t(170)](t(165)),{connection:n}=this[t(160)][t(195)][t(170)](ls),r=await this[t(199)][t(185)](n);await this[t(213)](r);for(const{suggestionData:e,resolve:n}of this[t(206)][t(171)]()){let s=r[t(179)]((t=>t.id===e.id));s||(s=await this[t(199)][t(188)](e.id,e[t(189)],e[t(209)],e[t(200)])),n(s)}for(const n of r)e[t(154)](n.id)||e[t(197)](n)}async[id(207)](){const t=id;this[t(199)][t(212)]||await new Promise((e=>{const n=t;this[n(177)](this[n(199)],n(204),(t=>{t[n(196)](),e()}))}))}async[id(213)](t){const e=id,n=this[e(160)][e(195)][e(170)](ps.Users),{connection:r}=this[e(160)][e(195)][e(170)](ls),s=new Set;for(const{authorId:r}of t)n[e(205)](r)||s[e(188)](r);if(0===s[e(175)])return;const o=await S[e(214)](r,Array[e(168)](s));for(const t of o)n[e(205)](t.id)||n[e(180)](t)}}ad[id(210)]=Vn;const cd=ad;function dd(){const t=["attributes","hasSuggestion","adapter","9942kSerjj","11608WunQye","cloud-services-internal-error: Request timeout.","set","editor","10441968xotnbG","update","suggestionUpdated","688753hsiMFK","TrackChangesEditing","init","pluginName","from","config","get","values","isPremiumPlugin","delete","message","size","catch","listenTo","requires","find","addUser","_saved","cloud-services-internal-error: Not connected.","reconnect","9306038CQBafo","connect","48VhGwfU","getSuggestion","add","type","then","17766qASKPf","CloudServicesTrackChangesAdapter","open","state","plugins","off","addSuggestionData","collaboration.channelId","_trackChangesService","originalSuggestionId","1705340TFYbII","connection","isOfficialPlugin","connected","getUser","_bufferedRequests","_waitForServiceReady","2580245DaQgdC","data","TrackChangesService","startsWith","isConnected","_fetchMissingUsersForThreads","getMany","addToReconnectionStack"];return(dd=function(){return t})()}function ud(t){if(ld(t))return new Promise((()=>{}));throw t}function ld(t){const e=id;return t[e(174)][e(211)](e(182))||t[e(174)][e(211)](e(158))}const pd=hd;function hd(t,e){const n=fd();return(hd=function(t,e){return n[t-=256]})(t,e)}function fd(){const t=["4867968QuVOXr","15WKpnUc","plugins","10gqMqPq","isThreadsLoadingPaused","requires","config","collaboration.channelId","isPremiumPlugin","_setUpService","data","835299bBBdmW","change:state","Comments","get","connected","665768BOrvzu","574214fUHlLJ","1102136vrTHxw","RealTimeCollaborativeComments","init","ready","26506PdlWzj","CommentsEditing","pluginName","18WETFPS","isOfficialPlugin","switchReadOnly","once","CommentsRepository","editor","listenTo","_terminateService","destroy","793164myWcbr"];return(fd=function(){return t})()}!function(t){const e=hd,n=t();for(;;)try{if(380449===parseInt(e(284))/1+-parseInt(e(289))/2*(-parseInt(e(257))/3)+-parseInt(e(283))/4*(parseInt(e(268))/5)+-parseInt(e(266))/6+-parseInt(e(285))/7+parseInt(e(267))/8+parseInt(e(278))/9*(-parseInt(e(270))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(fd);class md extends e.Plugin{static get[pd(272)](){return[pd(280),ed,Qc,ls]}static get[pd(256)](){return pd(286)}static get[pd(258)](){return!0}static get[pd(275)](){return!0}[pd(287)](){const t=pd,e=this[t(262)][t(269)][t(281)](ls),n=this[t(262)][t(269)][t(281)](t(290)),r=this[t(262)][t(269)][t(281)](ed);return this[t(262)][t(277)][t(260)](t(288),(()=>{const r=t;this[r(263)](e,r(279),((t,e,s)=>{const o=r;n[o(271)]=o(282)!==s}))})),this[t(263)](e,t(279),((e,n,r)=>{const s=t;this[s(262)][s(269)][s(281)](s(261))[s(259)](s(282)!==r)})),r[t(276)](this[t(262)][t(273)][t(281)](t(274)))}[pd(265)](){const t=pd;this[t(262)][t(269)][t(281)](ed)[t(264)](this[t(262)][t(273)][t(281)](t(274))),super[t(265)]()}}var yd=gd;function gd(t,e){var n=bd();return(gd=function(t,e){return n[t-=219]})(t,e)}function bd(){var t=["212380GEpyhH","4860NktZLm","7EIdJSB","pluginName","28008IeMBWP","isOfficialPlugin","206241LSlCkY","215GNcDvJ","requires","910674qUvkIH","1483312kHyFMJ","RealTimeCollaborativeTrackChanges","isPremiumPlugin","2864622QFBayF","1404cwCwel","TrackChanges"];return(bd=function(){return t})()}!function(t){for(var e=gd,n=t();;)try{if(263371===parseInt(e(227))/1+-parseInt(e(220))/2+parseInt(e(233))/3+-parseInt(e(231))/4*(parseInt(e(234))/5)+parseInt(e(224))/6+parseInt(e(229))/7*(parseInt(e(221))/8)+parseInt(e(225))/9*(parseInt(e(228))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(bd);class Od extends e.Plugin{static get[yd(219)](){return[md,cd,yd(226)]}static get[yd(230)](){return yd(222)}static get[yd(232)](){return!0}static get[yd(223)](){return!0}}const wd=Id;function vd(){const t=["getRevisions","6763025HPHMJL","once","toVersion","revisionsUpdated","7AoynQt","_isPendingUpdate","state","get","CloudServicesRevisionHistoryAdapter","setSource","RevisionTracker","addUser","reInit","_update","_startingVersion","bind","_preventResendingRevisionData","from","connection","map","_revisionDataBuilder","size","change:_isConnected","cloud-services-internal-error: Not connected.","_getLatestVersion","diffData","listenTo","_fetchMissingUsers","authors","setRevisionData","type","addToReconnectionStack","cloud-services-internal-error: Request timeout.","collaboration.channelId","currentRevision","connected","createdAt","653608UpEvNo","isEnabled","then","3EOBzTS","editor","baseVersion","length","catch","reconnect","1600gCBAqt","_revisionHistoryService","data","startsWith","isConnected","_getLatestVersionFromServerOperations","pluginName","init","_lastRequestId","sendBufferedUpdates","_handleRevisionsUpdate","cloud-services-internal-error: Revision History Service is not connected.","sessionId","updateRevisions","affectsData","wrongRequestId","_handleReconnectionError","_isConnected","_revisions","RevisionHistoryService","_revisionTracker","max","fromVersion","_oldOffset","change:_isPendingUpdate","code","_bufferedUpdates","_waitForServiceReady","_bufferUpdate","5546862xnahyY","cloudServices.bundleVersion","repository","keys","marker","isEmptyCurrent","adapter","161964zCgauh","config","_createCurrentRevision","remove","isOfficialPlugin","CONNECTED","destroy","plugins","9279736DJxdzL","400","requires","_fixRevision","creatorId","_offset","getRevision","getUser","message","1214290zWDXmc","getOperations","getMany","authorsIds","addRevisionData","off","has","buildRevisionData","serverHistory","isBundleUploaded","isPremiumPlugin","add","778466DGCnbL","reverse","connect"];return(vd=function(){return t})()}function Id(t,e){const n=vd();return(Id=function(t,e){return n[t-=341]})(t,e)}!function(t){const e=Id,n=t();for(;;)try{if(707400===-parseInt(e(391))/1+-parseInt(e(403))/2*(parseInt(e(447))/3)+parseInt(e(444))/4+parseInt(e(407))/5+-parseInt(e(367))/6+parseInt(e(411))/7*(-parseInt(e(382))/8)+-parseInt(e(374))/9*(-parseInt(e(453))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(vd);class Sd extends e.Plugin{static get[wd(384)](){return[ls,Gc,wd(417),ms,ps.Users]}static get[wd(344)](){return wd(415)}static get[wd(378)](){return!0}static get[wd(401)](){return!0}constructor(t){const e=wd;super(t);const n=this[e(448)][e(375)][e(414)](e(440));this[e(346)]=null,this[e(358)]=this[e(448)][e(381)][e(414)](e(417)),this[e(454)]=new(Sd[e(357)])(n)}async[wd(345)](){const t=wd,e=this[t(448)][t(381)][t(414)](Gc),r=e[t(399)],s=this[t(448)][t(381)][t(414)](ls);this[t(358)][t(416)]({history:r,getLatestVersion:()=>this[t(431)](),getCurrentRevisionId:()=>e[t(350)]});const o=this[t(448)][t(375)][t(414)](t(368))||n.version,i=await He[t(400)](s[t(425)],o);this[t(358)][t(373)]={getRevision:async({revisionId:e})=>(await this[t(365)](),await this[t(454)][t(388)](e)),updateRevisions:async e=>{const n=t;await this[n(365)]();const r=this[n(358)][n(441)];if(i&&1===e[n(450)]&&e[0].id===r.id)return e;for(const t of e)t.id===r.id&&(t[n(372)]=t[n(360)]===t[n(409)]);return this[n(454)][n(351)](e,this[n(346)])[n(446)]((t=>(this[n(346)]=t,e)))[n(451)]((t=>{const r=n;if(kd(t)||r(383)===t[r(363)]&&void 0!==t[r(455)][r(353)]){for(const t of e)!this[r(358)][r(369)][r(388)](t.id)||this[r(358)][r(366)](t.id,t,!1);if(kd(t))throw t;return e}throw t}))}},this[t(433)](this[t(454)],t(410),((e,{revisionsData:n,requestId:r})=>{const s=t;Math[s(359)](...n[s(426)]((t=>t[s(409)])))>this[s(343)]()-1?this[s(431)]()[s(446)]((()=>{this[s(348)](n,r)})):this[s(348)](n,r)}));const{revisions:a,requestId:c}=await this[t(454)][t(405)](s[t(425)]);s[t(438)](this),this[t(346)]=c,await this[t(434)](a);for(const e of a)this[t(358)][t(395)](e);this[t(433)](e,t(429),((n,r,s)=>{const o=t;s&&(this[o(361)]=e[o(387)],n[o(396)]())})),this[t(358)][t(422)](t(445)).to(s,t(413),(e=>e===Me[t(379)]))}async[wd(452)](){const t=wd,e=this[t(448)][t(381)][t(414)](ls),n=this[t(448)][t(381)][t(414)](Gc),r=async()=>{const r=t,s=this[r(358)][r(441)],o=s.id,i=o!==n[r(350)];if(i){const t=n[r(387)]-this[r(361)],e=this[r(343)]();if(this[r(358)][r(427)][r(419)](),s[r(409)]+t!==e){const n=s[r(360)]+t,o=this[r(448)][r(381)][r(414)](ps.Users),i=this[r(358)][r(398)]({revision:s,from:n,to:e});i.id=s.id;const a=i[r(394)][r(426)]((t=>o[r(389)](t)));s[r(420)]({...i,authors:a},!0),this[r(358)][r(366)](s.id,i,!0)}this[r(358)][r(421)]=e,s[r(409)]===s[r(360)]&&!this[r(358)][r(364)][r(397)](o)&&this[r(358)][r(369)][r(356)][r(377)](o),this[r(358)][r(376)](e)}const{revisions:a,requestId:c}=await this[r(454)][r(452)](e[r(425)],this[r(346)]);i&&a[r(450)]>0?n[r(354)]():(await this[r(434)](a),this[r(348)](a,c),this[r(358)][r(347)]())};return n[t(355)]?r():new Promise(((e,s)=>{const o=t;n[o(408)](o(429),(()=>{const t=o;r()[t(446)](e)[t(451)](s)}))}))}[wd(380)](){super[wd(380)]()}async[wd(365)](){const t=wd;this[t(454)][t(342)]||await new Promise((e=>{const n=t;this[n(433)](this[n(454)],n(442),(t=>{t[n(396)](),e()}))}))}[wd(343)](){const t=wd,e=this[t(448)][t(381)][t(414)](Gc)[t(399)][t(392)]()[t(404)]();for(const n of e)if(t(371)!==n[t(437)]||n[t(352)])return n[t(449)]+1}[wd(431)](){const t=wd,e=this[t(448)][t(381)][t(414)](Gc);return new Promise((n=>{const r=t;e[r(412)]?e[r(408)](r(362),(()=>{n(this[r(343)]())})):n(this[r(343)]())}))}[wd(348)](t,e){const n=wd,r=this[n(358)][n(369)];this[n(346)]=e;for(const e of t){const t=r[n(388)](e.id);if(t){if((e[n(360)]||e[n(409)])&&(e[n(432)]=null),t===this[n(358)][n(441)]){const r=Math[n(359)](t[n(409)],e[n(409)]),s=Math[n(359)](t[n(360)],e[n(360)]);let o;t[n(409)]===e[n(409)]&&t[n(360)]===e[n(360)]?(o=!0,this[n(423)](e)):e[n(409)]===r&&e[n(360)]===s?o=!1:(t[n(409)]===r&&t[n(360)]===s||this[n(385)]({revision:t,from:s,to:r}),o=!0),o&&(delete e[n(360)],delete e[n(409)],delete e[n(432)],delete e[n(443)],delete e[n(394)])}this[n(358)][n(436)](e),this[n(423)](e)}else this[n(358)][n(395)](e)}const s=r[n(406)]();s[n(404)]();for(let t=0;t<s[n(450)]-1;t++){const e=s[t],r=s[t+1];if(e[n(360)]<r[n(409)]){const t=r[n(409)],s=Math[n(359)](t,e[n(409)]);this[n(385)]({revision:e,from:t,to:s})}}}[wd(385)]({revision:t,from:e,to:n}={}){const r=wd,s=this[r(448)][r(381)][r(414)](ps.Users),o=this[r(358)][r(398)]({revision:t,from:e,to:n});o[r(435)]=o[r(394)][r(426)]((t=>s[r(389)](t))),t[r(420)](o)}[wd(423)](t){const e=wd,n={};n.id=t.id;for(const r of Object[e(370)](t))"id"!==r&&(n[r]=void 0);this[e(358)][e(366)](n.id,n,!0)}async[wd(434)](t){const e=wd,n=this[e(448)][e(381)][e(414)](ps.Users),{connection:r}=this[e(448)][e(381)][e(414)](ls),s=new Set;for(const n of t){for(const t of n[e(394)])i(t);n[e(386)]&&i(n[e(386)])}if(0===s[e(428)])return;const o=await S[e(393)](r,Array[e(424)](s));for(const t of o)n[e(389)](t.id)||n[e(418)](t);function i(t){const r=e;n[r(389)](t)||s[r(402)](t)}}}Sd[wd(357)]=ln;const Pd=Sd;function kd(t){const e=wd;return t[e(390)][e(341)](e(349))||t[e(390)][e(341)](e(430))||t[e(390)][e(341)](e(439))}function Ad(t,e){var n=Td();return(Ad=function(t,e){return n[t-=494]})(t,e)}var _d=Ad;function Td(){var t=["isPremiumPlugin","4141242KVJoGz","8uzvMQk","156598pYftzT","290622vYUxqm","RevisionHistory","2672873uLfwqg","RealTimeCollaborativeRevisionHistory","509790nFWNHn","isOfficialPlugin","requires","844JExrxY","3680mPVbHK","pluginName","894561OqaHWC"];return(Td=function(){return t})()}!function(t){for(var e=Ad,n=t();;)try{if(247826===-parseInt(e(497))/1+-parseInt(e(496))/2+parseInt(e(507))/3+-parseInt(e(504))/4*(-parseInt(e(505))/5)+parseInt(e(501))/6+parseInt(e(499))/7*(-parseInt(e(495))/8)+parseInt(e(494))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Td);class Cd extends e.Plugin{static get[_d(503)](){return[_d(498),Pd,Qc]}static get[_d(506)](){return _d(500)}static get[_d(502)](){return!0}static get[_d(508)](){return!0}}var jd=Function.prototype,Ed=Object.prototype,Dd=jd.toString,xd=Ed.hasOwnProperty,Rd=Dd.call(Object);const Nd=function(t){if(!oi(t)||"[object Object]"!=lo(t))return!1;var e=oa(t);if(null===e)return!0;var n=xd.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dd.call(n)==Rd};const Vd=function(t){return oi(t)&&1===t.nodeType&&!Nd(t)};function Md(t,e){const n=Ud();return(Md=function(t,e){return n[t-=364]})(t,e)}function Ud(){const t=["7585lIbOmw","usersCount","1341934kRbTTf","66Zutyap","367811ojIacG","CONNECTED_USERS","isHidden","setTemplate","832PwWJPq","set","ck-presence-list__counter--hidden","1776456lKMcxa","31038IWrqax","1943010OEVqRQ","1211568NqLVcM","ck-presence-list__counter","bindTemplate","div"];return(Ud=function(){return t})()}!function(t){const e=Md,n=t();for(;;)try{if(553617===-parseInt(e(375))/1+-parseInt(e(373))/2+parseInt(e(366))/3+parseInt(e(367))/4+-parseInt(e(371))/5*(parseInt(e(374))/6)+parseInt(e(365))/7*(parseInt(e(379))/8)+parseInt(e(364))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Ud);class Bd extends r.View{constructor(t){const e=Md;super(t);const n=this[e(369)];this[e(380)](e(372),0),this[e(380)](e(377),!0),this[e(378)]({tag:e(370),attributes:{class:["ck",e(368),n.if(e(377),e(381))]},children:[{text:n.to(e(372),(n=>Rs(t,e(376),n)))}]})}}const Jd=qd;function qd(t,e){const n=Gd();return(qd=function(t,e){return n[t-=415]})(t,e)}function Gd(){const t=["187880tKhjwk","3Ritsrs","element","isExpanded","498DNYDHX","set","render","fire","hasPopup","list","ck-presence-list__list","1002050zhrTwY","execute","246ThTjaU","removeAttribute","819044GTxveI","setTemplate","listenTo","30PNFusY","174234sGdzNe","bindTemplate","Connected users list","387837QBNkjt","setAttribute","change:hasPopup","focus","div","aria-expanded","keystrokes","6445DNhDJj","items","createCollection","Collapsed connected users list (press ENTER to open it)"];return(Gd=function(){return t})()}!function(t){const e=qd,n=t();for(;;)try{if(110777===-parseInt(e(415))/1+-parseInt(e(421))/2+parseInt(e(436))/3*(-parseInt(e(417))/4)+-parseInt(e(431))/5*(-parseInt(e(439))/6)+parseInt(e(446))/7+parseInt(e(435))/8+parseInt(e(424))/9*(parseInt(e(420))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Gd);class Ld extends r.View{constructor(t){const e=qd;super(t);const r=this[e(422)];this[e(432)]=this[e(433)](),this[e(430)]=new n.KeystrokeHandler,this[e(440)]({hasPopup:!1,isExpanded:!1}),this[e(418)]({tag:e(428),attributes:{"aria-haspopup":r.if(e(443)),"aria-expanded":r.to(e(438),(t=>this[e(443)]&&String(t))),"aria-label":r.to(e(443),(n=>Rs(t,e(n?434:423)))),role:e(444),tabindex:r.to(e(443),(t=>!!t&&0)),class:["ck",e(445)]},children:this[e(432)],on:{click:r.to((()=>this[e(442)](e(447))))}}),this.on(e(426),((t,n,r)=>{const s=e;this[s(437)]&&(r?this[s(437)][s(425)](s(429),String(this[s(438)])):this[s(437)][s(416)](s(429)))}))}[Jd(427)](){const t=Jd;this[t(437)][t(427)]()}[Jd(441)](){const t=Jd;super[t(441)](),this[t(430)][t(419)](this[t(437)])}}var Yd=__webpack_require__(106),Hd={attributes:{"data-cke":!0}};Hd.setAttributes=Ps(),Hd.insert=Is().bind(null,"head"),Hd.domAPI=ws(),Hd.insertStyleElement=As();bs()(Yd.A,Hd);Yd.A&&Yd.A.locals&&Yd.A.locals;function zd(t,e){const n=Kd();return(zd=function(t,e){return n[t-=413]})(t,e)}!function(t){const e=zd,n=t();for(;;)try{if(386777===-parseInt(e(416))/1*(parseInt(e(422))/2)+-parseInt(e(429))/3*(parseInt(e(425))/4)+-parseInt(e(424))/5+parseInt(e(426))/6+-parseInt(e(423))/7+parseInt(e(437))/8*(parseInt(e(438))/9)+parseInt(e(414))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Kd);class Fd extends r.View{constructor(t){const e=zd;super(t);const n=this[e(441)];this[e(430)](e(427),!0),this[e(421)]=new Bd(this[e(413)]),this[e(434)]=new Ld(t),this[e(434)][e(440)](e(419)).to(this,e(427)),this[e(417)](this[e(434)][e(415)],e(432),(()=>{const t=e;for(const e of this[t(434)][t(415)])e[t(435)]="s";this[t(434)][t(415)][t(433)]&&(this[t(434)][t(415)][t(433)][t(435)]="se")})),this[e(436)]({tag:e(439),attributes:{class:["ck",e(420),e(418),e(428),n.if(e(427),e(431))]},children:[this[e(421)],this[e(434)]]})}}function Kd(){const t=["isCollapsed","ck-rounded-corners","61941mPoJIP","set","ck-presence-list--collapsed","change","first","inlineListView","tooltipPosition","setTemplate","56wzPmAb","127503rglTim","div","bind","bindTemplate","locale","12801110BzcMUh","items","16612qJbvQK","listenTo","ck-reset","hasPopup","ck-presence-list","counterView","62LUZrfK","1230957TyRYUi","2509300tJvocE","48KUrqQH","2687664mFvQwd"];return(Kd=function(){return t})()}const Wd=Qd;function Qd(t,e){const n=$d();return(Qd=function(t,e){return n[t-=265]})(t,e)}function $d(){const t=["ck-presence-list__dropdown-list-wrapper_scrollable","items","window","1006347emUuvn","checkIfScrollable","resize","ck-presence-list__dropdown-list","1138845HxFNei","innerHeight","Connected users list dropdown menu","div","ariaLabelledBy","set","render","ck-reset","488768LWXWYD","bindTemplate","ck-presence-list__dropdown-list-wrapper","ck-list","scrollHeight","1981ULWDMr","82024tgpwXG","listWrapperView","5880210qppczw","3960324MSWGwT","role","ariaLabel","3583104jdgrJh","element","max","application","listenTo","_isScrollable","clientHeight","setTemplate","change"];return($d=function(){return t})()}!function(t){const e=Qd,n=t();for(;;)try{if(694315===-parseInt(e(290))/1+-parseInt(e(266))/2+-parseInt(e(278))/3+parseInt(e(275))/4+parseInt(e(294))/5+-parseInt(e(274))/6+parseInt(e(271))/7*(parseInt(e(272))/8))break;n.push(n.shift())}catch(t){n.push(n.shift())}}($d);class Xd extends r.View{constructor(t,e){const n=Qd;super(t),this[n(273)]=new Zd(t,e),this[n(285)]({tag:n(297),attributes:{tabindex:-1,role:n(281),class:["ck",n(293)],"aria-label":Rs(t,n(296))},children:[this[n(273)]]})}}class Zd extends r.ListView{constructor(t,e){const r=Qd;super(t);const s=this[r(267)];this[r(299)](r(283),!1),this[r(285)]({tag:e?r(297):"ul",attributes:{class:["ck",r(265),r(269),r(268),s.if(r(283),r(287))],role:s.to(r(276)),"aria-label":s.to(r(277)),"aria-labelledby":s.to(r(298))},children:this[r(288)]}),this[r(282)](n.global[r(289)],r(292),(()=>this[r(291)]())),this[r(288)].on(r(286),(()=>this[r(291)]()))}[Wd(300)](){const t=Wd;super[t(300)](),this[t(291)]()}[Wd(291)](){const t=Wd,e=this[t(279)];e&&(this[t(283)]=Math[t(280)](e[t(270)],e[t(284)])>.8*window[t(295)])}}const tu=eu;function eu(t,e){const n=ru();return(eu=function(t,e){return n[t-=453]})(t,e)}!function(t){const e=eu,n=t();for(;;)try{if(850276===-parseInt(e(473))/1+parseInt(e(454))/2+-parseInt(e(475))/3*(-parseInt(e(463))/4)+-parseInt(e(471))/5*(-parseInt(e(461))/6)+-parseInt(e(460))/7*(parseInt(e(464))/8)+parseInt(e(479))/9*(parseInt(e(462))/10)+-parseInt(e(466))/11*(parseInt(e(467))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(ru);class nu extends r.ListItemView{constructor(t,e,n){const r=eu;super(t);const s=this[r(469)];this[r(476)]=new ps.UserView(t,e);const o={tag:"li",attributes:{class:["ck",r(470)],tabindex:-1,role:r(457),"aria-label":e[r(455)]},children:[this[r(476)],{tag:r(482),attributes:{class:["ck",r(480)]},children:[{text:e[r(455)]}]},{tag:r(482),attributes:{class:["ck",r(477),e[r(468)][r(453)]()],"aria-hidden":r(478)}}]};n&&(o[r(481)]=r(458),o.on={click:s.to((()=>this[r(472)](r(465))))}),this[r(456)](o)}[tu(459)](){const t=tu;this[t(474)][t(459)]()}}function ru(){const t=["4348280dAjZDJ","1064lQxTVO","execute","11bWuwmn","19037580sTKKOP","color","bindTemplate","ck-presence-list__dropdown-list-item","6074165apdEFy","fire","823240MshgFS","element","3nvVICP","userView","ck-presence-list__marker","true","5660514xXwmdI","ck-user__full-name","tag","span","getBackgroundColorClass","804298onNuRR","name","setTemplate","presentation","button","focus","3843viqBna","6rZNYur","10NTUWHf"];return(ru=function(){return t})()}!function(t){const e=ou,n=t();for(;;)try{if(942750===parseInt(e(429))/1*(-parseInt(e(453))/2)+parseInt(e(452))/3*(-parseInt(e(435))/4)+parseInt(e(439))/5+-parseInt(e(449))/6*(-parseInt(e(433))/7)+-parseInt(e(444))/8*(-parseInt(e(441))/9)+-parseInt(e(450))/10*(parseInt(e(434))/11)+parseInt(e(427))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(iu);class su extends r.View{constructor(t,e,n){const s=ou;super(t);const o=this[s(432)];this[s(442)](s(445),!1),this[s(442)](s(454),!0),this[s(442)](s(446),""),this[s(459)]=new ps.UserView(t,e),this[s(431)]=new au(t,e);const i=new r.LabelView(t);i[s(428)][s(455)]=s(451),i[s(447)]=e[s(458)];const a={tag:s(437),attributes:{class:["ck",s(457)],role:s(448),tabindex:o.to(s(445),(t=>!!t&&0)),"aria-labelledby":i.id,"data-cke-tooltip-text":this[s(459)][s(458)],"data-cke-tooltip-position":o.to(s(446)),"data-cke-tooltip-disabled":o.to(s(454),(t=>!t)),"data-cke-tooltip-class":s(426)},children:[this[s(459)],this[s(431)],i]};n&&(a[s(455)]=s(430),a.on={click:o.to((()=>this[s(436)](s(443))))}),this[s(425)](a)}}function ou(t,e){const n=iu();return(ou=function(t,e){return n[t-=424]})(t,e)}function iu(){const t=["button","markerView","bindTemplate","7vXcrvx","104401UkrJRr","4GCaJpJ","fire","div","true","1051610BzNjGm","color","189LhDVRa","set","execute","69264icMjCz","isFocusable","tooltipPosition","text","listitem","6082716bsXHPn","250uoIMRT","span","3662151pJOzWX","188NbRkYa","hasTooltip","tag","ck-presence-list__marker","ck-presence-list__list-item","name","userView","getBackgroundColorClass","setTemplate","ck-presence-list__list-item__tooltip","34331976dNpDRi","template","19853EwrJit"];return(iu=function(){return t})()}class au extends r.View{constructor(t,e){const n=ou;super(t),this[n(425)]({tag:n(451),attributes:{class:["ck",n(456),e[n(440)][n(424)]()],"aria-hidden":n(438)}})}}const cu=du;function du(t,e){const n=uu();return(du=function(t,e){return n[t-=175]})(t,e)}function uu(){const t=["content","260RhSNcM","activeElement","ck ck-presence-list__balloon","880045tCXtYM","hideDropdown","attachToDom","9nqypTu","counterView","17922edivaH","154150dngyJB","detachFromDom","min","isVisible","focus","6529404qOBPIz","currentDisplayedUsers","unpin","destroy","_bodyCollection","input","body","filter","reverse","Shift+Tab","Tab","isHidden","isRendered","join","context","items","onClick","2396392VlKlnp","appendChild","render","from","742wVggoT","balloonPanelView","textarea","offsetWidth","10038ZTmute","focusTracker","isMe","_handleUserRemove","config","using","isFocusable","presenceList.collapseAt","button","143xncGnR","_createView","bindTo","inlineListView",':not([disabled]):not([tabindex="-1"])',"usersCount","init","displayMe","Enter","add","Esc","change:isFocused","class","sort","presencelist-missing-container","get","122278HqqkuY","[contenteditable]","define","[tabindex]","presenceList","indexOf","offsetHeight","element","_handleUserAdd","length","number","hasTooltip","showDropdown","checkIfScrollable","presenceList.container","select","requires","tabIndex","keystrokes","isExpanded","plugins","locale","querySelectorAll","presenceDropdownView","presencelist-collapseat-invalid-format","bind","presenceList.displayMe","view","pin","set","allConnectedUsers","_allConnectedUsers","listenTo","remove","map","execute","isCollapsed","2MsHLEp"];return(uu=function(){return t})()}!function(t){const e=du,n=t();for(;;)try{if(243328===-parseInt(e(179))/1*(-parseInt(e(216))/2)+-parseInt(e(257))/3*(-parseInt(e(218))/4)+parseInt(e(221))/5+parseInt(e(226))/6*(-parseInt(e(253))/7)+parseInt(e(249))/8*(-parseInt(e(224))/9)+parseInt(e(227))/10*(-parseInt(e(266))/11)+parseInt(e(232))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(uu);const lu={collapseAt:6,displayMe:!0};class pu extends e.ContextPlugin{constructor(t){const e=du;super(t),this[e(236)]=null,this[e(246)][e(261)][e(181)](e(183),lu);const s=t[e(261)][e(178)](e(264));if(e(189)!=typeof s)throw new n.CKEditorError(e(203),this);if(s<1)throw new n.CKEditorError(e(203),this);this[e(210)]=this[e(246)][e(199)][e(178)](ms)[e(209)],this[e(208)](e(271),0),this[e(233)]=new n.Collection,this[e(254)]=new r.BalloonPanelView,this[e(254)][e(175)]=e(220),this[e(206)]=this[e(267)](),this[e(202)]=void 0}static get[cu(195)](){return[ms]}[cu(272)](){const t=cu;for(const e of this[t(210)])this[t(187)](e);this[t(211)](this[t(210)],t(275),((e,n)=>{this[t(187)](n)})),this[t(211)](this[t(210)],t(212),((e,n)=>{this[t(260)](n)}))}[cu(267)](){const t=cu,e=this[t(246)],s=new Fd(this[t(246)][t(200)]),o=this[t(254)];if(!Vd(e[t(261)][t(178)](t(193))))throw new n.CKEditorError(t(177),this);return s[t(225)][t(204)](t(271)).to(this),s[t(204)](t(215)).to(this,t(271),(n=>{const r=t,{collapseAt:o,displayMe:i}=e[r(261)][r(178)](r(183)),a=n>=o;return s[r(225)][r(243)]=!(1==n&&i||a),a||this[r(222)](),a})),s[t(269)][t(247)][t(268)](this[t(233)])[t(262)]((n=>{const r=t,o=e[r(261)][r(178)](r(183)),i=new su(e[r(200)],n,!!o[r(248)]);return i[r(204)](r(190)).to(s,r(215),(t=>!t)),i[r(204)](r(263)).to(s,r(215),(t=>!t)),o[r(248)]&&this[r(211)](i,r(214),(()=>{const t=r;this[t(206)][t(215)]||o[t(248)](n,i[t(186)])})),i})),this[t(211)](s[t(269)],t(214),(()=>{const e=t;this[e(202)]?this[e(222)]():this[e(206)][e(215)]&&this[e(191)]()})),s[t(269)][t(197)][t(208)](t(274),((e,n)=>{const r=t;this[r(206)][r(215)]&&(this[r(191)](),n())})),s[t(251)](),o[t(251)](),(0,r.clickOutsideHandler)({emitter:s,activator:()=>o[t(230)],contextElements:[o[t(186)],s[t(269)][t(186)]],callback:()=>this[t(222)]()}),e[t(261)][t(178)](t(193))[t(250)](s[t(186)]),this[t(236)]=new r.BodyCollection(this[t(246)][t(200)]),this[t(236)][t(223)](),this[t(236)][t(275)](this[t(254)]),s}[cu(187)](t){const e=cu;if(!this[e(246)][e(261)][e(178)](e(205))&&t[e(259)])return;const n=this[e(246)][e(261)][e(178)](e(264))-1;this[e(271)]++,this[e(233)][e(188)]==n&&this[e(233)][e(188)]>1&&this[e(233)][e(212)](1);const r=t[e(259)]?0:this[e(233)][e(188)];this[e(233)][e(275)](t,r)}[cu(260)](t){const e=cu;if(this[e(271)]--,this[e(233)][e(178)](t.id)&&(this[e(233)][e(212)](t.id),this[e(233)][e(188)]<this[e(271)]))for(const t of Array[e(252)](this[e(210)])[e(240)]())if(!this[e(233)][e(178)](t.id))return void this[e(233)][e(275)](t,Math[e(229)](this[e(233)][e(188)],1))}[cu(191)](){const t=cu;if(this[t(202)])return;const e=this[t(246)][t(261)][t(178)](t(183));this[t(202)]=new Xd(this[t(246)][t(200)],!!e[t(248)]),this[t(206)][t(269)][t(198)]=!0;const{listWrapperView:n}=this[t(202)];n[t(247)][t(268)](this[t(210)])[t(262)]((n=>{const r=t;if(!e[r(273)]&&n[r(259)])return null;const s=new nu(this[r(246)][r(200)],n,!!e[r(248)]);return e[r(248)]&&this[r(211)](s,r(214),(()=>{const t=r;e[t(248)](n,s[t(186)])})),s})),this[t(254)][t(217)][t(275)](this[t(202)]),this[t(254)][t(207)]({target:this[t(206)][t(269)][t(186)]}),n[t(231)](),n[t(192)]();const r=(e,n)=>{const r=t;this[r(222)](),this[r(206)][r(269)][r(231)](),n()};n[t(197)][t(208)](t(276),r),n[t(197)][t(208)](t(241),r),n[t(197)][t(208)](t(242),((e,n)=>{const r=t;!function(t){const e=du,n=["a",e(265),e(237),e(194),e(255),e(182),e(180)][e(213)]((t=>t+e(270)))[e(245)](","),r=[...document[e(238)][e(201)](n)][e(239)]((t=>t===document[e(219)]||t[e(256)]+t[e(185)]>0))[e(176)](((t,n)=>(t[e(196)]||0)-(n[e(196)]||0))),s=r[e(184)](t),o=r[(s+1)%r[e(188)]];o&&o[e(231)]()}(this[r(206)][r(186)]),this[r(222)](),n()})),n[t(258)][t(275)](this[t(206)][t(186)]),n[t(258)].on(t(277),((e,n,r)=>{r||this[t(222)]()}))}[cu(222)](){const t=cu;this[t(202)]&&(this[t(206)][t(269)][t(198)]=!1,this[t(254)][t(234)](),this[t(254)][t(217)][t(212)](this[t(202)]),this[t(202)][t(235)](),this[t(202)]=void 0)}[cu(235)](){const t=cu;super[t(235)](),this[t(206)]&&this[t(206)][t(244)]&&this[t(206)][t(235)](),this[t(236)]&&(this[t(236)][t(228)](),this[t(236)][t(235)](),this[t(236)]=null)}}var hu=fu;function fu(t,e){var n=mu();return(fu=function(t,e){return n[t-=179]})(t,e)}function mu(){var t=["requires","20GmyBfP","1967910YuVmqK","PresenceList","isOfficialPlugin","2uPJIjn","pluginName","427185jSDRMo","6861536VwyoCU","212195YXXSPR","14FxrgHq","486187UjIHzx","27260220xoFDCe","43311nNzWhi","isPremiumPlugin"];return(mu=function(){return t})()}!function(t){for(var e=fu,n=t();;)try{if(452076===-parseInt(e(183))/1*(parseInt(e(192))/2)+-parseInt(e(185))/3+parseInt(e(188))/4*(-parseInt(e(181))/5)+parseInt(e(189))/6*(-parseInt(e(182))/7)+-parseInt(e(180))/8+-parseInt(e(179))/9+parseInt(e(184))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(mu);class yu extends e.ContextPlugin{static get[hu(187)](){return[ms,pu]}static get[hu(193)](){return hu(190)}static get[hu(191)](){return!0}static get[hu(186)](){return!0}}function gu(t,e){var n=bu();return(gu=function(t,e){return n[t-=473]})(t,e)}function bu(){var t=["32187324cYXnIf","135882ISMjFL","80jTohNi","5987262uqLqkA","443806yXPJPv","2QUUggR","1956426vggvwg","7zsombq","2034232QAAdUt","644089XUVmgh","5KQhbYw","310bqapHp"];return(bu=function(){return t})()}!function(t){for(var e=gu,n=t();;)try{if(775619===-parseInt(e(476))/1*(parseInt(e(484))/2)+-parseInt(e(473))/3+-parseInt(e(475))/4*(parseInt(e(477))/5)+parseInt(e(482))/6*(parseInt(e(474))/7)+parseInt(e(481))/8*(parseInt(e(480))/9)+parseInt(e(478))/10*(-parseInt(e(483))/11)+parseInt(e(479))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(bu)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();