@ckeditor/ckeditor5-real-time-collaboration 41.4.1 → 41.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/translations/ar.js +1 -1
  4. package/dist/translations/ar.umd.js +1 -1
  5. package/dist/translations/bg.js +1 -1
  6. package/dist/translations/bg.umd.js +1 -1
  7. package/dist/translations/bn.js +1 -1
  8. package/dist/translations/bn.umd.js +1 -1
  9. package/dist/translations/ca.js +1 -1
  10. package/dist/translations/ca.umd.js +1 -1
  11. package/dist/translations/cs.js +1 -1
  12. package/dist/translations/cs.umd.js +1 -1
  13. package/dist/translations/da.js +1 -1
  14. package/dist/translations/da.umd.js +1 -1
  15. package/dist/translations/de-ch.js +1 -1
  16. package/dist/translations/de-ch.umd.js +1 -1
  17. package/dist/translations/de.js +1 -1
  18. package/dist/translations/de.umd.js +1 -1
  19. package/dist/translations/el.js +1 -1
  20. package/dist/translations/el.umd.js +1 -1
  21. package/dist/translations/en-au.js +1 -1
  22. package/dist/translations/en-au.umd.js +1 -1
  23. package/dist/translations/en.umd.js +1 -1
  24. package/dist/translations/es.js +1 -1
  25. package/dist/translations/es.umd.js +1 -1
  26. package/dist/translations/et.js +1 -1
  27. package/dist/translations/et.umd.js +1 -1
  28. package/dist/translations/fa.js +1 -1
  29. package/dist/translations/fa.umd.js +1 -1
  30. package/dist/translations/fi.js +1 -1
  31. package/dist/translations/fi.umd.js +1 -1
  32. package/dist/translations/fr.js +1 -1
  33. package/dist/translations/fr.umd.js +1 -1
  34. package/dist/translations/gl.js +1 -1
  35. package/dist/translations/gl.umd.js +1 -1
  36. package/dist/translations/he.js +1 -1
  37. package/dist/translations/he.umd.js +1 -1
  38. package/dist/translations/hi.js +1 -1
  39. package/dist/translations/hi.umd.js +1 -1
  40. package/dist/translations/hr.js +1 -1
  41. package/dist/translations/hr.umd.js +1 -1
  42. package/dist/translations/hu.js +1 -1
  43. package/dist/translations/hu.umd.js +1 -1
  44. package/dist/translations/id.js +1 -1
  45. package/dist/translations/id.umd.js +1 -1
  46. package/dist/translations/it.js +1 -1
  47. package/dist/translations/it.umd.js +1 -1
  48. package/dist/translations/ja.js +1 -1
  49. package/dist/translations/ja.umd.js +1 -1
  50. package/dist/translations/ko.js +1 -1
  51. package/dist/translations/ko.umd.js +1 -1
  52. package/dist/translations/lt.js +1 -1
  53. package/dist/translations/lt.umd.js +1 -1
  54. package/dist/translations/lv.js +1 -1
  55. package/dist/translations/lv.umd.js +1 -1
  56. package/dist/translations/ms.js +1 -1
  57. package/dist/translations/ms.umd.js +1 -1
  58. package/dist/translations/nl.js +1 -1
  59. package/dist/translations/nl.umd.js +1 -1
  60. package/dist/translations/no.js +1 -1
  61. package/dist/translations/no.umd.js +1 -1
  62. package/dist/translations/pl.js +1 -1
  63. package/dist/translations/pl.umd.js +1 -1
  64. package/dist/translations/pt-br.js +1 -1
  65. package/dist/translations/pt-br.umd.js +1 -1
  66. package/dist/translations/pt.js +1 -1
  67. package/dist/translations/pt.umd.js +1 -1
  68. package/dist/translations/ro.js +1 -1
  69. package/dist/translations/ro.umd.js +1 -1
  70. package/dist/translations/ru.js +1 -1
  71. package/dist/translations/ru.umd.js +1 -1
  72. package/dist/translations/sk.js +1 -1
  73. package/dist/translations/sk.umd.js +1 -1
  74. package/dist/translations/sr-latn.js +1 -1
  75. package/dist/translations/sr-latn.umd.js +1 -1
  76. package/dist/translations/sr.js +1 -1
  77. package/dist/translations/sr.umd.js +1 -1
  78. package/dist/translations/sv.js +1 -1
  79. package/dist/translations/sv.umd.js +1 -1
  80. package/dist/translations/th.js +1 -1
  81. package/dist/translations/th.umd.js +1 -1
  82. package/dist/translations/tk.js +1 -1
  83. package/dist/translations/tk.umd.js +1 -1
  84. package/dist/translations/tr.js +1 -1
  85. package/dist/translations/tr.umd.js +1 -1
  86. package/dist/translations/uk.js +1 -1
  87. package/dist/translations/uk.umd.js +1 -1
  88. package/dist/translations/vi.js +1 -1
  89. package/dist/translations/vi.umd.js +1 -1
  90. package/dist/translations/zh-cn.js +1 -1
  91. package/dist/translations/zh-cn.umd.js +1 -1
  92. package/dist/translations/zh.js +1 -1
  93. package/dist/translations/zh.umd.js +1 -1
  94. package/package.json +4 -4
  95. package/src/common-translations.js +1 -1
  96. package/src/index.js +1 -1
  97. package/src/presencelist/presencelistui.js +1 -1
  98. package/src/presencelist/view/presencecounterview.js +1 -1
  99. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  100. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  101. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  102. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  103. package/src/presencelist/view/presencelistview.js +1 -1
  104. package/src/presencelist.js +1 -1
  105. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
  106. package/src/realtimecollaborativecomments.js +1 -1
  107. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
  108. package/src/realtimecollaborativeediting/sessions.js +1 -1
  109. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  110. package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
  111. package/src/realtimecollaborativeediting.js +1 -1
  112. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
  113. package/src/realtimecollaborativerevisionhistory.js +1 -1
  114. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
  115. package/src/realtimecollaborativetrackchanges.js +1 -1
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
4
4
  * For licensing, see LICENSE.md.
5
- */(()=>{var __webpack_modules__={310:e=>{"use strict";e.exports=function(e,t){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(e){if(o)if(o=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];s.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,i(e))}}))}},662:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),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(e,t,n){for(var s,o=null,i=[],a=0,c=0;t<n;){var d=e[t++];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(e,t,n){for(var r,o=n,a=0,c=0;c<e.length;){var d=e.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:t[n++]=r<<2|(48&d)>>4,r=d,a=2;break;case 2:t[n++]=(15&r)<<4|(60&d)>>2,r=d,a=3;break;case 3:t[n++]=(3&r)<<6|d,a=0}}if(1===a)throw Error(i);return n-o},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},707:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},365:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function s(e,r,s){t[0]=e,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3]}function o(e,r,s){t[0]=e,r[s]=n[3],r[s+1]=n[2],r[s+2]=n[1],r[s+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?s:o,e.writeFloatBE=r?o:s,e.readFloatLE=r?i:a,e.readFloatBE=r?a:i}():function(){function t(e,t,n,r){var s=t<0?1:0;if(s&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((s<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((s<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((s<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,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)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,s),e.readFloatBE=i.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function s(e,r,s){t[0]=e,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(e,r,s){t[0]=e,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(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?s:o,e.writeDoubleBE=r?o:s,e.readDoubleLE=r?i:a,e.readDoubleBE=r?a:i}():function(){function t(e,t,n,r,s,o){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,s,o+t),e(1/r>0?0:2147483648,s,o+n);else if(isNaN(r))e(0,s,o+t),e(2146959360,s,o+n);else if(r>17976931348623157e292)e(0,s,o+t),e((i<<31|2146435072)>>>0,s,o+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,s,o+t),e((i<<31|a/4294967296)>>>0,s,o+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,s,o+t),e((i<<31|c+1023<<20|1048576*a&1048575)>>>0,s,o+n)}}}function i(e,t,n,r,s){var o=e(r,s+t),i=e(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)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,s,0,4),e.readDoubleBE=i.bind(null,o,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},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(e){}return null}module.exports=inquire},319:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,s=r>>>1,o=null,i=r;return function(n){if(n<1||n>s)return e(n);i+n>r&&(o=e(r),i=0);var a=t.call(o,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},742:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,s=null,o=[],i=0;t<n;)(r=e[t++])<128?o[i++]=r:r>191&&r<224?o[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[i++]=55296+(r>>10),o[i++]=56320+(1023&r)):o[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],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(e,t,n){for(var r,s,o=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(s=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&s),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-o}},106:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(433),s=n.n(r)()((function(e){return e[1]}));s.push([e.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;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:0;color:inherit;font:inherit;margin-left:var(--ck-spacing-standard);outline:none;padding:0;position:relative}.ck.ck-presence-list__list-item:last-child{margin-left:0;order:-1}.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{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.ck-presence-list__list-item{margin-left:calc(var(--ck-user-avatar-size)*-1 + 7px)}.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-height:80vh;max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width);overflow-x:hidden;overflow-y:auto}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item{align-items:center;background:none;border:0;color:inherit;display:flex;font:inherit;outline:none;padding:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:first-of-type .ck-presence-list__marker{border-top-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:last-of-type .ck-presence-list__marker{border-bottom-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck-user__full-name{color:var(--ck-color-base-text);margin-left:var(--ck-spacing-standard);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck.ck-presence-list__marker{height:100%;left:0;margin:0;position:absolute;width:3px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const o=s},535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(433),s=n.n(r)()((function(e){return e[1]}));s.push([e.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 o=s},433:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(s[i]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&s[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},199:(e,t,n)=>{"use strict";e.exports=n(995)},995:(e,t,n)=>{"use strict";var r=t;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()},366:(e,t,n)=>{"use strict";e.exports=c;var r,s=n(737),o=s.LongBits,i=s.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var d,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return s.Buffer?function(e){return(c.create=function(e){return s.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};function p(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new 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 e=this.uint32();return e>>>1^-(1&e)},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=s.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=s.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=s.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=s.Long?"toLong":"toNumber";s.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},895:(e,t,n)=>{"use strict";e.exports=o;var r=n(366);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(e){r.call(this,e)}o._configure=function(){s.Buffer&&(o.prototype._slice=s.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},156:e=>{"use strict";e.exports={}},178:(e,t,n)=>{"use strict";t.Service=n(418)},418:(e,t,n)=>{"use strict";e.exports=s;var r=n(737);function s(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(s.prototype=Object.create(r.EventEmitter.prototype)).constructor=s,s.prototype.rpcCall=function e(t,n,s,o,i){if(!o)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(e,a,t,n,s,o);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof s))try{n=s[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},s.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},130:(e,t,n)=>{"use strict";e.exports=s;var r=n(737);function s(e,t){this.lo=e>>>0,this.hi=t>>>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(e){if(0===e)return o;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new s(n,r)},s.from=function(e){if("number"==typeof e)return s.fromNumber(e);if(r.isString(e)){if(!r.Long)return s.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new s(e.low>>>0,e.high>>>0):o},s.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},s.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;s.fromHash=function(e){return e===i?o:new s((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},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 e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},s.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},s.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},737:function(e,t,n){"use strict";var r=t;function s(e,t,n){for(var r=Object.keys(t),s=0;s<r.length;++s)void 0!==e[r[s]]&&n||(e[r[s]]=t[r[s]]);return e}function o(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&s(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(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(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=s,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},6:(e,t,n)=>{"use strict";e.exports=l;var r,s=n(737),o=s.LongBits,i=s.base64,a=s.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function d(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return s.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=p(),l.alloc=function(e){return new s.Array(e)},s.Array!==Array&&(l.alloc=s.pool(l.alloc,s.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(s.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(s.float.writeDoubleLE,8,e)};var g=s.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(s.isString(e)){var n=l.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(d,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=p(),r._configure()}},623:(e,t,n)=>{"use strict";e.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(e,t,n){e.length<40?s.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,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(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},o.prototype.bytes=function(e){s.isString(e)&&(e=s._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=s.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},o._configure()},553:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function s(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,o,i=[];for(o in"string"!=typeof t&&(t="?"),e)if(n.call(e,o)){if((r=e[o])||null!=r&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;i.push(o+"="+r)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,s={};t=n.exec(e);){var o=r(t[1]),i=r(t[2]);null===o||null===i||o in s||(s[o]=i)}return s}},696:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},673:(e,t,n)=>{"use strict";var r,s=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],s=0;s<e.length;s++){var o=e[s],c=t.base?o[0]+t.base:o[0],d=n[c]||0,u="".concat(c," ").concat(d);n[c]=d+1;var l=a(u),p={css:o[1],media:o[2],sourceMap:o[3]};-1!==l?(i[l].references++,i[l].updater(p)):i.push({identifier:u,updater:y(p,t),references:1}),r.push(u)}return r}function d(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var s=n.nc;s&&(r.nonce=s)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,l=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function p(e,t,n,r){var s=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,s);else{var o=document.createTextNode(s),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(o,i[t]):e.appendChild(o)}}function h(e,t,n){var r=n.css,s=n.media,o=n.sourceMap;if(s?e.setAttribute("media",s):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,m=0;function y(e,t){var n,r,s;if(t.singleton){var o=m++;n=f||(f=d(t)),r=p.bind(null,n,o,!1),s=p.bind(null,n,o,!0)}else n=d(t),r=h.bind(null,n,t),s=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else s()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=s());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var s=a(n[r]);i[s].references--}for(var o=c(e,t),d=0;d<n.length;d++){var u=a(n[d]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=o}}}},835:(e,t,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(e){return(e||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function f(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},s={},o=typeof(e=e||r);if("blob:"===e.protocol)s=new g(unescape(e.pathname),{});else if("string"===o)for(t in s=new g(e,{}),h)delete s[t];else if("object"===o){for(t in e)t in h||(s[t]=e[t]);void 0===s.slashes&&(s.slashes=a.test(e.href))}return s}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function y(e,t){e=(e=l(e)).replace(i,""),t=t||{};var n,r=d.exec(e),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(t.protocol)&&(n=r[4]),{protocol:s,slashes:o||m(s),slashesCount:c,rest:n}}function g(e,t,n){if(e=(e=l(e)).replace(i,""),!(this instanceof g))return new g(e,t,n);var o,a,c,d,h,b,O=p.slice(),w=typeof t,I=this,v=0;for("object"!==w&&"string"!==w&&(n=t,t=null),n&&"function"!=typeof n&&(n=s.parse),o=!(a=y(e||"",t=f(t))).protocol&&!a.slashes,I.slashes=a.slashes||o&&t.slashes,I.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(I.protocol)))&&(O[3]=[/(.*)/,"pathname"]);v<O.length;v++)"function"!=typeof(d=O[v])?(c=d[0],b=d[1],c!=c?I[b]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof d[2]?(I[b]=e.slice(0,h),e=e.slice(h+d[2])):(I[b]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(I[b]=h[1],e=e.slice(0,h.index)),I[b]=I[b]||o&&d[3]&&t[b]||"",d[4]&&(I[b]=I[b].toLowerCase())):e=d(e,I);n&&(I.query=n(I.query)),o&&t.slashes&&"/"!==I.pathname.charAt(0)&&(""!==I.pathname||""!==t.pathname)&&(I.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,s=n[r-1],o=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(o=!0),n.splice(r,1),i--);return o&&n.unshift(""),"."!==s&&".."!==s||n.push(""),n.join("/")}(I.pathname,t.pathname)),"/"!==I.pathname.charAt(0)&&m(I.protocol)&&(I.pathname="/"+I.pathname),r(I.port,I.protocol)||(I.host=I.hostname,I.port=""),I.username=I.password="",I.auth&&(~(h=I.auth.indexOf(":"))?(I.username=I.auth.slice(0,h),I.username=encodeURIComponent(decodeURIComponent(I.username)),I.password=I.auth.slice(h+1),I.password=encodeURIComponent(decodeURIComponent(I.password))):I.username=encodeURIComponent(decodeURIComponent(I.auth)),I.auth=I.password?I.username+":"+I.password:I.username),I.origin="file:"!==I.protocol&&m(I.protocol)&&I.host?I.protocol+"//"+I.host:"null",I.href=I.toString()}g.prototype={set:function(e,t,n){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||s.parse)(t)),o[e]=t;break;case"port":o[e]=t,r(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,c.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";o[e]=t.charAt(0)!==i?i+t:t}else o[e]=t;break;case"username":case"password":o[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(o.username=t.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=t.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(t))}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(e){e&&"function"==typeof e||(e=s.stringify);var t,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,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},g.extractProtocol=y,g.location=f,g.trimLeft=l,g.qs=s,e.exports=g},211:(e,t,n)=>{e.exports=n(312)("./src/collaboration-core.js")},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},312:e=>{"use strict";e.exports=CKEditor5.collaborationDll},237:e=>{"use strict";e.exports=CKEditor5.dll}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>ac,CloudServicesRevisionHistoryAdapter:()=>Cc,CloudServicesTrackChangesAdapter:()=>mc,PresenceList:()=>bd,RealTimeCollaborationClient:()=>Wa,RealTimeCollaborativeComments:()=>Ic,RealTimeCollaborativeEditing:()=>rc,RealTimeCollaborativeRevisionHistory:()=>xc,RealTimeCollaborativeTrackChanges:()=>Pc});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Decoder:()=>fe,Encoder:()=>pe,PacketType:()=>le,protocol:()=>ue});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{AttributeOperation:()=>jr,Element:()=>Lr,InsertOperation:()=>Rr,MarkerOperation:()=>Dr,MergeOperation:()=>Nr,MoveOperation:()=>xr,Position:()=>Jr,Range:()=>qr,RenameOperation:()=>Vr,RootAttributeOperation:()=>Mr,RootOperation:()=>Br,SplitOperation:()=>Ur,default:()=>Er});var n=__webpack_require__(782),r=__webpack_require__(584),s=__webpack_require__(311),o=__webpack_require__(783);const i=Object.create(null);i.open="0",i.close="1",i.ping="2",i.pong="3",i.message="4",i.upgrade="5",i.noop="6";const a=Object.create(null);Object.keys(i).forEach((e=>{a[i[e]]=e}));const c={type:"error",data:"parser error"},d="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),u="function"==typeof ArrayBuffer,l=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)},p=({type:e,data:t},n,r)=>{return d&&t instanceof Blob?n?r(t):l(t,r):u&&(t instanceof ArrayBuffer||(s=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer))?n?r(t):l(new Blob([t]),r):r(i[e]+(t||""));var s},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)f[h.charCodeAt(e)]=e;const m="function"==typeof ArrayBuffer,y=(e,t)=>{if(m){const n=(e=>{let t,n,r,s,o,i=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);const d=new ArrayBuffer(i),u=new Uint8Array(d);for(t=0;t<a;t+=4)n=f[e.charCodeAt(t)],r=f[e.charCodeAt(t+1)],s=f[e.charCodeAt(t+2)],o=f[e.charCodeAt(t+3)],u[c++]=n<<2|r>>4,u[c++]=(15&r)<<4|s>>2,u[c++]=(3&s)<<6|63&o;return d})(e);return g(n,t)}return{base64:!0,data:e}},g=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,b=(e,t)=>{if("string"!=typeof e)return{type:"message",data:g(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:y(e.substring(1),t)};return a[n]?e.length>1?{type:a[n],data:e.substring(1)}:{type:a[n]}:c},O=String.fromCharCode(30);function w(e){if(e)return function(e){for(var t in w.prototype)e[t]=w.prototype[t];return e}(e)}w.prototype.on=w.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},w.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},w.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},w.prototype.emitReserved=w.prototype.emit,w.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},w.prototype.hasListeners=function(e){return!!this.listeners(e).length};const I="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function v(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const S=I.setTimeout,A=I.clearTimeout;function P(e,t){t.useNativeTimers?(e.setTimeoutFn=S.bind(I),e.clearTimeoutFn=A.bind(I)):(e.setTimeoutFn=I.setTimeout.bind(I),e.clearTimeoutFn=I.clearTimeout.bind(I))}class T extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class _ extends w{constructor(e){super(),this.writable=!1,P(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new T(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=b(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}}const k="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),C=64,E={};let j,R=0,D=0;function N(e){let t="";do{t=k[e%C]+t,e=Math.floor(e/C)}while(e>0);return t}function x(){const e=N(+new Date);return e!==j?(R=0,j=e):e+"."+N(R++)}for(;D<C;D++)E[k[D]]=D;function V(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let M=!1;try{M="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const B=M;function U(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||B))return new XMLHttpRequest}catch(e){}if(!t)try{return new(I[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function J(){}const q=null!=new U({xdomain:!1}).responseType;class L extends w{constructor(e,t){super(),P(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=v(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new U(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=L.requestsCount++,L.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=J,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete L.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(L.requestsCount=0,L.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",G);else if("function"==typeof addEventListener){addEventListener("onpagehide"in I?"pagehide":"unload",G,!1)}function G(){for(let e in L.requests)L.requests.hasOwnProperty(e)&&L.requests[e].abort()}const Y="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),F=I.WebSocket||I.MozWebSocket,H="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const z={websocket:class extends _{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=H?{}:v(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=H?new F(e,t,n):t?new F(e,t):new F(e)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;p(n,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}r&&Y((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=x()),this.supportsBinary||(e.b64=1);const r=V(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!F}},polling:class extends _{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=q&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(O),r=[];for(let e=0;e<n.length;e++){const s=b(n[e],t);if(r.push(s),"error"===s.type)break}return r})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach(((e,o)=>{p(e,!1,(e=>{r[o]=e,++s===n&&t(r.join(O))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=x()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=V(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new L(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},K=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,W=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Q(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=K.exec(e||""),o={},i=14;for(;i--;)o[W[i]]=s[i]||"";return-1!=n&&-1!=r&&(o.source=t,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(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,o.path),o.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,o.query),o}class $ extends w{constructor(e,t={}){super(),this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=Q(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Q(t.host).host),P(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new z[e](n)}open(){let e;if(this.opts.rememberUpgrade&&$.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;$.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;$.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function s(){n||(n=!0,d(),t.close(),t=null)}const o=e=>{const n=new Error("probe error: "+e);n.transport=t.name,s(),this.emitReserved("upgradeError",n)};function i(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&s()}const d=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",o),t.once("close",i),this.once("close",a),this.once("upgrading",c),t.open()}onOpen(){if(this.readyState="open",$.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:e,data:t,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){$.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"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",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}$.protocol=4;$.protocol;const Z="function"==typeof ArrayBuffer,X=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ee=Object.prototype.toString,te="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===ee.call(Blob),ne="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===ee.call(File);function re(e){return Z&&(e instanceof ArrayBuffer||X(e))||te&&e instanceof Blob||ne&&e instanceof File}function se(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(se(e[t]))return!0;return!1}if(re(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return se(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&se(e[t]))return!0;return!1}function oe(e){const t=[],n=e.data,r=e;return r.data=ie(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ie(e,t){if(!e)return e;if(re(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=ie(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ie(e[r],t));return n}return e}function ae(e,t){return e.data=ce(e.data,t),delete e.attachments,e}function ce(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ce(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ce(e[n],t));return e}const de=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ue=5;var le;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(le||(le={}));class pe{constructor(e){this.replacer=e}encode(e){return e.type!==le.EVENT&&e.type!==le.ACK||!se(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===le.EVENT?le.BINARY_EVENT:le.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==le.BINARY_EVENT&&e.type!==le.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=oe(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function he(e){return"[object Object]"===Object.prototype.toString.call(e)}class fe extends w{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===le.BINARY_EVENT;n||t.type===le.BINARY_ACK?(t.type=n?le.EVENT:le.ACK,this.reconstructor=new me(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!re(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===le[n.type])throw new Error("unknown packet type "+n.type);if(n.type===le.BINARY_EVENT||n.type===le.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!fe.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case le.CONNECT:return he(t);case le.DISCONNECT:return void 0===t;case le.CONNECT_ERROR:return"string"==typeof t||he(t);case le.EVENT:case le.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===de.indexOf(t[0]));case le.ACK:case le.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class me{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=ae(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function ye(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const ge=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class be extends w{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[ye(e,"open",this.onopen.bind(this)),ye(e,"packet",this.onpacket.bind(this)),ye(e,"error",this.onerror.bind(this)),ye(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(ge.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:le.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const s=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(s),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,s)=>{t.push(((e,t)=>n?e?s(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case le.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case le.EVENT:case le.BINARY_EVENT:this.onevent(e);break;case le.ACK:case le.BINARY_ACK:this.onack(e);break;case le.DISCONNECT:this.ondisconnect();break;case le.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:le.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Oe(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Oe.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},Oe.prototype.reset=function(){this.attempts=0},Oe.prototype.setMin=function(e){this.ms=e},Oe.prototype.setMax=function(e){this.max=e},Oe.prototype.setJitter=function(e){this.jitter=e};class we extends w{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(n=t,t=void 0),(n=n||{}).path=n.path||"/socket.io",this.opts=n,P(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 Oe({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==n.timeout?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||e;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=!1!==n.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new $(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=ye(t,"open",(function(){n.onopen(),e&&e()})),s=ye(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ye(e,"ping",this.onping.bind(this)),ye(e,"data",this.ondata.bind(this)),ye(e,"error",this.onerror.bind(this)),ye(e,"close",this.onclose.bind(this)),ye(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){Y((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new be(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),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(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ie={};function ve(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=Q(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=Ie[s]&&o in Ie[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new we(r,t):(Ie[s]||(Ie[s]=new we(r,t)),a=Ie[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(ve,{Manager:we,Socket:be,io:ve,connect:ve});var Se=__webpack_require__(835);class Ae{constructor(...e){}}class Pe extends Ae{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}Pe.TYPE="1000";class Te extends Pe{constructor(e,t,n){super(),this.type=e,this.socketId=t,this.data=n}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(e){return new Te(e.type,e.socketId,e.data)}}Te.DESCRIPTOR_NAME="ChannelMessage",Te.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};var _e=__webpack_require__(199);const ke=_e.Reader,Ce=_e.Writer,Ee=_e.util,je=_e.roots.default||(_e.roots.default={}),Re=(je.OperationMetadataDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.userId="",e.prototype.type="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(18).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.OperationMetadataDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.userId=e.string();break;case 2:r.type=e.string();break;case 3:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!Ee.isString(e.userId)?"userId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof je.OperationMetadataDescriptor)return e;let t=new je.OperationMetadataDescriptor;return null!=e.userId&&(t.userId=String(e.userId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.userId="",n.type="",n.createdAt=""),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OperationMetadataDescriptor"},e})(),je.CollaborativeEditingConnectMessage=(()=>{function e(e){if(this.buffers=[],this.types=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.bundleVersion="",e.prototype.buffers=Ee.emptyArray,e.prototype.types=Ee.emptyArray,e.prototype.lastOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(26).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(34).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(42).string(e.lastOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.bundleVersion=e.string();break;case 3:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 4:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 5:r.lastOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id))return"id: string expected";if(null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!Ee.isString(e.bundleVersion))return"bundleVersion: string expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ee.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ee.isInteger(e.types[t]))return"types: integer[] expected"}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ee.isString(e.lastOperationId)?"lastOperationId: string expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingConnectMessage)return e;let t=new je.CollaborativeEditingConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectMessage.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ee.base64.decode(e.buffers[n],t.buffers[n]=Ee.newBuffer(Ee.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[]),t.defaults&&(n.id="",n.bundleVersion="",n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ee.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectMessage"},e})(),je.CollaborativeEditingReconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.bundleVersion="",e.prototype.lastKnowVersion=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.lastKnowVersion&&Object.hasOwnProperty.call(e,"lastKnowVersion")&&t.uint32(24).uint32(e.lastKnowVersion),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingReconnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.bundleVersion=e.string();break;case 3:r.lastKnowVersion=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!Ee.isString(e.bundleVersion)?"bundleVersion: string expected":null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&!Ee.isInteger(e.lastKnowVersion)?"lastKnowVersion: integer expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingReconnectMessage)return e;let t=new je.CollaborativeEditingReconnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),null!=e.lastKnowVersion&&(t.lastKnowVersion=e.lastKnowVersion>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.bundleVersion="",n.lastKnowVersion=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&(n.lastKnowVersion=e.lastKnowVersion),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingReconnectMessage"},e})(),je.CollaborativeEditingUpdateMessage=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.baseVersion=0,e.prototype.buffers=Ee.emptyArray,e.prototype.types=Ee.emptyArray,e.prototype.metadata=Ee.emptyArray,e.prototype.lastOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.baseVersion&&Object.hasOwnProperty.call(e,"baseVersion")&&t.uint32(16).uint32(e.baseVersion),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(26).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(34).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)je.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(50).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(58).string(e.lastOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingUpdateMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.baseVersion=e.uint32();break;case 3:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 4:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 6:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(je.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:r.lastOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id))return"id: string expected";if(null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&!Ee.isInteger(e.baseVersion))return"baseVersion: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ee.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ee.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=je.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ee.isString(e.lastOperationId)?"lastOperationId: string expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingUpdateMessage)return e;let t=new je.CollaborativeEditingUpdateMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.baseVersion&&(t.baseVersion=e.baseVersion>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingUpdateMessage.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ee.base64.decode(e.buffers[n],t.buffers[n]=Ee.newBuffer(Ee.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");t.metadata[n]=je.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.id="",n.baseVersion=0,n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&(n.baseVersion=e.baseVersion),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ee.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=je.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingUpdateMessage"},e})(),je.GetDocumentDetailsMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.environmentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.environmentId&&Object.hasOwnProperty.call(e,"environmentId")&&t.uint32(18).string(e.environmentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetDocumentDetailsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.environmentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.environmentId&&e.hasOwnProperty("environmentId")&&!Ee.isString(e.environmentId)?"environmentId: string expected":null},e.fromObject=function(e){if(e instanceof je.GetDocumentDetailsMessage)return e;let t=new je.GetDocumentDetailsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.environmentId&&(t.environmentId=String(e.environmentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.environmentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.environmentId&&e.hasOwnProperty("environmentId")&&(n.environmentId=e.environmentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsMessage"},e})(),je.CollaborativeEditingConnectResponse=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.offset=0,e.prototype.version=0,e.prototype.buffers=Ee.emptyArray,e.prototype.types=Ee.emptyArray,e.prototype.metadata=Ee.emptyArray,e.prototype.initData="",e.prototype.isInitialized=!1,e.prototype.sessionId="",e.prototype.lastOperationId="",e.prototype.sessionCreatedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&t.uint32(16).uint32(e.offset),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(24).uint32(e.version),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(34).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(42).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)je.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(58).fork()).ldelim();return null!=e.initData&&Object.hasOwnProperty.call(e,"initData")&&t.uint32(66).string(e.initData),null!=e.isInitialized&&Object.hasOwnProperty.call(e,"isInitialized")&&t.uint32(72).bool(e.isInitialized),null!=e.sessionId&&Object.hasOwnProperty.call(e,"sessionId")&&t.uint32(82).string(e.sessionId),null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(90).string(e.lastOperationId),null!=e.sessionCreatedAt&&Object.hasOwnProperty.call(e,"sessionCreatedAt")&&t.uint32(98).string(e.sessionCreatedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.offset=e.uint32();break;case 3:r.version=e.uint32();break;case 4:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 5:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 7:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(je.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:r.initData=e.string();break;case 9:r.isInitialized=e.bool();break;case 10:r.sessionId=e.string();break;case 11:r.lastOperationId=e.string();break;case 12:r.sessionCreatedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.offset&&e.hasOwnProperty("offset")&&!Ee.isInteger(e.offset))return"offset: integer expected";if(null!=e.version&&e.hasOwnProperty("version")&&!Ee.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ee.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ee.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=je.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.initData&&e.hasOwnProperty("initData")&&!Ee.isString(e.initData)?"initData: string expected":null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&"boolean"!=typeof e.isInitialized?"isInitialized: boolean expected":null!=e.sessionId&&e.hasOwnProperty("sessionId")&&!Ee.isString(e.sessionId)?"sessionId: string expected":null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ee.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&!Ee.isString(e.sessionCreatedAt)?"sessionCreatedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingConnectResponse)return e;let t=new je.CollaborativeEditingConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.offset&&(t.offset=e.offset>>>0),null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectResponse.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ee.base64.decode(e.buffers[n],t.buffers[n]=Ee.newBuffer(Ee.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");t.metadata[n]=je.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.initData&&(t.initData=String(e.initData)),null!=e.isInitialized&&(t.isInitialized=Boolean(e.isInitialized)),null!=e.sessionId&&(t.sessionId=String(e.sessionId)),null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.sessionCreatedAt&&(t.sessionCreatedAt=String(e.sessionCreatedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.channel="",n.offset=0,n.version=0,n.initData="",n.isInitialized=!1,n.sessionId="",n.lastOperationId="",n.sessionCreatedAt=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.offset&&e.hasOwnProperty("offset")&&(n.offset=e.offset),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ee.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=je.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.initData&&e.hasOwnProperty("initData")&&(n.initData=e.initData),null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&(n.isInitialized=e.isInitialized),null!=e.sessionId&&e.hasOwnProperty("sessionId")&&(n.sessionId=e.sessionId),null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&(n.sessionCreatedAt=e.sessionCreatedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectResponse"},e})(),je.CollaborativeEditingResponse=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.version=0,e.prototype.buffers=Ee.emptyArray,e.prototype.types=Ee.emptyArray,e.prototype.metadata=Ee.emptyArray,e.prototype.lastOperationId="",e.prototype.lastOperationAcceptedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(8).uint32(e.version),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(18).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(26).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)je.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(42).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(50).string(e.lastOperationId),null!=e.lastOperationAcceptedAt&&Object.hasOwnProperty.call(e,"lastOperationAcceptedAt")&&t.uint32(58).string(e.lastOperationAcceptedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.version=e.uint32();break;case 2:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 3:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 5:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(je.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:r.lastOperationId=e.string();break;case 7:r.lastOperationAcceptedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.version&&e.hasOwnProperty("version")&&!Ee.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ee.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ee.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=je.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ee.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&!Ee.isString(e.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingResponse)return e;let t=new je.CollaborativeEditingResponse;if(null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingResponse.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ee.base64.decode(e.buffers[n],t.buffers[n]=Ee.newBuffer(Ee.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");t.metadata[n]=je.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.lastOperationAcceptedAt&&(t.lastOperationAcceptedAt=String(e.lastOperationAcceptedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.version=0,n.lastOperationId="",n.lastOperationAcceptedAt=""),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ee.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=je.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&(n.lastOperationAcceptedAt=e.lastOperationAcceptedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingResponse"},e})(),je.GetDocumentDetailsResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.lastDocumentSessionId="",e.prototype.lastDocumentSessionOperationId="",e.prototype.currentDocumentSessionId="",e.prototype.currentDocumentSessionVersion=0,e.prototype.currentDocumentSessionOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.lastDocumentSessionId&&Object.hasOwnProperty.call(e,"lastDocumentSessionId")&&t.uint32(10).string(e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"lastDocumentSessionOperationId")&&t.uint32(18).string(e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&Object.hasOwnProperty.call(e,"currentDocumentSessionId")&&t.uint32(26).string(e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&Object.hasOwnProperty.call(e,"currentDocumentSessionVersion")&&t.uint32(32).uint32(e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"currentDocumentSessionOperationId")&&t.uint32(42).string(e.currentDocumentSessionOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetDocumentDetailsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.lastDocumentSessionId=e.string();break;case 2:r.lastDocumentSessionOperationId=e.string();break;case 3:r.currentDocumentSessionId=e.string();break;case 4:r.currentDocumentSessionVersion=e.uint32();break;case 5:r.currentDocumentSessionOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&!Ee.isString(e.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&!Ee.isString(e.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&!Ee.isString(e.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&!Ee.isInteger(e.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&!Ee.isString(e.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},e.fromObject=function(e){if(e instanceof je.GetDocumentDetailsResponse)return e;let t=new je.GetDocumentDetailsResponse;return null!=e.lastDocumentSessionId&&(t.lastDocumentSessionId=String(e.lastDocumentSessionId)),null!=e.lastDocumentSessionOperationId&&(t.lastDocumentSessionOperationId=String(e.lastDocumentSessionOperationId)),null!=e.currentDocumentSessionId&&(t.currentDocumentSessionId=String(e.currentDocumentSessionId)),null!=e.currentDocumentSessionVersion&&(t.currentDocumentSessionVersion=e.currentDocumentSessionVersion>>>0),null!=e.currentDocumentSessionOperationId&&(t.currentDocumentSessionOperationId=String(e.currentDocumentSessionOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.lastDocumentSessionId="",n.lastDocumentSessionOperationId="",n.currentDocumentSessionId="",n.currentDocumentSessionVersion=0,n.currentDocumentSessionOperationId=""),null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&(n.lastDocumentSessionId=e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&(n.lastDocumentSessionOperationId=e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&(n.currentDocumentSessionId=e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&(n.currentDocumentSessionVersion=e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&(n.currentDocumentSessionOperationId=e.currentDocumentSessionOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsResponse"},e})(),je.CommentDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentId="",e.prototype.commentThreadId="",e.prototype.userId="",e.prototype.content="",e.prototype.documentId="",e.prototype.createdAt="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(26).string(e.userId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(34).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(42).string(e.documentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentId=e.string();break;case 2:r.commentThreadId=e.string();break;case 3:r.userId=e.string();break;case 4:r.content=e.string();break;case 5:r.documentId=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId)?"commentId: string expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!Ee.isString(e.userId)?"userId: string expected":null!=e.content&&e.hasOwnProperty("content")&&!Ee.isString(e.content)?"content: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentDescriptor)return e;let t=new je.CommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentId="",n.commentThreadId="",n.userId="",n.content="",n.documentId="",n.createdAt="",n.attributes=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentDescriptor"},e})(),je.CommentsThreadDescriptor=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.comments=Ee.emptyArray,e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.context="",e.prototype.createdAt="",e.prototype.deletedAt="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)je.CommentDescriptor.encode(e.comments[n],t.uint32(18).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(42).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(58).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(74).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsThreadDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(je.CommentDescriptor.decode(e,e.uint32()));break;case 3:r.resolvedAt=e.string();break;case 4:r.resolvedBy=e.string();break;case 5:r.context=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.deletedAt=e.string();break;case 8:r.attributes=e.string();break;case 9:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=je.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!Ee.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!Ee.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!Ee.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsThreadDescriptor)return e;let t=new je.CommentsThreadDescriptor;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsThreadDescriptor.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");t.comments[n]=je.CommentDescriptor.fromObject(e.comments[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=je.CommentDescriptor.toObject(e.comments[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsThreadDescriptor"},e})(),je.CommentThreadAddedCommentDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentId="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentThreadAddedCommentDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentId=e.string();break;case 2:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentThreadAddedCommentDescriptor)return e;let t=new je.CommentThreadAddedCommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentId="",n.createdAt=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentThreadAddedCommentDescriptor"},e})(),je.CommentsV2AddCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.content="",e.prototype.documentId="",e.prototype.commentId="",e.prototype.createdAt="",e.prototype.userId="",e.prototype.attributes="",e.prototype.commentThread=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(34).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(42).string(e.createdAt),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(50).string(e.userId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&je.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(66).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2AddCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.content=e.string();break;case 3:r.documentId=e.string();break;case 4:r.commentId=e.string();break;case 5:r.createdAt=e.string();break;case 6:r.userId=e.string();break;case 7:r.attributes=e.string();break;case 8:r.commentThread=je.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!Ee.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId))return"documentId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId))return"commentId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt))return"createdAt: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!Ee.isString(e.userId))return"userId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes))return"attributes: string expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){let t=je.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2AddCommentMessage)return e;let t=new je.CommentsV2AddCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2AddCommentMessage.commentThread: object expected");t.commentThread=je.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.content="",n.documentId="",n.commentId="",n.createdAt="",n.userId="",n.attributes="",n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=je.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentMessage"},e})(),je.CommentsV2AddCommentThreadMessage=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.commentThreadId="",e.prototype.context="",e.prototype.createdAt="",e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.attributes="",e.prototype.deletedAt="",e.prototype.comments=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(42).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(50).string(e.resolvedBy),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)je.CommentDescriptor.encode(e.comments[n],t.uint32(74).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2AddCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.commentThreadId=e.string();break;case 3:r.context=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.resolvedAt=e.string();break;case 6:r.resolvedBy=e.string();break;case 7:r.attributes=e.string();break;case 8:r.deletedAt=e.string();break;case 9:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(je.CommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId))return"documentId: string expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.context&&e.hasOwnProperty("context")&&!Ee.isString(e.context))return"context: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt))return"createdAt: string expected";if(null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt))return"resolvedAt: string expected";if(null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy))return"resolvedBy: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes))return"attributes: string expected";if(null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!Ee.isString(e.deletedAt))return"deletedAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=je.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2AddCommentThreadMessage)return e;let t=new je.CommentsV2AddCommentThreadMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadMessage.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");t.comments[n]=je.CommentDescriptor.fromObject(e.comments[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.documentId="",n.commentThreadId="",n.context="",n.createdAt="",n.resolvedAt="",n.resolvedBy="",n.attributes="",n.deletedAt=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=je.CommentDescriptor.toObject(e.comments[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadMessage"},e})(),je.CommentsV2ReopenCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ReopenCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2ReopenCommentThreadMessage)return e;let t=new je.CommentsV2ReopenCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ReopenCommentThreadMessage"},e})(),je.CommentsV2ResolveCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.resolvedBy="",e.prototype.resolvedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(26).string(e.resolvedBy),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ResolveCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.resolvedBy=e.string();break;case 4:r.resolvedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt)?"resolvedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2ResolveCommentThreadMessage)return e;let t=new je.CommentsV2ResolveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedBy="",n.resolvedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadMessage"},e})(),je.CommentsV2UpdateCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.context="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(34).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(42).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2UpdateCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.context=e.string();break;case 4:r.attributes=e.string();break;case 5:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.context&&e.hasOwnProperty("context")&&!Ee.isString(e.context)?"context: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!Ee.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2UpdateCommentThreadMessage)return e;let t=new je.CommentsV2UpdateCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.context&&(t.context=String(e.context)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.context="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentThreadMessage"},e})(),je.CommentsV2ConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2ConnectMessage)return e;let t=new je.CommentsV2ConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectMessage"},e})(),je.CommentsV2GetCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2GetCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2GetCommentThreadMessage)return e;let t=new je.CommentsV2GetCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadMessage"},e})(),je.CommentsV2GetDocumentThreadsMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2GetDocumentThreadsMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2GetDocumentThreadsMessage)return e;let t=new je.CommentsV2GetDocumentThreadsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsMessage"},e})(),je.CommentsV2RemoveCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2RemoveCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId)?"commentId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2RemoveCommentMessage)return e;let t=new je.CommentsV2RemoveCommentMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentMessage"},e})(),je.CommentsV2RemoveCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2RemoveCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2RemoveCommentThreadMessage)return e;let t=new je.CommentsV2RemoveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentThreadMessage"},e})(),je.CommentsV2UpdateCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.content="",e.prototype.documentId="",e.prototype.attributes="",e.prototype.isAttributesUpdated=!1,e.prototype.commentThread=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(26).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(34).string(e.documentId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(42).string(e.attributes),null!=e.isAttributesUpdated&&Object.hasOwnProperty.call(e,"isAttributesUpdated")&&t.uint32(48).bool(e.isAttributesUpdated),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&je.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(58).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2UpdateCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.content=e.string();break;case 4:r.documentId=e.string();break;case 5:r.attributes=e.string();break;case 6:r.isAttributesUpdated=e.bool();break;case 7:r.commentThread=je.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId))return"commentId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!Ee.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId))return"documentId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes))return"attributes: string expected";if(null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&"boolean"!=typeof e.isAttributesUpdated)return"isAttributesUpdated: boolean expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){let t=je.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2UpdateCommentMessage)return e;let t=new je.CommentsV2UpdateCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.isAttributesUpdated&&(t.isAttributesUpdated=Boolean(e.isAttributesUpdated)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2UpdateCommentMessage.commentThread: object expected");t.commentThread=je.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.content="",n.documentId="",n.attributes="",n.isAttributesUpdated=!1,n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&(n.isAttributesUpdated=e.isAttributesUpdated),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=je.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentMessage"},e})(),je.CommentsV2AddCommentResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2AddCommentResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2AddCommentResponse)return e;let t=new je.CommentsV2AddCommentResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentResponse"},e})(),je.CommentsV2AddCommentThreadResponse=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.createdAt="",e.prototype.comments=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)je.CommentThreadAddedCommentDescriptor.encode(e.comments[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2AddCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.createdAt=e.string();break;case 3:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(je.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt))return"createdAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=je.CommentThreadAddedCommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2AddCommentThreadResponse)return e;let t=new je.CommentsV2AddCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadResponse.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");t.comments[n]=je.CommentThreadAddedCommentDescriptor.fromObject(e.comments[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=je.CommentThreadAddedCommentDescriptor.toObject(e.comments[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadResponse"},e})(),je.CommentsV2ResolveCommentThreadResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ResolveCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.resolvedAt=e.string();break;case 4:r.resolvedBy=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy)?"resolvedBy: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2ResolveCommentThreadResponse)return e;let t=new je.CommentsV2ResolveCommentThreadResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedAt="",n.resolvedBy=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadResponse"},e})(),je.CommentsV2ConnectResponse=(()=>{function e(e){if(this.threads=[],this.threadsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.threads=Ee.emptyArray,e.prototype.threadsV2=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.threads&&e.threads.length)for(let n=0;n<e.threads.length;++n)t.uint32(18).string(e.threads[n]);if(null!=e.threadsV2&&e.threadsV2.length)for(let n=0;n<e.threadsV2.length;++n)je.CommentsThreadDescriptor.encode(e.threadsV2[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.threads&&r.threads.length||(r.threads=[]),r.threads.push(e.string());break;case 3:r.threadsV2&&r.threadsV2.length||(r.threadsV2=[]),r.threadsV2.push(je.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(let t=0;t<e.threads.length;++t)if(!Ee.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(let t=0;t<e.threadsV2.length;++t){let n=je.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2ConnectResponse)return e;let t=new je.CommentsV2ConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2ConnectResponse.threads: array expected");t.threads=[];for(let n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2ConnectResponse.threadsV2: array expected");t.threadsV2=[];for(let n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");t.threadsV2[n]=je.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.threads&&e.threads.length){n.threads=[];for(let t=0;t<e.threads.length;++t)n.threads[t]=e.threads[t]}if(e.threadsV2&&e.threadsV2.length){n.threadsV2=[];for(let r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=je.CommentsThreadDescriptor.toObject(e.threadsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectResponse"},e})(),je.CommentsV2GetCommentThreadResponse=(()=>{function e(e){if(this.comments=[],this.commentsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.comments=Ee.emptyArray,e.prototype.commentsV2=Ee.emptyArray,e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.context="",e.prototype.createdAt="",e.prototype.deletedAt="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)t.uint32(18).string(e.comments[n]);if(null!=e.commentsV2&&e.commentsV2.length)for(let n=0;n<e.commentsV2.length;++n)je.CommentDescriptor.encode(e.commentsV2[n],t.uint32(26).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(42).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(50).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(58).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(74).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(82).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2GetCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(e.string());break;case 3:r.commentsV2&&r.commentsV2.length||(r.commentsV2=[]),r.commentsV2.push(je.CommentDescriptor.decode(e,e.uint32()));break;case 4:r.resolvedAt=e.string();break;case 5:r.resolvedBy=e.string();break;case 6:r.context=e.string();break;case 7:r.createdAt=e.string();break;case 8:r.deletedAt=e.string();break;case 9:r.attributes=e.string();break;case 10:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t)if(!Ee.isString(e.comments[t]))return"comments: string[] expected"}if(null!=e.commentsV2&&e.hasOwnProperty("commentsV2")){if(!Array.isArray(e.commentsV2))return"commentsV2: array expected";for(let t=0;t<e.commentsV2.length;++t){let n=je.CommentDescriptor.verify(e.commentsV2[t]);if(n)return"commentsV2."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!Ee.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!Ee.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!Ee.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2GetCommentThreadResponse)return e;let t=new je.CommentsV2GetCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2GetCommentThreadResponse.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n)t.comments[n]=String(e.comments[n])}if(e.commentsV2){if(!Array.isArray(e.commentsV2))throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: array expected");t.commentsV2=[];for(let n=0;n<e.commentsV2.length;++n){if("object"!=typeof e.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");t.commentsV2[n]=je.CommentDescriptor.fromObject(e.commentsV2[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[],n.commentsV2=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(let t=0;t<e.comments.length;++t)n.comments[t]=e.comments[t]}if(e.commentsV2&&e.commentsV2.length){n.commentsV2=[];for(let r=0;r<e.commentsV2.length;++r)n.commentsV2[r]=je.CommentDescriptor.toObject(e.commentsV2[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadResponse"},e})(),je.CommentsV2GetDocumentThreadsResponse=(()=>{function e(e){if(this.threads=[],this.threadsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.threads=Ee.emptyArray,e.prototype.threadsV2=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.threads&&e.threads.length)for(let n=0;n<e.threads.length;++n)t.uint32(10).string(e.threads[n]);if(null!=e.threadsV2&&e.threadsV2.length)for(let n=0;n<e.threadsV2.length;++n)je.CommentsThreadDescriptor.encode(e.threadsV2[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2GetDocumentThreadsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.threads&&r.threads.length||(r.threads=[]),r.threads.push(e.string());break;case 2:r.threadsV2&&r.threadsV2.length||(r.threadsV2=[]),r.threadsV2.push(je.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(let t=0;t<e.threads.length;++t)if(!Ee.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(let t=0;t<e.threadsV2.length;++t){let n=je.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2GetDocumentThreadsResponse)return e;let t=new je.CommentsV2GetDocumentThreadsResponse;if(e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");t.threads=[];for(let n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: array expected");t.threadsV2=[];for(let n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");t.threadsV2[n]=je.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),e.threads&&e.threads.length){n.threads=[];for(let t=0;t<e.threads.length;++t)n.threads[t]=e.threads[t]}if(e.threadsV2&&e.threadsV2.length){n.threadsV2=[];for(let r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=je.CommentsThreadDescriptor.toObject(e.threadsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsResponse"},e})(),je.KeyValueDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.KeyValueDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!Ee.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!Ee.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof je.KeyValueDescriptor)return e;let t=new je.KeyValueDescriptor;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/KeyValueDescriptor"},e})(),je.IsEditorBundleUploadedMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.bundleVersion="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(10).string(e.bundleVersion),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.IsEditorBundleUploadedMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.bundleVersion=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!Ee.isString(e.bundleVersion)?"bundleVersion: string expected":null},e.fromObject=function(e){if(e instanceof je.IsEditorBundleUploadedMessage)return e;let t=new je.IsEditorBundleUploadedMessage;return null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.bundleVersion=""),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedMessage"},e})(),je.IsEditorBundleUploadedResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.isUploaded=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.isUploaded&&Object.hasOwnProperty.call(e,"isUploaded")&&t.uint32(8).bool(e.isUploaded),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.IsEditorBundleUploadedResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.isUploaded=e.bool():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&"boolean"!=typeof e.isUploaded?"isUploaded: boolean expected":null},e.fromObject=function(e){if(e instanceof je.IsEditorBundleUploadedResponse)return e;let t=new je.IsEditorBundleUploadedResponse;return null!=e.isUploaded&&(t.isUploaded=Boolean(e.isUploaded)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.isUploaded=!1),null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&(n.isUploaded=e.isUploaded),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedResponse"},e})(),je.RevisionDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.revisionId="",e.prototype.name="",e.prototype.creatorId="",e.prototype.authorsIds="",e.prototype.diffData="",e.prototype.createdAt="",e.prototype.attributes="",e.prototype.toVersion=0,e.prototype.fromVersion=0,e.prototype.isEmptyCurrent=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.revisionId=e.string();break;case 2:r.name=e.string();break;case 3:r.creatorId=e.string();break;case 4:r.authorsIds=e.string();break;case 5:r.diffData=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;case 8:r.toVersion=e.uint32();break;case 9:r.fromVersion=e.uint32();break;case 10:r.isEmptyCurrent=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!Ee.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!Ee.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!Ee.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!Ee.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!Ee.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!Ee.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!Ee.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},e.fromObject=function(e){if(e instanceof je.RevisionDescriptor)return e;let t=new je.RevisionDescriptor;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionDescriptor"},e})(),je.RevisionHistoryConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryConnectMessage)return e;let t=new je.RevisionHistoryConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectMessage"},e})(),je.RevisionHistoryGetRevisionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.revisionId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(18).string(e.revisionId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryGetRevisionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.revisionId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!Ee.isString(e.revisionId)?"revisionId: string expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryGetRevisionMessage)return e;let t=new je.RevisionHistoryGetRevisionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.revisionId&&(t.revisionId=String(e.revisionId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.revisionId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionMessage"},e})(),je.RevisionHistoryReconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.requestId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryReconnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.requestId=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ee.isInteger(e.requestId)?"requestId: integer expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryReconnectMessage)return e;let t=new je.RevisionHistoryReconnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryReconnectMessage"},e})(),je.RevisionHistoryUpdateRevisionsMessage=(()=>{function e(e){if(this.revisions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.requestId=0,e.prototype.revisions=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(let n=0;n<e.revisions.length;++n)je.RevisionDescriptor.encode(e.revisions[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryUpdateRevisionsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.requestId=e.uint32();break;case 3:r.revisions&&r.revisions.length||(r.revisions=[]),r.revisions.push(je.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId))return"documentId: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ee.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(let t=0;t<e.revisions.length;++t){let n=je.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryUpdateRevisionsMessage)return e;let t=new je.RevisionHistoryUpdateRevisionsMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: array expected");t.revisions=[];for(let n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");t.revisions[n]=je.RevisionDescriptor.fromObject(e.revisions[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(let r=0;r<e.revisions.length;++r)n.revisions[r]=je.RevisionDescriptor.toObject(e.revisions[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsMessage"},e})(),je.RevisionHistoryConnectResponse=(()=>{function e(e){if(this.revisions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.requestId=0,e.prototype.revisions=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(let n=0;n<e.revisions.length;++n)je.RevisionDescriptor.encode(e.revisions[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.requestId=e.uint32();break;case 3:r.revisions&&r.revisions.length||(r.revisions=[]),r.revisions.push(je.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ee.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(let t=0;t<e.revisions.length;++t){let n=je.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryConnectResponse)return e;let t=new je.RevisionHistoryConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryConnectResponse.revisions: array expected");t.revisions=[];for(let n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");t.revisions[n]=je.RevisionDescriptor.fromObject(e.revisions[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.channel="",n.requestId=0),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(let r=0;r<e.revisions.length;++r)n.revisions[r]=je.RevisionDescriptor.toObject(e.revisions[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectResponse"},e})(),je.RevisionHistoryGetRevisionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.revisionId="",e.prototype.name="",e.prototype.creatorId="",e.prototype.authorsIds="",e.prototype.diffData="",e.prototype.createdAt="",e.prototype.attributes="",e.prototype.toVersion=0,e.prototype.fromVersion=0,e.prototype.isEmptyCurrent=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryGetRevisionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.revisionId=e.string();break;case 2:r.name=e.string();break;case 3:r.creatorId=e.string();break;case 4:r.authorsIds=e.string();break;case 5:r.diffData=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;case 8:r.toVersion=e.uint32();break;case 9:r.fromVersion=e.uint32();break;case 10:r.isEmptyCurrent=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!Ee.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!Ee.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!Ee.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!Ee.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!Ee.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!Ee.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!Ee.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryGetRevisionResponse)return e;let t=new je.RevisionHistoryGetRevisionResponse;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionResponse"},e})(),je.RevisionHistoryUpdateRevisionsResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.requestId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(8).uint32(e.requestId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryUpdateRevisionsResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.requestId=e.uint32():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ee.isInteger(e.requestId)?"requestId: integer expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryUpdateRevisionsResponse)return e;let t=new je.RevisionHistoryUpdateRevisionsResponse;return null!=e.requestId&&(t.requestId=e.requestId>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.requestId=0),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsResponse"},e})(),je.SessionsSocketDescriptor=(()=>{function e(e){if(this.permissions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.session="",e.prototype.user="",e.prototype.role="",e.prototype.permissions=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.session&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(18).string(e.user),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(let n=0;n<e.permissions.length;++n)t.uint32(34).string(e.permissions[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SessionsSocketDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.session=e.string();break;case 2:r.user=e.string();break;case 3:r.role=e.string();break;case 4:r.permissions&&r.permissions.length||(r.permissions=[]),r.permissions.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.session&&e.hasOwnProperty("session")&&!Ee.isString(e.session))return"session: string expected";if(null!=e.user&&e.hasOwnProperty("user")&&!Ee.isString(e.user))return"user: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!Ee.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(let t=0;t<e.permissions.length;++t)if(!Ee.isString(e.permissions[t]))return"permissions: string[] expected"}return null},e.fromObject=function(e){if(e instanceof je.SessionsSocketDescriptor)return e;let t=new je.SessionsSocketDescriptor;if(null!=e.session&&(t.session=String(e.session)),null!=e.user&&(t.user=String(e.user)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SessionsSocketDescriptor.permissions: array expected");t.permissions=[];for(let n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.session="",n.user="",n.role=""),null!=e.session&&e.hasOwnProperty("session")&&(n.session=e.session),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(let t=0;t<e.permissions.length;++t)n.permissions[t]=e.permissions[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsSocketDescriptor"},e})(),je.SessionsConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.sessionType=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.sessionType&&Object.hasOwnProperty.call(e,"sessionType")&&t.uint32(16).uint32(e.sessionType),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SessionsConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.sessionType=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.sessionType&&e.hasOwnProperty("sessionType")&&!Ee.isInteger(e.sessionType)?"sessionType: integer expected":null},e.fromObject=function(e){if(e instanceof je.SessionsConnectMessage)return e;let t=new je.SessionsConnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.sessionType&&(t.sessionType=e.sessionType>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.sessionType=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.sessionType&&e.hasOwnProperty("sessionType")&&(n.sessionType=e.sessionType),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectMessage"},e})(),je.SocketConnectMessage=(()=>{function e(e){if(this.permissions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.userId="",e.prototype.role="",e.prototype.permissions=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(let n=0;n<e.permissions.length;++n)t.uint32(34).string(e.permissions[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SocketConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.userId=e.string();break;case 3:r.role=e.string();break;case 4:r.permissions&&r.permissions.length||(r.permissions=[]),r.permissions.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id))return"id: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!Ee.isString(e.userId))return"userId: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!Ee.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(let t=0;t<e.permissions.length;++t)if(!Ee.isString(e.permissions[t]))return"permissions: string[] expected"}return null},e.fromObject=function(e){if(e instanceof je.SocketConnectMessage)return e;let t=new je.SocketConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SocketConnectMessage.permissions: array expected");t.permissions=[];for(let n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.id="",n.userId="",n.role=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(let t=0;t<e.permissions.length;++t)n.permissions[t]=e.permissions[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketConnectMessage"},e})(),je.SocketDisconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SocketDisconnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.id=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null},e.fromObject=function(e){if(e instanceof je.SocketDisconnectMessage)return e;let t=new je.SocketDisconnectMessage;return null!=e.id&&(t.id=String(e.id)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketDisconnectMessage"},e})(),je.SessionsConnectResponse=(()=>{function e(e){if(this.sockets=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.sockets=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.sockets&&e.sockets.length)for(let n=0;n<e.sockets.length;++n)je.SessionsSocketDescriptor.encode(e.sockets[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SessionsConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.sockets&&r.sockets.length||(r.sockets=[]),r.sockets.push(je.SessionsSocketDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.sockets&&e.hasOwnProperty("sockets")){if(!Array.isArray(e.sockets))return"sockets: array expected";for(let t=0;t<e.sockets.length;++t){let n=je.SessionsSocketDescriptor.verify(e.sockets[t]);if(n)return"sockets."+n}}return null},e.fromObject=function(e){if(e instanceof je.SessionsConnectResponse)return e;let t=new je.SessionsConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.sockets){if(!Array.isArray(e.sockets))throw TypeError(".SessionsConnectResponse.sockets: array expected");t.sockets=[];for(let n=0;n<e.sockets.length;++n){if("object"!=typeof e.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");t.sockets[n]=je.SessionsSocketDescriptor.fromObject(e.sockets[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.sockets=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.sockets&&e.sockets.length){n.sockets=[];for(let r=0;r<e.sockets.length;++r)n.sockets[r]=je.SessionsSocketDescriptor.toObject(e.sockets[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectResponse"},e})(),je.SuggestionDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SuggestionDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!Ee.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.SuggestionDescriptor)return e;let t=new je.SuggestionDescriptor;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SuggestionDescriptor"},e})(),je.TrackChangesAddSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.prototype.type="",e.prototype.data="",e.prototype.originalSuggestionId="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).string(e.data),null!=e.originalSuggestionId&&Object.hasOwnProperty.call(e,"originalSuggestionId")&&t.uint32(42).string(e.originalSuggestionId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesAddSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;case 3:r.type=e.string();break;case 4:r.data=e.string();break;case 5:r.originalSuggestionId=e.string();break;case 6:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&!Ee.isString(e.originalSuggestionId)?"originalSuggestionId: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesAddSuggestionMessage)return e;let t=new je.TrackChangesAddSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.type&&(t.type=String(e.type)),null!=e.data&&(t.data=String(e.data)),null!=e.originalSuggestionId&&(t.originalSuggestionId=String(e.originalSuggestionId)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId="",n.type="",n.data="",n.originalSuggestionId="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&(n.originalSuggestionId=e.originalSuggestionId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionMessage"},e})(),je.TrackChangesBatchUpdateSuggestionsStateMessage=(()=>{function e(e){if(this.ids=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ids=Ee.emptyArray,e.prototype.documentId="",e.prototype.state="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.ids&&e.ids.length)for(let n=0;n<e.ids.length;++n)t.uint32(10).string(e.ids[n]);return null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(26).string(e.state),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesBatchUpdateSuggestionsStateMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.ids&&r.ids.length||(r.ids=[]),r.ids.push(e.string());break;case 2:r.documentId=e.string();break;case 3:r.state=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(let t=0;t<e.ids.length;++t)if(!Ee.isString(e.ids[t]))return"ids: string[] expected"}return null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesBatchUpdateSuggestionsStateMessage)return e;let t=new je.TrackChangesBatchUpdateSuggestionsStateMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");t.ids=[];for(let n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.state&&(t.state=String(e.state)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.documentId="",n.state=""),e.ids&&e.ids.length){n.ids=[];for(let t=0;t<e.ids.length;++t)n.ids[t]=e.ids[t]}return null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesBatchUpdateSuggestionsStateMessage"},e})(),je.TrackChangesConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesConnectMessage)return e;let t=new je.TrackChangesConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectMessage"},e})(),je.TrackChangesGetAllSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesGetAllSuggestionMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesGetAllSuggestionMessage)return e;let t=new je.TrackChangesGetAllSuggestionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionMessage"},e})(),je.TrackChangesGetSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesGetSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesGetSuggestionMessage)return e;let t=new je.TrackChangesGetSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionMessage"},e})(),je.TrackChangesUpdateSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.prototype.hasComments=!1,e.prototype.isHasCommentsModified=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(24).bool(e.hasComments),null!=e.isHasCommentsModified&&Object.hasOwnProperty.call(e,"isHasCommentsModified")&&t.uint32(32).bool(e.isHasCommentsModified),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(42).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesUpdateSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;case 3:r.hasComments=e.bool();break;case 4:r.isHasCommentsModified=e.bool();break;case 5:r.state=e.string();break;case 6:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&"boolean"!=typeof e.isHasCommentsModified?"isHasCommentsModified: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesUpdateSuggestionMessage)return e;let t=new je.TrackChangesUpdateSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.isHasCommentsModified&&(t.isHasCommentsModified=Boolean(e.isHasCommentsModified)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId="",n.hasComments=!1,n.isHasCommentsModified=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&(n.isHasCommentsModified=e.isHasCommentsModified),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesUpdateSuggestionMessage"},e})(),je.TrackChangesAddSuggestionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesAddSuggestionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!Ee.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesAddSuggestionResponse)return e;let t=new je.TrackChangesAddSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionResponse"},e})(),je.TrackChangesConnectResponse=(()=>{function e(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.suggestions=Ee.emptyArray,e.prototype.suggestionsV2=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.suggestions&&e.suggestions.length)for(let n=0;n<e.suggestions.length;++n)t.uint32(18).string(e.suggestions[n]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(let n=0;n<e.suggestionsV2.length;++n)je.SuggestionDescriptor.encode(e.suggestionsV2[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(e.string());break;case 3:r.suggestionsV2&&r.suggestionsV2.length||(r.suggestionsV2=[]),r.suggestionsV2.push(je.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(let t=0;t<e.suggestions.length;++t)if(!Ee.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(let t=0;t<e.suggestionsV2.length;++t){let n=je.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},e.fromObject=function(e){if(e instanceof je.TrackChangesConnectResponse)return e;let t=new je.TrackChangesConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesConnectResponse.suggestions: array expected");t.suggestions=[];for(let n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesConnectResponse.suggestionsV2: array expected");t.suggestionsV2=[];for(let n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");t.suggestionsV2[n]=je.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.suggestions&&e.suggestions.length){n.suggestions=[];for(let t=0;t<e.suggestions.length;++t)n.suggestions[t]=e.suggestions[t]}if(e.suggestionsV2&&e.suggestionsV2.length){n.suggestionsV2=[];for(let r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=je.SuggestionDescriptor.toObject(e.suggestionsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectResponse"},e})(),je.TrackChangesGetAllSuggestionsResponse=(()=>{function e(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.suggestions=Ee.emptyArray,e.prototype.suggestionsV2=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.suggestions&&e.suggestions.length)for(let n=0;n<e.suggestions.length;++n)t.uint32(10).string(e.suggestions[n]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(let n=0;n<e.suggestionsV2.length;++n)je.SuggestionDescriptor.encode(e.suggestionsV2[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesGetAllSuggestionsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(e.string());break;case 2:r.suggestionsV2&&r.suggestionsV2.length||(r.suggestionsV2=[]),r.suggestionsV2.push(je.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(let t=0;t<e.suggestions.length;++t)if(!Ee.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(let t=0;t<e.suggestionsV2.length;++t){let n=je.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},e.fromObject=function(e){if(e instanceof je.TrackChangesGetAllSuggestionsResponse)return e;let t=new je.TrackChangesGetAllSuggestionsResponse;if(e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");t.suggestions=[];for(let n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: array expected");t.suggestionsV2=[];for(let n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");t.suggestionsV2[n]=je.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.suggestions&&e.suggestions.length){n.suggestions=[];for(let t=0;t<e.suggestions.length;++t)n.suggestions[t]=e.suggestions[t]}if(e.suggestionsV2&&e.suggestionsV2.length){n.suggestionsV2=[];for(let r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=je.SuggestionDescriptor.toObject(e.suggestionsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionsResponse"},e})(),je.TrackChangesGetSuggestionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesGetSuggestionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!Ee.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesGetSuggestionResponse)return e;let t=new je.TrackChangesGetSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionResponse"},e})(),je.UserDescriptor=(()=>{function e(e){if(this.attributes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.attributes=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.attributes&&e.attributes.length)for(let n=0;n<e.attributes.length;++n)je.KeyValueDescriptor.encode(e.attributes[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.UserDescriptor;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(je.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(let t=0;t<e.attributes.length;++t){let n=je.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},e.fromObject=function(e){if(e instanceof je.UserDescriptor)return e;let t=new je.UserDescriptor;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".UserDescriptor.attributes: array expected");t.attributes=[];for(let n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");t.attributes[n]=je.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(let r=0;r<e.attributes.length;++r)n.attributes[r]=je.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserDescriptor"},e})(),je.GetManyUsersMessage=(()=>{function e(e){if(this.ids=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ids=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.ids&&e.ids.length)for(let n=0;n<e.ids.length;++n)t.uint32(10).string(e.ids[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetManyUsersMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.ids&&r.ids.length||(r.ids=[]),r.ids.push(e.string())):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(let t=0;t<e.ids.length;++t)if(!Ee.isString(e.ids[t]))return"ids: string[] expected"}return null},e.fromObject=function(e){if(e instanceof je.GetManyUsersMessage)return e;let t=new je.GetManyUsersMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");t.ids=[];for(let n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.ids=[]),e.ids&&e.ids.length){n.ids=[];for(let t=0;t<e.ids.length;++t)n.ids[t]=e.ids[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersMessage"},e})(),je.GetUserMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetUserMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.id=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null},e.fromObject=function(e){if(e instanceof je.GetUserMessage)return e;let t=new je.GetUserMessage;return null!=e.id&&(t.id=String(e.id)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserMessage"},e})(),je.GetManyUsersResponse=(()=>{function e(e){if(this.users=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.users=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.users&&e.users.length)for(let n=0;n<e.users.length;++n)je.UserDescriptor.encode(e.users[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetManyUsersResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.users&&r.users.length||(r.users=[]),r.users.push(je.UserDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.users&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let n=je.UserDescriptor.verify(e.users[t]);if(n)return"users."+n}}return null},e.fromObject=function(e){if(e instanceof je.GetManyUsersResponse)return e;let t=new je.GetManyUsersResponse;if(e.users){if(!Array.isArray(e.users))throw TypeError(".GetManyUsersResponse.users: array expected");t.users=[];for(let n=0;n<e.users.length;++n){if("object"!=typeof e.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");t.users[n]=je.UserDescriptor.fromObject(e.users[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.users=[]),e.users&&e.users.length){n.users=[];for(let r=0;r<e.users.length;++r)n.users[r]=je.UserDescriptor.toObject(e.users[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersResponse"},e})(),je.GetUserResponse=(()=>{function e(e){if(this.attributes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.attributes=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.attributes&&e.attributes.length)for(let n=0;n<e.attributes.length;++n)je.KeyValueDescriptor.encode(e.attributes[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetUserResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(je.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(let t=0;t<e.attributes.length;++t){let n=je.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},e.fromObject=function(e){if(e instanceof je.GetUserResponse)return e;let t=new je.GetUserResponse;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".GetUserResponse.attributes: array expected");t.attributes=[];for(let n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");t.attributes[n]=je.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(let r=0;r<e.attributes.length;++r)n.attributes[r]=je.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserResponse"},e})(),je.ChannelMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=0,e.prototype.socketId="",e.prototype.data=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.socketId&&Object.hasOwnProperty.call(e,"socketId")&&t.uint32(18).string(e.socketId),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.ChannelMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.type=e.uint32();break;case 2:r.socketId=e.string();break;case 3:r.data=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isInteger(e.type)?"type: integer expected":null!=e.socketId&&e.hasOwnProperty("socketId")&&!Ee.isString(e.socketId)?"socketId: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||Ee.isString(e.data))?"data: buffer expected":null},e.fromObject=function(e){if(e instanceof je.ChannelMessage)return e;let t=new je.ChannelMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.socketId&&(t.socketId=String(e.socketId)),null!=e.data&&("string"==typeof e.data?Ee.base64.decode(e.data,t.data=Ee.newBuffer(Ee.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.type=0,n.socketId="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=Ee.newBuffer(n.data)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.socketId&&e.hasOwnProperty("socketId")&&(n.socketId=e.socketId),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?Ee.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ChannelMessage"},e})(),je.BytesBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=Ee.newBuffer([]),e.prototype.data1=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).bytes(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.BytesBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.bytes();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||Ee.isString(e.data))?"data: buffer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ee.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof je.BytesBytesPacketDataMessage)return e;let t=new je.BytesBytesPacketDataMessage;return null!=e.data&&("string"==typeof e.data?Ee.base64.decode(e.data,t.data=Ee.newBuffer(Ee.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.data1&&("string"==typeof e.data1?Ee.base64.decode(e.data1,t.data1=Ee.newBuffer(Ee.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=Ee.newBuffer(n.data))),t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ee.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?Ee.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ee.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/BytesBytesPacketDataMessage"},e})(),je.NumberBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.NumberBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ee.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof je.NumberBytesPacketDataMessage)return e;let t=new je.NumberBytesPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&("string"==typeof e.data1?Ee.base64.decode(e.data1,t.data1=Ee.newBuffer(Ee.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ee.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ee.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberBytesPacketDataMessage"},e})(),je.NumberNumberPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.NumberNumberPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isInteger(e.data1)?"data1: integer expected":null},e.fromObject=function(e){if(e instanceof je.NumberNumberPacketDataMessage)return e;let t=new je.NumberNumberPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=e.data1>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberNumberPacketDataMessage"},e})(),je.NumberObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.NumberObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.NumberObjectPacketDataMessage)return e;let t=new je.NumberObjectPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberObjectPacketDataMessage"},e})(),je.NumberStringPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.NumberStringPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.NumberStringPacketDataMessage)return e;let t=new je.NumberStringPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberStringPacketDataMessage"},e})(),je.ObjectBufferPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.ObjectBufferPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ee.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof je.ObjectBufferPacketDataMessage)return e;let t=new je.ObjectBufferPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?Ee.base64.decode(e.data1,t.data1=Ee.newBuffer(Ee.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ee.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ee.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectBufferPacketDataMessage"},e})(),je.ObjectObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.ObjectObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.ObjectObjectPacketDataMessage)return e;let t=new je.ObjectObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectObjectPacketDataMessage"},e})(),je.PacketMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=0,e.prototype.id=0,e.prototype.nsp="",e.prototype.data=Ee.newBuffer([]),e.prototype.options=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(16).uint32(e.id),null!=e.nsp&&Object.hasOwnProperty.call(e,"nsp")&&t.uint32(26).string(e.nsp),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&t.uint32(42).bytes(e.options),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.PacketMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.type=e.uint32();break;case 2:r.id=e.uint32();break;case 3:r.nsp=e.string();break;case 4:r.data=e.bytes();break;case 5:r.options=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isInteger(e.type)?"type: integer expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isInteger(e.id)?"id: integer expected":null!=e.nsp&&e.hasOwnProperty("nsp")&&!Ee.isString(e.nsp)?"nsp: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||Ee.isString(e.data))?"data: buffer expected":null!=e.options&&e.hasOwnProperty("options")&&!(e.options&&"number"==typeof e.options.length||Ee.isString(e.options))?"options: buffer expected":null},e.fromObject=function(e){if(e instanceof je.PacketMessage)return e;let t=new je.PacketMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.id&&(t.id=e.id>>>0),null!=e.nsp&&(t.nsp=String(e.nsp)),null!=e.data&&("string"==typeof e.data?Ee.base64.decode(e.data,t.data=Ee.newBuffer(Ee.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.options&&("string"==typeof e.options?Ee.base64.decode(e.options,t.options=Ee.newBuffer(Ee.base64.length(e.options)),0):e.options.length>=0&&(t.options=e.options)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.type=0,n.id=0,n.nsp="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=Ee.newBuffer(n.data))),t.bytes===String?n.options="":(n.options=[],t.bytes!==Array&&(n.options=Ee.newBuffer(n.options)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.nsp&&e.hasOwnProperty("nsp")&&(n.nsp=e.nsp),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?Ee.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.options&&e.hasOwnProperty("options")&&(n.options=t.bytes===String?Ee.base64.encode(e.options,0,e.options.length):t.bytes===Array?Array.prototype.slice.call(e.options):e.options),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketMessage"},e})(),je.PacketOptionsMessage=(()=>{function e(e){if(this.rooms=[],this.except=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.flags="",e.prototype.rooms=Ee.emptyArray,e.prototype.except=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.flags&&Object.hasOwnProperty.call(e,"flags")&&t.uint32(10).string(e.flags),null!=e.rooms&&e.rooms.length)for(let n=0;n<e.rooms.length;++n)t.uint32(18).string(e.rooms[n]);if(null!=e.except&&e.except.length)for(let n=0;n<e.except.length;++n)t.uint32(26).string(e.except[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.PacketOptionsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.flags=e.string();break;case 2:r.rooms&&r.rooms.length||(r.rooms=[]),r.rooms.push(e.string());break;case 3:r.except&&r.except.length||(r.except=[]),r.except.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.flags&&e.hasOwnProperty("flags")&&!Ee.isString(e.flags))return"flags: string expected";if(null!=e.rooms&&e.hasOwnProperty("rooms")){if(!Array.isArray(e.rooms))return"rooms: array expected";for(let t=0;t<e.rooms.length;++t)if(!Ee.isString(e.rooms[t]))return"rooms: string[] expected"}if(null!=e.except&&e.hasOwnProperty("except")){if(!Array.isArray(e.except))return"except: array expected";for(let t=0;t<e.except.length;++t)if(!Ee.isString(e.except[t]))return"except: string[] expected"}return null},e.fromObject=function(e){if(e instanceof je.PacketOptionsMessage)return e;let t=new je.PacketOptionsMessage;if(null!=e.flags&&(t.flags=String(e.flags)),e.rooms){if(!Array.isArray(e.rooms))throw TypeError(".PacketOptionsMessage.rooms: array expected");t.rooms=[];for(let n=0;n<e.rooms.length;++n)t.rooms[n]=String(e.rooms[n])}if(e.except){if(!Array.isArray(e.except))throw TypeError(".PacketOptionsMessage.except: array expected");t.except=[];for(let n=0;n<e.except.length;++n)t.except[n]=String(e.except[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.rooms=[],n.except=[]),t.defaults&&(n.flags=""),null!=e.flags&&e.hasOwnProperty("flags")&&(n.flags=e.flags),e.rooms&&e.rooms.length){n.rooms=[];for(let t=0;t<e.rooms.length;++t)n.rooms[t]=e.rooms[t]}if(e.except&&e.except.length){n.except=[];for(let t=0;t<e.except.length;++t)n.except[t]=e.except[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketOptionsMessage"},e})(),je.StringBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.StringBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ee.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof je.StringBytesPacketDataMessage)return e;let t=new je.StringBytesPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?Ee.base64.decode(e.data1,t.data1=Ee.newBuffer(Ee.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ee.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ee.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringBytesPacketDataMessage"},e})(),je.StringNumberPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.StringNumberPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isInteger(e.data1)?"data1: integer expected":null},e.fromObject=function(e){if(e instanceof je.StringNumberPacketDataMessage)return e;let t=new je.StringNumberPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=e.data1>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringNumberPacketDataMessage"},e})(),je.StringObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.StringObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.StringObjectPacketDataMessage)return e;let t=new je.StringObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringObjectPacketDataMessage"},e})(),je.StringStringPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.StringStringPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.StringStringPacketDataMessage)return e;let t=new je.StringStringPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},e})(),je);class De{static decode(e,t){const n=Ne(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=Ne(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}function Ne(e){return Re[e.DESCRIPTOR_NAME]}class xe extends((0,r.EmitterMixin)()){constructor(e,t,n){super(),this._channelName=e,this._wsGateway=t,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let n="";return t&&(n+="all:"),n+="event",e&&(n+=":"+e),n}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=De.decode(e,Te);this.fire(this.getEventName(t.type,!0),t.data,t.socketId),t.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(t.type),t.data,t.socketId)}))}}const Ve=xe;class Me extends Pe{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new Me(e.id)}}Me.TYPE="21",Me.READABLE_TYPE_NAME="getUser",Me.DESCRIPTOR_NAME="GetUserMessage",Me.DESCRIPTOR={fields:{id:{type:"string",id:1}}};class Be extends Pe{constructor(e){super(),this.attributes=e}toJSON(){return{attributes:Object.keys(this.attributes).map((e=>({key:e,value:JSON.stringify(this.attributes[e])})))}}static fromJSON(e){const t=e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{});return new Be(t)}}Be.DESCRIPTOR_NAME="GetUserResponse",Be.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};class Ue extends Pe{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new Ue(e.ids)}}Ue.TYPE="22",Ue.READABLE_TYPE_NAME="getManyUsers",Ue.DESCRIPTOR_NAME="GetManyUsersMessage",Ue.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};class Je extends Pe{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(qe)}}static fromJSON(e){return new Je(e.users.map(Le))}}function qe(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function Le(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}Je.DESCRIPTOR_NAME="GetManyUsersResponse",Je.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};class Ge{constructor(e={}){this._attributes=new Map;for(const t of Object.keys(e))"id"!==t?(this._attributes.set(t,e[t]),Object.defineProperty(this,t,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(t)})):this.id=e.id}static fromData(e){return new Ge(e)}static async get(e,t){const n=new Me(t);try{const t=await e._sendRequest(Ge._SERVICE,Me.TYPE,De.encode(n)),r=De.decode(t,Be);return new Ge(r.attributes)}catch(e){return new Ge({id:t})}}static async getMany(e,t){const n=new Ue(t);try{const t=await e._sendRequest(Ge._SERVICE,Ue.TYPE,De.encode(n));return De.decode(t,Je).users.map((e=>new Ge(e)))}catch(e){return t.map((e=>new Ge({id:e})))}}}Ge._SERVICE=2;const Ye=Ge;class Fe extends Error{constructor(e,t,n=null,r={}){super("cloud-services-internal-error: "+e),this.context=t,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new Fe(function(e){let t="cloud-services-error: "+e.message;return e.data&&(t+="\nError data: "+JSON.stringify(e.data)),e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}class He extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new He(function(e){let t="cloud-services-server-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}const ze="function"==typeof ArrayBuffer,Ke=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,We=Object.prototype.toString,Qe="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===We.call(Blob),$e="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===We.call(File);function Ze(e){return ze&&(e instanceof ArrayBuffer||Ke(e))||Qe&&e instanceof Blob||$e&&e instanceof File}function Xe(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(Xe(e[t]))return!0;return!1}if(Ze(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return Xe(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&Xe(e[t]))return!0;return!1}function et(e){const t=[],n=e.data,r=e;return r.data=tt(n,t),r.attachments=t.length,{packet:r,buffers:t}}function tt(e,t){if(!e)return e;if(Ze(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=tt(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=tt(e[r],t));return n}return e}function nt(e,t){return e.data=rt(e.data,t),delete e.attachments,e}function rt(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=rt(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=rt(e[n],t));return e}var st;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(st||(st={}));class ot{constructor(e){this.replacer=e}encode(e){return e.type!==st.EVENT&&e.type!==st.ACK||!Xe(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===st.EVENT?st.BINARY_EVENT:st.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==st.BINARY_EVENT&&e.type!==st.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=et(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}class it extends w{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===st.BINARY_EVENT;n||t.type===st.BINARY_ACK?(t.type=n?st.EVENT:st.ACK,this.reconstructor=new at(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!Ze(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===st[n.type])throw new Error("unknown packet type "+n.type);if(n.type===st.BINARY_EVENT||n.type===st.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!it.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case st.CONNECT:return"object"==typeof t;case st.DISCONNECT:return void 0===t;case st.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case st.EVENT:case st.BINARY_EVENT:return Array.isArray(t)&&("string"==typeof t[0]||"number"==typeof t[0]);case st.ACK:case st.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class at{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=nt(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}class ct extends Pe{constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new ct(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}ct.TYPE=11,ct.DESCRIPTOR_NAME="PacketOptionsMessage",ct.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};const dt=!("undefined"==typeof process||!process.versions||!process.versions.node);var ut,lt;(lt=ut||(ut={}))[lt.BUFFER=1]="BUFFER",lt[lt.STRING=2]="STRING",lt[lt.NUMBER=3]="NUMBER",lt[lt.OBJECT=4]="OBJECT";class pt{static getPacketType(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*Math.pow(10,e.length-n-1);return t}static getType(e){if(pt.isBuffer(e))return ut.BUFFER;const t=typeof e;return"string"===t?ut.STRING:"number"===t?ut.NUMBER:ut.OBJECT}static isBuffer(e){return dt&&Buffer.isBuffer(e)||e instanceof ArrayBuffer||e instanceof Uint8Array||this._isBufferView(e)}static _isBufferView(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}class ht extends Pe{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}class ft extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new ft(e.data,e.data1)}static create(e,t){return new ft(e,t)}}ft.TYPE=pt.getPacketType(ut.NUMBER,ut.BUFFER),ft.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",ft.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};class mt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new mt(e.data,e.data1)}static create(e,t){return new mt(e,t)}}mt.TYPE=pt.getPacketType(ut.STRING,ut.BUFFER),mt.DESCRIPTOR_NAME="StringBytesPacketDataMessage",mt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};class yt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new yt(e.data,e.data1)}static create(e,t){return new yt(e,t)}}yt.TYPE=pt.getPacketType(ut.BUFFER,ut.BUFFER),yt.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",yt.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};class gt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new gt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new gt(e,t)}}gt.TYPE=pt.getPacketType(ut.STRING,ut.OBJECT),gt.DESCRIPTOR_NAME="StringObjectPacketDataMessage",gt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class bt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new bt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new bt(e,t)}}bt.TYPE=pt.getPacketType(ut.NUMBER,ut.OBJECT),bt.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",bt.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};class Ot extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new Ot(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new Ot(e,t)}}Ot.TYPE=pt.getPacketType(ut.OBJECT,ut.OBJECT),Ot.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",Ot.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class wt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new wt(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new wt(e,t)}}wt.TYPE=pt.getPacketType(ut.OBJECT,ut.BUFFER),wt.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",wt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};class It extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new It(e.data,e.data1)}static create(e,t){return new It(e,t)}}It.TYPE=pt.getPacketType(ut.STRING,ut.STRING),It.DESCRIPTOR_NAME="StringStringPacketDataMessage",It.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class vt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new vt(e.data,e.data1)}static create(e,t){return new vt(e,t)}}vt.TYPE=pt.getPacketType(ut.STRING,ut.NUMBER),vt.DESCRIPTOR_NAME="StringNumberPacketDataMessage",vt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};class St extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new St(e.data,e.data1)}static create(e,t){return new St(e,t)}}St.TYPE=pt.getPacketType(ut.NUMBER,ut.NUMBER),St.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",St.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};class At extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new At(e.data,e.data1)}static create(e,t){return new At(e,t)}}At.TYPE=pt.getPacketType(ut.NUMBER,ut.STRING),At.DESCRIPTOR_NAME="NumberStringPacketDataMessage",At.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const Pt=[ft,mt,yt,gt,bt,Ot,wt,It,vt,St,At].reduce(((e,t)=>(e[t.TYPE]=t,e)),{});class Tt extends Pe{constructor(e,t,n,r="/",s=new ct){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=s}get packetData(){return void 0===this.data.data&&void 0===this.data.data1?[]:this.data.data&&void 0===this.data.data1?[this.data.data]:[this.data.data,this.data.data1]}toJSON(){const e=De.encode(this.options),t=De.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:t,options:e}}static fromJSON(e){const t=Math.floor(e.type/10);return new Tt(e.type-10*t,De.decode(e.data,Pt[t]),e.id,e.nsp,e.options?De.decode(e.options,ct):new ct)}static create(e,t={}){var n;const r=pt.getPacketType(pt.getType(e.data[0]),pt.getType(null!==(n=e.data[1])&&void 0!==n?n:e.data[0]));return new Tt(e.type,Pt[r].create(e.data[0],e.data[1]),e.id,e.nsp,new ct(t.flags,t.rooms,t.except))}}Tt.TYPE=10,Tt.DESCRIPTOR_NAME="PacketMessage",Tt.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}}};class _t{encode(e,t,n,r="/",s={}){if(t.length>2)throw new Error("PacketParser supports only 2 elements in data");const o={type:e,data:t,id:n,nsp:r};return De.encode(Tt.create(o,s))}decode(e){const t=De.decode(e,Tt);return{packet:{id:t.id,type:t.type,data:t.packetData,nsp:t.nsp},options:{flags:t.options.flags,rooms:t.options.rooms,except:t.options.except}}}}const kt=[st.EVENT,st.ACK,st.BINARY_ACK,st.BINARY_EVENT];class Ct extends ot{constructor(e=new _t){super(),this._packetParser=e}encode(e){if(kt.includes(e.type))try{return[this._packetParser.encode(e.type,e.data,e.id,e.nsp)]}catch(e){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:e.message}})}return super.encode(e)}}class Et extends it{constructor(e=new _t){super(),this._packetParser=e}add(e){if(!pt.isBuffer(e))return super.add(e);let t;try{t=this._packetParser.decode(e).packet}catch(t){return super.add(e)}super.emitReserved("decoded",t)}}class jt{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}(),this.timeout=setTimeout((()=>this.error(new Fe("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}class Rt{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const n=this._createRequest(t);try{return e(n),await n.promise}finally{this._finishRequest(n)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new jt(this._context,e);return this._requests.add(t),t}_finishRequest(e){this._requests.delete(e),clearTimeout(e.timeout)}async _waitForRequests(e=5e3,t=0){return!this._requests.size||t>=e/500?Promise.resolve():(await new Promise((e=>{setTimeout(e,500)})),this._waitForRequests(e,t++))}}var Dt,Nt;(Nt=Dt||(Dt={})).DISCONNECTED="disconnected",Nt.CONNECTING="connecting",Nt.CONNECTED="connected";class xt extends((0,r.ObservableMixin)()){constructor(e,t,n={},r=ve,s=Ye.get){if(super(),this._token=t,this._options=n,this._connectionProvider=r,this._userFactory=s,this._requestsManager=new Rt(this),this._channels=new Map,this._connectionAttempt=0,!e)throw new TypeError("Api address must be provided.");if(!this._token)throw new TypeError("Token must be provided.");this._options.requestTimeout||(this._options.requestTimeout=2e4),this._url=Se(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Dt.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==xt.STATE_CONNECTED){if(n===xt.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Fe("Not connected.",this))}else try{this.me=await this._userFactory.call(Ye,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:xt._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==Dt.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=Dt.DISCONNECTED)}async reconnect(){this._socket||this.state!==Dt.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=ve,s=Ye.get){const o=new xt(t,e,n,r,s);return await o._connect(),o}_sendRequest(e,t,n){if(!e)throw new Fe("`serviceName` must be provided.",this);if(this.state!==xt.STATE_CONNECTED)throw new Fe("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new Fe("Not authenticated.",this);const r=new ArrayBuffer(n.length+2),s=new Uint8Array(r);return s[0]=e,s[1]=parseInt(t),s.set(n,2),this._emit(1,s)}_getChannel(e,t){const n=""+e+t;return!this._channels.has(n)&&this._socket&&this._channels.set(n,new Ve(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise(((e,t)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),n.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),n.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",s=this._connectionProvider(n,{parser:{Encoder:Ct,Decoder:Et},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.3.1"},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=Dt.CONNECTING,s.on("connect",(()=>{this._debugEvent("connect"),this.socketId=s.id})),s.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),s.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),s.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),s.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=Dt.CONNECTING,this._connectionAttempt=e})),s.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),s.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=s,s}_emit(e,t){const n=this._socket;return this._requestsManager.send((r=>{n.emit(e,t,((e,t)=>{if(e)return r.error(He.fromPublicError(e));r.response(t)}))}),this._options.requestTimeout)}_addAuthData(e,t){this._socketAuth={environmentId:e,userId:t,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=Dt.CONNECTED;const e=async(e,t,n)=>{this._debugEvent("token:value:change");try{await this._authenticate(n)}catch(e){}};this._token.on("change:value",e),this._socket.io.off("reconnect_error"),this.on("disconnect",(()=>{this._token.off("change:value",e)}))}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=Dt.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const e of this._channels.values())e.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(e,t){if(!this._isDebugModeEnabled())return;const n=void 0!==t?", data: "+t:"";console.info((new Date).toLocaleString()+" "+e+n)}_reconnectionAttemptError(e){this._connectionAttempt>=2&&(this.disconnect(),e(Fe.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:e}){this._removeAuthData(),this.fire("error",He.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success","envId: "+t.environmentId+", userId: "+t.userId),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;return!!r.global.window.localStorage&&"true"===(null!==(e=r.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}xt.STATE_DISCONNECTED=Dt.DISCONNECTED,xt.STATE_CONNECTING=Dt.CONNECTING,xt.STATE_CONNECTED=Dt.CONNECTED,xt._CHANGE_STATE_EVENT_PRIORITY=r.priorities.get("highest")+999999;const Vt=xt;class Mt extends Pe{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new Mt(e.bundleVersion)}}Mt.TYPE="131",Mt.READABLE_TYPE_NAME="isEditorBundleUploaded",Mt.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",Mt.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};class Bt extends Pe{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new Bt(e.isUploaded)}}Bt.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",Bt.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};class Ut extends((0,r.EmitterMixin)()){static async isBundleUploaded(e,t){const n=new Mt(t);if(e.state!==Dt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(Ut._SERVICE,Mt.TYPE,De.encode(n));return De.decode(r,Bt).isUploaded}}Ut._SERVICE=13;const Jt=Ut;class qt extends Pe{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new qt(e.documentId,e.revisionId)}}qt.TYPE="123",qt.READABLE_TYPE_NAME="getRevision",qt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",qt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};class Lt extends Ae{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,n]of Object.entries(e))void 0===n&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}Lt.DESCRIPTOR_NAME="RevisionDescriptor",Lt.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}}};class Gt extends Pe{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.revisionId=e,this.name=t,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 Lt.toJSON(this)}toObject(){return Lt.toObject(this)}static create(e){return new Gt(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new Gt(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}Gt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",Gt.DESCRIPTOR=Lt.DESCRIPTOR;class Yt extends Pe{constructor(e,t,n){super(),this.documentId=e,this.requestId=t,this.revisions=n}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Lt.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Lt.toObject)}}static create(e){return new Yt(e.documentId,e.requestId,e.revisions.map(Lt.create))}static fromJSON(e){return new Yt(e.documentId,e.requestId,e.revisions.map(Lt.fromJSON))}}Yt.TYPE="124",Yt.READABLE_TYPE_NAME="updateRevisions",Yt.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",Yt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};class Ft extends Pe{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new Ft(e.requestId)}}Ft.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",Ft.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};class Ht extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Ht(e.documentId)}}Ht.TYPE="121",Ht.READABLE_TYPE_NAME="connectToRevisionHistory",Ht.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",Ht.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class zt extends Pe{constructor(e,t,n){super(),this.channel=e,this.requestId=t,this.revisions=n}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Lt.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Lt.toObject)}}static fromJSON(e){return new zt(e.channel,e.requestId,e.revisions.map(Lt.fromJSON))}}zt.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",zt.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};class Kt extends Pe{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new Kt(e.documentId,e.requestId)}}Kt.TYPE="122",Kt.READABLE_TYPE_NAME="reconnectToRevisionHistory",Kt.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",Kt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};class Wt extends Fe{constructor(e,t){super(e+" Service is not connected.",t)}}class Qt extends((0,r.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new Ht(this._documentId))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}reconnect(e,t){if(this.isConnected)throw new Fe("Cannot reconnect to already connected service.",e);return this._connect(e,new Kt(this._documentId,t))}async updateRevisions(e,t){const n=Yt.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(Yt.TYPE,n),{requestId:s}=De.decode(r,Ft);return s}async getRevision(e){const t=new qt(this._documentId,e),n=await this._sendRequest(qt.TYPE,t);return De.decode(n,Gt).toObject()}async _connect(e,t){if(e.state!==Dt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(12,t.constructor.TYPE,De.encode(t)),{channel:r,requestId:s,revisions:o}=De.decode(n,zt).toObject();return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r),this._isConnected=!0,this.fire("connected"),{revisions:o,requestId:s}}_connectToChannel(e,t){this._channel=e._getChannel(Qt._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Yt.TYPE),((e,t)=>{const{documentId:n,requestId:r,revisions:s}=De.decode(t,Yt).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})}))}_onWsGatewayStateChange(e){e===Dt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Wt("Revision History",this);return this._wsGateway._sendRequest(12,e,De.encode(t))}}Qt._SERVICE=12;const $t=Qt;class Zt extends Pe{constructor(e,t,n,r={},s=null,o=null){super(),this.id=e,this.documentId=t,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(e){var t;return new Zt(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}Zt.TYPE="101",Zt.READABLE_TYPE_NAME="addSuggestion",Zt.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",Zt.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}}};class Xt extends Pe{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,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 e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new Xt(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}Xt.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",Xt.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}}};class en extends Pe{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new en(e.id,e.documentId)}}en.TYPE="103",en.READABLE_TYPE_NAME="getSuggestion",en.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",en.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};class tn extends Pe{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,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(e){return new tn(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}tn.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",tn.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}}};class nn extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new nn(e.documentId)}}nn.TYPE="102",nn.READABLE_TYPE_NAME="getAllSuggestions",nn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",nn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class rn extends Ae{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}rn.DESCRIPTOR_NAME="SuggestionDescriptor",rn.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"}}};class sn extends Pe{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(rn.toJSON)}}static fromJSON(e){var t,n;return new sn(null===(t=e.suggestions)||void 0===t?void 0:t.map(on),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(rn.fromJSON))}}function on(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}sn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",sn.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};class an extends Pe{constructor(e,t,n,r,s,o=null){super(),this.id=e,this.documentId=t,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(e){return new an(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}an.TYPE="104",an.READABLE_TYPE_NAME="updateSuggestion",an.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",an.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}}};class cn extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new cn(e.documentId)}}cn.TYPE="105",cn.READABLE_TYPE_NAME="connectToSuggestions",cn.DESCRIPTOR_NAME="TrackChangesConnectMessage",cn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class dn extends Pe{constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(rn.toJSON)}}static fromJSON(e){var t,n;return new dn(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(rn.fromJSON))}}dn.DESCRIPTOR_NAME="TrackChangesConnectResponse",dn.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};class un extends Pe{constructor(e,t,n){super(),this.ids=e,this.documentId=t,this.state=n}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(e){return new un(e.ids,e.documentId,e.state)}}un.TYPE="106",un.READABLE_TYPE_NAME="batchUpdateSuggestionsState",un.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",un.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};class ln extends((0,r.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Dt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);const t=new cn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(10,cn.TYPE,De.encode(t)),r=De.decode(n,dn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,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(e,t,n,r=null,s){const o=new Zt(e,this._documentId,t,n,r,s),i=await this._sendRequest(Zt.TYPE,o);return De.decode(i,Xt)}async get(e,t=1){const n=new en(e,this._documentId);try{const e=await this._sendRequest(en.TYPE,n);return De.decode(e,tn)}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.get(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw He.fromPublicError(n)}var r}async getAll(){const e=new nn(this._documentId),t=await this._sendRequest(nn.TYPE,e),{suggestions:n}=De.decode(t,sn);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:s}=t,o=void 0!==n,i=new an(e,this._documentId,n,o,r,s);await this._sendRequest(an.TYPE,i)}async batchUpdateState(e){const t=new un(e.ids,this._documentId,e.state);await this._sendRequest(un.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(ln._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(an.TYPE),((e,t)=>{const n=De.decode(t,an);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(e){e===Dt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Wt("Track Changes",this);return this._wsGateway._sendRequest(10,e,De.encode(t))}}ln._SERVICE=10;const pn=ln;class hn extends Pe{constructor(e,t=[]){super(),this.channel=e,this.sockets=t}toJSON(){return{channel:this.channel,sockets:this.sockets.map((e=>({user:e.userId,session:e.id,role:e.role,permissions:e.permissions})))}}static fromJSON(e){return new hn(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}hn.DESCRIPTOR_NAME="SessionsConnectResponse",hn.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};class fn extends Pe{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new fn(e.id,e.sessionType)}}fn.TYPE="31",fn.READABLE_TYPE_NAME="getConnectedSockets",fn.DESCRIPTOR_NAME="SessionsConnectMessage",fn.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};class mn extends Pe{constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){var e,t,n;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(e){return new mn(e.id,e.userId,e.role,e.permissions)}}mn.TYPE="32",mn.READABLE_TYPE_NAME="connectSocket",mn.DESCRIPTOR_NAME="SocketConnectMessage",mn.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};class yn extends Pe{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new yn(e.id)}}yn.TYPE="33",yn.READABLE_TYPE_NAME="disconnectSocket",yn.DESCRIPTOR_NAME="SocketDisconnectMessage",yn.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const gn=class extends r.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new fn(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(3,fn.TYPE,De.encode(t));n=De.decode(e,hn)}catch(e){n=new hn(this._id,[])}this._connectToChannel(this._wsGateway,n.channel,this._sessionType);const r=await async function(e,t){const n=t.map((e=>e.userId)),r=n.length?await Ye.getMany(e,n):[];return t.map((e=>{const t={id:e.id,role:e.role,permissions:e.permissions};return t.user=e.userId&&r.find((t=>t.id===e.userId))||new Ye,t}))}(this._wsGateway,n.sockets);for(const e of r)super.add(e);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(e=!0){if(this._connected){for(this._connected=!1,this._eventsQueue=[];this.length;)super.remove(0);this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._wsGateway&&e&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),e&&this.stopListening()}}add(e,t){throw new TypeError("The collection is read-only.")}remove(e){throw new TypeError("The collection is read-only.")}_connectToChannel(e,t,n){this._channel=e._getChannel(n,t),this._channel&&(this._addHandler(this._channel,mn.TYPE,(async t=>{const n=De.decode(t,mn);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await Ye.get(e,n.userId)),super.add(t)}})),this._addHandler(this._channel,yn.TYPE,(e=>{const t=De.decode(e,yn);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===Vt.STATE_DISCONNECTED&&this.disconnect(!1),e===Vt.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let e;for(this._isRunning=!0;e=this._eventsQueue.shift();){const t=this._handlers.get(e.eventName);t&&await t(e.data)}this._isRunning=!1}_addHandler(e,t,n){const r=e.getEventName(t,!0);this.listenTo(e,r,(async(e,t)=>{const n=e.name;this._eventsQueue.push({eventName:n,data:t}),await this._runQueue()})),this._handlers.set(r,n)}};var bn,On=new Uint8Array(16);function wn(){if(!bn&&!(bn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bn(On)}const In=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const vn=function(e){return"string"==typeof e&&In.test(e)};for(var Sn=[],An=0;An<256;++An)Sn.push((An+256).toString(16).substr(1));const Pn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Sn[e[t+0]]+Sn[e[t+1]]+Sn[e[t+2]]+Sn[e[t+3]]+"-"+Sn[e[t+4]]+Sn[e[t+5]]+"-"+Sn[e[t+6]]+Sn[e[t+7]]+"-"+Sn[e[t+8]]+Sn[e[t+9]]+"-"+Sn[e[t+10]]+Sn[e[t+11]]+Sn[e[t+12]]+Sn[e[t+13]]+Sn[e[t+14]]+Sn[e[t+15]]).toLowerCase();if(!vn(n))throw TypeError("Stringified UUID is invalid");return n};const Tn=function(e,t,n){var r=(e=e||{}).random||(e.rng||wn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var s=0;s<16;++s)t[n+s]=r[s];return t}return Pn(r)};class _n{static async getConnectedSessions(e,t,n){const r=new gn(t,n);return await r.connect(e),r}}class kn extends Pe{constructor(e,t,n,r,s=""){super(),this.id=e,this.buffers=t,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(e){return new kn(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}kn.TYPE="11",kn.READABLE_TYPE_NAME="connectToDocument",kn.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",kn.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}}};class Cn{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];let r=0;for(const s of e)if(0!==s){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r])}return n}}class En extends Ae{static toJSON({createdAt:e,...t}){const n={...t};return(null==e?void 0:e.toISOString)&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}En.DESCRIPTOR_NAME="OperationMetadataDescriptor",En.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};class jn extends Pe{constructor(e,t,n,r,s=[],o=""){super(),this.id=e,this.buffers=t,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:Cn.removeUnnecessaryMetadata(this.types,this.metadata).map(En.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new jn(e.id,e.buffers,e.types,e.baseVersion,Cn.prepareMetadataForOperations(e.types,e.metadata).map(En.fromJSON),e.lastOperationId)}}jn.TYPE="13",jn.READABLE_TYPE_NAME="updateDocument",jn.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",jn.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}}};class Rn extends Pe{constructor(e,t,n){super(),this.id=e,this.lastKnowVersion=t,this.bundleVersion=n}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(e){return new Rn(e.id,e.lastKnowVersion,e.bundleVersion)}}Rn.TYPE="12",Rn.READABLE_TYPE_NAME="reconnectToDocument",Rn.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",Rn.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};class Dn extends Pe{constructor(e,t=[],n=[],r=[],s="",o=null){super(),this.version=e,this.buffers=t,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 e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:Cn.removeUnnecessaryMetadata(this.types,this.metadata).map(En.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new Dn(e.version,e.buffers,e.types,Cn.prepareMetadataForOperations(e.types,e.metadata).map(En.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new Dn(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}Dn.DESCRIPTOR_NAME="CollaborativeEditingResponse",Dn.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}}};class Nn extends Pe{constructor(e,t,n=[],r=[],s=0,o=[],i=null,a="",c="",d=null){super(),this.channel=e,this.version=t,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 e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:Cn.removeUnnecessaryMetadata(this.types,this.metadata).map(En.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new Nn(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let n=null;return!0===e.isInitialized?n=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(n=e.initData),Nn.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:Cn.prepareMetadataForOperations(e.types,e.metadata).map(En.fromJSON),initData:n,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}Nn.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",Nn.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:En.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}}};class xn extends Pe{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}toJSON(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,n=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new xn(t,n)}}xn.DESCRIPTOR_NAME="GetDocumentDetailsResponse",xn.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}}};class Vn extends Pe{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Vn(e.documentId)}}Vn.TYPE="14",Vn.READABLE_TYPE_NAME="getDocumentDetails",Vn.DESCRIPTOR_NAME="GetDocumentDetailsMessage",Vn.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};class Mn extends((0,r.EmitterMixin)()){constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:Tn(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new kn(this.getId(),t.buffers,t.types,this._bundleVersion,n);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new Fe("Cannot reconnect to already connected service.",e);return this._connect(e,new Rn(this.getId(),t,this._bundleVersion))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async getDocumentDetails(){const e=new Vn(this.getId());if(!this._wsGateway)throw new Wt("Collaborative Editing",this);const t=await this._wsGateway._sendRequest(1,Vn.TYPE,De.encode(e));return De.decode(t,xn)}async sendOperations(e,t,n){if(!e||!e.types||!e.types.length)throw new Fe("Cannot send empty update.",this._wsGateway);const r="number"==typeof t?t:parseInt(t);if(!Number.isInteger(r)||r<0)throw new Fe("Base version not provided.",this._wsGateway);const s=new jn(this.getId(),e.buffers,e.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new Wt("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,jn.TYPE,De.encode(s));return De.decode(o,Dn)}async getConnectedSessions(){if(!this._isConnected)throw new Wt("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await _n.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(e,t){return _n.getConnectedSessions(e,t,1)}async _connect(e,t){if(this.isConnected())return;if(e.state!==Vt.STATE_CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(1,t.constructor.TYPE,De.encode(t)),r=De.decode(n,Nn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r.channel),this._isConnected=!0,this.fire("connected"),r}_connectToChannel(e,t){this._channel=e._getChannel(1,t),this.listenTo(this._channel,this._channel.getEventName(jn.TYPE),((e,t)=>{const n=De.decode(t,jn);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(e){e===Vt.STATE_DISCONNECTED&&this.disconnect()}}Mn._SERVICE=1;const Bn=Mn;class Un extends Ae{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}Un.DESCRIPTOR_NAME="CommentDescriptor",Un.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"}}};class Jn extends Ae{static toJSON(e){var t,n,r,s,o;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(n=e.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:null===(s=e.comments)||void 0===s?void 0:s.map(Un.toJSON),unlinkedAt:null===(o=e.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,context:e.context?JSON.parse(e.context):void 0,comments:null===(t=e.comments)||void 0===t?void 0:t.map(Un.fromJSON),unlinkedAt:e.unlinkedAt?new Date(e.unlinkedAt):void 0}}}Jn.DESCRIPTOR_NAME="CommentsThreadDescriptor",Jn.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}}};class qn extends Pe{constructor(e,t,n,r="",s,o="",i=null,a){super(),this.documentId=e,this.commentThreadId=t,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?Jn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new qn(e.documentId,e.commentThreadId,e.content,e.commentId?e.commentId:void 0,e.createdAt?new Date(e.createdAt):void 0,e.userId?e.userId:void 0,e.attributes?JSON.parse(e.attributes):{},e.commentThread?Jn.fromJSON(e.commentThread):void 0)}}qn.TYPE="91",qn.READABLE_TYPE_NAME="addComment",qn.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",qn.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}}};class Ln extends Pe{constructor(e,t,n){super(),this.commentThreadId=e,this.commentId=t,this.createdAt=new Date(n)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(e){return new Ln(e.commentThreadId,e.commentId,e.createdAt)}}Ln.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",Ln.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};class Gn extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Gn(e.documentId)}}Gn.TYPE="92",Gn.READABLE_TYPE_NAME="connectToComment",Gn.DESCRIPTOR_NAME="CommentsV2ConnectMessage",Gn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class Yn extends Pe{constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Jn.toJSON)}}static fromJSON(e){var t,n;return new Yn(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Jn.fromJSON))}}Yn.DESCRIPTOR_NAME="CommentsV2ConnectResponse",Yn.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};class Fn extends Pe{constructor(e,t,n){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(e){return new Fn(e.documentId,e.commentThreadId,e.commentId)}}Fn.TYPE="95",Fn.READABLE_TYPE_NAME="removeComment",Fn.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",Fn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};class Hn extends Pe{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new Hn(e.documentId,e.commentThreadId)}}Hn.TYPE="97",Hn.READABLE_TYPE_NAME="removeCommentThread",Hn.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",Hn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class zn extends Pe{constructor(e,t,n,r,s=null,o=!1,i){super(),this.documentId=e,this.commentThreadId=t,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?Jn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new zn(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?Jn.fromJSON(e.commentThread):void 0)}}zn.TYPE="96",zn.READABLE_TYPE_NAME="updateComment",zn.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",zn.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}}};class Kn extends Pe{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new Kn(e.commentThreadId,e.documentId)}}Kn.TYPE="93",Kn.READABLE_TYPE_NAME="getComment",Kn.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",Kn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class Wn extends Pe{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=n,this.resolvedBy=s,this.comments=(null==n?void 0:n.length)?n:t,this.createdAt=i?new Date(i):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c,this.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 e,t,n,r,s,o;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(Un.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(e){var t,n;return new Wn(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(n=e.commentsV2)||void 0===n?void 0:n.map(Un.fromJSON),e.attributes?JSON.parse(e.attributes):e.attributes,e.resolvedBy,e.context?JSON.parse(e.context):e.context,e.createdAt,e.deletedAt,e.resolvedAt,e.unlinkedAt)}}Wn.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",Wn.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}}};class Qn extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Qn(e.documentId)}}Qn.TYPE="94",Qn.READABLE_TYPE_NAME="getDocumentThreads",Qn.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",Qn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class $n extends Pe{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Jn.toJSON)}}static fromJSON(e){var t,n;return new $n(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const n=JSON.parse(e),r={...n};return n.comments&&(r.comments=null===(t=n.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)})))),r}(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Jn.fromJSON))}}$n.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",$n.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};class Zn extends Ae{static toJSON(e){var t;return{commentId:e.commentId,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}Zn.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",Zn.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};class Xn extends Pe{constructor(e,t,n=[]){super(),this.commentThreadId=e,this.comments=n,this.createdAt=new Date(t)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString(),comments:this.comments.map((e=>Zn.toJSON(e)))}}static fromJSON(e){return new Xn(e.commentThreadId,e.createdAt,e.comments.map((e=>Zn.fromJSON(e))))}}Xn.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",Xn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};class er extends Pe{constructor(e,t,n=[],r,s=null,o=null,i=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,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 e;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(e=this.comments)||void 0===e?void 0:e.map((e=>Un.toJSON(e)))}}static fromJSON(e){var t;return new er(e.documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>Un.fromJSON({...t,documentId:e.documentId,commentThreadId:e.commentThreadId}))),e.context?JSON.parse(e.context):e.context,e.resolvedBy,e.createdAt?new Date(e.createdAt):void 0,e.resolvedAt?new Date(e.resolvedAt):void 0,e.deletedAt?new Date(e.deletedAt):void 0,e.attributes?JSON.parse(e.attributes):e.attributes)}}er.TYPE="140",er.READABLE_TYPE_NAME="addCommentThread",er.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",er.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}}};class tr extends Pe{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var e;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(e=this.resolvedAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(e){return new tr(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}tr.TYPE="142",tr.READABLE_TYPE_NAME="resolveCommentThread",tr.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",tr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};class nr extends Pe{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new nr(e.commentThreadId,e.documentId)}}nr.TYPE="141",nr.READABLE_TYPE_NAME="reopenCommentThread",nr.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",nr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class rr extends Pe{constructor(e,t,n,r=null,s=null){super(),this.commentThreadId=e,this.documentId=t,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(e){return new rr(e.commentThreadId,e.documentId,e.context?JSON.parse(e.context):e.context,e.attributes?JSON.parse(e.attributes):null,e.unlinkedAt?new Date(e.unlinkedAt):null)}}rr.TYPE="143",rr.READABLE_TYPE_NAME="updateCommentThread",rr.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",rr.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}}};class sr extends Pe{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=new Date(r)}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt.toISOString()}}static fromJSON(e){return new sr(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}sr.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",sr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};class or extends((0,r.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Dt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);const t=new Gn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(9,Gn.TYPE,De.encode(t)),{channel:r,threads:s}=De.decode(n,Yn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,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(e,t,n,r){const s=new qn(this._documentId,e,n,t,void 0,void 0,r),o=await this._sendRequest(qn.TYPE,s);return De.decode(o,Ln)}async updateComment(e,t,n,r){const s=void 0!==r,o=new zn(this._documentId,e,t,n,r,s);await this._sendRequest(zn.TYPE,o)}async removeComment(e,t){const n=new Fn(this._documentId,e,t);await this._sendRequest(Fn.TYPE,n)}async removeCommentThread(e){const t=new Hn(this._documentId,e);await this._sendRequest(Hn.TYPE,t)}async addCommentThread(e){var t;const n=new er(this._documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),r=await this._sendRequest(er.TYPE,n);return De.decode(r,Xn)}async resolveCommentThread(e){const t=new tr(e,this._documentId),n=await this._sendRequest(tr.TYPE,t);return De.decode(n,sr)}async reopenCommentThread(e){const t=new nr(e,this._documentId);await this._sendRequest(nr.TYPE,t)}async updateCommentThread(e){const t=new rr(e.commentThreadId,this._documentId,e.context,e.attributes,e.unlinkedAt);await this._sendRequest(rr.TYPE,t)}async getCommentThread(e,t=1){const n=new Kn(e,this._documentId);try{const e=await this._sendRequest(Kn.TYPE,n),t=De.decode(e,Wn);return{commentThreadId:t.commentThreadId,comments:t.comments,attributes:t.attributes,context:t.context,resolvedAt:t.resolvedAt,resolvedBy:t.resolvedBy,deletedAt:t.deletedAt,unlinkedAt:t.unlinkedAt}}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.getCommentThread(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw He.fromPublicError(n)}var r}async getDocumentThreads(){const e=new Qn(this._documentId),t=await this._sendRequest(Qn.TYPE,e),{threads:n}=De.decode(t,$n);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new Wt("Comments",this);return this._connectedSessions||(this._connectedSessions=await _n.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(or._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(qn.TYPE),((e,t)=>{const n=De.decode(t,qn);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(Fn.TYPE),((e,t)=>{const n=De.decode(t,Fn);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(zn.TYPE),((e,t)=>{const n=De.decode(t,zn);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Hn.TYPE),((e,t)=>{const n=De.decode(t,Hn);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(er.TYPE),((e,t)=>{const n=De.decode(t,er);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(rr.TYPE),((e,t)=>{const n=De.decode(t,rr);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(tr.TYPE),((e,t)=>{const n=De.decode(t,tr);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(nr.TYPE),((e,t)=>{const n=De.decode(t,nr);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(e){e===Dt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Wt("Comments",this);return this._wsGateway._sendRequest(9,e,De.encode(t))}}or._SERVICE=9;const ir=or;new Map([[kn.TYPE,kn.READABLE_TYPE_NAME],[Rn.TYPE,Rn.READABLE_TYPE_NAME],[jn.TYPE,jn.READABLE_TYPE_NAME],[Vn.TYPE,Vn.READABLE_TYPE_NAME],[qn.TYPE,qn.READABLE_TYPE_NAME],[Gn.TYPE,Gn.READABLE_TYPE_NAME],[Kn.TYPE,Kn.READABLE_TYPE_NAME],[Qn.TYPE,Qn.READABLE_TYPE_NAME],[Fn.TYPE,Fn.READABLE_TYPE_NAME],[Hn.TYPE,Hn.READABLE_TYPE_NAME],[zn.TYPE,zn.READABLE_TYPE_NAME],[fn.TYPE,fn.READABLE_TYPE_NAME],[mn.TYPE,mn.READABLE_TYPE_NAME],[yn.TYPE,yn.READABLE_TYPE_NAME],[Zt.TYPE,Zt.READABLE_TYPE_NAME],[en.TYPE,en.READABLE_TYPE_NAME],[an.TYPE,an.READABLE_TYPE_NAME],[nn.TYPE,nn.READABLE_TYPE_NAME],[cn.TYPE,cn.READABLE_TYPE_NAME],[un.TYPE,un.READABLE_TYPE_NAME],[Me.TYPE,Me.READABLE_TYPE_NAME],[Ue.TYPE,Ue.READABLE_TYPE_NAME],[Ht.TYPE,Ht.READABLE_TYPE_NAME],[Kt.TYPE,Kt.READABLE_TYPE_NAME],[qt.TYPE,qt.READABLE_TYPE_NAME],[Yt.TYPE,Yt.READABLE_TYPE_NAME],[Mt.TYPE,Mt.READABLE_TYPE_NAME],[tr.TYPE,tr.READABLE_TYPE_NAME],[nr.TYPE,nr.READABLE_TYPE_NAME],[rr.TYPE,rr.READABLE_TYPE_NAME],[er.TYPE,er.READABLE_TYPE_NAME]]);const ar=ur;function cr(){const e=["webSocketUrl","set","then","get","bind","Connected users limit exceeded","connect","limitExceeded","create","online","from","connected","_reconnectionStack","add","CONNECTING","cloudServices.requestTimeout","DISCONNECTED","94642nQbZcv","disconnect","cloudServices.connectionTimeout","stopListening","_reconnect","446968bIvkct","5ylDRVo","state","initialReconnectionInterval","_shouldPluginsReconnect","has","3BHXmqD","connection","destroy","_isBrowserOffline","all","catch","cloudservices-reconnection-error","864808xnBQiq","removeFromReconnectionStack","showWarning","48kmvofJ","delete","The limit of maximum concurrent connections that the collaboration server can handle has been reached. Try opening the document again in a few minutes. Please contact your system administrator if the problem persists.","CloudServices","error","change:me","config","reconnect","1199468elqBCU","websocketgateway-plugin-already-registered","CONNECTED","isInReconnectionStack","websocketgateway-invalid-plugin-interface","code","12WlODdL","9YHdkRQ","2210702TjXXhX","WebSocketGateway","cloudservices-init","pluginName","listenTo","websocketgateway-missing-websocket-url","constructor","function","context","5430gjFhWi","websocketgateway-missing-token","offline","_domEmitter","init","token","plugins","requires","addToReconnectionStack","143cLhIBF","173747YWfMdH","real-time-collaboration","define"];return(cr=function(){return e})()}!function(e,t){const n=ur,r=e();for(;;)try{if(150737===parseInt(n(262))/1+-parseInt(n(282))/2*(-parseInt(n(293))/3)+-parseInt(n(235))/4*(-parseInt(n(288))/5)+parseInt(n(241))/6*(parseInt(n(224))/7)+parseInt(n(287))/8*(parseInt(n(242))/9)+-parseInt(n(252))/10*(-parseInt(n(261))/11)+parseInt(n(227))/12*(-parseInt(n(243))/13))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(cr);class dr extends n.ContextPlugin{static get[ar(259)](){return[ar(230),s.Notification]}static get[ar(246)](){return ar(244)}constructor(e){const t=ar;super(e),this[t(266)](t(289),Dt[t(237)]),this[t(266)](t(296),!1),this[t(277)]=new Set,this[t(291)]=!1,this[t(255)]=Object[t(273)](r.DomEmitterMixin)}[ar(256)](){const e=ar,t=this[e(251)],n=t[e(258)][e(268)](e(230)),o=t[e(258)][e(268)](s.Notification);if(!n[e(257)])throw new r.CKEditorError(e(253),this);if(!n[e(265)])throw new r.CKEditorError(e(248),this);return this[e(255)][e(247)](window,e(254),(()=>this[e(296)]=!0)),this[e(255)][e(247)](window,e(274),(()=>this[e(296)]=!1)),this[e(251)][e(233)][e(264)](e(284),10),this[e(251)][e(233)][e(264)](e(280),20),dr[e(244)][e(271)](n[e(257)],n[e(265)],{timeout:1e3*this[e(251)][e(233)][e(268)](e(284)),requestTimeout:1e3*this[e(251)][e(233)][e(268)](e(280))})[e(267)]((t=>{const n=e;if(this[n(294)]=t,this[n(269)](n(289)).to(t,n(289),this,n(296),((e,t)=>(n(276)!==e&&(this[n(291)]=!0),t||e!==Dt[n(237)]?Dt[n(281)]:this[n(289)]==Dt[n(281)]&&this[n(291)]?(this[n(291)]=!1,this[n(286)](),Dt[n(279)]):Dt[n(237)]))),this[n(294)].on(n(231),((e,t)=>{const s=n;if(s(272)!==t[s(240)])throw console[s(231)](t),new r.CKEditorError(s(245),null,{originalError:t});o[s(226)](s(229),{title:s(270),namespace:s(263)})})),!t.me)return new Promise((e=>t.on(n(232),e)))}))[e(298)]((t=>{const n=e;throw console[n(231)](t),new r.CKEditorError(n(245),null,{originalError:t})}))}[ar(260)](e){const t=ar;if(t(250)!=typeof e[t(234)])throw new r.CKEditorError(t(239),this);if(this[t(238)](e))throw new r.CKEditorError(t(236),this,{name:e[t(249)][t(246)]});this[t(277)][t(278)](e)}[ar(225)](e){const t=ar;this[t(277)][t(228)](e)}[ar(238)](e){const t=ar;return this[t(277)][t(292)](e)}[ar(286)](){const e=ar;return this[e(294)][e(234)]()[e(267)]((()=>Promise[e(297)](Array[e(275)](this[e(277)],(t=>t[e(234)]())))))[e(267)]((()=>this[e(289)]=Dt[e(237)]))[e(298)]((t=>{const n=e;throw console[n(231)](t),new r.CKEditorError(n(299),this[n(251)])}))}[ar(295)](){const e=ar;this[e(294)]&&this[e(294)][e(283)](),this[e(289)]=Dt[e(281)],this[e(255)][e(285)](),super[e(295)]()}}function ur(e,t){const n=cr();return(ur=function(e,t){return n[e-=224]})(e,t)}dr[ar(244)]=Vt,dr[ar(290)]=1e3;const lr=dr;var pr=__webpack_require__(211);function hr(e,t){const n=mr();return(hr=function(e,t){return n[e-=418]})(e,t)}const fr=hr;function mr(){const e=["getUserBySessionId","mySessionId","requires","242802nASJHe","5025630QtDGZa","delete","user","channelSessions","plugins","change:state","get","21356OpMDBW","_handleSessionRemove","sessionId","set","getUserSessions","1618834nQBrGI","_createUser","assign","1119087FKcOeZ","connection","context","values","getUserRole","connected","allConnectedUsers","sessions-register-already-registered","add","16RmSLpj","getUser","_registeredSessions","sessions-unregister-not-exist","_uniqueUsersCount","clear","7125TTHBKy","75eRayNK","init","sessionAdd:","_users","role","defineMe","stopListening","channelConnectedUsers","Sessions","addUser","register","fire","forEach","isMe","unregister","16466SULARX","size","state","listenTo","_handleSessionAdd","1fRmCQu","has","orderNumber","pluginName","remove"];return(mr=function(){return e})()}!function(e,t){const n=hr,r=e();for(;;)try{if(125281===-parseInt(n(462))/1*(-parseInt(n(457))/2)+parseInt(n(442))/3*(parseInt(n(418))/4)+parseInt(n(441))/5+-parseInt(n(470))/6+-parseInt(n(423))/7+-parseInt(n(435))/8*(parseInt(n(426))/9)+parseInt(n(471))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(mr);class yr extends n.ContextPlugin{static get[fr(465)](){return fr(450)}static get[fr(469)](){return[lr,pr.Users]}constructor(e){const t=fr;super(e),this[t(474)]=new Map,this[t(449)]=new Map,this[t(432)]=new r.Collection,this[t(437)]=new Map,this[t(439)]=0,this[t(445)]=this[t(428)][t(475)][t(477)](pr.Users)}[fr(443)](){const e=fr,t=this[e(428)][e(475)][e(477)](lr);this[e(460)](t,e(476),((t,n,r)=>{const s=e;if(s(431)!==r)this[s(474)][s(454)]((e=>e[s(440)]())),this[s(449)][s(454)]((e=>e[s(440)]())),this[s(432)][s(440)]();else for(const[e,t]of this[s(437)])for(const n of t)this[s(461)](e,n)})),this[e(424)](t[e(427)].me,!0)}[fr(452)](e,t){const n=fr;if(this[n(437)][n(463)](e))throw new r.CKEditorError(n(433),null,{channelId:e});this[n(437)][n(421)](e,t),this[n(474)][n(421)](e,new r.Collection),this[n(449)][n(421)](e,new r.Collection),this[n(460)](t,n(434),((t,r)=>this[n(461)](e,r))),this[n(460)](t,n(466),((t,r)=>this[n(419)](e,r)));for(const r of t)this[n(461)](e,r)}[fr(456)](e){const t=fr;if(!this[t(437)][t(463)](e))throw new r.CKEditorError(t(438),null,{channelId:e});const n=this[t(437)][t(477)](e);this[t(448)](n);for(const r of n)t(431)===this[t(428)][t(475)][t(477)](lr)[t(459)]&&this[t(419)](e,r);this[t(437)][t(472)](e),this[t(474)][t(472)](e),this[t(449)][t(472)](e)}get[fr(468)](){const e=fr;return this[e(428)][e(475)][e(477)](lr)[e(427)][e(420)]}[fr(467)](e){const t=fr;for(const n of this[t(474)][t(429)]())for(const r of n)if(r.id===e)return r[t(473)]}[fr(422)](e,t){const n=fr,r=t?[this[n(474)][n(477)](t)]:this[n(474)][n(429)](),s=new Set;for(const t of r)for(const r of t)r[n(473)].id===e.id&&s[n(434)](r.id);return s}[fr(430)](e){const t=fr;for(const n of this[t(474)][t(429)]())for(const r of n)if(r[t(473)]===e)return r[t(446)]}[fr(461)](e,t){const n=fr;if(n(431)!==this[n(428)][n(475)][n(477)](lr)[n(459)])return;const r=t[n(473)],s=this[n(445)][n(436)](r.id)||this[n(424)](r),o=Object[n(425)]({},t,{user:s});this[n(474)][n(477)](e)[n(434)](o);const i=this[n(449)][n(477)](e);i[n(463)](s.id)||i[n(434)](s),this[n(432)][n(463)](s.id)||this[n(432)][n(434)](s,s[n(455)]?0:void 0),this[n(453)](n(444)+e,{channelId:e,session:o})}[fr(419)](e,t){const n=fr;if(n(431)!==this[n(428)][n(475)][n(477)](lr)[n(459)])return;const r=this[n(449)][n(477)](e),s=t[n(473)];s.id&&(this[n(474)][n(477)](e)[n(466)](t.id),r[n(463)](s.id)&&!this[n(422)](s,e)[n(458)]&&r[n(466)](s.id),this[n(432)][n(477)](s.id)&&!this[n(422)](s)[n(458)]&&this[n(432)][n(466)](s.id))}[fr(424)](e,t){const n=fr,r=this[n(445)][n(451)](e);return t&&this[n(445)][n(447)](e.id),r[n(464)]=this[n(439)]++,r}}var gr=__webpack_require__(673),br=__webpack_require__.n(gr),Or=__webpack_require__(535),wr={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};br()(Or.A,wr);Or.A.locals;const Ir=Sr;function vr(){const e=["2241729IwzMtI","Escape","getContainedElement","createUserMarkerOperations","getMarkerClass","editing","conversion","batch","user:position","commands","marker","414pVEKBh","removeMarker","parent","toDomElement","update:user:range","classList","stopListening","keydown","delete","startsWith","user:","user:position:","change","schema","selection","enqueueChange","isSimilar","editingDowncast","$text","removeClass","requires","createUIElement","has","oldRange","editor","view","add","rootName","name","model","markerToElement","60PpeNAA","tableCell","plugins","ck-user__marker_hovered","7096TvtABf","3909960ubPiHi","markerToHighlight","split","isCollapsed","afterInit","markerRange","nodeAfter","getPositions","highest","getStart","detach","fromRange","79050zBhHVp","markerNameToElements","getFirstRange","for","get","user:range:","isInline","reconvertMarker","updateMarker","render","type","set","markerName","span","checkChild","</span>⁠","_domEmitter","user:range","applyOperation","undo","change:range","35704PopWQD","data-session-id","getSelectionClass","$graveyard","listenTo","element","userPositionMarker","getRange","isLimit","getNearestSelectionRange","mapper","markers","remove","getAttribute","contenteditable","root","_createdBatches","mouseenter","innerHTML","deletionPosition","size","2456150yOnxqn","destroy","document","orderNumber","4SOyQeK","mySessionId","getCustomProperty","addEventListener","createRange","pluginName","mouseleave","setCustomProperty","UserMarkers","start",'⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span><span class="ck-user__marker-tooltip" contenteditable="false" spellcheck="false">',"isObject","init","hasDomSelection","newRange","hasContent","toRange","addMarker","ck-user__selection","clear","end","getUserBySessionId","color","ck-user__marker ","10408vLQhPK"];return(vr=function(){return e})()}function Sr(e,t){const n=vr();return(Sr=function(e,t){return n[e-=271]})(e,t)}!function(e,t){const n=Sr,r=e();for(;;)try{if(243413===-parseInt(n(397))/1*(-parseInt(n(373))/2)+-parseInt(n(279))/3*(-parseInt(n(314))/4)+-parseInt(n(327))/5*(parseInt(n(310))/6)+parseInt(n(398))/7+parseInt(n(348))/8+-parseInt(n(315))/9+parseInt(n(369))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(vr);class Ar extends n.Plugin{constructor(){const e=Sr;super(...arguments),this[e(343)]=new((0,r.DomEmitterMixin)())}static get[Ir(299)](){return[yr]}static get[Ir(378)](){return Ir(381)}[Ir(385)](){const e=Ir,t=this[e(303)],n=t[e(312)][e(331)](yr);t[e(274)][e(330)](e(296))[e(309)]({model:e(276),view:(r,{writer:s})=>function(t,n,r,s){const o=e,i=t[o(339)][o(317)](":")[2],a=r[o(394)](i);if(!a||i===r[o(374)])return;if(!s[o(308)][o(292)][o(341)](t[o(320)][o(382)],o(297)))return;const c={class:o(396)+a[o(395)][o(272)](),"data-name":a[o(307)],"data-session-id":i},d=s[o(308)][o(359)][o(331)](t[o(339)])[o(324)](),u=d[o(321)],l=s[o(308)][o(292)];if(u&&l[o(384)](u)&&l[o(333)](u)&&!s[o(308)][o(359)][o(331)](o(332)+i)[o(355)]()[o(318)])return;const p=d[o(281)];return s[o(308)][o(292)][o(356)](p)&&!s[o(308)][o(388)](p)&&(c[o(362)]=!1),function(e,t,n){const r=o,s=e[r(300)](r(340),t);return e[r(380)](r(354),!0,s),s[r(336)]=function(e){const t=r,s=this[t(282)](e);return s[t(366)]=t(383)+n[t(307)]+t(342),s[t(376)](t(365),(()=>{const e=t;s[e(284)][e(305)](e(313))})),s[t(376)](t(379),(()=>{const e=t;s[e(284)][e(360)](e(313))})),s},s[r(295)]=function(e){const t=r;return!(!this[t(375)](t(354))||!e[t(375)](t(354))||this[t(361)](t(349))!=e[t(361)](t(349)))},s}(n,c,a)}(r,s,n,t)}),t[e(274)][e(330)](e(296))[e(316)]({model:e(344),view:t=>function(t,n){const r=e,s=t[r(339)][r(317)](":")[2];if(s===n[r(374)])return null;const o=n[r(394)](s);return o?{id:s,classes:[r(391),o[r(395)][r(350)]()],attributes:{"data-session-id":s},priority:2e3+o[r(372)]}:{id:s,classes:[]}}(t,n)}),function(t){const n=e,r=t[n(308)],s=new Map,i=t[n(312)][n(331)](yr);r[n(359)].on(n(283),((e,a,c,d)=>{const u=n;if(!d&&s[u(331)](a[u(307)]))return s[u(331)](a[u(307)])[u(325)](),void s[u(287)](a[u(307)]);const l=a[u(307)][u(317)](":")[2];if(l===i[u(374)])return;const p=u(290)+l;r[u(359)][u(301)](p)&&t[u(273)][u(334)](p),a.on(u(347),((e,t,n)=>{const i=u;if(i(351)!=t[i(363)][i(306)]&&i(351)==a[i(355)]()[i(363)][i(306)]&&!s[i(301)](a[i(307)])){const e=r[i(292)][i(357)](n[i(367)]);if(e){const t=o.LiveRange[i(326)](e);s[i(338)](a[i(307)],t),t.on(i(347),((e,n,o)=>{const c=i;if(c(351)==t[c(363)][c(306)]){const e=r[c(292)][c(357)](o[c(367)]);e?(t[c(382)]=e[c(382)],t[c(393)]=e[c(393)]):(s[c(287)](a[c(307)]),t[c(325)]())}}))}}}))})),r[n(371)].on(n(291),(()=>{const e=n;s[e(368)]>0&&r[e(294)]({isUndoable:!1},(t=>{const n=e;for(const[e,o]of s)n(351)==r[n(359)][n(331)](e)[n(355)]()[n(363)][n(306)]&&(Pr(e[n(317)](":")[2],o[n(389)](),r,t),o[n(325)]());s[n(392)]()}))}))}(t),this[e(343)][e(352)](r.global[e(371)],e(286),((n,{key:r})=>{const s=e;s(399)===r&&function(e){const t=s;e[t(273)][t(304)][t(291)]((n=>{const r=t;for(const t of e[r(308)][r(359)]){if(!t[r(307)][r(288)](r(276)))continue;const s=e[r(273)][r(358)][r(328)](t[r(307)]);if(s)for(const e of s)n[r(298)](r(313),e)}}))}(t)}),{useCapture:!0})}[Ir(319)](){const e=Ir,t=this[e(303)],n=t[e(277)][e(331)](e(346));n&&t[e(308)].on(e(345),((r,s)=>{const o=e,i=s[0];if(o(278)!=i[o(337)]||!i[o(307)][o(288)](o(289)))return;const a=i[o(275)];n[o(364)][o(301)](a)&&(i[o(387)]=i[o(302)]?t[o(308)][o(377)](i[o(302)][o(382)],i[o(302)][o(393)]):null)}),{priority:e(323)})}[Ir(370)](){const e=Ir;return this[e(343)][e(285)](),super[e(370)]()}[Ir(271)](){const e=Ir,t=this[e(303)],n=t[e(308)][e(371)],r=t[e(312)][e(331)](yr);t[e(308)][e(294)]({isUndoable:!1},(s=>{const o=e,i=o(332)+r[o(374)],a=o(290)+r[o(374)],c=t[o(308)][o(359)][o(301)](i);t[o(273)][o(304)][o(386)]?Pr(r[o(374)],n[o(293)][o(329)](),t[o(308)],s):c&&(s[o(280)](i),s[o(280)](a))}))}}function Pr(e,t,n,r){const s=Ir,o=s(332)+e,i=s(290)+e,a=t[s(400)]();let c=t[s(382)];a&&a.is(s(353),s(311))&&(c=function(e,t){const n=s;for(const r of e[n(322)]())if(t[n(292)][n(341)](r,n(297)))return r}(t,n),t=r[s(377)](c));const d=r[s(377)](c);n[s(359)][s(301)](o)?(r[s(335)](o,{range:t}),r[s(335)](i,{range:d})):(r[s(390)](o,{range:t,usingOperation:!0}),r[s(390)](i,{range:d,usingOperation:!0}))}function Tr(e,t,n){const r=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return r({string:"Sending data to the server.",id:"PENDING_ACTION_SENDING_DATA"});case"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.":return r("The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.");case"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.":return r("The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");case"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.":return r("The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");case"The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.":return r("The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.");case"Synchronization issue":return r("Synchronization issue");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return r({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}const _r=_e.Reader,kr=_e.Writer,Cr=_e.util,Er=_e.roots.default||(_e.roots.default={}),jr=Er.AttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.range=null,e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&Er.Range.encode(e.range,t.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.AttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.range=Er.Range.decode(e,e.uint32());break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.range&&e.hasOwnProperty("range")){let t=Er.Range.verify(e.range);if(t)return"range."+t}return null!=e.key&&e.hasOwnProperty("key")&&!Cr.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!Cr.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!Cr.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.AttributeOperation)return e;let t=new Er.AttributeOperation;if(null!=e.range){if("object"!=typeof e.range)throw TypeError(".AttributeOperation.range: object expected");t.range=Er.Range.fromObject(e.range)}return null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.range=null,n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.range&&e.hasOwnProperty("range")&&(n.range=Er.Range.toObject(e.range,t)),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/AttributeOperation"},e})(),Rr=Er.InsertOperation=(()=>{function e(e){if(this.nodes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.nodes=Cr.emptyArray,e.prototype.shouldReceiveAttributes=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=kr.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&Er.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.nodes&&e.nodes.length)for(let n=0;n<e.nodes.length;++n)Er.Element.encode(e.nodes[n],t.uint32(18).fork()).ldelim();return null!=e.shouldReceiveAttributes&&Object.hasOwnProperty.call(e,"shouldReceiveAttributes")&&t.uint32(24).bool(e.shouldReceiveAttributes),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.InsertOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=Er.Position.decode(e,e.uint32());break;case 2:r.nodes&&r.nodes.length||(r.nodes=[]),r.nodes.push(Er.Element.decode(e,e.uint32()));break;case 3:r.shouldReceiveAttributes=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=Er.Position.verify(e.position);if(t)return"position."+t}if(null!=e.nodes&&e.hasOwnProperty("nodes")){if(!Array.isArray(e.nodes))return"nodes: array expected";for(let t=0;t<e.nodes.length;++t){let n=Er.Element.verify(e.nodes[t]);if(n)return"nodes."+n}}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&"boolean"!=typeof e.shouldReceiveAttributes?"shouldReceiveAttributes: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.InsertOperation)return e;let t=new Er.InsertOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".InsertOperation.position: object expected");t.position=Er.Position.fromObject(e.position)}if(e.nodes){if(!Array.isArray(e.nodes))throw TypeError(".InsertOperation.nodes: array expected");t.nodes=[];for(let n=0;n<e.nodes.length;++n){if("object"!=typeof e.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");t.nodes[n]=Er.Element.fromObject(e.nodes[n])}}return null!=e.shouldReceiveAttributes&&(t.shouldReceiveAttributes=Boolean(e.shouldReceiveAttributes)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.nodes=[]),t.defaults&&(n.position=null,n.shouldReceiveAttributes=!1,n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=Er.Position.toObject(e.position,t)),e.nodes&&e.nodes.length){n.nodes=[];for(let r=0;r<e.nodes.length;++r)n.nodes[r]=Er.Element.toObject(e.nodes[r],t)}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=e.shouldReceiveAttributes),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/InsertOperation"},e})(),Dr=Er.MarkerOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.oldRange=null,e.prototype.newRange=null,e.prototype.affectsData=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.oldRange&&Object.hasOwnProperty.call(e,"oldRange")&&Er.Range.encode(e.oldRange,t.uint32(18).fork()).ldelim(),null!=e.newRange&&Object.hasOwnProperty.call(e,"newRange")&&Er.Range.encode(e.newRange,t.uint32(26).fork()).ldelim(),null!=e.affectsData&&Object.hasOwnProperty.call(e,"affectsData")&&t.uint32(32).bool(e.affectsData),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.MarkerOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.name=e.string();break;case 2:r.oldRange=Er.Range.decode(e,e.uint32());break;case 3:r.newRange=Er.Range.decode(e,e.uint32());break;case 4:r.affectsData=e.bool();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!Cr.isString(e.name))return"name: string expected";if(null!=e.oldRange&&e.hasOwnProperty("oldRange")){let t=Er.Range.verify(e.oldRange);if(t)return"oldRange."+t}if(null!=e.newRange&&e.hasOwnProperty("newRange")){let t=Er.Range.verify(e.newRange);if(t)return"newRange."+t}return null!=e.affectsData&&e.hasOwnProperty("affectsData")&&"boolean"!=typeof e.affectsData?"affectsData: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.MarkerOperation)return e;let t=new Er.MarkerOperation;if(null!=e.name&&(t.name=String(e.name)),null!=e.oldRange){if("object"!=typeof e.oldRange)throw TypeError(".MarkerOperation.oldRange: object expected");t.oldRange=Er.Range.fromObject(e.oldRange)}if(null!=e.newRange){if("object"!=typeof e.newRange)throw TypeError(".MarkerOperation.newRange: object expected");t.newRange=Er.Range.fromObject(e.newRange)}return null!=e.affectsData&&(t.affectsData=Boolean(e.affectsData)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.name="",n.oldRange=null,n.newRange=null,n.affectsData=!1,n.wasUndone=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.oldRange&&e.hasOwnProperty("oldRange")&&(n.oldRange=Er.Range.toObject(e.oldRange,t)),null!=e.newRange&&e.hasOwnProperty("newRange")&&(n.newRange=Er.Range.toObject(e.newRange,t)),null!=e.affectsData&&e.hasOwnProperty("affectsData")&&(n.affectsData=e.affectsData),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MarkerOperation"},e})(),Nr=Er.MergeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.targetPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&Er.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&Er.Position.encode(e.targetPosition,t.uint32(18).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&Er.Position.encode(e.graveyardPosition,t.uint32(26).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(32).uint32(e.howMany),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.MergeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=Er.Position.decode(e,e.uint32());break;case 2:r.targetPosition=Er.Position.decode(e,e.uint32());break;case 3:r.graveyardPosition=Er.Position.decode(e,e.uint32());break;case 4:r.howMany=e.uint32();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=Er.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=Er.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=Er.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}return null!=e.howMany&&e.hasOwnProperty("howMany")&&!Cr.isInteger(e.howMany)?"howMany: integer expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.MergeOperation)return e;let t=new Er.MergeOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");t.sourcePosition=Er.Position.fromObject(e.sourcePosition)}if(null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");t.targetPosition=Er.Position.fromObject(e.targetPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");t.graveyardPosition=Er.Position.fromObject(e.graveyardPosition)}return null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.targetPosition=null,n.graveyardPosition=null,n.howMany=0,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=Er.Position.toObject(e.sourcePosition,t)),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=Er.Position.toObject(e.targetPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=Er.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MergeOperation"},e})(),xr=Er.MoveOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.howMany=0,e.prototype.targetPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&Er.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(16).uint32(e.howMany),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&Er.Position.encode(e.targetPosition,t.uint32(26).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.MoveOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=Er.Position.decode(e,e.uint32());break;case 2:r.howMany=e.uint32();break;case 3:r.targetPosition=Er.Position.decode(e,e.uint32());break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=Er.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!Cr.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=Er.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.MoveOperation)return e;let t=new Er.MoveOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");t.sourcePosition=Er.Position.fromObject(e.sourcePosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MoveOperation.targetPosition: object expected");t.targetPosition=Er.Position.fromObject(e.targetPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=Er.Position.toObject(e.sourcePosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=Er.Position.toObject(e.targetPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MoveOperation"},e})(),Vr=Er.RenameOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.oldName="",e.prototype.newName="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&Er.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.oldName&&Object.hasOwnProperty.call(e,"oldName")&&t.uint32(18).string(e.oldName),null!=e.newName&&Object.hasOwnProperty.call(e,"newName")&&t.uint32(26).string(e.newName),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.RenameOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=Er.Position.decode(e,e.uint32());break;case 2:r.oldName=e.string();break;case 3:r.newName=e.string();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=Er.Position.verify(e.position);if(t)return"position."+t}return null!=e.oldName&&e.hasOwnProperty("oldName")&&!Cr.isString(e.oldName)?"oldName: string expected":null!=e.newName&&e.hasOwnProperty("newName")&&!Cr.isString(e.newName)?"newName: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.RenameOperation)return e;let t=new Er.RenameOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".RenameOperation.position: object expected");t.position=Er.Position.fromObject(e.position)}return null!=e.oldName&&(t.oldName=String(e.oldName)),null!=e.newName&&(t.newName=String(e.newName)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=Er.Position.toObject(e.position,t)),null!=e.oldName&&e.hasOwnProperty("oldName")&&(n.oldName=e.oldName),null!=e.newName&&e.hasOwnProperty("newName")&&(n.newName=e.newName),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RenameOperation"},e})(),Mr=Er.RootAttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.RootAttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.root&&e.hasOwnProperty("root")&&!Cr.isString(e.root)?"root: string expected":null!=e.key&&e.hasOwnProperty("key")&&!Cr.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!Cr.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!Cr.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.RootAttributeOperation)return e;let t=new Er.RootAttributeOperation;return null!=e.root&&(t.root=String(e.root)),null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.root="",n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootAttributeOperation"},e})(),Br=Er.RootOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rootName="",e.prototype.elementName="",e.prototype.isAdd=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.rootName&&Object.hasOwnProperty.call(e,"rootName")&&t.uint32(10).string(e.rootName),null!=e.elementName&&Object.hasOwnProperty.call(e,"elementName")&&t.uint32(18).string(e.elementName),null!=e.isAdd&&Object.hasOwnProperty.call(e,"isAdd")&&t.uint32(24).bool(e.isAdd),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.RootOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.rootName=e.string();break;case 2:r.elementName=e.string();break;case 3:r.isAdd=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.rootName&&e.hasOwnProperty("rootName")&&!Cr.isString(e.rootName)?"rootName: string expected":null!=e.elementName&&e.hasOwnProperty("elementName")&&!Cr.isString(e.elementName)?"elementName: string expected":null!=e.isAdd&&e.hasOwnProperty("isAdd")&&"boolean"!=typeof e.isAdd?"isAdd: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.RootOperation)return e;let t=new Er.RootOperation;return null!=e.rootName&&(t.rootName=String(e.rootName)),null!=e.elementName&&(t.elementName=String(e.elementName)),null!=e.isAdd&&(t.isAdd=Boolean(e.isAdd)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.rootName="",n.elementName="",n.isAdd=!1,n.wasUndone=!1),null!=e.rootName&&e.hasOwnProperty("rootName")&&(n.rootName=e.rootName),null!=e.elementName&&e.hasOwnProperty("elementName")&&(n.elementName=e.elementName),null!=e.isAdd&&e.hasOwnProperty("isAdd")&&(n.isAdd=e.isAdd),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootOperation"},e})(),Ur=Er.SplitOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.splitPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.insertionPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.splitPosition&&Object.hasOwnProperty.call(e,"splitPosition")&&Er.Position.encode(e.splitPosition,t.uint32(10).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&Er.Position.encode(e.graveyardPosition,t.uint32(18).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(24).uint32(e.howMany),null!=e.insertionPosition&&Object.hasOwnProperty.call(e,"insertionPosition")&&Er.Position.encode(e.insertionPosition,t.uint32(34).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.SplitOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.splitPosition=Er.Position.decode(e,e.uint32());break;case 2:r.graveyardPosition=Er.Position.decode(e,e.uint32());break;case 3:r.howMany=e.uint32();break;case 4:r.insertionPosition=Er.Position.decode(e,e.uint32());break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.splitPosition&&e.hasOwnProperty("splitPosition")){let t=Er.Position.verify(e.splitPosition);if(t)return"splitPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=Er.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!Cr.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")){let t=Er.Position.verify(e.insertionPosition);if(t)return"insertionPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.SplitOperation)return e;let t=new Er.SplitOperation;if(null!=e.splitPosition){if("object"!=typeof e.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");t.splitPosition=Er.Position.fromObject(e.splitPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");t.graveyardPosition=Er.Position.fromObject(e.graveyardPosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.insertionPosition){if("object"!=typeof e.insertionPosition)throw TypeError(".SplitOperation.insertionPosition: object expected");t.insertionPosition=Er.Position.fromObject(e.insertionPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.splitPosition=null,n.graveyardPosition=null,n.howMany=0,n.insertionPosition=null,n.wasUndone=!1),null!=e.splitPosition&&e.hasOwnProperty("splitPosition")&&(n.splitPosition=Er.Position.toObject(e.splitPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=Er.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(n.insertionPosition=Er.Position.toObject(e.insertionPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SplitOperation"},e})(),Jr=Er.Position=(()=>{function e(e){if(this.path=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.rootMain=!1,e.prototype.rootGraveyard=!1,e.prototype.path=Cr.emptyArray,e.prototype.stickiness="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=kr.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.rootMain&&Object.hasOwnProperty.call(e,"rootMain")&&t.uint32(16).bool(e.rootMain),null!=e.rootGraveyard&&Object.hasOwnProperty.call(e,"rootGraveyard")&&t.uint32(24).bool(e.rootGraveyard),null!=e.path&&e.path.length){t.uint32(34).fork();for(let n=0;n<e.path.length;++n)t.uint32(e.path[n]);t.ldelim()}return null!=e.stickiness&&Object.hasOwnProperty.call(e,"stickiness")&&t.uint32(42).string(e.stickiness),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.Position;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.rootMain=e.bool();break;case 3:r.rootGraveyard=e.bool();break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.path.push(e.uint32())}else r.path.push(e.uint32());break;case 5:r.stickiness=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.root&&e.hasOwnProperty("root")&&!Cr.isString(e.root))return"root: string expected";if(null!=e.rootMain&&e.hasOwnProperty("rootMain")&&"boolean"!=typeof e.rootMain)return"rootMain: boolean expected";if(null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&"boolean"!=typeof e.rootGraveyard)return"rootGraveyard: boolean expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(let t=0;t<e.path.length;++t)if(!Cr.isInteger(e.path[t]))return"path: integer[] expected"}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&!Cr.isString(e.stickiness)?"stickiness: string expected":null},e.fromObject=function(e){if(e instanceof Er.Position)return e;let t=new Er.Position;if(null!=e.root&&(t.root=String(e.root)),null!=e.rootMain&&(t.rootMain=Boolean(e.rootMain)),null!=e.rootGraveyard&&(t.rootGraveyard=Boolean(e.rootGraveyard)),e.path){if(!Array.isArray(e.path))throw TypeError(".Position.path: array expected");t.path=[];for(let n=0;n<e.path.length;++n)t.path[n]=e.path[n]>>>0}return null!=e.stickiness&&(t.stickiness=String(e.stickiness)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.path=[]),t.defaults&&(n.root="",n.rootMain=!1,n.rootGraveyard=!1,n.stickiness=""),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.rootMain&&e.hasOwnProperty("rootMain")&&(n.rootMain=e.rootMain),null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&(n.rootGraveyard=e.rootGraveyard),e.path&&e.path.length){n.path=[];for(let t=0;t<e.path.length;++t)n.path[t]=e.path[t]}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&(n.stickiness=e.stickiness),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Position"},e})(),qr=Er.Range=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.start=null,e.prototype.end=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&Er.Position.encode(e.start,t.uint32(10).fork()).ldelim(),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&Er.Position.encode(e.end,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.Range;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.start=Er.Position.decode(e,e.uint32());break;case 2:r.end=Er.Position.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.start&&e.hasOwnProperty("start")){let t=Er.Position.verify(e.start);if(t)return"start."+t}if(null!=e.end&&e.hasOwnProperty("end")){let t=Er.Position.verify(e.end);if(t)return"end."+t}return null},e.fromObject=function(e){if(e instanceof Er.Range)return e;let t=new Er.Range;if(null!=e.start){if("object"!=typeof e.start)throw TypeError(".Range.start: object expected");t.start=Er.Position.fromObject(e.start)}if(null!=e.end){if("object"!=typeof e.end)throw TypeError(".Range.end: object expected");t.end=Er.Position.fromObject(e.end)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.start=null,n.end=null),null!=e.start&&e.hasOwnProperty("start")&&(n.start=Er.Position.toObject(e.start,t)),null!=e.end&&e.hasOwnProperty("end")&&(n.end=Er.Position.toObject(e.end,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Range"},e})(),Lr=Er.Element=(()=>{function e(e){if(this.children=[],this.attributesBoolean={},e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.children=Cr.emptyArray,e.prototype.data="",e.prototype.attributesBoolean=Cr.emptyObject,e.prototype.attributesJson="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=kr.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.children&&e.children.length)for(let n=0;n<e.children.length;++n)Er.Element.encode(e.children[n],t.uint32(18).fork()).ldelim();if(null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).string(e.data),null!=e.attributesBoolean&&Object.hasOwnProperty.call(e,"attributesBoolean"))for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(16).bool(e.attributesBoolean[n[r]]).ldelim();return null!=e.attributesJson&&Object.hasOwnProperty.call(e,"attributesJson")&&t.uint32(42).string(e.attributesJson),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n,r,s=void 0===t?e.len:e.pos+t,o=new Er.Element;for(;e.pos<s;){let t=e.uint32();switch(t>>>3){case 1:o.name=e.string();break;case 2:o.children&&o.children.length||(o.children=[]),o.children.push(Er.Element.decode(e,e.uint32()));break;case 3:o.data=e.string();break;case 4:{o.attributesBoolean===Cr.emptyObject&&(o.attributesBoolean={});let t=e.uint32()+e.pos;for(n="",r=!1;e.pos<t;){let t=e.uint32();switch(t>>>3){case 1:n=e.string();break;case 2:r=e.bool();break;default:e.skipType(7&t)}}o.attributesBoolean[n]=r;break}case 5:o.attributesJson=e.string();break;default:e.skipType(7&t)}}return o},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!Cr.isString(e.name))return"name: string expected";if(null!=e.children&&e.hasOwnProperty("children")){if(!Array.isArray(e.children))return"children: array expected";for(let t=0;t<e.children.length;++t){let n=Er.Element.verify(e.children[t]);if(n)return"children."+n}}if(null!=e.data&&e.hasOwnProperty("data")&&!Cr.isString(e.data))return"data: string expected";if(null!=e.attributesBoolean&&e.hasOwnProperty("attributesBoolean")){if(!Cr.isObject(e.attributesBoolean))return"attributesBoolean: object expected";let t=Object.keys(e.attributesBoolean);for(let n=0;n<t.length;++n)if("boolean"!=typeof e.attributesBoolean[t[n]])return"attributesBoolean: boolean{k:string} expected"}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&!Cr.isString(e.attributesJson)?"attributesJson: string expected":null},e.fromObject=function(e){if(e instanceof Er.Element)return e;let t=new Er.Element;if(null!=e.name&&(t.name=String(e.name)),e.children){if(!Array.isArray(e.children))throw TypeError(".Element.children: array expected");t.children=[];for(let n=0;n<e.children.length;++n){if("object"!=typeof e.children[n])throw TypeError(".Element.children: object expected");t.children[n]=Er.Element.fromObject(e.children[n])}}if(null!=e.data&&(t.data=String(e.data)),e.attributesBoolean){if("object"!=typeof e.attributesBoolean)throw TypeError(".Element.attributesBoolean: object expected");t.attributesBoolean={};for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.attributesBoolean[n[r]]=Boolean(e.attributesBoolean[n[r]])}return null!=e.attributesJson&&(t.attributesJson=String(e.attributesJson)),t},e.toObject=function(e,t){t||(t={});let n,r={};if((t.arrays||t.defaults)&&(r.children=[]),(t.objects||t.defaults)&&(r.attributesBoolean={}),t.defaults&&(r.name="",r.data="",r.attributesJson=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),e.children&&e.children.length){r.children=[];for(let n=0;n<e.children.length;++n)r.children[n]=Er.Element.toObject(e.children[n],t)}if(null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),e.attributesBoolean&&(n=Object.keys(e.attributesBoolean)).length){r.attributesBoolean={};for(let t=0;t<n.length;++t)r.attributesBoolean[n[t]]=e.attributesBoolean[n[t]]}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&(r.attributesJson=e.attributesJson),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},e})();class Gr{constructor(){this._protobufRoot=t}getDescriptor(e){return new Yr(this._protobufRoot[e])}}class Yr{constructor(e){this._protobuf=e}compress(e){const t=this._protobuf.verify(e);if(t)throw Error(t);return this._protobuf.encode(this._protobuf.create(e)).finish()}decompress(e){return this._protobuf.toObject(this._protobuf.decode(e),{oneofs:!0})}}const Fr=function(){this.__data__=[],this.size=0};const Hr=function(e,t){return e===t||e!=e&&t!=t};const zr=function(e,t){for(var n=e.length;n--;)if(Hr(e[n][0],t))return n;return-1};var Kr=Array.prototype.splice;const Wr=function(e){var t=this.__data__,n=zr(t,e);return!(n<0)&&(n==t.length-1?t.pop():Kr.call(t,n,1),--this.size,!0)};const Qr=function(e){var t=this.__data__,n=zr(t,e);return n<0?void 0:t[n][1]};const $r=function(e){return zr(this.__data__,e)>-1};const Zr=function(e,t){var n=this.__data__,r=zr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Xr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xr.prototype.clear=Fr,Xr.prototype.delete=Wr,Xr.prototype.get=Qr,Xr.prototype.has=$r,Xr.prototype.set=Zr;const es=Xr;const ts=function(){this.__data__=new es,this.size=0};const ns=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const rs=function(e){return this.__data__.get(e)};const ss=function(e){return this.__data__.has(e)};const os="object"==typeof global&&global&&global.Object===Object&&global;var is="object"==typeof self&&self&&self.Object===Object&&self;const as=os||is||Function("return this")();const cs=as.Symbol;var ds=Object.prototype,us=ds.hasOwnProperty,ls=ds.toString,ps=cs?cs.toStringTag:void 0;const hs=function(e){var t=us.call(e,ps),n=e[ps];try{e[ps]=void 0;var r=!0}catch(e){}var s=ls.call(e);return r&&(t?e[ps]=n:delete e[ps]),s};var fs=Object.prototype.toString;const ms=function(e){return fs.call(e)};var ys=cs?cs.toStringTag:void 0;const gs=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ys&&ys in Object(e)?hs(e):ms(e)};const bs=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Os=function(e){if(!bs(e))return!1;var t=gs(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const ws=as["__core-js_shared__"];var Is,vs=(Is=/[^.]+$/.exec(ws&&ws.keys&&ws.keys.IE_PROTO||""))?"Symbol(src)_1."+Is:"";const Ss=function(e){return!!vs&&vs in e};var As=Function.prototype.toString;const Ps=function(e){if(null!=e){try{return As.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Ts=/^\[object .+?Constructor\]$/,_s=Function.prototype,ks=Object.prototype,Cs=_s.toString,Es=ks.hasOwnProperty,js=RegExp("^"+Cs.call(Es).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Rs=function(e){return!(!bs(e)||Ss(e))&&(Os(e)?js:Ts).test(Ps(e))};const Ds=function(e,t){return null==e?void 0:e[t]};const Ns=function(e,t){var n=Ds(e,t);return Rs(n)?n:void 0};const xs=Ns(as,"Map");const Vs=Ns(Object,"create");const Ms=function(){this.__data__=Vs?Vs(null):{},this.size=0};const Bs=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var Us=Object.prototype.hasOwnProperty;const Js=function(e){var t=this.__data__;if(Vs){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Us.call(t,e)?t[e]:void 0};var qs=Object.prototype.hasOwnProperty;const Ls=function(e){var t=this.__data__;return Vs?void 0!==t[e]:qs.call(t,e)};const Gs=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Vs&&void 0===t?"__lodash_hash_undefined__":t,this};function Ys(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ys.prototype.clear=Ms,Ys.prototype.delete=Bs,Ys.prototype.get=Js,Ys.prototype.has=Ls,Ys.prototype.set=Gs;const Fs=Ys;const Hs=function(){this.size=0,this.__data__={hash:new Fs,map:new(xs||es),string:new Fs}};const zs=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Ks=function(e,t){var n=e.__data__;return zs(t)?n["string"==typeof t?"string":"hash"]:n.map};const Ws=function(e){var t=Ks(this,e).delete(e);return this.size-=t?1:0,t};const Qs=function(e){return Ks(this,e).get(e)};const $s=function(e){return Ks(this,e).has(e)};const Zs=function(e,t){var n=Ks(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Xs(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xs.prototype.clear=Hs,Xs.prototype.delete=Ws,Xs.prototype.get=Qs,Xs.prototype.has=$s,Xs.prototype.set=Zs;const eo=Xs;const to=function(e,t){var n=this.__data__;if(n instanceof es){var r=n.__data__;if(!xs||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new eo(r)}return n.set(e,t),this.size=n.size,this};function no(e){var t=this.__data__=new es(e);this.size=t.size}no.prototype.clear=ts,no.prototype.delete=ns,no.prototype.get=rs,no.prototype.has=ss,no.prototype.set=to;const ro=no;const so=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const oo=function(){try{var e=Ns(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const io=function(e,t,n){"__proto__"==t&&oo?oo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var ao=Object.prototype.hasOwnProperty;const co=function(e,t,n){var r=e[t];ao.call(e,t)&&Hr(r,n)&&(void 0!==n||t in e)||io(e,t,n)};const uo=function(e,t,n,r){var s=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),s?io(n,a,c):co(n,a,c)}return n};const lo=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const po=function(e){return null!=e&&"object"==typeof e};const ho=function(e){return po(e)&&"[object Arguments]"==gs(e)};var fo=Object.prototype,mo=fo.hasOwnProperty,yo=fo.propertyIsEnumerable,go=ho(function(){return arguments}())?ho:function(e){return po(e)&&mo.call(e,"callee")&&!yo.call(e,"callee")};const bo=go;const Oo=Array.isArray;const wo=function(){return!1};var Io="object"==typeof exports&&exports&&!exports.nodeType&&exports,vo=Io&&"object"==typeof module&&module&&!module.nodeType&&module,So=vo&&vo.exports===Io?as.Buffer:void 0;const Ao=(So?So.isBuffer:void 0)||wo;var Po=/^(?:0|[1-9]\d*)$/;const To=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Po.test(e))&&e>-1&&e%1==0&&e<t};const _o=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ko={};ko["[object Float32Array]"]=ko["[object Float64Array]"]=ko["[object Int8Array]"]=ko["[object Int16Array]"]=ko["[object Int32Array]"]=ko["[object Uint8Array]"]=ko["[object Uint8ClampedArray]"]=ko["[object Uint16Array]"]=ko["[object Uint32Array]"]=!0,ko["[object Arguments]"]=ko["[object Array]"]=ko["[object ArrayBuffer]"]=ko["[object Boolean]"]=ko["[object DataView]"]=ko["[object Date]"]=ko["[object Error]"]=ko["[object Function]"]=ko["[object Map]"]=ko["[object Number]"]=ko["[object Object]"]=ko["[object RegExp]"]=ko["[object Set]"]=ko["[object String]"]=ko["[object WeakMap]"]=!1;const Co=function(e){return po(e)&&_o(e.length)&&!!ko[gs(e)]};const Eo=function(e){return function(t){return e(t)}};var jo="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ro=jo&&"object"==typeof module&&module&&!module.nodeType&&module,Do=Ro&&Ro.exports===jo&&os.process;const No=function(){try{var e=Ro&&Ro.require&&Ro.require("util").types;return e||Do&&Do.binding&&Do.binding("util")}catch(e){}}();var xo=No&&No.isTypedArray;const Vo=xo?Eo(xo):Co;var Mo=Object.prototype.hasOwnProperty;const Bo=function(e,t){var n=Oo(e),r=!n&&bo(e),s=!n&&!r&&Ao(e),o=!n&&!r&&!s&&Vo(e),i=n||r||s||o,a=i?lo(e.length,String):[],c=a.length;for(var d in e)!t&&!Mo.call(e,d)||i&&("length"==d||s&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||To(d,c))||a.push(d);return a};var Uo=Object.prototype;const Jo=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Uo)};const qo=function(e,t){return function(n){return e(t(n))}};const Lo=qo(Object.keys,Object);var Go=Object.prototype.hasOwnProperty;const Yo=function(e){if(!Jo(e))return Lo(e);var t=[];for(var n in Object(e))Go.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Fo=function(e){return null!=e&&_o(e.length)&&!Os(e)};const Ho=function(e){return Fo(e)?Bo(e):Yo(e)};const zo=function(e,t){return e&&uo(t,Ho(t),e)};const Ko=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var Wo=Object.prototype.hasOwnProperty;const Qo=function(e){if(!bs(e))return Ko(e);var t=Jo(e),n=[];for(var r in e)("constructor"!=r||!t&&Wo.call(e,r))&&n.push(r);return n};const $o=function(e){return Fo(e)?Bo(e,!0):Qo(e)};const Zo=function(e,t){return e&&uo(t,$o(t),e)};var Xo="object"==typeof exports&&exports&&!exports.nodeType&&exports,ei=Xo&&"object"==typeof module&&module&&!module.nodeType&&module,ti=ei&&ei.exports===Xo?as.Buffer:void 0,ni=ti?ti.allocUnsafe:void 0;const ri=function(e,t){if(t)return e.slice();var n=e.length,r=ni?ni(n):new e.constructor(n);return e.copy(r),r};const si=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};const oi=function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[s++]=i)}return o};const ii=function(){return[]};var ai=Object.prototype.propertyIsEnumerable,ci=Object.getOwnPropertySymbols;const di=ci?function(e){return null==e?[]:(e=Object(e),oi(ci(e),(function(t){return ai.call(e,t)})))}:ii;const ui=function(e,t){return uo(e,di(e),t)};const li=function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e};const pi=qo(Object.getPrototypeOf,Object);const hi=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)li(t,di(e)),e=pi(e);return t}:ii;const fi=function(e,t){return uo(e,hi(e),t)};const mi=function(e,t,n){var r=t(e);return Oo(e)?r:li(r,n(e))};const yi=function(e){return mi(e,Ho,di)};const gi=function(e){return mi(e,$o,hi)};const bi=Ns(as,"DataView");const Oi=Ns(as,"Promise");const wi=Ns(as,"Set");const Ii=Ns(as,"WeakMap");var vi="[object Map]",Si="[object Promise]",Ai="[object Set]",Pi="[object WeakMap]",Ti="[object DataView]",_i=Ps(bi),ki=Ps(xs),Ci=Ps(Oi),Ei=Ps(wi),ji=Ps(Ii),Ri=gs;(bi&&Ri(new bi(new ArrayBuffer(1)))!=Ti||xs&&Ri(new xs)!=vi||Oi&&Ri(Oi.resolve())!=Si||wi&&Ri(new wi)!=Ai||Ii&&Ri(new Ii)!=Pi)&&(Ri=function(e){var t=gs(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ps(n):"";if(r)switch(r){case _i:return Ti;case ki:return vi;case Ci:return Si;case Ei:return Ai;case ji:return Pi}return t});const Di=Ri;var Ni=Object.prototype.hasOwnProperty;const xi=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ni.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const Vi=as.Uint8Array;const Mi=function(e){var t=new e.constructor(e.byteLength);return new Vi(t).set(new Vi(e)),t};const Bi=function(e,t){var n=t?Mi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var Ui=/\w*$/;const Ji=function(e){var t=new e.constructor(e.source,Ui.exec(e));return t.lastIndex=e.lastIndex,t};var qi=cs?cs.prototype:void 0,Li=qi?qi.valueOf:void 0;const Gi=function(e){return Li?Object(Li.call(e)):{}};const Yi=function(e,t){var n=t?Mi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Fi=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Mi(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Bi(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Yi(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Ji(e);case"[object Symbol]":return Gi(e)}};var Hi=Object.create;const zi=function(){function e(){}return function(t){if(!bs(t))return{};if(Hi)return Hi(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Ki=function(e){return"function"!=typeof e.constructor||Jo(e)?{}:zi(pi(e))};const Wi=function(e){return po(e)&&"[object Map]"==Di(e)};var Qi=No&&No.isMap;const $i=Qi?Eo(Qi):Wi;const Zi=function(e){return po(e)&&"[object Set]"==Di(e)};var Xi=No&&No.isSet;const ea=Xi?Eo(Xi):Zi;var ta="[object Arguments]",na="[object Function]",ra="[object Object]",sa={};sa[ta]=sa["[object Array]"]=sa["[object ArrayBuffer]"]=sa["[object DataView]"]=sa["[object Boolean]"]=sa["[object Date]"]=sa["[object Float32Array]"]=sa["[object Float64Array]"]=sa["[object Int8Array]"]=sa["[object Int16Array]"]=sa["[object Int32Array]"]=sa["[object Map]"]=sa["[object Number]"]=sa[ra]=sa["[object RegExp]"]=sa["[object Set]"]=sa["[object String]"]=sa["[object Symbol]"]=sa["[object Uint8Array]"]=sa["[object Uint8ClampedArray]"]=sa["[object Uint16Array]"]=sa["[object Uint32Array]"]=!0,sa["[object Error]"]=sa[na]=sa["[object WeakMap]"]=!1;const oa=function e(t,n,r,s,o,i){var a,c=1&n,d=2&n,u=4&n;if(r&&(a=o?r(t,s,o,i):r(t)),void 0!==a)return a;if(!bs(t))return t;var l=Oo(t);if(l){if(a=xi(t),!c)return si(t,a)}else{var p=Di(t),h=p==na||"[object GeneratorFunction]"==p;if(Ao(t))return ri(t,c);if(p==ra||p==ta||h&&!o){if(a=d||h?{}:Ki(t),!c)return d?fi(t,Zo(a,t)):ui(t,zo(a,t))}else{if(!sa[p])return o?t:{};a=Fi(t,p,c)}}i||(i=new ro);var f=i.get(t);if(f)return f;i.set(t,a),ea(t)?t.forEach((function(s){a.add(e(s,n,r,s,t,i))})):$i(t)&&t.forEach((function(s,o){a.set(o,e(s,n,r,o,t,i))}));var m=l?void 0:(u?d?gi:yi:d?$o:Ho)(t);return so(m||t,(function(s,o){m&&(s=t[o=s]),co(a,o,e(s,n,r,o,t,i))})),a};const ia=function(e){return oa(e,5)};const aa=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const ca=function(e){return this.__data__.has(e)};function da(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new eo;++t<n;)this.add(e[t])}da.prototype.add=da.prototype.push=aa,da.prototype.has=ca;const ua=da;const la=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const pa=function(e,t){return e.has(t)};const ha=function(e,t,n,r,s,o){var i=1&n,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var d=o.get(e),u=o.get(t);if(d&&u)return d==t&&u==e;var l=-1,p=!0,h=2&n?new ua:void 0;for(o.set(e,t),o.set(t,e);++l<a;){var f=e[l],m=t[l];if(r)var y=i?r(m,f,l,t,e,o):r(f,m,l,e,t,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!la(t,(function(e,t){if(!pa(h,t)&&(f===e||s(f,e,n,r,o)))return h.push(t)}))){p=!1;break}}else if(f!==m&&!s(f,m,n,r,o)){p=!1;break}}return o.delete(e),o.delete(t),p};const fa=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const ma=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var ya=cs?cs.prototype:void 0,ga=ya?ya.valueOf:void 0;const ba=function(e,t,n,r,s,o,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Vi(e),new Vi(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Hr(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=fa;case"[object Set]":var c=1&r;if(a||(a=ma),e.size!=t.size&&!c)return!1;var d=i.get(e);if(d)return d==t;r|=2,i.set(e,t);var u=ha(a(e),a(t),r,s,o,i);return i.delete(e),u;case"[object Symbol]":if(ga)return ga.call(e)==ga.call(t)}return!1};var Oa=Object.prototype.hasOwnProperty;const wa=function(e,t,n,r,s,o){var i=1&n,a=yi(e),c=a.length;if(c!=yi(t).length&&!i)return!1;for(var d=c;d--;){var u=a[d];if(!(i?u in t:Oa.call(t,u)))return!1}var l=o.get(e),p=o.get(t);if(l&&p)return l==t&&p==e;var h=!0;o.set(e,t),o.set(t,e);for(var f=i;++d<c;){var m=e[u=a[d]],y=t[u];if(r)var g=i?r(y,m,u,t,e,o):r(m,y,u,e,t,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=e.constructor,O=t.constructor;b==O||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return o.delete(e),o.delete(t),h};var Ia="[object Arguments]",va="[object Array]",Sa="[object Object]",Aa=Object.prototype.hasOwnProperty;const Pa=function(e,t,n,r,s,o){var i=Oo(e),a=Oo(t),c=i?va:Di(e),d=a?va:Di(t),u=(c=c==Ia?Sa:c)==Sa,l=(d=d==Ia?Sa:d)==Sa,p=c==d;if(p&&Ao(e)){if(!Ao(t))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new ro),i||Vo(e)?ha(e,t,n,r,s,o):ba(e,t,c,n,r,s,o);if(!(1&n)){var h=u&&Aa.call(e,"__wrapped__"),f=l&&Aa.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,y=f?t.value():t;return o||(o=new ro),s(m,y,n,r,o)}}return!!p&&(o||(o=new ro),wa(e,t,n,r,s,o))};const Ta=function e(t,n,r,s,o){return t===n||(null==t||null==n||!po(t)&&!po(n)?t!=t&&n!=n:Pa(t,n,r,s,e,o))};const _a=function(e,t){return Ta(e,t)};function ka(e,t){const n=ia(e);return n.path[n.path.length-1]+=t,n}function Ca(e,t){return e.root===t.root&&_a(e.path,t.path)}function Ea(e){Ra(e,(e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e)))}function ja(e){Ra(e,(e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e)))}function Ra(e,t){for(const n in e){const r=e[n];"nodes"!==n&&bs(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):Ra(r,t))}return e}class Da{constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return Ea(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){t.types.shift();const n=this._protobufDescriptor.decompress(t.buffers.shift());ja(n),n.__className=this._operationName,e.push(n)}}class Na extends Da{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),Ea(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,s=this._protobufDescriptor.decompress(r.shift());n.shift(),this._deserializeOneOf("oldValue",s),this._deserializeOneOf("newValue",s),ja(s),s.__className=this._operationName,e.push(s)}_serializeOneOf(e,t){const n=t[e];"boolean"==typeof n?t[`${e}Boolean`]=n:t[`${e}Json`]=JSON.stringify(n)}_deserializeOneOf(e,t){const n=`${e}Json`;t[n]?(t[e]=JSON.parse(t[n]),delete t[n]):(t[e]=t[`${e}Boolean`],delete t[`${e}Boolean`])}}class xa extends Da{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),Ea(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,s=this._protobufDescriptor.decompress(r.shift());n.shift(),s.nodes||(s.nodes=[]),this._deserializeNodesAttributes(s.nodes),ja(s),s.__className=this._operationName,e.push(s)}_serializeNodesAttributes(e){for(const t of e){if(t.attributes){const e=t.attributes;this._areValuesBoolean(e)?t.attributesBoolean=e:t.attributesJson=JSON.stringify(e)}t.children&&this._serializeNodesAttributes(t.children)}}_deserializeNodesAttributes(e){for(const t of e)(t.attributesBoolean||t.attributesJson)&&(t.attributesBoolean?(t.attributes=t.attributesBoolean,delete t.attributesBoolean):(t.attributes=JSON.parse(t.attributesJson),delete t.attributesJson)),t.children&&this._deserializeNodesAttributes(t.children)}_areValuesBoolean(e){return Object.keys(e).every((t=>"boolean"==typeof e[t]))}}class Va extends Da{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class Ma extends Da{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class Ba extends Va{constructor(e,t,n,r){super(e,t,n),this._omittedNamespace=r+":"}compress(e,t){return!("MarkerOperation"!=t[0].__className||!t[0].name.startsWith(this._omittedNamespace))&&(t[0].name=t[0].name.replace(new RegExp("^"+this._omittedNamespace),""),super.compress(e,t),!0)}decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.name=this._omittedNamespace+n.name}}class Ua{constructor(e,t){this._id=e,this._context=t}compress(e,t){let n;for(;t.length>1&&this._compareOperations(t[0],t[1]);)n?(n=this._combineNext(t.shift(),n),e.types.push(0)):(n=ia(t.shift()),e.types.push(this._id));return!!n&&(n=this._combineNext(t.shift(),n),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0)}decompress(e,t){const n=this._decompressSingleOperation(t);for(;0==t.types[0];)t.types.shift(),e.push(this._splitCurrent(n));e.push(n)}}class Ja extends Ua{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=ia(e),n=t.nodes[0],r=e.nodes[0],s=r.data[Symbol.iterator]().next().value,o=s.length;return n.data=s,r.data=r.data.substr(o),e.position=ka(e.position,o),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=Ca(ka(e.position,n),t.position),s=e.nodes[0],o=t.nodes[0];return r&&this._compareAttributes(s,o)}return!1}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("InsertOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("InsertOperation").decompress(t,e),t[0]}_checkOperation(e){return"InsertOperation"==e.__className&&1==e.nodes.length&&e.nodes[0].data&&!e.wasUndone&&1==Array.from(e.nodes[0].data).length}_compareAttributes(e,t){const n=Object.keys(e.attributes||{}),r=Object.keys(t.attributes||{});return n.length===r.length&&n.every((n=>t.attributes[n]&&t.attributes[n]===e.attributes[n]))}}class qa extends Ua{_combineNext(e,t){return t.howMany++,t.sourcePosition=ia(e.sourcePosition),t}_splitCurrent(e){const t=ia(e);return e.howMany--,t.howMany=1,t.sourcePosition=ka(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ca(ka(e.sourcePosition,-1),t.sourcePosition)&&Ca(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class La extends Ua{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=ia(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ca(e.sourcePosition,t.sourcePosition)&&Ca(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class Ga extends Ua{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&Ca(n.newRange.start,n.newRange.end)&&(n.newRange.end=null),t.shift(),e.types.push(this._id),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0}decompress(e,t){const n=this._decompressSingleOperation(t);n.newRange&&!n.newRange.end&&(n.newRange.end=ia(n.newRange.start));const r=ia(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=ia(r.newRange.start)),r.name="user:position:"+r.name.split(":")[2],t.types.shift(),e.push(n),e.push(r)}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MarkerOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MarkerOperation").decompress(t,e),t[0]}_compareOperations(e,t){return!(!e||!t)&&("MarkerOperation"==e.__className&&"MarkerOperation"==t.__className&&!(!e.name.startsWith("user:")||!t.name.startsWith("user:")||e.name==t.name))}}class Ya{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new Gr;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new Ma(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",Na),this._registerOperationCompressor(11,"InsertOperation",xa),this._registerOperationCompressor(12,"MarkerOperation",Va),this._registerOperationCompressor(13,"MergeOperation",Da),this._registerOperationCompressor(14,"MoveOperation",Da),this._registerOperationCompressor(15,"RenameOperation",Da),this._registerOperationCompressor(16,"RootAttributeOperation",Na),this._registerOperationCompressor(17,"SplitOperation",Da),this._registerCompressor(18,"CommentMarkerOperation",new Ba(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Ba(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",Da),this._registerActionCompressor(100,"TypingAction",Ja),this._registerActionCompressor(101,"DeletingAction",qa),this._registerActionCompressor(102,"ForwardDeletingAction",La),this._registerActionCompressor(103,"UserSelectionAction",Ga)}compress(e){if(!e||!e[0])throw new r.CKEditorError("no-operations-provided",this);const t={types:[],buffers:[],baseVersion:e[0].baseVersion};for(;e.length;)this._getCompressorByName("UserSelectionAction").compress(t,e)||this._getCompressorByName("TypingAction").compress(t,e)||this._getCompressorByName("DeletingAction").compress(t,e)||this._getCompressorByName("ForwardDeletingAction").compress(t,e)||this._getCompressorByName("CommentMarkerOperation").compress(t,e)||this._getCompressorByName("SuggestionMarkerOperation").compress(t,e)||this._getCompressorByName(e[0].__className).compress(t,e);return t}decompress(e){const t=[];for(;e.types.length;){this._compressorById.get(e.types[0]).decompress(t,e)}return t.forEach(((t,n)=>t.baseVersion=e.baseVersion+n)),t}_getCompressorByName(e){return this._compressorByName.get(e)}_registerOperationCompressor(e,t,n){const r=new n(e,t,this._protobufFactory.getDescriptor(t));this._registerCompressor(e,t,r)}_registerActionCompressor(e,t,n){const r=new n(e,this);this._registerCompressor(e,t,r)}_registerCompressor(e,t,n){this._compressorById.set(e,n),this._compressorByName.set(t,n)}}const Fa=Ha;function Ha(e,t){const n=Qa();return(Ha=function(e,t){return n[e-=260]})(e,t)}!function(e,t){const n=Ha,r=e();for(;;)try{if(640965===-parseInt(n(422))/1+parseInt(n(408))/2*(-parseInt(n(430))/3)+-parseInt(n(478))/4*(parseInt(n(292))/5)+-parseInt(n(481))/6*(parseInt(n(385))/7)+-parseInt(n(311))/8*(-parseInt(n(512))/9)+-parseInt(n(388))/10+parseInt(n(482))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Qa);let za=1;class Ka extends n.Plugin{static get[Fa(269)](){return[lr,yr,Ar,n.PendingActions,pr.Users,s.Notification]}static get[Fa(328)](){return Fa(503)}get[Fa(437)](){const e=Fa;return this[e(278)]+this[e(456)]}get[Fa(278)](){const e=Fa;return this[e(468)][e(447)]-this[e(456)]}get[Fa(295)](){const e=Fa,t=this[e(468)][e(324)]();for(let n=t[e(451)]-1;n>=0;n--){const r=t[n];if(!this[e(498)][e(494)](r))return r[e(329)]+1-this[e(456)]}return 0}constructor(e){const t=Fa;if(super(e),this[t(456)]=0,this[t(489)]=null,this[t(468)]=new o.History,this[t(417)][t(374)][t(275)](t(415),{}),this[t(288)]=this[t(417)][t(374)][t(365)](t(270)),!this[t(288)])throw new r.CKEditorError(t(381),this);const n=e[t(374)][t(365)](t(400))||r.version;this[t(282)]=new(Ka[t(416)])(n,this[t(288)]),this[t(383)]=this[t(417)][t(398)][t(315)],this[t(340)]=new Ya,this[t(281)]=[],this[t(322)]=new WeakSet,this[t(426)]=new Set,this[t(513)](t(465),!1),this[t(513)](t(296),!1),this[t(357)]=null,this[t(268)]=!1,this[t(367)]=null,this[t(394)]=300,this[t(432)]=this[t(394)],this[t(458)]=null,this[t(498)]=new WeakSet,this[t(488)]=new Xa(this[t(498)])}[Fa(483)](){const e=Fa,t=this[e(417)],n=t[e(391)][e(365)](pr.Users),r=t[e(391)][e(365)](lr);this[e(425)](n,e(453),((t,r)=>{const s=e,o=r[0];o[s(300)]&&(t[s(464)]=n[s(267)](o[s(300)]),t[s(272)]()),null===o[s(300)]&&(t[s(464)]=null,t[s(272)]())}),{priority:e(484)}),this[e(425)](t[e(398)][e(315)][e(321)],e(502),((t,n)=>{const r=e;n[r(279)]&&this[r(371)]()})),this[e(425)](t[e(390)][e(274)],e(423),(()=>{this[e(371)]()})),this[e(359)](),t[e(398)].on(e(333),((t,n)=>{const r=e,s=n[0];s[r(380)]&&(this[r(350)](s),this[r(475)]()&&this[r(327)]())})),this[e(407)](),this[e(298)](e(474)).to(r,e(352),this,e(296),((t,n)=>e(303)===t&&!n)),this.on(e(450),(()=>{const n=e;this[n(474)]?t[n(341)](n(316)):t[n(462)](n(316))})),this[e(474)]?t[e(341)](e(316)):t[e(462)](e(316)),this[e(513)](e(289),!1)}async[Fa(427)](){const e=Fa,t=this[e(417)][e(391)][e(365)](yr),n=this[e(417)][e(391)][e(365)](lr);try{this[e(465)]=!0,t[e(363)](this[e(288)]);const r=await this[e(282)][e(427)](n[e(344)],this[e(295)]);await this[e(370)](r)&&(this[e(465)]=!1,this[e(508)]());const s=await this[e(282)][e(326)]();t[e(309)](this[e(288)],s),this[e(280)](),this[e(289)]=!0}catch(t){if(function(t){const n=e;return n(384)===t[n(320)]}(t)&&this[e(489)])await this[e(334)]();else if(function(t){const n=e;return n(377)===t[n(320)]}(t)){const t=Tr(this[e(417)][e(476)],e(486));this[e(261)](t)}else{if(!(t instanceof $a))throw t;this[e(261)]()}}}[Fa(299)](){const e=Fa,t=this[e(417)][e(391)][e(365)](lr),n=this[e(417)][e(391)][e(365)](yr);this[e(417)][e(462)](e(497)),n[e(325)][e(494)](this[e(288)])&&n[e(363)](this[e(288)]),t[e(310)](this),this[e(286)](),super[e(299)]()}async[Fa(370)](e){const t=Fa;if(this[t(489)]!==e[t(489)]&&this[t(458)]!==e[t(431)])throw new $a;return this[t(489)]=e[t(489)],this[t(406)]([],{...e,wereChangesApplied:!1,data:e[t(307)]},t(427))}async[Fa(410)](e,t=!1){const n=Fa,{connection:r}=this[n(417)][n(391)][n(365)](lr);Ka[n(416)][n(326)](r,this[n(288)])[n(504)]((e=>this[n(319)](e)))[n(404)]((e=>{const t=n;this[t(413)](t(435),e)})),this[n(425)](this[n(282)],n(516),this[n(471)][n(298)](this)),this[n(425)](this[n(282)],n(345),((e,t)=>{const r=n;this[r(413)](r(302),t)})),this[n(425)](this[n(282)],n(336),(()=>{this[n(289)]=!1}));const s=this[n(488)][n(373)](e);this[n(465)]=!0;const o=await this[n(282)][n(477)](r,this[n(399)](e),s);if(this[n(489)]=o[n(489)],t){if(!o[n(323)])return void this[n(261)]();this[n(465)]=!1,this[n(508)](),this[n(468)][n(440)](),this[n(456)]=o[n(369)],this[n(468)][n(447)]=this[n(456)],await this[n(406)](e,o,n(379))}else await this[n(266)](o,e);this[n(280)](),this[n(289)]=!0}[Fa(280)](){const e=Fa,t=this[e(417)][e(391)][e(365)](yr),n=this[e(417)][e(391)][e(365)](Ar),r=t[e(325)][e(365)](this[e(288)]);r&&r[e(451)]>1?n[e(382)]():this[e(425)](t,e(361)+this[e(288)],(()=>{const r=e;2===t[r(325)][r(365)](this[r(288)])[r(451)]&&n[r(382)]()}))}async[Fa(471)](e,t,n,r){const s=Fa;if(!this[s(465)]&&this[s(383)][s(447)]==t){const e=this[s(372)](n,r);await this[s(490)](e),this[s(405)](e,t,n[s(431)])||this[s(413)](s(273))}}async[Fa(334)](){const e=Fa;this[e(286)]();const{locale:t}=this[e(417)];let n;try{n=await this[e(282)][e(424)]()}catch(n){const r=Tr(t,e(446));return void this[e(261)](r)}const r=n[e(485)]||n[e(358)];if(this[e(458)]===r[e(431)])await this[e(410)](this[e(417)][e(398)][e(315)][e(393)][e(324)](),!0);else{const n=Tr(t,e(348));this[e(261)](n)}}[Fa(286)](){const e=Fa;this[e(282)][e(392)](),this[e(281)]=[],clearTimeout(this[e(367)]),this[e(285)](this[e(282)])}[Fa(319)](e){const t=Fa,n=this[t(417)][t(391)][t(365)](yr);this[t(425)](n,t(361)+this[t(288)],((e,{session:r})=>{const s=t;if(r.id===n[s(265)]){e[s(283)]();const t=this[s(417)][s(391)][s(494)](s(351))&&this[s(417)][s(391)][s(365)](s(351));let n=r[s(271)];t&&t[s(509)]&&(n=n[s(339)]((e=>s(470)!==e))),this[s(417)][s(391)][s(365)](s(420))[s(347)](n,this[s(288)])}})),n[t(309)](this[t(288)],e)}[Fa(359)](){const e=Fa,t=this[e(417)][e(307)][e(513)];this[e(417)][e(307)][e(513)]=(...n)=>{const s=e;if(!n[n[s(451)]-1][s(436)])throw new r.CKEditorError(s(387),this);t[s(312)](this[s(417)][s(307)],n)}}[Fa(407)](){const e=Fa;this[e(417)][e(307)].on(e(483),((t,[n])=>{const s=e;if(this[s(383)][s(447)])throw new r.CKEditorError(s(491),this);t[s(272)](),this[s(287)]();const i=this[s(417)][s(374)][s(365)](s(378)),a=this[s(495)](n,i);0==a[s(451)]&&a[s(444)](new o.NoOperation(0)),t[s(464)]=this[s(410)](a)[s(504)]((()=>{const e=s;this[e(417)][e(391)][e(365)](lr)[e(277)](this),this[e(417)][e(307)][e(338)](e(492))}))[s(404)]((e=>this[s(413)](s(428),e)))[s(264)]((()=>this[s(508)]()))}),{priority:e(484)}),this[e(417)].on(e(396),(async(t,[n,r])=>{const s=e;t[s(272)]();const o=this[s(417)][s(398)][s(315)][s(343)](n);if(!this[s(426)][s(494)](n)){const e=r&&r[s(307)]?r[s(307)]:"",t=r&&r[s(434)]?r[s(434)]:{};await this[s(419)](n,e,t)}this[s(417)][s(398)][s(332)]({isUndoable:!1},(()=>{const e=s;o[e(375)]=!0,this[e(417)][e(398)][e(315)][e(487)][e(386)](o)}))}),{priority:e(484)})}async[Fa(490)](e){const t=Fa,n=this[t(417)][t(391)][t(365)](pr.Users),{connection:r}=this[t(417)][t(391)][t(365)](lr),s=new Set;for(const r of e){const e=r[t(300)];e&&!n[t(267)](e)&&s[t(449)](e)}if(0===s[t(290)])return;const o=await Ye[t(500)](r,Array[t(389)](s));for(const e of o)n[t(267)](e.id)||n[t(457)](e)}[Fa(495)](e,t={}){const n=Fa,s=this[n(417)][n(398)],i=[];let a=0;const c=n(479)==typeof e?{main:e}:e;for(const e of Object[n(356)](c)){if(!this[n(383)][n(331)][n(494)](e))throw new r.CKEditorError(n(473),this);const t=this[n(417)][n(307)][n(346)](c[e]),d=this[n(383)][n(343)](e),u=new o.InsertOperation(s[n(366)](d,0),t,a++);i[n(444)](u);for(const[e,r]of t[n(439)]){const t=s[n(401)](s[n(442)](d,r[n(411)][n(397)][n(515)]()),s[n(442)](d,r[n(304)][n(397)][n(515)]())),c=new o.MarkerOperation(e,null,t,s[n(439)],!0,a++);i[n(444)](c)}}if(t)for(const[e,c]of Object[n(421)](t)){const t=s[n(315)][n(343)](e);if(!t)throw new r.CKEditorError(n(314),null);for(const[e,r]of Object[n(421)](c))if(null!==r){const s=new o.RootAttributeOperation(t,e,null,r,a++);i[n(444)](s)}}return i}async[Fa(419)](e,t,n){const r=Fa;this[r(495)]({[e]:t},{[e]:n})[r(429)](((e,t)=>{const n=r;e[n(329)]=this[n(383)][n(447)]+t,e[n(463)]=!0,this[n(350)](e)})),this[r(327)](),await this[r(499)]()}async[Fa(266)](e,t){const n=Fa;let r;this[n(456)]=e[n(369)];const s=e[n(323)]&&!e[n(518)],o=s?0:e[n(307)][n(329)];if(t[n(429)]((t=>{const r=n;t[r(463)]=!0,t[r(505)]=e[r(260)],t[r(300)]=null})),s)r=t,this[n(514)](r,s);else{if(e[n(518)]){const t=this[n(495)](e[n(518)]);this[n(383)][n(393)][n(447)]=-t[n(451)],t[n(429)]((r=>{const s=n;r[s(329)]-=t[s(451)],r[s(505)]=e[s(260)],r[s(463)]=!0,r[s(300)]=null})),this[n(514)](t,!0),this[n(468)][n(447)]=-t[n(451)]+this[n(456)],this[n(362)](t)}this[n(383)][n(393)][n(447)]=o,r=this[n(372)](e[n(307)],e[n(460)]),await this[n(490)](r),this[n(514)](r,s)}e[n(431)]&&(this[n(488)][n(355)](r,e[n(431)]),this[n(458)]=e[n(431)]),this[n(468)][n(447)]=o+this[n(456)],this[n(362)](r),t[n(339)]((e=>{const t=n,r=this[t(510)](e);return r&&!this[t(426)][t(494)](r)}))[n(429)](((e,t)=>{const r=n;e[r(329)]=this[r(383)][r(447)]+t,this[r(350)](e)})),this[n(475)]()?(this[n(432)]=0,this[n(327)](!0),await this[n(499)]()):(this[n(465)]=!1,this[n(508)]())}[Fa(413)](e,t){const n=Fa;throw this[n(465)]=!0,t&&console[n(345)](t),new r.CKEditorError(e,this[n(417)])}[Fa(350)](e){const t=Fa;this[t(322)][t(494)](e)||(this[t(322)][t(449)](e),this[t(281)][t(444)](e),this[t(357)]||t(461)==e[t(445)]&&!e[t(342)]||this[t(287)]())}[Fa(327)](e=!1){const t=Fa;!e&&this[t(465)]||(this[t(465)]=!0,clearTimeout(this[t(367)]),this[t(367)]=setTimeout((()=>{const e=t;this[e(297)]()[e(504)]((t=>{const n=e;t&&(this[n(508)](),this[n(465)]=!1)}))[e(404)]((t=>{const n=e;if(this[n(508)](),this[n(465)]=!1,!function(e){const t=n;return e[t(433)][t(469)](t(467))||e[t(433)][t(469)](t(496))||e[t(433)][t(469)](t(448))}(t))throw t}))}),this[t(432)]))}[Fa(499)](){return new Promise((e=>{const t=Ha;this.on(t(364),(()=>{e()}))}))}async[Fa(297)](){const e=Fa,t=this[e(417)][e(391)][e(365)](Ar);if(this[e(294)]()&&(t[e(382)](),this[e(268)]=!1),!this[e(475)]())return!0;const n=[...this[e(281)]];for(const t of n)t[e(395)]=this[e(383)][e(393)][e(306)](t);const r=this[e(488)][e(373)](n),s=za++,o=this[e(399)](n),i=await this[e(282)][e(354)](o,o[e(329)],r);try{return await this[e(406)](n,i,s)}catch(t){return this[e(413)](e(507),t)}}async[Fa(406)](e,t,n){const r=Fa;if(r(345)in t)throw t[r(345)];let s=!1;if(t[r(323)]){t[r(431)]&&(this[r(458)]=t[r(431)]),this[r(281)]=this[r(281)][r(339)]((t=>!e[r(276)](t)));for(const n of e)n[r(505)]=r(317)in t&&t[r(317)]||void 0;Za(e,t[r(447)]-e[r(451)]),this[r(362)](e);const n=e[r(339)]((e=>{const t=r;if(!e[t(463)])return!1;const n=this[t(510)](e);return n&&!this[t(426)][t(494)](n)}));Za(n,this[r(383)][r(447)]),this[r(514)](n),s=!0,this[r(432)]=this[r(394)]}else{const e=this[r(372)](t[r(307)],t[r(460)])[r(339)]((e=>e[r(329)]>=this[r(278)]));e[r(429)]((e=>this[r(330)](e))),this[r(281)]=this[r(281)][r(339)]((e=>!e[r(463)]||!this[r(426)][r(494)](this[r(510)](e)))),this[r(281)][r(451)]&&Za(this[r(281)],this[r(281)][0][r(329)]),await this[r(490)](e),s=this[r(405)](e,t[r(447)],t[r(431)]),this[r(432)]=Math[r(452)](this[r(432)]/2)}return s?!this[r(475)]()||(this[r(327)](!0),!1):this[r(413)](r(472))}[Fa(405)](e,t,n){const r=Fa;try{const s={document:this[r(383)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,o.transformSets)(e,this[r(281)],s);Za(i,this[r(383)][r(447)]),Za(a,t);for(const e of i){const t=c[r(365)](e);e[r(300)]=t?t[r(300)]:null}n&&(this[r(488)][r(355)](e,n),this[r(458)]=n),this[r(281)]=[...a],this[r(514)](i),this[r(362)](e)}catch(e){return console[r(345)](e),!1}return!0}[Fa(514)](e,t=!1){const n=Fa;this[n(417)][n(398)][n(332)]({isUndoable:!1,isLocal:!1},(t=>{const r=n;for(const n of e)this[r(322)][r(449)](n),this[r(330)](n),t[r(517)][r(335)](n),this[r(417)][r(398)][r(333)](n)}))}[Fa(330)](e){const t=Fa,n=this[t(510)](e);n&&this[t(426)][t(449)](n)}[Fa(510)](e){const t=Fa;let n,r;switch(e[t(445)]){case t(353):n=e[t(443)][t(454)];break;case t(461):if(r=e[t(308)],!r)return null;n=r[t(454)];break;case t(418):n=e[t(454)];break;case t(403):n=e[t(441)];break;case t(318):n=e[t(305)][t(454)];break;default:return null}return n[t(493)]}[Fa(362)](e){const t=Fa;e[t(429)]((e=>{const n=t,r=e[n(480)]();r[n(300)]=e[n(300)],r[n(463)]=!!e[n(463)],r[n(505)]=e[n(505)],r[n(329)]+=this[n(456)],e[n(284)]&&this[n(498)][n(449)](r),this[n(468)][n(335)](r)}))}[Fa(261)](e){const t=Fa,n=this[t(417)][t(391)][t(365)](t(368)),r=this[t(417)][t(476)];e||(e=Tr(r,t(360))),n[t(455)](e,{title:Tr(r,t(349)),namespace:t(376)}),this[t(296)]=!0,clearTimeout(this[t(367)]),this[t(281)]=[],this[t(417)][t(391)][t(365)](lr)[t(299)]()}[Fa(287)](){const e=Fa;this[e(357)]||(this[e(357)]=this[e(417)][e(391)][e(365)](n.PendingActions)[e(449)](Tr(this[e(417)][e(476)],e(459))))}[Fa(508)](){const e=Fa;this[e(357)]&&(this[e(417)][e(391)][e(365)](n.PendingActions)[e(438)](this[e(357)]),this[e(357)]=null)}[Fa(399)](e){const t=Fa,n=e[t(313)]((e=>e[t(506)]()));return this[t(340)][t(409)](n)}[Fa(372)](e,t){const n=Fa;return this[n(340)][n(466)](e)[n(313)](((e,r)=>{const s=n,i=s(483)==t[r][s(445)];if(s(511)==e[s(263)]){const t=e[s(443)][s(454)];!this[s(383)][s(343)](t)&&(this[s(383)][s(262)](s(293),t)[s(402)]=!1)}const a=o.OperationFactory[s(414)](e,this[s(383)]);return a[s(395)]=e[s(395)],a[s(463)]=i,a[s(300)]=i?null:t[r][s(337)],a[s(284)]=s(291)===t[r][s(445)],a[s(505)]=t[r][s(505)],a}))}[Fa(371)](){const e=Fa;this[e(268)]=!0,this[e(294)]()?this[e(327)]():this[e(268)]=!1}[Fa(294)](){const e=Fa,t=this[e(417)][e(391)][e(365)](yr)[e(325)][e(365)](this[e(288)]);return!this[e(417)][e(301)]&&!!t&&t[e(451)]>1&&this[e(268)]}[Fa(475)](){const e=Fa;return this[e(281)][e(451)]>0||this[e(294)]()}}Ka[Fa(416)]=Bn;const Wa=Ka;function Qa(){const e=["unregister","change:_isPendingUpdate","get","createPositionAt","_sendBufferedOperationsDelayId","Notification","offset","_handleReconnectionResponse","_refreshUserSelectionMarkers","_decompressOperations","getIdOfTheLastOperation","config","_isLoaded","real-time-collaboration","409","rootsAttributes","reconnection: flushed session","isDocumentOperation","collaboration-missing-channelid","createUserMarkerOperations","_document","404","217cwsYnB","_bufferRootLoad","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","9023010lsddau","from","editing","plugins","disconnect","history","_baseBufferDelay","wasUndone","loadRoot","path","model","_compressOperations","cloudServices.bundleVersion","createRange","_isAttached","addRoot","catch","_handleExternalOperations","_handleServerResponse","_setUpDataInit","26LVGmFu","compress","_connectService","start","_operationToId","_crash","fromJSON","collaboration","CollaborativeEditingService","editor","addRootAttribute","_loadRoot","Permissions","entries","102474OpclzE","change:hasDomSelection","getDocumentDetails","listenTo","_knownRootNames","reconnect","realtimecollaborationclient-init-connection-failed","forEach","159981jmTRgq","lastOperationId","_currentBufferDelay","message","attributes","realtimecollaborationclient-init-session-connection-error","suppressErrorInCollaboration","cloudDocumentVersion","remove","markers","reset","affectedSelectable","createPositionFromPath","position","push","type","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","version","cloud-services-internal-error: Request timeout.","add","change:_isEditingAllowed","length","round","getOperationAuthor","root","showWarning","_offset","addUser","_lastSyncedOperationId","PENDING_ACTION_SENDING_DATA","metadata","marker","enableReadOnlyMode","_isInit","return","_isPendingUpdate","decompress","cloud-services-internal-error: Not connected.","serverHistory","startsWith","document:write","_handleReceivedOperations","realtimecollaborationclient-handleserverresponse","realtimecollaborationclient-init-non-existent-root","_isEditingAllowed","_shouldSendUpdate","locale","connect","1852qEftjn","string","clone","87948tUiHnB","27095827LMtvUm","init","high","currentDocumentSession","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","differ","_operationIdentifier","sessionId","_fetchMissingUsers","realtimecollaborationclient-init-document-already-initialized","ready","rootName","has","_getOperationsFromInitData","cloud-services-internal-error: Collaborative Editing Service is not connected.","rtc-destroyed","_disconnectionOperations","_waitUntilSynced","getMany","_ignoredOperations","change:range","RealTimeCollaborationClient","then","createdAt","toJSON","realtimecollaborationclient-sendbufferedoperations","_clearPendingAction","isEnabled","_getAffectedRoot","InsertOperation","124875eCRhIq","set","_applyOperationsSet","slice","operationsReceived","batch","initData","sessionCreatedAt","_handleReconnectionError","createRoot","__className","finally","mySessionId","_handleInitialConnectionData","getUser","_hasSelectionChanged","requires","collaboration.channelId","permissions","stop","realtimecollaborationclient-initservice-incorrect-server-operation","view","define","includes","addToReconnectionStack","_lastServerVersion","directChange","_handleSendingSelectionMarkers","_bufferedOperations","_service","off","_isDisconnection","stopListening","_disconnectService","_setPendingAction","_channelId","_isConnected","size","cs:removeUser","930jmKUsY","$root","_shouldSendSelectionUpdate","lastSyncVersion","_hasSynchronizationProblem","_sendBufferedOperations","bind","destroy","_authorId","isReadOnly","realtimecollaborationclient-initservice-internal-error","connected","end","targetPosition","isUndoneOperation","data","newRange","register","removeFromReconnectionStack","240FdImdn","apply","map","multi-root-editor-root-attributes-no-root","document","rtc-offline","lastOperationAcceptedAt","move","_initSessionsHandling","code","selection","_knownOperations","wereChangesApplied","getOperations","channelSessions","getConnectedSessions","_sendBufferedOperationsDelayed","pluginName","baseVersion","_addKnownRoot","roots","enqueueChange","applyOperation","_connectAfterSessionHasBeenFlushed","addOperation","disconnected","userId","fire","filter","_compressor","disableReadOnlyMode","affectsData","getRoot","connection","error","parse","setPermissions","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.","Synchronization issue","_saveOperationInBuffer","CommentsOnly","state","insert","sendOperations","setIdForTheLastOperation","keys","_pendingAction","lastDocumentSession","_initThrowingOnDataSet","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.","sessionAdd:","_updateServerHistory"];return(Qa=function(){return e})()}class $a extends Error{}function Za(e,t){const n=Fa;for(const r of e)r[n(329)]=t++}class Xa{constructor(e){const t=Fa;this[t(501)]=e,this[t(412)]=new WeakMap}[Fa(373)](e){const t=Fa;let n=e[t(451)];for(;n--;){const s=e[n];if(!this[t(501)][t(494)](s)){if(!this[t(412)][t(494)](s)){const e=(0,r.uid)()[t(515)](1,18);this[t(412)][t(513)](s,e)}return this[t(412)][t(365)](s)}}}[Fa(355)](e,t){const n=Fa;if(!t)return;let r=e[n(451)];for(;r--;){const s=e[r];this[n(501)][n(494)](s)||this[n(412)][n(513)](s,t)}}}var ec=tc;function tc(e,t){var n=nc();return(tc=function(e,t){return n[e-=406]})(e,t)}function nc(){var e=["requires","4403922EUTQVd","9rzFPdZ","2ukxHDj","106587mOlCFz","768485jBMWBO","350fjWJBL","597196scbFHy","137304SgNcha","994168KNedaZ","RealTimeCollaborativeEditing","10507QmJJmS","1518JnjlHa","2488GqpKZt","pluginName"];return(nc=function(){return e})()}!function(e,t){for(var n=tc,r=e();;)try{if(504741===-parseInt(n(414))/1*(parseInt(n(420))/2)+parseInt(n(413))/3*(parseInt(n(418))/4)+parseInt(n(416))/5+-parseInt(n(412))/6+parseInt(n(407))/7*(parseInt(n(409))/8)+parseInt(n(415))/9*(-parseInt(n(417))/10)+-parseInt(n(408))/11*(-parseInt(n(419))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(nc);class rc extends n.Plugin{static get[ec(411)](){return[Wa]}static get[ec(410)](){return ec(406)}}const sc=ic;!function(e,t){const n=ic,r=e();for(;;)try{if(207761===-parseInt(n(527))/1+-parseInt(n(500))/2+parseInt(n(482))/3*(parseInt(n(541))/4)+parseInt(n(570))/5+-parseInt(n(488))/6+parseInt(n(512))/7+parseInt(n(507))/8*(parseInt(n(550))/9))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(uc);class oc extends n.ContextPlugin{static get[sc(575)](){return[lr,sc(504),yr,pr.Users]}static get[sc(557)](){return sc(515)}constructor(e){const t=sc;super(e),this[t(528)]=new Map}async[sc(536)](){const e=sc,t=this[e(567)],r=t[e(490)][e(551)](e(504));if(t[e(490)][e(551)](lr)[e(520)](this),r[e(517)]={addCommentThread:async({channelId:t,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=e,d=await this[c(559)](t)[c(535)]({commentThreadId:n,comments:r[c(485)]((e=>function(e,t,n){const r=c;return{commentThreadId:n,commentId:e[r(487)],userId:e[r(560)],content:e[r(522)],documentId:t,createdAt:e[r(571)],attributes:e[r(562)]||{}}}(e,t,n))),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(537)](dc);return{threadId:d[c(489)],comments:d[c(513)]}},getCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(559)](t)[r(511)](n)[r(537)](dc);return await this[r(521)]([s]),{threadId:s[r(489)],comments:s[r(513)][r(485)](lc),context:s[r(567)],resolvedAt:s[r(503)],resolvedBy:s[r(564)],attributes:s[r(562)]||{}}},updateCommentThread:async({channelId:t,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[e(559)](t)[e(492)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[e(537)](cc)[e(537)](dc),resolveCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(559)](t)[r(486)](n)[r(537)](cc)[r(537)](dc);return{threadId:s[r(489)],resolvedAt:s[r(503)],resolvedBy:s[r(564)]}},reopenCommentThread:async({channelId:t,threadId:n})=>this[e(559)](t)[e(526)](n)[e(537)](cc)[e(537)](dc),removeCommentThread:({channelId:t,threadId:n})=>this[e(559)](t)[e(532)](n)[e(537)](cc)[e(537)](dc),addComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(559)](t)[e(497)](n,r,s,o)[e(537)](dc),updateComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(559)](t)[e(542)](n,r,s,o)[e(537)](cc)[e(537)](dc),removeComment:({channelId:t,threadId:n,commentId:r})=>this[e(559)](t)[e(544)](n,r)[e(537)](cc)[e(537)](dc)},t instanceof n.Context){const n=t[e(529)][e(551)](e(531)),r=t[e(490)][e(551)](yr);await this[e(543)](n);const s=await this[e(528)][e(551)](n)[e(514)]();this[e(524)](r,e(574)+n,((t,{session:s})=>{const o=e;s.id===r[o(501)]&&(t[o(548)](),this[o(567)][o(490)][o(551)](o(530))[o(566)](s[o(491)],n))})),r[e(502)](n,s)}}async[sc(543)](e){const t=sc;if(this[t(528)][t(553)](e))throw new r.CKEditorError(t(555),null,{channelId:e});const n=this[t(567)][t(490)][t(551)](t(504)),s=new(oc[t(579)])(e);this[t(528)][t(523)](e,s),this[t(524)](s,t(496),((e,r)=>{const s=t,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=r;n[s(511)](o)||n[s(535)]({threadId:o,channelId:i,comments:l?l[s(485)](lc):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})})),this[t(524)](s,t(552),((e,{commentThreadId:r,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=t;n[c(511)](r)&&n[c(492)]({threadId:r,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})})),this[t(524)](s,t(519),((e,{commentThreadId:r,resolvedBy:s,resolvedAt:o})=>{const i=t,a=n[i(511)](r);a&&a[i(484)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})})),this[t(524)](s,t(565),((e,{commentThreadId:r})=>{const s=t,o=n[s(511)](r);o&&o[s(558)]({isFromAdapter:!0})})),this[t(524)](s,t(572),((e,{commentThreadId:r})=>{const s=t,o=n[s(511)](r);o&&o[s(495)]({isFromAdapter:!0})})),this[t(524)](s,t(576),((e,r)=>{const s=t,o=r[s(489)],i=n[s(511)](o);i&&i[s(497)]({...lc(r),isFromAdapter:!0})})),this[t(524)](s,t(518),((e,{commentThreadId:r,commentId:s,content:o,attributes:i})=>{const a=t,c=n[a(511)](r);if(c){const e=c[a(525)](s);e&&e[a(563)]({content:o,attributes:i,isFromAdapter:!0})}})),this[t(524)](s,t(578),((e,{commentThreadId:r,commentId:s})=>{const o=t,i=n[o(511)](r);if(i){const e=i[o(525)](s);e&&e[o(495)]({isFromAdapter:!0})}})),await this[t(505)](e)}[sc(539)](){const e=sc;if(this[e(567)]instanceof n.Context){const t=this[e(567)][e(529)][e(551)](e(531));this[e(506)](t)}}[sc(506)](e){const t=sc;if(!this[t(528)][t(553)](e))throw new r.CKEditorError(t(533),null,{channelId:e});this[t(559)](e)[t(499)](),this[t(528)][t(509)](e)}async[sc(577)](){const e=sc;for(const t of this[e(528)][e(545)]())await this[e(505)](t);if(this[e(567)]instanceof n.Context){const t=this[e(567)][e(529)][e(551)](e(531)),n=this[e(567)][e(490)][e(551)](yr);n[e(561)](t);const r=await this[e(528)][e(551)](t)[e(514)]();n[e(502)](t,r)}}async[sc(505)](e){const t=sc,{connection:n}=this[t(567)][t(490)][t(551)](lr),r=this[t(567)][t(490)][t(551)](t(504)),s=this[t(528)][t(551)](e),o=await s[t(494)](n);await this[t(521)](o);const i=new Set(Array[t(549)](r[t(540)]({channelId:e}),(e=>e.id)));for(const e of o)e[t(534)]||i[t(509)](e[t(489)]);for(const e of i)r[t(511)](e)[t(495)]({isFromAdapter:!0});for(const n of o){let s=r[t(511)](n[t(489)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[t(535)]({channelId:e,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[t(549)](s[t(513)],(e=>e.id)));for(const e of n[t(513)])p[t(509)](e[t(487)]);for(const e of p)s[t(525)](e)[t(495)]({isFromAdapter:!0});for(const e of n[t(513)]){const n=s[t(525)](e[t(487)]);n?n[t(522)]!==e[t(522)]&&n[t(563)]({content:e[t(522)],isFromAdapter:!0}):s[t(497)](Object[t(483)](lc(e),{isFromAdapter:!0}))}}}[sc(559)](e){const t=sc;if(!this[t(528)][t(553)](e))throw new r.CKEditorError(t(538),null,{channelId:e});return this[t(528)][t(551)](e)}async[sc(521)](e){const t=sc,n=this[t(567)][t(490)][t(551)](pr.Users),{connection:r}=this[t(567)][t(490)][t(551)](lr),s=new Set;for(const{resolvedBy:r,comments:o}of e){r&&!n[t(556)](r)&&s[t(569)](r);for(const{userId:e}of o)n[t(556)](e)||s[t(569)](e)}if(0===s[t(508)])return;const o=await Ye[t(516)](r,Array[t(549)](s));for(const e of o)n[t(556)](e.id)||n[t(481)](e)}}function ic(e,t){const n=uc();return(ic=function(e,t){return n[e-=481]})(e,t)}oc[sc(579)]=ir;const ac=oc;async function cc(e){const t=sc;if(t(554)!==e[t(573)])throw e}function dc(e){const t=sc;if((n=e)[t(493)][t(568)](t(510))||n[t(493)][t(568)](t(546))||n[t(493)][t(568)](t(547)))return new Promise((()=>{}));var n;throw e}function uc(){const e=["2798502mbhOql","comments","getConnectedSessions","CloudServicesCommentsAdapter","getMany","adapter","commentUpdated","commentThreadResolved","addToReconnectionStack","_fetchMissingUsersForThreads","content","set","listenTo","getComment","reopenCommentThread","190332OTsdWK","_services","config","Permissions","collaboration.channelId","removeCommentThread","cloudservicescommentsadapter-disconnect-not-exist","deletedAt","addCommentThread","init","catch","cloudservicescommentsadapter-service-not-exist","destroy","getCommentThreads","336dpupYs","updateComment","_setUpService","removeComment","keys","cloud-services-internal-error: Not connected.","cloud-services-internal-error: Request timeout.","off","from","945603GsehUG","get","commentThreadUpdated","has","404","cloudservicescommentsadapter-connect-already-connected","getUser","pluginName","reopen","_getService","authorId","unregister","attributes","update","resolvedBy","commentThreadReopened","setPermissions","context","startsWith","add","97340EPObEj","createdAt","commentThreadRemoved","code","sessionAdd:","requires","commentAdded","reconnect","commentRemoved","CommentsService","addUser","3540zNquCv","assign","resolve","map","resolveCommentThread","commentId","398010ElFSBm","commentThreadId","plugins","permissions","updateCommentThread","message","connect","remove","commentThreadAdded","addComment","userId","disconnect","528160LsCNtB","mySessionId","register","resolvedAt","CommentsRepository","_connectService","_terminateService","16HNnqoW","size","delete","cloud-services-internal-error: Comments Service is not connected.","getCommentThread"];return(uc=function(){return e})()}function lc(e){const t=sc;return{threadId:e[t(489)],commentId:e[t(487)],content:e[t(522)],createdAt:e[t(571)],authorId:e[t(498)],attributes:e[t(562)]||{}}}function pc(){const e=["connected","data","_fetchMissingUsersForThreads","adapter","add","state","9313288bKphaj","startsWith","29YjnVOB","message","_waitForServiceReady","TrackChangesService","requires","cloud-services-internal-error: Not connected.","reconnect","listenTo","set","config","suggestionUpdated","from","21630780YxDLtZ","originalSuggestionId","find","addSuggestionData","_saved","9HhHyCM","3801525ebefFp","getSuggestion","collaboration.channelId","delete","55758vnIaUQ","init","_bufferedRequests","getUser","addToReconnectionStack","catch","type","TrackChangesEditing","connect","2824828ODfKun","connection","size","cloud-services-internal-error: Request timeout.","update","addUser","off","plugins","attributes","isConnected","hasSuggestion","then","_trackChangesService","getMany","3vNnTOL","editor","8846411IgcRlM","open","values","get","2592234NJxuBV"];return(pc=function(){return e})()}const hc=fc;function fc(e,t){const n=pc();return(fc=function(e,t){return n[e-=108]})(e,t)}!function(e,t){const n=fc,r=e();for(;;)try{if(643576===parseInt(n(146))/1*(parseInt(n(108))/2)+-parseInt(n(131))/3*(-parseInt(n(117))/4)+parseInt(n(164))/5+parseInt(n(137))/6+parseInt(n(133))/7+-parseInt(n(144))/8*(parseInt(n(163))/9)+-parseInt(n(158))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(pc);class mc extends n.Plugin{static get[hc(150)](){return[ac,hc(115),lr]}constructor(e){const t=hc;super(e);const n=this[t(132)][t(155)][t(136)](t(166));this[t(110)]=new Map,this[t(129)]=new(mc[t(149)])(n)}[hc(109)](){const e=hc,t=this[e(132)][e(124)][e(136)](lr),n=this[e(132)][e(124)][e(136)](e(115));return n[e(141)]={getSuggestion:async t=>{const n=e;await this[n(148)]();const r=await this[n(129)][n(136)](t)[n(113)](yc);return await this[n(140)]([r]),r},addSuggestion:async({id:t,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=e;await this[i(148)]();const a={id:t,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(129)][i(142)](t,n,r,s,o)[i(113)]((e=>{if(gc(e))return new Promise((e=>{const n=fc;this[n(110)][n(154)](t,{resolve:e,suggestionData:a})}));throw e}));return this[i(110)][i(167)](t),c},updateSuggestion:async(t,n)=>{const r=e;if(await this[r(148)](),r(134)!==n[r(143)])return this[r(129)][r(121)](t,n)[r(113)](yc)}},this[e(153)](this[e(129)],e(156),((t,r)=>{const s=e;n[s(127)](r.id)&&(n[s(165)](r.id)[s(125)]=r[s(125)])})),this[e(129)][e(116)](t[e(118)])[e(128)]((r=>(t[e(112)](this),this[e(140)](r)[e(128)]((()=>{const t=e;for(const e of r)n[t(161)](e)[t(162)]=!0})))))}async[hc(152)](){const e=hc,t=this[e(132)][e(124)][e(136)](e(115)),{connection:n}=this[e(132)][e(124)][e(136)](lr),r=await this[e(129)][e(116)](n);await this[e(140)](r);for(const{suggestionData:t,resolve:n}of this[e(110)][e(135)]()){let s=r[e(160)]((e=>e.id===t.id));s||(s=await this[e(129)][e(142)](t.id,t[e(114)],t[e(139)],t[e(159)])),n(s)}for(const n of r)t[e(127)](n.id)||t[e(161)](n)}async[hc(148)](){const e=hc;this[e(129)][e(126)]||await new Promise((t=>{const n=e;this[n(153)](this[n(129)],n(138),(e=>{e[n(123)](),t()}))}))}async[hc(140)](e){const t=hc,n=this[t(132)][t(124)][t(136)](pr.Users),{connection:r}=this[t(132)][t(124)][t(136)](lr),s=new Set;for(const{authorId:r}of e)n[t(111)](r)||s[t(142)](r);if(0===s[t(119)])return;const o=await Ye[t(130)](r,Array[t(157)](s));for(const e of o)n[t(111)](e.id)||n[t(122)](e)}}function yc(e){if(gc(e))return new Promise((()=>{}));throw e}function gc(e){const t=hc;return e[t(147)][t(145)](t(151))||e[t(147)][t(145)](t(120))}function bc(){const e=["data","plugins","requires","isThreadsLoadingPaused","123732jQMxvo","2380122vmzKTW","RealTimeCollaborativeComments","270bNJSJZ","get","23346irvMMn","CommentsRepository","listenTo","11481130XjIJxQ","7ZYCzNU","editor","collaboration.channelId","ready","Comments","5228zvwFqS","_setUpService","CommentsEditing","destroy","11cCZXsA","_terminateService","12857412eXgvUy","5LEFsTz","1347MqKEDi","config","connected","pluginName","init","once","switchReadOnly","change:state","5403184kPUBKg"];return(bc=function(){return e})()}mc[hc(149)]=pn;const Oc=wc;function wc(e,t){const n=bc();return(wc=function(e,t){return n[e-=456]})(e,t)}!function(e,t){const n=wc,r=e();for(;;)try{if(742278===-parseInt(n(476))/1*(-parseInt(n(460))/2)+parseInt(n(477))/3*(parseInt(n(469))/4)+parseInt(n(458))/5*(parseInt(n(490))/6)+-parseInt(n(464))/7*(parseInt(n(485))/8)+-parseInt(n(456))/9+-parseInt(n(463))/10+-parseInt(n(473))/11*(-parseInt(n(475))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(bc);class Ic extends n.Plugin{static get[Oc(488)](){return[Oc(468),ac,rc,lr]}static get[Oc(480)](){return Oc(457)}[Oc(481)](){const e=Oc,t=this[e(465)][e(487)][e(459)](lr),n=this[e(465)][e(487)][e(459)](e(471)),r=this[e(465)][e(487)][e(459)](ac);return this[e(465)][e(486)][e(482)](e(467),(()=>{const r=e;this[r(462)](t,r(484),((e,t,s)=>{const o=r;n[o(489)]=o(479)!==s}))})),this[e(462)](t,e(484),((t,n,r)=>{const s=e;this[s(465)][s(487)][s(459)](s(461))[s(483)](s(479)!==r)})),r[e(470)](this[e(465)][e(478)][e(459)](e(466)))}[Oc(472)](){const e=Oc;this[e(465)][e(487)][e(459)](ac)[e(474)](this[e(465)][e(478)][e(459)](e(466))),super[e(472)]()}}var vc=Sc;function Sc(e,t){var n=Ac();return(Sc=function(e,t){return n[e-=271]})(e,t)}function Ac(){var e=["1805010nibWPa","522987YtPEJD","611OmWsBS","760irfDlo","pluginName","236425JTQuGw","RealTimeCollaborativeTrackChanges","1807544VkpEpo","9wavIEj","806388YDITCi","TrackChanges","110360HIOysD","requires"];return(Ac=function(){return e})()}!function(e,t){for(var n=Sc,r=e();;)try{if(162791===-parseInt(n(276))/1*(parseInt(n(277))/2)+parseInt(n(275))/3+parseInt(n(283))/4+-parseInt(n(272))/5+parseInt(n(274))/6+-parseInt(n(279))/7+-parseInt(n(281))/8*(parseInt(n(282))/9))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Ac);class Pc extends n.Plugin{static get[vc(273)](){return[Ic,mc,vc(271)]}static get[vc(278)](){return vc(280)}}const Tc=_c;function _c(e,t){const n=jc();return(_c=function(e,t){return n[e-=148]})(e,t)}!function(e,t){const n=_c,r=e();for(;;)try{if(462892===parseInt(n(151))/1+-parseInt(n(213))/2*(parseInt(n(246))/3)+parseInt(n(229))/4*(-parseInt(n(170))/5)+parseInt(n(206))/6+-parseInt(n(257))/7+parseInt(n(254))/8+-parseInt(n(149))/9*(-parseInt(n(258))/10))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(jc);class kc extends n.Plugin{static get[Tc(164)](){return[lr,Wa,Tc(227),yr,pr.Users]}constructor(e){const t=Tc;super(e);const n=this[t(247)][t(196)][t(167)](t(168));this[t(191)]=null,this[t(157)]=this[t(247)][t(186)][t(167)](t(227)),this[t(210)]=new(kc[t(189)])(n)}async[Tc(233)](){const e=Tc,t=this[e(247)][e(186)][e(167)](Wa),n=t[e(218)],s=this[e(247)][e(186)][e(167)](lr);this[e(157)][e(165)]({history:n,getLatestVersion:()=>this[e(195)](),getCurrentRevisionId:()=>t[e(200)]});const o=this[e(247)][e(196)][e(167)](e(154))||r.version,i=await Jt[e(248)](s[e(148)],o);this[e(157)][e(179)]={getRevision:async({revisionId:t})=>(await this[e(251)](),await this[e(210)][e(171)](t)),updateRevisions:async t=>{const n=e;await this[n(251)]();const r=this[n(157)][n(205)];if(i&&1===t[n(183)]&&t[0].id===r.id)return t;for(const e of t)e.id===r.id&&(e[n(161)]=e[n(216)]===e[n(153)]);return this[n(210)][n(252)](t,this[n(191)])[n(155)]((e=>(this[n(191)]=e,t)))[n(215)]((e=>{const r=n;if(Ec(e)||r(184)===e[r(212)]&&void 0!==e[r(194)][r(255)]){for(const e of t)!this[r(157)][r(174)][r(171)](e.id)||this[r(157)][r(240)](e.id,e,!1);if(Ec(e))throw e;return t}throw e}))}},this[e(204)](this[e(210)],e(159),((t,{revisionsData:n,requestId:r})=>{const s=e;Math[s(169)](...n[s(163)]((e=>e[s(153)])))>this[s(211)]()-1?this[s(195)]()[s(155)]((()=>{this[s(245)](n,r)})):this[s(245)](n,r)}));const{revisions:a,requestId:c}=await this[e(210)][e(187)](s[e(148)]);s[e(235)](this),this[e(191)]=c,await this[e(197)](a);for(const t of a)this[e(157)][e(185)](t);this[e(204)](t,e(242),((n,r,s)=>{const o=e;s&&(this[o(222)]=t[o(181)],n[o(243)]())})),this[e(157)][e(250)](e(220)).to(s,e(226),(t=>t===Dt[e(173)]))}async[Tc(175)](){const e=Tc,t=this[e(247)][e(186)][e(167)](lr),n=this[e(247)][e(186)][e(167)](Wa),r=async()=>{const r=e,s=this[r(157)][r(205)],o=s.id,i=o!==n[r(200)];if(i){const e=n[r(181)]-this[r(222)],t=this[r(211)]();if(this[r(157)][r(237)][r(203)](),s[r(153)]+e!==t){const n=s[r(216)]+e,o=this[r(247)][r(186)][r(167)](pr.Users),i=this[r(157)][r(232)]({revision:s,from:n,to:t});i.id=s.id;const a=i[r(160)][r(163)]((e=>o[r(188)](e)));s[r(223)]({...i,authors:a},!0),this[r(157)][r(240)](s.id,i,!0)}this[r(157)][r(193)]=t,s[r(153)]===s[r(216)]&&!this[r(157)][r(201)][r(150)](o)&&this[r(157)][r(174)][r(207)][r(209)](o),this[r(157)][r(152)](t)}const{revisions:a,requestId:c}=await this[r(210)][r(175)](t[r(148)],this[r(191)]);i&&a[r(183)]>0?n[r(208)]():(await this[r(197)](a),this[r(245)](a,c),this[r(157)][r(180)]())};return n[e(241)]?r():new Promise(((t,s)=>{const o=e;n[o(182)](o(242),(()=>{const e=o;r()[e(155)](t)[e(215)](s)}))}))}[Tc(225)](){super[Tc(225)]()}async[Tc(251)](){const e=Tc;this[e(210)][e(249)]||await new Promise((t=>{const n=e;this[n(204)](this[n(210)],n(238),(e=>{e[n(243)](),t()}))}))}[Tc(211)](){const e=Tc,t=this[e(247)][e(186)][e(167)](Wa)[e(218)][e(256)]()[e(162)]();for(const n of t)if(e(177)!==n[e(176)]||n[e(198)])return n[e(224)]+1}[Tc(195)](){const e=Tc,t=this[e(247)][e(186)][e(167)](Wa);return new Promise((n=>{const r=e;t[r(219)]?t[r(182)](r(199),(()=>{n(this[r(211)]())})):n(this[r(211)]())}))}[Tc(245)](e,t){const n=Tc,r=this[n(157)][n(174)];this[n(191)]=t;for(const t of e){const e=r[n(171)](t.id);if(e){if((t[n(216)]||t[n(153)])&&(t[n(172)]=null),e===this[n(157)][n(205)]){const r=Math[n(169)](e[n(153)],t[n(153)]),s=Math[n(169)](e[n(216)],t[n(216)]);let o;e[n(153)]===t[n(153)]&&e[n(216)]===t[n(216)]?(o=!0,this[n(190)](t)):t[n(153)]===r&&t[n(216)]===s?o=!1:(e[n(153)]===r&&e[n(216)]===s||this[n(236)]({revision:e,from:s,to:r}),o=!0),o&&(delete t[n(216)],delete t[n(153)],delete t[n(172)],delete t[n(217)],delete t[n(160)])}this[n(157)][n(166)](t),this[n(190)](t)}else this[n(157)][n(185)](t)}const s=r[n(228)]();s[n(162)]();for(let e=0;e<s[n(183)]-1;e++){const t=s[e],r=s[e+1];if(t[n(216)]<r[n(153)]){const e=r[n(153)],s=Math[n(169)](e,t[n(153)]);this[n(236)]({revision:t,from:e,to:s})}}}[Tc(236)]({revision:e,from:t,to:n}={}){const r=Tc,s=this[r(247)][r(186)][r(167)](pr.Users),o=this[r(157)][r(232)]({revision:e,from:t,to:n});o[r(178)]=o[r(160)][r(163)]((e=>s[r(188)](e))),e[r(223)](o)}[Tc(190)](e){const t=Tc,n={};n.id=e.id;for(const r of Object[t(234)](e))"id"!==r&&(n[r]=void 0);this[t(157)][t(240)](n.id,n,!0)}async[Tc(197)](e){const t=Tc,n=this[t(247)][t(186)][t(167)](pr.Users),{connection:r}=this[t(247)][t(186)][t(167)](lr),s=new Set;for(const n of e){for(const e of n[t(160)])i(e);n[t(202)]&&i(n[t(202)])}if(0===s[t(156)])return;const o=await Ye[t(221)](r,Array[t(158)](s));for(const e of o)n[t(188)](e.id)||n[t(230)](e);function i(e){const r=t;n[r(188)](e)||s[r(253)](e)}}}kc[Tc(189)]=$t;const Cc=kc;function Ec(e){const t=Tc;return e[t(244)][t(231)](t(192))||e[t(244)][t(231)](t(214))||e[t(244)][t(231)](t(239))}function jc(){const e=["adapter","sendBufferedUpdates","_offset","once","length","400","addRevisionData","plugins","connect","getUser","RevisionHistoryService","_preventResendingRevisionData","_lastRequestId","cloud-services-internal-error: Revision History Service is not connected.","_startingVersion","data","_getLatestVersion","config","_fetchMissingUsers","affectsData","change:_isPendingUpdate","sessionId","_bufferedUpdates","creatorId","reInit","listenTo","currentRevision","1594350ZQaNeJ","_revisions","_handleReconnectionError","remove","_revisionHistoryService","_getLatestVersionFromServerOperations","code","896462HdjMqv","cloud-services-internal-error: Not connected.","catch","fromVersion","createdAt","serverHistory","_isPendingUpdate","isEnabled","getMany","_oldOffset","_update","baseVersion","destroy","state","RevisionTracker","getRevisions","4LtxrOE","addUser","startsWith","buildRevisionData","init","keys","addToReconnectionStack","_fixRevision","_revisionDataBuilder","connected","cloud-services-internal-error: Request timeout.","_bufferUpdate","_isConnected","change:_isConnected","off","message","_handleRevisionsUpdate","3ewQvJG","editor","isBundleUploaded","isConnected","bind","_waitForServiceReady","updateRevisions","add","5795144frWpHc","wrongRequestId","getOperations","6301491TPQYmS","1534450AQRnYA","connection","63cYwefm","has","507461reGjml","_createCurrentRevision","toVersion","cloudServices.bundleVersion","then","size","_revisionTracker","from","revisionsUpdated","authorsIds","isEmptyCurrent","reverse","map","requires","setSource","setRevisionData","get","collaboration.channelId","max","3801790rAEpwW","getRevision","diffData","CONNECTED","repository","reconnect","type","marker","authors"];return(jc=function(){return e})()}var Rc=Dc;function Dc(e,t){var n=Nc();return(Dc=function(e,t){return n[e-=434]})(e,t)}function Nc(){var e=["10936009eDxeFI","requires","22095PGEKqi","2678206eQMwWg","31596032qOGHXN","1300767XmlBft","1628830KxZFWk","pluginName","2022DaARXm","3040592xpAIZU","RealTimeCollaborativeRevisionHistory","RevisionHistory"];return(Nc=function(){return e})()}!function(e,t){for(var n=Dc,r=e();;)try{if(934846===-parseInt(n(442))/1+parseInt(n(439))/2+-parseInt(n(441))/3+parseInt(n(445))/4+parseInt(n(438))/5*(-parseInt(n(444))/6)+-parseInt(n(436))/7+parseInt(n(440))/8)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Nc);class xc extends n.Plugin{static get[Rc(437)](){return[Rc(435),Cc,rc]}static get[Rc(443)](){return Rc(434)}}var Vc=Function.prototype,Mc=Object.prototype,Bc=Vc.toString,Uc=Mc.hasOwnProperty,Jc=Bc.call(Object);const qc=function(e){if(!po(e)||"[object Object]"!=gs(e))return!1;var t=pi(e);if(null===t)return!0;var n=Uc.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Bc.call(n)==Jc};const Lc=function(e){return po(e)&&1===e.nodeType&&!qc(e)};function Gc(e,t){const n=Fc();return(Gc=function(e,t){return n[e-=435]})(e,t)}!function(e,t){const n=Gc,r=e();for(;;)try{if(335446===parseInt(n(436))/1+parseInt(n(435))/2+-parseInt(n(437))/3*(-parseInt(n(438))/4)+parseInt(n(440))/5+-parseInt(n(444))/6*(parseInt(n(445))/7)+parseInt(n(442))/8*(-parseInt(n(451))/9)+-parseInt(n(439))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Fc);class Yc extends s.View{constructor(e){const t=Gc;super(e);const n=this[t(448)];this[t(453)](t(450),0),this[t(453)](t(443),!0),this[t(447)]({tag:t(441),attributes:{class:["ck",t(449),n.if(t(443),t(452))]},children:[{text:n.to(t(450),(n=>Tr(e,t(446),n)))}]})}}function Fc(){const e=["set","1035248ApXPlf","285079RZTpCa","12ipuxyE","397988ZqEEqT","12812120GutuvW","2627755hNfmqt","div","488etEcBZ","isHidden","258GzNgoJ","4781Eriufe","CONNECTED_USERS","setTemplate","bindTemplate","ck-presence-list__counter","usersCount","11835xObjYb","ck-presence-list__counter--hidden"];return(Fc=function(){return e})()}function Hc(){const e=["fire","div","setTemplate","7876952vkkAyo","75210EqVTvO","createCollection","48006xwKrgD","746796VnUGmi","1532415FJbPhk","items","3503528KNICGb","execute","bindTemplate","ck-presence-list__list","162786FQMsKu","77UbpIVq"];return(Hc=function(){return e})()}function zc(e,t){const n=Hc();return(zc=function(e,t){return n[e-=325]})(e,t)}!function(e,t){const n=zc,r=e();for(;;)try{if(811297===parseInt(n(331))/1+parseInt(n(332))/2+parseInt(n(339))/3+parseInt(n(335))/4+parseInt(n(333))/5+parseInt(n(329))/6*(parseInt(n(340))/7)+-parseInt(n(328))/8)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Hc);class Kc extends s.View{constructor(e){const t=zc;super(e),this[t(334)]=this[t(330)]();const n=this[t(337)];this[t(327)]({tag:t(326),attributes:{class:["ck",t(338)]},children:this[t(334)],on:{click:n.to((()=>this[t(325)](t(336))))}})}}var Wc=__webpack_require__(106),Qc={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};br()(Wc.A,Qc);Wc.A.locals;function $c(){const e=["ck-rounded-corners","bindTemplate","tooltipPosition","locale","46668QPzrQH","set","1744932PfLjcY","75CShPcb","change","93ORcYxc","670QjVqgm","isCollapsed","498368gDgpEC","77CPOZFL","ck-presence-list","listenTo","first","div","ck-presence-list--collapsed","261850cUtlfK","31068uFhGNR","ck-reset","items","counterView","inlineListView","setTemplate","18056NUGMOc","2tWukxS","523956sYtVOL"];return($c=function(){return e})()}function Zc(e,t){const n=$c();return(Zc=function(e,t){return n[e-=349]})(e,t)}!function(e,t){const n=Zc,r=e();for(;;)try{if(168509===parseInt(n(374))/1*(parseInt(n(353))/2)+-parseInt(n(364))/3*(-parseInt(n(352))/4)+-parseInt(n(362))/5*(-parseInt(n(359))/6)+parseInt(n(361))/7+-parseInt(n(367))/8+parseInt(n(375))/9*(-parseInt(n(365))/10)+-parseInt(n(368))/11*(parseInt(n(354))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}($c);class Xc extends s.View{constructor(e){const t=Zc;super(e);const n=this[t(356)];this[t(360)](t(366),!0),this[t(349)]=new Yc(this[t(358)]),this[t(350)]=new Kc(e),this[t(370)](this[t(350)][t(377)],t(363),(()=>{const e=t;for(const t of this[e(350)][e(377)])t[e(357)]="s";this[e(350)][e(377)][e(371)]&&(this[e(350)][e(377)][e(371)][e(357)]="se")})),this[t(351)]({tag:t(372),attributes:{class:["ck",t(369),t(376),t(355),n.if(t(366),t(373))]},children:[this[t(349)],this[t(350)]]})}}function ed(e,t){var n=td();return(ed=function(e,t){return n[e-=392]})(e,t)}function td(){var e=["169PLWiHj","ck-presence-list__dropdown-list-wrapper","1140HFumNh","54lLHzBR","673088LbeRmt","2532RfIHFx","items","60027MBRrtZ","createCollection","328150twxVBH","ck-presence-list__dropdown-list","6kWPzMD","1579816pYRIZy","135015EWXKyO","715920koVMna","7JRCFTE","div","setTemplate"];return(td=function(){return e})()}!function(e,t){for(var n=ed,r=e();;)try{if(133271===parseInt(n(402))/1*(parseInt(n(407))/2)+parseInt(n(398))/3+-parseInt(n(406))/4+-parseInt(n(397))/5*(parseInt(n(395))/6)+parseInt(n(399))/7*(parseInt(n(396))/8)+parseInt(n(405))/9*(parseInt(n(393))/10)+-parseInt(n(409))/11*(parseInt(n(404))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(td);class nd extends s.View{constructor(e){var t=ed;super(e),this[t(408)]=this[t(392)](),this[t(401)]({tag:t(400),attributes:{class:["ck",t(394)]},children:[{tag:t(400),attributes:{class:["ck",t(403)]},children:this[t(408)]}]})}}function rd(){const e=["811380lAECDC","1361816CkRDut","1299848yKMwzR","color","21ixTTjp","tag","div","310OHgERM","setTemplate","ck-presence-list__marker","751556sZnMnR","fire","button","execute","35GcWMiC","bindTemplate","ck-user__full-name","name","getBackgroundColorClass","928926EuBPaE","136224swkGpZ","ck-presence-list__dropdown-list-item","userView","530986RHBMxa","true","span"];return(rd=function(){return e})()}function sd(e,t){const n=rd();return(sd=function(e,t){return n[e-=493]})(e,t)}!function(e,t){const n=sd,r=e();for(;;)try{if(981408===parseInt(n(503))/1+parseInt(n(498))/2+parseInt(n(501))/3+parseInt(n(511))/4+-parseInt(n(515))/5*(parseInt(n(494))/6)+parseInt(n(505))/7*(parseInt(n(502))/8)+-parseInt(n(495))/9*(parseInt(n(508))/10))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(rd);class od extends s.View{constructor(e,t,n){const r=sd;super(e);const s=this[r(516)];this[r(497)]=new pr.UserView(e,t);const o={tag:r(507),attributes:{class:["ck",r(496)]},children:[this[r(497)],{tag:r(500),attributes:{class:["ck",r(517)]},children:[{text:t[r(518)]}]},{tag:r(500),attributes:{class:["ck",r(510),t[r(504)][r(493)]()],"aria-hidden":r(499)}}]};n&&(o[r(506)]=r(513),o.on={click:s.to((()=>this[r(512)](r(514))))}),this[r(509)](o)}}function id(e,t){const n=ad();return(id=function(e,t){return n[e-=327]})(e,t)}function ad(){const e=["true","364eOohQv","hasTooltip","29530LzvnRQ","2277186aGyGbu","1526mPTrBa","9rlZdCF","1079850vwgaFR","bindTemplate","1794tJpovG","button","tag","ck-presence-list__marker","8034648vchtGb","ck-presence-list__list-item__tooltip","color","div","userView","fire","tooltipPosition","2172915dIWMPe","getBackgroundColorClass","set","setTemplate","markerView","name","1587608zPmjqh","execute","ck-presence-list__list-item","30KTvGBP","span"];return(ad=function(){return e})()}!function(e,t){const n=id,r=e();for(;;)try{if(814329===-parseInt(n(347))/1+parseInt(n(344))/2+parseInt(n(329))/3+parseInt(n(341))/4*(parseInt(n(343))/5)+parseInt(n(349))/6*(parseInt(n(345))/7)+parseInt(n(353))/8*(-parseInt(n(346))/9)+-parseInt(n(338))/10*(-parseInt(n(335))/11))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(ad);class cd extends s.View{constructor(e,t,n){const r=id;super(e);const s=this[r(348)];this[r(331)](r(342),!0),this[r(331)](r(328),""),this[r(357)]=new pr.UserView(e,t),this[r(333)]=new dd(e,t);const o={tag:r(356),attributes:{class:["ck",r(337)],"data-cke-tooltip-text":this[r(357)][r(334)],"data-cke-tooltip-position":s.to(r(328)),"data-cke-tooltip-disabled":s.to(r(342),(e=>!e)),"data-cke-tooltip-class":r(354)},children:[this[r(357)],this[r(333)]]};n&&(o[r(351)]=r(350),o.on={click:s.to((()=>this[r(327)](r(336))))}),this[r(332)](o)}}class dd extends s.View{constructor(e,t){const n=id;super(e),this[n(332)]({tag:n(339),attributes:{class:["ck",n(352),t[n(355)][n(330)]()],"aria-hidden":n(340)}})}}const ud=ld;function ld(e,t){const n=fd();return(ld=function(e,t){return n[e-=372]})(e,t)}!function(e,t){const n=ld,r=e();for(;;)try{if(627689===-parseInt(n(412))/1+parseInt(n(400))/2*(-parseInt(n(386))/3)+-parseInt(n(436))/4*(parseInt(n(390))/5)+parseInt(n(403))/6+-parseInt(n(384))/7*(parseInt(n(418))/8)+parseInt(n(373))/9+parseInt(n(385))/10*(parseInt(n(415))/11))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(fd);const pd={collapseAt:6,displayMe:!0};class hd extends n.ContextPlugin{constructor(e){const t=ld;super(e),this[t(401)][t(428)][t(382)](t(404),pd);const n=e[t(428)][t(389)](t(402));if(t(429)!=typeof n)throw new r.CKEditorError(t(443),this);if(n<1)throw new r.CKEditorError(t(443),this);this[t(416)]=this[t(401)][t(376)][t(389)](yr)[t(394)],this[t(383)](t(377),0),this[t(378)]=new r.Collection,this[t(395)]=new s.BalloonPanelView,this[t(395)][t(399)]=t(372),this[t(381)]=this[t(445)](),this[t(397)]=void 0}static get[ud(413)](){return[yr]}[ud(437)](){const e=ud;for(const t of this[e(416)])this[e(432)](t);this[e(433)](this[e(416)],e(442),((t,n)=>{this[e(432)](n)})),this[e(433)](this[e(416)],e(419),((t,n)=>{this[e(430)](n)}))}[ud(445)](){const e=ud,t=this[e(401)],n=new Xc(this[e(401)][e(414)]),o=this[e(395)];if(!Lc(t[e(428)][e(389)](e(444))))throw new r.CKEditorError(e(427),this);return n[e(388)][e(380)](e(377)).to(this),n[e(380)](e(426)).to(this,e(377),(r=>{const s=e,{collapseAt:o,displayMe:i}=t[s(428)][s(389)](s(404)),a=r>=o;return n[s(388)][s(409)]=!(1==r&&i||a),a||this[s(411)](),a})),n[e(440)][e(422)][e(441)](this[e(378)])[e(439)]((r=>{const s=e,o=t[s(428)][s(389)](s(404)),i=new cd(t[s(414)],r,!!o[s(435)]);return i[s(380)](s(420)).to(n,s(426),(e=>!e)),o[s(435)]&&this[s(433)](i,s(408),(()=>{const e=s;this[e(381)][e(426)]||o[e(435)](r,i[e(434)])})),i})),this[e(433)](n[e(440)],e(408),(()=>{const t=e;this[t(397)]?this[t(411)]():this[t(381)][t(426)]&&this[t(379)]()})),n[e(398)](),o[e(398)](),(0,s.clickOutsideHandler)({emitter:n,activator:()=>o[e(438)],contextElements:[o[e(434)],n[e(440)][e(434)]],callback:()=>this[e(411)]()}),t[e(428)][e(389)](e(444))[e(406)](n[e(434)]),this[e(387)]=new s.BodyCollection(this[e(401)][e(414)]),this[e(387)][e(392)](),this[e(387)][e(442)](o),n}[ud(432)](e){const t=ud;if(!this[t(401)][t(428)][t(389)](t(374))&&e[t(424)])return;const n=this[t(401)][t(428)][t(389)](t(402))-1;this[t(377)]++,this[t(378)][t(423)]==n&&this[t(378)][t(419)](0);const r=this[t(425)](e);this[t(378)][t(442)](e,r)}[ud(430)](e){const t=ud;if(this[t(377)]--,this[t(378)][t(389)](e.id)&&(this[t(378)][t(419)](e.id),this[t(378)][t(423)]<this[t(377)]))for(const e of Array[t(375)](this[t(416)])[t(407)]())if(!this[t(378)][t(389)](e.id))return void this[t(378)][t(442)](e,0)}[ud(425)](e){const t=ud;return Boolean(this[t(378)][t(417)]&&this[t(378)][t(417)][t(424)])&&!e[t(424)]?this[t(378)][t(423)]-1:this[t(378)][t(423)]}[ud(379)](){const e=ud;if(this[e(397)])return;this[e(397)]=new nd(this[e(401)][e(414)]);const t=this[e(401)][e(428)][e(389)](e(404));this[e(397)][e(422)][e(441)](this[e(416)])[e(439)]((n=>{const r=e;if(!t[r(431)]&&n[r(424)])return null;const s=new od(this[r(401)][r(414)],n,!!t[r(435)]);return t[r(435)]&&this[r(433)](s,r(408),(()=>{const e=r;t[e(435)](n,s[e(434)])})),s})),this[e(395)][e(393)][e(442)](this[e(397)]),this[e(395)][e(391)]({target:this[e(381)][e(440)][e(434)]})}[ud(411)](){const e=ud;this[e(397)]&&(this[e(395)][e(410)](),this[e(395)][e(393)][e(419)](this[e(397)]),this[e(397)][e(405)](),this[e(397)]=void 0)}[ud(405)](){const e=ud;super[e(405)](),this[e(381)]&&this[e(381)][e(396)]&&this[e(381)][e(405)](),this[e(387)]&&this[e(387)][e(421)]()}}function fd(){const e=["locale","308jDfbaD","_allConnectedUsers","last","8vqCRGF","remove","hasTooltip","detachFromDom","items","length","isMe","_calculateNewUserPosition","isCollapsed","presencelist-missing-container","config","number","_handleUserRemove","displayMe","_handleUserAdd","listenTo","element","onClick","13444Iobujf","init","isVisible","using","inlineListView","bindTo","add","presencelist-collapseat-invalid-format","presenceList.container","_createView","ck ck-presence-list__balloon","696060ZdVwus","presenceList.displayMe","from","plugins","usersCount","currentDisplayedUsers","showDropdown","bind","view","define","set","4509463ecEpuD","726860UACkbF","9UxXnrv","_bodyCollection","counterView","get","85UVkUPM","pin","attachToDom","content","allConnectedUsers","balloonPanelView","isRendered","presenceDropdownView","render","class","619342dQvDSr","context","presenceList.collapseAt","2382378AfYNZf","presenceList","destroy","appendChild","reverse","execute","isHidden","unpin","hideDropdown","251563fRYxDJ","requires"];return(fd=function(){return e})()}var md=gd;function yd(){var e=["1111ZIafaI","requires","6196824fEUFIX","19523xlXNnu","4svDCUM","PresenceList","2316AnXQQB","pluginName","1179363pucpHD","1384JCwXoC","4315UZTEFQ","397125HmimOo","633046kfJnsi","80890DNaqgp"];return(yd=function(){return e})()}function gd(e,t){var n=yd();return(gd=function(e,t){return n[e-=482]})(e,t)}!function(e,t){for(var n=gd,r=e();;)try{if(377391===parseInt(n(482))/1+-parseInt(n(483))/2+parseInt(n(493))/3*(-parseInt(n(489))/4)+-parseInt(n(495))/5*(parseInt(n(491))/6)+parseInt(n(488))/7*(-parseInt(n(494))/8)+parseInt(n(487))/9+parseInt(n(484))/10*(parseInt(n(485))/11))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(yd);class bd extends n.ContextPlugin{static get[md(486)](){return[yr,hd]}static get[md(492)](){return md(490)}}function Od(e,t){var n=wd();return(Od=function(e,t){return n[e-=383]})(e,t)}function wd(){var e=["249078FWOIUv","80BancfE","175820hBFyOk","7769490fHfrnH","293294GWbQLm","9551364UikFPb","11wdsMwQ","1914yydwHj","65zvWOKS","190179ghzAqT","15kLwOTe","3521ozBRLD","13xHcAPY"];return(wd=function(){return e})()}!function(e,t){for(var n=Od,r=e();;)try{if(390935===-parseInt(n(393))/1+parseInt(n(384))/2*(-parseInt(n(390))/3)+-parseInt(n(395))/4*(parseInt(n(388))/5)+parseInt(n(387))/6*(parseInt(n(391))/7)+-parseInt(n(394))/8*(-parseInt(n(389))/9)+-parseInt(n(383))/10*(-parseInt(n(386))/11)+-parseInt(n(385))/12*(-parseInt(n(392))/13))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(wd)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();
5
+ */(()=>{var __webpack_modules__={310:e=>{"use strict";e.exports=function(e,t){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(e){if(o)if(o=!1,e)i(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];s.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,i(e))}}))}},662:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),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(e,t,n){for(var s,o=null,i=[],a=0,c=0;t<n;){var d=e[t++];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(e,t,n){for(var r,o=n,a=0,c=0;c<e.length;){var d=e.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:t[n++]=r<<2|(48&d)>>4,r=d,a=2;break;case 2:t[n++]=(15&r)<<4|(60&d)>>2,r=d,a=3;break;case 3:t[n++]=(3&r)<<6|d,a=0}}if(1===a)throw Error(i);return n-o},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},707:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},365:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function s(e,r,s){t[0]=e,r[s]=n[0],r[s+1]=n[1],r[s+2]=n[2],r[s+3]=n[3]}function o(e,r,s){t[0]=e,r[s]=n[3],r[s+1]=n[2],r[s+2]=n[1],r[s+3]=n[0]}function i(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?s:o,e.writeFloatBE=r?o:s,e.readFloatLE=r?i:a,e.readFloatBE=r?a:i}():function(){function t(e,t,n,r){var s=t<0?1:0;if(s&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((s<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((s<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((s<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,r)}}function i(e,t,n){var r=e(t,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)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=i.bind(null,s),e.readFloatBE=i.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function s(e,r,s){t[0]=e,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(e,r,s){t[0]=e,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(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?s:o,e.writeDoubleBE=r?o:s,e.readDoubleLE=r?i:a,e.readDoubleBE=r?a:i}():function(){function t(e,t,n,r,s,o){var i=r<0?1:0;if(i&&(r=-r),0===r)e(0,s,o+t),e(1/r>0?0:2147483648,s,o+n);else if(isNaN(r))e(0,s,o+t),e(2146959360,s,o+n);else if(r>17976931348623157e292)e(0,s,o+t),e((i<<31|2146435072)>>>0,s,o+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,s,o+t),e((i<<31|a/4294967296)>>>0,s,o+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=r*Math.pow(2,-c))>>>0,s,o+t),e((i<<31|c+1023<<20|1048576*a&1048575)>>>0,s,o+n)}}}function i(e,t,n,r,s){var o=e(r,s+t),i=e(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)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=i.bind(null,s,0,4),e.readDoubleBE=i.bind(null,o,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},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(e){}return null}module.exports=inquire},319:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,s=r>>>1,o=null,i=r;return function(n){if(n<1||n>s)return e(n);i+n>r&&(o=e(r),i=0);var a=t.call(o,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},742:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,s=null,o=[],i=0;t<n;)(r=e[t++])<128?o[i++]=r:r>191&&r<224?o[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[i++]=55296+(r>>10),o[i++]=56320+(1023&r)):o[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],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(e,t,n){for(var r,s,o=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(s=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&s),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-o}},106:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(433),s=n.n(r)()((function(e){return e[1]}));s.push([e.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;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:0;color:inherit;font:inherit;margin-left:var(--ck-spacing-standard);outline:none;padding:0;position:relative}.ck.ck-presence-list__list-item:last-child{margin-left:0;order:-1}.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{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.ck-presence-list__list-item{margin-left:calc(var(--ck-user-avatar-size)*-1 + 7px)}.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-height:80vh;max-width:var(--ck-presence-list-dropdown-list-max-width);min-width:var(--ck-presence-list-dropdown-list-min-width);overflow-x:hidden;overflow-y:auto}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item{align-items:center;background:none;border:0;color:inherit;display:flex;font:inherit;outline:none;padding:var(--ck-spacing-standard);position:relative}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:first-of-type .ck-presence-list__marker{border-top-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list-item:last-of-type .ck-presence-list__marker{border-bottom-left-radius:var(--ck-border-radius)}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck-user__full-name{color:var(--ck-color-base-text);margin-left:var(--ck-spacing-standard);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck.ck-presence-list__balloon .ck.ck-presence-list__dropdown-list .ck.ck-presence-list__marker{height:100%;left:0;margin:0;position:absolute;width:3px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}",""]);const o=s},535:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(433),s=n.n(r)()((function(e){return e[1]}));s.push([e.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 o=s},433:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(s[i]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&s[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},199:(e,t,n)=>{"use strict";e.exports=n(995)},995:(e,t,n)=>{"use strict";var r=t;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()},366:(e,t,n)=>{"use strict";e.exports=c;var r,s=n(737),o=s.LongBits,i=s.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var d,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return s.Buffer?function(e){return(c.create=function(e){return s.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};function p(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new 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 e=this.uint32();return e>>>1^-(1&e)},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=s.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=s.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=s.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=s.Long?"toLong":"toNumber";s.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},895:(e,t,n)=>{"use strict";e.exports=o;var r=n(366);(o.prototype=Object.create(r.prototype)).constructor=o;var s=n(737);function o(e){r.call(this,e)}o._configure=function(){s.Buffer&&(o.prototype._slice=s.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},156:e=>{"use strict";e.exports={}},178:(e,t,n)=>{"use strict";t.Service=n(418)},418:(e,t,n)=>{"use strict";e.exports=s;var r=n(737);function s(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(s.prototype=Object.create(r.EventEmitter.prototype)).constructor=s,s.prototype.rpcCall=function e(t,n,s,o,i){if(!o)throw TypeError("request must be specified");var a=this;if(!i)return r.asPromise(e,a,t,n,s,o);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,n){if(e)return a.emit("error",e,t),i(e);if(null!==n){if(!(n instanceof s))try{n=s[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),i(e)}return a.emit("data",n,t),i(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){i(e)}),0)}else setTimeout((function(){i(Error("already ended"))}),0)},s.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},130:(e,t,n)=>{"use strict";e.exports=s;var r=n(737);function s(e,t){this.lo=e>>>0,this.hi=t>>>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(e){if(0===e)return o;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new s(n,r)},s.from=function(e){if("number"==typeof e)return s.fromNumber(e);if(r.isString(e)){if(!r.Long)return s.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new s(e.low>>>0,e.high>>>0):o},s.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},s.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;s.fromHash=function(e){return e===i?o:new s((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},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 e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},s.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},s.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},737:function(e,t,n){"use strict";var r=t;function s(e,t,n){for(var r=Object.keys(t),s=0;s<r.length;++s)void 0!==e[r[s]]&&n||(e[r[s]]=t[r[s]]);return e}function o(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&s(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(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(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=s,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},6:(e,t,n)=>{"use strict";e.exports=l;var r,s=n(737),o=s.LongBits,i=s.base64,a=s.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function d(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return s.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=p(),l.alloc=function(e){return new s.Array(e)},s.Array!==Array&&(l.alloc=s.pool(l.alloc,s.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(m,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(s.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(s.float.writeDoubleLE,8,e)};var g=s.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(s.isString(e)){var n=l.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(d,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=p(),r._configure()}},623:(e,t,n)=>{"use strict";e.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(e,t,n){e.length<40?s.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,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(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},o.prototype.bytes=function(e){s.isString(e)&&(e=s._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=s.Buffer.byteLength(e);return this.uint32(t),t&&this._push(i,t,e),this},o._configure()},553:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function s(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,o,i=[];for(o in"string"!=typeof t&&(t="?"),e)if(n.call(e,o)){if((r=e[o])||null!=r&&!isNaN(r)||(r=""),o=s(o),r=s(r),null===o||null===r)continue;i.push(o+"="+r)}return i.length?t+i.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,s={};t=n.exec(e);){var o=r(t[1]),i=r(t[2]);null===o||null===i||o in s||(s[o]=i)}return s}},696:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},673:(e,t,n)=>{"use strict";var r,s=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],s=0;s<e.length;s++){var o=e[s],c=t.base?o[0]+t.base:o[0],d=n[c]||0,u="".concat(c," ").concat(d);n[c]=d+1;var l=a(u),p={css:o[1],media:o[2],sourceMap:o[3]};-1!==l?(i[l].references++,i[l].updater(p)):i.push({identifier:u,updater:y(p,t),references:1}),r.push(u)}return r}function d(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var s=n.nc;s&&(r.nonce=s)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,l=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function p(e,t,n,r){var s=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,s);else{var o=document.createTextNode(s),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(o,i[t]):e.appendChild(o)}}function h(e,t,n){var r=n.css,s=n.media,o=n.sourceMap;if(s?e.setAttribute("media",s):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,m=0;function y(e,t){var n,r,s;if(t.singleton){var o=m++;n=f||(f=d(t)),r=p.bind(null,n,o,!1),s=p.bind(null,n,o,!0)}else n=d(t),r=h.bind(null,n,t),s=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else s()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=s());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var s=a(n[r]);i[s].references--}for(var o=c(e,t),d=0;d<n.length;d++){var u=a(n[d]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=o}}}},835:(e,t,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(e){return(e||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function f(e){var t,r=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},s={},o=typeof(e=e||r);if("blob:"===e.protocol)s=new g(unescape(e.pathname),{});else if("string"===o)for(t in s=new g(e,{}),h)delete s[t];else if("object"===o){for(t in e)t in h||(s[t]=e[t]);void 0===s.slashes&&(s.slashes=a.test(e.href))}return s}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function y(e,t){e=(e=l(e)).replace(i,""),t=t||{};var n,r=d.exec(e),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(t.protocol)&&(n=r[4]),{protocol:s,slashes:o||m(s),slashesCount:c,rest:n}}function g(e,t,n){if(e=(e=l(e)).replace(i,""),!(this instanceof g))return new g(e,t,n);var o,a,c,d,h,b,O=p.slice(),w=typeof t,I=this,v=0;for("object"!==w&&"string"!==w&&(n=t,t=null),n&&"function"!=typeof n&&(n=s.parse),o=!(a=y(e||"",t=f(t))).protocol&&!a.slashes,I.slashes=a.slashes||o&&t.slashes,I.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(I.protocol)))&&(O[3]=[/(.*)/,"pathname"]);v<O.length;v++)"function"!=typeof(d=O[v])?(c=d[0],b=d[1],c!=c?I[b]=e:"string"==typeof c?~(h="@"===c?e.lastIndexOf(c):e.indexOf(c))&&("number"==typeof d[2]?(I[b]=e.slice(0,h),e=e.slice(h+d[2])):(I[b]=e.slice(h),e=e.slice(0,h))):(h=c.exec(e))&&(I[b]=h[1],e=e.slice(0,h.index)),I[b]=I[b]||o&&d[3]&&t[b]||"",d[4]&&(I[b]=I[b].toLowerCase())):e=d(e,I);n&&(I.query=n(I.query)),o&&t.slashes&&"/"!==I.pathname.charAt(0)&&(""!==I.pathname||""!==t.pathname)&&(I.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,s=n[r-1],o=!1,i=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),i++):i&&(0===r&&(o=!0),n.splice(r,1),i--);return o&&n.unshift(""),"."!==s&&".."!==s||n.push(""),n.join("/")}(I.pathname,t.pathname)),"/"!==I.pathname.charAt(0)&&m(I.protocol)&&(I.pathname="/"+I.pathname),r(I.port,I.protocol)||(I.host=I.hostname,I.port=""),I.username=I.password="",I.auth&&(~(h=I.auth.indexOf(":"))?(I.username=I.auth.slice(0,h),I.username=encodeURIComponent(decodeURIComponent(I.username)),I.password=I.auth.slice(h+1),I.password=encodeURIComponent(decodeURIComponent(I.password))):I.username=encodeURIComponent(decodeURIComponent(I.auth)),I.auth=I.password?I.username+":"+I.password:I.username),I.origin="file:"!==I.protocol&&m(I.protocol)&&I.host?I.protocol+"//"+I.host:"null",I.href=I.toString()}g.prototype={set:function(e,t,n){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||s.parse)(t)),o[e]=t;break;case"port":o[e]=t,r(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,c.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";o[e]=t.charAt(0)!==i?i+t:t}else o[e]=t;break;case"username":case"password":o[e]=encodeURIComponent(t);break;case"auth":var a=t.indexOf(":");~a?(o.username=t.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=t.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(t))}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(e){e&&"function"==typeof e||(e=s.stringify);var t,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,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},g.extractProtocol=y,g.location=f,g.trimLeft=l,g.qs=s,e.exports=g},211:(e,t,n)=>{e.exports=n(312)("./src/collaboration-core.js")},782:(e,t,n)=>{e.exports=n(237)("./src/core.js")},783:(e,t,n)=>{e.exports=n(237)("./src/engine.js")},311:(e,t,n)=>{e.exports=n(237)("./src/ui.js")},584:(e,t,n)=>{e.exports=n(237)("./src/utils.js")},312:e=>{"use strict";e.exports=CKEditor5.collaborationDll},237:e=>{"use strict";e.exports=CKEditor5.dll}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nc=void 0;var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{CloudServicesCommentsAdapter:()=>cc,CloudServicesRevisionHistoryAdapter:()=>Ec,CloudServicesTrackChangesAdapter:()=>mc,PresenceList:()=>bd,RealTimeCollaborationClient:()=>Wa,RealTimeCollaborativeComments:()=>Ic,RealTimeCollaborativeEditing:()=>rc,RealTimeCollaborativeRevisionHistory:()=>xc,RealTimeCollaborativeTrackChanges:()=>Pc});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Decoder:()=>fe,Encoder:()=>pe,PacketType:()=>le,protocol:()=>ue});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{AttributeOperation:()=>jr,Element:()=>Lr,InsertOperation:()=>Rr,MarkerOperation:()=>Dr,MergeOperation:()=>Nr,MoveOperation:()=>xr,Position:()=>Jr,Range:()=>qr,RenameOperation:()=>Vr,RootAttributeOperation:()=>Mr,RootOperation:()=>Br,SplitOperation:()=>Ur,default:()=>Er});var n=__webpack_require__(782),r=__webpack_require__(584),s=__webpack_require__(311),o=__webpack_require__(783);const i=Object.create(null);i.open="0",i.close="1",i.ping="2",i.pong="3",i.message="4",i.upgrade="5",i.noop="6";const a=Object.create(null);Object.keys(i).forEach((e=>{a[i[e]]=e}));const c={type:"error",data:"parser error"},d="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),u="function"==typeof ArrayBuffer,l=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)},p=({type:e,data:t},n,r)=>{return d&&t instanceof Blob?n?r(t):l(t,r):u&&(t instanceof ArrayBuffer||(s=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer))?n?r(t):l(new Blob([t]),r):r(i[e]+(t||""));var s},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)f[h.charCodeAt(e)]=e;const m="function"==typeof ArrayBuffer,y=(e,t)=>{if(m){const n=(e=>{let t,n,r,s,o,i=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);const d=new ArrayBuffer(i),u=new Uint8Array(d);for(t=0;t<a;t+=4)n=f[e.charCodeAt(t)],r=f[e.charCodeAt(t+1)],s=f[e.charCodeAt(t+2)],o=f[e.charCodeAt(t+3)],u[c++]=n<<2|r>>4,u[c++]=(15&r)<<4|s>>2,u[c++]=(3&s)<<6|63&o;return d})(e);return g(n,t)}return{base64:!0,data:e}},g=(e,t)=>"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e,b=(e,t)=>{if("string"!=typeof e)return{type:"message",data:g(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:y(e.substring(1),t)};return a[n]?e.length>1?{type:a[n],data:e.substring(1)}:{type:a[n]}:c},O=String.fromCharCode(30);function w(e){if(e)return function(e){for(var t in w.prototype)e[t]=w.prototype[t];return e}(e)}w.prototype.on=w.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},w.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},w.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},w.prototype.emitReserved=w.prototype.emit,w.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},w.prototype.hasListeners=function(e){return!!this.listeners(e).length};const I="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function v(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const S=I.setTimeout,A=I.clearTimeout;function P(e,t){t.useNativeTimers?(e.setTimeoutFn=S.bind(I),e.clearTimeoutFn=A.bind(I)):(e.setTimeoutFn=I.setTimeout.bind(I),e.clearTimeoutFn=I.clearTimeout.bind(I))}class T extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class _ extends w{constructor(e){super(),this.writable=!1,P(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new T(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=b(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}}const k="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),C=64,E={};let j,R=0,D=0;function N(e){let t="";do{t=k[e%C]+t,e=Math.floor(e/C)}while(e>0);return t}function x(){const e=N(+new Date);return e!==j?(R=0,j=e):e+"."+N(R++)}for(;D<C;D++)E[k[D]]=D;function V(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}let M=!1;try{M="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const B=M;function U(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||B))return new XMLHttpRequest}catch(e){}if(!t)try{return new(I[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function J(){}const q=null!=new U({xdomain:!1}).responseType;class L extends w{constructor(e,t){super(),P(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=v(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new U(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=L.requestsCount++,L.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=J,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete L.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(L.requestsCount=0,L.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",G);else if("function"==typeof addEventListener){addEventListener("onpagehide"in I?"pagehide":"unload",G,!1)}function G(){for(let e in L.requests)L.requests.hasOwnProperty(e)&&L.requests[e].abort()}const Y="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),F=I.WebSocket||I.MozWebSocket,H="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const z={websocket:class extends _{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=H?{}:v(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=H?new F(e,t,n):t?new F(e,t):new F(e)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;p(n,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}r&&Y((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=x()),this.supportsBinary||(e.b64=1);const r=V(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}check(){return!!F}},polling:class extends _{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=q&&!t}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(O),r=[];for(let e=0;e<n.length;e++){const s=b(n[e],t);if(r.push(s),"error"===s.type)break}return r})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach(((e,o)=>{p(e,!1,(e=>{r[o]=e,++s===n&&t(r.join(O))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=x()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);const r=V(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new L(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},K=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,W=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function $(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=K.exec(e||""),o={},i=14;for(;i--;)o[W[i]]=s[i]||"";return-1!=n&&-1!=r&&(o.source=t,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(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,o.path),o.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,o.query),o}class Q extends w{constructor(e,t={}){super(),this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=$(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=$(t.host).host),P(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new z[e](n)}open(){let e;if(this.opts.rememberUpgrade&&Q.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;Q.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Q.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function s(){n||(n=!0,d(),t.close(),t=null)}const o=e=>{const n=new Error("probe error: "+e);n.transport=t.name,s(),this.emitReserved("upgradeError",n)};function i(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&s()}const d=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",o),t.once("close",i),this.once("close",a),this.once("upgrading",c),t.open()}onOpen(){if(this.readyState="open",Q.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:e,data:t,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){Q.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"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",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}Q.protocol=4;Q.protocol;const X="function"==typeof ArrayBuffer,Z=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ee=Object.prototype.toString,te="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===ee.call(Blob),ne="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===ee.call(File);function re(e){return X&&(e instanceof ArrayBuffer||Z(e))||te&&e instanceof Blob||ne&&e instanceof File}function se(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(se(e[t]))return!0;return!1}if(re(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return se(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&se(e[t]))return!0;return!1}function oe(e){const t=[],n=e.data,r=e;return r.data=ie(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ie(e,t){if(!e)return e;if(re(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=ie(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ie(e[r],t));return n}return e}function ae(e,t){return e.data=ce(e.data,t),delete e.attachments,e}function ce(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ce(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ce(e[n],t));return e}const de=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ue=5;var le;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(le||(le={}));class pe{constructor(e){this.replacer=e}encode(e){return e.type!==le.EVENT&&e.type!==le.ACK||!se(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===le.EVENT?le.BINARY_EVENT:le.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==le.BINARY_EVENT&&e.type!==le.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=oe(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}function he(e){return"[object Object]"===Object.prototype.toString.call(e)}class fe extends w{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===le.BINARY_EVENT;n||t.type===le.BINARY_ACK?(t.type=n?le.EVENT:le.ACK,this.reconstructor=new me(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!re(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===le[n.type])throw new Error("unknown packet type "+n.type);if(n.type===le.BINARY_EVENT||n.type===le.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!fe.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case le.CONNECT:return he(t);case le.DISCONNECT:return void 0===t;case le.CONNECT_ERROR:return"string"==typeof t||he(t);case le.EVENT:case le.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===de.indexOf(t[0]));case le.ACK:case le.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class me{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=ae(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function ye(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const ge=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class be extends w{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[ye(e,"open",this.onopen.bind(this)),ye(e,"packet",this.onpacket.bind(this)),ye(e,"error",this.onerror.bind(this)),ye(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(ge.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:le.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const s=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(s),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,s)=>{t.push(((e,t)=>n?e?s(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:le.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case le.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case le.EVENT:case le.BINARY_EVENT:this.onevent(e);break;case le.ACK:case le.BINARY_ACK:this.onack(e);break;case le.DISCONNECT:this.ondisconnect();break;case le.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:le.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:le.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Oe(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Oe.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},Oe.prototype.reset=function(){this.attempts=0},Oe.prototype.setMin=function(e){this.ms=e},Oe.prototype.setMax=function(e){this.max=e},Oe.prototype.setJitter=function(e){this.jitter=e};class we extends w{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(n=t,t=void 0),(n=n||{}).path=n.path||"/socket.io",this.opts=n,P(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 Oe({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==n.timeout?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||e;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=!1!==n.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Q(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=ye(t,"open",(function(){n.onopen(),e&&e()})),s=ye(t,"error",(t=>{n.cleanup(),n._readyState="closed",this.emitReserved("error",t),e?e(t):n.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&r();const n=this.setTimeoutFn((()=>{r(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}return this.subs.push(r),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ye(e,"ping",this.onping.bind(this)),ye(e,"data",this.ondata.bind(this)),ye(e,"error",this.onerror.bind(this)),ye(e,"close",this.onclose.bind(this)),ye(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){Y((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new be(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),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(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ie={};function ve(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=$(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=Ie[s]&&o in Ie[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new we(r,t):(Ie[s]||(Ie[s]=new we(r,t)),a=Ie[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(ve,{Manager:we,Socket:be,io:ve,connect:ve});var Se=__webpack_require__(835);class Ae{constructor(...e){}}class Pe extends Ae{constructor(...e){super()}static fromJSON(e){throw new TypeError("Must be implemented in a child class!")}}Pe.TYPE="1000";class Te extends Pe{constructor(e,t,n){super(),this.type=e,this.socketId=t,this.data=n}toJSON(){return{type:this.type,socketId:this.socketId,data:this.data}}static fromJSON(e){return new Te(e.type,e.socketId,e.data)}}Te.DESCRIPTOR_NAME="ChannelMessage",Te.DESCRIPTOR={fields:{type:{type:"uint32",id:1},socketId:{type:"string",id:2},data:{type:"bytes",id:3}}};var _e=__webpack_require__(199);const ke=_e.Reader,Ce=_e.Writer,Ee=_e.util,je=_e.roots.default||(_e.roots.default={}),Re=(je.OperationMetadataDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.userId="",e.prototype.type="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(18).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.OperationMetadataDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.userId=e.string();break;case 2:r.type=e.string();break;case 3:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!Ee.isString(e.userId)?"userId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof je.OperationMetadataDescriptor)return e;let t=new je.OperationMetadataDescriptor;return null!=e.userId&&(t.userId=String(e.userId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.userId="",n.type="",n.createdAt=""),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OperationMetadataDescriptor"},e})(),je.CollaborativeEditingConnectMessage=(()=>{function e(e){if(this.buffers=[],this.types=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.bundleVersion="",e.prototype.buffers=Ee.emptyArray,e.prototype.types=Ee.emptyArray,e.prototype.lastOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(26).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(34).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(42).string(e.lastOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.bundleVersion=e.string();break;case 3:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 4:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 5:r.lastOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id))return"id: string expected";if(null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!Ee.isString(e.bundleVersion))return"bundleVersion: string expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ee.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ee.isInteger(e.types[t]))return"types: integer[] expected"}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ee.isString(e.lastOperationId)?"lastOperationId: string expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingConnectMessage)return e;let t=new je.CollaborativeEditingConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectMessage.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ee.base64.decode(e.buffers[n],t.buffers[n]=Ee.newBuffer(Ee.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectMessage.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[]),t.defaults&&(n.id="",n.bundleVersion="",n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ee.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectMessage"},e})(),je.CollaborativeEditingReconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.bundleVersion="",e.prototype.lastKnowVersion=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(18).string(e.bundleVersion),null!=e.lastKnowVersion&&Object.hasOwnProperty.call(e,"lastKnowVersion")&&t.uint32(24).uint32(e.lastKnowVersion),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingReconnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.bundleVersion=e.string();break;case 3:r.lastKnowVersion=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!Ee.isString(e.bundleVersion)?"bundleVersion: string expected":null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&!Ee.isInteger(e.lastKnowVersion)?"lastKnowVersion: integer expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingReconnectMessage)return e;let t=new je.CollaborativeEditingReconnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),null!=e.lastKnowVersion&&(t.lastKnowVersion=e.lastKnowVersion>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.bundleVersion="",n.lastKnowVersion=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),null!=e.lastKnowVersion&&e.hasOwnProperty("lastKnowVersion")&&(n.lastKnowVersion=e.lastKnowVersion),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingReconnectMessage"},e})(),je.CollaborativeEditingUpdateMessage=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.baseVersion=0,e.prototype.buffers=Ee.emptyArray,e.prototype.types=Ee.emptyArray,e.prototype.metadata=Ee.emptyArray,e.prototype.lastOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.baseVersion&&Object.hasOwnProperty.call(e,"baseVersion")&&t.uint32(16).uint32(e.baseVersion),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(26).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(34).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)je.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(50).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(58).string(e.lastOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingUpdateMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.baseVersion=e.uint32();break;case 3:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 4:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 6:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(je.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 7:r.lastOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id))return"id: string expected";if(null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&!Ee.isInteger(e.baseVersion))return"baseVersion: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ee.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ee.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=je.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ee.isString(e.lastOperationId)?"lastOperationId: string expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingUpdateMessage)return e;let t=new je.CollaborativeEditingUpdateMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.baseVersion&&(t.baseVersion=e.baseVersion>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingUpdateMessage.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ee.base64.decode(e.buffers[n],t.buffers[n]=Ee.newBuffer(Ee.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingUpdateMessage.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingUpdateMessage.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingUpdateMessage.metadata: object expected");t.metadata[n]=je.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.id="",n.baseVersion=0,n.lastOperationId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.baseVersion&&e.hasOwnProperty("baseVersion")&&(n.baseVersion=e.baseVersion),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ee.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=je.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingUpdateMessage"},e})(),je.GetDocumentDetailsMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.environmentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.environmentId&&Object.hasOwnProperty.call(e,"environmentId")&&t.uint32(18).string(e.environmentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetDocumentDetailsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.environmentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.environmentId&&e.hasOwnProperty("environmentId")&&!Ee.isString(e.environmentId)?"environmentId: string expected":null},e.fromObject=function(e){if(e instanceof je.GetDocumentDetailsMessage)return e;let t=new je.GetDocumentDetailsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.environmentId&&(t.environmentId=String(e.environmentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.environmentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.environmentId&&e.hasOwnProperty("environmentId")&&(n.environmentId=e.environmentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsMessage"},e})(),je.CollaborativeEditingConnectResponse=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.offset=0,e.prototype.version=0,e.prototype.buffers=Ee.emptyArray,e.prototype.types=Ee.emptyArray,e.prototype.metadata=Ee.emptyArray,e.prototype.initData="",e.prototype.isInitialized=!1,e.prototype.sessionId="",e.prototype.lastOperationId="",e.prototype.sessionCreatedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.offset&&Object.hasOwnProperty.call(e,"offset")&&t.uint32(16).uint32(e.offset),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(24).uint32(e.version),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(34).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(42).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)je.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(58).fork()).ldelim();return null!=e.initData&&Object.hasOwnProperty.call(e,"initData")&&t.uint32(66).string(e.initData),null!=e.isInitialized&&Object.hasOwnProperty.call(e,"isInitialized")&&t.uint32(72).bool(e.isInitialized),null!=e.sessionId&&Object.hasOwnProperty.call(e,"sessionId")&&t.uint32(82).string(e.sessionId),null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(90).string(e.lastOperationId),null!=e.sessionCreatedAt&&Object.hasOwnProperty.call(e,"sessionCreatedAt")&&t.uint32(98).string(e.sessionCreatedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.offset=e.uint32();break;case 3:r.version=e.uint32();break;case 4:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 5:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 7:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(je.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 8:r.initData=e.string();break;case 9:r.isInitialized=e.bool();break;case 10:r.sessionId=e.string();break;case 11:r.lastOperationId=e.string();break;case 12:r.sessionCreatedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.offset&&e.hasOwnProperty("offset")&&!Ee.isInteger(e.offset))return"offset: integer expected";if(null!=e.version&&e.hasOwnProperty("version")&&!Ee.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ee.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ee.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=je.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.initData&&e.hasOwnProperty("initData")&&!Ee.isString(e.initData)?"initData: string expected":null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&"boolean"!=typeof e.isInitialized?"isInitialized: boolean expected":null!=e.sessionId&&e.hasOwnProperty("sessionId")&&!Ee.isString(e.sessionId)?"sessionId: string expected":null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ee.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&!Ee.isString(e.sessionCreatedAt)?"sessionCreatedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingConnectResponse)return e;let t=new je.CollaborativeEditingConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.offset&&(t.offset=e.offset>>>0),null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingConnectResponse.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ee.base64.decode(e.buffers[n],t.buffers[n]=Ee.newBuffer(Ee.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingConnectResponse.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingConnectResponse.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingConnectResponse.metadata: object expected");t.metadata[n]=je.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.initData&&(t.initData=String(e.initData)),null!=e.isInitialized&&(t.isInitialized=Boolean(e.isInitialized)),null!=e.sessionId&&(t.sessionId=String(e.sessionId)),null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.sessionCreatedAt&&(t.sessionCreatedAt=String(e.sessionCreatedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.channel="",n.offset=0,n.version=0,n.initData="",n.isInitialized=!1,n.sessionId="",n.lastOperationId="",n.sessionCreatedAt=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.offset&&e.hasOwnProperty("offset")&&(n.offset=e.offset),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ee.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=je.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.initData&&e.hasOwnProperty("initData")&&(n.initData=e.initData),null!=e.isInitialized&&e.hasOwnProperty("isInitialized")&&(n.isInitialized=e.isInitialized),null!=e.sessionId&&e.hasOwnProperty("sessionId")&&(n.sessionId=e.sessionId),null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.sessionCreatedAt&&e.hasOwnProperty("sessionCreatedAt")&&(n.sessionCreatedAt=e.sessionCreatedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingConnectResponse"},e})(),je.CollaborativeEditingResponse=(()=>{function e(e){if(this.buffers=[],this.types=[],this.metadata=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.version=0,e.prototype.buffers=Ee.emptyArray,e.prototype.types=Ee.emptyArray,e.prototype.metadata=Ee.emptyArray,e.prototype.lastOperationId="",e.prototype.lastOperationAcceptedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(8).uint32(e.version),null!=e.buffers&&e.buffers.length)for(let n=0;n<e.buffers.length;++n)t.uint32(18).bytes(e.buffers[n]);if(null!=e.types&&e.types.length){t.uint32(26).fork();for(let n=0;n<e.types.length;++n)t.uint32(e.types[n]);t.ldelim()}if(null!=e.metadata&&e.metadata.length)for(let n=0;n<e.metadata.length;++n)je.OperationMetadataDescriptor.encode(e.metadata[n],t.uint32(42).fork()).ldelim();return null!=e.lastOperationId&&Object.hasOwnProperty.call(e,"lastOperationId")&&t.uint32(50).string(e.lastOperationId),null!=e.lastOperationAcceptedAt&&Object.hasOwnProperty.call(e,"lastOperationAcceptedAt")&&t.uint32(58).string(e.lastOperationAcceptedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CollaborativeEditingResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.version=e.uint32();break;case 2:r.buffers&&r.buffers.length||(r.buffers=[]),r.buffers.push(e.bytes());break;case 3:if(r.types&&r.types.length||(r.types=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.types.push(e.uint32())}else r.types.push(e.uint32());break;case 5:r.metadata&&r.metadata.length||(r.metadata=[]),r.metadata.push(je.OperationMetadataDescriptor.decode(e,e.uint32()));break;case 6:r.lastOperationId=e.string();break;case 7:r.lastOperationAcceptedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.version&&e.hasOwnProperty("version")&&!Ee.isInteger(e.version))return"version: integer expected";if(null!=e.buffers&&e.hasOwnProperty("buffers")){if(!Array.isArray(e.buffers))return"buffers: array expected";for(let t=0;t<e.buffers.length;++t)if(!(e.buffers[t]&&"number"==typeof e.buffers[t].length||Ee.isString(e.buffers[t])))return"buffers: buffer[] expected"}if(null!=e.types&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)if(!Ee.isInteger(e.types[t]))return"types: integer[] expected"}if(null!=e.metadata&&e.hasOwnProperty("metadata")){if(!Array.isArray(e.metadata))return"metadata: array expected";for(let t=0;t<e.metadata.length;++t){let n=je.OperationMetadataDescriptor.verify(e.metadata[t]);if(n)return"metadata."+n}}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&!Ee.isString(e.lastOperationId)?"lastOperationId: string expected":null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&!Ee.isString(e.lastOperationAcceptedAt)?"lastOperationAcceptedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CollaborativeEditingResponse)return e;let t=new je.CollaborativeEditingResponse;if(null!=e.version&&(t.version=e.version>>>0),e.buffers){if(!Array.isArray(e.buffers))throw TypeError(".CollaborativeEditingResponse.buffers: array expected");t.buffers=[];for(let n=0;n<e.buffers.length;++n)"string"==typeof e.buffers[n]?Ee.base64.decode(e.buffers[n],t.buffers[n]=Ee.newBuffer(Ee.base64.length(e.buffers[n])),0):e.buffers[n].length>=0&&(t.buffers[n]=e.buffers[n])}if(e.types){if(!Array.isArray(e.types))throw TypeError(".CollaborativeEditingResponse.types: array expected");t.types=[];for(let n=0;n<e.types.length;++n)t.types[n]=e.types[n]>>>0}if(e.metadata){if(!Array.isArray(e.metadata))throw TypeError(".CollaborativeEditingResponse.metadata: array expected");t.metadata=[];for(let n=0;n<e.metadata.length;++n){if("object"!=typeof e.metadata[n])throw TypeError(".CollaborativeEditingResponse.metadata: object expected");t.metadata[n]=je.OperationMetadataDescriptor.fromObject(e.metadata[n])}}return null!=e.lastOperationId&&(t.lastOperationId=String(e.lastOperationId)),null!=e.lastOperationAcceptedAt&&(t.lastOperationAcceptedAt=String(e.lastOperationAcceptedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.buffers=[],n.types=[],n.metadata=[]),t.defaults&&(n.version=0,n.lastOperationId="",n.lastOperationAcceptedAt=""),null!=e.version&&e.hasOwnProperty("version")&&(n.version=e.version),e.buffers&&e.buffers.length){n.buffers=[];for(let r=0;r<e.buffers.length;++r)n.buffers[r]=t.bytes===String?Ee.base64.encode(e.buffers[r],0,e.buffers[r].length):t.bytes===Array?Array.prototype.slice.call(e.buffers[r]):e.buffers[r]}if(e.types&&e.types.length){n.types=[];for(let t=0;t<e.types.length;++t)n.types[t]=e.types[t]}if(e.metadata&&e.metadata.length){n.metadata=[];for(let r=0;r<e.metadata.length;++r)n.metadata[r]=je.OperationMetadataDescriptor.toObject(e.metadata[r],t)}return null!=e.lastOperationId&&e.hasOwnProperty("lastOperationId")&&(n.lastOperationId=e.lastOperationId),null!=e.lastOperationAcceptedAt&&e.hasOwnProperty("lastOperationAcceptedAt")&&(n.lastOperationAcceptedAt=e.lastOperationAcceptedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CollaborativeEditingResponse"},e})(),je.GetDocumentDetailsResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.lastDocumentSessionId="",e.prototype.lastDocumentSessionOperationId="",e.prototype.currentDocumentSessionId="",e.prototype.currentDocumentSessionVersion=0,e.prototype.currentDocumentSessionOperationId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.lastDocumentSessionId&&Object.hasOwnProperty.call(e,"lastDocumentSessionId")&&t.uint32(10).string(e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"lastDocumentSessionOperationId")&&t.uint32(18).string(e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&Object.hasOwnProperty.call(e,"currentDocumentSessionId")&&t.uint32(26).string(e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&Object.hasOwnProperty.call(e,"currentDocumentSessionVersion")&&t.uint32(32).uint32(e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&Object.hasOwnProperty.call(e,"currentDocumentSessionOperationId")&&t.uint32(42).string(e.currentDocumentSessionOperationId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetDocumentDetailsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.lastDocumentSessionId=e.string();break;case 2:r.lastDocumentSessionOperationId=e.string();break;case 3:r.currentDocumentSessionId=e.string();break;case 4:r.currentDocumentSessionVersion=e.uint32();break;case 5:r.currentDocumentSessionOperationId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&!Ee.isString(e.lastDocumentSessionId)?"lastDocumentSessionId: string expected":null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&!Ee.isString(e.lastDocumentSessionOperationId)?"lastDocumentSessionOperationId: string expected":null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&!Ee.isString(e.currentDocumentSessionId)?"currentDocumentSessionId: string expected":null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&!Ee.isInteger(e.currentDocumentSessionVersion)?"currentDocumentSessionVersion: integer expected":null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&!Ee.isString(e.currentDocumentSessionOperationId)?"currentDocumentSessionOperationId: string expected":null},e.fromObject=function(e){if(e instanceof je.GetDocumentDetailsResponse)return e;let t=new je.GetDocumentDetailsResponse;return null!=e.lastDocumentSessionId&&(t.lastDocumentSessionId=String(e.lastDocumentSessionId)),null!=e.lastDocumentSessionOperationId&&(t.lastDocumentSessionOperationId=String(e.lastDocumentSessionOperationId)),null!=e.currentDocumentSessionId&&(t.currentDocumentSessionId=String(e.currentDocumentSessionId)),null!=e.currentDocumentSessionVersion&&(t.currentDocumentSessionVersion=e.currentDocumentSessionVersion>>>0),null!=e.currentDocumentSessionOperationId&&(t.currentDocumentSessionOperationId=String(e.currentDocumentSessionOperationId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.lastDocumentSessionId="",n.lastDocumentSessionOperationId="",n.currentDocumentSessionId="",n.currentDocumentSessionVersion=0,n.currentDocumentSessionOperationId=""),null!=e.lastDocumentSessionId&&e.hasOwnProperty("lastDocumentSessionId")&&(n.lastDocumentSessionId=e.lastDocumentSessionId),null!=e.lastDocumentSessionOperationId&&e.hasOwnProperty("lastDocumentSessionOperationId")&&(n.lastDocumentSessionOperationId=e.lastDocumentSessionOperationId),null!=e.currentDocumentSessionId&&e.hasOwnProperty("currentDocumentSessionId")&&(n.currentDocumentSessionId=e.currentDocumentSessionId),null!=e.currentDocumentSessionVersion&&e.hasOwnProperty("currentDocumentSessionVersion")&&(n.currentDocumentSessionVersion=e.currentDocumentSessionVersion),null!=e.currentDocumentSessionOperationId&&e.hasOwnProperty("currentDocumentSessionOperationId")&&(n.currentDocumentSessionOperationId=e.currentDocumentSessionOperationId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetDocumentDetailsResponse"},e})(),je.CommentDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentId="",e.prototype.commentThreadId="",e.prototype.userId="",e.prototype.content="",e.prototype.documentId="",e.prototype.createdAt="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(26).string(e.userId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(34).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(42).string(e.documentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentId=e.string();break;case 2:r.commentThreadId=e.string();break;case 3:r.userId=e.string();break;case 4:r.content=e.string();break;case 5:r.documentId=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId)?"commentId: string expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!Ee.isString(e.userId)?"userId: string expected":null!=e.content&&e.hasOwnProperty("content")&&!Ee.isString(e.content)?"content: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentDescriptor)return e;let t=new je.CommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentId="",n.commentThreadId="",n.userId="",n.content="",n.documentId="",n.createdAt="",n.attributes=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentDescriptor"},e})(),je.CommentsThreadDescriptor=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.comments=Ee.emptyArray,e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.context="",e.prototype.createdAt="",e.prototype.deletedAt="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)je.CommentDescriptor.encode(e.comments[n],t.uint32(18).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(42).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(58).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(74).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsThreadDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(je.CommentDescriptor.decode(e,e.uint32()));break;case 3:r.resolvedAt=e.string();break;case 4:r.resolvedBy=e.string();break;case 5:r.context=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.deletedAt=e.string();break;case 8:r.attributes=e.string();break;case 9:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=je.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!Ee.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!Ee.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!Ee.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsThreadDescriptor)return e;let t=new je.CommentsThreadDescriptor;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsThreadDescriptor.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsThreadDescriptor.comments: object expected");t.comments[n]=je.CommentDescriptor.fromObject(e.comments[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=je.CommentDescriptor.toObject(e.comments[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsThreadDescriptor"},e})(),je.CommentThreadAddedCommentDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentId="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(10).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentThreadAddedCommentDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentId=e.string();break;case 2:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentThreadAddedCommentDescriptor)return e;let t=new je.CommentThreadAddedCommentDescriptor;return null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentId="",n.createdAt=""),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentThreadAddedCommentDescriptor"},e})(),je.CommentsV2AddCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.content="",e.prototype.documentId="",e.prototype.commentId="",e.prototype.createdAt="",e.prototype.userId="",e.prototype.attributes="",e.prototype.commentThread=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(34).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(42).string(e.createdAt),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(50).string(e.userId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&je.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(66).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2AddCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.content=e.string();break;case 3:r.documentId=e.string();break;case 4:r.commentId=e.string();break;case 5:r.createdAt=e.string();break;case 6:r.userId=e.string();break;case 7:r.attributes=e.string();break;case 8:r.commentThread=je.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!Ee.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId))return"documentId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId))return"commentId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt))return"createdAt: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!Ee.isString(e.userId))return"userId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes))return"attributes: string expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){let t=je.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2AddCommentMessage)return e;let t=new je.CommentsV2AddCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2AddCommentMessage.commentThread: object expected");t.commentThread=je.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.content="",n.documentId="",n.commentId="",n.createdAt="",n.userId="",n.attributes="",n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=je.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentMessage"},e})(),je.CommentsV2AddCommentThreadMessage=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.commentThreadId="",e.prototype.context="",e.prototype.createdAt="",e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.attributes="",e.prototype.deletedAt="",e.prototype.comments=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(18).string(e.commentThreadId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(42).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(50).string(e.resolvedBy),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)je.CommentDescriptor.encode(e.comments[n],t.uint32(74).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2AddCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.commentThreadId=e.string();break;case 3:r.context=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.resolvedAt=e.string();break;case 6:r.resolvedBy=e.string();break;case 7:r.attributes=e.string();break;case 8:r.deletedAt=e.string();break;case 9:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(je.CommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId))return"documentId: string expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.context&&e.hasOwnProperty("context")&&!Ee.isString(e.context))return"context: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt))return"createdAt: string expected";if(null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt))return"resolvedAt: string expected";if(null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy))return"resolvedBy: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes))return"attributes: string expected";if(null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!Ee.isString(e.deletedAt))return"deletedAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=je.CommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2AddCommentThreadMessage)return e;let t=new je.CommentsV2AddCommentThreadMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadMessage.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadMessage.comments: object expected");t.comments[n]=je.CommentDescriptor.fromObject(e.comments[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.documentId="",n.commentThreadId="",n.context="",n.createdAt="",n.resolvedAt="",n.resolvedBy="",n.attributes="",n.deletedAt=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=je.CommentDescriptor.toObject(e.comments[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadMessage"},e})(),je.CommentsV2ReopenCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ReopenCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2ReopenCommentThreadMessage)return e;let t=new je.CommentsV2ReopenCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ReopenCommentThreadMessage"},e})(),je.CommentsV2ResolveCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.resolvedBy="",e.prototype.resolvedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(26).string(e.resolvedBy),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ResolveCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.resolvedBy=e.string();break;case 4:r.resolvedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt)?"resolvedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2ResolveCommentThreadMessage)return e;let t=new je.CommentsV2ResolveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedBy="",n.resolvedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadMessage"},e})(),je.CommentsV2UpdateCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.context="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(26).string(e.context),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(34).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(42).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2UpdateCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.context=e.string();break;case 4:r.attributes=e.string();break;case 5:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.context&&e.hasOwnProperty("context")&&!Ee.isString(e.context)?"context: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!Ee.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2UpdateCommentThreadMessage)return e;let t=new je.CommentsV2UpdateCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.context&&(t.context=String(e.context)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.context="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentThreadMessage"},e})(),je.CommentsV2ConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2ConnectMessage)return e;let t=new je.CommentsV2ConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectMessage"},e})(),je.CommentsV2GetCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2GetCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2GetCommentThreadMessage)return e;let t=new je.CommentsV2GetCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadMessage"},e})(),je.CommentsV2GetDocumentThreadsMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2GetDocumentThreadsMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2GetDocumentThreadsMessage)return e;let t=new je.CommentsV2GetDocumentThreadsMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsMessage"},e})(),je.CommentsV2RemoveCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(26).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2RemoveCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId)?"commentId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2RemoveCommentMessage)return e;let t=new je.CommentsV2RemoveCommentMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentMessage"},e})(),je.CommentsV2RemoveCommentThreadMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2RemoveCommentThreadMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2RemoveCommentThreadMessage)return e;let t=new je.CommentsV2RemoveCommentThreadMessage;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2RemoveCommentThreadMessage"},e})(),je.CommentsV2UpdateCommentMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.content="",e.prototype.documentId="",e.prototype.attributes="",e.prototype.isAttributesUpdated=!1,e.prototype.commentThread=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(26).string(e.content),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(34).string(e.documentId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(42).string(e.attributes),null!=e.isAttributesUpdated&&Object.hasOwnProperty.call(e,"isAttributesUpdated")&&t.uint32(48).bool(e.isAttributesUpdated),null!=e.commentThread&&Object.hasOwnProperty.call(e,"commentThread")&&je.CommentsThreadDescriptor.encode(e.commentThread,t.uint32(58).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2UpdateCommentMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.content=e.string();break;case 4:r.documentId=e.string();break;case 5:r.attributes=e.string();break;case 6:r.isAttributesUpdated=e.bool();break;case 7:r.commentThread=je.CommentsThreadDescriptor.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId))return"commentId: string expected";if(null!=e.content&&e.hasOwnProperty("content")&&!Ee.isString(e.content))return"content: string expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId))return"documentId: string expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes))return"attributes: string expected";if(null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&"boolean"!=typeof e.isAttributesUpdated)return"isAttributesUpdated: boolean expected";if(null!=e.commentThread&&e.hasOwnProperty("commentThread")){let t=je.CommentsThreadDescriptor.verify(e.commentThread);if(t)return"commentThread."+t}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2UpdateCommentMessage)return e;let t=new je.CommentsV2UpdateCommentMessage;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.content&&(t.content=String(e.content)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.isAttributesUpdated&&(t.isAttributesUpdated=Boolean(e.isAttributesUpdated)),null!=e.commentThread){if("object"!=typeof e.commentThread)throw TypeError(".CommentsV2UpdateCommentMessage.commentThread: object expected");t.commentThread=je.CommentsThreadDescriptor.fromObject(e.commentThread)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.content="",n.documentId="",n.attributes="",n.isAttributesUpdated=!1,n.commentThread=null),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.content&&e.hasOwnProperty("content")&&(n.content=e.content),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.isAttributesUpdated&&e.hasOwnProperty("isAttributesUpdated")&&(n.isAttributesUpdated=e.isAttributesUpdated),null!=e.commentThread&&e.hasOwnProperty("commentThread")&&(n.commentThread=je.CommentsThreadDescriptor.toObject(e.commentThread,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2UpdateCommentMessage"},e})(),je.CommentsV2AddCommentResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.commentId="",e.prototype.createdAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.commentId&&Object.hasOwnProperty.call(e,"commentId")&&t.uint32(18).string(e.commentId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(26).string(e.createdAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2AddCommentResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.commentId=e.string();break;case 3:r.createdAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.commentId&&e.hasOwnProperty("commentId")&&!Ee.isString(e.commentId)?"commentId: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2AddCommentResponse)return e;let t=new je.CommentsV2AddCommentResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.commentId&&(t.commentId=String(e.commentId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.commentId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.commentId&&e.hasOwnProperty("commentId")&&(n.commentId=e.commentId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentResponse"},e})(),je.CommentsV2AddCommentThreadResponse=(()=>{function e(e){if(this.comments=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.createdAt="",e.prototype.comments=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(18).string(e.createdAt),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)je.CommentThreadAddedCommentDescriptor.encode(e.comments[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2AddCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.createdAt=e.string();break;case 3:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(je.CommentThreadAddedCommentDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt))return"createdAt: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t){let n=je.CommentThreadAddedCommentDescriptor.verify(e.comments[t]);if(n)return"comments."+n}}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2AddCommentThreadResponse)return e;let t=new je.CommentsV2AddCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2AddCommentThreadResponse.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n){if("object"!=typeof e.comments[n])throw TypeError(".CommentsV2AddCommentThreadResponse.comments: object expected");t.comments[n]=je.CommentThreadAddedCommentDescriptor.fromObject(e.comments[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[]),t.defaults&&(n.commentThreadId="",n.createdAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),e.comments&&e.comments.length){n.comments=[];for(let r=0;r<e.comments.length;++r)n.comments[r]=je.CommentThreadAddedCommentDescriptor.toObject(e.comments[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2AddCommentThreadResponse"},e})(),je.CommentsV2ResolveCommentThreadResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.documentId="",e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(26).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(34).string(e.resolvedBy),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ResolveCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.documentId=e.string();break;case 3:r.resolvedAt=e.string();break;case 4:r.resolvedBy=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId)?"commentThreadId: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy)?"resolvedBy: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2ResolveCommentThreadResponse)return e;let t=new je.CommentsV2ResolveCommentThreadResponse;return null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.commentThreadId="",n.documentId="",n.resolvedAt="",n.resolvedBy=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ResolveCommentThreadResponse"},e})(),je.CommentsV2ConnectResponse=(()=>{function e(e){if(this.threads=[],this.threadsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.threads=Ee.emptyArray,e.prototype.threadsV2=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.threads&&e.threads.length)for(let n=0;n<e.threads.length;++n)t.uint32(18).string(e.threads[n]);if(null!=e.threadsV2&&e.threadsV2.length)for(let n=0;n<e.threadsV2.length;++n)je.CommentsThreadDescriptor.encode(e.threadsV2[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2ConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.threads&&r.threads.length||(r.threads=[]),r.threads.push(e.string());break;case 3:r.threadsV2&&r.threadsV2.length||(r.threadsV2=[]),r.threadsV2.push(je.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(let t=0;t<e.threads.length;++t)if(!Ee.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(let t=0;t<e.threadsV2.length;++t){let n=je.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2ConnectResponse)return e;let t=new je.CommentsV2ConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2ConnectResponse.threads: array expected");t.threads=[];for(let n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2ConnectResponse.threadsV2: array expected");t.threadsV2=[];for(let n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2ConnectResponse.threadsV2: object expected");t.threadsV2[n]=je.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.threads&&e.threads.length){n.threads=[];for(let t=0;t<e.threads.length;++t)n.threads[t]=e.threads[t]}if(e.threadsV2&&e.threadsV2.length){n.threadsV2=[];for(let r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=je.CommentsThreadDescriptor.toObject(e.threadsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2ConnectResponse"},e})(),je.CommentsV2GetCommentThreadResponse=(()=>{function e(e){if(this.comments=[],this.commentsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.commentThreadId="",e.prototype.comments=Ee.emptyArray,e.prototype.commentsV2=Ee.emptyArray,e.prototype.resolvedAt="",e.prototype.resolvedBy="",e.prototype.context="",e.prototype.createdAt="",e.prototype.deletedAt="",e.prototype.attributes="",e.prototype.unlinkedAt="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.commentThreadId&&Object.hasOwnProperty.call(e,"commentThreadId")&&t.uint32(10).string(e.commentThreadId),null!=e.comments&&e.comments.length)for(let n=0;n<e.comments.length;++n)t.uint32(18).string(e.comments[n]);if(null!=e.commentsV2&&e.commentsV2.length)for(let n=0;n<e.commentsV2.length;++n)je.CommentDescriptor.encode(e.commentsV2[n],t.uint32(26).fork()).ldelim();return null!=e.resolvedAt&&Object.hasOwnProperty.call(e,"resolvedAt")&&t.uint32(34).string(e.resolvedAt),null!=e.resolvedBy&&Object.hasOwnProperty.call(e,"resolvedBy")&&t.uint32(42).string(e.resolvedBy),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(50).string(e.context),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(58).string(e.createdAt),null!=e.deletedAt&&Object.hasOwnProperty.call(e,"deletedAt")&&t.uint32(66).string(e.deletedAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(74).string(e.attributes),null!=e.unlinkedAt&&Object.hasOwnProperty.call(e,"unlinkedAt")&&t.uint32(82).string(e.unlinkedAt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2GetCommentThreadResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.commentThreadId=e.string();break;case 2:r.comments&&r.comments.length||(r.comments=[]),r.comments.push(e.string());break;case 3:r.commentsV2&&r.commentsV2.length||(r.commentsV2=[]),r.commentsV2.push(je.CommentDescriptor.decode(e,e.uint32()));break;case 4:r.resolvedAt=e.string();break;case 5:r.resolvedBy=e.string();break;case 6:r.context=e.string();break;case 7:r.createdAt=e.string();break;case 8:r.deletedAt=e.string();break;case 9:r.attributes=e.string();break;case 10:r.unlinkedAt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&!Ee.isString(e.commentThreadId))return"commentThreadId: string expected";if(null!=e.comments&&e.hasOwnProperty("comments")){if(!Array.isArray(e.comments))return"comments: array expected";for(let t=0;t<e.comments.length;++t)if(!Ee.isString(e.comments[t]))return"comments: string[] expected"}if(null!=e.commentsV2&&e.hasOwnProperty("commentsV2")){if(!Array.isArray(e.commentsV2))return"commentsV2: array expected";for(let t=0;t<e.commentsV2.length;++t){let n=je.CommentDescriptor.verify(e.commentsV2[t]);if(n)return"commentsV2."+n}}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&!Ee.isString(e.resolvedAt)?"resolvedAt: string expected":null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&!Ee.isString(e.resolvedBy)?"resolvedBy: string expected":null!=e.context&&e.hasOwnProperty("context")&&!Ee.isString(e.context)?"context: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&!Ee.isString(e.deletedAt)?"deletedAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&!Ee.isString(e.unlinkedAt)?"unlinkedAt: string expected":null},e.fromObject=function(e){if(e instanceof je.CommentsV2GetCommentThreadResponse)return e;let t=new je.CommentsV2GetCommentThreadResponse;if(null!=e.commentThreadId&&(t.commentThreadId=String(e.commentThreadId)),e.comments){if(!Array.isArray(e.comments))throw TypeError(".CommentsV2GetCommentThreadResponse.comments: array expected");t.comments=[];for(let n=0;n<e.comments.length;++n)t.comments[n]=String(e.comments[n])}if(e.commentsV2){if(!Array.isArray(e.commentsV2))throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: array expected");t.commentsV2=[];for(let n=0;n<e.commentsV2.length;++n){if("object"!=typeof e.commentsV2[n])throw TypeError(".CommentsV2GetCommentThreadResponse.commentsV2: object expected");t.commentsV2[n]=je.CommentDescriptor.fromObject(e.commentsV2[n])}}return null!=e.resolvedAt&&(t.resolvedAt=String(e.resolvedAt)),null!=e.resolvedBy&&(t.resolvedBy=String(e.resolvedBy)),null!=e.context&&(t.context=String(e.context)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.deletedAt&&(t.deletedAt=String(e.deletedAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.unlinkedAt&&(t.unlinkedAt=String(e.unlinkedAt)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.comments=[],n.commentsV2=[]),t.defaults&&(n.commentThreadId="",n.resolvedAt="",n.resolvedBy="",n.context="",n.createdAt="",n.deletedAt="",n.attributes="",n.unlinkedAt=""),null!=e.commentThreadId&&e.hasOwnProperty("commentThreadId")&&(n.commentThreadId=e.commentThreadId),e.comments&&e.comments.length){n.comments=[];for(let t=0;t<e.comments.length;++t)n.comments[t]=e.comments[t]}if(e.commentsV2&&e.commentsV2.length){n.commentsV2=[];for(let r=0;r<e.commentsV2.length;++r)n.commentsV2[r]=je.CommentDescriptor.toObject(e.commentsV2[r],t)}return null!=e.resolvedAt&&e.hasOwnProperty("resolvedAt")&&(n.resolvedAt=e.resolvedAt),null!=e.resolvedBy&&e.hasOwnProperty("resolvedBy")&&(n.resolvedBy=e.resolvedBy),null!=e.context&&e.hasOwnProperty("context")&&(n.context=e.context),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.deletedAt&&e.hasOwnProperty("deletedAt")&&(n.deletedAt=e.deletedAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.unlinkedAt&&e.hasOwnProperty("unlinkedAt")&&(n.unlinkedAt=e.unlinkedAt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetCommentThreadResponse"},e})(),je.CommentsV2GetDocumentThreadsResponse=(()=>{function e(e){if(this.threads=[],this.threadsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.threads=Ee.emptyArray,e.prototype.threadsV2=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.threads&&e.threads.length)for(let n=0;n<e.threads.length;++n)t.uint32(10).string(e.threads[n]);if(null!=e.threadsV2&&e.threadsV2.length)for(let n=0;n<e.threadsV2.length;++n)je.CommentsThreadDescriptor.encode(e.threadsV2[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.CommentsV2GetDocumentThreadsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.threads&&r.threads.length||(r.threads=[]),r.threads.push(e.string());break;case 2:r.threadsV2&&r.threadsV2.length||(r.threadsV2=[]),r.threadsV2.push(je.CommentsThreadDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.threads&&e.hasOwnProperty("threads")){if(!Array.isArray(e.threads))return"threads: array expected";for(let t=0;t<e.threads.length;++t)if(!Ee.isString(e.threads[t]))return"threads: string[] expected"}if(null!=e.threadsV2&&e.hasOwnProperty("threadsV2")){if(!Array.isArray(e.threadsV2))return"threadsV2: array expected";for(let t=0;t<e.threadsV2.length;++t){let n=je.CommentsThreadDescriptor.verify(e.threadsV2[t]);if(n)return"threadsV2."+n}}return null},e.fromObject=function(e){if(e instanceof je.CommentsV2GetDocumentThreadsResponse)return e;let t=new je.CommentsV2GetDocumentThreadsResponse;if(e.threads){if(!Array.isArray(e.threads))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threads: array expected");t.threads=[];for(let n=0;n<e.threads.length;++n)t.threads[n]=String(e.threads[n])}if(e.threadsV2){if(!Array.isArray(e.threadsV2))throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: array expected");t.threadsV2=[];for(let n=0;n<e.threadsV2.length;++n){if("object"!=typeof e.threadsV2[n])throw TypeError(".CommentsV2GetDocumentThreadsResponse.threadsV2: object expected");t.threadsV2[n]=je.CommentsThreadDescriptor.fromObject(e.threadsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.threads=[],n.threadsV2=[]),e.threads&&e.threads.length){n.threads=[];for(let t=0;t<e.threads.length;++t)n.threads[t]=e.threads[t]}if(e.threadsV2&&e.threadsV2.length){n.threadsV2=[];for(let r=0;r<e.threadsV2.length;++r)n.threadsV2[r]=je.CommentsThreadDescriptor.toObject(e.threadsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/CommentsV2GetDocumentThreadsResponse"},e})(),je.KeyValueDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.KeyValueDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!Ee.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!Ee.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof je.KeyValueDescriptor)return e;let t=new je.KeyValueDescriptor;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/KeyValueDescriptor"},e})(),je.IsEditorBundleUploadedMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.bundleVersion="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.bundleVersion&&Object.hasOwnProperty.call(e,"bundleVersion")&&t.uint32(10).string(e.bundleVersion),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.IsEditorBundleUploadedMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.bundleVersion=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&!Ee.isString(e.bundleVersion)?"bundleVersion: string expected":null},e.fromObject=function(e){if(e instanceof je.IsEditorBundleUploadedMessage)return e;let t=new je.IsEditorBundleUploadedMessage;return null!=e.bundleVersion&&(t.bundleVersion=String(e.bundleVersion)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.bundleVersion=""),null!=e.bundleVersion&&e.hasOwnProperty("bundleVersion")&&(n.bundleVersion=e.bundleVersion),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedMessage"},e})(),je.IsEditorBundleUploadedResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.isUploaded=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.isUploaded&&Object.hasOwnProperty.call(e,"isUploaded")&&t.uint32(8).bool(e.isUploaded),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.IsEditorBundleUploadedResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.isUploaded=e.bool():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&"boolean"!=typeof e.isUploaded?"isUploaded: boolean expected":null},e.fromObject=function(e){if(e instanceof je.IsEditorBundleUploadedResponse)return e;let t=new je.IsEditorBundleUploadedResponse;return null!=e.isUploaded&&(t.isUploaded=Boolean(e.isUploaded)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.isUploaded=!1),null!=e.isUploaded&&e.hasOwnProperty("isUploaded")&&(n.isUploaded=e.isUploaded),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/IsEditorBundleUploadedResponse"},e})(),je.RevisionDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.revisionId="",e.prototype.name="",e.prototype.creatorId="",e.prototype.authorsIds="",e.prototype.diffData="",e.prototype.createdAt="",e.prototype.attributes="",e.prototype.toVersion=0,e.prototype.fromVersion=0,e.prototype.isEmptyCurrent=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.revisionId=e.string();break;case 2:r.name=e.string();break;case 3:r.creatorId=e.string();break;case 4:r.authorsIds=e.string();break;case 5:r.diffData=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;case 8:r.toVersion=e.uint32();break;case 9:r.fromVersion=e.uint32();break;case 10:r.isEmptyCurrent=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!Ee.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!Ee.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!Ee.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!Ee.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!Ee.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!Ee.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!Ee.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},e.fromObject=function(e){if(e instanceof je.RevisionDescriptor)return e;let t=new je.RevisionDescriptor;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionDescriptor"},e})(),je.RevisionHistoryConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryConnectMessage)return e;let t=new je.RevisionHistoryConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectMessage"},e})(),je.RevisionHistoryGetRevisionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.revisionId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(18).string(e.revisionId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryGetRevisionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.revisionId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!Ee.isString(e.revisionId)?"revisionId: string expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryGetRevisionMessage)return e;let t=new je.RevisionHistoryGetRevisionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.revisionId&&(t.revisionId=String(e.revisionId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.revisionId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionMessage"},e})(),je.RevisionHistoryReconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.requestId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryReconnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.requestId=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ee.isInteger(e.requestId)?"requestId: integer expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryReconnectMessage)return e;let t=new je.RevisionHistoryReconnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryReconnectMessage"},e})(),je.RevisionHistoryUpdateRevisionsMessage=(()=>{function e(e){if(this.revisions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.prototype.requestId=0,e.prototype.revisions=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(let n=0;n<e.revisions.length;++n)je.RevisionDescriptor.encode(e.revisions[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryUpdateRevisionsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.documentId=e.string();break;case 2:r.requestId=e.uint32();break;case 3:r.revisions&&r.revisions.length||(r.revisions=[]),r.revisions.push(je.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId))return"documentId: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ee.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(let t=0;t<e.revisions.length;++t){let n=je.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryUpdateRevisionsMessage)return e;let t=new je.RevisionHistoryUpdateRevisionsMessage;if(null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: array expected");t.revisions=[];for(let n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryUpdateRevisionsMessage.revisions: object expected");t.revisions[n]=je.RevisionDescriptor.fromObject(e.revisions[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.documentId="",n.requestId=0),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(let r=0;r<e.revisions.length;++r)n.revisions[r]=je.RevisionDescriptor.toObject(e.revisions[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsMessage"},e})(),je.RevisionHistoryConnectResponse=(()=>{function e(e){if(this.revisions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.requestId=0,e.prototype.revisions=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(16).uint32(e.requestId),null!=e.revisions&&e.revisions.length)for(let n=0;n<e.revisions.length;++n)je.RevisionDescriptor.encode(e.revisions[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.requestId=e.uint32();break;case 3:r.revisions&&r.revisions.length||(r.revisions=[]),r.revisions.push(je.RevisionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ee.isInteger(e.requestId))return"requestId: integer expected";if(null!=e.revisions&&e.hasOwnProperty("revisions")){if(!Array.isArray(e.revisions))return"revisions: array expected";for(let t=0;t<e.revisions.length;++t){let n=je.RevisionDescriptor.verify(e.revisions[t]);if(n)return"revisions."+n}}return null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryConnectResponse)return e;let t=new je.RevisionHistoryConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),null!=e.requestId&&(t.requestId=e.requestId>>>0),e.revisions){if(!Array.isArray(e.revisions))throw TypeError(".RevisionHistoryConnectResponse.revisions: array expected");t.revisions=[];for(let n=0;n<e.revisions.length;++n){if("object"!=typeof e.revisions[n])throw TypeError(".RevisionHistoryConnectResponse.revisions: object expected");t.revisions[n]=je.RevisionDescriptor.fromObject(e.revisions[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.revisions=[]),t.defaults&&(n.channel="",n.requestId=0),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),e.revisions&&e.revisions.length){n.revisions=[];for(let r=0;r<e.revisions.length;++r)n.revisions[r]=je.RevisionDescriptor.toObject(e.revisions[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryConnectResponse"},e})(),je.RevisionHistoryGetRevisionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.revisionId="",e.prototype.name="",e.prototype.creatorId="",e.prototype.authorsIds="",e.prototype.diffData="",e.prototype.createdAt="",e.prototype.attributes="",e.prototype.toVersion=0,e.prototype.fromVersion=0,e.prototype.isEmptyCurrent=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.revisionId&&Object.hasOwnProperty.call(e,"revisionId")&&t.uint32(10).string(e.revisionId),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.creatorId&&Object.hasOwnProperty.call(e,"creatorId")&&t.uint32(26).string(e.creatorId),null!=e.authorsIds&&Object.hasOwnProperty.call(e,"authorsIds")&&t.uint32(34).string(e.authorsIds),null!=e.diffData&&Object.hasOwnProperty.call(e,"diffData")&&t.uint32(42).string(e.diffData),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(50).string(e.createdAt),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(58).string(e.attributes),null!=e.toVersion&&Object.hasOwnProperty.call(e,"toVersion")&&t.uint32(64).uint32(e.toVersion),null!=e.fromVersion&&Object.hasOwnProperty.call(e,"fromVersion")&&t.uint32(72).uint32(e.fromVersion),null!=e.isEmptyCurrent&&Object.hasOwnProperty.call(e,"isEmptyCurrent")&&t.uint32(80).bool(e.isEmptyCurrent),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryGetRevisionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.revisionId=e.string();break;case 2:r.name=e.string();break;case 3:r.creatorId=e.string();break;case 4:r.authorsIds=e.string();break;case 5:r.diffData=e.string();break;case 6:r.createdAt=e.string();break;case 7:r.attributes=e.string();break;case 8:r.toVersion=e.uint32();break;case 9:r.fromVersion=e.uint32();break;case 10:r.isEmptyCurrent=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.revisionId&&e.hasOwnProperty("revisionId")&&!Ee.isString(e.revisionId)?"revisionId: string expected":null!=e.name&&e.hasOwnProperty("name")&&!Ee.isString(e.name)?"name: string expected":null!=e.creatorId&&e.hasOwnProperty("creatorId")&&!Ee.isString(e.creatorId)?"creatorId: string expected":null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&!Ee.isString(e.authorsIds)?"authorsIds: string expected":null!=e.diffData&&e.hasOwnProperty("diffData")&&!Ee.isString(e.diffData)?"diffData: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null!=e.toVersion&&e.hasOwnProperty("toVersion")&&!Ee.isInteger(e.toVersion)?"toVersion: integer expected":null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&!Ee.isInteger(e.fromVersion)?"fromVersion: integer expected":null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&"boolean"!=typeof e.isEmptyCurrent?"isEmptyCurrent: boolean expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryGetRevisionResponse)return e;let t=new je.RevisionHistoryGetRevisionResponse;return null!=e.revisionId&&(t.revisionId=String(e.revisionId)),null!=e.name&&(t.name=String(e.name)),null!=e.creatorId&&(t.creatorId=String(e.creatorId)),null!=e.authorsIds&&(t.authorsIds=String(e.authorsIds)),null!=e.diffData&&(t.diffData=String(e.diffData)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.attributes&&(t.attributes=String(e.attributes)),null!=e.toVersion&&(t.toVersion=e.toVersion>>>0),null!=e.fromVersion&&(t.fromVersion=e.fromVersion>>>0),null!=e.isEmptyCurrent&&(t.isEmptyCurrent=Boolean(e.isEmptyCurrent)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.revisionId="",n.name="",n.creatorId="",n.authorsIds="",n.diffData="",n.createdAt="",n.attributes="",n.toVersion=0,n.fromVersion=0,n.isEmptyCurrent=!1),null!=e.revisionId&&e.hasOwnProperty("revisionId")&&(n.revisionId=e.revisionId),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.creatorId&&e.hasOwnProperty("creatorId")&&(n.creatorId=e.creatorId),null!=e.authorsIds&&e.hasOwnProperty("authorsIds")&&(n.authorsIds=e.authorsIds),null!=e.diffData&&e.hasOwnProperty("diffData")&&(n.diffData=e.diffData),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),null!=e.toVersion&&e.hasOwnProperty("toVersion")&&(n.toVersion=e.toVersion),null!=e.fromVersion&&e.hasOwnProperty("fromVersion")&&(n.fromVersion=e.fromVersion),null!=e.isEmptyCurrent&&e.hasOwnProperty("isEmptyCurrent")&&(n.isEmptyCurrent=e.isEmptyCurrent),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryGetRevisionResponse"},e})(),je.RevisionHistoryUpdateRevisionsResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.requestId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.requestId&&Object.hasOwnProperty.call(e,"requestId")&&t.uint32(8).uint32(e.requestId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.RevisionHistoryUpdateRevisionsResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.requestId=e.uint32():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.requestId&&e.hasOwnProperty("requestId")&&!Ee.isInteger(e.requestId)?"requestId: integer expected":null},e.fromObject=function(e){if(e instanceof je.RevisionHistoryUpdateRevisionsResponse)return e;let t=new je.RevisionHistoryUpdateRevisionsResponse;return null!=e.requestId&&(t.requestId=e.requestId>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.requestId=0),null!=e.requestId&&e.hasOwnProperty("requestId")&&(n.requestId=e.requestId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RevisionHistoryUpdateRevisionsResponse"},e})(),je.SessionsSocketDescriptor=(()=>{function e(e){if(this.permissions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.session="",e.prototype.user="",e.prototype.role="",e.prototype.permissions=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.session&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(18).string(e.user),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(let n=0;n<e.permissions.length;++n)t.uint32(34).string(e.permissions[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SessionsSocketDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.session=e.string();break;case 2:r.user=e.string();break;case 3:r.role=e.string();break;case 4:r.permissions&&r.permissions.length||(r.permissions=[]),r.permissions.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.session&&e.hasOwnProperty("session")&&!Ee.isString(e.session))return"session: string expected";if(null!=e.user&&e.hasOwnProperty("user")&&!Ee.isString(e.user))return"user: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!Ee.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(let t=0;t<e.permissions.length;++t)if(!Ee.isString(e.permissions[t]))return"permissions: string[] expected"}return null},e.fromObject=function(e){if(e instanceof je.SessionsSocketDescriptor)return e;let t=new je.SessionsSocketDescriptor;if(null!=e.session&&(t.session=String(e.session)),null!=e.user&&(t.user=String(e.user)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SessionsSocketDescriptor.permissions: array expected");t.permissions=[];for(let n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.session="",n.user="",n.role=""),null!=e.session&&e.hasOwnProperty("session")&&(n.session=e.session),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(let t=0;t<e.permissions.length;++t)n.permissions[t]=e.permissions[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsSocketDescriptor"},e})(),je.SessionsConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.sessionType=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.sessionType&&Object.hasOwnProperty.call(e,"sessionType")&&t.uint32(16).uint32(e.sessionType),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SessionsConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.sessionType=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.sessionType&&e.hasOwnProperty("sessionType")&&!Ee.isInteger(e.sessionType)?"sessionType: integer expected":null},e.fromObject=function(e){if(e instanceof je.SessionsConnectMessage)return e;let t=new je.SessionsConnectMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.sessionType&&(t.sessionType=e.sessionType>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.sessionType=0),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.sessionType&&e.hasOwnProperty("sessionType")&&(n.sessionType=e.sessionType),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectMessage"},e})(),je.SocketConnectMessage=(()=>{function e(e){if(this.permissions=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.userId="",e.prototype.role="",e.prototype.permissions=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(26).string(e.role),null!=e.permissions&&e.permissions.length)for(let n=0;n<e.permissions.length;++n)t.uint32(34).string(e.permissions[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SocketConnectMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.userId=e.string();break;case 3:r.role=e.string();break;case 4:r.permissions&&r.permissions.length||(r.permissions=[]),r.permissions.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id))return"id: string expected";if(null!=e.userId&&e.hasOwnProperty("userId")&&!Ee.isString(e.userId))return"userId: string expected";if(null!=e.role&&e.hasOwnProperty("role")&&!Ee.isString(e.role))return"role: string expected";if(null!=e.permissions&&e.hasOwnProperty("permissions")){if(!Array.isArray(e.permissions))return"permissions: array expected";for(let t=0;t<e.permissions.length;++t)if(!Ee.isString(e.permissions[t]))return"permissions: string[] expected"}return null},e.fromObject=function(e){if(e instanceof je.SocketConnectMessage)return e;let t=new je.SocketConnectMessage;if(null!=e.id&&(t.id=String(e.id)),null!=e.userId&&(t.userId=String(e.userId)),null!=e.role&&(t.role=String(e.role)),e.permissions){if(!Array.isArray(e.permissions))throw TypeError(".SocketConnectMessage.permissions: array expected");t.permissions=[];for(let n=0;n<e.permissions.length;++n)t.permissions[n]=String(e.permissions[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.permissions=[]),t.defaults&&(n.id="",n.userId="",n.role=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.role&&e.hasOwnProperty("role")&&(n.role=e.role),e.permissions&&e.permissions.length){n.permissions=[];for(let t=0;t<e.permissions.length;++t)n.permissions[t]=e.permissions[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketConnectMessage"},e})(),je.SocketDisconnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SocketDisconnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.id=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null},e.fromObject=function(e){if(e instanceof je.SocketDisconnectMessage)return e;let t=new je.SocketDisconnectMessage;return null!=e.id&&(t.id=String(e.id)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SocketDisconnectMessage"},e})(),je.SessionsConnectResponse=(()=>{function e(e){if(this.sockets=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.sockets=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.sockets&&e.sockets.length)for(let n=0;n<e.sockets.length;++n)je.SessionsSocketDescriptor.encode(e.sockets[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SessionsConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.sockets&&r.sockets.length||(r.sockets=[]),r.sockets.push(je.SessionsSocketDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.sockets&&e.hasOwnProperty("sockets")){if(!Array.isArray(e.sockets))return"sockets: array expected";for(let t=0;t<e.sockets.length;++t){let n=je.SessionsSocketDescriptor.verify(e.sockets[t]);if(n)return"sockets."+n}}return null},e.fromObject=function(e){if(e instanceof je.SessionsConnectResponse)return e;let t=new je.SessionsConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.sockets){if(!Array.isArray(e.sockets))throw TypeError(".SessionsConnectResponse.sockets: array expected");t.sockets=[];for(let n=0;n<e.sockets.length;++n){if("object"!=typeof e.sockets[n])throw TypeError(".SessionsConnectResponse.sockets: object expected");t.sockets[n]=je.SessionsSocketDescriptor.fromObject(e.sockets[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.sockets=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.sockets&&e.sockets.length){n.sockets=[];for(let r=0;r<e.sockets.length;++r)n.sockets[r]=je.SessionsSocketDescriptor.toObject(e.sockets[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SessionsConnectResponse"},e})(),je.SuggestionDescriptor=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.SuggestionDescriptor;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!Ee.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.SuggestionDescriptor)return e;let t=new je.SuggestionDescriptor;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SuggestionDescriptor"},e})(),je.TrackChangesAddSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.prototype.type="",e.prototype.data="",e.prototype.originalSuggestionId="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).string(e.data),null!=e.originalSuggestionId&&Object.hasOwnProperty.call(e,"originalSuggestionId")&&t.uint32(42).string(e.originalSuggestionId),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesAddSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;case 3:r.type=e.string();break;case 4:r.data=e.string();break;case 5:r.originalSuggestionId=e.string();break;case 6:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&!Ee.isString(e.originalSuggestionId)?"originalSuggestionId: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesAddSuggestionMessage)return e;let t=new je.TrackChangesAddSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.type&&(t.type=String(e.type)),null!=e.data&&(t.data=String(e.data)),null!=e.originalSuggestionId&&(t.originalSuggestionId=String(e.originalSuggestionId)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId="",n.type="",n.data="",n.originalSuggestionId="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.originalSuggestionId&&e.hasOwnProperty("originalSuggestionId")&&(n.originalSuggestionId=e.originalSuggestionId),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionMessage"},e})(),je.TrackChangesBatchUpdateSuggestionsStateMessage=(()=>{function e(e){if(this.ids=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ids=Ee.emptyArray,e.prototype.documentId="",e.prototype.state="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.ids&&e.ids.length)for(let n=0;n<e.ids.length;++n)t.uint32(10).string(e.ids[n]);return null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(26).string(e.state),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesBatchUpdateSuggestionsStateMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.ids&&r.ids.length||(r.ids=[]),r.ids.push(e.string());break;case 2:r.documentId=e.string();break;case 3:r.state=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(let t=0;t<e.ids.length;++t)if(!Ee.isString(e.ids[t]))return"ids: string[] expected"}return null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesBatchUpdateSuggestionsStateMessage)return e;let t=new je.TrackChangesBatchUpdateSuggestionsStateMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".TrackChangesBatchUpdateSuggestionsStateMessage.ids: array expected");t.ids=[];for(let n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.state&&(t.state=String(e.state)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.ids=[]),t.defaults&&(n.documentId="",n.state=""),e.ids&&e.ids.length){n.ids=[];for(let t=0;t<e.ids.length;++t)n.ids[t]=e.ids[t]}return null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesBatchUpdateSuggestionsStateMessage"},e})(),je.TrackChangesConnectMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesConnectMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesConnectMessage)return e;let t=new je.TrackChangesConnectMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectMessage"},e})(),je.TrackChangesGetAllSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(10).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesGetAllSuggestionMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.documentId=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesGetAllSuggestionMessage)return e;let t=new je.TrackChangesGetAllSuggestionMessage;return null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.documentId=""),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionMessage"},e})(),je.TrackChangesGetSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesGetSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesGetSuggestionMessage)return e;let t=new je.TrackChangesGetSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionMessage"},e})(),je.TrackChangesUpdateSuggestionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.documentId="",e.prototype.hasComments=!1,e.prototype.isHasCommentsModified=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.documentId&&Object.hasOwnProperty.call(e,"documentId")&&t.uint32(18).string(e.documentId),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(24).bool(e.hasComments),null!=e.isHasCommentsModified&&Object.hasOwnProperty.call(e,"isHasCommentsModified")&&t.uint32(32).bool(e.isHasCommentsModified),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(42).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(50).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesUpdateSuggestionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.documentId=e.string();break;case 3:r.hasComments=e.bool();break;case 4:r.isHasCommentsModified=e.bool();break;case 5:r.state=e.string();break;case 6:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.documentId&&e.hasOwnProperty("documentId")&&!Ee.isString(e.documentId)?"documentId: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&"boolean"!=typeof e.isHasCommentsModified?"isHasCommentsModified: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesUpdateSuggestionMessage)return e;let t=new je.TrackChangesUpdateSuggestionMessage;return null!=e.id&&(t.id=String(e.id)),null!=e.documentId&&(t.documentId=String(e.documentId)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.isHasCommentsModified&&(t.isHasCommentsModified=Boolean(e.isHasCommentsModified)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.documentId="",n.hasComments=!1,n.isHasCommentsModified=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.documentId&&e.hasOwnProperty("documentId")&&(n.documentId=e.documentId),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.isHasCommentsModified&&e.hasOwnProperty("isHasCommentsModified")&&(n.isHasCommentsModified=e.isHasCommentsModified),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesUpdateSuggestionMessage"},e})(),je.TrackChangesAddSuggestionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesAddSuggestionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!Ee.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesAddSuggestionResponse)return e;let t=new je.TrackChangesAddSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesAddSuggestionResponse"},e})(),je.TrackChangesConnectResponse=(()=>{function e(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.channel="",e.prototype.suggestions=Ee.emptyArray,e.prototype.suggestionsV2=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.channel&&Object.hasOwnProperty.call(e,"channel")&&t.uint32(10).string(e.channel),null!=e.suggestions&&e.suggestions.length)for(let n=0;n<e.suggestions.length;++n)t.uint32(18).string(e.suggestions[n]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(let n=0;n<e.suggestionsV2.length;++n)je.SuggestionDescriptor.encode(e.suggestionsV2[n],t.uint32(26).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesConnectResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.channel=e.string();break;case 2:r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(e.string());break;case 3:r.suggestionsV2&&r.suggestionsV2.length||(r.suggestionsV2=[]),r.suggestionsV2.push(je.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.channel&&e.hasOwnProperty("channel")&&!Ee.isString(e.channel))return"channel: string expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(let t=0;t<e.suggestions.length;++t)if(!Ee.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(let t=0;t<e.suggestionsV2.length;++t){let n=je.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},e.fromObject=function(e){if(e instanceof je.TrackChangesConnectResponse)return e;let t=new je.TrackChangesConnectResponse;if(null!=e.channel&&(t.channel=String(e.channel)),e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesConnectResponse.suggestions: array expected");t.suggestions=[];for(let n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesConnectResponse.suggestionsV2: array expected");t.suggestionsV2=[];for(let n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesConnectResponse.suggestionsV2: object expected");t.suggestionsV2[n]=je.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),t.defaults&&(n.channel=""),null!=e.channel&&e.hasOwnProperty("channel")&&(n.channel=e.channel),e.suggestions&&e.suggestions.length){n.suggestions=[];for(let t=0;t<e.suggestions.length;++t)n.suggestions[t]=e.suggestions[t]}if(e.suggestionsV2&&e.suggestionsV2.length){n.suggestionsV2=[];for(let r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=je.SuggestionDescriptor.toObject(e.suggestionsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesConnectResponse"},e})(),je.TrackChangesGetAllSuggestionsResponse=(()=>{function e(e){if(this.suggestions=[],this.suggestionsV2=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.suggestions=Ee.emptyArray,e.prototype.suggestionsV2=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.suggestions&&e.suggestions.length)for(let n=0;n<e.suggestions.length;++n)t.uint32(10).string(e.suggestions[n]);if(null!=e.suggestionsV2&&e.suggestionsV2.length)for(let n=0;n<e.suggestionsV2.length;++n)je.SuggestionDescriptor.encode(e.suggestionsV2[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesGetAllSuggestionsResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(e.string());break;case 2:r.suggestionsV2&&r.suggestionsV2.length||(r.suggestionsV2=[]),r.suggestionsV2.push(je.SuggestionDescriptor.decode(e,e.uint32()));break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.suggestions&&e.hasOwnProperty("suggestions")){if(!Array.isArray(e.suggestions))return"suggestions: array expected";for(let t=0;t<e.suggestions.length;++t)if(!Ee.isString(e.suggestions[t]))return"suggestions: string[] expected"}if(null!=e.suggestionsV2&&e.hasOwnProperty("suggestionsV2")){if(!Array.isArray(e.suggestionsV2))return"suggestionsV2: array expected";for(let t=0;t<e.suggestionsV2.length;++t){let n=je.SuggestionDescriptor.verify(e.suggestionsV2[t]);if(n)return"suggestionsV2."+n}}return null},e.fromObject=function(e){if(e instanceof je.TrackChangesGetAllSuggestionsResponse)return e;let t=new je.TrackChangesGetAllSuggestionsResponse;if(e.suggestions){if(!Array.isArray(e.suggestions))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestions: array expected");t.suggestions=[];for(let n=0;n<e.suggestions.length;++n)t.suggestions[n]=String(e.suggestions[n])}if(e.suggestionsV2){if(!Array.isArray(e.suggestionsV2))throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: array expected");t.suggestionsV2=[];for(let n=0;n<e.suggestionsV2.length;++n){if("object"!=typeof e.suggestionsV2[n])throw TypeError(".TrackChangesGetAllSuggestionsResponse.suggestionsV2: object expected");t.suggestionsV2[n]=je.SuggestionDescriptor.fromObject(e.suggestionsV2[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.suggestions=[],n.suggestionsV2=[]),e.suggestions&&e.suggestions.length){n.suggestions=[];for(let t=0;t<e.suggestions.length;++t)n.suggestions[t]=e.suggestions[t]}if(e.suggestionsV2&&e.suggestionsV2.length){n.suggestionsV2=[];for(let r=0;r<e.suggestionsV2.length;++r)n.suggestionsV2[r]=je.SuggestionDescriptor.toObject(e.suggestionsV2[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetAllSuggestionsResponse"},e})(),je.TrackChangesGetSuggestionResponse=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.prototype.authorId="",e.prototype.type="",e.prototype.createdAt="",e.prototype.data="",e.prototype.hasComments=!1,e.prototype.state="",e.prototype.attributes="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),null!=e.authorId&&Object.hasOwnProperty.call(e,"authorId")&&t.uint32(18).string(e.authorId),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.createdAt&&Object.hasOwnProperty.call(e,"createdAt")&&t.uint32(34).string(e.createdAt),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(42).string(e.data),null!=e.hasComments&&Object.hasOwnProperty.call(e,"hasComments")&&t.uint32(48).bool(e.hasComments),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.attributes&&Object.hasOwnProperty.call(e,"attributes")&&t.uint32(66).string(e.attributes),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.TrackChangesGetSuggestionResponse;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.string();break;case 2:r.authorId=e.string();break;case 3:r.type=e.string();break;case 4:r.createdAt=e.string();break;case 5:r.data=e.string();break;case 6:r.hasComments=e.bool();break;case 7:r.state=e.string();break;case 8:r.attributes=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null!=e.authorId&&e.hasOwnProperty("authorId")&&!Ee.isString(e.authorId)?"authorId: string expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isString(e.type)?"type: string expected":null!=e.createdAt&&e.hasOwnProperty("createdAt")&&!Ee.isString(e.createdAt)?"createdAt: string expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.hasComments&&e.hasOwnProperty("hasComments")&&"boolean"!=typeof e.hasComments?"hasComments: boolean expected":null!=e.state&&e.hasOwnProperty("state")&&!Ee.isString(e.state)?"state: string expected":null!=e.attributes&&e.hasOwnProperty("attributes")&&!Ee.isString(e.attributes)?"attributes: string expected":null},e.fromObject=function(e){if(e instanceof je.TrackChangesGetSuggestionResponse)return e;let t=new je.TrackChangesGetSuggestionResponse;return null!=e.id&&(t.id=String(e.id)),null!=e.authorId&&(t.authorId=String(e.authorId)),null!=e.type&&(t.type=String(e.type)),null!=e.createdAt&&(t.createdAt=String(e.createdAt)),null!=e.data&&(t.data=String(e.data)),null!=e.hasComments&&(t.hasComments=Boolean(e.hasComments)),null!=e.state&&(t.state=String(e.state)),null!=e.attributes&&(t.attributes=String(e.attributes)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id="",n.authorId="",n.type="",n.createdAt="",n.data="",n.hasComments=!1,n.state="",n.attributes=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.authorId&&e.hasOwnProperty("authorId")&&(n.authorId=e.authorId),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.createdAt&&e.hasOwnProperty("createdAt")&&(n.createdAt=e.createdAt),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.hasComments&&e.hasOwnProperty("hasComments")&&(n.hasComments=e.hasComments),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.attributes&&e.hasOwnProperty("attributes")&&(n.attributes=e.attributes),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/TrackChangesGetSuggestionResponse"},e})(),je.UserDescriptor=(()=>{function e(e){if(this.attributes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.attributes=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.attributes&&e.attributes.length)for(let n=0;n<e.attributes.length;++n)je.KeyValueDescriptor.encode(e.attributes[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.UserDescriptor;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(je.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(let t=0;t<e.attributes.length;++t){let n=je.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},e.fromObject=function(e){if(e instanceof je.UserDescriptor)return e;let t=new je.UserDescriptor;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".UserDescriptor.attributes: array expected");t.attributes=[];for(let n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".UserDescriptor.attributes: object expected");t.attributes[n]=je.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(let r=0;r<e.attributes.length;++r)n.attributes[r]=je.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserDescriptor"},e})(),je.GetManyUsersMessage=(()=>{function e(e){if(this.ids=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.ids=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.ids&&e.ids.length)for(let n=0;n<e.ids.length;++n)t.uint32(10).string(e.ids[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetManyUsersMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.ids&&r.ids.length||(r.ids=[]),r.ids.push(e.string())):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.ids&&e.hasOwnProperty("ids")){if(!Array.isArray(e.ids))return"ids: array expected";for(let t=0;t<e.ids.length;++t)if(!Ee.isString(e.ids[t]))return"ids: string[] expected"}return null},e.fromObject=function(e){if(e instanceof je.GetManyUsersMessage)return e;let t=new je.GetManyUsersMessage;if(e.ids){if(!Array.isArray(e.ids))throw TypeError(".GetManyUsersMessage.ids: array expected");t.ids=[];for(let n=0;n<e.ids.length;++n)t.ids[n]=String(e.ids[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.ids=[]),e.ids&&e.ids.length){n.ids=[];for(let t=0;t<e.ids.length;++t)n.ids[t]=e.ids[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersMessage"},e})(),je.GetUserMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetUserMessage;for(;e.pos<n;){let t=e.uint32();t>>>3==1?r.id=e.string():e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isString(e.id)?"id: string expected":null},e.fromObject=function(e){if(e instanceof je.GetUserMessage)return e;let t=new je.GetUserMessage;return null!=e.id&&(t.id=String(e.id)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.id=""),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserMessage"},e})(),je.GetManyUsersResponse=(()=>{function e(e){if(this.users=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.users=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.users&&e.users.length)for(let n=0;n<e.users.length;++n)je.UserDescriptor.encode(e.users[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetManyUsersResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.users&&r.users.length||(r.users=[]),r.users.push(je.UserDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.users&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let n=je.UserDescriptor.verify(e.users[t]);if(n)return"users."+n}}return null},e.fromObject=function(e){if(e instanceof je.GetManyUsersResponse)return e;let t=new je.GetManyUsersResponse;if(e.users){if(!Array.isArray(e.users))throw TypeError(".GetManyUsersResponse.users: array expected");t.users=[];for(let n=0;n<e.users.length;++n){if("object"!=typeof e.users[n])throw TypeError(".GetManyUsersResponse.users: object expected");t.users[n]=je.UserDescriptor.fromObject(e.users[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.users=[]),e.users&&e.users.length){n.users=[];for(let r=0;r<e.users.length;++r)n.users[r]=je.UserDescriptor.toObject(e.users[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetManyUsersResponse"},e})(),je.GetUserResponse=(()=>{function e(e){if(this.attributes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.attributes=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.attributes&&e.attributes.length)for(let n=0;n<e.attributes.length;++n)je.KeyValueDescriptor.encode(e.attributes[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.GetUserResponse;for(;e.pos<n;){let t=e.uint32();t>>>3==1?(r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(je.KeyValueDescriptor.decode(e,e.uint32()))):e.skipType(7&t)}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.attributes&&e.hasOwnProperty("attributes")){if(!Array.isArray(e.attributes))return"attributes: array expected";for(let t=0;t<e.attributes.length;++t){let n=je.KeyValueDescriptor.verify(e.attributes[t]);if(n)return"attributes."+n}}return null},e.fromObject=function(e){if(e instanceof je.GetUserResponse)return e;let t=new je.GetUserResponse;if(e.attributes){if(!Array.isArray(e.attributes))throw TypeError(".GetUserResponse.attributes: array expected");t.attributes=[];for(let n=0;n<e.attributes.length;++n){if("object"!=typeof e.attributes[n])throw TypeError(".GetUserResponse.attributes: object expected");t.attributes[n]=je.KeyValueDescriptor.fromObject(e.attributes[n])}}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.attributes=[]),e.attributes&&e.attributes.length){n.attributes=[];for(let r=0;r<e.attributes.length;++r)n.attributes[r]=je.KeyValueDescriptor.toObject(e.attributes[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/GetUserResponse"},e})(),je.ChannelMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=0,e.prototype.socketId="",e.prototype.data=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.socketId&&Object.hasOwnProperty.call(e,"socketId")&&t.uint32(18).string(e.socketId),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.ChannelMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.type=e.uint32();break;case 2:r.socketId=e.string();break;case 3:r.data=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isInteger(e.type)?"type: integer expected":null!=e.socketId&&e.hasOwnProperty("socketId")&&!Ee.isString(e.socketId)?"socketId: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||Ee.isString(e.data))?"data: buffer expected":null},e.fromObject=function(e){if(e instanceof je.ChannelMessage)return e;let t=new je.ChannelMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.socketId&&(t.socketId=String(e.socketId)),null!=e.data&&("string"==typeof e.data?Ee.base64.decode(e.data,t.data=Ee.newBuffer(Ee.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.type=0,n.socketId="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=Ee.newBuffer(n.data)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.socketId&&e.hasOwnProperty("socketId")&&(n.socketId=e.socketId),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?Ee.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ChannelMessage"},e})(),je.BytesBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=Ee.newBuffer([]),e.prototype.data1=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).bytes(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.BytesBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.bytes();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||Ee.isString(e.data))?"data: buffer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ee.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof je.BytesBytesPacketDataMessage)return e;let t=new je.BytesBytesPacketDataMessage;return null!=e.data&&("string"==typeof e.data?Ee.base64.decode(e.data,t.data=Ee.newBuffer(Ee.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.data1&&("string"==typeof e.data1?Ee.base64.decode(e.data1,t.data1=Ee.newBuffer(Ee.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=Ee.newBuffer(n.data))),t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ee.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?Ee.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ee.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/BytesBytesPacketDataMessage"},e})(),je.NumberBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.NumberBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ee.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof je.NumberBytesPacketDataMessage)return e;let t=new je.NumberBytesPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&("string"==typeof e.data1?Ee.base64.decode(e.data1,t.data1=Ee.newBuffer(Ee.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ee.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ee.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberBytesPacketDataMessage"},e})(),je.NumberNumberPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.NumberNumberPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isInteger(e.data1)?"data1: integer expected":null},e.fromObject=function(e){if(e instanceof je.NumberNumberPacketDataMessage)return e;let t=new je.NumberNumberPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=e.data1>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberNumberPacketDataMessage"},e})(),je.NumberObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.NumberObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.NumberObjectPacketDataMessage)return e;let t=new je.NumberObjectPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberObjectPacketDataMessage"},e})(),je.NumberStringPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data=0,e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(8).uint32(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.NumberStringPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.uint32();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isInteger(e.data)?"data: integer expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.NumberStringPacketDataMessage)return e;let t=new je.NumberStringPacketDataMessage;return null!=e.data&&(t.data=e.data>>>0),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data=0,n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/NumberStringPacketDataMessage"},e})(),je.ObjectBufferPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.ObjectBufferPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ee.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof je.ObjectBufferPacketDataMessage)return e;let t=new je.ObjectBufferPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?Ee.base64.decode(e.data1,t.data1=Ee.newBuffer(Ee.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ee.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ee.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectBufferPacketDataMessage"},e})(),je.ObjectObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.ObjectObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.ObjectObjectPacketDataMessage)return e;let t=new je.ObjectObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ObjectObjectPacketDataMessage"},e})(),je.PacketMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.type=0,e.prototype.id=0,e.prototype.nsp="",e.prototype.data=Ee.newBuffer([]),e.prototype.options=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).uint32(e.type),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(16).uint32(e.id),null!=e.nsp&&Object.hasOwnProperty.call(e,"nsp")&&t.uint32(26).string(e.nsp),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(34).bytes(e.data),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&t.uint32(42).bytes(e.options),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.PacketMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.type=e.uint32();break;case 2:r.id=e.uint32();break;case 3:r.nsp=e.string();break;case 4:r.data=e.bytes();break;case 5:r.options=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!Ee.isInteger(e.type)?"type: integer expected":null!=e.id&&e.hasOwnProperty("id")&&!Ee.isInteger(e.id)?"id: integer expected":null!=e.nsp&&e.hasOwnProperty("nsp")&&!Ee.isString(e.nsp)?"nsp: string expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"==typeof e.data.length||Ee.isString(e.data))?"data: buffer expected":null!=e.options&&e.hasOwnProperty("options")&&!(e.options&&"number"==typeof e.options.length||Ee.isString(e.options))?"options: buffer expected":null},e.fromObject=function(e){if(e instanceof je.PacketMessage)return e;let t=new je.PacketMessage;return null!=e.type&&(t.type=e.type>>>0),null!=e.id&&(t.id=e.id>>>0),null!=e.nsp&&(t.nsp=String(e.nsp)),null!=e.data&&("string"==typeof e.data?Ee.base64.decode(e.data,t.data=Ee.newBuffer(Ee.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),null!=e.options&&("string"==typeof e.options?Ee.base64.decode(e.options,t.options=Ee.newBuffer(Ee.base64.length(e.options)),0):e.options.length>=0&&(t.options=e.options)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.type=0,n.id=0,n.nsp="",t.bytes===String?n.data="":(n.data=[],t.bytes!==Array&&(n.data=Ee.newBuffer(n.data))),t.bytes===String?n.options="":(n.options=[],t.bytes!==Array&&(n.options=Ee.newBuffer(n.options)))),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.nsp&&e.hasOwnProperty("nsp")&&(n.nsp=e.nsp),null!=e.data&&e.hasOwnProperty("data")&&(n.data=t.bytes===String?Ee.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),null!=e.options&&e.hasOwnProperty("options")&&(n.options=t.bytes===String?Ee.base64.encode(e.options,0,e.options.length):t.bytes===Array?Array.prototype.slice.call(e.options):e.options),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketMessage"},e})(),je.PacketOptionsMessage=(()=>{function e(e){if(this.rooms=[],this.except=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.flags="",e.prototype.rooms=Ee.emptyArray,e.prototype.except=Ee.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=Ce.create()),null!=e.flags&&Object.hasOwnProperty.call(e,"flags")&&t.uint32(10).string(e.flags),null!=e.rooms&&e.rooms.length)for(let n=0;n<e.rooms.length;++n)t.uint32(18).string(e.rooms[n]);if(null!=e.except&&e.except.length)for(let n=0;n<e.except.length;++n)t.uint32(26).string(e.except[n]);return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.PacketOptionsMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.flags=e.string();break;case 2:r.rooms&&r.rooms.length||(r.rooms=[]),r.rooms.push(e.string());break;case 3:r.except&&r.except.length||(r.except=[]),r.except.push(e.string());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.flags&&e.hasOwnProperty("flags")&&!Ee.isString(e.flags))return"flags: string expected";if(null!=e.rooms&&e.hasOwnProperty("rooms")){if(!Array.isArray(e.rooms))return"rooms: array expected";for(let t=0;t<e.rooms.length;++t)if(!Ee.isString(e.rooms[t]))return"rooms: string[] expected"}if(null!=e.except&&e.hasOwnProperty("except")){if(!Array.isArray(e.except))return"except: array expected";for(let t=0;t<e.except.length;++t)if(!Ee.isString(e.except[t]))return"except: string[] expected"}return null},e.fromObject=function(e){if(e instanceof je.PacketOptionsMessage)return e;let t=new je.PacketOptionsMessage;if(null!=e.flags&&(t.flags=String(e.flags)),e.rooms){if(!Array.isArray(e.rooms))throw TypeError(".PacketOptionsMessage.rooms: array expected");t.rooms=[];for(let n=0;n<e.rooms.length;++n)t.rooms[n]=String(e.rooms[n])}if(e.except){if(!Array.isArray(e.except))throw TypeError(".PacketOptionsMessage.except: array expected");t.except=[];for(let n=0;n<e.except.length;++n)t.except[n]=String(e.except[n])}return t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.rooms=[],n.except=[]),t.defaults&&(n.flags=""),null!=e.flags&&e.hasOwnProperty("flags")&&(n.flags=e.flags),e.rooms&&e.rooms.length){n.rooms=[];for(let t=0;t<e.rooms.length;++t)n.rooms[t]=e.rooms[t]}if(e.except&&e.except.length){n.except=[];for(let t=0;t<e.except.length;++t)n.except[t]=e.except[t]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/PacketOptionsMessage"},e})(),je.StringBytesPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=Ee.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).bytes(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.StringBytesPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.bytes();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!(e.data1&&"number"==typeof e.data1.length||Ee.isString(e.data1))?"data1: buffer expected":null},e.fromObject=function(e){if(e instanceof je.StringBytesPacketDataMessage)return e;let t=new je.StringBytesPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&("string"==typeof e.data1?Ee.base64.decode(e.data1,t.data1=Ee.newBuffer(Ee.base64.length(e.data1)),0):e.data1.length>=0&&(t.data1=e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",t.bytes===String?n.data1="":(n.data1=[],t.bytes!==Array&&(n.data1=Ee.newBuffer(n.data1)))),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=t.bytes===String?Ee.base64.encode(e.data1,0,e.data1.length):t.bytes===Array?Array.prototype.slice.call(e.data1):e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringBytesPacketDataMessage"},e})(),je.StringNumberPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(16).uint32(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.StringNumberPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.uint32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isInteger(e.data1)?"data1: integer expected":null},e.fromObject=function(e){if(e instanceof je.StringNumberPacketDataMessage)return e;let t=new je.StringNumberPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=e.data1>>>0),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=0),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringNumberPacketDataMessage"},e})(),je.StringObjectPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.StringObjectPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.StringObjectPacketDataMessage)return e;let t=new je.StringObjectPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringObjectPacketDataMessage"},e})(),je.StringStringPacketDataMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.data="",e.prototype.data1="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=Ce.create()),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(10).string(e.data),null!=e.data1&&Object.hasOwnProperty.call(e,"data1")&&t.uint32(18).string(e.data1),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof ke||(e=ke.create(e));let n=void 0===t?e.len:e.pos+t,r=new je.StringStringPacketDataMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.data=e.string();break;case 2:r.data1=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof ke||(e=new ke(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.data&&e.hasOwnProperty("data")&&!Ee.isString(e.data)?"data: string expected":null!=e.data1&&e.hasOwnProperty("data1")&&!Ee.isString(e.data1)?"data1: string expected":null},e.fromObject=function(e){if(e instanceof je.StringStringPacketDataMessage)return e;let t=new je.StringStringPacketDataMessage;return null!=e.data&&(t.data=String(e.data)),null!=e.data1&&(t.data1=String(e.data1)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.data="",n.data1=""),null!=e.data&&e.hasOwnProperty("data")&&(n.data=e.data),null!=e.data1&&e.hasOwnProperty("data1")&&(n.data1=e.data1),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/StringStringPacketDataMessage"},e})(),je);class De{static decode(e,t){const n=Ne(t).decode("undefined"==typeof window?e:new Uint8Array(e));return t.fromJSON({...n})}static encode(e){const t=Ne(e.constructor),n=e.toJSON(),r=t.verify(n);if(r)throw Error(r);return t.encode(t.create(n)).finish()}}function Ne(e){return Re[e.DESCRIPTOR_NAME]}class xe extends((0,r.EmitterMixin)()){constructor(e,t,n){super(),this._channelName=e,this._wsGateway=t,this._socket=n,this._subscribeToChannel()}remove(){this._socket.off(this._channelName)}getEventName(e,t=!1){let n="";return t&&(n+="all:"),n+="event",e&&(n+=":"+e),n}_subscribeToChannel(){this._socket.on(this._channelName,(e=>{const t=De.decode(e,Te);this.fire(this.getEventName(t.type,!0),t.data,t.socketId),t.socketId!==this._wsGateway.socketId&&this.fire(this.getEventName(t.type),t.data,t.socketId)}))}}const Ve=xe;class Me extends Pe{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new Me(e.id)}}Me.TYPE="21",Me.READABLE_TYPE_NAME="getUser",Me.DESCRIPTOR_NAME="GetUserMessage",Me.DESCRIPTOR={fields:{id:{type:"string",id:1}}};class Be extends Pe{constructor(e){super(),this.attributes=e}toJSON(){return{attributes:Object.keys(this.attributes).map((e=>({key:e,value:JSON.stringify(this.attributes[e])})))}}static fromJSON(e){const t=e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{});return new Be(t)}}Be.DESCRIPTOR_NAME="GetUserResponse",Be.DESCRIPTOR={fields:{attributes:{rule:"repeated",type:"KeyValueDescriptor",id:1}}};class Ue extends Pe{constructor(e){super(),this.ids=e}toJSON(){return{ids:this.ids}}static fromJSON(e){return new Ue(e.ids)}}Ue.TYPE="22",Ue.READABLE_TYPE_NAME="getManyUsers",Ue.DESCRIPTOR_NAME="GetManyUsersMessage",Ue.DESCRIPTOR={fields:{ids:{id:1,type:"string",rule:"repeated"}}};class Je extends Pe{constructor(e){super(),this.users=e}toJSON(){return{users:this.users.map(qe)}}static fromJSON(e){return new Je(e.users.map(Le))}}function qe(e){return{attributes:Object.keys(e).map((t=>({key:t,value:JSON.stringify(e[t])})))}}function Le(e){return e.attributes.reduce(((e,t)=>(e[t.key]=t.value?JSON.parse(t.value):null,e)),{})}Je.DESCRIPTOR_NAME="GetManyUsersResponse",Je.DESCRIPTOR={fields:{users:{rule:"repeated",type:"UserDescriptor",id:1}}};class Ge{constructor(e={}){this._attributes=new Map;for(const t of Object.keys(e))"id"!==t?(this._attributes.set(t,e[t]),Object.defineProperty(this,t,{enumerable:!0,configurable:!1,get:()=>this._attributes.get(t)})):this.id=e.id}static fromData(e){return new Ge(e)}static async get(e,t){const n=new Me(t);try{const t=await e._sendRequest(Ge._SERVICE,Me.TYPE,De.encode(n)),r=De.decode(t,Be);return new Ge(r.attributes)}catch(e){return new Ge({id:t})}}static async getMany(e,t){const n=new Ue(t);try{const t=await e._sendRequest(Ge._SERVICE,Ue.TYPE,De.encode(n));return De.decode(t,Je).users.map((e=>new Ge(e)))}catch(e){return t.map((e=>new Ge({id:e})))}}}Ge._SERVICE=2;const Ye=Ge;class Fe extends Error{constructor(e,t,n=null,r={}){super("cloud-services-internal-error: "+e),this.context=t,this.code=n,this.data=r,this.name="CKEditorError"}static fromPublicError(e){return new Fe(function(e){let t="cloud-services-error: "+e.message;return e.data&&(t+="\nError data: "+JSON.stringify(e.data)),e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}class He extends Error{constructor(e,t){super(),this.name="CKEditorCloudServicesServerError",this.stack=void 0,this.message=e,this.code=t.code,this.traceId=t.traceId,this.data=t.data}static fromPublicError(e){return new He(function(e){let t="cloud-services-server-error: "+e.message;return e.explanation&&(t+="\nExplanation: "+e.explanation),e.action&&(t+="\nAction: "+e.action),e.traceId&&(t+="\nTraceId: "+e.traceId),e.code&&(t+="\nCode: "+e.code),t}(e),e)}}const ze="function"==typeof ArrayBuffer,Ke=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,We=Object.prototype.toString,$e="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===We.call(Blob),Qe="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===We.call(File);function Xe(e){return ze&&(e instanceof ArrayBuffer||Ke(e))||$e&&e instanceof Blob||Qe&&e instanceof File}function Ze(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(Ze(e[t]))return!0;return!1}if(Xe(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return Ze(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&Ze(e[t]))return!0;return!1}function et(e){const t=[],n=e.data,r=e;return r.data=tt(n,t),r.attachments=t.length,{packet:r,buffers:t}}function tt(e,t){if(!e)return e;if(Xe(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=tt(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=tt(e[r],t));return n}return e}function nt(e,t){return e.data=rt(e.data,t),delete e.attachments,e}function rt(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=rt(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=rt(e[n],t));return e}var st;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(st||(st={}));class ot{constructor(e){this.replacer=e}encode(e){return e.type!==st.EVENT&&e.type!==st.ACK||!Ze(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===st.EVENT?st.BINARY_EVENT:st.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==st.BINARY_EVENT&&e.type!==st.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=et(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}class it extends w{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===st.BINARY_EVENT;n||t.type===st.BINARY_ACK?(t.type=n?st.EVENT:st.ACK,this.reconstructor=new at(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!Xe(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===st[n.type])throw new Error("unknown packet type "+n.type);if(n.type===st.BINARY_EVENT||n.type===st.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!it.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case st.CONNECT:return"object"==typeof t;case st.DISCONNECT:return void 0===t;case st.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case st.EVENT:case st.BINARY_EVENT:return Array.isArray(t)&&("string"==typeof t[0]||"number"==typeof t[0]);case st.ACK:case st.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class at{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=nt(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}class ct extends Pe{constructor(e,t=[],n=[]){super(),this.flags=e,this.rooms=t,this.except=n}toJSON(){var e,t;return{flags:this.flags?JSON.stringify(this.flags):void 0,rooms:(null===(e=this.rooms)||void 0===e?void 0:e.length)?this.rooms:void 0,except:(null===(t=this.except)||void 0===t?void 0:t.length)?this.except:void 0}}static fromJSON(e){return new ct(e.flags&&JSON.parse(e.flags),e.rooms,e.except)}}ct.TYPE=11,ct.DESCRIPTOR_NAME="PacketOptionsMessage",ct.DESCRIPTOR={fields:{flags:{type:"string",id:1},rooms:{type:"string",id:2,rule:"repeated"},except:{type:"string",id:3,rule:"repeated"}}};const dt=!("undefined"==typeof process||!process.versions||!process.versions.node);var ut,lt;(lt=ut||(ut={}))[lt.BUFFER=1]="BUFFER",lt[lt.STRING=2]="STRING",lt[lt.NUMBER=3]="NUMBER",lt[lt.OBJECT=4]="OBJECT";class pt{static getPacketType(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*Math.pow(10,e.length-n-1);return t}static getType(e){if(pt.isBuffer(e))return ut.BUFFER;const t=typeof e;return"string"===t?ut.STRING:"number"===t?ut.NUMBER:ut.OBJECT}static isBuffer(e){return dt&&Buffer.isBuffer(e)||e instanceof ArrayBuffer||e instanceof Uint8Array||this._isBufferView(e)}static _isBufferView(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}class ht extends Pe{static create(e,t){throw new TypeError("Must be implemented in a child class!")}}class ft extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new ft(e.data,e.data1)}static create(e,t){return new ft(e,t)}}ft.TYPE=pt.getPacketType(ut.NUMBER,ut.BUFFER),ft.DESCRIPTOR_NAME="NumberBytesPacketDataMessage",ft.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"bytes",id:2}}};class mt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new mt(e.data,e.data1)}static create(e,t){return new mt(e,t)}}mt.TYPE=pt.getPacketType(ut.STRING,ut.BUFFER),mt.DESCRIPTOR_NAME="StringBytesPacketDataMessage",mt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};class yt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new yt(e.data,e.data1)}static create(e,t){return new yt(e,t)}}yt.TYPE=pt.getPacketType(ut.BUFFER,ut.BUFFER),yt.DESCRIPTOR_NAME="BytesBytesPacketDataMessage",yt.DESCRIPTOR={fields:{data:{type:"bytes",id:1},data1:{type:"bytes",id:2}}};class gt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new gt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new gt(e,t)}}gt.TYPE=pt.getPacketType(ut.STRING,ut.OBJECT),gt.DESCRIPTOR_NAME="StringObjectPacketDataMessage",gt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class bt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new bt(e.data,e.data1&&JSON.parse(e.data1))}static create(e,t){return new bt(e,t)}}bt.TYPE=pt.getPacketType(ut.NUMBER,ut.OBJECT),bt.DESCRIPTOR_NAME="NumberObjectPacketDataMessage",bt.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};class Ot extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1?JSON.stringify(this.data1):void 0}}static fromJSON(e){return new Ot(e.data&&JSON.parse(e.data),e.data1&&JSON.parse(e.data1))}static create(e,t){return new Ot(e,t)}}Ot.TYPE=pt.getPacketType(ut.OBJECT,ut.OBJECT),Ot.DESCRIPTOR_NAME="ObjectObjectPacketDataMessage",Ot.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class wt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data?JSON.stringify(this.data):void 0,data1:this.data1}}static fromJSON(e){return new wt(e.data&&JSON.parse(e.data),e.data1)}static create(e,t){return new wt(e,t)}}wt.TYPE=pt.getPacketType(ut.OBJECT,ut.BUFFER),wt.DESCRIPTOR_NAME="ObjectBufferPacketDataMessage",wt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"bytes",id:2}}};class It extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new It(e.data,e.data1)}static create(e,t){return new It(e,t)}}It.TYPE=pt.getPacketType(ut.STRING,ut.STRING),It.DESCRIPTOR_NAME="StringStringPacketDataMessage",It.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"string",id:2}}};class vt extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new vt(e.data,e.data1)}static create(e,t){return new vt(e,t)}}vt.TYPE=pt.getPacketType(ut.STRING,ut.NUMBER),vt.DESCRIPTOR_NAME="StringNumberPacketDataMessage",vt.DESCRIPTOR={fields:{data:{type:"string",id:1},data1:{type:"uint32",id:2}}};class St extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new St(e.data,e.data1)}static create(e,t){return new St(e,t)}}St.TYPE=pt.getPacketType(ut.NUMBER,ut.NUMBER),St.DESCRIPTOR_NAME="NumberNumberPacketDataMessage",St.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"uint32",id:2}}};class At extends ht{constructor(e,t){super(),this.data=e,this.data1=t}toJSON(){return{data:this.data,data1:this.data1}}static fromJSON(e){return new At(e.data,e.data1)}static create(e,t){return new At(e,t)}}At.TYPE=pt.getPacketType(ut.NUMBER,ut.STRING),At.DESCRIPTOR_NAME="NumberStringPacketDataMessage",At.DESCRIPTOR={fields:{data:{type:"uint32",id:1},data1:{type:"string",id:2}}};const Pt=[ft,mt,yt,gt,bt,Ot,wt,It,vt,St,At].reduce(((e,t)=>(e[t.TYPE]=t,e)),{});class Tt extends Pe{constructor(e,t,n,r="/",s=new ct){super(),this.type=e,this.data=t,this.id=n,this.nsp=r,this.options=s}get packetData(){return void 0===this.data.data&&void 0===this.data.data1?[]:this.data.data&&void 0===this.data.data1?[this.data.data]:[this.data.data,this.data.data1]}toJSON(){const e=De.encode(this.options),t=De.encode(this.data);return{type:this.type+10*this.data.constructor.TYPE,id:this.id,nsp:"/"===this.nsp?void 0:this.nsp,data:t,options:e}}static fromJSON(e){const t=Math.floor(e.type/10);return new Tt(e.type-10*t,De.decode(e.data,Pt[t]),e.id,e.nsp,e.options?De.decode(e.options,ct):new ct)}static create(e,t={}){var n;const r=pt.getPacketType(pt.getType(e.data[0]),pt.getType(null!==(n=e.data[1])&&void 0!==n?n:e.data[0]));return new Tt(e.type,Pt[r].create(e.data[0],e.data[1]),e.id,e.nsp,new ct(t.flags,t.rooms,t.except))}}Tt.TYPE=10,Tt.DESCRIPTOR_NAME="PacketMessage",Tt.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}}};class _t{encode(e,t,n,r="/",s={}){if(t.length>2)throw new Error("PacketParser supports only 2 elements in data");const o={type:e,data:t,id:n,nsp:r};return De.encode(Tt.create(o,s))}decode(e){const t=De.decode(e,Tt);return{packet:{id:t.id,type:t.type,data:t.packetData,nsp:t.nsp},options:{flags:t.options.flags,rooms:t.options.rooms,except:t.options.except}}}}const kt=[st.EVENT,st.ACK,st.BINARY_ACK,st.BINARY_EVENT];class Ct extends ot{constructor(e=new _t){super(),this._packetParser=e}encode(e){if(kt.includes(e.type))try{return[this._packetParser.encode(e.type,e.data,e.id,e.nsp)]}catch(e){console.error("Can not properly serialize or deserialize messages. Check the original error.",{originalError:{message:e.message}})}return super.encode(e)}}class Et extends it{constructor(e=new _t){super(),this._packetParser=e}add(e){if(!pt.isBuffer(e))return super.add(e);let t;try{t=this._packetParser.decode(e).packet}catch(t){return super.add(e)}super.emitReserved("decoded",t)}}class jt{constructor(e,t){this._context=e,this._deferredPromise=function(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return{resolve:e,reject:t,promise:n}}(),this.timeout=setTimeout((()=>this.error(new Fe("Request timeout.",this._context))),t)}get promise(){return this._deferredPromise.promise}response(e){this._deferredPromise.resolve(e)}error(e){this._deferredPromise.reject(e)}}class Rt{constructor(e){this._context=e,this._requests=new Set}async send(e,t=45e3){const n=this._createRequest(t);try{return e(n),await n.promise}finally{this._finishRequest(n)}}errorAll(e){for(const t of this._requests)t.error(e)}waitForAllRequests(e=45e3){return this._waitForRequests(e)}_createRequest(e){const t=new jt(this._context,e);return this._requests.add(t),t}_finishRequest(e){this._requests.delete(e),clearTimeout(e.timeout)}async _waitForRequests(e=5e3,t=0){return!this._requests.size||t>=e/500?Promise.resolve():(await new Promise((e=>{setTimeout(e,500)})),this._waitForRequests(e,t++))}}var Dt,Nt;(Nt=Dt||(Dt={})).DISCONNECTED="disconnected",Nt.CONNECTING="connecting",Nt.CONNECTED="connected";class xt extends((0,r.ObservableMixin)()){constructor(e,t,n={},r=ve,s=Ye.get){if(super(),this._token=t,this._options=n,this._connectionProvider=r,this._userFactory=s,this._requestsManager=new Rt(this),this._channels=new Map,this._connectionAttempt=0,!e)throw new TypeError("Api address must be provided.");if(!this._token)throw new TypeError("Token must be provided.");this._options.requestTimeout||(this._options.requestTimeout=2e4),this._url=Se(e.replace(/^(?!(?:\w+:)?\/\/)/,"https://")),this.set("state",Dt.DISCONNECTED),this.set("socketId",void 0),this.set("me",void 0),this.on("change:state",(async(e,t,n)=>{var r;if(this._debugEvent("ws-gw:change:state",n),n!==xt.STATE_CONNECTED){if(n===xt.STATE_DISCONNECTED)return this._requestsManager.errorAll(new Fe("Not connected.",this))}else try{this.me=await this._userFactory.call(Ye,this,null===(r=this._socketAuth)||void 0===r?void 0:r.userId)}catch(e){}}),{priority:xt._CHANGE_STATE_EVENT_PRIORITY}),this.on("error",((e,t)=>{this._options.onError?this._options.onError(t):console.error(t)}))}get sessionId(){return this.socketId}waitForAllRequests(e){return this._requestsManager.waitForAllRequests(e)}disconnect(){var e;this.state!==Dt.DISCONNECTED&&(null===(e=this._socket)||void 0===e||e.disconnect(),this._socket=void 0,this.state=Dt.DISCONNECTED)}async reconnect(){this._socket||this.state!==Dt.DISCONNECTED||(await this._token.refreshToken(),await this._connect())}static async connect(e,t="local.cs.dev:443/ws-v2",n={},r=ve,s=Ye.get){const o=new xt(t,e,n,r,s);return await o._connect(),o}_sendRequest(e,t,n){if(!e)throw new Fe("`serviceName` must be provided.",this);if(this.state!==xt.STATE_CONNECTED)throw new Fe("Not connected.",this);if(!this._socketAuth||!this._socketAuth.isAuthenticated)throw new Fe("Not authenticated.",this);const r=new ArrayBuffer(n.length+2),s=new Uint8Array(r);return s[0]=e,s[1]=parseInt(t),s.set(n,2),this._emit(1,s)}_getChannel(e,t){const n=""+e+t;return!this._channels.has(n)&&this._socket&&this._channels.set(n,new Ve(n,this,this._socket)),this._channels.get(n)}_connect(){return new Promise(((e,t)=>{const n=this._setupSocket();!this.socketId&&n.io.on("reconnect_error",(()=>{this._debugEvent("reconnect_error"),this._reconnectionAttemptError(t)})),n.once("connect",(async()=>{this._debugEvent("once-connect");try{await this._onConnect(),e()}catch(e){t(e)}})),n.connect()}))}_getPortByProtocol(e){return["http:","ws:"].includes(e)?80:443}_setupSocket(){var e;if(this._socket)return this._socket;const t=this._url.port||this._getPortByProtocol(this._url.protocol),n=(this._url.protocol||"https:")+"//"+this._url.hostname+":"+t,r=this._url.pathname.match(/^\/.*\/ws/)?this._url.pathname.split("/ws")[0]:"",s=this._connectionProvider(n,{parser:{Encoder:Ct,Decoder:Et},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.3.1"},agent:null!==(e=this._options.agent)&&void 0!==e&&e,closeOnBeforeunload:!1});return this.state=Dt.CONNECTING,s.on("connect",(()=>{this._debugEvent("connect"),this.socketId=s.id})),s.on("connect_error",(e=>{this._debugEvent("connect_error",e)})),s.on("disconnect",(()=>{this._debugEvent("disconnect"),this._onDisconnect()})),s.io.on("reconnect",(async()=>{this._debugEvent("reconnect"),await this._onReconnect()})),s.io.on("reconnect_attempt",(e=>{this._debugEvent("reconnect_attempt",e),this.state=Dt.CONNECTING,this._connectionAttempt=e})),s.on("unauthorized",(e=>{this._debugEvent("unauthorized"),this._onUnauthorized(e)})),s.on("authenticationRequest",(async e=>{this._debugEvent("authenticationRequest",e.attempt),await this._onReconnect()})),this._socket=s,s}_emit(e,t){const n=this._socket;return this._requestsManager.send((r=>{n.emit(e,t,((e,t)=>{if(e)return r.error(He.fromPublicError(e));r.response(t)}))}),this._options.requestTimeout)}_addAuthData(e,t){this._socketAuth={environmentId:e,userId:t,isAuthenticated:!0}}_removeAuthData(){this._socketAuth=void 0}async _onConnect(){await this._authenticate(this._token.value),this.state=Dt.CONNECTED;const e=async(e,t,n)=>{this._debugEvent("token:value:change");try{await this._authenticate(n)}catch(e){}};this._token.on("change:value",e),this._socket.io.off("reconnect_error"),this.on("disconnect",(()=>{this._token.off("change:value",e)}))}async _onReconnect(){await this._token.refreshToken(),await this._onConnect()}_onDisconnect(){this.state=Dt.DISCONNECTED,this._connectionAttempt=0,this.fire("disconnect");for(const e of this._channels.values())e.remove();this._channels.clear(),void 0===this._options.autoReconnect||this._options.autoReconnect||(this._socket=void 0)}_debugEvent(e,t){if(!this._isDebugModeEnabled())return;const n=void 0!==t?", data: "+t:"";console.info((new Date).toLocaleString()+" "+e+n)}_reconnectionAttemptError(e){this._connectionAttempt>=2&&(this.disconnect(),e(Fe.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:e}){this._removeAuthData(),this.fire("error",He.fromPublicError(e))}async _authenticate(e){try{this._debugEvent("authenticate:start");const t=await this._emit(2,{token:e});this._debugEvent("authenticate:success","envId: "+t.environmentId+", userId: "+t.userId),this._addAuthData(t.environmentId,t.userId)}catch(e){throw this._debugEvent("authenticate:error",e.message),this._removeAuthData(),e}}_isDebugModeEnabled(){var e;return!!r.global.window.localStorage&&"true"===(null!==(e=r.global.window.localStorage.getItem("csClientDebugMode"))&&void 0!==e?e:"false").toLowerCase()}}xt.STATE_DISCONNECTED=Dt.DISCONNECTED,xt.STATE_CONNECTING=Dt.CONNECTING,xt.STATE_CONNECTED=Dt.CONNECTED,xt._CHANGE_STATE_EVENT_PRIORITY=r.priorities.get("highest")+999999;const Vt=xt;class Mt extends Pe{constructor(e){super(),this.bundleVersion=e}toJSON(){return{bundleVersion:this.bundleVersion}}static fromJSON(e){return new Mt(e.bundleVersion)}}Mt.TYPE="131",Mt.READABLE_TYPE_NAME="isEditorBundleUploaded",Mt.DESCRIPTOR_NAME="IsEditorBundleUploadedMessage",Mt.DESCRIPTOR={fields:{bundleVersion:{type:"string",id:1}}};class Bt extends Pe{constructor(e){super(),this.isUploaded=e}toJSON(){return{isUploaded:this.isUploaded}}static fromJSON(e){return new Bt(e.isUploaded)}}Bt.DESCRIPTOR_NAME="IsEditorBundleUploadedResponse",Bt.DESCRIPTOR={fields:{isUploaded:{type:"bool",id:1}}};class Ut extends((0,r.EmitterMixin)()){static async isBundleUploaded(e,t){const n=new Mt(t);if(e.state!==Dt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);const r=await e._sendRequest(Ut._SERVICE,Mt.TYPE,De.encode(n));return De.decode(r,Bt).isUploaded}}Ut._SERVICE=13;const Jt=Ut;class qt extends Pe{constructor(e,t){super(),this.documentId=e,this.revisionId=t}toJSON(){return{documentId:this.documentId,revisionId:this.revisionId}}static fromJSON(e){return new qt(e.documentId,e.revisionId)}}qt.TYPE="123",qt.READABLE_TYPE_NAME="getRevision",qt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionMessage",qt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},revisionId:{type:"string",id:2}}};class Lt extends Ae{static create(e){return{revisionId:e.id,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.stringify(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds}}static toJSON(e){var t;return{revisionId:e.revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.stringify(e.authorsIds):void 0,diffData:e.diffData,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static fromJSON(e){return{revisionId:(e={...e}).revisionId,name:e.name,creatorId:e.creatorId,authorsIds:e.authorsIds?JSON.parse(e.authorsIds):void 0,diffData:e.diffData,createdAt:e.createdAt?new Date(e.createdAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):void 0,toVersion:e.toVersion,fromVersion:e.fromVersion,isEmptyCurrent:e.isEmptyCurrent}}static toObject(e){return function(e){for(const[t,n]of Object.entries(e))void 0===n&&delete e[t];return e}({id:e.revisionId,name:e.name,creatorId:e.creatorId,createdAt:e.createdAt,fromVersion:e.fromVersion,toVersion:e.toVersion,isEmptyCurrent:e.isEmptyCurrent,diffData:e.diffData?JSON.parse(e.diffData):void 0,attributes:e.attributes,authorsIds:e.authorsIds})}}Lt.DESCRIPTOR_NAME="RevisionDescriptor",Lt.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}}};class Gt extends Pe{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.revisionId=e,this.name=t,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 Lt.toJSON(this)}toObject(){return Lt.toObject(this)}static create(e){return new Gt(e.revisionId,e.name,e.creatorId,e.authorsIds,e.createdAt,e.diffData,e.attributes,e.fromVersion,e.toVersion,e.isEmptyCurrent)}static fromJSON(e){return new Gt(e.revisionId,e.name,e.creatorId,e.authorsIds?JSON.parse(e.authorsIds):void 0,e.createdAt?new Date(e.createdAt):void 0,e.diffData,e.attributes?JSON.parse(e.attributes):void 0,e.fromVersion,e.toVersion,e.isEmptyCurrent)}}Gt.DESCRIPTOR_NAME="RevisionHistoryGetRevisionResponse",Gt.DESCRIPTOR=Lt.DESCRIPTOR;class Yt extends Pe{constructor(e,t,n){super(),this.documentId=e,this.requestId=t,this.revisions=n}toJSON(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Lt.toJSON)}}toObject(){return{documentId:this.documentId,requestId:this.requestId,revisions:this.revisions.map(Lt.toObject)}}static create(e){return new Yt(e.documentId,e.requestId,e.revisions.map(Lt.create))}static fromJSON(e){return new Yt(e.documentId,e.requestId,e.revisions.map(Lt.fromJSON))}}Yt.TYPE="124",Yt.READABLE_TYPE_NAME="updateRevisions",Yt.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsMessage",Yt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};class Ft extends Pe{constructor(e){super(),this.requestId=e}toJSON(){return{requestId:this.requestId}}static fromJSON(e){return new Ft(e.requestId)}}Ft.DESCRIPTOR_NAME="RevisionHistoryUpdateRevisionsResponse",Ft.DESCRIPTOR={fields:{requestId:{type:"uint32",id:1}}};class Ht extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Ht(e.documentId)}}Ht.TYPE="121",Ht.READABLE_TYPE_NAME="connectToRevisionHistory",Ht.DESCRIPTOR_NAME="RevisionHistoryConnectMessage",Ht.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class zt extends Pe{constructor(e,t,n){super(),this.channel=e,this.requestId=t,this.revisions=n}toJSON(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Lt.toJSON)}}toObject(){return{channel:this.channel,requestId:this.requestId,revisions:this.revisions.map(Lt.toObject)}}static fromJSON(e){return new zt(e.channel,e.requestId,e.revisions.map(Lt.fromJSON))}}zt.DESCRIPTOR_NAME="RevisionHistoryConnectResponse",zt.DESCRIPTOR={fields:{channel:{type:"string",id:1},requestId:{type:"uint32",id:2},revisions:{type:"RevisionDescriptor",id:3,rule:"repeated"}}};class Kt extends Pe{constructor(e,t){super(),this.documentId=e,this.requestId=t}toJSON(){return{documentId:this.documentId,requestId:this.requestId}}static fromJSON(e){return new Kt(e.documentId,e.requestId)}}Kt.TYPE="122",Kt.READABLE_TYPE_NAME="reconnectToRevisionHistory",Kt.DESCRIPTOR_NAME="RevisionHistoryReconnectMessage",Kt.DESCRIPTOR={fields:{documentId:{type:"string",id:1},requestId:{type:"uint32",id:2}}};class Wt extends Fe{constructor(e,t){super(e+" Service is not connected.",t)}}class $t extends((0,r.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}connect(e){return this._isConnected?Promise.resolve():this._connect(e,new Ht(this._documentId))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this.fire("disconnected"),this.stopListening())}reconnect(e,t){if(this.isConnected)throw new Fe("Cannot reconnect to already connected service.",e);return this._connect(e,new Kt(this._documentId,t))}async updateRevisions(e,t){const n=Yt.create({documentId:this._documentId,requestId:t,revisions:e}),r=await this._sendRequest(Yt.TYPE,n),{requestId:s}=De.decode(r,Ft);return s}async getRevision(e){const t=new qt(this._documentId,e),n=await this._sendRequest(qt.TYPE,t);return De.decode(n,Gt).toObject()}async _connect(e,t){if(e.state!==Dt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(12,t.constructor.TYPE,De.encode(t)),{channel:r,requestId:s,revisions:o}=De.decode(n,zt).toObject();return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r),this._isConnected=!0,this.fire("connected"),{revisions:o,requestId:s}}_connectToChannel(e,t){this._channel=e._getChannel($t._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(Yt.TYPE),((e,t)=>{const{documentId:n,requestId:r,revisions:s}=De.decode(t,Yt).toObject();this.fire("revisionsUpdated",{documentId:n,requestId:r,revisionsData:s})}))}_onWsGatewayStateChange(e){e===Dt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Wt("Revision History",this);return this._wsGateway._sendRequest(12,e,De.encode(t))}}$t._SERVICE=12;const Qt=$t;class Xt extends Pe{constructor(e,t,n,r={},s=null,o=null){super(),this.id=e,this.documentId=t,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(e){var t;return new Xt(e.id,e.documentId,e.type,JSON.parse(e.data),null!==(t=e.originalSuggestionId)&&void 0!==t?t:null,e.attributes?JSON.parse(e.attributes):null)}}Xt.TYPE="101",Xt.READABLE_TYPE_NAME="addSuggestion",Xt.DESCRIPTOR_NAME="TrackChangesAddSuggestionMessage",Xt.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}}};class Zt extends Pe{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,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 e;return{id:this.id,authorId:this.authorId,type:this.type,createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),data:JSON.stringify(this.data),hasComments:this.hasComments,state:this.state,attributes:JSON.stringify(this.attributes)}}static fromJSON(e){return new Zt(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}Zt.DESCRIPTOR_NAME="TrackChangesAddSuggestionResponse",Zt.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}}};class en extends Pe{constructor(e,t){super(),this.id=e,this.documentId=t}toJSON(){return{id:this.id,documentId:this.documentId}}static fromJSON(e){return new en(e.id,e.documentId)}}en.TYPE="103",en.READABLE_TYPE_NAME="getSuggestion",en.DESCRIPTOR_NAME="TrackChangesGetSuggestionMessage",en.DESCRIPTOR={fields:{id:{type:"string",id:1},documentId:{type:"string",id:2}}};class tn extends Pe{constructor(e,t,n,r,s,o,i={},a=null){super(),this.id=e,this.authorId=t,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(e){return new tn(e.id,e.authorId,e.type,e.createdAt,e.hasComments,e.state,JSON.parse(e.data),e.attributes?JSON.parse(e.attributes):null)}}tn.DESCRIPTOR_NAME="TrackChangesGetSuggestionResponse",tn.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}}};class nn extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new nn(e.documentId)}}nn.TYPE="102",nn.READABLE_TYPE_NAME="getAllSuggestions",nn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionMessage",nn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class rn extends Ae{static toJSON(e){var t;return{...e,data:e.data?JSON.stringify(e.data):e.data,attributes:e.attributes?JSON.stringify(e.attributes):e.attributes,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{...e,data:e.data?JSON.parse(e.data):e.data,attributes:e.attributes?JSON.parse(e.attributes):e.attributes,createdAt:e.createdAt?new Date(e.createdAt):void 0}}}rn.DESCRIPTOR_NAME="SuggestionDescriptor",rn.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"}}};class sn extends Pe{constructor(e,t){super(),this._suggestions=e,this._suggestionsV2=t,this.suggestions=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(rn.toJSON)}}static fromJSON(e){var t,n;return new sn(null===(t=e.suggestions)||void 0===t?void 0:t.map(on),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(rn.fromJSON))}}function on(e){const t=JSON.parse(e);return t.createdAt=t.createdAt?new Date(t.createdAt):void 0,t}sn.DESCRIPTOR_NAME="TrackChangesGetAllSuggestionsResponse",sn.DESCRIPTOR={fields:{suggestions:{type:"string",rule:"repeated",id:1},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:2}}};class an extends Pe{constructor(e,t,n,r,s,o=null){super(),this.id=e,this.documentId=t,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(e){return new an(e.id,e.documentId,e.hasComments,e.isHasCommentsModified,e.state,e.attributes?JSON.parse(e.attributes):null)}}an.TYPE="104",an.READABLE_TYPE_NAME="updateSuggestion",an.DESCRIPTOR_NAME="TrackChangesUpdateSuggestionMessage",an.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}}};class cn extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new cn(e.documentId)}}cn.TYPE="105",cn.READABLE_TYPE_NAME="connectToSuggestions",cn.DESCRIPTOR_NAME="TrackChangesConnectMessage",cn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class dn extends Pe{constructor(e,t,n){super(),this.channel=e,this._suggestions=t,this._suggestionsV2=n,this.suggestions=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,suggestions:null===(e=this._suggestions)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),suggestionsV2:null===(t=this._suggestionsV2)||void 0===t?void 0:t.map(rn.toJSON)}}static fromJSON(e){var t,n;return new dn(e.channel,null===(t=e.suggestions)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.suggestionsV2)||void 0===n?void 0:n.map(rn.fromJSON))}}dn.DESCRIPTOR_NAME="TrackChangesConnectResponse",dn.DESCRIPTOR={fields:{channel:{type:"string",id:1},suggestions:{type:"string",rule:"repeated",id:2},suggestionsV2:{type:"SuggestionDescriptor",rule:"repeated",id:3}}};class un extends Pe{constructor(e,t,n){super(),this.ids=e,this.documentId=t,this.state=n}toJSON(){return{ids:this.ids,documentId:this.documentId,state:this.state}}static fromJSON(e){return new un(e.ids,e.documentId,e.state)}}un.TYPE="106",un.READABLE_TYPE_NAME="batchUpdateSuggestionsState",un.DESCRIPTOR_NAME="TrackChangesBatchUpdateSuggestionsStateMessage",un.DESCRIPTOR={fields:{ids:{type:"string",rule:"repeated",id:1},documentId:{type:"string",id:2},state:{type:"string",id:3}}};class ln extends((0,r.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Dt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);const t=new cn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(10,cn.TYPE,De.encode(t)),r=De.decode(n,dn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,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(e,t,n,r=null,s){const o=new Xt(e,this._documentId,t,n,r,s),i=await this._sendRequest(Xt.TYPE,o);return De.decode(i,Zt)}async get(e,t=1){const n=new en(e,this._documentId);try{const e=await this._sendRequest(en.TYPE,n);return De.decode(e,tn)}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.get(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw He.fromPublicError(n)}var r}async getAll(){const e=new nn(this._documentId),t=await this._sendRequest(nn.TYPE,e),{suggestions:n}=De.decode(t,sn);return n}async update(e,t={}){const{hasComments:n,state:r,attributes:s}=t,o=void 0!==n,i=new an(e,this._documentId,n,o,r,s);await this._sendRequest(an.TYPE,i)}async batchUpdateState(e){const t=new un(e.ids,this._documentId,e.state);await this._sendRequest(un.TYPE,t)}_connectToChannel(e,t){this._channel=e._getChannel(ln._SERVICE,t),this._channel&&this.listenTo(this._channel,this._channel.getEventName(an.TYPE),((e,t)=>{const n=De.decode(t,an);this.fire("suggestionUpdated",n)}))}_onWsGatewayStateChange(e){e===Dt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Wt("Track Changes",this);return this._wsGateway._sendRequest(10,e,De.encode(t))}}ln._SERVICE=10;const pn=ln;class hn extends Pe{constructor(e,t=[]){super(),this.channel=e,this.sockets=t}toJSON(){return{channel:this.channel,sockets:this.sockets.map((e=>({user:e.userId,session:e.id,role:e.role,permissions:e.permissions})))}}static fromJSON(e){return new hn(e.channel,e.sockets.map((e=>({id:e.session,userId:e.user,role:e.role,permissions:e.permissions}))))}}hn.DESCRIPTOR_NAME="SessionsConnectResponse",hn.DESCRIPTOR={fields:{channel:{type:"string",id:1},sockets:{rule:"repeated",type:"SessionsSocketDescriptor",id:2}}};class fn extends Pe{constructor(e,t){super(),this.id=e,this.sessionType=t}toJSON(){return{id:this.id,sessionType:this.sessionType}}static fromJSON(e){return new fn(e.id,e.sessionType)}}fn.TYPE="31",fn.READABLE_TYPE_NAME="getConnectedSockets",fn.DESCRIPTOR_NAME="SessionsConnectMessage",fn.DESCRIPTOR={fields:{id:{type:"string",id:1},sessionType:{type:"uint32",id:2}}};class mn extends Pe{constructor(e,t,n,r){super(),this.id=e,this.userId=t,this.role=n,this.permissions=r}toJSON(){var e,t,n;return{id:this.id,userId:null!==(e=this.userId)&&void 0!==e?e:void 0,role:null!==(t=this.role)&&void 0!==t?t:void 0,permissions:null!==(n=this.permissions)&&void 0!==n?n:void 0}}static fromJSON(e){return new mn(e.id,e.userId,e.role,e.permissions)}}mn.TYPE="32",mn.READABLE_TYPE_NAME="connectSocket",mn.DESCRIPTOR_NAME="SocketConnectMessage",mn.DESCRIPTOR={fields:{id:{type:"string",id:1},userId:{type:"string",id:2},role:{type:"string",id:3},permissions:{rule:"repeated",type:"string",id:4}}};class yn extends Pe{constructor(e){super(),this.id=e}toJSON(){return{id:this.id}}static fromJSON(e){return new yn(e.id)}}yn.TYPE="33",yn.READABLE_TYPE_NAME="disconnectSocket",yn.DESCRIPTOR_NAME="SocketDisconnectMessage",yn.DESCRIPTOR={fields:{id:{type:"string",id:1}}};const gn=class extends r.Collection{constructor(e,t){super({idProperty:"id"}),this._id=e,this._sessionType=t,this._handlers=new Map,this._eventsQueue=[],this._isRunning=!1}async connect(e){this._wsGateway=e,this.stopListening(e,"change:state");const t=new fn(this._id,this._sessionType);let n;try{const e=await this._wsGateway._sendRequest(3,fn.TYPE,De.encode(t));n=De.decode(e,hn)}catch(e){n=new hn(this._id,[])}this._connectToChannel(this._wsGateway,n.channel,this._sessionType);const r=await async function(e,t){const n=t.map((e=>e.userId)),r=n.length?await Ye.getMany(e,n):[];return t.map((e=>{const t={id:e.id,role:e.role,permissions:e.permissions};return t.user=e.userId&&r.find((t=>t.id===e.userId))||new Ye,t}))}(this._wsGateway,n.sockets);for(const e of r)super.add(e);this._connected=!0,this.fire("connected"),this.listenTo(this._wsGateway,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),await this._runQueue()}disconnect(e=!0){if(this._connected){for(this._connected=!1,this._eventsQueue=[];this.length;)super.remove(0);this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._wsGateway&&e&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this.fire("disconnected"),e&&this.stopListening()}}add(e,t){throw new TypeError("The collection is read-only.")}remove(e){throw new TypeError("The collection is read-only.")}_connectToChannel(e,t,n){this._channel=e._getChannel(n,t),this._channel&&(this._addHandler(this._channel,mn.TYPE,(async t=>{const n=De.decode(t,mn);if(-1===this.getIndex(n.id)){const t={id:n.id,role:n.role,permissions:n.permissions};n.userId&&(t.user=await Ye.get(e,n.userId)),super.add(t)}})),this._addHandler(this._channel,yn.TYPE,(e=>{const t=De.decode(e,yn);-1!==this.getIndex(t.id)&&super.remove(t.id)})))}async _onWsGatewayStateChange(e){e===Vt.STATE_DISCONNECTED&&this.disconnect(!1),e===Vt.STATE_CONNECTED&&await this.connect(this._wsGateway)}async _runQueue(){if(this._isRunning||!this._connected)return;let e;for(this._isRunning=!0;e=this._eventsQueue.shift();){const t=this._handlers.get(e.eventName);t&&await t(e.data)}this._isRunning=!1}_addHandler(e,t,n){const r=e.getEventName(t,!0);this.listenTo(e,r,(async(e,t)=>{const n=e.name;this._eventsQueue.push({eventName:n,data:t}),await this._runQueue()})),this._handlers.set(r,n)}};var bn,On=new Uint8Array(16);function wn(){if(!bn&&!(bn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bn(On)}const In=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const vn=function(e){return"string"==typeof e&&In.test(e)};for(var Sn=[],An=0;An<256;++An)Sn.push((An+256).toString(16).substr(1));const Pn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Sn[e[t+0]]+Sn[e[t+1]]+Sn[e[t+2]]+Sn[e[t+3]]+"-"+Sn[e[t+4]]+Sn[e[t+5]]+"-"+Sn[e[t+6]]+Sn[e[t+7]]+"-"+Sn[e[t+8]]+Sn[e[t+9]]+"-"+Sn[e[t+10]]+Sn[e[t+11]]+Sn[e[t+12]]+Sn[e[t+13]]+Sn[e[t+14]]+Sn[e[t+15]]).toLowerCase();if(!vn(n))throw TypeError("Stringified UUID is invalid");return n};const Tn=function(e,t,n){var r=(e=e||{}).random||(e.rng||wn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var s=0;s<16;++s)t[n+s]=r[s];return t}return Pn(r)};class _n{static async getConnectedSessions(e,t,n){const r=new gn(t,n);return await r.connect(e),r}}class kn extends Pe{constructor(e,t,n,r,s=""){super(),this.id=e,this.buffers=t,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(e){return new kn(e.id,e.buffers,e.types,e.bundleVersion,e.lastOperationId)}}kn.TYPE="11",kn.READABLE_TYPE_NAME="connectToDocument",kn.DESCRIPTOR_NAME="CollaborativeEditingConnectMessage",kn.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}}};class Cn{static prepareMetadataForOperations(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];let r=0;for(const s of e)if(0!==s){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r]),r++}else n.push(n[n.length-1]);return n}static removeUnnecessaryMetadata(e,t){if(!(e&&e.length&&t&&t.length))return[];const n=[];for(let r=0;r<e.length;r++)if(0!==e[r]){if(!t[r])throw new Error("Missing metadata for a operation");n.push(t[r])}return n}}class En extends Ae{static toJSON({createdAt:e,...t}){const n={...t};return(null==e?void 0:e.toISOString)&&(n.createdAt=e.toISOString()),n}static fromJSON({createdAt:e,...t}){const n={...t};return e&&(n.createdAt=new Date(e)),n}}En.DESCRIPTOR_NAME="OperationMetadataDescriptor",En.DESCRIPTOR={fields:{userId:{type:"string",id:1},type:{type:"string",id:2},createdAt:{type:"string",id:3}}};class jn extends Pe{constructor(e,t,n,r,s=[],o=""){super(),this.id=e,this.buffers=t,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:Cn.removeUnnecessaryMetadata(this.types,this.metadata).map(En.toJSON),lastOperationId:this.lastOperationId}}static fromJSON(e){return new jn(e.id,e.buffers,e.types,e.baseVersion,Cn.prepareMetadataForOperations(e.types,e.metadata).map(En.fromJSON),e.lastOperationId)}}jn.TYPE="13",jn.READABLE_TYPE_NAME="updateDocument",jn.DESCRIPTOR_NAME="CollaborativeEditingUpdateMessage",jn.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}}};class Rn extends Pe{constructor(e,t,n){super(),this.id=e,this.lastKnowVersion=t,this.bundleVersion=n}toJSON(){return{id:this.id,bundleVersion:this.bundleVersion,lastKnowVersion:this.lastKnowVersion}}static fromJSON(e){return new Rn(e.id,e.lastKnowVersion,e.bundleVersion)}}Rn.TYPE="12",Rn.READABLE_TYPE_NAME="reconnectToDocument",Rn.DESCRIPTOR_NAME="CollaborativeEditingReconnectMessage",Rn.DESCRIPTOR={fields:{id:{type:"string",id:1},bundleVersion:{type:"string",id:2},lastKnowVersion:{type:"uint32",id:3}}};class Dn extends Pe{constructor(e,t=[],n=[],r=[],s="",o=null){super(),this.version=e,this.buffers=t,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 e;return!(null===(e=this.types)||void 0===e?void 0:e.length)}toJSON(){return{version:this.version,buffers:this.buffers,types:this.types,metadata:Cn.removeUnnecessaryMetadata(this.types,this.metadata).map(En.toJSON),lastOperationId:this.lastOperationId,lastOperationAcceptedAt:this.lastOperationAcceptedAt instanceof Date?this.lastOperationAcceptedAt.toISOString():this.lastOperationAcceptedAt}}static fromJSON(e){return new Dn(e.version,e.buffers,e.types,Cn.prepareMetadataForOperations(e.types,e.metadata).map(En.fromJSON),e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}static create(e){return new Dn(e.version,e.buffers,e.types,e.metadata,e.lastOperationId,e.lastOperationAcceptedAt?new Date(e.lastOperationAcceptedAt):null)}}Dn.DESCRIPTOR_NAME="CollaborativeEditingResponse",Dn.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}}};class Nn extends Pe{constructor(e,t,n=[],r=[],s=0,o=[],i=null,a="",c="",d=null){super(),this.channel=e,this.version=t,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 e;return!(null===(e=this.types)||void 0===e?void 0:e.length)&&null===this.initData}toJSON(){var e;return{channel:this.channel,version:this.version,sessionId:this.sessionId,buffers:this.buffers,types:this.types,offset:this.offset,metadata:Cn.removeUnnecessaryMetadata(this.types,this.metadata).map(En.toJSON),initData:null!==(e=this.initData)&&void 0!==e?e:"",isInitialized:"string"==typeof this.initData,lastOperationId:this.lastOperationId,sessionCreatedAt:this.sessionCreatedAt?this.sessionCreatedAt.toISOString():null}}static create(e){return new Nn(e.channel,e.version,e.buffers,e.types,e.offset,e.metadata,e.initData,e.sessionId,e.lastOperationId,e.sessionCreatedAt)}static fromJSON(e){var t;let n=null;return!0===e.isInitialized?n=null!==(t=e.initData)&&void 0!==t?t:"":"boolean"!=typeof e.isInitialized&&e.initData&&(n=e.initData),Nn.create({channel:e.channel,version:e.version,buffers:e.buffers,types:e.types,offset:e.offset,metadata:Cn.prepareMetadataForOperations(e.types,e.metadata).map(En.fromJSON),initData:n,sessionId:e.sessionId,lastOperationId:e.lastOperationId,sessionCreatedAt:e.sessionCreatedAt?new Date(e.sessionCreatedAt):null})}}Nn.DESCRIPTOR_NAME="CollaborativeEditingConnectResponse",Nn.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:En.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}}};class xn extends Pe{constructor(e,t){super(),this.lastDocumentSession=e,this.currentDocumentSession=t}get data(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}toJSON(){var e,t,n,r,s;return{lastDocumentSessionId:null===(e=this.lastDocumentSession)||void 0===e?void 0:e.id,lastDocumentSessionOperationId:null===(t=this.lastDocumentSession)||void 0===t?void 0:t.lastOperationId,currentDocumentSessionId:null===(n=this.currentDocumentSession)||void 0===n?void 0:n.id,currentDocumentSessionVersion:null===(r=this.currentDocumentSession)||void 0===r?void 0:r.version,currentDocumentSessionOperationId:null===(s=this.currentDocumentSession)||void 0===s?void 0:s.lastOperationId}}static fromJSON(e){const t=e.lastDocumentSessionId?{id:e.lastDocumentSessionId,lastOperationId:e.lastDocumentSessionOperationId}:void 0,n=e.currentDocumentSessionId?{lastOperationId:e.currentDocumentSessionOperationId,version:e.currentDocumentSessionVersion,id:e.currentDocumentSessionId}:void 0;return new xn(t,n)}}xn.DESCRIPTOR_NAME="GetDocumentDetailsResponse",xn.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}}};class Vn extends Pe{constructor(e){super(),this.documentId=e}get data(){return{documentId:this.documentId}}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Vn(e.documentId)}}Vn.TYPE="14",Vn.READABLE_TYPE_NAME="getDocumentDetails",Vn.DESCRIPTOR_NAME="GetDocumentDetailsMessage",Vn.DESCRIPTOR={fields:{documentId:{type:"string",id:1},environmentId:{type:"string",id:2}}};class Mn extends((0,r.EmitterMixin)()){constructor(e,t){if(super(),!e)throw new TypeError('Param "bundleVersion" must be provided.');this._id=null!=t?t:Tn(),this._isConnected=!1,this._bundleVersion=e}getId(){return this._id}isConnected(){return this._isConnected}connect(e,t={buffers:[],types:[]},n){const r=new kn(this.getId(),t.buffers,t.types,this._bundleVersion,n);return this._connect(e,r)}reconnect(e,t){if(this.isConnected())throw new Fe("Cannot reconnect to already connected service.",e);return this._connect(e,new Rn(this.getId(),t,this._bundleVersion))}disconnect(){this._isConnected&&(this._isConnected=!1,this._wsGateway&&(this.stopListening(this._wsGateway),this._wsGateway=void 0),this._channel&&(this.stopListening(this._channel),this._channel=void 0),this._connectedSessions&&(this._connectedSessions.disconnect(),this._connectedSessions=void 0),this.fire("disconnected"),this.stopListening())}async getDocumentDetails(){const e=new Vn(this.getId());if(!this._wsGateway)throw new Wt("Collaborative Editing",this);const t=await this._wsGateway._sendRequest(1,Vn.TYPE,De.encode(e));return De.decode(t,xn)}async sendOperations(e,t,n){if(!e||!e.types||!e.types.length)throw new Fe("Cannot send empty update.",this._wsGateway);const r="number"==typeof t?t:parseInt(t);if(!Number.isInteger(r)||r<0)throw new Fe("Base version not provided.",this._wsGateway);const s=new jn(this.getId(),e.buffers,e.types,r,[],n);if(!this._wsGateway||!this._isConnected)throw new Wt("Collaborative Editing",this);const o=await this._wsGateway._sendRequest(1,jn.TYPE,De.encode(s));return De.decode(o,Dn)}async getConnectedSessions(){if(!this._isConnected)throw new Wt("Collaborative Editing",this);return this._connectedSessions||(this._connectedSessions=await _n.getConnectedSessions(this._wsGateway,this._id,1)),this._connectedSessions}static getConnectedSessions(e,t){return _n.getConnectedSessions(e,t,1)}async _connect(e,t){if(this.isConnected())return;if(e.state!==Vt.STATE_CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(1,t.constructor.TYPE,De.encode(t)),r=De.decode(n,Nn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,r.channel),this._isConnected=!0,this.fire("connected"),r}_connectToChannel(e,t){this._channel=e._getChannel(1,t),this.listenTo(this._channel,this._channel.getEventName(jn.TYPE),((e,t)=>{const n=De.decode(t,jn);this.fire("operationsReceived",n.baseVersion,n.data,n.metadata)}))}_onWsGatewayStateChange(e){e===Vt.STATE_DISCONNECTED&&this.disconnect()}}Mn._SERVICE=1;const Bn=Mn;class Un extends Ae{static toJSON(e){var t;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null}}static fromJSON(e){return{...e,createdAt:new Date(e.createdAt),attributes:e.attributes?JSON.parse(e.attributes):null}}}Un.DESCRIPTOR_NAME="CommentDescriptor",Un.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"}}};class Jn extends Ae{static toJSON(e){var t,n,r,s,o;return{...e,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString(),deletedAt:null===(n=e.deletedAt)||void 0===n?void 0:n.toISOString(),resolvedAt:null===(r=e.resolvedAt)||void 0===r?void 0:r.toISOString(),attributes:e.attributes?JSON.stringify(e.attributes):null,context:e.context?JSON.stringify(e.context):e.context,comments:null===(s=e.comments)||void 0===s?void 0:s.map(Un.toJSON),unlinkedAt:null===(o=e.unlinkedAt)||void 0===o?void 0:o.toISOString()}}static fromJSON(e){var t;return{...e,createdAt:e.createdAt?new Date(e.createdAt):void 0,deletedAt:e.deletedAt?new Date(e.deletedAt):void 0,resolvedAt:e.resolvedAt?new Date(e.resolvedAt):void 0,attributes:e.attributes?JSON.parse(e.attributes):null,context:e.context?JSON.parse(e.context):void 0,comments:null===(t=e.comments)||void 0===t?void 0:t.map(Un.fromJSON),unlinkedAt:e.unlinkedAt?new Date(e.unlinkedAt):void 0}}}Jn.DESCRIPTOR_NAME="CommentsThreadDescriptor",Jn.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}}};class qn extends Pe{constructor(e,t,n,r="",s,o="",i=null,a){super(),this.documentId=e,this.commentThreadId=t,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?Jn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new qn(e.documentId,e.commentThreadId,e.content,e.commentId?e.commentId:void 0,e.createdAt?new Date(e.createdAt):void 0,e.userId?e.userId:void 0,e.attributes?JSON.parse(e.attributes):{},e.commentThread?Jn.fromJSON(e.commentThread):void 0)}}qn.TYPE="91",qn.READABLE_TYPE_NAME="addComment",qn.DESCRIPTOR_NAME="CommentsV2AddCommentMessage",qn.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}}};class Ln extends Pe{constructor(e,t,n){super(),this.commentThreadId=e,this.commentId=t,this.createdAt=new Date(n)}toJSON(){return{commentThreadId:this.commentThreadId,commentId:this.commentId,createdAt:this.createdAt.toISOString()}}static fromJSON(e){return new Ln(e.commentThreadId,e.commentId,e.createdAt)}}Ln.DESCRIPTOR_NAME="CommentsV2AddCommentResponse",Ln.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},createdAt:{type:"string",id:3}}};class Gn extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new Gn(e.documentId)}}Gn.TYPE="92",Gn.READABLE_TYPE_NAME="connectToComment",Gn.DESCRIPTOR_NAME="CommentsV2ConnectMessage",Gn.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class Yn extends Pe{constructor(e,t,n){super(),this.channel=e,this._threads=t,this._threadsV2=n,this.threads=(null==n?void 0:n.length)?n:t}toJSON(){var e,t;return{channel:this.channel,threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Jn.toJSON)}}static fromJSON(e){var t,n;return new Yn(e.channel,null===(t=e.threads)||void 0===t?void 0:t.map((e=>JSON.parse(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Jn.fromJSON))}}Yn.DESCRIPTOR_NAME="CommentsV2ConnectResponse",Yn.DESCRIPTOR={fields:{channel:{type:"string",id:1},threads:{type:"string",rule:"repeated",id:2},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:3}}};class Fn extends Pe{constructor(e,t,n){super(),this.documentId=e,this.commentThreadId=t,this.commentId=n}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId,commentId:this.commentId}}static fromJSON(e){return new Fn(e.documentId,e.commentThreadId,e.commentId)}}Fn.TYPE="95",Fn.READABLE_TYPE_NAME="removeComment",Fn.DESCRIPTOR_NAME="CommentsV2RemoveCommentMessage",Fn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},commentId:{type:"string",id:2},documentId:{type:"string",id:3}}};class Hn extends Pe{constructor(e,t){super(),this.documentId=e,this.commentThreadId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new Hn(e.documentId,e.commentThreadId)}}Hn.TYPE="97",Hn.READABLE_TYPE_NAME="removeCommentThread",Hn.DESCRIPTOR_NAME="CommentsV2RemoveCommentThreadMessage",Hn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class zn extends Pe{constructor(e,t,n,r,s=null,o=!1,i){super(),this.documentId=e,this.commentThreadId=t,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?Jn.toJSON(this.commentThread):void 0}}static fromJSON(e){return new zn(e.documentId,e.commentThreadId,e.commentId,e.content,e.attributes?JSON.parse(e.attributes):null,e.isAttributesUpdated,e.commentThread?Jn.fromJSON(e.commentThread):void 0)}}zn.TYPE="96",zn.READABLE_TYPE_NAME="updateComment",zn.DESCRIPTOR_NAME="CommentsV2UpdateCommentMessage",zn.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}}};class Kn extends Pe{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId}}static fromJSON(e){return new Kn(e.commentThreadId,e.documentId)}}Kn.TYPE="93",Kn.READABLE_TYPE_NAME="getComment",Kn.DESCRIPTOR_NAME="CommentsV2GetCommentThreadMessage",Kn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class Wn extends Pe{constructor(e,t,n,r,s,o,i,a,c,d){super(),this.commentThreadId=e,this._comments=t,this._commentsV2=n,this.resolvedBy=s,this.comments=(null==n?void 0:n.length)?n:t,this.createdAt=i?new Date(i):void 0,this.deletedAt="string"==typeof a?new Date(a):a,this.resolvedAt="string"==typeof c?new Date(c):c,this.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 e,t,n,r,s,o;return{commentThreadId:this.commentThreadId,comments:null===(e=this._comments)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),commentsV2:null===(t=this._commentsV2)||void 0===t?void 0:t.map(Un.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(e){var t,n;return new Wn(e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((e=>function(e){const t=JSON.parse(e);return{...t,createdAt:new Date(t.createdAt)}}(e))),null===(n=e.commentsV2)||void 0===n?void 0:n.map(Un.fromJSON),e.attributes?JSON.parse(e.attributes):e.attributes,e.resolvedBy,e.context?JSON.parse(e.context):e.context,e.createdAt,e.deletedAt,e.resolvedAt,e.unlinkedAt)}}Wn.DESCRIPTOR_NAME="CommentsV2GetCommentThreadResponse",Wn.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}}};class $n extends Pe{constructor(e){super(),this.documentId=e}toJSON(){return{documentId:this.documentId}}static fromJSON(e){return new $n(e.documentId)}}$n.TYPE="94",$n.READABLE_TYPE_NAME="getDocumentThreads",$n.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsMessage",$n.DESCRIPTOR={fields:{documentId:{type:"string",id:1}}};class Qn extends Pe{constructor(e,t){super(),this._threads=e,this._threadsV2=t,this.threads=(null==t?void 0:t.length)?t:e}toJSON(){var e,t;return{threads:null===(e=this._threads)||void 0===e?void 0:e.map((e=>JSON.stringify(e))),threadsV2:null===(t=this._threadsV2)||void 0===t?void 0:t.map(Jn.toJSON)}}static fromJSON(e){var t,n;return new Qn(null===(t=e.threads)||void 0===t?void 0:t.map((e=>function(e){var t;const n=JSON.parse(e),r={...n};return n.comments&&(r.comments=null===(t=n.comments)||void 0===t?void 0:t.map((e=>({...e,createdAt:new Date(e.createdAt)})))),r}(e))),null===(n=e.threadsV2)||void 0===n?void 0:n.map(Jn.fromJSON))}}Qn.DESCRIPTOR_NAME="CommentsV2GetDocumentThreadsResponse",Qn.DESCRIPTOR={fields:{threads:{type:"string",rule:"repeated",id:1},threadsV2:{type:"CommentsThreadDescriptor",rule:"repeated",id:2}}};class Xn extends Ae{static toJSON(e){var t;return{commentId:e.commentId,createdAt:null===(t=e.createdAt)||void 0===t?void 0:t.toISOString()}}static fromJSON(e){return{commentId:e.commentId,createdAt:new Date(e.createdAt)}}}Xn.DESCRIPTOR_NAME="CommentThreadAddedCommentDescriptor",Xn.DESCRIPTOR={fields:{commentId:{id:1,type:"string"},createdAt:{id:2,type:"string"}}};class Zn extends Pe{constructor(e,t,n=[]){super(),this.commentThreadId=e,this.comments=n,this.createdAt=new Date(t)}toJSON(){return{commentThreadId:this.commentThreadId,createdAt:this.createdAt.toISOString(),comments:this.comments.map((e=>Xn.toJSON(e)))}}static fromJSON(e){return new Zn(e.commentThreadId,e.createdAt,e.comments.map((e=>Xn.fromJSON(e))))}}Zn.DESCRIPTOR_NAME="CommentsV2AddCommentThreadResponse",Zn.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},createdAt:{type:"string",id:2},comments:{type:"CommentThreadAddedCommentDescriptor",rule:"repeated",id:3}}};class er extends Pe{constructor(e,t,n=[],r,s=null,o=null,i=null,a=null,c=null){super(),this.documentId=e,this.commentThreadId=t,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 e;return{commentThreadId:this.commentThreadId,context:this.context?JSON.stringify(this.context):this.context,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt instanceof Date?this.resolvedAt.toISOString():this.resolvedAt,deletedAt:this.deletedAt instanceof Date?this.deletedAt.toISOString():this.deletedAt,createdAt:this.createdAt instanceof Date?this.createdAt.toISOString():this.createdAt,attributes:this.attributes?JSON.stringify(this.attributes):this.attributes,comments:null===(e=this.comments)||void 0===e?void 0:e.map((e=>Un.toJSON(e)))}}static fromJSON(e){var t;return new er(e.documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>Un.fromJSON({...t,documentId:e.documentId,commentThreadId:e.commentThreadId}))),e.context?JSON.parse(e.context):e.context,e.resolvedBy,e.createdAt?new Date(e.createdAt):void 0,e.resolvedAt?new Date(e.resolvedAt):void 0,e.deletedAt?new Date(e.deletedAt):void 0,e.attributes?JSON.parse(e.attributes):e.attributes)}}er.TYPE="140",er.READABLE_TYPE_NAME="addCommentThread",er.DESCRIPTOR_NAME="CommentsV2AddCommentThreadMessage",er.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}}};class tr extends Pe{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=r?new Date(r):void 0}toJSON(){var e;return{documentId:this.documentId,commentThreadId:this.commentThreadId,resolvedBy:this.resolvedBy,resolvedAt:null===(e=this.resolvedAt)||void 0===e?void 0:e.toISOString()}}static fromJSON(e){return new tr(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}tr.TYPE="142",tr.READABLE_TYPE_NAME="resolveCommentThread",tr.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadMessage",tr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedBy:{type:"string",id:3},resolvedAt:{type:"string",id:4}}};class nr extends Pe{constructor(e,t){super(),this.commentThreadId=e,this.documentId=t}toJSON(){return{documentId:this.documentId,commentThreadId:this.commentThreadId}}static fromJSON(e){return new nr(e.commentThreadId,e.documentId)}}nr.TYPE="141",nr.READABLE_TYPE_NAME="reopenCommentThread",nr.DESCRIPTOR_NAME="CommentsV2ReopenCommentThreadMessage",nr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2}}};class rr extends Pe{constructor(e,t,n,r=null,s=null){super(),this.commentThreadId=e,this.documentId=t,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(e){return new rr(e.commentThreadId,e.documentId,e.context?JSON.parse(e.context):e.context,e.attributes?JSON.parse(e.attributes):null,e.unlinkedAt?new Date(e.unlinkedAt):null)}}rr.TYPE="143",rr.READABLE_TYPE_NAME="updateCommentThread",rr.DESCRIPTOR_NAME="CommentsV2UpdateCommentThreadMessage",rr.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}}};class sr extends Pe{constructor(e,t,n,r){super(),this.commentThreadId=e,this.documentId=t,this.resolvedBy=n,this.resolvedAt=new Date(r)}toJSON(){return{commentThreadId:this.commentThreadId,documentId:this.documentId,resolvedBy:this.resolvedBy,resolvedAt:this.resolvedAt.toISOString()}}static fromJSON(e){return new sr(e.commentThreadId,e.documentId,e.resolvedBy,e.resolvedAt)}}sr.DESCRIPTOR_NAME="CommentsV2ResolveCommentThreadResponse",sr.DESCRIPTOR={fields:{commentThreadId:{type:"string",id:1},documentId:{type:"string",id:2},resolvedAt:{type:"string",id:3},resolvedBy:{type:"string",id:4}}};class or extends((0,r.EmitterMixin)()){constructor(e){super(),this._documentId=e,this._isConnected=!1}get isConnected(){return this._isConnected}async connect(e){if(this._isConnected)return;if(e.state!==Dt.CONNECTED)throw new Fe("WebSocket Gateway is not connected.",e);const t=new Gn(this._documentId);this._wsGateway=e,this.stopListening(e,"change:state");const n=await e._sendRequest(9,Gn.TYPE,De.encode(t)),{channel:r,threads:s}=De.decode(n,Yn);return this.listenTo(e,"change:state",((e,t,n)=>this._onWsGatewayStateChange(n)),{priority:Vt._CHANGE_STATE_EVENT_PRIORITY}),this._connectToChannel(e,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(e,t,n,r){const s=new qn(this._documentId,e,n,t,void 0,void 0,r),o=await this._sendRequest(qn.TYPE,s);return De.decode(o,Ln)}async updateComment(e,t,n,r){const s=void 0!==r,o=new zn(this._documentId,e,t,n,r,s);await this._sendRequest(zn.TYPE,o)}async removeComment(e,t){const n=new Fn(this._documentId,e,t);await this._sendRequest(Fn.TYPE,n)}async removeCommentThread(e){const t=new Hn(this._documentId,e);await this._sendRequest(Hn.TYPE,t)}async addCommentThread(e){var t;const n=new er(this._documentId,e.commentThreadId,null===(t=e.comments)||void 0===t?void 0:t.map((t=>({...t,documentId:this._documentId,commentThreadId:e.commentThreadId}))),e.context,e.resolvedBy,e.createdAt,e.resolvedAt,e.deletedAt,e.attributes),r=await this._sendRequest(er.TYPE,n);return De.decode(r,Zn)}async resolveCommentThread(e){const t=new tr(e,this._documentId),n=await this._sendRequest(tr.TYPE,t);return De.decode(n,sr)}async reopenCommentThread(e){const t=new nr(e,this._documentId);await this._sendRequest(nr.TYPE,t)}async updateCommentThread(e){const t=new rr(e.commentThreadId,this._documentId,e.context,e.attributes,e.unlinkedAt);await this._sendRequest(rr.TYPE,t)}async getCommentThread(e,t=1){const n=new Kn(e,this._documentId);try{const e=await this._sendRequest(Kn.TYPE,n),t=De.decode(e,Wn);return{commentThreadId:t.commentThreadId,comments:t.comments,attributes:t.attributes,context:t.context,resolvedAt:t.resolvedAt,resolvedBy:t.resolvedBy,deletedAt:t.deletedAt,unlinkedAt:t.unlinkedAt}}catch(n){if("CKEditorCloudServicesServerError"===n.name&&"404"===n.code&&t<5)return await(r=100*t,new Promise((e=>{setTimeout(e,r)}))),this.getCommentThread(e,t+1);if("CKEditorCloudServicesServerError"===n.name)throw n;throw He.fromPublicError(n)}var r}async getDocumentThreads(){const e=new $n(this._documentId),t=await this._sendRequest($n.TYPE,e),{threads:n}=De.decode(t,Qn);return{threads:n}}async getConnectedSessions(){if(!this._isConnected)throw new Wt("Comments",this);return this._connectedSessions||(this._connectedSessions=await _n.getConnectedSessions(this._wsGateway,this._documentId,9)),this._connectedSessions}_connectToChannel(e,t){this._channel=e._getChannel(or._SERVICE,t),this._channel&&(this.listenTo(this._channel,this._channel.getEventName(qn.TYPE),((e,t)=>{const n=De.decode(t,qn);this.fire("commentAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(Fn.TYPE),((e,t)=>{const n=De.decode(t,Fn);this.fire("commentRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(zn.TYPE),((e,t)=>{const n=De.decode(t,zn);this.fire("commentUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(Hn.TYPE),((e,t)=>{const n=De.decode(t,Hn);this.fire("commentThreadRemoved",n)})),this.listenTo(this._channel,this._channel.getEventName(er.TYPE),((e,t)=>{const n=De.decode(t,er);this.fire("commentThreadAdded",n)})),this.listenTo(this._channel,this._channel.getEventName(rr.TYPE),((e,t)=>{const n=De.decode(t,rr);this.fire("commentThreadUpdated",n)})),this.listenTo(this._channel,this._channel.getEventName(tr.TYPE),((e,t)=>{const n=De.decode(t,tr);this.fire("commentThreadResolved",n)})),this.listenTo(this._channel,this._channel.getEventName(nr.TYPE),((e,t)=>{const n=De.decode(t,nr);this.fire("commentThreadReopened",n)})))}_onWsGatewayStateChange(e){e===Dt.DISCONNECTED&&this.disconnect()}_sendRequest(e,t){if(!this._wsGateway||!this._isConnected)throw new Wt("Comments",this);return this._wsGateway._sendRequest(9,e,De.encode(t))}}or._SERVICE=9;const ir=or;new Map([[kn.TYPE,kn.READABLE_TYPE_NAME],[Rn.TYPE,Rn.READABLE_TYPE_NAME],[jn.TYPE,jn.READABLE_TYPE_NAME],[Vn.TYPE,Vn.READABLE_TYPE_NAME],[qn.TYPE,qn.READABLE_TYPE_NAME],[Gn.TYPE,Gn.READABLE_TYPE_NAME],[Kn.TYPE,Kn.READABLE_TYPE_NAME],[$n.TYPE,$n.READABLE_TYPE_NAME],[Fn.TYPE,Fn.READABLE_TYPE_NAME],[Hn.TYPE,Hn.READABLE_TYPE_NAME],[zn.TYPE,zn.READABLE_TYPE_NAME],[fn.TYPE,fn.READABLE_TYPE_NAME],[mn.TYPE,mn.READABLE_TYPE_NAME],[yn.TYPE,yn.READABLE_TYPE_NAME],[Xt.TYPE,Xt.READABLE_TYPE_NAME],[en.TYPE,en.READABLE_TYPE_NAME],[an.TYPE,an.READABLE_TYPE_NAME],[nn.TYPE,nn.READABLE_TYPE_NAME],[cn.TYPE,cn.READABLE_TYPE_NAME],[un.TYPE,un.READABLE_TYPE_NAME],[Me.TYPE,Me.READABLE_TYPE_NAME],[Ue.TYPE,Ue.READABLE_TYPE_NAME],[Ht.TYPE,Ht.READABLE_TYPE_NAME],[Kt.TYPE,Kt.READABLE_TYPE_NAME],[qt.TYPE,qt.READABLE_TYPE_NAME],[Yt.TYPE,Yt.READABLE_TYPE_NAME],[Mt.TYPE,Mt.READABLE_TYPE_NAME],[tr.TYPE,tr.READABLE_TYPE_NAME],[nr.TYPE,nr.READABLE_TYPE_NAME],[rr.TYPE,rr.READABLE_TYPE_NAME],[er.TYPE,er.READABLE_TYPE_NAME]]);const ar=cr;function cr(e,t){const n=dr();return(cr=function(e,t){return n[e-=249]})(e,t)}function dr(){const e=["connect","_isBrowserOffline","connection","21SIvWMw","pluginName","1269wOJorI","all","plugins","DISCONNECTED","7548924TXBqAQ","isInReconnectionStack","_reconnectionStack","destroy","CONNECTING","initialReconnectionInterval","init","_domEmitter","showWarning","function","42968541BofFDS","state","define","websocketgateway-plugin-already-registered","limitExceeded","constructor","code","cloudservices-init","13KBxlXp","requires","addToReconnectionStack","disconnect","offline","websocketgateway-invalid-plugin-interface","error","websocketgateway-missing-token","get","cloudServices.requestTimeout","WebSocketGateway","then","63238pMjGbv","add","91270fySEZW","config","reconnect","stopListening","CloudServices","context","749572rCMxMY","_reconnect","online","real-time-collaboration","token","Connected users limit exceeded","create","140780wtumVc","CONNECTED","144fWPFth","delete","set","webSocketUrl","bind","websocketgateway-missing-websocket-url","cloudServices.connectionTimeout","5317300cfbshz","cloudservices-reconnection-error","from","removeFromReconnectionStack","connected","_shouldPluginsReconnect","catch","listenTo","has","change:me","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."];return(dr=function(){return e})()}!function(e,t){const n=cr,r=e();for(;;)try{if(807315===parseInt(n(320))/1*(-parseInt(n(273))/2)+-parseInt(n(296))/3*(parseInt(n(266))/4)+-parseInt(n(282))/5+-parseInt(n(302))/6+-parseInt(n(258))/7*(-parseInt(n(275))/8)+parseInt(n(298))/9*(parseInt(n(260))/10)+parseInt(n(312))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(dr);class ur extends n.ContextPlugin{static get[ar(321)](){return[ar(264),s.Notification]}static get[ar(297)](){return ar(256)}constructor(e){const t=ar;super(e),this[t(277)](t(313),Dt[t(274)]),this[t(277)](t(294),!1),this[t(304)]=new Set,this[t(287)]=!1,this[t(309)]=Object[t(272)](r.DomEmitterMixin)}[ar(308)](){const e=ar,t=this[e(265)],n=t[e(300)][e(254)](e(264)),o=t[e(300)][e(254)](s.Notification);if(!n[e(270)])throw new r.CKEditorError(e(253),this);if(!n[e(278)])throw new r.CKEditorError(e(280),this);return this[e(309)][e(289)](window,e(250),(()=>this[e(294)]=!0)),this[e(309)][e(289)](window,e(268),(()=>this[e(294)]=!1)),this[e(265)][e(261)][e(314)](e(281),10),this[e(265)][e(261)][e(314)](e(255),20),ur[e(256)][e(293)](n[e(270)],n[e(278)],{timeout:1e3*this[e(265)][e(261)][e(254)](e(281)),requestTimeout:1e3*this[e(265)][e(261)][e(254)](e(255))})[e(257)]((t=>{const n=e;if(this[n(295)]=t,this[n(279)](n(313)).to(t,n(313),this,n(294),((e,t)=>(n(286)!==e&&(this[n(287)]=!0),t||e!==Dt[n(274)]?Dt[n(301)]:this[n(313)]==Dt[n(301)]&&this[n(287)]?(this[n(287)]=!1,this[n(267)](),Dt[n(306)]):Dt[n(274)]))),this[n(295)].on(n(252),((e,t)=>{const s=n;if(s(316)!==t[s(318)])throw console[s(252)](t),new r.CKEditorError(s(319),null,{originalError:t});o[s(310)](s(292),{title:s(271),namespace:s(269)})})),!t.me)return new Promise((e=>t.on(n(291),e)))}))[e(288)]((t=>{const n=e;throw console[n(252)](t),new r.CKEditorError(n(319),null,{originalError:t})}))}[ar(322)](e){const t=ar;if(t(311)!=typeof e[t(262)])throw new r.CKEditorError(t(251),this);if(this[t(303)](e))throw new r.CKEditorError(t(315),this,{name:e[t(317)][t(297)]});this[t(304)][t(259)](e)}[ar(285)](e){const t=ar;this[t(304)][t(276)](e)}[ar(303)](e){const t=ar;return this[t(304)][t(290)](e)}[ar(267)](){const e=ar;return this[e(295)][e(262)]()[e(257)]((()=>Promise[e(299)](Array[e(284)](this[e(304)],(t=>t[e(262)]())))))[e(257)]((()=>this[e(313)]=Dt[e(274)]))[e(288)]((t=>{const n=e;throw console[n(252)](t),new r.CKEditorError(n(283),this[n(265)])}))}[ar(305)](){const e=ar;this[e(295)]&&this[e(295)][e(249)](),this[e(313)]=Dt[e(301)],this[e(309)][e(263)](),super[e(305)]()}}ur[ar(256)]=Vt,ur[ar(307)]=1e3;const lr=ur;var pr=__webpack_require__(211);const hr=mr;function fr(){const e=["addUser","fire","add","forEach","orderNumber","register","sessions-unregister-not-exist","defineMe","_registeredSessions","getUserBySessionId","connection","allConnectedUsers","delete","state","4621092ayLJvO","init","_handleSessionAdd","_handleSessionRemove","sessionAdd:","remove","1912670yWVFPn","listenTo","pluginName","context","role","_users","Sessions","903728ippBOi","sessions-register-already-registered","has","unregister","535614FoRSrB","getUserRole","391176eBWmuN","18eLkxkN","352kIbZyP","1811740jaIXky","stopListening","plugins","_uniqueUsersCount","set","120575zysRzS","getUser","clear","_createUser","mySessionId","assign","get","channelConnectedUsers","values","size","14fsnMER","requires","change:state","channelSessions","sessionId","getUserSessions","isMe","user","connected"];return(fr=function(){return e})()}function mr(e,t){const n=fr();return(mr=function(e,t){return n[e-=340]})(e,t)}!function(e,t){const n=mr,r=e();for(;;)try{if(570594===-parseInt(n(340))/1+parseInt(n(360))/2*(parseInt(n(342))/3)+parseInt(n(396))/4+parseInt(n(345))/5+-parseInt(n(383))/6+parseInt(n(350))/7*(parseInt(n(344))/8)+parseInt(n(343))/9*(-parseInt(n(389))/10))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(fr);class yr extends n.ContextPlugin{static get[hr(391)](){return hr(395)}static get[hr(361)](){return[lr,pr.Users]}constructor(e){const t=hr;super(e),this[t(363)]=new Map,this[t(357)]=new Map,this[t(380)]=new r.Collection,this[t(377)]=new Map,this[t(348)]=0,this[t(394)]=this[t(392)][t(347)][t(356)](pr.Users)}[hr(384)](){const e=hr,t=this[e(392)][e(347)][e(356)](lr);this[e(390)](t,e(362),((t,n,r)=>{const s=e;if(s(368)!==r)this[s(363)][s(372)]((e=>e[s(352)]())),this[s(357)][s(372)]((e=>e[s(352)]())),this[s(380)][s(352)]();else for(const[e,t]of this[s(377)])for(const n of t)this[s(385)](e,n)})),this[e(353)](t[e(379)].me,!0)}[hr(374)](e,t){const n=hr;if(this[n(377)][n(398)](e))throw new r.CKEditorError(n(397),null,{channelId:e});this[n(377)][n(349)](e,t),this[n(363)][n(349)](e,new r.Collection),this[n(357)][n(349)](e,new r.Collection),this[n(390)](t,n(371),((t,r)=>this[n(385)](e,r))),this[n(390)](t,n(388),((t,r)=>this[n(386)](e,r)));for(const r of t)this[n(385)](e,r)}[hr(399)](e){const t=hr;if(!this[t(377)][t(398)](e))throw new r.CKEditorError(t(375),null,{channelId:e});const n=this[t(377)][t(356)](e);this[t(346)](n);for(const r of n)t(368)===this[t(392)][t(347)][t(356)](lr)[t(382)]&&this[t(386)](e,r);this[t(377)][t(381)](e),this[t(363)][t(381)](e),this[t(357)][t(381)](e)}get[hr(354)](){const e=hr;return this[e(392)][e(347)][e(356)](lr)[e(379)][e(364)]}[hr(378)](e){const t=hr;for(const n of this[t(363)][t(358)]())for(const r of n)if(r.id===e)return r[t(367)]}[hr(365)](e,t){const n=hr,r=t?[this[n(363)][n(356)](t)]:this[n(363)][n(358)](),s=new Set;for(const t of r)for(const r of t)r[n(367)].id===e.id&&s[n(371)](r.id);return s}[hr(341)](e){const t=hr;for(const n of this[t(363)][t(358)]())for(const r of n)if(r[t(367)]===e)return r[t(393)]}[hr(385)](e,t){const n=hr;if(n(368)!==this[n(392)][n(347)][n(356)](lr)[n(382)])return;const r=t[n(367)],s=this[n(394)][n(351)](r.id)||this[n(353)](r),o=Object[n(355)]({},t,{user:s});this[n(363)][n(356)](e)[n(371)](o);const i=this[n(357)][n(356)](e);i[n(398)](s.id)||i[n(371)](s),this[n(380)][n(398)](s.id)||this[n(380)][n(371)](s,s[n(366)]?0:void 0),this[n(370)](n(387)+e,{channelId:e,session:o})}[hr(386)](e,t){const n=hr;if(n(368)!==this[n(392)][n(347)][n(356)](lr)[n(382)])return;const r=this[n(357)][n(356)](e),s=t[n(367)];s.id&&(this[n(363)][n(356)](e)[n(388)](t.id),r[n(398)](s.id)&&!this[n(365)](s,e)[n(359)]&&r[n(388)](s.id),this[n(380)][n(356)](s.id)&&!this[n(365)](s)[n(359)]&&this[n(380)][n(388)](s.id))}[hr(353)](e,t){const n=hr,r=this[n(394)][n(369)](e);return t&&this[n(394)][n(376)](e.id),r[n(373)]=this[n(348)]++,r}}var gr=__webpack_require__(673),br=__webpack_require__.n(gr),Or=__webpack_require__(535),wr={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};br()(Or.A,wr);Or.A.locals;const Ir=vr;function vr(e,t){const n=Pr();return(vr=function(e,t){return n[e-=434]})(e,t)}!function(e,t){const n=vr,r=e();for(;;)try{if(311833===parseInt(n(550))/1*(parseInt(n(471))/2)+-parseInt(n(454))/3+parseInt(n(493))/4+-parseInt(n(494))/5*(parseInt(n(518))/6)+-parseInt(n(445))/7*(parseInt(n(527))/8)+parseInt(n(473))/9*(parseInt(n(442))/10)+parseInt(n(506))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Pr);class Sr extends n.Plugin{constructor(){const e=vr;super(...arguments),this[e(558)]=new((0,r.DomEmitterMixin)())}static get[Ir(556)](){return[yr]}static get[Ir(516)](){return Ir(434)}[Ir(468)](){const e=Ir,t=this[e(446)],n=t[e(531)][e(461)](yr);t[e(436)][e(447)](e(553))[e(535)]({model:e(460),view:(r,{writer:s})=>function(t,n,r,s){const o=e,i=t[o(554)][o(536)](":")[2],a=r[o(465)](i);if(!a||i===r[o(483)])return;if(!s[o(544)][o(456)][o(502)](t[o(479)][o(541)],o(522)))return;const c={class:o(529)+a[o(513)][o(524)](),"data-name":a[o(557)],"data-session-id":i},d=s[o(544)][o(459)][o(461)](t[o(554)])[o(503)](),u=d[o(475)],l=s[o(544)][o(456)];if(u&&l[o(548)](u)&&l[o(511)](u)&&!s[o(544)][o(459)][o(461)](o(561)+i)[o(555)]()[o(504)])return;const p=d[o(467)];return s[o(544)][o(456)][o(545)](p)&&!s[o(544)][o(449)](p)&&(c[o(517)]=!1),function(e,t,n){const r=o,s=e[r(472)](r(491),t);return e[r(534)](r(543),!0,s),s[r(514)]=function(e){const t=r,s=this[t(463)](e);return s[t(441)]=t(563)+n[t(557)]+t(485),s[t(474)](t(562),(()=>{const e=t;s[e(540)][e(455)](e(453))})),s[t(474)](t(450),(()=>{const e=t;s[e(540)][e(507)](e(453))})),s},s[r(462)]=function(e){const t=r;return!(!this[t(482)](t(543))||!e[t(482)](t(543))||this[t(487)](t(512))!=e[t(487)](t(512)))},s}(n,c,a)}(r,s,n,t)}),t[e(436)][e(447)](e(553))[e(532)]({model:e(542),view:t=>function(t,n){const r=e,s=t[r(554)][r(536)](":")[2];if(s===n[r(483)])return null;const o=n[r(465)](s);return o?{id:s,classes:[r(508),o[r(513)][r(464)]()],attributes:{"data-session-id":s},priority:2e3+o[r(497)]}:{id:s,classes:[]}}(t,n)}),function(t){const n=e,r=t[n(544)],s=new Map,i=t[n(531)][n(461)](yr);r[n(459)].on(n(560),((e,a,c,d)=>{const u=n;if(!d&&s[u(461)](a[u(557)]))return s[u(461)](a[u(557)])[u(448)](),void s[u(526)](a[u(557)]);const l=a[u(557)][u(536)](":")[2];if(l===i[u(483)])return;const p=u(458)+l;r[u(459)][u(486)](p)&&t[u(525)][u(538)](p),a.on(u(539),((e,t,n)=>{const i=u;if(i(520)!=t[i(489)][i(476)]&&i(520)==a[i(555)]()[i(489)][i(476)]&&!s[i(486)](a[i(557)])){const e=r[i(456)][i(528)](n[i(492)]);if(e){const t=o.LiveRange[i(533)](e);s[i(444)](a[i(557)],t),t.on(i(539),((e,n,o)=>{const c=i;if(c(520)==t[c(489)][c(476)]){const e=r[c(456)][c(528)](o[c(492)]);e?(t[c(541)]=e[c(541)],t[c(500)]=e[c(500)]):(s[c(526)](a[c(557)]),t[c(448)]())}}))}}}))})),r[n(477)].on(n(478),(()=>{const e=n;s[e(521)]>0&&r[e(488)]({isUndoable:!1},(t=>{const n=e;for(const[e,o]of s)n(520)==r[n(459)][n(461)](e)[n(555)]()[n(489)][n(476)]&&(Ar(e[n(536)](":")[2],o[n(559)](),r,t),o[n(448)]());s[n(437)]()}))}))}(t),this[e(558)][e(496)](r.global[e(477)],e(438),((n,{key:r})=>{const s=e;s(443)===r&&function(e){const t=s;e[t(525)][t(466)][t(478)]((n=>{const r=t;for(const t of e[r(544)][r(459)]){if(!t[r(557)][r(452)](r(460)))continue;const s=e[r(525)][r(490)][r(537)](t[r(557)]);if(s)for(const e of s)n[r(505)](r(453),e)}}))}(t)}),{useCapture:!0})}[Ir(564)](){const e=Ir,t=this[e(446)],n=t[e(519)][e(461)](e(495));n&&t[e(544)].on(e(523),((r,s)=>{const o=e,i=s[0];if(o(547)!=i[o(435)]||!i[o(557)][o(452)](o(509)))return;const a=i[o(481)];n[o(498)][o(486)](a)&&(i[o(501)]=i[o(499)]?t[o(544)][o(551)](i[o(499)][o(541)],i[o(499)][o(500)]):null)}),{priority:e(484)})}[Ir(515)](){const e=Ir;return this[e(558)][e(546)](),super[e(515)]()}[Ir(549)](){const e=Ir,t=this[e(446)],n=t[e(544)][e(477)],r=t[e(531)][e(461)](yr);t[e(544)][e(488)]({isUndoable:!1},(s=>{const o=e,i=o(561)+r[o(483)],a=o(458)+r[o(483)],c=t[o(544)][o(459)][o(486)](i);t[o(525)][o(466)][o(469)]?Ar(r[o(483)],n[o(470)][o(457)](),t[o(544)],s):c&&(s[o(510)](i),s[o(510)](a))}))}}function Ar(e,t,n,r){const s=Ir,o=s(561)+e,i=s(458)+e,a=t[s(439)]();let c=t[s(541)];a&&a.is(s(480),s(530))&&(c=function(e,t){const n=s;for(const r of e[n(440)]())if(t[n(456)][n(502)](r,n(522)))return r}(t,n),t=r[s(551)](c));const d=r[s(551)](c);n[s(459)][s(486)](o)?(r[s(552)](o,{range:t}),r[s(552)](i,{range:d})):(r[s(451)](o,{range:t,usingOperation:!0}),r[s(451)](i,{range:d,usingOperation:!0}))}function Pr(){const e=["getContainedElement","getPositions","innerHTML","140qWRiIW","Escape","set","14WaviPQ","editor","for","detach","hasContent","mouseleave","addMarker","startsWith","ck-user__marker_hovered","1183062WNiEaZ","add","schema","getFirstRange","user:position:","markers","user:position","get","isSimilar","toDomElement","getSelectionClass","getUserBySessionId","view","parent","init","hasDomSelection","selection","1159212QKRXgv","createUIElement","281439wtkEar","addEventListener","nodeAfter","rootName","document","change","markerRange","element","batch","getCustomProperty","mySessionId","highest","</span>⁠","has","getAttribute","enqueueChange","root","mapper","span","deletionPosition","1051748VTpDZc","1824310ctKFmH","undo","listenTo","orderNumber","_createdBatches","oldRange","end","newRange","checkChild","getStart","isCollapsed","removeClass","3991218vkKdUL","remove","ck-user__selection","user:","removeMarker","isInline","data-session-id","color","render","destroy","pluginName","contenteditable","6dfZhvz","commands","$graveyard","size","$text","applyOperation","getMarkerClass","editing","delete","2288504xgJejm","getNearestSelectionRange","ck-user__marker ","tableCell","plugins","markerToHighlight","fromRange","setCustomProperty","markerToElement","split","markerNameToElements","reconvertMarker","change:range","classList","start","user:range","userPositionMarker","model","isLimit","stopListening","marker","isObject","createUserMarkerOperations","1jYsdPK","createRange","updateMarker","editingDowncast","markerName","getRange","requires","name","_domEmitter","toRange","update:user:range","user:range:","mouseenter",'⁠<span class="ck-user__marker-line" contenteditable="false"><span class="ck-user__marker-dot"></span></span><span class="ck-user__marker-tooltip" contenteditable="false" spellcheck="false">',"afterInit","UserMarkers","type","conversion","clear","keydown"];return(Pr=function(){return e})()}function Tr(e,t,n){const r=e.t;switch(t){case"PENDING_ACTION_SENDING_DATA":return r({string:"Sending data to the server.",id:"PENDING_ACTION_SENDING_DATA"});case"The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.":return r("The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.");case"The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.":return r("The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.");case"The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.":return r("The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.");case"The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.":return r("The last saved version of the document does not match the local version. To not lose your content save it locally and refresh the editor.");case"Synchronization issue":return r("Synchronization issue");case"PENDING_ACTION_REVISION_HISTORY":return r({string:"Unsaved change in revision history.",id:"PENDING_ACTION_REVISION_HISTORY"});case"CONNECTED_USERS":return r({string:"1 connected user (me)",plural:"%0 connected users",id:"CONNECTED_USERS"},n);default:return""}}const _r=_e.Reader,kr=_e.Writer,Cr=_e.util,Er=_e.roots.default||(_e.roots.default={}),jr=Er.AttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.range=null,e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.range&&Object.hasOwnProperty.call(e,"range")&&Er.Range.encode(e.range,t.uint32(10).fork()).ldelim(),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.AttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.range=Er.Range.decode(e,e.uint32());break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.range&&e.hasOwnProperty("range")){let t=Er.Range.verify(e.range);if(t)return"range."+t}return null!=e.key&&e.hasOwnProperty("key")&&!Cr.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!Cr.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!Cr.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.AttributeOperation)return e;let t=new Er.AttributeOperation;if(null!=e.range){if("object"!=typeof e.range)throw TypeError(".AttributeOperation.range: object expected");t.range=Er.Range.fromObject(e.range)}return null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.range=null,n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.range&&e.hasOwnProperty("range")&&(n.range=Er.Range.toObject(e.range,t)),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/AttributeOperation"},e})(),Rr=Er.InsertOperation=(()=>{function e(e){if(this.nodes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.nodes=Cr.emptyArray,e.prototype.shouldReceiveAttributes=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=kr.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&Er.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.nodes&&e.nodes.length)for(let n=0;n<e.nodes.length;++n)Er.Element.encode(e.nodes[n],t.uint32(18).fork()).ldelim();return null!=e.shouldReceiveAttributes&&Object.hasOwnProperty.call(e,"shouldReceiveAttributes")&&t.uint32(24).bool(e.shouldReceiveAttributes),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.InsertOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=Er.Position.decode(e,e.uint32());break;case 2:r.nodes&&r.nodes.length||(r.nodes=[]),r.nodes.push(Er.Element.decode(e,e.uint32()));break;case 3:r.shouldReceiveAttributes=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=Er.Position.verify(e.position);if(t)return"position."+t}if(null!=e.nodes&&e.hasOwnProperty("nodes")){if(!Array.isArray(e.nodes))return"nodes: array expected";for(let t=0;t<e.nodes.length;++t){let n=Er.Element.verify(e.nodes[t]);if(n)return"nodes."+n}}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&"boolean"!=typeof e.shouldReceiveAttributes?"shouldReceiveAttributes: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.InsertOperation)return e;let t=new Er.InsertOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".InsertOperation.position: object expected");t.position=Er.Position.fromObject(e.position)}if(e.nodes){if(!Array.isArray(e.nodes))throw TypeError(".InsertOperation.nodes: array expected");t.nodes=[];for(let n=0;n<e.nodes.length;++n){if("object"!=typeof e.nodes[n])throw TypeError(".InsertOperation.nodes: object expected");t.nodes[n]=Er.Element.fromObject(e.nodes[n])}}return null!=e.shouldReceiveAttributes&&(t.shouldReceiveAttributes=Boolean(e.shouldReceiveAttributes)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.nodes=[]),t.defaults&&(n.position=null,n.shouldReceiveAttributes=!1,n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=Er.Position.toObject(e.position,t)),e.nodes&&e.nodes.length){n.nodes=[];for(let r=0;r<e.nodes.length;++r)n.nodes[r]=Er.Element.toObject(e.nodes[r],t)}return null!=e.shouldReceiveAttributes&&e.hasOwnProperty("shouldReceiveAttributes")&&(n.shouldReceiveAttributes=e.shouldReceiveAttributes),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/InsertOperation"},e})(),Dr=Er.MarkerOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.oldRange=null,e.prototype.newRange=null,e.prototype.affectsData=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.oldRange&&Object.hasOwnProperty.call(e,"oldRange")&&Er.Range.encode(e.oldRange,t.uint32(18).fork()).ldelim(),null!=e.newRange&&Object.hasOwnProperty.call(e,"newRange")&&Er.Range.encode(e.newRange,t.uint32(26).fork()).ldelim(),null!=e.affectsData&&Object.hasOwnProperty.call(e,"affectsData")&&t.uint32(32).bool(e.affectsData),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.MarkerOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.name=e.string();break;case 2:r.oldRange=Er.Range.decode(e,e.uint32());break;case 3:r.newRange=Er.Range.decode(e,e.uint32());break;case 4:r.affectsData=e.bool();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!Cr.isString(e.name))return"name: string expected";if(null!=e.oldRange&&e.hasOwnProperty("oldRange")){let t=Er.Range.verify(e.oldRange);if(t)return"oldRange."+t}if(null!=e.newRange&&e.hasOwnProperty("newRange")){let t=Er.Range.verify(e.newRange);if(t)return"newRange."+t}return null!=e.affectsData&&e.hasOwnProperty("affectsData")&&"boolean"!=typeof e.affectsData?"affectsData: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.MarkerOperation)return e;let t=new Er.MarkerOperation;if(null!=e.name&&(t.name=String(e.name)),null!=e.oldRange){if("object"!=typeof e.oldRange)throw TypeError(".MarkerOperation.oldRange: object expected");t.oldRange=Er.Range.fromObject(e.oldRange)}if(null!=e.newRange){if("object"!=typeof e.newRange)throw TypeError(".MarkerOperation.newRange: object expected");t.newRange=Er.Range.fromObject(e.newRange)}return null!=e.affectsData&&(t.affectsData=Boolean(e.affectsData)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.name="",n.oldRange=null,n.newRange=null,n.affectsData=!1,n.wasUndone=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.oldRange&&e.hasOwnProperty("oldRange")&&(n.oldRange=Er.Range.toObject(e.oldRange,t)),null!=e.newRange&&e.hasOwnProperty("newRange")&&(n.newRange=Er.Range.toObject(e.newRange,t)),null!=e.affectsData&&e.hasOwnProperty("affectsData")&&(n.affectsData=e.affectsData),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MarkerOperation"},e})(),Nr=Er.MergeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.targetPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&Er.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&Er.Position.encode(e.targetPosition,t.uint32(18).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&Er.Position.encode(e.graveyardPosition,t.uint32(26).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(32).uint32(e.howMany),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.MergeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=Er.Position.decode(e,e.uint32());break;case 2:r.targetPosition=Er.Position.decode(e,e.uint32());break;case 3:r.graveyardPosition=Er.Position.decode(e,e.uint32());break;case 4:r.howMany=e.uint32();break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=Er.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=Er.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=Er.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}return null!=e.howMany&&e.hasOwnProperty("howMany")&&!Cr.isInteger(e.howMany)?"howMany: integer expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.MergeOperation)return e;let t=new Er.MergeOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MergeOperation.sourcePosition: object expected");t.sourcePosition=Er.Position.fromObject(e.sourcePosition)}if(null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MergeOperation.targetPosition: object expected");t.targetPosition=Er.Position.fromObject(e.targetPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".MergeOperation.graveyardPosition: object expected");t.graveyardPosition=Er.Position.fromObject(e.graveyardPosition)}return null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.targetPosition=null,n.graveyardPosition=null,n.howMany=0,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=Er.Position.toObject(e.sourcePosition,t)),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=Er.Position.toObject(e.targetPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=Er.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MergeOperation"},e})(),xr=Er.MoveOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sourcePosition=null,e.prototype.howMany=0,e.prototype.targetPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.sourcePosition&&Object.hasOwnProperty.call(e,"sourcePosition")&&Er.Position.encode(e.sourcePosition,t.uint32(10).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(16).uint32(e.howMany),null!=e.targetPosition&&Object.hasOwnProperty.call(e,"targetPosition")&&Er.Position.encode(e.targetPosition,t.uint32(26).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.MoveOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.sourcePosition=Er.Position.decode(e,e.uint32());break;case 2:r.howMany=e.uint32();break;case 3:r.targetPosition=Er.Position.decode(e,e.uint32());break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")){let t=Er.Position.verify(e.sourcePosition);if(t)return"sourcePosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!Cr.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.targetPosition&&e.hasOwnProperty("targetPosition")){let t=Er.Position.verify(e.targetPosition);if(t)return"targetPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.MoveOperation)return e;let t=new Er.MoveOperation;if(null!=e.sourcePosition){if("object"!=typeof e.sourcePosition)throw TypeError(".MoveOperation.sourcePosition: object expected");t.sourcePosition=Er.Position.fromObject(e.sourcePosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.targetPosition){if("object"!=typeof e.targetPosition)throw TypeError(".MoveOperation.targetPosition: object expected");t.targetPosition=Er.Position.fromObject(e.targetPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.sourcePosition=null,n.howMany=0,n.targetPosition=null,n.wasUndone=!1),null!=e.sourcePosition&&e.hasOwnProperty("sourcePosition")&&(n.sourcePosition=Er.Position.toObject(e.sourcePosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.targetPosition&&e.hasOwnProperty("targetPosition")&&(n.targetPosition=Er.Position.toObject(e.targetPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/MoveOperation"},e})(),Vr=Er.RenameOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.oldName="",e.prototype.newName="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.position&&Object.hasOwnProperty.call(e,"position")&&Er.Position.encode(e.position,t.uint32(10).fork()).ldelim(),null!=e.oldName&&Object.hasOwnProperty.call(e,"oldName")&&t.uint32(18).string(e.oldName),null!=e.newName&&Object.hasOwnProperty.call(e,"newName")&&t.uint32(26).string(e.newName),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.RenameOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.position=Er.Position.decode(e,e.uint32());break;case 2:r.oldName=e.string();break;case 3:r.newName=e.string();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.position&&e.hasOwnProperty("position")){let t=Er.Position.verify(e.position);if(t)return"position."+t}return null!=e.oldName&&e.hasOwnProperty("oldName")&&!Cr.isString(e.oldName)?"oldName: string expected":null!=e.newName&&e.hasOwnProperty("newName")&&!Cr.isString(e.newName)?"newName: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.RenameOperation)return e;let t=new Er.RenameOperation;if(null!=e.position){if("object"!=typeof e.position)throw TypeError(".RenameOperation.position: object expected");t.position=Er.Position.fromObject(e.position)}return null!=e.oldName&&(t.oldName=String(e.oldName)),null!=e.newName&&(t.newName=String(e.newName)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.position=null,n.oldName="",n.newName="",n.wasUndone=!1),null!=e.position&&e.hasOwnProperty("position")&&(n.position=Er.Position.toObject(e.position,t)),null!=e.oldName&&e.hasOwnProperty("oldName")&&(n.oldName=e.oldName),null!=e.newName&&e.hasOwnProperty("newName")&&(n.newName=e.newName),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RenameOperation"},e})(),Mr=Er.RootAttributeOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.key="",e.prototype.oldValueBoolean=!1,e.prototype.oldValueJson="",e.prototype.newValueBoolean=!1,e.prototype.newValueJson="",e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(18).string(e.key),null!=e.oldValueBoolean&&Object.hasOwnProperty.call(e,"oldValueBoolean")&&t.uint32(24).bool(e.oldValueBoolean),null!=e.oldValueJson&&Object.hasOwnProperty.call(e,"oldValueJson")&&t.uint32(34).string(e.oldValueJson),null!=e.newValueBoolean&&Object.hasOwnProperty.call(e,"newValueBoolean")&&t.uint32(40).bool(e.newValueBoolean),null!=e.newValueJson&&Object.hasOwnProperty.call(e,"newValueJson")&&t.uint32(50).string(e.newValueJson),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(56).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.RootAttributeOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.key=e.string();break;case 3:r.oldValueBoolean=e.bool();break;case 4:r.oldValueJson=e.string();break;case 5:r.newValueBoolean=e.bool();break;case 6:r.newValueJson=e.string();break;case 7:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.root&&e.hasOwnProperty("root")&&!Cr.isString(e.root)?"root: string expected":null!=e.key&&e.hasOwnProperty("key")&&!Cr.isString(e.key)?"key: string expected":null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&"boolean"!=typeof e.oldValueBoolean?"oldValueBoolean: boolean expected":null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&!Cr.isString(e.oldValueJson)?"oldValueJson: string expected":null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&"boolean"!=typeof e.newValueBoolean?"newValueBoolean: boolean expected":null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&!Cr.isString(e.newValueJson)?"newValueJson: string expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.RootAttributeOperation)return e;let t=new Er.RootAttributeOperation;return null!=e.root&&(t.root=String(e.root)),null!=e.key&&(t.key=String(e.key)),null!=e.oldValueBoolean&&(t.oldValueBoolean=Boolean(e.oldValueBoolean)),null!=e.oldValueJson&&(t.oldValueJson=String(e.oldValueJson)),null!=e.newValueBoolean&&(t.newValueBoolean=Boolean(e.newValueBoolean)),null!=e.newValueJson&&(t.newValueJson=String(e.newValueJson)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.root="",n.key="",n.oldValueBoolean=!1,n.oldValueJson="",n.newValueBoolean=!1,n.newValueJson="",n.wasUndone=!1),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.oldValueBoolean&&e.hasOwnProperty("oldValueBoolean")&&(n.oldValueBoolean=e.oldValueBoolean),null!=e.oldValueJson&&e.hasOwnProperty("oldValueJson")&&(n.oldValueJson=e.oldValueJson),null!=e.newValueBoolean&&e.hasOwnProperty("newValueBoolean")&&(n.newValueBoolean=e.newValueBoolean),null!=e.newValueJson&&e.hasOwnProperty("newValueJson")&&(n.newValueJson=e.newValueJson),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootAttributeOperation"},e})(),Br=Er.RootOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rootName="",e.prototype.elementName="",e.prototype.isAdd=!1,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.rootName&&Object.hasOwnProperty.call(e,"rootName")&&t.uint32(10).string(e.rootName),null!=e.elementName&&Object.hasOwnProperty.call(e,"elementName")&&t.uint32(18).string(e.elementName),null!=e.isAdd&&Object.hasOwnProperty.call(e,"isAdd")&&t.uint32(24).bool(e.isAdd),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(32).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.RootOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.rootName=e.string();break;case 2:r.elementName=e.string();break;case 3:r.isAdd=e.bool();break;case 4:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.rootName&&e.hasOwnProperty("rootName")&&!Cr.isString(e.rootName)?"rootName: string expected":null!=e.elementName&&e.hasOwnProperty("elementName")&&!Cr.isString(e.elementName)?"elementName: string expected":null!=e.isAdd&&e.hasOwnProperty("isAdd")&&"boolean"!=typeof e.isAdd?"isAdd: boolean expected":null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.RootOperation)return e;let t=new Er.RootOperation;return null!=e.rootName&&(t.rootName=String(e.rootName)),null!=e.elementName&&(t.elementName=String(e.elementName)),null!=e.isAdd&&(t.isAdd=Boolean(e.isAdd)),null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.rootName="",n.elementName="",n.isAdd=!1,n.wasUndone=!1),null!=e.rootName&&e.hasOwnProperty("rootName")&&(n.rootName=e.rootName),null!=e.elementName&&e.hasOwnProperty("elementName")&&(n.elementName=e.elementName),null!=e.isAdd&&e.hasOwnProperty("isAdd")&&(n.isAdd=e.isAdd),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/RootOperation"},e})(),Ur=Er.SplitOperation=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.splitPosition=null,e.prototype.graveyardPosition=null,e.prototype.howMany=0,e.prototype.insertionPosition=null,e.prototype.wasUndone=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.splitPosition&&Object.hasOwnProperty.call(e,"splitPosition")&&Er.Position.encode(e.splitPosition,t.uint32(10).fork()).ldelim(),null!=e.graveyardPosition&&Object.hasOwnProperty.call(e,"graveyardPosition")&&Er.Position.encode(e.graveyardPosition,t.uint32(18).fork()).ldelim(),null!=e.howMany&&Object.hasOwnProperty.call(e,"howMany")&&t.uint32(24).uint32(e.howMany),null!=e.insertionPosition&&Object.hasOwnProperty.call(e,"insertionPosition")&&Er.Position.encode(e.insertionPosition,t.uint32(34).fork()).ldelim(),null!=e.wasUndone&&Object.hasOwnProperty.call(e,"wasUndone")&&t.uint32(40).bool(e.wasUndone),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.SplitOperation;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.splitPosition=Er.Position.decode(e,e.uint32());break;case 2:r.graveyardPosition=Er.Position.decode(e,e.uint32());break;case 3:r.howMany=e.uint32();break;case 4:r.insertionPosition=Er.Position.decode(e,e.uint32());break;case 5:r.wasUndone=e.bool();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.splitPosition&&e.hasOwnProperty("splitPosition")){let t=Er.Position.verify(e.splitPosition);if(t)return"splitPosition."+t}if(null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")){let t=Er.Position.verify(e.graveyardPosition);if(t)return"graveyardPosition."+t}if(null!=e.howMany&&e.hasOwnProperty("howMany")&&!Cr.isInteger(e.howMany))return"howMany: integer expected";if(null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")){let t=Er.Position.verify(e.insertionPosition);if(t)return"insertionPosition."+t}return null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&"boolean"!=typeof e.wasUndone?"wasUndone: boolean expected":null},e.fromObject=function(e){if(e instanceof Er.SplitOperation)return e;let t=new Er.SplitOperation;if(null!=e.splitPosition){if("object"!=typeof e.splitPosition)throw TypeError(".SplitOperation.splitPosition: object expected");t.splitPosition=Er.Position.fromObject(e.splitPosition)}if(null!=e.graveyardPosition){if("object"!=typeof e.graveyardPosition)throw TypeError(".SplitOperation.graveyardPosition: object expected");t.graveyardPosition=Er.Position.fromObject(e.graveyardPosition)}if(null!=e.howMany&&(t.howMany=e.howMany>>>0),null!=e.insertionPosition){if("object"!=typeof e.insertionPosition)throw TypeError(".SplitOperation.insertionPosition: object expected");t.insertionPosition=Er.Position.fromObject(e.insertionPosition)}return null!=e.wasUndone&&(t.wasUndone=Boolean(e.wasUndone)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.splitPosition=null,n.graveyardPosition=null,n.howMany=0,n.insertionPosition=null,n.wasUndone=!1),null!=e.splitPosition&&e.hasOwnProperty("splitPosition")&&(n.splitPosition=Er.Position.toObject(e.splitPosition,t)),null!=e.graveyardPosition&&e.hasOwnProperty("graveyardPosition")&&(n.graveyardPosition=Er.Position.toObject(e.graveyardPosition,t)),null!=e.howMany&&e.hasOwnProperty("howMany")&&(n.howMany=e.howMany),null!=e.insertionPosition&&e.hasOwnProperty("insertionPosition")&&(n.insertionPosition=Er.Position.toObject(e.insertionPosition,t)),null!=e.wasUndone&&e.hasOwnProperty("wasUndone")&&(n.wasUndone=e.wasUndone),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/SplitOperation"},e})(),Jr=Er.Position=(()=>{function e(e){if(this.path=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.root="",e.prototype.rootMain=!1,e.prototype.rootGraveyard=!1,e.prototype.path=Cr.emptyArray,e.prototype.stickiness="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=kr.create()),null!=e.root&&Object.hasOwnProperty.call(e,"root")&&t.uint32(10).string(e.root),null!=e.rootMain&&Object.hasOwnProperty.call(e,"rootMain")&&t.uint32(16).bool(e.rootMain),null!=e.rootGraveyard&&Object.hasOwnProperty.call(e,"rootGraveyard")&&t.uint32(24).bool(e.rootGraveyard),null!=e.path&&e.path.length){t.uint32(34).fork();for(let n=0;n<e.path.length;++n)t.uint32(e.path[n]);t.ldelim()}return null!=e.stickiness&&Object.hasOwnProperty.call(e,"stickiness")&&t.uint32(42).string(e.stickiness),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.Position;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.root=e.string();break;case 2:r.rootMain=e.bool();break;case 3:r.rootGraveyard=e.bool();break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)r.path.push(e.uint32())}else r.path.push(e.uint32());break;case 5:r.stickiness=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.root&&e.hasOwnProperty("root")&&!Cr.isString(e.root))return"root: string expected";if(null!=e.rootMain&&e.hasOwnProperty("rootMain")&&"boolean"!=typeof e.rootMain)return"rootMain: boolean expected";if(null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&"boolean"!=typeof e.rootGraveyard)return"rootGraveyard: boolean expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(let t=0;t<e.path.length;++t)if(!Cr.isInteger(e.path[t]))return"path: integer[] expected"}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&!Cr.isString(e.stickiness)?"stickiness: string expected":null},e.fromObject=function(e){if(e instanceof Er.Position)return e;let t=new Er.Position;if(null!=e.root&&(t.root=String(e.root)),null!=e.rootMain&&(t.rootMain=Boolean(e.rootMain)),null!=e.rootGraveyard&&(t.rootGraveyard=Boolean(e.rootGraveyard)),e.path){if(!Array.isArray(e.path))throw TypeError(".Position.path: array expected");t.path=[];for(let n=0;n<e.path.length;++n)t.path[n]=e.path[n]>>>0}return null!=e.stickiness&&(t.stickiness=String(e.stickiness)),t},e.toObject=function(e,t){t||(t={});let n={};if((t.arrays||t.defaults)&&(n.path=[]),t.defaults&&(n.root="",n.rootMain=!1,n.rootGraveyard=!1,n.stickiness=""),null!=e.root&&e.hasOwnProperty("root")&&(n.root=e.root),null!=e.rootMain&&e.hasOwnProperty("rootMain")&&(n.rootMain=e.rootMain),null!=e.rootGraveyard&&e.hasOwnProperty("rootGraveyard")&&(n.rootGraveyard=e.rootGraveyard),e.path&&e.path.length){n.path=[];for(let t=0;t<e.path.length;++t)n.path[t]=e.path[t]}return null!=e.stickiness&&e.hasOwnProperty("stickiness")&&(n.stickiness=e.stickiness),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Position"},e})(),qr=Er.Range=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.start=null,e.prototype.end=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=kr.create()),null!=e.start&&Object.hasOwnProperty.call(e,"start")&&Er.Position.encode(e.start,t.uint32(10).fork()).ldelim(),null!=e.end&&Object.hasOwnProperty.call(e,"end")&&Er.Position.encode(e.end,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n=void 0===t?e.len:e.pos+t,r=new Er.Range;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.start=Er.Position.decode(e,e.uint32());break;case 2:r.end=Er.Position.decode(e,e.uint32());break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.start&&e.hasOwnProperty("start")){let t=Er.Position.verify(e.start);if(t)return"start."+t}if(null!=e.end&&e.hasOwnProperty("end")){let t=Er.Position.verify(e.end);if(t)return"end."+t}return null},e.fromObject=function(e){if(e instanceof Er.Range)return e;let t=new Er.Range;if(null!=e.start){if("object"!=typeof e.start)throw TypeError(".Range.start: object expected");t.start=Er.Position.fromObject(e.start)}if(null!=e.end){if("object"!=typeof e.end)throw TypeError(".Range.end: object expected");t.end=Er.Position.fromObject(e.end)}return t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.start=null,n.end=null),null!=e.start&&e.hasOwnProperty("start")&&(n.start=Er.Position.toObject(e.start,t)),null!=e.end&&e.hasOwnProperty("end")&&(n.end=Er.Position.toObject(e.end,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Range"},e})(),Lr=Er.Element=(()=>{function e(e){if(this.children=[],this.attributesBoolean={},e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.children=Cr.emptyArray,e.prototype.data="",e.prototype.attributesBoolean=Cr.emptyObject,e.prototype.attributesJson="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=kr.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.children&&e.children.length)for(let n=0;n<e.children.length;++n)Er.Element.encode(e.children[n],t.uint32(18).fork()).ldelim();if(null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).string(e.data),null!=e.attributesBoolean&&Object.hasOwnProperty.call(e,"attributesBoolean"))for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(16).bool(e.attributesBoolean[n[r]]).ldelim();return null!=e.attributesJson&&Object.hasOwnProperty.call(e,"attributesJson")&&t.uint32(42).string(e.attributesJson),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof _r||(e=_r.create(e));let n,r,s=void 0===t?e.len:e.pos+t,o=new Er.Element;for(;e.pos<s;){let t=e.uint32();switch(t>>>3){case 1:o.name=e.string();break;case 2:o.children&&o.children.length||(o.children=[]),o.children.push(Er.Element.decode(e,e.uint32()));break;case 3:o.data=e.string();break;case 4:{o.attributesBoolean===Cr.emptyObject&&(o.attributesBoolean={});let t=e.uint32()+e.pos;for(n="",r=!1;e.pos<t;){let t=e.uint32();switch(t>>>3){case 1:n=e.string();break;case 2:r=e.bool();break;default:e.skipType(7&t)}}o.attributesBoolean[n]=r;break}case 5:o.attributesJson=e.string();break;default:e.skipType(7&t)}}return o},e.decodeDelimited=function(e){return e instanceof _r||(e=new _r(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!Cr.isString(e.name))return"name: string expected";if(null!=e.children&&e.hasOwnProperty("children")){if(!Array.isArray(e.children))return"children: array expected";for(let t=0;t<e.children.length;++t){let n=Er.Element.verify(e.children[t]);if(n)return"children."+n}}if(null!=e.data&&e.hasOwnProperty("data")&&!Cr.isString(e.data))return"data: string expected";if(null!=e.attributesBoolean&&e.hasOwnProperty("attributesBoolean")){if(!Cr.isObject(e.attributesBoolean))return"attributesBoolean: object expected";let t=Object.keys(e.attributesBoolean);for(let n=0;n<t.length;++n)if("boolean"!=typeof e.attributesBoolean[t[n]])return"attributesBoolean: boolean{k:string} expected"}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&!Cr.isString(e.attributesJson)?"attributesJson: string expected":null},e.fromObject=function(e){if(e instanceof Er.Element)return e;let t=new Er.Element;if(null!=e.name&&(t.name=String(e.name)),e.children){if(!Array.isArray(e.children))throw TypeError(".Element.children: array expected");t.children=[];for(let n=0;n<e.children.length;++n){if("object"!=typeof e.children[n])throw TypeError(".Element.children: object expected");t.children[n]=Er.Element.fromObject(e.children[n])}}if(null!=e.data&&(t.data=String(e.data)),e.attributesBoolean){if("object"!=typeof e.attributesBoolean)throw TypeError(".Element.attributesBoolean: object expected");t.attributesBoolean={};for(let n=Object.keys(e.attributesBoolean),r=0;r<n.length;++r)t.attributesBoolean[n[r]]=Boolean(e.attributesBoolean[n[r]])}return null!=e.attributesJson&&(t.attributesJson=String(e.attributesJson)),t},e.toObject=function(e,t){t||(t={});let n,r={};if((t.arrays||t.defaults)&&(r.children=[]),(t.objects||t.defaults)&&(r.attributesBoolean={}),t.defaults&&(r.name="",r.data="",r.attributesJson=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),e.children&&e.children.length){r.children=[];for(let n=0;n<e.children.length;++n)r.children[n]=Er.Element.toObject(e.children[n],t)}if(null!=e.data&&e.hasOwnProperty("data")&&(r.data=e.data),e.attributesBoolean&&(n=Object.keys(e.attributesBoolean)).length){r.attributesBoolean={};for(let t=0;t<n.length;++t)r.attributesBoolean[n[t]]=e.attributesBoolean[n[t]]}return null!=e.attributesJson&&e.hasOwnProperty("attributesJson")&&(r.attributesJson=e.attributesJson),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,_e.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/Element"},e})();class Gr{constructor(){this._protobufRoot=t}getDescriptor(e){return new Yr(this._protobufRoot[e])}}class Yr{constructor(e){this._protobuf=e}compress(e){const t=this._protobuf.verify(e);if(t)throw Error(t);return this._protobuf.encode(this._protobuf.create(e)).finish()}decompress(e){return this._protobuf.toObject(this._protobuf.decode(e),{oneofs:!0})}}const Fr=function(){this.__data__=[],this.size=0};const Hr=function(e,t){return e===t||e!=e&&t!=t};const zr=function(e,t){for(var n=e.length;n--;)if(Hr(e[n][0],t))return n;return-1};var Kr=Array.prototype.splice;const Wr=function(e){var t=this.__data__,n=zr(t,e);return!(n<0)&&(n==t.length-1?t.pop():Kr.call(t,n,1),--this.size,!0)};const $r=function(e){var t=this.__data__,n=zr(t,e);return n<0?void 0:t[n][1]};const Qr=function(e){return zr(this.__data__,e)>-1};const Xr=function(e,t){var n=this.__data__,r=zr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Zr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zr.prototype.clear=Fr,Zr.prototype.delete=Wr,Zr.prototype.get=$r,Zr.prototype.has=Qr,Zr.prototype.set=Xr;const es=Zr;const ts=function(){this.__data__=new es,this.size=0};const ns=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const rs=function(e){return this.__data__.get(e)};const ss=function(e){return this.__data__.has(e)};const os="object"==typeof global&&global&&global.Object===Object&&global;var is="object"==typeof self&&self&&self.Object===Object&&self;const as=os||is||Function("return this")();const cs=as.Symbol;var ds=Object.prototype,us=ds.hasOwnProperty,ls=ds.toString,ps=cs?cs.toStringTag:void 0;const hs=function(e){var t=us.call(e,ps),n=e[ps];try{e[ps]=void 0;var r=!0}catch(e){}var s=ls.call(e);return r&&(t?e[ps]=n:delete e[ps]),s};var fs=Object.prototype.toString;const ms=function(e){return fs.call(e)};var ys=cs?cs.toStringTag:void 0;const gs=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ys&&ys in Object(e)?hs(e):ms(e)};const bs=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Os=function(e){if(!bs(e))return!1;var t=gs(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const ws=as["__core-js_shared__"];var Is,vs=(Is=/[^.]+$/.exec(ws&&ws.keys&&ws.keys.IE_PROTO||""))?"Symbol(src)_1."+Is:"";const Ss=function(e){return!!vs&&vs in e};var As=Function.prototype.toString;const Ps=function(e){if(null!=e){try{return As.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var Ts=/^\[object .+?Constructor\]$/,_s=Function.prototype,ks=Object.prototype,Cs=_s.toString,Es=ks.hasOwnProperty,js=RegExp("^"+Cs.call(Es).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Rs=function(e){return!(!bs(e)||Ss(e))&&(Os(e)?js:Ts).test(Ps(e))};const Ds=function(e,t){return null==e?void 0:e[t]};const Ns=function(e,t){var n=Ds(e,t);return Rs(n)?n:void 0};const xs=Ns(as,"Map");const Vs=Ns(Object,"create");const Ms=function(){this.__data__=Vs?Vs(null):{},this.size=0};const Bs=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var Us=Object.prototype.hasOwnProperty;const Js=function(e){var t=this.__data__;if(Vs){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Us.call(t,e)?t[e]:void 0};var qs=Object.prototype.hasOwnProperty;const Ls=function(e){var t=this.__data__;return Vs?void 0!==t[e]:qs.call(t,e)};const Gs=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Vs&&void 0===t?"__lodash_hash_undefined__":t,this};function Ys(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ys.prototype.clear=Ms,Ys.prototype.delete=Bs,Ys.prototype.get=Js,Ys.prototype.has=Ls,Ys.prototype.set=Gs;const Fs=Ys;const Hs=function(){this.size=0,this.__data__={hash:new Fs,map:new(xs||es),string:new Fs}};const zs=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const Ks=function(e,t){var n=e.__data__;return zs(t)?n["string"==typeof t?"string":"hash"]:n.map};const Ws=function(e){var t=Ks(this,e).delete(e);return this.size-=t?1:0,t};const $s=function(e){return Ks(this,e).get(e)};const Qs=function(e){return Ks(this,e).has(e)};const Xs=function(e,t){var n=Ks(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Zs(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zs.prototype.clear=Hs,Zs.prototype.delete=Ws,Zs.prototype.get=$s,Zs.prototype.has=Qs,Zs.prototype.set=Xs;const eo=Zs;const to=function(e,t){var n=this.__data__;if(n instanceof es){var r=n.__data__;if(!xs||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new eo(r)}return n.set(e,t),this.size=n.size,this};function no(e){var t=this.__data__=new es(e);this.size=t.size}no.prototype.clear=ts,no.prototype.delete=ns,no.prototype.get=rs,no.prototype.has=ss,no.prototype.set=to;const ro=no;const so=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};const oo=function(){try{var e=Ns(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const io=function(e,t,n){"__proto__"==t&&oo?oo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var ao=Object.prototype.hasOwnProperty;const co=function(e,t,n){var r=e[t];ao.call(e,t)&&Hr(r,n)&&(void 0!==n||t in e)||io(e,t,n)};const uo=function(e,t,n,r){var s=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],c=r?r(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),s?io(n,a,c):co(n,a,c)}return n};const lo=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const po=function(e){return null!=e&&"object"==typeof e};const ho=function(e){return po(e)&&"[object Arguments]"==gs(e)};var fo=Object.prototype,mo=fo.hasOwnProperty,yo=fo.propertyIsEnumerable,go=ho(function(){return arguments}())?ho:function(e){return po(e)&&mo.call(e,"callee")&&!yo.call(e,"callee")};const bo=go;const Oo=Array.isArray;const wo=function(){return!1};var Io="object"==typeof exports&&exports&&!exports.nodeType&&exports,vo=Io&&"object"==typeof module&&module&&!module.nodeType&&module,So=vo&&vo.exports===Io?as.Buffer:void 0;const Ao=(So?So.isBuffer:void 0)||wo;var Po=/^(?:0|[1-9]\d*)$/;const To=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Po.test(e))&&e>-1&&e%1==0&&e<t};const _o=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ko={};ko["[object Float32Array]"]=ko["[object Float64Array]"]=ko["[object Int8Array]"]=ko["[object Int16Array]"]=ko["[object Int32Array]"]=ko["[object Uint8Array]"]=ko["[object Uint8ClampedArray]"]=ko["[object Uint16Array]"]=ko["[object Uint32Array]"]=!0,ko["[object Arguments]"]=ko["[object Array]"]=ko["[object ArrayBuffer]"]=ko["[object Boolean]"]=ko["[object DataView]"]=ko["[object Date]"]=ko["[object Error]"]=ko["[object Function]"]=ko["[object Map]"]=ko["[object Number]"]=ko["[object Object]"]=ko["[object RegExp]"]=ko["[object Set]"]=ko["[object String]"]=ko["[object WeakMap]"]=!1;const Co=function(e){return po(e)&&_o(e.length)&&!!ko[gs(e)]};const Eo=function(e){return function(t){return e(t)}};var jo="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ro=jo&&"object"==typeof module&&module&&!module.nodeType&&module,Do=Ro&&Ro.exports===jo&&os.process;const No=function(){try{var e=Ro&&Ro.require&&Ro.require("util").types;return e||Do&&Do.binding&&Do.binding("util")}catch(e){}}();var xo=No&&No.isTypedArray;const Vo=xo?Eo(xo):Co;var Mo=Object.prototype.hasOwnProperty;const Bo=function(e,t){var n=Oo(e),r=!n&&bo(e),s=!n&&!r&&Ao(e),o=!n&&!r&&!s&&Vo(e),i=n||r||s||o,a=i?lo(e.length,String):[],c=a.length;for(var d in e)!t&&!Mo.call(e,d)||i&&("length"==d||s&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||To(d,c))||a.push(d);return a};var Uo=Object.prototype;const Jo=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Uo)};const qo=function(e,t){return function(n){return e(t(n))}};const Lo=qo(Object.keys,Object);var Go=Object.prototype.hasOwnProperty;const Yo=function(e){if(!Jo(e))return Lo(e);var t=[];for(var n in Object(e))Go.call(e,n)&&"constructor"!=n&&t.push(n);return t};const Fo=function(e){return null!=e&&_o(e.length)&&!Os(e)};const Ho=function(e){return Fo(e)?Bo(e):Yo(e)};const zo=function(e,t){return e&&uo(t,Ho(t),e)};const Ko=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var Wo=Object.prototype.hasOwnProperty;const $o=function(e){if(!bs(e))return Ko(e);var t=Jo(e),n=[];for(var r in e)("constructor"!=r||!t&&Wo.call(e,r))&&n.push(r);return n};const Qo=function(e){return Fo(e)?Bo(e,!0):$o(e)};const Xo=function(e,t){return e&&uo(t,Qo(t),e)};var Zo="object"==typeof exports&&exports&&!exports.nodeType&&exports,ei=Zo&&"object"==typeof module&&module&&!module.nodeType&&module,ti=ei&&ei.exports===Zo?as.Buffer:void 0,ni=ti?ti.allocUnsafe:void 0;const ri=function(e,t){if(t)return e.slice();var n=e.length,r=ni?ni(n):new e.constructor(n);return e.copy(r),r};const si=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};const oi=function(e,t){for(var n=-1,r=null==e?0:e.length,s=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[s++]=i)}return o};const ii=function(){return[]};var ai=Object.prototype.propertyIsEnumerable,ci=Object.getOwnPropertySymbols;const di=ci?function(e){return null==e?[]:(e=Object(e),oi(ci(e),(function(t){return ai.call(e,t)})))}:ii;const ui=function(e,t){return uo(e,di(e),t)};const li=function(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e};const pi=qo(Object.getPrototypeOf,Object);const hi=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)li(t,di(e)),e=pi(e);return t}:ii;const fi=function(e,t){return uo(e,hi(e),t)};const mi=function(e,t,n){var r=t(e);return Oo(e)?r:li(r,n(e))};const yi=function(e){return mi(e,Ho,di)};const gi=function(e){return mi(e,Qo,hi)};const bi=Ns(as,"DataView");const Oi=Ns(as,"Promise");const wi=Ns(as,"Set");const Ii=Ns(as,"WeakMap");var vi="[object Map]",Si="[object Promise]",Ai="[object Set]",Pi="[object WeakMap]",Ti="[object DataView]",_i=Ps(bi),ki=Ps(xs),Ci=Ps(Oi),Ei=Ps(wi),ji=Ps(Ii),Ri=gs;(bi&&Ri(new bi(new ArrayBuffer(1)))!=Ti||xs&&Ri(new xs)!=vi||Oi&&Ri(Oi.resolve())!=Si||wi&&Ri(new wi)!=Ai||Ii&&Ri(new Ii)!=Pi)&&(Ri=function(e){var t=gs(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ps(n):"";if(r)switch(r){case _i:return Ti;case ki:return vi;case Ci:return Si;case Ei:return Ai;case ji:return Pi}return t});const Di=Ri;var Ni=Object.prototype.hasOwnProperty;const xi=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ni.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const Vi=as.Uint8Array;const Mi=function(e){var t=new e.constructor(e.byteLength);return new Vi(t).set(new Vi(e)),t};const Bi=function(e,t){var n=t?Mi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var Ui=/\w*$/;const Ji=function(e){var t=new e.constructor(e.source,Ui.exec(e));return t.lastIndex=e.lastIndex,t};var qi=cs?cs.prototype:void 0,Li=qi?qi.valueOf:void 0;const Gi=function(e){return Li?Object(Li.call(e)):{}};const Yi=function(e,t){var n=t?Mi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const Fi=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Mi(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Bi(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Yi(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Ji(e);case"[object Symbol]":return Gi(e)}};var Hi=Object.create;const zi=function(){function e(){}return function(t){if(!bs(t))return{};if(Hi)return Hi(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Ki=function(e){return"function"!=typeof e.constructor||Jo(e)?{}:zi(pi(e))};const Wi=function(e){return po(e)&&"[object Map]"==Di(e)};var $i=No&&No.isMap;const Qi=$i?Eo($i):Wi;const Xi=function(e){return po(e)&&"[object Set]"==Di(e)};var Zi=No&&No.isSet;const ea=Zi?Eo(Zi):Xi;var ta="[object Arguments]",na="[object Function]",ra="[object Object]",sa={};sa[ta]=sa["[object Array]"]=sa["[object ArrayBuffer]"]=sa["[object DataView]"]=sa["[object Boolean]"]=sa["[object Date]"]=sa["[object Float32Array]"]=sa["[object Float64Array]"]=sa["[object Int8Array]"]=sa["[object Int16Array]"]=sa["[object Int32Array]"]=sa["[object Map]"]=sa["[object Number]"]=sa[ra]=sa["[object RegExp]"]=sa["[object Set]"]=sa["[object String]"]=sa["[object Symbol]"]=sa["[object Uint8Array]"]=sa["[object Uint8ClampedArray]"]=sa["[object Uint16Array]"]=sa["[object Uint32Array]"]=!0,sa["[object Error]"]=sa[na]=sa["[object WeakMap]"]=!1;const oa=function e(t,n,r,s,o,i){var a,c=1&n,d=2&n,u=4&n;if(r&&(a=o?r(t,s,o,i):r(t)),void 0!==a)return a;if(!bs(t))return t;var l=Oo(t);if(l){if(a=xi(t),!c)return si(t,a)}else{var p=Di(t),h=p==na||"[object GeneratorFunction]"==p;if(Ao(t))return ri(t,c);if(p==ra||p==ta||h&&!o){if(a=d||h?{}:Ki(t),!c)return d?fi(t,Xo(a,t)):ui(t,zo(a,t))}else{if(!sa[p])return o?t:{};a=Fi(t,p,c)}}i||(i=new ro);var f=i.get(t);if(f)return f;i.set(t,a),ea(t)?t.forEach((function(s){a.add(e(s,n,r,s,t,i))})):Qi(t)&&t.forEach((function(s,o){a.set(o,e(s,n,r,o,t,i))}));var m=l?void 0:(u?d?gi:yi:d?Qo:Ho)(t);return so(m||t,(function(s,o){m&&(s=t[o=s]),co(a,o,e(s,n,r,o,t,i))})),a};const ia=function(e){return oa(e,5)};const aa=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const ca=function(e){return this.__data__.has(e)};function da(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new eo;++t<n;)this.add(e[t])}da.prototype.add=da.prototype.push=aa,da.prototype.has=ca;const ua=da;const la=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const pa=function(e,t){return e.has(t)};const ha=function(e,t,n,r,s,o){var i=1&n,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var d=o.get(e),u=o.get(t);if(d&&u)return d==t&&u==e;var l=-1,p=!0,h=2&n?new ua:void 0;for(o.set(e,t),o.set(t,e);++l<a;){var f=e[l],m=t[l];if(r)var y=i?r(m,f,l,t,e,o):r(f,m,l,e,t,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!la(t,(function(e,t){if(!pa(h,t)&&(f===e||s(f,e,n,r,o)))return h.push(t)}))){p=!1;break}}else if(f!==m&&!s(f,m,n,r,o)){p=!1;break}}return o.delete(e),o.delete(t),p};const fa=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const ma=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var ya=cs?cs.prototype:void 0,ga=ya?ya.valueOf:void 0;const ba=function(e,t,n,r,s,o,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Vi(e),new Vi(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Hr(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=fa;case"[object Set]":var c=1&r;if(a||(a=ma),e.size!=t.size&&!c)return!1;var d=i.get(e);if(d)return d==t;r|=2,i.set(e,t);var u=ha(a(e),a(t),r,s,o,i);return i.delete(e),u;case"[object Symbol]":if(ga)return ga.call(e)==ga.call(t)}return!1};var Oa=Object.prototype.hasOwnProperty;const wa=function(e,t,n,r,s,o){var i=1&n,a=yi(e),c=a.length;if(c!=yi(t).length&&!i)return!1;for(var d=c;d--;){var u=a[d];if(!(i?u in t:Oa.call(t,u)))return!1}var l=o.get(e),p=o.get(t);if(l&&p)return l==t&&p==e;var h=!0;o.set(e,t),o.set(t,e);for(var f=i;++d<c;){var m=e[u=a[d]],y=t[u];if(r)var g=i?r(y,m,u,t,e,o):r(m,y,u,e,t,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=e.constructor,O=t.constructor;b==O||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof O&&O instanceof O||(h=!1)}return o.delete(e),o.delete(t),h};var Ia="[object Arguments]",va="[object Array]",Sa="[object Object]",Aa=Object.prototype.hasOwnProperty;const Pa=function(e,t,n,r,s,o){var i=Oo(e),a=Oo(t),c=i?va:Di(e),d=a?va:Di(t),u=(c=c==Ia?Sa:c)==Sa,l=(d=d==Ia?Sa:d)==Sa,p=c==d;if(p&&Ao(e)){if(!Ao(t))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new ro),i||Vo(e)?ha(e,t,n,r,s,o):ba(e,t,c,n,r,s,o);if(!(1&n)){var h=u&&Aa.call(e,"__wrapped__"),f=l&&Aa.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,y=f?t.value():t;return o||(o=new ro),s(m,y,n,r,o)}}return!!p&&(o||(o=new ro),wa(e,t,n,r,s,o))};const Ta=function e(t,n,r,s,o){return t===n||(null==t||null==n||!po(t)&&!po(n)?t!=t&&n!=n:Pa(t,n,r,s,e,o))};const _a=function(e,t){return Ta(e,t)};function ka(e,t){const n=ia(e);return n.path[n.path.length-1]+=t,n}function Ca(e,t){return e.root===t.root&&_a(e.path,t.path)}function Ea(e){Ra(e,(e=>("main"==e.root?(e.rootMain=!0,delete e.root):"$graveyard"==e.root&&(e.rootGraveyard=!0,delete e.root),e)))}function ja(e){Ra(e,(e=>(e.rootMain?(e.root="main",delete e.rootMain):e.rootGraveyard&&(e.root="$graveyard",delete e.rootGraveyard),e)))}function Ra(e,t){for(const n in e){const r=e[n];"nodes"!==n&&bs(r)&&(r.path&&(r.root||r.rootMain||r.rootGraveyard)?e[n]=t(r):Ra(r,t))}return e}class Da{constructor(e,t,n){this._id=e,this._operationName=t,this._protobufDescriptor=n}compress(e,t){const n=t.shift();return Ea(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){t.types.shift();const n=this._protobufDescriptor.decompress(t.buffers.shift());ja(n),n.__className=this._operationName,e.push(n)}}class Na extends Da{compress(e,t){const n=t.shift();return this._serializeOneOf("oldValue",n),this._serializeOneOf("newValue",n),Ea(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,s=this._protobufDescriptor.decompress(r.shift());n.shift(),this._deserializeOneOf("oldValue",s),this._deserializeOneOf("newValue",s),ja(s),s.__className=this._operationName,e.push(s)}_serializeOneOf(e,t){const n=t[e];"boolean"==typeof n?t[`${e}Boolean`]=n:t[`${e}Json`]=JSON.stringify(n)}_deserializeOneOf(e,t){const n=`${e}Json`;t[n]?(t[e]=JSON.parse(t[n]),delete t[n]):(t[e]=t[`${e}Boolean`],delete t[`${e}Boolean`])}}class xa extends Da{compress(e,t){const n=t.shift();return this._serializeNodesAttributes(n.nodes),Ea(n),e.buffers.push(this._protobufDescriptor.compress(n)),e.types.push(this._id),!0}decompress(e,t){const{types:n,buffers:r}=t,s=this._protobufDescriptor.decompress(r.shift());n.shift(),s.nodes||(s.nodes=[]),this._deserializeNodesAttributes(s.nodes),ja(s),s.__className=this._operationName,e.push(s)}_serializeNodesAttributes(e){for(const t of e){if(t.attributes){const e=t.attributes;this._areValuesBoolean(e)?t.attributesBoolean=e:t.attributesJson=JSON.stringify(e)}t.children&&this._serializeNodesAttributes(t.children)}}_deserializeNodesAttributes(e){for(const t of e)(t.attributesBoolean||t.attributesJson)&&(t.attributesBoolean?(t.attributes=t.attributesBoolean,delete t.attributesBoolean):(t.attributes=JSON.parse(t.attributesJson),delete t.attributesJson)),t.children&&this._deserializeNodesAttributes(t.children)}_areValuesBoolean(e){return Object.keys(e).every((t=>"boolean"==typeof e[t]))}}class Va extends Da{decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.oldRange||(n.oldRange=null),n.newRange||(n.newRange=null)}}class Ma extends Da{compress(e,t){return t.shift(),e.types.push(this._id),!0}decompress(e,t){t.types.shift(),e.push({__className:this._operationName})}}class Ba extends Va{constructor(e,t,n,r){super(e,t,n),this._omittedNamespace=r+":"}compress(e,t){return!("MarkerOperation"!=t[0].__className||!t[0].name.startsWith(this._omittedNamespace))&&(t[0].name=t[0].name.replace(new RegExp("^"+this._omittedNamespace),""),super.compress(e,t),!0)}decompress(e,t){super.decompress(e,t);const n=e[e.length-1];n.name=this._omittedNamespace+n.name}}class Ua{constructor(e,t){this._id=e,this._context=t}compress(e,t){let n;for(;t.length>1&&this._compareOperations(t[0],t[1]);)n?(n=this._combineNext(t.shift(),n),e.types.push(0)):(n=ia(t.shift()),e.types.push(this._id));return!!n&&(n=this._combineNext(t.shift(),n),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0)}decompress(e,t){const n=this._decompressSingleOperation(t);for(;0==t.types[0];)t.types.shift(),e.push(this._splitCurrent(n));e.push(n)}}class Ja extends Ua{_combineNext(e,t){return t.nodes[0].data+=e.nodes[0].data,t}_splitCurrent(e){const t=ia(e),n=t.nodes[0],r=e.nodes[0],s=r.data[Symbol.iterator]().next().value,o=s.length;return n.data=s,r.data=r.data.substr(o),e.position=ka(e.position,o),t}_compareOperations(e,t){if(this._checkOperation(e)&&this._checkOperation(t)){const n=e.nodes[0].data.length,r=Ca(ka(e.position,n),t.position),s=e.nodes[0],o=t.nodes[0];return r&&this._compareAttributes(s,o)}return!1}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("InsertOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("InsertOperation").decompress(t,e),t[0]}_checkOperation(e){return"InsertOperation"==e.__className&&1==e.nodes.length&&e.nodes[0].data&&!e.wasUndone&&1==Array.from(e.nodes[0].data).length}_compareAttributes(e,t){const n=Object.keys(e.attributes||{}),r=Object.keys(t.attributes||{});return n.length===r.length&&n.every((n=>t.attributes[n]&&t.attributes[n]===e.attributes[n]))}}class qa extends Ua{_combineNext(e,t){return t.howMany++,t.sourcePosition=ia(e.sourcePosition),t}_splitCurrent(e){const t=ia(e);return e.howMany--,t.howMany=1,t.sourcePosition=ka(t.sourcePosition,e.howMany),t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ca(ka(e.sourcePosition,-1),t.sourcePosition)&&Ca(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class La extends Ua{_combineNext(e,t){return t.howMany++,t}_splitCurrent(e){const t=ia(e);return t.howMany=1,e.howMany--,t}_compareOperations(e,t){return!(!this._checkOperation(e)||!this._checkOperation(t))&&(Ca(e.sourcePosition,t.sourcePosition)&&Ca(e.targetPosition,t.targetPosition))}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MoveOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MoveOperation").decompress(t,e),t[0]}_checkOperation(e){return"MoveOperation"==e.__className&&"$graveyard"==e.targetPosition.root&&1==e.howMany&&!e.wasUndone}}class Ga extends Ua{compress(e,t){if(!this._compareOperations(t[0],t[1]))return!1;const n=t.shift();return n.oldRange=null,n.newRange&&Ca(n.newRange.start,n.newRange.end)&&(n.newRange.end=null),t.shift(),e.types.push(this._id),e.types.push(0),e.buffers.push(this._compressSingleOperation(n)),!0}decompress(e,t){const n=this._decompressSingleOperation(t);n.newRange&&!n.newRange.end&&(n.newRange.end=ia(n.newRange.start));const r=ia(n);r.newRange&&(r.newRange.start.stickiness="toNone",r.newRange.end=ia(r.newRange.start)),r.name="user:position:"+r.name.split(":")[2],t.types.shift(),e.push(n),e.push(r)}_compressSingleOperation(e){const t={types:[],buffers:[],baseVersion:0};return this._context._getCompressorByName("MarkerOperation").compress(t,[e]),t.buffers[0]}_decompressSingleOperation(e){const t=[];return this._context._getCompressorByName("MarkerOperation").decompress(t,e),t[0]}_compareOperations(e,t){return!(!e||!t)&&("MarkerOperation"==e.__className&&"MarkerOperation"==t.__className&&!(!e.name.startsWith("user:")||!t.name.startsWith("user:")||e.name==t.name))}}class Ya{constructor(){this._compressorById=new Map,this._compressorByName=new Map,this._protobufFactory=new Gr;const e=this._protobufFactory.getDescriptor("MarkerOperation");this._registerCompressor(1,"NoOperation",new Ma(1,"NoOperation",void 0)),this._registerOperationCompressor(10,"AttributeOperation",Na),this._registerOperationCompressor(11,"InsertOperation",xa),this._registerOperationCompressor(12,"MarkerOperation",Va),this._registerOperationCompressor(13,"MergeOperation",Da),this._registerOperationCompressor(14,"MoveOperation",Da),this._registerOperationCompressor(15,"RenameOperation",Da),this._registerOperationCompressor(16,"RootAttributeOperation",Na),this._registerOperationCompressor(17,"SplitOperation",Da),this._registerCompressor(18,"CommentMarkerOperation",new Ba(18,"MarkerOperation",e,"comment")),this._registerCompressor(19,"SuggestionMarkerOperation",new Ba(19,"MarkerOperation",e,"suggestion")),this._registerOperationCompressor(20,"RootOperation",Da),this._registerActionCompressor(100,"TypingAction",Ja),this._registerActionCompressor(101,"DeletingAction",qa),this._registerActionCompressor(102,"ForwardDeletingAction",La),this._registerActionCompressor(103,"UserSelectionAction",Ga)}compress(e){if(!e||!e[0])throw new r.CKEditorError("no-operations-provided",this);const t={types:[],buffers:[],baseVersion:e[0].baseVersion};for(;e.length;)this._getCompressorByName("UserSelectionAction").compress(t,e)||this._getCompressorByName("TypingAction").compress(t,e)||this._getCompressorByName("DeletingAction").compress(t,e)||this._getCompressorByName("ForwardDeletingAction").compress(t,e)||this._getCompressorByName("CommentMarkerOperation").compress(t,e)||this._getCompressorByName("SuggestionMarkerOperation").compress(t,e)||this._getCompressorByName(e[0].__className).compress(t,e);return t}decompress(e){const t=[];for(;e.types.length;){this._compressorById.get(e.types[0]).decompress(t,e)}return t.forEach(((t,n)=>t.baseVersion=e.baseVersion+n)),t}_getCompressorByName(e){return this._compressorByName.get(e)}_registerOperationCompressor(e,t,n){const r=new n(e,t,this._protobufFactory.getDescriptor(t));this._registerCompressor(e,t,r)}_registerActionCompressor(e,t,n){const r=new n(e,this);this._registerCompressor(e,t,r)}_registerCompressor(e,t,n){this._compressorById.set(e,n),this._compressorByName.set(t,n)}}const Fa=Ha;function Ha(e,t){const n=$a();return(Ha=function(e,t){return n[e-=434]})(e,t)}!function(e,t){const n=Ha,r=e();for(;;)try{if(380478===parseInt(n(648))/1*(parseInt(n(591))/2)+parseInt(n(547))/3*(-parseInt(n(450))/4)+-parseInt(n(523))/5*(parseInt(n(489))/6)+parseInt(n(571))/7+-parseInt(n(490))/8*(-parseInt(n(491))/9)+-parseInt(n(604))/10+parseInt(n(691))/11*(parseInt(n(453))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}($a);let za=1;class Ka extends n.Plugin{static get[Fa(651)](){return[lr,yr,Sr,n.PendingActions,pr.Users,s.Notification]}static get[Fa(497)](){return Fa(619)}get[Fa(486)](){const e=Fa;return this[e(493)]+this[e(478)]}get[Fa(493)](){const e=Fa;return this[e(512)][e(641)]-this[e(478)]}get[Fa(471)](){const e=Fa,t=this[e(512)][e(474)]();for(let n=t[e(558)]-1;n>=0;n--){const r=t[n];if(!this[e(588)][e(437)](r))return r[e(687)]+1-this[e(478)]}return 0}constructor(e){const t=Fa;if(super(e),this[t(478)]=0,this[t(612)]=null,this[t(512)]=new o.History,this[t(541)][t(459)][t(585)](t(567),{}),this[t(587)]=this[t(541)][t(459)][t(623)](t(446)),!this[t(587)])throw new r.CKEditorError(t(633),this);const n=e[t(459)][t(623)](t(525))||r.version;this[t(481)]=new(Ka[t(522)])(n,this[t(587)]),this[t(488)]=this[t(541)][t(625)][t(595)],this[t(454)]=new Ya,this[t(632)]=[],this[t(634)]=new WeakSet,this[t(500)]=new Set,this[t(600)](t(436),!1),this[t(600)](t(482),!1),this[t(470)]=null,this[t(492)]=!1,this[t(528)]=null,this[t(682)]=300,this[t(495)]=this[t(682)],this[t(598)]=null,this[t(588)]=new WeakSet,this[t(443)]=new Za(this[t(588)])}[Fa(468)](){const e=Fa,t=this[e(541)],n=t[e(582)][e(623)](pr.Users),r=t[e(582)][e(623)](lr);this[e(550)](n,e(526),((t,r)=>{const s=e,o=r[0];o[s(671)]&&(t[s(498)]=n[s(552)](o[s(671)]),t[s(601)]()),null===o[s(671)]&&(t[s(498)]=null,t[s(601)]())}),{priority:e(494)}),this[e(550)](t[e(625)][e(595)][e(554)],e(559),((t,n)=>{const r=e;n[r(657)]&&this[r(469)]()})),this[e(550)](t[e(515)][e(461)],e(503),(()=>{this[e(469)]()})),this[e(556)](),t[e(625)].on(e(631),((t,n)=>{const r=e,s=n[0];s[r(467)]&&(this[r(617)](s),this[r(662)]()&&this[r(622)]())})),this[e(464)](),this[e(434)](e(620)).to(r,e(575),this,e(482),((t,n)=>e(511)===t&&!n)),this.on(e(670),(()=>{const n=e;this[n(620)]?t[n(590)](n(594)):t[n(603)](n(594))})),this[e(620)]?t[e(590)](e(594)):t[e(603)](e(594)),this[e(600)](e(465),!1)}async[Fa(460)](){const e=Fa,t=this[e(541)][e(582)][e(623)](yr),n=this[e(541)][e(582)][e(623)](lr);try{this[e(436)]=!0,t[e(529)](this[e(587)]);const r=await this[e(481)][e(460)](n[e(538)],this[e(471)]);await this[e(616)](r)&&(this[e(436)]=!1,this[e(561)]());const s=await this[e(481)][e(536)]();t[e(544)](this[e(587)],s),this[e(672)](),this[e(465)]=!0}catch(t){if(function(t){const n=e;return n(542)===t[n(580)]}(t)&&this[e(612)])await this[e(440)]();else if(function(t){const n=e;return n(560)===t[n(580)]}(t)){const t=Tr(this[e(541)][e(563)],e(608));this[e(685)](t)}else{if(!(t instanceof Qa))throw t;this[e(685)]()}}}[Fa(438)](){const e=Fa,t=this[e(541)][e(582)][e(623)](lr),n=this[e(541)][e(582)][e(623)](yr);this[e(541)][e(603)](e(487)),n[e(584)][e(437)](this[e(587)])&&n[e(529)](this[e(587)]),t[e(668)](this),this[e(627)](),super[e(438)]()}async[Fa(616)](e){const t=Fa;if(this[t(612)]!==e[t(612)]&&this[t(598)]!==e[t(677)])throw new Qa;return this[t(612)]=e[t(612)],this[t(643)]([],{...e,wereChangesApplied:!1,data:e[t(535)]},t(460))}async[Fa(692)](e,t=!1){const n=Fa,{connection:r}=this[n(541)][n(582)][n(623)](lr);Ka[n(522)][n(536)](r,this[n(587)])[n(636)]((e=>this[n(653)](e)))[n(574)]((e=>{const t=n;this[t(545)](t(581),e)})),this[n(550)](this[n(481)],n(597),this[n(449)][n(434)](this)),this[n(550)](this[n(481)],n(527),((e,t)=>{const r=n;this[r(545)](r(543),t)})),this[n(550)](this[n(481)],n(475),(()=>{this[n(465)]=!1}));const s=this[n(443)][n(480)](e);this[n(436)]=!0;const o=await this[n(481)][n(508)](r,this[n(456)](e),s);if(this[n(612)]=o[n(612)],t){if(!o[n(555)])return void this[n(685)]();this[n(436)]=!1,this[n(561)](),this[n(512)][n(637)](),this[n(478)]=o[n(524)],this[n(512)][n(641)]=this[n(478)],await this[n(643)](e,o,n(624))}else await this[n(457)](o,e);this[n(672)](),this[n(465)]=!0}[Fa(672)](){const e=Fa,t=this[e(541)][e(582)][e(623)](yr),n=this[e(541)][e(582)][e(623)](Sr),r=t[e(584)][e(623)](this[e(587)]);r&&r[e(558)]>1?n[e(549)]():this[e(550)](t,e(683)+this[e(587)],(()=>{const r=e;2===t[r(584)][r(623)](this[r(587)])[r(558)]&&n[r(549)]()}))}async[Fa(449)](e,t,n,r){const s=Fa;if(!this[s(436)]&&this[s(488)][s(641)]==t){const e=this[s(564)](n,r);await this[s(673)](e),this[s(510)](e,t,n[s(677)])||this[s(545)](s(605))}}async[Fa(440)](){const e=Fa;this[e(627)]();const{locale:t}=this[e(541)];let n;try{n=await this[e(481)][e(650)]()}catch(n){const r=Tr(t,e(675));return void this[e(685)](r)}const r=n[e(649)]||n[e(638)];if(this[e(598)]===r[e(677)])await this[e(692)](this[e(541)][e(625)][e(595)][e(645)][e(474)](),!0);else{const n=Tr(t,e(652));this[e(685)](n)}}[Fa(627)](){const e=Fa;this[e(481)][e(533)](),this[e(632)]=[],clearTimeout(this[e(528)]),this[e(589)](this[e(481)])}[Fa(653)](e){const t=Fa,n=this[t(541)][t(582)][t(623)](yr);this[t(550)](n,t(683)+this[t(587)],((e,{session:r})=>{const s=t;if(r.id===n[s(665)]){e[s(680)]();const t=this[s(541)][s(582)][s(437)](s(530))&&this[s(541)][s(582)][s(623)](s(530));let n=r[s(689)];t&&t[s(684)]&&(n=n[s(509)]((e=>s(596)!==e))),this[s(541)][s(582)][s(623)](s(505))[s(656)](n,this[s(587)])}})),n[t(544)](this[t(587)],e)}[Fa(556)](){const e=Fa,t=this[e(541)][e(535)][e(600)];this[e(541)][e(535)][e(600)]=(...n)=>{const s=e;if(!n[n[s(558)]-1][s(607)])throw new r.CKEditorError(s(644),this);t[s(569)](this[s(541)][s(535)],n)}}[Fa(464)](){const e=Fa;this[e(541)][e(535)].on(e(468),((t,[n])=>{const s=e;if(this[s(488)][s(641)])throw new r.CKEditorError(s(583),this);t[s(601)](),this[s(618)]();const i=this[s(541)][s(459)][s(623)](s(519)),a=this[s(477)](n,i);0==a[s(558)]&&a[s(681)](new o.NoOperation(0)),t[s(498)]=this[s(692)](a)[s(636)]((()=>{const e=s;this[e(541)][e(582)][e(623)](lr)[e(611)](this),this[e(541)][e(535)][e(614)](e(658))}))[s(574)]((e=>this[s(545)](s(504),e)))[s(688)]((()=>this[s(561)]()))}),{priority:e(494)}),this[e(541)].on(e(659),(async(t,[n,r])=>{const s=e;t[s(601)]();const o=this[s(541)][s(625)][s(595)][s(531)](n);if(!this[s(500)][s(437)](n)){const e=r&&r[s(535)]?r[s(535)]:"",t=r&&r[s(669)]?r[s(669)]:{};await this[s(534)](n,e,t)}this[s(541)][s(625)][s(655)]({isUndoable:!1},(()=>{const e=s;o[e(615)]=!0,this[e(541)][e(625)][e(595)][e(690)][e(507)](o)}))}),{priority:e(494)})}async[Fa(673)](e){const t=Fa,n=this[t(541)][t(582)][t(623)](pr.Users),{connection:r}=this[t(541)][t(582)][t(623)](lr),s=new Set;for(const r of e){const e=r[t(671)];e&&!n[t(552)](e)&&s[t(548)](e)}if(0===s[t(441)])return;const o=await Ye[t(579)](r,Array[t(499)](s));for(const e of o)n[t(552)](e.id)||n[t(472)](e)}[Fa(477)](e,t={}){const n=Fa,s=this[n(541)][n(625)],i=[];let a=0;const c=n(613)==typeof e?{main:e}:e;for(const e of Object[n(593)](c)){if(!this[n(488)][n(485)][n(437)](e))throw new r.CKEditorError(n(586),this);const t=this[n(541)][n(535)][n(439)](c[e]),d=this[n(488)][n(531)](e),u=new o.InsertOperation(s[n(466)](d,0),t,a++);i[n(681)](u);for(const[e,r]of t[n(516)]){const t=s[n(621)](s[n(521)](d,r[n(442)][n(517)][n(678)]()),s[n(521)](d,r[n(609)][n(517)][n(678)]())),c=new o.MarkerOperation(e,null,t,s[n(516)],!0,a++);i[n(681)](c)}}if(t)for(const[e,c]of Object[n(463)](t)){const t=s[n(595)][n(531)](e);if(!t)throw new r.CKEditorError(n(476),null);for(const[e,r]of Object[n(463)](c))if(null!==r){const s=new o.RootAttributeOperation(t,e,null,r,a++);i[n(681)](s)}}return i}async[Fa(534)](e,t,n){const r=Fa;this[r(477)]({[e]:t},{[e]:n})[r(513)](((e,t)=>{const n=r;e[n(687)]=this[n(488)][n(641)]+t,e[n(602)]=!0,this[n(617)](e)})),this[r(622)](),await this[r(452)]()}async[Fa(457)](e,t){const n=Fa;let r;this[n(478)]=e[n(524)];const s=e[n(555)]&&!e[n(628)],o=s?0:e[n(535)][n(687)];if(t[n(513)]((t=>{const r=n;t[r(602)]=!0,t[r(496)]=e[r(674)],t[r(671)]=null})),s)r=t,this[n(473)](r,s);else{if(e[n(628)]){const t=this[n(477)](e[n(628)]);this[n(488)][n(645)][n(641)]=-t[n(558)],t[n(513)]((r=>{const s=n;r[s(687)]-=t[s(558)],r[s(496)]=e[s(674)],r[s(602)]=!0,r[s(671)]=null})),this[n(473)](t,!0),this[n(512)][n(641)]=-t[n(558)]+this[n(478)],this[n(676)](t)}this[n(488)][n(645)][n(641)]=o,r=this[n(564)](e[n(535)],e[n(679)]),await this[n(673)](r),this[n(473)](r,s)}e[n(677)]&&(this[n(443)][n(447)](r,e[n(677)]),this[n(598)]=e[n(677)]),this[n(512)][n(641)]=o+this[n(478)],this[n(676)](r),t[n(509)]((e=>{const t=n,r=this[t(518)](e);return r&&!this[t(500)][t(437)](r)}))[n(513)](((e,t)=>{const r=n;e[r(687)]=this[r(488)][r(641)]+t,this[r(617)](e)})),this[n(662)]()?(this[n(495)]=0,this[n(622)](!0),await this[n(452)]()):(this[n(436)]=!1,this[n(561)]())}[Fa(545)](e,t){const n=Fa;throw this[n(436)]=!0,t&&console[n(527)](t),new r.CKEditorError(e,this[n(541)])}[Fa(617)](e){const t=Fa;this[t(634)][t(437)](e)||(this[t(634)][t(548)](e),this[t(632)][t(681)](e),this[t(470)]||t(551)==e[t(435)]&&!e[t(557)]||this[t(618)]())}[Fa(622)](e=!1){const t=Fa;!e&&this[t(436)]||(this[t(436)]=!0,clearTimeout(this[t(528)]),this[t(528)]=setTimeout((()=>{const e=t;this[e(630)]()[e(636)]((t=>{const n=e;t&&(this[n(561)](),this[n(436)]=!1)}))[e(574)]((t=>{const n=e;if(this[n(561)](),this[n(436)]=!1,!function(e){const t=n;return e[t(540)][t(445)](t(546))||e[t(540)][t(445)](t(686))||e[t(540)][t(445)](t(483))}(t))throw t}))}),this[t(495)]))}[Fa(452)](){return new Promise((e=>{const t=Ha;this.on(t(566),(()=>{e()}))}))}async[Fa(630)](){const e=Fa,t=this[e(541)][e(582)][e(623)](Sr);if(this[e(629)]()&&(t[e(549)](),this[e(492)]=!1),!this[e(662)]())return!0;const n=[...this[e(632)]];for(const t of n)t[e(576)]=this[e(488)][e(645)][e(646)](t);const r=this[e(443)][e(480)](n),s=za++,o=this[e(456)](n),i=await this[e(481)][e(562)](o,o[e(687)],r);try{return await this[e(643)](n,i,s)}catch(t){return this[e(545)](e(664),t)}}async[Fa(643)](e,t,n){const r=Fa;if(r(527)in t)throw t[r(527)];let s=!1;if(t[r(555)]){t[r(677)]&&(this[r(598)]=t[r(677)]),this[r(632)]=this[r(632)][r(509)]((t=>!e[r(654)](t)));for(const n of e)n[r(496)]=r(502)in t&&t[r(502)]||void 0;Xa(e,t[r(641)]-e[r(558)]),this[r(676)](e);const n=e[r(509)]((e=>{const t=r;if(!e[t(602)])return!1;const n=this[t(518)](e);return n&&!this[t(500)][t(437)](n)}));Xa(n,this[r(488)][r(641)]),this[r(473)](n),s=!0,this[r(495)]=this[r(682)]}else{const e=this[r(564)](t[r(535)],t[r(679)])[r(509)]((e=>e[r(687)]>=this[r(493)]));e[r(513)]((e=>this[r(532)](e))),this[r(632)]=this[r(632)][r(509)]((e=>!e[r(602)]||!this[r(500)][r(437)](this[r(518)](e)))),this[r(632)][r(558)]&&Xa(this[r(632)],this[r(632)][0][r(687)]),await this[r(673)](e),s=this[r(510)](e,t[r(641)],t[r(677)]),this[r(495)]=Math[r(599)](this[r(495)]/2)}return s?!this[r(662)]()||(this[r(622)](!0),!1):this[r(545)](r(444))}[Fa(510)](e,t,n){const r=Fa;try{const s={document:this[r(488)],useRelations:!1,padWithNoOps:!0},{operationsA:i,operationsB:a,originalOperations:c}=(0,o.transformSets)(e,this[r(632)],s);Xa(i,this[r(488)][r(641)]),Xa(a,t);for(const e of i){const t=c[r(623)](e);e[r(671)]=t?t[r(671)]:null}n&&(this[r(443)][r(447)](e,n),this[r(598)]=n),this[r(632)]=[...a],this[r(473)](i),this[r(676)](e)}catch(e){return console[r(527)](e),!1}return!0}[Fa(473)](e,t=!1){const n=Fa;this[n(541)][n(625)][n(655)]({isUndoable:!1,isLocal:!1},(t=>{const r=n;for(const n of e)this[r(634)][r(548)](n),this[r(532)](n),t[r(479)][r(455)](n),this[r(541)][r(625)][r(631)](n)}))}[Fa(532)](e){const t=Fa,n=this[t(518)](e);n&&this[t(500)][t(548)](n)}[Fa(518)](e){const t=Fa;let n,r;switch(e[t(435)]){case t(578):n=e[t(642)][t(660)];break;case t(551):if(r=e[t(610)],!r)return null;n=r[t(660)];break;case t(448):n=e[t(660)];break;case t(553):n=e[t(501)];break;case t(514):n=e[t(666)][t(660)];break;default:return null}return n[t(667)]}[Fa(676)](e){const t=Fa;e[t(513)]((e=>{const n=t,r=e[n(539)]();r[n(671)]=e[n(671)],r[n(602)]=!!e[n(602)],r[n(496)]=e[n(496)],r[n(687)]+=this[n(478)],e[n(451)]&&this[n(588)][n(548)](r),this[n(512)][n(455)](r)}))}[Fa(685)](e){const t=Fa,n=this[t(541)][t(582)][t(623)](t(484)),r=this[t(541)][t(563)];e||(e=Tr(r,t(663))),n[t(572)](e,{title:Tr(r,t(462)),namespace:t(565)}),this[t(482)]=!0,clearTimeout(this[t(528)]),this[t(632)]=[],this[t(541)][t(582)][t(623)](lr)[t(438)]()}[Fa(618)](){const e=Fa;this[e(470)]||(this[e(470)]=this[e(541)][e(582)][e(623)](n.PendingActions)[e(548)](Tr(this[e(541)][e(563)],e(606))))}[Fa(561)](){const e=Fa;this[e(470)]&&(this[e(541)][e(582)][e(623)](n.PendingActions)[e(573)](this[e(470)]),this[e(470)]=null)}[Fa(456)](e){const t=Fa,n=e[t(577)]((e=>e[t(639)]()));return this[t(454)][t(693)](n)}[Fa(564)](e,t){const n=Fa;return this[n(454)][n(506)](e)[n(577)](((e,r)=>{const s=n,i=s(468)==t[r][s(435)];if(s(520)==e[s(458)]){const t=e[s(642)][s(660)];!this[s(488)][s(531)](t)&&(this[s(488)][s(592)](s(640),t)[s(568)]=!1)}const a=o.OperationFactory[s(647)](e,this[s(488)]);return a[s(576)]=e[s(576)],a[s(602)]=i,a[s(671)]=i?null:t[r][s(626)],a[s(451)]=s(570)===t[r][s(435)],a[s(496)]=t[r][s(496)],a}))}[Fa(469)](){const e=Fa;this[e(492)]=!0,this[e(629)]()?this[e(622)]():this[e(492)]=!1}[Fa(629)](){const e=Fa,t=this[e(541)][e(582)][e(623)](yr)[e(584)][e(623)](this[e(587)]);return!this[e(541)][e(661)]&&!!t&&t[e(558)]>1&&this[e(492)]}[Fa(662)](){const e=Fa;return this[e(632)][e(558)]>0||this[e(629)]()}}Ka[Fa(522)]=Bn;const Wa=Ka;function $a(){const e=["_handleReconnectionError","cloud-services-internal-error: Collaborative Editing Service is not connected.","baseVersion","finally","permissions","differ","11698258KkRJzI","_connectService","compress","bind","type","_isPendingUpdate","has","destroy","parse","_connectAfterSessionHasBeenFlushed","size","start","_operationIdentifier","realtimecollaborationclient-handleserverresponse","startsWith","collaboration.channelId","setIdForTheLastOperation","addRootAttribute","_handleReceivedOperations","128IvTevo","_isDisconnection","_waitUntilSynced","12YbxnML","_compressor","addOperation","_compressOperations","_handleInitialConnectionData","__className","config","reconnect","view","Synchronization issue","entries","_setUpDataInit","_isConnected","createPositionAt","isDocumentOperation","init","_refreshUserSelectionMarkers","_pendingAction","lastSyncVersion","addUser","_applyOperationsSet","getOperations","disconnected","multi-root-editor-root-attributes-no-root","_getOperationsFromInitData","_offset","batch","getIdOfTheLastOperation","_service","_hasSynchronizationProblem","cloud-services-internal-error: Request timeout.","Notification","roots","cloudDocumentVersion","rtc-destroyed","_document","155424BqKBkR","16LPsntj","1165239HCXpfb","_hasSelectionChanged","_lastServerVersion","high","_currentBufferDelay","createdAt","pluginName","return","from","_knownRootNames","affectedSelectable","lastOperationAcceptedAt","change:hasDomSelection","realtimecollaborationclient-init-connection-failed","Permissions","decompress","_bufferRootLoad","connect","filter","_handleExternalOperations","connected","serverHistory","forEach","move","editing","markers","path","_getAffectedRoot","rootsAttributes","InsertOperation","createPositionFromPath","CollaborativeEditingService","90LjlHmA","offset","cloudServices.bundleVersion","getOperationAuthor","error","_sendBufferedOperationsDelayId","unregister","CommentsOnly","getRoot","_addKnownRoot","disconnect","_loadRoot","data","getConnectedSessions","_operationToId","connection","clone","message","editor","404","realtimecollaborationclient-initservice-internal-error","register","_crash","cloud-services-internal-error: Not connected.","66951QrZVFe","add","createUserMarkerOperations","listenTo","marker","getUser","addRoot","selection","wereChangesApplied","_initThrowingOnDataSet","affectsData","length","change:range","409","_clearPendingAction","sendOperations","locale","_decompressOperations","real-time-collaboration","change:_isPendingUpdate","collaboration","_isAttached","apply","cs:removeUser","2633743EWBQMR","showWarning","remove","catch","state","wasUndone","map","insert","getMany","code","realtimecollaborationclient-init-session-connection-error","plugins","realtimecollaborationclient-init-document-already-initialized","channelSessions","define","realtimecollaborationclient-init-non-existent-root","_channelId","_disconnectionOperations","stopListening","disableReadOnlyMode","328590eUByuy","createRoot","keys","rtc-offline","document","document:write","operationsReceived","_lastSyncedOperationId","round","set","stop","_isInit","enableReadOnlyMode","4663650bhaosA","realtimecollaborationclient-initservice-incorrect-server-operation","PENDING_ACTION_SENDING_DATA","suppressErrorInCollaboration","The document cannot be connected back to the server. To not lose your content save it locally and refresh the editor.","end","newRange","addToReconnectionStack","sessionId","string","fire","_isLoaded","_handleReconnectionResponse","_saveOperationInBuffer","_setPendingAction","RealTimeCollaborationClient","_isEditingAllowed","createRange","_sendBufferedOperationsDelayed","get","reconnection: flushed session","model","userId","_disconnectService","initData","_shouldSendSelectionUpdate","_sendBufferedOperations","applyOperation","_bufferedOperations","collaboration-missing-channelid","_knownOperations","_ignoredOperations","then","reset","lastDocumentSession","toJSON","$root","version","position","_handleServerResponse","realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration","history","isUndoneOperation","fromJSON","2kGtcgd","currentDocumentSession","getDocumentDetails","requires","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.","_initSessionsHandling","includes","enqueueChange","setPermissions","directChange","ready","loadRoot","root","isReadOnly","_shouldSendUpdate","The local document and server document differ and merging them can cause unexpected behavior. To not lose your content save it locally and refresh the editor.","realtimecollaborationclient-sendbufferedoperations","mySessionId","targetPosition","rootName","removeFromReconnectionStack","attributes","change:_isEditingAllowed","_authorId","_handleSendingSelectionMarkers","_fetchMissingUsers","sessionCreatedAt","The document details could not be taken during the reconnection. To not lose your content save it locally and refresh the editor.","_updateServerHistory","lastOperationId","slice","metadata","off","push","_baseBufferDelay","sessionAdd:","isEnabled"];return($a=function(){return e})()}class Qa extends Error{}function Xa(e,t){const n=Fa;for(const r of e)r[n(687)]=t++}class Za{constructor(e){const t=Fa;this[t(635)]=e,this[t(537)]=new WeakMap}[Fa(480)](e){const t=Fa;let n=e[t(558)];for(;n--;){const s=e[n];if(!this[t(635)][t(437)](s)){if(!this[t(537)][t(437)](s)){const e=(0,r.uid)()[t(678)](1,18);this[t(537)][t(600)](s,e)}return this[t(537)][t(623)](s)}}}[Fa(447)](e,t){const n=Fa;if(!t)return;let r=e[n(558)];for(;r--;){const s=e[r];this[n(635)][n(437)](s)||this[n(537)][n(600)](s,t)}}}function ec(e,t){var n=nc();return(ec=function(e,t){return n[e-=262]})(e,t)}var tc=ec;function nc(){var e=["341022ePwqDi","757176hONPZe","1542RSzDey","3510360qUIwOG","3338bgqiSG","pluginName","396725fyoGcC","requires","18622125pfeMjF","RealTimeCollaborativeEditing","1891148FElFSm","105mQxEIu"];return(nc=function(){return e})()}!function(e,t){for(var n=ec,r=e();;)try{if(620791===parseInt(n(263))/1+-parseInt(n(273))/2*(parseInt(n(271))/3)+parseInt(n(267))/4+-parseInt(n(272))/5+parseInt(n(269))/6*(-parseInt(n(268))/7)+parseInt(n(270))/8+parseInt(n(265))/9)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(nc);class rc extends n.Plugin{static get[tc(264)](){return[Wa]}static get[tc(262)](){return tc(266)}}const sc=oc;function oc(e,t){const n=ic();return(oc=function(e,t){return n[e-=408]})(e,t)}function ic(){const e=["getMany","has","resolvedAt","_getService","commentThreadReopened","deletedAt","updateComment","getCommentThreads","_fetchMissingUsersForThreads","userId","updateCommentThread","from","connect","275010Umsehv","listenTo","1818520zkcsxV","commentRemoved","disconnect","map","Permissions","init","246Rrxrem","getComment","resolvedBy","getConnectedSessions","permissions","_services","startsWith","message","CloudServicesCommentsAdapter","size","getCommentThread","remove","collaboration.channelId","520lkVbkK","reopenCommentThread","CommentsService","_connectService","get","65MKdgro","requires","config","resolve","_setUpService","commentThreadAdded","unregister","comments","catch","commentId","removeComment","createdAt","add","commentThreadRemoved","cloudservicescommentsadapter-disconnect-not-exist","assign","cloud-services-internal-error: Comments Service is not connected.","getUser","mySessionId","commentUpdated","adapter","404","setPermissions","4642BPqIkz","update","addUser","off","19791bKLSRC","addToReconnectionStack","cloudservicescommentsadapter-service-not-exist","authorId","content","commentThreadId","resolveCommentThread","reopen","register","addComment","addCommentThread","commentThreadResolved","3494582SqLUDB","47003EUGJPf","removeCommentThread","cloudservicescommentsadapter-connect-already-connected","plugins","cloud-services-internal-error: Request timeout.","keys","set","sessionAdd:","691327moFogL","_terminateService","cloud-services-internal-error: Not connected.","pluginName","reconnect","commentAdded","context","delete","attributes","code","commentThreadUpdated","CommentsRepository","330pbbDQp","destroy"];return(ic=function(){return e})()}!function(e,t){const n=oc,r=e();for(;;)try{if(384118===-parseInt(n(477))/1+-parseInt(n(452))/2*(parseInt(n(411))/3)+parseInt(n(506))/4+parseInt(n(429))/5*(parseInt(n(504))/6)+parseInt(n(468))/7+-parseInt(n(424))/8*(parseInt(n(456))/9)+-parseInt(n(489))/10*(parseInt(n(469))/11))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(ic);class ac extends n.ContextPlugin{static get[sc(430)](){return[lr,sc(488),yr,pr.Users]}static get[sc(480)](){return sc(419)}constructor(e){const t=sc;super(e),this[t(416)]=new Map}async[sc(410)](){const e=sc,t=this[e(483)],r=t[e(472)][e(428)](e(488));if(t[e(472)][e(428)](lr)[e(457)](this),r[e(449)]={addCommentThread:async({channelId:t,threadId:n,comments:r,resolvedAt:s,resolvedBy:o,context:i,attributes:a})=>{const c=e,d=await this[c(494)](t)[c(466)]({commentThreadId:n,comments:r[c(408)]((e=>function(e,t,n){const r=c;return{commentThreadId:n,commentId:e[r(438)],userId:e[r(459)],content:e[r(460)],documentId:t,createdAt:e[r(440)],attributes:e[r(485)]||{}}}(e,t,n))),resolvedAt:s,resolvedBy:o,context:i,attributes:a})[c(437)](uc);return{threadId:d[c(461)],comments:d[c(436)]}},getCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(494)](t)[r(421)](n)[r(437)](uc);return await this[r(499)]([s]),{threadId:s[r(461)],comments:s[r(436)][r(408)](lc),context:s[r(483)],resolvedAt:s[r(493)],resolvedBy:s[r(413)],attributes:s[r(485)]||{}}},updateCommentThread:async({channelId:t,threadId:n,context:r,unlinkedAt:s,attributes:o})=>this[e(494)](t)[e(501)]({commentThreadId:n,context:r,attributes:o,unlinkedAt:s})[e(437)](dc)[e(437)](uc),resolveCommentThread:async({channelId:t,threadId:n})=>{const r=e,s=await this[r(494)](t)[r(462)](n)[r(437)](dc)[r(437)](uc);return{threadId:s[r(461)],resolvedAt:s[r(493)],resolvedBy:s[r(413)]}},reopenCommentThread:async({channelId:t,threadId:n})=>this[e(494)](t)[e(425)](n)[e(437)](dc)[e(437)](uc),removeCommentThread:({channelId:t,threadId:n})=>this[e(494)](t)[e(470)](n)[e(437)](dc)[e(437)](uc),addComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(494)](t)[e(465)](n,r,s,o)[e(437)](uc),updateComment:({channelId:t,threadId:n,commentId:r,content:s,attributes:o})=>this[e(494)](t)[e(497)](n,r,s,o)[e(437)](dc)[e(437)](uc),removeComment:({channelId:t,threadId:n,commentId:r})=>this[e(494)](t)[e(439)](n,r)[e(437)](dc)[e(437)](uc)},t instanceof n.Context){const n=t[e(431)][e(428)](e(423)),r=t[e(472)][e(428)](yr);await this[e(433)](n);const s=await this[e(416)][e(428)](n)[e(414)]();this[e(505)](r,e(476)+n,((t,{session:s})=>{const o=e;s.id===r[o(447)]&&(t[o(455)](),this[o(483)][o(472)][o(428)](o(409))[o(451)](s[o(415)],n))})),r[e(464)](n,s)}}async[sc(433)](e){const t=sc;if(this[t(416)][t(492)](e))throw new r.CKEditorError(t(471),null,{channelId:e});const n=this[t(483)][t(472)][t(428)](t(488)),s=new(ac[t(426)])(e);this[t(416)][t(475)](e,s),this[t(505)](s,t(434),((e,r)=>{const s=t,{commentThreadId:o,documentId:i,context:a,attributes:c,resolvedAt:d,resolvedBy:u,comments:l}=r;n[s(421)](o)||n[s(466)]({threadId:o,channelId:i,comments:l?l[s(408)](lc):[],context:a,attributes:c,resolvedAt:d,resolvedBy:u,isFromAdapter:!0})})),this[t(505)](s,t(487),((e,{commentThreadId:r,documentId:s,context:o,unlinkedAt:i,attributes:a})=>{const c=t;n[c(421)](r)&&n[c(501)]({threadId:r,channelId:s,context:o,unlinkedAt:i,attributes:a,isFromAdapter:!0})})),this[t(505)](s,t(467),((e,{commentThreadId:r,resolvedBy:s,resolvedAt:o})=>{const i=t,a=n[i(421)](r);a&&a[i(432)]({resolvedBy:s,resolvedAt:o,isFromAdapter:!0})})),this[t(505)](s,t(495),((e,{commentThreadId:r})=>{const s=t,o=n[s(421)](r);o&&o[s(463)]({isFromAdapter:!0})})),this[t(505)](s,t(442),((e,{commentThreadId:r})=>{const s=t,o=n[s(421)](r);o&&o[s(422)]({isFromAdapter:!0})})),this[t(505)](s,t(482),((e,r)=>{const s=t,o=r[s(461)],i=n[s(421)](o);i&&i[s(465)]({...lc(r),isFromAdapter:!0})})),this[t(505)](s,t(448),((e,{commentThreadId:r,commentId:s,content:o,attributes:i})=>{const a=t,c=n[a(421)](r);if(c){const e=c[a(412)](s);e&&e[a(453)]({content:o,attributes:i,isFromAdapter:!0})}})),this[t(505)](s,t(507),((e,{commentThreadId:r,commentId:s})=>{const o=t,i=n[o(421)](r);if(i){const e=i[o(412)](s);e&&e[o(422)]({isFromAdapter:!0})}})),await this[t(427)](e)}[sc(490)](){const e=sc;if(this[e(483)]instanceof n.Context){const t=this[e(483)][e(431)][e(428)](e(423));this[e(478)](t)}}[sc(478)](e){const t=sc;if(!this[t(416)][t(492)](e))throw new r.CKEditorError(t(443),null,{channelId:e});this[t(494)](e)[t(508)](),this[t(416)][t(484)](e)}async[sc(481)](){const e=sc;for(const t of this[e(416)][e(474)]())await this[e(427)](t);if(this[e(483)]instanceof n.Context){const t=this[e(483)][e(431)][e(428)](e(423)),n=this[e(483)][e(472)][e(428)](yr);n[e(435)](t);const r=await this[e(416)][e(428)](t)[e(414)]();n[e(464)](t,r)}}async[sc(427)](e){const t=sc,{connection:n}=this[t(483)][t(472)][t(428)](lr),r=this[t(483)][t(472)][t(428)](t(488)),s=this[t(416)][t(428)](e),o=await s[t(503)](n);await this[t(499)](o);const i=new Set(Array[t(502)](r[t(498)]({channelId:e}),(e=>e.id)));for(const e of o)e[t(496)]||i[t(484)](e[t(461)]);for(const e of i)r[t(421)](e)[t(422)]({isFromAdapter:!0});for(const n of o){let s=r[t(421)](n[t(461)]);const{commentThreadId:o,context:i,attributes:a,resolvedBy:c,resolvedAt:d,unlinkedAt:u,deletedAt:l}=n;if(l)continue;s||(s=r[t(466)]({channelId:e,threadId:o,context:i,attributes:a||{},resolvedBy:c,resolvedAt:d,unlinkedAt:u,isFromAdapter:!0}));const p=new Set(Array[t(502)](s[t(436)],(e=>e.id)));for(const e of n[t(436)])p[t(484)](e[t(438)]);for(const e of p)s[t(412)](e)[t(422)]({isFromAdapter:!0});for(const e of n[t(436)]){const n=s[t(412)](e[t(438)]);n?n[t(460)]!==e[t(460)]&&n[t(453)]({content:e[t(460)],isFromAdapter:!0}):s[t(465)](Object[t(444)](lc(e),{isFromAdapter:!0}))}}}[sc(494)](e){const t=sc;if(!this[t(416)][t(492)](e))throw new r.CKEditorError(t(458),null,{channelId:e});return this[t(416)][t(428)](e)}async[sc(499)](e){const t=sc,n=this[t(483)][t(472)][t(428)](pr.Users),{connection:r}=this[t(483)][t(472)][t(428)](lr),s=new Set;for(const{resolvedBy:r,comments:o}of e){r&&!n[t(446)](r)&&s[t(441)](r);for(const{userId:e}of o)n[t(446)](e)||s[t(441)](e)}if(0===s[t(420)])return;const o=await Ye[t(491)](r,Array[t(502)](s));for(const e of o)n[t(446)](e.id)||n[t(454)](e)}}ac[sc(426)]=ir;const cc=ac;async function dc(e){const t=sc;if(t(450)!==e[t(486)])throw e}function uc(e){const t=sc;if((n=e)[t(418)][t(417)](t(445))||n[t(418)][t(417)](t(479))||n[t(418)][t(417)](t(473)))return new Promise((()=>{}));var n;throw e}function lc(e){const t=sc;return{threadId:e[t(461)],commentId:e[t(438)],content:e[t(460)],createdAt:e[t(440)],authorId:e[t(500)],attributes:e[t(485)]||{}}}const pc=hc;function hc(e,t){const n=fc();return(hc=function(e,t){return n[e-=381]})(e,t)}function fc(){const e=["1707440fSFpFz","find","listenTo","_saved","_bufferedRequests","add","11511LNYPkq","connection","message","set","getUser","adapter","TrackChangesService","open","size","addToReconnectionStack","_waitForServiceReady","config","collaboration.channelId","attributes","cloud-services-internal-error: Not connected.","type","editor","6081790Vekchk","29OCSOHk","addSuggestionData","plugins","_fetchMissingUsersForThreads","TrackChangesEditing","then","3606ziYTFU","cloud-services-internal-error: Request timeout.","data","init","get","delete","1368WyygIr","state","reconnect","getSuggestion","update","connected","from","requires","connect","hasSuggestion","1394328YfYfXs","4xwVYLA","isConnected","catch","originalSuggestionId","42122wHwHJk","off","_trackChangesService","suggestionUpdated","4109ShiMAE","addUser","3204805ucHSSV","values","getMany","startsWith"];return(fc=function(){return e})()}!function(e,t){const n=hc,r=e();for(;;)try{if(342830===parseInt(n(398))/1*(-parseInt(n(425))/2)+parseInt(n(420))/3+parseInt(n(421))/4*(parseInt(n(431))/5)+parseInt(n(404))/6*(parseInt(n(429))/7)+-parseInt(n(410))/8*(-parseInt(n(441))/9)+-parseInt(n(435))/10+-parseInt(n(397))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(fc);class mc extends n.Plugin{static get[pc(417)](){return[cc,pc(402),lr]}constructor(e){const t=pc;super(e);const n=this[t(396)][t(391)][t(408)](t(392));this[t(439)]=new Map,this[t(427)]=new(mc[t(386)])(n)}[pc(407)](){const e=pc,t=this[e(396)][e(400)][e(408)](lr),n=this[e(396)][e(400)][e(408)](e(402));return n[e(385)]={getSuggestion:async t=>{const n=e;await this[n(390)]();const r=await this[n(427)][n(408)](t)[n(423)](yc);return await this[n(401)]([r]),r},addSuggestion:async({id:t,type:n,data:r,originalSuggestionId:s,attributes:o})=>{const i=e;await this[i(390)]();const a={id:t,type:n,data:r,originalSuggestionId:s,attributes:o},c=await this[i(427)][i(440)](t,n,r,s,o)[i(423)]((e=>{if(gc(e))return new Promise((e=>{const n=hc;this[n(439)][n(383)](t,{resolve:e,suggestionData:a})}));throw e}));return this[i(439)][i(409)](t),c},updateSuggestion:async(t,n)=>{const r=e;if(await this[r(390)](),r(387)!==n[r(411)])return this[r(427)][r(414)](t,n)[r(423)](yc)}},this[e(437)](this[e(427)],e(428),((t,r)=>{const s=e;n[s(419)](r.id)&&(n[s(413)](r.id)[s(393)]=r[s(393)])})),this[e(427)][e(418)](t[e(381)])[e(403)]((r=>(t[e(389)](this),this[e(401)](r)[e(403)]((()=>{const t=e;for(const e of r)n[t(399)](e)[t(438)]=!0})))))}async[pc(412)](){const e=pc,t=this[e(396)][e(400)][e(408)](e(402)),{connection:n}=this[e(396)][e(400)][e(408)](lr),r=await this[e(427)][e(418)](n);await this[e(401)](r);for(const{suggestionData:t,resolve:n}of this[e(439)][e(432)]()){let s=r[e(436)]((e=>e.id===t.id));s||(s=await this[e(427)][e(440)](t.id,t[e(395)],t[e(406)],t[e(424)])),n(s)}for(const n of r)t[e(419)](n.id)||t[e(399)](n)}async[pc(390)](){const e=pc;this[e(427)][e(422)]||await new Promise((t=>{const n=e;this[n(437)](this[n(427)],n(415),(e=>{e[n(426)](),t()}))}))}async[pc(401)](e){const t=pc,n=this[t(396)][t(400)][t(408)](pr.Users),{connection:r}=this[t(396)][t(400)][t(408)](lr),s=new Set;for(const{authorId:r}of e)n[t(384)](r)||s[t(440)](r);if(0===s[t(388)])return;const o=await Ye[t(433)](r,Array[t(416)](s));for(const e of o)n[t(384)](e.id)||n[t(430)](e)}}function yc(e){if(gc(e))return new Promise((()=>{}));throw e}function gc(e){const t=pc;return e[t(382)][t(434)](t(394))||e[t(382)][t(434)](t(405))}mc[pc(386)]=pn;const bc=wc;function Oc(){const e=["_terminateService","pluginName","1291660hOlliP","listenTo","connected","config","CommentsEditing","switchReadOnly","6176544NUfsXK","369tHdsjG","2223280bFGrjn","plugins","requires","_setUpService","change:state","3824DmarVZ","19609ZEdDsi","data","534igLlAC","Comments","editor","destroy","ready","isThreadsLoadingPaused","once","9gLdXbk","RealTimeCollaborativeComments","get","collaboration.channelId","CommentsRepository","12dMHaFK","693tfiOSq","init","462388GqufOT"];return(Oc=function(){return e})()}function wc(e,t){const n=Oc();return(wc=function(e,t){return n[e-=213]})(e,t)}!function(e,t){const n=wc,r=e();for(;;)try{if(379158===-parseInt(n(238))/1*(-parseInt(n(218))/2)+-parseInt(n(213))/3*(parseInt(n(221))/4)+parseInt(n(224))/5+parseInt(n(240))/6*(-parseInt(n(219))/7)+parseInt(n(237))/8*(parseInt(n(231))/9)+-parseInt(n(232))/10+parseInt(n(230))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Oc);class Ic extends n.Plugin{static get[bc(234)](){return[bc(241),cc,rc,lr]}static get[bc(223)](){return bc(214)}[bc(220)](){const e=bc,t=this[e(242)][e(233)][e(215)](lr),n=this[e(242)][e(233)][e(215)](e(228)),r=this[e(242)][e(233)][e(215)](cc);return this[e(242)][e(239)][e(246)](e(244),(()=>{const r=e;this[r(225)](t,r(236),((e,t,s)=>{const o=r;n[o(245)]=o(226)!==s}))})),this[e(225)](t,e(236),((t,n,r)=>{const s=e;this[s(242)][s(233)][s(215)](s(217))[s(229)](s(226)!==r)})),r[e(235)](this[e(242)][e(227)][e(215)](e(216)))}[bc(243)](){const e=bc;this[e(242)][e(233)][e(215)](cc)[e(222)](this[e(242)][e(227)][e(215)](e(216))),super[e(243)]()}}var vc=Ac;function Sc(){var e=["7224odJSbj","5460065LYvDsF","25070YvDkwp","3207300vcbEuM","143073hYykEY","3322DOEbBf","pluginName","10071MCyyWa","TrackChanges","requires","12TZDgMB","3cIExIj","2103606byBUQP","RealTimeCollaborativeTrackChanges","1118708JogFXx"];return(Sc=function(){return e})()}function Ac(e,t){var n=Sc();return(Ac=function(e,t){return n[e-=218]})(e,t)}!function(e,t){for(var n=Ac,r=e();;)try{if(569558===parseInt(n(222))/1+parseInt(n(220))/2*(-parseInt(n(219))/3)+-parseInt(n(226))/4+parseInt(n(224))/5+parseInt(n(218))/6*(-parseInt(n(227))/7)+-parseInt(n(223))/8*(-parseInt(n(230))/9)+-parseInt(n(225))/10*(parseInt(n(228))/11))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Sc);class Pc extends n.Plugin{static get[vc(232)](){return[Ic,mc,vc(231)]}static get[vc(229)](){return vc(221)}}const Tc=_c;function _c(e,t){const n=kc();return(_c=function(e,t){return n[e-=319]})(e,t)}function kc(){const e=["adapter","cloudServices.bundleVersion","remove","_revisions","_revisionTracker","connected","addToReconnectionStack","message","isConnected","_bufferedUpdates","addRevisionData","_bufferUpdate","from","serverHistory","cloud-services-internal-error: Not connected.","_fetchMissingUsers","_offset","config","toVersion","_isConnected","isEnabled","cloud-services-internal-error: Request timeout.","keys","400","isBundleUploaded","off","revisionsUpdated","3721912ykRPYz","size","connect","_preventResendingRevisionData","_revisionHistoryService","isEmptyCurrent","fromVersion","code","change:_isPendingUpdate","_handleReconnectionError","694001gKmHWM","collaboration.channelId","getMany","creatorId","repository","editor","_update","getRevision","add","marker","getRevisions","connection","reInit","setRevisionData","requires","_handleRevisionsUpdate","diffData","3360PCsWWY","catch","wrongRequestId","_getLatestVersionFromServerOperations","type","has","startsWith","_createCurrentRevision","data","affectsData","828186UZuAfS","_revisionDataBuilder","13424mfmISN","currentRevision","authors","RevisionTracker","sessionId","createdAt","init","destroy","plugins","_waitForServiceReady","setSource","once","_getLatestVersion","max","_fixRevision","state","listenTo","sendBufferedUpdates","get","8259132HOzzPW","reconnect","buildRevisionData","2mnUALT","cloud-services-internal-error: Revision History Service is not connected.","baseVersion","map","_isPendingUpdate","26055927FwClkk","RevisionHistoryService","change:_isConnected","getOperations","authorsIds","updateRevisions","addUser","length","CONNECTED","_lastRequestId","_startingVersion","_oldOffset","getUser","reverse","bind","then","6361000LIHUif"];return(kc=function(){return e})()}!function(e,t){const n=_c,r=e();for(;;)try{if(848720===parseInt(n(325))/1*(parseInt(n(376))/2)+parseInt(n(352))/3+parseInt(n(425))/4+parseInt(n(397))/5+parseInt(n(373))/6+-parseInt(n(342))/7*(parseInt(n(354))/8)+-parseInt(n(381))/9)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(kc);class Cc extends n.Plugin{static get[Tc(339)](){return[lr,Wa,Tc(357),yr,pr.Users]}constructor(e){const t=Tc;super(e);const n=this[t(330)][t(415)][t(372)](t(326));this[t(390)]=null,this[t(402)]=this[t(330)][t(362)][t(372)](t(357)),this[t(319)]=new(Cc[t(382)])(n)}async[Tc(360)](){const e=Tc,t=this[e(330)][e(362)][e(372)](Wa),n=t[e(411)],s=this[e(330)][e(362)][e(372)](lr);this[e(402)][e(364)]({history:n,getLatestVersion:()=>this[e(366)](),getCurrentRevisionId:()=>t[e(358)]});const o=this[e(330)][e(415)][e(372)](e(399))||r.version,i=await Jt[e(422)](s[e(336)],o);this[e(402)][e(398)]={getRevision:async({revisionId:t})=>(await this[e(363)](),await this[e(319)][e(332)](t)),updateRevisions:async t=>{const n=e;await this[n(363)]();const r=this[n(402)][n(355)];if(i&&1===t[n(388)]&&t[0].id===r.id)return t;for(const e of t)e.id===r.id&&(e[n(320)]=e[n(321)]===e[n(416)]);return this[n(319)][n(386)](t,this[n(390)])[n(396)]((e=>(this[n(390)]=e,t)))[n(343)]((e=>{const r=n;if(jc(e)||r(421)===e[r(322)]&&void 0!==e[r(350)][r(344)]){for(const e of t)!this[r(402)][r(329)][r(332)](e.id)||this[r(402)][r(409)](e.id,e,!1);if(jc(e))throw e;return t}throw e}))}},this[e(370)](this[e(319)],e(424),((t,{revisionsData:n,requestId:r})=>{const s=e;Math[s(367)](...n[s(379)]((e=>e[s(416)])))>this[s(345)]()-1?this[s(366)]()[s(396)]((()=>{this[s(340)](n,r)})):this[s(340)](n,r)}));const{revisions:a,requestId:c}=await this[e(319)][e(427)](s[e(336)]);s[e(404)](this),this[e(390)]=c,await this[e(413)](a);for(const t of a)this[e(402)][e(408)](t);this[e(370)](t,e(383),((n,r,s)=>{const o=e;s&&(this[o(392)]=t[o(414)],n[o(423)]())})),this[e(402)][e(395)](e(418)).to(s,e(369),(t=>t===Dt[e(389)]))}async[Tc(374)](){const e=Tc,t=this[e(330)][e(362)][e(372)](lr),n=this[e(330)][e(362)][e(372)](Wa),r=async()=>{const r=e,s=this[r(402)][r(355)],o=s.id,i=o!==n[r(358)];if(i){const e=n[r(414)]-this[r(392)],t=this[r(345)]();if(this[r(402)][r(353)][r(337)](),s[r(416)]+e!==t){const n=s[r(321)]+e,o=this[r(330)][r(362)][r(372)](pr.Users),i=this[r(402)][r(375)]({revision:s,from:n,to:t});i.id=s.id;const a=i[r(385)][r(379)]((e=>o[r(393)](e)));s[r(331)]({...i,authors:a},!0),this[r(402)][r(409)](s.id,i,!0)}this[r(402)][r(391)]=t,s[r(416)]===s[r(321)]&&!this[r(402)][r(407)][r(347)](o)&&this[r(402)][r(329)][r(401)][r(400)](o),this[r(402)][r(349)](t)}const{revisions:a,requestId:c}=await this[r(319)][r(374)](t[r(336)],this[r(390)]);i&&a[r(388)]>0?n[r(324)]():(await this[r(413)](a),this[r(340)](a,c),this[r(402)][r(371)]())};return n[e(417)]?r():new Promise(((t,s)=>{const o=e;n[o(365)](o(383),(()=>{const e=o;r()[e(396)](t)[e(343)](s)}))}))}[Tc(361)](){super[Tc(361)]()}async[Tc(363)](){const e=Tc;this[e(319)][e(406)]||await new Promise((t=>{const n=e;this[n(370)](this[n(319)],n(403),(e=>{e[n(423)](),t()}))}))}[Tc(345)](){const e=Tc,t=this[e(330)][e(362)][e(372)](Wa)[e(411)][e(384)]()[e(394)]();for(const n of t)if(e(334)!==n[e(346)]||n[e(351)])return n[e(378)]+1}[Tc(366)](){const e=Tc,t=this[e(330)][e(362)][e(372)](Wa);return new Promise((n=>{const r=e;t[r(380)]?t[r(365)](r(323),(()=>{n(this[r(345)]())})):n(this[r(345)]())}))}[Tc(340)](e,t){const n=Tc,r=this[n(402)][n(329)];this[n(390)]=t;for(const t of e){const e=r[n(332)](t.id);if(e){if((t[n(321)]||t[n(416)])&&(t[n(341)]=null),e===this[n(402)][n(355)]){const r=Math[n(367)](e[n(416)],t[n(416)]),s=Math[n(367)](e[n(321)],t[n(321)]);let o;e[n(416)]===t[n(416)]&&e[n(321)]===t[n(321)]?(o=!0,this[n(428)](t)):t[n(416)]===r&&t[n(321)]===s?o=!1:(e[n(416)]===r&&e[n(321)]===s||this[n(368)]({revision:e,from:s,to:r}),o=!0),o&&(delete t[n(321)],delete t[n(416)],delete t[n(341)],delete t[n(359)],delete t[n(385)])}this[n(402)][n(338)](t),this[n(428)](t)}else this[n(402)][n(408)](t)}const s=r[n(335)]();s[n(394)]();for(let e=0;e<s[n(388)]-1;e++){const t=s[e],r=s[e+1];if(t[n(321)]<r[n(416)]){const e=r[n(416)],s=Math[n(367)](e,t[n(416)]);this[n(368)]({revision:t,from:e,to:s})}}}[Tc(368)]({revision:e,from:t,to:n}={}){const r=Tc,s=this[r(330)][r(362)][r(372)](pr.Users),o=this[r(402)][r(375)]({revision:e,from:t,to:n});o[r(356)]=o[r(385)][r(379)]((e=>s[r(393)](e))),e[r(331)](o)}[Tc(428)](e){const t=Tc,n={};n.id=e.id;for(const r of Object[t(420)](e))"id"!==r&&(n[r]=void 0);this[t(402)][t(409)](n.id,n,!0)}async[Tc(413)](e){const t=Tc,n=this[t(330)][t(362)][t(372)](pr.Users),{connection:r}=this[t(330)][t(362)][t(372)](lr),s=new Set;for(const n of e){for(const e of n[t(385)])i(e);n[t(328)]&&i(n[t(328)])}if(0===s[t(426)])return;const o=await Ye[t(327)](r,Array[t(410)](s));for(const e of o)n[t(393)](e.id)||n[t(387)](e);function i(e){const r=t;n[r(393)](e)||s[r(333)](e)}}}Cc[Tc(382)]=Qt;const Ec=Cc;function jc(e){const t=Tc;return e[t(405)][t(348)](t(377))||e[t(405)][t(348)](t(412))||e[t(405)][t(348)](t(419))}function Rc(e,t){var n=Nc();return(Rc=function(e,t){return n[e-=330]})(e,t)}var Dc=Rc;function Nc(){var e=["1232004bcpRhV","5185bhopDs","44983STRnvd","pluginName","931071CaqDyq","RevisionHistory","404160leqnbB","10WkxBYn","requires","56fZqGFn","6728570jBRkGz","9cvbYHH","998914gGYtPy","RealTimeCollaborativeRevisionHistory"];return(Nc=function(){return e})()}!function(e,t){for(var n=Rc,r=e();;)try{if(174449===-parseInt(n(335))/1*(-parseInt(n(340))/2)+parseInt(n(337))/3+parseInt(n(342))/4*(parseInt(n(334))/5)+parseInt(n(333))/6+parseInt(n(331))/7+-parseInt(n(339))/8+-parseInt(n(330))/9*(parseInt(n(343))/10))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Nc);class xc extends n.Plugin{static get[Dc(341)](){return[Dc(338),Ec,rc]}static get[Dc(336)](){return Dc(332)}}var Vc=Function.prototype,Mc=Object.prototype,Bc=Vc.toString,Uc=Mc.hasOwnProperty,Jc=Bc.call(Object);const qc=function(e){if(!po(e)||"[object Object]"!=gs(e))return!1;var t=pi(e);if(null===t)return!0;var n=Uc.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Bc.call(n)==Jc};const Lc=function(e){return po(e)&&1===e.nodeType&&!qc(e)};function Gc(e,t){const n=Yc();return(Gc=function(e,t){return n[e-=467]})(e,t)}function Yc(){const e=["10370390KpnSwl","CONNECTED_USERS","1460166cgMbcw","bindTemplate","7DOhsVN","1480408vgmfqL","917222BuoLZP","isHidden","384591PRgeMB","ck-presence-list__counter","usersCount","1ZlLWoI","1329550juytae","div","set","setTemplate","ck-presence-list__counter--hidden","8pDpHXt","1635732buqGst"];return(Yc=function(){return e})()}!function(e,t){const n=Gc,r=e();for(;;)try{if(298243===parseInt(n(469))/1*(-parseInt(n(483))/2)+parseInt(n(485))/3+-parseInt(n(475))/4*(parseInt(n(470))/5)+-parseInt(n(479))/6+-parseInt(n(481))/7*(-parseInt(n(482))/8)+parseInt(n(476))/9+parseInt(n(477))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Yc);class Fc extends s.View{constructor(e){const t=Gc;super(e);const n=this[t(480)];this[t(472)](t(468),0),this[t(472)](t(484),!0),this[t(473)]({tag:t(471),attributes:{class:["ck",t(467),n.if(t(484),t(474))]},children:[{text:n.to(t(468),(n=>Tr(e,t(478),n)))}]})}}function Hc(e,t){const n=Kc();return(Hc=function(e,t){return n[e-=158]})(e,t)}!function(e,t){const n=Hc,r=e();for(;;)try{if(701464===-parseInt(n(166))/1*(-parseInt(n(165))/2)+parseInt(n(159))/3+-parseInt(n(158))/4+parseInt(n(173))/5+parseInt(n(161))/6*(-parseInt(n(169))/7)+-parseInt(n(168))/8+parseInt(n(175))/9*(parseInt(n(164))/10))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Kc);class zc extends s.View{constructor(e){const t=Hc;super(e),this[t(160)]=this[t(174)]();const n=this[t(171)];this[t(162)]({tag:t(172),attributes:{class:["ck",t(163)]},children:this[t(160)],on:{click:n.to((()=>this[t(167)](t(170))))}})}}function Kc(){const e=["9rXmNyp","4808176VvMLYo","3450264iEcylC","items","620742mKntXN","setTemplate","ck-presence-list__list","6440330BGEwiz","1971278YmPvhe","1SabLRd","fire","7797848PqfxtM","14YUlYgK","execute","bindTemplate","div","1526965puivSO","createCollection"];return(Kc=function(){return e})()}var Wc=__webpack_require__(106),$c={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};br()(Wc.A,$c);Wc.A.locals;function Qc(e,t){const n=Xc();return(Qc=function(e,t){return n[e-=108]})(e,t)}function Xc(){const e=["3208EmCygk","listenTo","counterView","change","47140uDuihF","div","bindTemplate","150bfnWeQ","1374909LCuELX","inlineListView","1002226bNPttH","1781864MFYxML","locale","12VgJOwq","1iteKlN","first","tooltipPosition","ck-rounded-corners","3199qnpHbr","isCollapsed","ck-presence-list","1165446fYglcH","ck-reset","items","ck-presence-list--collapsed","17363577pDBeFB","10gvYexH","setTemplate","set"];return(Xc=function(){return e})()}!function(e,t){const n=Qc,r=e();for(;;)try{if(250676===-parseInt(n(128))/1*(parseInt(n(124))/2)+-parseInt(n(122))/3+-parseInt(n(125))/4+-parseInt(n(118))/5*(parseInt(n(121))/6)+parseInt(n(132))/7*(parseInt(n(114))/8)+parseInt(n(135))/9*(parseInt(n(111))/10)+parseInt(n(110))/11*(parseInt(n(127))/12))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(Xc);class Zc extends s.View{constructor(e){const t=Qc;super(e);const n=this[t(120)];this[t(113)](t(133),!0),this[t(116)]=new Fc(this[t(126)]),this[t(123)]=new zc(e),this[t(115)](this[t(123)][t(108)],t(117),(()=>{const e=t;for(const t of this[e(123)][e(108)])t[e(130)]="s";this[e(123)][e(108)][e(129)]&&(this[e(123)][e(108)][e(129)][e(130)]="se")})),this[t(112)]({tag:t(119),attributes:{class:["ck",t(134),t(136),t(131),n.if(t(133),t(109))]},children:[this[t(116)],this[t(123)]]})}}function ed(){var e=["createCollection","ck-presence-list__dropdown-list","3auLLVA","ck-presence-list__dropdown-list-wrapper","setTemplate","168860FRsvlM","2934736OmlzCV","54857iGZTSY","5BKvWrs","1379277QBeEGg","260rpDIlu","36470GyvTIb","701197LeZTyF","264Hseeif","37806erQoyO","items","div"];return(ed=function(){return e})()}function td(e,t){var n=ed();return(td=function(e,t){return n[e-=286]})(e,t)}!function(e,t){for(var n=td,r=e();;)try{if(200450===parseInt(n(299))/1*(-parseInt(n(288))/2)+parseInt(n(293))/3*(-parseInt(n(296))/4)+-parseInt(n(302))/5*(-parseInt(n(287))/6)+parseInt(n(286))/7+-parseInt(n(297))/8+parseInt(n(300))/9+-parseInt(n(301))/10*(-parseInt(n(298))/11))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(ed);class nd extends s.View{constructor(e){var t=td;super(e),this[t(289)]=this[t(291)](),this[t(295)]({tag:t(290),attributes:{class:["ck",t(292)]},children:[{tag:t(290),attributes:{class:["ck",t(294)]},children:this[t(289)]}]})}}function rd(e,t){const n=sd();return(rd=function(e,t){return n[e-=226]})(e,t)}function sd(){const e=["12keGcVC","color","1031845iDEnxz","userView","1408kksyUD","name","fire","button","163379xLXtKn","setTemplate","6crVZvu","bindTemplate","ck-presence-list__marker","ck-user__full-name","153820PXRjUU","15CSdqam","ck-presence-list__dropdown-list-item","13060HxUJJS","274806sMebbv","div","614649UdnXAn","2598635MVFPJJ","getBackgroundColorClass","2ZwTBHf","execute","span","32Sucxbq","tag","true"];return(sd=function(){return e})()}!function(e,t){const n=rd,r=e();for(;;)try{if(110417===-parseInt(n(231))/1*(-parseInt(n(246))/2)+parseInt(n(238))/3*(-parseInt(n(237))/4)+parseInt(n(254))/5+parseInt(n(233))/6*(parseInt(n(243))/7)+-parseInt(n(249))/8*(parseInt(n(241))/9)+-parseInt(n(240))/10*(-parseInt(n(227))/11)+parseInt(n(252))/12*(-parseInt(n(244))/13))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(sd);class od extends s.View{constructor(e,t,n){const r=rd;super(e);const s=this[r(234)];this[r(226)]=new pr.UserView(e,t);const o={tag:r(242),attributes:{class:["ck",r(239)]},children:[this[r(226)],{tag:r(248),attributes:{class:["ck",r(236)]},children:[{text:t[r(228)]}]},{tag:r(248),attributes:{class:["ck",r(235),t[r(253)][r(245)]()],"aria-hidden":r(251)}}]};n&&(o[r(250)]=r(230),o.on={click:s.to((()=>this[r(229)](r(247))))}),this[r(232)](o)}}function id(e,t){const n=ad();return(id=function(e,t){return n[e-=453]})(e,t)}function ad(){const e=["hasTooltip","execute","ck-presence-list__list-item","setTemplate","3dqxNUG","1497366tJWqfF","markerView","tag","ck-presence-list__marker","1842075SoAvOV","796396YeasNM","tooltipPosition","fire","683164EHoMCD","1853998BTwmbw","span","164912GewdjX","true","set","div","2514015kvukSh","name","button","color","getBackgroundColorClass","ck-presence-list__list-item__tooltip","userView","bindTemplate"];return(ad=function(){return e})()}!function(e,t){const n=id,r=e();for(;;)try{if(662611===-parseInt(n(470))/1+-parseInt(n(471))/2*(-parseInt(n(461))/3)+parseInt(n(467))/4+-parseInt(n(466))/5+parseInt(n(462))/6+parseInt(n(477))/7+-parseInt(n(473))/8)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(ad);class cd extends s.View{constructor(e,t,n){const r=id;super(e);const s=this[r(456)];this[r(475)](r(457),!0),this[r(475)](r(468),""),this[r(455)]=new pr.UserView(e,t),this[r(463)]=new dd(e,t);const o={tag:r(476),attributes:{class:["ck",r(459)],"data-cke-tooltip-text":this[r(455)][r(478)],"data-cke-tooltip-position":s.to(r(468)),"data-cke-tooltip-disabled":s.to(r(457),(e=>!e)),"data-cke-tooltip-class":r(454)},children:[this[r(455)],this[r(463)]]};n&&(o[r(464)]=r(479),o.on={click:s.to((()=>this[r(469)](r(458))))}),this[r(460)](o)}}class dd extends s.View{constructor(e,t){const n=id;super(e),this[n(460)]({tag:n(472),attributes:{class:["ck",n(465),t[n(480)][n(453)]()],"aria-hidden":n(474)}})}}function ud(e,t){const n=pd();return(ud=function(e,t){return n[e-=304]})(e,t)}const ld=ud;function pd(){const e=["bind","reverse","708256WOrPTa","length","36mKxmEZ","isVisible","currentDisplayedUsers","2303826jXitGJ","add","locale","content","onClick","class","using","hasTooltip","listenTo","550010ZmBRXk","set","presenceList.container","_handleUserAdd","remove","appendChild","get","render","attachToDom","bindTo","_handleUserRemove","context","define","presenceList","1727940EEppMK","init","_bodyCollection","allConnectedUsers","pin","requires","314728WdBdse","_createView","isHidden","isRendered","2LoCayy","isCollapsed","presencelist-missing-container","view","from","usersCount","showDropdown","5vlQUUJ","displayMe","993483QbSuxP","inlineListView","14QdVLIN","plugins","presenceList.displayMe","presenceDropdownView","ck ck-presence-list__balloon","execute","items","presenceList.collapseAt","_allConnectedUsers","config","counterView","last","detachFromDom","unpin","isMe","destroy","hideDropdown","10171700GTsSly","number","_calculateNewUserPosition","presencelist-collapseat-invalid-format","balloonPanelView","element"];return(pd=function(){return e})()}!function(e,t){const n=ud,r=e();for(;;)try{if(386149===-parseInt(n(349))/1+-parseInt(n(373))/2*(-parseInt(n(308))/3)+parseInt(n(369))/4*(-parseInt(n(306))/5)+parseInt(n(340))/6*(-parseInt(n(310))/7)+-parseInt(n(335))/8*(-parseInt(n(337))/9)+parseInt(n(363))/10+parseInt(n(327))/11)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(pd);const hd={collapseAt:6,displayMe:!0};class fd extends n.ContextPlugin{constructor(e){const t=ud;super(e),this[t(360)][t(319)][t(361)](t(362),hd);const n=e[t(319)][t(355)](t(317));if(t(328)!=typeof n)throw new r.CKEditorError(t(330),this);if(n<1)throw new r.CKEditorError(t(330),this);this[t(318)]=this[t(360)][t(311)][t(355)](yr)[t(366)],this[t(350)](t(304),0),this[t(339)]=new r.Collection,this[t(331)]=new s.BalloonPanelView,this[t(331)][t(345)]=t(314),this[t(376)]=this[t(370)](),this[t(313)]=void 0}static get[ld(368)](){return[yr]}[ld(364)](){const e=ld;for(const t of this[e(318)])this[e(352)](t);this[e(348)](this[e(318)],e(341),((t,n)=>{this[e(352)](n)})),this[e(348)](this[e(318)],e(353),((t,n)=>{this[e(359)](n)}))}[ld(370)](){const e=ld,t=this[e(360)],n=new Zc(this[e(360)][e(342)]),o=this[e(331)];if(!Lc(t[e(319)][e(355)](e(351))))throw new r.CKEditorError(e(375),this);return n[e(320)][e(333)](e(304)).to(this),n[e(333)](e(374)).to(this,e(304),(r=>{const s=e,{collapseAt:o,displayMe:i}=t[s(319)][s(355)](s(362)),a=r>=o;return n[s(320)][s(371)]=!(1==r&&i||a),a||this[s(326)](),a})),n[e(309)][e(316)][e(358)](this[e(339)])[e(346)]((r=>{const s=e,o=t[s(319)][s(355)](s(362)),i=new cd(t[s(342)],r,!!o[s(344)]);return i[s(333)](s(347)).to(n,s(374),(e=>!e)),o[s(344)]&&this[s(348)](i,s(315),(()=>{const e=s;this[e(376)][e(374)]||o[e(344)](r,i[e(332)])})),i})),this[e(348)](n[e(309)],e(315),(()=>{const t=e;this[t(313)]?this[t(326)]():this[t(376)][t(374)]&&this[t(305)]()})),n[e(356)](),o[e(356)](),(0,s.clickOutsideHandler)({emitter:n,activator:()=>o[e(338)],contextElements:[o[e(332)],n[e(309)][e(332)]],callback:()=>this[e(326)]()}),t[e(319)][e(355)](e(351))[e(354)](n[e(332)]),this[e(365)]=new s.BodyCollection(this[e(360)][e(342)]),this[e(365)][e(357)](),this[e(365)][e(341)](o),n}[ld(352)](e){const t=ld;if(!this[t(360)][t(319)][t(355)](t(312))&&e[t(324)])return;const n=this[t(360)][t(319)][t(355)](t(317))-1;this[t(304)]++,this[t(339)][t(336)]==n&&this[t(339)][t(353)](0);const r=this[t(329)](e);this[t(339)][t(341)](e,r)}[ld(359)](e){const t=ld;if(this[t(304)]--,this[t(339)][t(355)](e.id)&&(this[t(339)][t(353)](e.id),this[t(339)][t(336)]<this[t(304)]))for(const e of Array[t(377)](this[t(318)])[t(334)]())if(!this[t(339)][t(355)](e.id))return void this[t(339)][t(341)](e,0)}[ld(329)](e){const t=ld;return Boolean(this[t(339)][t(321)]&&this[t(339)][t(321)][t(324)])&&!e[t(324)]?this[t(339)][t(336)]-1:this[t(339)][t(336)]}[ld(305)](){const e=ld;if(this[e(313)])return;this[e(313)]=new nd(this[e(360)][e(342)]);const t=this[e(360)][e(319)][e(355)](e(362));this[e(313)][e(316)][e(358)](this[e(318)])[e(346)]((n=>{const r=e;if(!t[r(307)]&&n[r(324)])return null;const s=new od(this[r(360)][r(342)],n,!!t[r(344)]);return t[r(344)]&&this[r(348)](s,r(315),(()=>{const e=r;t[e(344)](n,s[e(332)])})),s})),this[e(331)][e(343)][e(341)](this[e(313)]),this[e(331)][e(367)]({target:this[e(376)][e(309)][e(332)]})}[ld(326)](){const e=ld;this[e(313)]&&(this[e(331)][e(323)](),this[e(331)][e(343)][e(353)](this[e(313)]),this[e(313)][e(325)](),this[e(313)]=void 0)}[ld(325)](){const e=ld;super[e(325)](),this[e(376)]&&this[e(376)][e(372)]&&this[e(376)][e(325)](),this[e(365)]&&this[e(365)][e(322)]()}}var md=yd;function yd(e,t){var n=gd();return(yd=function(e,t){return n[e-=220]})(e,t)}function gd(){var e=["15821949PLRdtN","8165010TicyGe","PresenceList","2056845FTGxgA","pluginName","348723pZQIfz","41424HuldWL","requires","1314OhurKw","415EvvCuK","257612rCxYUo","30928moUmJJ","10ENnIxq","6OyZhTQ"];return(gd=function(){return e})()}!function(e,t){for(var n=yd,r=e();;)try{if(594247===-parseInt(n(231))/1+-parseInt(n(222))/2+parseInt(n(229))/3+parseInt(n(223))/4*(-parseInt(n(221))/5)+parseInt(n(225))/6*(-parseInt(n(227))/7)+-parseInt(n(232))/8*(-parseInt(n(220))/9)+-parseInt(n(224))/10*(-parseInt(n(226))/11))break;r.push(r.shift())}catch(e){r.push(r.shift())}}(gd);class bd extends n.ContextPlugin{static get[md(233)](){return[yr,fd]}static get[md(230)](){return md(228)}}function Od(e,t){var n=wd();return(Od=function(e,t){return n[e-=432]})(e,t)}function wd(){var e=["484407wqMJhb","2mYmJSA","4061619LXROfm","106187xfuVIP","39iciDZU","143876IDUdDv","1612616LXgjmA","4905DHxgEd","2244TrLQjv","2672710TcqmRq"];return(wd=function(){return e})()}!function(e,t){for(var n=Od,r=e();;)try{if(273506===-parseInt(n(434))/1*(parseInt(n(432))/2)+-parseInt(n(435))/3*(-parseInt(n(436))/4)+parseInt(n(438))/5*(parseInt(n(439))/6)+-parseInt(n(441))/7+-parseInt(n(437))/8+-parseInt(n(433))/9+parseInt(n(440))/10)break;r.push(r.shift())}catch(e){r.push(r.shift())}}(wd)})(),(window.CKEditor5=window.CKEditor5||{}).realTimeCollaboration=__webpack_exports__})();